@trackunit/react-core-contexts-test 1.21.2-alpha-34e3e456eda.0 → 1.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index2.cjs.js CHANGED
@@ -360,6 +360,16 @@ const mockUserSubscriptionContext = {
360
360
  packageType: "EXPAND_FLEET_OWNER",
361
361
  };
362
362
 
363
+ function _objectWithoutPropertiesLoose(r, e) {
364
+ if (null == r) return {};
365
+ var t = {};
366
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
367
+ if (-1 !== e.indexOf(n)) continue;
368
+ t[n] = r[n];
369
+ }
370
+ return t;
371
+ }
372
+
363
373
  function getDefaultExportFromCjs (x) {
364
374
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
365
375
  }
@@ -10412,16 +10422,12 @@ const COMMENT_NODE$1 = 8;
10412
10422
  const FRAGMENT_NODE = 11;
10413
10423
  const ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
10414
10424
  const isCustomElement = val => {
10415
- const {
10416
- tagName
10417
- } = val;
10425
+ const tagName = val.tagName;
10418
10426
  return Boolean(typeof tagName === 'string' && tagName.includes('-') || typeof val.hasAttribute === 'function' && val.hasAttribute('is'));
10419
10427
  };
10420
10428
  const testNode = val => {
10421
10429
  const constructorName = val.constructor.name;
10422
- const {
10423
- nodeType
10424
- } = val;
10430
+ const nodeType = val.nodeType;
10425
10431
  return nodeType === ELEMENT_NODE$1 && (ELEMENT_REGEXP.test(constructorName) || isCustomElement(val)) || nodeType === TEXT_NODE$1 && constructorName === 'Text' || nodeType === COMMENT_NODE$1 && constructorName === 'Comment' || nodeType === FRAGMENT_NODE && constructorName === 'DocumentFragment';
10426
10432
  };
10427
10433
  function nodeIsText(node) {
@@ -10459,14 +10465,14 @@ function createDOMElementFilter(filterNode) {
10459
10465
  }
10460
10466
 
10461
10467
  // We try to load node dependencies
10462
- let chalk = null;
10468
+ let picocolors = null;
10463
10469
  let readFileSync = null;
10464
10470
  let codeFrameColumns = null;
10465
10471
  try {
10466
10472
  const nodeRequire = module && module.require;
10467
10473
  readFileSync = nodeRequire.call(module, 'fs').readFileSync;
10468
10474
  codeFrameColumns = nodeRequire.call(module, '@babel/code-frame').codeFrameColumns;
10469
- chalk = nodeRequire.call(module, 'chalk');
10475
+ picocolors = nodeRequire.call(module, 'picocolors');
10470
10476
  } catch {
10471
10477
  // We're in a browser environment
10472
10478
  }
@@ -10477,7 +10483,10 @@ function getCodeFrame(frame) {
10477
10483
  const locationEnd = frame.indexOf(')');
10478
10484
  const frameLocation = frame.slice(locationStart, locationEnd);
10479
10485
  const frameLocationElements = frameLocation.split(':');
10480
- const [filename, line, column] = [frameLocationElements[0], parseInt(frameLocationElements[1], 10), parseInt(frameLocationElements[2], 10)];
10486
+ const _ref = [frameLocationElements[0], parseInt(frameLocationElements[1], 10), parseInt(frameLocationElements[2], 10)],
10487
+ filename = _ref[0],
10488
+ line = _ref[1],
10489
+ column = _ref[2];
10481
10490
  let rawFileContents = '';
10482
10491
  try {
10483
10492
  rawFileContents = readFileSync(filename, 'utf-8');
@@ -10493,7 +10502,7 @@ function getCodeFrame(frame) {
10493
10502
  highlightCode: true,
10494
10503
  linesBelow: 0
10495
10504
  });
10496
- return chalk.dim(frameLocation) + "\n" + codeFrame + "\n";
10505
+ return picocolors.dim(frameLocation) + "\n" + codeFrame + "\n";
10497
10506
  }
10498
10507
  function getUserCodeFrame() {
10499
10508
  // If we couldn't load dependencies, we can't generate the user trace
@@ -10568,6 +10577,7 @@ function checkContainerType(container) {
10568
10577
  }
10569
10578
  }
10570
10579
 
10580
+ const _excluded$1 = ["filterNode"];
10571
10581
  const shouldHighlight = () => {
10572
10582
  if (typeof process === 'undefined') {
10573
10583
  // Don't colorize in non-node environments (e.g. Browsers)
@@ -10593,9 +10603,7 @@ const shouldHighlight = () => {
10593
10603
  return process.versions !== undefined && process.versions.node !== undefined;
10594
10604
  }
10595
10605
  };
10596
- const {
10597
- DOMCollection
10598
- } = plugins_1;
10606
+ const DOMCollection = plugins_1.DOMCollection;
10599
10607
 
10600
10608
  // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType#node_type_constants
10601
10609
  const ELEMENT_NODE = 1;
@@ -10631,10 +10639,10 @@ function prettyDOM(dom, maxLength, options) {
10631
10639
  if (!('outerHTML' in dom)) {
10632
10640
  throw new TypeError("Expected an element or document but got " + domTypeName);
10633
10641
  }
10634
- const {
10635
- filterNode = filterCommentsAndDefaultIgnoreTagsTags,
10636
- ...prettyFormatOptions
10637
- } = options;
10642
+ const _options = options,
10643
+ _options$filterNode = _options.filterNode,
10644
+ filterNode = _options$filterNode === void 0 ? filterCommentsAndDefaultIgnoreTagsTags : _options$filterNode,
10645
+ prettyFormatOptions = _objectWithoutPropertiesLoose(_options, _excluded$1);
10638
10646
  const debugContent = format_1(dom, {
10639
10647
  plugins: [createDOMElementFilter(filterNode), DOMCollection],
10640
10648
  printFunctionName: false,
@@ -10744,9 +10752,9 @@ function isLabelable(element) {
10744
10752
  return /BUTTON|METER|OUTPUT|PROGRESS|SELECT|TEXTAREA/.test(element.tagName) || element.tagName === 'INPUT' && element.getAttribute('type') !== 'hidden';
10745
10753
  }
10746
10754
  function getLabels(container, element, _temp) {
10747
- let {
10748
- selector = '*'
10749
- } = _temp === void 0 ? {} : _temp;
10755
+ let _ref = _temp === void 0 ? {} : _temp,
10756
+ _ref$selector = _ref.selector,
10757
+ selector = _ref$selector === void 0 ? '*' : _ref$selector;
10750
10758
  const ariaLabelledBy = element.getAttribute('aria-labelledby');
10751
10759
  const labelsId = ariaLabelledBy ? ariaLabelledBy.split(' ') : [];
10752
10760
  return labelsId.length ? labelsId.map(labelId => {
@@ -10771,7 +10779,7 @@ function getLabels(container, element, _temp) {
10771
10779
 
10772
10780
  function assertNotNullOrUndefined(matcher) {
10773
10781
  if (matcher === null || matcher === undefined) {
10774
- throw new Error( // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- implicitly converting `T` to `string`
10782
+ throw new Error(// eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- implicitly converting `T` to `string`
10775
10783
  "It looks like " + matcher + " was passed instead of a matcher. Did you do something like getByText(" + matcher + ")?");
10776
10784
  }
10777
10785
  }
@@ -10804,10 +10812,11 @@ function matches(textToMatch, node, matcher, normalizer) {
10804
10812
  }
10805
10813
  }
10806
10814
  function getDefaultNormalizer(_temp) {
10807
- let {
10808
- trim = true,
10809
- collapseWhitespace = true
10810
- } = _temp === void 0 ? {} : _temp;
10815
+ let _ref = _temp === void 0 ? {} : _temp,
10816
+ _ref$trim = _ref.trim,
10817
+ trim = _ref$trim === void 0 ? true : _ref$trim,
10818
+ _ref$collapseWhitespa = _ref.collapseWhitespace,
10819
+ collapseWhitespace = _ref$collapseWhitespa === void 0 ? true : _ref$collapseWhitespa;
10811
10820
  return text => {
10812
10821
  let normalizedText = text;
10813
10822
  normalizedText = trim ? normalizedText.trim() : normalizedText;
@@ -10826,12 +10835,10 @@ function getDefaultNormalizer(_temp) {
10826
10835
  * @returns {Function} A normalizer
10827
10836
  */
10828
10837
 
10829
- function makeNormalizer(_ref) {
10830
- let {
10831
- trim,
10832
- collapseWhitespace,
10833
- normalizer
10834
- } = _ref;
10838
+ function makeNormalizer(_ref2) {
10839
+ let trim = _ref2.trim,
10840
+ collapseWhitespace = _ref2.collapseWhitespace,
10841
+ normalizer = _ref2.normalizer;
10835
10842
  if (!normalizer) {
10836
10843
  // No custom normalizer specified. Just use default.
10837
10844
  return getDefaultNormalizer({
@@ -10899,9 +10906,9 @@ function isInaccessible(element, options) {
10899
10906
  if (options === void 0) {
10900
10907
  options = {};
10901
10908
  }
10902
- const {
10903
- isSubtreeInaccessible: isSubtreeInaccessibleImpl = isSubtreeInaccessible
10904
- } = options;
10909
+ const _options = options,
10910
+ _options$isSubtreeIna = _options.isSubtreeInaccessible,
10911
+ isSubtreeInaccessibleImpl = _options$isSubtreeIna === void 0 ? isSubtreeInaccessible : _options$isSubtreeIna;
10905
10912
  const window = element.ownerDocument.defaultView;
10906
10913
  // since visibility is inherited we can exit early
10907
10914
  if (window.getComputedStyle(element).visibility === 'hidden') {
@@ -10919,10 +10926,9 @@ function isInaccessible(element, options) {
10919
10926
  function getImplicitAriaRoles(currentNode) {
10920
10927
  // eslint bug here:
10921
10928
  // eslint-disable-next-line no-unused-vars
10922
- for (const {
10923
- match,
10924
- roles
10925
- } of elementRoleList) {
10929
+ for (const _ref of elementRoleList) {
10930
+ const match = _ref.match;
10931
+ const roles = _ref.roles;
10926
10932
  if (match(currentNode)) {
10927
10933
  return [...roles];
10928
10934
  }
@@ -10930,17 +10936,14 @@ function getImplicitAriaRoles(currentNode) {
10930
10936
  return [];
10931
10937
  }
10932
10938
  function buildElementRoleList(elementRolesMap) {
10933
- function makeElementSelector(_ref) {
10934
- let {
10935
- name,
10936
- attributes
10937
- } = _ref;
10938
- return "" + name + attributes.map(_ref2 => {
10939
- let {
10940
- name: attributeName,
10941
- value,
10942
- constraints = []
10943
- } = _ref2;
10939
+ function makeElementSelector(_ref2) {
10940
+ let name = _ref2.name,
10941
+ attributes = _ref2.attributes;
10942
+ return "" + name + attributes.map(_ref3 => {
10943
+ let attributeName = _ref3.name,
10944
+ value = _ref3.value,
10945
+ _ref3$constraints = _ref3.constraints,
10946
+ constraints = _ref3$constraints === void 0 ? [] : _ref3$constraints;
10944
10947
  const shouldNotExist = constraints.indexOf('undefined') !== -1;
10945
10948
  const shouldBeNonEmpty = constraints.indexOf('set') !== -1;
10946
10949
  const hasExplicitValue = typeof value !== 'undefined';
@@ -10954,25 +10957,19 @@ function buildElementRoleList(elementRolesMap) {
10954
10957
  return "[" + attributeName + "]";
10955
10958
  }).join('');
10956
10959
  }
10957
- function getSelectorSpecificity(_ref3) {
10958
- let {
10959
- attributes = []
10960
- } = _ref3;
10960
+ function getSelectorSpecificity(_ref4) {
10961
+ let _ref4$attributes = _ref4.attributes,
10962
+ attributes = _ref4$attributes === void 0 ? [] : _ref4$attributes;
10961
10963
  return attributes.length;
10962
10964
  }
10963
- function bySelectorSpecificity(_ref4, _ref5) {
10964
- let {
10965
- specificity: leftSpecificity
10966
- } = _ref4;
10967
- let {
10968
- specificity: rightSpecificity
10969
- } = _ref5;
10965
+ function bySelectorSpecificity(_ref5, _ref6) {
10966
+ let leftSpecificity = _ref5.specificity;
10967
+ let rightSpecificity = _ref6.specificity;
10970
10968
  return rightSpecificity - leftSpecificity;
10971
10969
  }
10972
10970
  function match(element) {
10973
- let {
10974
- attributes = []
10975
- } = element;
10971
+ let _element$attributes = element.attributes,
10972
+ attributes = _element$attributes === void 0 ? [] : _element$attributes;
10976
10973
 
10977
10974
  // https://github.com/testing-library/dom-testing-library/issues/814
10978
10975
  const typeTextIndex = attributes.findIndex(attribute => attribute.value && attribute.name === 'type' && attribute.value === 'text');
@@ -10995,7 +10992,9 @@ function buildElementRoleList(elementRolesMap) {
10995
10992
 
10996
10993
  // eslint bug here:
10997
10994
  // eslint-disable-next-line no-unused-vars
10998
- for (const [element, roles] of elementRolesMap.entries()) {
10995
+ for (const _ref7 of elementRolesMap.entries()) {
10996
+ const element = _ref7[0];
10997
+ const roles = _ref7[1];
10999
10998
  result = [...result, {
11000
10999
  match: match(element),
11001
11000
  roles: Array.from(roles),
@@ -11005,9 +11004,9 @@ function buildElementRoleList(elementRolesMap) {
11005
11004
  return result.sort(bySelectorSpecificity);
11006
11005
  }
11007
11006
  function getRoles(container, _temp) {
11008
- let {
11009
- hidden = false
11010
- } = _temp === void 0 ? {} : _temp;
11007
+ let _ref8 = _temp === void 0 ? {} : _temp,
11008
+ _ref8$hidden = _ref8.hidden,
11009
+ hidden = _ref8$hidden === void 0 ? false : _ref8$hidden;
11011
11010
  function flattenDOM(node) {
11012
11011
  return [node, ...Array.from(node.children).reduce((acc, child) => [...acc, ...flattenDOM(child)], [])];
11013
11012
  }
@@ -11030,20 +11029,19 @@ function getRoles(container, _temp) {
11030
11029
  }, acc);
11031
11030
  }, {});
11032
11031
  }
11033
- function prettyRoles(dom, _ref6) {
11034
- let {
11035
- hidden,
11036
- includeDescription
11037
- } = _ref6;
11032
+ function prettyRoles(dom, _ref9) {
11033
+ let hidden = _ref9.hidden,
11034
+ includeDescription = _ref9.includeDescription;
11038
11035
  const roles = getRoles(dom, {
11039
11036
  hidden
11040
11037
  });
11041
11038
  // We prefer to skip generic role, we don't recommend it
11042
- return Object.entries(roles).filter(_ref7 => {
11043
- let [role] = _ref7;
11039
+ return Object.entries(roles).filter(_ref0 => {
11040
+ let role = _ref0[0];
11044
11041
  return role !== 'generic';
11045
- }).map(_ref8 => {
11046
- let [role, elements] = _ref8;
11042
+ }).map(_ref1 => {
11043
+ let role = _ref1[0],
11044
+ elements = _ref1[1];
11047
11045
  const delimiterBar = '-'.repeat(50);
11048
11046
  const elementsString = elements.map(el => {
11049
11047
  const nameString = "Name \"" + computeAccessibleName(el, {
@@ -11119,9 +11117,9 @@ function computeAriaPressed(element) {
11119
11117
  * @returns {boolean | string | null} -
11120
11118
  */
11121
11119
  function computeAriaCurrent(element) {
11122
- var _ref9, _checkBooleanAttribut;
11120
+ var _ref11, _checkBooleanAttribut;
11123
11121
  // https://www.w3.org/TR/wai-aria-1.1/#aria-current
11124
- return (_ref9 = (_checkBooleanAttribut = checkBooleanAttribute(element, 'aria-current')) != null ? _checkBooleanAttribut : element.getAttribute('aria-current')) != null ? _ref9 : false;
11122
+ return (_ref11 = (_checkBooleanAttribut = checkBooleanAttribute(element, 'aria-current')) != null ? _checkBooleanAttribut : element.getAttribute('aria-current')) != null ? _ref11 : false;
11125
11123
  }
11126
11124
 
11127
11125
  /**
@@ -11208,10 +11206,8 @@ function getRegExpMatcher(string) {
11208
11206
  return new RegExp(escapeRegExp(string.toLowerCase()), 'i');
11209
11207
  }
11210
11208
  function makeSuggestion(queryName, element, content, _ref) {
11211
- let {
11212
- variant,
11213
- name
11214
- } = _ref;
11209
+ let variant = _ref.variant,
11210
+ name = _ref.name;
11215
11211
  let warning = '';
11216
11212
  const queryOptions = {};
11217
11213
  const queryArgs = [['Role', 'TestId'].includes(queryName) ? content : getRegExpMatcher(content)];
@@ -11236,10 +11232,12 @@ function makeSuggestion(queryName, element, content, _ref) {
11236
11232
  if (warning) {
11237
11233
  console.warn(warning);
11238
11234
  }
11239
- let [text, options] = queryArgs;
11235
+ let text = queryArgs[0],
11236
+ options = queryArgs[1];
11240
11237
  text = typeof text === 'string' ? "'" + text + "'" : text;
11241
11238
  options = options ? ", { " + Object.entries(options).map(_ref2 => {
11242
- let [k, v] = _ref2;
11239
+ let k = _ref2[0],
11240
+ v = _ref2[1];
11243
11241
  return k + ": " + v;
11244
11242
  }).join(', ') + " }" : '';
11245
11243
  return queryMethod + "(" + text + options + ")";
@@ -11319,25 +11317,29 @@ function copyStackTrace(target, source) {
11319
11317
  target.stack = source.stack.replace(source.message, target.message);
11320
11318
  }
11321
11319
  function waitFor(callback, _ref) {
11322
- let {
11323
- container = getDocument(),
11324
- timeout = getConfig$1().asyncUtilTimeout,
11325
- showOriginalStackTrace = getConfig$1().showOriginalStackTrace,
11326
- stackTraceError,
11327
- interval = 50,
11328
- onTimeout = error => {
11320
+ let _ref$container = _ref.container,
11321
+ container = _ref$container === void 0 ? getDocument() : _ref$container,
11322
+ _ref$timeout = _ref.timeout,
11323
+ timeout = _ref$timeout === void 0 ? getConfig$1().asyncUtilTimeout : _ref$timeout,
11324
+ _ref$showOriginalStac = _ref.showOriginalStackTrace,
11325
+ showOriginalStackTrace = _ref$showOriginalStac === void 0 ? getConfig$1().showOriginalStackTrace : _ref$showOriginalStac,
11326
+ stackTraceError = _ref.stackTraceError,
11327
+ _ref$interval = _ref.interval,
11328
+ interval = _ref$interval === void 0 ? 50 : _ref$interval,
11329
+ _ref$onTimeout = _ref.onTimeout,
11330
+ onTimeout = _ref$onTimeout === void 0 ? error => {
11329
11331
  Object.defineProperty(error, 'message', {
11330
11332
  value: getConfig$1().getElementError(error.message, container).message
11331
11333
  });
11332
11334
  return error;
11333
- },
11334
- mutationObserverOptions = {
11335
+ } : _ref$onTimeout,
11336
+ _ref$mutationObserver = _ref.mutationObserverOptions,
11337
+ mutationObserverOptions = _ref$mutationObserver === void 0 ? {
11335
11338
  subtree: true,
11336
11339
  childList: true,
11337
11340
  attributes: true,
11338
11341
  characterData: true
11339
- }
11340
- } = _ref;
11342
+ } : _ref$mutationObserver;
11341
11343
  if (typeof callback !== 'function') {
11342
11344
  throw new TypeError('Received `callback` arg must be a function');
11343
11345
  }
@@ -11348,9 +11350,8 @@ function waitFor(callback, _ref) {
11348
11350
  const overallTimeoutTimer = setTimeout(handleTimeout, timeout);
11349
11351
  const usingJestFakeTimers = jestFakeTimersAreEnabled$1();
11350
11352
  if (usingJestFakeTimers) {
11351
- const {
11352
- unstable_advanceTimersWrapper: advanceTimersWrapper
11353
- } = getConfig$1();
11353
+ const _getConfig = getConfig$1(),
11354
+ advanceTimersWrapper = _getConfig.unstable_advanceTimersWrapper;
11354
11355
  checkCallback();
11355
11356
  // this is a dangerous rule to disable because it could lead to an
11356
11357
  // infinite loop. However, eslint isn't smart enough to know that we're
@@ -11397,9 +11398,8 @@ function waitFor(callback, _ref) {
11397
11398
  return;
11398
11399
  }
11399
11400
  intervalId = setInterval(checkRealTimersCallback, interval);
11400
- const {
11401
- MutationObserver
11402
- } = getWindowFromNode(container);
11401
+ const _getWindowFromNode = getWindowFromNode(container),
11402
+ MutationObserver = _getWindowFromNode.MutationObserver;
11403
11403
  observer = new MutationObserver(checkRealTimersCallback);
11404
11404
  observer.observe(container, mutationObserverOptions);
11405
11405
  checkCallback();
@@ -11487,12 +11487,12 @@ function getMultipleElementsFoundError(message, container) {
11487
11487
  return getElementError(message + "\n\n(If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)).", container);
11488
11488
  }
11489
11489
  function queryAllByAttribute(attribute, container, text, _temp) {
11490
- let {
11491
- exact = true,
11492
- collapseWhitespace,
11493
- trim,
11494
- normalizer
11495
- } = _temp === void 0 ? {} : _temp;
11490
+ let _ref = _temp === void 0 ? {} : _temp,
11491
+ _ref$exact = _ref.exact,
11492
+ exact = _ref$exact === void 0 ? true : _ref$exact,
11493
+ collapseWhitespace = _ref.collapseWhitespace,
11494
+ trim = _ref.trim,
11495
+ normalizer = _ref.normalizer;
11496
11496
  const matcher = exact ? matches : fuzzyMatches;
11497
11497
  const matchNormalizer = makeNormalizer({
11498
11498
  collapseWhitespace,
@@ -11554,9 +11554,11 @@ const wrapSingleQueryWithSuggestion = (query, queryAllByName, variant) => functi
11554
11554
  args[_key3 - 1] = arguments[_key3];
11555
11555
  }
11556
11556
  const element = query(container, ...args);
11557
- const [{
11558
- suggest = getConfig$1().throwSuggestions
11559
- } = {}] = args.slice(-1);
11557
+ const _ref2 = args.slice(-1),
11558
+ _ref2$ = _ref2[0],
11559
+ _ref2$2 = _ref2$ === void 0 ? {} : _ref2$,
11560
+ _ref2$2$suggest = _ref2$2.suggest,
11561
+ suggest = _ref2$2$suggest === void 0 ? getConfig$1().throwSuggestions : _ref2$2$suggest;
11560
11562
  if (element && suggest) {
11561
11563
  const suggestion = getSuggestedQuery(element, variant);
11562
11564
  if (suggestion && !queryAllByName.endsWith(suggestion.queryName)) {
@@ -11570,9 +11572,11 @@ const wrapAllByQueryWithSuggestion = (query, queryAllByName, variant) => functio
11570
11572
  args[_key4 - 1] = arguments[_key4];
11571
11573
  }
11572
11574
  const els = query(container, ...args);
11573
- const [{
11574
- suggest = getConfig$1().throwSuggestions
11575
- } = {}] = args.slice(-1);
11575
+ const _ref3 = args.slice(-1),
11576
+ _ref3$ = _ref3[0],
11577
+ _ref3$2 = _ref3$ === void 0 ? {} : _ref3$,
11578
+ _ref3$2$suggest = _ref3$2.suggest,
11579
+ suggest = _ref3$2$suggest === void 0 ? getConfig$1().throwSuggestions : _ref3$2$suggest;
11576
11580
  if (els.length && suggest) {
11577
11581
  // get a unique list of all suggestion messages. We are only going to make a suggestion if
11578
11582
  // all the suggestions are the same
@@ -11612,19 +11616,17 @@ function queryAllLabels(container) {
11612
11616
  textToMatch: getLabelContent(node)
11613
11617
  };
11614
11618
  }).filter(_ref => {
11615
- let {
11616
- textToMatch
11617
- } = _ref;
11619
+ let textToMatch = _ref.textToMatch;
11618
11620
  return textToMatch !== null;
11619
11621
  });
11620
11622
  }
11621
11623
  const queryAllLabelsByText = function (container, text, _temp) {
11622
- let {
11623
- exact = true,
11624
- trim,
11625
- collapseWhitespace,
11626
- normalizer
11627
- } = _temp === void 0 ? {} : _temp;
11624
+ let _ref2 = _temp === void 0 ? {} : _temp,
11625
+ _ref2$exact = _ref2.exact,
11626
+ exact = _ref2$exact === void 0 ? true : _ref2$exact,
11627
+ trim = _ref2.trim,
11628
+ collapseWhitespace = _ref2.collapseWhitespace,
11629
+ normalizer = _ref2.normalizer;
11628
11630
  const matcher = exact ? matches : fuzzyMatches;
11629
11631
  const matchNormalizer = makeNormalizer({
11630
11632
  collapseWhitespace,
@@ -11632,27 +11634,24 @@ const queryAllLabelsByText = function (container, text, _temp) {
11632
11634
  normalizer
11633
11635
  });
11634
11636
  const textToMatchByLabels = queryAllLabels(container);
11635
- return textToMatchByLabels.filter(_ref2 => {
11636
- let {
11637
- node,
11638
- textToMatch
11639
- } = _ref2;
11637
+ return textToMatchByLabels.filter(_ref3 => {
11638
+ let node = _ref3.node,
11639
+ textToMatch = _ref3.textToMatch;
11640
11640
  return matcher(textToMatch, node, text, matchNormalizer);
11641
- }).map(_ref3 => {
11642
- let {
11643
- node
11644
- } = _ref3;
11641
+ }).map(_ref4 => {
11642
+ let node = _ref4.node;
11645
11643
  return node;
11646
11644
  });
11647
11645
  };
11648
11646
  const queryAllByLabelText = function (container, text, _temp2) {
11649
- let {
11650
- selector = '*',
11651
- exact = true,
11652
- collapseWhitespace,
11653
- trim,
11654
- normalizer
11655
- } = _temp2 === void 0 ? {} : _temp2;
11647
+ let _ref5 = _temp2 === void 0 ? {} : _temp2,
11648
+ _ref5$selector = _ref5.selector,
11649
+ selector = _ref5$selector === void 0 ? '*' : _ref5$selector,
11650
+ _ref5$exact = _ref5.exact,
11651
+ exact = _ref5$exact === void 0 ? true : _ref5$exact,
11652
+ collapseWhitespace = _ref5.collapseWhitespace,
11653
+ trim = _ref5.trim,
11654
+ normalizer = _ref5.normalizer;
11656
11655
  checkContainerType(container);
11657
11656
  const matcher = exact ? matches : fuzzyMatches;
11658
11657
  const matchNormalizer = makeNormalizer({
@@ -11753,17 +11752,24 @@ const queryAllByPlaceholderText = function () {
11753
11752
  const getMultipleError$6 = (c, text) => "Found multiple elements with the placeholder text of: " + text;
11754
11753
  const getMissingError$6 = (c, text) => "Unable to find an element with the placeholder text of: " + text;
11755
11754
  const queryAllByPlaceholderTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByPlaceholderText, queryAllByPlaceholderText.name, 'queryAll');
11756
- const [queryByPlaceholderText, getAllByPlaceholderText, getByPlaceholderText, findAllByPlaceholderText, findByPlaceholderText] = buildQueries(queryAllByPlaceholderText, getMultipleError$6, getMissingError$6);
11755
+ const _buildQueries$6 = buildQueries(queryAllByPlaceholderText, getMultipleError$6, getMissingError$6),
11756
+ queryByPlaceholderText = _buildQueries$6[0],
11757
+ getAllByPlaceholderText = _buildQueries$6[1],
11758
+ getByPlaceholderText = _buildQueries$6[2],
11759
+ findAllByPlaceholderText = _buildQueries$6[3],
11760
+ findByPlaceholderText = _buildQueries$6[4];
11757
11761
 
11758
11762
  const queryAllByText = function (container, text, _temp) {
11759
- let {
11760
- selector = '*',
11761
- exact = true,
11762
- collapseWhitespace,
11763
- trim,
11764
- ignore = getConfig$1().defaultIgnore,
11765
- normalizer
11766
- } = _temp === void 0 ? {} : _temp;
11763
+ let _ref = _temp === void 0 ? {} : _temp,
11764
+ _ref$selector = _ref.selector,
11765
+ selector = _ref$selector === void 0 ? '*' : _ref$selector,
11766
+ _ref$exact = _ref.exact,
11767
+ exact = _ref$exact === void 0 ? true : _ref$exact,
11768
+ collapseWhitespace = _ref.collapseWhitespace,
11769
+ trim = _ref.trim,
11770
+ _ref$ignore = _ref.ignore,
11771
+ ignore = _ref$ignore === void 0 ? getConfig$1().defaultIgnore : _ref$ignore,
11772
+ normalizer = _ref.normalizer;
11767
11773
  checkContainerType(container);
11768
11774
  const matcher = exact ? matches : fuzzyMatches;
11769
11775
  const matchNormalizer = makeNormalizer({
@@ -11784,12 +11790,11 @@ const getMissingError$5 = function (c, text, options) {
11784
11790
  if (options === void 0) {
11785
11791
  options = {};
11786
11792
  }
11787
- const {
11788
- collapseWhitespace,
11789
- trim,
11790
- normalizer,
11791
- selector
11792
- } = options;
11793
+ const _options = options,
11794
+ collapseWhitespace = _options.collapseWhitespace,
11795
+ trim = _options.trim,
11796
+ normalizer = _options.normalizer,
11797
+ selector = _options.selector;
11793
11798
  const matchNormalizer = makeNormalizer({
11794
11799
  collapseWhitespace,
11795
11800
  trim,
@@ -11801,15 +11806,20 @@ const getMissingError$5 = function (c, text, options) {
11801
11806
  return "Unable to find an element with the text: " + (isNormalizedDifferent ? normalizedText + " (normalized from '" + text + "')" : text) + (isCustomSelector ? ", which matches selector '" + selector + "'" : '') + ". This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.";
11802
11807
  };
11803
11808
  const queryAllByTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByText, queryAllByText.name, 'queryAll');
11804
- const [queryByText, getAllByText, getByText, findAllByText, findByText] = buildQueries(queryAllByText, getMultipleError$5, getMissingError$5);
11809
+ const _buildQueries$5 = buildQueries(queryAllByText, getMultipleError$5, getMissingError$5),
11810
+ queryByText = _buildQueries$5[0],
11811
+ getAllByText = _buildQueries$5[1],
11812
+ getByText = _buildQueries$5[2],
11813
+ findAllByText = _buildQueries$5[3],
11814
+ findByText = _buildQueries$5[4];
11805
11815
 
11806
11816
  const queryAllByDisplayValue = function (container, value, _temp) {
11807
- let {
11808
- exact = true,
11809
- collapseWhitespace,
11810
- trim,
11811
- normalizer
11812
- } = _temp === void 0 ? {} : _temp;
11817
+ let _ref = _temp === void 0 ? {} : _temp,
11818
+ _ref$exact = _ref.exact,
11819
+ exact = _ref$exact === void 0 ? true : _ref$exact,
11820
+ collapseWhitespace = _ref.collapseWhitespace,
11821
+ trim = _ref.trim,
11822
+ normalizer = _ref.normalizer;
11813
11823
  checkContainerType(container);
11814
11824
  const matcher = exact ? matches : fuzzyMatches;
11815
11825
  const matchNormalizer = makeNormalizer({
@@ -11829,7 +11839,12 @@ const queryAllByDisplayValue = function (container, value, _temp) {
11829
11839
  const getMultipleError$4 = (c, value) => "Found multiple elements with the display value: " + value + ".";
11830
11840
  const getMissingError$4 = (c, value) => "Unable to find an element with the display value: " + value + ".";
11831
11841
  const queryAllByDisplayValueWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByDisplayValue, queryAllByDisplayValue.name, 'queryAll');
11832
- const [queryByDisplayValue, getAllByDisplayValue, getByDisplayValue, findAllByDisplayValue, findByDisplayValue] = buildQueries(queryAllByDisplayValue, getMultipleError$4, getMissingError$4);
11842
+ const _buildQueries$4 = buildQueries(queryAllByDisplayValue, getMultipleError$4, getMissingError$4),
11843
+ queryByDisplayValue = _buildQueries$4[0],
11844
+ getAllByDisplayValue = _buildQueries$4[1],
11845
+ getByDisplayValue = _buildQueries$4[2],
11846
+ findAllByDisplayValue = _buildQueries$4[3],
11847
+ findByDisplayValue = _buildQueries$4[4];
11833
11848
 
11834
11849
  // Valid tags are img, input, area and custom elements
11835
11850
  const VALID_TAG_REGEXP = /^(img|input|area|.+-.+)$/i;
@@ -11843,19 +11858,24 @@ const queryAllByAltText = function (container, alt, options) {
11843
11858
  const getMultipleError$3 = (c, alt) => "Found multiple elements with the alt text: " + alt;
11844
11859
  const getMissingError$3 = (c, alt) => "Unable to find an element with the alt text: " + alt;
11845
11860
  const queryAllByAltTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByAltText, queryAllByAltText.name, 'queryAll');
11846
- const [queryByAltText, getAllByAltText, getByAltText, findAllByAltText, findByAltText] = buildQueries(queryAllByAltText, getMultipleError$3, getMissingError$3);
11861
+ const _buildQueries$3 = buildQueries(queryAllByAltText, getMultipleError$3, getMissingError$3),
11862
+ queryByAltText = _buildQueries$3[0],
11863
+ getAllByAltText = _buildQueries$3[1],
11864
+ getByAltText = _buildQueries$3[2],
11865
+ findAllByAltText = _buildQueries$3[3],
11866
+ findByAltText = _buildQueries$3[4];
11847
11867
 
11848
11868
  const isSvgTitle = node => {
11849
11869
  var _node$parentElement;
11850
11870
  return node.tagName.toLowerCase() === 'title' && ((_node$parentElement = node.parentElement) == null ? void 0 : _node$parentElement.tagName.toLowerCase()) === 'svg';
11851
11871
  };
11852
11872
  const queryAllByTitle = function (container, text, _temp) {
11853
- let {
11854
- exact = true,
11855
- collapseWhitespace,
11856
- trim,
11857
- normalizer
11858
- } = _temp === void 0 ? {} : _temp;
11873
+ let _ref = _temp === void 0 ? {} : _temp,
11874
+ _ref$exact = _ref.exact,
11875
+ exact = _ref$exact === void 0 ? true : _ref$exact,
11876
+ collapseWhitespace = _ref.collapseWhitespace,
11877
+ trim = _ref.trim,
11878
+ normalizer = _ref.normalizer;
11859
11879
  checkContainerType(container);
11860
11880
  const matcher = exact ? matches : fuzzyMatches;
11861
11881
  const matchNormalizer = makeNormalizer({
@@ -11868,29 +11888,35 @@ const queryAllByTitle = function (container, text, _temp) {
11868
11888
  const getMultipleError$2 = (c, title) => "Found multiple elements with the title: " + title + ".";
11869
11889
  const getMissingError$2 = (c, title) => "Unable to find an element with the title: " + title + ".";
11870
11890
  const queryAllByTitleWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByTitle, queryAllByTitle.name, 'queryAll');
11871
- const [queryByTitle, getAllByTitle, getByTitle, findAllByTitle, findByTitle] = buildQueries(queryAllByTitle, getMultipleError$2, getMissingError$2);
11891
+ const _buildQueries$2 = buildQueries(queryAllByTitle, getMultipleError$2, getMissingError$2),
11892
+ queryByTitle = _buildQueries$2[0],
11893
+ getAllByTitle = _buildQueries$2[1],
11894
+ getByTitle = _buildQueries$2[2],
11895
+ findAllByTitle = _buildQueries$2[3],
11896
+ findByTitle = _buildQueries$2[4];
11872
11897
 
11873
11898
  /* eslint-disable complexity */
11874
11899
  const queryAllByRole = function (container, role, _temp) {
11875
- let {
11876
- hidden = getConfig$1().defaultHidden,
11877
- name,
11878
- description,
11879
- queryFallbacks = false,
11880
- selected,
11881
- busy,
11882
- checked,
11883
- pressed,
11884
- current,
11885
- level,
11886
- expanded,
11887
- value: {
11888
- now: valueNow,
11889
- min: valueMin,
11890
- max: valueMax,
11891
- text: valueText
11892
- } = {}
11893
- } = _temp === void 0 ? {} : _temp;
11900
+ let _ref = _temp === void 0 ? {} : _temp,
11901
+ _ref$hidden = _ref.hidden,
11902
+ hidden = _ref$hidden === void 0 ? getConfig$1().defaultHidden : _ref$hidden,
11903
+ name = _ref.name,
11904
+ description = _ref.description,
11905
+ _ref$queryFallbacks = _ref.queryFallbacks,
11906
+ queryFallbacks = _ref$queryFallbacks === void 0 ? false : _ref$queryFallbacks,
11907
+ selected = _ref.selected,
11908
+ busy = _ref.busy,
11909
+ checked = _ref.checked,
11910
+ pressed = _ref.pressed,
11911
+ current = _ref.current,
11912
+ level = _ref.level,
11913
+ expanded = _ref.expanded,
11914
+ _ref$value = _ref.value,
11915
+ _ref$value2 = _ref$value === void 0 ? {} : _ref$value,
11916
+ valueNow = _ref$value2.now,
11917
+ valueMin = _ref$value2.min,
11918
+ valueMax = _ref$value2.max,
11919
+ valueText = _ref$value2.text;
11894
11920
  checkContainerType(container);
11895
11921
  if (selected !== undefined) {
11896
11922
  var _allRoles$get;
@@ -11965,9 +11991,9 @@ const queryAllByRole = function (container, role, _temp) {
11965
11991
  }
11966
11992
  }
11967
11993
  if (expanded !== undefined) {
11968
- var _allRoles$get10;
11994
+ var _allRoles$get0;
11969
11995
  // guard against unknown roles
11970
- if (((_allRoles$get10 = roles_1.get(role)) == null ? void 0 : _allRoles$get10.props['aria-expanded']) === undefined) {
11996
+ if (((_allRoles$get0 = roles_1.get(role)) == null ? void 0 : _allRoles$get0.props['aria-expanded']) === undefined) {
11971
11997
  throw new Error("\"aria-expanded\" is not supported on role \"" + role + "\".");
11972
11998
  }
11973
11999
  }
@@ -11988,7 +12014,8 @@ const queryAllByRole = function (container, role, _temp) {
11988
12014
  return roleValue.split(' ').filter(Boolean).some(roleAttributeToken => roleAttributeToken === role);
11989
12015
  }
11990
12016
  // other wise only send the first token to match
11991
- const [firstRoleAttributeToken] = roleValue.split(' ');
12017
+ const _roleValue$split = roleValue.split(' '),
12018
+ firstRoleAttributeToken = _roleValue$split[0];
11992
12019
  return firstRoleAttributeToken === role;
11993
12020
  }
11994
12021
  const implicitRoles = getImplicitAriaRoles(node);
@@ -12062,10 +12089,8 @@ function makeRoleSelector(role) {
12062
12089
  var _roleElements$get;
12063
12090
  const explicitRoleSelector = "*[role~=\"" + role + "\"]";
12064
12091
  const roleRelations = (_roleElements$get = roleElements_1.get(role)) != null ? _roleElements$get : new Set();
12065
- const implicitRoleSelectors = new Set(Array.from(roleRelations).map(_ref => {
12066
- let {
12067
- name
12068
- } = _ref;
12092
+ const implicitRoleSelectors = new Set(Array.from(roleRelations).map(_ref2 => {
12093
+ let name = _ref2.name;
12069
12094
  return name;
12070
12095
  }));
12071
12096
 
@@ -12086,17 +12111,16 @@ const getNameHint = name => {
12086
12111
  return nameHint;
12087
12112
  };
12088
12113
  const getMultipleError$1 = function (c, role, _temp2) {
12089
- let {
12090
- name
12091
- } = _temp2 === void 0 ? {} : _temp2;
12114
+ let _ref3 = _temp2 === void 0 ? {} : _temp2,
12115
+ name = _ref3.name;
12092
12116
  return "Found multiple elements with the role \"" + role + "\"" + getNameHint(name);
12093
12117
  };
12094
12118
  const getMissingError$1 = function (container, role, _temp3) {
12095
- let {
12096
- hidden = getConfig$1().defaultHidden,
12097
- name,
12098
- description
12099
- } = _temp3 === void 0 ? {} : _temp3;
12119
+ let _ref4 = _temp3 === void 0 ? {} : _temp3,
12120
+ _ref4$hidden = _ref4.hidden,
12121
+ hidden = _ref4$hidden === void 0 ? getConfig$1().defaultHidden : _ref4$hidden,
12122
+ name = _ref4.name,
12123
+ description = _ref4.description;
12100
12124
  if (getConfig$1()._disableExpensiveErrorDiagnostics) {
12101
12125
  return "Unable to find role=\"" + role + "\"" + getNameHint(name);
12102
12126
  }
@@ -12136,7 +12160,12 @@ const getMissingError$1 = function (container, role, _temp3) {
12136
12160
  return ("\nUnable to find an " + (hidden === false ? 'accessible ' : '') + "element with the role \"" + role + "\"" + nameHint + descriptionHint + "\n\n" + roleMessage).trim();
12137
12161
  };
12138
12162
  const queryAllByRoleWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByRole, queryAllByRole.name, 'queryAll');
12139
- const [queryByRole, getAllByRole, getByRole, findAllByRole, findByRole] = buildQueries(queryAllByRole, getMultipleError$1, getMissingError$1);
12163
+ const _buildQueries$1 = buildQueries(queryAllByRole, getMultipleError$1, getMissingError$1),
12164
+ queryByRole = _buildQueries$1[0],
12165
+ getAllByRole = _buildQueries$1[1],
12166
+ getByRole = _buildQueries$1[2],
12167
+ findAllByRole = _buildQueries$1[3],
12168
+ findByRole = _buildQueries$1[4];
12140
12169
 
12141
12170
  const getTestIdAttribute = () => getConfig$1().testIdAttribute;
12142
12171
  const queryAllByTestId = function () {
@@ -12149,7 +12178,12 @@ const queryAllByTestId = function () {
12149
12178
  const getMultipleError = (c, id) => "Found multiple elements by: [" + getTestIdAttribute() + "=\"" + id + "\"]";
12150
12179
  const getMissingError = (c, id) => "Unable to find an element by: [" + getTestIdAttribute() + "=\"" + id + "\"]";
12151
12180
  const queryAllByTestIdWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByTestId, queryAllByTestId.name, 'queryAll');
12152
- const [queryByTestId, getAllByTestId, getByTestId, findAllByTestId, findByTestId] = buildQueries(queryAllByTestId, getMultipleError, getMissingError);
12181
+ const _buildQueries = buildQueries(queryAllByTestId, getMultipleError, getMissingError),
12182
+ queryByTestId = _buildQueries[0],
12183
+ getAllByTestId = _buildQueries[1],
12184
+ getByTestId = _buildQueries[2],
12185
+ findAllByTestId = _buildQueries[3],
12186
+ findByTestId = _buildQueries[4];
12153
12187
 
12154
12188
  var queries = /*#__PURE__*/Object.freeze({
12155
12189
  __proto__: null,
@@ -12938,6 +12972,8 @@ const eventAliasMap = {
12938
12972
  doubleClick: 'dblClick'
12939
12973
  };
12940
12974
 
12975
+ const _excluded = ["value", "files"],
12976
+ _excluded2 = ["bubbles", "cancelable", "detail"];
12941
12977
  function fireEvent(element, event) {
12942
12978
  return getConfig$1().eventWrapper(() => {
12943
12979
  if (!event) {
@@ -12950,10 +12986,11 @@ function fireEvent(element, event) {
12950
12986
  });
12951
12987
  }
12952
12988
  function createEvent(eventName, node, init, _temp) {
12953
- let {
12954
- EventType = 'Event',
12955
- defaultInit = {}
12956
- } = _temp === void 0 ? {} : _temp;
12989
+ let _ref = _temp === void 0 ? {} : _temp,
12990
+ _ref$EventType = _ref.EventType,
12991
+ EventType = _ref$EventType === void 0 ? 'Event' : _ref$EventType,
12992
+ _ref$defaultInit = _ref.defaultInit,
12993
+ defaultInit = _ref$defaultInit === void 0 ? {} : _ref$defaultInit;
12957
12994
  if (!node) {
12958
12995
  throw new Error("Unable to fire a \"" + eventName + "\" event - please provide a DOM element.");
12959
12996
  }
@@ -12961,13 +12998,11 @@ function createEvent(eventName, node, init, _temp) {
12961
12998
  ...defaultInit,
12962
12999
  ...init
12963
13000
  };
12964
- const {
12965
- target: {
12966
- value,
12967
- files,
12968
- ...targetProperties
12969
- } = {}
12970
- } = eventInit;
13001
+ const _eventInit$target = eventInit.target,
13002
+ _eventInit$target2 = _eventInit$target === void 0 ? {} : _eventInit$target,
13003
+ value = _eventInit$target2.value,
13004
+ files = _eventInit$target2.files,
13005
+ targetProperties = _objectWithoutPropertiesLoose(_eventInit$target2, _excluded);
12971
13006
  if (value !== undefined) {
12972
13007
  setNativeValue(node, value);
12973
13008
  }
@@ -12992,12 +13027,10 @@ function createEvent(eventName, node, init, _temp) {
12992
13027
  } else {
12993
13028
  // IE11 polyfill from https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
12994
13029
  event = window.document.createEvent(EventType);
12995
- const {
12996
- bubbles,
12997
- cancelable,
12998
- detail,
12999
- ...otherInit
13000
- } = eventInit;
13030
+ const bubbles = eventInit.bubbles,
13031
+ cancelable = eventInit.cancelable,
13032
+ detail = eventInit.detail,
13033
+ otherInit = _objectWithoutPropertiesLoose(eventInit, _excluded2);
13001
13034
  event.initEvent(eventName, bubbles, cancelable, detail);
13002
13035
  Object.keys(otherInit).forEach(eventKey => {
13003
13036
  event[eventKey] = otherInit[eventKey];
@@ -13029,10 +13062,9 @@ function createEvent(eventName, node, init, _temp) {
13029
13062
  return event;
13030
13063
  }
13031
13064
  Object.keys(eventMap).forEach(key => {
13032
- const {
13033
- EventType,
13034
- defaultInit
13035
- } = eventMap[key];
13065
+ const _eventMap$key = eventMap[key],
13066
+ EventType = _eventMap$key.EventType,
13067
+ defaultInit = _eventMap$key.defaultInit;
13036
13068
  const eventName = key.toLowerCase();
13037
13069
  createEvent[key] = (node, init) => createEvent(eventName, node, init, {
13038
13070
  EventType,
@@ -13044,13 +13076,11 @@ Object.keys(eventMap).forEach(key => {
13044
13076
  // function written after some investigation here:
13045
13077
  // https://github.com/facebook/react/issues/10135#issuecomment-401496776
13046
13078
  function setNativeValue(element, value) {
13047
- const {
13048
- set: valueSetter
13049
- } = Object.getOwnPropertyDescriptor(element, 'value') || {};
13079
+ const _ref2 = Object.getOwnPropertyDescriptor(element, 'value') || {},
13080
+ valueSetter = _ref2.set;
13050
13081
  const prototype = Object.getPrototypeOf(element);
13051
- const {
13052
- set: prototypeValueSetter
13053
- } = Object.getOwnPropertyDescriptor(prototype, 'value') || {};
13082
+ const _ref3 = Object.getOwnPropertyDescriptor(prototype, 'value') || {},
13083
+ prototypeValueSetter = _ref3.set;
13054
13084
  if (prototypeValueSetter && valueSetter !== prototypeValueSetter) {
13055
13085
  prototypeValueSetter.call(element, value);
13056
13086
  } else {
@@ -13212,6 +13242,7 @@ function jestFakeTimersAreEnabled() {
13212
13242
 
13213
13243
  return false;
13214
13244
  }
13245
+ let inEventWrapper = false;
13215
13246
  configure({
13216
13247
  unstable_advanceTimersWrapper: cb => {
13217
13248
  return act(cb);
@@ -13241,11 +13272,19 @@ configure({
13241
13272
  }
13242
13273
  },
13243
13274
  eventWrapper: cb => {
13244
- let result;
13245
- act(() => {
13246
- result = cb();
13247
- });
13248
- return result;
13275
+ if (inEventWrapper) {
13276
+ return cb();
13277
+ }
13278
+ inEventWrapper = true;
13279
+ try {
13280
+ let result;
13281
+ act(() => {
13282
+ result = cb();
13283
+ });
13284
+ return result;
13285
+ } finally {
13286
+ inEventWrapper = false;
13287
+ }
13249
13288
  }
13250
13289
  });
13251
13290
 
@@ -13259,24 +13298,24 @@ const mountedContainers = new Set();
13259
13298
  * @type Array<{container: import('react-dom').Container, root: ReturnType<typeof createConcurrentRoot>}>
13260
13299
  */
13261
13300
  const mountedRootEntries = [];
13262
- function strictModeIfNeeded(innerElement) {
13263
- return getConfig().reactStrictMode ? /*#__PURE__*/React__namespace.createElement(React__namespace.StrictMode, null, innerElement) : innerElement;
13301
+ function strictModeIfNeeded(innerElement, reactStrictMode) {
13302
+ return reactStrictMode ?? getConfig().reactStrictMode ? /*#__PURE__*/React__namespace.createElement(React__namespace.StrictMode, null, innerElement) : innerElement;
13264
13303
  }
13265
13304
  function wrapUiIfNeeded(innerElement, wrapperComponent) {
13266
13305
  return wrapperComponent ? /*#__PURE__*/React__namespace.createElement(wrapperComponent, null, innerElement) : innerElement;
13267
13306
  }
13268
- function createConcurrentRoot(container, _ref) {
13269
- let {
13270
- hydrate,
13271
- onCaughtError,
13272
- onRecoverableError,
13273
- ui,
13274
- wrapper: WrapperComponent
13275
- } = _ref;
13307
+ function createConcurrentRoot(container, {
13308
+ hydrate,
13309
+ onCaughtError,
13310
+ onRecoverableError,
13311
+ ui,
13312
+ wrapper: WrapperComponent,
13313
+ reactStrictMode
13314
+ }) {
13276
13315
  let root;
13277
13316
  if (hydrate) {
13278
13317
  act(() => {
13279
- root = ReactDOMClient__namespace.hydrateRoot(container, strictModeIfNeeded(wrapUiIfNeeded(ui, WrapperComponent)), {
13318
+ root = ReactDOMClient__namespace.hydrateRoot(container, strictModeIfNeeded(wrapUiIfNeeded(ui, WrapperComponent), reactStrictMode), {
13280
13319
  onCaughtError,
13281
13320
  onRecoverableError
13282
13321
  });
@@ -13316,35 +13355,30 @@ function createLegacyRoot(container) {
13316
13355
  }
13317
13356
  };
13318
13357
  }
13319
- function renderRoot(ui, _ref2) {
13320
- let {
13321
- baseElement,
13322
- container,
13323
- hydrate,
13324
- queries,
13325
- root,
13326
- wrapper: WrapperComponent
13327
- } = _ref2;
13358
+ function renderRoot(ui, {
13359
+ baseElement,
13360
+ container,
13361
+ hydrate,
13362
+ queries,
13363
+ root,
13364
+ wrapper: WrapperComponent,
13365
+ reactStrictMode
13366
+ }) {
13328
13367
  act(() => {
13329
13368
  if (hydrate) {
13330
- root.hydrate(strictModeIfNeeded(wrapUiIfNeeded(ui, WrapperComponent)), container);
13369
+ root.hydrate(strictModeIfNeeded(wrapUiIfNeeded(ui, WrapperComponent), reactStrictMode), container);
13331
13370
  } else {
13332
- root.render(strictModeIfNeeded(wrapUiIfNeeded(ui, WrapperComponent)), container);
13371
+ root.render(strictModeIfNeeded(wrapUiIfNeeded(ui, WrapperComponent), reactStrictMode), container);
13333
13372
  }
13334
13373
  });
13335
13374
  return {
13336
13375
  container,
13337
13376
  baseElement,
13338
- debug: function (el, maxLength, options) {
13339
- if (el === void 0) {
13340
- el = baseElement;
13341
- }
13342
- return Array.isArray(el) ?
13343
- // eslint-disable-next-line no-console
13344
- el.forEach(e => console.log(prettyDOM(e, maxLength, options))) :
13345
- // eslint-disable-next-line no-console,
13346
- console.log(prettyDOM(el, maxLength, options));
13347
- },
13377
+ debug: (el = baseElement, maxLength, options) => Array.isArray(el) ?
13378
+ // eslint-disable-next-line no-console
13379
+ el.forEach(e => console.log(prettyDOM(e, maxLength, options))) :
13380
+ // eslint-disable-next-line no-console,
13381
+ console.log(prettyDOM(el, maxLength, options)),
13348
13382
  unmount: () => {
13349
13383
  act(() => {
13350
13384
  root.unmount();
@@ -13355,7 +13389,8 @@ function renderRoot(ui, _ref2) {
13355
13389
  container,
13356
13390
  baseElement,
13357
13391
  root,
13358
- wrapper: WrapperComponent
13392
+ wrapper: WrapperComponent,
13393
+ reactStrictMode
13359
13394
  });
13360
13395
  // Intentionally do not return anything to avoid unnecessarily complicating the API.
13361
13396
  // folks can use all the same utilities we return in the first place that are bound to the container
@@ -13373,18 +13408,18 @@ function renderRoot(ui, _ref2) {
13373
13408
  ...getQueriesForElement(baseElement, queries)
13374
13409
  };
13375
13410
  }
13376
- function render(ui, _temp) {
13377
- let {
13378
- container,
13379
- baseElement = container,
13380
- legacyRoot = false,
13381
- onCaughtError,
13382
- onUncaughtError,
13383
- onRecoverableError,
13384
- queries,
13385
- hydrate = false,
13386
- wrapper
13387
- } = _temp === void 0 ? {} : _temp;
13411
+ function render(ui, {
13412
+ container,
13413
+ baseElement = container,
13414
+ legacyRoot = false,
13415
+ onCaughtError,
13416
+ onUncaughtError,
13417
+ onRecoverableError,
13418
+ queries,
13419
+ hydrate = false,
13420
+ wrapper,
13421
+ reactStrictMode
13422
+ } = {}) {
13388
13423
  if (onUncaughtError !== undefined) {
13389
13424
  throw new Error('onUncaughtError is not supported. The `render` call will already throw on uncaught errors.');
13390
13425
  }
@@ -13402,7 +13437,7 @@ function render(ui, _temp) {
13402
13437
  container = baseElement.appendChild(document.createElement('div'));
13403
13438
  }
13404
13439
  let root;
13405
- // 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.
13440
+ // 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 reused so we don't want to read the case that happens later first.
13406
13441
  if (!mountedContainers.has(container)) {
13407
13442
  const createRootImpl = legacyRoot ? createLegacyRoot : createConcurrentRoot;
13408
13443
  root = createRootImpl(container, {
@@ -13410,7 +13445,8 @@ function render(ui, _temp) {
13410
13445
  onCaughtError,
13411
13446
  onRecoverableError,
13412
13447
  ui,
13413
- wrapper
13448
+ wrapper,
13449
+ reactStrictMode
13414
13450
  });
13415
13451
  mountedRootEntries.push({
13416
13452
  container,
@@ -13436,15 +13472,15 @@ function render(ui, _temp) {
13436
13472
  queries,
13437
13473
  hydrate,
13438
13474
  wrapper,
13439
- root
13475
+ root,
13476
+ reactStrictMode
13440
13477
  });
13441
13478
  }
13442
13479
  function cleanup() {
13443
- mountedRootEntries.forEach(_ref3 => {
13444
- let {
13445
- root,
13446
- container
13447
- } = _ref3;
13480
+ mountedRootEntries.forEach(({
13481
+ root,
13482
+ container
13483
+ }) => {
13448
13484
  act(() => {
13449
13485
  root.unmount();
13450
13486
  });
@@ -13455,10 +13491,7 @@ function cleanup() {
13455
13491
  mountedRootEntries.length = 0;
13456
13492
  mountedContainers.clear();
13457
13493
  }
13458
- function renderHook(renderCallback, options) {
13459
- if (options === void 0) {
13460
- options = {};
13461
- }
13494
+ function renderHook(renderCallback, options = {}) {
13462
13495
  const {
13463
13496
  initialProps,
13464
13497
  ...renderOptions
@@ -13469,10 +13502,9 @@ function renderHook(renderCallback, options) {
13469
13502
  throw error;
13470
13503
  }
13471
13504
  const result = /*#__PURE__*/React__namespace.createRef();
13472
- function TestComponent(_ref4) {
13473
- let {
13474
- renderCallbackProps
13475
- } = _ref4;
13505
+ function TestComponent({
13506
+ renderCallbackProps
13507
+ }) {
13476
13508
  const pendingResult = renderCallback(renderCallbackProps);
13477
13509
  React__namespace.useEffect(() => {
13478
13510
  result.current = pendingResult;