{"version":3,"sources":["../src/index.ts","../src/shadow-queries.ts","../src/trick-dom-testing-library.ts","../src/deep-query-selectors.ts","../src/log-shadow-dom.ts","../src/pretty-shadow-dom.ts","../src/debug.ts","../src/shadow-screen.ts","../src/shadow-within.ts","../src/log-roles.ts","../node_modules/dom-accessibility-api/sources/polyfills/array.from.ts","../node_modules/dom-accessibility-api/sources/polyfills/SetLike.ts","../node_modules/dom-accessibility-api/sources/getRole.ts","../node_modules/dom-accessibility-api/sources/util.ts","../node_modules/dom-accessibility-api/sources/accessible-name-and-description.ts","../node_modules/dom-accessibility-api/sources/accessible-description.ts","../node_modules/dom-accessibility-api/sources/accessible-name.ts"],"sourcesContent":["import { configure, getConfig } from \"@testing-library/dom\";\n\nimport * as shadowQueries from \"./shadow-queries\";\nimport { debug } from \"./debug\";\nimport { logShadowDOM } from \"./log-shadow-dom\";\nimport { prettyShadowDOM } from \"./pretty-shadow-dom\";\nimport { shadowScreen } from \"./shadow-screen\";\nimport { shadowWithin } from \"./shadow-within\";\nimport { logRoles } from \"./log-roles\";\n\nconfigure({\n  // https://github.com/testing-library/dom-testing-library/blob/39a64d4b862f706d09f0cd225ce9eda892f1e8d8/src/config.ts#L36-L51\n  getElementError(message, container) {\n    const prettifiedDOM = prettyShadowDOM(container);\n    const error = new Error(\n      [\n        message,\n        `Ignored nodes: comments, ${\n          getConfig().defaultIgnore\n        }\\n${prettifiedDOM}`,\n      ]\n        .filter(Boolean)\n        .join(\"\\n\\n\"),\n    );\n    error.name = \"ShadowDOMTestingLibraryElementError\";\n    return error;\n  },\n});\n\nexport * from \"./types\";\nexport * from \"./shadow-queries\";\n\nexport { createDOMElementFilter } from \"./pretty-shadow-dom\";\n\nexport {\n  deepQuerySelector,\n  deepQuerySelectorAll,\n  getAllElementsAndShadowRoots,\n} from \"./deep-query-selectors\";\n\nexport {\n  shadowScreen as screen,\n  shadowWithin as within,\n  shadowQueries,\n  debug,\n  logShadowDOM,\n  prettyShadowDOM,\n  logRoles,\n};\n","import {\n  buildQueries,\n  ByRoleMatcher,\n  queryAllByRole,\n  queryAllByLabelText,\n  Matcher,\n  queryAllByPlaceholderText,\n  queryAllByText,\n  queryAllByDisplayValue,\n  queryAllByAltText,\n  queryAllByTitle,\n  queryAllByTestId,\n  AllByRole,\n  AllByText,\n  AllByBoundAttribute,\n  GetByRole,\n  QueryByRole,\n  FindByRole,\n  FindAllByRole,\n  QueryByText,\n  GetByText,\n  FindAllByText,\n  FindByText,\n  QueryByBoundAttribute,\n  GetByBoundAttribute,\n  FindAllByBoundAttribute,\n  FindByBoundAttribute,\n} from \"@testing-library/dom\";\n\nimport { getAllElementsAndShadowRoots } from \"./deep-query-selectors\";\nimport { patchWrap } from \"./trick-dom-testing-library\";\nimport {\n  ScreenShadowMatcherParams,\n  ScreenShadowRoleMatcherParams,\n  ScreenShadowSelectorMatcherParams,\n  ShadowMatcherParams,\n  ShadowRoleMatcherParams,\n  ShadowSelectorMatcherParams,\n} from \"./types\";\n\nfunction toShadowQueries<T extends Function[]>(queries: T): T {\n  return queries.map((query): Function => {\n    return (...args: any[]): unknown => {\n      let [arg1, arg2, options, ...rest] = args;\n      if (options == null) options = {};\n      options.suggest = false;\n      return query(arg1, arg2, options, ...rest);\n    };\n  }) as T;\n}\n\n// Role\nfunction queryAllByShadowRole<T extends HTMLElement = HTMLElement>(\n  ...args: ShadowRoleMatcherParams\n): ReturnType<AllByRole<T>> {\n  let [container, role, options] = args;\n\n  if (options == null) {\n    options = {};\n  }\n\n  options.suggest = false;\n\n  return [\n    ...new Set(\n      patchWrap(() =>\n        getAllElementsAndShadowRoots(container, options)\n          .map((el) => queryAllByRole(el as HTMLElement, role, options))\n          .flat(Infinity),\n      ),\n    ),\n  ] as T[];\n}\n\nconst getMultipleRoleError = (_c: Element | null, role: ByRoleMatcher) =>\n  `Found multiple elements with the role of: ${role}`;\nconst getMissingRoleError = (_c: Element | null, role: ByRoleMatcher) =>\n  `Unable to find an element with the role of: ${role}`;\n\nconst [\n  _queryByShadowRole,\n  _getAllByShadowRole,\n  _getByShadowRole,\n  _findAllByShadowRole,\n  _findByShadowRole,\n] = toShadowQueries(\n  buildQueries<ScreenShadowRoleMatcherParams>(\n    queryAllByShadowRole,\n    getMultipleRoleError,\n    getMissingRoleError,\n  ),\n);\n\nconst queryByShadowRole = <T extends HTMLElement>(\n  ...args: Parameters<typeof _queryByShadowRole>\n) => _queryByShadowRole(...args) as ReturnType<QueryByRole<T>>;\nconst getAllByShadowRole = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getAllByShadowRole>\n) => _getAllByShadowRole(...args) as Array<ReturnType<GetByRole<T>>>;\nconst getByShadowRole = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getByShadowRole>\n) => _getByShadowRole(...args) as ReturnType<GetByRole<T>>;\nconst findAllByShadowRole = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findAllByShadowRole>\n) => _findAllByShadowRole(...args) as ReturnType<FindAllByRole<T>>;\nconst findByShadowRole = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findByShadowRole>\n) => _findByShadowRole(...args) as ReturnType<FindByRole<T>>;\n\n// Label Text\nfunction queryAllByShadowLabelText<T extends HTMLElement = HTMLElement>(\n  ...args: ShadowSelectorMatcherParams\n): ReturnType<AllByText<T>> {\n  let [container, id, options] = args;\n\n  if (options == null) {\n    options = {};\n  }\n\n  options.suggest = false;\n\n  return [\n    ...new Set(\n      patchWrap(() =>\n        getAllElementsAndShadowRoots(container, options)\n          .map((el) => queryAllByLabelText(el as HTMLElement, id, options))\n          .flat(Infinity),\n      ),\n    ),\n  ] as T[];\n}\n\nconst getMultipleLabelTextError = (_c: Element | null, id: Matcher) =>\n  `Found multiple elements with the label text of: ${id}`;\nconst getMissingLabelTextError = (_c: Element | null, id: Matcher) =>\n  `Unable to find an element with the label text of: ${id}`;\n\nconst [\n  _queryByShadowLabelText,\n  _getAllByShadowLabelText,\n  _getByShadowLabelText,\n  _findAllByShadowLabelText,\n  _findByShadowLabelText,\n] = toShadowQueries(\n  buildQueries<ScreenShadowSelectorMatcherParams>(\n    queryAllByShadowLabelText,\n    getMultipleLabelTextError,\n    getMissingLabelTextError,\n  ),\n);\n\nconst queryByShadowLabelText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _queryByShadowLabelText>\n) => _queryByShadowLabelText(...args) as ReturnType<QueryByText<T>>;\nconst getAllByShadowLabelText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getAllByShadowLabelText>\n) => _getAllByShadowLabelText(...args) as Array<ReturnType<GetByText<T>>>;\nconst getByShadowLabelText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getByShadowLabelText>\n) => _getByShadowLabelText(...args) as ReturnType<GetByText<T>>;\nconst findAllByShadowLabelText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findAllByShadowLabelText>\n) => _findAllByShadowLabelText(...args) as ReturnType<FindAllByText<T>>;\nconst findByShadowLabelText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findByShadowLabelText>\n) => _findByShadowLabelText(...args) as ReturnType<FindByText<T>>;\n\n// Placeholder Text\nfunction queryAllByShadowPlaceholderText<T extends HTMLElement = HTMLElement>(\n  ...args: ShadowMatcherParams\n): ReturnType<AllByText<T>> {\n  let [container, id, options] = args;\n\n  if (options == null) {\n    options = {};\n  }\n\n  options.suggest = false;\n\n  return [\n    ...new Set(\n      patchWrap(() =>\n        getAllElementsAndShadowRoots(container, options)\n          .map((el) =>\n            queryAllByPlaceholderText(el as HTMLElement, id, options),\n          )\n          .flat(Infinity),\n      ),\n    ),\n  ] as T[];\n}\n\nconst getMultiplePlaceholderTextError = (_c: Element | null, id: Matcher) =>\n  `Found multiple elements with the placeholder text of: ${id}`;\nconst getMissingPlaceholderTextError = (_c: Element | null, id: Matcher) =>\n  `Unable to find an element with the placeholder text of: ${id}`;\n\nconst [\n  _queryByShadowPlaceholderText,\n  _getAllByShadowPlaceholderText,\n  _getByShadowPlaceholderText,\n  _findAllByShadowPlaceholderText,\n  _findByShadowPlaceholderText,\n] = toShadowQueries(\n  buildQueries<ScreenShadowSelectorMatcherParams>(\n    queryAllByShadowPlaceholderText,\n    getMultiplePlaceholderTextError,\n    getMissingPlaceholderTextError,\n  ),\n);\n\nconst queryByShadowPlaceholderText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _queryByShadowPlaceholderText>\n) => _queryByShadowPlaceholderText(...args) as ReturnType<QueryByText<T>>;\nconst getAllByShadowPlaceholderText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getAllByShadowPlaceholderText>\n) => _getAllByShadowPlaceholderText(...args) as Array<ReturnType<GetByText<T>>>;\nconst getByShadowPlaceholderText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getByShadowPlaceholderText>\n) => _getByShadowPlaceholderText(...args) as ReturnType<GetByText<T>>;\nconst findAllByShadowPlaceholderText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findAllByShadowPlaceholderText>\n) => _findAllByShadowPlaceholderText(...args) as ReturnType<FindAllByText<T>>;\nconst findByShadowPlaceholderText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findByShadowPlaceholderText>\n) => _findByShadowPlaceholderText(...args) as ReturnType<FindByText<T>>;\n\n// Text\nfunction queryAllByShadowText<T extends HTMLElement = HTMLElement>(\n  ...args: ShadowSelectorMatcherParams\n): ReturnType<AllByText<T>> {\n  let [container, id, options] = args;\n\n  if (options == null) {\n    options = {};\n  }\n\n  options.suggest = false;\n\n  return [\n    ...new Set(\n      patchWrap(() =>\n        getAllElementsAndShadowRoots(container, options)\n          .map((el) => queryAllByText(el as HTMLElement, id, options))\n          .flat(Infinity),\n      ),\n    ),\n  ] as T[];\n}\n\nconst getMultipleTextError = (_c: Element | null, id: Matcher) =>\n  `Found multiple elements with the text of: ${id}`;\nconst getMissingTextError = (_c: Element | null, id: Matcher) =>\n  `Unable to find an element with the text of: ${id}`;\n\nconst [\n  _queryByShadowText,\n  _getAllByShadowText,\n  _getByShadowText,\n  _findAllByShadowText,\n  _findByShadowText,\n] = toShadowQueries(\n  buildQueries<ScreenShadowSelectorMatcherParams>(\n    queryAllByShadowText,\n    getMultipleTextError,\n    getMissingTextError,\n  ),\n);\n\nconst queryByShadowText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _queryByShadowText>\n) => _queryByShadowText(...args) as ReturnType<QueryByText<T>>;\nconst getAllByShadowText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getAllByShadowText>\n) => _getAllByShadowText(...args) as Array<ReturnType<GetByText<T>>>;\nconst getByShadowText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getByShadowText>\n) => _getByShadowText(...args) as ReturnType<GetByText<T>>;\nconst findAllByShadowText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findAllByShadowText>\n) => _findAllByShadowText(...args) as ReturnType<FindAllByText<T>>;\nconst findByShadowText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findByShadowText>\n) => _findByShadowText(...args) as ReturnType<FindByText<T>>;\n\n// Display Value\nfunction queryAllByShadowDisplayValue<T extends HTMLElement = HTMLElement>(\n  ...args: ShadowSelectorMatcherParams\n): ReturnType<AllByBoundAttribute<T>> {\n  let [container, id, options] = args;\n\n  if (options == null) {\n    options = {};\n  }\n\n  options.suggest = false;\n\n  return [\n    ...new Set(\n      patchWrap(() =>\n        getAllElementsAndShadowRoots(container, options)\n          .map((el) => queryAllByDisplayValue(el as HTMLElement, id, options))\n          .flat(Infinity),\n      ),\n    ),\n  ] as T[];\n}\n\nconst getMultipleDisplayValueError = (_c: Element | null, id: Matcher) =>\n  `Found multiple elements with the display value of: ${id}`;\nconst getMissingDisplayValueError = (_c: Element | null, id: Matcher) =>\n  `Unable to find an element with the display value of: ${id}`;\n\nconst [\n  _queryByShadowDisplayValue,\n  _getAllByShadowDisplayValue,\n  _getByShadowDisplayValue,\n  _findAllByShadowDisplayValue,\n  _findByShadowDisplayValue,\n] = toShadowQueries(\n  buildQueries<ScreenShadowSelectorMatcherParams>(\n    queryAllByShadowDisplayValue,\n    getMultipleDisplayValueError,\n    getMissingDisplayValueError,\n  ),\n);\n\nconst queryByShadowDisplayValue = <T extends HTMLElement>(\n  ...args: Parameters<typeof _queryByShadowDisplayValue>\n) =>\n  _queryByShadowDisplayValue(...args) as ReturnType<QueryByBoundAttribute<T>>;\nconst getAllByShadowDisplayValue = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getAllByShadowDisplayValue>\n) =>\n  _getAllByShadowDisplayValue(...args) as Array<\n    ReturnType<GetByBoundAttribute<T>>\n  >;\nconst getByShadowDisplayValue = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getByShadowDisplayValue>\n) => _getByShadowDisplayValue(...args) as ReturnType<GetByBoundAttribute<T>>;\nconst findAllByShadowDisplayValue = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findAllByShadowDisplayValue>\n) =>\n  _findAllByShadowDisplayValue(...args) as ReturnType<\n    FindAllByBoundAttribute<T>\n  >;\nconst findByShadowDisplayValue = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findByShadowDisplayValue>\n) => _findByShadowDisplayValue(...args) as ReturnType<FindByBoundAttribute<T>>;\n\n// Alt Text\nfunction queryAllByShadowAltText<T extends HTMLElement = HTMLElement>(\n  ...args: ShadowMatcherParams\n): ReturnType<AllByText<T>> {\n  let [container, id, options] = args;\n\n  if (options == null) {\n    options = {};\n  }\n\n  options.suggest = false;\n\n  return [\n    ...new Set(\n      patchWrap(() =>\n        getAllElementsAndShadowRoots(container, options)\n          .map((el) => queryAllByAltText(el as HTMLElement, id, options))\n          .flat(Infinity),\n      ),\n    ),\n  ] as T[];\n}\n\nconst getMultipleAltTextError = (_c: Element | null, id: Matcher) =>\n  `Found multiple elements with the alt text of: ${id}`;\nconst getMissingAltTextError = (_c: Element | null, id: Matcher) =>\n  `Unable to find an element with the alt text of: ${id}`;\n\nconst [\n  _queryByShadowAltText,\n  _getAllByShadowAltText,\n  _getByShadowAltText,\n  _findAllByShadowAltText,\n  _findByShadowAltText,\n] = toShadowQueries(\n  buildQueries<ScreenShadowMatcherParams>(\n    queryAllByShadowAltText,\n    getMultipleAltTextError,\n    getMissingAltTextError,\n  ),\n);\n\nconst queryByShadowAltText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _queryByShadowAltText>\n) => _queryByShadowAltText(...args) as ReturnType<QueryByText<T>>;\nconst getAllByShadowAltText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getAllByShadowAltText>\n) => _getAllByShadowAltText(...args) as Array<ReturnType<GetByText<T>>>;\nconst getByShadowAltText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getByShadowAltText>\n) => _getByShadowAltText(...args) as ReturnType<GetByText<T>>;\nconst findAllByShadowAltText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findAllByShadowAltText>\n) => _findAllByShadowAltText(...args) as ReturnType<FindAllByText<T>>;\nconst findByShadowAltText = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findByShadowAltText>\n) => _findByShadowAltText(...args) as ReturnType<FindByText<T>>;\n\n// Title\nfunction queryAllByShadowTitle<T extends HTMLElement = HTMLElement>(\n  ...args: ShadowMatcherParams\n): ReturnType<AllByBoundAttribute<T>> {\n  let [container, id, options] = args;\n\n  if (options == null) {\n    options = {};\n  }\n\n  options.suggest = false;\n\n  return [\n    ...new Set(\n      patchWrap(() =>\n        getAllElementsAndShadowRoots(container, options)\n          .map((el) => queryAllByTitle(el as HTMLElement, id, options))\n          .flat(Infinity),\n      ),\n    ),\n  ] as T[];\n}\n\nconst getMultipleTitleError = (_c: Element | null, id: Matcher) =>\n  `Found multiple elements with the title of: ${id}`;\nconst getMissingTitleError = (_c: Element | null, id: Matcher) =>\n  `Unable to find an element with the title of: ${id}`;\n\nconst [\n  _queryByShadowTitle,\n  _getAllByShadowTitle,\n  _getByShadowTitle,\n  _findAllByShadowTitle,\n  _findByShadowTitle,\n] = toShadowQueries(\n  buildQueries<ScreenShadowMatcherParams>(\n    queryAllByShadowTitle,\n    getMultipleTitleError,\n    getMissingTitleError,\n  ),\n);\n\nconst queryByShadowTitle = <T extends HTMLElement>(\n  ...args: Parameters<typeof _queryByShadowTitle>\n) => _queryByShadowTitle(...args) as ReturnType<QueryByBoundAttribute<T>>;\nconst getAllByShadowTitle = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getAllByShadowTitle>\n) => _getAllByShadowTitle(...args) as Array<ReturnType<GetByBoundAttribute<T>>>;\nconst getByShadowTitle = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getByShadowTitle>\n) => _getByShadowTitle(...args) as ReturnType<GetByBoundAttribute<T>>;\nconst findAllByShadowTitle = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findAllByShadowTitle>\n) => _findAllByShadowTitle(...args) as ReturnType<FindAllByBoundAttribute<T>>;\nconst findByShadowTitle = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findByShadowTitle>\n) => _findByShadowTitle(...args) as ReturnType<FindByBoundAttribute<T>>;\n\n// Test Id\nfunction queryAllByShadowTestId<T extends HTMLElement = HTMLElement>(\n  ...args: ShadowMatcherParams\n): ReturnType<AllByBoundAttribute<T>> {\n  let [container, id, options] = args;\n\n  if (options == null) {\n    options = {};\n  }\n\n  options.suggest = false;\n\n  return [\n    ...new Set(\n      patchWrap(() =>\n        getAllElementsAndShadowRoots(container, options)\n          .map((el) => queryAllByTestId(el as HTMLElement, id, options))\n          .flat(Infinity),\n      ),\n    ),\n  ] as T[];\n}\n\nconst getMultipleTestIdError = (_c: Element | null, id: Matcher) =>\n  `Found multiple elements with the test id of: ${id}`;\nconst getMissingTestIdError = (_c: Element | null, id: Matcher) =>\n  `Unable to find an element with the test id of: ${id}`;\n\nconst [\n  _queryByShadowTestId,\n  _getAllByShadowTestId,\n  _getByShadowTestId,\n  _findAllByShadowTestId,\n  _findByShadowTestId,\n] = toShadowQueries(\n  buildQueries<ScreenShadowMatcherParams>(\n    queryAllByShadowTestId,\n    getMultipleTestIdError,\n    getMissingTestIdError,\n  ),\n);\n\nconst queryByShadowTestId = <T extends HTMLElement>(\n  ...args: Parameters<typeof _queryByShadowTestId>\n) => _queryByShadowTestId(...args) as ReturnType<QueryByBoundAttribute<T>>;\nconst getAllByShadowTestId = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getAllByShadowTestId>\n) =>\n  _getAllByShadowTestId(...args) as Array<ReturnType<GetByBoundAttribute<T>>>;\nconst getByShadowTestId = <T extends HTMLElement>(\n  ...args: Parameters<typeof _getByShadowTestId>\n) => _getByShadowTestId(...args) as ReturnType<GetByBoundAttribute<T>>;\nconst findAllByShadowTestId = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findAllByShadowTestId>\n) => _findAllByShadowTestId(...args) as ReturnType<FindAllByBoundAttribute<T>>;\nconst findByShadowTestId = <T extends HTMLElement>(\n  ...args: Parameters<typeof _findByShadowTestId>\n) => _findByShadowTestId(...args) as ReturnType<FindByBoundAttribute<T>>;\n\nexport {\n  // Role\n  queryAllByShadowRole,\n  queryByShadowRole,\n  getAllByShadowRole,\n  getByShadowRole,\n  findAllByShadowRole,\n  findByShadowRole,\n\n  // Label Text\n  queryAllByShadowLabelText,\n  queryByShadowLabelText,\n  getAllByShadowLabelText,\n  getByShadowLabelText,\n  findAllByShadowLabelText,\n  findByShadowLabelText,\n\n  // Placeholder Text\n  queryAllByShadowPlaceholderText,\n  queryByShadowPlaceholderText,\n  getAllByShadowPlaceholderText,\n  getByShadowPlaceholderText,\n  findAllByShadowPlaceholderText,\n  findByShadowPlaceholderText,\n\n  // Text\n  queryAllByShadowText,\n  queryByShadowText,\n  getAllByShadowText,\n  getByShadowText,\n  findAllByShadowText,\n  findByShadowText,\n\n  // Display Value\n  queryAllByShadowDisplayValue,\n  queryByShadowDisplayValue,\n  getAllByShadowDisplayValue,\n  getByShadowDisplayValue,\n  findAllByShadowDisplayValue,\n  findByShadowDisplayValue,\n\n  // Alt Text\n  queryAllByShadowAltText,\n  queryByShadowAltText,\n  getAllByShadowAltText,\n  getByShadowAltText,\n  findAllByShadowAltText,\n  findByShadowAltText,\n\n  // Title\n  queryAllByShadowTitle,\n  queryByShadowTitle,\n  getAllByShadowTitle,\n  getByShadowTitle,\n  findAllByShadowTitle,\n  findByShadowTitle,\n\n  // Test Id\n  queryAllByShadowTestId,\n  queryByShadowTestId,\n  getAllByShadowTestId,\n  getByShadowTestId,\n  findAllByShadowTestId,\n  findByShadowTestId,\n};\n","declare global {\n  interface ShadowRoot {\n    matches?: typeof HTMLElement.prototype.matches;\n    outerHTML?: typeof HTMLElement.prototype.outerHTML;\n  }\n}\n\n// Okay. For some reason shadow root patches cant be part of patchDOM. Haven't figured out why.\n// Only reason I can come up with is the patchWrap() may be conflicting with internals of dom-testing-library?\n// I do know calling `.getByText(el.shadowRoot)` will fail without this patch.\n// outerHTML fails with some issue around \"this\".\n// IDK...but this is weird, no its not the most responsible patch, but it works.\n// Just dont go calling .matches() or .outerHTML() on shadowRoots in your code...\n// This previously existed in other version of SDTL so not a huge deal.\npatchShadowRoot();\n\n// Amazingly fun hack to trick DOM testing libraries internal type checking logic.\n// https://github.com/testing-library/dom-testing-library/blob/73a5694529dbfff289f3d7a01470c45ef5c77715/src/queries/text.ts#L34-L36\n// https://github.com/testing-library/dom-testing-library/blob/73a5694529dbfff289f3d7a01470c45ef5c77715/src/pretty-dom.js#L50-L54\nexport function patchDOM() {\n  /**\n   * Tracks already accessed nodes from `.childNodes` so we don't get duplicate text nodes when using `<slot>` elements with projected content..\n   */\n  const accessedNodes = new WeakMap<Node, boolean>();\n  // Return \"dispose\" callbacks to cleanup patchs\n  return [\n    patchChildNodesForAllNodes(accessedNodes),\n    patchSlotElement(accessedNodes),\n  ];\n}\n\nfunction removeDOMPatch(patchRemovalFunctions: Function[]) {\n  for (const fn of patchRemovalFunctions) {\n    fn();\n  }\n}\n\nexport function patchWrap<T extends (...args: any) => any>(\n  callback: T,\n): ReturnType<T> {\n  const patchRemovalFunctions = patchDOM();\n  try {\n    const val = callback();\n\n    // We only wrap RTL functions, so I dont think anything returns a promise, but just in-case,\n    // lets make sure we clean up.\n    if (\n      typeof val === \"object\" &&\n      \"finally\" in val &&\n      typeof val.finally === \"function\"\n    ) {\n      val.finally(() => removeDOMPatch(patchRemovalFunctions));\n    }\n\n    return val;\n  } finally {\n    removeDOMPatch(patchRemovalFunctions);\n  }\n}\n\nfunction patchShadowRoot() {\n  if (typeof ShadowRoot == \"undefined\")\n    throw \"Your environment does not support shadow roots.\";\n\n  if (ShadowRoot.prototype.matches == null) {\n    Object.defineProperties(ShadowRoot.prototype, {\n      matches: {\n        get() {\n          return function (this: ShadowRoot, string: string): boolean {\n            const str = string.trim();\n            if (str === \"*\") return true;\n\n            return Boolean(this.querySelector(string));\n          };\n        },\n      },\n    });\n  }\n\n  if (ShadowRoot.prototype.outerHTML == null) {\n    Object.defineProperties(ShadowRoot.prototype, {\n      outerHTML: {\n        get() {\n          return this.innerHTML;\n        },\n      },\n    });\n  }\n}\n\nfunction patchChildNodesForAllNodes(accessedNodes: WeakMap<Node, boolean>) {\n  const originalChildNodesDescriptor = Object.getOwnPropertyDescriptor(\n    Node.prototype,\n    \"childNodes\",\n  );\n  const originalChildNodesGetter = originalChildNodesDescriptor!.get;\n\n  Object.defineProperty(Node.prototype, \"childNodes\", {\n    get() {\n      // if no assignedNodes, return original `childNodes`.\n      const childNodes = originalChildNodesGetter!.call(this) as NodeList;\n\n      for (const node of Array.from(childNodes)) {\n        accessedNodes.set(node, true);\n      }\n\n      return childNodes;\n    },\n    enumerable: true,\n    configurable: true,\n  });\n  return () => {\n    // There's no way to `delete` a newly defined property, so we just call the original descriptor.\n    Object.defineProperty(HTMLSlotElement.prototype, \"childNodes\", {\n      get() {\n        return originalChildNodesGetter!.call(this);\n      },\n      enumerable: true,\n      configurable: true,\n    });\n  };\n}\n\nfunction patchSlotElement(accessedNodes: WeakMap<Node, boolean>) {\n  const qsa = HTMLElement.prototype.querySelectorAll;\n  const originalChildNodesDescriptor = Object.getOwnPropertyDescriptor(\n    Node.prototype,\n    \"childNodes\",\n  );\n  const originalChildNodesGetter = originalChildNodesDescriptor!.get;\n\n  /**\n   * This patch allows labels to get proper textContent, and most likely other text helpers by taking either the projected nodes, or the fallback nodes.\n   * https://github.com/KonnorRogers/shadow-dom-testing-library/issues/64#issuecomment-3177493042\n   * https://github.com/testing-library/dom-testing-library/blob/225a3e4cfaa8f8046989d51b9051df507354b644/src/label-helpers.ts#L13-L35\n   */\n  Object.defineProperty(HTMLSlotElement.prototype, \"childNodes\", {\n    get() {\n      const projectedNodes: Node[] = this.assignedNodes({ flatten: true });\n\n      // Slotted elements, use those.\n      if (projectedNodes.length > 0) {\n        // Remove any nodes that have already been accessed during this patch.\n        const childNodes = projectedNodes.filter((node) => {\n          return !accessedNodes.has(node);\n        });\n\n        for (const node of childNodes) {\n          accessedNodes.set(node, true);\n        }\n\n        return childNodes;\n      }\n      // if no assignedNodes, return original `childNodes`.\n      const childNodes = originalChildNodesGetter!.call(this) as NodeList;\n\n      for (const node of Array.from(childNodes)) {\n        accessedNodes.set(node, true);\n      }\n\n      return childNodes;\n    },\n    enumerable: true,\n    configurable: true,\n  });\n\n  HTMLSlotElement.prototype.querySelectorAll = function (str: string) {\n    let els: Element[] = [];\n\n    this.assignedElements({ flatten: true }).forEach((_el) => {\n      const el = _el as Element;\n\n      // Clone it and make a scratch buffer because we need to check that _el\n      // meets the criteria of the querySelector before we push it to \"els\"\n      const scratch = document.createElement(\"div\");\n      scratch.appendChild(el.cloneNode(false));\n\n      if (scratch.querySelector(str)) {\n        els.push(el);\n      }\n\n      els = els.concat(Array.from(el.querySelectorAll(str)));\n    });\n\n    // So because slots have fallback content, we want to only first query for slotted content.\n    // If theres no slotted content, we fallback to using the default content.\n    if (els.length == 0) {\n      els = Array.from(qsa.call(this, str));\n    }\n\n    return [...new Set(els)] as unknown as ReturnType<\n      typeof HTMLSlotElement.prototype.querySelectorAll\n    >;\n  };\n\n  return () => {\n    HTMLSlotElement.prototype.querySelectorAll = qsa;\n\n    // There's no way to `delete` a newly defined property, so we just call the original descriptor.\n    Object.defineProperty(HTMLSlotElement.prototype, \"childNodes\", {\n      get() {\n        return originalChildNodesGetter!.call(this);\n      },\n      enumerable: true,\n      configurable: true,\n    });\n  };\n}\n","import { patchWrap } from \"./trick-dom-testing-library\";\nimport { Container, ShadowOptions } from \"./types\";\n\nfunction fixOptions(options: ShadowOptions) {\n  if (options.shallow === true && options.depth !== 1) {\n    console.warn(\n      `The \"shallow\" option will be removed in the next major release. Please use \"{depth: 1}\" to maintain the same functionality as {shallow: true}.`,\n    );\n\n    if (options.shallow === true) {\n      options.depth = 1;\n    }\n  }\n\n  if (!options.depth) {\n    options.depth = Infinity;\n  }\n\n  return options;\n}\n\nexport function deepQuerySelector<T extends HTMLElement>(\n  container: Container,\n  selector: string,\n  options: ShadowOptions = { shallow: false, depth: Infinity },\n): T | null {\n  options = fixOptions(options);\n\n  const els = deepQuerySelectorAll(container, selector, options);\n\n  if (Array.isArray(els) && els.length > 0) {\n    return els[0] as T | null;\n  }\n\n  return null;\n}\n\n/**\n * `deepQuerySelector` behaves like a normal querySelector except it will recurse into the container ShadowRoot\n * and shadowRoot of children. It will not return shadow roots.\n *\n * @example\n *   // <my-element>\n *   //   #shadowRoot <slot name=\"blah\"></slot>\n *   //   <div></div>\n *   // </my-element>\n *   deepQuerySelectorAll(myElement, \"*\") // => [slot, div]\n *   deepQuerySelectorAll(myElement, \"slot[name='blah']\") // => [slot]\n */\nexport function deepQuerySelectorAll<T extends HTMLElement>(\n  container: Container,\n  selector: string,\n  options: ShadowOptions = { shallow: false, depth: Infinity },\n): T[] {\n  return patchWrap(() => {\n    const elements = getAllElementsAndShadowRoots(\n      container,\n      fixOptions(options),\n    );\n\n    const queriedElements = elements\n      .map((el) => Array.from(el.querySelectorAll<T>(selector)))\n      .flat(Infinity) as T[];\n    return [...new Set(queriedElements)];\n  });\n}\n\n// This could probably get really slow and memory intensive in large DOMs,\n// maybe an infinite generator in the future?\nexport function getAllElementsAndShadowRoots(\n  container: Container,\n  options: ShadowOptions = { shallow: false, depth: Infinity },\n) {\n  const selector = \"*\";\n\n  return recurse(container, selector, fixOptions(options));\n}\n\nfunction recurse(\n  container: Container,\n  selector: string,\n  options: ShadowOptions = { shallow: false, depth: Infinity },\n  elementsToProcess: (Element | ShadowRoot | Document)[] = [],\n  elements: (Element | ShadowRoot | Document)[] = [],\n  currentDepth = 1,\n) {\n  // if \"document\" is passed in, it will also pick up \"<html>\" causing the query to run twice.\n  if (container instanceof Document) {\n    container = document.documentElement;\n  }\n\n  // I haven't figured this one out, but for some reason when using the buildQueries\n  // from DOM-testing-library, not reassigning here causes an infinite loop.\n  // I've even tried calling \"elementsToProcess.includes / .find\" with no luck.\n  elementsToProcess = [container];\n  elements.push(container); // Make sure we're checking the container element!\n\n  // Accounts for if the container houses a textNode\n  if (\n    container instanceof HTMLElement &&\n    container.shadowRoot != null &&\n    container.shadowRoot.mode !== \"closed\"\n  ) {\n    elements.push(container.shadowRoot);\n    elementsToProcess.push(container.shadowRoot);\n  }\n\n  elementsToProcess.forEach((containerElement) => {\n    containerElement\n      .querySelectorAll(selector)\n      .forEach((el: Element | HTMLElement) => {\n        if (el.shadowRoot == null || el.shadowRoot.mode === \"closed\") {\n          elements.push(el);\n          return;\n        }\n\n        // This is here because queryByRole() requires the parent element which in some cases is the shadow root.\n        elements.push(el.shadowRoot);\n\n        if (options.depth && options.depth <= currentDepth) {\n          el.shadowRoot.querySelectorAll(selector).forEach((el) => {\n            elements.push(el);\n          });\n          return;\n        }\n\n        currentDepth++;\n\n        el.shadowRoot.querySelectorAll(selector).forEach((el) => {\n          elements.push(el);\n          elementsToProcess.push(el);\n        });\n        recurse(\n          el.shadowRoot,\n          selector,\n          options,\n          elementsToProcess,\n          elements,\n          currentDepth,\n        );\n      });\n  });\n\n  // We can sometimes hit duplicate nodes this way, lets stop that.\n  return [...new Set(elements)];\n}\n","import { logDOM } from \"@testing-library/dom\";\nimport {\n  createDOMElementFilter,\n  filterCommentsAndDefaultIgnoreTagsTags,\n} from \"./pretty-shadow-dom\";\nimport type { NewPlugin } from \"pretty-format\";\nimport { patchWrap } from \"./trick-dom-testing-library\";\n\nexport function logShadowDOM(\n  ...args: Parameters<typeof logDOM>\n): ReturnType<typeof logDOM> {\n  let [dom, maxLength, options] = args;\n\n  const plugin: NewPlugin = createDOMElementFilter(\n    options?.filterNode || filterCommentsAndDefaultIgnoreTagsTags,\n  );\n\n  if (options == null) options = {};\n  if (options.plugins == null) options.plugins = [];\n  options.plugins.push(plugin);\n\n  patchWrap(() => logDOM(dom, maxLength, options));\n}\n","import { prettyDOM, getConfig } from \"@testing-library/dom\";\nimport type { Config, NewPlugin, Printer, Refs } from \"pretty-format\";\nimport { patchWrap } from \"./trick-dom-testing-library\";\n\n// This regexp combo took way too long to figure out...\nconst findWhiteSpace = /([^\\S(\\r\\n|\\r|\\n)]*[\\f\\n\\r\\t\\v]+)/.source;\n\nfunction removeDuplicateNewLines(str: string) {\n  let final = str.replace(\n    new RegExp(`${findWhiteSpace}.*${findWhiteSpace}{2,}`, \"g\"),\n    \"\",\n  );\n  return final;\n}\n\nexport function prettyShadowDOM(\n  ...args: Parameters<typeof prettyDOM>\n): ReturnType<typeof prettyDOM> {\n  let [dom, maxLength, options] = args;\n\n  const plugin: NewPlugin = createDOMElementFilter(\n    options?.filterNode || filterCommentsAndDefaultIgnoreTagsTags,\n  );\n\n  if (options == null) options = {};\n  if (options.plugins == null) options.plugins = [];\n\n  options.plugins.push(plugin);\n\n  return patchWrap(() =>\n    prettyDOM(dom, maxLength, {\n      ...options,\n      plugins: [plugin],\n    }),\n  );\n}\n\nfunction escapeHTML(str: string): string {\n  return str.replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n}\n\nexport function filterCommentsAndDefaultIgnoreTagsTags(value: Node) {\n  return (\n    value.nodeType !== COMMENT_NODE &&\n    (value.nodeType !== ELEMENT_NODE ||\n      // @ts-expect-error\n      !value.matches(getConfig().defaultIgnore))\n  );\n}\n\n// Return empty string if keys is empty.\nconst printProps = (\n  keys: Array<string>,\n  props: Record<string, unknown>,\n  config: Config,\n  indentation: string,\n  depth: number,\n  refs: Refs,\n  printer: Printer,\n): string => {\n  const indentationNext = indentation + config.indent;\n  const colors = config.colors;\n\n  return keys\n    .map((key) => {\n      const value = props[key];\n      let printed = printer(value, config, indentationNext, depth, refs);\n\n      if (typeof value !== \"string\") {\n        if (printed.indexOf(\"\\n\") !== -1) {\n          printed =\n            config.spacingOuter +\n            indentationNext +\n            printed +\n            config.spacingOuter +\n            indentation;\n        }\n        printed = \"{\" + printed + \"}\";\n      }\n\n      return (\n        config.spacingInner +\n        indentation +\n        colors.prop.open +\n        key +\n        colors.prop.close +\n        \"=\" +\n        colors.value.open +\n        printed +\n        colors.value.close\n      );\n    })\n    .join(\"\");\n};\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType#node_type_constants\nconst NodeTypeTextNode = 3;\n\n// Return empty string if children is empty.\nconst printChildren = (\n  children: Array<unknown>,\n  config: Config,\n  indentation: string,\n  depth: number,\n  refs: Refs,\n  printer: Printer,\n): string =>\n  removeDuplicateNewLines(\n    children\n      .map((child) => {\n        const printedChild =\n          typeof child === \"string\"\n            ? printText(child, config)\n            : printer(child, config, indentation, depth, refs);\n\n        if (\n          printedChild === \"\" &&\n          typeof child === \"object\" &&\n          child != null &&\n          (child as Node).nodeType !== NodeTypeTextNode\n        ) {\n          // A plugin serialized this Node to '' meaning we should ignore it.\n          return \"\";\n        }\n        return config.spacingOuter + indentation + printedChild;\n      })\n      .join(\"\"),\n  );\n\nconst printText = (text: string, config: Config): string => {\n  const contentColor = config.colors.content;\n  return contentColor.open + escapeHTML(text) + contentColor.close;\n};\n\nconst printComment = (comment: string, config: Config): string => {\n  const commentColor = config.colors.comment;\n  return (\n    commentColor.open +\n    \"<!--\" +\n    escapeHTML(comment) +\n    \"-->\" +\n    commentColor.close\n  );\n};\n\n// Separate the functions to format props, children, and element,\n// so a plugin could override a particular function, if needed.\n// Too bad, so sad: the traditional (but unnecessary) space\n// in a self-closing tagColor requires a second test of printedProps.\nconst printElement = (\n  type: string,\n  printedProps: string,\n  printedChildren: string,\n  config: Config,\n  indentation: string,\n): string => {\n  const tagColor = config.colors.tag;\n\n  return (\n    tagColor.open +\n    \"<\" +\n    type +\n    (printedProps &&\n      tagColor.close +\n        printedProps +\n        config.spacingOuter +\n        indentation +\n        tagColor.open) +\n    (printedChildren\n      ? \">\" +\n        tagColor.close +\n        printedChildren +\n        config.spacingOuter +\n        indentation +\n        tagColor.open +\n        \"</\" +\n        type\n      : (printedProps && !config.min ? \"\" : \" \") + \"/\") +\n    \">\" +\n    tagColor.close\n  );\n};\n\nconst printElementAsLeaf = (type: string, config: Config): string => {\n  const tagColor = config.colors.tag;\n  return (\n    tagColor.open +\n    \"<\" +\n    type +\n    tagColor.close +\n    \" …\" +\n    tagColor.open +\n    \" />\" +\n    tagColor.close\n  );\n};\n\nconst ELEMENT_NODE = 1;\nconst TEXT_NODE = 3;\nconst COMMENT_NODE = 8;\nconst FRAGMENT_NODE = 11;\n\nconst ELEMENT_REGEXP = /^((HTML|SVG)\\w*)?Element$/;\n\nconst testNode = (val: any) => {\n  const constructorName = val?.constructor?.name || \"\";\n  const { nodeType, tagName } = val;\n  const isCustomElement =\n    (typeof tagName === \"string\" && tagName.includes(\"-\")) ||\n    (typeof val.hasAttribute === \"function\" && val.hasAttribute(\"is\")) ||\n    val instanceof HTMLElement;\n\n  return (\n    (nodeType === ELEMENT_NODE &&\n      (ELEMENT_REGEXP.test(constructorName) || isCustomElement)) ||\n    (nodeType === TEXT_NODE && constructorName === \"Text\") ||\n    (nodeType === COMMENT_NODE && constructorName === \"Comment\") ||\n    // Don't check constructorName === \"DocumentFragment\" because it excludes ShadowRoot.\n    nodeType === FRAGMENT_NODE\n  );\n};\n\nexport const test: NewPlugin[\"test\"] = (val: any) =>\n  val?.constructor?.name && testNode(val);\n\ntype HandledType = Element | Text | Comment | DocumentFragment;\n\nfunction nodeIsText(node: HandledType): node is Text {\n  return node.nodeType === TEXT_NODE;\n}\n\nfunction nodeIsComment(node: HandledType): node is Comment {\n  return node.nodeType === COMMENT_NODE;\n}\n\nfunction nodeIsFragment(\n  node: HandledType,\n): node is DocumentFragment | ShadowRoot {\n  return node.nodeType === FRAGMENT_NODE;\n}\n\nexport function createDOMElementFilter(\n  filterNode: (node: Node) => boolean,\n): NewPlugin {\n  function getChildren(\n    node: Element | DocumentFragment | ShadowRoot,\n  ): (Node | Element | ShadowRoot)[] {\n    const children: (Node | Element | ShadowRoot)[] =\n      Array.prototype.slice.call(node.childNodes || node.children);\n\n    if (\n      \"shadowRoot\" in node &&\n      node.shadowRoot != null &&\n      node.shadowRoot.mode !== \"closed\"\n    ) {\n      children.unshift(node.shadowRoot);\n    }\n\n    return children.filter(filterNode);\n  }\n\n  return {\n    test: (val: any) => val?.constructor && testNode(val),\n    serialize: (\n      node: HandledType,\n      config: Config,\n      indentation: string,\n      depth: number,\n      refs: Refs,\n      printer: Printer,\n    ) => {\n      if (nodeIsText(node)) {\n        return printText(node.data, config);\n      }\n\n      if (nodeIsComment(node)) {\n        return printComment(node.data, config);\n      }\n\n      let type = \"DocumentFragment\";\n\n      if (\"tagName\" in node && node.tagName) {\n        type = node.tagName.toLowerCase();\n      } else if (node instanceof ShadowRoot) {\n        type = \"ShadowRoot\";\n      }\n\n      if (++depth > config.maxDepth) {\n        return printElementAsLeaf(type, config);\n      }\n\n      return printElement(\n        type,\n        printProps(\n          nodeIsFragment(node)\n            ? []\n            : Array.from(node.attributes)\n                .map((attr) => attr.name)\n                .sort(),\n          nodeIsFragment(node)\n            ? {}\n            : Array.from(node.attributes).reduce<Record<string, string>>(\n                (props, attribute) => {\n                  props[attribute.name] = attribute.value;\n                  return props;\n                },\n                {},\n              ),\n          config,\n          indentation + config.indent,\n          depth,\n          refs,\n          printer,\n        ),\n        printChildren(\n          getChildren(node) as unknown[],\n          config,\n          indentation + config.indent,\n          depth,\n          refs,\n          printer,\n        ),\n        config,\n        indentation,\n      );\n    },\n  };\n}\n","import { screen } from \"@testing-library/dom\";\nimport { logShadowDOM } from \"./log-shadow-dom\";\n\nexport function debug(...args: Parameters<typeof screen.debug>) {\n  let [element, maxLength, options] = args;\n\n  Array.isArray(element)\n    ? element.forEach((el) => logShadowDOM(el, maxLength, options))\n    : logShadowDOM(element, maxLength, options);\n}\n","import { debug } from \"./debug\";\nimport { screen } from \"@testing-library/dom\";\n\nimport * as shadowQueries from \"./shadow-queries\";\nimport {\n  AsyncScreenShadowMatcherParams,\n  AsyncScreenShadowRoleMatcherParams,\n  AsyncScreenShadowSelectorMatcherParams,\n  ScreenShadowMatcherParams,\n  ScreenShadowRoleMatcherParams,\n  ScreenShadowSelectorMatcherParams,\n} from \"./types\";\n\n// Shadows the following: https://testing-library.com/docs/queries/about/#priority\nconst shadowScreen = {\n  ...screen,\n  debug,\n  // Role\n  queryAllByShadowRole: <T extends HTMLElement>(\n    ...args: ScreenShadowRoleMatcherParams\n  ) =>\n    shadowQueries.queryAllByShadowRole<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  queryByShadowRole: <T extends HTMLElement>(\n    ...args: ScreenShadowRoleMatcherParams\n  ) =>\n    shadowQueries.queryByShadowRole<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getAllByShadowRole: <T extends HTMLElement>(\n    ...args: ScreenShadowRoleMatcherParams\n  ) =>\n    shadowQueries.getAllByShadowRole<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getByShadowRole: <T extends HTMLElement>(\n    ...args: ScreenShadowRoleMatcherParams\n  ) =>\n    shadowQueries.getByShadowRole<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  findAllByShadowRole: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowRoleMatcherParams\n  ) =>\n    shadowQueries.findAllByShadowRole<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n  findByShadowRole: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowRoleMatcherParams\n  ) =>\n    shadowQueries.findByShadowRole<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n\n  // Label Text\n  queryAllByShadowLabelText: <T extends HTMLElement>(\n    ...args: ScreenShadowSelectorMatcherParams\n  ) =>\n    shadowQueries.queryAllByShadowLabelText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  queryByShadowLabelText: <T extends HTMLElement>(\n    ...args: ScreenShadowSelectorMatcherParams\n  ) =>\n    shadowQueries.queryByShadowLabelText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getAllByShadowLabelText: <T extends HTMLElement>(\n    ...args: ScreenShadowSelectorMatcherParams\n  ) =>\n    shadowQueries.getAllByShadowLabelText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getByShadowLabelText: <T extends HTMLElement>(\n    ...args: ScreenShadowSelectorMatcherParams\n  ) =>\n    shadowQueries.getByShadowLabelText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  findAllByShadowLabelText: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowSelectorMatcherParams\n  ) =>\n    shadowQueries.findAllByShadowLabelText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n  findByShadowLabelText: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowSelectorMatcherParams\n  ) =>\n    shadowQueries.findByShadowLabelText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n\n  // Placeholder Text\n  queryAllByShadowPlaceholderText: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.queryAllByShadowPlaceholderText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  queryByShadowPlaceholderText: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.queryByShadowPlaceholderText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getAllByShadowPlaceholderText: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.getAllByShadowPlaceholderText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getByShadowPlaceholderText: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.getByShadowPlaceholderText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  findAllByShadowPlaceholderText: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowMatcherParams\n  ) =>\n    shadowQueries.findAllByShadowPlaceholderText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n  findByShadowPlaceholderText: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowMatcherParams\n  ) =>\n    shadowQueries.findByShadowPlaceholderText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n\n  // Text\n  queryAllByShadowText: <T extends HTMLElement>(\n    ...args: ScreenShadowSelectorMatcherParams\n  ) =>\n    shadowQueries.queryAllByShadowText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  queryByShadowText: <T extends HTMLElement>(\n    ...args: ScreenShadowSelectorMatcherParams\n  ) =>\n    shadowQueries.queryByShadowText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getAllByShadowText: <T extends HTMLElement>(\n    ...args: ScreenShadowSelectorMatcherParams\n  ) =>\n    shadowQueries.getAllByShadowText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getByShadowText: <T extends HTMLElement>(\n    ...args: ScreenShadowSelectorMatcherParams\n  ) =>\n    shadowQueries.getByShadowText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  findAllByShadowText: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowSelectorMatcherParams\n  ) =>\n    shadowQueries.findAllByShadowText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n  findByShadowText: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowSelectorMatcherParams\n  ) =>\n    shadowQueries.findByShadowText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n\n  // Display Value\n  queryAllByShadowDisplayValue: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.queryAllByShadowDisplayValue<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  queryByShadowDisplayValue: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.queryByShadowDisplayValue<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getAllByShadowDisplayValue: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.getAllByShadowDisplayValue<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getByShadowDisplayValue: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.getByShadowDisplayValue<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  findAllByShadowDisplayValue: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowMatcherParams\n  ) =>\n    shadowQueries.findAllByShadowDisplayValue<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n  findByShadowDisplayValue: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowMatcherParams\n  ) =>\n    shadowQueries.findByShadowDisplayValue<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n\n  // Alt Text\n  queryAllByShadowAltText: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.queryAllByShadowAltText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  queryByShadowAltText: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.queryByShadowAltText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getAllByShadowAltText: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.getAllByShadowAltText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getByShadowAltText: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.getByShadowAltText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  findAllByShadowAltText: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowMatcherParams\n  ) =>\n    shadowQueries.findAllByShadowAltText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n  findByShadowAltText: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowMatcherParams\n  ) =>\n    shadowQueries.findByShadowAltText<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n\n  // Title\n  queryAllByShadowTitle: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.queryAllByShadowTitle<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  queryByShadowTitle: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.queryByShadowTitle<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getAllByShadowTitle: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.getAllByShadowTitle<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getByShadowTitle: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.getByShadowTitle<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  findAllByShadowTitle: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowMatcherParams\n  ) =>\n    shadowQueries.findAllByShadowTitle<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n  findByShadowTitle: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowMatcherParams\n  ) =>\n    shadowQueries.findByShadowTitle<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n\n  // Test Id\n  queryAllByShadowTestId: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.queryAllByShadowTestId<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  queryByShadowTestId: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.queryByShadowTestId<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getAllByShadowTestId: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.getAllByShadowTestId<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  getByShadowTestId: <T extends HTMLElement>(\n    ...args: ScreenShadowMatcherParams\n  ) =>\n    shadowQueries.getByShadowTestId<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n    ),\n  findAllByShadowTestId: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowMatcherParams\n  ) =>\n    shadowQueries.findAllByShadowTestId<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n  findByShadowTestId: <T extends HTMLElement>(\n    ...args: AsyncScreenShadowMatcherParams\n  ) =>\n    shadowQueries.findByShadowTestId<T>(\n      document.documentElement,\n      args[0],\n      args[1],\n      args[2],\n    ),\n};\n\nexport { shadowScreen };\n","import { queries, within } from \"@testing-library/dom\";\n\nimport * as shadowQueries from \"./shadow-queries\";\n\nconst allQueries = {\n  ...queries,\n  ...shadowQueries,\n};\n\nexport function shadowWithin(element: HTMLElement) {\n  const withinObj = within(element, allQueries);\n\n  // This is a gross and ugly hack. However, the `allQueries` function from RTL doesn't\n  // preserve generics, so we generate the within object, and then overwrite the \"shadow\" functions to properly\n  // support generics.\n  const shadowWithinObj = {\n    // Role\n    queryAllByShadowRole: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryAllByShadowRole>\n    ) =>\n      withinObj.queryAllByShadowRole(...args) as ReturnType<\n        typeof shadowQueries.queryAllByShadowRole<T>\n      >,\n    queryByShadowRole: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryByShadowRole>\n    ) =>\n      withinObj.queryByShadowRole(...args) as ReturnType<\n        typeof shadowQueries.queryByShadowRole<T>\n      >,\n    getAllByShadowRole: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getAllByShadowRole>\n    ) =>\n      withinObj.getAllByShadowRole(...args) as ReturnType<\n        typeof shadowQueries.getAllByShadowRole<T>\n      >,\n    getByShadowRole: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getByShadowRole>\n    ) =>\n      withinObj.getByShadowRole(...args) as ReturnType<\n        typeof shadowQueries.getByShadowRole<T>\n      >,\n    findAllByShadowRole: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findAllByShadowRole>\n    ) =>\n      withinObj.findAllByShadowRole(...args) as ReturnType<\n        typeof shadowQueries.findAllByShadowRole<T>\n      >,\n    findByShadowRole: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findByShadowRole>\n    ) =>\n      withinObj.findByShadowRole(...args) as ReturnType<\n        typeof shadowQueries.findByShadowRole<T>\n      >,\n\n    // Label Text\n    queryAllByShadowLabelText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryAllByShadowLabelText>\n    ) =>\n      withinObj.queryAllByShadowLabelText(...args) as ReturnType<\n        typeof shadowQueries.queryAllByShadowLabelText<T>\n      >,\n    queryByShadowLabelText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryByShadowLabelText>\n    ) =>\n      withinObj.queryByShadowLabelText(...args) as ReturnType<\n        typeof shadowQueries.queryByShadowLabelText<T>\n      >,\n    getAllByShadowLabelText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getAllByShadowLabelText>\n    ) =>\n      withinObj.getAllByShadowLabelText(...args) as ReturnType<\n        typeof shadowQueries.getAllByShadowLabelText<T>\n      >,\n    getByShadowLabelText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getByShadowLabelText>\n    ) =>\n      withinObj.getByShadowLabelText(...args) as ReturnType<\n        typeof shadowQueries.getByShadowLabelText<T>\n      >,\n    findAllByShadowLabelText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findAllByShadowLabelText>\n    ) =>\n      withinObj.findAllByShadowLabelText(...args) as ReturnType<\n        typeof shadowQueries.findAllByShadowLabelText<T>\n      >,\n    findByShadowLabelText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findByShadowLabelText>\n    ) =>\n      withinObj.findByShadowLabelText(...args) as ReturnType<\n        typeof shadowQueries.findByShadowLabelText<T>\n      >,\n\n    // Placeholder Text\n    queryAllByShadowPlaceholderText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryAllByShadowPlaceholderText>\n    ) =>\n      withinObj.queryAllByShadowPlaceholderText(...args) as ReturnType<\n        typeof shadowQueries.queryAllByShadowPlaceholderText<T>\n      >,\n    queryByShadowPlaceholderText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryByShadowPlaceholderText>\n    ) =>\n      withinObj.queryByShadowPlaceholderText(...args) as ReturnType<\n        typeof shadowQueries.queryByShadowPlaceholderText<T>\n      >,\n    getAllByShadowPlaceholderText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getAllByShadowPlaceholderText>\n    ) =>\n      withinObj.getAllByShadowPlaceholderText(...args) as ReturnType<\n        typeof shadowQueries.getAllByShadowPlaceholderText<T>\n      >,\n    getByShadowPlaceholderText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getByShadowPlaceholderText>\n    ) =>\n      withinObj.getByShadowPlaceholderText(...args) as ReturnType<\n        typeof shadowQueries.getByShadowPlaceholderText<T>\n      >,\n    findAllByShadowPlaceholderText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findAllByShadowPlaceholderText>\n    ) =>\n      withinObj.findAllByShadowPlaceholderText(...args) as ReturnType<\n        typeof shadowQueries.findAllByShadowPlaceholderText<T>\n      >,\n    findByShadowPlaceholderText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findByShadowPlaceholderText>\n    ) =>\n      withinObj.findByShadowPlaceholderText(...args) as ReturnType<\n        typeof shadowQueries.findByShadowPlaceholderText<T>\n      >,\n\n    // Text\n    queryAllByShadowText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryAllByShadowText>\n    ) =>\n      withinObj.queryAllByShadowText(...args) as ReturnType<\n        typeof shadowQueries.queryAllByShadowText<T>\n      >,\n    queryByShadowText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryByShadowText>\n    ) =>\n      withinObj.queryByShadowText(...args) as ReturnType<\n        typeof shadowQueries.queryByShadowText<T>\n      >,\n    getAllByShadowText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getAllByShadowText>\n    ) =>\n      withinObj.getAllByShadowText(...args) as ReturnType<\n        typeof shadowQueries.getAllByShadowText<T>\n      >,\n    getByShadowText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getByShadowText>\n    ) =>\n      withinObj.getByShadowText(...args) as ReturnType<\n        typeof shadowQueries.getByShadowText<T>\n      >,\n    findAllByShadowText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findAllByShadowText>\n    ) =>\n      withinObj.findAllByShadowText(...args) as ReturnType<\n        typeof shadowQueries.findAllByShadowText<T>\n      >,\n    findByShadowText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findByShadowText>\n    ) =>\n      withinObj.findByShadowText(...args) as ReturnType<\n        typeof shadowQueries.findByShadowText<T>\n      >,\n\n    // Display Value\n    queryAllByShadowDisplayValue: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryAllByShadowDisplayValue>\n    ) =>\n      withinObj.queryAllByShadowDisplayValue(...args) as ReturnType<\n        typeof shadowQueries.queryAllByShadowDisplayValue<T>\n      >,\n    queryByShadowDisplayValue: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryByShadowDisplayValue>\n    ) =>\n      withinObj.queryByShadowDisplayValue(...args) as ReturnType<\n        typeof shadowQueries.queryByShadowDisplayValue<T>\n      >,\n    getAllByShadowDisplayValue: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getAllByShadowDisplayValue>\n    ) =>\n      withinObj.getAllByShadowDisplayValue(...args) as ReturnType<\n        typeof shadowQueries.getAllByShadowDisplayValue<T>\n      >,\n    getByShadowDisplayValue: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getByShadowDisplayValue>\n    ) =>\n      withinObj.getByShadowDisplayValue(...args) as ReturnType<\n        typeof shadowQueries.getByShadowDisplayValue<T>\n      >,\n    findAllByShadowDisplayValue: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findAllByShadowDisplayValue>\n    ) =>\n      withinObj.findAllByShadowDisplayValue(...args) as ReturnType<\n        typeof shadowQueries.findAllByShadowDisplayValue<T>\n      >,\n    findByShadowDisplayValue: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findByShadowDisplayValue>\n    ) =>\n      withinObj.findByShadowDisplayValue(...args) as ReturnType<\n        typeof shadowQueries.findByShadowDisplayValue<T>\n      >,\n\n    // Alt Text\n    queryAllByShadowAltText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryAllByShadowAltText>\n    ) =>\n      withinObj.queryAllByShadowAltText(...args) as ReturnType<\n        typeof shadowQueries.queryAllByShadowAltText<T>\n      >,\n    queryByShadowAltText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryByShadowAltText>\n    ) =>\n      withinObj.queryByShadowAltText(...args) as ReturnType<\n        typeof shadowQueries.queryByShadowAltText<T>\n      >,\n    getAllByShadowAltText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getAllByShadowAltText>\n    ) =>\n      withinObj.getAllByShadowAltText(...args) as ReturnType<\n        typeof shadowQueries.getAllByShadowAltText<T>\n      >,\n    getByShadowAltText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getByShadowAltText>\n    ) =>\n      withinObj.getByShadowAltText(...args) as ReturnType<\n        typeof shadowQueries.getByShadowAltText<T>\n      >,\n    findAllByShadowAltText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findAllByShadowAltText>\n    ) =>\n      withinObj.findAllByShadowAltText(...args) as ReturnType<\n        typeof shadowQueries.findAllByShadowAltText<T>\n      >,\n    findByShadowAltText: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findByShadowAltText>\n    ) =>\n      withinObj.findByShadowAltText(...args) as ReturnType<\n        typeof shadowQueries.findByShadowAltText<T>\n      >,\n\n    // Title\n    queryAllByShadowTitle: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryAllByShadowTitle>\n    ) =>\n      withinObj.queryAllByShadowTitle(...args) as ReturnType<\n        typeof shadowQueries.queryAllByShadowTitle<T>\n      >,\n    queryByShadowTitle: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryByShadowTitle>\n    ) =>\n      withinObj.queryByShadowTitle(...args) as ReturnType<\n        typeof shadowQueries.queryByShadowTitle<T>\n      >,\n    getAllByShadowTitle: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getAllByShadowTitle>\n    ) =>\n      withinObj.getAllByShadowTitle(...args) as ReturnType<\n        typeof shadowQueries.getAllByShadowTitle<T>\n      >,\n    getByShadowTitle: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getByShadowTitle>\n    ) =>\n      withinObj.getByShadowTitle(...args) as ReturnType<\n        typeof shadowQueries.getByShadowTitle<T>\n      >,\n    findAllByShadowTitle: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findAllByShadowTitle>\n    ) =>\n      withinObj.findAllByShadowTitle(...args) as ReturnType<\n        typeof shadowQueries.findAllByShadowTitle<T>\n      >,\n    findByShadowTitle: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findByShadowTitle>\n    ) =>\n      withinObj.findByShadowTitle(...args) as ReturnType<\n        typeof shadowQueries.findByShadowTitle<T>\n      >,\n\n    // Test Id\n    queryAllByShadowTestId: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryAllByShadowTestId>\n    ) =>\n      withinObj.queryAllByShadowTestId(...args) as ReturnType<\n        typeof shadowQueries.queryAllByShadowTestId<T>\n      >,\n    queryByShadowTestId: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.queryByShadowTestId>\n    ) =>\n      withinObj.queryByShadowTestId(...args) as ReturnType<\n        typeof shadowQueries.queryByShadowTestId<T>\n      >,\n    getAllByShadowTestId: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getAllByShadowTestId>\n    ) =>\n      withinObj.getAllByShadowTestId(...args) as ReturnType<\n        typeof shadowQueries.getAllByShadowTestId<T>\n      >,\n    getByShadowTestId: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.getByShadowTestId>\n    ) =>\n      withinObj.getByShadowTestId(...args) as ReturnType<\n        typeof shadowQueries.getByShadowTestId<T>\n      >,\n    findAllByShadowTestId: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findAllByShadowTestId>\n    ) =>\n      withinObj.findAllByShadowTestId(...args) as ReturnType<\n        typeof shadowQueries.findAllByShadowTestId<T>\n      >,\n    findByShadowTestId: <T extends HTMLElement>(\n      ...args: Parameters<typeof withinObj.findByShadowTestId>\n    ) =>\n      withinObj.findByShadowTestId(...args) as ReturnType<\n        typeof shadowQueries.findByShadowTestId<T>\n      >,\n  };\n\n  // return withinFn\n\n  const finalObj = {\n    ...withinObj,\n    ...shadowWithinObj,\n  };\n\n  return finalObj;\n}\n","import { getConfig, isInaccessible } from \"@testing-library/dom\";\nimport { getImplicitAriaRoles } from \"@testing-library/dom/dist/role-helpers\";\n\nimport {\n  computeAccessibleName,\n  computeAccessibleDescription,\n} from \"dom-accessibility-api\";\nimport { prettyShadowDOM } from \"./pretty-shadow-dom\";\n\nfunction getRoles(container: Element, { hidden = false } = {}) {\n  function getShadowChildren(node: Element, shadowChildren: Element[] = []) {\n    if (!node.shadowRoot) {\n      return shadowChildren;\n    }\n\n    // should we push the shadowRoot??\n    // shadowChildren.push(node.shadowRoot)\n\n    for (const child of Array.from(node.shadowRoot.children)) {\n      getShadowChildren(child, shadowChildren);\n      shadowChildren.push(child);\n    }\n\n    return shadowChildren;\n  }\n  function flattenDOM(node: Element): Element[] {\n    const children = Array.from(node.children);\n    const flatChildren = [...getShadowChildren(node), ...children].reduce<\n      Element[]\n    >((acc, child) => [...acc, ...flattenDOM(child)], []);\n    return [node, ...flatChildren];\n  }\n\n  return flattenDOM(container)\n    .filter((element) => {\n      return hidden === false\n        ? isInaccessible(element as Element) === false\n        : true;\n    })\n    .reduce(\n      (acc, node) => {\n        let roles: string[] = [];\n        // TODO: This violates html-aria which does not allow any role on every element\n        if (node.hasAttribute(\"role\")) {\n          roles = node.getAttribute(\"role\")!.split(\" \").slice(0, 1);\n        } else {\n          roles = getImplicitAriaRoles(node);\n        }\n\n        return roles.reduce<any>(\n          (rolesAcc, role) =>\n            Array.isArray(rolesAcc[role])\n              ? { ...rolesAcc, [role]: [...rolesAcc[role], node] }\n              : { ...rolesAcc, [role]: [node] },\n          acc,\n        );\n      },\n      {} as Record<string, Element[]>,\n    );\n}\n\nfunction prettyRoles(\n  dom: Element,\n  {\n    hidden,\n    includeDescription,\n  }: { hidden?: boolean; includeDescription?: boolean },\n) {\n  const roles = getRoles(dom, { hidden });\n  // We prefer to skip generic role, we don't recommend it\n  return Object.entries(roles)\n    .filter(([role]) => role !== \"generic\")\n    .map(([role, elements]) => {\n      const delimiterBar = \"-\".repeat(50);\n      const elementsString = elements\n        .map((el) => {\n          const nameString = `Name \"${computeAccessibleName(el, {\n            computedStyleSupportsPseudoElements:\n              getConfig().computedStyleSupportsPseudoElements,\n          })}\":\\n`;\n\n          // @ts-expect-error\n          const domString = prettyShadowDOM(el.cloneNode(false));\n\n          if (includeDescription) {\n            const descriptionString = `Description \"${computeAccessibleDescription(\n              el,\n              {\n                computedStyleSupportsPseudoElements:\n                  getConfig().computedStyleSupportsPseudoElements,\n              },\n            )}\":\\n`;\n            return `${nameString}${descriptionString}${domString}`;\n          }\n\n          return `${nameString}${domString}`;\n        })\n        .join(\"\\n\\n\");\n\n      return `${role}:\\n\\n${elementsString}\\n\\n${delimiterBar}`;\n    })\n    .join(\"\\n\");\n}\n\nexport const logRoles = (dom: Element, { hidden = false } = {}) =>\n  console.log(prettyRoles(dom, { hidden }));\n","/**\n * @source {https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Polyfill}\n * but without thisArg (too hard to type, no need to `this`)\n */\nconst toStr = Object.prototype.toString;\nfunction isCallable(fn: unknown): boolean {\n\treturn typeof fn === \"function\" || toStr.call(fn) === \"[object Function]\";\n}\nfunction toInteger(value: unknown): number {\n\tconst number = Number(value);\n\tif (isNaN(number)) {\n\t\treturn 0;\n\t}\n\tif (number === 0 || !isFinite(number)) {\n\t\treturn number;\n\t}\n\treturn (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));\n}\nconst maxSafeInteger = Math.pow(2, 53) - 1;\nfunction toLength(value: unknown): number {\n\tconst len = toInteger(value);\n\treturn Math.min(Math.max(len, 0), maxSafeInteger);\n}\n/**\n * Creates an array from an iterable object.\n * @param iterable An iterable object to convert to an array.\n */\nexport default function arrayFrom<T>(iterable: Iterable<T> | ArrayLike<T>): T[];\n/**\n * Creates an array from an iterable object.\n * @param iterable An iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\nexport default function arrayFrom<T, U>(\n\tarrayLike: Iterable<T> | ArrayLike<T>,\n\tmapFn?: (v: T, k: number) => U\n): U[] {\n\t// 1. Let C be the this value.\n\t// edit(@eps1lon): we're not calling it as Array.from\n\tconst C = Array;\n\n\t// 2. Let items be ToObject(arrayLike).\n\tconst items = Object(arrayLike);\n\n\t// 3. ReturnIfAbrupt(items).\n\tif (arrayLike == null) {\n\t\tthrow new TypeError(\n\t\t\t\"Array.from requires an array-like object - not null or undefined\"\n\t\t);\n\t}\n\n\t// 4. If mapfn is undefined, then let mapping be false.\n\t// const mapFn = arguments.length > 1 ? arguments[1] : void undefined;\n\n\tif (typeof mapFn !== \"undefined\") {\n\t\t// 5. else\n\t\t// 5. a If IsCallable(mapfn) is false, throw a TypeError exception.\n\t\tif (!isCallable(mapFn)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t\"Array.from: when provided, the second argument must be a function\"\n\t\t\t);\n\t\t}\n\t}\n\n\t// 10. Let lenValue be Get(items, \"length\").\n\t// 11. Let len be ToLength(lenValue).\n\tconst len = toLength(items.length);\n\n\t// 13. If IsConstructor(C) is true, then\n\t// 13. a. Let A be the result of calling the [[Construct]] internal method\n\t// of C with an argument list containing the single item len.\n\t// 14. a. Else, Let A be ArrayCreate(len).\n\tconst A = isCallable(C) ? Object(new C(len)) : new Array(len);\n\n\t// 16. Let k be 0.\n\tlet k = 0;\n\t// 17. Repeat, while k < len… (also steps a - h)\n\tlet kValue;\n\twhile (k < len) {\n\t\tkValue = items[k];\n\t\tif (mapFn) {\n\t\t\tA[k] = mapFn(kValue, k);\n\t\t} else {\n\t\t\tA[k] = kValue;\n\t\t}\n\t\tk += 1;\n\t}\n\t// 18. Let putStatus be Put(A, \"length\", len, true).\n\tA.length = len;\n\t// 20. Return A.\n\treturn A;\n}\n","declare global {\n\tclass Set<T> {\n\t\t// es2015.collection.d.ts\n\t\tconstructor(items?: T[]);\n\t\tadd(value: T): this;\n\t\tclear(): void;\n\t\tdelete(value: T): boolean;\n\t\tforEach(\n\t\t\tcallbackfn: (value: T, value2: T, set: Set<T>) => void,\n\t\t\tthisArg?: unknown\n\t\t): void;\n\t\thas(value: T): boolean;\n\t\treadonly size: number;\n\n\t\t// es2015.iterable.d.ts\n\t\t// no  implemennted\n\t}\n}\n\n// for environments without Set we fallback to arrays with unique members\nclass SetLike<T> implements Set<T> {\n\tprivate items: T[];\n\n\tconstructor(items: T[] = []) {\n\t\tthis.items = items;\n\t}\n\n\tadd(value: T): this {\n\t\tif (this.has(value) === false) {\n\t\t\tthis.items.push(value);\n\t\t}\n\t\treturn this;\n\t}\n\tclear(): void {\n\t\tthis.items = [];\n\t}\n\tdelete(value: T): boolean {\n\t\tconst previousLength = this.items.length;\n\t\tthis.items = this.items.filter((item) => item !== value);\n\n\t\treturn previousLength !== this.items.length;\n\t}\n\tforEach(callbackfn: (value: T, value2: T, set: Set<T>) => void): void {\n\t\tthis.items.forEach((item) => {\n\t\t\tcallbackfn(item, item, this);\n\t\t});\n\t}\n\thas(value: T): boolean {\n\t\treturn this.items.indexOf(value) !== -1;\n\t}\n\n\tget size(): number {\n\t\treturn this.items.length;\n\t}\n}\n\nexport default typeof Set === \"undefined\" ? Set : SetLike;\n","// https://w3c.github.io/html-aria/#document-conformance-requirements-for-use-of-aria-attributes-in-html\n\n/**\n * Safe Element.localName for all supported environments\n * @param element\n */\nexport function getLocalName(element: Element): string {\n\treturn (\n\t\t// eslint-disable-next-line no-restricted-properties -- actual guard for environments without localName\n\t\telement.localName ??\n\t\t// eslint-disable-next-line no-restricted-properties -- required for the fallback\n\t\telement.tagName.toLowerCase()\n\t);\n}\n\nconst localNameToRoleMappings: Record<string, string | undefined> = {\n\tarticle: \"article\",\n\taside: \"complementary\",\n\tbutton: \"button\",\n\tdatalist: \"listbox\",\n\tdd: \"definition\",\n\tdetails: \"group\",\n\tdialog: \"dialog\",\n\tdt: \"term\",\n\tfieldset: \"group\",\n\tfigure: \"figure\",\n\t// WARNING: Only with an accessible name\n\tform: \"form\",\n\tfooter: \"contentinfo\",\n\th1: \"heading\",\n\th2: \"heading\",\n\th3: \"heading\",\n\th4: \"heading\",\n\th5: \"heading\",\n\th6: \"heading\",\n\theader: \"banner\",\n\thr: \"separator\",\n\thtml: \"document\",\n\tlegend: \"legend\",\n\tli: \"listitem\",\n\tmath: \"math\",\n\tmain: \"main\",\n\tmenu: \"list\",\n\tnav: \"navigation\",\n\tol: \"list\",\n\toptgroup: \"group\",\n\t// WARNING: Only in certain context\n\toption: \"option\",\n\toutput: \"status\",\n\tprogress: \"progressbar\",\n\t// WARNING: Only with an accessible name\n\tsection: \"region\",\n\tsummary: \"button\",\n\ttable: \"table\",\n\ttbody: \"rowgroup\",\n\ttextarea: \"textbox\",\n\ttfoot: \"rowgroup\",\n\t// WARNING: Only in certain context\n\ttd: \"cell\",\n\tth: \"columnheader\",\n\tthead: \"rowgroup\",\n\ttr: \"row\",\n\tul: \"list\",\n};\n\nconst prohibitedAttributes: Record<string, Set<string>> = {\n\tcaption: new Set([\"aria-label\", \"aria-labelledby\"]),\n\tcode: new Set([\"aria-label\", \"aria-labelledby\"]),\n\tdeletion: new Set([\"aria-label\", \"aria-labelledby\"]),\n\temphasis: new Set([\"aria-label\", \"aria-labelledby\"]),\n\tgeneric: new Set([\"aria-label\", \"aria-labelledby\", \"aria-roledescription\"]),\n\tinsertion: new Set([\"aria-label\", \"aria-labelledby\"]),\n\tparagraph: new Set([\"aria-label\", \"aria-labelledby\"]),\n\tpresentation: new Set([\"aria-label\", \"aria-labelledby\"]),\n\tstrong: new Set([\"aria-label\", \"aria-labelledby\"]),\n\tsubscript: new Set([\"aria-label\", \"aria-labelledby\"]),\n\tsuperscript: new Set([\"aria-label\", \"aria-labelledby\"]),\n};\n\n/**\n *\n * @param element\n * @param role The role used for this element. This is specified to control whether you want to use the implicit or explicit role.\n */\nfunction hasGlobalAriaAttributes(element: Element, role: string): boolean {\n\t// https://rawgit.com/w3c/aria/stable/#global_states\n\t// commented attributes are deprecated\n\treturn [\n\t\t\"aria-atomic\",\n\t\t\"aria-busy\",\n\t\t\"aria-controls\",\n\t\t\"aria-current\",\n\t\t\"aria-describedby\",\n\t\t\"aria-details\",\n\t\t// \"disabled\",\n\t\t\"aria-dropeffect\",\n\t\t// \"errormessage\",\n\t\t\"aria-flowto\",\n\t\t\"aria-grabbed\",\n\t\t// \"haspopup\",\n\t\t\"aria-hidden\",\n\t\t// \"invalid\",\n\t\t\"aria-keyshortcuts\",\n\t\t\"aria-label\",\n\t\t\"aria-labelledby\",\n\t\t\"aria-live\",\n\t\t\"aria-owns\",\n\t\t\"aria-relevant\",\n\t\t\"aria-roledescription\",\n\t].some((attributeName) => {\n\t\treturn (\n\t\t\telement.hasAttribute(attributeName) &&\n\t\t\t!prohibitedAttributes[role]?.has(attributeName)\n\t\t);\n\t});\n}\n\nfunction ignorePresentationalRole(\n\telement: Element,\n\timplicitRole: string\n): boolean {\n\t// https://rawgit.com/w3c/aria/stable/#conflict_resolution_presentation_none\n\treturn hasGlobalAriaAttributes(element, implicitRole);\n}\n\nexport default function getRole(element: Element): string | null {\n\tconst explicitRole = getExplicitRole(element);\n\tif (explicitRole === null || explicitRole === \"presentation\") {\n\t\tconst implicitRole = getImplicitRole(element);\n\t\tif (\n\t\t\texplicitRole !== \"presentation\" ||\n\t\t\tignorePresentationalRole(element, implicitRole || \"\")\n\t\t) {\n\t\t\treturn implicitRole;\n\t\t}\n\t}\n\n\treturn explicitRole;\n}\n\nfunction getImplicitRole(element: Element): string | null {\n\tconst mappedByTag = localNameToRoleMappings[getLocalName(element)];\n\tif (mappedByTag !== undefined) {\n\t\treturn mappedByTag;\n\t}\n\n\tswitch (getLocalName(element)) {\n\t\tcase \"a\":\n\t\tcase \"area\":\n\t\tcase \"link\":\n\t\t\tif (element.hasAttribute(\"href\")) {\n\t\t\t\treturn \"link\";\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"img\":\n\t\t\tif (\n\t\t\t\telement.getAttribute(\"alt\") === \"\" &&\n\t\t\t\t!ignorePresentationalRole(element, \"img\")\n\t\t\t) {\n\t\t\t\treturn \"presentation\";\n\t\t\t}\n\t\t\treturn \"img\";\n\t\tcase \"input\": {\n\t\t\tconst { type } = element as HTMLInputElement;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"button\":\n\t\t\t\tcase \"image\":\n\t\t\t\tcase \"reset\":\n\t\t\t\tcase \"submit\":\n\t\t\t\t\treturn \"button\";\n\t\t\t\tcase \"checkbox\":\n\t\t\t\tcase \"radio\":\n\t\t\t\t\treturn type;\n\t\t\t\tcase \"range\":\n\t\t\t\t\treturn \"slider\";\n\t\t\t\tcase \"email\":\n\t\t\t\tcase \"tel\":\n\t\t\t\tcase \"text\":\n\t\t\t\tcase \"url\":\n\t\t\t\t\tif (element.hasAttribute(\"list\")) {\n\t\t\t\t\t\treturn \"combobox\";\n\t\t\t\t\t}\n\t\t\t\t\treturn \"textbox\";\n\n\t\t\t\tcase \"search\":\n\t\t\t\t\tif (element.hasAttribute(\"list\")) {\n\t\t\t\t\t\treturn \"combobox\";\n\t\t\t\t\t}\n\t\t\t\t\treturn \"searchbox\";\n\t\t\t\tcase \"number\":\n\t\t\t\t\treturn \"spinbutton\";\n\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\tcase \"select\":\n\t\t\tif (\n\t\t\t\telement.hasAttribute(\"multiple\") ||\n\t\t\t\t(element as HTMLSelectElement).size > 1\n\t\t\t) {\n\t\t\t\treturn \"listbox\";\n\t\t\t}\n\t\t\treturn \"combobox\";\n\t}\n\treturn null;\n}\n\nfunction getExplicitRole(element: Element): string | null {\n\tconst role = element.getAttribute(\"role\");\n\tif (role !== null) {\n\t\tconst explicitRole = role.trim().split(\" \")[0];\n\t\t// String.prototype.split(sep, limit) will always return an array with at least one member\n\t\t// as long as limit is either undefined or > 0\n\t\tif (explicitRole.length > 0) {\n\t\t\treturn explicitRole;\n\t\t}\n\t}\n\n\treturn null;\n}\n","export { getLocalName } from \"./getRole\";\nimport getRole, { getLocalName } from \"./getRole\";\n\nexport function isElement(node: Node | null): node is Element {\n\treturn node !== null && node.nodeType === node.ELEMENT_NODE;\n}\n\nexport function isHTMLTableCaptionElement(\n\tnode: Node | null\n): node is HTMLTableCaptionElement {\n\treturn isElement(node) && getLocalName(node) === \"caption\";\n}\n\nexport function isHTMLInputElement(\n\tnode: Node | null\n): node is HTMLInputElement {\n\treturn isElement(node) && getLocalName(node) === \"input\";\n}\n\nexport function isHTMLOptGroupElement(\n\tnode: Node | null\n): node is HTMLOptGroupElement {\n\treturn isElement(node) && getLocalName(node) === \"optgroup\";\n}\n\nexport function isHTMLSelectElement(\n\tnode: Node | null\n): node is HTMLSelectElement {\n\treturn isElement(node) && getLocalName(node) === \"select\";\n}\n\nexport function isHTMLTableElement(\n\tnode: Node | null\n): node is HTMLTableElement {\n\treturn isElement(node) && getLocalName(node) === \"table\";\n}\n\nexport function isHTMLTextAreaElement(\n\tnode: Node | null\n): node is HTMLTextAreaElement {\n\treturn isElement(node) && getLocalName(node) === \"textarea\";\n}\n\nexport function safeWindow(node: Node): Window {\n\tconst { defaultView } =\n\t\tnode.ownerDocument === null ? (node as Document) : node.ownerDocument;\n\n\tif (defaultView === null) {\n\t\tthrow new TypeError(\"no window available\");\n\t}\n\treturn defaultView;\n}\n\nexport function isHTMLFieldSetElement(\n\tnode: Node | null\n): node is HTMLFieldSetElement {\n\treturn isElement(node) && getLocalName(node) === \"fieldset\";\n}\n\nexport function isHTMLLegendElement(\n\tnode: Node | null\n): node is HTMLLegendElement {\n\treturn isElement(node) && getLocalName(node) === \"legend\";\n}\n\nexport function isHTMLSlotElement(node: Node | null): node is HTMLSlotElement {\n\treturn isElement(node) && getLocalName(node) === \"slot\";\n}\n\nexport function isSVGElement(node: Node | null): node is SVGElement {\n\treturn isElement(node) && (node as SVGElement).ownerSVGElement !== undefined;\n}\n\nexport function isSVGSVGElement(node: Node | null): node is SVGSVGElement {\n\treturn isElement(node) && getLocalName(node) === \"svg\";\n}\n\nexport function isSVGTitleElement(node: Node | null): node is SVGTitleElement {\n\treturn isSVGElement(node) && getLocalName(node) === \"title\";\n}\n\n/**\n *\n * @param {Node} node -\n * @param {string} attributeName -\n * @returns {Element[]} -\n */\nexport function queryIdRefs(node: Node, attributeName: string): Element[] {\n\tif (isElement(node) && node.hasAttribute(attributeName)) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- safe due to hasAttribute check\n\t\tconst ids = node.getAttribute(attributeName)!.split(\" \");\n\n\t\t// Browsers that don't support shadow DOM won't have getRootNode\n\t\tconst root = node.getRootNode\n\t\t\t? (node.getRootNode() as Document | ShadowRoot)\n\t\t\t: node.ownerDocument;\n\n\t\treturn ids\n\t\t\t.map((id) => root.getElementById(id))\n\t\t\t.filter(\n\t\t\t\t(element: Element | null): element is Element => element !== null\n\t\t\t\t// TODO: why does this not narrow?\n\t\t\t) as Element[];\n\t}\n\n\treturn [];\n}\n\nexport function hasAnyConcreteRoles(\n\tnode: Node,\n\troles: Array<string | null>\n): node is Element {\n\tif (isElement(node)) {\n\t\treturn roles.indexOf(getRole(node)) !== -1;\n\t}\n\treturn false;\n}\n","/**\n * implements https://w3c.github.io/accname/\n */\nimport ArrayFrom from \"./polyfills/array.from\";\nimport SetLike from \"./polyfills/SetLike\";\nimport {\n\thasAnyConcreteRoles,\n\tisElement,\n\tisHTMLTableCaptionElement,\n\tisHTMLInputElement,\n\tisHTMLSelectElement,\n\tisHTMLTextAreaElement,\n\tsafeWindow,\n\tisHTMLFieldSetElement,\n\tisHTMLLegendElement,\n\tisHTMLOptGroupElement,\n\tisHTMLTableElement,\n\tisHTMLSlotElement,\n\tisSVGSVGElement,\n\tisSVGTitleElement,\n\tqueryIdRefs,\n\tgetLocalName,\n} from \"./util\";\n\n/**\n *  A string of characters where all carriage returns, newlines, tabs, and form-feeds are replaced with a single space, and multiple spaces are reduced to a single space. The string contains only character data; it does not contain any markup.\n */\ntype FlatString = string & {\n\t__flat: true;\n};\n\n/**\n * interface for an options-bag where `window.getComputedStyle` can be mocked\n */\nexport interface ComputeTextAlternativeOptions {\n\tcompute?: \"description\" | \"name\";\n\t/**\n\t * Set to true if window.computedStyle supports the second argument.\n\t * This should be false in JSDOM. Otherwise JSDOM will log console errors.\n\t */\n\tcomputedStyleSupportsPseudoElements?: boolean;\n\t/**\n\t * mock window.getComputedStyle. Needs `content`, `display` and `visibility`\n\t */\n\tgetComputedStyle?: typeof window.getComputedStyle;\n\t/**\n\t * Set to `true` if you want to include hidden elements in the accessible name and description computation.\n\t * Skips 2A in https://w3c.github.io/accname/#computation-steps.\n\t * @default false\n\t */\n\thidden?: boolean;\n}\n\n/**\n *\n * @param {string} string -\n * @returns {FlatString} -\n */\nfunction asFlatString(s: string): FlatString {\n\treturn s.trim().replace(/\\s\\s+/g, \" \") as FlatString;\n}\n\n/**\n *\n * @param node -\n * @param options - These are not optional to prevent accidentally calling it without options in `computeAccessibleName`\n * @returns {boolean} -\n */\nfunction isHidden(\n\tnode: Node,\n\tgetComputedStyleImplementation: typeof window.getComputedStyle\n): node is Element {\n\tif (!isElement(node)) {\n\t\treturn false;\n\t}\n\n\tif (\n\t\tnode.hasAttribute(\"hidden\") ||\n\t\tnode.getAttribute(\"aria-hidden\") === \"true\"\n\t) {\n\t\treturn true;\n\t}\n\n\tconst style = getComputedStyleImplementation(node);\n\treturn (\n\t\tstyle.getPropertyValue(\"display\") === \"none\" ||\n\t\tstyle.getPropertyValue(\"visibility\") === \"hidden\"\n\t);\n}\n\n/**\n * @param {Node} node -\n * @returns {boolean} - As defined in step 2E of https://w3c.github.io/accname/#mapping_additional_nd_te\n */\nfunction isControl(node: Node): boolean {\n\treturn (\n\t\thasAnyConcreteRoles(node, [\"button\", \"combobox\", \"listbox\", \"textbox\"]) ||\n\t\thasAbstractRole(node, \"range\")\n\t);\n}\n\nfunction hasAbstractRole(node: Node, role: string): node is Element {\n\tif (!isElement(node)) {\n\t\treturn false;\n\t}\n\n\tswitch (role) {\n\t\tcase \"range\":\n\t\t\treturn hasAnyConcreteRoles(node, [\n\t\t\t\t\"meter\",\n\t\t\t\t\"progressbar\",\n\t\t\t\t\"scrollbar\",\n\t\t\t\t\"slider\",\n\t\t\t\t\"spinbutton\",\n\t\t\t]);\n\t\tdefault:\n\t\t\tthrow new TypeError(\n\t\t\t\t`No knowledge about abstract role '${role}'. This is likely a bug :(`\n\t\t\t);\n\t}\n}\n\n/**\n * element.querySelectorAll but also considers owned tree\n * @param element\n * @param selectors\n */\nfunction querySelectorAllSubtree(\n\telement: Element,\n\tselectors: string\n): Element[] {\n\tconst elements = ArrayFrom(element.querySelectorAll(selectors));\n\n\tqueryIdRefs(element, \"aria-owns\").forEach((root) => {\n\t\t// babel transpiles this assuming an iterator\n\t\telements.push.apply(elements, ArrayFrom(root.querySelectorAll(selectors)));\n\t});\n\n\treturn elements;\n}\n\nfunction querySelectedOptions(listbox: Element): ArrayLike<Element> {\n\tif (isHTMLSelectElement(listbox)) {\n\t\t// IE11 polyfill\n\t\treturn (\n\t\t\tlistbox.selectedOptions || querySelectorAllSubtree(listbox, \"[selected]\")\n\t\t);\n\t}\n\treturn querySelectorAllSubtree(listbox, '[aria-selected=\"true\"]');\n}\n\nfunction isMarkedPresentational(node: Node): node is Element {\n\treturn hasAnyConcreteRoles(node, [\"none\", \"presentation\"]);\n}\n\n/**\n * Elements specifically listed in html-aam\n *\n * We don't need this for `label` or `legend` elements.\n * Their implicit roles already allow \"naming from content\".\n *\n * sources:\n *\n * - https://w3c.github.io/html-aam/#table-element\n */\nfunction isNativeHostLanguageTextAlternativeElement(\n\tnode: Node\n): node is Element {\n\treturn isHTMLTableCaptionElement(node);\n}\n\n/**\n * https://w3c.github.io/aria/#namefromcontent\n */\nfunction allowsNameFromContent(node: Node): boolean {\n\treturn hasAnyConcreteRoles(node, [\n\t\t\"button\",\n\t\t\"cell\",\n\t\t\"checkbox\",\n\t\t\"columnheader\",\n\t\t\"gridcell\",\n\t\t\"heading\",\n\t\t\"label\",\n\t\t\"legend\",\n\t\t\"link\",\n\t\t\"menuitem\",\n\t\t\"menuitemcheckbox\",\n\t\t\"menuitemradio\",\n\t\t\"option\",\n\t\t\"radio\",\n\t\t\"row\",\n\t\t\"rowheader\",\n\t\t\"switch\",\n\t\t\"tab\",\n\t\t\"tooltip\",\n\t\t\"treeitem\",\n\t]);\n}\n\n/**\n * TODO https://github.com/eps1lon/dom-accessibility-api/issues/100\n */\nfunction isDescendantOfNativeHostLanguageTextAlternativeElement(\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars -- not implemented yet\n\tnode: Node\n): boolean {\n\treturn false;\n}\n\n/**\n * TODO https://github.com/eps1lon/dom-accessibility-api/issues/101\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- not implemented yet\nfunction computeTooltipAttributeValue(node: Node): string | null {\n\treturn null;\n}\n\nfunction getValueOfTextbox(element: Element): string {\n\tif (isHTMLInputElement(element) || isHTMLTextAreaElement(element)) {\n\t\treturn element.value;\n\t}\n\t// https://github.com/eps1lon/dom-accessibility-api/issues/4\n\treturn element.textContent || \"\";\n}\n\nfunction getTextualContent(declaration: CSSStyleDeclaration): string {\n\tconst content = declaration.getPropertyValue(\"content\");\n\tif (/^[\"'].*[\"']$/.test(content)) {\n\t\treturn content.slice(1, -1);\n\t}\n\treturn \"\";\n}\n\n/**\n * https://html.spec.whatwg.org/multipage/forms.html#category-label\n * TODO: form-associated custom elements\n * @param element\n */\nfunction isLabelableElement(element: Element): boolean {\n\tconst localName = getLocalName(element);\n\n\treturn (\n\t\tlocalName === \"button\" ||\n\t\t(localName === \"input\" && element.getAttribute(\"type\") !== \"hidden\") ||\n\t\tlocalName === \"meter\" ||\n\t\tlocalName === \"output\" ||\n\t\tlocalName === \"progress\" ||\n\t\tlocalName === \"select\" ||\n\t\tlocalName === \"textarea\"\n\t);\n}\n\n/**\n * > [...], then the first such descendant in tree order is the label element's labeled control.\n * -- https://html.spec.whatwg.org/multipage/forms.html#labeled-control\n * @param element\n */\nfunction findLabelableElement(element: Element): Element | null {\n\tif (isLabelableElement(element)) {\n\t\treturn element;\n\t}\n\tlet labelableElement: Element | null = null;\n\telement.childNodes.forEach((childNode) => {\n\t\tif (labelableElement === null && isElement(childNode)) {\n\t\t\tconst descendantLabelableElement = findLabelableElement(childNode);\n\t\t\tif (descendantLabelableElement !== null) {\n\t\t\t\tlabelableElement = descendantLabelableElement;\n\t\t\t}\n\t\t}\n\t});\n\n\treturn labelableElement;\n}\n\n/**\n * Polyfill of HTMLLabelElement.control\n * https://html.spec.whatwg.org/multipage/forms.html#labeled-control\n * @param label\n */\nfunction getControlOfLabel(label: HTMLLabelElement): Element | null {\n\tif (label.control !== undefined) {\n\t\treturn label.control;\n\t}\n\n\tconst htmlFor = label.getAttribute(\"for\");\n\tif (htmlFor !== null) {\n\t\treturn label.ownerDocument.getElementById(htmlFor);\n\t}\n\n\treturn findLabelableElement(label);\n}\n\n/**\n * Polyfill of HTMLInputElement.labels\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/labels\n * @param element\n */\nfunction getLabels(element: Element): HTMLLabelElement[] | null {\n\tconst labelsProperty = (element as any).labels as\n\t\t| undefined\n\t\t| null\n\t\t| NodeListOf<HTMLLabelElement>;\n\tif (labelsProperty === null) {\n\t\treturn labelsProperty;\n\t}\n\tif (labelsProperty !== undefined) {\n\t\treturn ArrayFrom(labelsProperty);\n\t}\n\n\t// polyfill\n\tif (!isLabelableElement(element)) {\n\t\treturn null;\n\t}\n\tconst document = element.ownerDocument;\n\n\treturn ArrayFrom(document.querySelectorAll(\"label\")).filter((label) => {\n\t\treturn getControlOfLabel(label) === element;\n\t});\n}\n\n/**\n * Gets the contents of a slot used for computing the accname\n * @param slot\n */\nfunction getSlotContents(slot: HTMLSlotElement): Node[] {\n\t// Computing the accessible name for elements containing slots is not\n\t// currently defined in the spec. This implementation reflects the\n\t// behavior of NVDA 2020.2/Firefox 81 and iOS VoiceOver/Safari 13.6.\n\tconst assignedNodes = slot.assignedNodes();\n\tif (assignedNodes.length === 0) {\n\t\t// if no nodes are assigned to the slot, it displays the default content\n\t\treturn ArrayFrom(slot.childNodes);\n\t}\n\treturn assignedNodes;\n}\n\n/**\n * implements https://w3c.github.io/accname/#mapping_additional_nd_te\n * @param root\n * @param options\n * @returns\n */\nexport function computeTextAlternative(\n\troot: Element,\n\toptions: ComputeTextAlternativeOptions = {}\n): string {\n\tconst consultedNodes = new SetLike<Node>();\n\n\tconst window = safeWindow(root);\n\tconst {\n\t\tcompute = \"name\",\n\t\tcomputedStyleSupportsPseudoElements = options.getComputedStyle !==\n\t\t\tundefined,\n\t\t// This might be overengineered. I don't know what happens if I call\n\t\t// window.getComputedStyle(elementFromAnotherWindow) or if I don't bind it\n\t\t// the type declarations don't require a `this`\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\tgetComputedStyle = window.getComputedStyle.bind(window),\n\t\thidden = false,\n\t} = options;\n\n\t// 2F.i\n\tfunction computeMiscTextAlternative(\n\t\tnode: Node,\n\t\tcontext: { isEmbeddedInLabel: boolean; isReferenced: boolean }\n\t): string {\n\t\tlet accumulatedText = \"\";\n\t\tif (isElement(node) && computedStyleSupportsPseudoElements) {\n\t\t\tconst pseudoBefore = getComputedStyle(node, \"::before\");\n\t\t\tconst beforeContent = getTextualContent(pseudoBefore);\n\t\t\taccumulatedText = `${beforeContent} ${accumulatedText}`;\n\t\t}\n\n\t\t// FIXME: Including aria-owns is not defined in the spec\n\t\t// But it is required in the web-platform-test\n\t\tconst childNodes = isHTMLSlotElement(node)\n\t\t\t? getSlotContents(node)\n\t\t\t: ArrayFrom(node.childNodes).concat(queryIdRefs(node, \"aria-owns\"));\n\t\tchildNodes.forEach((child) => {\n\t\t\tconst result = computeTextAlternative(child, {\n\t\t\t\tisEmbeddedInLabel: context.isEmbeddedInLabel,\n\t\t\t\tisReferenced: false,\n\t\t\t\trecursion: true,\n\t\t\t});\n\t\t\t// TODO: Unclear why display affects delimiter\n\t\t\t// see https://github.com/w3c/accname/issues/3\n\t\t\tconst display = isElement(child)\n\t\t\t\t? getComputedStyle(child).getPropertyValue(\"display\")\n\t\t\t\t: \"inline\";\n\t\t\tconst separator = display !== \"inline\" ? \" \" : \"\";\n\t\t\t// trailing separator for wpt tests\n\t\t\taccumulatedText += `${separator}${result}${separator}`;\n\t\t});\n\n\t\tif (isElement(node) && computedStyleSupportsPseudoElements) {\n\t\t\tconst pseudoAfter = getComputedStyle(node, \"::after\");\n\t\t\tconst afterContent = getTextualContent(pseudoAfter);\n\t\t\taccumulatedText = `${accumulatedText} ${afterContent}`;\n\t\t}\n\n\t\treturn accumulatedText.trim();\n\t}\n\n\tfunction computeElementTextAlternative(node: Node): string | null {\n\t\tif (!isElement(node)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t *\n\t\t * @param element\n\t\t * @param attributeName\n\t\t * @returns A string non-empty string or `null`\n\t\t */\n\t\tfunction useAttribute(\n\t\t\telement: Element,\n\t\t\tattributeName: string\n\t\t): string | null {\n\t\t\tconst attribute = element.getAttributeNode(attributeName);\n\t\t\tif (\n\t\t\t\tattribute !== null &&\n\t\t\t\t!consultedNodes.has(attribute) &&\n\t\t\t\tattribute.value.trim() !== \"\"\n\t\t\t) {\n\t\t\t\tconsultedNodes.add(attribute);\n\t\t\t\treturn attribute.value;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t// https://w3c.github.io/html-aam/#fieldset-and-legend-elements\n\t\tif (isHTMLFieldSetElement(node)) {\n\t\t\tconsultedNodes.add(node);\n\t\t\tconst children = ArrayFrom(node.childNodes);\n\t\t\tfor (let i = 0; i < children.length; i += 1) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (isHTMLLegendElement(child)) {\n\t\t\t\t\treturn computeTextAlternative(child, {\n\t\t\t\t\t\tisEmbeddedInLabel: false,\n\t\t\t\t\t\tisReferenced: false,\n\t\t\t\t\t\trecursion: false,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isHTMLTableElement(node)) {\n\t\t\t// https://w3c.github.io/html-aam/#table-element\n\t\t\tconsultedNodes.add(node);\n\t\t\tconst children = ArrayFrom(node.childNodes);\n\t\t\tfor (let i = 0; i < children.length; i += 1) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (isHTMLTableCaptionElement(child)) {\n\t\t\t\t\treturn computeTextAlternative(child, {\n\t\t\t\t\t\tisEmbeddedInLabel: false,\n\t\t\t\t\t\tisReferenced: false,\n\t\t\t\t\t\trecursion: false,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isSVGSVGElement(node)) {\n\t\t\t// https://www.w3.org/TR/svg-aam-1.0/\n\t\t\tconsultedNodes.add(node);\n\t\t\tconst children = ArrayFrom(node.childNodes);\n\t\t\tfor (let i = 0; i < children.length; i += 1) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (isSVGTitleElement(child)) {\n\t\t\t\t\treturn child.textContent;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t} else if (getLocalName(node) === \"img\" || getLocalName(node) === \"area\") {\n\t\t\t// https://w3c.github.io/html-aam/#area-element\n\t\t\t// https://w3c.github.io/html-aam/#img-element\n\t\t\tconst nameFromAlt = useAttribute(node, \"alt\");\n\t\t\tif (nameFromAlt !== null) {\n\t\t\t\treturn nameFromAlt;\n\t\t\t}\n\t\t} else if (isHTMLOptGroupElement(node)) {\n\t\t\tconst nameFromLabel = useAttribute(node, \"label\");\n\t\t\tif (nameFromLabel !== null) {\n\t\t\t\treturn nameFromLabel;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tisHTMLInputElement(node) &&\n\t\t\t(node.type === \"button\" ||\n\t\t\t\tnode.type === \"submit\" ||\n\t\t\t\tnode.type === \"reset\")\n\t\t) {\n\t\t\t// https://w3c.github.io/html-aam/#input-type-text-input-type-password-input-type-search-input-type-tel-input-type-email-input-type-url-and-textarea-element-accessible-description-computation\n\t\t\tconst nameFromValue = useAttribute(node, \"value\");\n\t\t\tif (nameFromValue !== null) {\n\t\t\t\treturn nameFromValue;\n\t\t\t}\n\n\t\t\t// TODO: l10n\n\t\t\tif (node.type === \"submit\") {\n\t\t\t\treturn \"Submit\";\n\t\t\t}\n\t\t\t// TODO: l10n\n\t\t\tif (node.type === \"reset\") {\n\t\t\t\treturn \"Reset\";\n\t\t\t}\n\t\t}\n\n\t\tconst labels = getLabels(node);\n\t\tif (labels !== null && labels.length !== 0) {\n\t\t\tconsultedNodes.add(node);\n\t\t\treturn ArrayFrom(labels)\n\t\t\t\t.map((element) => {\n\t\t\t\t\treturn computeTextAlternative(element, {\n\t\t\t\t\t\tisEmbeddedInLabel: true,\n\t\t\t\t\t\tisReferenced: false,\n\t\t\t\t\t\trecursion: true,\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.filter((label) => {\n\t\t\t\t\treturn label.length > 0;\n\t\t\t\t})\n\t\t\t\t.join(\" \");\n\t\t}\n\n\t\t// https://w3c.github.io/html-aam/#input-type-image-accessible-name-computation\n\t\t// TODO: wpt test consider label elements but html-aam does not mention them\n\t\t// We follow existing implementations over spec\n\t\tif (isHTMLInputElement(node) && node.type === \"image\") {\n\t\t\tconst nameFromAlt = useAttribute(node, \"alt\");\n\t\t\tif (nameFromAlt !== null) {\n\t\t\t\treturn nameFromAlt;\n\t\t\t}\n\n\t\t\tconst nameFromTitle = useAttribute(node, \"title\");\n\t\t\tif (nameFromTitle !== null) {\n\t\t\t\treturn nameFromTitle;\n\t\t\t}\n\n\t\t\t// TODO: l10n\n\t\t\treturn \"Submit Query\";\n\t\t}\n\n\t\tif (hasAnyConcreteRoles(node, [\"button\"])) {\n\t\t\t// https://www.w3.org/TR/html-aam-1.0/#button-element\n\t\t\tconst nameFromSubTree = computeMiscTextAlternative(node, {\n\t\t\t\tisEmbeddedInLabel: false,\n\t\t\t\tisReferenced: false,\n\t\t\t});\n\t\t\tif (nameFromSubTree !== \"\") {\n\t\t\t\treturn nameFromSubTree;\n\t\t\t}\n\t\t\treturn useAttribute(node, \"title\");\n\t\t}\n\n\t\treturn useAttribute(node, \"title\");\n\t}\n\n\tfunction computeTextAlternative(\n\t\tcurrent: Node,\n\t\tcontext: {\n\t\t\tisEmbeddedInLabel: boolean;\n\t\t\tisReferenced: boolean;\n\t\t\trecursion: boolean;\n\t\t}\n\t): string {\n\t\tif (consultedNodes.has(current)) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\t// 2A\n\t\tif (\n\t\t\t!hidden &&\n\t\t\tisHidden(current, getComputedStyle) &&\n\t\t\t!context.isReferenced\n\t\t) {\n\t\t\tconsultedNodes.add(current);\n\t\t\treturn \"\" as FlatString;\n\t\t}\n\n\t\t// 2B\n\t\tconst labelElements = queryIdRefs(current, \"aria-labelledby\");\n\t\tif (\n\t\t\tcompute === \"name\" &&\n\t\t\t!context.isReferenced &&\n\t\t\tlabelElements.length > 0\n\t\t) {\n\t\t\treturn labelElements\n\t\t\t\t.map((element) =>\n\t\t\t\t\tcomputeTextAlternative(element, {\n\t\t\t\t\t\tisEmbeddedInLabel: context.isEmbeddedInLabel,\n\t\t\t\t\t\tisReferenced: true,\n\t\t\t\t\t\t// thais isn't recursion as specified, otherwise we would skip\n\t\t\t\t\t\t// `aria-label` in\n\t\t\t\t\t\t// <input id=\"myself\" aria-label=\"foo\" aria-labelledby=\"myself\"\n\t\t\t\t\t\trecursion: false,\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.join(\" \");\n\t\t}\n\n\t\t// 2C\n\t\t// Changed from the spec in anticipation of https://github.com/w3c/accname/issues/64\n\t\t// spec says we should only consider skipping if we have a non-empty label\n\t\tconst skipToStep2E =\n\t\t\tcontext.recursion && isControl(current) && compute === \"name\";\n\t\tif (!skipToStep2E) {\n\t\t\tconst ariaLabel = (\n\t\t\t\t(isElement(current) && current.getAttribute(\"aria-label\")) ||\n\t\t\t\t\"\"\n\t\t\t).trim();\n\t\t\tif (ariaLabel !== \"\" && compute === \"name\") {\n\t\t\t\tconsultedNodes.add(current);\n\t\t\t\treturn ariaLabel;\n\t\t\t}\n\n\t\t\t// 2D\n\t\t\tif (!isMarkedPresentational(current)) {\n\t\t\t\tconst elementTextAlternative = computeElementTextAlternative(current);\n\t\t\t\tif (elementTextAlternative !== null) {\n\t\t\t\t\tconsultedNodes.add(current);\n\t\t\t\t\treturn elementTextAlternative;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// special casing, cheating to make tests pass\n\t\t// https://github.com/w3c/accname/issues/67\n\t\tif (hasAnyConcreteRoles(current, [\"menu\"])) {\n\t\t\tconsultedNodes.add(current);\n\t\t\treturn \"\";\n\t\t}\n\n\t\t// 2E\n\t\tif (skipToStep2E || context.isEmbeddedInLabel || context.isReferenced) {\n\t\t\tif (hasAnyConcreteRoles(current, [\"combobox\", \"listbox\"])) {\n\t\t\t\tconsultedNodes.add(current);\n\t\t\t\tconst selectedOptions = querySelectedOptions(current);\n\t\t\t\tif (selectedOptions.length === 0) {\n\t\t\t\t\t// defined per test `name_heading_combobox`\n\t\t\t\t\treturn isHTMLInputElement(current) ? current.value : \"\";\n\t\t\t\t}\n\t\t\t\treturn ArrayFrom(selectedOptions)\n\t\t\t\t\t.map((selectedOption) => {\n\t\t\t\t\t\treturn computeTextAlternative(selectedOption, {\n\t\t\t\t\t\t\tisEmbeddedInLabel: context.isEmbeddedInLabel,\n\t\t\t\t\t\t\tisReferenced: false,\n\t\t\t\t\t\t\trecursion: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t})\n\t\t\t\t\t.join(\" \");\n\t\t\t}\n\t\t\tif (hasAbstractRole(current, \"range\")) {\n\t\t\t\tconsultedNodes.add(current);\n\t\t\t\tif (current.hasAttribute(\"aria-valuetext\")) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- safe due to hasAttribute guard\n\t\t\t\t\treturn current.getAttribute(\"aria-valuetext\")!;\n\t\t\t\t}\n\t\t\t\tif (current.hasAttribute(\"aria-valuenow\")) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- safe due to hasAttribute guard\n\t\t\t\t\treturn current.getAttribute(\"aria-valuenow\")!;\n\t\t\t\t}\n\t\t\t\t// Otherwise, use the value as specified by a host language attribute.\n\t\t\t\treturn current.getAttribute(\"value\") || \"\";\n\t\t\t}\n\t\t\tif (hasAnyConcreteRoles(current, [\"textbox\"])) {\n\t\t\t\tconsultedNodes.add(current);\n\t\t\t\treturn getValueOfTextbox(current);\n\t\t\t}\n\t\t}\n\n\t\t// 2F: https://w3c.github.io/accname/#step2F\n\t\tif (\n\t\t\tallowsNameFromContent(current) ||\n\t\t\t(isElement(current) && context.isReferenced) ||\n\t\t\tisNativeHostLanguageTextAlternativeElement(current) ||\n\t\t\tisDescendantOfNativeHostLanguageTextAlternativeElement(current)\n\t\t) {\n\t\t\tconsultedNodes.add(current);\n\t\t\treturn computeMiscTextAlternative(current, {\n\t\t\t\tisEmbeddedInLabel: context.isEmbeddedInLabel,\n\t\t\t\tisReferenced: false,\n\t\t\t});\n\t\t}\n\n\t\tif (current.nodeType === current.TEXT_NODE) {\n\t\t\tconsultedNodes.add(current);\n\t\t\treturn current.textContent || \"\";\n\t\t}\n\n\t\tif (context.recursion) {\n\t\t\tconsultedNodes.add(current);\n\t\t\treturn computeMiscTextAlternative(current, {\n\t\t\t\tisEmbeddedInLabel: context.isEmbeddedInLabel,\n\t\t\t\tisReferenced: false,\n\t\t\t});\n\t\t}\n\n\t\tconst tooltipAttributeValue = computeTooltipAttributeValue(current);\n\t\tif (tooltipAttributeValue !== null) {\n\t\t\tconsultedNodes.add(current);\n\t\t\treturn tooltipAttributeValue;\n\t\t}\n\n\t\t// TODO should this be reachable?\n\t\tconsultedNodes.add(current);\n\t\treturn \"\";\n\t}\n\n\treturn asFlatString(\n\t\tcomputeTextAlternative(root, {\n\t\t\tisEmbeddedInLabel: false,\n\t\t\t// by spec computeAccessibleDescription starts with the referenced elements as roots\n\t\t\tisReferenced: compute === \"description\",\n\t\t\trecursion: false,\n\t\t})\n\t);\n}\n","import {\n\tcomputeTextAlternative,\n\tComputeTextAlternativeOptions,\n} from \"./accessible-name-and-description\";\nimport { queryIdRefs } from \"./util\";\n\n/**\n * @param root\n * @param options\n * @returns\n */\nexport function computeAccessibleDescription(\n\troot: Element,\n\toptions: ComputeTextAlternativeOptions = {}\n): string {\n\tlet description = queryIdRefs(root, \"aria-describedby\")\n\t\t.map((element) => {\n\t\t\treturn computeTextAlternative(element, {\n\t\t\t\t...options,\n\t\t\t\tcompute: \"description\",\n\t\t\t});\n\t\t})\n\t\t.join(\" \");\n\n\t// TODO: Technically we need to make sure that node wasn't used for the accessible name\n\t//       This causes `description_1.0_combobox-focusable-manual` to fail\n\t//\n\t// https://www.w3.org/TR/html-aam-1.0/#accessible-name-and-description-computation\n\t// says for so many elements to use the `title` that we assume all elements are considered\n\tif (description === \"\") {\n\t\tconst title = root.getAttribute(\"title\");\n\t\tdescription = title === null ? \"\" : title;\n\t}\n\n\treturn description;\n}\n","import {\n\tcomputeTextAlternative,\n\tComputeTextAlternativeOptions,\n} from \"./accessible-name-and-description\";\nimport { hasAnyConcreteRoles } from \"./util\";\n\n/**\n * https://w3c.github.io/aria/#namefromprohibited\n */\nfunction prohibitsNaming(node: Node): boolean {\n\treturn hasAnyConcreteRoles(node, [\n\t\t\"caption\",\n\t\t\"code\",\n\t\t\"deletion\",\n\t\t\"emphasis\",\n\t\t\"generic\",\n\t\t\"insertion\",\n\t\t\"paragraph\",\n\t\t\"presentation\",\n\t\t\"strong\",\n\t\t\"subscript\",\n\t\t\"superscript\",\n\t]);\n}\n\n/**\n * implements https://w3c.github.io/accname/#mapping_additional_nd_name\n * @param root\n * @param options\n * @returns\n */\nexport function computeAccessibleName(\n\troot: Element,\n\toptions: ComputeTextAlternativeOptions = {}\n): string {\n\tif (prohibitsNaming(root)) {\n\t\treturn \"\";\n\t}\n\n\treturn computeTextAlternative(root, options);\n}\n"],"mappings":"ubAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,4BAAAE,EAAA,UAAAC,GAAA,sBAAAC,GAAA,yBAAAC,GAAA,2BAAAC,GAAA,gCAAAC,GAAA,6BAAAC,GAAA,mCAAAC,GAAA,wBAAAC,EAAA,0BAAAC,GAAA,wBAAAC,GAAA,yBAAAC,GAAA,wBAAAC,GAAA,6BAAAC,GAAA,0BAAAC,GAA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AAA,CAAM,EAEd,MAAO,GAAGV;AAAA;AAAA,EAAYM;AAAA;AAAA,EAAqBD,GAC7C,CAAC,EACA,KAAK;AAAA,CAAI,CACd,CAEO,IAAMS,GAAW,CAACZ,EAAc,CAAE,OAAAd,EAAS,EAAM,EAAI,CAAC,IAC3D,QAAQ,IAAIa,GAAYC,EAAK,CAAE,OAAAd,CAAO,CAAC,CAAC,KT/F1C,cAAU,CAER,gBAAgB2B,EAASC,EAAW,CAClC,IAAMC,EAAgBC,EAAgBF,CAAS,EACzCG,EAAQ,IAAI,MAChB,CACEJ,EACA,+BACE,cAAU,EAAE;AAAA,EACTE,GACP,EACG,OAAO,OAAO,EACd,KAAK;AAAA;AAAA,CAAM,CAChB,EACA,OAAAE,EAAM,KAAO,sCACNA,CACT,CACF,CAAC","names":["src_exports","__export","createDOMElementFilter","debug","deepQuerySelector","deepQuerySelectorAll","findAllByShadowAltText","findAllByShadowDisplayValue","findAllByShadowLabelText","findAllByShadowPlaceholderText","findAllByShadowRole","findAllByShadowTestId","findAllByShadowText","findAllByShadowTitle","findByShadowAltText","findByShadowDisplayValue","findByShadowLabelText","findByShadowPlaceholderText","findByShadowRole","findByShadowTestId","findByShadowText","findByShadowTitle","getAllByShadowAltText","getAllByShadowDisplayValue","getAllByShadowLabelText","getAllByShadowPlaceholderText","getAllByShadowRole","getAllByShadowTestId","getAllByShadowText","getAllByShadowTitle","getAllElementsAndShadowRoots","getByShadowAltText","getByShadowDisplayValue","getByShadowLabelText","getByShadowPlaceholderText","getByShadowRole","getByShadowTestId","getByShadowText","getByShadowTitle","logRoles","logShadowDOM","prettyShadowDOM","queryAllByShadowAltText","queryAllByShadowDisplayValue","queryAllByShadowLabelText","queryAllByShadowPlaceholderText","queryAllByShadowRole","queryAllByShadowTestId","queryAllByShadowText","queryAllByShadowTitle","queryByShadowAltText","queryByShadowDisplayValue","queryByShadowLabelText","queryByShadowPlaceholderText","queryByShadowRole","queryByShadowTestId","queryByShadowText","queryByShadowTitle","shadowScreen","shadow_queries_exports","shadowWithin","__toCommonJS","import_dom","shadow_queries_exports","__export","findAllByShadowAltText","findAllByShadowDisplayValue","findAllByShadowLabelText","findAllByShadowPlaceholderText","findAllByShadowRole","findAllByShadowTestId","findAllByShadowText","findAllByShadowTitle","findByShadowAltText","findByShadowDisplayValue","findByShadowLabelText","findByShadowPlaceholderText","findByShadowRole","findByShadowTestId","findByShadowText","findByShadowTitle","getAllByShadowAltText","getAllByShadowDisplayValue","getAllByShadowLabelText","getAllByShadowPlaceholderText","getAllByShadowRole","getAllByShadowTestId","getAllByShadowText","getAllByShadowTitle","getByShadowAltText","getByShadowDisplayValue","getByShadowLabelText","getByShadowPlaceholderText","getByShadowRole","getByShadowTestId","getByShadowText","getByShadowTitle","queryAllByShadowAltText","queryAllByShadowDisplayValue","queryAllByShadowLabelText","queryAllByShadowPlaceholderText","queryAllByShadowRole","queryAllByShadowTestId","queryAllByShadowText","queryAllByShadowTitle","queryByShadowAltText","queryByShadowDisplayValue","queryByShadowLabelText","queryByShadowPlaceholderText","queryByShadowRole","queryByShadowTestId","queryByShadowText","queryByShadowTitle","import_dom","patchShadowRoot","patchDOM","accessedNodes","patchChildNodesForAllNodes","patchSlotElement","removeDOMPatch","patchRemovalFunctions","fn","patchWrap","callback","val","string","originalChildNodesGetter","childNodes","node","qsa","projectedNodes","str","els","_el","el","scratch","fixOptions","options","deepQuerySelector","container","selector","els","deepQuerySelectorAll","patchWrap","queriedElements","getAllElementsAndShadowRoots","el","recurse","elementsToProcess","elements","currentDepth","containerElement","toShadowQueries","queries","query","args","arg1","arg2","options","rest","queryAllByShadowRole","container","role","patchWrap","getAllElementsAndShadowRoots","el","getMultipleRoleError","_c","getMissingRoleError","_queryByShadowRole","_getAllByShadowRole","_getByShadowRole","_findAllByShadowRole","_findByShadowRole","queryByShadowRole","getAllByShadowRole","getByShadowRole","findAllByShadowRole","findByShadowRole","queryAllByShadowLabelText","id","getMultipleLabelTextError","getMissingLabelTextError","_queryByShadowLabelText","_getAllByShadowLabelText","_getByShadowLabelText","_findAllByShadowLabelText","_findByShadowLabelText","queryByShadowLabelText","getAllByShadowLabelText","getByShadowLabelText","findAllByShadowLabelText","findByShadowLabelText","queryAllByShadowPlaceholderText","getMultiplePlaceholderTextError","getMissingPlaceholderTextError","_queryByShadowPlaceholderText","_getAllByShadowPlaceholderText","_getByShadowPlaceholderText","_findAllByShadowPlaceholderText","_findByShadowPlaceholderText","queryByShadowPlaceholderText","getAllByShadowPlaceholderText","getByShadowPlaceholderText","findAllByShadowPlaceholderText","findByShadowPlaceholderText","queryAllByShadowText","getMultipleTextError","getMissingTextError","_queryByShadowText","_getAllByShadowText","_getByShadowText","_findAllByShadowText","_findByShadowText","queryByShadowText","getAllByShadowText","getByShadowText","findAllByShadowText","findByShadowText","queryAllByShadowDisplayValue","getMultipleDisplayValueError","getMissingDisplayValueError","_queryByShadowDisplayValue","_getAllByShadowDisplayValue","_getByShadowDisplayValue","_findAllByShadowDisplayValue","_findByShadowDisplayValue","queryByShadowDisplayValue","getAllByShadowDisplayValue","getByShadowDisplayValue","findAllByShadowDisplayValue","findByShadowDisplayValue","queryAllByShadowAltText","getMultipleAltTextError","getMissingAltTextError","_queryByShadowAltText","_getAllByShadowAltText","_getByShadowAltText","_findAllByShadowAltText","_findByShadowAltText","queryByShadowAltText","getAllByShadowAltText","getByShadowAltText","findAllByShadowAltText","findByShadowAltText","queryAllByShadowTitle","getMultipleTitleError","getMissingTitleError","_queryByShadowTitle","_getAllByShadowTitle","_getByShadowTitle","_findAllByShadowTitle","_findByShadowTitle","queryByShadowTitle","getAllByShadowTitle","getByShadowTitle","findAllByShadowTitle","findByShadowTitle","queryAllByShadowTestId","getMultipleTestIdError","getMissingTestIdError","_queryByShadowTestId","_getAllByShadowTestId","_getByShadowTestId","_findAllByShadowTestId","_findByShadowTestId","queryByShadowTestId","getAllByShadowTestId","getByShadowTestId","findAllByShadowTestId","findByShadowTestId","import_dom","import_dom","findWhiteSpace","removeDuplicateNewLines","str","prettyShadowDOM","args","dom","maxLength","options","plugin","createDOMElementFilter","filterCommentsAndDefaultIgnoreTagsTags","patchWrap","escapeHTML","value","COMMENT_NODE","ELEMENT_NODE","printProps","keys","props","config","indentation","depth","refs","printer","indentationNext","colors","key","printed","NodeTypeTextNode","printChildren","children","child","printedChild","printText","text","contentColor","printComment","comment","commentColor","printElement","type","printedProps","printedChildren","tagColor","printElementAsLeaf","TEXT_NODE","FRAGMENT_NODE","ELEMENT_REGEXP","testNode","val","_a","constructorName","nodeType","tagName","isCustomElement","nodeIsText","node","TEXT_NODE","nodeIsComment","COMMENT_NODE","nodeIsFragment","FRAGMENT_NODE","createDOMElementFilter","filterNode","getChildren","children","val","testNode","config","indentation","depth","refs","printer","printText","printComment","type","printElementAsLeaf","printElement","printProps","attr","props","attribute","printChildren","logShadowDOM","args","dom","maxLength","options","plugin","createDOMElementFilter","filterCommentsAndDefaultIgnoreTagsTags","patchWrap","debug","args","element","maxLength","options","el","logShadowDOM","import_dom","shadowScreen","debug","args","queryAllByShadowRole","queryByShadowRole","getAllByShadowRole","getByShadowRole","findAllByShadowRole","findByShadowRole","queryAllByShadowLabelText","queryByShadowLabelText","getAllByShadowLabelText","getByShadowLabelText","findAllByShadowLabelText","findByShadowLabelText","queryAllByShadowPlaceholderText","queryByShadowPlaceholderText","getAllByShadowPlaceholderText","getByShadowPlaceholderText","findAllByShadowPlaceholderText","findByShadowPlaceholderText","queryAllByShadowText","queryByShadowText","getAllByShadowText","getByShadowText","findAllByShadowText","findByShadowText","queryAllByShadowDisplayValue","queryByShadowDisplayValue","getAllByShadowDisplayValue","getByShadowDisplayValue","findAllByShadowDisplayValue","findByShadowDisplayValue","queryAllByShadowAltText","queryByShadowAltText","getAllByShadowAltText","getByShadowAltText","findAllByShadowAltText","findByShadowAltText","queryAllByShadowTitle","queryByShadowTitle","getAllByShadowTitle","getByShadowTitle","findAllByShadowTitle","findByShadowTitle","queryAllByShadowTestId","queryByShadowTestId","getAllByShadowTestId","getByShadowTestId","findAllByShadowTestId","findByShadowTestId","import_dom","allQueries","shadow_queries_exports","shadowWithin","element","withinObj","args","import_dom","import_role_helpers","toStr","Object","prototype","toString","isCallable","fn","call","toInteger","value","number","Number","isNaN","isFinite","Math","floor","abs","maxSafeInteger","pow","toLength","len","min","max","arrayFrom","arrayLike","mapFn","C","Array","items","TypeError","length","A","k","kValue","SetLike","items","_classCallCheck","_defineProperty","value","has","push","previousLength","length","filter","item","callbackfn","_this","forEach","indexOf","SetLike_default","Set","getLocalName","element","_element$localName","localName","tagName","toLowerCase","localNameToRoleMappings","article","aside","button","datalist","dd","details","dialog","dt","fieldset","figure","form","footer","h1","h2","h3","h4","h5","h6","header","hr","html","legend","li","math","main","menu","nav","ol","optgroup","option","output","progress","section","summary","table","tbody","textarea","tfoot","td","th","thead","tr","ul","prohibitedAttributes","caption","Set","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript","hasGlobalAriaAttributes","role","some","attributeName","_prohibitedAttributes","hasAttribute","has","ignorePresentationalRole","implicitRole","getRole","explicitRole","getExplicitRole","getImplicitRole","mappedByTag","undefined","getAttribute","_ref","type","size","trim","split","length","isElement","node","nodeType","ELEMENT_NODE","isHTMLTableCaptionElement","getLocalName","isHTMLInputElement","isHTMLOptGroupElement","isHTMLSelectElement","isHTMLTableElement","isHTMLTextAreaElement","safeWindow","_ref","ownerDocument","defaultView","TypeError","isHTMLFieldSetElement","isHTMLLegendElement","isHTMLSlotElement","isSVGElement","ownerSVGElement","undefined","isSVGSVGElement","isSVGTitleElement","queryIdRefs","attributeName","hasAttribute","ids","getAttribute","split","root","getRootNode","map","id","getElementById","filter","element","hasAnyConcreteRoles","roles","indexOf","getRole","asFlatString","s","trim","replace","isHidden","node","getComputedStyleImplementation","isElement","hasAttribute","getAttribute","style","getPropertyValue","isControl","hasAnyConcreteRoles","hasAbstractRole","role","TypeError","querySelectorAllSubtree","element","selectors","elements","ArrayFrom","querySelectorAll","queryIdRefs","forEach","root","push","apply","querySelectedOptions","listbox","isHTMLSelectElement","selectedOptions","isMarkedPresentational","isNativeHostLanguageTextAlternativeElement","isHTMLTableCaptionElement","allowsNameFromContent","isDescendantOfNativeHostLanguageTextAlternativeElement","computeTooltipAttributeValue","getValueOfTextbox","isHTMLInputElement","isHTMLTextAreaElement","value","textContent","getTextualContent","declaration","content","test","slice","isLabelableElement","localName","getLocalName","findLabelableElement","labelableElement","childNodes","childNode","descendantLabelableElement","getControlOfLabel","label","control","undefined","htmlFor","ownerDocument","getElementById","getLabels","labelsProperty","labels","document","filter","getSlotContents","slot","assignedNodes","length","computeTextAlternative","options","consultedNodes","SetLike","window","safeWindow","_options$compute","compute","_options$computedStyl","computedStyleSupportsPseudoElements","getComputedStyle","_options$getComputedS","bind","_options$hidden","hidden","computeMiscTextAlternative","context","accumulatedText","pseudoBefore","beforeContent","isHTMLSlotElement","concat","child","result","isEmbeddedInLabel","isReferenced","recursion","display","separator","pseudoAfter","afterContent","computeElementTextAlternative","useAttribute","attributeName","attribute","getAttributeNode","has","add","isHTMLFieldSetElement","children","i","isHTMLLegendElement","isHTMLTableElement","isSVGSVGElement","isSVGTitleElement","nameFromAlt","isHTMLOptGroupElement","nameFromLabel","type","nameFromValue","map","join","nameFromTitle","nameFromSubTree","current","labelElements","skipToStep2E","ariaLabel","elementTextAlternative","selectedOption","nodeType","TEXT_NODE","tooltipAttributeValue","computeAccessibleDescription","root","options","description","queryIdRefs","map","element","computeTextAlternative","_objectSpread","compute","join","title","getAttribute","prohibitsNaming","node","hasAnyConcreteRoles","computeAccessibleName","root","options","computeTextAlternative","getRoles","container","hidden","getShadowChildren","node","shadowChildren","child","flattenDOM","children","flatChildren","acc","element","roles","rolesAcc","role","prettyRoles","dom","includeDescription","elements","delimiterBar","elementsString","el","nameString","computeAccessibleName","domString","prettyShadowDOM","descriptionString","computeAccessibleDescription","logRoles","message","container","prettifiedDOM","prettyShadowDOM","error"]}