@ctrl/dom 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +338 -0
  3. package/README.md +362 -2
  4. package/dist/aria/_chunks/roles-list-CYZF-l9K.js +1503 -0
  5. package/dist/aria/_chunks/roles-list-D4WCyRO_.cjs +1754 -0
  6. package/dist/aria/index.cjs +232 -0
  7. package/dist/aria/index.js +198 -0
  8. package/dist/aria/internal.cjs +69 -0
  9. package/dist/aria/internal.js +30 -0
  10. package/dist/aria/types/accname.d.ts +40 -0
  11. package/dist/aria/types/data/aria-query.d.ts +61 -0
  12. package/dist/aria/types/data/aria-query.generated.d.ts +2 -0
  13. package/dist/aria/types/forms.d.ts +25 -0
  14. package/dist/aria/types/hidden.d.ts +38 -0
  15. package/dist/aria/types/index.d.ts +46 -0
  16. package/dist/aria/types/internal.d.ts +15 -0
  17. package/dist/aria/types/role.d.ts +27 -0
  18. package/dist/aria/types/roles-list.d.ts +18 -0
  19. package/dist/aria/types/states.d.ts +29 -0
  20. package/dist/aria/types/style.d.ts +18 -0
  21. package/dist/aria/types/tree.d.ts +20 -0
  22. package/dist/bridge/index.cjs +3 -0
  23. package/dist/bridge/index.js +4 -0
  24. package/dist/bridge/internal.cjs +3 -0
  25. package/dist/bridge/internal.js +4 -0
  26. package/dist/cli/_chunks/report-DdncYfuJ.js +93 -0
  27. package/dist/cli/ctrl-dom.js +199 -0
  28. package/dist/cli/jest-reporter.js +55 -0
  29. package/dist/cli/vitest-reporter.js +81 -0
  30. package/dist/dom/_chunks/src-DWP2w3IQ.js +47516 -0
  31. package/dist/dom/index.js +3 -0
  32. package/dist/dom/internal.js +434 -0
  33. package/dist/dom/types/collections/DOMStringMap.d.ts +8 -0
  34. package/dist/dom/types/collections/DOMTokenList.d.ts +33 -0
  35. package/dist/dom/types/collections/HTMLCollection.d.ts +62 -0
  36. package/dist/dom/types/collections/NamedNodeMap.d.ts +22 -0
  37. package/dist/dom/types/collections/NodeList.d.ts +43 -0
  38. package/dist/dom/types/collections/indexed.d.ts +8 -0
  39. package/dist/dom/types/collections/iterator.d.ts +8 -0
  40. package/dist/dom/types/css/CSS.d.ts +21 -0
  41. package/dist/dom/types/css/CSSStyleDeclaration.d.ts +57 -0
  42. package/dist/dom/types/css/cascade.d.ts +159 -0
  43. package/dist/dom/types/css/colors.d.ts +28 -0
  44. package/dist/dom/types/css/computed.d.ts +22 -0
  45. package/dist/dom/types/css/cssom.d.ts +363 -0
  46. package/dist/dom/types/css/data/properties.d.ts +1 -0
  47. package/dist/dom/types/css/declarations.d.ts +40 -0
  48. package/dist/dom/types/css/index.d.ts +5 -0
  49. package/dist/dom/types/css/inline-count.d.ts +2 -0
  50. package/dist/dom/types/css/internal.d.ts +11 -0
  51. package/dist/dom/types/css/layout-mode.d.ts +4 -0
  52. package/dist/dom/types/css/layout.d.ts +63 -0
  53. package/dist/dom/types/css/media.d.ts +55 -0
  54. package/dist/dom/types/css/parser.d.ts +93 -0
  55. package/dist/dom/types/css/properties.d.ts +28 -0
  56. package/dist/dom/types/css/resize-observer.d.ts +19 -0
  57. package/dist/dom/types/css/selector-info.d.ts +13 -0
  58. package/dist/dom/types/css/shorthands.d.ts +33 -0
  59. package/dist/dom/types/css/stylesheets.d.ts +93 -0
  60. package/dist/dom/types/css/supports.d.ts +4 -0
  61. package/dist/dom/types/css/tokenizer.d.ts +91 -0
  62. package/dist/dom/types/css/values.d.ts +91 -0
  63. package/dist/dom/types/css/view.d.ts +44 -0
  64. package/dist/dom/types/events/DataTransfer.d.ts +62 -0
  65. package/dist/dom/types/events/Event.d.ts +115 -0
  66. package/dist/dom/types/events/EventTarget.d.ts +22 -0
  67. package/dist/dom/types/events/UIEvents.d.ts +308 -0
  68. package/dist/dom/types/events/activation.d.ts +7 -0
  69. package/dist/dom/types/events/convert.d.ts +16 -0
  70. package/dist/dom/types/events/createEvent.d.ts +3 -0
  71. package/dist/dom/types/events/dispatch.d.ts +39 -0
  72. package/dist/dom/types/events/events.d.ts +200 -0
  73. package/dist/dom/types/events/fire.d.ts +21 -0
  74. package/dist/dom/types/events/handlers.d.ts +14 -0
  75. package/dist/dom/types/events/listeners.d.ts +32 -0
  76. package/dist/dom/types/events/report.d.ts +10 -0
  77. package/dist/dom/types/html/HTMLElement.d.ts +126 -0
  78. package/dist/dom/types/html/MathMLElement.d.ts +6 -0
  79. package/dist/dom/types/html/SVGElement.d.ts +145 -0
  80. package/dist/dom/types/html/anchor.d.ts +16 -0
  81. package/dist/dom/types/html/aria-reflection.d.ts +14 -0
  82. package/dist/dom/types/html/collection.d.ts +5 -0
  83. package/dist/dom/types/html/custom-elements.d.ts +129 -0
  84. package/dist/dom/types/html/elements.d.ts +202 -0
  85. package/dist/dom/types/html/events.d.ts +22 -0
  86. package/dist/dom/types/html/focus.d.ts +63 -0
  87. package/dist/dom/types/html/forms/FileList.d.ts +1 -0
  88. package/dist/dom/types/html/forms/FormData.d.ts +7 -0
  89. package/dist/dom/types/html/forms/HTMLButtonElement.d.ts +36 -0
  90. package/dist/dom/types/html/forms/HTMLFieldSetElement.d.ts +29 -0
  91. package/dist/dom/types/html/forms/HTMLFormElement.d.ts +61 -0
  92. package/dist/dom/types/html/forms/HTMLInputElement.d.ts +204 -0
  93. package/dist/dom/types/html/forms/HTMLLabelElement.d.ts +15 -0
  94. package/dist/dom/types/html/forms/HTMLOptionElement.d.ts +61 -0
  95. package/dist/dom/types/html/forms/HTMLOutputElement.d.ts +74 -0
  96. package/dist/dom/types/html/forms/HTMLSelectElement.d.ts +96 -0
  97. package/dist/dom/types/html/forms/HTMLTextAreaElement.d.ts +82 -0
  98. package/dist/dom/types/html/forms/autofill.d.ts +10 -0
  99. package/dist/dom/types/html/forms/collections.d.ts +112 -0
  100. package/dist/dom/types/html/forms/common.d.ts +36 -0
  101. package/dist/dom/types/html/forms/face.d.ts +59 -0
  102. package/dist/dom/types/html/forms/form-associated.d.ts +46 -0
  103. package/dist/dom/types/html/forms/form-submission.d.ts +55 -0
  104. package/dist/dom/types/html/forms/index.d.ts +17 -0
  105. package/dist/dom/types/html/forms/input-type.d.ts +50 -0
  106. package/dist/dom/types/html/forms/microsyntaxes.d.ts +52 -0
  107. package/dist/dom/types/html/forms/state.d.ts +54 -0
  108. package/dist/dom/types/html/forms/ui.d.ts +35 -0
  109. package/dist/dom/types/html/forms/user-validity.d.ts +19 -0
  110. package/dist/dom/types/html/forms/validation.d.ts +76 -0
  111. package/dist/dom/types/html/index.d.ts +13 -0
  112. package/dist/dom/types/html/innerText.d.ts +9 -0
  113. package/dist/dom/types/html/interactive.d.ts +43 -0
  114. package/dist/dom/types/html/invokers.d.ts +39 -0
  115. package/dist/dom/types/html/media.d.ts +86 -0
  116. package/dist/dom/types/html/reflect.d.ts +67 -0
  117. package/dist/dom/types/html/registry.d.ts +9 -0
  118. package/dist/dom/types/html/resources.d.ts +55 -0
  119. package/dist/dom/types/html/shared.d.ts +22 -0
  120. package/dist/dom/types/html/slot.d.ts +15 -0
  121. package/dist/dom/types/html/template.d.ts +18 -0
  122. package/dist/dom/types/html/top-layer.d.ts +73 -0
  123. package/dist/dom/types/index.d.ts +50 -0
  124. package/dist/dom/types/internal.d.ts +61 -0
  125. package/dist/dom/types/keys.d.ts +209 -0
  126. package/dist/dom/types/nodes/Attr.d.ts +25 -0
  127. package/dist/dom/types/nodes/CharacterData.d.ts +35 -0
  128. package/dist/dom/types/nodes/Document.d.ts +169 -0
  129. package/dist/dom/types/nodes/DocumentFragment.d.ts +12 -0
  130. package/dist/dom/types/nodes/DocumentType.d.ts +17 -0
  131. package/dist/dom/types/nodes/Element.d.ts +142 -0
  132. package/dist/dom/types/nodes/Node.d.ts +112 -0
  133. package/dist/dom/types/nodes/NodeImpl.d.ts +90 -0
  134. package/dist/dom/types/nodes/ShadowRoot.d.ts +43 -0
  135. package/dist/dom/types/nodes/attr-nodes.d.ts +8 -0
  136. package/dist/dom/types/nodes/attributes.d.ts +46 -0
  137. package/dist/dom/types/nodes/cache.d.ts +38 -0
  138. package/dist/dom/types/nodes/character-data.d.ts +5 -0
  139. package/dist/dom/types/nodes/clone.d.ts +5 -0
  140. package/dist/dom/types/nodes/constants.d.ts +52 -0
  141. package/dist/dom/types/nodes/create.d.ts +42 -0
  142. package/dist/dom/types/nodes/derived.d.ts +26 -0
  143. package/dist/dom/types/nodes/inspect.d.ts +2 -0
  144. package/dist/dom/types/nodes/mixins.d.ts +41 -0
  145. package/dist/dom/types/nodes/names.d.ts +15 -0
  146. package/dist/dom/types/nodes/slots.d.ts +38 -0
  147. package/dist/dom/types/nodes/tags.d.ts +8 -0
  148. package/dist/dom/types/nodes/traverse.d.ts +21 -0
  149. package/dist/dom/types/nodes/tree.d.ts +47 -0
  150. package/dist/dom/types/observers/MutationObserver.d.ts +33 -0
  151. package/dist/dom/types/observers/MutationRecord.d.ts +17 -0
  152. package/dist/dom/types/observers/queue.d.ts +45 -0
  153. package/dist/dom/types/parser/entities-data.d.ts +3 -0
  154. package/dist/dom/types/parser/entities.d.ts +11 -0
  155. package/dist/dom/types/parser/index.d.ts +34 -0
  156. package/dist/dom/types/parser/tags.d.ts +182 -0
  157. package/dist/dom/types/parser/tokenizer.d.ts +109 -0
  158. package/dist/dom/types/parser/treebuilder.d.ts +271 -0
  159. package/dist/dom/types/parser/xml.d.ts +14 -0
  160. package/dist/dom/types/selectors/compile.d.ts +154 -0
  161. package/dist/dom/types/selectors/filter.d.ts +21 -0
  162. package/dist/dom/types/selectors/html-predicates.d.ts +1 -0
  163. package/dist/dom/types/selectors/index.d.ts +16 -0
  164. package/dist/dom/types/selectors/internal.d.ts +87 -0
  165. package/dist/dom/types/selectors/parser.d.ts +310 -0
  166. package/dist/dom/types/selectors/serialize.d.ts +20 -0
  167. package/dist/dom/types/selectors/state.d.ts +43 -0
  168. package/dist/dom/types/serializer/index.d.ts +29 -0
  169. package/dist/dom/types/trace.d.ts +51 -0
  170. package/dist/dom/types/traversal/Range.d.ts +113 -0
  171. package/dist/dom/types/traversal/Selection.d.ts +45 -0
  172. package/dist/dom/types/traversal/TreeWalker.d.ts +77 -0
  173. package/dist/dom/types/traversal/live.d.ts +46 -0
  174. package/dist/dom/types/webidl-runtime.d.ts +18 -0
  175. package/dist/dom/types/webidl.d.ts +34 -0
  176. package/dist/dom/types/window/DOMStringList.d.ts +14 -0
  177. package/dist/dom/types/window/FileList.d.ts +11 -0
  178. package/dist/dom/types/window/FileReader.d.ts +27 -0
  179. package/dist/dom/types/window/History.d.ts +43 -0
  180. package/dist/dom/types/window/Location.d.ts +46 -0
  181. package/dist/dom/types/window/Navigator.d.ts +79 -0
  182. package/dist/dom/types/window/Screen.d.ts +27 -0
  183. package/dist/dom/types/window/Storage.d.ts +28 -0
  184. package/dist/dom/types/window/Window.d.ts +329 -0
  185. package/dist/dom/types/window/abort.d.ts +4 -0
  186. package/dist/dom/types/window/browsing-context.d.ts +12 -0
  187. package/dist/dom/types/window/clock.d.ts +153 -0
  188. package/dist/dom/types/window/compat.d.ts +34 -0
  189. package/dist/dom/types/window/cookies.d.ts +21 -0
  190. package/dist/dom/types/window/current.d.ts +7 -0
  191. package/dist/dom/types/window/document.d.ts +19 -0
  192. package/dist/dom/types/window/events.d.ts +11 -0
  193. package/dist/dom/types/window/fallbacks.d.ts +20 -0
  194. package/dist/dom/types/window/geometry.d.ts +133 -0
  195. package/dist/dom/types/window/globals.d.ts +7 -0
  196. package/dist/dom/types/window/hooks.d.ts +22 -0
  197. package/dist/dom/types/window/host-originals.d.ts +9 -0
  198. package/dist/dom/types/window/interfaces.d.ts +13 -0
  199. package/dist/dom/types/window/isolation.d.ts +20 -0
  200. package/dist/dom/types/window/media.d.ts +33 -0
  201. package/dist/dom/types/window/not-implemented.d.ts +23 -0
  202. package/dist/dom/types/window/observers.d.ts +42 -0
  203. package/dist/dom/types/window/origin.d.ts +3 -0
  204. package/dist/dom/types/window/timers.d.ts +28 -0
  205. package/dist/dom/types/window/xhr.d.ts +108 -0
  206. package/dist/jest-dom/_chunks/matchers-CDnnXUfG.js +2211 -0
  207. package/dist/jest-dom/_chunks/matchers-D988Ducb.cjs +2516 -0
  208. package/dist/jest-dom/index.cjs +5 -0
  209. package/dist/jest-dom/index.js +6 -0
  210. package/dist/jest-dom/jest-globals.cjs +6 -0
  211. package/dist/jest-dom/jest-globals.js +7 -0
  212. package/dist/jest-dom/matchers.cjs +53 -0
  213. package/dist/jest-dom/matchers.js +3 -0
  214. package/dist/jest-dom/types/bun.d.ts +13 -0
  215. package/dist/jest-dom/types/index.d.ts +3 -0
  216. package/dist/jest-dom/types/jest-globals.d.ts +13 -0
  217. package/dist/jest-dom/types/jest.d.ts +15 -0
  218. package/dist/jest-dom/types/matchers-standalone.d.ts +32 -0
  219. package/dist/jest-dom/types/matchers.d.ts +1079 -0
  220. package/dist/jest-dom/types/package.json +1 -0
  221. package/dist/jest-dom/types/vitest.d.ts +16 -0
  222. package/dist/jest-dom/vitest.cjs +6 -0
  223. package/dist/jest-dom/vitest.js +7 -0
  224. package/dist/react/_chunks/pure-DZ97z2oT.cjs +498 -0
  225. package/dist/react/_chunks/pure-PtE2hivW.js +420 -0
  226. package/dist/react/dont-cleanup-after-each.cjs +3 -0
  227. package/dist/react/dont-cleanup-after-each.js +4 -0
  228. package/dist/react/index.cjs +47 -0
  229. package/dist/react/index.js +35 -0
  230. package/dist/react/pure.cjs +17 -0
  231. package/dist/react/pure.js +5 -0
  232. package/dist/react/types/act-compat.d.ts +6 -0
  233. package/dist/react/types/config.d.ts +9 -0
  234. package/dist/react/types/dont-cleanup-after-each.d.ts +1 -0
  235. package/dist/react/types/dtl.d.ts +1 -0
  236. package/dist/react/types/fire-event.d.ts +3 -0
  237. package/dist/react/types/index.d.ts +1 -0
  238. package/dist/react/types/pure.d.ts +136 -0
  239. package/dist/register/index.js +11 -0
  240. package/dist/register/pure.js +147 -0
  241. package/dist/register/types/index.d.ts +1 -0
  242. package/dist/register/types/pure.d.ts +36 -0
  243. package/dist/testing-library/_chunks/aria-snapshot-diff-D7PzpXew.cjs +1170 -0
  244. package/dist/testing-library/_chunks/aria-snapshot-diff-Q8Wj33K0.js +985 -0
  245. package/dist/testing-library/agent.cjs +721 -0
  246. package/dist/testing-library/agent.js +713 -0
  247. package/dist/testing-library/index.cjs +2469 -0
  248. package/dist/testing-library/index.js +2390 -0
  249. package/dist/testing-library/types/agent.d.ts +56 -0
  250. package/dist/testing-library/types/aria-role.d.ts +99 -0
  251. package/dist/testing-library/types/aria-snapshot.d.ts +43 -0
  252. package/dist/testing-library/types/config.d.ts +27 -0
  253. package/dist/testing-library/types/events.d.ts +118 -0
  254. package/dist/testing-library/types/get-node-text.d.ts +1 -0
  255. package/dist/testing-library/types/get-queries-for-element.d.ts +182 -0
  256. package/dist/testing-library/types/index.d.ts +24 -0
  257. package/dist/testing-library/types/matches.d.ts +46 -0
  258. package/dist/testing-library/types/pretty-dom.d.ts +37 -0
  259. package/dist/testing-library/types/queries.d.ts +315 -0
  260. package/dist/testing-library/types/query-helpers.d.ts +112 -0
  261. package/dist/testing-library/types/role-helpers.d.ts +19 -0
  262. package/dist/testing-library/types/screen.d.ts +30 -0
  263. package/dist/testing-library/types/suggestions.d.ts +46 -0
  264. package/dist/testing-library/types/wait-for-element-to-be-removed.d.ts +6 -0
  265. package/dist/testing-library/types/wait-for.d.ts +12 -0
  266. package/dist/user-event/index.cjs +3910 -0
  267. package/dist/user-event/index.js +3885 -0
  268. package/dist/user-event/types/clipboard/copy.d.ts +2 -0
  269. package/dist/user-event/types/clipboard/cut.d.ts +2 -0
  270. package/dist/user-event/types/clipboard/index.d.ts +3 -0
  271. package/dist/user-event/types/clipboard/paste.d.ts +3 -0
  272. package/dist/user-event/types/convenience/click.d.ts +5 -0
  273. package/dist/user-event/types/convenience/hover.d.ts +4 -0
  274. package/dist/user-event/types/convenience/index.d.ts +3 -0
  275. package/dist/user-event/types/convenience/tab.d.ts +4 -0
  276. package/dist/user-event/types/ctrl-dom.d.ts +50 -0
  277. package/dist/user-event/types/document/UI.d.ts +35 -0
  278. package/dist/user-event/types/document/copySelection.d.ts +2 -0
  279. package/dist/user-event/types/document/getValueOrTextContent.d.ts +2 -0
  280. package/dist/user-event/types/document/index.d.ts +5 -0
  281. package/dist/user-event/types/document/interceptor.d.ts +20 -0
  282. package/dist/user-event/types/document/patchFocus.d.ts +7 -0
  283. package/dist/user-event/types/document/prepareDocument.d.ts +2 -0
  284. package/dist/user-event/types/document/trackValue.d.ts +13 -0
  285. package/dist/user-event/types/dom-types.d.ts +56 -0
  286. package/dist/user-event/types/event/behavior/click.d.ts +1 -0
  287. package/dist/user-event/types/event/behavior/cut.d.ts +1 -0
  288. package/dist/user-event/types/event/behavior/index.d.ts +8 -0
  289. package/dist/user-event/types/event/behavior/keydown.d.ts +1 -0
  290. package/dist/user-event/types/event/behavior/keypress.d.ts +1 -0
  291. package/dist/user-event/types/event/behavior/keyup.d.ts +1 -0
  292. package/dist/user-event/types/event/behavior/paste.d.ts +1 -0
  293. package/dist/user-event/types/event/behavior/registry.d.ts +9 -0
  294. package/dist/user-event/types/event/createEvent.d.ts +8 -0
  295. package/dist/user-event/types/event/dispatchEvent.d.ts +6 -0
  296. package/dist/user-event/types/event/eventMap.d.ts +265 -0
  297. package/dist/user-event/types/event/focus.d.ts +6 -0
  298. package/dist/user-event/types/event/index.d.ts +7 -0
  299. package/dist/user-event/types/event/input.d.ts +3 -0
  300. package/dist/user-event/types/event/radio.d.ts +5 -0
  301. package/dist/user-event/types/event/selection/getInputRange.d.ts +6 -0
  302. package/dist/user-event/types/event/selection/getTargetTypeAndSelection.d.ts +11 -0
  303. package/dist/user-event/types/event/selection/index.d.ts +15 -0
  304. package/dist/user-event/types/event/selection/modifySelection.d.ts +9 -0
  305. package/dist/user-event/types/event/selection/modifySelectionPerMouse.d.ts +8 -0
  306. package/dist/user-event/types/event/selection/moveSelection.d.ts +5 -0
  307. package/dist/user-event/types/event/selection/resolveCaretPosition.d.ts +9 -0
  308. package/dist/user-event/types/event/selection/selectAll.d.ts +6 -0
  309. package/dist/user-event/types/event/selection/setSelection.d.ts +11 -0
  310. package/dist/user-event/types/event/selection/setSelectionPerMouse.d.ts +9 -0
  311. package/dist/user-event/types/event/selection/setSelectionRange.d.ts +7 -0
  312. package/dist/user-event/types/event/selection/updateSelectionOnFocus.d.ts +6 -0
  313. package/dist/user-event/types/event/types.d.ts +21 -0
  314. package/dist/user-event/types/event/wrapEvent.d.ts +2 -0
  315. package/dist/user-event/types/index.d.ts +6 -0
  316. package/dist/user-event/types/keyboard/index.d.ts +3 -0
  317. package/dist/user-event/types/keyboard/keyMap.d.ts +5 -0
  318. package/dist/user-event/types/keyboard/parseKeyDef.d.ts +17 -0
  319. package/dist/user-event/types/options.d.ts +121 -0
  320. package/dist/user-event/types/pointer/index.d.ts +29 -0
  321. package/dist/user-event/types/pointer/keyMap.d.ts +2 -0
  322. package/dist/user-event/types/pointer/parseKeyDef.d.ts +6 -0
  323. package/dist/user-event/types/setup/api.d.ts +23 -0
  324. package/dist/user-event/types/setup/directApi.d.ts +25 -0
  325. package/dist/user-event/types/setup/dtl.d.ts +20 -0
  326. package/dist/user-event/types/setup/index.d.ts +22 -0
  327. package/dist/user-event/types/setup/setup.d.ts +45 -0
  328. package/dist/user-event/types/setup/wrapAsync.d.ts +4 -0
  329. package/dist/user-event/types/system/index.d.ts +13 -0
  330. package/dist/user-event/types/system/keyLocation.d.ts +11 -0
  331. package/dist/user-event/types/system/keyboard.d.ts +46 -0
  332. package/dist/user-event/types/system/pointer/buttons.d.ts +25 -0
  333. package/dist/user-event/types/system/pointer/device.d.ts +8 -0
  334. package/dist/user-event/types/system/pointer/index.d.ts +21 -0
  335. package/dist/user-event/types/system/pointer/mouse.d.ts +31 -0
  336. package/dist/user-event/types/system/pointer/pointer.d.ts +32 -0
  337. package/dist/user-event/types/system/pointer/shared.d.ts +21 -0
  338. package/dist/user-event/types/utility/clear.d.ts +3 -0
  339. package/dist/user-event/types/utility/index.d.ts +4 -0
  340. package/dist/user-event/types/utility/selectOptions.d.ts +4 -0
  341. package/dist/user-event/types/utility/type.d.ts +10 -0
  342. package/dist/user-event/types/utility/upload.d.ts +6 -0
  343. package/dist/user-event/types/utils/click/isClickableInput.d.ts +17 -0
  344. package/dist/user-event/types/utils/dataTransfer/Blob.d.ts +4 -0
  345. package/dist/user-event/types/utils/dataTransfer/Clipboard.d.ts +12 -0
  346. package/dist/user-event/types/utils/dataTransfer/DataTransfer.d.ts +3 -0
  347. package/dist/user-event/types/utils/dataTransfer/FileList.d.ts +2 -0
  348. package/dist/user-event/types/utils/edit/isContentEditable.d.ts +8 -0
  349. package/dist/user-event/types/utils/edit/isEditable.d.ts +26 -0
  350. package/dist/user-event/types/utils/edit/maxLength.d.ts +16 -0
  351. package/dist/user-event/types/utils/edit/setFiles.d.ts +11 -0
  352. package/dist/user-event/types/utils/edit/timeValue.d.ts +5 -0
  353. package/dist/user-event/types/utils/focus/cursor.d.ts +5 -0
  354. package/dist/user-event/types/utils/focus/getActiveElement.d.ts +3 -0
  355. package/dist/user-event/types/utils/focus/getTabDestination.d.ts +2 -0
  356. package/dist/user-event/types/utils/focus/isFocusable.d.ts +2 -0
  357. package/dist/user-event/types/utils/focus/selection.d.ts +9 -0
  358. package/dist/user-event/types/utils/focus/selector.d.ts +1 -0
  359. package/dist/user-event/types/utils/index.d.ts +29 -0
  360. package/dist/user-event/types/utils/keyDef/readNextDescriptor.d.ts +21 -0
  361. package/dist/user-event/types/utils/misc/cloneEvent.d.ts +2 -0
  362. package/dist/user-event/types/utils/misc/findClosest.d.ts +2 -0
  363. package/dist/user-event/types/utils/misc/getDocumentFromNode.d.ts +2 -0
  364. package/dist/user-event/types/utils/misc/getTreeDiff.d.ts +2 -0
  365. package/dist/user-event/types/utils/misc/getWindow.d.ts +2 -0
  366. package/dist/user-event/types/utils/misc/isDescendantOrSelf.d.ts +2 -0
  367. package/dist/user-event/types/utils/misc/isDisabled.d.ts +2 -0
  368. package/dist/user-event/types/utils/misc/isElementType.d.ts +6 -0
  369. package/dist/user-event/types/utils/misc/isVisible.d.ts +2 -0
  370. package/dist/user-event/types/utils/misc/level.d.ts +9 -0
  371. package/dist/user-event/types/utils/misc/wait.d.ts +6 -0
  372. package/dist/user-event/types/utils/pointer/cssPointerEvents.d.ts +4 -0
  373. package/dist/vitest-environment/failure-snapshot.js +42 -0
  374. package/dist/vitest-environment/index.js +185 -0
  375. package/dist/vitest-environment/plugin.js +90 -0
  376. package/dist/vitest-environment/types/failure-snapshot.d.ts +1 -0
  377. package/dist/vitest-environment/types/index.d.ts +29 -0
  378. package/dist/vitest-environment/types/plugin.d.ts +33 -0
  379. package/jest-preset.cjs +17 -0
  380. package/package.json +177 -3
@@ -0,0 +1,2211 @@
1
+ import { createRequire } from "node:module";
2
+ import { prettyDOM, queries } from "@ctrl/dom/testing-library";
3
+ import { daa06, getImplicitAriaRolesJestDom, roles } from "@ctrl/dom/aria";
4
+ import { $impl } from "@ctrl/dom/internal";
5
+ import { AriaTemplateError, matchAriaSnapshot } from "@ctrl/dom/testing-library/agent";
6
+
7
+ // \0rolldown/runtime.js
8
+ var __defProp = Object.defineProperty;
9
+ var __exportAll = (all, no_symbols) => {
10
+ let target = {};
11
+ for (var name in all) {
12
+ __defProp(target, name, {
13
+ get: all[name],
14
+ enumerable: true
15
+ });
16
+ }
17
+ if (!no_symbols) {
18
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
19
+ }
20
+ return target;
21
+ };
22
+
23
+ // src/utils.ts
24
+ var GenericTypeError = class extends Error {
25
+ constructor(expectedString, received, matcherFn, context) {
26
+ super();
27
+ if (Error.captureStackTrace) Error.captureStackTrace(this, matcherFn);
28
+ let withType = "";
29
+ try {
30
+ withType = context.utils.printWithType("Received", received, context.utils.printReceived);
31
+ } catch {}
32
+ this.message = [
33
+ context.utils.matcherHint(`${context.isNot ? ".not" : ""}.${matcherFn.name}`, "received", ""),
34
+ "",
35
+ `${context.utils.RECEIVED_COLOR("received")} value must ${expectedString}.`,
36
+ withType
37
+ ].join("\n");
38
+ }
39
+ };
40
+ var HtmlElementTypeError = class extends GenericTypeError {
41
+ constructor(received, matcherFn, context) {
42
+ super("be an HTMLElement or an SVGElement", received, matcherFn, context);
43
+ }
44
+ };
45
+ var NodeTypeError = class extends GenericTypeError {
46
+ constructor(received, matcherFn, context) {
47
+ super("be a Node", received, matcherFn, context);
48
+ }
49
+ };
50
+ function checkHasWindow(htmlElement, ErrorClass, matcherFn, context) {
51
+ if (!htmlElement || !htmlElement.ownerDocument || !htmlElement.ownerDocument.defaultView) throw new ErrorClass(htmlElement, matcherFn, context);
52
+ }
53
+ function checkNode(node, matcherFn, context) {
54
+ checkHasWindow(node, NodeTypeError, matcherFn, context);
55
+ if (!(node instanceof node.ownerDocument.defaultView.Node)) throw new NodeTypeError(node, matcherFn, context);
56
+ }
57
+ function checkHtmlElement(htmlElement, matcherFn, context) {
58
+ checkHasWindow(htmlElement, HtmlElementTypeError, matcherFn, context);
59
+ const window = htmlElement.ownerDocument.defaultView;
60
+ if (!(htmlElement instanceof window.HTMLElement) && !(htmlElement instanceof window.SVGElement)) throw new HtmlElementTypeError(htmlElement, matcherFn, context);
61
+ }
62
+ var InvalidCSSError = class extends Error {
63
+ constructor(received, matcherFn, context) {
64
+ super();
65
+ if (Error.captureStackTrace) Error.captureStackTrace(this, matcherFn);
66
+ this.message = [
67
+ received.message,
68
+ "",
69
+ context.utils.RECEIVED_COLOR(`Failing css:`),
70
+ context.utils.RECEIVED_COLOR(`${received.css}`)
71
+ ].join("\n");
72
+ }
73
+ };
74
+ let cssParse = null;
75
+ function parseCSS(css, matcherFn, context) {
76
+ cssParse ??= createRequire(import.meta.url)("@adobe/css-tools").parse;
77
+ const ast = cssParse(`selector { ${css} }`, { silent: true }).stylesheet;
78
+ if (ast.parsingErrors && ast.parsingErrors.length > 0) {
79
+ const { reason, line } = ast.parsingErrors[0];
80
+ throw new InvalidCSSError({
81
+ css,
82
+ message: `Syntax error parsing expected css: ${reason} on line: ${line}`
83
+ }, matcherFn, context);
84
+ }
85
+ const parsedRules = {};
86
+ const declarations = ast.rules[0].declarations;
87
+ for (let i = 0; i < declarations.length; i++) {
88
+ const d = declarations[i];
89
+ if (d.type === "declaration") parsedRules[d.property] = d.value;
90
+ }
91
+ return parsedRules;
92
+ }
93
+ function display(context, value) {
94
+ return typeof value === "string" ? value : context.utils.stringify(value);
95
+ }
96
+ function getMessage(context, matcher, expectedLabel, expectedValue, receivedLabel, receivedValue) {
97
+ return [
98
+ `${matcher}\n`,
99
+ `${expectedLabel}:\n${context.utils.EXPECTED_COLOR(redent(display(context, expectedValue), 2))}`,
100
+ `${receivedLabel}:\n${context.utils.RECEIVED_COLOR(redent(display(context, receivedValue), 2))}`
101
+ ].join("\n");
102
+ }
103
+ function matches(textToMatch, matcher) {
104
+ if (matcher instanceof RegExp) return matcher.test(textToMatch);
105
+ return textToMatch.includes(String(matcher));
106
+ }
107
+ function deprecate(name, replacementText) {
108
+ console.warn(`Warning: ${name} has been deprecated and will be removed in future updates.`, replacementText);
109
+ }
110
+ function normalize(text) {
111
+ return text.replace(/\s+/g, " ").trim();
112
+ }
113
+ function getTag(element) {
114
+ return element.tagName && element.tagName.toLowerCase();
115
+ }
116
+ function getSelectValue({ multiple, options }) {
117
+ const selectedOptions = [];
118
+ for (let i = 0; i < options.length; i++) if (options[i].selected) selectedOptions.push(options[i]);
119
+ if (multiple) return selectedOptions.map((opt) => opt.value);
120
+ if (selectedOptions.length === 0) return;
121
+ return selectedOptions[0].value;
122
+ }
123
+ function getInputValue(inputElement) {
124
+ switch (inputElement.type) {
125
+ case "number": return inputElement.value === "" ? null : Number(inputElement.value);
126
+ case "checkbox": return inputElement.checked;
127
+ default: return inputElement.value;
128
+ }
129
+ }
130
+ const rolesSupportingValues = [
131
+ "meter",
132
+ "progressbar",
133
+ "slider",
134
+ "spinbutton"
135
+ ];
136
+ function getAccessibleValue(element) {
137
+ if (!rolesSupportingValues.includes(element.getAttribute("role"))) return;
138
+ return Number(element.getAttribute("aria-valuenow"));
139
+ }
140
+ function getSingleElementValue(element) {
141
+ if (!element) return;
142
+ switch (element.tagName.toLowerCase()) {
143
+ case "input": return getInputValue(element);
144
+ case "select": return getSelectValue(element);
145
+ default: return element.value ?? getAccessibleValue(element);
146
+ }
147
+ }
148
+ function toSentence(array, { wordConnector = ", ", lastWordConnector = " and " } = {}) {
149
+ return [array.slice(0, -1).join(wordConnector), array[array.length - 1]].join(array.length > 1 ? lastWordConnector : "");
150
+ }
151
+ function compareAsSet(val1, val2) {
152
+ if (Array.isArray(val1) && Array.isArray(val2)) {
153
+ const set2 = new Set(val2);
154
+ return [...new Set(val1)].every((v) => set2.has(v));
155
+ }
156
+ return val1 === val2;
157
+ }
158
+ /**
159
+ * redent@3 (strip-indent@3 + indent-string@4): remove the common leading indentation, then
160
+ * indent every non-empty line by `count` spaces. MIT, Sindre Sorhus.
161
+ */
162
+ function redent(string, count) {
163
+ const match = string.match(/^[ \t]*(?=\S)/gm);
164
+ let indent = 0;
165
+ if (match) indent = match.reduce((r, a) => Math.min(r, a.length), Infinity);
166
+ const stripped = indent > 0 ? string.replace(new RegExp(`^[ \\t]{${indent}}`, "gm"), "") : string;
167
+ if (count === 0) return stripped;
168
+ return stripped.replace(/^(?!\s*$)/gm, " ".repeat(count));
169
+ }
170
+ /** https://drafts.csswg.org/cssom/#serialize-an-identifier (css.escape@1.5.1, MIT, Mathias Bynens). */
171
+ function cssEscape(value) {
172
+ const string = String(value);
173
+ const length = string.length;
174
+ let index = -1;
175
+ let result = "";
176
+ const firstCodeUnit = string.charCodeAt(0);
177
+ while (++index < length) {
178
+ const codeUnit = string.charCodeAt(index);
179
+ if (codeUnit === 0) {
180
+ result += "�";
181
+ continue;
182
+ }
183
+ if (codeUnit >= 1 && codeUnit <= 31 || codeUnit === 127 || index === 0 && codeUnit >= 48 && codeUnit <= 57 || index === 1 && codeUnit >= 48 && codeUnit <= 57 && firstCodeUnit === 45) {
184
+ result += "\\" + codeUnit.toString(16) + " ";
185
+ continue;
186
+ }
187
+ if (index === 0 && length === 1 && codeUnit === 45) {
188
+ result += "\\" + string.charAt(index);
189
+ continue;
190
+ }
191
+ if (codeUnit >= 128 || codeUnit === 45 || codeUnit === 95 || codeUnit >= 48 && codeUnit <= 57 || codeUnit >= 65 && codeUnit <= 90 || codeUnit >= 97 && codeUnit <= 122) {
192
+ result += string.charAt(index);
193
+ continue;
194
+ }
195
+ result += "\\" + string.charAt(index);
196
+ }
197
+ return result;
198
+ }
199
+ const env = process.env;
200
+ const argv = process.argv;
201
+ const isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || process.platform === "win32" || process.stdout?.isTTY && env.TERM !== "dumb" || !!env.CI);
202
+ function picoRed(input) {
203
+ if (!isColorSupported) return String(input);
204
+ const open = "\x1B[31m";
205
+ const close = "\x1B[39m";
206
+ const string = "" + input;
207
+ let index = string.indexOf(close, 5);
208
+ if (index === -1) return open + string + close;
209
+ let result = "";
210
+ let cursor = 0;
211
+ do {
212
+ result += string.substring(cursor, index) + open;
213
+ cursor = index + 5;
214
+ index = string.indexOf(close, cursor);
215
+ } while (index !== -1);
216
+ return open + result + string.substring(cursor) + close;
217
+ }
218
+
219
+ // src/matchers/query.ts
220
+ /**
221
+ * The list of supported query names. These must match the plain English used by Testing
222
+ * Library (e.g. "by role", "by test ID"). Each name is converted to PascalCase to derive the
223
+ * matcher names `toContainAnyBy${PascalCase}` and `toContainOneBy${PascalCase}`, as well as
224
+ * look up the query function `queryAllBy${PascalCase}`.
225
+ */
226
+ const queryNames = [
227
+ "alt text",
228
+ "display value",
229
+ "label text",
230
+ "placeholder text",
231
+ "role",
232
+ "test ID",
233
+ "text",
234
+ "title"
235
+ ];
236
+ function toPascalCase(value) {
237
+ return value.split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join("");
238
+ }
239
+ function createQueryMatcher(quantity, queryName) {
240
+ const strategy = toPascalCase(queryName);
241
+ const matcherName = `toContain${quantity}By${strategy}`;
242
+ const query = queries[`queryAllBy${strategy}`];
243
+ function queryMatcher(actual, ...args) {
244
+ checkHtmlElement(actual, queryMatcher, this);
245
+ const elements = query(actual, ...args);
246
+ return {
247
+ message: () => {
248
+ const to = this.isNot ? "not to" : "to";
249
+ const hint = this.utils.matcherHint(`${this.isNot ? ".not" : ""}.${matcherName}`, "element", queryName, { secondArgument: args[1] === void 0 ? void 0 : this.utils.printExpected(args[1]) });
250
+ const parts = [getMessage(this, hint, `Expected element ${to} contain ${quantity.toLowerCase()} descendant by ${queryName}`, args[0], "Received", elements.length)];
251
+ const prettyElements = elements.map((element) => prettyDOM(element)).filter((value) => typeof value === "string");
252
+ if (prettyElements.length) parts.push("Here are the matching elements:", ...prettyElements);
253
+ return parts.join("\n\n");
254
+ },
255
+ pass: quantity === "One" ? elements.length === 1 : elements.length > 0
256
+ };
257
+ }
258
+ Object.defineProperty(queryMatcher, "name", { value: matcherName });
259
+ return queryMatcher;
260
+ }
261
+ const queryMatchers = {};
262
+ for (const queryName of queryNames) {
263
+ const anyMatcher = createQueryMatcher("Any", queryName);
264
+ const oneMatcher = createQueryMatcher("One", queryName);
265
+ queryMatchers[anyMatcher.name] = anyMatcher;
266
+ queryMatchers[oneMatcher.name] = oneMatcher;
267
+ }
268
+
269
+ // src/matchers/document.ts
270
+ function toBeInTheDocument(element) {
271
+ if (element !== null || !this.isNot) checkHtmlElement(element, toBeInTheDocument, this);
272
+ const pass = element === null ? false : element.ownerDocument === element.getRootNode({ composed: true });
273
+ const errorFound = () => {
274
+ return `expected document not to contain element, found ${this.utils.stringify(element.cloneNode(true))} instead`;
275
+ };
276
+ const errorNotFound = () => {
277
+ return `element could not be found in the document`;
278
+ };
279
+ return {
280
+ pass,
281
+ message: () => {
282
+ return [
283
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeInTheDocument`, "element", ""),
284
+ "",
285
+ this.utils.RECEIVED_COLOR(this.isNot ? errorFound() : errorNotFound())
286
+ ].join("\n");
287
+ }
288
+ };
289
+ }
290
+ function toBeInTheDOM(element, container) {
291
+ deprecate("toBeInTheDOM", "Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container.");
292
+ if (element) checkHtmlElement(element, toBeInTheDOM, this);
293
+ if (container) checkHtmlElement(container, toBeInTheDOM, this);
294
+ return {
295
+ pass: container ? container.contains(element) : !!element,
296
+ message: () => {
297
+ return [
298
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeInTheDOM`, "element", ""),
299
+ "",
300
+ "Received:",
301
+ ` ${this.utils.printReceived(element ? element.cloneNode(false) : element)}`
302
+ ].join("\n");
303
+ }
304
+ };
305
+ }
306
+ /**
307
+ * Whether an element has no child nodes other than comments.
308
+ * (Upstream compares nodeType to 8 instead of Node.COMMENT_NODE because of
309
+ * https://github.com/jsdom/jsdom/issues/2220.)
310
+ */
311
+ function isEmptyElement(element) {
312
+ for (let child = element.firstChild; child !== null; child = child.nextSibling) if (child.nodeType !== 8) return false;
313
+ return true;
314
+ }
315
+ function toBeEmptyDOMElement(element) {
316
+ checkHtmlElement(element, toBeEmptyDOMElement, this);
317
+ return {
318
+ pass: isEmptyElement(element),
319
+ message: () => {
320
+ return [
321
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeEmptyDOMElement`, "element", ""),
322
+ "",
323
+ "Received:",
324
+ ` ${this.utils.printReceived(element.innerHTML)}`
325
+ ].join("\n");
326
+ }
327
+ };
328
+ }
329
+ function toBeEmpty(element) {
330
+ deprecate("toBeEmpty", "Please use instead toBeEmptyDOMElement for finding empty nodes in the DOM.");
331
+ checkHtmlElement(element, toBeEmpty, this);
332
+ return {
333
+ pass: element.innerHTML === "",
334
+ message: () => {
335
+ return [
336
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeEmpty`, "element", ""),
337
+ "",
338
+ "Received:",
339
+ ` ${this.utils.printReceived(element.innerHTML)}`
340
+ ].join("\n");
341
+ }
342
+ };
343
+ }
344
+ function toContainElement(container, element) {
345
+ checkHtmlElement(container, toContainElement, this);
346
+ if (element !== null) checkHtmlElement(element, toContainElement, this);
347
+ return {
348
+ pass: container.contains(element),
349
+ message: () => {
350
+ return [
351
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toContainElement`, "element", "element"),
352
+ "",
353
+ this.utils.RECEIVED_COLOR(`${this.utils.stringify(container.cloneNode(false))} ${this.isNot ? "contains:" : "does not contain:"} ${this.utils.stringify(element ? element.cloneNode(false) : element)}
354
+ `)
355
+ ].join("\n");
356
+ }
357
+ };
358
+ }
359
+ function getNormalizedHtml(container, htmlText) {
360
+ const div = container.ownerDocument.createElement("div");
361
+ div.innerHTML = htmlText;
362
+ return div.innerHTML;
363
+ }
364
+ function toContainHTML(container, htmlText) {
365
+ checkHtmlElement(container, toContainHTML, this);
366
+ if (typeof htmlText !== "string") throw new Error(`.toContainHTML() expects a string value, got ${htmlText}`);
367
+ return {
368
+ pass: container.outerHTML.includes(getNormalizedHtml(container, htmlText)),
369
+ message: () => {
370
+ return [
371
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toContainHTML`, "element", ""),
372
+ "Expected:",
373
+ ` ${this.utils.EXPECTED_COLOR(htmlText)}`,
374
+ "Received:",
375
+ ` ${this.utils.printReceived(container.cloneNode(true))}`
376
+ ].join("\n");
377
+ }
378
+ };
379
+ }
380
+ function toHaveFocus(element) {
381
+ checkHtmlElement(element, toHaveFocus, this);
382
+ return {
383
+ pass: element.ownerDocument.activeElement === element,
384
+ message: () => {
385
+ return [
386
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveFocus`, "element", ""),
387
+ "",
388
+ ...this.isNot ? ["Received element is focused:", ` ${this.utils.printReceived(element)}`] : [
389
+ "Expected element with focus:",
390
+ ` ${this.utils.printExpected(element)}`,
391
+ "Received element with focus:",
392
+ ` ${this.utils.printReceived(element.ownerDocument.activeElement)}`
393
+ ]
394
+ ].join("\n");
395
+ }
396
+ };
397
+ }
398
+ const DOCUMENT_POSITION_DISCONNECTED = 1;
399
+ const DOCUMENT_POSITION_PRECEDING = 2;
400
+ const DOCUMENT_POSITION_FOLLOWING = 4;
401
+ const DOCUMENT_POSITION_CONTAINS = 8;
402
+ const DOCUMENT_POSITION_CONTAINED_BY = 16;
403
+ const DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;
404
+ const DOCUMENT_POSITIONS_STRINGS = {
405
+ [DOCUMENT_POSITION_DISCONNECTED]: "Node.DOCUMENT_POSITION_DISCONNECTED",
406
+ [DOCUMENT_POSITION_PRECEDING]: "Node.DOCUMENT_POSITION_PRECEDING",
407
+ [DOCUMENT_POSITION_FOLLOWING]: "Node.DOCUMENT_POSITION_FOLLOWING",
408
+ [DOCUMENT_POSITION_CONTAINS]: "Node.DOCUMENT_POSITION_CONTAINS",
409
+ [DOCUMENT_POSITION_CONTAINED_BY]: "Node.DOCUMENT_POSITION_CONTAINED_BY",
410
+ [DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC]: "Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC"
411
+ };
412
+ function makeDocumentPositionErrorString(documentPosition) {
413
+ if (documentPosition in DOCUMENT_POSITIONS_STRINGS) return `${DOCUMENT_POSITIONS_STRINGS[documentPosition]} (${documentPosition})`;
414
+ return `Unknown document position (${documentPosition})`;
415
+ }
416
+ function checkToAppear(context, methodName, targetDocumentPosition, element, secondElement) {
417
+ checkHtmlElement(element, toAppearBefore, context);
418
+ checkHtmlElement(secondElement, toAppearBefore, context);
419
+ const documentPosition = element.compareDocumentPosition(secondElement);
420
+ return {
421
+ pass: documentPosition === targetDocumentPosition,
422
+ message: () => {
423
+ return [
424
+ context.utils.matcherHint(`${context.isNot ? ".not" : ""}.${methodName}`, "element", "secondElement"),
425
+ "",
426
+ `Received: ${makeDocumentPositionErrorString(documentPosition)}`
427
+ ].join("\n");
428
+ }
429
+ };
430
+ }
431
+ function toAppearBefore(element, secondElement) {
432
+ return checkToAppear(this, "toAppearBefore", DOCUMENT_POSITION_FOLLOWING, element, secondElement);
433
+ }
434
+ function toAppearAfter(element, secondElement) {
435
+ return checkToAppear(this, "toAppearAfter", DOCUMENT_POSITION_PRECEDING, element, secondElement);
436
+ }
437
+
438
+ // src/matchers/content.ts
439
+ function toHaveTextContent(node, checkWith, options = { normalizeWhitespace: true }) {
440
+ checkNode(node, toHaveTextContent, this);
441
+ const textContent = options.normalizeWhitespace ? normalize(node.textContent) : node.textContent.replace(/ /g, " ");
442
+ const checkingWithEmptyString = textContent !== "" && checkWith === "";
443
+ return {
444
+ pass: !checkingWithEmptyString && matches(textContent, checkWith),
445
+ message: () => {
446
+ const to = this.isNot ? "not to" : "to";
447
+ return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveTextContent`, "element", ""), checkingWithEmptyString ? `Checking with empty string will always match, use .toBeEmptyDOMElement() instead` : `Expected element ${to} have text content`, checkWith, "Received", textContent);
448
+ }
449
+ };
450
+ }
451
+ function printAttribute(stringify, name, value) {
452
+ return value === void 0 ? name : `${name}=${stringify(value)}`;
453
+ }
454
+ function getAttributeComment(stringify, name, value) {
455
+ return value === void 0 ? `element.hasAttribute(${stringify(name)})` : `element.getAttribute(${stringify(name)}) === ${stringify(value)}`;
456
+ }
457
+ function toHaveAttribute(htmlElement, name, expectedValue) {
458
+ checkHtmlElement(htmlElement, toHaveAttribute, this);
459
+ const isExpectedValuePresent = expectedValue !== void 0;
460
+ const hasAttribute = htmlElement.hasAttribute(name);
461
+ const receivedValue = htmlElement.getAttribute(name);
462
+ return {
463
+ pass: isExpectedValuePresent ? hasAttribute && this.equals(receivedValue, expectedValue) : hasAttribute,
464
+ message: () => {
465
+ const to = this.isNot ? "not to" : "to";
466
+ const receivedAttribute = hasAttribute ? printAttribute(this.utils.stringify, name, receivedValue) : null;
467
+ const matcher = this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveAttribute`, "element", this.utils.printExpected(name), {
468
+ secondArgument: isExpectedValuePresent ? this.utils.printExpected(expectedValue) : void 0,
469
+ comment: getAttributeComment(this.utils.stringify, name, expectedValue)
470
+ });
471
+ return getMessage(this, matcher, `Expected the element ${to} have attribute`, printAttribute(this.utils.stringify, name, expectedValue), "Received", receivedAttribute);
472
+ }
473
+ };
474
+ }
475
+ function getExpectedClassNamesAndOptions(params) {
476
+ const lastParam = params.pop();
477
+ let expectedClassNames;
478
+ let options;
479
+ if (typeof lastParam === "object" && !(lastParam instanceof RegExp)) {
480
+ expectedClassNames = params;
481
+ options = lastParam;
482
+ } else {
483
+ expectedClassNames = params.concat(lastParam);
484
+ options = { exact: false };
485
+ }
486
+ return {
487
+ expectedClassNames,
488
+ options
489
+ };
490
+ }
491
+ function splitClassNames(str) {
492
+ if (!str) return [];
493
+ return str.split(/\s+/).filter((s) => s.length > 0);
494
+ }
495
+ function isSubset$1(subset, superset) {
496
+ return subset.every((strOrRegexp) => typeof strOrRegexp === "string" ? superset.includes(strOrRegexp) : superset.some((className) => strOrRegexp.test(className)));
497
+ }
498
+ function toHaveClass(htmlElement, ...params) {
499
+ checkHtmlElement(htmlElement, toHaveClass, this);
500
+ const { expectedClassNames, options } = getExpectedClassNamesAndOptions(params);
501
+ const received = splitClassNames(htmlElement.getAttribute("class"));
502
+ const expected = expectedClassNames.reduce((acc, className) => acc.concat(typeof className === "string" || !className ? splitClassNames(className) : className), []);
503
+ const hasRegExp = expected.some((className) => className instanceof RegExp);
504
+ if (options.exact && hasRegExp) throw new Error("Exact option does not support RegExp expected class names");
505
+ if (options.exact) return {
506
+ pass: isSubset$1(expected, received) && expected.length === received.length,
507
+ message: () => {
508
+ const to = this.isNot ? "not to" : "to";
509
+ return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveClass`, "element", this.utils.printExpected(expected.join(" "))), `Expected the element ${to} have EXACTLY defined classes`, expected.join(" "), "Received", received.join(" "));
510
+ }
511
+ };
512
+ return expected.length > 0 ? {
513
+ pass: isSubset$1(expected, received),
514
+ message: () => {
515
+ const to = this.isNot ? "not to" : "to";
516
+ return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveClass`, "element", this.utils.printExpected(expected.join(" "))), `Expected the element ${to} have class`, expected.join(" "), "Received", received.join(" "));
517
+ }
518
+ } : {
519
+ pass: this.isNot ? received.length > 0 : false,
520
+ message: () => this.isNot ? getMessage(this, this.utils.matcherHint(".not.toHaveClass", "element", ""), "Expected the element to have classes", "(none)", "Received", received.join(" ")) : [this.utils.matcherHint(`.toHaveClass`, "element"), "At least one expected class must be provided."].join("\n")
521
+ };
522
+ }
523
+ function toHaveValue(htmlElement, expectedValue) {
524
+ checkHtmlElement(htmlElement, toHaveValue, this);
525
+ if (htmlElement.tagName.toLowerCase() === "input" && ["checkbox", "radio"].includes(htmlElement.type)) throw new Error("input with type=checkbox or type=radio cannot be used with .toHaveValue(). Use .toBeChecked() for type=checkbox or .toHaveFormValues() instead");
526
+ const receivedValue = getSingleElementValue(htmlElement);
527
+ const expectsValue = expectedValue !== void 0;
528
+ let expectedTypedValue = expectedValue;
529
+ let receivedTypedValue = receivedValue;
530
+ if (expectedValue == receivedValue && expectedValue !== receivedValue) {
531
+ expectedTypedValue = `${expectedValue} (${typeof expectedValue})`;
532
+ receivedTypedValue = `${receivedValue} (${typeof receivedValue})`;
533
+ }
534
+ return {
535
+ pass: expectsValue ? compareAsSet(receivedValue, expectedValue) : Boolean(receivedValue),
536
+ message: () => {
537
+ const to = this.isNot ? "not to" : "to";
538
+ const matcher = this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveValue`, "element", expectedValue);
539
+ return getMessage(this, matcher, `Expected the element ${to} have value`, expectsValue ? expectedTypedValue : "(any)", "Received", receivedTypedValue);
540
+ }
541
+ };
542
+ }
543
+ function getValues(tagName, htmlElement) {
544
+ if (tagName !== "select") return [htmlElement.value];
545
+ const values = [];
546
+ const options = htmlElement.options;
547
+ for (let i = 0; i < options.length; i++) {
548
+ const option = options[i];
549
+ if (option.selected) values.push(option.textContent);
550
+ }
551
+ return values;
552
+ }
553
+ function toHaveDisplayValue(htmlElement, expectedValue) {
554
+ checkHtmlElement(htmlElement, toHaveDisplayValue, this);
555
+ const tagName = htmlElement.tagName.toLowerCase();
556
+ if (![
557
+ "select",
558
+ "input",
559
+ "textarea"
560
+ ].includes(tagName)) throw new Error(".toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.");
561
+ if (tagName === "input" && ["radio", "checkbox"].includes(htmlElement.type)) throw new Error(`.toHaveDisplayValue() currently does not support input[type="${htmlElement.type}"], try with another matcher instead.`);
562
+ const values = getValues(tagName, htmlElement);
563
+ const expectedValues = expectedValue instanceof Array ? expectedValue : [expectedValue];
564
+ const numberOfMatchesWithValues = expectedValues.filter((expected) => values.some((value) => expected instanceof RegExp ? expected.test(value) : this.equals(value, String(expected)))).length;
565
+ const matchedWithAllValues = numberOfMatchesWithValues === values.length;
566
+ const matchedWithAllExpectedValues = numberOfMatchesWithValues === expectedValues.length;
567
+ return {
568
+ pass: matchedWithAllValues && matchedWithAllExpectedValues,
569
+ message: () => getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveDisplayValue`, "element", ""), `Expected element ${this.isNot ? "not " : ""}to have display value`, expectedValue, "Received", values)
570
+ };
571
+ }
572
+ function getMultiElementValue(elements) {
573
+ const types = [...new Set(elements.map((element) => element.type))];
574
+ if (types.length !== 1) throw new Error("Multiple form elements with the same name must be of the same type");
575
+ switch (types[0]) {
576
+ case "radio": {
577
+ const theChosenOne = elements.find((radio) => radio.checked);
578
+ return theChosenOne ? theChosenOne.value : void 0;
579
+ }
580
+ case "checkbox": return elements.filter((checkbox) => checkbox.checked).map((checkbox) => checkbox.value);
581
+ default: return elements.map((element) => element.value);
582
+ }
583
+ }
584
+ function getFormValue(container, name) {
585
+ const elements = [...container.querySelectorAll(`[name="${cssEscape(name)}"]`)];
586
+ if (elements.length === 0) return;
587
+ switch (elements.length) {
588
+ case 1: return getSingleElementValue(elements[0]);
589
+ default: return getMultiElementValue(elements);
590
+ }
591
+ }
592
+ function getPureName(name) {
593
+ return name.endsWith("[]") ? name.slice(0, -2) : name;
594
+ }
595
+ function getAllFormValues(container) {
596
+ const values = {};
597
+ for (const element of Array.from(container.elements)) {
598
+ const name = element.name;
599
+ values[getPureName(name)] = getFormValue(container, name);
600
+ }
601
+ return values;
602
+ }
603
+ function toHaveFormValues(formElement, expectedValues) {
604
+ checkHtmlElement(formElement, toHaveFormValues, this);
605
+ if (!formElement.elements) throw new Error("toHaveFormValues must be called on a form or a fieldset");
606
+ const formValues = getAllFormValues(formElement);
607
+ return {
608
+ pass: Object.entries(expectedValues).every(([name, expectedValue]) => compareAsSet(formValues[name], expectedValue)),
609
+ message: () => {
610
+ const to = this.isNot ? "not to" : "to";
611
+ const matcher = `${this.isNot ? ".not" : ""}.toHaveFormValues`;
612
+ const commonKeyValues = {};
613
+ for (const key of Object.keys(formValues)) if (Object.prototype.hasOwnProperty.call(expectedValues, key)) commonKeyValues[key] = formValues[key];
614
+ return [
615
+ this.utils.matcherHint(matcher, "element", ""),
616
+ `Expected the element ${to} have form values`,
617
+ this.utils.diff(expectedValues, commonKeyValues)
618
+ ].join("\n\n");
619
+ }
620
+ };
621
+ }
622
+ /** Returns the selection from the element. */
623
+ function getSelection(element) {
624
+ const selection = element.ownerDocument.getSelection();
625
+ if (["input", "textarea"].includes(element.tagName.toLowerCase())) {
626
+ if (["radio", "checkbox"].includes(element.type)) return "";
627
+ return element.value.toString().substring(element.selectionStart, element.selectionEnd);
628
+ }
629
+ if (selection.anchorNode === null || selection.focusNode === null) return "";
630
+ const originalRange = selection.getRangeAt(0);
631
+ const temporaryRange = element.ownerDocument.createRange();
632
+ if (selection.containsNode(element, false)) {
633
+ temporaryRange.selectNodeContents(element);
634
+ selection.removeAllRanges();
635
+ selection.addRange(temporaryRange);
636
+ } else if (element.contains(selection.anchorNode) && element.contains(selection.focusNode)) {} else {
637
+ const selectionStartsWithinElement = element === originalRange.startContainer || element.contains(originalRange.startContainer);
638
+ const selectionEndsWithinElement = element === originalRange.endContainer || element.contains(originalRange.endContainer);
639
+ selection.removeAllRanges();
640
+ if (selectionStartsWithinElement || selectionEndsWithinElement) {
641
+ temporaryRange.selectNodeContents(element);
642
+ if (selectionStartsWithinElement) temporaryRange.setStart(originalRange.startContainer, originalRange.startOffset);
643
+ if (selectionEndsWithinElement) temporaryRange.setEnd(originalRange.endContainer, originalRange.endOffset);
644
+ selection.addRange(temporaryRange);
645
+ }
646
+ }
647
+ const result = selection.toString();
648
+ selection.removeAllRanges();
649
+ selection.addRange(originalRange);
650
+ return result;
651
+ }
652
+ function toHaveSelection(htmlElement, expectedSelection) {
653
+ checkHtmlElement(htmlElement, toHaveSelection, this);
654
+ const expectsSelection = expectedSelection !== void 0;
655
+ if (expectsSelection && typeof expectedSelection !== "string") throw new Error(`expected selection must be a string or undefined`);
656
+ const receivedSelection = getSelection(htmlElement);
657
+ return {
658
+ pass: expectsSelection ? compareAsSet(receivedSelection, expectedSelection) : Boolean(receivedSelection),
659
+ message: () => {
660
+ const to = this.isNot ? "not to" : "to";
661
+ const matcher = this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveSelection`, "element", expectedSelection);
662
+ return getMessage(this, matcher, `Expected the element ${to} have selection`, expectsSelection ? expectedSelection : "(any)", "Received", receivedSelection);
663
+ }
664
+ };
665
+ }
666
+
667
+ // src/aria.ts
668
+ let fallback = null;
669
+ function foreign() {
670
+ return fallback ??= createRequire(import.meta.url)("dom-accessibility-api");
671
+ }
672
+ function computeAccessibleName(element) {
673
+ if (element[$impl] !== void 0) return daa06.computeAccessibleName(element);
674
+ return foreign().computeAccessibleName(element);
675
+ }
676
+ function computeAccessibleDescription(element) {
677
+ if (element[$impl] !== void 0) return daa06.computeAccessibleDescription(element);
678
+ return foreign().computeAccessibleDescription(element);
679
+ }
680
+
681
+ // src/element-roles.generated.ts
682
+ const ELEMENT_ROLES = [
683
+ [
684
+ "input",
685
+ [["list", "+"], ["type", "=email"]],
686
+ false,
687
+ ["combobox"]
688
+ ],
689
+ [
690
+ "input",
691
+ [["list", "+"], ["type", "=search"]],
692
+ false,
693
+ ["combobox"]
694
+ ],
695
+ [
696
+ "input",
697
+ [["list", "+"], ["type", "=tel"]],
698
+ false,
699
+ ["combobox"]
700
+ ],
701
+ [
702
+ "input",
703
+ [["list", "+"]],
704
+ true,
705
+ ["combobox"]
706
+ ],
707
+ [
708
+ "input",
709
+ [["list", "+"], ["type", "=url"]],
710
+ false,
711
+ ["combobox"]
712
+ ],
713
+ [
714
+ "select",
715
+ [["multiple", "-"], ["size", "-"]],
716
+ false,
717
+ ["combobox"]
718
+ ],
719
+ [
720
+ "input",
721
+ [["list", "-"], ["type", "=search"]],
722
+ false,
723
+ ["searchbox"]
724
+ ],
725
+ [
726
+ "input",
727
+ [["type", "-"], ["list", "-"]],
728
+ false,
729
+ ["textbox"]
730
+ ],
731
+ [
732
+ "input",
733
+ [["list", "-"], ["type", "=email"]],
734
+ false,
735
+ ["textbox"]
736
+ ],
737
+ [
738
+ "input",
739
+ [["list", "-"], ["type", "=tel"]],
740
+ false,
741
+ ["textbox"]
742
+ ],
743
+ [
744
+ "input",
745
+ [["list", "-"]],
746
+ true,
747
+ ["textbox"]
748
+ ],
749
+ [
750
+ "input",
751
+ [["list", "-"], ["type", "=url"]],
752
+ false,
753
+ ["textbox"]
754
+ ],
755
+ [
756
+ "input",
757
+ [["type", "=button"]],
758
+ false,
759
+ ["button"]
760
+ ],
761
+ [
762
+ "input",
763
+ [["type", "=image"]],
764
+ false,
765
+ ["button"]
766
+ ],
767
+ [
768
+ "input",
769
+ [["type", "=reset"]],
770
+ false,
771
+ ["button"]
772
+ ],
773
+ [
774
+ "input",
775
+ [["type", "=submit"]],
776
+ false,
777
+ ["button"]
778
+ ],
779
+ [
780
+ "input",
781
+ [["type", "=checkbox"]],
782
+ false,
783
+ ["checkbox"]
784
+ ],
785
+ [
786
+ "th",
787
+ [["scope", "=col"]],
788
+ false,
789
+ ["columnheader"]
790
+ ],
791
+ [
792
+ "th",
793
+ [["scope", "=colgroup"]],
794
+ false,
795
+ ["columnheader"]
796
+ ],
797
+ [
798
+ "aside",
799
+ [["aria-label", "+"]],
800
+ false,
801
+ ["complementary"]
802
+ ],
803
+ [
804
+ "aside",
805
+ [["aria-labelledby", "+"]],
806
+ false,
807
+ ["complementary"]
808
+ ],
809
+ [
810
+ "form",
811
+ [["aria-label", "+"]],
812
+ false,
813
+ ["form"]
814
+ ],
815
+ [
816
+ "form",
817
+ [["aria-labelledby", "+"]],
818
+ false,
819
+ ["form"]
820
+ ],
821
+ [
822
+ "form",
823
+ [["name", "+"]],
824
+ false,
825
+ ["form"]
826
+ ],
827
+ [
828
+ "img",
829
+ [["alt", "+"]],
830
+ false,
831
+ ["img"]
832
+ ],
833
+ [
834
+ "img",
835
+ [["alt", "-"]],
836
+ false,
837
+ ["img"]
838
+ ],
839
+ [
840
+ "a",
841
+ [["href", "+"]],
842
+ false,
843
+ ["link"]
844
+ ],
845
+ [
846
+ "area",
847
+ [["href", "+"]],
848
+ false,
849
+ ["link"]
850
+ ],
851
+ [
852
+ "select",
853
+ [["size", "+"]],
854
+ false,
855
+ ["listbox"]
856
+ ],
857
+ [
858
+ "select",
859
+ [["multiple", "+"]],
860
+ false,
861
+ ["listbox"]
862
+ ],
863
+ [
864
+ "img",
865
+ [["alt", "+"]],
866
+ false,
867
+ ["presentation"]
868
+ ],
869
+ [
870
+ "input",
871
+ [["type", "=radio"]],
872
+ false,
873
+ ["radio"]
874
+ ],
875
+ [
876
+ "section",
877
+ [["aria-label", "+"]],
878
+ false,
879
+ ["region"]
880
+ ],
881
+ [
882
+ "section",
883
+ [["aria-labelledby", "+"]],
884
+ false,
885
+ ["region"]
886
+ ],
887
+ [
888
+ "th",
889
+ [["scope", "=row"]],
890
+ false,
891
+ ["rowheader"]
892
+ ],
893
+ [
894
+ "th",
895
+ [["scope", "=rowgroup"]],
896
+ false,
897
+ ["rowheader"]
898
+ ],
899
+ [
900
+ "input",
901
+ [["type", "=range"]],
902
+ false,
903
+ ["slider"]
904
+ ],
905
+ [
906
+ "input",
907
+ [["type", "=number"]],
908
+ false,
909
+ ["spinbutton"]
910
+ ],
911
+ [
912
+ "article",
913
+ [],
914
+ false,
915
+ ["article"]
916
+ ],
917
+ [
918
+ "header",
919
+ [],
920
+ false,
921
+ ["banner"]
922
+ ],
923
+ [
924
+ "blockquote",
925
+ [],
926
+ false,
927
+ ["blockquote"]
928
+ ],
929
+ [
930
+ "button",
931
+ [],
932
+ false,
933
+ ["button"]
934
+ ],
935
+ [
936
+ "caption",
937
+ [],
938
+ false,
939
+ ["caption"]
940
+ ],
941
+ [
942
+ "td",
943
+ [],
944
+ false,
945
+ ["cell"]
946
+ ],
947
+ [
948
+ "code",
949
+ [],
950
+ false,
951
+ ["code"]
952
+ ],
953
+ [
954
+ "th",
955
+ [],
956
+ false,
957
+ ["columnheader"]
958
+ ],
959
+ [
960
+ "aside",
961
+ [],
962
+ false,
963
+ ["complementary"]
964
+ ],
965
+ [
966
+ "footer",
967
+ [],
968
+ false,
969
+ ["contentinfo"]
970
+ ],
971
+ [
972
+ "dd",
973
+ [],
974
+ false,
975
+ ["definition"]
976
+ ],
977
+ [
978
+ "del",
979
+ [],
980
+ false,
981
+ ["deletion"]
982
+ ],
983
+ [
984
+ "dialog",
985
+ [],
986
+ false,
987
+ ["dialog"]
988
+ ],
989
+ [
990
+ "html",
991
+ [],
992
+ false,
993
+ ["document"]
994
+ ],
995
+ [
996
+ "em",
997
+ [],
998
+ false,
999
+ ["emphasis"]
1000
+ ],
1001
+ [
1002
+ "figure",
1003
+ [],
1004
+ false,
1005
+ ["figure"]
1006
+ ],
1007
+ [
1008
+ "a",
1009
+ [],
1010
+ false,
1011
+ ["generic"]
1012
+ ],
1013
+ [
1014
+ "area",
1015
+ [],
1016
+ false,
1017
+ ["generic"]
1018
+ ],
1019
+ [
1020
+ "aside",
1021
+ [],
1022
+ false,
1023
+ ["generic"]
1024
+ ],
1025
+ [
1026
+ "b",
1027
+ [],
1028
+ false,
1029
+ ["generic"]
1030
+ ],
1031
+ [
1032
+ "bdo",
1033
+ [],
1034
+ false,
1035
+ ["generic"]
1036
+ ],
1037
+ [
1038
+ "body",
1039
+ [],
1040
+ false,
1041
+ ["generic"]
1042
+ ],
1043
+ [
1044
+ "data",
1045
+ [],
1046
+ false,
1047
+ ["generic"]
1048
+ ],
1049
+ [
1050
+ "div",
1051
+ [],
1052
+ false,
1053
+ ["generic"]
1054
+ ],
1055
+ [
1056
+ "footer",
1057
+ [],
1058
+ false,
1059
+ ["generic"]
1060
+ ],
1061
+ [
1062
+ "header",
1063
+ [],
1064
+ false,
1065
+ ["generic"]
1066
+ ],
1067
+ [
1068
+ "hgroup",
1069
+ [],
1070
+ false,
1071
+ ["generic"]
1072
+ ],
1073
+ [
1074
+ "i",
1075
+ [],
1076
+ false,
1077
+ ["generic"]
1078
+ ],
1079
+ [
1080
+ "pre",
1081
+ [],
1082
+ false,
1083
+ ["generic"]
1084
+ ],
1085
+ [
1086
+ "q",
1087
+ [],
1088
+ false,
1089
+ ["generic"]
1090
+ ],
1091
+ [
1092
+ "samp",
1093
+ [],
1094
+ false,
1095
+ ["generic"]
1096
+ ],
1097
+ [
1098
+ "section",
1099
+ [],
1100
+ false,
1101
+ ["generic"]
1102
+ ],
1103
+ [
1104
+ "small",
1105
+ [],
1106
+ false,
1107
+ ["generic"]
1108
+ ],
1109
+ [
1110
+ "span",
1111
+ [],
1112
+ false,
1113
+ ["generic"]
1114
+ ],
1115
+ [
1116
+ "u",
1117
+ [],
1118
+ false,
1119
+ ["generic"]
1120
+ ],
1121
+ [
1122
+ "td",
1123
+ [],
1124
+ false,
1125
+ ["gridcell"]
1126
+ ],
1127
+ [
1128
+ "details",
1129
+ [],
1130
+ false,
1131
+ ["group"]
1132
+ ],
1133
+ [
1134
+ "fieldset",
1135
+ [],
1136
+ false,
1137
+ ["group"]
1138
+ ],
1139
+ [
1140
+ "optgroup",
1141
+ [],
1142
+ false,
1143
+ ["group"]
1144
+ ],
1145
+ [
1146
+ "address",
1147
+ [],
1148
+ false,
1149
+ ["group"]
1150
+ ],
1151
+ [
1152
+ "h1",
1153
+ [],
1154
+ false,
1155
+ ["heading"]
1156
+ ],
1157
+ [
1158
+ "h2",
1159
+ [],
1160
+ false,
1161
+ ["heading"]
1162
+ ],
1163
+ [
1164
+ "h3",
1165
+ [],
1166
+ false,
1167
+ ["heading"]
1168
+ ],
1169
+ [
1170
+ "h4",
1171
+ [],
1172
+ false,
1173
+ ["heading"]
1174
+ ],
1175
+ [
1176
+ "h5",
1177
+ [],
1178
+ false,
1179
+ ["heading"]
1180
+ ],
1181
+ [
1182
+ "h6",
1183
+ [],
1184
+ false,
1185
+ ["heading"]
1186
+ ],
1187
+ [
1188
+ "ins",
1189
+ [],
1190
+ false,
1191
+ ["insertion"]
1192
+ ],
1193
+ [
1194
+ "menu",
1195
+ [],
1196
+ false,
1197
+ ["list"]
1198
+ ],
1199
+ [
1200
+ "ol",
1201
+ [],
1202
+ false,
1203
+ ["list"]
1204
+ ],
1205
+ [
1206
+ "ul",
1207
+ [],
1208
+ false,
1209
+ ["list"]
1210
+ ],
1211
+ [
1212
+ "datalist",
1213
+ [],
1214
+ false,
1215
+ ["listbox"]
1216
+ ],
1217
+ [
1218
+ "li",
1219
+ [],
1220
+ false,
1221
+ ["listitem"]
1222
+ ],
1223
+ [
1224
+ "main",
1225
+ [],
1226
+ false,
1227
+ ["main"]
1228
+ ],
1229
+ [
1230
+ "mark",
1231
+ [],
1232
+ false,
1233
+ ["mark"]
1234
+ ],
1235
+ [
1236
+ "math",
1237
+ [],
1238
+ false,
1239
+ ["math"]
1240
+ ],
1241
+ [
1242
+ "meter",
1243
+ [],
1244
+ false,
1245
+ ["meter"]
1246
+ ],
1247
+ [
1248
+ "nav",
1249
+ [],
1250
+ false,
1251
+ ["navigation"]
1252
+ ],
1253
+ [
1254
+ "option",
1255
+ [],
1256
+ false,
1257
+ ["option"]
1258
+ ],
1259
+ [
1260
+ "p",
1261
+ [],
1262
+ false,
1263
+ ["paragraph"]
1264
+ ],
1265
+ [
1266
+ "progress",
1267
+ [],
1268
+ false,
1269
+ ["progressbar"]
1270
+ ],
1271
+ [
1272
+ "tr",
1273
+ [],
1274
+ false,
1275
+ ["row"]
1276
+ ],
1277
+ [
1278
+ "tbody",
1279
+ [],
1280
+ false,
1281
+ ["rowgroup"]
1282
+ ],
1283
+ [
1284
+ "tfoot",
1285
+ [],
1286
+ false,
1287
+ ["rowgroup"]
1288
+ ],
1289
+ [
1290
+ "thead",
1291
+ [],
1292
+ false,
1293
+ ["rowgroup"]
1294
+ ],
1295
+ [
1296
+ "hr",
1297
+ [],
1298
+ false,
1299
+ ["separator"]
1300
+ ],
1301
+ [
1302
+ "output",
1303
+ [],
1304
+ false,
1305
+ ["status"]
1306
+ ],
1307
+ [
1308
+ "strong",
1309
+ [],
1310
+ false,
1311
+ ["strong"]
1312
+ ],
1313
+ [
1314
+ "sub",
1315
+ [],
1316
+ false,
1317
+ ["subscript"]
1318
+ ],
1319
+ [
1320
+ "sup",
1321
+ [],
1322
+ false,
1323
+ ["superscript"]
1324
+ ],
1325
+ [
1326
+ "table",
1327
+ [],
1328
+ false,
1329
+ ["table"]
1330
+ ],
1331
+ [
1332
+ "dfn",
1333
+ [],
1334
+ false,
1335
+ ["term"]
1336
+ ],
1337
+ [
1338
+ "dt",
1339
+ [],
1340
+ false,
1341
+ ["term"]
1342
+ ],
1343
+ [
1344
+ "textarea",
1345
+ [],
1346
+ false,
1347
+ ["textbox"]
1348
+ ],
1349
+ [
1350
+ "time",
1351
+ [],
1352
+ false,
1353
+ ["time"]
1354
+ ]
1355
+ ];
1356
+
1357
+ // src/matchers/aria.ts
1358
+ const HTML_NS = "http://www.w3.org/1999/xhtml";
1359
+ /** Attribute values HTML says selectors compare ASCII case-insensitively (https://html.spec.whatwg.org/#case-sensitivity-of-selectors). */
1360
+ function valueEquals(element, attribute, actual, expected) {
1361
+ if (actual === expected) return true;
1362
+ if ((attribute === "type" || attribute === "scope") && element.namespaceURI === HTML_NS) return actual.toLowerCase() === expected;
1363
+ return false;
1364
+ }
1365
+ function getImplicitAriaRoles(element) {
1366
+ const localName = element.localName;
1367
+ for (let i = 0; i < ELEMENT_ROLES.length; i++) {
1368
+ const [name, attrs, typeText, roles] = ELEMENT_ROLES[i];
1369
+ if (name !== localName) continue;
1370
+ if (typeText && element.type !== "text") continue;
1371
+ let ok = true;
1372
+ for (let j = 0; j < attrs.length && ok; j++) {
1373
+ const [attribute, kind] = attrs[j];
1374
+ const value = element.getAttribute(attribute);
1375
+ if (kind === "-") ok = value === null;
1376
+ else if (kind === "+") ok = value !== null;
1377
+ else ok = value !== null && valueEquals(element, attribute, value, kind.slice(1));
1378
+ }
1379
+ if (ok) return [...roles];
1380
+ }
1381
+ return [];
1382
+ }
1383
+ function getExplicitOrImplicitRoles(htmlElement) {
1384
+ const roleValue = htmlElement.getAttribute("role");
1385
+ if (roleValue !== null) return roleValue.split(" ").filter(Boolean);
1386
+ if (htmlElement[$impl] !== void 0) return getImplicitAriaRolesJestDom(htmlElement);
1387
+ return getImplicitAriaRoles(htmlElement);
1388
+ }
1389
+ function toHaveRole(htmlElement, expectedRole) {
1390
+ checkHtmlElement(htmlElement, toHaveRole, this);
1391
+ const actualRoles = getExplicitOrImplicitRoles(htmlElement);
1392
+ return {
1393
+ pass: actualRoles.some((el) => el === expectedRole),
1394
+ message: () => {
1395
+ const to = this.isNot ? "not to" : "to";
1396
+ return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.${toHaveRole.name}`, "element", ""), `Expected element ${to} have role`, expectedRole, "Received", actualRoles.join(", "));
1397
+ }
1398
+ };
1399
+ }
1400
+ function toHaveAccessibleName(htmlElement, expectedAccessibleName) {
1401
+ checkHtmlElement(htmlElement, toHaveAccessibleName, this);
1402
+ const actualAccessibleName = computeAccessibleName(htmlElement);
1403
+ const missingExpectedValue = arguments.length === 1;
1404
+ let pass = false;
1405
+ if (missingExpectedValue) pass = actualAccessibleName !== "";
1406
+ else pass = expectedAccessibleName instanceof RegExp ? expectedAccessibleName.test(actualAccessibleName) : this.equals(actualAccessibleName, expectedAccessibleName);
1407
+ return {
1408
+ pass,
1409
+ message: () => {
1410
+ const to = this.isNot ? "not to" : "to";
1411
+ return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.${toHaveAccessibleName.name}`, "element", ""), `Expected element ${to} have accessible name`, expectedAccessibleName, "Received", actualAccessibleName);
1412
+ }
1413
+ };
1414
+ }
1415
+ function toHaveAccessibleDescription(htmlElement, expectedAccessibleDescription) {
1416
+ checkHtmlElement(htmlElement, toHaveAccessibleDescription, this);
1417
+ const actualAccessibleDescription = computeAccessibleDescription(htmlElement);
1418
+ const missingExpectedValue = arguments.length === 1;
1419
+ let pass = false;
1420
+ if (missingExpectedValue) pass = actualAccessibleDescription !== "";
1421
+ else pass = expectedAccessibleDescription instanceof RegExp ? expectedAccessibleDescription.test(actualAccessibleDescription) : this.equals(actualAccessibleDescription, expectedAccessibleDescription);
1422
+ return {
1423
+ pass,
1424
+ message: () => {
1425
+ const to = this.isNot ? "not to" : "to";
1426
+ return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.${toHaveAccessibleDescription.name}`, "element", ""), `Expected element ${to} have accessible description`, expectedAccessibleDescription, "Received", actualAccessibleDescription);
1427
+ }
1428
+ };
1429
+ }
1430
+ const ariaInvalidName = "aria-invalid";
1431
+ const validStates = ["false"];
1432
+ function toHaveAccessibleErrorMessage(htmlElement, expectedAccessibleErrorMessage) {
1433
+ checkHtmlElement(htmlElement, toHaveAccessibleErrorMessage, this);
1434
+ const to = this.isNot ? "not to" : "to";
1435
+ const method = this.isNot ? ".not.toHaveAccessibleErrorMessage" : ".toHaveAccessibleErrorMessage";
1436
+ const errormessageId = htmlElement.getAttribute("aria-errormessage");
1437
+ if (!!errormessageId && /\s+/.test(errormessageId)) return {
1438
+ pass: false,
1439
+ message: () => {
1440
+ return getMessage(this, this.utils.matcherHint(method, "element"), "Expected element's `aria-errormessage` attribute to be empty or a single, valid ID", "", "Received", `aria-errormessage="${errormessageId}"`);
1441
+ }
1442
+ };
1443
+ const ariaInvalidVal = htmlElement.getAttribute(ariaInvalidName);
1444
+ if (!htmlElement.hasAttribute(ariaInvalidName) || validStates.includes(ariaInvalidVal)) return {
1445
+ pass: false,
1446
+ message: () => {
1447
+ return getMessage(this, this.utils.matcherHint(method, "element"), "Expected element to be marked as invalid with attribute", `${ariaInvalidName}="${String(true)}"`, "Received", htmlElement.hasAttribute("aria-invalid") ? `${ariaInvalidName}="${htmlElement.getAttribute(ariaInvalidName)}` : null);
1448
+ }
1449
+ };
1450
+ const error = normalize(htmlElement.ownerDocument.getElementById(errormessageId)?.textContent ?? "");
1451
+ return {
1452
+ pass: expectedAccessibleErrorMessage === void 0 ? Boolean(error) : expectedAccessibleErrorMessage instanceof RegExp ? expectedAccessibleErrorMessage.test(error) : this.equals(error, expectedAccessibleErrorMessage),
1453
+ message: () => {
1454
+ return getMessage(this, this.utils.matcherHint(method, "element"), `Expected element ${to} have accessible error message`, expectedAccessibleErrorMessage ?? "", "Received", error);
1455
+ }
1456
+ };
1457
+ }
1458
+ function textOfIdRefs(htmlElement, attribute) {
1459
+ const ids = (htmlElement.getAttribute(attribute) || "").split(/\s+/).filter(Boolean);
1460
+ if (ids.length === 0) return "";
1461
+ const document = htmlElement.ownerDocument;
1462
+ const els = ids.map((id) => document.getElementById(id)).filter(Boolean);
1463
+ return normalize(els.map((el) => el.textContent).join(" "));
1464
+ }
1465
+ function toHaveDescription(htmlElement, checkWith) {
1466
+ deprecate("toHaveDescription", "Please use toHaveAccessibleDescription.");
1467
+ checkHtmlElement(htmlElement, toHaveDescription, this);
1468
+ const expectsDescription = checkWith !== void 0;
1469
+ const description = textOfIdRefs(htmlElement, "aria-describedby");
1470
+ return {
1471
+ pass: expectsDescription ? checkWith instanceof RegExp ? checkWith.test(description) : this.equals(description, checkWith) : Boolean(description),
1472
+ message: () => {
1473
+ const to = this.isNot ? "not to" : "to";
1474
+ return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveDescription`, "element", ""), `Expected the element ${to} have description`, this.utils.printExpected(checkWith), "Received", this.utils.printReceived(description));
1475
+ }
1476
+ };
1477
+ }
1478
+ function toHaveErrorMessage(htmlElement, checkWith) {
1479
+ deprecate("toHaveErrorMessage", "Please use toHaveAccessibleErrorMessage.");
1480
+ checkHtmlElement(htmlElement, toHaveErrorMessage, this);
1481
+ if (!htmlElement.hasAttribute("aria-invalid") || htmlElement.getAttribute("aria-invalid") === "false") {
1482
+ const not = this.isNot ? ".not" : "";
1483
+ return {
1484
+ pass: false,
1485
+ message: () => {
1486
+ return getMessage(this, this.utils.matcherHint(`${not}.toHaveErrorMessage`, "element", ""), `Expected the element to have invalid state indicated by`, "aria-invalid=\"true\"", "Received", htmlElement.hasAttribute("aria-invalid") ? `aria-invalid="${htmlElement.getAttribute("aria-invalid")}"` : this.utils.printReceived(""));
1487
+ }
1488
+ };
1489
+ }
1490
+ const expectsErrorMessage = checkWith !== void 0;
1491
+ const errormessage = textOfIdRefs(htmlElement, "aria-errormessage");
1492
+ return {
1493
+ pass: expectsErrorMessage ? checkWith instanceof RegExp ? checkWith.test(errormessage) : this.equals(errormessage, checkWith) : Boolean(errormessage),
1494
+ message: () => {
1495
+ const to = this.isNot ? "not to" : "to";
1496
+ return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveErrorMessage`, "element", ""), `Expected the element ${to} have error message`, this.utils.printExpected(checkWith), "Received", this.utils.printReceived(errormessage));
1497
+ }
1498
+ };
1499
+ }
1500
+
1501
+ // src/color.ts
1502
+ /** https://drafts.csswg.org/css-color-4/#named-colors — packed 0xRRGGBB. */
1503
+ const NAMED = {
1504
+ aliceblue: 15792383,
1505
+ antiquewhite: 16444375,
1506
+ aqua: 65535,
1507
+ aquamarine: 8388564,
1508
+ azure: 15794175,
1509
+ beige: 16119260,
1510
+ bisque: 16770244,
1511
+ black: 0,
1512
+ blanchedalmond: 16772045,
1513
+ blue: 255,
1514
+ blueviolet: 9055202,
1515
+ brown: 10824234,
1516
+ burlywood: 14596231,
1517
+ cadetblue: 6266528,
1518
+ chartreuse: 8388352,
1519
+ chocolate: 13789470,
1520
+ coral: 16744272,
1521
+ cornflowerblue: 6591981,
1522
+ cornsilk: 16775388,
1523
+ crimson: 14423100,
1524
+ cyan: 65535,
1525
+ darkblue: 139,
1526
+ darkcyan: 35723,
1527
+ darkgoldenrod: 12092939,
1528
+ darkgray: 11119017,
1529
+ darkgreen: 25600,
1530
+ darkgrey: 11119017,
1531
+ darkkhaki: 12433259,
1532
+ darkmagenta: 9109643,
1533
+ darkolivegreen: 5597999,
1534
+ darkorange: 16747520,
1535
+ darkorchid: 10040012,
1536
+ darkred: 9109504,
1537
+ darksalmon: 15308410,
1538
+ darkseagreen: 9419919,
1539
+ darkslateblue: 4734347,
1540
+ darkslategray: 3100495,
1541
+ darkslategrey: 3100495,
1542
+ darkturquoise: 52945,
1543
+ darkviolet: 9699539,
1544
+ deeppink: 16716947,
1545
+ deepskyblue: 49151,
1546
+ dimgray: 6908265,
1547
+ dimgrey: 6908265,
1548
+ dodgerblue: 2003199,
1549
+ firebrick: 11674146,
1550
+ floralwhite: 16775920,
1551
+ forestgreen: 2263842,
1552
+ fuchsia: 16711935,
1553
+ gainsboro: 14474460,
1554
+ ghostwhite: 16316671,
1555
+ gold: 16766720,
1556
+ goldenrod: 14329120,
1557
+ gray: 8421504,
1558
+ green: 32768,
1559
+ greenyellow: 11403055,
1560
+ grey: 8421504,
1561
+ honeydew: 15794160,
1562
+ hotpink: 16738740,
1563
+ indianred: 13458524,
1564
+ indigo: 4915330,
1565
+ ivory: 16777200,
1566
+ khaki: 15787660,
1567
+ lavender: 15132410,
1568
+ lavenderblush: 16773365,
1569
+ lawngreen: 8190976,
1570
+ lemonchiffon: 16775885,
1571
+ lightblue: 11393254,
1572
+ lightcoral: 15761536,
1573
+ lightcyan: 14745599,
1574
+ lightgoldenrodyellow: 16448210,
1575
+ lightgray: 13882323,
1576
+ lightgreen: 9498256,
1577
+ lightgrey: 13882323,
1578
+ lightpink: 16758465,
1579
+ lightsalmon: 16752762,
1580
+ lightseagreen: 2142890,
1581
+ lightskyblue: 8900346,
1582
+ lightslategray: 7833753,
1583
+ lightslategrey: 7833753,
1584
+ lightsteelblue: 11584734,
1585
+ lightyellow: 16777184,
1586
+ lime: 65280,
1587
+ limegreen: 3329330,
1588
+ linen: 16445670,
1589
+ magenta: 16711935,
1590
+ maroon: 8388608,
1591
+ mediumaquamarine: 6737322,
1592
+ mediumblue: 205,
1593
+ mediumorchid: 12211667,
1594
+ mediumpurple: 9662683,
1595
+ mediumseagreen: 3978097,
1596
+ mediumslateblue: 8087790,
1597
+ mediumspringgreen: 64154,
1598
+ mediumturquoise: 4772300,
1599
+ mediumvioletred: 13047173,
1600
+ midnightblue: 1644912,
1601
+ mintcream: 16121850,
1602
+ mistyrose: 16770273,
1603
+ moccasin: 16770229,
1604
+ navajowhite: 16768685,
1605
+ navy: 128,
1606
+ oldlace: 16643558,
1607
+ olive: 8421376,
1608
+ olivedrab: 7048739,
1609
+ orange: 16753920,
1610
+ orangered: 16729344,
1611
+ orchid: 14315734,
1612
+ palegoldenrod: 15657130,
1613
+ palegreen: 10025880,
1614
+ paleturquoise: 11529966,
1615
+ palevioletred: 14381203,
1616
+ papayawhip: 16773077,
1617
+ peachpuff: 16767673,
1618
+ peru: 13468991,
1619
+ pink: 16761035,
1620
+ plum: 14524637,
1621
+ powderblue: 11591910,
1622
+ purple: 8388736,
1623
+ rebeccapurple: 6697881,
1624
+ red: 16711680,
1625
+ rosybrown: 12357519,
1626
+ royalblue: 4286945,
1627
+ saddlebrown: 9127187,
1628
+ salmon: 16416882,
1629
+ sandybrown: 16032864,
1630
+ seagreen: 3050327,
1631
+ seashell: 16774638,
1632
+ sienna: 10506797,
1633
+ silver: 12632256,
1634
+ skyblue: 8900331,
1635
+ slateblue: 6970061,
1636
+ slategray: 7372944,
1637
+ slategrey: 7372944,
1638
+ snow: 16775930,
1639
+ springgreen: 65407,
1640
+ steelblue: 4620980,
1641
+ tan: 13808780,
1642
+ teal: 32896,
1643
+ thistle: 14204888,
1644
+ tomato: 16737095,
1645
+ turquoise: 4251856,
1646
+ violet: 15631086,
1647
+ wheat: 16113331,
1648
+ white: 16777215,
1649
+ whitesmoke: 16119285,
1650
+ yellow: 16776960,
1651
+ yellowgreen: 10145074
1652
+ };
1653
+ const NUM_RE = /^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(%|deg|grad|rad|turn)?$/i;
1654
+ function channel(s, percentScale) {
1655
+ if (s.toLowerCase() === "none") return 0;
1656
+ const m = NUM_RE.exec(s);
1657
+ if (m === null) return null;
1658
+ const v = Number(m[1]);
1659
+ if (m[2] === void 0) return v;
1660
+ return m[2] === "%" ? v / 100 * percentScale : null;
1661
+ }
1662
+ function hue(s) {
1663
+ const m = NUM_RE.exec(s);
1664
+ if (m === null) return s.toLowerCase() === "none" ? 0 : null;
1665
+ const v = Number(m[1]);
1666
+ switch (m[2]?.toLowerCase()) {
1667
+ case void 0:
1668
+ case "deg": return v;
1669
+ case "grad": return v * 360 / 400;
1670
+ case "rad": return v * 180 / Math.PI;
1671
+ case "turn": return v * 360;
1672
+ default: return null;
1673
+ }
1674
+ }
1675
+ /** Arguments of rgb()/hsl(): legacy comma syntax or modern space + "/" syntax. */
1676
+ function args(inner) {
1677
+ const s = inner.trim();
1678
+ if (s.includes(",")) {
1679
+ const parts = s.split(",").map((p) => p.trim());
1680
+ return parts.some((p) => p === "" || /\s/.test(p)) ? null : parts;
1681
+ }
1682
+ const slash = s.indexOf("/");
1683
+ const main = (slash === -1 ? s : s.slice(0, slash)).trim().split(/\s+/);
1684
+ if (slash !== -1) main.push(s.slice(slash + 1).trim());
1685
+ return main;
1686
+ }
1687
+ const clamp = (v, lo, hi) => Math.min(hi, Math.max(lo, v));
1688
+ /** https://drafts.csswg.org/css-color-4/#hsl-to-rgb */
1689
+ function hslToRgb(h, s, l) {
1690
+ h = (h % 360 + 360) % 360;
1691
+ s = clamp(s, 0, 1);
1692
+ l = clamp(l, 0, 1);
1693
+ const f = (n) => {
1694
+ const k = (n + h / 30) % 12;
1695
+ const a = s * Math.min(l, 1 - l);
1696
+ return (l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1))) * 255;
1697
+ };
1698
+ return [
1699
+ f(0),
1700
+ f(8),
1701
+ f(4)
1702
+ ];
1703
+ }
1704
+ function key(r, g, b, a) {
1705
+ return `${Math.round(clamp(r, 0, 255))},${Math.round(clamp(g, 0, 255))},${Math.round(clamp(b, 0, 255))},${Math.round(clamp(a, 0, 1) * 1e3)}`;
1706
+ }
1707
+ /** Canonical "r,g,b,alpha*1000" key for a single color value, or null if `text` is not one. */
1708
+ function canonicalColor(text) {
1709
+ if (typeof text !== "string") return null;
1710
+ const s = text.trim().toLowerCase();
1711
+ if (s === "") return null;
1712
+ if (s === "transparent") return key(0, 0, 0, 0);
1713
+ if (s.charCodeAt(0) === 35) {
1714
+ const hex = s.slice(1);
1715
+ if (!/^[0-9a-f]+$/.test(hex)) return null;
1716
+ const n = hex.length;
1717
+ const d = (i, len) => parseInt(hex.slice(i, i + len), 16) * (len === 1 ? 17 : 1);
1718
+ if (n === 3 || n === 4) return key(d(0, 1), d(1, 1), d(2, 1), n === 4 ? d(3, 1) / 255 : 1);
1719
+ if (n === 6 || n === 8) return key(d(0, 2), d(2, 2), d(4, 2), n === 8 ? d(6, 2) / 255 : 1);
1720
+ return null;
1721
+ }
1722
+ const paren = s.indexOf("(");
1723
+ if (paren === -1) {
1724
+ const packed = NAMED[s];
1725
+ return packed === void 0 ? null : key(packed >> 16, packed >> 8 & 255, packed & 255, 1);
1726
+ }
1727
+ if (!s.endsWith(")")) return null;
1728
+ const name = s.slice(0, paren);
1729
+ const parts = args(s.slice(paren + 1, -1));
1730
+ if (parts === null || parts.length !== 3 && parts.length !== 4) return null;
1731
+ const alpha = parts.length === 4 ? channel(parts[3], 1) : 1;
1732
+ if (alpha === null) return null;
1733
+ if (name === "rgb" || name === "rgba") {
1734
+ const r = channel(parts[0], 255);
1735
+ const g = channel(parts[1], 255);
1736
+ const b = channel(parts[2], 255);
1737
+ return r === null || g === null || b === null ? null : key(r, g, b, alpha);
1738
+ }
1739
+ if (name === "hsl" || name === "hsla") {
1740
+ const h = hue(parts[0]);
1741
+ const sat = channel(parts[1], 1);
1742
+ const light = channel(parts[2], 1);
1743
+ if (h === null || sat === null || light === null) return null;
1744
+ const [r, g, b] = hslToRgb(h, parts[1].endsWith("%") ? sat : sat / 100, parts[2].endsWith("%") ? light : light / 100);
1745
+ return key(r, g, b, alpha);
1746
+ }
1747
+ return null;
1748
+ }
1749
+ /** Whether two style values are the same single color in different serializations. */
1750
+ function sameColor(expected, received) {
1751
+ const a = canonicalColor(expected);
1752
+ return a !== null && a === canonicalColor(received);
1753
+ }
1754
+
1755
+ // src/matchers/style.ts
1756
+ function isStyleVisible(element) {
1757
+ const { getComputedStyle } = element.ownerDocument.defaultView;
1758
+ const { display, visibility, opacity } = getComputedStyle(element);
1759
+ return display !== "none" && visibility !== "hidden" && visibility !== "collapse" && opacity !== "0" && opacity !== 0;
1760
+ }
1761
+ function isAttributeVisible(element, previousElement) {
1762
+ let detailsVisibility;
1763
+ if (previousElement) detailsVisibility = element.nodeName === "DETAILS" && previousElement.nodeName !== "SUMMARY" ? element.hasAttribute("open") : true;
1764
+ else detailsVisibility = element.nodeName === "DETAILS" ? element.hasAttribute("open") : true;
1765
+ return !element.hasAttribute("hidden") && detailsVisibility;
1766
+ }
1767
+ function isElementVisible(element, previousElement) {
1768
+ return isStyleVisible(element) && isAttributeVisible(element, previousElement) && (!element.parentElement || isElementVisible(element.parentElement, element));
1769
+ }
1770
+ function toBeVisible(element) {
1771
+ checkHtmlElement(element, toBeVisible, this);
1772
+ const isInDocument = element.ownerDocument === element.getRootNode({ composed: true });
1773
+ const isVisible = isInDocument && isElementVisible(element);
1774
+ return {
1775
+ pass: isVisible,
1776
+ message: () => {
1777
+ const is = isVisible ? "is" : "is not";
1778
+ return [
1779
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeVisible`, "element", ""),
1780
+ "",
1781
+ `Received element ${is} visible${isInDocument ? "" : " (element is not in the document)"}:`,
1782
+ ` ${this.utils.printReceived(element.cloneNode(false))}`
1783
+ ].join("\n");
1784
+ }
1785
+ };
1786
+ }
1787
+ function getStyleDeclaration(document, css) {
1788
+ const styles = {};
1789
+ const copy = document.createElement("div");
1790
+ for (const property of Object.keys(css)) {
1791
+ copy.style[property] = css[property];
1792
+ styles[property] = copy.style[property];
1793
+ }
1794
+ return styles;
1795
+ }
1796
+ function valueMatches(received, value) {
1797
+ return received === value || sameColor(value, received);
1798
+ }
1799
+ function isSubset(styles, computedStyle) {
1800
+ const entries = Object.entries(styles);
1801
+ if (entries.length === 0) return false;
1802
+ for (const [prop, value] of entries) {
1803
+ const isCustomProperty = prop.startsWith("--");
1804
+ if (valueMatches(computedStyle[prop], value) || valueMatches(computedStyle.getPropertyValue(prop), value)) continue;
1805
+ if (!isCustomProperty) {
1806
+ const lower = prop.toLowerCase();
1807
+ if (valueMatches(computedStyle[lower], value) || valueMatches(computedStyle.getPropertyValue(lower), value)) continue;
1808
+ }
1809
+ return false;
1810
+ }
1811
+ return true;
1812
+ }
1813
+ function printoutStyles(styles) {
1814
+ return Object.keys(styles).sort().map((prop) => `${prop}: ${styles[prop]};`).join("\n");
1815
+ }
1816
+ function expectedDiff(diffFn, expected, computedStyles) {
1817
+ const received = {};
1818
+ for (const prop of Array.from(computedStyles)) if (expected[prop] !== void 0) received[prop] = computedStyles.getPropertyValue(prop);
1819
+ return diffFn(printoutStyles(expected), printoutStyles(received)).replace(`${picoRed("+ Received")}\n`, "");
1820
+ }
1821
+ function toHaveStyle(htmlElement, css) {
1822
+ checkHtmlElement(htmlElement, toHaveStyle, this);
1823
+ const parsedCSS = typeof css === "object" ? css : parseCSS(css, toHaveStyle, this);
1824
+ const { getComputedStyle } = htmlElement.ownerDocument.defaultView;
1825
+ const expected = getStyleDeclaration(htmlElement.ownerDocument, parsedCSS);
1826
+ const received = getComputedStyle(htmlElement);
1827
+ return {
1828
+ pass: isSubset(expected, received),
1829
+ message: () => {
1830
+ const matcher = `${this.isNot ? ".not" : ""}.toHaveStyle`;
1831
+ return [this.utils.matcherHint(matcher, "element", ""), expectedDiff(this.utils.diff, expected, received)].join("\n\n");
1832
+ }
1833
+ };
1834
+ }
1835
+
1836
+ // src/matchers/state.ts
1837
+ const ariaRoles = roles;
1838
+ const ROLES_SUPPORTING_CHECKED = ariaRoles.keys().filter((role) => ariaRoles.get(role)?.props["aria-checked"] !== void 0);
1839
+ function roleSupportsChecked(role) {
1840
+ return role !== null && ROLES_SUPPORTING_CHECKED.includes(role);
1841
+ }
1842
+ function supportedRolesSentence() {
1843
+ return toSentence(ROLES_SUPPORTING_CHECKED.map((role) => `role="${role}"`), { lastWordConnector: " or " });
1844
+ }
1845
+ function toBeChecked(element) {
1846
+ checkHtmlElement(element, toBeChecked, this);
1847
+ const isValidInput = () => {
1848
+ return element.tagName.toLowerCase() === "input" && ["checkbox", "radio"].includes(element.type);
1849
+ };
1850
+ const isValidAriaElement = () => {
1851
+ return roleSupportsChecked(element.getAttribute("role")) && ["true", "false"].includes(element.getAttribute("aria-checked"));
1852
+ };
1853
+ if (!isValidInput() && !isValidAriaElement()) return {
1854
+ pass: false,
1855
+ message: () => `only inputs with type="checkbox" or type="radio" or elements with ${supportedRolesSentence()} and a valid aria-checked attribute can be used with .toBeChecked(). Use .toHaveValue() instead`
1856
+ };
1857
+ const isChecked = () => {
1858
+ if (isValidInput()) return element.checked;
1859
+ return element.getAttribute("aria-checked") === "true";
1860
+ };
1861
+ return {
1862
+ pass: isChecked(),
1863
+ message: () => {
1864
+ const is = isChecked() ? "is" : "is not";
1865
+ return [
1866
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeChecked`, "element", ""),
1867
+ "",
1868
+ `Received element ${is} checked:`,
1869
+ ` ${this.utils.printReceived(element.cloneNode(false))}`
1870
+ ].join("\n");
1871
+ }
1872
+ };
1873
+ }
1874
+ function toBePartiallyChecked(element) {
1875
+ checkHtmlElement(element, toBePartiallyChecked, this);
1876
+ const isValidInput = () => {
1877
+ return element.tagName.toLowerCase() === "input" && element.type === "checkbox";
1878
+ };
1879
+ const isValidAriaElement = () => {
1880
+ return element.getAttribute("role") === "checkbox";
1881
+ };
1882
+ if (!isValidInput() && !isValidAriaElement()) return {
1883
+ pass: false,
1884
+ message: () => "only inputs with type=\"checkbox\" or elements with role=\"checkbox\" and a valid aria-checked attribute can be used with .toBePartiallyChecked(). Use .toHaveValue() instead"
1885
+ };
1886
+ const isPartiallyChecked = () => {
1887
+ const isAriaMixed = element.getAttribute("aria-checked") === "mixed";
1888
+ if (isValidInput()) return element.indeterminate || isAriaMixed;
1889
+ return isAriaMixed;
1890
+ };
1891
+ return {
1892
+ pass: isPartiallyChecked(),
1893
+ message: () => {
1894
+ const is = isPartiallyChecked() ? "is" : "is not";
1895
+ return [
1896
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBePartiallyChecked`, "element", ""),
1897
+ "",
1898
+ `Received element ${is} partially checked:`,
1899
+ ` ${this.utils.printReceived(element.cloneNode(false))}`
1900
+ ].join("\n");
1901
+ }
1902
+ };
1903
+ }
1904
+ function isButtonLike(element) {
1905
+ const roles = (element.getAttribute("role") || "").split(" ").map((role) => role.trim());
1906
+ return element.tagName.toLowerCase() === "button" || element.tagName.toLowerCase() === "input" && element.type === "button" || roles.includes("button");
1907
+ }
1908
+ function toBePressed(element) {
1909
+ checkHtmlElement(element, toBePressed, this);
1910
+ const isButton = isButtonLike(element);
1911
+ const pressedAttribute = element.getAttribute("aria-pressed");
1912
+ if (!isButton || !(pressedAttribute === "true" || pressedAttribute === "false")) return {
1913
+ pass: false,
1914
+ message: () => `Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePressed()`
1915
+ };
1916
+ return {
1917
+ pass: isButton && pressedAttribute === "true",
1918
+ message: () => {
1919
+ const matcher = this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBePressed`, "element", "");
1920
+ return getMessage(this, matcher, `Expected element to have`, `aria-pressed="${this.isNot ? "false" : "true"}"`, `Received`, `aria-pressed="${pressedAttribute}"`);
1921
+ }
1922
+ };
1923
+ }
1924
+ function toBePartiallyPressed(element) {
1925
+ checkHtmlElement(element, toBePartiallyPressed, this);
1926
+ const isButton = isButtonLike(element);
1927
+ const pressedAttribute = element.getAttribute("aria-pressed");
1928
+ if (!isButton || !(pressedAttribute === "true" || pressedAttribute === "false" || pressedAttribute === "mixed")) return {
1929
+ pass: false,
1930
+ message: () => `Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePartiallyPressed()`
1931
+ };
1932
+ return {
1933
+ pass: isButton && pressedAttribute === "mixed",
1934
+ message: () => {
1935
+ const to = this.isNot ? "not to" : "to";
1936
+ const matcher = this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBePartiallyPressed`, "element", "");
1937
+ return getMessage(this, matcher, `Expected element ${to} have`, `aria-pressed="mixed"`, `Received`, `aria-pressed="${pressedAttribute}"`);
1938
+ }
1939
+ };
1940
+ }
1941
+ const DISABLEABLE_FORM_TAGS = [
1942
+ "fieldset",
1943
+ "input",
1944
+ "select",
1945
+ "optgroup",
1946
+ "option",
1947
+ "button",
1948
+ "textarea"
1949
+ ];
1950
+ function isFirstLegendChildOfFieldset(element, parent) {
1951
+ if (getTag(element) !== "legend" || getTag(parent) !== "fieldset") return false;
1952
+ for (let child = parent.firstElementChild; child !== null; child = child.nextElementSibling) if (getTag(child) === "legend") return element.isSameNode(child);
1953
+ return false;
1954
+ }
1955
+ function isElementDisabledByParent(element, parent) {
1956
+ return isElementDisabled(parent) && !isFirstLegendChildOfFieldset(element, parent);
1957
+ }
1958
+ function isCustomElement(tag) {
1959
+ return tag.includes("-");
1960
+ }
1961
+ function canElementBeDisabled(element) {
1962
+ const tag = getTag(element);
1963
+ return DISABLEABLE_FORM_TAGS.includes(tag) || isCustomElement(tag);
1964
+ }
1965
+ function isElementDisabled(element) {
1966
+ return canElementBeDisabled(element) && element.hasAttribute("disabled");
1967
+ }
1968
+ function isAncestorDisabled(element) {
1969
+ const parent = element.parentElement;
1970
+ return Boolean(parent) && (isElementDisabledByParent(element, parent) || isAncestorDisabled(parent));
1971
+ }
1972
+ function isElementOrAncestorDisabled(element) {
1973
+ return canElementBeDisabled(element) && (isElementDisabled(element) || isAncestorDisabled(element));
1974
+ }
1975
+ function toBeDisabled(element) {
1976
+ checkHtmlElement(element, toBeDisabled, this);
1977
+ const isDisabled = isElementOrAncestorDisabled(element);
1978
+ return {
1979
+ pass: isDisabled,
1980
+ message: () => {
1981
+ const is = isDisabled ? "is" : "is not";
1982
+ return [
1983
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeDisabled`, "element", ""),
1984
+ "",
1985
+ `Received element ${is} disabled:`,
1986
+ ` ${this.utils.printReceived(element.cloneNode(false))}`
1987
+ ].join("\n");
1988
+ }
1989
+ };
1990
+ }
1991
+ function toBeEnabled(element) {
1992
+ checkHtmlElement(element, toBeEnabled, this);
1993
+ const isEnabled = !isElementOrAncestorDisabled(element);
1994
+ return {
1995
+ pass: isEnabled,
1996
+ message: () => {
1997
+ const is = isEnabled ? "is" : "is not";
1998
+ return [
1999
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeEnabled`, "element", ""),
2000
+ "",
2001
+ `Received element ${is} enabled:`,
2002
+ ` ${this.utils.printReceived(element.cloneNode(false))}`
2003
+ ].join("\n");
2004
+ }
2005
+ };
2006
+ }
2007
+ const REQUIRED_FORM_TAGS = ["select", "textarea"];
2008
+ const ARIA_FORM_TAGS = [
2009
+ "input",
2010
+ "select",
2011
+ "textarea"
2012
+ ];
2013
+ const UNSUPPORTED_INPUT_TYPES = [
2014
+ "color",
2015
+ "hidden",
2016
+ "range",
2017
+ "submit",
2018
+ "image",
2019
+ "reset"
2020
+ ];
2021
+ const SUPPORTED_ARIA_ROLES = [
2022
+ "checkbox",
2023
+ "combobox",
2024
+ "gridcell",
2025
+ "listbox",
2026
+ "radiogroup",
2027
+ "spinbutton",
2028
+ "textbox",
2029
+ "tree"
2030
+ ];
2031
+ function isRequiredOnFormTagsExceptInput(element) {
2032
+ return REQUIRED_FORM_TAGS.includes(getTag(element)) && element.hasAttribute("required");
2033
+ }
2034
+ function isRequiredOnSupportedInput(element) {
2035
+ return getTag(element) === "input" && element.hasAttribute("required") && (element.hasAttribute("type") && !UNSUPPORTED_INPUT_TYPES.includes(element.getAttribute("type")) || !element.hasAttribute("type"));
2036
+ }
2037
+ function isElementRequiredByARIA(element) {
2038
+ return element.hasAttribute("aria-required") && element.getAttribute("aria-required") === "true" && (ARIA_FORM_TAGS.includes(getTag(element)) || element.hasAttribute("role") && SUPPORTED_ARIA_ROLES.includes(element.getAttribute("role")));
2039
+ }
2040
+ function toBeRequired(element) {
2041
+ checkHtmlElement(element, toBeRequired, this);
2042
+ const isRequired = isRequiredOnFormTagsExceptInput(element) || isRequiredOnSupportedInput(element) || isElementRequiredByARIA(element);
2043
+ return {
2044
+ pass: isRequired,
2045
+ message: () => {
2046
+ const is = isRequired ? "is" : "is not";
2047
+ return [
2048
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeRequired`, "element", ""),
2049
+ "",
2050
+ `Received element ${is} required:`,
2051
+ ` ${this.utils.printReceived(element.cloneNode(false))}`
2052
+ ].join("\n");
2053
+ }
2054
+ };
2055
+ }
2056
+ const VALIDATABLE_TAGS = [
2057
+ "form",
2058
+ "input",
2059
+ "select",
2060
+ "textarea"
2061
+ ];
2062
+ function isElementHavingAriaInvalid(element) {
2063
+ return element.hasAttribute("aria-invalid") && element.getAttribute("aria-invalid") !== "false";
2064
+ }
2065
+ function isElementInvalid(element) {
2066
+ const isHaveAriaInvalid = isElementHavingAriaInvalid(element);
2067
+ if (VALIDATABLE_TAGS.includes(getTag(element))) return isHaveAriaInvalid || !element.checkValidity();
2068
+ return isHaveAriaInvalid;
2069
+ }
2070
+ function toBeInvalid(element) {
2071
+ checkHtmlElement(element, toBeInvalid, this);
2072
+ const isInvalid = isElementInvalid(element);
2073
+ return {
2074
+ pass: isInvalid,
2075
+ message: () => {
2076
+ const is = isInvalid ? "is" : "is not";
2077
+ return [
2078
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeInvalid`, "element", ""),
2079
+ "",
2080
+ `Received element ${is} currently invalid:`,
2081
+ ` ${this.utils.printReceived(element.cloneNode(false))}`
2082
+ ].join("\n");
2083
+ }
2084
+ };
2085
+ }
2086
+ function toBeValid(element) {
2087
+ checkHtmlElement(element, toBeValid, this);
2088
+ const isValid = !isElementInvalid(element);
2089
+ return {
2090
+ pass: isValid,
2091
+ message: () => {
2092
+ const is = isValid ? "is" : "is not";
2093
+ return [
2094
+ this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeValid`, "element", ""),
2095
+ "",
2096
+ `Received element ${is} currently valid:`,
2097
+ ` ${this.utils.printReceived(element.cloneNode(false))}`
2098
+ ].join("\n");
2099
+ }
2100
+ };
2101
+ }
2102
+
2103
+ // src/matchers/aria-snapshot.ts
2104
+ function toMatchAriaSnapshot(container, template) {
2105
+ if (container == null || typeof container !== "object" || container[$impl] === void 0) throw new NodeTypeError(container, toMatchAriaSnapshot, this);
2106
+ if (typeof template !== "string") throw new TypeError(`toMatchAriaSnapshot expects an aria snapshot template string, got ${template === null ? "null" : typeof template}`);
2107
+ let match;
2108
+ try {
2109
+ match = matchAriaSnapshot(container, template);
2110
+ } catch (error) {
2111
+ if (error instanceof AriaTemplateError && Error.captureStackTrace) Error.captureStackTrace(error, toMatchAriaSnapshot);
2112
+ throw error;
2113
+ }
2114
+ const hint = this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toMatchAriaSnapshot`, "element", "template");
2115
+ return {
2116
+ pass: match.pass,
2117
+ message: () => {
2118
+ if (this.isNot) return [
2119
+ hint,
2120
+ "",
2121
+ "Expected the accessibility tree not to match the template:",
2122
+ this.utils.EXPECTED_COLOR(match.expected()),
2123
+ "",
2124
+ "Received:",
2125
+ this.utils.RECEIVED_COLOR(match.received())
2126
+ ].join("\n");
2127
+ const ops = match.diff();
2128
+ let removed = 0;
2129
+ let added = 0;
2130
+ const lines = [];
2131
+ for (let i = 0; i < ops.length; i++) {
2132
+ const op = ops[i];
2133
+ if (op.kind === "-") {
2134
+ removed++;
2135
+ lines.push(this.utils.EXPECTED_COLOR(`- ${op.text}`));
2136
+ } else if (op.kind === "+") {
2137
+ added++;
2138
+ lines.push(this.utils.RECEIVED_COLOR(`+ ${op.text}`));
2139
+ } else lines.push(` ${op.text}`);
2140
+ }
2141
+ return [
2142
+ hint,
2143
+ "",
2144
+ `${this.utils.EXPECTED_COLOR(`- Expected - ${removed}`)} (template)`,
2145
+ `${this.utils.RECEIVED_COLOR(`+ Received + ${added}`)} (closest part of the accessibility tree)`,
2146
+ "",
2147
+ ...lines,
2148
+ "",
2149
+ "Received accessibility tree:",
2150
+ this.utils.RECEIVED_COLOR(match.received())
2151
+ ].join("\n");
2152
+ }
2153
+ };
2154
+ }
2155
+
2156
+ // src/matchers.ts
2157
+ var matchers_exports = /* @__PURE__ */ __exportAll({
2158
+ toAppearAfter: () => toAppearAfter,
2159
+ toAppearBefore: () => toAppearBefore,
2160
+ toBeChecked: () => toBeChecked,
2161
+ toBeDisabled: () => toBeDisabled,
2162
+ toBeEmpty: () => toBeEmpty,
2163
+ toBeEmptyDOMElement: () => toBeEmptyDOMElement,
2164
+ toBeEnabled: () => toBeEnabled,
2165
+ toBeInTheDOM: () => toBeInTheDOM,
2166
+ toBeInTheDocument: () => toBeInTheDocument,
2167
+ toBeInvalid: () => toBeInvalid,
2168
+ toBePartiallyChecked: () => toBePartiallyChecked,
2169
+ toBePartiallyPressed: () => toBePartiallyPressed,
2170
+ toBePressed: () => toBePressed,
2171
+ toBeRequired: () => toBeRequired,
2172
+ toBeValid: () => toBeValid,
2173
+ toBeVisible: () => toBeVisible,
2174
+ toContainAnyByAltText: () => toContainAnyByAltText,
2175
+ toContainAnyByDisplayValue: () => toContainAnyByDisplayValue,
2176
+ toContainAnyByLabelText: () => toContainAnyByLabelText,
2177
+ toContainAnyByPlaceholderText: () => toContainAnyByPlaceholderText,
2178
+ toContainAnyByRole: () => toContainAnyByRole,
2179
+ toContainAnyByTestId: () => toContainAnyByTestId,
2180
+ toContainAnyByText: () => toContainAnyByText,
2181
+ toContainAnyByTitle: () => toContainAnyByTitle,
2182
+ toContainElement: () => toContainElement,
2183
+ toContainHTML: () => toContainHTML,
2184
+ toContainOneByAltText: () => toContainOneByAltText,
2185
+ toContainOneByDisplayValue: () => toContainOneByDisplayValue,
2186
+ toContainOneByLabelText: () => toContainOneByLabelText,
2187
+ toContainOneByPlaceholderText: () => toContainOneByPlaceholderText,
2188
+ toContainOneByRole: () => toContainOneByRole,
2189
+ toContainOneByTestId: () => toContainOneByTestId,
2190
+ toContainOneByText: () => toContainOneByText,
2191
+ toContainOneByTitle: () => toContainOneByTitle,
2192
+ toHaveAccessibleDescription: () => toHaveAccessibleDescription,
2193
+ toHaveAccessibleErrorMessage: () => toHaveAccessibleErrorMessage,
2194
+ toHaveAccessibleName: () => toHaveAccessibleName,
2195
+ toHaveAttribute: () => toHaveAttribute,
2196
+ toHaveClass: () => toHaveClass,
2197
+ toHaveDescription: () => toHaveDescription,
2198
+ toHaveDisplayValue: () => toHaveDisplayValue,
2199
+ toHaveErrorMessage: () => toHaveErrorMessage,
2200
+ toHaveFocus: () => toHaveFocus,
2201
+ toHaveFormValues: () => toHaveFormValues,
2202
+ toHaveRole: () => toHaveRole,
2203
+ toHaveSelection: () => toHaveSelection,
2204
+ toHaveStyle: () => toHaveStyle,
2205
+ toHaveTextContent: () => toHaveTextContent,
2206
+ toHaveValue: () => toHaveValue,
2207
+ toMatchAriaSnapshot: () => toMatchAriaSnapshot
2208
+ });
2209
+ const { toContainAnyByAltText, toContainOneByAltText, toContainAnyByDisplayValue, toContainOneByDisplayValue, toContainAnyByLabelText, toContainOneByLabelText, toContainAnyByPlaceholderText, toContainOneByPlaceholderText, toContainAnyByRole, toContainOneByRole, toContainAnyByTestId, toContainOneByTestId, toContainAnyByText, toContainOneByText, toContainAnyByTitle, toContainOneByTitle } = queryMatchers;
2210
+
2211
+ export { toHaveAccessibleDescription as A, toHaveSelection as B, toBePartiallyChecked as C, toBeValid as D, toBeRequired as E, toHaveRole as F, toBeEmpty as G, toHaveValue as H, toHaveAttribute as I, toBeInTheDocument as J, toBeEmptyDOMElement as K, toHaveClass as L, toHaveAccessibleName as M, toHaveDescription as N, toBeVisible as O, toHaveErrorMessage as P, toHaveDisplayValue as R, toBeInvalid as S, toBePressed as T, toAppearAfter as U, toHaveTextContent as V, toAppearBefore as W, toContainHTML as X, toContainElement as Y, toHaveFocus as Z, toContainOneByTitle as _, toContainAnyByPlaceholderText as a, toBeDisabled as b, toContainAnyByText as c, toContainOneByDisplayValue as d, toContainOneByLabelText as f, toContainOneByText as g, toContainOneByTestId as h, toContainAnyByLabelText as i, toHaveAccessibleErrorMessage as j, toHaveStyle as k, toContainAnyByTitle as l, toContainOneByRole as m, toContainAnyByAltText as n, toContainAnyByRole as o, toContainOneByPlaceholderText as p, toBeInTheDOM as q, toContainAnyByDisplayValue as r, toContainAnyByTestId as s, matchers_exports as t, toContainOneByAltText as u, toMatchAriaSnapshot as v, toBePartiallyPressed as w, toBeEnabled as x, toBeChecked as y, toHaveFormValues as z };