Rocky_Mountain_Vending/.pnpm-store/v10/files/d7/75e41f425189993931feacf70cf9eb7aa178bd237d91c069e6445397e3832d4ea1cd2b6a76b8c188e356804beb1f8606e0445ae7edfbde4301c16b56b5107f
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

1 line
No EOL
81 KiB
Text

{"version":3,"sources":["../../src/server/render.tsx"],"sourcesContent":["/* eslint-disable @next/internal/no-ambiguous-jsx -- Pages router doesn't use react-server */\nimport type { IncomingMessage, ServerResponse } from 'http'\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { ReactDOMServerReadableStream } from 'react-dom/server'\nimport type { NextRouter } from '../shared/lib/router/router'\nimport type { HtmlProps } from '../shared/lib/html-context.shared-runtime'\nimport type { DomainLocale } from './config'\nimport type {\n AppType,\n DocumentInitialProps,\n DocumentType,\n DocumentProps,\n DocumentContext,\n NextComponentType,\n RenderPage,\n RenderPageResult,\n} from '../shared/lib/utils'\nimport type { ImageConfigComplete } from '../shared/lib/image-config'\nimport type { Redirect } from '../lib/load-custom-routes'\nimport {\n type NextApiRequestCookies,\n type __ApiPreviewProps,\n setLazyProp,\n} from './api-utils'\nimport { getCookieParser } from './api-utils/get-cookie-parser'\nimport type { LoadComponentsReturnType } from './load-components'\nimport type {\n GetServerSideProps,\n GetStaticProps,\n PreviewData,\n ServerRuntime,\n SizeLimit,\n} from '../types'\nimport type { UnwrapPromise } from '../lib/coalesced-function'\nimport type { ClientReferenceManifest } from '../build/webpack/plugins/flight-manifest-plugin'\nimport type { NextFontManifest } from '../build/webpack/plugins/next-font-manifest-plugin'\nimport type { PagesModule } from './route-modules/pages/module'\nimport type { ComponentsEnhancer } from '../shared/lib/utils'\nimport type { NextParsedUrlQuery } from './request-meta'\nimport type { Revalidate } from './lib/cache-control'\nimport type { COMPILER_NAMES } from '../shared/lib/constants'\n\nimport React, { type JSX } from 'react'\nimport ReactDOMServerPages from 'next/dist/server/ReactDOMServerPages'\nimport { StyleRegistry, createStyleRegistry } from 'styled-jsx'\nimport {\n GSP_NO_RETURNED_VALUE,\n GSSP_COMPONENT_MEMBER_ERROR,\n GSSP_NO_RETURNED_VALUE,\n STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR,\n SERVER_PROPS_GET_INIT_PROPS_CONFLICT,\n SERVER_PROPS_SSG_CONFLICT,\n SSG_GET_INITIAL_PROPS_CONFLICT,\n UNSTABLE_REVALIDATE_RENAME_ERROR,\n HTML_CONTENT_TYPE_HEADER,\n JSON_CONTENT_TYPE_HEADER,\n} from '../lib/constants'\nimport {\n NEXT_BUILTIN_DOCUMENT,\n SERVER_PROPS_ID,\n STATIC_PROPS_ID,\n STATIC_STATUS_PAGES,\n} from '../shared/lib/constants'\nimport { isSerializableProps } from '../lib/is-serializable-props'\nimport { defaultHead } from '../shared/lib/head'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport Loadable from '../shared/lib/loadable.shared-runtime'\nimport { LoadableContext } from '../shared/lib/loadable-context.shared-runtime'\nimport { RouterContext } from '../shared/lib/router-context.shared-runtime'\nimport { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'\nimport {\n getDisplayName,\n isResSent,\n loadGetInitialProps,\n} from '../shared/lib/utils'\nimport { HtmlContext } from '../shared/lib/html-context.shared-runtime'\nimport { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'\nimport { denormalizePagePath } from '../shared/lib/page-path/denormalize-page-path'\nimport { getRequestMeta } from './request-meta'\nimport { allowedStatusCodes, getRedirectStatus } from '../lib/redirect-status'\nimport RenderResult, { type PagesRenderResultMetadata } from './render-result'\nimport isError from '../lib/is-error'\nimport {\n streamToString,\n renderToInitialFizzStream,\n} from './stream-utils/node-web-streams-helper'\nimport { ImageConfigContext } from '../shared/lib/image-config-context.shared-runtime'\nimport stripAnsi from 'next/dist/compiled/strip-ansi'\nimport { stripInternalQueries } from './internal-utils'\nimport {\n adaptForAppRouterInstance,\n adaptForPathParams,\n adaptForSearchParams,\n PathnameContextProviderAdapter,\n} from '../shared/lib/router/adapters'\nimport { AppRouterContext } from '../shared/lib/app-router-context.shared-runtime'\nimport {\n SearchParamsContext,\n PathParamsContext,\n} from '../shared/lib/hooks-client-context.shared-runtime'\nimport { getTracer } from './lib/trace/tracer'\nimport { RenderSpan } from './lib/trace/constants'\nimport { ReflectAdapter } from './web/spec-extension/adapters/reflect'\nimport { getCacheControlHeader } from './lib/cache-control'\nimport { getErrorSource } from '../shared/lib/error-source'\nimport type { DeepReadonly } from '../shared/lib/deep-readonly'\nimport type { PagesDevOverlayBridgeType } from '../next-devtools/userspace/pages/pages-dev-overlay-setup'\nimport { getScriptNonceFromHeader } from './app-render/get-script-nonce-from-header'\n\nlet tryGetPreviewData: typeof import('./api-utils/node/try-get-preview-data').tryGetPreviewData\nlet warn: typeof import('../build/output/log').warn\nlet postProcessHTML: typeof import('./post-process').postProcessHTML\n\nconst DOCTYPE = '<!DOCTYPE html>'\n\nif (process.env.NEXT_RUNTIME !== 'edge') {\n tryGetPreviewData = (\n require('./api-utils/node/try-get-preview-data') as typeof import('./api-utils/node/try-get-preview-data')\n ).tryGetPreviewData\n warn = (\n require('../build/output/log') as typeof import('../build/output/log')\n ).warn\n postProcessHTML = (\n require('./post-process') as typeof import('./post-process')\n ).postProcessHTML\n} else {\n warn = console.warn.bind(console)\n postProcessHTML = async (html: string) => html\n}\n\nfunction noRouter() {\n const message =\n 'No router instance found. you should only use \"next/router\" inside the client side of your app. https://nextjs.org/docs/messages/no-router-instance'\n throw new Error(message)\n}\n\nasync function renderToString(element: React.ReactElement) {\n const renderStream = await ReactDOMServerPages.renderToReadableStream(element)\n await renderStream.allReady\n return streamToString(renderStream)\n}\n\nclass ServerRouter implements NextRouter {\n route: string\n pathname: string\n query: ParsedUrlQuery\n asPath: string\n basePath: string\n events: any\n isFallback: boolean\n locale?: string\n isReady: boolean\n locales?: readonly string[]\n defaultLocale?: string\n domainLocales?: readonly DomainLocale[]\n isPreview: boolean\n isLocaleDomain: boolean\n\n constructor(\n pathname: string,\n query: ParsedUrlQuery,\n as: string,\n { isFallback }: { isFallback: boolean },\n isReady: boolean,\n basePath: string,\n locale?: string,\n locales?: readonly string[],\n defaultLocale?: string,\n domainLocales?: readonly DomainLocale[],\n isPreview?: boolean,\n isLocaleDomain?: boolean\n ) {\n this.route = pathname.replace(/\\/$/, '') || '/'\n this.pathname = pathname\n this.query = query\n this.asPath = as\n this.isFallback = isFallback\n this.basePath = basePath\n this.locale = locale\n this.locales = locales\n this.defaultLocale = defaultLocale\n this.isReady = isReady\n this.domainLocales = domainLocales\n this.isPreview = !!isPreview\n this.isLocaleDomain = !!isLocaleDomain\n }\n\n push(): any {\n noRouter()\n }\n replace(): any {\n noRouter()\n }\n reload() {\n noRouter()\n }\n back() {\n noRouter()\n }\n forward(): void {\n noRouter()\n }\n prefetch(): any {\n noRouter()\n }\n beforePopState() {\n noRouter()\n }\n}\n\nfunction enhanceComponents(\n options: ComponentsEnhancer,\n App: AppType,\n Component: NextComponentType\n): {\n App: AppType\n Component: NextComponentType\n} {\n // For backwards compatibility\n if (typeof options === 'function') {\n return {\n App,\n Component: options(Component),\n }\n }\n\n return {\n App: options.enhanceApp ? options.enhanceApp(App) : App,\n Component: options.enhanceComponent\n ? options.enhanceComponent(Component)\n : Component,\n }\n}\n\nfunction renderPageTree(\n App: AppType,\n Component: NextComponentType,\n props: any\n) {\n return <App Component={Component} {...props} />\n}\n\nexport type RenderOptsPartial = {\n assetPrefix?: string\n err?: Error | null\n nextExport?: boolean\n dev?: boolean\n ErrorDebug?: PagesDevOverlayBridgeType\n isNextDataRequest?: boolean\n params?: ParsedUrlQuery\n previewProps: __ApiPreviewProps | undefined\n basePath: string\n unstable_runtimeJS?: false\n unstable_JsPreload?: false\n optimizeCss: any\n nextConfigOutput?: 'standalone' | 'export'\n nextScriptWorkers: any\n assetQueryString?: string\n resolvedUrl?: string\n resolvedAsPath?: string\n setIsrStatus?: (key: string, value: boolean | undefined) => void\n clientReferenceManifest?: DeepReadonly<ClientReferenceManifest>\n nextFontManifest?: DeepReadonly<NextFontManifest>\n distDir?: string\n locale?: string\n locales?: readonly string[]\n defaultLocale?: string\n domainLocales?: readonly DomainLocale[]\n disableOptimizedLoading?: boolean\n supportsDynamicResponse: boolean\n botType?: 'dom' | 'html' | undefined\n serveStreamingMetadata?: boolean\n runtime?: ServerRuntime\n serverComponents?: boolean\n serverActions?: {\n bodySizeLimit?: SizeLimit\n allowedOrigins?: string[]\n }\n crossOrigin?: 'anonymous' | 'use-credentials' | '' | undefined\n images: ImageConfigComplete\n largePageDataBytes?: number\n isOnDemandRevalidate?: boolean\n isPossibleServerAction?: boolean\n isExperimentalCompile?: boolean\n isPrefetch?: boolean\n isBot?: boolean\n expireTime?: number\n experimental: {\n clientTraceMetadata?: string[]\n }\n}\n\nexport type RenderOpts = LoadComponentsReturnType<PagesModule> &\n RenderOptsPartial\n\n/**\n * Shared context used for all page renders.\n */\nexport type PagesSharedContext = {\n /**\n * Used to facilitate caching of page bundles, we send it to the client so\n * that pageloader knows where to load bundles.\n */\n buildId: string\n\n /**\n * The deployment ID if the user is deploying to a platform that provides one.\n */\n deploymentId: string | undefined\n\n /**\n * True if the user is using a custom server.\n */\n customServer: true | undefined\n}\n\n/**\n * The context for the given request.\n */\nexport type PagesRenderContext = {\n /**\n * Whether this should be rendered as a fallback page.\n */\n isFallback: boolean\n\n /**\n * Whether this is in draft mode.\n */\n isDraftMode: boolean | undefined\n\n /**\n * In development, the original source page that returned a 404.\n */\n developmentNotFoundSourcePage: string | undefined\n}\n\n/**\n * RenderOptsExtra is being used to split away functionality that's within the\n * renderOpts. Eventually we can have more explicit render options for each\n * route kind.\n */\nexport type RenderOptsExtra = {\n App: AppType\n Document: DocumentType\n}\n\nconst invalidKeysMsg = (\n methodName: 'getServerSideProps' | 'getStaticProps',\n invalidKeys: string[]\n) => {\n const docsPathname = `invalid-${methodName.toLocaleLowerCase()}-value`\n\n return (\n `Additional keys were returned from \\`${methodName}\\`. Properties intended for your component must be nested under the \\`props\\` key, e.g.:` +\n `\\n\\n\\treturn { props: { title: 'My Title', content: '...' } }` +\n `\\n\\nKeys that need to be moved: ${invalidKeys.join(', ')}.` +\n `\\nRead more: https://nextjs.org/docs/messages/${docsPathname}`\n )\n}\n\nfunction checkRedirectValues(\n redirect: Redirect,\n req: IncomingMessage,\n method: 'getStaticProps' | 'getServerSideProps'\n) {\n const { destination, permanent, statusCode, basePath } = redirect\n let errors: string[] = []\n\n const hasStatusCode = typeof statusCode !== 'undefined'\n const hasPermanent = typeof permanent !== 'undefined'\n\n if (hasPermanent && hasStatusCode) {\n errors.push(`\\`permanent\\` and \\`statusCode\\` can not both be provided`)\n } else if (hasPermanent && typeof permanent !== 'boolean') {\n errors.push(`\\`permanent\\` must be \\`true\\` or \\`false\\``)\n } else if (hasStatusCode && !allowedStatusCodes.has(statusCode!)) {\n errors.push(\n `\\`statusCode\\` must undefined or one of ${[...allowedStatusCodes].join(\n ', '\n )}`\n )\n }\n const destinationType = typeof destination\n\n if (destinationType !== 'string') {\n errors.push(\n `\\`destination\\` should be string but received ${destinationType}`\n )\n }\n\n const basePathType = typeof basePath\n\n if (basePathType !== 'undefined' && basePathType !== 'boolean') {\n errors.push(\n `\\`basePath\\` should be undefined or a false, received ${basePathType}`\n )\n }\n\n if (errors.length > 0) {\n throw new Error(\n `Invalid redirect object returned from ${method} for ${req.url}\\n` +\n errors.join(' and ') +\n '\\n' +\n `See more info here: https://nextjs.org/docs/messages/invalid-redirect-gssp`\n )\n }\n}\n\nexport function errorToJSON(err: Error) {\n let source: typeof COMPILER_NAMES.server | typeof COMPILER_NAMES.edgeServer =\n 'server'\n\n if (process.env.NEXT_RUNTIME !== 'edge') {\n source = getErrorSource(err) || 'server'\n }\n\n return {\n name: err.name,\n source,\n message: stripAnsi(err.message),\n stack: err.stack,\n digest: (err as any).digest,\n }\n}\n\nfunction serializeError(\n dev: boolean | undefined,\n err: Error\n): Error & {\n statusCode?: number\n source?: typeof COMPILER_NAMES.server | typeof COMPILER_NAMES.edgeServer\n} {\n if (dev) {\n return errorToJSON(err)\n }\n\n return {\n name: 'Internal Server Error.',\n message: '500 - Internal Server Error.',\n statusCode: 500,\n }\n}\n\nexport async function renderToHTMLImpl(\n req: IncomingMessage,\n res: ServerResponse,\n pathname: string,\n query: NextParsedUrlQuery,\n renderOpts: Omit<RenderOpts, keyof RenderOptsExtra>,\n extra: RenderOptsExtra,\n sharedContext: PagesSharedContext,\n renderContext: PagesRenderContext\n): Promise<RenderResult> {\n // Adds support for reading `cookies` in `getServerSideProps` when SSR.\n setLazyProp({ req: req as any }, 'cookies', getCookieParser(req.headers))\n\n const metadata: PagesRenderResultMetadata = {}\n\n metadata.assetQueryString =\n (renderOpts.dev && renderOpts.assetQueryString) || ''\n\n if (renderOpts.dev && !metadata.assetQueryString) {\n const userAgent = (req.headers['user-agent'] || '').toLowerCase()\n if (userAgent.includes('safari') && !userAgent.includes('chrome')) {\n // In dev we invalidate the cache by appending a timestamp to the resource URL.\n // This is a workaround to fix https://github.com/vercel/next.js/issues/5860\n // TODO: remove this workaround when https://bugs.webkit.org/show_bug.cgi?id=187726 is fixed.\n // Note: The workaround breaks breakpoints on reload since the script url always changes,\n // so we only apply it to Safari.\n metadata.assetQueryString = `?ts=${Date.now()}`\n }\n }\n\n // if deploymentId is provided we append it to all asset requests\n if (sharedContext.deploymentId) {\n metadata.assetQueryString += `${metadata.assetQueryString ? '&' : '?'}dpl=${\n sharedContext.deploymentId\n }`\n }\n\n // don't modify original query object\n query = Object.assign({}, query)\n\n const {\n err,\n dev = false,\n pageConfig = {},\n buildManifest,\n reactLoadableManifest,\n ErrorDebug,\n getStaticProps,\n getStaticPaths,\n getServerSideProps,\n isNextDataRequest,\n params,\n previewProps,\n basePath,\n images,\n runtime: globalRuntime,\n isExperimentalCompile,\n expireTime,\n } = renderOpts\n const { App } = extra\n\n const assetQueryString = metadata.assetQueryString\n\n let Document = extra.Document\n\n let Component: React.ComponentType<{}> | ((props: any) => JSX.Element) =\n renderOpts.Component\n const OriginComponent = Component\n\n const isFallback = renderContext.isFallback ?? false\n const notFoundSrcPage = renderContext.developmentNotFoundSourcePage\n\n // next internal queries should be stripped out\n stripInternalQueries(query)\n\n const isSSG = !!getStaticProps\n const isBuildTimeSSG = isSSG && renderOpts.nextExport\n const defaultAppGetInitialProps =\n App.getInitialProps === (App as any).origGetInitialProps\n\n const hasPageGetInitialProps = !!(Component as any)?.getInitialProps\n const hasPageScripts = (Component as any)?.unstable_scriptLoader\n\n const pageIsDynamic = isDynamicRoute(pathname)\n\n const defaultErrorGetInitialProps =\n pathname === '/_error' &&\n (Component as any).getInitialProps ===\n (Component as any).origGetInitialProps\n\n if (\n renderOpts.nextExport &&\n hasPageGetInitialProps &&\n !defaultErrorGetInitialProps\n ) {\n warn(\n `Detected getInitialProps on page '${pathname}'` +\n ` while running export. It's recommended to use getStaticProps` +\n ` which has a more correct behavior for static exporting.` +\n `\\nRead more: https://nextjs.org/docs/messages/get-initial-props-export`\n )\n }\n\n let isAutoExport =\n !hasPageGetInitialProps &&\n defaultAppGetInitialProps &&\n !isSSG &&\n !getServerSideProps\n\n // if we are running from experimental compile and the page\n // would normally be automatically statically optimized\n // ensure we set cache header so it's not rendered on-demand\n // every request\n if (isAutoExport && !dev && isExperimentalCompile) {\n res.setHeader(\n 'Cache-Control',\n getCacheControlHeader({ revalidate: false, expire: expireTime })\n )\n isAutoExport = false\n }\n\n if (hasPageGetInitialProps && isSSG) {\n throw new Error(SSG_GET_INITIAL_PROPS_CONFLICT + ` ${pathname}`)\n }\n\n if (hasPageGetInitialProps && getServerSideProps) {\n throw new Error(SERVER_PROPS_GET_INIT_PROPS_CONFLICT + ` ${pathname}`)\n }\n\n if (getServerSideProps && isSSG) {\n throw new Error(SERVER_PROPS_SSG_CONFLICT + ` ${pathname}`)\n }\n\n if (getServerSideProps && renderOpts.nextConfigOutput === 'export') {\n throw new Error(\n 'getServerSideProps cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'\n )\n }\n\n if (getStaticPaths && !pageIsDynamic) {\n throw new Error(\n `getStaticPaths is only allowed for dynamic SSG pages and was found on '${pathname}'.` +\n `\\nRead more: https://nextjs.org/docs/messages/non-dynamic-getstaticpaths-usage`\n )\n }\n\n if (!!getStaticPaths && !isSSG) {\n throw new Error(\n `getStaticPaths was added without a getStaticProps in ${pathname}. Without getStaticProps, getStaticPaths does nothing`\n )\n }\n\n if (isSSG && pageIsDynamic && !getStaticPaths) {\n throw new Error(\n `getStaticPaths is required for dynamic SSG pages and is missing for '${pathname}'.` +\n `\\nRead more: https://nextjs.org/docs/messages/invalid-getstaticpaths-value`\n )\n }\n\n let asPath: string = renderOpts.resolvedAsPath || (req.url as string)\n\n if (dev) {\n const { isValidElementType } =\n require('next/dist/compiled/react-is') as typeof import('next/dist/compiled/react-is')\n if (!isValidElementType(Component)) {\n throw new Error(\n `The default export is not a React Component in page: \"${pathname}\"`\n )\n }\n\n if (!isValidElementType(App)) {\n throw new Error(\n `The default export is not a React Component in page: \"/_app\"`\n )\n }\n\n if (!isValidElementType(Document)) {\n throw new Error(\n `The default export is not a React Component in page: \"/_document\"`\n )\n }\n\n if (isAutoExport || isFallback) {\n // remove query values except ones that will be set during export\n query = {}\n asPath = `${pathname}${\n // ensure trailing slash is present for non-dynamic auto-export pages\n req.url!.endsWith('/') && pathname !== '/' && !pageIsDynamic ? '/' : ''\n }`\n req.url = pathname\n }\n\n if (pathname === '/404' && (hasPageGetInitialProps || getServerSideProps)) {\n throw new Error(\n `\\`pages/404\\` ${STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR}`\n )\n }\n if (\n STATIC_STATUS_PAGES.includes(pathname) &&\n (hasPageGetInitialProps || getServerSideProps)\n ) {\n throw new Error(\n `\\`pages${pathname}\\` ${STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR}`\n )\n }\n\n if (renderOpts?.setIsrStatus) {\n renderOpts.setIsrStatus(asPath, isSSG || isAutoExport)\n }\n }\n\n for (const methodName of [\n 'getStaticProps',\n 'getServerSideProps',\n 'getStaticPaths',\n ]) {\n if ((Component as any)?.[methodName]) {\n throw new Error(\n `page ${pathname} ${methodName} ${GSSP_COMPONENT_MEMBER_ERROR}`\n )\n }\n }\n\n await Loadable.preloadAll() // Make sure all dynamic imports are loaded\n\n let isPreview: boolean | undefined = undefined\n let previewData: PreviewData\n\n if (\n (isSSG || getServerSideProps) &&\n !isFallback &&\n process.env.NEXT_RUNTIME !== 'edge' &&\n previewProps\n ) {\n // Reads of this are cached on the `req` object, so this should resolve\n // instantly. There's no need to pass this data down from a previous\n // invoke.\n previewData = tryGetPreviewData(\n req,\n res,\n previewProps,\n !!renderOpts.multiZoneDraftMode\n )\n isPreview = previewData !== false\n }\n\n // url will always be set\n const routerIsReady = !!(\n getServerSideProps ||\n hasPageGetInitialProps ||\n (!defaultAppGetInitialProps && !isSSG) ||\n isExperimentalCompile\n )\n const router = new ServerRouter(\n pathname,\n query,\n asPath,\n {\n isFallback: isFallback,\n },\n routerIsReady,\n basePath,\n renderOpts.locale,\n renderOpts.locales,\n renderOpts.defaultLocale,\n renderOpts.domainLocales,\n isPreview,\n getRequestMeta(req, 'isLocaleDomain')\n )\n\n const appRouter = adaptForAppRouterInstance(router)\n\n let scriptLoader: any = {}\n const jsxStyleRegistry = createStyleRegistry()\n\n let head: JSX.Element[] = defaultHead()\n const reactLoadableModules: string[] = []\n\n let initialScripts: any = {}\n if (hasPageScripts) {\n initialScripts.beforeInteractive = []\n .concat(hasPageScripts())\n .filter((script: any) => script.props.strategy === 'beforeInteractive')\n .map((script: any) => script.props)\n }\n\n const csp =\n req.headers['content-security-policy'] ||\n req.headers['content-security-policy-report-only']\n\n const nonce =\n typeof csp === 'string' ? getScriptNonceFromHeader(csp) : undefined\n\n const AppContainer = ({ children }: { children: JSX.Element }) => (\n <AppRouterContext.Provider value={appRouter}>\n <SearchParamsContext.Provider value={adaptForSearchParams(router)}>\n <PathnameContextProviderAdapter\n router={router}\n isAutoExport={isAutoExport}\n >\n <PathParamsContext.Provider value={adaptForPathParams(router)}>\n <RouterContext.Provider value={router}>\n <HeadManagerContext.Provider\n value={{\n updateHead: (state) => {\n head = state\n },\n updateScripts: (scripts) => {\n scriptLoader = scripts\n },\n scripts: initialScripts,\n mountedInstances: new Set(),\n nonce,\n }}\n >\n <LoadableContext.Provider\n value={(moduleName) => reactLoadableModules.push(moduleName)}\n >\n <StyleRegistry registry={jsxStyleRegistry}>\n <ImageConfigContext.Provider value={images}>\n {children}\n </ImageConfigContext.Provider>\n </StyleRegistry>\n </LoadableContext.Provider>\n </HeadManagerContext.Provider>\n </RouterContext.Provider>\n </PathParamsContext.Provider>\n </PathnameContextProviderAdapter>\n </SearchParamsContext.Provider>\n </AppRouterContext.Provider>\n )\n\n // The `useId` API uses the path indexes to generate an ID for each node.\n // To guarantee the match of hydration, we need to ensure that the structure\n // of wrapper nodes is isomorphic in server and client.\n // TODO: With `enhanceApp` and `enhanceComponents` options, this approach may\n // not be useful.\n // https://github.com/facebook/react/pull/22644\n const Noop = () => null\n const AppContainerWithIsomorphicFiberStructure: React.FC<{\n children: JSX.Element\n }> = ({ children }) => {\n return (\n <>\n {/* <Head/> */}\n <Noop />\n <AppContainer>\n <>\n {children}\n {/* <RouteAnnouncer/> */}\n <Noop />\n </>\n </AppContainer>\n </>\n )\n }\n\n const ctx = {\n err,\n req: isAutoExport ? undefined : req,\n res: isAutoExport ? undefined : res,\n pathname,\n query,\n asPath,\n locale: renderOpts.locale,\n locales: renderOpts.locales,\n defaultLocale: renderOpts.defaultLocale,\n AppTree: (props: any) => {\n return (\n <AppContainerWithIsomorphicFiberStructure>\n {renderPageTree(App, OriginComponent, { ...props, router })}\n </AppContainerWithIsomorphicFiberStructure>\n )\n },\n defaultGetInitialProps: async (\n docCtx: DocumentContext,\n options: { nonce?: string } = {}\n ): Promise<DocumentInitialProps> => {\n const enhanceApp = (AppComp: any) => {\n return (props: any) => <AppComp {...props} />\n }\n\n const { html, head: renderPageHead } = await docCtx.renderPage({\n enhanceApp,\n })\n const styles = jsxStyleRegistry.styles({ nonce: options.nonce || nonce })\n jsxStyleRegistry.flush()\n return { html, head: renderPageHead, styles }\n },\n }\n let props: any\n\n const nextExport =\n !isSSG && (renderOpts.nextExport || (dev && (isAutoExport || isFallback)))\n\n const styledJsxInsertedHTML = () => {\n const styles = jsxStyleRegistry.styles()\n jsxStyleRegistry.flush()\n return <>{styles}</>\n }\n\n props = await loadGetInitialProps(App, {\n AppTree: ctx.AppTree,\n Component,\n router,\n ctx,\n })\n\n if ((isSSG || getServerSideProps) && isPreview) {\n props.__N_PREVIEW = true\n }\n\n if (isSSG) {\n props[STATIC_PROPS_ID] = true\n }\n\n if (isSSG && !isFallback) {\n let data: Readonly<UnwrapPromise<ReturnType<GetStaticProps>>>\n\n try {\n data = await getTracer().trace(\n RenderSpan.getStaticProps,\n {\n spanName: `getStaticProps ${pathname}`,\n attributes: {\n 'next.route': pathname,\n },\n },\n () =>\n getStaticProps({\n ...(pageIsDynamic ? { params } : undefined),\n ...(isPreview\n ? { draftMode: true, preview: true, previewData: previewData }\n : undefined),\n locales: [...(renderOpts.locales ?? [])],\n locale: renderOpts.locale,\n defaultLocale: renderOpts.defaultLocale,\n revalidateReason: renderOpts.isOnDemandRevalidate\n ? 'on-demand'\n : isBuildTimeSSG\n ? 'build'\n : 'stale',\n })\n )\n } catch (staticPropsError: any) {\n // remove not found error code to prevent triggering legacy\n // 404 rendering\n if (staticPropsError && staticPropsError.code === 'ENOENT') {\n delete staticPropsError.code\n }\n throw staticPropsError\n }\n\n if (data == null) {\n throw new Error(GSP_NO_RETURNED_VALUE)\n }\n\n const invalidKeys = Object.keys(data).filter(\n (key) =>\n key !== 'revalidate' &&\n key !== 'props' &&\n key !== 'redirect' &&\n key !== 'notFound'\n )\n\n if (invalidKeys.includes('unstable_revalidate')) {\n throw new Error(UNSTABLE_REVALIDATE_RENAME_ERROR)\n }\n\n if (invalidKeys.length) {\n throw new Error(invalidKeysMsg('getStaticProps', invalidKeys))\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (\n typeof (data as any).notFound !== 'undefined' &&\n typeof (data as any).redirect !== 'undefined'\n ) {\n throw new Error(\n `\\`redirect\\` and \\`notFound\\` can not both be returned from ${\n isSSG ? 'getStaticProps' : 'getServerSideProps'\n } at the same time. Page: ${pathname}\\nSee more info here: https://nextjs.org/docs/messages/gssp-mixed-not-found-redirect`\n )\n }\n }\n\n if ('notFound' in data && data.notFound) {\n if (pathname === '/404') {\n throw new Error(\n `The /404 page can not return notFound in \"getStaticProps\", please remove it to continue!`\n )\n }\n\n metadata.isNotFound = true\n }\n\n if (\n 'redirect' in data &&\n data.redirect &&\n typeof data.redirect === 'object'\n ) {\n checkRedirectValues(data.redirect as Redirect, req, 'getStaticProps')\n\n if (isBuildTimeSSG) {\n throw new Error(\n `\\`redirect\\` can not be returned from getStaticProps during prerendering (${req.url})\\n` +\n `See more info here: https://nextjs.org/docs/messages/gsp-redirect-during-prerender`\n )\n }\n\n ;(data as any).props = {\n __N_REDIRECT: data.redirect.destination,\n __N_REDIRECT_STATUS: getRedirectStatus(data.redirect),\n }\n if (typeof data.redirect.basePath !== 'undefined') {\n ;(data as any).props.__N_REDIRECT_BASE_PATH = data.redirect.basePath\n }\n metadata.isRedirect = true\n }\n\n if (\n (dev || isBuildTimeSSG) &&\n !metadata.isNotFound &&\n !isSerializableProps(pathname, 'getStaticProps', (data as any).props)\n ) {\n // this fn should throw an error instead of ever returning `false`\n throw new Error(\n 'invariant: getStaticProps did not return valid props. Please report this.'\n )\n }\n\n let revalidate: Revalidate\n if ('revalidate' in data) {\n if (data.revalidate && renderOpts.nextConfigOutput === 'export') {\n throw new Error(\n 'ISR cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'\n )\n }\n if (typeof data.revalidate === 'number') {\n if (!Number.isInteger(data.revalidate)) {\n throw new Error(\n `A page's revalidate option must be seconds expressed as a natural number for ${req.url}. Mixed numbers, such as '${data.revalidate}', cannot be used.` +\n `\\nTry changing the value to '${Math.ceil(\n data.revalidate\n )}' or using \\`Math.ceil()\\` if you're computing the value.`\n )\n } else if (data.revalidate <= 0) {\n throw new Error(\n `A page's revalidate option can not be less than or equal to zero for ${req.url}. A revalidate option of zero means to revalidate after _every_ request, and implies stale data cannot be tolerated.` +\n `\\n\\nTo never revalidate, you can set revalidate to \\`false\\` (only ran once at build-time).` +\n `\\nTo revalidate as soon as possible, you can set the value to \\`1\\`.`\n )\n } else {\n if (data.revalidate > 31536000) {\n // if it's greater than a year for some reason error\n console.warn(\n `Warning: A page's revalidate option was set to more than a year for ${req.url}. This may have been done in error.` +\n `\\nTo only run getStaticProps at build-time and not revalidate at runtime, you can set \\`revalidate\\` to \\`false\\`!`\n )\n }\n\n revalidate = data.revalidate\n }\n } else if (data.revalidate === true) {\n // When enabled, revalidate after 1 second. This value is optimal for\n // the most up-to-date page possible, but without a 1-to-1\n // request-refresh ratio.\n revalidate = 1\n } else if (\n data.revalidate === false ||\n typeof data.revalidate === 'undefined'\n ) {\n // By default, we never revalidate.\n revalidate = false\n } else {\n throw new Error(\n `A page's revalidate option must be seconds expressed as a natural number. Mixed numbers and strings cannot be used. Received '${JSON.stringify(\n data.revalidate\n )}' for ${req.url}`\n )\n }\n } else {\n // By default, we never revalidate.\n revalidate = false\n }\n\n props.pageProps = Object.assign(\n {},\n props.pageProps,\n 'props' in data ? data.props : undefined\n )\n\n // pass up cache control and props for export\n metadata.cacheControl = { revalidate, expire: undefined }\n metadata.pageData = props\n\n // this must come after revalidate is added to renderResultMeta\n if (metadata.isNotFound) {\n return new RenderResult(null, {\n metadata,\n contentType: null,\n })\n }\n }\n\n if (getServerSideProps) {\n props[SERVER_PROPS_ID] = true\n }\n\n if (getServerSideProps && !isFallback) {\n let data: UnwrapPromise<ReturnType<GetServerSideProps>>\n\n let canAccessRes = true\n let resOrProxy = res\n let deferredContent = false\n if (process.env.NODE_ENV !== 'production') {\n resOrProxy = new Proxy<ServerResponse>(res, {\n get: function (obj, prop) {\n if (!canAccessRes) {\n const message =\n `You should not access 'res' after getServerSideProps resolves.` +\n `\\nRead more: https://nextjs.org/docs/messages/gssp-no-mutating-res`\n\n if (deferredContent) {\n throw new Error(message)\n } else {\n warn(message)\n }\n }\n\n if (typeof prop === 'symbol') {\n return ReflectAdapter.get(obj, prop, res)\n }\n\n return ReflectAdapter.get(obj, prop, res)\n },\n })\n }\n\n try {\n data = await getTracer().trace(\n RenderSpan.getServerSideProps,\n {\n spanName: `getServerSideProps ${pathname}`,\n attributes: {\n 'next.route': pathname,\n },\n },\n async () =>\n getServerSideProps({\n req: req as IncomingMessage & {\n cookies: NextApiRequestCookies\n },\n res: resOrProxy,\n query,\n resolvedUrl: renderOpts.resolvedUrl as string,\n ...(pageIsDynamic ? { params } : undefined),\n ...(previewData !== false\n ? { draftMode: true, preview: true, previewData: previewData }\n : undefined),\n // We create a copy here to avoid having the types of\n // `getServerSideProps` change. This ensures that users can't\n // mutate this array and have it poison the reference.\n locales: [...(renderOpts.locales ?? [])],\n locale: renderOpts.locale,\n defaultLocale: renderOpts.defaultLocale,\n })\n )\n canAccessRes = false\n metadata.cacheControl = { revalidate: 0, expire: undefined }\n } catch (serverSidePropsError: any) {\n // remove not found error code to prevent triggering legacy\n // 404 rendering\n if (\n isError(serverSidePropsError) &&\n serverSidePropsError.code === 'ENOENT'\n ) {\n delete serverSidePropsError.code\n }\n throw serverSidePropsError\n }\n\n if (data == null) {\n throw new Error(GSSP_NO_RETURNED_VALUE)\n }\n\n if ((data as any).props instanceof Promise) {\n deferredContent = true\n }\n\n const invalidKeys = Object.keys(data).filter(\n (key) => key !== 'props' && key !== 'redirect' && key !== 'notFound'\n )\n\n if ((data as any).unstable_notFound) {\n throw new Error(\n `unstable_notFound has been renamed to notFound, please update the field to continue. Page: ${pathname}`\n )\n }\n if ((data as any).unstable_redirect) {\n throw new Error(\n `unstable_redirect has been renamed to redirect, please update the field to continue. Page: ${pathname}`\n )\n }\n\n if (invalidKeys.length) {\n throw new Error(invalidKeysMsg('getServerSideProps', invalidKeys))\n }\n\n if ('notFound' in data && data.notFound) {\n if (pathname === '/404') {\n throw new Error(\n `The /404 page can not return notFound in \"getStaticProps\", please remove it to continue!`\n )\n }\n\n metadata.isNotFound = true\n return new RenderResult(null, {\n metadata,\n contentType: null,\n })\n }\n\n if ('redirect' in data && typeof data.redirect === 'object') {\n checkRedirectValues(data.redirect as Redirect, req, 'getServerSideProps')\n ;(data as any).props = {\n __N_REDIRECT: data.redirect.destination,\n __N_REDIRECT_STATUS: getRedirectStatus(data.redirect),\n }\n if (typeof data.redirect.basePath !== 'undefined') {\n ;(data as any).props.__N_REDIRECT_BASE_PATH = data.redirect.basePath\n }\n metadata.isRedirect = true\n }\n\n if (deferredContent) {\n ;(data as any).props = await (data as any).props\n }\n\n if (\n (dev || isBuildTimeSSG) &&\n !isSerializableProps(pathname, 'getServerSideProps', (data as any).props)\n ) {\n // this fn should throw an error instead of ever returning `false`\n throw new Error(\n 'invariant: getServerSideProps did not return valid props. Please report this.'\n )\n }\n\n props.pageProps = Object.assign({}, props.pageProps, (data as any).props)\n metadata.pageData = props\n }\n\n if (\n !isSSG && // we only show this warning for legacy pages\n !getServerSideProps &&\n process.env.NODE_ENV !== 'production' &&\n Object.keys(props?.pageProps || {}).includes('url')\n ) {\n console.warn(\n `The prop \\`url\\` is a reserved prop in Next.js for legacy reasons and will be overridden on page ${pathname}\\n` +\n `See more info here: https://nextjs.org/docs/messages/reserved-page-prop`\n )\n }\n\n // Avoid rendering page un-necessarily for getServerSideProps data request\n // and getServerSideProps/getStaticProps redirects\n if ((isNextDataRequest && !isSSG) || metadata.isRedirect) {\n return new RenderResult(JSON.stringify(props), {\n metadata,\n contentType: JSON_CONTENT_TYPE_HEADER,\n })\n }\n\n // We don't call getStaticProps or getServerSideProps while generating\n // the fallback so make sure to set pageProps to an empty object\n if (isFallback) {\n props.pageProps = {}\n }\n\n // the response might be finished on the getInitialProps call\n if (isResSent(res) && !isSSG) return RenderResult.EMPTY\n\n // we preload the buildManifest for auto-export dynamic pages\n // to speed up hydrating query values\n let filteredBuildManifest = buildManifest\n if (isAutoExport && pageIsDynamic) {\n const page = denormalizePagePath(normalizePagePath(pathname))\n // This code would be much cleaner using `immer` and directly pushing into\n // the result from `getPageFiles`, we could maybe consider that in the\n // future.\n if (page in filteredBuildManifest.pages) {\n filteredBuildManifest = {\n ...filteredBuildManifest,\n pages: {\n ...filteredBuildManifest.pages,\n [page]: [\n ...filteredBuildManifest.pages[page],\n ...filteredBuildManifest.lowPriorityFiles.filter((f) =>\n f.includes('_buildManifest')\n ),\n ],\n },\n lowPriorityFiles: filteredBuildManifest.lowPriorityFiles.filter(\n (f) => !f.includes('_buildManifest')\n ),\n }\n }\n }\n\n const Body = ({ children }: { children: JSX.Element }) => {\n return <div id=\"__next\">{children}</div>\n }\n\n const renderDocument = async () => {\n // For `Document`, there are two cases that we don't support:\n // 1. Using `Document.getInitialProps` in the Edge runtime.\n // 2. Using the class component `Document` with concurrent features.\n\n const BuiltinFunctionalDocument: DocumentType | undefined = (\n Document as any\n )[NEXT_BUILTIN_DOCUMENT]\n\n if (process.env.NEXT_RUNTIME === 'edge' && Document.getInitialProps) {\n // In the Edge runtime, `Document.getInitialProps` isn't supported.\n // We throw an error here if it's customized.\n if (BuiltinFunctionalDocument) {\n Document = BuiltinFunctionalDocument\n } else {\n throw new Error(\n '`getInitialProps` in Document component is not supported with the Edge Runtime.'\n )\n }\n }\n\n async function loadDocumentInitialProps(\n renderShell: (\n _App: AppType,\n _Component: NextComponentType\n ) => Promise<ReactDOMServerReadableStream>\n ) {\n const renderPage: RenderPage = async (\n options: ComponentsEnhancer = {}\n ): Promise<RenderPageResult> => {\n if (ctx.err && ErrorDebug) {\n // Always start rendering the shell even if there's an error.\n if (renderShell) {\n renderShell(App, Component)\n }\n\n const html = await renderToString(\n <Body>\n <ErrorDebug />\n </Body>\n )\n return { html, head }\n }\n\n if (dev && (props.router || props.Component)) {\n throw new Error(\n `'router' and 'Component' can not be returned in getInitialProps from _app.js https://nextjs.org/docs/messages/cant-override-next-props`\n )\n }\n\n const { App: EnhancedApp, Component: EnhancedComponent } =\n enhanceComponents(options, App, Component)\n\n const stream = await renderShell(EnhancedApp, EnhancedComponent)\n await stream.allReady\n const html = await streamToString(stream)\n\n return { html, head }\n }\n const documentCtx = { ...ctx, renderPage }\n const docProps: DocumentInitialProps = await loadGetInitialProps(\n Document,\n documentCtx\n )\n // the response might be finished on the getInitialProps call\n if (isResSent(res) && !isSSG) return null\n\n if (!docProps || typeof docProps.html !== 'string') {\n const message = `\"${getDisplayName(\n Document\n )}.getInitialProps()\" should resolve to an object with a \"html\" prop set with a valid html string`\n throw new Error(message)\n }\n\n return { docProps, documentCtx }\n }\n\n const renderContent = (_App: AppType, _Component: NextComponentType) => {\n const EnhancedApp = _App || App\n const EnhancedComponent = _Component || Component\n\n return ctx.err && ErrorDebug ? (\n <Body>\n <ErrorDebug />\n </Body>\n ) : (\n <Body>\n <AppContainerWithIsomorphicFiberStructure>\n {renderPageTree(EnhancedApp, EnhancedComponent, {\n ...props,\n router,\n })}\n </AppContainerWithIsomorphicFiberStructure>\n </Body>\n )\n }\n\n // Always using react concurrent rendering mode with required react version 18.x\n const renderShell = async (\n EnhancedApp: AppType,\n EnhancedComponent: NextComponentType\n ) => {\n const content = renderContent(EnhancedApp, EnhancedComponent)\n return await renderToInitialFizzStream({\n ReactDOMServer: ReactDOMServerPages,\n element: content,\n })\n }\n\n const hasDocumentGetInitialProps =\n process.env.NEXT_RUNTIME !== 'edge' && !!Document.getInitialProps\n\n // If it has getInitialProps, we will render the shell in `renderPage`.\n // Otherwise we do it right now.\n let documentInitialPropsRes:\n | {}\n | Awaited<ReturnType<typeof loadDocumentInitialProps>>\n\n const [rawStyledJsxInsertedHTML, content] = await Promise.all([\n renderToString(styledJsxInsertedHTML()),\n (async () => {\n if (hasDocumentGetInitialProps) {\n documentInitialPropsRes = await loadDocumentInitialProps(renderShell)\n if (documentInitialPropsRes === null) return null\n const { docProps } = documentInitialPropsRes as any\n return docProps.html\n } else {\n documentInitialPropsRes = {}\n const stream = await renderShell(App, Component)\n await stream.allReady\n return streamToString(stream)\n }\n })(),\n ])\n\n if (content === null) {\n return null\n }\n\n const contentHTML = rawStyledJsxInsertedHTML + content\n\n // @ts-ignore: documentInitialPropsRes is set\n const { docProps } = (documentInitialPropsRes as any) || {}\n const documentElement = (htmlProps: any) => {\n if (process.env.NEXT_RUNTIME === 'edge') {\n return (Document as any)()\n } else {\n return <Document {...htmlProps} {...docProps} />\n }\n }\n\n let styles\n if (hasDocumentGetInitialProps) {\n styles = docProps.styles\n head = docProps.head\n } else {\n styles = jsxStyleRegistry.styles()\n jsxStyleRegistry.flush()\n }\n\n return {\n contentHTML,\n documentElement,\n head,\n headTags: [],\n styles,\n }\n }\n\n getTracer().setRootSpanAttribute('next.route', renderOpts.page)\n const documentResult = await getTracer().trace(\n RenderSpan.renderDocument,\n {\n spanName: `render route (pages) ${renderOpts.page}`,\n attributes: {\n 'next.route': renderOpts.page,\n },\n },\n async () => renderDocument()\n )\n if (!documentResult) {\n return new RenderResult(null, {\n metadata,\n contentType: HTML_CONTENT_TYPE_HEADER,\n })\n }\n\n const dynamicImportsIds = new Set<string | number>()\n const dynamicImports = new Set<string>()\n\n for (const mod of reactLoadableModules) {\n const manifestItem = reactLoadableManifest[mod]\n\n if (manifestItem) {\n dynamicImportsIds.add(manifestItem.id)\n manifestItem.files.forEach((item) => {\n dynamicImports.add(item)\n })\n }\n }\n\n const docComponentsRendered: DocumentProps['docComponentsRendered'] = {}\n\n const {\n assetPrefix,\n defaultLocale,\n disableOptimizedLoading,\n domainLocales,\n locale,\n locales,\n } = renderOpts\n const htmlProps: HtmlProps = {\n __NEXT_DATA__: {\n props, // The result of getInitialProps\n page: pathname, // The rendered page\n query, // querystring parsed / passed by the user\n buildId: sharedContext.buildId,\n assetPrefix: assetPrefix === '' ? undefined : assetPrefix, // send assetPrefix to the client side when configured, otherwise don't sent in the resulting HTML\n nextExport: nextExport === true ? true : undefined, // If this is a page exported by `next export`\n autoExport: isAutoExport === true ? true : undefined, // If this is an auto exported page\n isFallback,\n isExperimentalCompile,\n dynamicIds:\n dynamicImportsIds.size === 0\n ? undefined\n : Array.from(dynamicImportsIds),\n err: renderOpts.err ? serializeError(dev, renderOpts.err) : undefined, // Error if one happened, otherwise don't sent in the resulting HTML\n gsp: !!getStaticProps ? true : undefined, // whether the page is getStaticProps\n gssp: !!getServerSideProps ? true : undefined, // whether the page is getServerSideProps\n customServer: sharedContext.customServer,\n gip: hasPageGetInitialProps ? true : undefined, // whether the page has getInitialProps\n appGip: !defaultAppGetInitialProps ? true : undefined, // whether the _app has getInitialProps\n locale,\n locales,\n defaultLocale,\n domainLocales,\n isPreview: isPreview === true ? true : undefined,\n notFoundSrcPage: notFoundSrcPage && dev ? notFoundSrcPage : undefined,\n },\n nonce,\n buildManifest: filteredBuildManifest,\n docComponentsRendered,\n dangerousAsPath: router.asPath,\n isDevelopment: !!dev,\n dynamicImports: Array.from(dynamicImports),\n dynamicCssManifest: new Set(renderOpts.dynamicCssManifest || []),\n assetPrefix,\n // Only enabled in production as development mode has features relying on HMR (style injection for example)\n unstable_runtimeJS:\n process.env.NODE_ENV === 'production'\n ? pageConfig.unstable_runtimeJS\n : undefined,\n unstable_JsPreload: pageConfig.unstable_JsPreload,\n assetQueryString,\n scriptLoader,\n locale,\n disableOptimizedLoading,\n head: documentResult.head,\n headTags: documentResult.headTags,\n styles: documentResult.styles,\n crossOrigin: renderOpts.crossOrigin,\n optimizeCss: renderOpts.optimizeCss,\n nextConfigOutput: renderOpts.nextConfigOutput,\n nextScriptWorkers: renderOpts.nextScriptWorkers,\n runtime: globalRuntime,\n largePageDataBytes: renderOpts.largePageDataBytes,\n nextFontManifest: renderOpts.nextFontManifest,\n experimentalClientTraceMetadata:\n renderOpts.experimental.clientTraceMetadata,\n }\n\n const document = (\n <HtmlContext.Provider value={htmlProps}>\n {documentResult.documentElement(htmlProps)}\n </HtmlContext.Provider>\n )\n\n const documentHTML = await getTracer().trace(\n RenderSpan.renderToString,\n async () => renderToString(document)\n )\n\n if (process.env.NODE_ENV !== 'production') {\n const nonRenderedComponents = []\n const expectedDocComponents = ['Main', 'Head', 'NextScript', 'Html']\n\n for (const comp of expectedDocComponents) {\n if (!(docComponentsRendered as any)[comp]) {\n nonRenderedComponents.push(comp)\n }\n }\n\n if (nonRenderedComponents.length) {\n const missingComponentList = nonRenderedComponents\n .map((e) => `<${e} />`)\n .join(', ')\n const plural = nonRenderedComponents.length !== 1 ? 's' : ''\n console.warn(\n `Your custom Document (pages/_document) did not render all the required subcomponent${plural}.\\n` +\n `Missing component${plural}: ${missingComponentList}\\n` +\n 'Read how to fix here: https://nextjs.org/docs/messages/missing-document-component'\n )\n }\n }\n\n const [renderTargetPrefix, renderTargetSuffix] = documentHTML.split(\n '<next-js-internal-body-render-target></next-js-internal-body-render-target>',\n 2\n )\n\n let prefix = ''\n if (!documentHTML.startsWith(DOCTYPE)) {\n prefix += DOCTYPE\n }\n prefix += renderTargetPrefix\n\n const content = prefix + documentResult.contentHTML + renderTargetSuffix\n\n const optimizedHtml = await postProcessHTML(content, renderOpts)\n\n return new RenderResult(optimizedHtml, {\n metadata,\n contentType: HTML_CONTENT_TYPE_HEADER,\n })\n}\n\nexport type PagesRender = (\n req: IncomingMessage,\n res: ServerResponse,\n pathname: string,\n query: NextParsedUrlQuery,\n renderOpts: RenderOpts,\n sharedContext: PagesSharedContext,\n renderContext: PagesRenderContext\n) => Promise<RenderResult>\n\nexport const renderToHTML: PagesRender = (\n req,\n res,\n pathname,\n query,\n renderOpts,\n sharedContext,\n renderContext\n) => {\n return renderToHTMLImpl(\n req,\n res,\n pathname,\n query,\n renderOpts,\n renderOpts,\n sharedContext,\n renderContext\n )\n}\n"],"names":["setLazyProp","getCookieParser","React","ReactDOMServerPages","StyleRegistry","createStyleRegistry","GSP_NO_RETURNED_VALUE","GSSP_COMPONENT_MEMBER_ERROR","GSSP_NO_RETURNED_VALUE","STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR","SERVER_PROPS_GET_INIT_PROPS_CONFLICT","SERVER_PROPS_SSG_CONFLICT","SSG_GET_INITIAL_PROPS_CONFLICT","UNSTABLE_REVALIDATE_RENAME_ERROR","HTML_CONTENT_TYPE_HEADER","JSON_CONTENT_TYPE_HEADER","NEXT_BUILTIN_DOCUMENT","SERVER_PROPS_ID","STATIC_PROPS_ID","STATIC_STATUS_PAGES","isSerializableProps","defaultHead","HeadManagerContext","Loadable","LoadableContext","RouterContext","isDynamicRoute","getDisplayName","isResSent","loadGetInitialProps","HtmlContext","normalizePagePath","denormalizePagePath","getRequestMeta","allowedStatusCodes","getRedirectStatus","RenderResult","isError","streamToString","renderToInitialFizzStream","ImageConfigContext","stripAnsi","stripInternalQueries","adaptForAppRouterInstance","adaptForPathParams","adaptForSearchParams","PathnameContextProviderAdapter","AppRouterContext","SearchParamsContext","PathParamsContext","getTracer","RenderSpan","ReflectAdapter","getCacheControlHeader","getErrorSource","getScriptNonceFromHeader","tryGetPreviewData","warn","postProcessHTML","DOCTYPE","process","env","NEXT_RUNTIME","require","console","bind","html","noRouter","message","Error","renderToString","element","renderStream","renderToReadableStream","allReady","ServerRouter","constructor","pathname","query","as","isFallback","isReady","basePath","locale","locales","defaultLocale","domainLocales","isPreview","isLocaleDomain","route","replace","asPath","push","reload","back","forward","prefetch","beforePopState","enhanceComponents","options","App","Component","enhanceApp","enhanceComponent","renderPageTree","props","invalidKeysMsg","methodName","invalidKeys","docsPathname","toLocaleLowerCase","join","checkRedirectValues","redirect","req","method","destination","permanent","statusCode","errors","hasStatusCode","hasPermanent","has","destinationType","basePathType","length","url","errorToJSON","err","source","name","stack","digest","serializeError","dev","renderToHTMLImpl","res","renderOpts","extra","sharedContext","renderContext","headers","metadata","assetQueryString","userAgent","toLowerCase","includes","Date","now","deploymentId","Object","assign","pageConfig","buildManifest","reactLoadableManifest","ErrorDebug","getStaticProps","getStaticPaths","getServerSideProps","isNextDataRequest","params","previewProps","images","runtime","globalRuntime","isExperimentalCompile","expireTime","Document","OriginComponent","notFoundSrcPage","developmentNotFoundSourcePage","isSSG","isBuildTimeSSG","nextExport","defaultAppGetInitialProps","getInitialProps","origGetInitialProps","hasPageGetInitialProps","hasPageScripts","unstable_scriptLoader","pageIsDynamic","defaultErrorGetInitialProps","isAutoExport","setHeader","revalidate","expire","nextConfigOutput","resolvedAsPath","isValidElementType","endsWith","setIsrStatus","preloadAll","undefined","previewData","multiZoneDraftMode","routerIsReady","router","appRouter","scriptLoader","jsxStyleRegistry","head","reactLoadableModules","initialScripts","beforeInteractive","concat","filter","script","strategy","map","csp","nonce","AppContainer","children","Provider","value","updateHead","state","updateScripts","scripts","mountedInstances","Set","moduleName","registry","Noop","AppContainerWithIsomorphicFiberStructure","ctx","AppTree","defaultGetInitialProps","docCtx","AppComp","renderPageHead","renderPage","styles","flush","styledJsxInsertedHTML","__N_PREVIEW","data","trace","spanName","attributes","draftMode","preview","revalidateReason","isOnDemandRevalidate","staticPropsError","code","keys","key","NODE_ENV","notFound","isNotFound","__N_REDIRECT","__N_REDIRECT_STATUS","__N_REDIRECT_BASE_PATH","isRedirect","Number","isInteger","Math","ceil","JSON","stringify","pageProps","cacheControl","pageData","contentType","canAccessRes","resOrProxy","deferredContent","Proxy","get","obj","prop","resolvedUrl","serverSidePropsError","Promise","unstable_notFound","unstable_redirect","EMPTY","filteredBuildManifest","page","pages","lowPriorityFiles","f","Body","div","id","renderDocument","BuiltinFunctionalDocument","loadDocumentInitialProps","renderShell","EnhancedApp","EnhancedComponent","stream","documentCtx","docProps","renderContent","_App","_Component","content","ReactDOMServer","hasDocumentGetInitialProps","documentInitialPropsRes","rawStyledJsxInsertedHTML","all","contentHTML","documentElement","htmlProps","headTags","setRootSpanAttribute","documentResult","dynamicImportsIds","dynamicImports","mod","manifestItem","add","files","forEach","item","docComponentsRendered","assetPrefix","disableOptimizedLoading","__NEXT_DATA__","buildId","autoExport","dynamicIds","size","Array","from","gsp","gssp","customServer","gip","appGip","dangerousAsPath","isDevelopment","dynamicCssManifest","unstable_runtimeJS","unstable_JsPreload","crossOrigin","optimizeCss","nextScriptWorkers","largePageDataBytes","nextFontManifest","experimentalClientTraceMetadata","experimental","clientTraceMetadata","document","documentHTML","nonRenderedComponents","expectedDocComponents","comp","missingComponentList","e","plural","renderTargetPrefix","renderTargetSuffix","split","prefix","startsWith","optimizedHtml","renderToHTML"],"mappings":"AAAA,2FAA2F;AAmB3F,SAGEA,WAAW,QACN,cAAa;AACpB,SAASC,eAAe,QAAQ,gCAA+B;AAkB/D,OAAOC,WAAyB,QAAO;AACvC,OAAOC,yBAAyB,uCAAsC;AACtE,SAASC,aAAa,EAAEC,mBAAmB,QAAQ,aAAY;AAC/D,SACEC,qBAAqB,EACrBC,2BAA2B,EAC3BC,sBAAsB,EACtBC,0CAA0C,EAC1CC,oCAAoC,EACpCC,yBAAyB,EACzBC,8BAA8B,EAC9BC,gCAAgC,EAChCC,wBAAwB,EACxBC,wBAAwB,QACnB,mBAAkB;AACzB,SACEC,qBAAqB,EACrBC,eAAe,EACfC,eAAe,EACfC,mBAAmB,QACd,0BAAyB;AAChC,SAASC,mBAAmB,QAAQ,+BAA8B;AAClE,SAASC,WAAW,QAAQ,qBAAoB;AAChD,SAASC,kBAAkB,QAAQ,oDAAmD;AACtF,OAAOC,cAAc,wCAAuC;AAC5D,SAASC,eAAe,QAAQ,gDAA+C;AAC/E,SAASC,aAAa,QAAQ,8CAA6C;AAC3E,SAASC,cAAc,QAAQ,wCAAuC;AACtE,SACEC,cAAc,EACdC,SAAS,EACTC,mBAAmB,QACd,sBAAqB;AAC5B,SAASC,WAAW,QAAQ,4CAA2C;AACvE,SAASC,iBAAiB,QA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