{"version":3,"file":"react.umd.js","sources":["../../src/act-compat.js","../../src/fire-event.js","../../src/config.js","../../src/pure.js","../../src/index.js"],"sourcesContent":["import * as React from 'react'\nimport * as DeprecatedReactTestUtils from 'react-dom/test-utils'\n\nconst reactAct =\n typeof React.act === 'function' ? React.act : DeprecatedReactTestUtils.act\n\nfunction getGlobalThis() {\n /* istanbul ignore else */\n if (typeof globalThis !== 'undefined') {\n return globalThis\n }\n /* istanbul ignore next */\n if (typeof self !== 'undefined') {\n return self\n }\n /* istanbul ignore next */\n if (typeof window !== 'undefined') {\n return window\n }\n /* istanbul ignore next */\n if (typeof global !== 'undefined') {\n return global\n }\n /* istanbul ignore next */\n throw new Error('unable to locate global object')\n}\n\nfunction setIsReactActEnvironment(isReactActEnvironment) {\n getGlobalThis().IS_REACT_ACT_ENVIRONMENT = isReactActEnvironment\n}\n\nfunction getIsReactActEnvironment() {\n return getGlobalThis().IS_REACT_ACT_ENVIRONMENT\n}\n\nfunction withGlobalActEnvironment(actImplementation) {\n return callback => {\n const previousActEnvironment = getIsReactActEnvironment()\n setIsReactActEnvironment(true)\n try {\n // The return value of `act` is always a thenable.\n let callbackNeedsToBeAwaited = false\n const actResult = actImplementation(() => {\n const result = callback()\n if (\n result !== null &&\n typeof result === 'object' &&\n typeof result.then === 'function'\n ) {\n callbackNeedsToBeAwaited = true\n }\n return result\n })\n if (callbackNeedsToBeAwaited) {\n const thenable = actResult\n return {\n then: (resolve, reject) => {\n thenable.then(\n returnValue => {\n setIsReactActEnvironment(previousActEnvironment)\n resolve(returnValue)\n },\n error => {\n setIsReactActEnvironment(previousActEnvironment)\n reject(error)\n },\n )\n },\n }\n } else {\n setIsReactActEnvironment(previousActEnvironment)\n return actResult\n }\n } catch (error) {\n // Can't be a `finally {}` block since we don't know if we have to immediately restore IS_REACT_ACT_ENVIRONMENT\n // or if we have to await the callback first.\n setIsReactActEnvironment(previousActEnvironment)\n throw error\n }\n }\n}\n\nconst act = withGlobalActEnvironment(reactAct)\n\nexport default act\nexport {\n setIsReactActEnvironment as setReactActEnvironment,\n getIsReactActEnvironment,\n}\n\n/* eslint no-console:0 */\n","import {fireEvent as dtlFireEvent} from '@testing-library/dom'\n\n// react-testing-library's version of fireEvent will call\n// dom-testing-library's version of fireEvent. The reason\n// we make this distinction however is because we have\n// a few extra events that work a bit differently\nconst fireEvent = (...args) => dtlFireEvent(...args)\n\nObject.keys(dtlFireEvent).forEach(key => {\n fireEvent[key] = (...args) => dtlFireEvent[key](...args)\n})\n\n// React event system tracks native mouseOver/mouseOut events for\n// running onMouseEnter/onMouseLeave handlers\n// @link https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/events/EnterLeaveEventPlugin.js#L24-L31\nconst mouseEnter = fireEvent.mouseEnter\nconst mouseLeave = fireEvent.mouseLeave\nfireEvent.mouseEnter = (...args) => {\n mouseEnter(...args)\n return fireEvent.mouseOver(...args)\n}\nfireEvent.mouseLeave = (...args) => {\n mouseLeave(...args)\n return fireEvent.mouseOut(...args)\n}\n\nconst pointerEnter = fireEvent.pointerEnter\nconst pointerLeave = fireEvent.pointerLeave\nfireEvent.pointerEnter = (...args) => {\n pointerEnter(...args)\n return fireEvent.pointerOver(...args)\n}\nfireEvent.pointerLeave = (...args) => {\n pointerLeave(...args)\n return fireEvent.pointerOut(...args)\n}\n\nconst select = fireEvent.select\nfireEvent.select = (node, init) => {\n select(node, init)\n // React tracks this event only on focused inputs\n node.focus()\n\n // React creates this event when one of the following native events happens\n // - contextMenu\n // - mouseUp\n // - dragEnd\n // - keyUp\n // - keyDown\n // so we can use any here\n // @link https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/events/SelectEventPlugin.js#L203-L224\n fireEvent.keyUp(node, init)\n}\n\n// React event system tracks native focusout/focusin events for\n// running blur/focus handlers\n// @link https://github.com/facebook/react/pull/19186\nconst blur = fireEvent.blur\nconst focus = fireEvent.focus\nfireEvent.blur = (...args) => {\n fireEvent.focusOut(...args)\n return blur(...args)\n}\nfireEvent.focus = (...args) => {\n fireEvent.focusIn(...args)\n return focus(...args)\n}\n\nexport {fireEvent}\n","import {\n getConfig as getConfigDTL,\n configure as configureDTL,\n} from '@testing-library/dom'\n\nlet configForRTL = {\n reactStrictMode: false,\n}\n\nfunction getConfig() {\n return {\n ...getConfigDTL(),\n ...configForRTL,\n }\n}\n\nfunction configure(newConfig) {\n if (typeof newConfig === 'function') {\n // Pass the existing config out to the provided function\n // and accept a delta in return\n newConfig = newConfig(getConfig())\n }\n\n const {reactStrictMode, ...configForDTL} = newConfig\n\n configureDTL(configForDTL)\n\n configForRTL = {\n ...configForRTL,\n reactStrictMode,\n }\n}\n\nexport {getConfig, configure}\n","import * as React from 'react'\nimport ReactDOM from 'react-dom'\nimport * as ReactDOMClient from 'react-dom/client'\nimport {\n getQueriesForElement,\n prettyDOM,\n configure as configureDTL,\n} from '@testing-library/dom'\nimport act, {\n getIsReactActEnvironment,\n setReactActEnvironment,\n} from './act-compat'\nimport {fireEvent} from './fire-event'\nimport {getConfig, configure} from './config'\n\nfunction jestFakeTimersAreEnabled() {\n /* istanbul ignore else */\n if (typeof jest !== 'undefined' && jest !== null) {\n return (\n // legacy timers\n setTimeout._isMockFunction === true || // modern timers\n // eslint-disable-next-line prefer-object-has-own -- No Object.hasOwn in all target environments we support.\n Object.prototype.hasOwnProperty.call(setTimeout, 'clock')\n )\n } // istanbul ignore next\n\n return false\n}\n\nconfigureDTL({\n unstable_advanceTimersWrapper: cb => {\n return act(cb)\n },\n // We just want to run `waitFor` without IS_REACT_ACT_ENVIRONMENT\n // But that's not necessarily how `asyncWrapper` is used since it's a public method.\n // Let's just hope nobody else is using it.\n asyncWrapper: async cb => {\n const previousActEnvironment = getIsReactActEnvironment()\n setReactActEnvironment(false)\n try {\n const result = await cb()\n // Drain microtask queue.\n // Otherwise we'll restore the previous act() environment, before we resolve the `waitFor` call.\n // The caller would have no chance to wrap the in-flight Promises in `act()`\n await new Promise(resolve => {\n setTimeout(() => {\n resolve()\n }, 0)\n\n if (jestFakeTimersAreEnabled()) {\n jest.advanceTimersByTime(0)\n }\n })\n\n return result\n } finally {\n setReactActEnvironment(previousActEnvironment)\n }\n },\n eventWrapper: cb => {\n let result\n act(() => {\n result = cb()\n })\n return result\n },\n})\n\n// Ideally we'd just use a WeakMap where containers are keys and roots are values.\n// We use two variables so that we can bail out in constant time when we render with a new container (most common use case)\n/**\n * @type {Set}\n */\nconst mountedContainers = new Set()\n/**\n * @type Array<{container: import('react-dom').Container, root: ReturnType}>\n */\nconst mountedRootEntries = []\n\nfunction strictModeIfNeeded(innerElement, reactStrictMode) {\n return reactStrictMode ?? getConfig().reactStrictMode\n ? React.createElement(React.StrictMode, null, innerElement)\n : innerElement\n}\n\nfunction wrapUiIfNeeded(innerElement, wrapperComponent) {\n return wrapperComponent\n ? React.createElement(wrapperComponent, null, innerElement)\n : innerElement\n}\n\nfunction createConcurrentRoot(\n container,\n {\n hydrate,\n onCaughtError,\n onRecoverableError,\n ui,\n wrapper: WrapperComponent,\n reactStrictMode,\n },\n) {\n let root\n if (hydrate) {\n act(() => {\n root = ReactDOMClient.hydrateRoot(\n container,\n strictModeIfNeeded(\n wrapUiIfNeeded(ui, WrapperComponent),\n reactStrictMode,\n ),\n {onCaughtError, onRecoverableError},\n )\n })\n } else {\n root = ReactDOMClient.createRoot(container, {\n onCaughtError,\n onRecoverableError,\n })\n }\n\n return {\n hydrate() {\n /* istanbul ignore if */\n if (!hydrate) {\n throw new Error(\n 'Attempted to hydrate a non-hydrateable root. This is a bug in `@testing-library/react`.',\n )\n }\n // Nothing to do since hydration happens when creating the root object.\n },\n render(element) {\n root.render(element)\n },\n unmount() {\n root.unmount()\n },\n }\n}\n\nfunction createLegacyRoot(container) {\n return {\n hydrate(element) {\n ReactDOM.hydrate(element, container)\n },\n render(element) {\n ReactDOM.render(element, container)\n },\n unmount() {\n ReactDOM.unmountComponentAtNode(container)\n },\n }\n}\n\nfunction renderRoot(\n ui,\n {\n baseElement,\n container,\n hydrate,\n queries,\n root,\n wrapper: WrapperComponent,\n reactStrictMode,\n },\n) {\n act(() => {\n if (hydrate) {\n root.hydrate(\n strictModeIfNeeded(\n wrapUiIfNeeded(ui, WrapperComponent),\n reactStrictMode,\n ),\n container,\n )\n } else {\n root.render(\n strictModeIfNeeded(\n wrapUiIfNeeded(ui, WrapperComponent),\n reactStrictMode,\n ),\n container,\n )\n }\n })\n\n return {\n container,\n baseElement,\n debug: (el = baseElement, maxLength, options) =>\n Array.isArray(el)\n ? // eslint-disable-next-line no-console\n el.forEach(e => console.log(prettyDOM(e, maxLength, options)))\n : // eslint-disable-next-line no-console,\n console.log(prettyDOM(el, maxLength, options)),\n unmount: () => {\n act(() => {\n root.unmount()\n })\n },\n rerender: rerenderUi => {\n renderRoot(rerenderUi, {\n container,\n baseElement,\n root,\n wrapper: WrapperComponent,\n reactStrictMode,\n })\n // Intentionally do not return anything to avoid unnecessarily complicating the API.\n // folks can use all the same utilities we return in the first place that are bound to the container\n },\n asFragment: () => {\n /* istanbul ignore else (old jsdom limitation) */\n if (typeof document.createRange === 'function') {\n return document\n .createRange()\n .createContextualFragment(container.innerHTML)\n } else {\n const template = document.createElement('template')\n template.innerHTML = container.innerHTML\n return template.content\n }\n },\n ...getQueriesForElement(baseElement, queries),\n }\n}\n\nfunction render(\n ui,\n {\n container,\n baseElement = container,\n legacyRoot = false,\n onCaughtError,\n onUncaughtError,\n onRecoverableError,\n queries,\n hydrate = false,\n wrapper,\n reactStrictMode,\n } = {},\n) {\n if (onUncaughtError !== undefined) {\n throw new Error(\n 'onUncaughtError is not supported. The `render` call will already throw on uncaught errors.',\n )\n }\n if (legacyRoot && typeof ReactDOM.render !== 'function') {\n const error = new Error(\n '`legacyRoot: true` is not supported in this version of React. ' +\n 'If your app runs React 19 or later, you should remove this flag. ' +\n 'If your app runs React 18 or earlier, visit https://react.dev/blog/2022/03/08/react-18-upgrade-guide for upgrade instructions.',\n )\n Error.captureStackTrace(error, render)\n throw error\n }\n\n if (!baseElement) {\n // default to document.body instead of documentElement to avoid output of potentially-large\n // head elements (such as JSS style blocks) in debug output\n baseElement = document.body\n }\n if (!container) {\n container = baseElement.appendChild(document.createElement('div'))\n }\n\n let root\n // eslint-disable-next-line no-negated-condition -- we want to map the evolution of this over time. The root is created first. Only later is it re-used so we don't want to read the case that happens later first.\n if (!mountedContainers.has(container)) {\n const createRootImpl = legacyRoot ? createLegacyRoot : createConcurrentRoot\n root = createRootImpl(container, {\n hydrate,\n onCaughtError,\n onRecoverableError,\n ui,\n wrapper,\n reactStrictMode,\n })\n\n mountedRootEntries.push({container, root})\n // we'll add it to the mounted containers regardless of whether it's actually\n // added to document.body so the cleanup method works regardless of whether\n // they're passing us a custom container or not.\n mountedContainers.add(container)\n } else {\n mountedRootEntries.forEach(rootEntry => {\n // Else is unreachable since `mountedContainers` has the `container`.\n // Only reachable if one would accidentally add the container to `mountedContainers` but not the root to `mountedRootEntries`\n /* istanbul ignore else */\n if (rootEntry.container === container) {\n root = rootEntry.root\n }\n })\n }\n\n return renderRoot(ui, {\n container,\n baseElement,\n queries,\n hydrate,\n wrapper,\n root,\n reactStrictMode,\n })\n}\n\nfunction cleanup() {\n mountedRootEntries.forEach(({root, container}) => {\n act(() => {\n root.unmount()\n })\n if (container.parentNode === document.body) {\n document.body.removeChild(container)\n }\n })\n mountedRootEntries.length = 0\n mountedContainers.clear()\n}\n\nfunction renderHook(renderCallback, options = {}) {\n const {initialProps, ...renderOptions} = options\n\n if (renderOptions.legacyRoot && typeof ReactDOM.render !== 'function') {\n const error = new Error(\n '`legacyRoot: true` is not supported in this version of React. ' +\n 'If your app runs React 19 or later, you should remove this flag. ' +\n 'If your app runs React 18 or earlier, visit https://react.dev/blog/2022/03/08/react-18-upgrade-guide for upgrade instructions.',\n )\n Error.captureStackTrace(error, renderHook)\n throw error\n }\n\n const result = React.createRef()\n\n function TestComponent({renderCallbackProps}) {\n const pendingResult = renderCallback(renderCallbackProps)\n\n React.useEffect(() => {\n result.current = pendingResult\n })\n\n return null\n }\n\n const {rerender: baseRerender, unmount} = render(\n ,\n renderOptions,\n )\n\n function rerender(rerenderCallbackProps) {\n return baseRerender(\n ,\n )\n }\n\n return {result, rerender, unmount}\n}\n\n// just re-export everything from dom-testing-library\nexport * from '@testing-library/dom'\nexport {render, renderHook, cleanup, act, fireEvent, getConfig, configure}\n\n/* eslint func-name-matching:0 */\n","import {getIsReactActEnvironment, setReactActEnvironment} from './act-compat'\nimport {cleanup} from './pure'\n\n// if we're running in a test runner that supports afterEach\n// or teardown then we'll automatically run cleanup afterEach test\n// this ensures that tests run in isolation from each other\n// if you don't like this then either import the `pure` module\n// or set the RTL_SKIP_AUTO_CLEANUP env variable to 'true'.\nif (typeof process === 'undefined' || !process.env?.RTL_SKIP_AUTO_CLEANUP) {\n // ignore teardown() in code coverage because Jest does not support it\n /* istanbul ignore else */\n if (typeof afterEach === 'function') {\n afterEach(() => {\n cleanup()\n })\n } else if (typeof teardown === 'function') {\n // Block is guarded by `typeof` check.\n // eslint does not support `typeof` guards.\n // eslint-disable-next-line no-undef\n teardown(() => {\n cleanup()\n })\n }\n\n // No test setup with other test runners available\n /* istanbul ignore else */\n if (typeof beforeAll === 'function' && typeof afterAll === 'function') {\n // This matches the behavior of React < 18.\n let previousIsReactActEnvironment = getIsReactActEnvironment()\n beforeAll(() => {\n previousIsReactActEnvironment = getIsReactActEnvironment()\n setReactActEnvironment(true)\n })\n\n afterAll(() => {\n setReactActEnvironment(previousIsReactActEnvironment)\n })\n }\n}\n\nexport * from './pure'\n"],"names":["reactAct","React","act","DeprecatedReactTestUtils","getGlobalThis","globalThis","self","window","global","Error","setIsReactActEnvironment","isReactActEnvironment","IS_REACT_ACT_ENVIRONMENT","getIsReactActEnvironment","withGlobalActEnvironment","actImplementation","callback","previousActEnvironment","callbackNeedsToBeAwaited","actResult","result","then","thenable","resolve","reject","returnValue","error","fireEvent","args","dtlFireEvent","Object","keys","forEach","key","mouseEnter","mouseLeave","mouseOver","mouseOut","pointerEnter","pointerLeave","pointerOver","pointerOut","select","node","init","focus","keyUp","blur","focusOut","focusIn","configForRTL","reactStrictMode","getConfig","getConfigDTL","configure","newConfig","configForDTL","configureDTL","jestFakeTimersAreEnabled","jest","setTimeout","_isMockFunction","prototype","hasOwnProperty","call","unstable_advanceTimersWrapper","cb","asyncWrapper","setReactActEnvironment","Promise","advanceTimersByTime","eventWrapper","mountedContainers","Set","mountedRootEntries","strictModeIfNeeded","innerElement","createElement","StrictMode","wrapUiIfNeeded","wrapperComponent","createConcurrentRoot","container","hydrate","onCaughtError","onRecoverableError","ui","wrapper","WrapperComponent","root","ReactDOMClient","hydrateRoot","createRoot","render","element","unmount","createLegacyRoot","ReactDOM","unmountComponentAtNode","renderRoot","baseElement","queries","debug","el","maxLength","options","Array","isArray","e","console","log","prettyDOM","rerender","rerenderUi","asFragment","document","createRange","createContextualFragment","innerHTML","template","content","getQueriesForElement","legacyRoot","onUncaughtError","undefined","captureStackTrace","body","appendChild","has","createRootImpl","push","add","rootEntry","cleanup","parentNode","removeChild","length","clear","renderHook","renderCallback","initialProps","renderOptions","createRef","TestComponent","renderCallbackProps","pendingResult","useEffect","current","baseRerender","rerenderCallbackProps","process","env","RTL_SKIP_AUTO_CLEANUP","afterEach","teardown","beforeAll","afterAll","previousIsReactActEnvironment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA,MAAMA,QAAQ,GACZ,OAAOC,gBAAK,CAACC,GAAG,KAAK,UAAU,GAAGD,gBAAK,CAACC,GAAG,GAAGC,mCAAwB,CAACD,GAAG,CAAA;EAE5E,SAASE,aAAaA,GAAG;EACvB;EACA,EAAA,IAAI,OAAOC,UAAU,KAAK,WAAW,EAAE;EACrC,IAAA,OAAOA,UAAU,CAAA;EACnB,GAAA;EACA;EACA,EAAA,IAAI,OAAOC,IAAI,KAAK,WAAW,EAAE;EAC/B,IAAA,OAAOA,IAAI,CAAA;EACb,GAAA;EACA;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