@ctrl/dom 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aria/_chunks/roles-list-CtWrIYOt.cjs +4 -0
- package/dist/aria/_chunks/roles-list-D5_w80vQ.js +4 -0
- package/dist/aria/index.cjs +1 -1
- package/dist/aria/index.js +1 -1
- package/dist/aria/internal.cjs +1 -1
- package/dist/aria/internal.js +1 -1
- package/dist/bridge/index.js +1 -1
- package/dist/bridge/internal.js +1 -1
- package/dist/dom/_chunks/src-CImID776.js +49 -0
- package/dist/dom/index.js +1 -1
- package/dist/dom/internal.js +1 -1
- package/dist/dom/types/collections/iterator.d.ts +8 -0
- package/dist/dom/types/css/cascade.d.ts +10 -0
- package/dist/dom/types/css/properties.d.ts +2 -0
- package/dist/dom/types/css/values.d.ts +8 -2
- package/dist/dom/types/events/Event.d.ts +2 -0
- package/dist/dom/types/html/SVGElement.d.ts +18 -21
- package/dist/dom/types/html/elements.d.ts +4 -2
- package/dist/dom/types/html/index.d.ts +1 -0
- package/dist/dom/types/html/media.d.ts +13 -2
- package/dist/dom/types/html/svg-types.d.ts +67 -0
- package/dist/dom/types/index.d.ts +3 -1
- package/dist/dom/types/nodes/Document.d.ts +1 -1
- package/dist/dom/types/nodes/constants.d.ts +10 -0
- package/dist/dom/types/traversal/live.d.ts +7 -0
- package/dist/dom/types/webidl-runtime.d.ts +14 -0
- package/dist/dom/types/window/observers.d.ts +28 -0
- package/dist/jest-dom/_chunks/{matchers-CwGF61j-.js → matchers-DGsBvtWC.js} +13 -13
- package/dist/jest-dom/_chunks/{matchers-CZ6Smfw9.cjs → matchers-DJmRgUYG.cjs} +7 -7
- package/dist/jest-dom/index.cjs +1 -1
- package/dist/jest-dom/index.js +1 -1
- package/dist/jest-dom/jest-globals.cjs +1 -1
- package/dist/jest-dom/jest-globals.js +1 -1
- package/dist/jest-dom/matchers.cjs +1 -1
- package/dist/jest-dom/matchers.js +1 -1
- package/dist/jest-dom/vitest.cjs +1 -1
- package/dist/jest-dom/vitest.js +1 -1
- package/dist/testing-library/_chunks/{aria-snapshot-diff-BXYf4D_D.cjs → aria-snapshot-diff-B95LLutl.cjs} +8 -6
- package/dist/testing-library/_chunks/aria-snapshot-diff-BSXxnyqJ.js +16 -0
- package/dist/testing-library/agent.cjs +1 -1
- package/dist/testing-library/agent.js +1 -1
- package/dist/testing-library/index.cjs +8 -8
- package/dist/testing-library/index.js +9 -9
- package/dist/user-event/index.cjs +10 -10
- package/dist/user-event/index.js +10 -10
- package/package.json +1 -1
- package/dist/aria/_chunks/roles-list-C57tqF4n.cjs +0 -4
- package/dist/aria/_chunks/roles-list-DEwbBc_c.js +0 -4
- package/dist/dom/_chunks/src-u_GjEFAe.js +0 -49
- package/dist/testing-library/_chunks/aria-snapshot-diff-DejA3Rdn.js +0 -14
|
@@ -1,9 +1,9 @@
|
|
|
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
|
|
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,ELEMENT_NODE as s,F_HTML as c,asciiLowercase as l,computedValue as u,getAttribute as p,getComputedStyleOverride as ee}from"@ctrl/dom/internal";import{AriaTemplateError as m,matchAriaSnapshot as h}from"@ctrl/dom/testing-library/agent";var g=Object.defineProperty,__name=(e,t)=>g(e,`name`,{value:t,configurable:!0}),__exportAll=(e,t)=>{let n={};for(var r in e)g(n,r,{get:e[r],enumerable:!0});return t||g(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
|
-
`)}};let
|
|
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
|
|
3
|
+
`)}};let _=null;function parseCSS(t,n,r){_??=e(import.meta.url)(`@adobe/css-tools`).parse;let i=_(`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 v=[`meter`,`progressbar`,`slider`,`spinbutton`];function getAccessibleValue(e){if(v.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 y=process.env,b=process.argv,x=!(y.NO_COLOR||b.includes(`--no-color`))&&(!!y.FORCE_COLOR||b.includes(`--color`)||process.platform===`win32`||process.stdout?.isTTY&&y.TERM!==`dumb`||!!y.CI);function picoRed(e){if(!x)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 S=[`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
|
-
`)},pass:e===`One`?s.length===1:s.length>0}}return Object.defineProperty(queryMatcher,"name",{value:a}),queryMatcher}const
|
|
6
|
+
`)},pass:e===`One`?s.length===1:s.length>0}}return Object.defineProperty(queryMatcher,"name",{value:a}),queryMatcher}const C={};for(let e of S){let t=createQueryMatcher(`Any`,e),n=createQueryMatcher(`One`,e);C[t.name]=t,C[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(`
|
|
8
8
|
`)}}function isEmptyElement(e){for(let t=e.firstChild;t!==null;t=t.nextSibling)if(t.nodeType!==8)return!1;return!0}function toBeEmptyDOMElement(e){return checkHtmlElement(e,toBeEmptyDOMElement,this),{pass:isEmptyElement(e),message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeEmptyDOMElement`,`element`,``),``,`Received:`,` ${this.utils.printReceived(e.innerHTML)}`].join(`
|
|
9
9
|
`)}}function toBeEmpty(e){return deprecate(`toBeEmpty`,`Please use instead toBeEmptyDOMElement for finding empty nodes in the DOM.`),checkHtmlElement(e,toBeEmpty,this),{pass:e.innerHTML===``,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeEmpty`,`element`,``),``,`Received:`,` ${this.utils.printReceived(e.innerHTML)}`].join(`
|
|
@@ -11,21 +11,21 @@ import{createRequire as e}from"node:module";import{prettyDOM as t,queries as n}f
|
|
|
11
11
|
`)].join(`
|
|
12
12
|
`)}}function getNormalizedHtml(e,t){let n=e.ownerDocument.createElement(`div`);return n.innerHTML=t,n.innerHTML}function toContainHTML(e,t){if(checkHtmlElement(e,toContainHTML,this),typeof t!=`string`)throw Error(`.toContainHTML() expects a string value, got ${t}`);return{pass:e.outerHTML.includes(getNormalizedHtml(e,t)),message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toContainHTML`,`element`,``),`Expected:`,` ${this.utils.EXPECTED_COLOR(t)}`,`Received:`,` ${this.utils.printReceived(e.cloneNode(!0))}`].join(`
|
|
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
|
-
`)}}const
|
|
14
|
+
`)}}const w={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 w?`${w[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
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
|
-
`)}}}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
|
-
`)}}}function getStyleDeclaration(e,t){let n={}
|
|
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 T=null;function foreign(){return T??=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 E=[[`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<E.length;n++){let[r,i,a,o]=E[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 D=`aria-invalid`,O=[`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(D);if(!e.hasAttribute(D)||O.includes(a))return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(r,`element`),`Expected element to be marked as invalid with attribute`,`${D}="true"`,`Received`,e.hasAttribute(`aria-invalid`)?`${D}="${e.getAttribute(D)}`: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 k={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},A=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(%|deg|grad|rad|turn)?$/i;function channel(e,t){if(e.toLowerCase()===`none`)return 0;let n=A.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=A.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=k[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 nodeNameIs(e,t,n){return e.prefix===null?(e.flags&c)===0?e.name===n:l(e.name)===t:!1}function isElementVisibleImpl(e){let t=null;for(let n=e;n!==null&&n.type===s;t=n,n=n.parent){if(u(n,`display`)===`none`)return!1;let e=u(n,`visibility`);if(e===`hidden`||e===`collapse`||u(n,`opacity`)===`0`||p(n,`hidden`)!==null||nodeNameIs(n,`details`,`DETAILS`)&&(t===null||!nodeNameIs(t,`summary`,`SUMMARY`))&&p(n,`open`)===null)return!1}return!0}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=e[o],r=t&&(n!==void 0&&ee(n)===null?isElementVisibleImpl(n):isElementVisible(e));return{pass:r,message:()=>{let n=r?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeVisible`,`element`,``),``,`Received element ${n} visible${t?``:` (element is not in the document)`}:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
19
|
+
`)}}}function getStyleDeclaration(e,t){let n=normalizedKey(t);if(n!==null){let e=j.get(n);if(e!==void 0)return{...e}}let r={},i=e.createElement(`div`);for(let e of Object.keys(t))i.style[e]=t[e],r[e]=i.style[e];return n!==null&&(j.size>=512&&j.clear(),j.set(n,{...r})),r}const j=/* @__PURE__ */ new Map;function normalizedKey(e){let t=``;for(let n of Object.keys(e)){let r=e[n],i=typeof r;if(i!==`string`&&i!==`number`)return null;t+=`${n}\u0000${i===`number`?`n`:`s`}${r}\u0001`}return t}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(`
|
|
20
20
|
`)}function expectedDiff(e,t,n){let r={};for(let e of Array.from(n))t[e]!==void 0&&(r[e]=n.getPropertyValue(e));return e(printoutStyles(t),printoutStyles(r)).replace(`${picoRed(`+ Received`)}\n`,``)}function toHaveStyle(e,t){checkHtmlElement(e,toHaveStyle,this);let n=typeof t==`object`?t:parseCSS(t,toHaveStyle,this),{getComputedStyle:r}=e.ownerDocument.defaultView,i=getStyleDeclaration(e.ownerDocument,n),a=r(e);return{pass:isSubset(i,a),message:()=>{let e=`${this.isNot?`.not`:``}.toHaveStyle`;return[this.utils.matcherHint(e,`element`,``),expectedDiff(this.utils.diff,i,a)].join(`
|
|
21
21
|
|
|
22
|
-
`)}}}const
|
|
22
|
+
`)}}}const M=a;let N=null;function checkedRoles(){return N??=M.keys().filter(e=>M.get(e)?.props[`aria-checked`]!==void 0)}function roleSupportsChecked(e){return e!==null&&checkedRoles().includes(e)}function supportedRolesSentence(){return toSentence(checkedRoles().map(e=>`role="${e}"`),{lastWordConnector:` or `})}function toBeChecked(e){checkHtmlElement(e,toBeChecked,this);let isValidInput=()=>e.tagName.toLowerCase()===`input`&&[`checkbox`,`radio`].includes(e.type),isValidAriaElement=()=>roleSupportsChecked(e.getAttribute(`role`))&&[`true`,`false`].includes(e.getAttribute(`aria-checked`));if(!isValidInput()&&!isValidAriaElement())return{pass:!1,message:()=>`only inputs with type="checkbox" or type="radio" or elements with ${supportedRolesSentence()} and a valid aria-checked attribute can be used with .toBeChecked(). Use .toHaveValue() instead`};let isChecked=()=>isValidInput()?e.checked:e.getAttribute(`aria-checked`)===`true`;return{pass:isChecked(),message:()=>{let t=isChecked()?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeChecked`,`element`,``),``,`Received element ${t} checked:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
23
23
|
`)}}}function toBePartiallyChecked(e){checkHtmlElement(e,toBePartiallyChecked,this);let isValidInput=()=>e.tagName.toLowerCase()===`input`&&e.type===`checkbox`,isValidAriaElement=()=>e.getAttribute(`role`)===`checkbox`;if(!isValidInput()&&!isValidAriaElement())return{pass:!1,message:()=>`only inputs with type="checkbox" or elements with role="checkbox" and a valid aria-checked attribute can be used with .toBePartiallyChecked(). Use .toHaveValue() instead`};let isPartiallyChecked=()=>{let t=e.getAttribute(`aria-checked`)===`mixed`;return isValidInput()&&e.indeterminate||t};return{pass:isPartiallyChecked(),message:()=>{let t=isPartiallyChecked()?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBePartiallyChecked`,`element`,``),``,`Received element ${t} partially checked:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
24
|
-
`)}}}function isButtonLike(e){let t=(e.getAttribute(`role`)||``).split(` `).map(e=>e.trim());return e.tagName.toLowerCase()===`button`||e.tagName.toLowerCase()===`input`&&e.type===`button`||t.includes(`button`)}function toBePressed(e){checkHtmlElement(e,toBePressed,this);let t=isButtonLike(e),n=e.getAttribute(`aria-pressed`);return!t||n!==`true`&&n!==`false`?{pass:!1,message:()=>`Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePressed()`}:{pass:t&&n===`true`,message:()=>{let e=this.utils.matcherHint(`${this.isNot?`.not`:``}.toBePressed`,`element`,``);return getMessage(this,e,`Expected element to have`,`aria-pressed="${this.isNot?`false`:`true`}"`,`Received`,`aria-pressed="${n}"`)}}}function toBePartiallyPressed(e){checkHtmlElement(e,toBePartiallyPressed,this);let t=isButtonLike(e),n=e.getAttribute(`aria-pressed`);return!t||n!==`true`&&n!==`false`&&n!==`mixed`?{pass:!1,message:()=>`Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePartiallyPressed()`}:{pass:t&&n===`mixed`,message:()=>{let e=this.isNot?`not to`:`to`,t=this.utils.matcherHint(`${this.isNot?`.not`:``}.toBePartiallyPressed`,`element`,``);return getMessage(this,t,`Expected element ${e} have`,`aria-pressed="mixed"`,`Received`,`aria-pressed="${n}"`)}}}const
|
|
24
|
+
`)}}}function isButtonLike(e){let t=(e.getAttribute(`role`)||``).split(` `).map(e=>e.trim());return e.tagName.toLowerCase()===`button`||e.tagName.toLowerCase()===`input`&&e.type===`button`||t.includes(`button`)}function toBePressed(e){checkHtmlElement(e,toBePressed,this);let t=isButtonLike(e),n=e.getAttribute(`aria-pressed`);return!t||n!==`true`&&n!==`false`?{pass:!1,message:()=>`Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePressed()`}:{pass:t&&n===`true`,message:()=>{let e=this.utils.matcherHint(`${this.isNot?`.not`:``}.toBePressed`,`element`,``);return getMessage(this,e,`Expected element to have`,`aria-pressed="${this.isNot?`false`:`true`}"`,`Received`,`aria-pressed="${n}"`)}}}function toBePartiallyPressed(e){checkHtmlElement(e,toBePartiallyPressed,this);let t=isButtonLike(e),n=e.getAttribute(`aria-pressed`);return!t||n!==`true`&&n!==`false`&&n!==`mixed`?{pass:!1,message:()=>`Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePartiallyPressed()`}:{pass:t&&n===`mixed`,message:()=>{let e=this.isNot?`not to`:`to`,t=this.utils.matcherHint(`${this.isNot?`.not`:``}.toBePartiallyPressed`,`element`,``);return getMessage(this,t,`Expected element ${e} have`,`aria-pressed="mixed"`,`Received`,`aria-pressed="${n}"`)}}}const P=[`fieldset`,`input`,`select`,`optgroup`,`option`,`button`,`textarea`];function isFirstLegendChildOfFieldset(e,t){if(getTag(e)!==`legend`||getTag(t)!==`fieldset`)return!1;for(let n=t.firstElementChild;n!==null;n=n.nextElementSibling)if(getTag(n)===`legend`)return e.isSameNode(n);return!1}function isElementDisabledByParent(e,t){return isElementDisabled(t)&&!isFirstLegendChildOfFieldset(e,t)}function isCustomElement(e){return e.includes(`-`)}function canElementBeDisabled(e){let t=getTag(e);return P.includes(t)||isCustomElement(t)}function isElementDisabled(e){return canElementBeDisabled(e)&&e.hasAttribute(`disabled`)}function isAncestorDisabled(e){let t=e.parentElement;return!!t&&(isElementDisabledByParent(e,t)||isAncestorDisabled(t))}function isElementOrAncestorDisabled(e){let t=e[o];return t===void 0?canElementBeDisabled(e)&&(isElementDisabled(e)||isAncestorDisabled(e)):isElementOrAncestorDisabledImpl(t)}function tagOf(e){return e.prefix===null&&e.tag!==0&&(e.flags&c)!==0?e.name:(e.prefix===null?e.name:`${e.prefix}:${e.name}`).toLowerCase()}function isElementDisabledImpl(e,t){return(P.includes(t)||isCustomElement(t))&&p(e,`disabled`)!==null}function isElementOrAncestorDisabledImpl(e){let t=tagOf(e);if(!P.includes(t)&&!isCustomElement(t))return!1;if(p(e,`disabled`)!==null)return!0;let n=e,r=t;for(let t=e.parent;t!==null&&t.type===s;t=t.parent){let e=tagOf(t);if(isElementDisabledImpl(t,e)&&!isFirstLegendChildImpl(n,r,t,e))return!0;n=t,r=e}return!1}function isFirstLegendChildImpl(e,t,n,r){if(t!==`legend`||r!==`fieldset`)return!1;for(let t=n.first;t!==null;t=t.next)if(t.type===s&&tagOf(t)===`legend`)return t===e;return!1}function toBeDisabled(e){checkHtmlElement(e,toBeDisabled,this);let t=isElementOrAncestorDisabled(e);return{pass:t,message:()=>{let n=t?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeDisabled`,`element`,``),``,`Received element ${n} disabled:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
25
25
|
`)}}}function toBeEnabled(e){checkHtmlElement(e,toBeEnabled,this);let t=!isElementOrAncestorDisabled(e);return{pass:t,message:()=>{let n=t?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeEnabled`,`element`,``),``,`Received element ${n} enabled:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
26
|
-
`)}}}const
|
|
27
|
-
`)}}}const
|
|
26
|
+
`)}}}const F=[`select`,`textarea`],I=[`input`,`select`,`textarea`],L=[`color`,`hidden`,`range`,`submit`,`image`,`reset`],te=[`checkbox`,`combobox`,`gridcell`,`listbox`,`radiogroup`,`spinbutton`,`textbox`,`tree`];function isRequiredOnFormTagsExceptInput(e){return F.includes(getTag(e))&&e.hasAttribute(`required`)}function isRequiredOnSupportedInput(e){return getTag(e)===`input`&&e.hasAttribute(`required`)&&(e.hasAttribute(`type`)&&!L.includes(e.getAttribute(`type`))||!e.hasAttribute(`type`))}function isElementRequiredByARIA(e){return e.hasAttribute(`aria-required`)&&e.getAttribute(`aria-required`)===`true`&&(I.includes(getTag(e))||e.hasAttribute(`role`)&&te.includes(e.getAttribute(`role`)))}function toBeRequired(e){checkHtmlElement(e,toBeRequired,this);let t=isRequiredOnFormTagsExceptInput(e)||isRequiredOnSupportedInput(e)||isElementRequiredByARIA(e);return{pass:t,message:()=>{let n=t?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeRequired`,`element`,``),``,`Received element ${n} required:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
27
|
+
`)}}}const ne=[`form`,`input`,`select`,`textarea`];function isElementHavingAriaInvalid(e){return e.hasAttribute(`aria-invalid`)&&e.getAttribute(`aria-invalid`)!==`false`}function isElementInvalid(e){let t=isElementHavingAriaInvalid(e);return ne.includes(getTag(e))?t||!e.checkValidity():t}function toBeInvalid(e){checkHtmlElement(e,toBeInvalid,this);let t=isElementInvalid(e);return{pass:t,message:()=>{let n=t?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInvalid`,`element`,``),``,`Received element ${n} currently invalid:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
28
28
|
`)}}}function toBeValid(e){checkHtmlElement(e,toBeValid,this);let t=!isElementInvalid(e);return{pass:t,message:()=>{let n=t?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeValid`,`element`,``),``,`Received element ${n} currently valid:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
29
|
-
`)}}}function toMatchAriaSnapshot(e,t){if(typeof e!=`object`||!e||e[o]===void 0)throw new NodeTypeError(e,toMatchAriaSnapshot,this);if(typeof t!=`string`)throw TypeError(`toMatchAriaSnapshot expects an aria snapshot template string, got ${t===null?`null`:typeof t}`);let n;try{n=
|
|
29
|
+
`)}}}function toMatchAriaSnapshot(e,t){if(typeof e!=`object`||!e||e[o]===void 0)throw new NodeTypeError(e,toMatchAriaSnapshot,this);if(typeof t!=`string`)throw TypeError(`toMatchAriaSnapshot expects an aria snapshot template string, got ${t===null?`null`:typeof t}`);let n;try{n=h(e,t)}catch(e){throw e instanceof m&&Error.captureStackTrace&&Error.captureStackTrace(e,toMatchAriaSnapshot),e}let r=this.utils.matcherHint(`${this.isNot?`.not`:``}.toMatchAriaSnapshot`,`element`,`template`);return{pass:n.pass,message:()=>{if(this.isNot)return[r,``,`Expected the accessibility tree not to match the template:`,this.utils.EXPECTED_COLOR(n.expected()),``,`Received:`,this.utils.RECEIVED_COLOR(n.received())].join(`
|
|
30
30
|
`);let e=n.diff(),t=0,i=0,a=[];for(let n=0;n<e.length;n++){let r=e[n];r.kind===`-`?(t++,a.push(this.utils.EXPECTED_COLOR(`- ${r.text}`))):r.kind===`+`?(i++,a.push(this.utils.RECEIVED_COLOR(`+ ${r.text}`))):a.push(` ${r.text}`)}return[r,``,`${this.utils.EXPECTED_COLOR(`- Expected - ${t}`)} (template)`,`${this.utils.RECEIVED_COLOR(`+ Received + ${i}`)} (closest part of the accessibility tree)`,``,...a,``,`Received accessibility tree:`,this.utils.RECEIVED_COLOR(n.received())].join(`
|
|
31
|
-
`)}}}var
|
|
31
|
+
`)}}}var re=/* @__PURE__ */ __exportAll({toAppearAfter:()=>toAppearAfter,toAppearBefore:()=>toAppearBefore,toBeChecked:()=>toBeChecked,toBeDisabled:()=>toBeDisabled,toBeEmpty:()=>toBeEmpty,toBeEmptyDOMElement:()=>toBeEmptyDOMElement,toBeEnabled:()=>toBeEnabled,toBeInTheDOM:()=>toBeInTheDOM,toBeInTheDocument:()=>toBeInTheDocument,toBeInvalid:()=>toBeInvalid,toBePartiallyChecked:()=>toBePartiallyChecked,toBePartiallyPressed:()=>toBePartiallyPressed,toBePressed:()=>toBePressed,toBeRequired:()=>toBeRequired,toBeValid:()=>toBeValid,toBeVisible:()=>toBeVisible,toContainAnyByAltText:()=>R,toContainAnyByDisplayValue:()=>B,toContainAnyByLabelText:()=>H,toContainAnyByPlaceholderText:()=>W,toContainAnyByRole:()=>K,toContainAnyByTestId:()=>J,toContainAnyByText:()=>X,toContainAnyByTitle:()=>Q,toContainElement:()=>toContainElement,toContainHTML:()=>toContainHTML,toContainOneByAltText:()=>z,toContainOneByDisplayValue:()=>V,toContainOneByLabelText:()=>U,toContainOneByPlaceholderText:()=>G,toContainOneByRole:()=>q,toContainOneByTestId:()=>Y,toContainOneByText:()=>Z,toContainOneByTitle:()=>$,toHaveAccessibleDescription:()=>toHaveAccessibleDescription,toHaveAccessibleErrorMessage:()=>toHaveAccessibleErrorMessage,toHaveAccessibleName:()=>toHaveAccessibleName,toHaveAttribute:()=>toHaveAttribute,toHaveClass:()=>toHaveClass,toHaveDescription:()=>toHaveDescription,toHaveDisplayValue:()=>toHaveDisplayValue,toHaveErrorMessage:()=>toHaveErrorMessage,toHaveFocus:()=>toHaveFocus,toHaveFormValues:()=>toHaveFormValues,toHaveRole:()=>toHaveRole,toHaveSelection:()=>toHaveSelection,toHaveStyle:()=>toHaveStyle,toHaveTextContent:()=>toHaveTextContent,toHaveValue:()=>toHaveValue,toMatchAriaSnapshot:()=>toMatchAriaSnapshot});const{toContainAnyByAltText:R,toContainOneByAltText:z,toContainAnyByDisplayValue:B,toContainOneByDisplayValue:V,toContainAnyByLabelText:H,toContainOneByLabelText:U,toContainAnyByPlaceholderText:W,toContainOneByPlaceholderText:G,toContainAnyByRole:K,toContainOneByRole:q,toContainAnyByTestId:J,toContainOneByTestId:Y,toContainAnyByText:X,toContainOneByText:Z,toContainAnyByTitle:Q,toContainOneByTitle:$}=C;export{toHaveAccessibleDescription as A,toHaveSelection as B,toBePartiallyChecked as C,toBeValid as D,toBeRequired as E,toHaveRole as F,toBeEmpty as G,toHaveValue as H,toHaveAttribute as I,toBeInTheDocument as J,toBeEmptyDOMElement as K,toHaveClass as L,toHaveAccessibleName as M,toHaveDescription as N,toBeVisible as O,toHaveErrorMessage as P,toHaveDisplayValue as R,toBeInvalid as S,toBePressed as T,toAppearAfter as U,toHaveTextContent as V,toAppearBefore as W,toContainHTML as X,toContainElement as Y,toHaveFocus as Z,$ as _,W as a,toBeDisabled as b,X as c,V as d,U as f,Z as g,Y as h,H as i,toHaveAccessibleErrorMessage as j,toHaveStyle as k,Q as l,q as m,R as n,K as o,G as p,toBeInTheDOM as q,B as r,J as s,re as t,z as u,toMatchAriaSnapshot as v,toBePartiallyPressed as w,toBeEnabled as x,toBeChecked as y,toHaveFormValues as z};
|
|
@@ -15,17 +15,17 @@ var e=Object.defineProperty,__name=(t,n)=>e(t,`name`,{value:n,configurable:!0}),
|
|
|
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
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
|
-
`)}}}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
|
-
`)}}}function getStyleDeclaration(e,t){let n={}
|
|
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 nodeNameIs(e,t,n){return e.prefix===null?(e.flags&i.F_HTML)===0?e.name===n:(0,i.asciiLowercase)(e.name)===t:!1}function isElementVisibleImpl(e){let t=null;for(let n=e;n!==null&&n.type===i.ELEMENT_NODE;t=n,n=n.parent){if((0,i.computedValue)(n,`display`)===`none`)return!1;let e=(0,i.computedValue)(n,`visibility`);if(e===`hidden`||e===`collapse`||(0,i.computedValue)(n,`opacity`)===`0`||(0,i.getAttribute)(n,`hidden`)!==null||nodeNameIs(n,`details`,`DETAILS`)&&(t===null||!nodeNameIs(t,`summary`,`SUMMARY`))&&(0,i.getAttribute)(n,`open`)===null)return!1}return!0}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=e[i.$impl],r=t&&(n!==void 0&&(0,i.getComputedStyleOverride)(n)===null?isElementVisibleImpl(n):isElementVisible(e));return{pass:r,message:()=>{let n=r?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeVisible`,`element`,``),``,`Received element ${n} visible${t?``:` (element is not in the document)`}:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
19
|
+
`)}}}function getStyleDeclaration(e,t){let n=normalizedKey(t);if(n!==null){let e=S.get(n);if(e!==void 0)return{...e}}let r={},i=e.createElement(`div`);for(let e of Object.keys(t))i.style[e]=t[e],r[e]=i.style[e];return n!==null&&(S.size>=512&&S.clear(),S.set(n,{...r})),r}const S=/* @__PURE__ */ new Map;function normalizedKey(e){let t=``;for(let n of Object.keys(e)){let r=e[n],i=typeof r;if(i!==`string`&&i!==`number`)return null;t+=`${n}\u0000${i===`number`?`n`:`s`}${r}\u0001`}return t}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(`
|
|
20
20
|
`)}function expectedDiff(e,t,n){let r={};for(let e of Array.from(n))t[e]!==void 0&&(r[e]=n.getPropertyValue(e));return e(printoutStyles(t),printoutStyles(r)).replace(`${picoRed(`+ Received`)}\n`,``)}function toHaveStyle(e,t){checkHtmlElement(e,toHaveStyle,this);let n=typeof t==`object`?t:parseCSS(t,toHaveStyle,this),{getComputedStyle:r}=e.ownerDocument.defaultView,i=getStyleDeclaration(e.ownerDocument,n),a=r(e);return{pass:isSubset(i,a),message:()=>{let e=`${this.isNot?`.not`:``}.toHaveStyle`;return[this.utils.matcherHint(e,`element`,``),expectedDiff(this.utils.diff,i,a)].join(`
|
|
21
21
|
|
|
22
|
-
`)}}}const
|
|
22
|
+
`)}}}const C=r.roles;let w=null;function checkedRoles(){return w??=C.keys().filter(e=>C.get(e)?.props[`aria-checked`]!==void 0)}function roleSupportsChecked(e){return e!==null&&checkedRoles().includes(e)}function supportedRolesSentence(){return toSentence(checkedRoles().map(e=>`role="${e}"`),{lastWordConnector:` or `})}function toBeChecked(e){checkHtmlElement(e,toBeChecked,this);let isValidInput=()=>e.tagName.toLowerCase()===`input`&&[`checkbox`,`radio`].includes(e.type),isValidAriaElement=()=>roleSupportsChecked(e.getAttribute(`role`))&&[`true`,`false`].includes(e.getAttribute(`aria-checked`));if(!isValidInput()&&!isValidAriaElement())return{pass:!1,message:()=>`only inputs with type="checkbox" or type="radio" or elements with ${supportedRolesSentence()} and a valid aria-checked attribute can be used with .toBeChecked(). Use .toHaveValue() instead`};let isChecked=()=>isValidInput()?e.checked:e.getAttribute(`aria-checked`)===`true`;return{pass:isChecked(),message:()=>{let t=isChecked()?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeChecked`,`element`,``),``,`Received element ${t} checked:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
23
23
|
`)}}}function toBePartiallyChecked(e){checkHtmlElement(e,toBePartiallyChecked,this);let isValidInput=()=>e.tagName.toLowerCase()===`input`&&e.type===`checkbox`,isValidAriaElement=()=>e.getAttribute(`role`)===`checkbox`;if(!isValidInput()&&!isValidAriaElement())return{pass:!1,message:()=>`only inputs with type="checkbox" or elements with role="checkbox" and a valid aria-checked attribute can be used with .toBePartiallyChecked(). Use .toHaveValue() instead`};let isPartiallyChecked=()=>{let t=e.getAttribute(`aria-checked`)===`mixed`;return isValidInput()&&e.indeterminate||t};return{pass:isPartiallyChecked(),message:()=>{let t=isPartiallyChecked()?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBePartiallyChecked`,`element`,``),``,`Received element ${t} partially checked:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
24
|
-
`)}}}function isButtonLike(e){let t=(e.getAttribute(`role`)||``).split(` `).map(e=>e.trim());return e.tagName.toLowerCase()===`button`||e.tagName.toLowerCase()===`input`&&e.type===`button`||t.includes(`button`)}function toBePressed(e){checkHtmlElement(e,toBePressed,this);let t=isButtonLike(e),n=e.getAttribute(`aria-pressed`);return!t||n!==`true`&&n!==`false`?{pass:!1,message:()=>`Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePressed()`}:{pass:t&&n===`true`,message:()=>{let e=this.utils.matcherHint(`${this.isNot?`.not`:``}.toBePressed`,`element`,``);return getMessage(this,e,`Expected element to have`,`aria-pressed="${this.isNot?`false`:`true`}"`,`Received`,`aria-pressed="${n}"`)}}}function toBePartiallyPressed(e){checkHtmlElement(e,toBePartiallyPressed,this);let t=isButtonLike(e),n=e.getAttribute(`aria-pressed`);return!t||n!==`true`&&n!==`false`&&n!==`mixed`?{pass:!1,message:()=>`Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePartiallyPressed()`}:{pass:t&&n===`mixed`,message:()=>{let e=this.isNot?`not to`:`to`,t=this.utils.matcherHint(`${this.isNot?`.not`:``}.toBePartiallyPressed`,`element`,``);return getMessage(this,t,`Expected element ${e} have`,`aria-pressed="mixed"`,`Received`,`aria-pressed="${n}"`)}}}const
|
|
24
|
+
`)}}}function isButtonLike(e){let t=(e.getAttribute(`role`)||``).split(` `).map(e=>e.trim());return e.tagName.toLowerCase()===`button`||e.tagName.toLowerCase()===`input`&&e.type===`button`||t.includes(`button`)}function toBePressed(e){checkHtmlElement(e,toBePressed,this);let t=isButtonLike(e),n=e.getAttribute(`aria-pressed`);return!t||n!==`true`&&n!==`false`?{pass:!1,message:()=>`Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePressed()`}:{pass:t&&n===`true`,message:()=>{let e=this.utils.matcherHint(`${this.isNot?`.not`:``}.toBePressed`,`element`,``);return getMessage(this,e,`Expected element to have`,`aria-pressed="${this.isNot?`false`:`true`}"`,`Received`,`aria-pressed="${n}"`)}}}function toBePartiallyPressed(e){checkHtmlElement(e,toBePartiallyPressed,this);let t=isButtonLike(e),n=e.getAttribute(`aria-pressed`);return!t||n!==`true`&&n!==`false`&&n!==`mixed`?{pass:!1,message:()=>`Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePartiallyPressed()`}:{pass:t&&n===`mixed`,message:()=>{let e=this.isNot?`not to`:`to`,t=this.utils.matcherHint(`${this.isNot?`.not`:``}.toBePartiallyPressed`,`element`,``);return getMessage(this,t,`Expected element ${e} have`,`aria-pressed="mixed"`,`Received`,`aria-pressed="${n}"`)}}}const T=[`fieldset`,`input`,`select`,`optgroup`,`option`,`button`,`textarea`];function isFirstLegendChildOfFieldset(e,t){if(getTag(e)!==`legend`||getTag(t)!==`fieldset`)return!1;for(let n=t.firstElementChild;n!==null;n=n.nextElementSibling)if(getTag(n)===`legend`)return e.isSameNode(n);return!1}function isElementDisabledByParent(e,t){return isElementDisabled(t)&&!isFirstLegendChildOfFieldset(e,t)}function isCustomElement(e){return e.includes(`-`)}function canElementBeDisabled(e){let t=getTag(e);return T.includes(t)||isCustomElement(t)}function isElementDisabled(e){return canElementBeDisabled(e)&&e.hasAttribute(`disabled`)}function isAncestorDisabled(e){let t=e.parentElement;return!!t&&(isElementDisabledByParent(e,t)||isAncestorDisabled(t))}function isElementOrAncestorDisabled(e){let t=e[i.$impl];return t===void 0?canElementBeDisabled(e)&&(isElementDisabled(e)||isAncestorDisabled(e)):isElementOrAncestorDisabledImpl(t)}function tagOf(e){return e.prefix===null&&e.tag!==0&&(e.flags&i.F_HTML)!==0?e.name:(e.prefix===null?e.name:`${e.prefix}:${e.name}`).toLowerCase()}function isElementDisabledImpl(e,t){return(T.includes(t)||isCustomElement(t))&&(0,i.getAttribute)(e,`disabled`)!==null}function isElementOrAncestorDisabledImpl(e){let t=tagOf(e);if(!T.includes(t)&&!isCustomElement(t))return!1;if((0,i.getAttribute)(e,`disabled`)!==null)return!0;let n=e,r=t;for(let t=e.parent;t!==null&&t.type===i.ELEMENT_NODE;t=t.parent){let e=tagOf(t);if(isElementDisabledImpl(t,e)&&!isFirstLegendChildImpl(n,r,t,e))return!0;n=t,r=e}return!1}function isFirstLegendChildImpl(e,t,n,r){if(t!==`legend`||r!==`fieldset`)return!1;for(let t=n.first;t!==null;t=t.next)if(t.type===i.ELEMENT_NODE&&tagOf(t)===`legend`)return t===e;return!1}function toBeDisabled(e){checkHtmlElement(e,toBeDisabled,this);let t=isElementOrAncestorDisabled(e);return{pass:t,message:()=>{let n=t?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeDisabled`,`element`,``),``,`Received element ${n} disabled:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
25
25
|
`)}}}function toBeEnabled(e){checkHtmlElement(e,toBeEnabled,this);let t=!isElementOrAncestorDisabled(e);return{pass:t,message:()=>{let n=t?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeEnabled`,`element`,``),``,`Received element ${n} enabled:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
26
|
-
`)}}}const
|
|
27
|
-
`)}}}const
|
|
26
|
+
`)}}}const E=[`select`,`textarea`],D=[`input`,`select`,`textarea`],O=[`color`,`hidden`,`range`,`submit`,`image`,`reset`],k=[`checkbox`,`combobox`,`gridcell`,`listbox`,`radiogroup`,`spinbutton`,`textbox`,`tree`];function isRequiredOnFormTagsExceptInput(e){return E.includes(getTag(e))&&e.hasAttribute(`required`)}function isRequiredOnSupportedInput(e){return getTag(e)===`input`&&e.hasAttribute(`required`)&&(e.hasAttribute(`type`)&&!O.includes(e.getAttribute(`type`))||!e.hasAttribute(`type`))}function isElementRequiredByARIA(e){return e.hasAttribute(`aria-required`)&&e.getAttribute(`aria-required`)===`true`&&(D.includes(getTag(e))||e.hasAttribute(`role`)&&k.includes(e.getAttribute(`role`)))}function toBeRequired(e){checkHtmlElement(e,toBeRequired,this);let t=isRequiredOnFormTagsExceptInput(e)||isRequiredOnSupportedInput(e)||isElementRequiredByARIA(e);return{pass:t,message:()=>{let n=t?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeRequired`,`element`,``),``,`Received element ${n} required:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
27
|
+
`)}}}const A=[`form`,`input`,`select`,`textarea`];function isElementHavingAriaInvalid(e){return e.hasAttribute(`aria-invalid`)&&e.getAttribute(`aria-invalid`)!==`false`}function isElementInvalid(e){let t=isElementHavingAriaInvalid(e);return A.includes(getTag(e))?t||!e.checkValidity():t}function toBeInvalid(e){checkHtmlElement(e,toBeInvalid,this);let t=isElementInvalid(e);return{pass:t,message:()=>{let n=t?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInvalid`,`element`,``),``,`Received element ${n} currently invalid:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
28
28
|
`)}}}function toBeValid(e){checkHtmlElement(e,toBeValid,this);let t=!isElementInvalid(e);return{pass:t,message:()=>{let n=t?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeValid`,`element`,``),``,`Received element ${n} currently valid:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
|
|
29
29
|
`)}}}function toMatchAriaSnapshot(e,t){if(typeof e!=`object`||!e||e[i.$impl]===void 0)throw new NodeTypeError(e,toMatchAriaSnapshot,this);if(typeof t!=`string`)throw TypeError(`toMatchAriaSnapshot expects an aria snapshot template string, got ${t===null?`null`:typeof t}`);let n;try{n=(0,a.matchAriaSnapshot)(e,t)}catch(e){throw e instanceof a.AriaTemplateError&&Error.captureStackTrace&&Error.captureStackTrace(e,toMatchAriaSnapshot),e}let r=this.utils.matcherHint(`${this.isNot?`.not`:``}.toMatchAriaSnapshot`,`element`,`template`);return{pass:n.pass,message:()=>{if(this.isNot)return[r,``,`Expected the accessibility tree not to match the template:`,this.utils.EXPECTED_COLOR(n.expected()),``,`Received:`,this.utils.RECEIVED_COLOR(n.received())].join(`
|
|
30
30
|
`);let e=n.diff(),t=0,i=0,a=[];for(let n=0;n<e.length;n++){let r=e[n];r.kind===`-`?(t++,a.push(this.utils.EXPECTED_COLOR(`- ${r.text}`))):r.kind===`+`?(i++,a.push(this.utils.RECEIVED_COLOR(`+ ${r.text}`))):a.push(` ${r.text}`)}return[r,``,`${this.utils.EXPECTED_COLOR(`- Expected - ${t}`)} (template)`,`${this.utils.RECEIVED_COLOR(`+ Received + ${i}`)} (closest part of the accessibility tree)`,``,...a,``,`Received accessibility tree:`,this.utils.RECEIVED_COLOR(n.received())].join(`
|
|
31
|
-
`)}}}var
|
|
31
|
+
`)}}}var j=/* @__PURE__ */ __exportAll({toAppearAfter:()=>toAppearAfter,toAppearBefore:()=>toAppearBefore,toBeChecked:()=>toBeChecked,toBeDisabled:()=>toBeDisabled,toBeEmpty:()=>toBeEmpty,toBeEmptyDOMElement:()=>toBeEmptyDOMElement,toBeEnabled:()=>toBeEnabled,toBeInTheDOM:()=>toBeInTheDOM,toBeInTheDocument:()=>toBeInTheDocument,toBeInvalid:()=>toBeInvalid,toBePartiallyChecked:()=>toBePartiallyChecked,toBePartiallyPressed:()=>toBePartiallyPressed,toBePressed:()=>toBePressed,toBeRequired:()=>toBeRequired,toBeValid:()=>toBeValid,toBeVisible:()=>toBeVisible,toContainAnyByAltText:()=>M,toContainAnyByDisplayValue:()=>P,toContainAnyByLabelText:()=>I,toContainAnyByPlaceholderText:()=>R,toContainAnyByRole:()=>B,toContainAnyByTestId:()=>H,toContainAnyByText:()=>W,toContainAnyByTitle:()=>K,toContainElement:()=>toContainElement,toContainHTML:()=>toContainHTML,toContainOneByAltText:()=>N,toContainOneByDisplayValue:()=>F,toContainOneByLabelText:()=>L,toContainOneByPlaceholderText:()=>z,toContainOneByRole:()=>V,toContainOneByTestId:()=>U,toContainOneByText:()=>G,toContainOneByTitle:()=>q,toHaveAccessibleDescription:()=>toHaveAccessibleDescription,toHaveAccessibleErrorMessage:()=>toHaveAccessibleErrorMessage,toHaveAccessibleName:()=>toHaveAccessibleName,toHaveAttribute:()=>toHaveAttribute,toHaveClass:()=>toHaveClass,toHaveDescription:()=>toHaveDescription,toHaveDisplayValue:()=>toHaveDisplayValue,toHaveErrorMessage:()=>toHaveErrorMessage,toHaveFocus:()=>toHaveFocus,toHaveFormValues:()=>toHaveFormValues,toHaveRole:()=>toHaveRole,toHaveSelection:()=>toHaveSelection,toHaveStyle:()=>toHaveStyle,toHaveTextContent:()=>toHaveTextContent,toHaveValue:()=>toHaveValue,toMatchAriaSnapshot:()=>toMatchAriaSnapshot});const{toContainAnyByAltText:M,toContainOneByAltText:N,toContainAnyByDisplayValue:P,toContainOneByDisplayValue:F,toContainAnyByLabelText:I,toContainOneByLabelText:L,toContainAnyByPlaceholderText:R,toContainOneByPlaceholderText:z,toContainAnyByRole:B,toContainOneByRole:V,toContainAnyByTestId:H,toContainOneByTestId:U,toContainAnyByText:W,toContainOneByText:G,toContainAnyByTitle:K,toContainOneByTitle:q}=m;Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return toHaveAccessibleDescription}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return toHaveSelection}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return toBePartiallyChecked}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return toBeValid}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return toBeRequired}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return toHaveRole}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return toBeEmpty}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return toHaveValue}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return toHaveAttribute}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return toBeInTheDocument}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return toBeEmptyDOMElement}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return toHaveClass}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return toHaveAccessibleName}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return toHaveDescription}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return toBeVisible}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return toHaveErrorMessage}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return toHaveDisplayValue}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return toBeInvalid}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return toBePressed}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return toAppearAfter}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return toHaveTextContent}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return toAppearBefore}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return toContainHTML}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return toContainElement}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return toHaveFocus}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return toBeDisabled}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return toHaveAccessibleErrorMessage}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return toHaveStyle}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return toBeInTheDOM}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return toMatchAriaSnapshot}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return toBePartiallyPressed}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return toBeEnabled}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return toBeChecked}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return toHaveFormValues}});
|
package/dist/jest-dom/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-DJmRgUYG.cjs");expect.extend(e.t);
|
package/dist/jest-dom/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./_chunks/matchers-
|
|
1
|
+
import{t as e}from"./_chunks/matchers-DGsBvtWC.js";expect.extend(e);export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-DJmRgUYG.cjs");require("@jest/globals").expect.extend(e.t);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./_chunks/matchers-
|
|
1
|
+
import{t as e}from"./_chunks/matchers-DGsBvtWC.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-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-DJmRgUYG.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-
|
|
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-DGsBvtWC.js";
|
package/dist/jest-dom/vitest.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-DJmRgUYG.cjs");require("vitest").expect.extend(e.t);
|
package/dist/jest-dom/vitest.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./_chunks/matchers-
|
|
1
|
+
import{t as e}from"./_chunks/matchers-DGsBvtWC.js";import{expect as t}from"vitest";t.extend(e);export{};
|