@ctrl/dom 0.1.14 → 0.2.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 (87) hide show
  1. package/README.md +44 -0
  2. package/dist/aria/_chunks/{roles-list--7uYUGyR.cjs → roles-list-C57tqF4n.cjs} +2 -2
  3. package/dist/aria/_chunks/roles-list-DEwbBc_c.js +4 -0
  4. package/dist/aria/index.cjs +1 -1
  5. package/dist/aria/index.js +1 -1
  6. package/dist/aria/internal.cjs +1 -1
  7. package/dist/aria/internal.js +1 -1
  8. package/dist/aria/types/forms.d.ts +6 -13
  9. package/dist/bridge/internal.js +1 -1
  10. package/dist/dom/_chunks/src-CaVKwScX.js +49 -0
  11. package/dist/dom/index.js +1 -1
  12. package/dist/dom/internal.js +1 -1
  13. package/dist/dom/types/collections/HTMLCollection.d.ts +2 -5
  14. package/dist/dom/types/css/cascade.d.ts +10 -3
  15. package/dist/dom/types/css/cssom.d.ts +9 -3
  16. package/dist/dom/types/css/parser.d.ts +27 -0
  17. package/dist/dom/types/css/style-deps.d.ts +11 -0
  18. package/dist/dom/types/events/Event.d.ts +16 -3
  19. package/dist/dom/types/events/EventTarget.d.ts +3 -3
  20. package/dist/dom/types/events/UIEvents.d.ts +10 -1
  21. package/dist/dom/types/events/activation.d.ts +2 -0
  22. package/dist/dom/types/events/dispatch.d.ts +1 -6
  23. package/dist/dom/types/events/listeners.d.ts +58 -18
  24. package/dist/dom/types/html/elements.d.ts +3 -2
  25. package/dist/dom/types/html/forms/HTMLButtonElement.d.ts +4 -3
  26. package/dist/dom/types/html/forms/HTMLFieldSetElement.d.ts +3 -2
  27. package/dist/dom/types/html/forms/HTMLInputElement.d.ts +11 -39
  28. package/dist/dom/types/html/forms/HTMLOutputElement.d.ts +6 -5
  29. package/dist/dom/types/html/forms/HTMLSelectElement.d.ts +6 -9
  30. package/dist/dom/types/html/forms/HTMLTextAreaElement.d.ts +10 -19
  31. package/dist/dom/types/html/forms/control-state.d.ts +33 -0
  32. package/dist/dom/types/html/forms/face.d.ts +3 -2
  33. package/dist/dom/types/html/forms/form-associated.d.ts +29 -9
  34. package/dist/dom/types/html/forms/user-validity.d.ts +7 -8
  35. package/dist/dom/types/html/forms/validation.d.ts +2 -2
  36. package/dist/dom/types/html/reflect.d.ts +1 -0
  37. package/dist/dom/types/internal.d.ts +4 -3
  38. package/dist/dom/types/keys.d.ts +10 -17
  39. package/dist/dom/types/nodes/Document.d.ts +6 -2
  40. package/dist/dom/types/nodes/Element.d.ts +1 -7
  41. package/dist/dom/types/nodes/Node.d.ts +4 -1
  42. package/dist/dom/types/nodes/attributes.d.ts +24 -2
  43. package/dist/dom/types/nodes/cache.d.ts +1 -1
  44. package/dist/dom/types/nodes/constants.d.ts +5 -0
  45. package/dist/dom/types/nodes/tree.d.ts +3 -3
  46. package/dist/dom/types/selectors/compile.d.ts +8 -0
  47. package/dist/dom/types/selectors/internal.d.ts +3 -1
  48. package/dist/dom/types/window/clock.d.ts +30 -0
  49. package/dist/dom/types/window/file-reset.d.ts +22 -0
  50. package/dist/jest-dom/_chunks/{matchers-CkxM783o.cjs → matchers-CZ6Smfw9.cjs} +2 -2
  51. package/dist/jest-dom/_chunks/{matchers-Dt7W4g5X.js → matchers-CwGF61j-.js} +2 -2
  52. package/dist/jest-dom/index.cjs +1 -1
  53. package/dist/jest-dom/index.js +1 -1
  54. package/dist/jest-dom/jest-globals.cjs +1 -1
  55. package/dist/jest-dom/jest-globals.js +1 -1
  56. package/dist/jest-dom/matchers.cjs +1 -1
  57. package/dist/jest-dom/matchers.js +1 -1
  58. package/dist/jest-dom/vitest.cjs +1 -1
  59. package/dist/jest-dom/vitest.js +1 -1
  60. package/dist/react/_chunks/pure-CYb0HgYU.js +1 -0
  61. package/dist/react/_chunks/pure-DRugbA0j.cjs +1 -0
  62. package/dist/react/index.cjs +1 -1
  63. package/dist/react/index.js +1 -1
  64. package/dist/react/pure.cjs +1 -1
  65. package/dist/react/pure.js +1 -1
  66. package/dist/testing-library/index.cjs +2 -2
  67. package/dist/testing-library/index.js +7 -7
  68. package/dist/user-event/index.cjs +15 -15
  69. package/dist/user-event/index.js +15 -15
  70. package/dist/user-event/types/ctrl-dom.d.ts +8 -0
  71. package/dist/vitest-environment/_chunks/rolldown-runtime-H3fMLYWS.js +1 -0
  72. package/dist/vitest-environment/failure-snapshot.js +1 -1
  73. package/dist/vitest-environment/index.js +1 -1
  74. package/dist/vitest-environment/jsx-dev-runtime.js +1 -0
  75. package/dist/vitest-environment/jsx-runtime.js +1 -0
  76. package/dist/vitest-environment/plugin.js +1 -1
  77. package/dist/vitest-environment/shared-workers.js +1 -0
  78. package/dist/vitest-environment/types/jsx-dev-runtime.d.ts +3 -0
  79. package/dist/vitest-environment/types/jsx-runtime.d.ts +4 -0
  80. package/dist/vitest-environment/types/plugin.d.ts +19 -0
  81. package/dist/vitest-environment/types/shared-workers.d.ts +1 -0
  82. package/package.json +13 -1
  83. package/dist/aria/_chunks/roles-list-b_Z0ZWwY.js +0 -4
  84. package/dist/dom/_chunks/src-BacPsCQO.js +0 -49
  85. package/dist/react/_chunks/pure-D7Z4g4oF.js +0 -1
  86. package/dist/react/_chunks/pure-DOgNQrwu.cjs +0 -1
  87. package/dist/vitest-environment/_chunks/rolldown-runtime-BhWHdk3m.js +0 -1
@@ -0,0 +1,22 @@
1
+ import type { Window } from "./Window.js";
2
+ /**
3
+ * What a testing library does around tests, for a runner hook to call. A library registers these
4
+ * when it is loaded, under the conditions it would register the runner's own hooks; loaded once
5
+ * for a worker's files, its own registration reaches only the first.
6
+ */
7
+ export interface TestLibraryHooks {
8
+ /** A test file ended with the window going on: unmount what is still mounted. */
9
+ fileEnd?: () => void;
10
+ afterEach?: () => void;
11
+ beforeAll?: () => void;
12
+ afterAll?: () => void;
13
+ }
14
+ /**
15
+ * Testing library `name`'s hooks, added to the ones it registered before. A fresh instance of the
16
+ * library (after a module reset) replaces the previous one's.
17
+ */
18
+ export declare function registerTestHooks(name: string, hooks: TestLibraryHooks): void;
19
+ /** The hooks registered for the current window, by library. */
20
+ export declare function testHooks(): TestLibraryHooks[];
21
+ /** A test file is about to start in `window`, which other files have used or will use. */
22
+ export declare function resetWindowBetweenFiles(window: Window): void;
@@ -1,7 +1,7 @@
1
1
  var e=Object.defineProperty,__name=(t,n)=>e(t,`name`,{value:n,configurable:!0}),__exportAll=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};let t=require("@ctrl/dom/testing-library"),n=require("node:module"),r=require("@ctrl/dom/aria"),i=require("@ctrl/dom/internal"),a=require("@ctrl/dom/testing-library/agent");var GenericTypeError=class extends Error{constructor(e,t,n,r){super(),Error.captureStackTrace&&Error.captureStackTrace(this,n);let i=``;try{i=r.utils.printWithType(`Received`,t,r.utils.printReceived)}catch{}this.message=[r.utils.matcherHint(`${r.isNot?`.not`:``}.${n.name}`,`received`,``),``,`${r.utils.RECEIVED_COLOR(`received`)} value must ${e}.`,i].join(`
2
2
  `)}},HtmlElementTypeError=class extends GenericTypeError{constructor(e,t,n){super(`be an HTMLElement or an SVGElement`,e,t,n)}},NodeTypeError=class extends GenericTypeError{constructor(e,t,n){super(`be a Node`,e,t,n)}};function checkHasWindow(e,t,n,r){if(!e||!e.ownerDocument||!e.ownerDocument.defaultView)throw new t(e,n,r)}function checkNode(e,t,n){if(checkHasWindow(e,NodeTypeError,t,n),!(e instanceof e.ownerDocument.defaultView.Node))throw new NodeTypeError(e,t,n)}function checkHtmlElement(e,t,n){checkHasWindow(e,HtmlElementTypeError,t,n);let r=e.ownerDocument.defaultView;if(!(e instanceof r.HTMLElement)&&!(e instanceof r.SVGElement))throw new HtmlElementTypeError(e,t,n)}var InvalidCSSError=class extends Error{constructor(e,t,n){super(),Error.captureStackTrace&&Error.captureStackTrace(this,t),this.message=[e.message,``,n.utils.RECEIVED_COLOR(`Failing css:`),n.utils.RECEIVED_COLOR(`${e.css}`)].join(`
3
3
  `)}};let o=null;function parseCSS(e,t,r){o??=(0,n.createRequire)(require("url").pathToFileURL(__filename).href)(`@adobe/css-tools`).parse;let i=o(`selector { ${e} }`,{silent:!0}).stylesheet;if(i.parsingErrors&&i.parsingErrors.length>0){let{reason:n,line:a}=i.parsingErrors[0];throw new InvalidCSSError({css:e,message:`Syntax error parsing expected css: ${n} on line: ${a}`},t,r)}let a={},s=i.rules[0].declarations;for(let e=0;e<s.length;e++){let t=s[e];t.type===`declaration`&&(a[t.property]=t.value)}return a}function display(e,t){return typeof t==`string`?t:e.utils.stringify(t)}function getMessage(e,t,n,r,i,a){return[`${t}\n`,`${n}:\n${e.utils.EXPECTED_COLOR(redent(display(e,r),2))}`,`${i}:\n${e.utils.RECEIVED_COLOR(redent(display(e,a),2))}`].join(`
4
- `)}function matches(e,t){return t instanceof RegExp?t.test(e):e.includes(String(t))}function deprecate(e,t){console.warn(`Warning: ${e} has been deprecated and will be removed in future updates.`,t)}function normalize(e){return e.replace(/\s+/g,` `).trim()}function getTag(e){return e.tagName&&e.tagName.toLowerCase()}function getSelectValue({multiple:e,options:t}){let n=[];for(let e=0;e<t.length;e++)t[e].selected&&n.push(t[e]);if(e)return n.map(e=>e.value);if(n.length!==0)return n[0].value}function getInputValue(e){switch(e.type){case`number`:return e.value===``?null:Number(e.value);case`checkbox`:return e.checked;default:return e.value}}const s=[`meter`,`progressbar`,`slider`,`spinbutton`];function getAccessibleValue(e){if(s.includes(e.getAttribute(`role`)))return Number(e.getAttribute(`aria-valuenow`))}function getSingleElementValue(e){if(e)switch(e.tagName.toLowerCase()){case`input`:return getInputValue(e);case`select`:return getSelectValue(e);default:return e.value??getAccessibleValue(e)}}function toSentence(e,{wordConnector:t=`, `,lastWordConnector:n=` and `}={}){return[e.slice(0,-1).join(t),e[e.length-1]].join(e.length>1?n:``)}function compareAsSet(e,t){if(Array.isArray(e)&&Array.isArray(t)){let n=new Set(t);return[...new Set(e)].every(e=>n.has(e))}return e===t}function redent(e,t){let n=e.match(/^[ \t]*(?=\S)/gm),r=0;n&&(r=n.reduce((e,t)=>Math.min(e,t.length),1/0));let i=r>0?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e;return t===0?i:i.replace(/^(?!\s*$)/gm,` `.repeat(t))}function cssEscape(e){let t=String(e),n=t.length,r=-1,i=``,a=t.charCodeAt(0);for(;++r<n;){let e=t.charCodeAt(r);i+=e===0?`�`:e>=1&&e<=31||e===127||r===0&&e>=48&&e<=57||r===1&&e>=48&&e<=57&&a===45?`\\`+e.toString(16)+` `:r===0&&n===1&&e===45?`\\`+t.charAt(r):e>=128||e===45||e===95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?t.charAt(r):`\\`+t.charAt(r)}return i}const c=process.env,l=process.argv,u=!(c.NO_COLOR||l.includes(`--no-color`))&&(!!c.FORCE_COLOR||l.includes(`--color`)||process.platform===`win32`||process.stdout?.isTTY&&c.TERM!==`dumb`||!!c.CI);function picoRed(e){if(!u)return String(e);let t=`\x1B[31m`,n=`\x1B[39m`,r=``+e,i=r.indexOf(n,5);if(i===-1)return t+r+n;let a=``,o=0;do a+=r.substring(o,i)+t,o=i+5,i=r.indexOf(n,o);while(i!==-1);return t+a+r.substring(o)+n}const p=[`alt text`,`display value`,`label text`,`placeholder text`,`role`,`test ID`,`text`,`title`];function toPascalCase(e){return e.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(``)}function createQueryMatcher(e,n){let r=toPascalCase(n),i=`toContain${e}By${r}`,a=t.queries[`queryAllBy${r}`];function queryMatcher(r,...o){checkHtmlElement(r,queryMatcher,this);let s=a(r,...o);return{message:()=>{let r=this.isNot?`not to`:`to`,a=this.utils.matcherHint(`${this.isNot?`.not`:``}.${i}`,`element`,n,{secondArgument:o[1]===void 0?void 0:this.utils.printExpected(o[1])}),c=[getMessage(this,a,`Expected element ${r} contain ${e.toLowerCase()} descendant by ${n}`,o[0],`Received`,s.length)],l=s.map(e=>(0,t.prettyDOM)(e)).filter(e=>typeof e==`string`);return l.length&&c.push(`Here are the matching elements:`,...l),c.join(`
4
+ `)}function matches(e,t){return t instanceof RegExp?t.test(e):e.includes(String(t))}function deprecate(e,t){console.warn(`Warning: ${e} has been deprecated and will be removed in future updates.`,t)}function normalize(e){return e.replace(/\s+/g,` `).trim()}function getTag(e){return e.tagName&&e.tagName.toLowerCase()}function getSelectValue({multiple:e,options:t}){let n=[];for(let e=0;e<t.length;e++)t[e].selected&&n.push(t[e]);if(e)return n.map(e=>e.value);if(n.length!==0)return n[0].value}function getInputValue(e){switch(e.type){case`number`:return e.value===``?null:Number(e.value);case`checkbox`:return e.checked;default:return e.value}}const s=[`meter`,`progressbar`,`slider`,`spinbutton`];function getAccessibleValue(e){if(s.includes(e.getAttribute(`role`)))return Number(e.getAttribute(`aria-valuenow`))}function getSingleElementValue(e){if(e)switch(e.tagName.toLowerCase()){case`input`:return getInputValue(e);case`select`:return getSelectValue(e);default:return e.value??getAccessibleValue(e)}}function toSentence(e,{wordConnector:t=`, `,lastWordConnector:n=` and `}={}){return[e.slice(0,-1).join(t),e[e.length-1]].join(e.length>1?n:``)}function compareAsSet(e,t){if(Array.isArray(e)&&Array.isArray(t)){let n=new Set(t);return[...new Set(e)].every(e=>n.has(e))}return e===t}function redent(e,t){let n=e.match(/^[ \t]*(?=\S)/gm),r=0;n&&(r=n.reduce((e,t)=>Math.min(e,t.length),1/0));let i=r>0?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e;return t===0?i:i.replace(/^(?!\s*$)/gm,` `.repeat(t))}const c=process.env,l=process.argv,u=!(c.NO_COLOR||l.includes(`--no-color`))&&(!!c.FORCE_COLOR||l.includes(`--color`)||process.platform===`win32`||process.stdout?.isTTY&&c.TERM!==`dumb`||!!c.CI);function picoRed(e){if(!u)return String(e);let t=`\x1B[31m`,n=`\x1B[39m`,r=``+e,i=r.indexOf(n,5);if(i===-1)return t+r+n;let a=``,o=0;do a+=r.substring(o,i)+t,o=i+5,i=r.indexOf(n,o);while(i!==-1);return t+a+r.substring(o)+n}const p=[`alt text`,`display value`,`label text`,`placeholder text`,`role`,`test ID`,`text`,`title`];function toPascalCase(e){return e.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(``)}function createQueryMatcher(e,n){let r=toPascalCase(n),i=`toContain${e}By${r}`,a=t.queries[`queryAllBy${r}`];function queryMatcher(r,...o){checkHtmlElement(r,queryMatcher,this);let s=a(r,...o);return{message:()=>{let r=this.isNot?`not to`:`to`,a=this.utils.matcherHint(`${this.isNot?`.not`:``}.${i}`,`element`,n,{secondArgument:o[1]===void 0?void 0:this.utils.printExpected(o[1])}),c=[getMessage(this,a,`Expected element ${r} contain ${e.toLowerCase()} descendant by ${n}`,o[0],`Received`,s.length)],l=s.map(e=>(0,t.prettyDOM)(e)).filter(e=>typeof e==`string`);return l.length&&c.push(`Here are the matching elements:`,...l),c.join(`
5
5
 
6
6
  `)},pass:e===`One`?s.length===1:s.length>0}}return Object.defineProperty(queryMatcher,"name",{value:i}),queryMatcher}const m={};for(let e of p){let t=createQueryMatcher(`Any`,e),n=createQueryMatcher(`One`,e);m[t.name]=t,m[n.name]=n}function toBeInTheDocument(e){e===null&&this.isNot||checkHtmlElement(e,toBeInTheDocument,this);let t=e!==null&&e.ownerDocument===e.getRootNode({composed:!0}),errorFound=()=>`expected document not to contain element, found ${this.utils.stringify(e.cloneNode(!0))} instead`,errorNotFound=()=>`element could not be found in the document`;return{pass:t,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInTheDocument`,`element`,``),``,this.utils.RECEIVED_COLOR(this.isNot?errorFound():errorNotFound())].join(`
7
7
  `)}}function toBeInTheDOM(e,t){return deprecate(`toBeInTheDOM`,`Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container.`),e&&checkHtmlElement(e,toBeInTheDOM,this),t&&checkHtmlElement(t,toBeInTheDOM,this),{pass:t?t.contains(e):!!e,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInTheDOM`,`element`,``),``,`Received:`,` ${this.utils.printReceived(e&&e.cloneNode(!1))}`].join(`
@@ -13,7 +13,7 @@ var e=Object.defineProperty,__name=(t,n)=>e(t,`name`,{value:n,configurable:!0}),
13
13
  `)}}function toHaveFocus(e){return checkHtmlElement(e,toHaveFocus,this),{pass:e.ownerDocument.activeElement===e,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveFocus`,`element`,``),``,...this.isNot?[`Received element is focused:`,` ${this.utils.printReceived(e)}`]:[`Expected element with focus:`,` ${this.utils.printExpected(e)}`,`Received element with focus:`,` ${this.utils.printReceived(e.ownerDocument.activeElement)}`]].join(`
14
14
  `)}}const h={1:`Node.DOCUMENT_POSITION_DISCONNECTED`,2:`Node.DOCUMENT_POSITION_PRECEDING`,4:`Node.DOCUMENT_POSITION_FOLLOWING`,8:`Node.DOCUMENT_POSITION_CONTAINS`,16:`Node.DOCUMENT_POSITION_CONTAINED_BY`,32:`Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC`};function makeDocumentPositionErrorString(e){return e in h?`${h[e]} (${e})`:`Unknown document position (${e})`}function checkToAppear(e,t,n,r,i){checkHtmlElement(r,toAppearBefore,e),checkHtmlElement(i,toAppearBefore,e);let a=r.compareDocumentPosition(i);return{pass:a===n,message:()=>[e.utils.matcherHint(`${e.isNot?`.not`:``}.${t}`,`element`,`secondElement`),``,`Received: ${makeDocumentPositionErrorString(a)}`].join(`
15
15
  `)}}function toAppearBefore(e,t){return checkToAppear(this,`toAppearBefore`,4,e,t)}function toAppearAfter(e,t){return checkToAppear(this,`toAppearAfter`,2,e,t)}function toHaveTextContent(e,t,n={normalizeWhitespace:!0}){checkNode(e,toHaveTextContent,this);let r=n.normalizeWhitespace?normalize(e.textContent):e.textContent.replace(/ /g,` `),i=r!==``&&t===``;return{pass:!i&&matches(r,t),message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveTextContent`,`element`,``),i?`Checking with empty string will always match, use .toBeEmptyDOMElement() instead`:`Expected element ${e} have text content`,t,`Received`,r)}}}function printAttribute(e,t,n){return n===void 0?t:`${t}=${e(n)}`}function getAttributeComment(e,t,n){return n===void 0?`element.hasAttribute(${e(t)})`:`element.getAttribute(${e(t)}) === ${e(n)}`}function toHaveAttribute(e,t,n){checkHtmlElement(e,toHaveAttribute,this);let r=n!==void 0,i=e.hasAttribute(t),a=e.getAttribute(t);return{pass:r?i&&this.equals(a,n):i,message:()=>{let e=this.isNot?`not to`:`to`,o=i?printAttribute(this.utils.stringify,t,a):null,s=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveAttribute`,`element`,this.utils.printExpected(t),{secondArgument:r?this.utils.printExpected(n):void 0,comment:getAttributeComment(this.utils.stringify,t,n)});return getMessage(this,s,`Expected the element ${e} have attribute`,printAttribute(this.utils.stringify,t,n),`Received`,o)}}}function getExpectedClassNamesAndOptions(e){let t=e.pop(),n,r;return typeof t==`object`&&!(t instanceof RegExp)?(n=e,r=t):(n=e.concat(t),r={exact:!1}),{expectedClassNames:n,options:r}}function splitClassNames(e){return e?e.split(/\s+/).filter(e=>e.length>0):[]}function isSubset$1(e,t){return e.every(e=>typeof e==`string`?t.includes(e):t.some(t=>e.test(t)))}__name(isSubset$1,`isSubset`);function toHaveClass(e,...t){checkHtmlElement(e,toHaveClass,this);let{expectedClassNames:n,options:r}=getExpectedClassNamesAndOptions(t),i=splitClassNames(e.getAttribute(`class`)),a=n.reduce((e,t)=>e.concat(typeof t==`string`||!t?splitClassNames(t):t),[]),o=a.some(e=>e instanceof RegExp);if(r.exact&&o)throw Error(`Exact option does not support RegExp expected class names`);return r.exact?{pass:isSubset$1(a,i)&&a.length===i.length,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveClass`,`element`,this.utils.printExpected(a.join(` `))),`Expected the element ${e} have EXACTLY defined classes`,a.join(` `),`Received`,i.join(` `))}}:a.length>0?{pass:isSubset$1(a,i),message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveClass`,`element`,this.utils.printExpected(a.join(` `))),`Expected the element ${e} have class`,a.join(` `),`Received`,i.join(` `))}}:{pass:this.isNot?i.length>0:!1,message:()=>this.isNot?getMessage(this,this.utils.matcherHint(`.not.toHaveClass`,`element`,``),`Expected the element to have classes`,`(none)`,`Received`,i.join(` `)):[this.utils.matcherHint(`.toHaveClass`,`element`),`At least one expected class must be provided.`].join(`
16
- `)}}function toHaveValue(e,t){if(checkHtmlElement(e,toHaveValue,this),e.tagName.toLowerCase()===`input`&&[`checkbox`,`radio`].includes(e.type))throw Error(`input with type=checkbox or type=radio cannot be used with .toHaveValue(). Use .toBeChecked() for type=checkbox or .toHaveFormValues() instead`);let n=getSingleElementValue(e),r=t!==void 0,i=t,a=n;return t==n&&t!==n&&(i=`${t} (${typeof t})`,a=`${n} (${typeof n})`),{pass:r?compareAsSet(n,t):!!n,message:()=>{let e=this.isNot?`not to`:`to`,n=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveValue`,`element`,t);return getMessage(this,n,`Expected the element ${e} have value`,r?i:`(any)`,`Received`,a)}}}function getValues(e,t){if(e!==`select`)return[t.value];let n=[],r=t.options;for(let e=0;e<r.length;e++){let t=r[e];t.selected&&n.push(t.textContent)}return n}function toHaveDisplayValue(e,t){checkHtmlElement(e,toHaveDisplayValue,this);let n=e.tagName.toLowerCase();if(![`select`,`input`,`textarea`].includes(n))throw Error(`.toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.`);if(n===`input`&&[`radio`,`checkbox`].includes(e.type))throw Error(`.toHaveDisplayValue() currently does not support input[type="${e.type}"], try with another matcher instead.`);let r=getValues(n,e),i=t instanceof Array?t:[t],a=i.filter(e=>r.some(t=>e instanceof RegExp?e.test(t):this.equals(t,String(e)))).length,o=a===r.length,s=a===i.length;return{pass:o&&s,message:()=>getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDisplayValue`,`element`,``),`Expected element ${this.isNot?`not `:``}to have display value`,t,`Received`,r)}}function getMultiElementValue(e){let t=[...new Set(e.map(e=>e.type))];if(t.length!==1)throw Error(`Multiple form elements with the same name must be of the same type`);switch(t[0]){case`radio`:{let t=e.find(e=>e.checked);return t?t.value:void 0}case`checkbox`:return e.filter(e=>e.checked).map(e=>e.value);default:return e.map(e=>e.value)}}function getFormValue(e,t){let n=[...e.querySelectorAll(`[name="${cssEscape(t)}"]`)];if(n.length!==0)switch(n.length){case 1:return getSingleElementValue(n[0]);default:return getMultiElementValue(n)}}function getPureName(e){return e.endsWith(`[]`)?e.slice(0,-2):e}function getAllFormValues(e){let t={};for(let n of Array.from(e.elements)){let r=n.name;t[getPureName(r)]=getFormValue(e,r)}return t}function toHaveFormValues(e,t){if(checkHtmlElement(e,toHaveFormValues,this),!e.elements)throw Error(`toHaveFormValues must be called on a form or a fieldset`);let n=getAllFormValues(e);return{pass:Object.entries(t).every(([e,t])=>compareAsSet(n[e],t)),message:()=>{let e=this.isNot?`not to`:`to`,r=`${this.isNot?`.not`:``}.toHaveFormValues`,i={};for(let e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=n[e]);return[this.utils.matcherHint(r,`element`,``),`Expected the element ${e} have form values`,this.utils.diff(t,i)].join(`
16
+ `)}}function toHaveValue(e,t){if(checkHtmlElement(e,toHaveValue,this),e.tagName.toLowerCase()===`input`&&[`checkbox`,`radio`].includes(e.type))throw Error(`input with type=checkbox or type=radio cannot be used with .toHaveValue(). Use .toBeChecked() for type=checkbox or .toHaveFormValues() instead`);let n=getSingleElementValue(e),r=t!==void 0,i=t,a=n;return t==n&&t!==n&&(i=`${t} (${typeof t})`,a=`${n} (${typeof n})`),{pass:r?compareAsSet(n,t):!!n,message:()=>{let e=this.isNot?`not to`:`to`,n=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveValue`,`element`,t);return getMessage(this,n,`Expected the element ${e} have value`,r?i:`(any)`,`Received`,a)}}}function getValues(e,t){if(e!==`select`)return[t.value];let n=[],r=t.options;for(let e=0;e<r.length;e++){let t=r[e];t.selected&&n.push(t.textContent)}return n}function toHaveDisplayValue(e,t){checkHtmlElement(e,toHaveDisplayValue,this);let n=e.tagName.toLowerCase();if(![`select`,`input`,`textarea`].includes(n))throw Error(`.toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.`);if(n===`input`&&[`radio`,`checkbox`].includes(e.type))throw Error(`.toHaveDisplayValue() currently does not support input[type="${e.type}"], try with another matcher instead.`);let r=getValues(n,e),i=t instanceof Array?t:[t],a=i.filter(e=>r.some(t=>e instanceof RegExp?e.test(t):this.equals(t,String(e)))).length,o=a===r.length,s=a===i.length;return{pass:o&&s,message:()=>getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDisplayValue`,`element`,``),`Expected element ${this.isNot?`not `:``}to have display value`,t,`Received`,r)}}function getMultiElementValue(e){let t=[...new Set(e.map(e=>e.type))];if(t.length!==1)throw Error(`Multiple form elements with the same name must be of the same type`);switch(t[0]){case`radio`:{let t=e.find(e=>e.checked);return t?t.value:void 0}case`checkbox`:return e.filter(e=>e.checked).map(e=>e.value);default:return e.map(e=>e.value)}}function getFormValue(e){if(e!==void 0)switch(e.length){case 1:return getSingleElementValue(e[0]);default:return getMultiElementValue(e)}}function getPureName(e){return e.endsWith(`[]`)?e.slice(0,-2):e}function getAllFormValues(e){let t=/* @__PURE__ */ new Map;for(let n of e.querySelectorAll(`[name]`)){let e=n.getAttribute(`name`),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}let n={};for(let r of Array.from(e.elements)){let e=r.name;n[getPureName(e)]=getFormValue(t.get(e))}return n}function toHaveFormValues(e,t){if(checkHtmlElement(e,toHaveFormValues,this),!e.elements)throw Error(`toHaveFormValues must be called on a form or a fieldset`);let n=getAllFormValues(e);return{pass:Object.entries(t).every(([e,t])=>compareAsSet(n[e],t)),message:()=>{let e=this.isNot?`not to`:`to`,r=`${this.isNot?`.not`:``}.toHaveFormValues`,i={};for(let e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=n[e]);return[this.utils.matcherHint(r,`element`,``),`Expected the element ${e} have form values`,this.utils.diff(t,i)].join(`
17
17
 
18
18
  `)}}}function getSelection(e){let t=e.ownerDocument.getSelection();if([`input`,`textarea`].includes(e.tagName.toLowerCase()))return[`radio`,`checkbox`].includes(e.type)?``:e.value.toString().substring(e.selectionStart,e.selectionEnd);if(t.anchorNode===null||t.focusNode===null)return``;let n=t.getRangeAt(0),r=e.ownerDocument.createRange();if(t.containsNode(e,!1))r.selectNodeContents(e),t.removeAllRanges(),t.addRange(r);else if(!(e.contains(t.anchorNode)&&e.contains(t.focusNode))){let i=e===n.startContainer||e.contains(n.startContainer),a=e===n.endContainer||e.contains(n.endContainer);t.removeAllRanges(),(i||a)&&(r.selectNodeContents(e),i&&r.setStart(n.startContainer,n.startOffset),a&&r.setEnd(n.endContainer,n.endOffset),t.addRange(r))}let i=t.toString();return t.removeAllRanges(),t.addRange(n),i}function toHaveSelection(e,t){checkHtmlElement(e,toHaveSelection,this);let n=t!==void 0;if(n&&typeof t!=`string`)throw Error(`expected selection must be a string or undefined`);let r=getSelection(e);return{pass:n?compareAsSet(r,t):!!r,message:()=>{let e=this.isNot?`not to`:`to`,i=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveSelection`,`element`,t);return getMessage(this,i,`Expected the element ${e} have selection`,n?t:`(any)`,`Received`,r)}}}let g=null;function foreign(){return g??=(0,n.createRequire)(require("url").pathToFileURL(__filename).href)(`dom-accessibility-api`)}function computeAccessibleName(e){return e[i.$impl]===void 0?foreign().computeAccessibleName(e):r.daa06.computeAccessibleName(e)}function computeAccessibleDescription(e){return e[i.$impl]===void 0?foreign().computeAccessibleDescription(e):r.daa06.computeAccessibleDescription(e)}const _=[[`input`,[[`list`,`+`],[`type`,`=email`]],!1,[`combobox`]],[`input`,[[`list`,`+`],[`type`,`=search`]],!1,[`combobox`]],[`input`,[[`list`,`+`],[`type`,`=tel`]],!1,[`combobox`]],[`input`,[[`list`,`+`]],!0,[`combobox`]],[`input`,[[`list`,`+`],[`type`,`=url`]],!1,[`combobox`]],[`select`,[[`multiple`,`-`],[`size`,`-`]],!1,[`combobox`]],[`input`,[[`list`,`-`],[`type`,`=search`]],!1,[`searchbox`]],[`input`,[[`type`,`-`],[`list`,`-`]],!1,[`textbox`]],[`input`,[[`list`,`-`],[`type`,`=email`]],!1,[`textbox`]],[`input`,[[`list`,`-`],[`type`,`=tel`]],!1,[`textbox`]],[`input`,[[`list`,`-`]],!0,[`textbox`]],[`input`,[[`list`,`-`],[`type`,`=url`]],!1,[`textbox`]],[`input`,[[`type`,`=button`]],!1,[`button`]],[`input`,[[`type`,`=image`]],!1,[`button`]],[`input`,[[`type`,`=reset`]],!1,[`button`]],[`input`,[[`type`,`=submit`]],!1,[`button`]],[`input`,[[`type`,`=checkbox`]],!1,[`checkbox`]],[`th`,[[`scope`,`=col`]],!1,[`columnheader`]],[`th`,[[`scope`,`=colgroup`]],!1,[`columnheader`]],[`aside`,[[`aria-label`,`+`]],!1,[`complementary`]],[`aside`,[[`aria-labelledby`,`+`]],!1,[`complementary`]],[`form`,[[`aria-label`,`+`]],!1,[`form`]],[`form`,[[`aria-labelledby`,`+`]],!1,[`form`]],[`form`,[[`name`,`+`]],!1,[`form`]],[`img`,[[`alt`,`+`]],!1,[`img`]],[`img`,[[`alt`,`-`]],!1,[`img`]],[`a`,[[`href`,`+`]],!1,[`link`]],[`area`,[[`href`,`+`]],!1,[`link`]],[`select`,[[`size`,`+`]],!1,[`listbox`]],[`select`,[[`multiple`,`+`]],!1,[`listbox`]],[`img`,[[`alt`,`+`]],!1,[`presentation`]],[`input`,[[`type`,`=radio`]],!1,[`radio`]],[`section`,[[`aria-label`,`+`]],!1,[`region`]],[`section`,[[`aria-labelledby`,`+`]],!1,[`region`]],[`th`,[[`scope`,`=row`]],!1,[`rowheader`]],[`th`,[[`scope`,`=rowgroup`]],!1,[`rowheader`]],[`input`,[[`type`,`=range`]],!1,[`slider`]],[`input`,[[`type`,`=number`]],!1,[`spinbutton`]],[`article`,[],!1,[`article`]],[`header`,[],!1,[`banner`]],[`blockquote`,[],!1,[`blockquote`]],[`button`,[],!1,[`button`]],[`caption`,[],!1,[`caption`]],[`td`,[],!1,[`cell`]],[`code`,[],!1,[`code`]],[`th`,[],!1,[`columnheader`]],[`aside`,[],!1,[`complementary`]],[`footer`,[],!1,[`contentinfo`]],[`dd`,[],!1,[`definition`]],[`del`,[],!1,[`deletion`]],[`dialog`,[],!1,[`dialog`]],[`html`,[],!1,[`document`]],[`em`,[],!1,[`emphasis`]],[`figure`,[],!1,[`figure`]],[`a`,[],!1,[`generic`]],[`area`,[],!1,[`generic`]],[`aside`,[],!1,[`generic`]],[`b`,[],!1,[`generic`]],[`bdo`,[],!1,[`generic`]],[`body`,[],!1,[`generic`]],[`data`,[],!1,[`generic`]],[`div`,[],!1,[`generic`]],[`footer`,[],!1,[`generic`]],[`header`,[],!1,[`generic`]],[`hgroup`,[],!1,[`generic`]],[`i`,[],!1,[`generic`]],[`pre`,[],!1,[`generic`]],[`q`,[],!1,[`generic`]],[`samp`,[],!1,[`generic`]],[`section`,[],!1,[`generic`]],[`small`,[],!1,[`generic`]],[`span`,[],!1,[`generic`]],[`u`,[],!1,[`generic`]],[`td`,[],!1,[`gridcell`]],[`details`,[],!1,[`group`]],[`fieldset`,[],!1,[`group`]],[`optgroup`,[],!1,[`group`]],[`address`,[],!1,[`group`]],[`h1`,[],!1,[`heading`]],[`h2`,[],!1,[`heading`]],[`h3`,[],!1,[`heading`]],[`h4`,[],!1,[`heading`]],[`h5`,[],!1,[`heading`]],[`h6`,[],!1,[`heading`]],[`ins`,[],!1,[`insertion`]],[`menu`,[],!1,[`list`]],[`ol`,[],!1,[`list`]],[`ul`,[],!1,[`list`]],[`datalist`,[],!1,[`listbox`]],[`li`,[],!1,[`listitem`]],[`main`,[],!1,[`main`]],[`mark`,[],!1,[`mark`]],[`math`,[],!1,[`math`]],[`meter`,[],!1,[`meter`]],[`nav`,[],!1,[`navigation`]],[`option`,[],!1,[`option`]],[`p`,[],!1,[`paragraph`]],[`progress`,[],!1,[`progressbar`]],[`tr`,[],!1,[`row`]],[`tbody`,[],!1,[`rowgroup`]],[`tfoot`,[],!1,[`rowgroup`]],[`thead`,[],!1,[`rowgroup`]],[`hr`,[],!1,[`separator`]],[`output`,[],!1,[`status`]],[`strong`,[],!1,[`strong`]],[`sub`,[],!1,[`subscript`]],[`sup`,[],!1,[`superscript`]],[`table`,[],!1,[`table`]],[`dfn`,[],!1,[`term`]],[`dt`,[],!1,[`term`]],[`textarea`,[],!1,[`textbox`]],[`time`,[],!1,[`time`]]];function valueEquals(e,t,n,r){return n===r||(t===`type`||t===`scope`)&&e.namespaceURI===`http://www.w3.org/1999/xhtml`&&n.toLowerCase()===r}function getImplicitAriaRoles(e){let t=e.localName;for(let n=0;n<_.length;n++){let[r,i,a,o]=_[n];if(r!==t||a&&e.type!==`text`)continue;let s=!0;for(let t=0;t<i.length&&s;t++){let[n,r]=i[t],a=e.getAttribute(n);s=r===`-`?a===null:r===`+`?a!==null:a!==null&&valueEquals(e,n,a,r.slice(1))}if(s)return[...o]}return[]}function getExplicitOrImplicitRoles(e){let t=e.getAttribute(`role`);return t===null?e[i.$impl]===void 0?getImplicitAriaRoles(e):(0,r.getImplicitAriaRolesJestDom)(e):t.split(` `).filter(Boolean)}function toHaveRole(e,t){checkHtmlElement(e,toHaveRole,this);let n=getExplicitOrImplicitRoles(e);return{pass:n.some(e=>e===t),message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${toHaveRole.name}`,`element`,``),`Expected element ${e} have role`,t,`Received`,n.join(`, `))}}}function toHaveAccessibleName(e,t){checkHtmlElement(e,toHaveAccessibleName,this);let n=computeAccessibleName(e),r=arguments.length===1,i=!1;return i=r?n!==``:t instanceof RegExp?t.test(n):this.equals(n,t),{pass:i,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${toHaveAccessibleName.name}`,`element`,``),`Expected element ${e} have accessible name`,t,`Received`,n)}}}function toHaveAccessibleDescription(e,t){checkHtmlElement(e,toHaveAccessibleDescription,this);let n=computeAccessibleDescription(e),r=arguments.length===1,i=!1;return i=r?n!==``:t instanceof RegExp?t.test(n):this.equals(n,t),{pass:i,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${toHaveAccessibleDescription.name}`,`element`,``),`Expected element ${e} have accessible description`,t,`Received`,n)}}}const v=`aria-invalid`,y=[`false`];function toHaveAccessibleErrorMessage(e,t){checkHtmlElement(e,toHaveAccessibleErrorMessage,this);let n=this.isNot?`not to`:`to`,r=this.isNot?`.not.toHaveAccessibleErrorMessage`:`.toHaveAccessibleErrorMessage`,i=e.getAttribute(`aria-errormessage`);if(i&&/\s+/.test(i))return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(r,`element`),"Expected element's `aria-errormessage` attribute to be empty or a single, valid ID",``,`Received`,`aria-errormessage="${i}"`)};let a=e.getAttribute(v);if(!e.hasAttribute(v)||y.includes(a))return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(r,`element`),`Expected element to be marked as invalid with attribute`,`${v}="true"`,`Received`,e.hasAttribute(`aria-invalid`)?`${v}="${e.getAttribute(v)}`:null)};let o=normalize(e.ownerDocument.getElementById(i)?.textContent??``);return{pass:t===void 0?!!o:t instanceof RegExp?t.test(o):this.equals(o,t),message:()=>getMessage(this,this.utils.matcherHint(r,`element`),`Expected element ${n} have accessible error message`,t??``,`Received`,o)}}function textOfIdRefs(e,t){let n=(e.getAttribute(t)||``).split(/\s+/).filter(Boolean);if(n.length===0)return``;let r=e.ownerDocument;return normalize(n.map(e=>r.getElementById(e)).filter(Boolean).map(e=>e.textContent).join(` `))}function toHaveDescription(e,t){deprecate(`toHaveDescription`,`Please use toHaveAccessibleDescription.`),checkHtmlElement(e,toHaveDescription,this);let n=t!==void 0,r=textOfIdRefs(e,`aria-describedby`);return{pass:n?t instanceof RegExp?t.test(r):this.equals(r,t):!!r,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDescription`,`element`,``),`Expected the element ${e} have description`,this.utils.printExpected(t),`Received`,this.utils.printReceived(r))}}}function toHaveErrorMessage(e,t){if(deprecate(`toHaveErrorMessage`,`Please use toHaveAccessibleErrorMessage.`),checkHtmlElement(e,toHaveErrorMessage,this),!e.hasAttribute(`aria-invalid`)||e.getAttribute(`aria-invalid`)===`false`){let t=this.isNot?`.not`:``;return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(`${t}.toHaveErrorMessage`,`element`,``),`Expected the element to have invalid state indicated by`,`aria-invalid="true"`,`Received`,e.hasAttribute(`aria-invalid`)?`aria-invalid="${e.getAttribute(`aria-invalid`)}"`:this.utils.printReceived(``))}}let n=t!==void 0,r=textOfIdRefs(e,`aria-errormessage`);return{pass:n?t instanceof RegExp?t.test(r):this.equals(r,t):!!r,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveErrorMessage`,`element`,``),`Expected the element ${e} have error message`,this.utils.printExpected(t),`Received`,this.utils.printReceived(r))}}}const b={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},x=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(%|deg|grad|rad|turn)?$/i;function channel(e,t){if(e.toLowerCase()===`none`)return 0;let n=x.exec(e);if(n===null)return null;let r=Number(n[1]);return n[2]===void 0?r:n[2]===`%`?r/100*t:null}function hue(e){let t=x.exec(e);if(t===null)return e.toLowerCase()===`none`?0:null;let n=Number(t[1]);switch(t[2]?.toLowerCase()){case void 0:case`deg`:return n;case`grad`:return n*360/400;case`rad`:return n*180/Math.PI;case`turn`:return n*360;default:return null}}function args(e){let t=e.trim();if(t.includes(`,`)){let e=t.split(`,`).map(e=>e.trim());return e.some(e=>e===``||/\s/.test(e))?null:e}let n=t.indexOf(`/`),r=(n===-1?t:t.slice(0,n)).trim().split(/\s+/);return n!==-1&&r.push(t.slice(n+1).trim()),r}const clamp=(e,t,n)=>Math.min(n,Math.max(t,e));function hslToRgb(e,t,n){e=(e%360+360)%360,t=clamp(t,0,1),n=clamp(n,0,1);let f=r=>{let i=(r+e/30)%12,a=t*Math.min(n,1-n);return(n-a*Math.max(-1,Math.min(i-3,9-i,1)))*255};return[f(0),f(8),f(4)]}function key(e,t,n,r){return`${Math.round(clamp(e,0,255))},${Math.round(clamp(t,0,255))},${Math.round(clamp(n,0,255))},${Math.round(clamp(r,0,1)*1e3)}`}function canonicalColor(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();if(t===``)return null;if(t===`transparent`)return key(0,0,0,0);if(t.charCodeAt(0)===35){let e=t.slice(1);if(!/^[0-9a-f]+$/.test(e))return null;let n=e.length,d=(t,n)=>parseInt(e.slice(t,t+n),16)*(n===1?17:1);return n===3||n===4?key(d(0,1),d(1,1),d(2,1),n===4?d(3,1)/255:1):n===6||n===8?key(d(0,2),d(2,2),d(4,2),n===8?d(6,2)/255:1):null}let n=t.indexOf(`(`);if(n===-1){let e=b[t];return e===void 0?null:key(e>>16,e>>8&255,e&255,1)}if(!t.endsWith(`)`))return null;let r=t.slice(0,n),i=args(t.slice(n+1,-1));if(i===null||i.length!==3&&i.length!==4)return null;let a=i.length===4?channel(i[3],1):1;if(a===null)return null;if(r===`rgb`||r===`rgba`){let e=channel(i[0],255),t=channel(i[1],255),n=channel(i[2],255);return e===null||t===null||n===null?null:key(e,t,n,a)}if(r===`hsl`||r===`hsla`){let e=hue(i[0]),t=channel(i[1],1),n=channel(i[2],1);if(e===null||t===null||n===null)return null;let[r,o,s]=hslToRgb(e,i[1].endsWith(`%`)?t:t/100,i[2].endsWith(`%`)?n:n/100);return key(r,o,s,a)}return null}function sameColor(e,t){let n=canonicalColor(e);return n!==null&&n===canonicalColor(t)}function isStyleVisible(e){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r,opacity:i}=t(e);return n!==`none`&&r!==`hidden`&&r!==`collapse`&&i!==`0`&&i!==0}function isAttributeVisible(e,t){let n;return n=t?e.nodeName===`DETAILS`&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0:e.nodeName!==`DETAILS`||e.hasAttribute(`open`),!e.hasAttribute(`hidden`)&&n}function isElementVisible(e,t){return isStyleVisible(e)&&isAttributeVisible(e,t)&&(!e.parentElement||isElementVisible(e.parentElement,e))}function toBeVisible(e){checkHtmlElement(e,toBeVisible,this);let t=e.ownerDocument===e.getRootNode({composed:!0}),n=t&&isElementVisible(e);return{pass:n,message:()=>{let r=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeVisible`,`element`,``),``,`Received element ${r} visible${t?``:` (element is not in the document)`}:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
19
19
  `)}}}function getStyleDeclaration(e,t){let n={},r=e.createElement(`div`);for(let e of Object.keys(t))r.style[e]=t[e],n[e]=r.style[e];return n}function valueMatches(e,t){return e===t||sameColor(t,e)}function isSubset(e,t){let n=Object.entries(e);if(n.length===0)return!1;for(let[e,r]of n){let n=e.startsWith(`--`);if(!(valueMatches(t[e],r)||valueMatches(t.getPropertyValue(e),r))){if(!n){let n=e.toLowerCase();if(valueMatches(t[n],r)||valueMatches(t.getPropertyValue(n),r))continue}return!1}}return!0}function printoutStyles(e){return Object.keys(e).sort().map(t=>`${t}: ${e[t]};`).join(`
@@ -1,7 +1,7 @@
1
1
  import{createRequire as e}from"node:module";import{prettyDOM as t,queries as n}from"@ctrl/dom/testing-library";import{daa06 as r,getImplicitAriaRolesJestDom as i,roles as a}from"@ctrl/dom/aria";import{$impl as o}from"@ctrl/dom/internal";import{AriaTemplateError as s,matchAriaSnapshot as c}from"@ctrl/dom/testing-library/agent";var l=Object.defineProperty,__name=(e,t)=>l(e,`name`,{value:t,configurable:!0}),__exportAll=(e,t)=>{let n={};for(var r in e)l(n,r,{get:e[r],enumerable:!0});return t||l(n,Symbol.toStringTag,{value:`Module`}),n},GenericTypeError=class extends Error{constructor(e,t,n,r){super(),Error.captureStackTrace&&Error.captureStackTrace(this,n);let i=``;try{i=r.utils.printWithType(`Received`,t,r.utils.printReceived)}catch{}this.message=[r.utils.matcherHint(`${r.isNot?`.not`:``}.${n.name}`,`received`,``),``,`${r.utils.RECEIVED_COLOR(`received`)} value must ${e}.`,i].join(`
2
2
  `)}},HtmlElementTypeError=class extends GenericTypeError{constructor(e,t,n){super(`be an HTMLElement or an SVGElement`,e,t,n)}},NodeTypeError=class extends GenericTypeError{constructor(e,t,n){super(`be a Node`,e,t,n)}};function checkHasWindow(e,t,n,r){if(!e||!e.ownerDocument||!e.ownerDocument.defaultView)throw new t(e,n,r)}function checkNode(e,t,n){if(checkHasWindow(e,NodeTypeError,t,n),!(e instanceof e.ownerDocument.defaultView.Node))throw new NodeTypeError(e,t,n)}function checkHtmlElement(e,t,n){checkHasWindow(e,HtmlElementTypeError,t,n);let r=e.ownerDocument.defaultView;if(!(e instanceof r.HTMLElement)&&!(e instanceof r.SVGElement))throw new HtmlElementTypeError(e,t,n)}var InvalidCSSError=class extends Error{constructor(e,t,n){super(),Error.captureStackTrace&&Error.captureStackTrace(this,t),this.message=[e.message,``,n.utils.RECEIVED_COLOR(`Failing css:`),n.utils.RECEIVED_COLOR(`${e.css}`)].join(`
3
3
  `)}};let u=null;function parseCSS(t,n,r){u??=e(import.meta.url)(`@adobe/css-tools`).parse;let i=u(`selector { ${t} }`,{silent:!0}).stylesheet;if(i.parsingErrors&&i.parsingErrors.length>0){let{reason:e,line:a}=i.parsingErrors[0];throw new InvalidCSSError({css:t,message:`Syntax error parsing expected css: ${e} on line: ${a}`},n,r)}let a={},o=i.rules[0].declarations;for(let e=0;e<o.length;e++){let t=o[e];t.type===`declaration`&&(a[t.property]=t.value)}return a}function display(e,t){return typeof t==`string`?t:e.utils.stringify(t)}function getMessage(e,t,n,r,i,a){return[`${t}\n`,`${n}:\n${e.utils.EXPECTED_COLOR(redent(display(e,r),2))}`,`${i}:\n${e.utils.RECEIVED_COLOR(redent(display(e,a),2))}`].join(`
4
- `)}function matches(e,t){return t instanceof RegExp?t.test(e):e.includes(String(t))}function deprecate(e,t){console.warn(`Warning: ${e} has been deprecated and will be removed in future updates.`,t)}function normalize(e){return e.replace(/\s+/g,` `).trim()}function getTag(e){return e.tagName&&e.tagName.toLowerCase()}function getSelectValue({multiple:e,options:t}){let n=[];for(let e=0;e<t.length;e++)t[e].selected&&n.push(t[e]);if(e)return n.map(e=>e.value);if(n.length!==0)return n[0].value}function getInputValue(e){switch(e.type){case`number`:return e.value===``?null:Number(e.value);case`checkbox`:return e.checked;default:return e.value}}const p=[`meter`,`progressbar`,`slider`,`spinbutton`];function getAccessibleValue(e){if(p.includes(e.getAttribute(`role`)))return Number(e.getAttribute(`aria-valuenow`))}function getSingleElementValue(e){if(e)switch(e.tagName.toLowerCase()){case`input`:return getInputValue(e);case`select`:return getSelectValue(e);default:return e.value??getAccessibleValue(e)}}function toSentence(e,{wordConnector:t=`, `,lastWordConnector:n=` and `}={}){return[e.slice(0,-1).join(t),e[e.length-1]].join(e.length>1?n:``)}function compareAsSet(e,t){if(Array.isArray(e)&&Array.isArray(t)){let n=new Set(t);return[...new Set(e)].every(e=>n.has(e))}return e===t}function redent(e,t){let n=e.match(/^[ \t]*(?=\S)/gm),r=0;n&&(r=n.reduce((e,t)=>Math.min(e,t.length),1/0));let i=r>0?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e;return t===0?i:i.replace(/^(?!\s*$)/gm,` `.repeat(t))}function cssEscape(e){let t=String(e),n=t.length,r=-1,i=``,a=t.charCodeAt(0);for(;++r<n;){let e=t.charCodeAt(r);i+=e===0?`�`:e>=1&&e<=31||e===127||r===0&&e>=48&&e<=57||r===1&&e>=48&&e<=57&&a===45?`\\`+e.toString(16)+` `:r===0&&n===1&&e===45?`\\`+t.charAt(r):e>=128||e===45||e===95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?t.charAt(r):`\\`+t.charAt(r)}return i}const m=process.env,h=process.argv,g=!(m.NO_COLOR||h.includes(`--no-color`))&&(!!m.FORCE_COLOR||h.includes(`--color`)||process.platform===`win32`||process.stdout?.isTTY&&m.TERM!==`dumb`||!!m.CI);function picoRed(e){if(!g)return String(e);let t=`\x1B[31m`,n=`\x1B[39m`,r=``+e,i=r.indexOf(n,5);if(i===-1)return t+r+n;let a=``,o=0;do a+=r.substring(o,i)+t,o=i+5,i=r.indexOf(n,o);while(i!==-1);return t+a+r.substring(o)+n}const _=[`alt text`,`display value`,`label text`,`placeholder text`,`role`,`test ID`,`text`,`title`];function toPascalCase(e){return e.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(``)}function createQueryMatcher(e,r){let i=toPascalCase(r),a=`toContain${e}By${i}`,o=n[`queryAllBy${i}`];function queryMatcher(n,...i){checkHtmlElement(n,queryMatcher,this);let s=o(n,...i);return{message:()=>{let n=this.isNot?`not to`:`to`,o=this.utils.matcherHint(`${this.isNot?`.not`:``}.${a}`,`element`,r,{secondArgument:i[1]===void 0?void 0:this.utils.printExpected(i[1])}),c=[getMessage(this,o,`Expected element ${n} contain ${e.toLowerCase()} descendant by ${r}`,i[0],`Received`,s.length)],l=s.map(e=>t(e)).filter(e=>typeof e==`string`);return l.length&&c.push(`Here are the matching elements:`,...l),c.join(`
4
+ `)}function matches(e,t){return t instanceof RegExp?t.test(e):e.includes(String(t))}function deprecate(e,t){console.warn(`Warning: ${e} has been deprecated and will be removed in future updates.`,t)}function normalize(e){return e.replace(/\s+/g,` `).trim()}function getTag(e){return e.tagName&&e.tagName.toLowerCase()}function getSelectValue({multiple:e,options:t}){let n=[];for(let e=0;e<t.length;e++)t[e].selected&&n.push(t[e]);if(e)return n.map(e=>e.value);if(n.length!==0)return n[0].value}function getInputValue(e){switch(e.type){case`number`:return e.value===``?null:Number(e.value);case`checkbox`:return e.checked;default:return e.value}}const p=[`meter`,`progressbar`,`slider`,`spinbutton`];function getAccessibleValue(e){if(p.includes(e.getAttribute(`role`)))return Number(e.getAttribute(`aria-valuenow`))}function getSingleElementValue(e){if(e)switch(e.tagName.toLowerCase()){case`input`:return getInputValue(e);case`select`:return getSelectValue(e);default:return e.value??getAccessibleValue(e)}}function toSentence(e,{wordConnector:t=`, `,lastWordConnector:n=` and `}={}){return[e.slice(0,-1).join(t),e[e.length-1]].join(e.length>1?n:``)}function compareAsSet(e,t){if(Array.isArray(e)&&Array.isArray(t)){let n=new Set(t);return[...new Set(e)].every(e=>n.has(e))}return e===t}function redent(e,t){let n=e.match(/^[ \t]*(?=\S)/gm),r=0;n&&(r=n.reduce((e,t)=>Math.min(e,t.length),1/0));let i=r>0?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e;return t===0?i:i.replace(/^(?!\s*$)/gm,` `.repeat(t))}const m=process.env,h=process.argv,g=!(m.NO_COLOR||h.includes(`--no-color`))&&(!!m.FORCE_COLOR||h.includes(`--color`)||process.platform===`win32`||process.stdout?.isTTY&&m.TERM!==`dumb`||!!m.CI);function picoRed(e){if(!g)return String(e);let t=`\x1B[31m`,n=`\x1B[39m`,r=``+e,i=r.indexOf(n,5);if(i===-1)return t+r+n;let a=``,o=0;do a+=r.substring(o,i)+t,o=i+5,i=r.indexOf(n,o);while(i!==-1);return t+a+r.substring(o)+n}const _=[`alt text`,`display value`,`label text`,`placeholder text`,`role`,`test ID`,`text`,`title`];function toPascalCase(e){return e.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(``)}function createQueryMatcher(e,r){let i=toPascalCase(r),a=`toContain${e}By${i}`,o=n[`queryAllBy${i}`];function queryMatcher(n,...i){checkHtmlElement(n,queryMatcher,this);let s=o(n,...i);return{message:()=>{let n=this.isNot?`not to`:`to`,o=this.utils.matcherHint(`${this.isNot?`.not`:``}.${a}`,`element`,r,{secondArgument:i[1]===void 0?void 0:this.utils.printExpected(i[1])}),c=[getMessage(this,o,`Expected element ${n} contain ${e.toLowerCase()} descendant by ${r}`,i[0],`Received`,s.length)],l=s.map(e=>t(e)).filter(e=>typeof e==`string`);return l.length&&c.push(`Here are the matching elements:`,...l),c.join(`
5
5
 
6
6
  `)},pass:e===`One`?s.length===1:s.length>0}}return Object.defineProperty(queryMatcher,"name",{value:a}),queryMatcher}const v={};for(let e of _){let t=createQueryMatcher(`Any`,e),n=createQueryMatcher(`One`,e);v[t.name]=t,v[n.name]=n}function toBeInTheDocument(e){e===null&&this.isNot||checkHtmlElement(e,toBeInTheDocument,this);let t=e!==null&&e.ownerDocument===e.getRootNode({composed:!0}),errorFound=()=>`expected document not to contain element, found ${this.utils.stringify(e.cloneNode(!0))} instead`,errorNotFound=()=>`element could not be found in the document`;return{pass:t,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInTheDocument`,`element`,``),``,this.utils.RECEIVED_COLOR(this.isNot?errorFound():errorNotFound())].join(`
7
7
  `)}}function toBeInTheDOM(e,t){return deprecate(`toBeInTheDOM`,`Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container.`),e&&checkHtmlElement(e,toBeInTheDOM,this),t&&checkHtmlElement(t,toBeInTheDOM,this),{pass:t?t.contains(e):!!e,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInTheDOM`,`element`,``),``,`Received:`,` ${this.utils.printReceived(e&&e.cloneNode(!1))}`].join(`
@@ -13,7 +13,7 @@ import{createRequire as e}from"node:module";import{prettyDOM as t,queries as n}f
13
13
  `)}}function toHaveFocus(e){return checkHtmlElement(e,toHaveFocus,this),{pass:e.ownerDocument.activeElement===e,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveFocus`,`element`,``),``,...this.isNot?[`Received element is focused:`,` ${this.utils.printReceived(e)}`]:[`Expected element with focus:`,` ${this.utils.printExpected(e)}`,`Received element with focus:`,` ${this.utils.printReceived(e.ownerDocument.activeElement)}`]].join(`
14
14
  `)}}const y={1:`Node.DOCUMENT_POSITION_DISCONNECTED`,2:`Node.DOCUMENT_POSITION_PRECEDING`,4:`Node.DOCUMENT_POSITION_FOLLOWING`,8:`Node.DOCUMENT_POSITION_CONTAINS`,16:`Node.DOCUMENT_POSITION_CONTAINED_BY`,32:`Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC`};function makeDocumentPositionErrorString(e){return e in y?`${y[e]} (${e})`:`Unknown document position (${e})`}function checkToAppear(e,t,n,r,i){checkHtmlElement(r,toAppearBefore,e),checkHtmlElement(i,toAppearBefore,e);let a=r.compareDocumentPosition(i);return{pass:a===n,message:()=>[e.utils.matcherHint(`${e.isNot?`.not`:``}.${t}`,`element`,`secondElement`),``,`Received: ${makeDocumentPositionErrorString(a)}`].join(`
15
15
  `)}}function toAppearBefore(e,t){return checkToAppear(this,`toAppearBefore`,4,e,t)}function toAppearAfter(e,t){return checkToAppear(this,`toAppearAfter`,2,e,t)}function toHaveTextContent(e,t,n={normalizeWhitespace:!0}){checkNode(e,toHaveTextContent,this);let r=n.normalizeWhitespace?normalize(e.textContent):e.textContent.replace(/ /g,` `),i=r!==``&&t===``;return{pass:!i&&matches(r,t),message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveTextContent`,`element`,``),i?`Checking with empty string will always match, use .toBeEmptyDOMElement() instead`:`Expected element ${e} have text content`,t,`Received`,r)}}}function printAttribute(e,t,n){return n===void 0?t:`${t}=${e(n)}`}function getAttributeComment(e,t,n){return n===void 0?`element.hasAttribute(${e(t)})`:`element.getAttribute(${e(t)}) === ${e(n)}`}function toHaveAttribute(e,t,n){checkHtmlElement(e,toHaveAttribute,this);let r=n!==void 0,i=e.hasAttribute(t),a=e.getAttribute(t);return{pass:r?i&&this.equals(a,n):i,message:()=>{let e=this.isNot?`not to`:`to`,o=i?printAttribute(this.utils.stringify,t,a):null,s=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveAttribute`,`element`,this.utils.printExpected(t),{secondArgument:r?this.utils.printExpected(n):void 0,comment:getAttributeComment(this.utils.stringify,t,n)});return getMessage(this,s,`Expected the element ${e} have attribute`,printAttribute(this.utils.stringify,t,n),`Received`,o)}}}function getExpectedClassNamesAndOptions(e){let t=e.pop(),n,r;return typeof t==`object`&&!(t instanceof RegExp)?(n=e,r=t):(n=e.concat(t),r={exact:!1}),{expectedClassNames:n,options:r}}function splitClassNames(e){return e?e.split(/\s+/).filter(e=>e.length>0):[]}function isSubset$1(e,t){return e.every(e=>typeof e==`string`?t.includes(e):t.some(t=>e.test(t)))}__name(isSubset$1,`isSubset`);function toHaveClass(e,...t){checkHtmlElement(e,toHaveClass,this);let{expectedClassNames:n,options:r}=getExpectedClassNamesAndOptions(t),i=splitClassNames(e.getAttribute(`class`)),a=n.reduce((e,t)=>e.concat(typeof t==`string`||!t?splitClassNames(t):t),[]),o=a.some(e=>e instanceof RegExp);if(r.exact&&o)throw Error(`Exact option does not support RegExp expected class names`);return r.exact?{pass:isSubset$1(a,i)&&a.length===i.length,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveClass`,`element`,this.utils.printExpected(a.join(` `))),`Expected the element ${e} have EXACTLY defined classes`,a.join(` `),`Received`,i.join(` `))}}:a.length>0?{pass:isSubset$1(a,i),message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveClass`,`element`,this.utils.printExpected(a.join(` `))),`Expected the element ${e} have class`,a.join(` `),`Received`,i.join(` `))}}:{pass:this.isNot?i.length>0:!1,message:()=>this.isNot?getMessage(this,this.utils.matcherHint(`.not.toHaveClass`,`element`,``),`Expected the element to have classes`,`(none)`,`Received`,i.join(` `)):[this.utils.matcherHint(`.toHaveClass`,`element`),`At least one expected class must be provided.`].join(`
16
- `)}}function toHaveValue(e,t){if(checkHtmlElement(e,toHaveValue,this),e.tagName.toLowerCase()===`input`&&[`checkbox`,`radio`].includes(e.type))throw Error(`input with type=checkbox or type=radio cannot be used with .toHaveValue(). Use .toBeChecked() for type=checkbox or .toHaveFormValues() instead`);let n=getSingleElementValue(e),r=t!==void 0,i=t,a=n;return t==n&&t!==n&&(i=`${t} (${typeof t})`,a=`${n} (${typeof n})`),{pass:r?compareAsSet(n,t):!!n,message:()=>{let e=this.isNot?`not to`:`to`,n=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveValue`,`element`,t);return getMessage(this,n,`Expected the element ${e} have value`,r?i:`(any)`,`Received`,a)}}}function getValues(e,t){if(e!==`select`)return[t.value];let n=[],r=t.options;for(let e=0;e<r.length;e++){let t=r[e];t.selected&&n.push(t.textContent)}return n}function toHaveDisplayValue(e,t){checkHtmlElement(e,toHaveDisplayValue,this);let n=e.tagName.toLowerCase();if(![`select`,`input`,`textarea`].includes(n))throw Error(`.toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.`);if(n===`input`&&[`radio`,`checkbox`].includes(e.type))throw Error(`.toHaveDisplayValue() currently does not support input[type="${e.type}"], try with another matcher instead.`);let r=getValues(n,e),i=t instanceof Array?t:[t],a=i.filter(e=>r.some(t=>e instanceof RegExp?e.test(t):this.equals(t,String(e)))).length,o=a===r.length,s=a===i.length;return{pass:o&&s,message:()=>getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDisplayValue`,`element`,``),`Expected element ${this.isNot?`not `:``}to have display value`,t,`Received`,r)}}function getMultiElementValue(e){let t=[...new Set(e.map(e=>e.type))];if(t.length!==1)throw Error(`Multiple form elements with the same name must be of the same type`);switch(t[0]){case`radio`:{let t=e.find(e=>e.checked);return t?t.value:void 0}case`checkbox`:return e.filter(e=>e.checked).map(e=>e.value);default:return e.map(e=>e.value)}}function getFormValue(e,t){let n=[...e.querySelectorAll(`[name="${cssEscape(t)}"]`)];if(n.length!==0)switch(n.length){case 1:return getSingleElementValue(n[0]);default:return getMultiElementValue(n)}}function getPureName(e){return e.endsWith(`[]`)?e.slice(0,-2):e}function getAllFormValues(e){let t={};for(let n of Array.from(e.elements)){let r=n.name;t[getPureName(r)]=getFormValue(e,r)}return t}function toHaveFormValues(e,t){if(checkHtmlElement(e,toHaveFormValues,this),!e.elements)throw Error(`toHaveFormValues must be called on a form or a fieldset`);let n=getAllFormValues(e);return{pass:Object.entries(t).every(([e,t])=>compareAsSet(n[e],t)),message:()=>{let e=this.isNot?`not to`:`to`,r=`${this.isNot?`.not`:``}.toHaveFormValues`,i={};for(let e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=n[e]);return[this.utils.matcherHint(r,`element`,``),`Expected the element ${e} have form values`,this.utils.diff(t,i)].join(`
16
+ `)}}function toHaveValue(e,t){if(checkHtmlElement(e,toHaveValue,this),e.tagName.toLowerCase()===`input`&&[`checkbox`,`radio`].includes(e.type))throw Error(`input with type=checkbox or type=radio cannot be used with .toHaveValue(). Use .toBeChecked() for type=checkbox or .toHaveFormValues() instead`);let n=getSingleElementValue(e),r=t!==void 0,i=t,a=n;return t==n&&t!==n&&(i=`${t} (${typeof t})`,a=`${n} (${typeof n})`),{pass:r?compareAsSet(n,t):!!n,message:()=>{let e=this.isNot?`not to`:`to`,n=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveValue`,`element`,t);return getMessage(this,n,`Expected the element ${e} have value`,r?i:`(any)`,`Received`,a)}}}function getValues(e,t){if(e!==`select`)return[t.value];let n=[],r=t.options;for(let e=0;e<r.length;e++){let t=r[e];t.selected&&n.push(t.textContent)}return n}function toHaveDisplayValue(e,t){checkHtmlElement(e,toHaveDisplayValue,this);let n=e.tagName.toLowerCase();if(![`select`,`input`,`textarea`].includes(n))throw Error(`.toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.`);if(n===`input`&&[`radio`,`checkbox`].includes(e.type))throw Error(`.toHaveDisplayValue() currently does not support input[type="${e.type}"], try with another matcher instead.`);let r=getValues(n,e),i=t instanceof Array?t:[t],a=i.filter(e=>r.some(t=>e instanceof RegExp?e.test(t):this.equals(t,String(e)))).length,o=a===r.length,s=a===i.length;return{pass:o&&s,message:()=>getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDisplayValue`,`element`,``),`Expected element ${this.isNot?`not `:``}to have display value`,t,`Received`,r)}}function getMultiElementValue(e){let t=[...new Set(e.map(e=>e.type))];if(t.length!==1)throw Error(`Multiple form elements with the same name must be of the same type`);switch(t[0]){case`radio`:{let t=e.find(e=>e.checked);return t?t.value:void 0}case`checkbox`:return e.filter(e=>e.checked).map(e=>e.value);default:return e.map(e=>e.value)}}function getFormValue(e){if(e!==void 0)switch(e.length){case 1:return getSingleElementValue(e[0]);default:return getMultiElementValue(e)}}function getPureName(e){return e.endsWith(`[]`)?e.slice(0,-2):e}function getAllFormValues(e){let t=/* @__PURE__ */ new Map;for(let n of e.querySelectorAll(`[name]`)){let e=n.getAttribute(`name`),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}let n={};for(let r of Array.from(e.elements)){let e=r.name;n[getPureName(e)]=getFormValue(t.get(e))}return n}function toHaveFormValues(e,t){if(checkHtmlElement(e,toHaveFormValues,this),!e.elements)throw Error(`toHaveFormValues must be called on a form or a fieldset`);let n=getAllFormValues(e);return{pass:Object.entries(t).every(([e,t])=>compareAsSet(n[e],t)),message:()=>{let e=this.isNot?`not to`:`to`,r=`${this.isNot?`.not`:``}.toHaveFormValues`,i={};for(let e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=n[e]);return[this.utils.matcherHint(r,`element`,``),`Expected the element ${e} have form values`,this.utils.diff(t,i)].join(`
17
17
 
18
18
  `)}}}function getSelection(e){let t=e.ownerDocument.getSelection();if([`input`,`textarea`].includes(e.tagName.toLowerCase()))return[`radio`,`checkbox`].includes(e.type)?``:e.value.toString().substring(e.selectionStart,e.selectionEnd);if(t.anchorNode===null||t.focusNode===null)return``;let n=t.getRangeAt(0),r=e.ownerDocument.createRange();if(t.containsNode(e,!1))r.selectNodeContents(e),t.removeAllRanges(),t.addRange(r);else if(!(e.contains(t.anchorNode)&&e.contains(t.focusNode))){let i=e===n.startContainer||e.contains(n.startContainer),a=e===n.endContainer||e.contains(n.endContainer);t.removeAllRanges(),(i||a)&&(r.selectNodeContents(e),i&&r.setStart(n.startContainer,n.startOffset),a&&r.setEnd(n.endContainer,n.endOffset),t.addRange(r))}let i=t.toString();return t.removeAllRanges(),t.addRange(n),i}function toHaveSelection(e,t){checkHtmlElement(e,toHaveSelection,this);let n=t!==void 0;if(n&&typeof t!=`string`)throw Error(`expected selection must be a string or undefined`);let r=getSelection(e);return{pass:n?compareAsSet(r,t):!!r,message:()=>{let e=this.isNot?`not to`:`to`,i=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveSelection`,`element`,t);return getMessage(this,i,`Expected the element ${e} have selection`,n?t:`(any)`,`Received`,r)}}}let b=null;function foreign(){return b??=e(import.meta.url)(`dom-accessibility-api`)}function computeAccessibleName(e){return e[o]===void 0?foreign().computeAccessibleName(e):r.computeAccessibleName(e)}function computeAccessibleDescription(e){return e[o]===void 0?foreign().computeAccessibleDescription(e):r.computeAccessibleDescription(e)}const x=[[`input`,[[`list`,`+`],[`type`,`=email`]],!1,[`combobox`]],[`input`,[[`list`,`+`],[`type`,`=search`]],!1,[`combobox`]],[`input`,[[`list`,`+`],[`type`,`=tel`]],!1,[`combobox`]],[`input`,[[`list`,`+`]],!0,[`combobox`]],[`input`,[[`list`,`+`],[`type`,`=url`]],!1,[`combobox`]],[`select`,[[`multiple`,`-`],[`size`,`-`]],!1,[`combobox`]],[`input`,[[`list`,`-`],[`type`,`=search`]],!1,[`searchbox`]],[`input`,[[`type`,`-`],[`list`,`-`]],!1,[`textbox`]],[`input`,[[`list`,`-`],[`type`,`=email`]],!1,[`textbox`]],[`input`,[[`list`,`-`],[`type`,`=tel`]],!1,[`textbox`]],[`input`,[[`list`,`-`]],!0,[`textbox`]],[`input`,[[`list`,`-`],[`type`,`=url`]],!1,[`textbox`]],[`input`,[[`type`,`=button`]],!1,[`button`]],[`input`,[[`type`,`=image`]],!1,[`button`]],[`input`,[[`type`,`=reset`]],!1,[`button`]],[`input`,[[`type`,`=submit`]],!1,[`button`]],[`input`,[[`type`,`=checkbox`]],!1,[`checkbox`]],[`th`,[[`scope`,`=col`]],!1,[`columnheader`]],[`th`,[[`scope`,`=colgroup`]],!1,[`columnheader`]],[`aside`,[[`aria-label`,`+`]],!1,[`complementary`]],[`aside`,[[`aria-labelledby`,`+`]],!1,[`complementary`]],[`form`,[[`aria-label`,`+`]],!1,[`form`]],[`form`,[[`aria-labelledby`,`+`]],!1,[`form`]],[`form`,[[`name`,`+`]],!1,[`form`]],[`img`,[[`alt`,`+`]],!1,[`img`]],[`img`,[[`alt`,`-`]],!1,[`img`]],[`a`,[[`href`,`+`]],!1,[`link`]],[`area`,[[`href`,`+`]],!1,[`link`]],[`select`,[[`size`,`+`]],!1,[`listbox`]],[`select`,[[`multiple`,`+`]],!1,[`listbox`]],[`img`,[[`alt`,`+`]],!1,[`presentation`]],[`input`,[[`type`,`=radio`]],!1,[`radio`]],[`section`,[[`aria-label`,`+`]],!1,[`region`]],[`section`,[[`aria-labelledby`,`+`]],!1,[`region`]],[`th`,[[`scope`,`=row`]],!1,[`rowheader`]],[`th`,[[`scope`,`=rowgroup`]],!1,[`rowheader`]],[`input`,[[`type`,`=range`]],!1,[`slider`]],[`input`,[[`type`,`=number`]],!1,[`spinbutton`]],[`article`,[],!1,[`article`]],[`header`,[],!1,[`banner`]],[`blockquote`,[],!1,[`blockquote`]],[`button`,[],!1,[`button`]],[`caption`,[],!1,[`caption`]],[`td`,[],!1,[`cell`]],[`code`,[],!1,[`code`]],[`th`,[],!1,[`columnheader`]],[`aside`,[],!1,[`complementary`]],[`footer`,[],!1,[`contentinfo`]],[`dd`,[],!1,[`definition`]],[`del`,[],!1,[`deletion`]],[`dialog`,[],!1,[`dialog`]],[`html`,[],!1,[`document`]],[`em`,[],!1,[`emphasis`]],[`figure`,[],!1,[`figure`]],[`a`,[],!1,[`generic`]],[`area`,[],!1,[`generic`]],[`aside`,[],!1,[`generic`]],[`b`,[],!1,[`generic`]],[`bdo`,[],!1,[`generic`]],[`body`,[],!1,[`generic`]],[`data`,[],!1,[`generic`]],[`div`,[],!1,[`generic`]],[`footer`,[],!1,[`generic`]],[`header`,[],!1,[`generic`]],[`hgroup`,[],!1,[`generic`]],[`i`,[],!1,[`generic`]],[`pre`,[],!1,[`generic`]],[`q`,[],!1,[`generic`]],[`samp`,[],!1,[`generic`]],[`section`,[],!1,[`generic`]],[`small`,[],!1,[`generic`]],[`span`,[],!1,[`generic`]],[`u`,[],!1,[`generic`]],[`td`,[],!1,[`gridcell`]],[`details`,[],!1,[`group`]],[`fieldset`,[],!1,[`group`]],[`optgroup`,[],!1,[`group`]],[`address`,[],!1,[`group`]],[`h1`,[],!1,[`heading`]],[`h2`,[],!1,[`heading`]],[`h3`,[],!1,[`heading`]],[`h4`,[],!1,[`heading`]],[`h5`,[],!1,[`heading`]],[`h6`,[],!1,[`heading`]],[`ins`,[],!1,[`insertion`]],[`menu`,[],!1,[`list`]],[`ol`,[],!1,[`list`]],[`ul`,[],!1,[`list`]],[`datalist`,[],!1,[`listbox`]],[`li`,[],!1,[`listitem`]],[`main`,[],!1,[`main`]],[`mark`,[],!1,[`mark`]],[`math`,[],!1,[`math`]],[`meter`,[],!1,[`meter`]],[`nav`,[],!1,[`navigation`]],[`option`,[],!1,[`option`]],[`p`,[],!1,[`paragraph`]],[`progress`,[],!1,[`progressbar`]],[`tr`,[],!1,[`row`]],[`tbody`,[],!1,[`rowgroup`]],[`tfoot`,[],!1,[`rowgroup`]],[`thead`,[],!1,[`rowgroup`]],[`hr`,[],!1,[`separator`]],[`output`,[],!1,[`status`]],[`strong`,[],!1,[`strong`]],[`sub`,[],!1,[`subscript`]],[`sup`,[],!1,[`superscript`]],[`table`,[],!1,[`table`]],[`dfn`,[],!1,[`term`]],[`dt`,[],!1,[`term`]],[`textarea`,[],!1,[`textbox`]],[`time`,[],!1,[`time`]]];function valueEquals(e,t,n,r){return n===r||(t===`type`||t===`scope`)&&e.namespaceURI===`http://www.w3.org/1999/xhtml`&&n.toLowerCase()===r}function getImplicitAriaRoles(e){let t=e.localName;for(let n=0;n<x.length;n++){let[r,i,a,o]=x[n];if(r!==t||a&&e.type!==`text`)continue;let s=!0;for(let t=0;t<i.length&&s;t++){let[n,r]=i[t],a=e.getAttribute(n);s=r===`-`?a===null:r===`+`?a!==null:a!==null&&valueEquals(e,n,a,r.slice(1))}if(s)return[...o]}return[]}function getExplicitOrImplicitRoles(e){let t=e.getAttribute(`role`);return t===null?e[o]===void 0?getImplicitAriaRoles(e):i(e):t.split(` `).filter(Boolean)}function toHaveRole(e,t){checkHtmlElement(e,toHaveRole,this);let n=getExplicitOrImplicitRoles(e);return{pass:n.some(e=>e===t),message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${toHaveRole.name}`,`element`,``),`Expected element ${e} have role`,t,`Received`,n.join(`, `))}}}function toHaveAccessibleName(e,t){checkHtmlElement(e,toHaveAccessibleName,this);let n=computeAccessibleName(e),r=arguments.length===1,i=!1;return i=r?n!==``:t instanceof RegExp?t.test(n):this.equals(n,t),{pass:i,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${toHaveAccessibleName.name}`,`element`,``),`Expected element ${e} have accessible name`,t,`Received`,n)}}}function toHaveAccessibleDescription(e,t){checkHtmlElement(e,toHaveAccessibleDescription,this);let n=computeAccessibleDescription(e),r=arguments.length===1,i=!1;return i=r?n!==``:t instanceof RegExp?t.test(n):this.equals(n,t),{pass:i,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${toHaveAccessibleDescription.name}`,`element`,``),`Expected element ${e} have accessible description`,t,`Received`,n)}}}const S=`aria-invalid`,C=[`false`];function toHaveAccessibleErrorMessage(e,t){checkHtmlElement(e,toHaveAccessibleErrorMessage,this);let n=this.isNot?`not to`:`to`,r=this.isNot?`.not.toHaveAccessibleErrorMessage`:`.toHaveAccessibleErrorMessage`,i=e.getAttribute(`aria-errormessage`);if(i&&/\s+/.test(i))return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(r,`element`),"Expected element's `aria-errormessage` attribute to be empty or a single, valid ID",``,`Received`,`aria-errormessage="${i}"`)};let a=e.getAttribute(S);if(!e.hasAttribute(S)||C.includes(a))return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(r,`element`),`Expected element to be marked as invalid with attribute`,`${S}="true"`,`Received`,e.hasAttribute(`aria-invalid`)?`${S}="${e.getAttribute(S)}`:null)};let o=normalize(e.ownerDocument.getElementById(i)?.textContent??``);return{pass:t===void 0?!!o:t instanceof RegExp?t.test(o):this.equals(o,t),message:()=>getMessage(this,this.utils.matcherHint(r,`element`),`Expected element ${n} have accessible error message`,t??``,`Received`,o)}}function textOfIdRefs(e,t){let n=(e.getAttribute(t)||``).split(/\s+/).filter(Boolean);if(n.length===0)return``;let r=e.ownerDocument;return normalize(n.map(e=>r.getElementById(e)).filter(Boolean).map(e=>e.textContent).join(` `))}function toHaveDescription(e,t){deprecate(`toHaveDescription`,`Please use toHaveAccessibleDescription.`),checkHtmlElement(e,toHaveDescription,this);let n=t!==void 0,r=textOfIdRefs(e,`aria-describedby`);return{pass:n?t instanceof RegExp?t.test(r):this.equals(r,t):!!r,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDescription`,`element`,``),`Expected the element ${e} have description`,this.utils.printExpected(t),`Received`,this.utils.printReceived(r))}}}function toHaveErrorMessage(e,t){if(deprecate(`toHaveErrorMessage`,`Please use toHaveAccessibleErrorMessage.`),checkHtmlElement(e,toHaveErrorMessage,this),!e.hasAttribute(`aria-invalid`)||e.getAttribute(`aria-invalid`)===`false`){let t=this.isNot?`.not`:``;return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(`${t}.toHaveErrorMessage`,`element`,``),`Expected the element to have invalid state indicated by`,`aria-invalid="true"`,`Received`,e.hasAttribute(`aria-invalid`)?`aria-invalid="${e.getAttribute(`aria-invalid`)}"`:this.utils.printReceived(``))}}let n=t!==void 0,r=textOfIdRefs(e,`aria-errormessage`);return{pass:n?t instanceof RegExp?t.test(r):this.equals(r,t):!!r,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveErrorMessage`,`element`,``),`Expected the element ${e} have error message`,this.utils.printExpected(t),`Received`,this.utils.printReceived(r))}}}const w={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},T=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(%|deg|grad|rad|turn)?$/i;function channel(e,t){if(e.toLowerCase()===`none`)return 0;let n=T.exec(e);if(n===null)return null;let r=Number(n[1]);return n[2]===void 0?r:n[2]===`%`?r/100*t:null}function hue(e){let t=T.exec(e);if(t===null)return e.toLowerCase()===`none`?0:null;let n=Number(t[1]);switch(t[2]?.toLowerCase()){case void 0:case`deg`:return n;case`grad`:return n*360/400;case`rad`:return n*180/Math.PI;case`turn`:return n*360;default:return null}}function args(e){let t=e.trim();if(t.includes(`,`)){let e=t.split(`,`).map(e=>e.trim());return e.some(e=>e===``||/\s/.test(e))?null:e}let n=t.indexOf(`/`),r=(n===-1?t:t.slice(0,n)).trim().split(/\s+/);return n!==-1&&r.push(t.slice(n+1).trim()),r}const clamp=(e,t,n)=>Math.min(n,Math.max(t,e));function hslToRgb(e,t,n){e=(e%360+360)%360,t=clamp(t,0,1),n=clamp(n,0,1);let f=r=>{let i=(r+e/30)%12,a=t*Math.min(n,1-n);return(n-a*Math.max(-1,Math.min(i-3,9-i,1)))*255};return[f(0),f(8),f(4)]}function key(e,t,n,r){return`${Math.round(clamp(e,0,255))},${Math.round(clamp(t,0,255))},${Math.round(clamp(n,0,255))},${Math.round(clamp(r,0,1)*1e3)}`}function canonicalColor(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();if(t===``)return null;if(t===`transparent`)return key(0,0,0,0);if(t.charCodeAt(0)===35){let e=t.slice(1);if(!/^[0-9a-f]+$/.test(e))return null;let n=e.length,d=(t,n)=>parseInt(e.slice(t,t+n),16)*(n===1?17:1);return n===3||n===4?key(d(0,1),d(1,1),d(2,1),n===4?d(3,1)/255:1):n===6||n===8?key(d(0,2),d(2,2),d(4,2),n===8?d(6,2)/255:1):null}let n=t.indexOf(`(`);if(n===-1){let e=w[t];return e===void 0?null:key(e>>16,e>>8&255,e&255,1)}if(!t.endsWith(`)`))return null;let r=t.slice(0,n),i=args(t.slice(n+1,-1));if(i===null||i.length!==3&&i.length!==4)return null;let a=i.length===4?channel(i[3],1):1;if(a===null)return null;if(r===`rgb`||r===`rgba`){let e=channel(i[0],255),t=channel(i[1],255),n=channel(i[2],255);return e===null||t===null||n===null?null:key(e,t,n,a)}if(r===`hsl`||r===`hsla`){let e=hue(i[0]),t=channel(i[1],1),n=channel(i[2],1);if(e===null||t===null||n===null)return null;let[r,o,s]=hslToRgb(e,i[1].endsWith(`%`)?t:t/100,i[2].endsWith(`%`)?n:n/100);return key(r,o,s,a)}return null}function sameColor(e,t){let n=canonicalColor(e);return n!==null&&n===canonicalColor(t)}function isStyleVisible(e){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r,opacity:i}=t(e);return n!==`none`&&r!==`hidden`&&r!==`collapse`&&i!==`0`&&i!==0}function isAttributeVisible(e,t){let n;return n=t?e.nodeName===`DETAILS`&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0:e.nodeName!==`DETAILS`||e.hasAttribute(`open`),!e.hasAttribute(`hidden`)&&n}function isElementVisible(e,t){return isStyleVisible(e)&&isAttributeVisible(e,t)&&(!e.parentElement||isElementVisible(e.parentElement,e))}function toBeVisible(e){checkHtmlElement(e,toBeVisible,this);let t=e.ownerDocument===e.getRootNode({composed:!0}),n=t&&isElementVisible(e);return{pass:n,message:()=>{let r=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeVisible`,`element`,``),``,`Received element ${r} visible${t?``:` (element is not in the document)`}:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
19
19
  `)}}}function getStyleDeclaration(e,t){let n={},r=e.createElement(`div`);for(let e of Object.keys(t))r.style[e]=t[e],n[e]=r.style[e];return n}function valueMatches(e,t){return e===t||sameColor(t,e)}function isSubset(e,t){let n=Object.entries(e);if(n.length===0)return!1;for(let[e,r]of n){let n=e.startsWith(`--`);if(!(valueMatches(t[e],r)||valueMatches(t.getPropertyValue(e),r))){if(!n){let n=e.toLowerCase();if(valueMatches(t[n],r)||valueMatches(t.getPropertyValue(n),r))continue}return!1}}return!0}function printoutStyles(e){return Object.keys(e).sort().map(t=>`${t}: ${e[t]};`).join(`
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CkxM783o.cjs");expect.extend(e.t);
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CZ6Smfw9.cjs");expect.extend(e.t);
@@ -1 +1 @@
1
- import{t as e}from"./_chunks/matchers-Dt7W4g5X.js";expect.extend(e);export{};
1
+ import{t as e}from"./_chunks/matchers-CwGF61j-.js";expect.extend(e);export{};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CkxM783o.cjs");require("@jest/globals").expect.extend(e.t);
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CZ6Smfw9.cjs");require("@jest/globals").expect.extend(e.t);
@@ -1 +1 @@
1
- import{t as e}from"./_chunks/matchers-Dt7W4g5X.js";import{expect as t}from"@jest/globals";t.extend(e);export{};
1
+ import{t as e}from"./_chunks/matchers-CwGF61j-.js";import{expect as t}from"@jest/globals";t.extend(e);export{};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CkxM783o.cjs");exports.toAppearAfter=e.U,exports.toAppearBefore=e.W,exports.toBeChecked=e.y,exports.toBeDisabled=e.b,exports.toBeEmpty=e.G,exports.toBeEmptyDOMElement=e.K,exports.toBeEnabled=e.x,exports.toBeInTheDOM=e.q,exports.toBeInTheDocument=e.J,exports.toBeInvalid=e.S,exports.toBePartiallyChecked=e.C,exports.toBePartiallyPressed=e.w,exports.toBePressed=e.T,exports.toBeRequired=e.E,exports.toBeValid=e.D,exports.toBeVisible=e.O,exports.toContainAnyByAltText=e.n,exports.toContainAnyByDisplayValue=e.r,exports.toContainAnyByLabelText=e.i,exports.toContainAnyByPlaceholderText=e.a,exports.toContainAnyByRole=e.o,exports.toContainAnyByTestId=e.s,exports.toContainAnyByText=e.c,exports.toContainAnyByTitle=e.l,exports.toContainElement=e.Y,exports.toContainHTML=e.X,exports.toContainOneByAltText=e.u,exports.toContainOneByDisplayValue=e.d,exports.toContainOneByLabelText=e.f,exports.toContainOneByPlaceholderText=e.p,exports.toContainOneByRole=e.m,exports.toContainOneByTestId=e.h,exports.toContainOneByText=e.g,exports.toContainOneByTitle=e._,exports.toHaveAccessibleDescription=e.A,exports.toHaveAccessibleErrorMessage=e.j,exports.toHaveAccessibleName=e.M,exports.toHaveAttribute=e.I,exports.toHaveClass=e.L,exports.toHaveDescription=e.N,exports.toHaveDisplayValue=e.R,exports.toHaveErrorMessage=e.P,exports.toHaveFocus=e.Z,exports.toHaveFormValues=e.z,exports.toHaveRole=e.F,exports.toHaveSelection=e.B,exports.toHaveStyle=e.k,exports.toHaveTextContent=e.V,exports.toHaveValue=e.H,exports.toMatchAriaSnapshot=e.v;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CZ6Smfw9.cjs");exports.toAppearAfter=e.U,exports.toAppearBefore=e.W,exports.toBeChecked=e.y,exports.toBeDisabled=e.b,exports.toBeEmpty=e.G,exports.toBeEmptyDOMElement=e.K,exports.toBeEnabled=e.x,exports.toBeInTheDOM=e.q,exports.toBeInTheDocument=e.J,exports.toBeInvalid=e.S,exports.toBePartiallyChecked=e.C,exports.toBePartiallyPressed=e.w,exports.toBePressed=e.T,exports.toBeRequired=e.E,exports.toBeValid=e.D,exports.toBeVisible=e.O,exports.toContainAnyByAltText=e.n,exports.toContainAnyByDisplayValue=e.r,exports.toContainAnyByLabelText=e.i,exports.toContainAnyByPlaceholderText=e.a,exports.toContainAnyByRole=e.o,exports.toContainAnyByTestId=e.s,exports.toContainAnyByText=e.c,exports.toContainAnyByTitle=e.l,exports.toContainElement=e.Y,exports.toContainHTML=e.X,exports.toContainOneByAltText=e.u,exports.toContainOneByDisplayValue=e.d,exports.toContainOneByLabelText=e.f,exports.toContainOneByPlaceholderText=e.p,exports.toContainOneByRole=e.m,exports.toContainOneByTestId=e.h,exports.toContainOneByText=e.g,exports.toContainOneByTitle=e._,exports.toHaveAccessibleDescription=e.A,exports.toHaveAccessibleErrorMessage=e.j,exports.toHaveAccessibleName=e.M,exports.toHaveAttribute=e.I,exports.toHaveClass=e.L,exports.toHaveDescription=e.N,exports.toHaveDisplayValue=e.R,exports.toHaveErrorMessage=e.P,exports.toHaveFocus=e.Z,exports.toHaveFormValues=e.z,exports.toHaveRole=e.F,exports.toHaveSelection=e.B,exports.toHaveStyle=e.k,exports.toHaveTextContent=e.V,exports.toHaveValue=e.H,exports.toMatchAriaSnapshot=e.v;
@@ -1 +1 @@
1
- export{U as toAppearAfter,W as toAppearBefore,y as toBeChecked,b as toBeDisabled,G as toBeEmpty,K as toBeEmptyDOMElement,x as toBeEnabled,q as toBeInTheDOM,J as toBeInTheDocument,S as toBeInvalid,C as toBePartiallyChecked,w as toBePartiallyPressed,T as toBePressed,E as toBeRequired,D as toBeValid,O as toBeVisible,n as toContainAnyByAltText,r as toContainAnyByDisplayValue,i as toContainAnyByLabelText,a as toContainAnyByPlaceholderText,o as toContainAnyByRole,s as toContainAnyByTestId,c as toContainAnyByText,l as toContainAnyByTitle,Y as toContainElement,X as toContainHTML,u as toContainOneByAltText,d as toContainOneByDisplayValue,f as toContainOneByLabelText,p as toContainOneByPlaceholderText,m as toContainOneByRole,h as toContainOneByTestId,g as toContainOneByText,_ as toContainOneByTitle,A as toHaveAccessibleDescription,j as toHaveAccessibleErrorMessage,M as toHaveAccessibleName,I as toHaveAttribute,L as toHaveClass,N as toHaveDescription,R as toHaveDisplayValue,P as toHaveErrorMessage,Z as toHaveFocus,z as toHaveFormValues,F as toHaveRole,B as toHaveSelection,k as toHaveStyle,V as toHaveTextContent,H as toHaveValue,v as toMatchAriaSnapshot}from"./_chunks/matchers-Dt7W4g5X.js";
1
+ export{U as toAppearAfter,W as toAppearBefore,y as toBeChecked,b as toBeDisabled,G as toBeEmpty,K as toBeEmptyDOMElement,x as toBeEnabled,q as toBeInTheDOM,J as toBeInTheDocument,S as toBeInvalid,C as toBePartiallyChecked,w as toBePartiallyPressed,T as toBePressed,E as toBeRequired,D as toBeValid,O as toBeVisible,n as toContainAnyByAltText,r as toContainAnyByDisplayValue,i as toContainAnyByLabelText,a as toContainAnyByPlaceholderText,o as toContainAnyByRole,s as toContainAnyByTestId,c as toContainAnyByText,l as toContainAnyByTitle,Y as toContainElement,X as toContainHTML,u as toContainOneByAltText,d as toContainOneByDisplayValue,f as toContainOneByLabelText,p as toContainOneByPlaceholderText,m as toContainOneByRole,h as toContainOneByTestId,g as toContainOneByText,_ as toContainOneByTitle,A as toHaveAccessibleDescription,j as toHaveAccessibleErrorMessage,M as toHaveAccessibleName,I as toHaveAttribute,L as toHaveClass,N as toHaveDescription,R as toHaveDisplayValue,P as toHaveErrorMessage,Z as toHaveFocus,z as toHaveFormValues,F as toHaveRole,B as toHaveSelection,k as toHaveStyle,V as toHaveTextContent,H as toHaveValue,v as toMatchAriaSnapshot}from"./_chunks/matchers-CwGF61j-.js";
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CkxM783o.cjs");require("vitest").expect.extend(e.t);
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CZ6Smfw9.cjs");require("vitest").expect.extend(e.t);
@@ -1 +1 @@
1
- import{t as e}from"./_chunks/matchers-Dt7W4g5X.js";import{expect as t}from"vitest";t.extend(e);export{};
1
+ import{t as e}from"./_chunks/matchers-CwGF61j-.js";import{expect as t}from"vitest";t.extend(e);export{};
@@ -0,0 +1 @@
1
+ import*as e from"react";import{canSkipZeroDelayWait as t,listenerCount as n,loopTurn as r,registerTestHooks as i,reusableElement as a,skipZeroDelayWait as o,traceSync as s,tracing as c}from"@ctrl/dom/internal";import*as l from"react-dom/client";var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty,__exportAll=(e,t)=>{let n={};for(var r in e)u(n,r,{get:e[r],enumerable:!0});return t||u(n,Symbol.toStringTag,{value:`Module`}),n},__copyProps=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=f(t),a=0,o=i.length,s;a<o;a++)s=i[a],!p.call(e,s)&&s!==n&&u(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=d(t,s))||r.enumerable});return e},__reExport=(e,t,n)=>(__copyProps(e,t,`default`),n&&__copyProps(n,t,`default`)),m=/* @__PURE__ */ __exportAll({});import*as h from"@ctrl/dom/testing-library";__reExport(m,h);let g={reactStrictMode:!1,releaseSuspendedWork:!0};function releaseSuspendedWorkEnabled(){return g.releaseSuspendedWork}function getConfig(){return{...(0,m.getConfig)(),...g}}function configure(e){typeof e==`function`&&(e=e(getConfig()));let{reactStrictMode:t,releaseSuspendedWork:n,...r}=e;(0,m.configure)(r),g={...g,reactStrictMode:t,releaseSuspendedWork:n??g.releaseSuspendedWork}}const _=e.act;function setReactActEnvironment(e){globalThis.IS_REACT_ACT_ENVIRONMENT=e}function getIsReactActEnvironment(){return globalThis.IS_REACT_ACT_ENVIRONMENT}const v=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,y=/* @__PURE__ */ new Set;function flushReleasingSuspendedWork(e){let t=!1,n=0;try{for(;n<e.length;n++){let r=e[n];for(;r!==null;)if(v.didUsePromise=!1,r=r(!1),r!==null&&v.didUsePromise){t=!0;break}}e.length=0}catch(t){e.splice(0,n+1),v.thrownErrors.unshift(t)}if(t)for(let e of y){let t=e._internalRoot,n=t?.callbackNode;n!=null&&n.callback===void 0&&(t.callbackNode=null,t.callbackPriority=0)}return v.thrownErrors.splice(0)}function isThenable(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}function withGlobalActEnvironment(e){return t=>{let n=getIsReactActEnvironment();setReactActEnvironment(!0);try{let r=!1,i=e(()=>{let e=t();return isThenable(e)&&(r=!0),e});if(r){let e=i;return{then:(t,r)=>{e.then(e=>{setReactActEnvironment(n),t(e)},e=>{setReactActEnvironment(n),r(e)})}}}return setReactActEnvironment(n),i}catch(e){throw setReactActEnvironment(n),e}}}const b=withGlobalActEnvironment(_);function actReleasingSuspendedWork(e){if(v.actQueue!==null||!releaseSuspendedWorkEnabled()){b(e);return}let t=[];try{b(()=>{let n=v.actQueue;e(),t=flushReleasingSuspendedWork(n)})}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t)}const fireEvent=((...e)=>(0,m.fireEvent)(...e)),x=fireEvent,S=m.fireEvent;for(let e of Object.keys(m.fireEvent))x[e]=(...t)=>S[e](...t);const C=x.mouseEnter,w=x.mouseLeave;x.mouseEnter=(...e)=>(C(...e),x.mouseOver(...e)),x.mouseLeave=(...e)=>(w(...e),x.mouseOut(...e));const T=x.pointerEnter,E=x.pointerLeave;x.pointerEnter=(...e)=>(T(...e),x.pointerOver(...e)),x.pointerLeave=(...e)=>(E(...e),x.pointerOut(...e));const D=x.select;x.select=(e,t)=>{D(e,t),e.focus(),x.keyUp(e,t)};const O=x.blur,k=x.focus;x.blur=(...e)=>(x.focusOut(...e),O(...e)),x.focus=(...e)=>(x.focusIn(...e),k(...e));var A=/* @__PURE__ */ __exportAll({act:()=>b,cleanup:()=>cleanup,configure:()=>configure,fireEvent:()=>fireEvent,getConfig:()=>getConfig,render:()=>render,renderHook:()=>renderHook});__reExport(A,m);function advanceFakeTimersIfEnabled(){if(typeof jest<`u`&&jest!==null){(setTimeout._isMockFunction===!0||Object.prototype.hasOwnProperty.call(setTimeout,`clock`))&&jest.advanceTimersByTime(0);return}let e=setTimeout.clock;typeof e?.tick==`function`&&e.tick(0)}function drainWithTimer(e){setTimeout(()=>{e()},0),advanceFakeTimersIfEnabled()}let j=!1;(0,m.configure)({unstable_advanceTimersWrapper:e=>b(e),asyncWrapper:async e=>{let n=getIsReactActEnvironment();setReactActEnvironment(!1);try{let n=await e();return await new Promise(e=>{t(globalThis)?r(()=>o(globalThis)?e():drainWithTimer(e)):drainWithTimer(e)}),n}finally{setReactActEnvironment(n)}},eventWrapper:e=>{if(j)return e();j=!0;try{let t;return actReleasingSuspendedWork(()=>{t=e()}),t}finally{j=!1}}});const M=/* @__PURE__ */ new Set,N=[],P=/* @__PURE__ */ new WeakMap,F=/* @__PURE__ */ new WeakMap;function strictModeIfNeeded(t,n){return n??getConfig().reactStrictMode?e.createElement(e.StrictMode,null,t):t}function wrapUiIfNeeded(t,n){return n?e.createElement(n,null,t):t}function createConcurrentRoot(e,{hydrate:t,onCaughtError:n,onRecoverableError:r,ui:i,wrapper:a,reactStrictMode:o}){let s;if(t)try{actReleasingSuspendedWork(()=>{s=l.hydrateRoot(e,strictModeIfNeeded(wrapUiIfNeeded(i,a),o),{onCaughtError:n,onRecoverableError:r}),y.add(s)})}catch(e){throw y.delete(s),e}else s=l.createRoot(e,{onCaughtError:n,onRecoverableError:r}),y.add(s);return{hydrate(){if(!t)throw Error("Attempted to hydrate a non-hydrateable root. This is a bug in `@testing-library/react`.")},render(e){s.render(e)},unmount(){s.unmount(),y.delete(s)}}}const I=/* @__PURE__ */ new WeakMap;function resultTemplateFor(e){let t=I.get(e);return t===void 0&&(t={container:void 0,baseElement:void 0,debug:void 0,unmount:void 0,rerender:void 0,asFragment:void 0,...(0,m.getQueriesForElement)(e)},I.set(e,t)),t}function actRender(e,t,n,r,i){actReleasingSuspendedWork(()=>{n?t.hydrate():t.render(strictModeIfNeeded(wrapUiIfNeeded(e,r),i))})}function renderRoot(e,{baseElement:t,container:n,hydrate:r,queries:i,root:a,wrapper:o,reactStrictMode:l}){actRender(e,a,r,o,l);let debug=(e=t,n,r)=>Array.isArray(e)?e.forEach(e=>console.log((0,m.prettyDOM)(e,n,r))):console.log((0,m.prettyDOM)(e,n,r)),unmount=()=>{b(()=>{a.unmount()})},rerender=e=>{let rerender=()=>actRender(e,a,!1,o,l);c()?s(`react.rerender`,`rerender(${describeElement(e)})`,rerender):rerender()},asFragment=()=>{if(typeof document.createRange==`function`)return document.createRange().createContextualFragment(n.innerHTML);let e=document.createElement(`template`);return e.innerHTML=n.innerHTML,e.content};if(i!==void 0)return{container:n,baseElement:t,debug,unmount,rerender,asFragment,...(0,m.getQueriesForElement)(t,i)};let u={...resultTemplateFor(t)};return u.container=n,u.baseElement=t,u.debug=debug,u.unmount=unmount,u.rerender=rerender,u.asFragment=asFragment,u}function legacyRootError(e){let t=/* @__PURE__ */ Error("`legacyRoot: true` is not supported in this version of React. If your app runs React 19 or later, you should remove this flag. If your app runs React 18 or earlier, visit https://react.dev/blog/2022/03/08/react-18-upgrade-guide for upgrade instructions.");return Error.captureStackTrace(t,e),t}function render(e,t){return c()?s(`react.render`,`render(${describeElement(e)})`,()=>renderUntraced(e,t)):renderUntraced(e,t)}function describeElement(t){if(!e.isValidElement(t))return typeof t==`string`?JSON.stringify(t):String(t);let n=t;for(let e=0;e<10;e++){let e=isWrapper(n)?wrappedElement(n):null;if(e===null)break;n=e}return describeTree(n,0)}function describeTree(e,t){let n=componentName(e.type)||`Component`;if(typeof e.type!=`string`)return`<${n} />`;let r=e.props.children;if(r==null||r===!1)return`<${n} />`;let i=onlyElement(r);return i!==null&&t<2?`<${n}>${describeTree(i,t+1)}</${n}>`:`<${n}>…</${n}>`}function componentName(e){if(typeof e==`string`)return e;if(typeof e==`symbol`)return e.description?.replace(/^react\./,``)??``;let t=e;return(t?.displayName??t?.name??t?.render?.name??t?.type?.name??``).replace(/\$\d+$/,``)}const L=/(?:Providers?|Context|Router|Wrapper|Fragment|StrictMode|Suspense|Profiler)$/;function isWrapper(e){if(typeof e.type==`symbol`)return!0;let t=componentName(e.type);return L.test(t)||t===``&&onlyElement(e.props.children)!==null}function wrappedElement(e){let t=e.props;return onlyElement(t.children)??firstRouteElement(t.router?.routes)}function firstRouteElement(e){for(let t of e??[]){let e=onlyElement(t.element);if(e!==null&&componentName(e.type)!==`Outlet`)return e;let n=firstRouteElement(t.children);if(n!==null)return n}return null}function onlyElement(t){if(e.isValidElement(t))return t;if(!Array.isArray(t))return null;let n=t.filter(t=>e.isValidElement(t));return n.length===1?n[0]:null}function renderUntraced(e,{container:t,baseElement:r=t,legacyRoot:i=!1,onCaughtError:a,onUncaughtError:o,onRecoverableError:s,queries:c,hydrate:l=!1,wrapper:u,reactStrictMode:d}={}){if(o!==void 0)throw Error("onUncaughtError is not supported. The `render` call will already throw on uncaught errors.");if(i)throw legacyRootError(render);r||=document.body;let f=!1;if(!t){let e=P.get(document)?.pop();f=e===void 0,t=r.appendChild(e??document.createElement(`div`))}let p;if(!M.has(t))p=createConcurrentRoot(t,{hydrate:l,onCaughtError:a,onRecoverableError:s,ui:e,wrapper:u,reactStrictMode:d}),f&&F.set(t,{listeners:n(t),keys:Object.keys(t).length}),N.push({container:t,root:p}),M.add(t);else for(let e=0;e<N.length;e++){let n=N[e];n.container===t&&(p=n.root)}return renderRoot(e,{container:t,baseElement:r,queries:c,hydrate:l,wrapper:u,root:p,reactStrictMode:d})}function cleanup(){for(let e=0;e<N.length;e++){let{root:t,container:n}=N[e];if(b(()=>{t.unmount()}),n.parentNode===document.body){document.body.removeChild(n);let e=F.get(n);if(e!==void 0&&(n.onclick=null),e!==void 0&&a(n,e.listeners)&&Object.keys(n).length===e.keys){let e=P.get(document);e===void 0&&P.set(document,e=[]),e.length<8&&e.push(n)}}}N.length=0,M.clear()}i(`react`,{fileEnd(){cleanup(),dropHoistedResources()}});function dropHoistedResources(){for(let e of Object.keys(document)){if(!e.startsWith(`__reactResources$`))continue;let t=document[e];for(let e of[t?.hoistableStyles,t?.hoistableScripts])if(e instanceof Map)for(let t of e.values()){let e=t?.instance??t;typeof e?.remove==`function`&&e.remove()}delete document[e]}}function renderHook(t,n={}){let{initialProps:r,...i}=n;if(i.legacyRoot)throw legacyRootError(renderHook);let a=e.createRef();function TestComponent({renderCallbackProps:n}){let r=t(n);return e.useEffect(()=>{a.current=r}),null}let{rerender:o,unmount:s}=render(e.createElement(TestComponent,{renderCallbackProps:r}),i);function rerender(t){return o(e.createElement(TestComponent,{renderCallbackProps:t}))}return{result:a,rerender,unmount:s}}export{fireEvent as a,setReactActEnvironment as c,__exportAll as d,__reExport as f,renderHook as i,configure as l,A as n,b as o,render as r,getIsReactActEnvironment as s,cleanup as t,getConfig as u};
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,__exportAll=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},__copyProps=(r,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!i.call(r,d)&&d!==o&&e(r,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return r},__reExport=(e,t,n)=>(__copyProps(e,t,`default`),n&&__copyProps(n,t,`default`)),__toESM=(t,n,a)=>(a=t==null?{}:{__proto__:r(t)},__copyProps(n||!t||!t.__esModule||!i.call(t,`default`)?e(a,`default`,{value:t,enumerable:!0}):a,t));let a=require("react");a=__toESM(a,1);let o=require("@ctrl/dom/internal"),s=require("react-dom/client");s=__toESM(s,1);var c=/* @__PURE__ */ __exportAll({});__reExport(c,require("@ctrl/dom/testing-library"));let l={reactStrictMode:!1,releaseSuspendedWork:!0};function releaseSuspendedWorkEnabled(){return l.releaseSuspendedWork}function getConfig(){return{...(0,c.getConfig)(),...l}}function configure(e){typeof e==`function`&&(e=e(getConfig()));let{reactStrictMode:t,releaseSuspendedWork:n,...r}=e;(0,c.configure)(r),l={...l,reactStrictMode:t,releaseSuspendedWork:n??l.releaseSuspendedWork}}const u=a.act;function setReactActEnvironment(e){globalThis.IS_REACT_ACT_ENVIRONMENT=e}function getIsReactActEnvironment(){return globalThis.IS_REACT_ACT_ENVIRONMENT}const d=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,f=/* @__PURE__ */ new Set;function flushReleasingSuspendedWork(e){let t=!1,n=0;try{for(;n<e.length;n++){let r=e[n];for(;r!==null;)if(d.didUsePromise=!1,r=r(!1),r!==null&&d.didUsePromise){t=!0;break}}e.length=0}catch(t){e.splice(0,n+1),d.thrownErrors.unshift(t)}if(t)for(let e of f){let t=e._internalRoot,n=t?.callbackNode;n!=null&&n.callback===void 0&&(t.callbackNode=null,t.callbackPriority=0)}return d.thrownErrors.splice(0)}function isThenable(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}function withGlobalActEnvironment(e){return t=>{let n=getIsReactActEnvironment();setReactActEnvironment(!0);try{let r=!1,i=e(()=>{let e=t();return isThenable(e)&&(r=!0),e});if(r){let e=i;return{then:(t,r)=>{e.then(e=>{setReactActEnvironment(n),t(e)},e=>{setReactActEnvironment(n),r(e)})}}}return setReactActEnvironment(n),i}catch(e){throw setReactActEnvironment(n),e}}}const p=withGlobalActEnvironment(u);function actReleasingSuspendedWork(e){if(d.actQueue!==null||!releaseSuspendedWorkEnabled()){p(e);return}let t=[];try{p(()=>{let n=d.actQueue;e(),t=flushReleasingSuspendedWork(n)})}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t)}const fireEvent=((...e)=>(0,c.fireEvent)(...e)),m=fireEvent,h=c.fireEvent;for(let e of Object.keys(c.fireEvent))m[e]=(...t)=>h[e](...t);const g=m.mouseEnter,_=m.mouseLeave;m.mouseEnter=(...e)=>(g(...e),m.mouseOver(...e)),m.mouseLeave=(...e)=>(_(...e),m.mouseOut(...e));const v=m.pointerEnter,y=m.pointerLeave;m.pointerEnter=(...e)=>(v(...e),m.pointerOver(...e)),m.pointerLeave=(...e)=>(y(...e),m.pointerOut(...e));const b=m.select;m.select=(e,t)=>{b(e,t),e.focus(),m.keyUp(e,t)};const x=m.blur,S=m.focus;m.blur=(...e)=>(m.focusOut(...e),x(...e)),m.focus=(...e)=>(m.focusIn(...e),S(...e));var C=/* @__PURE__ */ __exportAll({act:()=>p,cleanup:()=>cleanup,configure:()=>configure,fireEvent:()=>fireEvent,getConfig:()=>getConfig,render:()=>render,renderHook:()=>renderHook});__reExport(C,c);function advanceFakeTimersIfEnabled(){if(typeof jest<`u`&&jest!==null){(setTimeout._isMockFunction===!0||Object.prototype.hasOwnProperty.call(setTimeout,`clock`))&&jest.advanceTimersByTime(0);return}let e=setTimeout.clock;typeof e?.tick==`function`&&e.tick(0)}function drainWithTimer(e){setTimeout(()=>{e()},0),advanceFakeTimersIfEnabled()}let w=!1;(0,c.configure)({unstable_advanceTimersWrapper:e=>p(e),asyncWrapper:async e=>{let t=getIsReactActEnvironment();setReactActEnvironment(!1);try{let t=await e();return await new Promise(e=>{(0,o.canSkipZeroDelayWait)(globalThis)?(0,o.loopTurn)(()=>(0,o.skipZeroDelayWait)(globalThis)?e():drainWithTimer(e)):drainWithTimer(e)}),t}finally{setReactActEnvironment(t)}},eventWrapper:e=>{if(w)return e();w=!0;try{let t;return actReleasingSuspendedWork(()=>{t=e()}),t}finally{w=!1}}});const T=/* @__PURE__ */ new Set,E=[],D=/* @__PURE__ */ new WeakMap,O=/* @__PURE__ */ new WeakMap;function strictModeIfNeeded(e,t){return t??getConfig().reactStrictMode?a.createElement(a.StrictMode,null,e):e}function wrapUiIfNeeded(e,t){return t?a.createElement(t,null,e):e}function createConcurrentRoot(e,{hydrate:t,onCaughtError:n,onRecoverableError:r,ui:i,wrapper:a,reactStrictMode:o}){let c;if(t)try{actReleasingSuspendedWork(()=>{c=s.hydrateRoot(e,strictModeIfNeeded(wrapUiIfNeeded(i,a),o),{onCaughtError:n,onRecoverableError:r}),f.add(c)})}catch(e){throw f.delete(c),e}else c=s.createRoot(e,{onCaughtError:n,onRecoverableError:r}),f.add(c);return{hydrate(){if(!t)throw Error("Attempted to hydrate a non-hydrateable root. This is a bug in `@testing-library/react`.")},render(e){c.render(e)},unmount(){c.unmount(),f.delete(c)}}}const k=/* @__PURE__ */ new WeakMap;function resultTemplateFor(e){let t=k.get(e);return t===void 0&&(t={container:void 0,baseElement:void 0,debug:void 0,unmount:void 0,rerender:void 0,asFragment:void 0,...(0,c.getQueriesForElement)(e)},k.set(e,t)),t}function actRender(e,t,n,r,i){actReleasingSuspendedWork(()=>{n?t.hydrate():t.render(strictModeIfNeeded(wrapUiIfNeeded(e,r),i))})}function renderRoot(e,{baseElement:t,container:n,hydrate:r,queries:i,root:a,wrapper:s,reactStrictMode:l}){actRender(e,a,r,s,l);let debug=(e=t,n,r)=>Array.isArray(e)?e.forEach(e=>console.log((0,c.prettyDOM)(e,n,r))):console.log((0,c.prettyDOM)(e,n,r)),unmount=()=>{p(()=>{a.unmount()})},rerender=e=>{let rerender=()=>actRender(e,a,!1,s,l);(0,o.tracing)()?(0,o.traceSync)(`react.rerender`,`rerender(${describeElement(e)})`,rerender):rerender()},asFragment=()=>{if(typeof document.createRange==`function`)return document.createRange().createContextualFragment(n.innerHTML);let e=document.createElement(`template`);return e.innerHTML=n.innerHTML,e.content};if(i!==void 0)return{container:n,baseElement:t,debug,unmount,rerender,asFragment,...(0,c.getQueriesForElement)(t,i)};let u={...resultTemplateFor(t)};return u.container=n,u.baseElement=t,u.debug=debug,u.unmount=unmount,u.rerender=rerender,u.asFragment=asFragment,u}function legacyRootError(e){let t=/* @__PURE__ */ Error("`legacyRoot: true` is not supported in this version of React. If your app runs React 19 or later, you should remove this flag. If your app runs React 18 or earlier, visit https://react.dev/blog/2022/03/08/react-18-upgrade-guide for upgrade instructions.");return Error.captureStackTrace(t,e),t}function render(e,t){return(0,o.tracing)()?(0,o.traceSync)(`react.render`,`render(${describeElement(e)})`,()=>renderUntraced(e,t)):renderUntraced(e,t)}function describeElement(e){if(!a.isValidElement(e))return typeof e==`string`?JSON.stringify(e):String(e);let t=e;for(let e=0;e<10;e++){let e=isWrapper(t)?wrappedElement(t):null;if(e===null)break;t=e}return describeTree(t,0)}function describeTree(e,t){let n=componentName(e.type)||`Component`;if(typeof e.type!=`string`)return`<${n} />`;let r=e.props.children;if(r==null||r===!1)return`<${n} />`;let i=onlyElement(r);return i!==null&&t<2?`<${n}>${describeTree(i,t+1)}</${n}>`:`<${n}>…</${n}>`}function componentName(e){if(typeof e==`string`)return e;if(typeof e==`symbol`)return e.description?.replace(/^react\./,``)??``;let t=e;return(t?.displayName??t?.name??t?.render?.name??t?.type?.name??``).replace(/\$\d+$/,``)}const A=/(?:Providers?|Context|Router|Wrapper|Fragment|StrictMode|Suspense|Profiler)$/;function isWrapper(e){if(typeof e.type==`symbol`)return!0;let t=componentName(e.type);return A.test(t)||t===``&&onlyElement(e.props.children)!==null}function wrappedElement(e){let t=e.props;return onlyElement(t.children)??firstRouteElement(t.router?.routes)}function firstRouteElement(e){for(let t of e??[]){let e=onlyElement(t.element);if(e!==null&&componentName(e.type)!==`Outlet`)return e;let n=firstRouteElement(t.children);if(n!==null)return n}return null}function onlyElement(e){if(a.isValidElement(e))return e;if(!Array.isArray(e))return null;let t=e.filter(e=>a.isValidElement(e));return t.length===1?t[0]:null}function renderUntraced(e,{container:t,baseElement:n=t,legacyRoot:r=!1,onCaughtError:i,onUncaughtError:a,onRecoverableError:s,queries:c,hydrate:l=!1,wrapper:u,reactStrictMode:d}={}){if(a!==void 0)throw Error("onUncaughtError is not supported. The `render` call will already throw on uncaught errors.");if(r)throw legacyRootError(render);n||=document.body;let f=!1;if(!t){let e=D.get(document)?.pop();f=e===void 0,t=n.appendChild(e??document.createElement(`div`))}let p;if(!T.has(t))p=createConcurrentRoot(t,{hydrate:l,onCaughtError:i,onRecoverableError:s,ui:e,wrapper:u,reactStrictMode:d}),f&&O.set(t,{listeners:(0,o.listenerCount)(t),keys:Object.keys(t).length}),E.push({container:t,root:p}),T.add(t);else for(let e=0;e<E.length;e++){let n=E[e];n.container===t&&(p=n.root)}return renderRoot(e,{container:t,baseElement:n,queries:c,hydrate:l,wrapper:u,root:p,reactStrictMode:d})}function cleanup(){for(let e=0;e<E.length;e++){let{root:t,container:n}=E[e];if(p(()=>{t.unmount()}),n.parentNode===document.body){document.body.removeChild(n);let e=O.get(n);if(e!==void 0&&(n.onclick=null),e!==void 0&&(0,o.reusableElement)(n,e.listeners)&&Object.keys(n).length===e.keys){let e=D.get(document);e===void 0&&D.set(document,e=[]),e.length<8&&e.push(n)}}}E.length=0,T.clear()}(0,o.registerTestHooks)(`react`,{fileEnd(){cleanup(),dropHoistedResources()}});function dropHoistedResources(){for(let e of Object.keys(document)){if(!e.startsWith(`__reactResources$`))continue;let t=document[e];for(let e of[t?.hoistableStyles,t?.hoistableScripts])if(e instanceof Map)for(let t of e.values()){let e=t?.instance??t;typeof e?.remove==`function`&&e.remove()}delete document[e]}}function renderHook(e,t={}){let{initialProps:n,...r}=t;if(r.legacyRoot)throw legacyRootError(renderHook);let i=a.createRef();function TestComponent({renderCallbackProps:t}){let n=e(t);return a.useEffect(()=>{i.current=n}),null}let{rerender:o,unmount:s}=render(a.createElement(TestComponent,{renderCallbackProps:n}),r);function rerender(e){return o(a.createElement(TestComponent,{renderCallbackProps:e}))}return{result:i,rerender,unmount:s}}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return fireEvent}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return setReactActEnvironment}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return __exportAll}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return __reExport}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return renderHook}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return configure}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return render}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return getIsReactActEnvironment}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return cleanup}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return getConfig}});
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/pure-DOgNQrwu.cjs");var t=/* @__PURE__ */ e.d({act:()=>e.o,cleanup:()=>e.t,configure:()=>e.l,fireEvent:()=>e.a,getConfig:()=>e.u,render:()=>e.r,renderHook:()=>e.i});if(e.f(t,e.n),(typeof process>`u`||!process.env?.RTL_SKIP_AUTO_CLEANUP)&&(typeof afterEach==`function`?afterEach(()=>{e.t()}):typeof teardown==`function`&&teardown(()=>{e.t()}),typeof beforeAll==`function`&&typeof afterAll==`function`)){let t=e.s();beforeAll(()=>{t=e.s(),e.c(!0)}),afterAll(()=>{e.c(t)})}exports.act=e.o,exports.cleanup=e.t,exports.configure=e.l,exports.fireEvent=e.a,exports.getConfig=e.u,exports.render=e.r,exports.renderHook=e.i;var n=require("@ctrl/dom/testing-library");Object.keys(n).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})});
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/pure-DRugbA0j.cjs");let t=require("@ctrl/dom/internal");var n=/* @__PURE__ */ e.d({act:()=>e.o,cleanup:()=>e.t,configure:()=>e.l,fireEvent:()=>e.a,getConfig:()=>e.u,render:()=>e.r,renderHook:()=>e.i});if(e.f(n,e.n),(typeof process>`u`||!process.env?.RTL_SKIP_AUTO_CLEANUP)&&(typeof afterEach==`function`?(afterEach(()=>{e.t()}),(0,t.registerTestHooks)(`react`,{afterEach:e.t})):typeof teardown==`function`&&teardown(()=>{e.t()}),typeof beforeAll==`function`&&typeof afterAll==`function`)){let n=e.s(),enterActEnvironment=()=>{n=e.s(),e.c(!0)},leaveActEnvironment=()=>{e.c(n)};beforeAll(enterActEnvironment),afterAll(leaveActEnvironment),(0,t.registerTestHooks)(`react`,{beforeAll:enterActEnvironment,afterAll:leaveActEnvironment})}exports.act=e.o,exports.cleanup=e.t,exports.configure=e.l,exports.fireEvent=e.a,exports.getConfig=e.u,exports.render=e.r,exports.renderHook=e.i;var r=require("@ctrl/dom/testing-library");Object.keys(r).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})});
@@ -1 +1 @@
1
- import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./_chunks/pure-D7Z4g4oF.js";export*from"@ctrl/dom/testing-library";if(r(/* @__PURE__ */ n({act:()=>s,cleanup:()=>u,configure:()=>a,fireEvent:()=>e,getConfig:()=>d,render:()=>c,renderHook:()=>i}),o),(typeof process>`u`||!process.env?.RTL_SKIP_AUTO_CLEANUP)&&(typeof afterEach==`function`?afterEach(()=>{u()}):typeof teardown==`function`&&teardown(()=>{u()}),typeof beforeAll==`function`&&typeof afterAll==`function`)){let e=l();beforeAll(()=>{e=l(),t(!0)}),afterAll(()=>{t(e)})}export{s as act,u as cleanup,a as configure,e as fireEvent,d as getConfig,c as render,i as renderHook};
1
+ import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./_chunks/pure-CYb0HgYU.js";import{registerTestHooks as f}from"@ctrl/dom/internal";export*from"@ctrl/dom/testing-library";if(r(/* @__PURE__ */ n({act:()=>s,cleanup:()=>u,configure:()=>a,fireEvent:()=>e,getConfig:()=>d,render:()=>c,renderHook:()=>i}),o),(typeof process>`u`||!process.env?.RTL_SKIP_AUTO_CLEANUP)&&(typeof afterEach==`function`?(afterEach(()=>{u()}),f(`react`,{afterEach:u})):typeof teardown==`function`&&teardown(()=>{u()}),typeof beforeAll==`function`&&typeof afterAll==`function`)){let e=l(),enterActEnvironment=()=>{e=l(),t(!0)},leaveActEnvironment=()=>{t(e)};beforeAll(enterActEnvironment),afterAll(leaveActEnvironment),f(`react`,{beforeAll:enterActEnvironment,afterAll:leaveActEnvironment})}export{s as act,u as cleanup,a as configure,e as fireEvent,d as getConfig,c as render,i as renderHook};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/pure-DOgNQrwu.cjs");exports.act=e.o,exports.cleanup=e.t,exports.configure=e.l,exports.fireEvent=e.a,exports.getConfig=e.u,exports.render=e.r,exports.renderHook=e.i;var t=require("@ctrl/dom/testing-library");Object.keys(t).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})});
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/pure-DRugbA0j.cjs");exports.act=e.o,exports.cleanup=e.t,exports.configure=e.l,exports.fireEvent=e.a,exports.getConfig=e.u,exports.render=e.r,exports.renderHook=e.i;var t=require("@ctrl/dom/testing-library");Object.keys(t).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})});
@@ -1 +1 @@
1
- export{o as act,t as cleanup,l as configure,a as fireEvent,u as getConfig,r as render,i as renderHook}from"./_chunks/pure-D7Z4g4oF.js";export*from"@ctrl/dom/testing-library";
1
+ export{o as act,t as cleanup,l as configure,a as fireEvent,u as getConfig,r as render,i as renderHook}from"./_chunks/pure-CYb0HgYU.js";export*from"@ctrl/dom/testing-library";
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/aria-snapshot-diff-BXYf4D_D.cjs");let t=require("@ctrl/dom/internal"),n=require("@ctrl/dom/aria"),r=require("@ctrl/dom/aria/internal"),i=require("node:async_hooks");function isLabelable(e){if(e.type!==t.ELEMENT_NODE||e.ns!==t.HTML_NS)return!1;switch(e.tag){case t.T.button:case t.T.meter:case t.T.output:case t.T.progress:case t.T.select:case t.T.textarea:return!0;case t.T.input:{let n=(0,t.attr)(e,`type`);return n===null||(0,t.asciiLowercase)(n)!==`hidden`}}return!1}function isLabelledNodeName(e){if(e.prefix!==null)return!1;switch((0,t.asciiLowercase)(e.name)){case`button`:case`meter`:case`output`:case`progress`:case`select`:case`textarea`:case`input`:return!0}return!1}function buildIdMap(e,n){let r=/* @__PURE__ */ new Map;n&&e.type===t.ELEMENT_NODE&&e.id!==``&&r.set(e.id,e);for(let n=e.first;n!==null;n=(0,t.nextInTree)(n,e))n.type===t.ELEMENT_NODE&&n.id!==``&&!r.has(n.id)&&r.set(n.id,n);return r}var LabelContext=class{container;containerIds;sameTree;labelMap;constructor(e,t=!1){this.container=e,this.containerIds=null,this.sameTree=t,this.labelMap=null}labelsOf(e){return this.sameTree?isLabelable(e)?(this.labelMap??=(0,r.labelMapForTree)(this.container)).get(e)??a:a:(0,r.labelsOf)(e)??a}byIdInContainer(e){let t=this.containerIds;return t===null&&(t=this.containerIds=buildIdMap(this.container,!1)),t.get(e)??null}};const a=[];function getTextContent(e){if(e.type===t.ELEMENT_NODE&&isLabelledNodeName(e))return``;if(e.type===t.TEXT_NODE)return e.data;let n=``;for(let t=e.first;t!==null;t=t.next)n+=getTextContent(t);return n}function getLabelContentImpl(e){if(e.tag===t.T.label&&e.ns===t.HTML_NS)return getTextContent(e);let n=e.node;return n.value||n.textContent}const o=/* @__PURE__ */ new Set([`button`,`input`,`meter`,`output`,`progress`,`select`,`textarea`]);function labelledFormControl(n,r){for(let i=n.first;i!==null;i=(0,t.nextInTree)(i,n))if(i.type===t.ELEMENT_NODE&&o.has(i.name)&&(r===`*`||e.T(i,r)))return i}function getLabelsImpl(e,n,r=`*`){let i=(0,t.ariaAttr)(n,`aria-labelledby`),a=i?i.split(` `):[];return a.length?a.map(t=>{let n=e.byIdInContainer(t);return n?{content:getLabelContentImpl(n),formControl:null}:{content:``,formControl:null}}):e.labelsOf(n).map(e=>({content:getLabelContentImpl(e),formControl:labelledFormControl(e,r)}))}function assertNotNullOrUndefined(e){if(e==null)throw Error(`It looks like ${e} was passed instead of a matcher. Did you do something like getByText(${e})?`)}function fuzzyMatches(e,t,n,r){if(typeof e!=`string`)return!1;assertNotNullOrUndefined(n);let i=r(e);return typeof n==`string`||typeof n==`number`?i.toLowerCase().includes(n.toString().toLowerCase()):typeof n==`function`?n(i,t):matchRegExp(n,i)}function matches(e,t,n,r){if(typeof e!=`string`)return!1;assertNotNullOrUndefined(n);let i=r(e);return n instanceof Function?n(i,t):n instanceof RegExp?matchRegExp(n,i):i===String(n)}function isRegExpWhitespace(e){return e<=32?e===32||e>=9&&e<=13:e<160?!1:e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function changedByNormalizing(e,t,n){let r=e.length-1,i=!1;for(let a=0;a<=r;a++){let o=e.charCodeAt(a),s=isRegExpWhitespace(o);if(s&&(t&&(a===0||a===r)||n&&(i||o!==32)))return!0;i=s}return!1}const s=/\s+/g;function getDefaultNormalizer({trim:e=!0,collapseWhitespace:t=!0}={}){return n=>{if(!changedByNormalizing(n,e,t))return n;let r=n;return r=e?r.trim():r,r=t?r.replace(s,` `):r,r}}const c=getDefaultNormalizer();function textMatcher(e,t,n){if(!e)return(e,r)=>fuzzyMatches(e,r,t,n);if(n!==c||typeof t!=`string`&&typeof t!=`number`)return(e,r)=>matches(e,r,t,n);let r=String(t);if(changedByNormalizing(r,!0,!0))return()=>!1;let i=r.length,a=r.charCodeAt(0),o=r.charCodeAt(i-1);return e=>{if(typeof e!=`string`||e.length<i)return!1;if(i!==0){let t=e.charCodeAt(0);if(t!==a&&!isRegExpWhitespace(t))return!1;let n=e.charCodeAt(e.length-1);if(n!==o&&!isRegExpWhitespace(n))return!1}return c(e)===r}}function makeNormalizer({trim:e,collapseWhitespace:t,normalizer:n}){if(!n)return e===void 0&&t===void 0?c:getDefaultNormalizer({trim:e,collapseWhitespace:t});if(e!==void 0||t!==void 0)throw Error(`trim and collapseWhitespace are not supported with a normalizer. If you want to use the default trim and collapseWhitespace logic in your normalizer, use "getDefaultNormalizer({trim, collapseWhitespace})" and compose that into your normalizer`);return n}function matchRegExp(e,t){let n=e.test(t);return e.global&&e.lastIndex!==0&&(console.warn(`To match all elements we had to reset the lastIndex of the RegExp because the global flag is enabled. We encourage to remove the global flag from the RegExp.`),e.lastIndex=0),n}function isButtonLikeInput(e){if(e.tag!==t.T.input||e.ns!==t.HTML_NS)return!1;let n=(0,t.attr)(e,`type`);if(n===null)return!1;let r=(0,t.asciiLowercase)(n);return r===`submit`||r===`button`||r===`reset`}function getNodeTextImpl(e){if(isButtonLikeInput(e))return e.node.value;let n=``;for(let r=e.first;r!==null;r=r.next)r.type===t.TEXT_NODE&&(n+=r.data);return n}function getNodeText(n){let r=e.A(n);return r.type===t.ELEMENT_NODE?getNodeTextImpl(r):n.matches(`input[type=submit], input[type=button], input[type=reset]`)}const l={computedStyleSupportsPseudoElements:!0};function styleOverride(e){return(0,t.getComputedStyleOverride)(e)}function nameOptions(e,t){return t===null?e?l:void 0:{computedStyleSupportsPseudoElements:e,getComputedStyle:t}}const u={implicitRole(e){let t=(0,r.implicitRole)(e);return t===``?null:t},roleMatches:r.tlRoleMatches,roleSupportsProp(e,t){return typeof e==`string`&&(0,n.roleSupportsProp)(e,t)},computeAccessibleName(e,t,n){return(0,r.computeAccessibleNameImpl)(e,nameOptions(t,n),5)},computeAccessibleDescription(e,t,n){return(0,r.computeAccessibleDescriptionImpl)(e,nameOptions(t,n),5)},isInaccessible:r.isInaccessibleImpl,isInaccessibleWithStyle:r.isInaccessibleWithStyle,isSubtreeInaccessible:r.isSubtreeInaccessibleImpl};function parentElement(e){let n=e.parent;return n!==null&&n.type===t.ELEMENT_NODE?n:null}function isInaccessibleImpl$1(e){return u.isInaccessible(e)}e.N(isInaccessibleImpl$1,`isInaccessibleImpl`);function isInaccessibleChecked(e){let t=styleOverride(e);return t===null?u.isInaccessible(e):u.isInaccessibleWithStyle(e,t,null)}function isInaccessible(t,n={}){let i=e.A(t),a=n.isSubtreeInaccessible,o=styleOverride(i);if(a===void 0)return o===null?isInaccessibleImpl$1(i):u.isInaccessibleWithStyle(i,o,null);if(o===null?(0,r.isVisibilityHidden)(i):o(t).visibility===`hidden`)return!0;for(let e=i;e!==null;e=parentElement(e))if(a(e.node))return!0;return!1}function getImplicitAriaRolesImpl(e){let t=u.implicitRole(e);return t===null?[]:[t]}function getRoles(n,{hidden:r=!1}={}){let i=e.A(n),a={},o=r===!1?styleOverride(i):null,s=o===null?null:/* @__PURE__ */ new Map,visit=e=>{if(r!==!1||(o===null?isInaccessibleImpl$1(e):u.isInaccessibleWithStyle(e,o,s))===!1){let n=(0,t.attr)(e,`role`),r=n===null?getImplicitAriaRolesImpl(e):n.split(` `).slice(0,1);for(let t of r){let n=a[t];Array.isArray(n)?n.push(e.node):a[t]=[e.node]}}for(let n=e.first;n!==null;n=n.next)n.type===t.ELEMENT_NODE&&visit(n)};return visit(i),a}const d={format:`pretty`};function prettyRoles(t,{hidden:n,includeDescription:r}){let i=getRoles(t,{hidden:n}),a=e.i().computedStyleSupportsPseudoElements,o=styleOverride(e.A(t));return Object.entries(i).filter(([e])=>e!==`generic`).map(([t,n])=>{let i=`-`.repeat(50);return`${t}:\n\n${n.map(t=>{let n=e.A(t),i=`Name "${u.computeAccessibleName(n,a,o)}":\n`,s=e.s(t.cloneNode(!1),void 0,d);return r?`${i}${`Description "${u.computeAccessibleDescription(n,a,o)}":\n`}${s}`:`${i}${s}`}).join(`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/aria-snapshot-diff-BXYf4D_D.cjs");let t=require("@ctrl/dom/internal"),n=require("@ctrl/dom/aria"),r=require("@ctrl/dom/aria/internal"),i=require("node:async_hooks");function isLabelledNodeName(e){if(e.prefix!==null)return!1;switch((0,t.asciiLowercase)(e.name)){case`button`:case`meter`:case`output`:case`progress`:case`select`:case`textarea`:case`input`:return!0}return!1}function buildIdMap(e,n){let r=/* @__PURE__ */ new Map;n&&e.type===t.ELEMENT_NODE&&e.id!==``&&r.set(e.id,e);for(let n=e.first;n!==null;n=(0,t.nextInTree)(n,e))n.type===t.ELEMENT_NODE&&n.id!==``&&!r.has(n.id)&&r.set(n.id,n);return r}var LabelContext=class{container;containerIds;sameTree;labelMap;constructor(e,t=!1){this.container=e,this.containerIds=null,this.sameTree=t,this.labelMap=null}labelsOf(e){return this.sameTree?(this.labelMap??=(0,r.labelMapForTree)(this.container)).get(e)??a:(0,r.labelsOf)(e)??a}byIdInContainer(e){let t=this.containerIds;return t===null&&(t=this.containerIds=buildIdMap(this.container,!1)),t.get(e)??null}};const a=[];function getTextContent(e){if(e.type===t.ELEMENT_NODE&&isLabelledNodeName(e))return``;if(e.type===t.TEXT_NODE)return e.data;let n=``;for(let t=e.first;t!==null;t=t.next)n+=getTextContent(t);return n}function getLabelContentImpl(e){if(e.tag===t.T.label&&e.ns===t.HTML_NS)return getTextContent(e);let n=e.node;return n.value||n.textContent}const o=/* @__PURE__ */ new Set([`button`,`input`,`meter`,`output`,`progress`,`select`,`textarea`]);function labelledFormControl(n,r){for(let i=n.first;i!==null;i=(0,t.nextInTree)(i,n))if(i.type===t.ELEMENT_NODE&&o.has(i.name)&&(r===`*`||e.T(i,r)))return i}function getLabelsImpl(e,n,r=`*`){let i=(0,t.ariaAttr)(n,`aria-labelledby`),a=i?i.split(` `):[];return a.length?a.map(t=>{let n=e.byIdInContainer(t);return n?{content:getLabelContentImpl(n),formControl:null}:{content:``,formControl:null}}):e.labelsOf(n).map(e=>({content:getLabelContentImpl(e),formControl:labelledFormControl(e,r)}))}function assertNotNullOrUndefined(e){if(e==null)throw Error(`It looks like ${e} was passed instead of a matcher. Did you do something like getByText(${e})?`)}function fuzzyMatches(e,t,n,r){if(typeof e!=`string`)return!1;assertNotNullOrUndefined(n);let i=r(e);return typeof n==`string`||typeof n==`number`?i.toLowerCase().includes(n.toString().toLowerCase()):typeof n==`function`?n(i,t):matchRegExp(n,i)}function matches(e,t,n,r){if(typeof e!=`string`)return!1;assertNotNullOrUndefined(n);let i=r(e);return n instanceof Function?n(i,t):n instanceof RegExp?matchRegExp(n,i):i===String(n)}function isRegExpWhitespace(e){return e<=32?e===32||e>=9&&e<=13:e<160?!1:e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function changedByNormalizing(e,t,n){let r=e.length-1,i=!1;for(let a=0;a<=r;a++){let o=e.charCodeAt(a),s=isRegExpWhitespace(o);if(s&&(t&&(a===0||a===r)||n&&(i||o!==32)))return!0;i=s}return!1}const s=/\s+/g;function getDefaultNormalizer({trim:e=!0,collapseWhitespace:t=!0}={}){return n=>{if(!changedByNormalizing(n,e,t))return n;let r=n;return r=e?r.trim():r,r=t?r.replace(s,` `):r,r}}const c=getDefaultNormalizer();function textMatcher(e,t,n){if(!e)return(e,r)=>fuzzyMatches(e,r,t,n);if(n!==c||typeof t!=`string`&&typeof t!=`number`)return(e,r)=>matches(e,r,t,n);let r=String(t);if(changedByNormalizing(r,!0,!0))return()=>!1;let i=r.length,a=r.charCodeAt(0),o=r.charCodeAt(i-1);return e=>{if(typeof e!=`string`||e.length<i)return!1;if(i!==0){let t=e.charCodeAt(0);if(t!==a&&!isRegExpWhitespace(t))return!1;let n=e.charCodeAt(e.length-1);if(n!==o&&!isRegExpWhitespace(n))return!1}return c(e)===r}}function makeNormalizer({trim:e,collapseWhitespace:t,normalizer:n}){if(!n)return e===void 0&&t===void 0?c:getDefaultNormalizer({trim:e,collapseWhitespace:t});if(e!==void 0||t!==void 0)throw Error(`trim and collapseWhitespace are not supported with a normalizer. If you want to use the default trim and collapseWhitespace logic in your normalizer, use "getDefaultNormalizer({trim, collapseWhitespace})" and compose that into your normalizer`);return n}function matchRegExp(e,t){let n=e.test(t);return e.global&&e.lastIndex!==0&&(console.warn(`To match all elements we had to reset the lastIndex of the RegExp because the global flag is enabled. We encourage to remove the global flag from the RegExp.`),e.lastIndex=0),n}function isButtonLikeInput(e){if(e.tag!==t.T.input||e.ns!==t.HTML_NS)return!1;let n=(0,t.attr)(e,`type`);if(n===null)return!1;let r=(0,t.asciiLowercase)(n);return r===`submit`||r===`button`||r===`reset`}function getNodeTextImpl(e){if(isButtonLikeInput(e))return e.node.value;let n=``;for(let r=e.first;r!==null;r=r.next)r.type===t.TEXT_NODE&&(n+=r.data);return n}function getNodeText(n){let r=e.A(n);return r.type===t.ELEMENT_NODE?getNodeTextImpl(r):n.matches(`input[type=submit], input[type=button], input[type=reset]`)}const l={computedStyleSupportsPseudoElements:!0};function styleOverride(e){return(0,t.getComputedStyleOverride)(e)}function nameOptions(e,t){return t===null?e?l:void 0:{computedStyleSupportsPseudoElements:e,getComputedStyle:t}}const u={implicitRole(e){let t=(0,r.implicitRole)(e);return t===``?null:t},roleMatches:r.tlRoleMatches,roleSupportsProp(e,t){return typeof e==`string`&&(0,n.roleSupportsProp)(e,t)},computeAccessibleName(e,t,n){return(0,r.computeAccessibleNameImpl)(e,nameOptions(t,n),5)},computeAccessibleDescription(e,t,n){return(0,r.computeAccessibleDescriptionImpl)(e,nameOptions(t,n),5)},isInaccessible:r.isInaccessibleImpl,isInaccessibleWithStyle:r.isInaccessibleWithStyle,isSubtreeInaccessible:r.isSubtreeInaccessibleImpl};function parentElement(e){let n=e.parent;return n!==null&&n.type===t.ELEMENT_NODE?n:null}function isInaccessibleImpl$1(e){return u.isInaccessible(e)}e.N(isInaccessibleImpl$1,`isInaccessibleImpl`);function isInaccessibleChecked(e){let t=styleOverride(e);return t===null?u.isInaccessible(e):u.isInaccessibleWithStyle(e,t,null)}function isInaccessible(t,n={}){let i=e.A(t),a=n.isSubtreeInaccessible,o=styleOverride(i);if(a===void 0)return o===null?isInaccessibleImpl$1(i):u.isInaccessibleWithStyle(i,o,null);if(o===null?(0,r.isVisibilityHidden)(i):o(t).visibility===`hidden`)return!0;for(let e=i;e!==null;e=parentElement(e))if(a(e.node))return!0;return!1}function getImplicitAriaRolesImpl(e){let t=u.implicitRole(e);return t===null?[]:[t]}function getRoles(n,{hidden:r=!1}={}){let i=e.A(n),a={},o=r===!1?styleOverride(i):null,s=o===null?null:/* @__PURE__ */ new Map,visit=e=>{if(r!==!1||(o===null?isInaccessibleImpl$1(e):u.isInaccessibleWithStyle(e,o,s))===!1){let n=(0,t.attr)(e,`role`),r=n===null?getImplicitAriaRolesImpl(e):n.split(` `).slice(0,1);for(let t of r){let n=a[t];Array.isArray(n)?n.push(e.node):a[t]=[e.node]}}for(let n=e.first;n!==null;n=n.next)n.type===t.ELEMENT_NODE&&visit(n)};return visit(i),a}const d={format:`pretty`};function prettyRoles(t,{hidden:n,includeDescription:r}){let i=getRoles(t,{hidden:n}),a=e.i().computedStyleSupportsPseudoElements,o=styleOverride(e.A(t));return Object.entries(i).filter(([e])=>e!==`generic`).map(([t,n])=>{let i=`-`.repeat(50);return`${t}:\n\n${n.map(t=>{let n=e.A(t),i=`Name "${u.computeAccessibleName(n,a,o)}":\n`,s=e.s(t.cloneNode(!1),void 0,d);return r?`${i}${`Description "${u.computeAccessibleDescription(n,a,o)}":\n`}${s}`:`${i}${s}`}).join(`
2
2
 
3
3
  `)}\n\n${i}`}).join(`
4
4
  `)}const logRoles=(e,{hidden:t=!1}={})=>console.log(prettyRoles(e,{hidden:t}));function checkBooleanAttribute(e,n){let r=(0,t.attr)(e,n);if(r===`true`)return!0;if(r===`false`)return!1}function computeAriaSelected(e){return e.tag===t.T.option&&e.ns===t.HTML_NS?e.node.selected:checkBooleanAttribute(e,`aria-selected`)}function computeAriaBusy(e){return(0,t.ariaAttr)(e,`aria-busy`)===`true`}function computeAriaChecked(e){let t=e.node;if(!(`indeterminate`in t&&t.indeterminate))return`checked`in t?t.checked:checkBooleanAttribute(e,`aria-checked`)}function computeAriaPressed(e){return checkBooleanAttribute(e,`aria-pressed`)}function computeAriaCurrent(e){return checkBooleanAttribute(e,`aria-current`)??(0,t.ariaAttr)(e,`aria-current`)??!1}function computeAriaExpanded(e){return checkBooleanAttribute(e,`aria-expanded`)}function computeHeadingLevelImpl(e){let n=(0,t.ariaAttr)(e,`aria-level`),r=n&&Number(n);if(r)return r;if(e.ns===t.HTML_NS)switch(e.tag){case t.T.h1:return 1;case t.T.h2:return 2;case t.T.h3:return 3;case t.T.h4:return 4;case t.T.h5:return 5;case t.T.h6:return 6}}function computeAriaValueNow(e){let n=(0,t.ariaAttr)(e,`aria-valuenow`);return n===null?void 0:+n}function computeAriaValueMax(e){let n=(0,t.ariaAttr)(e,`aria-valuemax`);return n===null?void 0:+n}function computeAriaValueMin(e){let n=(0,t.ariaAttr)(e,`aria-valuemin`);return n===null?void 0:+n}function computeAriaValueText(e){let n=(0,t.ariaAttr)(e,`aria-valuetext`);return n===null?void 0:n}const f=getDefaultNormalizer();function escapeRegExp(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,`\\$&`)}function getRegExpMatcher(e){return new RegExp(escapeRegExp(e.toLowerCase()),`i`)}function makeSuggestion(t,n,r,{variant:i,name:a}){let o=``,s={},c=[[`Role`,`TestId`].includes(t)?r:getRegExpMatcher(r)];a&&(s.name=getRegExpMatcher(a)),t===`Role`&&isInaccessibleChecked(e.A(n))&&(s.hidden=!0,o=`Element is inaccessible. This means that the element and all its children are invisible to screen readers.
@@ -13,7 +13,7 @@ Here are the matching elements:
13
13
  ${t}`,r)}return a[0]||null}}function getSuggestionError(t,n){return e.i().getElementError(`A better query is available, try this:
14
14
  ${t.toString()}
15
15
  `,n)}function makeGetAllQuery(t,n){return(r,...i)=>{let a=t(r,...i);if(!a.length)throw e.i().getElementError(n(r,...i),r);return a}}function makeFindQuery(e,n=`find`){return(r,i,a,o)=>{let find=t=>waitForInSpan(()=>e(r,i,a),{container:r,...o},t);return(0,t.tracing)()?(0,t.tracePromise)(p,(0,t.describeCall)(n,[i,a]),async e=>{let t=await find(e);return e.data.matches=matchCount(t),t}):find(null)}}const p=`testing-library.query`,matchCount=e=>Array.isArray(e)?e.length:+!!e;function traceQuery(e,n){return(r,...i)=>(0,t.tracing)()?(0,t.traceSync)(p,(0,t.describeCall)(e,i),e=>{let t=n(r,...i);return e.data.matches=matchCount(t),t}):n(r,...i)}const wrapSingleQueryWithSuggestion=(t,n,r)=>(i,...a)=>{let o=t(i,...a),[{suggest:s=e.i().throwSuggestions}={}]=a.slice(-1);if(o&&s){let e=getSuggestedQuery(o,r);if(e&&!n.endsWith(e.queryName))throw getSuggestionError(e.toString(),i)}return o},wrapAllByQueryWithSuggestion=(t,n,r)=>(i,...a)=>{let o=t(i,...a),[{suggest:s=e.i().throwSuggestions}={}]=a.slice(-1);if(o.length&&s){let e=[...new Set(o.map(e=>getSuggestedQuery(e,r)?.toString()))];if(e.length===1&&!n.endsWith(getSuggestedQuery(o[0],r).queryName))throw getSuggestionError(e[0],i)}return o};function buildQueries(e,t,n){let r=wrapSingleQueryWithSuggestion(makeSingleQuery(e,t),e.name,`query`),i=makeGetAllQuery(e,n),a=makeSingleQuery(i,t),o=wrapSingleQueryWithSuggestion(a,e.name,`get`),s=wrapAllByQueryWithSuggestion(i,e.name.replace(`query`,`get`),`getAll`),c=e.name.startsWith(`queryAll`)?e.name.slice(8):``,l=makeFindQuery(wrapAllByQueryWithSuggestion(i,e.name,`findAll`),`findAll${c}`),u=makeFindQuery(wrapSingleQueryWithSuggestion(a,e.name,`find`),`find${c}`);return[traceQuery(`query${c}`,r),traceQuery(`getAll${c}`,s),traceQuery(`get${c}`,o),l,u]}const m=/* @__PURE__ */ new Set([``,`generic`,`none`,`presentation`]),h=/* @__PURE__ */ e.N(e=>e,`identity`);function normalize(e){return e.replace(/\s+/g,` `).trim()}function similarity(e,t){let n=normalize(e).toLowerCase(),r=normalize(t).toLowerCase();if(n===``||r===``)return-1;if(n===r)return 0;if(n.includes(r)||r.includes(n))return 1;let i=r.split(` `);for(let e=0;e<i.length;e++)if(i[e].length>2&&n.includes(i[e]))return 2;return-1}function closeness(e,t,n,r,i=!0){if((i?matches:fuzzyMatches)(e,t,n,r))return 0;if(typeof n==`string`||typeof n==`number`){let t=similarity(r(e),String(n));return t===-1?-1:t+1}return-1}function line(t,n,r,i,a){let o={role:n,name:r,props:e.v(t,n,!1,i),value:null,url:null,children:[],element:t};return`- ${e._(o,80)} # ${a}`}function format(e,t){if(t.length===0)return``;t.sort((e,t)=>e.rank-t.rank);let n=t.slice(0,10).map(e=>e.line);return t.length>10&&n.push(`# … ${t.length-10} more`),`${e}:\n${n.join(`
16
- `)}`}function nameOf(e){return normalize((0,r.computeAccessibleNameImpl)(e,void 0,5))}function roleCandidates(n,i){let a=e.A(n),o=[],s=i.name;for(let n=a.first;n!==null;n=(0,t.nextInTree)(n,a)){if(n.type!==t.ELEMENT_NODE)continue;let a=(0,r.isInaccessibleImpl)(n),c=(0,r.tlRole)(n);if((0,r.tlRoleMatches)(n,i.role,i.queryFallbacks)){let t=nameOf(n),r=s===void 0?0:closeness(t,n.node,s,h),l=i.matchesState(n);r===0&&l?a&&!i.hidden&&o.push({line:line(n,c,t,!0,`hidden: ${e.h(n)} (or pass { hidden: true })`),rank:0}):r===0?o.push({line:line(n,c,t,a&&!i.hidden,`role and name match, state is not ${i.stateHint}`),rank:1}):(!a||i.hidden)&&o.push({line:line(n,c,t,!1,r>0?`similar name`:`same role, other name`),rank:r>0?2+r:10});continue}if(s===void 0)continue;if(!m.has(c)){let e=nameOf(n);if(e===``)continue;let t=closeness(e,n.node,s,h);t>=0&&o.push({line:line(n,c,e,a&&!i.hidden,`same name, role "${c}"`),rank:2+t});continue}let l=normalize(getNodeTextImpl(n));l!==``&&closeness(l,n.node,s,h)===0&&o.push({line:`- text: ${e.y(e.x(l,80))} # in ${e.p(n)}, which has no role: give it role="${i.role}" or use getByText`,rank:2})}return format(`Closest matches`,o)}function roleOrTag(t){let n=(0,r.tlRole)(t);return m.has(n)?e.p(t):n}function textCandidates(n,r,i,a,o,s){if(typeof r==`function`)return``;let c=e.A(n),l=[],u=[];for(let n=c.first;n!==null;n=(0,t.nextInTree)(n,c)){if(n.type!==t.ELEMENT_NODE||o&&typeof o==`string`&&e.T(n,o))continue;let c=getNodeTextImpl(n),d=c.trim()===``?-1:closeness(c,n.node,r,i,s);d===0?l.push({line:`- ${roleOrTag(n)}: ${e.y(e.x(i(c),80))} # matches, but not selector "${a}"`,rank:0}):d>0&&l.push({line:`- ${roleOrTag(n)}: ${e.y(e.x(i(c),80))} # similar text in ${e.p(n)}`,rank:1+d}),d!==0&&n.first!==null&&n.first!==n.last&&(s?matches:fuzzyMatches)(n.node.textContent,n.node,r,i)&&u.push(n)}for(let t=0;t<u.length;t++){let n=u[t],r=!1;for(let e=t+1;e<u.length&&!r;e++)isAncestor(n,u[e])&&(r=!0);r||l.push({line:`- ${roleOrTag(n)}: ${e.y(e.x(i(n.node.textContent),80))} # text split across child elements of ${e.p(n)}: use a function matcher or getByRole`,rank:0})}return format(`Closest matches`,l)}function isAncestor(e,t){for(let n=t.parent;n!==null;n=n.parent)if(n===e)return!0;return!1}const g=/* @__PURE__ */ new Set([`textbox`,`searchbox`,`combobox`,`listbox`,`checkbox`,`radio`,`switch`,`slider`,`spinbutton`]);function labelCandidates(n,i,a,o){if(typeof i==`function`)return``;let s=e.A(n),c=[];for(let n=s.first;n!==null;n=(0,t.nextInTree)(n,s)){if(n.type!==t.ELEMENT_NODE)continue;let s=(0,r.tlRole)(n);if(!g.has(s))continue;let l=nameOf(n),u=(0,r.isInaccessibleImpl)(n);if(l===``){let r=(0,t.attr)(n,`placeholder`),o=r?`no label, placeholder ${e.y(r)}: use getByPlaceholderText or add a <label>`:`no label: add a <label>, aria-label or aria-labelledby`;c.push({line:line(n,s,``,u,o),rank:r&&closeness(r,n.node,i,a)>=0?1:5});continue}let d=closeness(l,n.node,i,a,o);c.push({line:line(n,s,l,u,d>=0?`similar label`:`labelled control`),rank:d>=0?2+d:10})}return format(`Labelled form controls`,c)}var _=/* @__PURE__ */ e.M({findAllByLabelText:()=>x,findByLabelText:()=>S,getAllByLabelText:()=>C,getByLabelText:()=>w,queryAllByLabelText:()=>T,queryByLabelText:()=>y});function queryAllLabels(n){let r=e.A(n),i=[];for(let e=r.first;e!==null;e=(0,t.nextInTree)(e,r)){if(e.type!==t.ELEMENT_NODE||e.name!==`label`&&e.name!==`input`)continue;let n=getLabelContentImpl(e);n!==null&&i.push({node:e.node,textToMatch:n})}return i}function queryAllLabelsByText(e,t,{exact:n=!0,trim:r,collapseWhitespace:i,normalizer:a}={}){let o=textMatcher(n,t,makeNormalizer({collapseWhitespace:i,trim:r,normalizer:a}));return queryAllLabels(e).filter(({node:e,textToMatch:t})=>o(t,e)).map(({node:e})=>e)}function queryAllByLabelText(n,r,{selector:i=`*`,exact:a=!0,collapseWhitespace:o,trim:s,normalizer:c}={}){e.D(n);let l=makeNormalizer({collapseWhitespace:o,trim:s,normalizer:c}),u=textMatcher(a,r,l),d=e.A(n),f=new LabelContext(d,!0),p=[];for(let e=d.first;e!==null;e=(0,t.nextInTree)(e,d))e.type===t.ELEMENT_NODE&&((0,t.ariaAttr)(e,`aria-labelledby`)!==null||f.labelsOf(e).length!==0)&&collectLabelled(f,e,i,u,p);let m=queryAllByAttribute(`aria-label`,n,r,{exact:a,normalizer:l});for(let e=0;e<m.length;e++)p.push(m[e]);let h=Array.from(new Set(p));return i===`*`?h:h.filter(n=>e.T(n[t.$impl],i))}function collectLabelled(e,t,n,r,i){let a=getLabelsImpl(e,t,n);if(a.length===1){let e=a[0];e.formControl&&r(e.content,e.formControl.node)&&i.push(e.formControl.node),r(`${e.content||``}`,t.node)&&i.push(t.node);return}for(let e of a){if(!e.formControl)continue;let t=e.formControl.node;r(e.content,t)&&i.push(t)}let o=a.filter(e=>!!e.content).map(e=>e.content),s=t.node;r(o.join(` `),s)&&i.push(s),o.length>1&&o.forEach((e,t)=>{r(e,s)&&i.push(s);let n=[...o];n.splice(t,1),n.length>1&&r(n.join(` `),s)&&i.push(s)})}function getAllByLabelText(t,n,...r){let i=queryAllByLabelText(t,n,...r);if(!i.length){let i=queryAllLabelsByText(t,n,...r);if(i.length){let r=i.map(e=>getTagNameOfElementAssociatedWithLabelViaFor(t,e)).filter(e=>!!e);throw r.length?e.i().getElementError(r.map(e=>`Found a label with the text of: ${n}, however the element associated with this label (<${e} />) is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a <${e} />, you can use aria-label or aria-labelledby instead.`).join(`
16
+ `)}`}function nameOf(e){return normalize((0,r.computeAccessibleNameImpl)(e,void 0,5))}function roleCandidates(n,i){let a=e.A(n),o=[],s=i.name;for(let n=a.first;n!==null;n=(0,t.nextInTree)(n,a)){if(n.type!==t.ELEMENT_NODE)continue;let a=(0,r.isInaccessibleImpl)(n),c=(0,r.tlRole)(n);if((0,r.tlRoleMatches)(n,i.role,i.queryFallbacks)){let t=nameOf(n),r=s===void 0?0:closeness(t,n.node,s,h),l=i.matchesState(n);r===0&&l?a&&!i.hidden&&o.push({line:line(n,c,t,!0,`hidden: ${e.h(n)} (or pass { hidden: true })`),rank:0}):r===0?o.push({line:line(n,c,t,a&&!i.hidden,`role and name match, state is not ${i.stateHint}`),rank:1}):(!a||i.hidden)&&o.push({line:line(n,c,t,!1,r>0?`similar name`:`same role, other name`),rank:r>0?2+r:10});continue}if(s===void 0)continue;if(!m.has(c)){let e=nameOf(n);if(e===``)continue;let t=closeness(e,n.node,s,h);t>=0&&o.push({line:line(n,c,e,a&&!i.hidden,`same name, role "${c}"`),rank:2+t});continue}let l=normalize(getNodeTextImpl(n));l!==``&&closeness(l,n.node,s,h)===0&&o.push({line:`- text: ${e.y(e.x(l,80))} # in ${e.p(n)}, which has no role: give it role="${i.role}" or use getByText`,rank:2})}return format(`Closest matches`,o)}function roleOrTag(t){let n=(0,r.tlRole)(t);return m.has(n)?e.p(t):n}function textCandidates(n,r,i,a,o,s){if(typeof r==`function`)return``;let c=e.A(n),l=[],u=[];for(let n=c.first;n!==null;n=(0,t.nextInTree)(n,c)){if(n.type!==t.ELEMENT_NODE||o&&typeof o==`string`&&e.T(n,o))continue;let c=getNodeTextImpl(n),d=c.trim()===``?-1:closeness(c,n.node,r,i,s);d===0?l.push({line:`- ${roleOrTag(n)}: ${e.y(e.x(i(c),80))} # matches, but not selector "${a}"`,rank:0}):d>0&&l.push({line:`- ${roleOrTag(n)}: ${e.y(e.x(i(c),80))} # similar text in ${e.p(n)}`,rank:1+d}),d!==0&&n.first!==null&&n.first!==n.last&&(s?matches:fuzzyMatches)(n.node.textContent,n.node,r,i)&&u.push(n)}for(let t=0;t<u.length;t++){let n=u[t],r=!1;for(let e=t+1;e<u.length&&!r;e++)isAncestor(n,u[e])&&(r=!0);r||l.push({line:`- ${roleOrTag(n)}: ${e.y(e.x(i(n.node.textContent),80))} # text split across child elements of ${e.p(n)}: use a function matcher or getByRole`,rank:0})}return format(`Closest matches`,l)}function isAncestor(e,t){for(let n=t.parent;n!==null;n=n.parent)if(n===e)return!0;return!1}const g=/* @__PURE__ */ new Set([`textbox`,`searchbox`,`combobox`,`listbox`,`checkbox`,`radio`,`switch`,`slider`,`spinbutton`]);function labelCandidates(n,i,a,o){if(typeof i==`function`)return``;let s=e.A(n),c=[];for(let n=s.first;n!==null;n=(0,t.nextInTree)(n,s)){if(n.type!==t.ELEMENT_NODE)continue;let s=(0,r.tlRole)(n);if(!g.has(s))continue;let l=nameOf(n),u=(0,r.isInaccessibleImpl)(n);if(l===``){let r=(0,t.attr)(n,`placeholder`),o=r?`no label, placeholder ${e.y(r)}: use getByPlaceholderText or add a <label>`:`no label: add a <label>, aria-label or aria-labelledby`;c.push({line:line(n,s,``,u,o),rank:r&&closeness(r,n.node,i,a)>=0?1:5});continue}let d=closeness(l,n.node,i,a,o);c.push({line:line(n,s,l,u,d>=0?`similar label`:`labelled control`),rank:d>=0?2+d:10})}return format(`Labelled form controls`,c)}var _=/* @__PURE__ */ e.M({findAllByLabelText:()=>x,findByLabelText:()=>S,getAllByLabelText:()=>C,getByLabelText:()=>w,queryAllByLabelText:()=>T,queryByLabelText:()=>y});function queryAllLabels(n){let r=e.A(n),i=[];for(let e=r.first;e!==null;e=(0,t.nextInTree)(e,r)){if(e.type!==t.ELEMENT_NODE||e.name!==`label`&&e.name!==`input`)continue;let n=getLabelContentImpl(e);n!==null&&i.push({node:e.node,textToMatch:n})}return i}function queryAllLabelsByText(e,t,{exact:n=!0,trim:r,collapseWhitespace:i,normalizer:a}={}){let o=textMatcher(n,t,makeNormalizer({collapseWhitespace:i,trim:r,normalizer:a}));return queryAllLabels(e).filter(({node:e,textToMatch:t})=>o(t,e)).map(({node:e})=>e)}function queryAllByLabelText(n,r,{selector:i=`*`,exact:a=!0,collapseWhitespace:o,trim:s,normalizer:c}={}){e.D(n);let l=textMatcher(a,r,makeNormalizer({collapseWhitespace:o,trim:s,normalizer:c})),u=e.A(n),d=new LabelContext(u,!0),f=[],p=[];for(let e=u.first;e!==null;e=(0,t.nextInTree)(e,u))e.type===t.ELEMENT_NODE&&((0,t.ariaAttr)(e,`aria-label`)!==null&&p.push(e),((0,t.ariaAttr)(e,`aria-labelledby`)!==null||d.labelsOf(e).length!==0)&&collectLabelled(d,e,i,l,f));for(let e=0;e<p.length;e++){let n=p[e];l((0,t.ariaAttr)(n,`aria-label`),n.node)&&f.push(n.node)}let m=Array.from(new Set(f));return i===`*`?m:m.filter(n=>e.T(n[t.$impl],i))}function collectLabelled(e,t,n,r,i){let a=getLabelsImpl(e,t,n);if(a.length===1){let e=a[0];e.formControl&&r(e.content,e.formControl.node)&&i.push(e.formControl.node),r(`${e.content||``}`,t.node)&&i.push(t.node);return}for(let e of a){if(!e.formControl)continue;let t=e.formControl.node;r(e.content,t)&&i.push(t)}let o=a.filter(e=>!!e.content).map(e=>e.content),s=t.node;r(o.join(` `),s)&&i.push(s),o.length>1&&o.forEach((e,t)=>{r(e,s)&&i.push(s);let n=[...o];n.splice(t,1),n.length>1&&r(n.join(` `),s)&&i.push(s)})}function getAllByLabelText(t,n,...r){let i=queryAllByLabelText(t,n,...r);if(!i.length){let i=queryAllLabelsByText(t,n,...r);if(i.length){let r=i.map(e=>getTagNameOfElementAssociatedWithLabelViaFor(t,e)).filter(e=>!!e);throw r.length?e.i().getElementError(r.map(e=>`Found a label with the text of: ${n}, however the element associated with this label (<${e} />) is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a <${e} />, you can use aria-label or aria-labelledby instead.`).join(`
17
17
 
18
18
  `),t):e.i().getElementError(`Found a label with the text of: ${n}, however no form control was found associated to that label. Make sure you're using the "for" attribute or "aria-labelledby" attribute correctly.`,t)}throw e.i().getElementError(withLabelCandidates(`Unable to find a label with the text of: ${n}`,t,n,r[0]),t)}return i}function withLabelCandidates(t,n,r,i={}){if(e.w()===null)return t;let{exact:a=!0,trim:o,collapseWhitespace:s,normalizer:c}=i,l=labelCandidates(n,r,makeNormalizer({trim:o,collapseWhitespace:s,normalizer:c}),a);return l===``?t:`${t}\n\n${l}`}function getTagNameOfElementAssociatedWithLabelViaFor(t,n){let r=n.getAttribute(`for`);if(!r)return null;let i=new LabelContext(e.A(t)).byIdInContainer(r);return i?i.node.tagName.toLowerCase():null}const v=/* @__PURE__ */ e.N((e,t)=>`Found multiple elements with the text of: ${t}`,`getMultipleError`),y=wrapSingleQueryWithSuggestion(makeSingleQuery(queryAllByLabelText,v),queryAllByLabelText.name,`query`),b=makeSingleQuery(getAllByLabelText,v),x=makeFindQuery(wrapAllByQueryWithSuggestion(getAllByLabelText,getAllByLabelText.name,`findAll`)),S=makeFindQuery(wrapSingleQueryWithSuggestion(b,getAllByLabelText.name,`find`)),C=wrapAllByQueryWithSuggestion(getAllByLabelText,getAllByLabelText.name,`getAll`),w=wrapSingleQueryWithSuggestion(b,getAllByLabelText.name,`get`),T=wrapAllByQueryWithSuggestion(queryAllByLabelText,queryAllByLabelText.name,`queryAll`);var ee=/* @__PURE__ */ e.M({findAllByPlaceholderText:()=>O,findByPlaceholderText:()=>k,getAllByPlaceholderText:()=>E,getByPlaceholderText:()=>D,queryAllByPlaceholderText:()=>re,queryByPlaceholderText:()=>ie});function queryAllByPlaceholderText(...t){return e.D(t[0]),queryAllByAttribute(`placeholder`,...t)}const te=/* @__PURE__ */ e.N((e,t)=>`Found multiple elements with the placeholder text of: ${t}`,`getMultipleError`),ne=/* @__PURE__ */ e.N((e,t)=>`Unable to find an element with the placeholder text of: ${t}`,`getMissingError`),re=wrapAllByQueryWithSuggestion(queryAllByPlaceholderText,queryAllByPlaceholderText.name,`queryAll`),[ie,E,D,O,k]=buildQueries(queryAllByPlaceholderText,te,ne);var ae=/* @__PURE__ */ e.M({findAllByText:()=>P,findByText:()=>F,getAllByText:()=>M,getByText:()=>N,queryAllByText:()=>A,queryByText:()=>j});function isScriptStyleIgnore(e){return e===`script, style`||e===`script,style`}function isScriptOrStyle(e){let t=e.name;return t===`script`||t===`style`}function queryAllByText(n,r,{selector:i=`*`,exact:a=!0,collapseWhitespace:o,trim:s,ignore:c=e.i().defaultIgnore,normalizer:l}={}){e.D(n);let u=textMatcher(a,r,makeNormalizer({collapseWhitespace:o,trim:s,normalizer:l})),d=e.A(n),f=i===`*`,p=isScriptStyleIgnore(c),m=[],visit=t=>{(f||e.T(t,i))&&(c&&(p?isScriptOrStyle(t):e.T(t,c))||u(getNodeTextImpl(t),t.node)&&m.push(t.node))};d.type===t.ELEMENT_NODE&&visit(d);for(let e=d.first;e!==null;e=(0,t.nextInTree)(e,d))e.type===t.ELEMENT_NODE&&visit(e);return m}const oe=/* @__PURE__ */ e.N((e,t)=>`Found multiple elements with the text: ${t}`,`getMultipleError`),se=/* @__PURE__ */ e.N((t,n,r={})=>{let{collapseWhitespace:i,trim:a,normalizer:o,selector:s}=r,c=makeNormalizer({collapseWhitespace:i,trim:a,normalizer:o}),l=c(n.toString()),u=l!==n.toString(),d=(s??`*`)!==`*`,f=`Unable to find an element with the text: ${u?`${l} (normalized from '${n}')`:n}${d?`, which matches selector '${s}'`:``}. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.`;if(e.w()===null)return f;let{exact:p=!0,ignore:m=e.i().defaultIgnore}=r,h=textCandidates(t,n,c,s??`*`,m,p);return h===``?f:`${f}\n\n${h}`},`getMissingError`),A=wrapAllByQueryWithSuggestion(queryAllByText,queryAllByText.name,`queryAll`),[j,M,N,P,F]=buildQueries(queryAllByText,oe,se);var ce=/* @__PURE__ */ e.M({findAllByDisplayValue:()=>B,findByDisplayValue:()=>V,getAllByDisplayValue:()=>R,getByDisplayValue:()=>z,queryAllByDisplayValue:()=>I,queryByDisplayValue:()=>L});function queryAllByDisplayValue(n,r,{exact:i=!0,collapseWhitespace:a,trim:o,normalizer:s}={}){e.D(n);let c=textMatcher(i,r,makeNormalizer({collapseWhitespace:a,trim:o,normalizer:s})),l=e.A(n),u=[];for(let e=l.first;e!==null;e=(0,t.nextInTree)(e,l)){if(e.type!==t.ELEMENT_NODE)continue;let n=e.name;if(n!==`input`&&n!==`textarea`&&n!==`select`)continue;let r=e.node;if(e.tag===t.T.select&&e.ns===t.HTML_NS){let e=r.options,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i.selected&&c(getNodeTextImpl(i[t.$impl]),i)){n=!0;break}}n&&u.push(r)}else c(r.value,r)&&u.push(r)}return u}const le=/* @__PURE__ */ e.N((e,t)=>`Found multiple elements with the display value: ${t}.`,`getMultipleError`),ue=/* @__PURE__ */ e.N((e,t)=>`Unable to find an element with the display value: ${t}.`,`getMissingError`),I=wrapAllByQueryWithSuggestion(queryAllByDisplayValue,queryAllByDisplayValue.name,`queryAll`),[L,R,z,B,V]=buildQueries(queryAllByDisplayValue,le,ue);var de=/* @__PURE__ */ e.M({findAllByAltText:()=>K,findByAltText:()=>q,getAllByAltText:()=>W,getByAltText:()=>G,queryAllByAltText:()=>H,queryByAltText:()=>U});const fe=/^(img|input|area|.+-.+)$/i;function queryAllByAltText(t,n,r={}){return e.D(t),queryAllByAttribute(`alt`,t,n,r).filter(e=>fe.test(e.tagName))}const pe=/* @__PURE__ */ e.N((e,t)=>`Found multiple elements with the alt text: ${t}`,`getMultipleError`),me=/* @__PURE__ */ e.N((e,t)=>`Unable to find an element with the alt text: ${t}`,`getMissingError`),H=wrapAllByQueryWithSuggestion(queryAllByAltText,queryAllByAltText.name,`queryAll`),[U,W,G,K,q]=buildQueries(queryAllByAltText,pe,me);var he=/* @__PURE__ */ e.M({findAllByTitle:()=>ye,findByTitle:()=>be,getAllByTitle:()=>Y,getByTitle:()=>X,queryAllByTitle:()=>ve,queryByTitle:()=>J});function isSvgTitle(e){let n=e.parent;return(0,t.asciiLowercase)(e.prefix===null?e.name:e.prefix+`:`+e.name)===`title`&&n!==null&&n.type===t.ELEMENT_NODE&&(0,t.asciiLowercase)(n.prefix===null?n.name:n.prefix+`:`+n.name)===`svg`}function queryAllByTitle(n,r,{exact:i=!0,collapseWhitespace:a,trim:o,normalizer:s}={}){e.D(n);let c=textMatcher(i,r,makeNormalizer({collapseWhitespace:a,trim:o,normalizer:s})),l=e.A(n),u=[];for(let e=l.first;e!==null;e=(0,t.nextInTree)(e,l)){if(e.type!==t.ELEMENT_NODE)continue;let n=e.attrs===null?null:(0,t.attr)(e,`title`),r=e.name===`title`&&e.parent!==null&&e.parent.type===t.ELEMENT_NODE&&e.parent.name===`svg`;(n!==null||r)&&(c(n,e.node)||isSvgTitle(e)&&c(getNodeTextImpl(e),e.node))&&u.push(e.node)}return u}const ge=/* @__PURE__ */ e.N((e,t)=>`Found multiple elements with the title: ${t}.`,`getMultipleError`),_e=/* @__PURE__ */ e.N((e,t)=>`Unable to find an element with the title: ${t}.`,`getMissingError`),ve=wrapAllByQueryWithSuggestion(queryAllByTitle,queryAllByTitle.name,`queryAll`),[J,Y,X,ye,be]=buildQueries(queryAllByTitle,ge,_e);var xe=/* @__PURE__ */ e.M({findAllByRole:()=>Oe,findByRole:()=>ke,getAllByRole:()=>Ee,getByRole:()=>De,queryAllByRole:()=>we,queryByRole:()=>Te});const identity=e=>e;function assertSupported(e,t){if(!u.roleSupportsProp(e,t))throw Error(`"${t}" is not supported on role "${e}".`)}function queryAllByRole(n,r,{hidden:i=e.i().defaultHidden,name:a,description:o,queryFallbacks:s=!1,selected:c,busy:l,checked:d,pressed:f,current:p,level:m,expanded:h,value:{now:g,min:_,max:v,text:y}={}}={}){if(e.D(n),c!==void 0&&assertSupported(r,`aria-selected`),l!==void 0&&assertSupported(r,`aria-busy`),d!==void 0&&assertSupported(r,`aria-checked`),f!==void 0&&assertSupported(r,`aria-pressed`),p!==void 0&&assertSupported(r,`aria-current`),m!==void 0&&r!==`heading`)throw Error(`Role "${r}" cannot have "level" property.`);g!==void 0&&assertSupported(r,`aria-valuenow`),v!==void 0&&assertSupported(r,`aria-valuemax`),_!==void 0&&assertSupported(r,`aria-valuemin`),y!==void 0&&assertSupported(r,`aria-valuetext`),h!==void 0&&assertSupported(r,`aria-expanded`);let b={selected:c,busy:l,checked:d,pressed:f,current:p,level:m,expanded:h,valueNow:g,valueMin:_,valueMax:v,valueText:y},x=e.i().computedStyleSupportsPseudoElements,S=e.A(n),C=[],w=styleOverride(S),T=w!==null&&i===!1?/* @__PURE__ */ new Map:null;for(let e=S.first;e!==null;e=(0,t.nextInTree)(e,S))e.type===t.ELEMENT_NODE&&u.roleMatches(e,r,s)&&matchesState(e,b)&&(i===!1&&(w===null?isInaccessibleImpl$1(e):u.isInaccessibleWithStyle(e,w,T))||(a===void 0||matches(u.computeAccessibleName(e,x,w),e.node,a,identity))&&(o===void 0||matches(u.computeAccessibleDescription(e,x,w),e.node,o,identity))&&C.push(e.node));return C}function matchesState(e,t){if(t.selected!==void 0)return t.selected===computeAriaSelected(e);if(t.busy!==void 0)return t.busy===computeAriaBusy(e);if(t.checked!==void 0)return t.checked===computeAriaChecked(e);if(t.pressed!==void 0)return t.pressed===computeAriaPressed(e);if(t.current!==void 0)return t.current===computeAriaCurrent(e);if(t.expanded!==void 0)return t.expanded===computeAriaExpanded(e);if(t.level!==void 0)return t.level===computeHeadingLevelImpl(e);if(t.valueNow!==void 0||t.valueMax!==void 0||t.valueMin!==void 0||t.valueText!==void 0){let n=!0;return t.valueNow!==void 0&&(n&&=t.valueNow===computeAriaValueNow(e)),t.valueMax!==void 0&&(n&&=t.valueMax===computeAriaValueMax(e)),t.valueMin!==void 0&&(n&&=t.valueMin===computeAriaValueMin(e)),t.valueText!==void 0&&(n&&=matches(computeAriaValueText(e)??null,e.node,t.valueText,identity)),n}return!0}const getNameHint=e=>{let t=``;return t=e===void 0?``:typeof e==`string`?` and name "${e}"`:` and name \`${e}\``,t},Se=/* @__PURE__ */ e.N((e,t,{name:n}={})=>`Found multiple elements with the role "${t}"${getNameHint(n)}`,`getMultipleError`),Ce=/* @__PURE__ */ e.N((t,n,r={})=>{let{hidden:i=e.i().defaultHidden,name:a,description:o}=r;if(e.w()!==null)return agentMissingError(t,n,r,i);if(e.i()._disableExpensiveErrorDiagnostics)return`Unable to find role="${n}"${getNameHint(a)}`;let s=``;Array.from(t.children).forEach(e=>{s+=prettyRoles(e,{hidden:i,includeDescription:o!==void 0})});let c;c=s.length===0?i===!1?"There are no accessible roles. But there might be some inaccessible roles. If you wish to access them, then set the `hidden` option to `true`. Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole":`There are no available roles.`:`
19
19
  Here are the ${i===!1?`accessible`:`available`} roles: