the-forest/client/node_modules/.cache/babel-loader/bac804a64cea3ff90c3478018e123a246faaa915a941befd755f61bf05078f79.json

1 line
25 KiB
JSON
Raw Normal View History

2024-09-17 20:35:18 -04:00
{"ast":null,"code":"/* global __webpack_require__ */\nvar Refresh = require('react-refresh/runtime');\n\n/**\n * Extracts exports from a webpack module object.\n * @param {string} moduleId A Webpack module ID.\n * @returns {*} An exports object from the module.\n */\nfunction getModuleExports(moduleId) {\n if (typeof moduleId === 'undefined') {\n // `moduleId` is unavailable, which indicates that this module is not in the cache,\n // which means we won't be able to capture any exports,\n // and thus they cannot be refreshed safely.\n // These are likely runtime or dynamically generated modules.\n return {};\n }\n var maybeModule = __webpack_require__.c[moduleId];\n if (typeof maybeModule === 'undefined') {\n // `moduleId` is available but the module in cache is unavailable,\n // which indicates the module is somehow corrupted (e.g. broken Webpacak `module` globals).\n // We will warn the user (as this is likely a mistake) and assume they cannot be refreshed.\n console.warn('[React Refresh] Failed to get exports for module: ' + moduleId + '.');\n return {};\n }\n var exportsOrPromise = maybeModule.exports;\n if (typeof Promise !== 'undefined' && exportsOrPromise instanceof Promise) {\n return exportsOrPromise.then(function (exports) {\n return exports;\n });\n }\n return exportsOrPromise;\n}\n\n/**\n * Calculates the signature of a React refresh boundary.\n * If this signature changes, it's unsafe to accept the boundary.\n *\n * This implementation is based on the one in [Metro](https://github.com/facebook/metro/blob/907d6af22ac6ebe58572be418e9253a90665ecbd/packages/metro/src/lib/polyfills/require.js#L795-L816).\n * @param {*} moduleExports A Webpack module exports object.\n * @returns {string[]} A React refresh boundary signature array.\n */\nfunction getReactRefreshBoundarySignature(moduleExports) {\n var signature = [];\n signature.push(Refresh.getFamilyByType(moduleExports));\n if (moduleExports == null || typeof moduleExports !== 'object') {\n // Exit if we can't iterate over exports.\n return signature;\n }\n for (var key in moduleExports) {\n if (key === '__esModule') {\n continue;\n }\n signature.push(key);\n signature.push(Refresh.getFamilyByType(moduleExports[key]));\n }\n return signature;\n}\n\n/**\n * Creates a data object to be retained across refreshes.\n * This object should not transtively reference previous exports,\n * which can form infinite chain of objects across refreshes, which can pressure RAM.\n *\n * @param {*} moduleExports A Webpack module exports object.\n * @returns {*} A React refresh boundary signature array.\n */\nfunction getWebpackHotData(moduleExports) {\n return {\n signature: getReactRefreshBoundarySignature(moduleExports),\n isReactRefreshBoundary: isReactRefreshBoundary(moduleExports)\n };\n}\n\n/**\n * Creates a helper that performs a delayed React refresh.\n * @returns {function(function(): void): void} A debounced React refresh function.\n */\nfunction createDebounceUpdate() {\n /**\n * A cached setTimeout handler.\n * @type {number | undefined}\n */\n var refreshTimeout;\n\n /**\n * Performs react refresh on a delay and clears the error overlay.\n * @param {function(): void} callback\n * @returns {void}\n */\n function enqueueUpdate(callback) {\n if (typeof refreshTimeout === 'undefined') {\n refreshTimeout = setTimeout(function () {\n refreshTimeout = undefined;\n Refresh.performReactRefresh();\n callback();\n }, 30);\n }\n }\n return enqueueUpdate;\n}\n\n/**\n * Checks if all exports are likely a React component.\n *\n * This implementation is based on the one in [Metro](https://github.com/facebook/metro/blob/febdba2383113c88296c61e28e4ef6a7f4939fda/packages/metro/src/lib/polyfills/require.js#L748-L774).\n * @param {*} moduleExports A Webpack module exports object.\n * @returns {boolean} Whether the exports are React component like.\n */\nfunction isReactRefreshBoundary(moduleExports) {\n if (Refresh.isLikelyComponentType(moduleExp