@vitest/browser 4.1.3 → 4.1.5

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.
@@ -23,7 +23,7 @@
23
23
  })();
24
24
  </script>
25
25
  <!-- !LOAD_METADATA! -->
26
- <script type="module" src="./assets/index-DflzHTY2.js"></script>
26
+ <script type="module" src="./assets/index-BPQdrqGZ.js"></script>
27
27
  <link rel="stylesheet" href="./assets/index-Da0hb3oU.css">
28
28
  </head>
29
29
  <body>
@@ -690,7 +690,14 @@ function parseStacktrace(stack, options = {}) {
690
690
  const { ignoreStackEntries = stackIgnorePatterns } = options;
691
691
  let stacks = !CHROME_IE_STACK_REGEXP.test(stack) ? parseFFOrSafariStackTrace(stack) : parseV8Stacktrace(stack);
692
692
  const helperIndex = stacks.findLastIndex(
693
- (s) => s.method === "__VITEST_HELPER__" || s.method === "async*__VITEST_HELPER__" || s.method === "async __VITEST_HELPER__"
693
+ (s) => (
694
+ // this covers cases such as
695
+ // "__VITEST_HELPER__"
696
+ // "__VITEST_HELPER__ [as <object method name>]"
697
+ // "async*__VITEST_HELPER__" (firefox)
698
+ // "async __VITEST_HELPER__" (webkit)
699
+ s.method.includes("__VITEST_HELPER__")
700
+ )
694
701
  );
695
702
  if (helperIndex >= 0) {
696
703
  stacks = stacks.slice(helperIndex + 1);
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" href="{__VITEST_FAVICON__}" type="image/svg+xml">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Vitest Browser Tester</title>
8
- <script type="module" crossorigin src="/__vitest_browser__/tester-DvOWMUmv.js"></script>
8
+ <script type="module" crossorigin src="/__vitest_browser__/tester-Bf18VQr2.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/__vitest_browser__/utils-DmkAiRYk.js">
10
10
  </head>
11
11
  <body>
@@ -1,27 +1,34 @@
1
- import{recordArtifact as e,expect as t,chai as n}from"vitest";import{getType as r}from"vitest/internal/browser";import{k as i,L as a,g as o,a as s,b as c,c as l,e as u,i as ee,d as te,f as ne,h as re,j as ie,l as d,m as f,p as ae,n as oe}from"./index-C8KwPhQz.js";import{server as p}from"vitest/browser";function se(){return[...i]}function ce(e,t,n){return e instanceof a&&(e=e.query()),e==null?null:m(e,t,n)}function m(e,t,n){e instanceof a&&(e=e.element());let r=e?.ownerDocument?.defaultView||window;if(e instanceof r.HTMLElement||e instanceof r.SVGElement)return e;throw new me(e,t,n)}function le(e,t,n){e instanceof a&&(e=e.element());let r=e.ownerDocument?.defaultView||window;if(e instanceof r.Node)return e;throw new he(e,t,n)}function h(e,t,n,r,i,a){return[`${t}\n`,`${n}:\n${e.utils.EXPECTED_COLOR(g(_(e,r),2))}`,`${i}:\n${e.utils.RECEIVED_COLOR(g(_(e,a),2))}`].join(`
2
- `)}function g(e,t){return ue(fe(e),t)}function ue(e,t){return e.replace(/^(?!\s*$)/gm,` `.repeat(t))}function de(e){let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((e,t)=>Math.min(e,t.length),1/0):0}function fe(e){let t=de(e);if(t===0)return e;let n=RegExp(`^[ \\t]{${t}}`,`gm`);return e.replace(n,``)}function _(e,t){return typeof t==`string`?t:e.utils.stringify(t)}function pe(e,{wordConnector:t=`, `,lastWordConnector:n=` and `}={}){return[e.slice(0,-1).join(t),e.at(-1)].join(e.length>1?n:``)}class v 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} or a Locator that returns ${e}.`,i].join(`
3
- `)}}class me extends v{constructor(e,t,n){super(`an HTMLElement or an SVGElement`,e,t,n)}}class he extends v{constructor(e,t,n){super(`a Node`,e,t,n)}}function y(e){return e instanceof HTMLFormElement?`FORM`:e.tagName.toUpperCase()}function b(e){return y(e)===`INPUT`}function x(e){if(e)switch(y(e)){case`INPUT`:return _e(e);case`SELECT`:return ge(e);default:return e.value??ye(e)}}function ge({multiple:e,options:t}){let n=[...t].filter(e=>e.selected);if(e)return[...n].map(e=>e.value);if(n.length!==0)return n[0].value}function _e(e){switch(e.type){case`number`:return e.value===``?null:Number(e.value);case`checkbox`:return e.checked;default:return e.value}}const ve=[`meter`,`progressbar`,`slider`,`spinbutton`];function ye(e){if(ve.includes(e.getAttribute(`role`)||``))return Number(e.getAttribute(`aria-valuenow`))}function be(e){return e.replace(/\s+/g,` `).trim()}function xe(e,t){return t instanceof RegExp?t.test(e):e.includes(String(t))}function S(e,t){if(Array.isArray(e)&&Array.isArray(t)){let n=new Set(t);for(let t of new Set(e))if(!n.has(t))return!1;return!0}}const C=se();function w(e){let t=m(e,w,this);if(!(b(t)&&[`checkbox`,`radio`].includes(t.type))&&!(C.includes(s(t)||``)&&[`true`,`false`].includes(t.getAttribute(`aria-checked`)||``)))return{pass:!1,message:()=>`only inputs with type="checkbox" or type="radio" or elements with ${Se()} and a valid aria-checked attribute can be used with .toBeChecked(). Use .toHaveValue() instead`};let n=o(t)===!0;return{pass:n,message:()=>{let e=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeChecked`,`element`,``),``,`Received element ${e} checked:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
4
- `)}}}function Se(){return pe(C.map(e=>`role="${e}"`),{lastWordConnector:` or `})}function T(e){let t=m(e,T,this);return{pass:Ce(t),message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeEmptyDOMElement`,`element`,``),``,`Received:`,` ${this.utils.printReceived(t.innerHTML)}`].join(`
5
- `)}}function Ce(e){return[...e.childNodes].filter(e=>e.nodeType!==Node.COMMENT_NODE).length===0}function E(e){let t=m(e,E,this),n=O(t);return{pass:n,message:()=>{let e=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeDisabled`,`element`,``),``,`Received element ${e} disabled:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
6
- `)}}}function D(e){let t=m(e,D,this),n=O(t);return{pass:!n,message:()=>{let e=n?`is not`:`is`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeEnabled`,`element`,``),``,`Received element ${e} enabled:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
7
- `)}}}function O(e){return y(e).includes(`-`)?e.hasAttribute(`disabled`):c(e)}function k(e){let t=null;(e!==null||!this.isNot)&&(t=ce(e,k,this));let n=t===null?!1:t.ownerDocument===t.getRootNode({composed:!0}),r=()=>`expected document not to contain element, found ${this.utils.stringify(t?.cloneNode(!0))} instead`,i=()=>`element could not be found in the document`;return{pass:n,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInTheDocument`,`element`,``),``,this.utils.RECEIVED_COLOR(this.isNot?r():i())].join(`
8
- `)}}const we=[`FORM`,`INPUT`,`SELECT`,`TEXTAREA`];function Te(e){return e.hasAttribute(`aria-invalid`)&&e.getAttribute(`aria-invalid`)!==`false`}function Ee(e){return we.includes(y(e))}function A(e){let t=Te(e);return Ee(e)?t||!e.checkValidity():t}function j(e){let t=m(e,j,this),n=A(t);return{pass:n,message:()=>{let e=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInvalid`,`element`,``),``,`Received element ${e} currently invalid:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
9
- `)}}}function De(e){let t=m(e,j,this),n=!A(t);return{pass:n,message:()=>{let e=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeValid`,`element`,``),``,`Received element ${e} currently valid:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
10
- `)}}}function M(e,t){let n=m(e,M,this),r=t?.ratio??0;return Oe(n,r).then(({pass:e,ratio:t})=>({pass:e,message:()=>{let i=e?`is`:`is not`,a=r>0?` with ratio ${r}`:``,o=t===void 0?``:` (actual ratio: ${t.toFixed(3)})`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInViewport`,`element`,``),``,`Received element ${i} in viewport${a}${o}:`,` ${this.utils.printReceived(n.cloneNode(!1))}`].join(`
11
- `)}}))}async function Oe(e,t){let n=await new Promise(t=>{let n=new IntersectionObserver(e=>{e.length>0?t(e[0].intersectionRatio):t(0),n.disconnect()});n.observe(e),requestAnimationFrame(()=>{})});return{pass:n>0&&n>t-1e-9,ratio:n}}function N(e){let t=m(e,N,this);if(!(b(t)&&t.type===`checkbox`)&&t.getAttribute(`role`)!==`checkbox`)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 n=ke(t);return{pass:n,message:()=>{let e=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBePartiallyChecked`,`element`,``),``,`Received element ${e} partially checked:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
12
- `)}}}function ke(e){let t=o(e)===`mixed`;return!t&&b(e)&&[`checkbox`,`radio`].includes(e.type)&&e.getAttribute(`aria-checked`)===`mixed`?!0:t}const Ae=[`SELECT`,`TEXTAREA`],je=[`INPUT`,`SELECT`,`TEXTAREA`],Me=[`color`,`hidden`,`range`,`submit`,`image`,`reset`],Ne=[`checkbox`,`combobox`,`gridcell`,`listbox`,`radiogroup`,`spinbutton`,`textbox`,`tree`];function Pe(e){return Ae.includes(y(e))&&e.hasAttribute(`required`)}function Fe(e){return y(e)===`INPUT`&&e.hasAttribute(`required`)&&(e.hasAttribute(`type`)&&!Me.includes(e.getAttribute(`type`)||``)||!e.hasAttribute(`type`))}function Ie(e){return e.hasAttribute(`aria-required`)&&e.getAttribute(`aria-required`)===`true`&&(je.includes(y(e))||e.hasAttribute(`role`)&&Ne.includes(e.getAttribute(`role`)||``))}function P(e){let t=m(e,P,this),n=Pe(t)||Fe(t)||Ie(t);return{pass:n,message:()=>{let e=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeRequired`,`element`,``),``,`Received element ${e} required:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
13
- `)}}}function Le(e){let t=m(e,Le,this),n=t.ownerDocument===t.getRootNode({composed:!0});l();let r=n&&Re(t);return u(),{pass:r,message:()=>{let e=r?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeVisible`,`element`,``),``,`Received element ${e} visible${n?``:` (element is not in the document)`}:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
14
- `)}}}function Re(e){let t=ee(e);if(p.browser!==`webkit`)return t;let n=e.closest(`details`);return!n||e===n?t:ze(e)}function ze(e){let t=e;for(;t;){if(t.tagName===`DETAILS`){let n=t.querySelector(`summary`)===e;if(!t.open&&!n)return!1}t=t.parentElement}return e.offsetParent!==null}function F(e,t){let n=m(e,F,this),r=t===null?null:m(t,F,this);return{pass:n.contains(r),message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toContainElement`,`element`,`element`),``,this.utils.RECEIVED_COLOR(`${this.utils.stringify(n.cloneNode(!1))} ${this.isNot?`contains:`:`does not contain:`} ${this.utils.stringify(r?r.cloneNode(!1):null)}
1
+ import{Snapshots as e,recordArtifact as t,expect as n,chai as r}from"vitest";import{getType as i}from"vitest/internal/browser";import{b as a,e as o,i as s,g as c,n as l,a as u,k as d,c as f,d as ee,f as p,h as te,j as ne,l as re,m as ie,o as ae,p as oe,q as se,r as ce,s as le,t as m,_ as h,L as g,u as ue,v as de,w as fe,x as pe,y as me,z as _,A as he,B as ge}from"./index-D8jtZoIM.js";import{server as _e}from"vitest/browser";var ve=Object.defineProperty,ye=(e,t)=>{let n={};for(var r in e)ve(n,r,{get:e[r],enumerable:!0});return ve(n,Symbol.toStringTag,{value:`Module`}),n};function be(e,t,n={}){let r=xe(e,t,n);if(r.errors.length)throw Error(r.errors[0].message);return r.fragment}function xe(e,t,n={}){let r=new e.LineCounter,i={keepSourceTokens:!0,lineCounter:r,...n},a=e.parseDocument(t,i),o=[],s=e=>[r.linePos(e[0]),r.linePos(e[1])],c=e=>{o.push({message:e.message,range:[r.linePos(e.pos[0]),r.linePos(e.pos[1])]})},l=(t,n)=>{for(let r of n.items){if(r instanceof e.Scalar&&typeof r.value==`string`){let e=we.parse(r,i,o);e&&(t.children=t.children||[],t.children.push(e));continue}if(r instanceof e.YAMLMap){u(t,r);continue}o.push({message:`Sequence items should be strings or maps`,range:s(r.range||n.range)})}},u=(t,n)=>{for(let r of n.items){if(t.children=t.children||[],!(r.key instanceof e.Scalar&&typeof r.key.value==`string`)){o.push({message:`Only string keys are supported`,range:s(r.key.range||n.range)});continue}let a=r.key,c=r.value;if(a.value===`text`){if(!(c instanceof e.Scalar&&typeof c.value==`string`)){o.push({message:`Text value should be a string`,range:s(r.value.range||n.range)});continue}t.children.push({kind:`text`,text:v(c.value)});continue}if(a.value===`/children`){if(!(c instanceof e.Scalar&&typeof c.value==`string`)||c.value!==`contain`&&c.value!==`equal`&&c.value!==`deep-equal`){o.push({message:`Strict value should be "contain", "equal" or "deep-equal"`,range:s(r.value.range||n.range)});continue}t.containerMode=c.value;continue}if(a.value.startsWith(`/`)){if(!(c instanceof e.Scalar&&typeof c.value==`string`)){o.push({message:`Property value should be a string`,range:s(r.value.range||n.range)});continue}t.props=t.props??{},t.props[a.value.slice(1)]=v(c.value);continue}let u=we.parse(a,i,o);if(u){if(c instanceof e.Scalar){let e=typeof c.value;if(e!==`string`&&e!==`number`&&e!==`boolean`){o.push({message:`Node value should be a string or a sequence`,range:s(r.value.range||n.range)});continue}t.children.push({...u,children:[{kind:`text`,text:v(String(c.value))}]});continue}if(c instanceof e.YAMLSeq){t.children.push(u),l(u,c);continue}o.push({message:`Map values should be strings or sequences`,range:s(r.value.range||n.range)})}}},d={kind:`role`,role:`fragment`};return a.errors.forEach(c),o.length||(a.contents instanceof e.YAMLSeq||o.push({message:`Aria snapshot must be a YAML sequence, elements starting with " -"`,range:a.contents?s(a.contents.range):[{line:0,col:0},{line:0,col:0}]}),o.length)?{errors:o,fragment:d}:(l(d,a.contents),o.length?{errors:o,fragment:Se}:d.children?.length===1&&(!d.containerMode||d.containerMode===`contain`)?{fragment:d.children[0],errors:[]}:{fragment:d,errors:[]})}const Se={kind:`role`,role:`fragment`};function Ce(e){return e.replace(/[\u200b\u00ad]/g,``).replace(/[\r\n\s\t]+/g,` `).trim()}function v(e){return{raw:e,normalized:Ce(e)}}var we=class e{static parse(t,n,r){try{return new e(t.value)._parse()}catch(e){if(e instanceof y){let i=n.prettyErrors===!1?e.message:`${e.message}:\n\n${t.value}\n${` `.repeat(e.pos)}^\n`;return r.push({message:i,range:[n.lineCounter.linePos(t.range[0]),n.lineCounter.linePos(t.range[0]+e.pos)]}),null}throw e}}constructor(e){h(this,`_input`,void 0),h(this,`_pos`,void 0),h(this,`_length`,void 0),this._input=e,this._pos=0,this._length=e.length}_peek(){return this._input[this._pos]||``}_next(){return this._pos<this._length?this._input[this._pos++]:null}_eof(){return this._pos>=this._length}_isWhitespace(){return!this._eof()&&/\s/.test(this._peek())}_skipWhitespace(){for(;this._isWhitespace();)this._pos++}_readIdentifier(e){this._eof()&&this._throwError(`Unexpected end of input when expecting ${e}`);let t=this._pos;for(;!this._eof()&&/[a-zA-Z]/.test(this._peek());)this._pos++;return this._input.slice(t,this._pos)}_readString(){let e=``,t=!1;for(;!this._eof();){let n=this._next();if(t)e+=n,t=!1;else if(n===`\\`)t=!0;else if(n===`"`)return e;else e+=n}this._throwError(`Unterminated string`)}_throwError(e,t=0){throw new y(e,t||this._pos)}_readRegex(){let e=``,t=!1,n=!1;for(;!this._eof();){let r=this._next();if(t)e+=r,t=!1;else if(r===`\\`)t=!0,e+=r;else if(r===`/`&&!n)return{pattern:e};else r===`[`?(n=!0,e+=r):r===`]`&&n?(e+=r,n=!1):e+=r}this._throwError(`Unterminated regex`)}_readStringOrRegex(){let e=this._peek();return e===`"`?(this._next(),Ce(this._readString())):e===`/`?(this._next(),this._readRegex()):null}_readAttributes(e){let t=this._pos;for(;this._skipWhitespace(),this._peek()===`[`;){this._next(),this._skipWhitespace(),t=this._pos;let n=this._readIdentifier(`attribute`);this._skipWhitespace();let r=``;if(this._peek()===`=`)for(this._next(),this._skipWhitespace(),t=this._pos;this._peek()!==`]`&&!this._isWhitespace()&&!this._eof();)r+=this._next();this._skipWhitespace(),this._peek()!==`]`&&this._throwError(`Expected ]`),this._next(),this._applyAttribute(e,n,r||`true`,t)}}_parse(){this._skipWhitespace();let e=this._readIdentifier(`role`);this._skipWhitespace();let t={kind:`role`,role:e,name:this._readStringOrRegex()||void 0};return this._readAttributes(t),this._skipWhitespace(),this._eof()||this._throwError(`Unexpected input`),t}_applyAttribute(e,t,n,r){if(t===`checked`){this._assert(n===`true`||n===`false`||n===`mixed`,`Value of "checked" attribute must be a boolean or "mixed"`,r),e.checked=n===`true`?!0:n===`false`?!1:`mixed`;return}if(t===`disabled`){this._assert(n===`true`||n===`false`,`Value of "disabled" attribute must be a boolean`,r),e.disabled=n===`true`;return}if(t===`expanded`){this._assert(n===`true`||n===`false`,`Value of "expanded" attribute must be a boolean`,r),e.expanded=n===`true`;return}if(t===`active`){this._assert(n===`true`||n===`false`,`Value of "active" attribute must be a boolean`,r),e.active=n===`true`;return}if(t===`level`){this._assert(!Number.isNaN(Number(n)),`Value of "level" attribute must be a number`,r),e.level=Number(n);return}if(t===`pressed`){this._assert(n===`true`||n===`false`||n===`mixed`,`Value of "pressed" attribute must be a boolean or "mixed"`,r),e.pressed=n===`true`?!0:n===`false`?!1:`mixed`;return}if(t===`selected`){this._assert(n===`true`||n===`false`,`Value of "selected" attribute must be a boolean`,r),e.selected=n===`true`;return}this._assert(!1,`Unsupported attribute [${t}]`,r)}_assert(e,t,n){e||this._throwError(t||`Assertion error`,n)}},y=class extends Error{constructor(e,t){super(e),h(this,`pos`,void 0),this.pos=t}};function b(e,t){return t?e?typeof t==`string`?e===t:!!e.match(new RegExp(t.pattern)):!1:!0}function x(e,t){if(!t?.normalized)return!0;if(!e)return!1;if(e===t.normalized||e===t.raw)return!0;let n=C(t);return n?!!e.match(n):!1}const S=Symbol(`cachedRegex`);function C(e){if(e[S]!==void 0)return e[S];let{raw:t}=e,n=t.startsWith(`/`)&&t.endsWith(`/`)&&t.length>1,r;try{r=n?new RegExp(t.slice(1,-1)):null}catch{r=null}return e[S]=r,r}function w(e,t,n){if(typeof e==`string`&&t.kind===`text`)return x(e,t.text);if(typeof e!=`object`||!e||t.kind!==`role`||t.role!==`fragment`&&t.role!==e.role||t.checked!==void 0&&t.checked!==e.checked||t.disabled!==void 0&&t.disabled!==e.disabled||t.expanded!==void 0&&t.expanded!==e.expanded||t.level!==void 0&&t.level!==e.level||t.pressed!==void 0&&t.pressed!==e.pressed||t.selected!==void 0&&t.selected!==e.selected||!b(e.name,t.name))return!1;if(t.props){for(let[n,r]of Object.entries(t.props))if(!x(e.props[n]||``,r))return!1}return t.containerMode===`contain`?E(e.children||[],t.children||[]):t.containerMode===`equal`?T(e.children||[],t.children||[],!1):t.containerMode===`deep-equal`||n?T(e.children||[],t.children||[],!0):E(e.children||[],t.children||[])}function T(e,t,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!w(e[r],t[r],n))return!1;return!0}function E(e,t){if(t.length>e.length)return!1;let n=e.slice(),r=t.slice();for(let e of r){let t=n.shift();for(;t&&!w(t,e,!1);)t=n.shift();if(!t)return!1}return!0}var Te=ye({LineCounter:()=>Ee,Scalar:()=>D,YAMLError:()=>A,YAMLMap:()=>O,YAMLSeq:()=>k,parseDocument:()=>De}),D=class{constructor(e,t=[0,0,0]){h(this,`value`,void 0),h(this,`range`,void 0),this.value=e,this.range=t}},O=class{constructor(e=[0,0,0]){h(this,`items`,void 0),h(this,`range`,void 0),this.items=[],this.range=e}},k=class{constructor(e=[0,0,0]){h(this,`items`,void 0),h(this,`range`,void 0),this.items=[],this.range=e}},Ee=class{constructor(){h(this,`lineStarts`,[0])}addNewLine(e){e>this.lineStarts[this.lineStarts.length-1]&&this.lineStarts.push(e)}linePos(e){let t=0,n=this.lineStarts.length-1;for(;t<n;){let r=t+n+1>>1;this.lineStarts[r]<=e?t=r:n=r-1}return{line:t+1,col:e-this.lineStarts[t]+1}}},A=class extends Error{constructor(e,t){super(e),h(this,`pos`,void 0),this.pos=t}};function De(e,t={}){let n=t.lineCounter,r=[];if(n)for(let t=0;t<e.length;t++)e[t]===`
2
+ `&&n.addNewLine(t+1);try{return{contents:new Oe(e,r).parseRoot(),errors:r}}catch(e){if(e instanceof A)return r.push(e),{contents:null,errors:r};throw e}}var Oe=class{constructor(e,t){h(this,`lines`,void 0),h(this,`pos`,void 0),h(this,`text`,void 0),h(this,`errors`,void 0),this.text=e,this.errors=t,this.lines=[],this.pos=0;let n=0,r=e.split(`
3
+ `);for(let e of r){let t=e.replace(/\r$/,``),r=t.replace(/^\s+/,``),i=t.length-r.length;this.lines.push({indent:i,content:r,offset:n+i,lineOffset:n,raw:t}),n+=e.length+1}for(;this.lines.length>0&&this.lines[this.lines.length-1].content===``;)this.lines.pop()}parseRoot(){if(this.lines.length===0)return null;let e=this.parseNode(0);if(this.skipEmpty(),this.pos<this.lines.length){let e=this.currentLine();this.addError(`Unexpected scalar at node end`,e.offset)}return e}currentLine(){return this.lines[this.pos]}parseNode(e){this.skipEmpty();let t=this.currentLine();return!t||t.indent<e?null:t.content.startsWith(`- `)||t.content===`-`?this.parseSequence(t.indent):this.isMapEntry(t.content)?this.parseMap(t.indent):this.parseScalarValue(t.content,t.offset,t)}parseSequence(e){let t=this.currentLine(),n=new k([t.offset-t.indent,0,0]),r=t.offset;for(;this.pos<this.lines.length;){this.skipEmpty();let t=this.currentLine();if(!t||t.indent<e)break;if(t.indent>e){this.addError(`Bad indentation of a sequence entry`,t.offset);break}if(!t.content.startsWith(`- `)&&t.content!==`-`)break;let i=t.content===`-`?1:2,a=t.content.slice(i),o=t.offset+i;if(this.pos++,a===``||a.trim()===``){let t=this.parseNode(e+1);t&&(n.items.push(t),r=this.peekLastOffset())}else if(this.isMapEntry(a)){let s=this.parseInlineMap(a,o,e+i,t);n.items.push(s),r=s.range[2]}else{let e=this.parseScalarValue(a,o,t);n.items.push(e),r=e.range[2]}}return n.range[1]=r,n.range[2]=r,n}parseMap(e){let t=this.currentLine(),n=new O([t.offset-t.indent,0,0]),r=t.offset;for(;this.pos<this.lines.length;){this.skipEmpty();let t=this.currentLine();if(!t||t.indent<e)break;if(t.indent>e){this.addError(`Bad indentation of a mapping entry`,t.offset);break}if(!this.isMapEntry(t.content))break;let{key:i,valueStr:a,colonOffset:o,valueOffset:s}=this.splitMapEntry(t.content,t.offset),c=new D(i,[t.offset,t.offset+i.length,o]);this.pos++;let l;l=a===``?this.parseMapValue(e,o):this.parseScalarValue(a.trim(),s,t),n.items.push({key:c,value:l}),r=l?this.getNodeEnd(l):o+1}return n.range[1]=r,n.range[2]=r,n}parseInlineMap(e,t,n,r){let i=new O([t,0,0]),a=t,{key:o,valueStr:s,colonOffset:c,valueOffset:l}=this.splitMapEntry(e,t),u=new D(o,[t,t+o.length,c]),d;for(d=s===``?this.parseMapValue(n,c):this.parseScalarValue(s.trim(),l,r),i.items.push({key:u,value:d}),a=d?this.getNodeEnd(d):c+1;this.pos<this.lines.length;){this.skipEmpty();let e=this.currentLine();if(!e||e.indent<n||e.indent>n||!this.isMapEntry(e.content)||e.content.startsWith(`- `))break;let t=this.splitMapEntry(e.content,e.offset),r=new D(t.key,[e.offset,e.offset+t.key.length,t.colonOffset]);this.pos++;let o;o=t.valueStr===``?this.parseMapValue(n,t.colonOffset):this.parseScalarValue(t.valueStr.trim(),t.valueOffset,e),i.items.push({key:r,value:o}),a=o?this.getNodeEnd(o):t.colonOffset+1}return i.range[1]=a,i.range[2]=a,i}parseMapValue(e,t){this.skipEmpty();let n=this.currentLine();return!n||n.indent<e?new D(null,[t+1,t+1,t+1]):n.indent===e&&(n.content.startsWith(`- `)||n.content===`-`)?this.parseNode(e):n.indent>e?this.parseNode(e+1):new D(null,[t+1,t+1,t+1])}getNodeEnd(e){return e.range[2]}peekLastOffset(){if(this.pos>0&&this.pos<=this.lines.length){let e=this.lines[this.pos-1];return e.lineOffset+e.raw.length}return this.text.length}parseScalarValue(e,t,n){let r=e.trim(),i=t+e.indexOf(r),a=i+r.length,o=n.lineOffset+n.raw.length;return r.startsWith(`"`)?this.parseQuotedScalar(r,i,o):r===`true`||r===`false`?new D(r===`true`,[i,a,o]):r===`null`||r===`~`?new D(null,[i,a,o]):r!==``&&ke(r)?new D(Number(r),[i,a,o]):new D(r,[i,a,o])}parseQuotedScalar(e,t,n){let r=``,i=1;for(;i<e.length;){let a=e[i];if(a===`\\`){if(i++,i>=e.length){this.addError(`Unterminated double-quoted string`,t+i);break}let n=e[i];switch(n){case`n`:r+=`
4
+ `;break;case`t`:r+=` `;break;case`r`:r+=`\r`;break;case`"`:r+=`"`;break;case`\\`:r+=`\\`;break;case`/`:r+=`/`;break;default:r+=n}}else if(a===`"`){let e=t+i+1;return new D(r,[t,e,n])}else r+=a;i++}return this.addError(`Unterminated double-quoted string`,t),new D(r,[t,t+e.length,n])}skipEmpty(){for(;this.pos<this.lines.length&&this.lines[this.pos].content===``;)this.pos++}isMapEntry(e){return this.findMapColon(e)>=0}findMapColon(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){n=!1;continue}if(i===`\\`&&t){n=!0;continue}if(i===`"`){t=!t;continue}if(!t&&i===`:`&&(r+1>=e.length||e[r+1]===` `))return r}return-1}splitMapEntry(e,t){let n=this.findMapColon(e),r=e.slice(0,n).trim(),i=t+n,a=e.slice(n+1),o=a.trimStart(),s=i+1+(a.length-a.trimStart().length);return r.startsWith(`"`)&&r.endsWith(`"`)?{key:r.slice(1,-1),valueStr:o,colonOffset:i,valueOffset:s}:{key:r,valueStr:o,colonOffset:i,valueOffset:s}}addError(e,t){this.errors.push(new A(e,[t,t+1]))}};function ke(e){return e===``||e===`-`||e===`+`?!1:/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(e)}function j(e){return Ae(e)?`"`+e.replace(/[\\"\x00-\x1f\x7f-\x9f]/g,e=>{switch(e){case`\\`:return`\\\\`;case`"`:return`\\"`;case`\b`:return`\\b`;case`\f`:return`\\f`;case`
5
+ `:return`\\n`;case`\r`:return`\\r`;case` `:return`\\t`;default:return`\\x`+e.charCodeAt(0).toString(16).padStart(2,`0`)}})+`"`:e}function Ae(e){return!!(e.length===0||/^\s|\s$/.test(e)||/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(e)||/^-/.test(e)||/[\n:](\s|$)/.test(e)||/\s#/.test(e)||/[\n\r]/.test(e)||/^[&*\],?!>|@"'#%]/.test(e)||/[{}`]/.test(e)||/^\[/.test(e)||!isNaN(Number(e))||[`y`,`n`,`yes`,`no`,`true`,`false`,`on`,`off`,`null`].includes(e.toLowerCase()))}const M={visible:!0,inline:!1};function je(e){let t=new Set,n={role:`fragment`,name:``,children:[],props:{},box:M,receivesPointerEvents:!0},r=(n,r,a)=>{if(t.has(r))return;if(t.add(r),r.nodeType===Node.TEXT_NODE&&r.nodeValue){if(!a)return;let e=r.nodeValue;n.role!==`textbox`&&e&&n.children.push(r.nodeValue||``);return}if(r.nodeType!==Node.ELEMENT_NODE)return;let o=r,c=!s(o);if(!c)return;let l=[];if(o.hasAttribute(`aria-owns`)){let t=o.getAttribute(`aria-owns`).split(/\s+/);for(let n of t){let t=e.ownerDocument.getElementById(n);t&&l.push(t)}}let u=Me(o);u&&n.children.push(u),i(u||n,o,l,c)};function i(e,t,n,i){let a=(le(t)?.display||`inline`)!==`inline`||t.nodeName===`BR`?` `:``;a&&e.children.push(a),e.children.push(m(t,`::before`));let o=t.nodeName===`SLOT`?t.assignedNodes():[];if(o.length)for(let t of o)r(e,t,i);else{for(let n=t.firstChild;n;n=n.nextSibling)n.assignedSlot||r(e,n,i);if(t.shadowRoot)for(let n=t.shadowRoot.firstChild;n;n=n.nextSibling)r(e,n,i)}for(let t of n)r(e,t,i);if(e.children.push(m(t,`::after`)),a&&e.children.push(a),e.children.length===1&&e.name===e.children[0]&&(e.children=[]),e.role===`link`&&t.hasAttribute(`href`)){let n=t.getAttribute(`href`);e.props.url=n}if(e.role===`textbox`&&t.hasAttribute(`placeholder`)&&t.getAttribute(`placeholder`)!==e.name){let n=t.getAttribute(`placeholder`);e.props.placeholder=n}}a();try{r(n,e,!0)}finally{o()}return Ne(n),n}function Me(e){let t=c(e)??null;if(!t||t===`presentation`||t===`none`)return null;let n={role:t,name:l(u(e,!1)||``),children:[],props:{},box:M,receivesPointerEvents:!0};if(d.includes(t)&&(n.checked=f(e)),ee.includes(t)&&(n.disabled=p(e)||void 0),te.includes(t)){let t=ne(e);n.expanded=t===`none`?void 0:t}return re.includes(t)&&(n.level=ie(e)),ae.includes(t)&&(n.pressed=oe(e)),se.includes(t)&&(n.selected=ce(e)),(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.type!==`checkbox`&&e.type!==`radio`&&e.type!==`file`&&(n.children=[e.value]),n}function Ne(e){let t=(e,t)=>{if(!e.length)return;let n=l(e.join(``));n&&t.push(n),e.length=0},n=e=>{let r=[],i=[];for(let a of e.children||[])typeof a==`string`?i.push(a):(t(i,r),n(a),r.push(a));t(i,r),e.children=r.length?r:[],e.children.length===1&&e.children[0]===e.name&&(e.children=[])};n(e)}function N(e,t){let n=``;return e.level&&(n+=` [level=${e.level}]`),e.checked===!0&&(n+=` [checked]`),e.checked===`mixed`&&(n+=` [checked=mixed]`),e.disabled&&(n+=` [disabled]`),e.expanded===!0&&(n+=` [expanded]`),e.expanded,e.pressed===!0&&(n+=` [pressed]`),e.pressed===`mixed`&&(n+=` [pressed=mixed]`),e.selected&&(n+=` [selected]`),n}function Pe(e){let t=e.role;return e.name&&e.name.length<=900&&(t+=` ${JSON.stringify(e.name)}`),t+=N(e),t}function P(e,t,n){let r=Pe(e),i=Object.keys(e.props).length>0,a=e.children.length===1&&typeof e.children[0]==`string`&&!i?e.children[0]:void 0;if(!e.children.length&&!i)n.push(`${t}- ${r}`);else if(a!==void 0)n.push(`${t}- ${r}: ${j(a)}`);else{n.push(`${t}- ${r}:`);for(let[r,i]of Object.entries(e.props))n.push(`${t} - /${r}: ${j(i)}`);for(let r of e.children)typeof r==`string`?r&&n.push(`${t} - text: ${j(r)}`):P(r,`${t} `,n)}}function Fe(e){let t=[],n=e.role===`fragment`?e.children:[e];for(let e of n)typeof e==`string`?e&&t.push(`- text: ${j(e)}`):P(e,``,t);return t.join(`
6
+ `)}function F(e){return C(e)?`/${e.raw.slice(1,-1)}/`:j(e.normalized)}function I(e){return typeof e==`string`?JSON.stringify(e):`/${e.pattern}/`}function Ie(e){let t=[];if(e.kind===`text`)t.push(`- text: ${F(e.text)}`);else if(e.role===`fragment`)for(let n of e.children||[])L(n,``,t);else L(e,``,t);return t.join(`
7
+ `)}function Le(e){let t=e.role;return e.name!==void 0&&(t+=` ${I(e.name)}`),t+=N(e),t}function L(e,t,n){if(e.kind===`text`){n.push(`${t}- text: ${F(e.text)}`);return}let r=Le(e),i=e.children||[],a=[];if(e.containerMode&&e.containerMode!==`contain`&&a.push(`${t} - /children: ${e.containerMode}`),e.props)for(let[n,r]of Object.entries(e.props))a.push(`${t} - /${n}: ${F(r)}`);if(i.length===0&&a.length===0){n.push(`${t}- ${r}`);return}if(i.length===1&&i[0].kind===`text`&&a.length===0){n.push(`${t}- ${r}: ${F(i[0].text)}`);return}n.push(`${t}- ${r}:`),n.push(...a);for(let e of i)L(e,`${t} `,n)}function Re(e,t){let n=z([e],[t],``);return{pass:n.pass,resolved:n.resolved.join(`
8
+ `)}}function ze(e){return typeof e==`object`&&!!e&&`pattern`in e}function Be(e,t){let n=e.role;return t.name===void 0||(ze(t.name)&&b(e.name,t.name)?n+=` ${I(t.name)}`:e.name&&(n+=` ${JSON.stringify(e.name)}`)),t.level!==void 0&&(n+=` [level=${e.level}]`),t.checked!==void 0&&(e.checked===!0?n+=` [checked]`:e.checked===`mixed`&&(n+=` [checked=mixed]`)),t.disabled!==void 0&&e.disabled&&(n+=` [disabled]`),t.expanded!==void 0&&(e.expanded===!0?n+=` [expanded]`:e.expanded===!1&&(n+=` [expanded=false]`)),t.pressed!==void 0&&(e.pressed===!0?n+=` [pressed]`:e.pressed===`mixed`&&(n+=` [pressed=mixed]`)),t.selected!==void 0&&e.selected&&(n+=` [selected]`),n}function Ve(e,t){let n=new Map,r=0;for(let i=0;i<e.length&&r<t.length;i++)w(e[i],t[r],!1)&&(n.set(i,r),r++);return n}function He(e,t){let n=new Map,r=new Set;for(let i=0;i<t.length;i++)for(let a=0;a<e.length;a++)if(!r.has(a)&&w(e[a],t[i],!1)){n.set(a,i),r.add(a);break}return n}function R(e,t){let n=[];return typeof e==`string`?n.push(`${t}- text: ${e}`):P(e,t,n),n}function z(e,t,n,r){if(e=e.flatMap(e=>typeof e!=`string`&&e.role===`fragment`?e.children:[e]),t=t.flatMap(e=>e.kind===`role`&&e.role===`fragment`?e.children||[]:[e]),r===`equal`||r===`deep-equal`)return Ue(e,t,n,r===`deep-equal`);let i=[],a=Ve(e,t);if(t.length!==a.size){let r=He(e,t);for(let a=0;a<e.length;a++){let o=r.get(a);o===void 0?i.push(...R(e[a],n)):i.push(...B(e[a],t[o],n))}return{resolved:i,pass:!1}}for(let r=0;r<e.length;r++){let o=a.get(r);o!==void 0&&i.push(...B(e[r],t[o],n))}return{resolved:i,pass:!0}}function Ue(e,t,n,r){let i=[],a=e.length===t.length&&e.every((e,n)=>w(e,t[n],r));for(let a=0;a<e.length;a++)a<t.length?i.push(...B(e[a],t[a],n,r)):i.push(...R(e[a],n));return{resolved:i,pass:a}}function B(e,t,n,r=!1){if(typeof e==`string`&&t.kind===`text`)return[`${n}- text: ${x(e,t.text)&&C(t.text)?F(t.text):e}`];if(typeof e==`string`||t.kind===`text`)return R(e,n);let i=Be(e,t),a=z(e.children,t.children||[],`${n} `,t.containerMode??(r?`equal`:`contain`)),o=[];t.containerMode&&t.containerMode!==`contain`&&o.push(`${n} - /children: ${t.containerMode}`);let s=new Set([...Object.keys(e.props),...Object.keys(t.props||{})]);for(let r of s){let i=e.props[r],a=t.props?.[r];if(i!==void 0){let e=(a===void 0||x(i,a))&&a&&C(a)?F(a):i;o.push(`${n} - /${r}: ${e}`)}}let c=[];if(!a.resolved.length&&!o.length)c.push(`${n}- ${i}`);else if(a.resolved.length===1&&a.resolved[0].trimStart().startsWith(`- text: `)&&!o.length){let e=a.resolved[0].trimStart().slice(8);c.push(`${n}- ${i}: ${e}`)}else c.push(`${n}- ${i}:`),c.push(...o),c.push(...a.resolved);return c}function We(e){return be(Te,e)}const Ge={name:`aria`,capture(e){if(e instanceof Element)return je(e);throw TypeError(`aria adapter expects an Element`)},render(e){return V(Fe(e))},parseExpected(e){let t=Error.stackTraceLimit;Error.stackTraceLimit=t+20;try{return We(e.trim())}finally{Error.stackTraceLimit=t}},match(e,t){let n=Re(e,t);return n.pass?{pass:!0}:{pass:!1,message:`Accessibility tree does not match expected template`,resolved:V(n.resolved),expected:V(Ie(t))}}};function V(e){return`\n${e}\n`}const Ke={toMatchAriaSnapshot(t){return e.toMatchDomainSnapshot.call(this,Ge,t)},toMatchAriaInlineSnapshot(t,n){return e.toMatchDomainInlineSnapshot.call(this,Ge,t,n)}};for(let e of Object.values(Ke))Object.assign(e,{__vitest_poll_takeover__:!0});function qe(){return[...d]}function Je(e,t,n){return e instanceof g&&(e=e.query()),e==null?null:H(e,t,n)}function H(e,t,n){e instanceof g&&(e=e.element());let r=e?.ownerDocument?.defaultView||window;if(e instanceof r.HTMLElement||e instanceof r.SVGElement)return e;throw new nt(e,t,n)}function Ye(e,t,n){e instanceof g&&(e=e.element());let r=e.ownerDocument?.defaultView||window;if(e instanceof r.Node)return e;throw new rt(e,t,n)}function U(e,t,n,r,i,a){return[`${t}\n`,`${n}:\n${e.utils.EXPECTED_COLOR(W($e(e,r),2))}`,`${i}:\n${e.utils.RECEIVED_COLOR(W($e(e,a),2))}`].join(`
9
+ `)}function W(e,t){return Xe(Qe(e),t)}function Xe(e,t){return e.replace(/^(?!\s*$)/gm,` `.repeat(t))}function Ze(e){let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((e,t)=>Math.min(e,t.length),1/0):0}function Qe(e){let t=Ze(e);if(t===0)return e;let n=RegExp(`^[ \\t]{${t}}`,`gm`);return e.replace(n,``)}function $e(e,t){return typeof t==`string`?t:e.utils.stringify(t)}function et(e,{wordConnector:t=`, `,lastWordConnector:n=` and `}={}){return[e.slice(0,-1).join(t),e.at(-1)].join(e.length>1?n:``)}class tt 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} or a Locator that returns ${e}.`,i].join(`
10
+ `)}}class nt extends tt{constructor(e,t,n){super(`an HTMLElement or an SVGElement`,e,t,n)}}class rt extends tt{constructor(e,t,n){super(`a Node`,e,t,n)}}function G(e){return e instanceof HTMLFormElement?`FORM`:e.tagName.toUpperCase()}function K(e){return G(e)===`INPUT`}function it(e){if(e)switch(G(e)){case`INPUT`:return ot(e);case`SELECT`:return at(e);default:return e.value??ct(e)}}function at({multiple:e,options:t}){let n=[...t].filter(e=>e.selected);if(e)return[...n].map(e=>e.value);if(n.length!==0)return n[0].value}function ot(e){switch(e.type){case`number`:return e.value===``?null:Number(e.value);case`checkbox`:return e.checked;default:return e.value}}const st=[`meter`,`progressbar`,`slider`,`spinbutton`];function ct(e){if(st.includes(e.getAttribute(`role`)||``))return Number(e.getAttribute(`aria-valuenow`))}function lt(e){return e.replace(/\s+/g,` `).trim()}function ut(e,t){return t instanceof RegExp?t.test(e):e.includes(String(t))}function q(e,t){if(Array.isArray(e)&&Array.isArray(t)){let n=new Set(t);for(let t of new Set(e))if(!n.has(t))return!1;return!0}}const dt=qe();function ft(e){let t=H(e,ft,this);if(!(K(t)&&[`checkbox`,`radio`].includes(t.type))&&!(dt.includes(c(t)||``)&&[`true`,`false`].includes(t.getAttribute(`aria-checked`)||``)))return{pass:!1,message:()=>`only inputs with type="checkbox" or type="radio" or elements with ${pt()} and a valid aria-checked attribute can be used with .toBeChecked(). Use .toHaveValue() instead`};let n=f(t)===!0;return{pass:n,message:()=>{let e=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeChecked`,`element`,``),``,`Received element ${e} checked:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
11
+ `)}}}function pt(){return et(dt.map(e=>`role="${e}"`),{lastWordConnector:` or `})}function mt(e){let t=H(e,mt,this);return{pass:ht(t),message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeEmptyDOMElement`,`element`,``),``,`Received:`,` ${this.utils.printReceived(t.innerHTML)}`].join(`
12
+ `)}}function ht(e){return[...e.childNodes].filter(e=>e.nodeType!==Node.COMMENT_NODE).length===0}function gt(e){let t=H(e,gt,this),n=vt(t);return{pass:n,message:()=>{let e=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeDisabled`,`element`,``),``,`Received element ${e} disabled:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
13
+ `)}}}function _t(e){let t=H(e,_t,this),n=vt(t);return{pass:!n,message:()=>{let e=n?`is not`:`is`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeEnabled`,`element`,``),``,`Received element ${e} enabled:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
14
+ `)}}}function vt(e){return G(e).includes(`-`)?e.hasAttribute(`disabled`):p(e)}function yt(e){let t=null;(e!==null||!this.isNot)&&(t=Je(e,yt,this));let n=t===null?!1:t.ownerDocument===t.getRootNode({composed:!0}),r=()=>`expected document not to contain element, found ${this.utils.stringify(t?.cloneNode(!0))} instead`,i=()=>`element could not be found in the document`;return{pass:n,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInTheDocument`,`element`,``),``,this.utils.RECEIVED_COLOR(this.isNot?r():i())].join(`
15
+ `)}}const bt=[`FORM`,`INPUT`,`SELECT`,`TEXTAREA`];function xt(e){return e.hasAttribute(`aria-invalid`)&&e.getAttribute(`aria-invalid`)!==`false`}function St(e){return bt.includes(G(e))}function Ct(e){let t=xt(e);return St(e)?t||!e.checkValidity():t}function J(e){let t=H(e,J,this),n=Ct(t);return{pass:n,message:()=>{let e=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInvalid`,`element`,``),``,`Received element ${e} currently invalid:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
16
+ `)}}}function wt(e){let t=H(e,J,this),n=!Ct(t);return{pass:n,message:()=>{let e=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeValid`,`element`,``),``,`Received element ${e} currently valid:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
17
+ `)}}}function Tt(e,t){let n=H(e,Tt,this),r=t?.ratio??0;return Et(n,r).then(({pass:e,ratio:t})=>({pass:e,message:()=>{let i=e?`is`:`is not`,a=r>0?` with ratio ${r}`:``,o=t===void 0?``:` (actual ratio: ${t.toFixed(3)})`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInViewport`,`element`,``),``,`Received element ${i} in viewport${a}${o}:`,` ${this.utils.printReceived(n.cloneNode(!1))}`].join(`
18
+ `)}}))}async function Et(e,t){let n=await new Promise(t=>{let n=new IntersectionObserver(e=>{e.length>0?t(e[0].intersectionRatio):t(0),n.disconnect()});n.observe(e),requestAnimationFrame(()=>{})});return{pass:n>0&&n>t-1e-9,ratio:n}}function Dt(e){let t=H(e,Dt,this);if(!(K(t)&&t.type===`checkbox`)&&t.getAttribute(`role`)!==`checkbox`)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 n=Ot(t);return{pass:n,message:()=>{let e=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBePartiallyChecked`,`element`,``),``,`Received element ${e} partially checked:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
19
+ `)}}}function Ot(e){let t=f(e)===`mixed`;return!t&&K(e)&&[`checkbox`,`radio`].includes(e.type)&&e.getAttribute(`aria-checked`)===`mixed`?!0:t}const kt=[`SELECT`,`TEXTAREA`],At=[`INPUT`,`SELECT`,`TEXTAREA`],jt=[`color`,`hidden`,`range`,`submit`,`image`,`reset`],Mt=[`checkbox`,`combobox`,`gridcell`,`listbox`,`radiogroup`,`spinbutton`,`textbox`,`tree`];function Nt(e){return kt.includes(G(e))&&e.hasAttribute(`required`)}function Pt(e){return G(e)===`INPUT`&&e.hasAttribute(`required`)&&(e.hasAttribute(`type`)&&!jt.includes(e.getAttribute(`type`)||``)||!e.hasAttribute(`type`))}function Ft(e){return e.hasAttribute(`aria-required`)&&e.getAttribute(`aria-required`)===`true`&&(At.includes(G(e))||e.hasAttribute(`role`)&&Mt.includes(e.getAttribute(`role`)||``))}function It(e){let t=H(e,It,this),n=Nt(t)||Pt(t)||Ft(t);return{pass:n,message:()=>{let e=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeRequired`,`element`,``),``,`Received element ${e} required:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
20
+ `)}}}function Lt(e){let t=H(e,Lt,this),n=t.ownerDocument===t.getRootNode({composed:!0});a();let r=n&&Rt(t);return o(),{pass:r,message:()=>{let e=r?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeVisible`,`element`,``),``,`Received element ${e} visible${n?``:` (element is not in the document)`}:`,` ${this.utils.printReceived(t.cloneNode(!1))}`].join(`
21
+ `)}}}function Rt(e){let t=ue(e);if(_e.browser!==`webkit`)return t;let n=e.closest(`details`);return!n||e===n?t:zt(e)}function zt(e){let t=e;for(;t;){if(t.tagName===`DETAILS`){let n=t.querySelector(`summary`)===e;if(!t.open&&!n)return!1}t=t.parentElement}return e.offsetParent!==null}function Y(e,t){let n=H(e,Y,this),r=t===null?null:H(t,Y,this);return{pass:n.contains(r),message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toContainElement`,`element`,`element`),``,this.utils.RECEIVED_COLOR(`${this.utils.stringify(n.cloneNode(!1))} ${this.isNot?`contains:`:`does not contain:`} ${this.utils.stringify(r?r.cloneNode(!1):null)}
15
22
  `)].join(`
16
- `)}}function Be(e,t){let n=e.ownerDocument.createElement(`div`);return n.innerHTML=t,n.innerHTML}function I(e,t){let n=m(e,I,this);if(typeof t!=`string`)throw TypeError(`.toContainHTML() expects a string value, got ${t}`);return{pass:n.outerHTML.includes(Be(n,t)),message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toContainHTML`,`element`,``),`Expected:`,` ${this.utils.EXPECTED_COLOR(t)}`,`Received:`,` ${this.utils.printReceived(n.cloneNode(!0))}`].join(`
17
- `)}}function L(e,t){let n=m(e,L,this),r=te(n,!1),i=n.ownerDocument.defaultView||window,a=arguments.length===1,o=!1;return o=a?r!==``:t instanceof i.RegExp?t.test(r):this.equals(r,t,this.customTesters),{pass:o,message:()=>{let e=this.isNot?`not to`:`to`;return h(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveAccessibleDescription`,`element`,``),`Expected element ${e} have accessible description`,t,`Received`,r)}}}function R(e,t){let n=m(e,R,this),r=ne(n)??``,i=n.ownerDocument.defaultView||window,a=arguments.length===1,o=!1;return o=a?r!==``:t instanceof i.RegExp?t.test(r):this.equals(r,t,this.customTesters),{pass:o,message:()=>{let e=this.isNot?`not to`:`to`;return t==null?[this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveAccessibleErrorMessage`,`element`,``),`Expected element ${e} have accessible error message, but got${this.isNot?``:` nothing`}`,this.isNot?this.utils.RECEIVED_COLOR(g(r,2)):``].filter(Boolean).join(`
23
+ `)}}function Bt(e,t){let n=e.ownerDocument.createElement(`div`);return n.innerHTML=t,n.innerHTML}function Vt(e,t){let n=H(e,Vt,this);if(typeof t!=`string`)throw TypeError(`.toContainHTML() expects a string value, got ${t}`);return{pass:n.outerHTML.includes(Bt(n,t)),message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toContainHTML`,`element`,``),`Expected:`,` ${this.utils.EXPECTED_COLOR(t)}`,`Received:`,` ${this.utils.printReceived(n.cloneNode(!0))}`].join(`
24
+ `)}}function Ht(e,t){let n=H(e,Ht,this),r=de(n,!1),i=n.ownerDocument.defaultView||window,a=arguments.length===1,o=!1;return o=a?r!==``:t instanceof i.RegExp?t.test(r):this.equals(r,t,this.customTesters),{pass:o,message:()=>{let e=this.isNot?`not to`:`to`;return U(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveAccessibleDescription`,`element`,``),`Expected element ${e} have accessible description`,t,`Received`,r)}}}function Ut(e,t){let n=H(e,Ut,this),r=fe(n)??``,i=n.ownerDocument.defaultView||window,a=arguments.length===1,o=!1;return o=a?r!==``:t instanceof i.RegExp?t.test(r):this.equals(r,t,this.customTesters),{pass:o,message:()=>{let e=this.isNot?`not to`:`to`;return t==null?[this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveAccessibleErrorMessage`,`element`,``),`Expected element ${e} have accessible error message, but got${this.isNot?``:` nothing`}`,this.isNot?this.utils.RECEIVED_COLOR(W(r,2)):``].filter(Boolean).join(`
18
25
 
19
- `):h(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveAccessibleErrorMessage`,`element`,``),`Expected element ${e} have accessible error message`,t,`Received`,r)}}}function z(e,t){let n=m(e,z,this),r=re(n,!1),i=arguments.length===1,a=n.ownerDocument.defaultView||window,o=!1;return o=i?r!==``:t instanceof a.RegExp?t.test(r):this.equals(r,t,this.customTesters),{pass:o,message:()=>{let e=this.isNot?`not to`:`to`;return h(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${z.name}`,`element`,``),`Expected element ${e} have accessible name`,t,`Received`,r)}}}function B(e,t,n){let r=m(e,B,this),i=n!==void 0,a=r.hasAttribute(t),o=r.getAttribute(t);return{pass:i?a&&this.equals(o,n,this.customTesters):a,message:()=>{let e=this.isNot?`not to`:`to`,r=a?V(this.utils.stringify,t,o):null,s=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveAttribute`,`element`,this.utils.printExpected(t),{secondArgument:i?this.utils.printExpected(n):void 0,comment:Ve(this.utils.stringify,t,n)});return h(this,s,`Expected the element ${e} have attribute`,V(this.utils.stringify,t,n),`Received`,r)}}}function V(e,t,n){return n===void 0?t:`${t}=${e(n)}`}function Ve(e,t,n){return n===void 0?`element.hasAttribute(${e(t)})`:`element.getAttribute(${e(t)}) === ${e(n)}`}function H(e,...t){let n=m(e,H,this),{expectedClassNames:r,options:i}=He(t),a=U(n.getAttribute(`class`)),o=r.reduce((e,t)=>e.concat(typeof t==`string`||!t?U(t):t),[]),s=o.some(e=>e instanceof RegExp);if(i.exact&&s)throw Error(`Exact option does not support RegExp expected class names`);return i.exact?{pass:W(o,a)&&o.length===a.length,message:()=>{let e=this.isNot?`not to`:`to`;return h(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveClass`,`element`,this.utils.printExpected(o.join(` `))),`Expected the element ${e} have EXACTLY defined classes`,o.join(` `),`Received`,a.join(` `))}}:o.length>0?{pass:W(o,a),message:()=>{let e=this.isNot?`not to`:`to`;return h(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveClass`,`element`,this.utils.printExpected(o.join(` `))),`Expected the element ${e} have class`,o.join(` `),`Received`,a.join(` `))}}:{pass:this.isNot?a.length>0:!1,message:()=>this.isNot?h(this,this.utils.matcherHint(`.not.toHaveClass`,`element`,``),`Expected the element to have classes`,`(none)`,`Received`,a.join(` `)):[this.utils.matcherHint(`.toHaveClass`,`element`),`At least one expected class must be provided.`].join(`
20
- `)}}function He(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 U(e){return e?e.split(/\s+/).filter(e=>e.length>0):[]}function W(e,t){return e.every(e=>typeof e==`string`?t.includes(e):t.some(t=>e.test(t)))}function G(e,t){let n=m(e,G,this),r=y(n);if(![`SELECT`,`INPUT`,`TEXTAREA`].includes(r))throw Error(`.toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.`);if(b(n)&&[`radio`,`checkbox`].includes(n.type))throw Error(`.toHaveDisplayValue() currently does not support input[type="${n.type}"], try with another matcher instead.`);let i=Ue(r,n),a=We(t),o=a.filter(e=>i.some(t=>e instanceof RegExp?e.test(t):this.equals(t,String(e),this.customTesters))).length,s=o===i.length,c=o===a.length;return{pass:s&&c,message:()=>h(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDisplayValue`,`element`,``),`Expected element ${this.isNot?`not `:``}to have display value`,t,`Received`,i)}}function Ue(e,t){return e===`SELECT`?Array.from(t).filter(e=>e.selected).map(e=>e.textContent||``):[t.value]}function We(e){return Array.isArray(e)?e:[e]}function K(e){let t=m(e,K,this);return{pass:t.ownerDocument.activeElement===t,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveFocus`,`element`,``),``,...this.isNot?[`Received element is focused:`,` ${this.utils.printReceived(t)}`]:[`Expected element with focus:`,` ${this.utils.printExpected(t)}`,`Received element with focus:`,` ${this.utils.printReceived(t.ownerDocument.activeElement)}`]].join(`
21
- `)}}function q(e,t){let n=m(e,q,this),r=n.ownerDocument.defaultView||window;if(!(n instanceof r.HTMLFieldSetElement)&&!(n instanceof r.HTMLFormElement))throw TypeError(`toHaveFormValues must be called on a form or a fieldset, instead got ${y(n)}`);if(!t||typeof t!=`object`)throw TypeError(`toHaveFormValues must be called with an object of expected form values. Got ${t}`);let i=Je(n);return{pass:Object.entries(t).every(([e,t])=>this.equals(i[e],t,[S,...this.customTesters])),message:()=>{let e=this.isNot?`not to`:`to`,n=`${this.isNot?`.not`:``}.toHaveFormValues`,r={};for(let e in i)Object.hasOwn(t,e)&&(r[e]=i[e]);return[this.utils.matcherHint(n,`element`,``),`Expected the element ${e} have form values`,this.utils.diff(t,r)].join(`
26
+ `):U(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveAccessibleErrorMessage`,`element`,``),`Expected element ${e} have accessible error message`,t,`Received`,r)}}}function X(e,t){let n=H(e,X,this),r=u(n,!1),i=arguments.length===1,a=n.ownerDocument.defaultView||window,o=!1;return o=i?r!==``:t instanceof a.RegExp?t.test(r):this.equals(r,t,this.customTesters),{pass:o,message:()=>{let e=this.isNot?`not to`:`to`;return U(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${X.name}`,`element`,``),`Expected element ${e} have accessible name`,t,`Received`,r)}}}function Wt(e,t,n){let r=H(e,Wt,this),i=n!==void 0,a=r.hasAttribute(t),o=r.getAttribute(t);return{pass:i?a&&this.equals(o,n,this.customTesters):a,message:()=>{let e=this.isNot?`not to`:`to`,r=a?Gt(this.utils.stringify,t,o):null,s=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveAttribute`,`element`,this.utils.printExpected(t),{secondArgument:i?this.utils.printExpected(n):void 0,comment:Kt(this.utils.stringify,t,n)});return U(this,s,`Expected the element ${e} have attribute`,Gt(this.utils.stringify,t,n),`Received`,r)}}}function Gt(e,t,n){return n===void 0?t:`${t}=${e(n)}`}function Kt(e,t,n){return n===void 0?`element.hasAttribute(${e(t)})`:`element.getAttribute(${e(t)}) === ${e(n)}`}function qt(e,...t){let n=H(e,qt,this),{expectedClassNames:r,options:i}=Jt(t),a=Z(n.getAttribute(`class`)),o=r.reduce((e,t)=>e.concat(typeof t==`string`||!t?Z(t):t),[]),s=o.some(e=>e instanceof RegExp);if(i.exact&&s)throw Error(`Exact option does not support RegExp expected class names`);return i.exact?{pass:Yt(o,a)&&o.length===a.length,message:()=>{let e=this.isNot?`not to`:`to`;return U(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveClass`,`element`,this.utils.printExpected(o.join(` `))),`Expected the element ${e} have EXACTLY defined classes`,o.join(` `),`Received`,a.join(` `))}}:o.length>0?{pass:Yt(o,a),message:()=>{let e=this.isNot?`not to`:`to`;return U(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveClass`,`element`,this.utils.printExpected(o.join(` `))),`Expected the element ${e} have class`,o.join(` `),`Received`,a.join(` `))}}:{pass:this.isNot?a.length>0:!1,message:()=>this.isNot?U(this,this.utils.matcherHint(`.not.toHaveClass`,`element`,``),`Expected the element to have classes`,`(none)`,`Received`,a.join(` `)):[this.utils.matcherHint(`.toHaveClass`,`element`),`At least one expected class must be provided.`].join(`
27
+ `)}}function Jt(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 Z(e){return e?e.split(/\s+/).filter(e=>e.length>0):[]}function Yt(e,t){return e.every(e=>typeof e==`string`?t.includes(e):t.some(t=>e.test(t)))}function Xt(e,t){let n=H(e,Xt,this),r=G(n);if(![`SELECT`,`INPUT`,`TEXTAREA`].includes(r))throw Error(`.toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.`);if(K(n)&&[`radio`,`checkbox`].includes(n.type))throw Error(`.toHaveDisplayValue() currently does not support input[type="${n.type}"], try with another matcher instead.`);let i=Zt(r,n),a=Qt(t),o=a.filter(e=>i.some(t=>e instanceof RegExp?e.test(t):this.equals(t,String(e),this.customTesters))).length,s=o===i.length,c=o===a.length;return{pass:s&&c,message:()=>U(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDisplayValue`,`element`,``),`Expected element ${this.isNot?`not `:``}to have display value`,t,`Received`,i)}}function Zt(e,t){return e===`SELECT`?Array.from(t).filter(e=>e.selected).map(e=>e.textContent||``):[t.value]}function Qt(e){return Array.isArray(e)?e:[e]}function $t(e){let t=H(e,$t,this);return{pass:t.ownerDocument.activeElement===t,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveFocus`,`element`,``),``,...this.isNot?[`Received element is focused:`,` ${this.utils.printReceived(t)}`]:[`Expected element with focus:`,` ${this.utils.printExpected(t)}`,`Received element with focus:`,` ${this.utils.printReceived(t.ownerDocument.activeElement)}`]].join(`
28
+ `)}}function en(e,t){let n=H(e,en,this),r=n.ownerDocument.defaultView||window;if(!(n instanceof r.HTMLFieldSetElement)&&!(n instanceof r.HTMLFormElement))throw TypeError(`toHaveFormValues must be called on a form or a fieldset, instead got ${G(n)}`);if(!t||typeof t!=`object`)throw TypeError(`toHaveFormValues must be called with an object of expected form values. Got ${t}`);let i=an(n);return{pass:Object.entries(t).every(([e,t])=>this.equals(i[e],t,[q,...this.customTesters])),message:()=>{let e=this.isNot?`not to`:`to`,n=`${this.isNot?`.not`:``}.toHaveFormValues`,r={};for(let e in i)Object.hasOwn(t,e)&&(r[e]=i[e]);return[this.utils.matcherHint(n,`element`,``),`Expected the element ${e} have form values`,this.utils.diff(t,r)].join(`
22
29
 
23
- `)}}}function Ge(e){let t=``;for(let n of e){if(t&&t!==n.type)throw Error(`Multiple form elements with the same name must be of the same type`);t=n.type}switch(t){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 Ke(e,t){let n=[...e.querySelectorAll(`[name="${ie(t)}"]`)];if(n.length!==0)switch(n.length){case 1:return x(n[0]);default:return Ge(n)}}function qe(e){return/\[\]$/.test(e)?e.slice(0,-2):e}function Je(e){let t={};for(let n of e.elements){if(!(`name`in n))continue;let r=n.name;t[qe(r)]=Ke(e,r)}return t}function J(e,t){let n=m(e,J,this);l();let r=s(n);return u(),{pass:r===t,message:()=>{let e=this.isNot?`not to`:`to`;return h(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveRole`,`element`,``),`Expected element ${e} have role`,t,`Received`,r)}}}function Y(e,t){let n=m(e,Y,this),r=t!==void 0;if(r&&typeof t!=`string`)throw Error(`expected selection must be a string or undefined`);let i=Ye(n);return{pass:r?this.equals(i,t,[S,...this.customTesters]):!!i,message:()=>{let e=this.isNot?`not to`:`to`,n=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveSelection`,`element`,t);return h(this,n,`Expected the element ${e} have selection`,r?t:`(any)`,`Received`,i)}}}function Ye(e){let t=e.ownerDocument.getSelection();if(!t)return``;if([`INPUT`,`TEXTAREA`].includes(y(e))){let t=e;return[`radio`,`checkbox`].includes(t.type)||t.selectionStart==null||t.selectionEnd==null?``:t.value.toString().substring(t.selectionStart,t.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}const X=p.config.browser.name,Z=new Set(`backgroundPosition.background-position.bottom.left.right.top.height.width.margin-bottom.marginBottom.margin-left.marginLeft.margin-right.marginRight.margin-top.marginTop.min-height.minHeight.min-width.minWidth.padding-bottom.padding-left.padding-right.padding-top.text-indent.paddingBottom.paddingLeft.paddingRight.paddingTop.textIndent`.split(`.`));function Q(e,t){let n=m(e,Q,this),{getComputedStyle:r}=n.ownerDocument.defaultView,i=typeof t==`object`?Xe(t):Ze(t),a=r(n),o=new Set(Array.from(n.style));return{pass:$e(i,n,a,o),message:()=>{let e=`${this.isNot?`.not`:``}.toHaveStyle`,t=new Set(Object.keys(i)),r=Qe(Array.from(a).filter(e=>t.has(e)).reduce((e,t)=>(e[t]=(o.has(t)&&Z.has(t)?n.style:a)[t],e),{})),s=r===``?`Expected styles could not be parsed by the browser. Did you make a typo?`:this.utils.diff(Qe(i),r);return[this.utils.matcherHint(e,`element`,``),s].join(`
30
+ `)}}}function tn(e){let t=``;for(let n of e){if(t&&t!==n.type)throw Error(`Multiple form elements with the same name must be of the same type`);t=n.type}switch(t){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 nn(e,t){let n=[...e.querySelectorAll(`[name="${pe(t)}"]`)];if(n.length!==0)switch(n.length){case 1:return it(n[0]);default:return tn(n)}}function rn(e){return/\[\]$/.test(e)?e.slice(0,-2):e}function an(e){let t={};for(let n of e.elements){if(!(`name`in n))continue;let r=n.name;t[rn(r)]=nn(e,r)}return t}function on(e,t){let n=H(e,on,this);a();let r=c(n);return o(),{pass:r===t,message:()=>{let e=this.isNot?`not to`:`to`;return U(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveRole`,`element`,``),`Expected element ${e} have role`,t,`Received`,r)}}}function sn(e,t){let n=H(e,sn,this),r=t!==void 0;if(r&&typeof t!=`string`)throw Error(`expected selection must be a string or undefined`);let i=cn(n);return{pass:r?this.equals(i,t,[q,...this.customTesters]):!!i,message:()=>{let e=this.isNot?`not to`:`to`,n=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveSelection`,`element`,t);return U(this,n,`Expected the element ${e} have selection`,r?t:`(any)`,`Received`,i)}}}function cn(e){let t=e.ownerDocument.getSelection();if(!t)return``;if([`INPUT`,`TEXTAREA`].includes(G(e))){let t=e;return[`radio`,`checkbox`].includes(t.type)||t.selectionStart==null||t.selectionEnd==null?``:t.value.toString().substring(t.selectionStart,t.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}const Q=_e.config.browser.name,$=new Set(`backgroundPosition.background-position.bottom.left.right.top.height.width.margin-bottom.marginBottom.margin-left.marginLeft.margin-right.marginRight.margin-top.marginTop.min-height.minHeight.min-width.minWidth.padding-bottom.padding-left.padding-right.padding-top.text-indent.paddingBottom.paddingLeft.paddingRight.paddingTop.textIndent`.split(`.`));function ln(e,t){let n=H(e,ln,this),{getComputedStyle:r}=n.ownerDocument.defaultView,i=typeof t==`object`?un(t):dn(t),a=r(n),o=new Set(Array.from(n.style));return{pass:pn(i,n,a,o),message:()=>{let e=`${this.isNot?`.not`:``}.toHaveStyle`,t=new Set(Object.keys(i)),r=fn(Array.from(a).filter(e=>t.has(e)).reduce((e,t)=>(e[t]=(o.has(t)&&$.has(t)?n.style:a)[t],e),{})),s=r===``?`Expected styles could not be parsed by the browser. Did you make a typo?`:this.utils.diff(fn(i),r);return[this.utils.matcherHint(e,`element`,``),s].join(`
24
31
 
25
- `)}}}function Xe(e){let t=X===`chrome`||X===`chromium`?document:document.implementation.createHTMLDocument(``),n=t.createElement(`div`);t.body.appendChild(n);let r=Object.keys(e);r.forEach(t=>{n.style[t]=e[t]});let i={},a=window.getComputedStyle(n);return r.forEach(e=>{let t=(Z.has(e)?n.style:a)[e];t!=null&&(i[e]=t)}),n.remove(),i}function Ze(e){let t=X===`chrome`||X===`chromium`||X===`webkit`?document:document.implementation.createHTMLDocument(``),n=t.createElement(`div`);n.setAttribute(`style`,e.replace(/\n/g,``)),t.body.appendChild(n);let r=window.getComputedStyle(n),i=Array.from(n.style).reduce((e,t)=>(e[t]=Z.has(t)?n.style.getPropertyValue(t):r.getPropertyValue(t),e),{});return n.remove(),i}function Qe(e){return Object.keys(e).sort().map(t=>`${t}: ${e[t]};`).join(`
26
- `)}function $e(e,t,n,r){let i=Object.keys(e);return i.length?i.every(i=>{let a=e[i],o=i.startsWith(`--`),s=[i];return o||s.push(i.toLowerCase()),s.some(e=>{let o=r.has(i)&&Z.has(i)?t.style:n;return o[e]===a||o.getPropertyValue(e)===a})}):!1}function et(e,t,n={normalizeWhitespace:!0}){let r=le(e,et,this),i=n.normalizeWhitespace?be(r.textContent||``):(r.textContent||``).replace(/\u00A0/g,` `),a=i!==``&&t===``;return{pass:!a&&xe(i,t),message:()=>{let e=this.isNot?`not to`:`to`;return h(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveTextContent`,`element`,``),a?`Checking with empty string will always match, use .toBeEmptyDOMElement() instead`:`Expected element ${e} have text content`,t,`Received`,i)}}}function tt(e,t){let n=m(e,tt,this);if(b(n)&&[`checkbox`,`radio`].includes(n.type))throw Error(`input with type=checkbox or type=radio cannot be used with .toHaveValue(). Use .toBeChecked() for type=checkbox or .toHaveFormValues() instead`);let r=x(n),i=t!==void 0,a=t,o=r;return t==r&&t!==r&&(a=`${t} (${typeof t})`,o=`${r} (${typeof r})`),{pass:i?this.equals(r,t,[S,...this.customTesters]):!!r,message:()=>{let e=this.isNot?`not to`:`to`,n=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveValue`,`element`,t);return h(this,n,`Expected the element ${e} have value`,i?a:`(any)`,`Received`,o)}}}const $=new Map([]);async function nt(t,n,r=typeof n==`object`?n:{}){if(this.isNot)throw Error(`'toMatchScreenshot' cannot be used with "not"`);if(this.task===void 0||this.currentTestName===void 0)throw Error(`'toMatchScreenshot' cannot be used without test context`);let i=`${this.task.result?.repeatCount??0}${this.testPath}${this.currentTestName}`,a=$.get(i);a===void 0&&(a={current:0},$.set(i,a)),a.current+=1;let o=typeof n==`string`?n:`${this.currentTestName} ${a.current}`,[s,...c]=await Promise.all([d(t,r),...r.screenshotOptions&&`mask`in r.screenshotOptions?r.screenshotOptions.mask.map(e=>d(e,r)):[]]),l=r.screenshotOptions&&`mask`in r.screenshotOptions?{...r,screenshotOptions:{...r.screenshotOptions,mask:c}}:r,u=await f().commands.triggerCommand(`__vitest_screenshotMatcher`,[o,this.currentTestName,{element:s,...l}]);if(u.pass===!1){let t=[];u.reference&&t.push({name:`reference`,...u.reference}),u.actual&&t.push({name:`actual`,...u.actual}),u.diff&&t.push({name:`diff`,...u.diff}),t.length>0&&await e(this.task,{type:`internal:toMatchScreenshot`,kind:`visual-regression`,message:u.message,attachments:t})}return{pass:u.pass,message:()=>u.pass?``:[this.utils.matcherHint(`toMatchScreenshot`,`element`,``),``,u.message,u.reference?`\nReference screenshot:\n ${this.utils.EXPECTED_COLOR(u.reference.path)}`:null,u.actual?`\nActual screenshot:\n ${this.utils.RECEIVED_COLOR(u.actual.path)}`:null,u.diff?this.utils.DIM_COLOR(`\nDiff image:\n ${u.diff.path}`):null,``].filter(e=>e!==null).join(`
27
- `),meta:{outcome:u.outcome}}}const rt={toBeDisabled:E,toBeEnabled:D,toBeEmptyDOMElement:T,toBeInTheDocument:k,toBeInViewport:M,toBeInvalid:j,toBeRequired:P,toBeValid:De,toBeVisible:Le,toContainElement:F,toContainHTML:I,toHaveAccessibleDescription:L,toHaveAccessibleErrorMessage:R,toHaveAccessibleName:z,toHaveAttribute:B,toHaveClass:H,toHaveFocus:K,toHaveFormValues:q,toHaveStyle:Q,toHaveTextContent:et,toHaveValue:tt,toHaveDisplayValue:G,toBeChecked:w,toBePartiallyChecked:N,toHaveRole:J,toHaveSelection:Y,toMatchScreenshot:nt},it=Symbol.for(`$$vitest:locator`);function at(e,i){if(e!=null&&!(e instanceof HTMLElement)&&!(e instanceof SVGElement)&&!(it in e))throw Error(`Invalid element or locator: ${e}. Expected an instance of HTMLElement, SVGElement or Locator, received ${r(e)}`);let a=t.poll(function(){if(e instanceof Element||e==null)return e;let t=n.util.flag(this,`negate`),r=n.util.flag(this,`_name`);if(t&&r===`toBeInTheDocument`)return e.query();if(r===`toHaveLength`)return e.elements();if(r===`toMatchScreenshot`&&!n.util.flag(this,`_poll.assert_once`)&&n.util.flag(this,`_poll.assert_once`,!0),n.util.flag(this,`_isLastPollAttempt`))return e.element();let i=e.query();if(!i)throw Error(`Cannot find element with locator: ${JSON.stringify(e)}`);return i},ae(i));n.util.flag(a,`_poll.element`,!0);let o=oe().current;if(o&&f().activeTraceTaskIds.has(o.id)){let t=Error(`__vitest_mark_trace__`);n.util.flag(a,`_poll.onSettled`,async r=>{let i=n.util.flag(r.assertion,`negate`),a=n.util.flag(r.assertion,`_name`)||`<unknown>`,o=`expect.element().${i?`not.`:``}${a}`,s=r.status===`fail`?`${o} [ERROR]`:o,c=!e||e instanceof Element?void 0:e.selector;await f().commands.triggerCommand(`__vitest_markTrace`,[{name:s,selector:c,stack:t.stack}],t)})}return a}t.extend(rt),t.element=at;
32
+ `)}}}function un(e){let t=Q===`chrome`||Q===`chromium`?document:document.implementation.createHTMLDocument(``),n=t.createElement(`div`);t.body.appendChild(n);let r=Object.keys(e);r.forEach(t=>{n.style[t]=e[t]});let i={},a=window.getComputedStyle(n);return r.forEach(e=>{let t=($.has(e)?n.style:a)[e];t!=null&&(i[e]=t)}),n.remove(),i}function dn(e){let t=Q===`chrome`||Q===`chromium`||Q===`webkit`?document:document.implementation.createHTMLDocument(``),n=t.createElement(`div`);n.setAttribute(`style`,e.replace(/\n/g,``)),t.body.appendChild(n);let r=window.getComputedStyle(n),i=Array.from(n.style).reduce((e,t)=>(e[t]=$.has(t)?n.style.getPropertyValue(t):r.getPropertyValue(t),e),{});return n.remove(),i}function fn(e){return Object.keys(e).sort().map(t=>`${t}: ${e[t]};`).join(`
33
+ `)}function pn(e,t,n,r){let i=Object.keys(e);return i.length?i.every(i=>{let a=e[i],o=i.startsWith(`--`),s=[i];return o||s.push(i.toLowerCase()),s.some(e=>{let o=r.has(i)&&$.has(i)?t.style:n;return o[e]===a||o.getPropertyValue(e)===a})}):!1}function mn(e,t,n={normalizeWhitespace:!0}){let r=Ye(e,mn,this),i=n.normalizeWhitespace?lt(r.textContent||``):(r.textContent||``).replace(/\u00A0/g,` `),a=i!==``&&t===``;return{pass:!a&&ut(i,t),message:()=>{let e=this.isNot?`not to`:`to`;return U(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveTextContent`,`element`,``),a?`Checking with empty string will always match, use .toBeEmptyDOMElement() instead`:`Expected element ${e} have text content`,t,`Received`,i)}}}function hn(e,t){let n=H(e,hn,this);if(K(n)&&[`checkbox`,`radio`].includes(n.type))throw Error(`input with type=checkbox or type=radio cannot be used with .toHaveValue(). Use .toBeChecked() for type=checkbox or .toHaveFormValues() instead`);let r=it(n),i=t!==void 0,a=t,o=r;return t==r&&t!==r&&(a=`${t} (${typeof t})`,o=`${r} (${typeof r})`),{pass:i?this.equals(r,t,[q,...this.customTesters]):!!r,message:()=>{let e=this.isNot?`not to`:`to`,n=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveValue`,`element`,t);return U(this,n,`Expected the element ${e} have value`,i?a:`(any)`,`Received`,o)}}}const gn=new Map([]);async function _n(e,n,r=typeof n==`object`?n:{}){if(this.isNot)throw Error(`'toMatchScreenshot' cannot be used with "not"`);if(this.task===void 0||this.currentTestName===void 0)throw Error(`'toMatchScreenshot' cannot be used without test context`);let i=`${this.task.result?.repeatCount??0}${this.testPath}${this.currentTestName}`,a=gn.get(i);a===void 0&&(a={current:0},gn.set(i,a)),a.current+=1;let o=typeof n==`string`?n:`${this.currentTestName} ${a.current}`,[s,...c]=await Promise.all([me(e,r),...r.screenshotOptions&&`mask`in r.screenshotOptions?r.screenshotOptions.mask.map(e=>me(e,r)):[]]),l=r.screenshotOptions&&`mask`in r.screenshotOptions?{...r,screenshotOptions:{...r.screenshotOptions,mask:c}}:r,u=await _().commands.triggerCommand(`__vitest_screenshotMatcher`,[o,this.currentTestName,{element:s,...l}]);if(u.pass===!1){let e=[];u.reference&&e.push({name:`reference`,...u.reference}),u.actual&&e.push({name:`actual`,...u.actual}),u.diff&&e.push({name:`diff`,...u.diff}),e.length>0&&await t(this.task,{type:`internal:toMatchScreenshot`,kind:`visual-regression`,message:u.message,attachments:e})}return{pass:u.pass,message:()=>u.pass?``:[this.utils.matcherHint(`toMatchScreenshot`,`element`,``),``,u.message,u.reference?`\nReference screenshot:\n ${this.utils.EXPECTED_COLOR(u.reference.path)}`:null,u.actual?`\nActual screenshot:\n ${this.utils.RECEIVED_COLOR(u.actual.path)}`:null,u.diff?this.utils.DIM_COLOR(`\nDiff image:\n ${u.diff.path}`):null,``].filter(e=>e!==null).join(`
34
+ `),meta:{outcome:u.outcome}}}const vn={toBeDisabled:gt,toBeEnabled:_t,toBeEmptyDOMElement:mt,toBeInTheDocument:yt,toBeInViewport:Tt,toBeInvalid:J,toBeRequired:It,toBeValid:wt,toBeVisible:Lt,toContainElement:Y,toContainHTML:Vt,toHaveAccessibleDescription:Ht,toHaveAccessibleErrorMessage:Ut,toHaveAccessibleName:X,toHaveAttribute:Wt,toHaveClass:qt,toHaveFocus:$t,toHaveFormValues:en,toHaveStyle:ln,toHaveTextContent:mn,toHaveValue:hn,toHaveDisplayValue:Xt,toBeChecked:ft,toBePartiallyChecked:Dt,toHaveRole:on,toHaveSelection:sn,toMatchScreenshot:_n},yn=Symbol.for(`$$vitest:locator`);function bn(e,t){if(e!=null&&!(e instanceof HTMLElement)&&!(e instanceof SVGElement)&&!(yn in e))throw Error(`Invalid element or locator: ${e}. Expected an instance of HTMLElement, SVGElement or Locator, received ${i(e)}`);let a=n.poll(function(){if(e instanceof Element||e==null)return e;let t=r.util.flag(this,`negate`),n=r.util.flag(this,`_name`);if(t&&n===`toBeInTheDocument`)return e.query();if(n===`toHaveLength`)return e.elements();if(n===`toMatchScreenshot`&&!r.util.flag(this,`_poll.assert_once`)&&r.util.flag(this,`_poll.assert_once`,!0),r.util.flag(this,`_isLastPollAttempt`))return e.element();let i=e.query();if(!i)throw Error(`Cannot find element with locator: ${JSON.stringify(e)}`);return i},he(t));r.util.flag(a,`_poll.element`,!0);let o=ge().current;if(o&&_().activeTraceTaskIds.has(o.id)){let t=Error(`__vitest_mark_trace__`);r.util.flag(a,`_poll.onSettled`,async n=>{let i=r.util.flag(n.assertion,`negate`),a=r.util.flag(n.assertion,`_name`)||`<unknown>`,o=`expect.element().${i?`not.`:``}${a}`,s=n.status===`fail`?`${o} [ERROR]`:o,c=!e||e instanceof Element?void 0:e.selector;await _().commands.triggerCommand(`__vitest_markTrace`,[{name:s,selector:c,stack:t.stack}],t)})}return a}n.extend(vn),n.extend(Ke),n.element=bn;
@@ -2,4 +2,4 @@ import{server as e,page as t,utils as n}from"vitest/browser";import{__INTERNAL a
2
2
  `:this.value}},w=class extends x{constructor(...e){super(...e),c(this,`value`,``)}ASCIIMatch(e){return this.value.toLowerCase()===e.toLowerCase()}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e}},Te=class extends w{constructor(e){super(),c(this,`tokenType`,`IDENT`),this.value=e}toString(){return`IDENT(${this.value})`}toSource(){return T(this.value)}},Ee=class extends w{constructor(e){super(),c(this,`tokenType`,`FUNCTION`),c(this,`mirror`,void 0),this.value=e,this.mirror=`)`}toString(){return`FUNCTION(${this.value})`}toSource(){return`${T(this.value)}(`}},De=class extends w{constructor(e){super(),c(this,`tokenType`,`AT-KEYWORD`),this.value=e}toString(){return`AT(${this.value})`}toSource(){return`@${T(this.value)}`}},Oe=class extends w{constructor(e){super(),c(this,`tokenType`,`HASH`),c(this,`type`,void 0),this.value=e,this.type=`unrestricted`}toString(){return`HASH(${this.value})`}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.type=this.type,e}toSource(){return this.type===`id`?`#${T(this.value)}`:`#${Pe(this.value)}`}},ke=class extends w{constructor(e){super(),c(this,`tokenType`,`STRING`),this.value=e}toString(){return`"${Fe(this.value)}"`}},Ae=class extends w{constructor(e){super(),c(this,`tokenType`,`URL`),this.value=e}toString(){return`URL(${this.value})`}toSource(){return`url("${Fe(this.value)}")`}},je=class extends x{constructor(){super(),c(this,`tokenType`,`NUMBER`),c(this,`type`,void 0),c(this,`repr`,void 0),this.type=`integer`,this.repr=``}toString(){return this.type===`integer`?`INT(${this.value})`:`NUMBER(${this.value})`}toJSON(){let e=super.toJSON();return e.value=this.value,e.type=this.type,e.repr=this.repr,e}toSource(){return this.repr}},Me=class extends x{constructor(){super(),c(this,`tokenType`,`PERCENTAGE`),c(this,`repr`,void 0),this.repr=``}toString(){return`PERCENTAGE(${this.value})`}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.repr=this.repr,e}toSource(){return`${this.repr}%`}},Ne=class extends x{constructor(){super(),c(this,`tokenType`,`DIMENSION`),c(this,`type`,void 0),c(this,`repr`,void 0),c(this,`unit`,void 0),this.type=`integer`,this.repr=``,this.unit=``}toString(){return`DIM(${this.value},${this.unit})`}toJSON(){let e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.type=this.type,e.repr=this.repr,e.unit=this.unit,e}toSource(){let e=this.repr,t=T(this.unit);return t[0].toLowerCase()===`e`&&(t[1]===`-`||l(t.charCodeAt(1),48,57))&&(t=`\\65 ${t.slice(1,t.length)}`),e+t}};function T(e){e=`${e}`;let t=``,n=e.charCodeAt(0);for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i===0)throw new y(`Invalid character: the input contains U+0000.`);l(i,1,31)||i===127||r===0&&l(i,48,57)||r===1&&l(i,48,57)&&n===45?t+=`\\${i.toString(16)} `:i>=128||i===45||i===95||l(i,48,57)||l(i,65,90)||l(i,97,122)?t+=e[r]:t+=`\\${e[r]}`}return t}function Pe(e){e=`${e}`;let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===0)throw new y(`Invalid character: the input contains U+0000.`);r>=128||r===45||r===95||l(r,48,57)||l(r,65,90)||l(r,97,122)?t+=e[n]:t+=`\\${r.toString(16)} `}return t}function Fe(e){e=`${e}`;let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===0)throw new y(`Invalid character: the input contains U+0000.`);l(r,1,31)||r===127?t+=`\\${r.toString(16)} `:r===34||r===92?t+=`\\${e[n]}`:t+=e[n]}return t}var E=class extends Error{};function D(e,t){let n;try{n=re(e),n[n.length-1]instanceof we||n.push(new we)}catch(t){let n=`${t.message} while parsing selector "${e}"`,r=(t.stack||``).indexOf(t.message);throw r!==-1&&(t.stack=t.stack.substring(0,r)+n+t.stack.substring(r+t.message.length)),t.message=n,t}let r=n.find(e=>e instanceof De||e instanceof ie||e instanceof ae||e instanceof Ce||e instanceof se||e instanceof ce||e instanceof ue||e instanceof fe||e instanceof pe||e instanceof Ae||e instanceof Me);if(r)throw new E(`Unsupported token "${r.toSource()}" while parsing selector "${e}"`);let i=0,a=new Set;function o(){return new E(`Unexpected token "${n[i].toSource()}" while parsing selector "${e}"`)}function s(){for(;n[i]instanceof oe;)i++}function c(e=i){return n[e]instanceof Te}function l(e=i){return n[e]instanceof ke}function u(e=i){return n[e]instanceof je}function d(e=i){return n[e]instanceof de}function f(e=i){return n[e]instanceof ge}function p(e=i){return n[e]instanceof _e}function m(e=i){return n[e]instanceof Ee}function h(e=i){return n[e]instanceof C&&n[e].value===`*`}function g(e=i){return n[e]instanceof we}function ee(e=i){return n[e]instanceof C&&[`>`,`+`,`~`].includes(n[e].value)}function te(e=i){return d(e)||p(e)||g(e)||ee(e)||n[e]instanceof oe}function _(){let e=[v()];for(;s(),d();)i++,e.push(v());return e}function v(){return s(),u()||l()?n[i++].value:y()}function y(){let e={simples:[]};for(s(),ee()?e.simples.push({selector:{functions:[{name:`scope`,args:[]}]},combinator:``}):e.simples.push({selector:ne(),combinator:``});;){if(s(),ee())e.simples[e.simples.length-1].combinator=n[i++].value,s();else if(te())break;e.simples.push({combinator:``,selector:ne()})}return e}function ne(){let e=``,r=[];for(;!te();)if(c()||h())e+=n[i++].toSource();else if(n[i]instanceof Oe)e+=n[i++].toSource();else if(n[i]instanceof C&&n[i].value===`.`)if(i++,c())e+=`.${n[i++].toSource()}`;else throw o();else if(n[i]instanceof le)if(i++,c())if(!t.has(n[i].value.toLowerCase()))e+=`:${n[i++].toSource()}`;else{let e=n[i++].value.toLowerCase();r.push({name:e,args:[]}),a.add(e)}else if(m()){let c=n[i++].value.toLowerCase();if(t.has(c)?(r.push({name:c,args:_()}),a.add(c)):e+=`:${c}(${b()})`,s(),!p())throw o();i++}else throw o();else if(n[i]instanceof me){for(e+=`[`,i++;!(n[i]instanceof he)&&!g();)e+=n[i++].toSource();if(!(n[i]instanceof he))throw o();e+=`]`,i++}else throw o();if(!e&&!r.length)throw o();return{css:e||void 0,functions:r}}function b(){let e=``,t=1;for(;!g()&&((f()||m())&&t++,p()&&t--,t);)e+=n[i++].toSource();return e}let x=_();if(!g())throw o();if(x.some(e=>typeof e!=`object`||!(`simples`in e)))throw new E(`Error while parsing selector "${e}"`);return{selector:x,names:Array.from(a)}}const Ie=new Set([`internal:has`,`internal:has-not`,`internal:and`,`internal:or`,`internal:chain`,`left-of`,`right-of`,`above`,`below`,`near`]),Le=new Set([`left-of`,`right-of`,`above`,`below`,`near`]),O=new Set([`not`,`is`,`where`,`has`,`scope`,`light`,`visible`,`text`,`text-matches`,`text-is`,`has-text`,`above`,`below`,`right-of`,`left-of`,`near`,`nth-match`]);function k(e){let t=Be(e),n=[];for(let e of t.parts){if(e.name===`css`||e.name===`css:light`){e.name===`css:light`&&(e.body=`:light(${e.body})`);let t=D(e.body,O);n.push({name:`css`,body:t.selector,source:e.body});continue}if(Ie.has(e.name)){let t,r;try{let n=JSON.parse(`[${e.body}]`);if(!Array.isArray(n)||n.length<1||n.length>2||typeof n[0]!=`string`)throw new E(`Malformed selector: ${e.name}=${e.body}`);if(t=n[0],n.length===2){if(typeof n[1]!=`number`||!Le.has(e.name))throw new E(`Malformed selector: ${e.name}=${e.body}`);r=n[1]}}catch{throw new E(`Malformed selector: ${e.name}=${e.body}`)}let i={name:e.name,source:e.body,body:{parsed:k(t),distance:r}},a=[...i.body.parsed.parts].reverse().find(e=>e.name===`internal:control`&&e.body===`enter-frame`),o=a?i.body.parsed.parts.indexOf(a):-1;o!==-1&&Re(i.body.parsed.parts.slice(0,o+1),n.slice(0,o+1))&&i.body.parsed.parts.splice(0,o+1),n.push(i);continue}n.push({...e,source:e.body})}if(Ie.has(n[0].name))throw new E(`"${n[0].name}" selector cannot be first`);return{capture:t.capture,parts:n}}function Re(e,t){return A({parts:e})===A({parts:t})}function A(e,t){return typeof e==`string`?e:e.parts.map((n,r)=>{let i=!0;!t&&r!==e.capture&&(n.name===`css`||n.name===`xpath`&&n.source.startsWith(`//`)||n.source.startsWith(`..`))&&(i=!1);let a=i?`${n.name}=`:``;return`${r===e.capture?`*`:``}${a}${n.source}`}).join(` >> `)}function ze(e,t){let n=(e,r)=>{for(let i of e.parts)t(i,r),Ie.has(i.name)&&n(i.body.parsed,!0)};n(e,!1)}function Be(e){let t=0,n,r=0,i={parts:[]},a=()=>{let n=e.substring(r,t).trim(),a=n.indexOf(`=`),o,s;a!==-1&&n.substring(0,a).trim().match(/^[\w\-+:*]+$/)?(o=n.substring(0,a).trim(),s=n.substring(a+1)):n.length>1&&n[0]===`"`&&n[n.length-1]===`"`||n.length>1&&n[0]===`'`&&n[n.length-1]===`'`?(o=`text`,s=n):/^\(*\/\//.test(n)||n.startsWith(`..`)?(o=`xpath`,s=n):(o=`css`,s=n);let c=!1;if(o[0]===`*`&&(c=!0,o=o.substring(1)),i.parts.push({name:o,body:s}),c){if(i.capture!==void 0)throw new E(`Only one of the selectors can capture using * modifier`);i.capture=i.parts.length-1}};if(!e.includes(`>>`))return t=e.length,a(),i;let o=()=>{let n=e.substring(r,t).match(/^\s*text\s*=(.*)$/);return!!n&&!!n[1]};for(;t<e.length;){let i=e[t];i===`\\`&&t+1<e.length?t+=2:i===n?(n=void 0,t++):!n&&(i===`"`||i===`'`||i==="`")&&!o()?(n=i,t++):!n&&i===`>`&&e[t+1]===`>`?(a(),t+=2,r=t):t++}return a(),i}function j(e,t){let n=0,r=e.length===0,i=()=>e[n]||``,a=()=>{let t=i();return++n,r=n>=e.length,t},o=t=>{throw r?new E(`Unexpected end of selector while parsing selector \`${e}\``):new E(`Error while parsing selector \`${e}\` - unexpected symbol "${i()}" at position ${n}${t?` during ${t}`:``}`)};function s(){for(;!r&&/\s/.test(i());)a()}function c(e){return e>=`€`||e>=`0`&&e<=`9`||e>=`A`&&e<=`Z`||e>=`a`&&e<=`z`||e>=`0`&&e<=`9`||e===`_`||e===`-`}function l(){let e=``;for(s();!r&&c(i());)e+=a();return e}function u(e){let t=a();for(t!==e&&o(`parsing quoted string`);!r&&i()!==e;)i()===`\\`&&a(),t+=a();return i()!==e&&o(`parsing quoted string`),t+=a(),t}function d(){a()!==`/`&&o(`parsing regular expression`);let t=``,n=!1;for(;!r;){if(i()===`\\`)t+=a(),r&&o(`parsing regular expression`);else if(n&&i()===`]`)n=!1;else if(!n&&i()===`[`)n=!0;else if(!n&&i()===`/`)break;t+=a()}a()!==`/`&&o(`parsing regular expression`);let s=``;for(;!r&&i().match(/[dgimsuy]/);)s+=a();try{return new RegExp(t,s)}catch(t){throw new E(`Error while parsing selector \`${e}\`: ${t.message}`)}}function f(){let e=``;return s(),e=i()===`'`||i()===`"`?u(i()).slice(1,-1):l(),e||o(`parsing property path`),e}function p(){s();let e=``;return r||(e+=a()),!r&&e!==`=`&&(e+=a()),[`=`,`*=`,`^=`,`$=`,`|=`,`~=`].includes(e)||o(`parsing operator`),e}function m(){a();let t=[];for(t.push(f()),s();i()===`.`;)a(),t.push(f()),s();if(i()===`]`)return a(),{name:t.join(`.`),jsonPath:t,op:`<truthy>`,value:null,caseSensitive:!1};let n=p(),l,m=!0;if(s(),i()===`/`){if(n!==`=`)throw new E(`Error while parsing selector \`${e}\` - cannot use ${n} in attribute with regular expression`);l=d()}else if(i()===`'`||i()===`"`)l=u(i()).slice(1,-1),s(),i()===`i`||i()===`I`?(m=!1,a()):(i()===`s`||i()===`S`)&&(m=!0,a());else{for(l=``;!r&&(c(i())||i()===`+`||i()===`.`);)l+=a();l===`true`?l=!0:l===`false`&&(l=!1)}if(s(),i()!==`]`&&o(`parsing attribute value`),a(),n!==`=`&&typeof l!=`string`)throw new E(`Error while parsing selector \`${e}\` - cannot use ${n} in attribute with non-string matching value - ${l}`);return{name:t.join(`.`),jsonPath:t,op:n,value:l,caseSensitive:m}}let h={name:``,attributes:[]};for(h.name=l(),s();i()===`[`;)h.attributes.push(m()),s();if(r||o(void 0),!h.name&&!h.attributes.length)throw new E(`Error while parsing selector \`${e}\` - selector cannot be empty`);return h}function Ve(e,t=`'`){let n=JSON.stringify(e),r=n.substring(1,n.length-1).replace(/\\"/g,`"`);if(t===`'`)return t+r.replace(/'/g,`\\'`)+t;if(t===`"`)return t+r.replace(/"/g,`\\"`)+t;if(t==="`")return t+r.replace(/`/g,"`")+t;throw Error(`Invalid escape char`)}function M(e){let t=``;for(let n=0;n<e.length;n++)t+=He(e,n);return t}function N(e){return`"${M(e).replace(/\\ /g,` `)}"`}function He(e,t){let n=e.charCodeAt(t);return n===0?`�`:n>=1&&n<=31||n>=48&&n<=57&&(t===0||t===1&&e.charCodeAt(0)===45)?`\\${n.toString(16)} `:t===0&&n===45&&e.length===1?`\\${e.charAt(t)}`:n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122?e.charAt(t):`\\${e.charAt(t)}`}function P(e){return e.replace(/[\u200b\u00ad]/g,``).trim().replace(/\s+/g,` `)}function Ue(e){return e.replace(/(^|[^\\])(\\\\)*\\(['"`])/g,`$1$2$3`)}function We(e){return e.unicode||e.unicodeSets?String(e):String(e).replace(/(^|[^\\])(\\\\)*(["'`])/g,`$1$2\\$3`).replace(/>>/g,`\\>\\>`)}function F(e,t){return typeof e==`string`?`${JSON.stringify(e)}${t?`s`:`i`}`:We(e)}function I(e,t){return typeof e==`string`?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"${t?`s`:`i`}`:We(e)}function Ge(e,t,n=``){if(e.length<=t)return e;let r=[...e];return r.length>t?r.slice(0,t-n.length).join(``)+n:r.join(``)}function Ke(e,t){return Ge(e,t,`…`)}function qe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function L(e){if(e.parentElement)return e.parentElement;if(e.parentNode&&e.parentNode.nodeType===11&&e.parentNode.host)return e.parentNode.host}function Je(e){let t=e;for(;t.parentNode;)t=t.parentNode;if(t.nodeType===11||t.nodeType===9)return t}function Ye(e){for(;e.parentElement;)e=e.parentElement;return L(e)}function Xe(e,t){for(;e;){let n=e.closest(t);if(n)return n;e=Ye(e)}}function R(e,t){return e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,t):void 0}function Ze(e,t){if(t??=R(e),!t)return!0;if(Element.prototype.checkVisibility&&Z.options.browser!==`webkit`){if(!e.checkVisibility())return!1}else{let t=e.closest(`details,summary`);if(t!==e&&t?.nodeName===`DETAILS`&&!t.open)return!1}return t.visibility===`visible`}function Qe(e){let t=R(e);if(!t)return!0;if(t.display===`contents`){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===1&&Qe(t)||t.nodeType===3&&$e(t))return!0;return!1}if(!Ze(e,t))return!1;let n=e.getBoundingClientRect();return n.width>0&&n.height>0}function $e(e){let t=e.ownerDocument.createRange();t.selectNode(e);let n=t.getBoundingClientRect();return n.width>0&&n.height>0}function z(e){return e instanceof HTMLFormElement?`FORM`:e.tagName.toUpperCase()}function et(e){return e.hasAttribute(`aria-label`)||e.hasAttribute(`aria-labelledby`)}const tt=`article:not([role]), aside:not([role]), main:not([role]), nav:not([role]), section:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]`,nt=new Map([[`aria-atomic`,void 0],[`aria-busy`,void 0],[`aria-controls`,void 0],[`aria-current`,void 0],[`aria-describedby`,void 0],[`aria-details`,void 0],[`aria-dropeffect`,void 0],[`aria-flowto`,void 0],[`aria-grabbed`,void 0],[`aria-hidden`,void 0],[`aria-keyshortcuts`,void 0],[`aria-label`,new Set([`caption`,`code`,`deletion`,`emphasis`,`generic`,`insertion`,`paragraph`,`presentation`,`strong`,`subscript`,`superscript`])],[`aria-labelledby`,new Set([`caption`,`code`,`deletion`,`emphasis`,`generic`,`insertion`,`paragraph`,`presentation`,`strong`,`subscript`,`superscript`])],[`aria-live`,void 0],[`aria-owns`,void 0],[`aria-relevant`,void 0],[`aria-roledescription`,new Set([`generic`])]]);function rt(e,t){return[...nt].some(([n,r])=>!r?.has(t||``)&&e.hasAttribute(n))}function it(e){return!Number.isNaN(Number(String(e.getAttribute(`tabindex`))))}function at(e){return!Wt(e)&&(ot(e)||it(e))}function ot(e){let t=z(e);return[`BUTTON`,`DETAILS`,`SELECT`,`TEXTAREA`].includes(t)?!0:t===`A`||t===`AREA`?e.hasAttribute(`href`):t===`INPUT`?!e.hidden:!1}const st={A:e=>e.hasAttribute(`href`)?`link`:null,AREA:e=>e.hasAttribute(`href`)?`link`:null,ARTICLE:()=>`article`,ASIDE:()=>`complementary`,BLOCKQUOTE:()=>`blockquote`,BUTTON:()=>`button`,CAPTION:()=>`caption`,CODE:()=>`code`,DATALIST:()=>`listbox`,DD:()=>`definition`,DEL:()=>`deletion`,DETAILS:()=>`group`,DFN:()=>`term`,DIALOG:()=>`dialog`,DT:()=>`term`,EM:()=>`emphasis`,FIELDSET:()=>`group`,FIGURE:()=>`figure`,FOOTER:e=>Xe(e,tt)?null:`contentinfo`,FORM:e=>et(e)?`form`:null,H1:()=>`heading`,H2:()=>`heading`,H3:()=>`heading`,H4:()=>`heading`,H5:()=>`heading`,H6:()=>`heading`,HEADER:e=>Xe(e,tt)?null:`banner`,HR:()=>`separator`,HTML:()=>`document`,IMG:e=>e.getAttribute(`alt`)===``&&!e.getAttribute(`title`)&&!rt(e)&&!it(e)?`presentation`:`img`,INPUT:e=>{let t=e.type.toLowerCase();if(t===`search`)return e.hasAttribute(`list`)?`combobox`:`searchbox`;if([`email`,`tel`,`text`,`url`,``].includes(t)){let t=H(e,e.getAttribute(`list`))[0];return t&&z(t)===`DATALIST`?`combobox`:`textbox`}return t===`hidden`?``:t===`file`?`button`:{button:`button`,checkbox:`checkbox`,image:`button`,number:`spinbutton`,radio:`radio`,range:`slider`,reset:`button`,submit:`button`}[t]||`textbox`},INS:()=>`insertion`,LI:()=>`listitem`,MAIN:()=>`main`,MARK:()=>`mark`,MATH:()=>`math`,MENU:()=>`list`,METER:()=>`meter`,NAV:()=>`navigation`,OL:()=>`list`,OPTGROUP:()=>`group`,OPTION:()=>`option`,OUTPUT:()=>`status`,P:()=>`paragraph`,PROGRESS:()=>`progressbar`,SECTION:e=>et(e)?`region`:null,SELECT:e=>e.hasAttribute(`multiple`)||e.size>1?`listbox`:`combobox`,STRONG:()=>`strong`,SUB:()=>`subscript`,SUP:()=>`superscript`,SVG:()=>`img`,TABLE:()=>`table`,TBODY:()=>`rowgroup`,TD:e=>{let t=Xe(e,`table`),n=t?pt(t):``;return n===`grid`||n===`treegrid`?`gridcell`:`cell`},TEXTAREA:()=>`textbox`,TFOOT:()=>`rowgroup`,TH:e=>{if(e.getAttribute(`scope`)===`col`)return`columnheader`;if(e.getAttribute(`scope`)===`row`)return`rowheader`;let t=Xe(e,`table`),n=t?pt(t):``;return n===`grid`||n===`treegrid`?`gridcell`:`cell`},THEAD:()=>`rowgroup`,TIME:()=>`time`,TR:()=>`row`,UL:()=>`list`},ct={DD:[`DL`,`DIV`],DIV:[`DL`],DT:[`DL`,`DIV`],LI:[`OL`,`UL`],TBODY:[`TABLE`],TD:[`TR`],TFOOT:[`TABLE`],TH:[`TR`],THEAD:[`TABLE`],TR:[`THEAD`,`TBODY`,`TFOOT`,`TABLE`]};function lt(e){let t=st[z(e)]?.call(st,e)||``;if(!t)return null;let n=e;for(;n;){let e=L(n),t=ct[z(n)];if(!t||!e||!t.includes(z(e)))break;let r=pt(e);if((r===`none`||r===`presentation`)&&!mt(e,r))return r;n=e}return t}const ut=`alert.alertdialog.application.article.banner.blockquote.button.caption.cell.checkbox.code.columnheader.combobox.command.complementary.composite.contentinfo.definition.deletion.dialog.directory.document.emphasis.feed.figure.form.generic.grid.gridcell.group.heading.img.input.insertion.landmark.link.list.listbox.listitem.log.main.marquee.math.meter.menu.menubar.menuitem.menuitemcheckbox.menuitemradio.navigation.none.note.option.paragraph.presentation.progressbar.radio.radiogroup.range.region.roletype.row.rowgroup.rowheader.scrollbar.search.searchbox.section.sectionhead.select.separator.slider.spinbutton.status.strong.structure.subscript.superscript.switch.tab.table.tablist.tabpanel.term.textbox.time.timer.toolbar.tooltip.tree.treegrid.treeitem.widget.window`.split(`.`),dt=[`command`,`composite`,`input`,`landmark`,`range`,`roletype`,`section`,`sectionhead`,`select`,`structure`,`widget`,`window`],ft=ut.filter(e=>!dt.includes(e));function pt(e){return(e.getAttribute(`role`)||``).split(` `).map(e=>e.trim()).find(e=>ft.includes(e))||null}function mt(e,t){return rt(e,t)||at(e)}function B(e){let t=pt(e);if(!t)return lt(e);if(t===`none`||t===`presentation`){let t=lt(e);if(mt(e,t))return t}return t}function ht(e){return e===null?void 0:e.toLowerCase()===`true`}function gt(e){return[`STYLE`,`SCRIPT`,`NOSCRIPT`,`TEMPLATE`].includes(z(e))}function V(e){if(gt(e))return!0;let t=R(e),n=e.nodeName===`SLOT`;if(t?.display===`contents`&&!n){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===1&&!V(t)||t.nodeType===3&&$e(t))return!1;return!0}return!(e.nodeName===`OPTION`&&e.closest(`select`))&&!n&&!Ze(e,t)?!0:_t(e)}function _t(e){let t=Qt?.get(e);if(t===void 0){if(t=!1,e.parentElement&&e.parentElement.shadowRoot&&!e.assignedSlot&&(t=!0),!t){let n=R(e);t=!n||n.display===`none`||ht(e.getAttribute(`aria-hidden`))===!0}if(!t){let n=L(e);n&&(t=_t(n))}Qt?.set(e,t)}return t}function H(e,t){if(!t)return[];let n=Je(e);if(!n)return[];try{let e=t.split(` `).filter(e=>!!e),r=new Set;for(let t of e){let e=n.querySelector(`#${CSS.escape(t)}`);e&&r.add(e)}return[...r]}catch{return[]}}function U(e){return e.trim()}function vt(e){return e.split(`\xA0`).map(e=>e.replace(/\r\n/g,`
3
3
  `).replace(/[\u200b\u00ad]/g,``).replace(/\s\s*/g,` `)).join(`\xA0`).trim()}function yt(e,t){let n=[...e.querySelectorAll(t)];for(let r of H(e,e.getAttribute(`aria-owns`)))r.matches(t)&&n.push(r),n.push(...r.querySelectorAll(t));return n}function bt(e,t){let n=t===`::before`?$t:en;if(n?.has(e))return n?.get(e)||``;let r=xt(R(e,t));return n&&n.set(e,r),r}function xt(e){if(!e)return``;let t=e.content;if(t[0]===`'`&&t[t.length-1]===`'`||t[0]===`"`&&t[t.length-1]===`"`){let n=t.substring(1,t.length-1);return(e.display||`inline`)===`inline`?n:` ${n} `}return``}function St(e){let t=e.getAttribute(`aria-labelledby`);return t===null?null:H(e,t)}function Ct(e,t){let n=[`button`,`cell`,`checkbox`,`columnheader`,`gridcell`,`heading`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`row`,`rowheader`,`switch`,`tab`,`tooltip`,`treeitem`].includes(e),r=t&&[``,`caption`,`code`,`contentinfo`,`definition`,`deletion`,`emphasis`,`insertion`,`list`,`listitem`,`mark`,`none`,`paragraph`,`presentation`,`region`,`row`,`rowgroup`,`section`,`strong`,`subscript`,`superscript`,`table`,`term`,`time`].includes(e);return n||r}function wt(e,t){let n=t?Yt:Jt,r=n?.get(e);return r===void 0&&(r=``,[`caption`,`code`,`definition`,`deletion`,`emphasis`,`generic`,`insertion`,`mark`,`paragraph`,`presentation`,`strong`,`subscript`,`suggestion`,`superscript`,`term`,`time`].includes(B(e)||``)||(r=vt(W(e,{includeHidden:t,visitedElements:new Set,embeddedInDescribedBy:void 0,embeddedInLabelledBy:void 0,embeddedInLabel:void 0,embeddedInNativeTextAlternative:void 0,embeddedInTargetElement:`self`}))),n?.set(e,r)),r}function Tt(e,t){let n=Zt,r=n?.get(e);return r===void 0&&(r=``,r=e.hasAttribute(`aria-describedby`)?vt(H(e,e.getAttribute(`aria-describedby`)).map(e=>W(e,{includeHidden:t,visitedElements:new Set,embeddedInDescribedBy:{element:e,hidden:V(e)}})).join(` `)):e.hasAttribute(`aria-description`)?vt(e.getAttribute(`aria-description`)||``):vt(e.getAttribute(`title`)||``),n?.set(e,r)),r}const Et=[`application`,`checkbox`,`combobox`,`gridcell`,`listbox`,`radiogroup`,`slider`,`spinbutton`,`textbox`,`tree`,`columnheader`,`rowheader`,`searchbox`,`switch`,`treegrid`];function Dt(e){let t=B(e)||``;if(!t||!Et.includes(t))return`false`;let n=e.getAttribute(`aria-invalid`);return!n||n.trim()===``||n.toLocaleLowerCase()===`false`?`false`:n===`true`||n===`grammar`||n===`spelling`?n:`true`}function Ot(e){return`validity`in e?e.validity?.valid===!1:!1}function kt(e){let t=Xt,n=Xt?.get(e);if(n===void 0){n=``;let r=Dt(e)!==`false`,i=Ot(e);(r||i)&&(n=H(e,e.getAttribute(`aria-errormessage`)).map(e=>vt(W(e,{visitedElements:new Set,embeddedInDescribedBy:{element:e,hidden:V(e)}}))).join(` `).trim()),t?.set(e,n)}return n}function W(e,t){if(t.visitedElements.has(e))return``;let n={...t,embeddedInTargetElement:t.embeddedInTargetElement===`self`?`descendant`:t.embeddedInTargetElement};if(!t.includeHidden){let n=!!t.embeddedInLabelledBy?.hidden||!!t.embeddedInDescribedBy?.hidden||!!t.embeddedInNativeTextAlternative?.hidden||!!t.embeddedInLabel?.hidden;if(gt(e)||!n&&V(e))return t.visitedElements.add(e),``}let r=St(e);if(!t.embeddedInLabelledBy){let e=(r||[]).map(e=>W(e,{...t,embeddedInLabelledBy:{element:e,hidden:V(e)},embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0,embeddedInLabel:void 0,embeddedInNativeTextAlternative:void 0})).join(` `);if(e)return e}let i=B(e)||``,a=z(e);if(t.embeddedInLabel||t.embeddedInLabelledBy||t.embeddedInTargetElement===`descendant`){let o=[...e.labels||[]].includes(e),s=(r||[]).includes(e);if(!o&&!s){if(i===`textbox`)return t.visitedElements.add(e),a===`INPUT`||a===`TEXTAREA`?e.value:e.textContent||``;if([`combobox`,`listbox`].includes(i)){t.visitedElements.add(e);let r;if(a===`SELECT`)r=[...e.selectedOptions],!r.length&&e.options.length&&r.push(e.options[0]);else{let t=i===`combobox`?yt(e,`*`).find(e=>B(e)===`listbox`):e;r=t?yt(t,`[aria-selected="true"]`).filter(e=>B(e)===`option`):[]}return!r.length&&a===`INPUT`?e.value:r.map(e=>W(e,n)).join(` `)}if([`progressbar`,`scrollbar`,`slider`,`spinbutton`,`meter`].includes(i))return t.visitedElements.add(e),e.hasAttribute(`aria-valuetext`)?e.getAttribute(`aria-valuetext`)||``:e.hasAttribute(`aria-valuenow`)?e.getAttribute(`aria-valuenow`)||``:e.getAttribute(`value`)||``;if([`menu`].includes(i))return t.visitedElements.add(e),``}}let o=e.getAttribute(`aria-label`)||``;if(U(o))return t.visitedElements.add(e),o;if(![`presentation`,`none`].includes(i)){if(a===`INPUT`&&[`button`,`submit`,`reset`].includes(e.type)){t.visitedElements.add(e);let n=e.value||``;return U(n)?n:e.type===`submit`?`Submit`:e.type===`reset`?`Reset`:e.getAttribute(`title`)||``}if(a===`INPUT`&&e.type===`image`){t.visitedElements.add(e);let n=e.labels||[];if(n.length&&!t.embeddedInLabelledBy)return qt(n,t);let r=e.getAttribute(`alt`)||``;if(U(r))return r;let i=e.getAttribute(`title`)||``;return U(i)?i:`Submit`}if(!r&&a===`BUTTON`){t.visitedElements.add(e);let n=e.labels||[];if(n.length)return qt(n,t)}if(!r&&a===`OUTPUT`){t.visitedElements.add(e);let n=e.labels||[];return n.length?qt(n,t):e.getAttribute(`title`)||``}if(!r&&(a===`TEXTAREA`||a===`SELECT`||a===`INPUT`)){t.visitedElements.add(e);let n=e.labels||[];if(n.length)return qt(n,t);let r=a===`INPUT`&&[`text`,`password`,`search`,`tel`,`email`,`url`].includes(e.type)||a===`TEXTAREA`,i=e.getAttribute(`placeholder`)||``,o=e.getAttribute(`title`)||``;return!r||o?o:i}if(!r&&a===`FIELDSET`){t.visitedElements.add(e);for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(z(t)===`LEGEND`)return W(t,{...n,embeddedInNativeTextAlternative:{element:t,hidden:V(t)}});return e.getAttribute(`title`)||``}if(!r&&a===`FIGURE`){t.visitedElements.add(e);for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(z(t)===`FIGCAPTION`)return W(t,{...n,embeddedInNativeTextAlternative:{element:t,hidden:V(t)}});return e.getAttribute(`title`)||``}if(a===`IMG`){t.visitedElements.add(e);let n=e.getAttribute(`alt`)||``;return U(n)?n:e.getAttribute(`title`)||``}if(a===`TABLE`){t.visitedElements.add(e);for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(z(t)===`CAPTION`)return W(t,{...n,embeddedInNativeTextAlternative:{element:t,hidden:V(t)}});let r=e.getAttribute(`summary`)||``;if(r)return r}if(a===`AREA`){t.visitedElements.add(e);let n=e.getAttribute(`alt`)||``;return U(n)?n:e.getAttribute(`title`)||``}if(a===`SVG`||e.ownerSVGElement){t.visitedElements.add(e);for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(z(t)===`TITLE`&&t.ownerSVGElement)return W(t,{...n,embeddedInLabelledBy:{element:t,hidden:V(t)}})}if(e.ownerSVGElement&&a===`A`){let n=e.getAttribute(`xlink:title`)||``;if(U(n))return t.visitedElements.add(e),n}}let s=a===`SUMMARY`&&![`presentation`,`none`].includes(i);if(Ct(i,t.embeddedInTargetElement===`descendant`)||s||t.embeddedInLabelledBy||t.embeddedInDescribedBy||t.embeddedInLabel||t.embeddedInNativeTextAlternative){t.visitedElements.add(e);let r=At(e,n);if(t.embeddedInTargetElement===`self`?U(r):r)return r}if(![`presentation`,`none`].includes(i)||a===`IFRAME`){t.visitedElements.add(e);let n=e.getAttribute(`title`)||``;if(U(n))return n}return t.visitedElements.add(e),``}function At(e,t){let n=[],r=(e,r)=>{if(!(r&&e.assignedSlot))if(e.nodeType===1){let r=R(e)?.display||`inline`,i=W(e,t);(r!==`inline`||e.nodeName===`BR`)&&(i=` `+i+` `),n.push(i)}else e.nodeType===3&&n.push(e.textContent||``)};n.push(bt(e,`::before`));let i=e.nodeName===`SLOT`?e.assignedNodes():[];if(i.length)for(let e of i)r(e,!1);else{for(let t=e.firstChild;t;t=t.nextSibling)r(t,!0);if(e.shadowRoot)for(let t=e.shadowRoot.firstChild;t;t=t.nextSibling)r(t,!0);for(let t of H(e,e.getAttribute(`aria-owns`)))r(t,!0)}return n.push(bt(e,`::after`)),n.join(``)}const jt=[`gridcell`,`option`,`row`,`tab`,`rowheader`,`columnheader`,`treeitem`];function Mt(e){return z(e)===`OPTION`?e.selected:jt.includes(B(e)||``)?ht(e.getAttribute(`aria-selected`))===!0:!1}const Nt=[`checkbox`,`menuitemcheckbox`,`option`,`radio`,`switch`,`menuitemradio`,`treeitem`];function Pt(e){let t=Ft(e);return t===`error`?!1:t}function Ft(e,t){let n=z(e);if(n===`INPUT`&&e.indeterminate)return`mixed`;if(n===`INPUT`&&[`checkbox`,`radio`].includes(e.type))return e.checked;if(Nt.includes(B(e)||``)){let t=e.getAttribute(`aria-checked`);return t===`true`?!0:t===`mixed`?`mixed`:!1}return`error`}const It=[`button`];function Lt(e){if(It.includes(B(e)||``)){let t=e.getAttribute(`aria-pressed`);if(t===`true`)return!0;if(t===`mixed`)return`mixed`}return!1}const Rt=[`application`,`button`,`checkbox`,`combobox`,`gridcell`,`link`,`listbox`,`menuitem`,`row`,`rowheader`,`tab`,`treeitem`,`columnheader`,`menuitemcheckbox`,`menuitemradio`,`rowheader`,`switch`];function zt(e){if(z(e)===`DETAILS`)return e.open;if(Rt.includes(B(e)||``)){let t=e.getAttribute(`aria-expanded`);return t===null?`none`:t===`true`}return`none`}const Bt=[`heading`,`listitem`,`row`,`treeitem`];function Vt(e){let t={H1:1,H2:2,H3:3,H4:4,H5:5,H6:6}[z(e)];if(t)return t;if(Bt.includes(B(e)||``)){let t=e.getAttribute(`aria-level`),n=t===null?NaN:Number(t);if(Number.isInteger(n)&&n>=1)return n}return 0}const Ht=`application.button.composite.gridcell.group.input.link.menuitem.scrollbar.separator.tab.checkbox.columnheader.combobox.grid.listbox.menu.menubar.menuitemcheckbox.menuitemradio.option.radio.radiogroup.row.rowheader.searchbox.select.slider.spinbutton.switch.tablist.textbox.toolbar.tree.treegrid.treeitem`.split(`.`);function Ut(e){return Wt(e)||Kt(e)}function Wt(e){return[`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`OPTION`,`OPTGROUP`].includes(e.tagName)&&(e.hasAttribute(`disabled`)||Gt(e))}function Gt(e){let t=e?.closest(`FIELDSET[DISABLED]`);if(!t)return!1;let n=t.querySelector(`:scope > LEGEND`);return!n||!n.contains(e)}function Kt(e){if(!e)return!1;if(Ht.includes(B(e)||``)){let t=(e.getAttribute(`aria-disabled`)||``).toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}return Kt(L(e))}function qt(e,t){return[...e].map(e=>W(e,{...t,embeddedInLabel:{element:e,hidden:V(e)},embeddedInNativeTextAlternative:void 0,embeddedInLabelledBy:void 0,embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0})).filter(e=>!!e).join(` `)}let Jt,Yt,Xt,Zt,Qt,$t,en,tn=0;function nn(){++tn,Jt??=new Map,Yt??=new Map,Zt??=new Map,Xt??=new Map,Qt??=new Map,$t??=new Map,en??=new Map}function rn(){--tn||(Jt=void 0,Yt=void 0,Zt=void 0,Xt=void 0,Qt=void 0,$t=void 0,en=void 0)}function an(e,t){let n=typeof e==`string`&&!t.caseSensitive?e.toUpperCase():e,r=typeof t.value==`string`&&!t.caseSensitive?t.value.toUpperCase():t.value;return t.op===`<truthy>`?!!n:t.op===`=`?r instanceof RegExp?typeof n==`string`&&!!n.match(r):n===r:typeof n!=`string`||typeof r!=`string`?!1:t.op===`*=`?n.includes(r):t.op===`^=`?n.startsWith(r):t.op===`$=`?n.endsWith(r):t.op===`|=`?n===r||n.startsWith(`${r}-`):t.op===`~=`?n.split(` `).includes(r):!1}function on(e){let t=e.ownerDocument;return e.nodeName===`SCRIPT`||e.nodeName===`NOSCRIPT`||e.nodeName===`STYLE`||t.head&&t.head.contains(e)}function G(e,t){let n=e.get(t);if(n===void 0){if(n={full:``,normalized:``,immediate:[]},!on(t)){let r=``;if(t instanceof HTMLInputElement&&(t.type===`submit`||t.type===`button`))n={full:t.value,normalized:P(t.value),immediate:[t.value]};else{for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType===Node.TEXT_NODE?(n.full+=i.nodeValue||``,r+=i.nodeValue||``):(r&&n.immediate.push(r),r=``,i.nodeType===Node.ELEMENT_NODE&&(n.full+=G(e,i).full));r&&n.immediate.push(r),t.shadowRoot&&(n.full+=G(e,t.shadowRoot).full),n.full&&(n.normalized=P(n.full))}}e.set(t,n)}return n}function sn(e,t,n){if(on(t)||!n(G(e,t)))return`none`;for(let r=t.firstChild;r;r=r.nextSibling)if(r.nodeType===Node.ELEMENT_NODE&&n(G(e,r)))return`selfAndChildren`;return t.shadowRoot&&n(G(e,t.shadowRoot))?`selfAndChildren`:`self`}function cn(e,t){let n=St(t);if(n)return n.map(t=>G(e,t));let r=t.getAttribute(`aria-label`);if(r!==null&&r.trim())return[{full:r,normalized:P(r),immediate:[r]}];let i=t.nodeName===`INPUT`&&t.type!==`hidden`;if([`BUTTON`,`METER`,`OUTPUT`,`PROGRESS`,`SELECT`,`TEXTAREA`].includes(t.nodeName)||i){let n=t.labels;if(n)return[...n].map(t=>G(e,t))}return[]}const ln=[`selected`,`checked`,`pressed`,`expanded`,`level`,`disabled`,`name`,`include-hidden`];ln.sort();function un(e,t,n){if(!t.includes(n))throw Error(`"${e}" attribute is only supported for roles: ${t.slice().sort().map(e=>`"${e}"`).join(`, `)}`)}function K(e,t){if(e.op!==`<truthy>`&&!t.includes(e.value))throw Error(`"${e.name}" must be one of ${t.map(e=>JSON.stringify(e)).join(`, `)}`)}function q(e,t){if(!t.includes(e.op))throw Error(`"${e.name}" does not support "${e.op}" matcher`)}function dn(e,t){let n={role:t};for(let r of e)switch(r.name){case`checked`:un(r.name,Nt,t),K(r,[!0,!1,`mixed`]),q(r,[`<truthy>`,`=`]),n.checked=r.op===`<truthy>`?!0:r.value;break;case`pressed`:un(r.name,It,t),K(r,[!0,!1,`mixed`]),q(r,[`<truthy>`,`=`]),n.pressed=r.op===`<truthy>`?!0:r.value;break;case`selected`:un(r.name,jt,t),K(r,[!0,!1]),q(r,[`<truthy>`,`=`]),n.selected=r.op===`<truthy>`?!0:r.value;break;case`expanded`:un(r.name,Rt,t),K(r,[!0,!1]),q(r,[`<truthy>`,`=`]),n.expanded=r.op===`<truthy>`?!0:r.value;break;case`level`:if(un(r.name,Bt,t),typeof r.value==`string`&&(r.value=+r.value),r.op!==`=`||typeof r.value!=`number`||Number.isNaN(r.value))throw Error(`"level" attribute must be compared to a number`);n.level=r.value;break;case`disabled`:K(r,[!0,!1]),q(r,[`<truthy>`,`=`]),n.disabled=r.op===`<truthy>`?!0:r.value;break;case`name`:if(r.op===`<truthy>`)throw Error(`"name" attribute must have a value`);if(typeof r.value!=`string`&&!(r.value instanceof RegExp))throw TypeError(`"name" attribute must be a string or a regular expression`);n.name=r.value,n.nameOp=r.op,n.exact=r.caseSensitive;break;case`include-hidden`:K(r,[!0,!1]),q(r,[`<truthy>`,`=`]),n.includeHidden=r.op===`<truthy>`?!0:r.value;break;default:throw Error(`Unknown attribute "${r.name}", must be one of ${ln.map(e=>`"${e}"`).join(`, `)}.`)}return n}function fn(e,t,n){let r=[],i=e=>{if(B(e)===t.role&&!(t.selected!==void 0&&Mt(e)!==t.selected)&&!(t.checked!==void 0&&Pt(e)!==t.checked)&&!(t.pressed!==void 0&&Lt(e)!==t.pressed)&&!(t.expanded!==void 0&&zt(e)!==t.expanded)&&!(t.level!==void 0&&Vt(e)!==t.level)&&!(t.disabled!==void 0&&Ut(e)!==t.disabled)&&!(!t.includeHidden&&V(e))){if(t.name!==void 0){let r=P(wt(e,!!t.includeHidden));if(typeof t.name==`string`&&(t.name=P(t.name)),n&&!t.exact&&t.nameOp===`=`&&(t.nameOp=`*=`),!an(r,{op:t.nameOp||`=`,value:t.name,caseSensitive:!!t.exact}))return}r.push(e)}},a=e=>{let t=[];e.shadowRoot&&t.push(e.shadowRoot);for(let n of e.querySelectorAll(`*`))i(n),n.shadowRoot&&t.push(n.shadowRoot);t.forEach(a)};return a(e),r}function pn(e){return{queryAll:(t,n)=>{let r=j(n),i=r.name.toLowerCase();if(!i)throw Error(`Role must not be empty`);let a=dn(r.attributes,i);nn();try{return fn(t,a,e)}finally{rn()}}}}function mn(e,t,n=!1){return hn(e,t,n)[0]}function hn(e,t,n=!1,r=20,i){try{return J(new vn[e](i),k(t),n,r)}catch{return[t]}}function J(e,t,n=!1,r=20){let i=[...t.parts];for(let e=0;e<i.length-1;e++)if(i[e].name===`nth`&&i[e+1].name===`internal:control`&&i[e+1].body===`enter-frame`){let[t]=i.splice(e,1);i.splice(e+1,0,t)}let a=[],o=n?`frame-locator`:`page`;for(let t=0;t<i.length;t++){let n=i[t],s=o;if(o=`locator`,n.name===`nth`){n.body===`0`?a.push([e.generateLocator(s,`first`,``),e.generateLocator(s,`nth`,`0`)]):n.body===`-1`?a.push([e.generateLocator(s,`last`,``),e.generateLocator(s,`nth`,`-1`)]):a.push([e.generateLocator(s,`nth`,n.body)]);continue}if(n.name===`internal:text`){let{exact:t,text:r}=_n(n.body);a.push([e.generateLocator(s,`text`,r,{exact:t})]);continue}if(n.name===`internal:has-text`){let{exact:t,text:r}=_n(n.body);if(!t){a.push([e.generateLocator(s,`has-text`,r,{exact:t})]);continue}}if(n.name===`internal:has-not-text`){let{exact:t,text:r}=_n(n.body);if(!t){a.push([e.generateLocator(s,`has-not-text`,r,{exact:t})]);continue}}if(n.name===`internal:has`){let t=J(e,n.body.parsed,!1,r);a.push(t.map(t=>e.generateLocator(s,`has`,t)));continue}if(n.name===`internal:has-not`){let t=J(e,n.body.parsed,!1,r);a.push(t.map(t=>e.generateLocator(s,`hasNot`,t)));continue}if(n.name===`internal:and`){let t=J(e,n.body.parsed,!1,r);a.push(t.map(t=>e.generateLocator(s,`and`,t)));continue}if(n.name===`internal:or`){let t=J(e,n.body.parsed,!1,r);a.push(t.map(t=>e.generateLocator(s,`or`,t)));continue}if(n.name===`internal:chain`){let t=J(e,n.body.parsed,!1,r);a.push(t.map(t=>e.generateLocator(s,`chain`,t)));continue}if(n.name===`internal:label`){let{exact:t,text:r}=_n(n.body);a.push([e.generateLocator(s,`label`,r,{exact:t})]);continue}if(n.name===`internal:role`){let t=j(n.body),r={attrs:[]};for(let e of t.attributes)e.name===`name`?(r.exact=e.caseSensitive,r.name=e.value):(e.name===`level`&&typeof e.value==`string`&&(e.value=+e.value),r.attrs.push({name:e.name===`include-hidden`?`includeHidden`:e.name,value:e.value}));a.push([e.generateLocator(s,`role`,t.name,r)]);continue}if(n.name===`internal:testid`){let{value:t}=j(n.body).attributes[0];a.push([e.generateLocator(s,`test-id`,t)]);continue}if(n.name===`internal:attr`){let{name:t,value:r,caseSensitive:i}=j(n.body).attributes[0],o=r,c=!!i;if(t===`placeholder`){a.push([e.generateLocator(s,`placeholder`,o,{exact:c})]);continue}if(t===`alt`){a.push([e.generateLocator(s,`alt`,o,{exact:c})]);continue}if(t===`title`){a.push([e.generateLocator(s,`title`,o,{exact:c})]);continue}}let c=`default`,l=i[t+1];l&&l.name===`internal:control`&&l.body===`enter-frame`&&(c=`frame`,o=`frame-locator`,t++);let u=A({parts:[n]}),d=e.generateLocator(s,c,u);if(c===`default`&&l&&[`internal:has-text`,`internal:has-not-text`].includes(l.name)){let{exact:n,text:r}=_n(l.body);if(!n){let i=e.generateLocator(`locator`,l.name===`internal:has-text`?`has-text`:`has-not-text`,r,{exact:n}),o={};l.name===`internal:has-text`?o.hasText=r:o.hasNotText=r;let c=e.generateLocator(s,`default`,u,o);a.push([e.chainLocators([d,i]),c]),t++;continue}}let f;if([`xpath`,`css`].includes(n.name)){let t=A({parts:[n]},!0);f=e.generateLocator(s,c,t)}a.push([d,f].filter(Boolean))}return gn(e,a,r)}function gn(e,t,n){let r=t.map(()=>``),i=[],a=o=>{if(o===t.length)return i.push(e.chainLocators(r)),r.length<n;for(let e of t[o])if(r[o]=e,!a(o+1))return!1;return!0};return a(0),i}function _n(e){let t=!1,n=e.match(/^\/(.*)\/([igm]*)$/);return n?{text:new RegExp(n[1],n[2])}:(e.endsWith(`"`)?(e=JSON.parse(e),t=!0):e.endsWith(`"s`)?(e=JSON.parse(e.substring(0,e.length-1)),t=!0):e.endsWith(`"i`)&&(e=JSON.parse(e.substring(0,e.length-1)),t=!1),{exact:t,text:e})}const vn={javascript:class{constructor(e){this.preferredQuote=e}generateLocator(e,t,n,r={}){switch(t){case`default`:return r.hasText===void 0?r.hasNotText===void 0?`locator(${this.quote(n)})`:`locator(${this.quote(n)}, { hasNotText: ${this.toHasText(r.hasNotText)} })`:`locator(${this.quote(n)}, { hasText: ${this.toHasText(r.hasText)} })`;case`frame`:return`frameLocator(${this.quote(n)})`;case`nth`:return`nth(${n})`;case`first`:return`first()`;case`last`:return`last()`;case`role`:{let e=[];yn(r.name)?e.push(`name: ${this.regexToSourceString(r.name)}`):typeof r.name==`string`&&(e.push(`name: ${this.quote(r.name)}`),r.exact&&e.push(`exact: true`));for(let{name:t,value:n}of r.attrs)e.push(`${t}: ${typeof n==`string`?this.quote(n):n}`);let t=e.length?`, { ${e.join(`, `)} }`:``;return`getByRole(${this.quote(n)}${t})`}case`has-text`:return`filter({ hasText: ${this.toHasText(n)} })`;case`has-not-text`:return`filter({ hasNotText: ${this.toHasText(n)} })`;case`has`:return`filter({ has: ${n} })`;case`hasNot`:return`filter({ hasNot: ${n} })`;case`and`:return`and(${n})`;case`or`:return`or(${n})`;case`chain`:return`locator(${n})`;case`test-id`:{let e=this.toTestIdValue(n);return e.startsWith(`'__vitest_`)&&e.endsWith(`__'`)?`page`:`getByTestId(${e})`}case`text`:return this.toCallWithExact(`getByText`,n,!!r.exact);case`alt`:return this.toCallWithExact(`getByAltText`,n,!!r.exact);case`placeholder`:return this.toCallWithExact(`getByPlaceholder`,n,!!r.exact);case`label`:return this.toCallWithExact(`getByLabel`,n,!!r.exact);case`title`:return this.toCallWithExact(`getByTitle`,n,!!r.exact);default:throw Error(`Unknown selector kind ${t}`)}}chainLocators(e){return e.join(`.`)}regexToSourceString(e){return Ue(String(e))}toCallWithExact(e,t,n){return yn(t)?`${e}(${this.regexToSourceString(t)})`:n?`${e}(${this.quote(t)}, { exact: true })`:`${e}(${this.quote(t)})`}toHasText(e){return yn(e)?this.regexToSourceString(e):this.quote(e)}toTestIdValue(e){return yn(e)?this.regexToSourceString(e):this.quote(e)}quote(e){return Ve(e,this.preferredQuote??`'`)}}};function yn(e){return e instanceof RegExp}const bn=new Map,xn=new Map,Sn=1e4;function Cn(e,t,n){e._evaluator.begin(),nn();try{return jn(Tn(e,t,n)||kn(e,t,n))}finally{bn.clear(),xn.clear(),rn(),e._evaluator.end()}}function wn(e){return e.filter(e=>e[0].selector[0]!==`/`)}function Tn(e,t,n){if(t.ownerDocument.documentElement===t)return[{engine:`css`,selector:`html`,score:1}];let r=(r,a)=>{let o=r===t,s=a?Dn(e,r,r===t):[];r!==t&&(s=wn(s));let c=En(e,r,n).map(e=>[e]),l=Mn(e,t.ownerDocument,r,[...s,...c],o);s=wn(s);let u=t=>{let n=a&&!t.length,s=[...t,...c].filter(e=>l?Y(e)<Y(l):!0),u=s[0];if(u)for(let t=L(r);t;t=L(t)){let a=i(t,n);if(!a||l&&Y([...a,...u])>=Y(l))continue;if(u=Mn(e,t,r,s,o),!u)return;let c=[...a,...u];(!l||Y(c)<Y(l))&&(l=c)}};return u(s),r===t&&s.length&&u([]),l},i=(e,t)=>{let n=t?bn:xn,i=n.get(e);return i===void 0&&(i=r(e,t),n.set(e,i)),i};return r(t,!n.noText)}function En(e,t,n){let r=[];for(let e of[`data-testid`,`data-test-id`,`data-test`])e!==n.testIdAttributeName&&t.getAttribute(e)&&r.push({engine:`css`,selector:`[${e}=${N(t.getAttribute(e))}]`,score:2});if(!n.noCSSId){let e=t.getAttribute(`id`);e&&!Nn(e)&&r.push({engine:`css`,selector:On(e),score:500})}if(r.push({engine:`css`,selector:M(t.nodeName.toLowerCase()),score:530}),t.nodeName===`IFRAME`){for(let e of[`name`,`title`])t.getAttribute(e)&&r.push({engine:`css`,selector:`${M(t.nodeName.toLowerCase())}[${e}=${N(t.getAttribute(e))}]`,score:10});return t.getAttribute(n.testIdAttributeName)&&r.push({engine:`css`,selector:`[${n.testIdAttributeName}=${N(t.getAttribute(n.testIdAttributeName))}]`,score:1}),An([r]),r}if(t.getAttribute(n.testIdAttributeName)&&r.push({engine:`internal:testid`,selector:`[${n.testIdAttributeName}=${I(t.getAttribute(n.testIdAttributeName),!0)}]`,score:1}),t.nodeName===`INPUT`||t.nodeName===`TEXTAREA`){let e=t;if(e.placeholder){r.push({engine:`internal:attr`,selector:`[placeholder=${I(e.placeholder,!0)}]`,score:105});for(let t of X(e.placeholder))r.push({engine:`internal:attr`,selector:`[placeholder=${I(t.text,!1)}]`,score:100-t.scoreBouns})}}let i=cn(e._evaluator._cacheText,t);for(let e of i){let t=e.normalized;r.push({engine:`internal:label`,selector:F(t,!0),score:125});for(let e of X(t))r.push({engine:`internal:label`,selector:F(e.text,!1),score:120-e.scoreBouns})}let a=B(t);return a&&![`none`,`presentation`].includes(a)&&r.push({engine:`internal:role`,selector:a,score:510}),t.getAttribute(`name`)&&[`BUTTON`,`FORM`,`FIELDSET`,`FRAME`,`IFRAME`,`INPUT`,`KEYGEN`,`OBJECT`,`OUTPUT`,`SELECT`,`TEXTAREA`,`MAP`,`META`,`PARAM`].includes(t.nodeName)&&r.push({engine:`css`,selector:`${M(t.nodeName.toLowerCase())}[name=${N(t.getAttribute(`name`))}]`,score:520}),[`INPUT`,`TEXTAREA`].includes(t.nodeName)&&t.getAttribute(`type`)!==`hidden`&&t.getAttribute(`type`)&&r.push({engine:`css`,selector:`${M(t.nodeName.toLowerCase())}[type=${N(t.getAttribute(`type`))}]`,score:520}),[`INPUT`,`TEXTAREA`,`SELECT`].includes(t.nodeName)&&t.getAttribute(`type`)!==`hidden`&&r.push({engine:`css`,selector:M(t.nodeName.toLowerCase()),score:521}),An([r]),r}function Dn(e,t,n){if(t.nodeName===`SELECT`)return[];let r=[],i=t.getAttribute(`title`);if(i){r.push([{engine:`internal:attr`,selector:`[title=${I(i,!0)}]`,score:205}]);for(let e of X(i))r.push([{engine:`internal:attr`,selector:`[title=${I(e.text,!1)}]`,score:200-e.scoreBouns}])}let a=t.getAttribute(`alt`);if(a&&[`APPLET`,`AREA`,`IMG`,`INPUT`].includes(t.nodeName)){r.push([{engine:`internal:attr`,selector:`[alt=${I(a,!0)}]`,score:165}]);for(let e of X(a))r.push([{engine:`internal:attr`,selector:`[alt=${I(e.text,!1)}]`,score:160-e.scoreBouns}])}let o=G(e._evaluator._cacheText,t).normalized;if(o){let e=X(o);if(n){o.length<=80&&r.push([{engine:`internal:text`,selector:F(o,!0),score:185}]);for(let t of e)r.push([{engine:`internal:text`,selector:F(t.text,!1),score:180-t.scoreBouns}])}let i={engine:`css`,selector:M(t.nodeName.toLowerCase()),score:530};for(let t of e)r.push([i,{engine:`internal:has-text`,selector:F(t.text,!1),score:180-t.scoreBouns}]);if(o.length<=80){let e=RegExp(`^${qe(o)}$`);r.push([i,{engine:`internal:has-text`,selector:F(e,!1),score:250}])}}let s=B(t);if(s&&![`none`,`presentation`].includes(s)){let e=wt(t,!1);if(e){r.push([{engine:`internal:role`,selector:`${s}[name=${I(e,!0)}]`,score:145}]);for(let t of X(e))r.push([{engine:`internal:role`,selector:`${s}[name=${I(t.text,!1)}]`,score:140-t.scoreBouns}])}}return An(r),r}function On(e){return/^[a-z][\w\-]+$/i.test(e)?`#${e}`:`[id="${M(e)}"]`}function kn(e,t,n){let r=t.ownerDocument,i=[];function a(n){let a=i.slice();n&&a.unshift(n);let o=a.join(` > `),s=e.parseSelector(o);return e.querySelector(s,r,!1)===t?o:void 0}function o(n){let i={engine:`css`,selector:n,score:1e7},a=e.parseSelector(n),o=e.querySelectorAll(a,r);return o.length===1?[i]:[i,{engine:`nth`,selector:String(o.indexOf(t)),score:Sn}]}for(let e=t;e&&e!==r;e=L(e)){let t=e.nodeName.toLowerCase(),r=``;if(e.id&&!n.noCSSId){let t=On(e.id),n=a(t);if(n)return o(n);r=t}let s=e.parentNode,c=[...e.classList];for(let e=0;e<c.length;++e){let t=`.${M(c.slice(0,e+1).join(`.`))}`,n=a(t);if(n)return o(n);!r&&s&&s.querySelectorAll(t).length===1&&(r=t)}if(s){let n=[...s.children],i=n.filter(e=>e.nodeName.toLowerCase()===t).indexOf(e)===0?M(t):`${M(t)}:nth-child(${1+n.indexOf(e)})`,c=a(i);if(c)return o(c);r||=i}else r||=M(t);i.unshift(r)}return o(a())}function An(e){for(let t of e)for(let e of t)e.score>50&&e.score<300&&(e.score+=Math.min(10,e.selector.length/10|0))}function jn(e){let t=[],n=``;for(let{engine:r,selector:i}of e)t.length&&(n!==`css`||r!==`css`||i.startsWith(`:nth-match(`))&&t.push(`>>`),n=r,r===`css`?t.push(i):t.push(`${r}=${i}`);return t.join(` `)}function Y(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].score*(e.length-n);return t}function Mn(e,t,n,r,i){let a=r.map(e=>({tokens:e,score:Y(e)}));a.sort((e,t)=>e.score-t.score);let o=null;for(let{tokens:r}of a){let a=e.parseSelector(jn(r)),s=e.querySelectorAll(a,t);if(s[0]===n&&s.length===1)return r;let c=s.indexOf(n);if(!i||o||c===-1||s.length>5)continue;let l={engine:`nth`,selector:String(c),score:Sn};o=[...r,l]}return o}function Nn(e){let t,n=0;for(let r=0;r<e.length;++r){let i=e[r],a;if(!(i===`-`||i===`_`)){if(a=i>=`a`&&i<=`z`?`lower`:i>=`A`&&i<=`Z`?`upper`:i>=`0`&&i<=`9`?`digit`:`other`,a===`lower`&&t===`upper`){t=a;continue}t&&t!==a&&++n,t=a}}return n>=e.length/4}function Pn(e,t){if(e.length<=t)return e;e=e.substring(0,t);let n=e.match(/^(.*)\b(.+)$/);return n?n[1].trimEnd():``}function X(e){let t=[];{let n=e.match(/^([\d.,]+)[^.,\w]/),r=n?n[1].length:0;if(r){let n=Pn(e.substring(r).trimStart(),80);t.push({text:n,scoreBouns:n.length<=30?2:1})}}{let n=e.match(/[^.,\w]([\d.,]+)$/),r=n?n[1].length:0;if(r){let n=Pn(e.substring(0,e.length-r).trimEnd(),80);t.push({text:n,scoreBouns:n.length<=30?2:1})}}return e.length<=30?t.push({text:e,scoreBouns:0}):(t.push({text:Pn(e,80),scoreBouns:0}),t.push({text:Pn(e,30),scoreBouns:1})),t=t.filter(e=>e.text),t.length||t.push({text:e.substring(0,80),scoreBouns:0}),t}function Fn(e,t,n){let r=e.left-t.right;if(!(r<0||n!==void 0&&r>n))return r+Math.max(t.bottom-e.bottom,0)+Math.max(e.top-t.top,0)}function In(e,t,n){let r=t.left-e.right;if(!(r<0||n!==void 0&&r>n))return r+Math.max(t.bottom-e.bottom,0)+Math.max(e.top-t.top,0)}function Ln(e,t,n){let r=t.top-e.bottom;if(!(r<0||n!==void 0&&r>n))return r+Math.max(e.left-t.left,0)+Math.max(t.right-e.right,0)}function Rn(e,t,n){let r=e.top-t.bottom;if(!(r<0||n!==void 0&&r>n))return r+Math.max(e.left-t.left,0)+Math.max(t.right-e.right,0)}function zn(e,t,n){let r=n===void 0?50:n,i=0;return e.left-t.right>=0&&(i+=e.left-t.right),t.left-e.right>=0&&(i+=t.left-e.right),t.top-e.bottom>=0&&(i+=t.top-e.bottom),e.top-t.bottom>=0&&(i+=e.top-t.bottom),i>r?void 0:i}const Bn=[`left-of`,`right-of`,`above`,`below`,`near`];function Vn(e,t,n,r){let i=t.getBoundingClientRect(),a={"left-of":In,"right-of":Fn,above:Ln,below:Rn,near:zn}[e],o;for(let e of n){if(e===t)continue;let n=a(i,e.getBoundingClientRect(),r);n!==void 0&&(o===void 0||n<o)&&(o=n)}return o}var Hn=class{constructor(e){c(this,`_engines`,new Map),c(this,`_cacheQueryCSS`,new Map),c(this,`_cacheMatches`,new Map),c(this,`_cacheQuery`,new Map),c(this,`_cacheMatchesSimple`,new Map),c(this,`_cacheMatchesParents`,new Map),c(this,`_cacheCallMatches`,new Map),c(this,`_cacheCallQuery`,new Map),c(this,`_cacheQuerySimple`,new Map),c(this,`_cacheText`,new Map),c(this,`_scoreMap`,void 0),c(this,`_retainCacheCounter`,0);for(let[t,n]of e)this._engines.set(t,n);this._engines.set(`not`,Kn),this._engines.set(`is`,Un),this._engines.set(`where`,Un),this._engines.set(`has`,Wn),this._engines.set(`scope`,Gn),this._engines.set(`light`,qn),this._engines.set(`visible`,Jn),this._engines.set(`text`,Yn),this._engines.set(`text-is`,Xn),this._engines.set(`text-matches`,Zn),this._engines.set(`has-text`,Qn),this._engines.set(`right-of`,$n(`right-of`)),this._engines.set(`left-of`,$n(`left-of`)),this._engines.set(`above`,$n(`above`)),this._engines.set(`below`,$n(`below`)),this._engines.set(`near`,$n(`near`)),this._engines.set(`nth-match`,er);let t=[...this._engines.keys()];t.sort();let n=[...O];if(n.sort(),t.join(`|`)!==n.join(`|`))throw Error(`Please keep customCSSNames in sync with evaluator engines: ${t.join(`|`)} vs ${n.join(`|`)}`)}begin(){++this._retainCacheCounter}end(){--this._retainCacheCounter,this._retainCacheCounter||(this._cacheQueryCSS.clear(),this._cacheMatches.clear(),this._cacheQuery.clear(),this._cacheMatchesSimple.clear(),this._cacheMatchesParents.clear(),this._cacheCallMatches.clear(),this._cacheCallQuery.clear(),this._cacheQuerySimple.clear(),this._cacheText.clear())}_cached(e,t,n,r){e.has(t)||e.set(t,[]);let i=e.get(t),a=i.find(e=>n.every((t,n)=>e.rest[n]===t));if(a)return a.result;let o=r();return i.push({rest:n,result:o}),o}_checkSelector(e){if(!(typeof e==`object`&&e&&(Array.isArray(e)||`simples`in e&&e.simples.length)))throw Error(`Malformed selector "${e}"`);return e}matches(e,t,n){let r=this._checkSelector(t);this.begin();try{return this._cached(this._cacheMatches,e,[r,n.scope,n.pierceShadow,n.originalScope],()=>Array.isArray(r)?this._matchesEngine(Un,e,r,n):(this._hasScopeClause(r)&&(n=this._expandContextForScopeMatching(n)),this._matchesSimple(e,r.simples[r.simples.length-1].selector,n)?this._matchesParents(e,r,r.simples.length-2,n):!1))}finally{this.end()}}query(e,t){let n=this._checkSelector(t);this.begin();try{return this._cached(this._cacheQuery,n,[e.scope,e.pierceShadow,e.originalScope],()=>{if(Array.isArray(n))return this._queryEngine(Un,e,n);this._hasScopeClause(n)&&(e=this._expandContextForScopeMatching(e));let t=this._scoreMap;this._scoreMap=new Map;let r=this._querySimple(e,n.simples[n.simples.length-1].selector);return r=r.filter(t=>this._matchesParents(t,n,n.simples.length-2,e)),this._scoreMap.size&&r.sort((e,t)=>{let n=this._scoreMap.get(e),r=this._scoreMap.get(t);return n===r?0:n===void 0?1:r===void 0?-1:n-r}),this._scoreMap=t,r})}finally{this.end()}}_markScore(e,t){this._scoreMap&&this._scoreMap.set(e,t)}_hasScopeClause(e){return e.simples.some(e=>e.selector.functions.some(e=>e.name===`scope`))}_expandContextForScopeMatching(e){if(e.scope.nodeType!==1)return e;let t=L(e.scope);return t?{...e,scope:t,originalScope:e.originalScope||e.scope}:e}_matchesSimple(e,t,n){return this._cached(this._cacheMatchesSimple,e,[t,n.scope,n.pierceShadow,n.originalScope],()=>{if(e===n.scope||t.css&&!this._matchesCSS(e,t.css))return!1;for(let r of t.functions)if(!this._matchesEngine(this._getEngine(r.name),e,r.args,n))return!1;return!0})}_querySimple(e,t){return t.functions.length?this._cached(this._cacheQuerySimple,t,[e.scope,e.pierceShadow,e.originalScope],()=>{let n=t.css,r=t.functions;n===`*`&&r.length&&(n=void 0);let i,a=-1;n===void 0?(a=r.findIndex(e=>this._getEngine(e.name).query!==void 0),a===-1&&(a=0),i=this._queryEngine(this._getEngine(r[a].name),e,r[a].args)):i=this._queryCSS(e,n);for(let t=0;t<r.length;t++){if(t===a)continue;let n=this._getEngine(r[t].name);n.matches!==void 0&&(i=i.filter(i=>this._matchesEngine(n,i,r[t].args,e)))}for(let t=0;t<r.length;t++){if(t===a)continue;let n=this._getEngine(r[t].name);n.matches===void 0&&(i=i.filter(i=>this._matchesEngine(n,i,r[t].args,e)))}return i}):this._queryCSS(e,t.css||`*`)}_matchesParents(e,t,n,r){return n<0?!0:this._cached(this._cacheMatchesParents,e,[t,n,r.scope,r.pierceShadow,r.originalScope],()=>{let{selector:i,combinator:a}=t.simples[n];if(a===`>`){let a=tr(e,r);return!a||!this._matchesSimple(a,i,r)?!1:this._matchesParents(a,t,n-1,r)}if(a===`+`){let a=nr(e,r);return!a||!this._matchesSimple(a,i,r)?!1:this._matchesParents(a,t,n-1,r)}if(a===``){let a=tr(e,r);for(;a;){if(this._matchesSimple(a,i,r)){if(this._matchesParents(a,t,n-1,r))return!0;if(t.simples[n-1].combinator===``)break}a=tr(a,r)}return!1}if(a===`~`){let a=nr(e,r);for(;a;){if(this._matchesSimple(a,i,r)){if(this._matchesParents(a,t,n-1,r))return!0;if(t.simples[n-1].combinator===`~`)break}a=nr(a,r)}return!1}if(a===`>=`){let a=e;for(;a;){if(this._matchesSimple(a,i,r)){if(this._matchesParents(a,t,n-1,r))return!0;if(t.simples[n-1].combinator===``)break}a=tr(a,r)}return!1}throw Error(`Unsupported combinator "${a}"`)})}_matchesEngine(e,t,n,r){if(e.matches)return this._callMatches(e,t,n,r);if(e.query)return this._callQuery(e,n,r).includes(t);throw Error(`Selector engine should implement "matches" or "query"`)}_queryEngine(e,t,n){if(e.query)return this._callQuery(e,n,t);if(e.matches)return this._queryCSS(t,`*`).filter(r=>this._callMatches(e,r,n,t));throw Error(`Selector engine should implement "matches" or "query"`)}_callMatches(e,t,n,r){return this._cached(this._cacheCallMatches,t,[e,r.scope,r.pierceShadow,r.originalScope,...n],()=>e.matches(t,n,r,this))}_callQuery(e,t,n){return this._cached(this._cacheCallQuery,e,[n.scope,n.pierceShadow,n.originalScope,...t],()=>e.query(n,t,this))}_matchesCSS(e,t){return e.matches(t)}_queryCSS(e,t){return this._cached(this._cacheQueryCSS,t,[e.scope,e.pierceShadow,e.originalScope],()=>{let n=[];function r(i){if(n=n.concat([...i.querySelectorAll(t)]),e.pierceShadow){i.shadowRoot&&r(i.shadowRoot);for(let e of i.querySelectorAll(`*`))e.shadowRoot&&r(e.shadowRoot)}}return r(e.scope),n})}_getEngine(e){let t=this._engines.get(e);if(!t)throw Error(`Unknown selector engine "${e}"`);return t}};const Un={matches(e,t,n,r){if(t.length===0)throw Error(`"is" engine expects non-empty selector list`);return t.some(t=>r.matches(e,t,n))},query(e,t,n){if(t.length===0)throw Error(`"is" engine expects non-empty selector list`);let r=[];for(let i of t)r=r.concat(n.query(e,i));return t.length===1?r:rr(r)}},Wn={matches(e,t,n,r){if(t.length===0)throw Error(`"has" engine expects non-empty selector list`);return r.query({...n,scope:e},t).length>0}},Gn={matches(e,t,n,r){if(t.length!==0)throw Error(`"scope" engine expects no arguments`);let i=n.originalScope||n.scope;return i.nodeType===9?e===i.documentElement:e===i},query(e,t,n){if(t.length!==0)throw Error(`"scope" engine expects no arguments`);let r=e.originalScope||e.scope;if(r.nodeType===9){let e=r.documentElement;return e?[e]:[]}return r.nodeType===1?[r]:[]}},Kn={matches(e,t,n,r){if(t.length===0)throw Error(`"not" engine expects non-empty selector list`);return!r.matches(e,t,n)}},qn={query(e,t,n){return n.query({...e,pierceShadow:!1},t)},matches(e,t,n,r){return r.matches(e,t,{...n,pierceShadow:!1})}},Jn={matches(e,t,n,r){if(t.length)throw Error(`"visible" engine expects no arguments`);return Qe(e)}},Yn={matches(e,t,n,r){if(t.length!==1||typeof t[0]!=`string`)throw Error(`"text" engine expects a single string`);let i=P(t[0]).toLowerCase();return sn(r._cacheText,e,e=>e.normalized.toLowerCase().includes(i))===`self`}},Xn={matches(e,t,n,r){if(t.length!==1||typeof t[0]!=`string`)throw Error(`"text-is" engine expects a single string`);let i=P(t[0]);return sn(r._cacheText,e,e=>!i&&!e.immediate.length?!0:e.immediate.some(e=>P(e)===i))!==`none`}},Zn={matches(e,t,n,r){if(t.length===0||typeof t[0]!=`string`||t.length>2||t.length===2&&typeof t[1]!=`string`)throw Error(`"text-matches" engine expects a regexp body and optional regexp flags`);let i=new RegExp(t[0],t.length===2?t[1]:void 0);return sn(r._cacheText,e,e=>i.test(e.full))===`self`}},Qn={matches(e,t,n,r){if(t.length!==1||typeof t[0]!=`string`)throw Error(`"has-text" engine expects a single string`);if(on(e))return!1;let i=P(t[0]).toLowerCase();return(e=>e.normalized.toLowerCase().includes(i))(G(r._cacheText,e))}};function $n(e){return{matches(t,n,r,i){let a=n.length&&typeof n[n.length-1]==`number`?n[n.length-1]:void 0,o=a===void 0?n:n.slice(0,n.length-1);if(n.length<1+(a===void 0?0:1))throw Error(`"${e}" engine expects a selector list and optional maximum distance in pixels`);let s=Vn(e,t,i.query(r,o),a);return s===void 0?!1:(i._markScore(t,s),!0)}}}const er={query(e,t,n){let r=t[t.length-1];if(t.length<2)throw Error(`"nth-match" engine expects non-empty selector list and an index argument`);if(typeof r!=`number`||r<1)throw Error(`"nth-match" engine expects a one-based index as the last argument`);let i=Un.query(e,t.slice(0,t.length-1),n);return r--,r<i.length?[i[r]]:[]}};function tr(e,t){if(e!==t.scope)return t.pierceShadow?L(e):e.parentElement||void 0}function nr(e,t){if(e!==t.scope)return e.previousElementSibling||void 0}function rr(e){let t=new Map,n=[],r=[];function i(e){let r=t.get(e);if(r)return r;let a=L(e);return a?i(a).children.push(e):n.push(e),r={children:[],taken:!1},t.set(e,r),r}for(let t of e)i(t).taken=!0;function a(e){let n=t.get(e);if(n.taken&&r.push(e),n.children.length>1){let t=new Set(n.children);n.children=[];let r=e.firstElementChild;for(;r&&n.children.length<t.size;)t.has(r)&&n.children.push(r),r=r.nextElementSibling;for(r=e.shadowRoot?e.shadowRoot.firstElementChild:null;r&&n.children.length<t.size;)t.has(r)&&n.children.push(r),r=r.nextElementSibling}n.children.forEach(a)}return n.forEach(a),r}function ir(e,t,n){return`internal:attr=[${e}=${I(t,n?.exact??Z.options.exact)}]`}function ar(e,t){return`internal:testid=[${e}=${I(t,!0)}]`}function or(e,t){return`internal:label=${F(e,t?.exact??Z.options.exact)}`}function sr(e,t){return ir(`alt`,e,t)}function cr(e,t){return ir(`title`,e,t)}function lr(e,t){return ir(`placeholder`,e,t)}function ur(e,t){return`internal:text=${F(e,t?.exact??Z.options.exact)}`}function dr(e,t={}){let n=[];return t.checked!==void 0&&n.push([`checked`,String(t.checked)]),t.disabled!==void 0&&n.push([`disabled`,String(t.disabled)]),t.selected!==void 0&&n.push([`selected`,String(t.selected)]),t.expanded!==void 0&&n.push([`expanded`,String(t.expanded)]),t.includeHidden!==void 0&&n.push([`include-hidden`,String(t.includeHidden)]),t.level!==void 0&&n.push([`level`,String(t.level)]),t.name!==void 0&&n.push([`name`,I(t.name,t.exact??Z.options.exact)]),t.pressed!==void 0&&n.push([`pressed`,String(t.pressed)]),`internal:role=${e}${n.map(([e,t])=>`[${e}=${t}]`).join(``)}`}var Z=class e{static create(t){return Object.assign(e.options,t),e.singleton||=new e}constructor(){c(this,`_engines`,void 0),c(this,`_evaluator`,void 0),this._evaluator=new Hn(new Map),this._engines=new Map,this._engines.set(`xpath`,_r),this._engines.set(`xpath:light`,_r),this._engines.set(`role`,pn(!1)),this._engines.set(`text`,this._createTextEngine(!0,!1)),this._engines.set(`text:light`,this._createTextEngine(!1,!1)),this._engines.set(`id`,this._createAttributeEngine(`id`,!0)),this._engines.set(`id:light`,this._createAttributeEngine(`id`,!1)),this._engines.set(`data-testid`,this._createAttributeEngine(`data-testid`,!0)),this._engines.set(`data-testid:light`,this._createAttributeEngine(`data-testid`,!1)),this._engines.set(`data-test-id`,this._createAttributeEngine(`data-test-id`,!0)),this._engines.set(`data-test-id:light`,this._createAttributeEngine(`data-test-id`,!1)),this._engines.set(`data-test`,this._createAttributeEngine(`data-test`,!0)),this._engines.set(`data-test:light`,this._createAttributeEngine(`data-test`,!1)),this._engines.set(`css`,this._createCSSEngine()),this._engines.set(`nth`,{queryAll:()=>[]}),this._engines.set(`visible`,this._createVisibleEngine()),this._engines.set(`internal:control`,this._createControlEngine()),this._engines.set(`internal:has`,this._createHasEngine()),this._engines.set(`internal:has-not`,this._createHasNotEngine()),this._engines.set(`internal:and`,{queryAll:()=>[]}),this._engines.set(`internal:or`,{queryAll:()=>[]}),this._engines.set(`internal:chain`,this._createInternalChainEngine()),this._engines.set(`internal:label`,this._createInternalLabelEngine()),this._engines.set(`internal:text`,this._createTextEngine(!0,!0)),this._engines.set(`internal:has-text`,this._createInternalHasTextEngine()),this._engines.set(`internal:has-not-text`,this._createInternalHasNotTextEngine()),this._engines.set(`internal:attr`,this._createNamedAttributeEngine()),this._engines.set(`internal:testid`,this._createNamedAttributeEngine()),this._engines.set(`internal:role`,pn(!0))}queryLocatorSelector(e,t=document.documentElement,n=!0){return this.querySelector(this.parseSelector(e),t,n)}queryLocatorSelectorAll(e,t=document.documentElement){return this.querySelectorAll(this.parseSelector(e),t)}querySelector(e,t,n=!0){let r=this.querySelectorAll(e,t);if(n&&r.length>1)throw this.strictModeViolationError(e,r);return r[0]||null}queryAllByRole(e,t,n=document.documentElement){let r=this.parseSelector(dr(e,t));return this.querySelectorAll(r,n)}queryAllByLabelText(e,t,n=document.documentElement){let r=this.parseSelector(or(e,t));return this.querySelectorAll(r,n)}queryAllByTestId(t,n=document.documentElement){let r=this.parseSelector(ar(e.options.testIdAttribute,t));return this.querySelectorAll(r,n)}queryAllByText(e,t,n=document.documentElement){let r=this.parseSelector(ur(e,t));return this.querySelectorAll(r,n)}queryAllByTitle(e,t,n=document.documentElement){let r=this.parseSelector(cr(e,t));return this.querySelectorAll(r,n)}queryAllByPlaceholder(e,t,n=document.documentElement){let r=this.parseSelector(lr(e,t));return this.querySelectorAll(r,n)}queryAllByAltText(e,t,n=document.documentElement){let r=this.parseSelector(sr(e,t));return this.querySelectorAll(r,n)}queryByRole(e,t,n=document.documentElement){let r=this.parseSelector(dr(e,t));return this.querySelector(r,n,!1)}queryByLabelText(e,t,n=document.documentElement){let r=this.parseSelector(or(e,t));return this.querySelector(r,n,!1)}queryByTestId(t,n=document.documentElement){let r=this.parseSelector(ar(e.options.testIdAttribute,t));return this.querySelector(r,n,!1)}queryByText(e,t,n=document.documentElement){let r=this.parseSelector(ur(e,t));return this.querySelector(r,n,!1)}queryByTitle(e,t,n=document.documentElement){let r=this.parseSelector(cr(e,t));return this.querySelector(r,n,!1)}queryByPlaceholder(e,t,n=document.documentElement){let r=this.parseSelector(lr(e,t));return this.querySelector(r,n,!1)}queryByAltText(e,t,n=document.documentElement){let r=this.parseSelector(sr(e,t));return this.querySelector(r,n,!1)}strictModeViolationError(e,t){let n=t.slice(0,10).map(e=>({preview:this.previewNode(e),selector:this.generateSelectorSimple(e)})),r=n.map((e,t)=>`\n ${t+1}) ${e.preview} aka ${mn(`javascript`,e.selector)}`);return n.length<t.length&&r.push(`
4
4
  ...`),this.createStacklessError(`strict mode violation: ${mn(`javascript`,A(e))} resolved to ${t.length} elements:${r.join(``)}\n`)}generateSelectorSimple(t,n){return Cn(this,t,{...n,testIdAttributeName:e.options.testIdAttribute})}parseSelector(e){let t=k(e);return ze(t,t=>{if(!this._engines.has(t.name))throw this.createStacklessError(`Unknown engine "${t.name}" while parsing selector ${e}`)}),t}previewNode(e){if(e.nodeType===Node.TEXT_NODE)return fr(`#text=${e.nodeValue||``}`);if(e.nodeType!==Node.ELEMENT_NODE)return fr(`<${e.nodeName.toLowerCase()} />`);let t=e,n=[];for(let e=0;e<t.attributes.length;e++){let{name:r,value:i}=t.attributes[e];r!==`style`&&(!i&&pr.has(r)?n.push(` ${r}`):n.push(` ${r}="${i}"`))}n.sort((e,t)=>e.length-t.length);let r=Ke(n.join(``),500);if(mr.has(t.nodeName))return fr(`<${t.nodeName.toLowerCase()}${r}/>`);let i=t.childNodes,a=!1;if(i.length<=5){a=!0;for(let e=0;e<i.length;e++)a&&=i[e].nodeType===Node.TEXT_NODE}let o=a?t.textContent||``:i.length?`…`:``;return fr(`<${t.nodeName.toLowerCase()}${r}>${Ke(o,50)}</${t.nodeName.toLowerCase()}>`)}querySelectorAll(e,t){if(e.capture!==void 0){if(e.parts.some(e=>e.name===`nth`))throw this.createStacklessError(`Can't query n-th element in a request with the capture.`);let n={parts:e.parts.slice(0,e.capture+1)};if(e.capture<e.parts.length-1){let t={parts:e.parts.slice(e.capture+1)},r={name:`internal:has`,body:{parsed:t},source:A(t)};n.parts.push(r)}return this.querySelectorAll(n,t)}if(!t.querySelectorAll)throw this.createStacklessError(`Node is not queryable.`);if(e.capture!==void 0)throw this.createStacklessError(`Internal error: there should not be a capture in the selector.`);if(t.nodeType===11&&e.parts.length===1&&e.parts[0].name===`css`&&e.parts[0].source===`:scope`)return[t];this._evaluator.begin();try{let n=new Set([t]);for(let r of e.parts)if(r.name===`nth`)n=this._queryNth(n,r);else if(r.name===`internal:and`){let e=this.querySelectorAll(r.body.parsed,t);n=new Set(e.filter(e=>n.has(e)))}else if(r.name===`internal:or`){let e=this.querySelectorAll(r.body.parsed,t);n=new Set(rr(new Set([...n,...e])))}else if(Bn.includes(r.name))n=this._queryLayoutSelector(n,r,t);else{let e=new Set;for(let t of n){let n=this._queryEngineAll(r,t);for(let t of n)e.add(t)}n=e}return[...n]}finally{this._evaluator.end()}}_queryEngineAll(e,t){let n=this._engines.get(e.name).queryAll(t,e.body);for(let e of n)if(!(`nodeName`in e))throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(e)}`);return n}_queryNth(e,t){let n=[...e],r=+t.body;return r===-1&&(r=n.length-1),new Set(n.slice(r,r+1))}_queryLayoutSelector(e,t,n){let r=t.name,i=t.body,a=[],o=this.querySelectorAll(i.parsed,n);for(let t of e){let e=Vn(r,t,o,i.distance);e!==void 0&&a.push({element:t,score:e})}return a.sort((e,t)=>e.score-t.score),new Set(a.map(e=>e.element))}createStacklessError(t){if(e.options.browser===`firefox`){let e=Error(`Error: ${t}`);return e.stack=``,e}let n=Error(t);return delete n.stack,n}_createTextEngine(e,t){return{queryAll:(n,r)=>{let{matcher:i,kind:a}=gr(r,t),o=[],s=null,c=e=>{if(a===`lax`&&s&&s.contains(e))return!1;let n=sn(this._evaluator._cacheText,e,i);n===`none`&&(s=e),(n===`self`||n===`selfAndChildren`&&a===`strict`&&!t)&&o.push(e)};n.nodeType===Node.ELEMENT_NODE&&c(n);let l=this._evaluator._queryCSS({scope:n,pierceShadow:e},`*`);for(let e of l)c(e);return o}}}_createAttributeEngine(e,t){let n=t=>[{simples:[{selector:{css:`[${e}=${JSON.stringify(t)}]`,functions:[]},combinator:``}]}];return{queryAll:(e,r)=>this._evaluator.query({scope:e,pierceShadow:t},n(r))}}_createCSSEngine(){return{queryAll:(e,t)=>this._evaluator.query({scope:e,pierceShadow:!0},t)}}_createNamedAttributeEngine(){return{queryAll:(e,t)=>{let n=j(t);if(n.name||n.attributes.length!==1)throw Error(`Malformed attribute selector: ${t}`);let{name:r,value:i,caseSensitive:a}=n.attributes[0],o=a?null:i.toLowerCase(),s;return s=i instanceof RegExp?e=>!!e.match(i):a?e=>e===i:e=>e.toLowerCase().includes(o),this._evaluator._queryCSS({scope:e,pierceShadow:!0},`[${r}]`).filter(e=>s(e.getAttribute(r)))}}}_createVisibleEngine(){return{queryAll:(e,t)=>e.nodeType===1&&Qe(e)===!!t?[e]:[]}}_createControlEngine(){return{queryAll:(e,t)=>{if(t===`enter-frame`&&e instanceof HTMLIFrameElement){let t=e.contentDocument?.documentElement;return t?[t]:[]}return[]}}}_createHasEngine(){return{queryAll:(e,t)=>e.nodeType===1&&this.querySelector(t.parsed,e,!1)?[e]:[]}}_createHasNotEngine(){return{queryAll:(e,t)=>e.nodeType===1?this.querySelector(t.parsed,e,!1)?[]:[e]:[]}}_createInternalChainEngine(){return{queryAll:(e,t)=>this.querySelectorAll(t.parsed,e)}}_createInternalLabelEngine(){return{queryAll:(e,t)=>{let{matcher:n}=gr(t,!0);return this._evaluator._queryCSS({scope:e,pierceShadow:!0},`*`).filter(e=>cn(this._evaluator._cacheText,e).some(e=>n(e)))}}}_createInternalHasTextEngine(){return{queryAll:(e,t)=>{if(e.nodeType!==1)return[];let n=e,r=G(this._evaluator._cacheText,n),{matcher:i}=gr(t,!0);return i(r)?[n]:[]}}}_createInternalHasNotTextEngine(){return{queryAll:(e,t)=>{if(e.nodeType!==1)return[];let n=e,r=G(this._evaluator._cacheText,n),{matcher:i}=gr(t,!0);return i(r)?[]:[n]}}}};c(Z,`options`,{testIdAttribute:`data-testid`,browser:`chromium`,exact:!1}),c(Z,`singleton`,null);function fr(e){return e.replace(/\n/g,`↵`).replace(/\t/g,`⇆`)}const pr=new Set([`checked`,`selected`,`disabled`,`readonly`,`multiple`]),mr=new Set([`AREA`,`BASE`,`BR`,`COL`,`COMMAND`,`EMBED`,`HR`,`IMG`,`INPUT`,`KEYGEN`,`LINK`,`MENUITEM`,`META`,`PARAM`,`SOURCE`,`TRACK`,`WBR`]);function hr(e){if(e=e.substring(1,e.length-1),!e.includes(`\\`))return e;let t=[],n=0;for(;n<e.length;)e[n]===`\\`&&n+1<e.length&&n++,t.push(e[n++]);return t.join(``)}function gr(e,t){if(e[0]===`/`&&e.lastIndexOf(`/`)>0){let t=e.lastIndexOf(`/`),n=new RegExp(e.substring(1,t),e.substring(t+1));return{matcher:e=>n.test(e.full),kind:`regex`}}let n=t?JSON.parse.bind(JSON):hr,r=!1;return e.length>1&&e[0]===`"`&&e[e.length-1]===`"`?(e=n(e),r=!0):t&&e.length>1&&e[0]===`"`&&e[e.length-2]===`"`&&e[e.length-1]===`i`?(e=n(e.substring(0,e.length-1)),r=!1):t&&e.length>1&&e[0]===`"`&&e[e.length-2]===`"`&&e[e.length-1]===`s`?(e=n(e.substring(0,e.length-1)),r=!0):e.length>1&&e[0]===`'`&&e[e.length-1]===`'`&&(e=n(e),r=!0),e=P(e),r?t?{kind:`strict`,matcher:t=>t.normalized===e}:{matcher:t=>!e&&!t.immediate.length?!0:t.immediate.some(t=>P(t)===e),kind:`strict`}:(e=e.toLowerCase(),{kind:`lax`,matcher:t=>t.normalized.toLowerCase().includes(e)})}const _r={queryAll(e,t){t.startsWith(`/`)&&e.nodeType!==Node.DOCUMENT_NODE&&(t=`.${t}`);let n=[],r=e.ownerDocument||e;if(!r)return n;let i=r.evaluate(t,e,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE);for(let e=i.iterateNext();e;e=i.iterateNext())e.nodeType===Node.ELEMENT_NODE&&n.push(e);return n}};function vr(e){let t=yr().current;if(!t||t.type!==`test`)return e();let n=!1,r=Error(`STACK_TRACE_ERROR`);t.onFinished??=[],t.onFinished.push(()=>{if(!n){let e=Error(`The call was not awaited. This method is asynchronous and must be awaited; otherwise, the call will not start to avoid unhandled rejections.`);throw e.stack=r.stack?.replace(r.message,e.message),e}});let i;return{then(t,a){return n=!0,(i||=e(r)).then(t,a)},catch(t){return n=!0,(i||=e(r)).catch(t)},finally(t){return n=!0,(i||=e(r)).finally(t)},[Symbol.toStringTag]:`Promise`}}function Q(){return window.__vitest_browser_runner__}function yr(){let e=window.__vitest_worker__;if(!e)throw Error(`Worker state is not found. This is an issue with Vitest. Please, open an issue.`);return e}function br(e){if(!e||!(e instanceof Element))throw Error(`Expected DOM element to be an instance of Element, received ${typeof e}`);return Sr(e)}function xr(e){return e.split(``).map(e=>{let t=e.charCodeAt(0);return e===` `||e===`#`||e===`.`||e===`:`||e===`[`||e===`]`||e===`>`||e===`+`||e===`~`||e===`\\`?`\\${e}`:t>=65536?`\\${t.toString(16).toUpperCase().padStart(6,`0`)} `:t<32||t===127||t>=128?`\\${t.toString(16).toUpperCase().padStart(2,`0`)} `:e}).join(``)}function Sr(e){let t=[],n,r=!1;for(;n=Cr(e);){n.shadowRoot&&(r=!0);let i=e.tagName;if(e.id)t.push(`#${xr(e.id)}`);else if(!e.nextElementSibling&&!e.previousElementSibling)t.push(i.toLowerCase());else{let r=0,a=0,o=0;for(let t of n.children)r++,t.tagName===i&&a++,t===e&&(o=r);a>1?t.push(`${i.toLowerCase()}:nth-child(${o})`):t.push(i.toLowerCase())}e=n}return`${Q().provider===`webdriverio`&&r?`>>>`:``}${t.reverse().join(` > `)}`}function Cr(e){let t=e.parentNode;return t instanceof ShadowRoot?t.host:t}const wr=globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now;function Tr(e){if(e&&e.timeout!=null||yr().config.browser.providerOptions.actionTimeout!=null)return e;let t=Q().runner,n=t._currentTaskStartTime;if(!n)return e;let r=t._currentTaskTimeout;if(r===0||r==null||r===1/0)return e;e||={};let i=wr(),a=n+r,o=Math.floor(a-i);return o<=0||(e.timeout=o-100),e}function Er(){let e=window.parent.document.querySelector(`iframe[data-vitest]`)?.parentElement;if(!e)throw Error(`Cannot find Tester element. This is a bug in Vitest. Please, open a new issue with reproduction.`);let t=e.getAttribute(`data-scale`),n=Number(t);if(Number.isNaN(n))throw TypeError(`Cannot parse scale value from Tester element (${t}). This is a bug in Vitest. Please, open a new issue with reproduction.`);return n}function Dr(e){return e.unicode||e.unicodeSets?String(e):String(e).replace(/(^|[^\\])(\\\\)*(["'`])/g,`$1$2\\$3`).replace(/>>/g,`\\>\\>`)}function Or(e,t){return typeof e==`string`?`${JSON.stringify(e)}i`:Dr(e)}const kr=Q().provider,Ar=Symbol.for(`$$vitest:locator-resolved`);async function jr(e,t){if(!e)throw Error(`Expected element or locator to be defined.`);if(e instanceof Element)return br(e);if(Nr(e))return kr===`playwright`||Ar in e?e.selector:br(await e.findElement(t));throw Error(`Expected element or locator to be an instance of Element or Locator.`)}const Mr=Symbol.for(`$$vitest:locator`);function Nr(e){return!!e&&typeof e==`object`&&Mr in e}function Pr(e){let t;if(e.delta)t=e.delta;else switch(e.direction){case`up`:t={y:-100};break;case`down`:t={y:100};break;case`left`:t={x:-100};break;case`right`:t={x:100};break}return{delta:t,times:e.times}}r._asLocator=mn;const Fr=Date.now,Ir=[0,20,50,100,100,500];function Lr(e){let{setTimeout:t}=i();return new Promise(n=>t(n,e))}const $=Z.create({exact:e.config.browser.locators.exact,browser:(e=>{switch(e){case`edge`:case`chrome`:return`chromium`;case`safari`:return`webkit`;default:return e}})(e.config.browser.name),testIdAttribute:e.config.browser.locators.testIdAttribute}),Rr=Symbol.for(`$$vitest:locator`);class zr{_parsedSelector;_container;_pwSelector;_errorSource;constructor(){Object.defineProperty(this,Rr,{enumerable:!1,writable:!1,configurable:!1,value:Rr})}click(e){return this.triggerCommand(`__vitest_click`,this.selector,e)}dblClick(e){return this.triggerCommand(`__vitest_dblClick`,this.selector,e)}tripleClick(e){return this.triggerCommand(`__vitest_tripleClick`,this.selector,e)}wheel(e){return vr(async t=>{await Q().commands.triggerCommand(`__vitest_wheel`,[this.selector,Pr(e)],t);let n=Q().config.browser.name;if(n===`chromium`||n===`chrome`)return new Promise(e=>{requestAnimationFrame(()=>{e()})})})}clear(e){return this.triggerCommand(`__vitest_clear`,this.selector,e)}hover(e){return this.triggerCommand(`__vitest_hover`,this.selector,e)}unhover(e){return this.triggerCommand(`__vitest_hover`,`html > body`,e)}fill(e,t){return this.triggerCommand(`__vitest_fill`,this.selector,e,t)}upload(e,t){return vr(async n=>{let r=(Array.isArray(e)?e:[e]).map(async e=>{if(typeof e==`string`)return e;let t=await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(Error(`Failed to read file: ${e.name}`)),r.readAsDataURL(e)});return{name:e.name,mimeType:e.type,base64:t.slice(t.indexOf(`,`)+1)}});return Q().commands.triggerCommand(`__vitest_upload`,[this.selector,await Promise.all(r),t],n)})}dropTo(e,t={}){return this.triggerCommand(`__vitest_dragAndDrop`,this.selector,e.selector,t)}selectOptions(e,t){let n=(Array.isArray(e)?e:[e]).map(e=>typeof e==`string`?e:{element:Nr(e)?e.selector:$.generateSelectorSimple(e)});return this.triggerCommand(`__vitest_selectOptions`,this.selector,n,t)}screenshot(e){return t.screenshot({...e,element:this})}mark(e,t){let n=yr().current;return!n||!Q().activeTraceTaskIds.has(n.id)?Promise.resolve():vr(n=>Q().commands.triggerCommand(`__vitest_markTrace`,[{name:e,selector:this.selector,stack:t?.stack??n?.stack}],n))}getByRole(e,t){return this.locator(dr(e,t))}getByAltText(e,t){return this.locator(sr(e,t))}getByLabelText(e,t){return this.locator(or(e,t))}getByPlaceholder(e,t){return this.locator(lr(e,t))}getByTestId(t){return this.locator(ar(e.config.browser.locators.testIdAttribute,t))}getByText(e,t){return this.locator(ur(e,t))}getByTitle(e,t){return this.locator(cr(e,t))}filter(e){let t=[];if(e?.hasText&&t.push(`internal:has-text=${Or(e.hasText)}`),e?.hasNotText&&t.push(`internal:has-not-text=${Or(e.hasNotText)}`),e?.has){let n=e.has;t.push(`internal:has=${JSON.stringify(n._pwSelector||n.selector)}`)}if(e?.hasNot){let n=e.hasNot;t.push(`internal:has-not=${JSON.stringify(n._pwSelector||n.selector)}`)}if(!t.length)throw Error(`Locator.filter expects at least one filter. None provided.`);return this.locator(t.join(` >> `))}and(e){return this.locator(`internal:and=${JSON.stringify(e._pwSelector||e.selector)}`)}or(e){return this.locator(`internal:or=${JSON.stringify(e._pwSelector||e.selector)}`)}query(){let e=this._parsedSelector||=$.parseSelector(this._pwSelector||this.selector);return $.querySelector(e,document.documentElement,!0)}element(){let e=this.query();if(!e)throw n.getElementError(this._pwSelector||this.selector,this._container||document.body);return e}elements(){let e=this._parsedSelector||=$.parseSelector(this._pwSelector||this.selector);return $.querySelectorAll(e,document.documentElement)}get length(){return this.elements().length}all(){return this.elements().map(e=>this.elementLocator(e))}nth(e){return this.locator(`nth=${e}`)}first(){return this.nth(0)}last(){return this.nth(-1)}toString(){return this.selector}toJSON(){return this.selector}async findElement(e={}){let t=Tr(e),r=t?.timeout,i=t?.strict??!0,a=Fr(),o=0;for(;;){let e=this.elements();if(e.length===1)return e[0];if(e.length>1){if(i)throw Vr(this._pwSelector||this.selector,e);return e[0]}let t=Fr()-a;if(r!=null&&t>=r)throw n.getElementError(this._pwSelector||this.selector,this._container||document.body);let s=Ir[Math.min(o++,Ir.length-1)];await Lr(r==null?s:Math.min(s,r-t))}}triggerCommand(e,...t){return this._errorSource?Br({name:e,arguments:t,errorSource:this._errorSource}):vr(n=>Br({name:e,arguments:t,errorSource:n}))}}function Br(e){return Q().commands.triggerCommand(e.name,e.arguments,e.errorSource)}function Vr(e,t){let n=t.slice(0,10).map(e=>({preview:$.previewNode(e),selector:$.generateSelectorSimple(e)})),r=n.map((e,t)=>`\n ${t+1}) ${e.preview} aka ${mn(`javascript`,e.selector)}`);return n.length<t.length&&r.push(`
5
- ...`),Error(`strict mode violation: ${mn(`javascript`,e)} resolved to ${t.length} elements:${r.join(``)}\n`)}export{Br as A,zr as L,B as a,Ut as b,nn as c,Tt as d,rn as e,kt as f,Pt as g,wt as h,Qe as i,M as j,Nt as k,jr as l,Q as m,yr as n,br as o,Tr as p,vr as q,sr as r,or as s,lr as t,dr as u,ar as v,ur as w,cr as x,Er as y,$ as z};
5
+ ...`),Error(`strict mode violation: ${mn(`javascript`,e)} resolved to ${t.length} elements:${r.join(``)}\n`)}export{Tr as A,yr as B,br as C,vr as D,sr as E,or as F,lr as G,dr as H,ar as I,ur as J,cr as K,zr as L,Er as M,$ as N,Br as O,c as _,wt as a,nn as b,Pt as c,Ht as d,rn as e,Ut as f,B as g,Rt as h,V as i,zt as j,Nt as k,Bt as l,Vt as m,P as n,It as o,Lt as p,jt as q,Mt as r,R as s,bt as t,Qe as u,Tt as v,kt as w,M as x,jr as y,Q as z};
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import { PNG } from 'pngjs';
18
18
  import { diff } from '@blazediff/core';
19
19
  import { WebSocketServer } from 'ws';
20
20
 
21
- var version = "4.1.3";
21
+ var version = "4.1.5";
22
22
 
23
23
  const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
24
24
  function normalizeWindowsPath(input = "") {
@@ -7881,6 +7881,7 @@ const createBrowserServer = async (options) => {
7881
7881
  configFile: configPath,
7882
7882
  configLoader: project.vite.config.inlineConfig.configLoader,
7883
7883
  server: {
7884
+ ...project.options?.server,
7884
7885
  hmr: false,
7885
7886
  watch: null
7886
7887
  },
package/dist/locators.js CHANGED
@@ -1 +1 @@
1
- export{L as Locator,o as convertElementToCssSelector,q as ensureAwaited,r as getByAltTextSelector,s as getByLabelSelector,t as getByPlaceholderSelector,u as getByRoleSelector,v as getByTestIdSelector,w as getByTextSelector,x as getByTitleSelector,y as getIframeScale,p as processTimeoutOptions,z as selectorEngine,A as triggerCommandWithTrace}from"./index-C8KwPhQz.js";import"vitest/browser";import"vitest/internal/browser";
1
+ export{L as Locator,C as convertElementToCssSelector,D as ensureAwaited,E as getByAltTextSelector,F as getByLabelSelector,G as getByPlaceholderSelector,H as getByRoleSelector,I as getByTestIdSelector,J as getByTextSelector,K as getByTitleSelector,M as getIframeScale,A as processTimeoutOptions,N as selectorEngine,O as triggerCommandWithTrace}from"./index-D8jtZoIM.js";import"vitest/browser";import"vitest/internal/browser";
package/jest-dom.d.ts CHANGED
@@ -721,4 +721,66 @@ export interface TestingLibraryMatchers<E, R> {
721
721
  name?: string,
722
722
  options?: ScreenshotMatcherOptions<ComparatorName>,
723
723
  ): Promise<R>
724
+
725
+ /**
726
+ * @experimental
727
+ * @description
728
+ * Captures the accessibility tree of an element and compares it against a stored
729
+ * snapshot file. The snapshot uses a YAML-like format describing roles, names, and
730
+ * states of the accessibility tree.
731
+ *
732
+ * In Browser Mode, `expect.element()` automatically retries until the tree matches
733
+ * or the timeout is reached. On first run or with `--update`, the snapshot is
734
+ * written immediately.
735
+ *
736
+ * @example
737
+ * <nav aria-label="Main">
738
+ * <a href="/">Home</a>
739
+ * <a href="/about">About</a>
740
+ * </nav>
741
+ *
742
+ * await expect.element(page.getByRole('navigation')).toMatchAriaSnapshot()
743
+ *
744
+ * // Generates a snapshot entry like:
745
+ * // - navigation "Main":
746
+ * // - link "Home":
747
+ * // - /url: /
748
+ * // - link "About":
749
+ * // - /url: /about
750
+ *
751
+ * @see https://vitest.dev/guide/browser/aria-snapshots
752
+ * @see https://vitest.dev/api/expect#tomatchariasnapshot
753
+ */
754
+ toMatchAriaSnapshot: () => void
755
+ /**
756
+ * @experimental
757
+ * @description
758
+ * Captures the accessibility tree of an element and compares it against an inline
759
+ * snapshot stored directly in the test file. The snapshot uses a YAML-like format
760
+ * describing roles, names, and states of the accessibility tree.
761
+ *
762
+ * Supports partial matching (only listed nodes are checked) and regex patterns
763
+ * for flexible assertions. Hand-edited regex patterns are preserved on `--update`.
764
+ *
765
+ * In Browser Mode, `expect.element()` automatically retries until the tree matches
766
+ * or the timeout is reached.
767
+ *
768
+ * @example
769
+ * <form aria-label="Log In">
770
+ * <input aria-label="Email" />
771
+ * <input aria-label="Password" type="password" />
772
+ * <button>Submit</button>
773
+ * </form>
774
+ *
775
+ * await expect.element(page.getByRole('form')).toMatchAriaInlineSnapshot(`
776
+ * - form "Log In":
777
+ * - textbox "Email"
778
+ * - textbox "Password"
779
+ * - button "Submit"
780
+ * `)
781
+ *
782
+ * @see https://vitest.dev/guide/browser/aria-snapshots
783
+ * @see https://vitest.dev/api/expect#tomatchariaInlinesnapshot
784
+ */
785
+ toMatchAriaInlineSnapshot: (inlineSnapshot?: string) => void
724
786
  }