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>
1 line
No EOL
34 KiB
Text
1 line
No EOL
34 KiB
Text
{"version":3,"sources":["../../../src/server/node-environment-extensions/unhandled-rejection.tsx"],"sourcesContent":["/**\n * Manages unhandled rejection listeners to intelligently filter rejections\n * from aborted prerenders when cache components are enabled.\n *\n * THE PROBLEM:\n * When we abort prerenders we expect to find numerous unhandled promise rejections due to\n * things like awaiting Request data like `headers()`. The rejections are fine and should\n * not be construed as problematic so we need to avoid the appearance of a problem by\n * omitting them from the logged output.\n *\n * THE STRATEGY:\n * 1. Install a filtering unhandled rejection handler\n * 2. Intercept process event methods to capture new handlers in our internal queue\n * 3. For each rejection, check if it comes from an aborted prerender context\n * 4. If yes, suppress it. If no, delegate to all handlers in our queue\n * 5. This provides precise filtering without time-based windows\n *\n * This ensures we suppress noisy prerender-related rejections while preserving\n * normal error logging for genuine unhandled rejections.\n */\n\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\n\nconst MODE:\n | 'enabled'\n | 'debug'\n | 'silent'\n | 'true'\n | 'false'\n | '1'\n | '0'\n | ''\n | string\n | undefined = process.env.NEXT_UNHANDLED_REJECTION_FILTER\n\nlet ENABLE_UHR_FILTER = true\nlet UHR_FILTER_LOG_LEVEL: 'debug' | 'warn' | 'silent' = 'warn'\n\nswitch (MODE) {\n case 'silent':\n UHR_FILTER_LOG_LEVEL = 'silent'\n break\n case 'debug':\n UHR_FILTER_LOG_LEVEL = 'debug'\n break\n case 'false':\n case 'disabled':\n case '0':\n ENABLE_UHR_FILTER = false\n break\n case '':\n case undefined:\n case 'enabled':\n case 'true':\n case '1':\n break\n default:\n if (typeof MODE === 'string') {\n console.error(\n `NEXT_UNHANDLED_REJECTION_FILTER has an unrecognized value: ${JSON.stringify(MODE)}. Use \"enabled\", \"disabled\", \"silent\", or \"debug\", or omit the environment variable altogether`\n )\n }\n}\n\nlet debug: typeof console.debug | undefined\nlet debugWithTrace: typeof console.debug | undefined\nlet warn: typeof console.warn | undefined\nlet warnWithTrace: typeof console.warn | undefined\n\nswitch (UHR_FILTER_LOG_LEVEL) {\n case 'debug':\n debug = (message: string) =>\n console.log('[Next.js Unhandled Rejection Filter]: ' + message)\n debugWithTrace = (message: string) => {\n console.log(new DebugWithStack(message))\n }\n // Intentional fallthrough\n case 'warn':\n warn = (message: string) => {\n console.warn('[Next.js Unhandled Rejection Filter]: ' + message)\n }\n warnWithTrace = (message: string) => {\n console.warn(new WarnWithStack(message))\n }\n break\n case 'silent':\n default:\n}\n\nclass DebugWithStack extends Error {\n constructor(message: string) {\n super(message)\n this.name = '[Next.js Unhandled Rejection Filter]'\n }\n}\n\nclass WarnWithStack extends Error {\n constructor(message: string) {\n super(message)\n this.name = '[Next.js Unhandled Rejection Filter]'\n }\n}\n\nlet didWarnUninstalled = false\nconst warnUninstalledOnce = warn\n ? function warnUninstalledOnce(...args: any[]) {\n if (!didWarnUninstalled) {\n didWarnUninstalled = true\n warn(...args)\n }\n }\n : undefined\n\ntype ListenerMetadata = {\n listener: NodeJS.UnhandledRejectionListener\n once: boolean\n}\n\nlet filterInstalled = false\n\n// We store the proxied listeners for unhandled rejections here.\nlet underlyingListeners: Array<NodeJS.UnhandledRejectionListener> = []\n// We store a unique pointer to each event listener registration to track\n// details like whether the listener is a once listener.\nlet listenerMetadata: Array<ListenerMetadata> = []\n\n// These methods are used to restore the original implementations when uninstalling the patch\nlet originalProcessAddListener: typeof process.addListener\nlet originalProcessRemoveListener: typeof process.removeListener\nlet originalProcessOn: typeof process.on\nlet originalProcessOff: typeof process.off\nlet originalProcessPrependListener: typeof process.prependListener\nlet originalProcessOnce: typeof process.once\nlet originalProcessPrependOnceListener: typeof process.prependOnceListener\nlet originalProcessRemoveAllListeners: typeof process.removeAllListeners\nlet originalProcessListeners: typeof process.listeners\n\ntype UnderlyingMethod =\n | typeof originalProcessAddListener\n | typeof originalProcessRemoveListener\n | typeof originalProcessOn\n | typeof originalProcessOff\n | typeof originalProcessPrependListener\n | typeof originalProcessOnce\n | typeof originalProcessPrependOnceListener\n | typeof originalProcessRemoveAllListeners\n | typeof originalProcessListeners\n\n// Some of these base methods call others and we don't want them to call the patched version so we\n// need a way to synchronously disable the patch temporarily.\nlet bypassPatch = false\n\n// This patch ensures that if any patched methods end up calling other methods internally they will\n// bypass the patch during their execution. This is important for removeAllListeners in particular\n// because it calls removeListener internally and we want to ensure it actually clears the listeners\n// from the process queue and not our private queue.\nfunction patchWithoutReentrancy<T extends UnderlyingMethod>(\n original: T,\n patchedImpl: T\n): T {\n // Produce a function which has the correct name\n const patched = {\n [original.name]: function (...args: Parameters<T>) {\n if (bypassPatch) {\n return Reflect.apply(original, process, args)\n }\n\n const previousBypassPatch = bypassPatch\n bypassPatch = true\n try {\n return Reflect.apply(patchedImpl, process, args)\n } finally {\n bypassPatch = previousBypassPatch\n }\n } as any,\n }[original.name]\n\n // Preserve the original toString behavior\n Object.defineProperty(patched, 'toString', {\n value: original.toString.bind(original),\n writable: true,\n configurable: true,\n })\n\n return patched\n}\n\nconst MACGUFFIN_EVENT = 'Next.UnhandledRejectionFilter.MacguffinEvent'\n\n/**\n * Installs a filtering unhandled rejection handler that intelligently suppresses\n * rejections from aborted prerender contexts.\n *\n * This should be called once during server startup to install the global filter.\n */\nfunction installUnhandledRejectionFilter(): void {\n if (filterInstalled) {\n warnWithTrace?.(\n 'Unexpected subsequent filter installation. This is a bug in Next.js'\n )\n return\n }\n\n debug?.('Installing Filter')\n\n // Capture existing handlers\n underlyingListeners = Array.from(process.listeners('unhandledRejection'))\n // We assume all existing handlers are not \"once\"\n listenerMetadata = underlyingListeners.map((l) => ({\n listener: l,\n once: false,\n }))\n\n // Remove all existing handlers\n process.removeAllListeners('unhandledRejection')\n\n // Install our filtering handler\n process.addListener('unhandledRejection', filteringUnhandledRejectionHandler)\n\n // Store the original process methods\n originalProcessAddListener = process.addListener\n originalProcessRemoveListener = process.removeListener\n originalProcessOn = process.on\n originalProcessOff = process.off\n originalProcessPrependListener = process.prependListener\n originalProcessOnce = process.once\n originalProcessPrependOnceListener = process.prependOnceListener\n originalProcessRemoveAllListeners = process.removeAllListeners\n originalProcessListeners = process.listeners\n\n process.addListener = patchWithoutReentrancy(\n originalProcessAddListener,\n function (event: string | symbol, listener: (...args: any[]) => void) {\n if (event === 'unhandledRejection') {\n debugWithTrace?.(\n `Appending 'unhandledRejection' listener with name \\`${listener.name}\\`.`\n )\n // We add the listener to a dummy event in case it throws. We don't catch it intentionally\n try {\n originalProcessAddListener.call(\n process,\n MACGUFFIN_EVENT as any,\n listener\n )\n } finally {\n // We clean up the added event\n originalProcessRemoveAllListeners.call(process, MACGUFFIN_EVENT)\n }\n // Add new handlers to our internal queue instead of the process\n underlyingListeners.push(listener as NodeJS.UnhandledRejectionListener)\n listenerMetadata.push({ listener, once: false })\n return process\n }\n // For other events, use the original method\n return originalProcessAddListener.call(process, event as any, listener)\n } as typeof process.addListener\n )\n\n // Intercept process.removeListener (alias for process.off)\n process.removeListener = patchWithoutReentrancy(\n originalProcessRemoveListener,\n function (event: string | symbol, listener: (...args: any[]) => void) {\n if (event === 'unhandledRejection') {\n // Check if they're trying to remove our filtering handler\n if (listener === filteringUnhandledRejectionHandler) {\n warnUninstalledOnce?.(\n `Uninstalling filter because \\`process.removeListener('unhandledRejection', listener)\\` was called with the filter listener. Uninstalling this filter is not recommended and will cause you to observe 'unhandledRejection' events related to intentionally aborted prerenders.\n\nYou can silence warnings related to this behavior by running Next.js with \\`NEXT_UNHANDLED_REJECTION_FILTER=silent\\` environment variable.\n\nYou can debug event listener operations by running Next.js with \\`NEXT_UNHANDLED_REJECTION_FILTER=debug\\` environment variable.`\n )\n uninstallUnhandledRejectionFilter()\n return process\n }\n\n debugWithTrace?.(\n `Removing 'unhandledRejection' listener with name \\`${listener.name}\\`.`\n )\n // We remove the listener on a dummy event in case it throws. We don't catch it intentionally\n originalProcessRemoveListener.call(\n process,\n MACGUFFIN_EVENT as any,\n listener\n )\n const index = underlyingListeners.lastIndexOf(listener)\n if (index > -1) {\n debug?.(`listener found index ${index} and removed.`)\n underlyingListeners.splice(index, 1)\n listenerMetadata.splice(index, 1)\n } else {\n debug?.(`listener not found.`)\n }\n return process\n }\n // For other events, use the original method\n return originalProcessRemoveListener.call(process, event, listener)\n } as typeof process.removeListener\n )\n\n // If the process.on is referentially process.addListener then share the patched version as well\n if (originalProcessOn === originalProcessAddListener) {\n process.on = process.addListener\n } else {\n process.on = patchWithoutReentrancy(originalProcessOn, function (\n event: string | symbol,\n listener: (...args: any[]) => void\n ) {\n if (event === 'unhandledRejection') {\n debugWithTrace?.(\n `Appending 'unhandledRejection' listener with name \\`${listener.name}\\`.`\n )\n // We add the listener to a dummy event in case it throws. We don't catch it intentionally\n try {\n originalProcessOn.call(process, MACGUFFIN_EVENT as any, listener)\n } finally {\n // We clean up the added event\n originalProcessRemoveAllListeners.call(process, MACGUFFIN_EVENT)\n }\n // Add new handlers to our internal queue instead of the process\n underlyingListeners.push(listener as NodeJS.UnhandledRejectionListener)\n listenerMetadata.push({ listener, once: false })\n return process\n }\n // For other events, use the original method\n return originalProcessOn.call(process, event, listener)\n } as typeof process.on)\n }\n\n // If the process.off is referentially process.addListener then share the patched version as well\n if (originalProcessOff === originalProcessRemoveListener) {\n process.off = process.removeListener\n } else {\n process.off = patchWithoutReentrancy(originalProcessOff, function (\n event: string | symbol,\n listener: (...args: any[]) => void\n ) {\n if (event === 'unhandledRejection') {\n // Check if they're trying to remove our filtering handler\n if (listener === filteringUnhandledRejectionHandler) {\n warnUninstalledOnce?.(\n `Uninstalling filter because \\`process.off('unhandledRejection', listener)\\` was called with the filter listener. Uninstalling this filter is not recommended and will cause you to observe 'unhandledRejection' events related to intentionally aborted prerenders.\n\nYou can silence warnings related to this behavior by running Next.js with \\`NEXT_UNHANDLED_REJECTION_FILTER=silent\\` environment variable.\n\nYou can debug event listener operations by running Next.js with \\`NEXT_UNHANDLED_REJECTION_FILTER=debug\\` environment variable.`\n )\n uninstallUnhandledRejectionFilter()\n return process\n }\n\n debugWithTrace?.(\n `Removing 'unhandledRejection' listener with name \\`${listener.name}\\`.`\n )\n // We remove the listener on a dummy event in case it throws. We don't catch it intentionally\n originalProcessOff.call(process, MACGUFFIN_EVENT as any, listener)\n const index = underlyingListeners.lastIndexOf(listener)\n if (index > -1) {\n debug?.(`listener found index ${index} and removed.`)\n underlyingListeners.splice(index, 1)\n listenerMetadata.splice(index, 1)\n } else {\n debug?.(`listener not found.`)\n }\n return process\n }\n // For other events, use the original method\n return originalProcessOff.call(process, event, listener)\n } as typeof process.off)\n }\n\n // Intercept process.prependListener for handlers that should go first\n process.prependListener = patchWithoutReentrancy(\n originalProcessPrependListener,\n function (event: string | symbol, listener: (...args: any[]) => void) {\n if (event === 'unhandledRejection') {\n debugWithTrace?.(\n `(Prepending) Inserting 'unhandledRejection' listener with name \\`${listener.name}\\` immediately following the Next.js 'unhandledRejection' filter listener.`\n )\n // We add the listener to a dummy event in case it throws. We don't catch it intentionally\n try {\n originalProcessPrependListener.call(\n process,\n MACGUFFIN_EVENT as any,\n listener\n )\n } finally {\n // We clean up the added event\n originalProcessRemoveAllListeners.call(process, MACGUFFIN_EVENT)\n }\n\n // Add new handlers to the beginning of our internal queue\n underlyingListeners.unshift(\n listener as NodeJS.UnhandledRejectionListener\n )\n listenerMetadata.unshift({ listener, once: false })\n return process\n }\n // For other events, use the original method\n return originalProcessPrependListener.call(\n process,\n event as any,\n listener\n )\n } as typeof process.prependListener\n )\n\n // Intercept process.once for one-time handlers\n process.once = patchWithoutReentrancy(originalProcessOnce, function (\n event: string | symbol,\n listener: (...args: any[]) => void\n ) {\n if (event === 'unhandledRejection') {\n debugWithTrace?.(\n `Appending 'unhandledRejection' once-listener with name \\`${listener.name}\\`.`\n )\n // We add the listener to a dummy event in case it throws. We don't catch it intentionally\n try {\n originalProcessOnce.call(process, MACGUFFIN_EVENT as any, listener)\n } finally {\n // We clean up the added event\n originalProcessRemoveAllListeners.call(process, MACGUFFIN_EVENT)\n }\n underlyingListeners.push(listener as NodeJS.UnhandledRejectionListener)\n listenerMetadata.push({\n listener: listener as NodeJS.UnhandledRejectionListener,\n once: true,\n })\n return process\n }\n // For other events, use the original method\n return originalProcessOnce.call(process, event, listener)\n } as typeof process.once)\n\n // Intercept process.prependOnceListener for one-time handlers that should go first\n process.prependOnceListener = patchWithoutReentrancy(\n originalProcessPrependOnceListener,\n function (event: string | symbol, listener: (...args: any[]) => void) {\n if (event === 'unhandledRejection') {\n debugWithTrace?.(\n `(Prepending) Inserting 'unhandledRejection' once-listener with name \\`${listener.name}\\` immediately following the Next.js 'unhandledRejection' filter listener.`\n )\n // We add the listener to a dummy event in case it throws. We don't catch it intentionally\n try {\n originalProcessPrependOnceListener.call(\n process,\n MACGUFFIN_EVENT as any,\n listener\n )\n } finally {\n // We clean up the added event\n originalProcessRemoveAllListeners.call(process, MACGUFFIN_EVENT)\n }\n\n // Add to the beginning of our internal queue\n underlyingListeners.unshift(\n listener as NodeJS.UnhandledRejectionListener\n )\n listenerMetadata.unshift({\n listener: listener as NodeJS.UnhandledRejectionListener,\n once: true,\n })\n return process\n }\n // For other events, use the original method\n return originalProcessPrependOnceListener.call(\n process,\n event as any,\n listener\n )\n } as typeof process.prependOnceListener\n )\n\n // Intercept process.removeAllListeners\n process.removeAllListeners = patchWithoutReentrancy(\n originalProcessRemoveAllListeners,\n function (event?: string | symbol) {\n if (event === 'unhandledRejection') {\n // TODO add warning for this case once we stop importing this in test scopes automatically. Currently\n // we pull this file in whenever build/utils.tsx is imported which is not the right layering.\n // The extensions should be loaded from entrypoints like build/index or next-server\n // warnRemoveAllOnce?.(\n // `\\`process.removeAllListeners('unhandledRejection')\\` was called. Next.js maintains the first 'unhandledRejection' listener to filter out unnecessary rejection warnings caused by aborting prerenders early. It is not recommended that you uninstall this behavior, but if you want to you must you can acquire the listener with \\`process.listeners('unhandledRejection')[0]\\` and remove it with \\`process.removeListener('unhandledRejection', listener)\\`.\n\n // You can silence warnings related to this behavior by running Next.js with \\`NEXT_UNHANDLED_REJECTION_FILTER=silent\\` environment variable.\n\n // You can debug event listener operations by running Next.js with \\`NEXT_UNHANDLED_REJECTION_FILTER=debug\\` environment variable.`\n // )\n debugWithTrace?.(\n `Removing all 'unhandledRejection' listeners except for the Next.js filter.`\n )\n\n underlyingListeners.length = 0\n listenerMetadata.length = 0\n return process\n }\n\n // For other specific events, use the original method\n if (event !== undefined) {\n return originalProcessRemoveAllListeners.call(process, event)\n }\n\n // If no event specified (removeAllListeners()), uninstall our patch completely\n warnUninstalledOnce?.(\n `Uninstalling filter because \\`process.removeAllListeners()\\` was called. Uninstalling this filter is not recommended and will cause you to observe 'unhandledRejection' events related to intentionally aborted prerenders.\n\nYou can silence warnings related to this behavior by running Next.js with \\`NEXT_UNHANDLED_REJECTION_FILTER=silent\\` environment variable.\n\nYou can debug event listener operations by running Next.js with \\`NEXT_UNHANDLED_REJECTION_FILTER=debug\\` environment variable.`\n )\n uninstallUnhandledRejectionFilter()\n return originalProcessRemoveAllListeners.call(process)\n } as typeof process.removeAllListeners\n )\n\n // Intercept process.listeners to return our internal handlers for unhandled rejection\n process.listeners = patchWithoutReentrancy(\n originalProcessListeners,\n function (event: string | symbol) {\n if (event === 'unhandledRejection') {\n debugWithTrace?.(`Retrieving all 'unhandledRejection' listeners.`)\n return [filteringUnhandledRejectionHandler, ...underlyingListeners]\n }\n return originalProcessListeners.call(process, event as any)\n } as typeof process.listeners\n )\n\n filterInstalled = true\n}\n\n/**\n * Uninstalls the unhandled rejection filter and restores original process methods.\n * This is called when someone explicitly removes our filtering handler.\n * @internal\n */\nfunction uninstallUnhandledRejectionFilter(): void {\n if (!filterInstalled) {\n warnWithTrace?.(\n 'Unexpected subsequent filter uninstallation. This is a bug in Next.js'\n )\n return\n }\n\n debug?.('Uninstalling Filter')\n\n // Restore original process methods\n process.on = originalProcessOn\n process.addListener = originalProcessAddListener\n process.once = originalProcessOnce\n process.prependListener = originalProcessPrependListener\n process.prependOnceListener = originalProcessPrependOnceListener\n process.removeListener = originalProcessRemoveListener\n process.off = originalProcessOff\n process.removeAllListeners = originalProcessRemoveAllListeners\n process.listeners = originalProcessListeners\n\n // Remove our filtering handler\n process.removeListener(\n 'unhandledRejection',\n filteringUnhandledRejectionHandler\n )\n\n // Re-register all the handlers that were in our internal queue\n for (const meta of listenerMetadata) {\n if (meta.once) {\n process.once('unhandledRejection', meta.listener)\n } else {\n process.addListener('unhandledRejection', meta.listener)\n }\n }\n\n // Reset state\n filterInstalled = false\n underlyingListeners.length = 0\n listenerMetadata.length = 0\n}\n\n/**\n * The filtering handler that decides whether to suppress or delegate unhandled rejections.\n */\nfunction filteringUnhandledRejectionHandler(\n reason: any,\n promise: Promise<any>\n): void {\n const capturedListenerMetadata = Array.from(listenerMetadata)\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime': {\n const signal = workUnitStore.renderSignal\n if (signal.aborted) {\n // This unhandledRejection is from async work spawned in a now\n // aborted prerender. We don't need to report this.\n return\n }\n break\n }\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n // Not from an aborted prerender, delegate to original handlers\n if (capturedListenerMetadata.length === 0) {\n // We need to log something because the default behavior when there is\n // no event handler installed is to trigger an Unhandled Exception.\n // We don't do that here b/c we don't want to rely on this implicit default\n // to kill the process since it can be disabled by installing a userland listener\n // and you may also choose to run Next.js with args such that unhandled rejections\n // do not automatically terminate the process.\n console.error('Unhandled Rejection:', reason)\n } else {\n try {\n for (const meta of capturedListenerMetadata) {\n if (meta.once) {\n // This is a once listener. we remove it from our set before we call it\n const index = listenerMetadata.indexOf(meta)\n if (index !== -1) {\n underlyingListeners.splice(index, 1)\n listenerMetadata.splice(index, 1)\n }\n }\n const listener = meta.listener\n listener(reason, promise)\n }\n } catch (error) {\n // If any handlers error we produce an Uncaught Exception\n setImmediate(() => {\n throw error\n })\n }\n }\n}\n\n// Install the filter when this module is imported\nif (ENABLE_UHR_FILTER) {\n installUnhandledRejectionFilter()\n}\n"],"names":["workUnitAsyncStorage","MODE","process","env","NEXT_UNHANDLED_REJECTION_FILTER","ENABLE_UHR_FILTER","UHR_FILTER_LOG_LEVEL","undefined","console","error","JSON","stringify","debug","debugWithTrace","warn","warnWithTrace","message","log","DebugWithStack","WarnWithStack","Error","constructor","name","didWarnUninstalled","warnUninstalledOnce","args","filterInstalled","underlyingListeners","listenerMetadata","originalProcessAddListener","originalProcessRemoveListener","originalProcessOn","originalProcessOff","originalProcessPrependListener","originalProcessOnce","originalProcessPrependOnceListener","originalProcessRemoveAllListeners","originalProcessListeners","bypassPatch","patchWithoutReentrancy","original","patchedImpl","patched","Reflect","apply","previousBypassPatch","Object","defineProperty","value","toString","bind","writable","configurable","MACGUFFIN_EVENT","installUnhandledRejectionFilter","Array","from","listeners","map","l","listener","once","removeAllListeners","addListener","filteringUnhandledRejectionHandler","removeListener","on","off","prependListener","prependOnceListener","event","call","push","uninstallUnhandledRejectionFilter","index","lastIndexOf","splice","unshift","length","meta","reason","promise","capturedListenerMetadata","workUnitStore","getStore","type","signal","renderSignal","aborted","indexOf","setImmediate"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;CAmBC,GAED,SAASA,oBAAoB,QAAQ,iDAAgD;AAErF,MAAMC,OAUUC,QAAQC,GAAG,CAACC,+BAA+B;AAE3D,IAAIC,oBAAoB;AACxB,IAAIC,uBAAoD;AAExD,OAAQL;IACN,KAAK;QACHK,uBAAuB;QACvB;IACF,KAAK;QACHA,uBAAuB;QACvB;IACF,KAAK;IACL,KAAK;IACL,KAAK;QACHD,oBAAoB;QACpB;IACF,KAAK;IACL,KAAKE;IACL,KAAK;IACL,KAAK;IACL,KAAK;QACH;IACF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