ferridriver 0.4.0

Browser automation in Rust with a Playwright-compatible API. Four pluggable backends: CDP pipe, CDP WebSocket, Playwright WebKit, Firefox BiDi.
Documentation
(function(){if(window.__fd)return;(()=>{function d6(Y,_){if(Y.role!==_.role||Y.name!==_.name)return!1;if(!z5(Y,_)||y0(Y)!==y0(_))return!1;let X=Object.keys(Y.props),Z=Object.keys(_.props);return X.length===Z.length&&X.every(($)=>Y.props[$]===_.props[$])}function y0(Y){return Y.box.cursor==="pointer"}function z5(Y,_){return Y.active===_.active&&Y.checked===_.checked&&Y.disabled===_.disabled&&Y.expanded===_.expanded&&Y.selected===_.selected&&Y.level===_.level&&Y.pressed===_.pressed}function c6(Y,_,X={}){let Z=new Y.LineCounter,$={keepSourceTokens:!0,lineCounter:Z,...X},J=Y.parseDocument(_,$),Q=[],K=(W)=>{return[Z.linePos(W[0]),Z.linePos(W[1])]},G=(W)=>{Q.push({message:W.message,range:[Z.linePos(W.pos[0]),Z.linePos(W.pos[1])]})},U=(W,L)=>{for(let M of L.items){if(M instanceof Y.Scalar&&typeof M.value==="string"){let V=J1.parse(M,$,Q);if(V)W.children=W.children||[],W.children.push(V);continue}if(M instanceof Y.YAMLMap){H(W,M);continue}Q.push({message:"Sequence items should be strings or maps",range:K(M.range||L.range)})}},H=(W,L)=>{for(let M of L.items){if(W.children=W.children||[],!(M.key instanceof Y.Scalar&&typeof M.key.value==="string")){Q.push({message:"Only string keys are supported",range:K(M.key.range||L.range)});continue}let{key:q,value:V}=M;if(q.value==="text"){if(!(V instanceof Y.Scalar&&typeof V.value==="string")){Q.push({message:"Text value should be a string",range:K(M.value.range||L.range)});continue}W.children.push({kind:"text",text:a1(V.value)});continue}if(q.value==="/children"){if(!(V instanceof Y.Scalar&&typeof V.value==="string")||V.value!=="contain"&&V.value!=="equal"&&V.value!=="deep-equal"){Q.push({message:'Strict value should be "contain", "equal" or "deep-equal"',range:K(M.value.range||L.range)});continue}W.containerMode=V.value;continue}if(q.value.startsWith("/")){if(!(V instanceof Y.Scalar&&typeof V.value==="string")){Q.push({message:"Property value should be a string",range:K(M.value.range||L.range)});continue}W.props=W.props??{},W.props[q.value.slice(1)]=a1(V.value);continue}let R=J1.parse(q,$,Q);if(!R)continue;if(V instanceof Y.Scalar){let i=typeof V.value;if(i!=="string"&&i!=="number"&&i!=="boolean"){Q.push({message:"Node value should be a string or a sequence",range:K(M.value.range||L.range)});continue}W.children.push({...R,children:[{kind:"text",text:a1(String(V.value))}]});continue}if(V instanceof Y.YAMLSeq){W.children.push(R),U(R,V);continue}Q.push({message:"Map values should be strings or sequences",range:K(M.value.range||L.range)})}},w={kind:"role",role:"fragment"};if(J.errors.forEach(G),Q.length)return{errors:Q,fragment:w};if(!(J.contents instanceof Y.YAMLSeq))Q.push({message:'Aria snapshot must be a YAML sequence, elements starting with " -"',range:J.contents?K(J.contents.range):[{line:0,col:0},{line:0,col:0}]});if(Q.length)return{errors:Q,fragment:w};if(U(w,J.contents),Q.length)return{errors:Q,fragment:I5};if(w.children?.length===1&&(!w.containerMode||w.containerMode==="contain"))return{fragment:w.children[0],errors:[]};return{fragment:w,errors:[]}}var I5={kind:"role",role:"fragment"};function i6(Y){return Y.replace(/[\u200b\u00ad]/g,"").replace(/[\r\n\s\t]+/g," ").trim()}function a1(Y){return{raw:Y,normalized:i6(Y)}}class J1{_input;_pos;_length;static parse(Y,_,X){try{return new J1(Y.value)._parse()}catch(Z){if(Z instanceof o1){let $=_.prettyErrors===!1?Z.message:Z.message+`:

`+Y.value+`
`+" ".repeat(Z.pos)+`^
`;return X.push({message:$,range:[_.lineCounter.linePos(Y.range[0]),_.lineCounter.linePos(Y.range[0]+Z.pos)]}),null}throw Z}}constructor(Y){this._input=Y,this._pos=0,this._length=Y.length}_peek(){return this._input[this._pos]||""}_next(){if(this._pos<this._length)return this._input[this._pos++];return null}_eof(){return this._pos>=this._length}_isWhitespace(){return!this._eof()&&/\s/.test(this._peek())}_skipWhitespace(){while(this._isWhitespace())this._pos++}_readIdentifier(Y){if(this._eof())this._throwError(`Unexpected end of input when expecting ${Y}`);let _=this._pos;while(!this._eof()&&/[a-zA-Z]/.test(this._peek()))this._pos++;return this._input.slice(_,this._pos)}_readString(){let Y="",_=!1;while(!this._eof()){let X=this._next();if(_)Y+=X,_=!1;else if(X==="\\")_=!0;else if(X==='"')return Y;else Y+=X}this._throwError("Unterminated string")}_throwError(Y,_=0){throw new o1(Y,_||this._pos)}_readRegex(){let Y="",_=!1,X=!1;while(!this._eof()){let Z=this._next();if(_)Y+=Z,_=!1;else if(Z==="\\")_=!0,Y+=Z;else if(Z==="/"&&!X)return{pattern:Y};else if(Z==="[")X=!0,Y+=Z;else if(Z==="]"&&X)Y+=Z,X=!1;else Y+=Z}this._throwError("Unterminated regex")}_readStringOrRegex(){let Y=this._peek();if(Y==='"')return this._next(),i6(this._readString());if(Y==="/")return this._next(),this._readRegex();return null}_readAttributes(Y){let _=this._pos;while(!0)if(this._skipWhitespace(),this._peek()==="["){this._next(),this._skipWhitespace(),_=this._pos;let X=this._readIdentifier("attribute");this._skipWhitespace();let Z="";if(this._peek()==="="){this._next(),this._skipWhitespace(),_=this._pos;while(this._peek()!=="]"&&!this._isWhitespace()&&!this._eof())Z+=this._next()}if(this._skipWhitespace(),this._peek()!=="]")this._throwError("Expected ]");this._next(),this._applyAttribute(Y,X,Z||"true",_)}else break}_parse(){this._skipWhitespace();let Y=this._readIdentifier("role");this._skipWhitespace();let _=this._readStringOrRegex()||"",X={kind:"role",role:Y,name:_};if(this._readAttributes(X),this._skipWhitespace(),!this._eof())this._throwError("Unexpected input");return X}_applyAttribute(Y,_,X,Z){if(_==="checked"){this._assert(X==="true"||X==="false"||X==="mixed",'Value of "checked" attribute must be a boolean or "mixed"',Z),Y.checked=X==="true"?!0:X==="false"?!1:"mixed";return}if(_==="disabled"){this._assert(X==="true"||X==="false",'Value of "disabled" attribute must be a boolean',Z),Y.disabled=X==="true";return}if(_==="expanded"){this._assert(X==="true"||X==="false",'Value of "expanded" attribute must be a boolean',Z),Y.expanded=X==="true";return}if(_==="active"){this._assert(X==="true"||X==="false",'Value of "active" attribute must be a boolean',Z),Y.active=X==="true";return}if(_==="level"){this._assert(!isNaN(Number(X)),'Value of "level" attribute must be a number',Z),Y.level=Number(X);return}if(_==="pressed"){this._assert(X==="true"||X==="false"||X==="mixed",'Value of "pressed" attribute must be a boolean or "mixed"',Z),Y.pressed=X==="true"?!0:X==="false"?!1:"mixed";return}if(_==="selected"){this._assert(X==="true"||X==="false",'Value of "selected" attribute must be a boolean',Z),Y.selected=X==="true";return}this._assert(!1,`Unsupported attribute [${_}]`,Z)}_assert(Y,_,X){if(!Y)this._throwError(_||"Assertion error",X)}}class o1 extends Error{pos;constructor(Y,_){super(Y);this.pos=_}}function l6(Y,_){function X(Q,K,G){let U=1,H=G+U;for(let w of Q.children||[])if(typeof w==="string")U++,H++;else U+=X(w,K,H),H+=U;if(!["none","presentation","fragment","iframe","generic"].includes(Q.role)&&Q.name){let w=K.get(Q.role);if(!w)w=new Map,K.set(Q.role,w);let W=w.get(Q.name),L=U*100-G;if(!W||W.sizeAndPosition<L)w.set(Q.name,{node:Q,sizeAndPosition:L})}return U}let Z=new Map;if(Y)X(Y,Z,0);let $=new Map;X(_,$,0);let J=[];for(let[Q,K]of $)for(let[G,U]of K)if(!Z.get(Q)?.get(G))J.push(U);return J.sort((Q,K)=>K.sizeAndPosition-Q.sizeAndPosition),J[0]?.node}var E=function(Y,_,X){return Y>=_&&Y<=X};function x(Y){return E(Y,48,57)}function s6(Y){return x(Y)||E(Y,65,70)||E(Y,97,102)}function P5(Y){return E(Y,65,90)}function A5(Y){return E(Y,97,122)}function j5(Y){return P5(Y)||A5(Y)}function f5(Y){return Y>=128}function K1(Y){return j5(Y)||f5(Y)||Y===95}function n6(Y){return K1(Y)||x(Y)||Y===45}function C5(Y){return E(Y,0,8)||Y===11||E(Y,14,31)||Y===127}function B0(Y){return Y===10}function t(Y){return B0(Y)||Y===9||Y===32}var E5=1114111;class Q1 extends Error{constructor(Y){super(Y);this.name="InvalidCharacterError"}}function N5(Y){let _=[];for(let X=0;X<Y.length;X++){let Z=Y.charCodeAt(X);if(Z===13&&Y.charCodeAt(X+1)===10)Z=10,X++;if(Z===13||Z===12)Z=10;if(Z===0)Z=65533;if(E(Z,55296,56319)&&E(Y.charCodeAt(X+1),56320,57343)){let $=Z-55296,J=Y.charCodeAt(X+1)-56320;Z=Math.pow(2,16)+$*Math.pow(2,10)+J,X++}_.push(Z)}return _}function T(Y){if(Y<=65535)return String.fromCharCode(Y);Y-=Math.pow(2,16);let _=Math.floor(Y/Math.pow(2,10))+55296,X=Y%Math.pow(2,10)+56320;return String.fromCharCode(_)+String.fromCharCode(X)}function G1(Y){let _=N5(Y),X=-1,Z=[],$,J=0,Q=0,K=0,G=function(){J+=1,K=Q,Q=0},U={line:J,column:Q},H=function(D){if(D>=_.length)return-1;return _[D]},w=function(D){if(D===void 0)D=1;if(D>3)throw"Spec Error: no more than three codepoints of lookahead.";return H(X+D)},W=function(D){if(D===void 0)D=1;if(X+=D,$=H(X),B0($))G();else Q+=D;return!0},L=function(){if(X-=1,B0($))J-=1,Q=K;else Q-=1;return U.line=J,U.column=Q,!0},M=function(D){if(D===void 0)D=$;return D===-1},O=function(){},q=function(){},V=function(){if(R(),W(),t($)){while(t(w()))W();return new K0}else if($===34)return i();else if($===35)if(n6(w())||o(w(1),w(2))){let D=new z1("");if(g(w(1),w(2),w(3)))D.type="id";return D.value=$1(),D}else return new C($);else if($===36)if(w()===61)return W(),new t6;else return new C($);else if($===39)return i();else if($===40)return new O1;else if($===41)return new L0;else if($===42)if(w()===61)return W(),new e6;else return new C($);else if($===43)if(s1())return L(),I();else return new C($);else if($===44)return new q1;else if($===45)if(s1())return L(),I();else if(w(1)===45&&w(2)===62)return W(2),new M1;else if(d())return L(),a();else return new C($);else if($===46)if(s1())return L(),I();else return new C($);else if($===58)return new H1;else if($===59)return new W1;else if($===60)if(w(1)===33&&w(2)===45&&w(3)===45)return W(3),new w1;else return new C($);else if($===64)if(g(w(1),w(2),w(3)))return new R1($1());else return new C($);else if($===91)return new L1;else if($===92)if(B())return L(),a();else return q(),new C($);else if($===93)return new b0;else if($===94)if(w()===61)return W(),new o6;else return new C($);else if($===123)return new B1;else if($===124)if(w()===61)return W(),new a6;else if(w()===124)return W(),new V1;else return new C($);else if($===125)return new D1;else if($===126)if(w()===61)return W(),new r6;else return new C($);else if(x($))return L(),I();else if(K1($))return L(),a();else if(M())return new O0;else return new C($)},R=function(){while(w(1)===47&&w(2)===42){W(2);while(!0)if(W(),$===42&&w()===47){W();break}else if(M()){q();return}}},I=function(){let D=L5();if(g(w(1),w(2),w(3))){let z=new Y8;return z.value=D.value,z.repr=D.repr,z.type=D.type,z.unit=$1(),z}else if(w()===37){W();let z=new P1;return z.value=D.value,z.repr=D.repr,z}else{let z=new F1;return z.value=D.value,z.repr=D.repr,z.type=D.type,z}},a=function(){let D=$1();if(D.toLowerCase()==="url"&&w()===40){W();while(t(w(1))&&t(w(2)))W();if(w()===34||w()===39)return new _0(D);else if(t(w())&&(w(2)===34||w(2)===39))return new _0(D);else return J0()}else if(w()===40)return W(),new _0(D);else return new V0(D)},i=function(D){if(D===void 0)D=$;let z="";while(W())if($===D||M())return new R0(z);else if(B0($))return q(),L(),new U1;else if($===92)if(M(w()))O();else if(B0(w()))W();else z+=T(m());else z+=T($);throw Error("Internal error")},J0=function(){let D=new I1("");while(t(w()))W();if(M(w()))return D;while(W())if($===41||M())return D;else if(t($)){while(t(w()))W();if(w()===41||M(w()))return W(),D;else return n1(),new D0}else if($===34||$===39||$===40||C5($))return q(),n1(),new D0;else if($===92)if(B())D.value+=T(m());else return q(),n1(),new D0;else D.value+=T($);throw Error("Internal error")},m=function(){if(W(),s6($)){let D=[$];for(let c=0;c<5;c++)if(s6(w()))W(),D.push($);else break;if(t(w()))W();let z=parseInt(D.map(function(c){return String.fromCharCode(c)}).join(""),16);if(z>E5)z=65533;return z}else if(M())return 65533;else return $},o=function(D,z){if(D!==92)return!1;if(B0(z))return!1;return!0},B=function(){return o($,w())},g=function(D,z,c){if(D===45)return K1(z)||z===45||o(z,c);else if(K1(D))return!0;else if(D===92)return o(D,z);else return!1},d=function(){return g($,w(1),w(2))},D5=function(D,z,c){if(D===43||D===45){if(x(z))return!0;if(z===46&&x(c))return!0;return!1}else if(D===46){if(x(z))return!0;return!1}else if(x(D))return!0;else return!1},s1=function(){return D5($,w(1),w(2))},$1=function(){let D="";while(W())if(n6($))D+=T($);else if(B())D+=T(m());else return L(),D;throw Error("Internal parse error")},L5=function(){let D="",z="integer";if(w()===43||w()===45)W(),D+=T($);while(x(w()))W(),D+=T($);if(w(1)===46&&x(w(2))){W(),D+=T($),W(),D+=T($),z="number";while(x(w()))W(),D+=T($)}let c=w(1),r1=w(2),V5=w(3);if((c===69||c===101)&&x(r1)){W(),D+=T($),W(),D+=T($),z="number";while(x(w()))W(),D+=T($)}else if((c===69||c===101)&&(r1===43||r1===45)&&x(V5)){W(),D+=T($),W(),D+=T($),W(),D+=T($),z="number";while(x(w()))W(),D+=T($)}let R5=O5(D);return{type:z,value:R5,repr:D}},O5=function(D){return+D},n1=function(){while(W())if($===41||M())return;else if(B())m(),O();else O()},m6=0;while(!M(w()))if(Z.push(V()),m6++,m6>_.length*2)throw Error("I'm infinite-looping!");return Z}class A{tokenType="";value;toJSON(){return{token:this.tokenType}}toString(){return this.tokenType}toSource(){return""+this}}class U1 extends A{tokenType="BADSTRING"}class D0 extends A{tokenType="BADURL"}class K0 extends A{tokenType="WHITESPACE";toString(){return"WS"}toSource(){return" "}}class w1 extends A{tokenType="CDO";toSource(){return"<!--"}}class M1 extends A{tokenType="CDC";toSource(){return"-->"}}class H1 extends A{tokenType=":"}class W1 extends A{tokenType=";"}class q1 extends A{tokenType=","}class Q0 extends A{value="";mirror=""}class B1 extends Q0{tokenType="{";constructor(){super();this.value="{",this.mirror="}"}}class D1 extends Q0{tokenType="}";constructor(){super();this.value="}",this.mirror="{"}}class L1 extends Q0{tokenType="[";constructor(){super();this.value="[",this.mirror="]"}}class b0 extends Q0{tokenType="]";constructor(){super();this.value="]",this.mirror="["}}class O1 extends Q0{tokenType="(";constructor(){super();this.value="(",this.mirror=")"}}class L0 extends Q0{tokenType=")";constructor(){super();this.value=")",this.mirror="("}}class r6 extends A{tokenType="~="}class a6 extends A{tokenType="|="}class o6 extends A{tokenType="^="}class t6 extends A{tokenType="$="}class e6 extends A{tokenType="*="}class V1 extends A{tokenType="||"}class O0 extends A{tokenType="EOF";toSource(){return""}}class C extends A{tokenType="DELIM";value="";constructor(Y){super();this.value=T(Y)}toString(){return"DELIM("+this.value+")"}toJSON(){let Y=this.constructor.prototype.constructor.prototype.toJSON.call(this);return Y.value=this.value,Y}toSource(){if(this.value==="\\")return"\\\n";else return this.value}}class G0 extends A{value="";ASCIIMatch(Y){return this.value.toLowerCase()===Y.toLowerCase()}toJSON(){let Y=this.constructor.prototype.constructor.prototype.toJSON.call(this);return Y.value=this.value,Y}}class V0 extends G0{constructor(Y){super();this.value=Y}tokenType="IDENT";toString(){return"IDENT("+this.value+")"}toSource(){return x0(this.value)}}class _0 extends G0{tokenType="FUNCTION";mirror;constructor(Y){super();this.value=Y,this.mirror=")"}toString(){return"FUNCTION("+this.value+")"}toSource(){return x0(this.value)+"("}}class R1 extends G0{tokenType="AT-KEYWORD";constructor(Y){super();this.value=Y}toString(){return"AT("+this.value+")"}toSource(){return"@"+x0(this.value)}}class z1 extends G0{tokenType="HASH";type;constructor(Y){super();this.value=Y,this.type="unrestricted"}toString(){return"HASH("+this.value+")"}toJSON(){let Y=this.constructor.prototype.constructor.prototype.toJSON.call(this);return Y.value=this.value,Y.type=this.type,Y}toSource(){if(this.type==="id")return"#"+x0(this.value);else return"#"+T5(this.value)}}class R0 extends G0{tokenType="STRING";constructor(Y){super();this.value=Y}toString(){return'"'+_8(this.value)+'"'}}class I1 extends G0{tokenType="URL";constructor(Y){super();this.value=Y}toString(){return"URL("+this.value+")"}toSource(){return'url("'+_8(this.value)+'")'}}class F1 extends A{tokenType="NUMBER";type;repr;constructor(){super();this.type="integer",this.repr=""}toString(){if(this.type==="integer")return"INT("+this.value+")";return"NUMBER("+this.value+")"}toJSON(){let Y=super.toJSON();return Y.value=this.value,Y.type=this.type,Y.repr=this.repr,Y}toSource(){return this.repr}}class P1 extends A{tokenType="PERCENTAGE";repr;constructor(){super();this.repr=""}toString(){return"PERCENTAGE("+this.value+")"}toJSON(){let Y=this.constructor.prototype.constructor.prototype.toJSON.call(this);return Y.value=this.value,Y.repr=this.repr,Y}toSource(){return this.repr+"%"}}class Y8 extends A{tokenType="DIMENSION";type;repr;unit;constructor(){super();this.type="integer",this.repr="",this.unit=""}toString(){return"DIM("+this.value+","+this.unit+")"}toJSON(){let Y=this.constructor.prototype.constructor.prototype.toJSON.call(this);return Y.value=this.value,Y.type=this.type,Y.repr=this.repr,Y.unit=this.unit,Y}toSource(){let Y=this.repr,_=x0(this.unit);if(_[0].toLowerCase()==="e"&&(_[1]==="-"||E(_.charCodeAt(1),48,57)))_="\\65 "+_.slice(1,_.length);return Y+_}}function x0(Y){Y=""+Y;let _="",X=Y.charCodeAt(0);for(let Z=0;Z<Y.length;Z++){let $=Y.charCodeAt(Z);if($===0)throw new Q1("Invalid character: the input contains U+0000.");if(E($,1,31)||$===127||Z===0&&E($,48,57)||Z===1&&E($,48,57)&&X===45)_+="\\"+$.toString(16)+" ";else if($>=128||$===45||$===95||E($,48,57)||E($,65,90)||E($,97,122))_+=Y[Z];else _+="\\"+Y[Z]}return _}function T5(Y){Y=""+Y;let _="";for(let X=0;X<Y.length;X++){let Z=Y.charCodeAt(X);if(Z===0)throw new Q1("Invalid character: the input contains U+0000.");if(Z>=128||Z===45||Z===95||E(Z,48,57)||E(Z,65,90)||E(Z,97,122))_+=Y[X];else _+="\\"+Z.toString(16)+" "}return _}function _8(Y){Y=""+Y;let _="";for(let X=0;X<Y.length;X++){let Z=Y.charCodeAt(X);if(Z===0)throw new Q1("Invalid character: the input contains U+0000.");if(E(Z,1,31)||Z===127)_+="\\"+Z.toString(16)+" ";else if(Z===34||Z===92)_+="\\"+Y[X];else _+=Y[X]}return _}class k extends Error{}function Z8(Y,_){let X;try{if(X=G1(Y),!(X[X.length-1]instanceof O0))X.push(new O0)}catch(B){let g=B.message+` while parsing css selector "${Y}". Did you mean to CSS.escape it?`,d=(B.stack||"").indexOf(B.message);if(d!==-1)B.stack=B.stack.substring(0,d)+g+B.stack.substring(d+B.message.length);throw B.message=g,B}let Z=X.find((B)=>{return B instanceof R1||B instanceof U1||B instanceof D0||B instanceof V1||B instanceof w1||B instanceof M1||B instanceof W1||B instanceof B1||B instanceof D1||B instanceof I1||B instanceof P1});if(Z)throw new k(`Unsupported token "${Z.toSource()}" while parsing css selector "${Y}". Did you mean to CSS.escape it?`);let $=0,J=new Set;function Q(){return new k(`Unexpected token "${X[$].toSource()}" while parsing css selector "${Y}". Did you mean to CSS.escape it?`)}function K(){while(X[$]instanceof K0)$++}function G(B=$){return X[B]instanceof V0}function U(B=$){return X[B]instanceof R0}function H(B=$){return X[B]instanceof F1}function w(B=$){return X[B]instanceof q1}function W(B=$){return X[B]instanceof O1}function L(B=$){return X[B]instanceof L0}function M(B=$){return X[B]instanceof _0}function O(B=$){return X[B]instanceof C&&X[B].value==="*"}function q(B=$){return X[B]instanceof O0}function V(B=$){return X[B]instanceof C&&[">","+","~"].includes(X[B].value)}function R(B=$){return w(B)||L(B)||q(B)||V(B)||X[B]instanceof K0}function I(){let B=[a()];while(!0){if(K(),!w())break;$++,B.push(a())}return B}function a(){if(K(),H())return X[$++].value;if(U())return X[$++].value;return i()}function i(){let B={simples:[]};if(K(),V())B.simples.push({selector:{functions:[{name:"scope",args:[]}]},combinator:""});else B.simples.push({selector:J0(),combinator:""});while(!0){if(K(),V())B.simples[B.simples.length-1].combinator=X[$++].value,K();else if(R())break;B.simples.push({combinator:"",selector:J0()})}return B}function J0(){let B="",g=[];while(!R())if(G()||O())B+=X[$++].toSource();else if(X[$]instanceof z1)B+=X[$++].toSource();else if(X[$]instanceof C&&X[$].value===".")if($++,G())B+="."+X[$++].toSource();else throw Q();else if(X[$]instanceof H1)if($++,G())if(!_.has(X[$].value.toLowerCase()))B+=":"+X[$++].toSource();else{let d=X[$++].value.toLowerCase();g.push({name:d,args:[]}),J.add(d)}else if(M()){let d=X[$++].value.toLowerCase();if(!_.has(d))B+=`:${d}(${m()})`;else g.push({name:d,args:I()}),J.add(d);if(K(),!L())throw Q();$++}else throw Q();else if(X[$]instanceof L1){B+="[",$++;while(!(X[$]instanceof b0)&&!q())B+=X[$++].toSource();if(!(X[$]instanceof b0))throw Q();B+="]",$++}else throw Q();if(!B&&!g.length)throw Q();return{css:B||void 0,functions:g}}function m(){let B="",g=1;while(!q()){if(W()||M())g++;if(L())g--;if(!g)break;B+=X[$++].toSource()}return B}let o=I();if(!q())throw Q();if(o.some((B)=>typeof B!=="object"||!("simples"in B)))throw new k(`Error while parsing css selector "${Y}". Did you mean to CSS.escape it?`);return{selector:o,names:Array.from(J)}}var t1=new Set(["internal:has","internal:has-not","internal:and","internal:or","internal:chain","left-of","right-of","above","below","near"]),k5=new Set(["left-of","right-of","above","below","near"]),e1=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 u0(Y){let _=h5(Y),X=[];for(let Z of _.parts){if(Z.name==="css"||Z.name==="css:light"){if(Z.name==="css:light")Z.body=":light("+Z.body+")";let $=Z8(Z.body,e1);X.push({name:"css",body:$.selector,source:Z.body});continue}if(t1.has(Z.name)){let $,J;try{let U=JSON.parse("["+Z.body+"]");if(!Array.isArray(U)||U.length<1||U.length>2||typeof U[0]!=="string")throw new k(`Malformed selector: ${Z.name}=`+Z.body);if($=U[0],U.length===2){if(typeof U[1]!=="number"||!k5.has(Z.name))throw new k(`Malformed selector: ${Z.name}=`+Z.body);J=U[1]}}catch(U){throw new k(`Malformed selector: ${Z.name}=`+Z.body)}let Q={name:Z.name,source:Z.body,body:{parsed:u0($),distance:J}},K=[...Q.body.parsed.parts].reverse().find((U)=>U.name==="internal:control"&&U.body==="enter-frame"),G=K?Q.body.parsed.parts.indexOf(K):-1;if(G!==-1&&S5(Q.body.parsed.parts.slice(0,G+1),X.slice(0,G+1)))Q.body.parsed.parts.splice(0,G+1);X.push(Q);continue}X.push({...Z,source:Z.body})}if(t1.has(X[0].name))throw new k(`"${X[0].name}" selector cannot be first`);return{capture:_.capture,parts:X}}function S5(Y,_){return v({parts:Y})===v({parts:_})}function v(Y,_){if(typeof Y==="string")return Y;return Y.parts.map((X,Z)=>{let $=!0;if(!_&&Z!==Y.capture){if(X.name==="css")$=!1;else if(X.name==="xpath"&&X.source.startsWith("//")||X.source.startsWith(".."))$=!1}let J=$?X.name+"=":"";return`${Z===Y.capture?"*":""}${J}${X.source}`}).join(" >> ")}function $8(Y,_){let X=(Z,$)=>{for(let J of Z.parts)if(_(J,$),t1.has(J.name))X(J.body.parsed,!0)};X(Y,!1)}function h5(Y){let _=0,X,Z=0,$={parts:[]},J=()=>{let K=Y.substring(Z,_).trim(),G=K.indexOf("="),U,H;if(G!==-1&&K.substring(0,G).trim().match(/^[a-zA-Z_0-9-+:*]+$/))U=K.substring(0,G).trim(),H=K.substring(G+1);else if(K.length>1&&K[0]==='"'&&K[K.length-1]==='"')U="text",H=K;else if(K.length>1&&K[0]==="'"&&K[K.length-1]==="'")U="text",H=K;else if(/^\(*\/\//.test(K)||K.startsWith(".."))U="xpath",H=K;else U="css",H=K;let w=!1;if(U[0]==="*")w=!0,U=U.substring(1);if($.parts.push({name:U,body:H}),w){if($.capture!==void 0)throw new k("Only one of the selectors can capture using * modifier");$.capture=$.parts.length-1}};if(!Y.includes(">>"))return _=Y.length,J(),$;let Q=()=>{let G=Y.substring(Z,_).match(/^\s*text\s*=(.*)$/);return!!G&&!!G[1]};while(_<Y.length){let K=Y[_];if(K==="\\"&&_+1<Y.length)_+=2;else if(K===X)X=void 0,_++;else if(!X&&(K==='"'||K==="'"||K==="`")&&!Q())X=K,_++;else if(!X&&K===">"&&Y[_+1]===">")J(),_+=2,Z=_;else _++}return J(),$}function X0(Y,_){let X=0,Z=Y.length===0,$=()=>Y[X]||"",J=()=>{let q=$();return++X,Z=X>=Y.length,q},Q=(q)=>{if(Z)throw new k(`Unexpected end of selector while parsing selector \`${Y}\``);throw new k(`Error while parsing selector \`${Y}\` - unexpected symbol "${$()}" at position ${X}`+(q?" during "+q:""))};function K(){while(!Z&&/\s/.test($()))J()}function G(q){return q>="€"||q>="0"&&q<="9"||q>="A"&&q<="Z"||q>="a"&&q<="z"||q>="0"&&q<="9"||q==="_"||q==="-"}function U(){let q="";K();while(!Z&&G($()))q+=J();return q}function H(q){let V=J();if(V!==q)Q("parsing quoted string");while(!Z&&$()!==q){if($()==="\\")J();V+=J()}if($()!==q)Q("parsing quoted string");return V+=J(),V}function w(){if(J()!=="/")Q("parsing regular expression");let q="",V=!1;while(!Z){if($()==="\\"){if(q+=J(),Z)Q("parsing regular expression")}else if(V&&$()==="]")V=!1;else if(!V&&$()==="[")V=!0;else if(!V&&$()==="/")break;q+=J()}if(J()!=="/")Q("parsing regular expression");let R="";while(!Z&&$().match(/[dgimsuy]/))R+=J();try{return new RegExp(q,R)}catch(I){throw new k(`Error while parsing selector \`${Y}\`: ${I.message}`)}}function W(){let q="";if(K(),$()==="'"||$()==='"')q=H($()).slice(1,-1);else q=U();if(!q)Q("parsing property path");return q}function L(){K();let q="";if(!Z)q+=J();if(!Z&&q!=="=")q+=J();if(!["=","*=","^=","$=","|=","~="].includes(q))Q("parsing operator");return q}function M(){J();let q=[];q.push(W()),K();while($()===".")J(),q.push(W()),K();if($()==="]")return J(),{name:q.join("."),jsonPath:q,op:"<truthy>",value:null,caseSensitive:!1};let V=L(),R=void 0,I=!0;if(K(),$()==="/"){if(V!=="=")throw new k(`Error while parsing selector \`${Y}\` - cannot use ${V} in attribute with regular expression`);R=w()}else if($()==="'"||$()==='"'){if(R=H($()).slice(1,-1),K(),$()==="i"||$()==="I")I=!1,J();else if($()==="s"||$()==="S")I=!0,J()}else{R="";while(!Z&&(G($())||$()==="+"||$()==="."))R+=J();if(R==="true")R=!0;else if(R==="false")R=!1;else if(!_){if(R=+R,Number.isNaN(R))Q("parsing attribute value")}}if(K(),$()!=="]")Q("parsing attribute value");if(J(),V!=="="&&typeof R!=="string")throw new k(`Error while parsing selector \`${Y}\` - cannot use ${V} in attribute with non-string matching value - ${R}`);return{name:q.join("."),jsonPath:q,op:V,value:R,caseSensitive:I}}let O={name:"",attributes:[]};O.name=U(),K();while($()==="[")O.attributes.push(M()),K();if(!Z)Q(void 0);if(!O.name&&!O.attributes.length)throw new k(`Error while parsing selector \`${Y}\` - selector cannot be empty`);return O}function p0(Y,_="'"){let X=JSON.stringify(Y),Z=X.substring(1,X.length-1).replace(/\\"/g,'"');if(_==="'")return _+Z.replace(/[']/g,"\\'")+_;if(_==='"')return _+Z.replace(/["]/g,"\\\"")+_;if(_==="`")return _+Z.replace(/[`]/g,"\\`")+_;throw Error("Invalid escape char")}function m0(Y){return Y.charAt(0).toUpperCase()+Y.substring(1)}function _6(Y){return Y.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function U0(Y){return`"${Y.replace(/["\\]/g,(_)=>"\\"+_)}"`}var Y6;function J8(){Y6=new Map}function j(Y){let _=Y6?.get(Y);if(_===void 0)_=Y.replace(/[\u200b\u00ad]/g,"").trim().replace(/\s+/g," "),Y6?.set(Y,_);return _}function d0(Y){return Y.replace(/(^|[^\\])(\\\\)*\\(['"`])/g,"$1$2$3")}function K8(Y){if(Y.unicode||Y.unicodeSets)return String(Y);return String(Y).replace(/(^|[^\\])(\\\\)*(["'`])/g,"$1$2\\$3").replace(/>>/g,"\\>\\>")}function u(Y,_){if(typeof Y!=="string")return K8(Y);return`${JSON.stringify(Y)}${_?"s":"i"}`}function y(Y,_){if(typeof Y!=="string")return K8(Y);return`"${Y.replace(/\\/g,"\\\\").replace(/["]/g,"\\\"")}"${_?"s":"i"}`}function g5(Y,_,X=""){if(Y.length<=_)return Y;let Z=[...Y];if(Z.length>_)return Z.slice(0,_-X.length).join("")+X;return Z.join("")}function X6(Y,_){return g5(Y,_,"…")}function z0(Y){return Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Q8(Y,_){let X=Y.length,Z=_.length,$=0,J=0,Q=Array(X+1).fill(null).map(()=>Array(Z+1).fill(0));for(let K=1;K<=X;K++)for(let G=1;G<=Z;G++)if(Y[K-1]===_[G-1]){if(Q[K][G]=Q[K-1][G-1]+1,Q[K][G]>$)$=Q[K][G],J=K}return Y.slice(J-$,J)}var RY=new RegExp("([\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~])))","g");function w0(Y,_,X=!1){return v5(Y,_,X,1)[0]}function v5(Y,_,X=!1,Z=20,$){try{return I0(new b5[Y]($),u0(_),X,Z)}catch(J){return[_]}}function I0(Y,_,X=!1,Z=20){let $=[..._.parts],J=[],Q=X?"frame-locator":"page";for(let K=0;K<$.length;K++){let G=$[K],U=Q;if(Q="locator",G.name==="internal:describe")continue;if(G.name==="nth"){if(G.body==="0")J.push([Y.generateLocator(U,"first",""),Y.generateLocator(U,"nth","0")]);else if(G.body==="-1")J.push([Y.generateLocator(U,"last",""),Y.generateLocator(U,"nth","-1")]);else J.push([Y.generateLocator(U,"nth",G.body)]);continue}if(G.name==="visible"){J.push([Y.generateLocator(U,"visible",G.body),Y.generateLocator(U,"default",`visible=${G.body}`)]);continue}if(G.name==="internal:text"){let{exact:M,text:O}=c0(G.body);J.push([Y.generateLocator(U,"text",O,{exact:M})]);continue}if(G.name==="internal:has-text"){let{exact:M,text:O}=c0(G.body);if(!M){J.push([Y.generateLocator(U,"has-text",O,{exact:M})]);continue}}if(G.name==="internal:has-not-text"){let{exact:M,text:O}=c0(G.body);if(!M){J.push([Y.generateLocator(U,"has-not-text",O,{exact:M})]);continue}}if(G.name==="internal:has"){let M=I0(Y,G.body.parsed,!1,Z);J.push(M.map((O)=>Y.generateLocator(U,"has",O)));continue}if(G.name==="internal:has-not"){let M=I0(Y,G.body.parsed,!1,Z);J.push(M.map((O)=>Y.generateLocator(U,"hasNot",O)));continue}if(G.name==="internal:and"){let M=I0(Y,G.body.parsed,!1,Z);J.push(M.map((O)=>Y.generateLocator(U,"and",O)));continue}if(G.name==="internal:or"){let M=I0(Y,G.body.parsed,!1,Z);J.push(M.map((O)=>Y.generateLocator(U,"or",O)));continue}if(G.name==="internal:chain"){let M=I0(Y,G.body.parsed,!1,Z);J.push(M.map((O)=>Y.generateLocator(U,"chain",O)));continue}if(G.name==="internal:label"){let{exact:M,text:O}=c0(G.body);J.push([Y.generateLocator(U,"label",O,{exact:M})]);continue}if(G.name==="internal:role"){let M=X0(G.body,!0),O={attrs:[]};for(let q of M.attributes)if(q.name==="name")O.exact=q.caseSensitive,O.name=q.value;else{if(q.name==="level"&&typeof q.value==="string")q.value=+q.value;O.attrs.push({name:q.name==="include-hidden"?"includeHidden":q.name,value:q.value})}J.push([Y.generateLocator(U,"role",M.name,O)]);continue}if(G.name==="internal:testid"){let M=X0(G.body,!0),{value:O}=M.attributes[0];J.push([Y.generateLocator(U,"test-id",O)]);continue}if(G.name==="internal:attr"){let M=X0(G.body,!0),{name:O,value:q,caseSensitive:V}=M.attributes[0],R=q,I=!!V;if(O==="placeholder"){J.push([Y.generateLocator(U,"placeholder",R,{exact:I})]);continue}if(O==="alt"){J.push([Y.generateLocator(U,"alt",R,{exact:I})]);continue}if(O==="title"){J.push([Y.generateLocator(U,"title",R,{exact:I})]);continue}}if(G.name==="internal:control"&&G.body==="enter-frame"){let M=J[J.length-1],O=$[K-1],q=M.map((V)=>Y.chainLocators([V,Y.generateLocator(U,"frame","")]));if(["xpath","css"].includes(O.name))q.push(Y.generateLocator(U,"frame-locator",v({parts:[O]})),Y.generateLocator(U,"frame-locator",v({parts:[O]},!0)));M.splice(0,M.length,...q),Q="frame-locator";continue}let H=$[K+1],w=v({parts:[G]}),W=Y.generateLocator(U,"default",w);if(H&&["internal:has-text","internal:has-not-text"].includes(H.name)){let{exact:M,text:O}=c0(H.body);if(!M){let q=Y.generateLocator("locator",H.name==="internal:has-text"?"has-text":"has-not-text",O,{exact:M}),V={};if(H.name==="internal:has-text")V.hasText=O;else V.hasNotText=O;let R=Y.generateLocator(U,"default",w,V);J.push([Y.chainLocators([W,q]),R]),K++;continue}}let L;if(["xpath","css"].includes(G.name)){let M=v({parts:[G]},!0);L=Y.generateLocator(U,"default",M)}J.push([W,L].filter(Boolean))}return y5(Y,J,Z)}function y5(Y,_,X){let Z=_.map(()=>""),$=[],J=(Q)=>{if(Q===_.length)return $.push(Y.chainLocators(Z)),$.length<X;for(let K of _[Q])if(Z[Q]=K,!J(Q+1))return!1;return!0};return J(0),$}function c0(Y){let _=!1,X=Y.match(/^\/(.*)\/([igm]*)$/);if(X)return{text:new RegExp(X[1],X[2])};if(Y.endsWith('"'))Y=JSON.parse(Y),_=!0;else if(Y.endsWith('"s'))Y=JSON.parse(Y.substring(0,Y.length-1)),_=!0;else if(Y.endsWith('"i'))Y=JSON.parse(Y.substring(0,Y.length-1)),_=!1;return{exact:_,text:Y}}class G8{preferredQuote;constructor(Y){this.preferredQuote=Y}generateLocator(Y,_,X,Z={}){switch(_){case"default":if(Z.hasText!==void 0)return`locator(${this.quote(X)}, { hasText: ${this.toHasText(Z.hasText)} })`;if(Z.hasNotText!==void 0)return`locator(${this.quote(X)}, { hasNotText: ${this.toHasText(Z.hasNotText)} })`;return`locator(${this.quote(X)})`;case"frame-locator":return`frameLocator(${this.quote(X)})`;case"frame":return"contentFrame()";case"nth":return`nth(${X})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter({ visible: ${X==="true"?"true":"false"} })`;case"role":let $=[];if(S(Z.name))$.push(`name: ${this.regexToSourceString(Z.name)}`);else if(typeof Z.name==="string"){if($.push(`name: ${this.quote(Z.name)}`),Z.exact)$.push("exact: true")}for(let{name:Q,value:K}of Z.attrs)$.push(`${Q}: ${typeof K==="string"?this.quote(K):K}`);let J=$.length?`, { ${$.join(", ")} }`:"";return`getByRole(${this.quote(X)}${J})`;case"has-text":return`filter({ hasText: ${this.toHasText(X)} })`;case"has-not-text":return`filter({ hasNotText: ${this.toHasText(X)} })`;case"has":return`filter({ has: ${X} })`;case"hasNot":return`filter({ hasNot: ${X} })`;case"and":return`and(${X})`;case"or":return`or(${X})`;case"chain":return`locator(${X})`;case"test-id":return`getByTestId(${this.toTestIdValue(X)})`;case"text":return this.toCallWithExact("getByText",X,!!Z.exact);case"alt":return this.toCallWithExact("getByAltText",X,!!Z.exact);case"placeholder":return this.toCallWithExact("getByPlaceholder",X,!!Z.exact);case"label":return this.toCallWithExact("getByLabel",X,!!Z.exact);case"title":return this.toCallWithExact("getByTitle",X,!!Z.exact);default:throw Error("Unknown selector kind "+_)}}chainLocators(Y){return Y.join(".")}regexToSourceString(Y){return d0(String(Y))}toCallWithExact(Y,_,X){if(S(_))return`${Y}(${this.regexToSourceString(_)})`;return X?`${Y}(${this.quote(_)}, { exact: true })`:`${Y}(${this.quote(_)})`}toHasText(Y){if(S(Y))return this.regexToSourceString(Y);return this.quote(Y)}toTestIdValue(Y){if(S(Y))return this.regexToSourceString(Y);return this.quote(Y)}quote(Y){return p0(Y,this.preferredQuote??"'")}}class U8{generateLocator(Y,_,X,Z={}){switch(_){case"default":if(Z.hasText!==void 0)return`locator(${this.quote(X)}, has_text=${this.toHasText(Z.hasText)})`;if(Z.hasNotText!==void 0)return`locator(${this.quote(X)}, has_not_text=${this.toHasText(Z.hasNotText)})`;return`locator(${this.quote(X)})`;case"frame-locator":return`frame_locator(${this.quote(X)})`;case"frame":return"content_frame";case"nth":return`nth(${X})`;case"first":return"first";case"last":return"last";case"visible":return`filter(visible=${X==="true"?"True":"False"})`;case"role":let $=[];if(S(Z.name))$.push(`name=${this.regexToString(Z.name)}`);else if(typeof Z.name==="string"){if($.push(`name=${this.quote(Z.name)}`),Z.exact)$.push("exact=True")}for(let{name:Q,value:K}of Z.attrs){let G=typeof K==="string"?this.quote(K):K;if(typeof K==="boolean")G=K?"True":"False";$.push(`${_6(Q)}=${G}`)}let J=$.length?`, ${$.join(", ")}`:"";return`get_by_role(${this.quote(X)}${J})`;case"has-text":return`filter(has_text=${this.toHasText(X)})`;case"has-not-text":return`filter(has_not_text=${this.toHasText(X)})`;case"has":return`filter(has=${X})`;case"hasNot":return`filter(has_not=${X})`;case"and":return`and_(${X})`;case"or":return`or_(${X})`;case"chain":return`locator(${X})`;case"test-id":return`get_by_test_id(${this.toTestIdValue(X)})`;case"text":return this.toCallWithExact("get_by_text",X,!!Z.exact);case"alt":return this.toCallWithExact("get_by_alt_text",X,!!Z.exact);case"placeholder":return this.toCallWithExact("get_by_placeholder",X,!!Z.exact);case"label":return this.toCallWithExact("get_by_label",X,!!Z.exact);case"title":return this.toCallWithExact("get_by_title",X,!!Z.exact);default:throw Error("Unknown selector kind "+_)}}chainLocators(Y){return Y.join(".")}regexToString(Y){let _=Y.flags.includes("i")?", re.IGNORECASE":"";return`re.compile(r"${d0(Y.source).replace(/\\\//,"/").replace(/"/g,"\\\"")}"${_})`}toCallWithExact(Y,_,X){if(S(_))return`${Y}(${this.regexToString(_)})`;if(X)return`${Y}(${this.quote(_)}, exact=True)`;return`${Y}(${this.quote(_)})`}toHasText(Y){if(S(Y))return this.regexToString(Y);return`${this.quote(Y)}`}toTestIdValue(Y){if(S(Y))return this.regexToString(Y);return this.quote(Y)}quote(Y){return p0(Y,'"')}}class w8{generateLocator(Y,_,X,Z={}){let $;switch(Y){case"page":$="Page";break;case"frame-locator":$="FrameLocator";break;case"locator":$="Locator";break}switch(_){case"default":if(Z.hasText!==void 0)return`locator(${this.quote(X)}, new ${$}.LocatorOptions().setHasText(${this.toHasText(Z.hasText)}))`;if(Z.hasNotText!==void 0)return`locator(${this.quote(X)}, new ${$}.LocatorOptions().setHasNotText(${this.toHasText(Z.hasNotText)}))`;return`locator(${this.quote(X)})`;case"frame-locator":return`frameLocator(${this.quote(X)})`;case"frame":return"contentFrame()";case"nth":return`nth(${X})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter(new ${$}.FilterOptions().setVisible(${X==="true"?"true":"false"}))`;case"role":let J=[];if(S(Z.name))J.push(`.setName(${this.regexToString(Z.name)})`);else if(typeof Z.name==="string"){if(J.push(`.setName(${this.quote(Z.name)})`),Z.exact)J.push(".setExact(true)")}for(let{name:K,value:G}of Z.attrs)J.push(`.set${m0(K)}(${typeof G==="string"?this.quote(G):G})`);let Q=J.length?`, new ${$}.GetByRoleOptions()${J.join("")}`:"";return`getByRole(AriaRole.${_6(X).toUpperCase()}${Q})`;case"has-text":return`filter(new ${$}.FilterOptions().setHasText(${this.toHasText(X)}))`;case"has-not-text":return`filter(new ${$}.FilterOptions().setHasNotText(${this.toHasText(X)}))`;case"has":return`filter(new ${$}.FilterOptions().setHas(${X}))`;case"hasNot":return`filter(new ${$}.FilterOptions().setHasNot(${X}))`;case"and":return`and(${X})`;case"or":return`or(${X})`;case"chain":return`locator(${X})`;case"test-id":return`getByTestId(${this.toTestIdValue(X)})`;case"text":return this.toCallWithExact($,"getByText",X,!!Z.exact);case"alt":return this.toCallWithExact($,"getByAltText",X,!!Z.exact);case"placeholder":return this.toCallWithExact($,"getByPlaceholder",X,!!Z.exact);case"label":return this.toCallWithExact($,"getByLabel",X,!!Z.exact);case"title":return this.toCallWithExact($,"getByTitle",X,!!Z.exact);default:throw Error("Unknown selector kind "+_)}}chainLocators(Y){return Y.join(".")}regexToString(Y){let _=Y.flags.includes("i")?", Pattern.CASE_INSENSITIVE":"";return`Pattern.compile(${this.quote(d0(Y.source))}${_})`}toCallWithExact(Y,_,X,Z){if(S(X))return`${_}(${this.regexToString(X)})`;if(Z)return`${_}(${this.quote(X)}, new ${Y}.${m0(_)}Options().setExact(true))`;return`${_}(${this.quote(X)})`}toHasText(Y){if(S(Y))return this.regexToString(Y);return this.quote(Y)}toTestIdValue(Y){if(S(Y))return this.regexToString(Y);return this.quote(Y)}quote(Y){return p0(Y,'"')}}class M8{generateLocator(Y,_,X,Z={}){switch(_){case"default":if(Z.hasText!==void 0)return`Locator(${this.quote(X)}, new() { ${this.toHasText(Z.hasText)} })`;if(Z.hasNotText!==void 0)return`Locator(${this.quote(X)}, new() { ${this.toHasNotText(Z.hasNotText)} })`;return`Locator(${this.quote(X)})`;case"frame-locator":return`FrameLocator(${this.quote(X)})`;case"frame":return"ContentFrame";case"nth":return`Nth(${X})`;case"first":return"First";case"last":return"Last";case"visible":return`Filter(new() { Visible = ${X==="true"?"true":"false"} })`;case"role":let $=[];if(S(Z.name))$.push(`NameRegex = ${this.regexToString(Z.name)}`);else if(typeof Z.name==="string"){if($.push(`Name = ${this.quote(Z.name)}`),Z.exact)$.push("Exact = true")}for(let{name:Q,value:K}of Z.attrs)$.push(`${m0(Q)} = ${typeof K==="string"?this.quote(K):K}`);let J=$.length?`, new() { ${$.join(", ")} }`:"";return`GetByRole(AriaRole.${m0(X)}${J})`;case"has-text":return`Filter(new() { ${this.toHasText(X)} })`;case"has-not-text":return`Filter(new() { ${this.toHasNotText(X)} })`;case"has":return`Filter(new() { Has = ${X} })`;case"hasNot":return`Filter(new() { HasNot = ${X} })`;case"and":return`And(${X})`;case"or":return`Or(${X})`;case"chain":return`Locator(${X})`;case"test-id":return`GetByTestId(${this.toTestIdValue(X)})`;case"text":return this.toCallWithExact("GetByText",X,!!Z.exact);case"alt":return this.toCallWithExact("GetByAltText",X,!!Z.exact);case"placeholder":return this.toCallWithExact("GetByPlaceholder",X,!!Z.exact);case"label":return this.toCallWithExact("GetByLabel",X,!!Z.exact);case"title":return this.toCallWithExact("GetByTitle",X,!!Z.exact);default:throw Error("Unknown selector kind "+_)}}chainLocators(Y){return Y.join(".")}regexToString(Y){let _=Y.flags.includes("i")?", RegexOptions.IgnoreCase":"";return`new Regex(${this.quote(d0(Y.source))}${_})`}toCallWithExact(Y,_,X){if(S(_))return`${Y}(${this.regexToString(_)})`;if(X)return`${Y}(${this.quote(_)}, new() { Exact = true })`;return`${Y}(${this.quote(_)})`}toHasText(Y){if(S(Y))return`HasTextRegex = ${this.regexToString(Y)}`;return`HasText = ${this.quote(Y)}`}toTestIdValue(Y){if(S(Y))return this.regexToString(Y);return this.quote(Y)}toHasNotText(Y){if(S(Y))return`HasNotTextRegex = ${this.regexToString(Y)}`;return`HasNotText = ${this.quote(Y)}`}quote(Y){return p0(Y,'"')}}class H8{generateLocator(Y,_,X,Z={}){return JSON.stringify({kind:_,body:X,options:Z})}chainLocators(Y){let _=Y.map((X)=>JSON.parse(X));for(let X=0;X<_.length-1;++X)_[X].next=_[X+1];return JSON.stringify(_[0])}}var b5={javascript:G8,python:U8,java:w8,csharp:M8,jsonl:H8};function S(Y){return Y instanceof RegExp}function W8(Y){if(!q8(Y))return Y;return"'"+Y.replace(/'/g,"''")+"'"}function A1(Y){if(!q8(Y))return Y;return'"'+Y.replace(/[\\"\x00-\x1f\x7f-\x9f]/g,(_)=>{switch(_){case"\\":return"\\\\";case'"':return"\\\"";case"\b":return"\\b";case"\f":return"\\f";case`
`:return"\\n";case"\r":return"\\r";case"\t":return"\\t";default:return"\\x"+_.charCodeAt(0).toString(16).padStart(2,"0")}})+'"'}function q8(Y){if(Y.length===0)return!0;if(/^\s|\s$/.test(Y))return!0;if(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(Y))return!0;if(/^-/.test(Y))return!0;if(/[\n:](\s|$)/.test(Y))return!0;if(/\s#/.test(Y))return!0;if(/[\n\r]/.test(Y))return!0;if(/^[&*\],?!>|@"'#%]/.test(Y))return!0;if(/[{}`]/.test(Y))return!0;if(/^\[/.test(Y))return!0;if(!isNaN(Number(Y))||["y","n","yes","no","true","false","on","off","null"].includes(Y.toLowerCase()))return!0;return!1}var B8={};function D8(Y){B8=Y}function i0(Y,_){while(_){if(Y.contains(_))return!0;_=L8(_)}return!1}function N(Y){if(Y.parentElement)return Y.parentElement;if(!Y.parentNode)return;if(Y.parentNode.nodeType===11&&Y.parentNode.host)return Y.parentNode.host}function j1(Y){let _=Y;while(_.parentNode)_=_.parentNode;if(_.nodeType===11||_.nodeType===9)return _}function L8(Y){while(Y.parentElement)Y=Y.parentElement;return N(Y)}function M0(Y,_,X){while(Y){let Z=Y.closest(_);if(X&&Z!==X&&Z?.contains(X))return;if(Z)return Z;Y=L8(Y)}}function n(Y,_){let X=_==="::before"?K6:_==="::after"?Q6:J6;if(X&&X.has(Y))return X.get(Y);let Z=Y.ownerDocument&&Y.ownerDocument.defaultView?Y.ownerDocument.defaultView.getComputedStyle(Y,_):void 0;return X?.set(Y,Z),Z}function Z6(Y,_){if(_=_??n(Y),!_)return!0;if(Element.prototype.checkVisibility&&B8.browserNameForWorkarounds!=="webkit"){if(!Y.checkVisibility())return!1}else{let X=Y.closest("details,summary");if(X!==Y&&X?.nodeName==="DETAILS"&&!X.open)return!1}if(_.visibility!=="visible")return!1;return!0}function l0(Y){let _=n(Y);if(!_)return{visible:!0,inline:!1};let X=_.cursor;if(_.display==="contents"){for(let $=Y.firstChild;$;$=$.nextSibling){if($.nodeType===1&&b($))return{visible:!0,inline:!1,cursor:X};if($.nodeType===3&&$6($))return{visible:!0,inline:!0,cursor:X}}return{visible:!1,inline:!1,cursor:X}}if(!Z6(Y,_))return{cursor:X,visible:!1,inline:!1};let Z=Y.getBoundingClientRect();return{cursor:X,visible:Z.width>0&&Z.height>0,inline:_.display==="inline"}}function b(Y){return l0(Y).visible}function $6(Y){let _=Y.ownerDocument.createRange();_.selectNode(Y);let X=_.getBoundingClientRect();return X.width>0&&X.height>0}function f(Y){let _=Y.tagName;if(typeof _==="string")return _.toUpperCase();if(Y instanceof HTMLFormElement)return"FORM";return Y.tagName.toUpperCase()}var J6,K6,Q6,O8=0;function F0(){++O8,J6??=new Map,K6??=new Map,Q6??=new Map}function P0(){if(!--O8)J6=void 0,K6=void 0,Q6=void 0}function V8(Y){return Y.hasAttribute("aria-label")||Y.hasAttribute("aria-labelledby")}var R8="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]",x5=[["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",["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"]],["aria-labelledby",["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",["generic"]]];function A8(Y,_){return x5.some(([X,Z])=>{return!Z?.includes(_||"")&&Y.hasAttribute(X)})}function j8(Y){return!Number.isNaN(Number(String(Y.getAttribute("tabindex"))))}function u5(Y){return!S8(Y)&&(p5(Y)||j8(Y))}function p5(Y){let _=f(Y);if(["BUTTON","DETAILS","SELECT","TEXTAREA"].includes(_))return!0;if(_==="A"||_==="AREA")return Y.hasAttribute("href");if(_==="INPUT")return!Y.hidden;return!1}var m5={A:(Y)=>{return Y.hasAttribute("href")?"link":null},AREA:(Y)=>{return Y.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:(Y)=>M0(Y,R8)?null:"contentinfo",FORM:(Y)=>V8(Y)?"form":null,H1:()=>"heading",H2:()=>"heading",H3:()=>"heading",H4:()=>"heading",H5:()=>"heading",H6:()=>"heading",HEADER:(Y)=>M0(Y,R8)?null:"banner",HR:()=>"separator",HTML:()=>"document",IMG:(Y)=>Y.getAttribute("alt")===""&&!Y.getAttribute("title")&&!A8(Y)&&!j8(Y)?"presentation":"img",INPUT:(Y)=>{let _=Y.type.toLowerCase();if(_==="search")return Y.hasAttribute("list")?"combobox":"searchbox";if(["email","tel","text","url",""].includes(_)){let X=j0(Y,Y.getAttribute("list"))[0];return X&&f(X)==="DATALIST"?"combobox":"textbox"}if(_==="hidden")return null;if(_==="file")return"button";return e5[_]||"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",SEARCH:()=>"search",SECTION:(Y)=>V8(Y)?"region":null,SELECT:(Y)=>Y.hasAttribute("multiple")||Y.size>1?"listbox":"combobox",STRONG:()=>"strong",SUB:()=>"subscript",SUP:()=>"superscript",SVG:()=>"img",TABLE:()=>"table",TBODY:()=>"rowgroup",TD:(Y)=>{let _=M0(Y,"table"),X=_?G6(_):"";return X==="grid"||X==="treegrid"?"gridcell":"cell"},TEXTAREA:()=>"textbox",TFOOT:()=>"rowgroup",TH:(Y)=>{let _=Y.getAttribute("scope");if(_==="col"||_==="colgroup")return"columnheader";if(_==="row"||_==="rowgroup")return"rowheader";let{nextElementSibling:X,previousElementSibling:Z}=Y,$=!!Y.parentElement&&f(Y.parentElement)==="TR"?Y.parentElement:void 0;if(!X&&!Z){if($){let J=M0($,"table");if(J&&J.rows.length<=1)return null}return"columnheader"}if(z8(X)&&z8(Z))return"columnheader";if(I8(X)||I8(Z))return"rowheader";return"columnheader"},THEAD:()=>"rowgroup",TIME:()=>"time",TR:()=>"row",UL:()=>"list"};function z8(Y){return!!Y&&f(Y)==="TH"}function I8(Y){if(!Y||f(Y)!=="TD")return!1;return!!(Y.textContent?.trim()||Y.children.length>0)}var d5={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 F8(Y){let _=m5[f(Y)]?.(Y)||"";if(!_)return null;let X=Y;while(X){let Z=N(X),$=d5[f(X)];if(!$||!Z||!$.includes(f(Z)))break;let J=G6(Z);if((J==="none"||J==="presentation")&&!f8(Z,J))return J;X=Z}return _}var c5=["alert","alertdialog","application","article","banner","blockquote","button","caption","cell","checkbox","code","columnheader","combobox","complementary","contentinfo","definition","deletion","dialog","directory","document","emphasis","feed","figure","form","generic","grid","gridcell","group","heading","img","insertion","link","list","listbox","listitem","log","main","mark","marquee","math","meter","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","navigation","none","note","option","paragraph","presentation","progressbar","radio","radiogroup","region","row","rowgroup","rowheader","scrollbar","search","searchbox","separator","slider","spinbutton","status","strong","subscript","superscript","switch","tab","table","tablist","tabpanel","term","textbox","time","timer","toolbar","tooltip","tree","treegrid","treeitem"];function G6(Y){return(Y.getAttribute("role")||"").split(" ").map((X)=>X.trim()).find((X)=>c5.includes(X))||null}function f8(Y,_){return A8(Y,_)||u5(Y)}function P(Y){let _=G6(Y);if(!_)return F8(Y);if(_==="none"||_==="presentation"){let X=F8(Y);if(f8(Y,X))return X}return _}function C8(Y){return Y===null?void 0:Y.toLowerCase()==="true"}function E8(Y){return["STYLE","SCRIPT","NOSCRIPT","TEMPLATE"].includes(f(Y))}function p(Y){if(E8(Y))return!0;let _=n(Y),X=Y.nodeName==="SLOT";if(_?.display==="contents"&&!X){for(let $=Y.firstChild;$;$=$.nextSibling){if($.nodeType===1&&!p($))return!1;if($.nodeType===3&&$6($))return!1}return!0}if(!(Y.nodeName==="OPTION"&&!!Y.closest("select"))&&!X&&!Z6(Y,_))return!0;return N8(Y)}function N8(Y){let _=C1?.get(Y);if(_===void 0){if(_=!1,Y.parentElement&&Y.parentElement.shadowRoot&&!Y.assignedSlot)_=!0;if(!_){let X=n(Y);_=!X||X.display==="none"||C8(Y.getAttribute("aria-hidden"))===!0}if(!_){let X=N(Y);if(X)_=N8(X)}C1?.set(Y,_)}return _}function j0(Y,_){if(!_)return[];let X=j1(Y);if(!X)return[];try{let Z=_.split(" ").filter((J)=>!!J),$=[];for(let J of Z){let Q=X.querySelector("#"+CSS.escape(J));if(Q&&!$.includes(Q))$.push(Q)}return $}catch(Z){return[]}}function e(Y){return Y.trim()}function n0(Y){return Y.split(" ").map((_)=>_.replace(/\r\n/g,`
`).replace(/[\u200b\u00ad]/g,"").replace(/\s\s*/g," ")).join(" ").trim()}function P8(Y,_){let X=[...Y.querySelectorAll(_)];for(let Z of j0(Y,Y.getAttribute("aria-owns"))){if(Z.matches(_))X.push(Z);X.push(...Z.querySelectorAll(_))}return X}function A0(Y,_){let X=_==="::before"?O6:_==="::after"?V6:L6;if(X?.has(Y))return X?.get(Y);let Z=n(Y,_),$;if(Z){let J=Z.content;if(J&&J!=="none"&&J!=="normal"){if(Z.display!=="none"&&Z.visibility!=="hidden")$=i5(Y,J,!!_)}}if(_&&$!==void 0){if((Z?.display||"inline")!=="inline")$=" "+$+" "}if(X)X.set(Y,$);return $}function i5(Y,_,X){if(!_||_==="none"||_==="normal")return;try{let Z=G1(_).filter((K)=>!(K instanceof K0)),$=Z.findIndex((K)=>K instanceof C&&K.value==="/");if($!==-1)Z=Z.slice($+1);else if(!X)return;let J=[],Q=0;while(Q<Z.length)if(Z[Q]instanceof R0)J.push(Z[Q].value),Q++;else if(Q+2<Z.length&&Z[Q]instanceof _0&&Z[Q].value==="attr"&&Z[Q+1]instanceof V0&&Z[Q+2]instanceof L0){let K=Z[Q+1].value;J.push(Y.getAttribute(K)||""),Q+=3}else return;return J.join("")}catch{}}function U6(Y){let _=Y.getAttribute("aria-labelledby");if(_===null)return null;let X=j0(Y,_);return X.length?X:null}function l5(Y,_){let X=["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"].includes(Y),Z=_&&["","caption","code","contentinfo","definition","deletion","emphasis","insertion","list","listitem","mark","none","paragraph","presentation","region","row","rowgroup","section","strong","subscript","superscript","table","term","time"].includes(Y);return X||Z}function s(Y,_){let X=_?q6:W6,Z=X?.get(Y);if(Z===void 0){if(Z="",!["caption","code","definition","deletion","emphasis","generic","insertion","mark","paragraph","presentation","strong","subscript","suggestion","superscript","term","time"].includes(P(Y)||""))Z=n0(l(Y,{includeHidden:_,visitedElements:new Set,embeddedInTargetElement:"self"}));X?.set(Y,Z)}return Z}function w6(Y,_){let X=_?D6:B6,Z=X?.get(Y);if(Z===void 0){if(Z="",Y.hasAttribute("aria-describedby")){let $=j0(Y,Y.getAttribute("aria-describedby"));Z=n0($.map((J)=>l(J,{includeHidden:_,visitedElements:new Set,embeddedInDescribedBy:{element:J,hidden:p(J)}})).join(" "))}else if(Y.hasAttribute("aria-description"))Z=n0(Y.getAttribute("aria-description")||"");else Z=n0(Y.getAttribute("title")||"");X?.set(Y,Z)}return Z}function s5(Y){let _=Y.getAttribute("aria-invalid");if(!_||_.trim()===""||_.toLocaleLowerCase()==="false")return"false";if(_==="true"||_==="grammar"||_==="spelling")return _;return"true"}function n5(Y){if("validity"in Y)return Y.validity?.valid===!1;return!1}function T8(Y){let _=f1,X=f1?.get(Y);if(X===void 0){X="";let Z=s5(Y)!=="false",$=n5(Y);if(Z||$){let J=Y.getAttribute("aria-errormessage");X=j0(Y,J).map((G)=>n0(l(G,{visitedElements:new Set,embeddedInDescribedBy:{element:G,hidden:p(G)}}))).join(" ").trim()}_?.set(Y,X)}return X}function l(Y,_){if(_.visitedElements.has(Y))return"";let X={..._,embeddedInTargetElement:_.embeddedInTargetElement==="self"?"descendant":_.embeddedInTargetElement};if(!_.includeHidden){let G=!!_.embeddedInLabelledBy?.hidden||!!_.embeddedInDescribedBy?.hidden||!!_.embeddedInNativeTextAlternative?.hidden||!!_.embeddedInLabel?.hidden;if(E8(Y)||!G&&p(Y))return _.visitedElements.add(Y),""}let Z=U6(Y);if(!_.embeddedInLabelledBy){let G=(Z||[]).map((U)=>l(U,{..._,embeddedInLabelledBy:{element:U,hidden:p(U)},embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0,embeddedInLabel:void 0,embeddedInNativeTextAlternative:void 0})).join(" ");if(G)return G}let $=P(Y)||"",J=f(Y);if(!!_.embeddedInLabel||!!_.embeddedInLabelledBy||_.embeddedInTargetElement==="descendant"){let G=[...Y.labels||[]].includes(Y),U=(Z||[]).includes(Y);if(!G&&!U){if($==="textbox"){if(_.visitedElements.add(Y),J==="INPUT"||J==="TEXTAREA")return Y.value;return Y.textContent||""}if(["combobox","listbox"].includes($)){_.visitedElements.add(Y);let H;if(J==="SELECT"){if(H=[...Y.selectedOptions],!H.length&&Y.options.length)H.push(Y.options[0])}else{let w=$==="combobox"?P8(Y,"*").find((W)=>P(W)==="listbox"):Y;H=w?P8(w,'[aria-selected="true"]').filter((W)=>P(W)==="option"):[]}if(!H.length&&J==="INPUT")return Y.value;return H.map((w)=>l(w,X)).join(" ")}if(["progressbar","scrollbar","slider","spinbutton","meter"].includes($)){if(_.visitedElements.add(Y),Y.hasAttribute("aria-valuetext"))return Y.getAttribute("aria-valuetext")||"";if(Y.hasAttribute("aria-valuenow"))return Y.getAttribute("aria-valuenow")||"";return Y.getAttribute("value")||""}if(["menu"].includes($))return _.visitedElements.add(Y),""}}let Q=Y.getAttribute("aria-label")||"";if(e(Q))return _.visitedElements.add(Y),Q;if(!["presentation","none"].includes($)){if(J==="INPUT"&&["button","submit","reset"].includes(Y.type)){_.visitedElements.add(Y);let G=Y.value||"";if(e(G))return G;if(Y.type==="submit")return"Submit";if(Y.type==="reset")return"Reset";return Y.getAttribute("title")||""}if(J==="INPUT"&&Y.type==="file"){_.visitedElements.add(Y);let G=Y.labels||[];if(G.length&&!_.embeddedInLabelledBy)return s0(G,_);return"Choose File"}if(J==="INPUT"&&Y.type==="image"){_.visitedElements.add(Y);let G=Y.labels||[];if(G.length&&!_.embeddedInLabelledBy)return s0(G,_);let U=Y.getAttribute("alt")||"";if(e(U))return U;let H=Y.getAttribute("title")||"";if(e(H))return H;return"Submit"}if(!Z&&J==="BUTTON"){_.visitedElements.add(Y);let G=Y.labels||[];if(G.length)return s0(G,_)}if(!Z&&J==="OUTPUT"){_.visitedElements.add(Y);let G=Y.labels||[];if(G.length)return s0(G,_);return Y.getAttribute("title")||""}if(!Z&&(J==="TEXTAREA"||J==="SELECT"||J==="INPUT")){_.visitedElements.add(Y);let G=Y.labels||[];if(G.length)return s0(G,_);let U=J==="INPUT"&&["text","password","search","tel","email","url"].includes(Y.type)||J==="TEXTAREA",H=Y.getAttribute("placeholder")||"",w=Y.getAttribute("title")||"";if(!U||w)return w;return H}if(!Z&&J==="FIELDSET"){_.visitedElements.add(Y);for(let U=Y.firstElementChild;U;U=U.nextElementSibling)if(f(U)==="LEGEND")return l(U,{...X,embeddedInNativeTextAlternative:{element:U,hidden:p(U)}});return Y.getAttribute("title")||""}if(!Z&&J==="FIGURE"){_.visitedElements.add(Y);for(let U=Y.firstElementChild;U;U=U.nextElementSibling)if(f(U)==="FIGCAPTION")return l(U,{...X,embeddedInNativeTextAlternative:{element:U,hidden:p(U)}});return Y.getAttribute("title")||""}if(J==="IMG"){_.visitedElements.add(Y);let G=Y.getAttribute("alt")||"";if(e(G))return G;return Y.getAttribute("title")||""}if(J==="TABLE"){_.visitedElements.add(Y);for(let U=Y.firstElementChild;U;U=U.nextElementSibling)if(f(U)==="CAPTION")return l(U,{...X,embeddedInNativeTextAlternative:{element:U,hidden:p(U)}});let G=Y.getAttribute("summary")||"";if(G)return G}if(J==="AREA"){_.visitedElements.add(Y);let G=Y.getAttribute("alt")||"";if(e(G))return G;return Y.getAttribute("title")||""}if(J==="SVG"||Y.ownerSVGElement){_.visitedElements.add(Y);for(let G=Y.firstElementChild;G;G=G.nextElementSibling)if(f(G)==="TITLE"&&G.ownerSVGElement)return l(G,{...X,embeddedInLabelledBy:{element:G,hidden:p(G)}})}if(Y.ownerSVGElement&&J==="A"){let G=Y.getAttribute("xlink:title")||"";if(e(G))return _.visitedElements.add(Y),G}}let K=J==="SUMMARY"&&!["presentation","none"].includes($);if(l5($,_.embeddedInTargetElement==="descendant")||K||!!_.embeddedInLabelledBy||!!_.embeddedInDescribedBy||!!_.embeddedInLabel||!!_.embeddedInNativeTextAlternative){_.visitedElements.add(Y);let G=r5(Y,X);if(_.embeddedInTargetElement==="self"?e(G):G)return G}if(!["presentation","none"].includes($)||J==="IFRAME"){_.visitedElements.add(Y);let G=Y.getAttribute("title")||"";if(e(G))return G}return _.visitedElements.add(Y),""}function r5(Y,_){let X=[],Z=(J,Q)=>{if(Q&&J.assignedSlot)return;if(J.nodeType===1){let K=n(J)?.display||"inline",G=l(J,_);if(K!=="inline"||J.nodeName==="BR")G=" "+G+" ";X.push(G)}else if(J.nodeType===3)X.push(J.textContent||"")};X.push(A0(Y,"::before")||"");let $=A0(Y);if($!==void 0)X.push($);else{let J=Y.nodeName==="SLOT"?Y.assignedNodes():[];if(J.length)for(let Q of J)Z(Q,!1);else{for(let Q=Y.firstChild;Q;Q=Q.nextSibling)Z(Q,!0);if(Y.shadowRoot)for(let Q=Y.shadowRoot.firstChild;Q;Q=Q.nextSibling)Z(Q,!0);for(let Q of j0(Y,Y.getAttribute("aria-owns")))Z(Q,!0)}}return X.push(A0(Y,"::after")||""),X.join("")}var r0=["gridcell","option","row","tab","rowheader","columnheader","treeitem"];function E1(Y){if(f(Y)==="OPTION")return Y.selected;if(r0.includes(P(Y)||""))return C8(Y.getAttribute("aria-selected"))===!0;return!1}var a0=["checkbox","menuitemcheckbox","option","radio","switch","menuitemradio","treeitem"];function N1(Y){let _=M6(Y,!0);return _==="error"?!1:_}function k8(Y){return M6(Y,!0)}function T1(Y){return M6(Y,!1)}function M6(Y,_){let X=f(Y);if(_&&X==="INPUT"&&Y.indeterminate)return"mixed";if(X==="INPUT"&&["checkbox","radio"].includes(Y.type))return Y.checked;if(a0.includes(P(Y)||"")){let Z=Y.getAttribute("aria-checked");if(Z==="true")return!0;if(_&&Z==="mixed")return"mixed";return!1}return"error"}var a5=["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox","columnheader","rowheader","searchbox","switch","treegrid"];function k1(Y){let _=f(Y);if(["INPUT","TEXTAREA","SELECT"].includes(_))return Y.hasAttribute("readonly");if(a5.includes(P(Y)||""))return Y.getAttribute("aria-readonly")==="true";if(Y.isContentEditable)return!1;return"error"}var o0=["button"];function S1(Y){if(o0.includes(P(Y)||"")){let _=Y.getAttribute("aria-pressed");if(_==="true")return!0;if(_==="mixed")return"mixed"}return!1}var t0=["application","button","checkbox","combobox","gridcell","link","listbox","menuitem","row","rowheader","tab","treeitem","columnheader","menuitemcheckbox","menuitemradio","rowheader","switch"];function h1(Y){if(f(Y)==="DETAILS")return Y.open;if(t0.includes(P(Y)||"")){let _=Y.getAttribute("aria-expanded");if(_===null)return;if(_==="true")return!0;return!1}return}var e0=["heading","listitem","row","treeitem"];function g1(Y){let _={H1:1,H2:2,H3:3,H4:4,H5:5,H6:6}[f(Y)];if(_)return _;if(e0.includes(P(Y)||"")){let X=Y.getAttribute("aria-level"),Z=X===null?Number.NaN:Number(X);if(Number.isInteger(Z)&&Z>=1)return Z}return 0}var H6=["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"];function r(Y){return S8(Y)||h8(Y)}function S8(Y){return["BUTTON","INPUT","SELECT","TEXTAREA","OPTION","OPTGROUP"].includes(f(Y))&&(Y.hasAttribute("disabled")||o5(Y)||t5(Y))}function o5(Y){return f(Y)==="OPTION"&&!!Y.closest("OPTGROUP[DISABLED]")}function t5(Y){let _=Y?.closest("FIELDSET[DISABLED]");if(!_)return!1;let X=_.querySelector(":scope > LEGEND");return!X||!X.contains(Y)}function h8(Y,_=!1){if(!Y)return!1;if(_||H6.includes(P(Y)||"")){let X=(Y.getAttribute("aria-disabled")||"").toLowerCase();if(X==="true")return!0;if(X==="false")return!1;return h8(N(Y),!0)}return!1}function s0(Y,_){return[...Y].map((X)=>l(X,{..._,embeddedInLabel:{element:X,hidden:p(X)},embeddedInNativeTextAlternative:void 0,embeddedInLabelledBy:void 0,embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0})).filter((X)=>!!X).join(" ")}function g8(Y){let _=R6,X=Y,Z,$=[];for(;X;X=N(X)){let J=_.get(X);if(J!==void 0){Z=J;break}$.push(X);let Q=n(X);if(!Q){Z=!0;break}let K=Q.pointerEvents;if(K){Z=K!=="none";break}}if(Z===void 0)Z=!0;for(let J of $)_.set(J,Z);return Z}var W6,q6,B6,D6,f1,C1,L6,O6,V6,R6,v8=0;function Z0(){F0(),++v8,W6??=new Map,q6??=new Map,B6??=new Map,D6??=new Map,f1??=new Map,C1??=new Map,L6??=new Map,O6??=new Map,V6??=new Map,R6??=new Map}function $0(){if(!--v8)W6=void 0,q6=void 0,B6=void 0,D6=void 0,f1=void 0,C1=void 0,L6=void 0,O6=void 0,V6=void 0,R6=void 0;P0()}var e5={button:"button",checkbox:"checkbox",image:"button",number:"spinbutton",radio:"radio",range:"slider",reset:"button",submit:"button"};var _4=0;function p8(Y){if(Y.mode==="ai")return{visibility:"ariaOrVisible",refs:"interactable",refPrefix:Y.refPrefix,includeGenericRole:!0,renderActive:!Y.doNotRenderActive,renderCursorPointer:!0};if(Y.mode==="autoexpect")return{visibility:"ariaAndVisible",refs:"none"};if(Y.mode==="codegen")return{visibility:"aria",refs:"none",renderStringsAsRegex:!0};return{visibility:"aria",refs:"none"}}function C0(Y,_){let X=p8(_),Z=new Set,$={root:{role:"fragment",name:"",children:[],props:{},box:l0(Y),receivesPointerEvents:!0},elements:new Map,refs:new Map,iframeRefs:[]};I6($.root,Y);let J=(K,G,U)=>{if(Z.has(G))return;if(Z.add(G),G.nodeType===Node.TEXT_NODE&&G.nodeValue){if(!U)return;let O=G.nodeValue;if(K.role!=="textbox"&&O)K.children.push(G.nodeValue||"");return}if(G.nodeType!==Node.ELEMENT_NODE)return;let H=G,w=!p(H),W=w;if(X.visibility==="ariaOrVisible")W=w||b(H);if(X.visibility==="ariaAndVisible")W=w&&b(H);if(X.visibility==="aria"&&!W)return;let L=[];if(H.hasAttribute("aria-owns")){let O=H.getAttribute("aria-owns").split(/\s+/);for(let q of O){let V=Y.ownerDocument.getElementById(q);if(V)L.push(V)}}let M=W?X4(H,X):null;if(M){if(M.ref){if($.elements.set(M.ref,H),$.refs.set(H,M.ref),M.role==="iframe")$.iframeRefs.push(M.ref)}K.children.push(M)}Q(M||K,H,L,W)};function Q(K,G,U,H){let W=(n(G)?.display||"inline")!=="inline"||G.nodeName==="BR"?" ":"";if(W)K.children.push(W);K.children.push(A0(G,"::before")||"");let L=G.nodeName==="SLOT"?G.assignedNodes():[];if(L.length)for(let M of L)J(K,M,H);else{for(let M=G.firstChild;M;M=M.nextSibling)if(!M.assignedSlot)J(K,M,H);if(G.shadowRoot)for(let M=G.shadowRoot.firstChild;M;M=M.nextSibling)J(K,M,H)}for(let M of U)J(K,M,H);if(K.children.push(A0(G,"::after")||""),W)K.children.push(W);if(K.children.length===1&&K.name===K.children[0])K.children=[];if(K.role==="link"&&G.hasAttribute("href")){let M=G.getAttribute("href");K.props.url=M}if(K.role==="textbox"&&G.hasAttribute("placeholder")&&G.getAttribute("placeholder")!==K.name){let M=G.getAttribute("placeholder");K.props.placeholder=M}}Z0();try{J($.root,Y,!0)}finally{$0()}return $4($.root),Z4($.root),$}function y8(Y,_){if(_.refs==="none")return;if(_.refs==="interactable"&&(!Y.box.visible||!Y.receivesPointerEvents))return;let X=A6(Y),Z=X._ariaRef;if(!Z||Z.role!==Y.role||Z.name!==Y.name)Z={role:Y.role,name:Y.name,ref:(_.refPrefix??"")+"e"+ ++_4},X._ariaRef=Z;Y.ref=Z.ref}function X4(Y,_){let X=Y.ownerDocument.activeElement===Y;if(Y.nodeName==="IFRAME"){let U={role:"iframe",name:"",children:[],props:{},box:l0(Y),receivesPointerEvents:!0,active:X};return I6(U,Y),y8(U,_),U}let Z=_.includeGenericRole?"generic":null,$=P(Y)??Z;if(!$||$==="presentation"||$==="none")return null;let J=j(s(Y,!1)||""),Q=g8(Y),K=l0(Y);if($==="generic"&&K.inline&&Y.childNodes.length===1&&Y.childNodes[0].nodeType===Node.TEXT_NODE)return null;let G={role:$,name:J,children:[],props:{},box:K,receivesPointerEvents:Q,active:X};if(I6(G,Y),y8(G,_),a0.includes($))G.checked=N1(Y);if(H6.includes($))G.disabled=r(Y);if(t0.includes($))G.expanded=h1(Y);if(e0.includes($))G.level=g1(Y);if(o0.includes($))G.pressed=S1(Y);if(r0.includes($))G.selected=E1(Y);if(Y instanceof HTMLInputElement||Y instanceof HTMLTextAreaElement){if(Y.type!=="checkbox"&&Y.type!=="radio"&&Y.type!=="file")G.children=[Y.value]}return G}function Z4(Y){let _=(X)=>{let Z=[];for(let J of X.children||[]){if(typeof J==="string"){Z.push(J);continue}let Q=_(J);Z.push(...Q)}if(X.role==="generic"&&!X.name&&Z.length<=1&&Z.every((J)=>typeof J!=="string"&&!!J.ref))return Z;return X.children=Z,[X]};_(Y)}function $4(Y){let _=(Z,$)=>{if(!Z.length)return;let J=j(Z.join(""));if(J)$.push(J);Z.length=0},X=(Z)=>{let $=[],J=[];for(let Q of Z.children||[])if(typeof Q==="string")J.push(Q);else _(J,$),X(Q),$.push(Q);if(_(J,$),Z.children=$.length?$:[],Z.children.length===1&&Z.children[0]===Z.name)Z.children=[]};X(Y)}function J4(Y,_){if(!_)return!0;if(!Y)return!1;if(typeof _==="string")return Y===_;return!!Y.match(new RegExp(_.pattern))}function b8(Y,_){if(!_?.normalized)return!0;if(!Y)return!1;if(Y===_.normalized)return!0;if(Y===_.raw)return!0;let X=K4(_);if(X)return!!Y.match(X);return!1}var z6=Symbol("cachedRegex");function K4(Y){if(Y[z6]!==void 0)return Y[z6];let{raw:_}=Y,X=_.startsWith("/")&&_.endsWith("/")&&_.length>1,Z;try{Z=X?new RegExp(_.slice(1,-1)):null}catch($){Z=null}return Y[z6]=Z,Z}function F6(Y,_){let X=C0(Y,{mode:"default"});return{matches:d8(X.root,_,!1,!1),received:{raw:f0(X,{mode:"default"}).text,regex:f0(X,{mode:"codegen"}).text}}}function m8(Y,_){let X=C0(Y,{mode:"default"}).root;return d8(X,_,!0,!1).map(($)=>A6($))}function P6(Y,_,X){if(typeof Y==="string"&&_.kind==="text")return b8(Y,_.text);if(Y===null||typeof Y!=="object"||_.kind!=="role")return!1;if(_.role!=="fragment"&&_.role!==Y.role)return!1;if(_.checked!==void 0&&_.checked!==Y.checked)return!1;if(_.disabled!==void 0&&_.disabled!==Y.disabled)return!1;if(_.expanded!==void 0&&_.expanded!==Y.expanded)return!1;if(_.level!==void 0&&_.level!==Y.level)return!1;if(_.pressed!==void 0&&_.pressed!==Y.pressed)return!1;if(_.selected!==void 0&&_.selected!==Y.selected)return!1;if(!J4(Y.name,_.name))return!1;if(!b8(Y.props.url,_.props?.url))return!1;if(_.containerMode==="contain")return u8(Y.children||[],_.children||[]);if(_.containerMode==="equal")return x8(Y.children||[],_.children||[],!1);if(_.containerMode==="deep-equal"||X)return x8(Y.children||[],_.children||[],!0);return u8(Y.children||[],_.children||[])}function x8(Y,_,X){if(_.length!==Y.length)return!1;for(let Z=0;Z<_.length;++Z)if(!P6(Y[Z],_[Z],X))return!1;return!0}function u8(Y,_){if(_.length>Y.length)return!1;let X=Y.slice(),Z=_.slice();for(let $ of Z){let J=X.shift();while(J){if(P6(J,$,!1))break;J=X.shift()}if(!J)return!1}return!0}function d8(Y,_,X,Z){let $=[],J=(Q,K)=>{if(P6(Q,_,Z)){let G=typeof Q==="string"?K:Q;if(G)$.push(G);return!X}if(typeof Q==="string")return!1;for(let G of Q.children||[])if(J(G,Q))return!0;return!1};return J(Y,null),$}function c8(Y,_=new Map){if(Y?.ref)_.set(Y.ref,Y);for(let X of Y?.children||[])if(typeof X!=="string")c8(X,_);return _}function Q4(Y,_){let X=c8(_?.root),Z=new Map,$=(J,Q)=>{let K=J.children.length===Q?.children.length&&d6(J,Q),G=K;for(let U=0;U<J.children.length;U++){let H=J.children[U],w=Q?.children[U];if(typeof H==="string")K&&=H===w,G&&=H===w;else{let W=typeof w!=="string"?w:void 0;if(H.ref)W=X.get(H.ref);let L=$(H,W);if(!W||!L&&!H.ref||W!==w)G=!1;K&&=L&&W===w}}return Z.set(J,K?"same":G?"skip":"changed"),K};return $(Y.root,X.get(_?.root?.ref)),Z}function G4(Y,_){let X=[],Z=($)=>{let J=_.get($);if(J==="same");else if(J==="skip"){for(let Q of $.children)if(typeof Q!=="string")Z(Q)}else X.push($)};for(let $ of Y)if(typeof $==="string")X.push($);else Z($);return X}function v1(Y){return"  ".repeat(Y)}function f0(Y,_,X){let Z=p8(_),$=[],J={},Q=Z.renderStringsAsRegex?w4:()=>!0,K=Z.renderStringsAsRegex?U4:(M)=>M,G=Y.root.role==="fragment"?Y.root.children:[Y.root],U=Q4(Y,X);if(X)G=G4(G,U);let H=(M,O)=>{if(_.depth&&O>_.depth)return;let q=A1(K(M));if(q)$.push(v1(O)+"- text: "+q)},w=(M,O)=>{let q=M.role;if(M.name&&M.name.length<=900){let V=K(M.name);if(V){let R=V.startsWith("/")&&V.endsWith("/")?V:JSON.stringify(V);q+=" "+R}}if(M.checked==="mixed")q+=" [checked=mixed]";if(M.checked===!0)q+=" [checked]";if(M.disabled)q+=" [disabled]";if(M.expanded)q+=" [expanded]";if(M.active&&Z.renderActive)q+=" [active]";if(M.level)q+=` [level=${M.level}]`;if(M.pressed==="mixed")q+=" [pressed=mixed]";if(M.pressed===!0)q+=" [pressed]";if(M.selected===!0)q+=" [selected]";if(M.ref){if(q+=` [ref=${M.ref}]`,O&&y0(M))q+=" [cursor=pointer]"}return q},W=(M)=>{return M?.children.length===1&&typeof M.children[0]==="string"&&!Object.keys(M.props).length?M.children[0]:void 0},L=(M,O,q)=>{if(_.depth&&O>_.depth)return;if(M.role==="iframe"&&M.ref)J[M.ref]=O;if(U.get(M)==="same"&&M.ref){$.push(v1(O)+`- ref=${M.ref} [unchanged]`);return}let V=!!X&&!O,R=v1(O)+"- "+(V?"<changed> ":"")+W8(w(M,q)),I=W(M),a=!!_.depth&&O===_.depth;if(!I&&(!M.children.length||a)&&!Object.keys(M.props).length)$.push(R);else if(I!==void 0)if(Q(M,I))$.push(R+": "+A1(K(I)));else $.push(R);else{$.push(R+":");for(let[m,o]of Object.entries(M.props))$.push(v1(O+1)+"- /"+m+": "+A1(o));let J0=!!M.ref&&q&&y0(M);for(let m of M.children)if(typeof m==="string")H(Q(M,m)?m:"",O+1);else L(m,O+1,q&&!J0)}};for(let M of G)if(typeof M==="string")H(M,0);else L(M,0,!!Z.renderCursorPointer);return{text:$.join(`
`),iframeDepths:J}}function U4(Y){let _=[{regex:/\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b/,replacement:"[0-9a-fA-F-]+"},{regex:/\b[\d,.]+[bkmBKM]+\b/,replacement:"[\\d,.]+[bkmBKM]+"},{regex:/\b\d+[hmsp]+\b/,replacement:"\\d+[hmsp]+"},{regex:/\b[\d,.]+[hmsp]+\b/,replacement:"[\\d,.]+[hmsp]+"},{regex:/\b\d+,\d+\b/,replacement:"\\d+,\\d+"},{regex:/\b\d+\.\d{2,}\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\.\d+\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\b/,replacement:"\\d+"}],X="",Z=0,$=new RegExp(_.map((J)=>"("+J.regex.source+")").join("|"),"g");if(Y.replace($,(J,...Q)=>{let K=Q[Q.length-2],G=Q.slice(0,-2);X+=z0(Y.slice(Z,K));for(let U=0;U<G.length;U++)if(G[U]){let{replacement:H}=_[U];X+=H;break}return Z=K+J.length,J}),!X)return Y;return X+=z0(Y.slice(Z)),String(new RegExp(X))}function w4(Y,_){if(!_.length)return!1;if(!Y.name)return!0;let X=_.length<=200&&Y.name.length<=200?Q8(_,Y.name):"",Z=_;while(X&&Z.includes(X))Z=Z.replace(X,"");return Z.trim().length/_.length>0.1}var i8=Symbol("element");function A6(Y){return Y[i8]}function I6(Y,_){Y[i8]=_}function l8(Y,_){let X=l6(Y,_);return X?A6(X):void 0}var j6=`/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

:host {
  font-size: 13px;
  font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;
  color: #333;
}

svg {
  position: absolute;
  height: 0;
}

x-pw-tooltip {
  backdrop-filter: blur(5px);
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 0.5rem 1.2rem rgba(0,0,0,.3);
  display: none;
  font-size: 12.8px;
  font-weight: normal;
  left: 0;
  line-height: 1.5;
  max-width: 600px;
  position: absolute;
  top: 0;
  padding: 0;
  flex-direction: column;
  overflow: hidden;
}

x-pw-tooltip-line {
  display: flex;
  max-width: 600px;
  padding: 6px;
  user-select: none;
  cursor: pointer;
}

x-pw-tooltip-footer {
  display: flex;
  max-width: 600px;
  padding: 6px;
  user-select: none;
  color: #777;
}

x-pw-dialog {
  background-color: white;
  pointer-events: auto;
  border-radius: 6px;
  box-shadow: 0 0.5rem 1.2rem rgba(0,0,0,.3);
  display: flex;
  flex-direction: column;
  position: absolute;
  z-index: 10;
  font-size: 13px;
}

x-pw-dialog:not(.autosize) {
  width: 400px;
  height: 150px;
}

x-pw-dialog-body {
  display: flex;
  flex-direction: column;
  flex: auto;
}

x-pw-dialog-body label {
  margin: 5px 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
}

x-pw-highlight {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
}

x-pw-action-point {
  position: absolute;
  width: 20px;
  height: 20px;
  background: red;
  border-radius: 10px;
  margin: -10px 0 0 -10px;
  z-index: 2;
}

x-pw-title {
  position: absolute;
  backdrop-filter: blur(5px);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border-radius: 6px;
  padding: 6px;
  font-size: 24px;
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
  z-index: 3;
}

x-pw-user-overlays, x-pw-user-overlay {
  position: absolute;
  inset: 0;
}

@keyframes pw-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

x-pw-separator {
  height: 1px;
  margin: 6px 9px;
  background: rgb(148 148 148 / 90%);
}

x-pw-tool-gripper {
  height: 28px;
  width: 24px;
  margin: 2px 0;
  cursor: grab;
}

x-pw-tool-gripper:active {
  cursor: grabbing;
}

x-pw-tool-gripper > x-div {
  width: 16px;
  height: 16px;
  margin: 6px 4px;
  clip-path: url(#icon-gripper);
  background-color: #555555;
}

x-pw-tools-list > label {
  display: flex;
  align-items: center;
  margin: 0 10px;
  user-select: none;
}

x-pw-tools-list {
  display: flex;
  width: 100%;
  border-bottom: 1px solid #dddddd;
}

x-pw-tool-item {
  pointer-events: auto;
  height: 28px;
  width: 28px;
  border-radius: 3px;
}

x-pw-tool-item:not(.disabled) {
  cursor: pointer;
}

x-pw-tool-item:not(.disabled):hover {
  background-color: hsl(0, 0%, 86%);
}

x-pw-tool-item.toggled {
  background-color: rgba(138, 202, 228, 0.5);
}

x-pw-tool-item.toggled:not(.disabled):hover {
  background-color: #8acae4c4;
}

x-pw-tool-item > x-div {
  width: 16px;
  height: 16px;
  margin: 6px;
  background-color: #3a3a3a;
}

x-pw-tool-item.disabled > x-div {
  background-color: rgba(97, 97, 97, 0.5);
  cursor: default;
}

x-pw-tool-item.record.toggled {
  background-color: transparent;
}

x-pw-tool-item.record.toggled:not(.disabled):hover {
  background-color: hsl(0, 0%, 86%);
}

x-pw-tool-item.record.toggled > x-div {
  background-color: #a1260d;
}

x-pw-tool-item.record.disabled.toggled > x-div {
  opacity: 0.8;
}

x-pw-tool-item.accept > x-div {
  background-color: #388a34;
}

x-pw-tool-item.record > x-div {
  /* codicon: circle-large-filled */
  clip-path: url(#icon-circle-large-filled);
}

x-pw-tool-item.record.toggled > x-div {
  /* codicon: stop-circle */
  clip-path: url(#icon-stop-circle);
}

x-pw-tool-item.pick-locator > x-div {
  /* codicon: inspect */
  clip-path: url(#icon-inspect);
}

x-pw-tool-item.text > x-div {
  /* codicon: whole-word */
  clip-path: url(#icon-whole-word);
}

x-pw-tool-item.visibility > x-div {
  /* codicon: eye */
  clip-path: url(#icon-eye);
}

x-pw-tool-item.value > x-div {
  /* codicon: symbol-constant */
  clip-path: url(#icon-symbol-constant);
}

x-pw-tool-item.snapshot > x-div {
  /* codicon: eye */
  clip-path: url(#icon-gist);
}

x-pw-tool-item.accept > x-div {
  clip-path: url(#icon-check);
}

x-pw-tool-item.cancel > x-div {
  clip-path: url(#icon-close);
}

x-pw-tool-item.succeeded > x-div {
  /* codicon: pass */
  clip-path: url(#icon-pass);
  background-color: #388a34 !important;
}

x-pw-overlay {
  position: absolute;
  top: 0;
  max-width: min-content;
  z-index: 2147483647;
  background: transparent;
  pointer-events: auto;
}

x-pw-overlay x-pw-tools-list {
  background-color: #ffffffdd;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 5px 5px;
  border-radius: 3px;
  border-bottom: none;
}

x-pw-overlay x-pw-tool-item {
  margin: 2px;
}

textarea.text-editor {
  font-family: system-ui,Ubuntu,Droid Sans,sans-serif;
  flex: auto;
  border: none;
  margin: 6px 10px;
  color: #333;
  outline: 1px solid transparent!important;
  resize: none;
  padding: 0;
  font-size: 13px;
}

textarea.text-editor.does-not-match {
  outline: 1px solid red !important;
}

x-div {
  display: block;
}

x-spacer {
  flex: auto;
}

* {
  box-sizing: border-box;
}

*[hidden] {
  display: none !important;
}

x-locator-editor {
  flex: none;
  width: 100%;
  height: 60px;
  padding: 4px;
  border-bottom: 1px solid #dddddd;
  outline: 1px solid transparent;
}

x-locator-editor.does-not-match {
  outline: 1px solid red;
}

.CodeMirror {
  width: 100% !important;
  height: 100% !important;
}

x-pw-action-list {
  flex: auto;
  display: flex;
  flex-direction: column;
  user-select: none;
}

x-pw-action-item {
  padding: 6px 10px;
  cursor: pointer;
  overflow: hidden;
}

x-pw-action-item:hover {
  background-color: hsl(0, 0%, 95%);
}

x-pw-action-item:last-child {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}
`;class f6{_glassPaneElement;_glassPaneShadow;_renderedEntries=[];_actionPointElement;_titleElement;_userOverlayContainer;_userOverlays=new Map;_userOverlayHidden=!1;_isUnderTest;_injectedScript;_rafRequest;_language="javascript";_elementHighlightSelectors=new Map;constructor(Y){this._injectedScript=Y;let _=Y.document;if(this._isUnderTest=Y.isUnderTest,this._glassPaneElement=_.createElement("x-pw-glass"),this._glassPaneElement.setAttribute("popover","manual"),this._glassPaneElement.style.inset="0",this._glassPaneElement.style.width="100%",this._glassPaneElement.style.height="100%",this._glassPaneElement.style.maxWidth="none",this._glassPaneElement.style.maxHeight="none",this._glassPaneElement.style.padding="0",this._glassPaneElement.style.margin="0",this._glassPaneElement.style.border="none",this._glassPaneElement.style.overflow="visible",this._glassPaneElement.style.pointerEvents="none",this._glassPaneElement.style.display="flex",this._glassPaneElement.style.backgroundColor="transparent",this._actionPointElement=_.createElement("x-pw-action-point"),this._actionPointElement.setAttribute("hidden","true"),this._titleElement=_.createElement("x-pw-title"),this._titleElement.setAttribute("hidden","true"),this._userOverlayContainer=_.createElement("x-pw-user-overlays"),this._userOverlayContainer.setAttribute("hidden","true"),this._glassPaneShadow=this._glassPaneElement.attachShadow({mode:this._isUnderTest?"open":"closed"}),typeof this._glassPaneShadow.adoptedStyleSheets.push==="function"){let X=new this._injectedScript.window.CSSStyleSheet;X.replaceSync(j6),this._glassPaneShadow.adoptedStyleSheets.push(X)}else{let X=this._injectedScript.document.createElement("style");X.textContent=j6,this._glassPaneShadow.appendChild(X)}this._glassPaneShadow.appendChild(this._actionPointElement),this._glassPaneShadow.appendChild(this._titleElement),this._glassPaneShadow.appendChild(this._userOverlayContainer)}install(){if(!this._injectedScript.document.documentElement)return;if(!this._injectedScript.document.documentElement.contains(this._glassPaneElement)||this._glassPaneElement.nextElementSibling)this._injectedScript.document.documentElement.appendChild(this._glassPaneElement);this._bringToFront()}_bringToFront(){this._glassPaneElement.hidePopover(),this._glassPaneElement.showPopover()}setLanguage(Y){this._language=Y}addElementHighlight(Y,_){let X=v(Y);this._elementHighlightSelectors.set(X,{selector:Y,cssStyle:_}),this._ensureElementHighlightRaf()}removeElementHighlight(Y){let _=v(Y);if(!this._elementHighlightSelectors.delete(_))return;if(this._elementHighlightSelectors.size===0){if(this._rafRequest)this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest),this._rafRequest=void 0;this.clearHighlight()}}_ensureElementHighlightRaf(){if(this._rafRequest)return;let Y=()=>{let _=[];for(let{selector:X,cssStyle:Z}of this._elementHighlightSelectors.values()){let $=this._injectedScript.querySelectorAll(X,this._injectedScript.document.documentElement),J=w0(this._language,v(X)),Q=$.length>1?"#f6b26b7f":"#6fa8dc7f";for(let K=0;K<$.length;++K){let G=$.length>1?` [${K+1} of ${$.length}]`:"";_.push({element:$[K],color:Q,tooltipText:J+G,cssStyle:Z})}}this.updateHighlight(_),this._rafRequest=this._injectedScript.utils.builtins.requestAnimationFrame(Y)};this._rafRequest=this._injectedScript.utils.builtins.requestAnimationFrame(Y)}uninstall(){if(this._rafRequest)this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest),this._rafRequest=void 0;this._elementHighlightSelectors.clear(),this._glassPaneElement.remove()}showActionPoint(Y,_,X){if(this._actionPointElement.style.top=_+"px",this._actionPointElement.style.left=Y+"px",this._actionPointElement.hidden=!1,X)this._actionPointElement.style.animation=`pw-fade-out ${X}ms ease-out forwards`;else this._actionPointElement.style.animation=""}hideActionPoint(){this._actionPointElement.hidden=!0}showActionTitle(Y,_,X,Z){if(this._titleElement.textContent=Y,this._titleElement.hidden=!1,_){let $=_/4;this._titleElement.style.animation=`pw-fade-out ${$}ms ease-out ${_-$}ms forwards`}else this._titleElement.style.animation="";switch(this._titleElement.style.top="",this._titleElement.style.bottom="",this._titleElement.style.left="",this._titleElement.style.right="",this._titleElement.style.transform="",X){case"top-left":this._titleElement.style.top="6px",this._titleElement.style.left="6px";break;case"top":this._titleElement.style.top="6px",this._titleElement.style.left="50%",this._titleElement.style.transform="translateX(-50%)";break;case"bottom-left":this._titleElement.style.bottom="6px",this._titleElement.style.left="6px";break;case"bottom":this._titleElement.style.bottom="6px",this._titleElement.style.left="50%",this._titleElement.style.transform="translateX(-50%)";break;case"bottom-right":this._titleElement.style.bottom="6px",this._titleElement.style.right="6px";break;case"top-right":default:this._titleElement.style.top="6px",this._titleElement.style.right="6px";break}if(Z)this._titleElement.style.fontSize=Z+"px"}hideActionTitle(){this._titleElement.hidden=!0}addUserOverlay(Y,_){let X=this._injectedScript.document.createElement("div");X.className="x-pw-user-overlay",X.innerHTML=_;for(let Z of X.querySelectorAll("script"))Z.remove();for(let Z of X.querySelectorAll("*"))for(let $ of[...Z.attributes])if($.name.startsWith("on"))Z.removeAttribute($.name);return this._userOverlays.set(Y,X),this._userOverlayContainer.appendChild(X),this._userOverlayContainer.hidden=this._userOverlayHidden,Y}getUserOverlay(Y){return this._userOverlays.get(Y)}removeUserOverlay(Y){let _=this._userOverlays.get(Y);if(_)_.remove(),this._userOverlays.delete(Y);if(this._userOverlays.size===0)this._userOverlayContainer.hidden=!0}setUserOverlaysVisible(Y){this._userOverlayHidden=!Y,this._userOverlayContainer.hidden=!Y||this._userOverlays.size===0}clearHighlight(){for(let Y of this._renderedEntries)Y.highlightElement?.remove(),Y.tooltipElement?.remove();this._renderedEntries=[]}maskElements(Y,_){this.updateHighlight(Y.map((X)=>({element:X,color:_})))}updateHighlight(Y){if(this._highlightIsUpToDate(Y))return;this.clearHighlight();for(let _ of Y){let X=this._createHighlightElement();this._glassPaneShadow.appendChild(X);let Z;if(_.tooltipText){Z=this._injectedScript.document.createElement("x-pw-tooltip"),this._glassPaneShadow.appendChild(Z),Z.style.top="0",Z.style.left="0",Z.style.display="flex";let $=this._injectedScript.document.createElement("x-pw-tooltip-line");$.textContent=_.tooltipText,Z.appendChild($)}this._renderedEntries.push({targetElement:_.element,box:s8(_.box),color:_.color,borderColor:_.borderColor,fadeDuration:_.fadeDuration,cssStyle:_.cssStyle,tooltipElement:Z,highlightElement:X})}for(let _ of this._renderedEntries){if(!_.box&&!_.targetElement)continue;if(_.box=_.box||_.targetElement.getBoundingClientRect(),!_.tooltipElement)continue;let{anchorLeft:X,anchorTop:Z}=this.tooltipPosition(_.box,_.tooltipElement);_.tooltipTop=Z,_.tooltipLeft=X}for(let _ of this._renderedEntries){if(_.tooltipElement)_.tooltipElement.style.top=_.tooltipTop+"px",_.tooltipElement.style.left=_.tooltipLeft+"px";let X=_.box;if(_.highlightElement.style.backgroundColor=_.color,_.highlightElement.style.left=X.x+"px",_.highlightElement.style.top=X.y+"px",_.highlightElement.style.width=X.width+"px",_.highlightElement.style.height=X.height+"px",_.highlightElement.style.display="block",_.borderColor)_.highlightElement.style.border="2px solid "+_.borderColor;if(_.fadeDuration)_.highlightElement.style.animation=`pw-fade-out ${_.fadeDuration}ms ease-out forwards`;if(_.cssStyle)_.highlightElement.style.cssText+=";"+_.cssStyle;if(this._isUnderTest)console.error("Highlight box for test: "+JSON.stringify({x:X.x,y:X.y,width:X.width,height:X.height}))}}firstBox(){return this._renderedEntries[0]?.box}firstTooltipBox(){let Y=this._renderedEntries[0];if(!Y||!Y.tooltipElement||Y.tooltipLeft===void 0||Y.tooltipTop===void 0)return;return{x:Y.tooltipLeft,y:Y.tooltipTop,left:Y.tooltipLeft,top:Y.tooltipTop,width:Y.tooltipElement.offsetWidth,height:Y.tooltipElement.offsetHeight,bottom:Y.tooltipTop+Y.tooltipElement.offsetHeight,right:Y.tooltipLeft+Y.tooltipElement.offsetWidth,toJSON:()=>{}}}tooltipPosition(Y,_){let{offsetWidth:X,offsetHeight:Z}=_,$=this._glassPaneElement.offsetWidth,J=this._glassPaneElement.offsetHeight,Q=Math.max(5,Y.left);if(Q+X>$-5)Q=$-X-5;let K=Math.max(0,Y.bottom)+5;if(K+Z>J-5)if(Math.max(0,Y.top)>Z+5)K=Math.max(0,Y.top)-Z-5;else K=J-5-Z;return{anchorLeft:Q,anchorTop:K}}_highlightIsUpToDate(Y){if(Y.length!==this._renderedEntries.length)return!1;for(let _=0;_<this._renderedEntries.length;++_){if(Y[_].element!==this._renderedEntries[_].targetElement)return!1;if(Y[_].color!==this._renderedEntries[_].color)return!1;if(Y[_].cssStyle!==this._renderedEntries[_].cssStyle)return!1;let X=this._renderedEntries[_].box;if(!X)return!1;let Z=Y[_].box?s8(Y[_].box):Y[_].element.getBoundingClientRect();if(Z.top!==X.top||Z.right!==X.right||Z.bottom!==X.bottom||Z.left!==X.left)return!1}return!0}_createHighlightElement(){return this._injectedScript.document.createElement("x-pw-highlight")}appendChild(Y){this._glassPaneShadow.appendChild(Y)}onGlassPaneClick(Y){this._glassPaneElement.style.pointerEvents="auto",this._glassPaneElement.style.backgroundColor="rgba(0, 0, 0, 0.3)",this._glassPaneElement.addEventListener("click",Y)}offGlassPaneClick(Y){this._glassPaneElement.style.pointerEvents="none",this._glassPaneElement.style.backgroundColor="transparent",this._glassPaneElement.removeEventListener("click",Y)}}function s8(Y){if(!Y)return;return new DOMRect(Y.x,Y.y,Y.width,Y.height)}function M4(Y,_,X){let Z=Y.left-_.right;if(Z<0||X!==void 0&&Z>X)return;return Z+Math.max(_.bottom-Y.bottom,0)+Math.max(Y.top-_.top,0)}function H4(Y,_,X){let Z=_.left-Y.right;if(Z<0||X!==void 0&&Z>X)return;return Z+Math.max(_.bottom-Y.bottom,0)+Math.max(Y.top-_.top,0)}function W4(Y,_,X){let Z=_.top-Y.bottom;if(Z<0||X!==void 0&&Z>X)return;return Z+Math.max(Y.left-_.left,0)+Math.max(_.right-Y.right,0)}function q4(Y,_,X){let Z=Y.top-_.bottom;if(Z<0||X!==void 0&&Z>X)return;return Z+Math.max(Y.left-_.left,0)+Math.max(_.right-Y.right,0)}function B4(Y,_,X){let Z=X===void 0?50:X,$=0;if(Y.left-_.right>=0)$+=Y.left-_.right;if(_.left-Y.right>=0)$+=_.left-Y.right;if(_.top-Y.bottom>=0)$+=_.top-Y.bottom;if(Y.top-_.bottom>=0)$+=Y.top-_.bottom;return $>Z?void 0:$}var n8=["left-of","right-of","above","below","near"];function y1(Y,_,X,Z){let $=_.getBoundingClientRect(),J={"left-of":H4,"right-of":M4,above:W4,below:q4,near:B4}[Y],Q;for(let K of X){if(K===_)continue;let G=J($,K.getBoundingClientRect(),Z);if(G===void 0)continue;if(Q===void 0||G<Q)Q=G}return Q}function r8(Y,_){let X=typeof Y==="string"&&!_.caseSensitive?Y.toUpperCase():Y,Z=typeof _.value==="string"&&!_.caseSensitive?_.value.toUpperCase():_.value;if(_.op==="<truthy>")return!!X;if(_.op==="="){if(Z instanceof RegExp)return typeof X==="string"&&!!X.match(Z);return X===Z}if(typeof X!=="string"||typeof Z!=="string")return!1;if(_.op==="*=")return X.includes(Z);if(_.op==="^=")return X.startsWith(Z);if(_.op==="$=")return X.endsWith(Z);if(_.op==="|=")return X===Z||X.startsWith(Z+"-");if(_.op==="~=")return X.split(" ").includes(Z);return!1}function b1(Y){let _=Y.ownerDocument;return Y.nodeName==="SCRIPT"||Y.nodeName==="NOSCRIPT"||Y.nodeName==="STYLE"||_.head&&_.head.contains(Y)}function h(Y,_){let X=Y.get(_);if(X===void 0){if(X={full:"",normalized:"",immediate:[]},!b1(_)){let Z="";if(_ instanceof HTMLInputElement&&(_.type==="submit"||_.type==="button"))X={full:_.value,normalized:j(_.value),immediate:[_.value]};else{for(let $=_.firstChild;$;$=$.nextSibling)if($.nodeType===Node.TEXT_NODE)X.full+=$.nodeValue||"",Z+=$.nodeValue||"";else if($.nodeType===Node.COMMENT_NODE)continue;else{if(Z)X.immediate.push(Z);if(Z="",$.nodeType===Node.ELEMENT_NODE)X.full+=h(Y,$).full}if(Z)X.immediate.push(Z);if(_.shadowRoot)X.full+=h(Y,_.shadowRoot).full;if(X.full)X.normalized=j(X.full)}}Y.set(_,X)}return X}function E0(Y,_,X){if(b1(_))return"none";if(!X(h(Y,_)))return"none";for(let Z=_.firstChild;Z;Z=Z.nextSibling)if(Z.nodeType===Node.ELEMENT_NODE&&X(h(Y,Z)))return"selfAndChildren";if(_.shadowRoot&&X(h(Y,_.shadowRoot)))return"selfAndChildren";return"self"}function x1(Y,_){let X=U6(_);if(X)return X.map((J)=>h(Y,J));let Z=_.getAttribute("aria-label");if(Z!==null&&!!Z.trim())return[{full:Z,normalized:j(Z),immediate:[Z]}];let $=_.nodeName==="INPUT"&&_.type!=="hidden";if(["BUTTON","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA"].includes(_.nodeName)||$){let J=_.labels;if(J)return[...J].map((Q)=>h(Y,Q))}return[]}var a8=["selected","checked","pressed","expanded","level","disabled","name","include-hidden"];a8.sort();function Y1(Y,_,X){if(!_.includes(X))throw Error(`"${Y}" attribute is only supported for roles: ${_.slice().sort().map((Z)=>`"${Z}"`).join(", ")}`)}function N0(Y,_){if(Y.op!=="<truthy>"&&!_.includes(Y.value))throw Error(`"${Y.name}" must be one of ${_.map((X)=>JSON.stringify(X)).join(", ")}`)}function T0(Y,_){if(!_.includes(Y.op))throw Error(`"${Y.name}" does not support "${Y.op}" matcher`)}function D4(Y,_){let X={role:_};for(let Z of Y)switch(Z.name){case"checked":{Y1(Z.name,a0,_),N0(Z,[!0,!1,"mixed"]),T0(Z,["<truthy>","="]),X.checked=Z.op==="<truthy>"?!0:Z.value;break}case"pressed":{Y1(Z.name,o0,_),N0(Z,[!0,!1,"mixed"]),T0(Z,["<truthy>","="]),X.pressed=Z.op==="<truthy>"?!0:Z.value;break}case"selected":{Y1(Z.name,r0,_),N0(Z,[!0,!1]),T0(Z,["<truthy>","="]),X.selected=Z.op==="<truthy>"?!0:Z.value;break}case"expanded":{Y1(Z.name,t0,_),N0(Z,[!0,!1]),T0(Z,["<truthy>","="]),X.expanded=Z.op==="<truthy>"?!0:Z.value;break}case"level":{if(Y1(Z.name,e0,_),typeof Z.value==="string")Z.value=+Z.value;if(Z.op!=="="||typeof Z.value!=="number"||Number.isNaN(Z.value))throw Error('"level" attribute must be compared to a number');X.level=Z.value;break}case"disabled":{N0(Z,[!0,!1]),T0(Z,["<truthy>","="]),X.disabled=Z.op==="<truthy>"?!0:Z.value;break}case"name":{if(Z.op==="<truthy>")throw Error('"name" attribute must have a value');if(typeof Z.value!=="string"&&!(Z.value instanceof RegExp))throw Error('"name" attribute must be a string or a regular expression');X.name=Z.value,X.nameOp=Z.op,X.exact=Z.caseSensitive;break}case"include-hidden":{N0(Z,[!0,!1]),T0(Z,["<truthy>","="]),X.includeHidden=Z.op==="<truthy>"?!0:Z.value;break}default:throw Error(`Unknown attribute "${Z.name}", must be one of ${a8.map(($)=>`"${$}"`).join(", ")}.`)}return X}function L4(Y,_,X){let Z=[],$=(Q)=>{if(P(Q)!==_.role)return;if(_.selected!==void 0&&E1(Q)!==_.selected)return;if(_.checked!==void 0&&N1(Q)!==_.checked)return;if(_.pressed!==void 0&&S1(Q)!==_.pressed)return;if(_.expanded!==void 0&&h1(Q)!==_.expanded)return;if(_.level!==void 0&&g1(Q)!==_.level)return;if(_.disabled!==void 0&&r(Q)!==_.disabled)return;if(!_.includeHidden){if(p(Q))return}if(_.name!==void 0){let K=j(s(Q,!!_.includeHidden));if(typeof _.name==="string")_.name=j(_.name);if(X&&!_.exact&&_.nameOp==="=")_.nameOp="*=";if(!r8(K,{name:"",jsonPath:[],op:_.nameOp||"=",value:_.name,caseSensitive:!!_.exact}))return}Z.push(Q)},J=(Q)=>{let K=[];if(Q.shadowRoot)K.push(Q.shadowRoot);for(let G of Q.querySelectorAll("*"))if($(G),G.shadowRoot)K.push(G.shadowRoot);K.forEach(J)};return J(Y),Z}function C6(Y){return{queryAll:(_,X)=>{let Z=X0(X,!0),$=Z.name.toLowerCase();if(!$)throw Error("Role must not be empty");let J=D4(Z.attributes,$);Z0();try{return L4(_,J,Y)}finally{$0()}}}}class N6{_engines;_cacheQueryCSS;_cacheMatches;_cacheQuery;_cacheMatchesSimple;_cacheMatchesParents;_cacheCallMatches;_cacheCallQuery;_cacheQuerySimple;_cacheText;_scoreMap;_retainCacheCounter=0;constructor(){this._cacheText=new Map,this._cacheQueryCSS=new Map,this._cacheMatches=new Map,this._cacheQuery=new Map,this._cacheMatchesSimple=new Map,this._cacheMatchesParents=new Map,this._cacheCallMatches=new Map,this._cacheCallQuery=new Map,this._cacheQuerySimple=new Map,this._engines=new Map,this._engines.set("not",R4),this._engines.set("is",X1),this._engines.set("where",X1),this._engines.set("has",O4),this._engines.set("scope",V4),this._engines.set("light",z4),this._engines.set("visible",I4),this._engines.set("text",F4),this._engines.set("text-is",P4),this._engines.set("text-matches",A4),this._engines.set("has-text",j4),this._engines.set("right-of",_1("right-of")),this._engines.set("left-of",_1("left-of")),this._engines.set("above",_1("above")),this._engines.set("below",_1("below")),this._engines.set("near",_1("near")),this._engines.set("nth-match",f4);let Y=[...this._engines.keys()];Y.sort();let _=[...e1];if(_.sort(),Y.join("|")!==_.join("|"))throw Error(`Please keep customCSSNames in sync with evaluator engines: ${Y.join("|")} vs ${_.join("|")}`)}begin(){++this._retainCacheCounter}end(){if(--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(Y,_,X,Z){if(!Y.has(_))Y.set(_,[]);let $=Y.get(_),J=$.find((K)=>X.every((G,U)=>K.rest[U]===G));if(J)return J.result;let Q=Z();return $.push({rest:X,result:Q}),Q}_checkSelector(Y){if(!(typeof Y==="object"&&Y&&(Array.isArray(Y)||("simples"in Y)&&Y.simples.length)))throw Error(`Malformed selector "${Y}"`);return Y}matches(Y,_,X){let Z=this._checkSelector(_);this.begin();try{return this._cached(this._cacheMatches,Y,[Z,X.scope,X.pierceShadow,X.originalScope],()=>{if(Array.isArray(Z))return this._matchesEngine(X1,Y,Z,X);if(this._hasScopeClause(Z))X=this._expandContextForScopeMatching(X);if(!this._matchesSimple(Y,Z.simples[Z.simples.length-1].selector,X))return!1;return this._matchesParents(Y,Z,Z.simples.length-2,X)})}finally{this.end()}}query(Y,_){let X=this._checkSelector(_);this.begin();try{return this._cached(this._cacheQuery,X,[Y.scope,Y.pierceShadow,Y.originalScope],()=>{if(Array.isArray(X))return this._queryEngine(X1,Y,X);if(this._hasScopeClause(X))Y=this._expandContextForScopeMatching(Y);let Z=this._scoreMap;this._scoreMap=new Map;let $=this._querySimple(Y,X.simples[X.simples.length-1].selector);if($=$.filter((J)=>this._matchesParents(J,X,X.simples.length-2,Y)),this._scoreMap.size)$.sort((J,Q)=>{let K=this._scoreMap.get(J),G=this._scoreMap.get(Q);if(K===G)return 0;if(K===void 0)return 1;if(G===void 0)return-1;return K-G});return this._scoreMap=Z,$})}finally{this.end()}}_markScore(Y,_){if(this._scoreMap)this._scoreMap.set(Y,_)}_hasScopeClause(Y){return Y.simples.some((_)=>_.selector.functions.some((X)=>X.name==="scope"))}_expandContextForScopeMatching(Y){if(Y.scope.nodeType!==1)return Y;let _=N(Y.scope);if(!_)return Y;return{...Y,scope:_,originalScope:Y.originalScope||Y.scope}}_matchesSimple(Y,_,X){return this._cached(this._cacheMatchesSimple,Y,[_,X.scope,X.pierceShadow,X.originalScope],()=>{if(Y===X.scope)return!1;if(_.css&&!this._matchesCSS(Y,_.css))return!1;for(let Z of _.functions)if(!this._matchesEngine(this._getEngine(Z.name),Y,Z.args,X))return!1;return!0})}_querySimple(Y,_){if(!_.functions.length)return this._queryCSS(Y,_.css||"*");return this._cached(this._cacheQuerySimple,_,[Y.scope,Y.pierceShadow,Y.originalScope],()=>{let{css:X,functions:Z}=_;if(X==="*"&&Z.length)X=void 0;let $,J=-1;if(X!==void 0)$=this._queryCSS(Y,X);else{if(J=Z.findIndex((Q)=>this._getEngine(Q.name).query!==void 0),J===-1)J=0;$=this._queryEngine(this._getEngine(Z[J].name),Y,Z[J].args)}for(let Q=0;Q<Z.length;Q++){if(Q===J)continue;let K=this._getEngine(Z[Q].name);if(K.matches!==void 0)$=$.filter((G)=>this._matchesEngine(K,G,Z[Q].args,Y))}for(let Q=0;Q<Z.length;Q++){if(Q===J)continue;let K=this._getEngine(Z[Q].name);if(K.matches===void 0)$=$.filter((G)=>this._matchesEngine(K,G,Z[Q].args,Y))}return $})}_matchesParents(Y,_,X,Z){if(X<0)return!0;return this._cached(this._cacheMatchesParents,Y,[_,X,Z.scope,Z.pierceShadow,Z.originalScope],()=>{let{selector:$,combinator:J}=_.simples[X];if(J===">"){let Q=u1(Y,Z);if(!Q||!this._matchesSimple(Q,$,Z))return!1;return this._matchesParents(Q,_,X-1,Z)}if(J==="+"){let Q=E6(Y,Z);if(!Q||!this._matchesSimple(Q,$,Z))return!1;return this._matchesParents(Q,_,X-1,Z)}if(J===""){let Q=u1(Y,Z);while(Q){if(this._matchesSimple(Q,$,Z)){if(this._matchesParents(Q,_,X-1,Z))return!0;if(_.simples[X-1].combinator==="")break}Q=u1(Q,Z)}return!1}if(J==="~"){let Q=E6(Y,Z);while(Q){if(this._matchesSimple(Q,$,Z)){if(this._matchesParents(Q,_,X-1,Z))return!0;if(_.simples[X-1].combinator==="~")break}Q=E6(Q,Z)}return!1}if(J===">="){let Q=Y;while(Q){if(this._matchesSimple(Q,$,Z)){if(this._matchesParents(Q,_,X-1,Z))return!0;if(_.simples[X-1].combinator==="")break}Q=u1(Q,Z)}return!1}throw Error(`Unsupported combinator "${J}"`)})}_matchesEngine(Y,_,X,Z){if(Y.matches)return this._callMatches(Y,_,X,Z);if(Y.query)return this._callQuery(Y,X,Z).includes(_);throw Error('Selector engine should implement "matches" or "query"')}_queryEngine(Y,_,X){if(Y.query)return this._callQuery(Y,X,_);if(Y.matches)return this._queryCSS(_,"*").filter((Z)=>this._callMatches(Y,Z,X,_));throw Error('Selector engine should implement "matches" or "query"')}_callMatches(Y,_,X,Z){return this._cached(this._cacheCallMatches,_,[Y,Z.scope,Z.pierceShadow,Z.originalScope,...X],()=>{return Y.matches(_,X,Z,this)})}_callQuery(Y,_,X){return this._cached(this._cacheCallQuery,Y,[X.scope,X.pierceShadow,X.originalScope,..._],()=>{return Y.query(X,_,this)})}_matchesCSS(Y,_){return Y.matches(_)}_queryCSS(Y,_){return this._cached(this._cacheQueryCSS,_,[Y.scope,Y.pierceShadow,Y.originalScope],()=>{let X=[];function Z($){if(X=X.concat([...$.querySelectorAll(_)]),!Y.pierceShadow)return;if($.shadowRoot)Z($.shadowRoot);for(let J of $.querySelectorAll("*"))if(J.shadowRoot)Z(J.shadowRoot)}return Z(Y.scope),X})}_getEngine(Y){let _=this._engines.get(Y);if(!_)throw Error(`Unknown selector engine "${Y}"`);return _}}var X1={matches(Y,_,X,Z){if(_.length===0)throw Error('"is" engine expects non-empty selector list');return _.some(($)=>Z.matches(Y,$,X))},query(Y,_,X){if(_.length===0)throw Error('"is" engine expects non-empty selector list');let Z=[];for(let $ of _)Z=Z.concat(X.query(Y,$));return _.length===1?Z:T6(Z)}},O4={matches(Y,_,X,Z){if(_.length===0)throw Error('"has" engine expects non-empty selector list');return Z.query({...X,scope:Y},_).length>0}},V4={matches(Y,_,X,Z){if(_.length!==0)throw Error('"scope" engine expects no arguments');let $=X.originalScope||X.scope;if($.nodeType===9)return Y===$.documentElement;return Y===$},query(Y,_,X){if(_.length!==0)throw Error('"scope" engine expects no arguments');let Z=Y.originalScope||Y.scope;if(Z.nodeType===9){let $=Z.documentElement;return $?[$]:[]}if(Z.nodeType===1)return[Z];return[]}},R4={matches(Y,_,X,Z){if(_.length===0)throw Error('"not" engine expects non-empty selector list');return!Z.matches(Y,_,X)}},z4={query(Y,_,X){return X.query({...Y,pierceShadow:!1},_)},matches(Y,_,X,Z){return Z.matches(Y,_,{...X,pierceShadow:!1})}},I4={matches(Y,_,X,Z){if(_.length)throw Error('"visible" engine expects no arguments');return b(Y)}},F4={matches(Y,_,X,Z){if(_.length!==1||typeof _[0]!=="string")throw Error('"text" engine expects a single string');let $=j(_[0]).toLowerCase(),J=(Q)=>Q.normalized.toLowerCase().includes($);return E0(Z._cacheText,Y,J)==="self"}},P4={matches(Y,_,X,Z){if(_.length!==1||typeof _[0]!=="string")throw Error('"text-is" engine expects a single string');let $=j(_[0]),J=(Q)=>{if(!$&&!Q.immediate.length)return!0;return Q.immediate.some((K)=>j(K)===$)};return E0(Z._cacheText,Y,J)!=="none"}},A4={matches(Y,_,X,Z){if(_.length===0||typeof _[0]!=="string"||_.length>2||_.length===2&&typeof _[1]!=="string")throw Error('"text-matches" engine expects a regexp body and optional regexp flags');let $=new RegExp(_[0],_.length===2?_[1]:void 0),J=(Q)=>$.test(Q.full);return E0(Z._cacheText,Y,J)==="self"}},j4={matches(Y,_,X,Z){if(_.length!==1||typeof _[0]!=="string")throw Error('"has-text" engine expects a single string');if(b1(Y))return!1;let $=j(_[0]).toLowerCase();return((Q)=>Q.normalized.toLowerCase().includes($))(h(Z._cacheText,Y))}};function _1(Y){return{matches(_,X,Z,$){let J=X.length&&typeof X[X.length-1]==="number"?X[X.length-1]:void 0,Q=J===void 0?X:X.slice(0,X.length-1);if(X.length<1+(J===void 0?0:1))throw Error(`"${Y}" engine expects a selector list and optional maximum distance in pixels`);let K=$.query(Z,Q),G=y1(Y,_,K,J);if(G===void 0)return!1;return $._markScore(_,G),!0}}}var f4={query(Y,_,X){let Z=_[_.length-1];if(_.length<2)throw Error('"nth-match" engine expects non-empty selector list and an index argument');if(typeof Z!=="number"||Z<1)throw Error('"nth-match" engine expects a one-based index as the last argument');let $=X1.query(Y,_.slice(0,_.length-1),X);return Z--,Z<$.length?[$[Z]]:[]}};function u1(Y,_){if(Y===_.scope)return;if(!_.pierceShadow)return Y.parentElement||void 0;return N(Y)}function E6(Y,_){if(Y===_.scope)return;return Y.previousElementSibling||void 0}function T6(Y){let _=new Map,X=[],Z=[];function $(Q){let K=_.get(Q);if(K)return K;let G=N(Q);if(G)$(G).children.push(Q);else X.push(Q);return K={children:[],taken:!1},_.set(Q,K),K}for(let Q of Y)$(Q).taken=!0;function J(Q){let K=_.get(Q);if(K.taken)Z.push(Q);if(K.children.length>1){let G=new Set(K.children);K.children=[];let U=Q.firstElementChild;while(U&&K.children.length<G.size){if(G.has(U))K.children.push(U);U=U.nextElementSibling}U=Q.shadowRoot?Q.shadowRoot.firstElementChild:null;while(U&&K.children.length<G.size){if(G.has(U))K.children.push(U);U=U.nextElementSibling}}K.children.forEach(J)}return X.forEach(J),Z}var e8=10,S0=e8/2,o8=1,C4=2,E4=10,N4=50,Y5=100,_5=120,X5=140,Z5=160,m1=180,$5=200,t8=250,T4=_5+S0,k4=X5+S0,S4=Y5+S0,h4=Z5+S0,g4=m1+S0,v4=$5+S0,y4=300,b4=500,J5=510,k6=520,K5=530,h6=1e4,x4=1e7,u4=1000;function v6(Y,_,X){Y._evaluator.begin();let Z={allowText:new Map,disallowText:new Map};Z0(),F0();try{let $=[];if(X.forTextExpect){let K=Z1(Y,_.ownerDocument.documentElement,X);for(let G=_;G;G=N(G)){let U=H0(Z,Y,G,{...X,noText:!0});if(!U)continue;if(W0(U)<=u4){K=U;break}}$=[d1(K)]}else{if(!_.matches("input,textarea,select")&&!_.isContentEditable){let K=M0(_,"button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]",X.root);if(K&&b(K))_=K}if(X.multiple){let K=H0(Z,Y,_,X),G=H0(Z,Y,_,{...X,noText:!0}),U=[K,G];if(Z.allowText.clear(),Z.disallowText.clear(),K&&S6(K))U.push(H0(Z,Y,_,{...X,noCSSId:!0}));if(G&&S6(G))U.push(H0(Z,Y,_,{...X,noText:!0,noCSSId:!0}));if(U=U.filter(Boolean),!U.length){let H=Z1(Y,_,X);if(U.push(H),S6(H))U.push(Z1(Y,_,{...X,noCSSId:!0}))}$=[...new Set(U.map((H)=>d1(H)))]}else{let K=H0(Z,Y,_,X)||Z1(Y,_,X);$=[d1(K)]}}let J=$[0],Q=Y.parseSelector(J);return{selector:J,selectors:$,elements:Y.querySelectorAll(Q,X.root??_.ownerDocument)}}finally{P0(),$0(),Y._evaluator.end()}}function H0(Y,_,X,Z){if(Z.root&&!i0(Z.root,X))throw Error("Target element must belong to the root's subtree");if(X===Z.root)return[{engine:"css",selector:":scope",score:1}];if(X.ownerDocument.documentElement===X)return[{engine:"css",selector:"html",score:1}];let $=null,J=(K)=>{if(!$||W0(K)<W0($))$=K},Q=[];if(!Z.noText)for(let K of m4(_,X,!Z.isRecursive))Q.push({candidate:K,isTextCandidate:!0});for(let K of p4(_,X,Z)){if(Z.omitInternalEngines&&K.engine.startsWith("internal:"))continue;Q.push({candidate:[K],isTextCandidate:!1})}Q.sort((K,G)=>W0(K.candidate)-W0(G.candidate));for(let{candidate:K,isTextCandidate:G}of Q){let U=_.querySelectorAll(_.parseSelector(d1(K)),Z.root??X.ownerDocument);if(!U.includes(X))continue;if(U.length===1){J(K);break}let H=U.indexOf(X);if(H>5)continue;if(J([...K,{engine:"nth",selector:String(H),score:h6}]),Z.isRecursive)continue;for(let w=N(X);w&&w!==Z.root;w=N(w)){let W=U.filter((I)=>i0(w,I)&&I!==w),L=W.indexOf(X);if(W.length>5||L===-1||L===H&&W.length>1)continue;let M=W.length===1?K:[...K,{engine:"nth",selector:String(L),score:h6}];if($&&W0([{engine:"",selector:"",score:1},...M])>=W0($))continue;let q=!!Z.noText||G,V=q?Y.disallowText:Y.allowText,R=V.get(w);if(R===void 0)R=H0(Y,_,w,{...Z,isRecursive:!0,noText:q})||Z1(_,w,Z),V.set(w,R);if(!R)continue;J([...R,...M])}}return $}function p4(Y,_,X){let Z=[];{for(let Q of["data-testid","data-test-id","data-test"])if(Q!==X.testIdAttributeName&&_.getAttribute(Q))Z.push({engine:"css",selector:`[${Q}=${U0(_.getAttribute(Q))}]`,score:C4});if(!X.noCSSId){let Q=_.getAttribute("id");if(Q&&!d4(Q))Z.push({engine:"css",selector:Q5(Q),score:b4})}Z.push({engine:"css",selector:Y0(_),score:K5})}if(_.nodeName==="IFRAME"){for(let Q of["name","title"])if(_.getAttribute(Q))Z.push({engine:"css",selector:`${Y0(_)}[${Q}=${U0(_.getAttribute(Q))}]`,score:E4});if(_.getAttribute(X.testIdAttributeName))Z.push({engine:"css",selector:`[${X.testIdAttributeName}=${U0(_.getAttribute(X.testIdAttributeName))}]`,score:o8});return g6([Z]),Z}if(_.getAttribute(X.testIdAttributeName))Z.push({engine:"internal:testid",selector:`[${X.testIdAttributeName}=${y(_.getAttribute(X.testIdAttributeName),!0)}]`,score:o8});if(_.nodeName==="INPUT"||_.nodeName==="TEXTAREA"){let Q=_;if(Q.placeholder){Z.push({engine:"internal:attr",selector:`[placeholder=${y(Q.placeholder,!0)}]`,score:T4});for(let K of k0(Q.placeholder))Z.push({engine:"internal:attr",selector:`[placeholder=${y(K.text,!1)}]`,score:_5-K.scoreBonus})}}let $=x1(Y._evaluator._cacheText,_);for(let Q of $){let K=Q.normalized;Z.push({engine:"internal:label",selector:u(K,!0),score:k4});for(let G of k0(K))Z.push({engine:"internal:label",selector:u(G.text,!1),score:X5-G.scoreBonus})}let J=P(_);if(J&&!["none","presentation"].includes(J))Z.push({engine:"internal:role",selector:J,score:J5});if(_.getAttribute("name")&&["BUTTON","FORM","FIELDSET","FRAME","IFRAME","INPUT","KEYGEN","OBJECT","OUTPUT","SELECT","TEXTAREA","MAP","META","PARAM"].includes(_.nodeName))Z.push({engine:"css",selector:`${Y0(_)}[name=${U0(_.getAttribute("name"))}]`,score:k6});if(["INPUT","TEXTAREA"].includes(_.nodeName)&&_.getAttribute("type")!=="hidden"){if(_.getAttribute("type"))Z.push({engine:"css",selector:`${Y0(_)}[type=${U0(_.getAttribute("type"))}]`,score:k6})}if(["INPUT","TEXTAREA","SELECT"].includes(_.nodeName)&&_.getAttribute("type")!=="hidden")Z.push({engine:"css",selector:Y0(_),score:k6+1});return g6([Z]),Z}function m4(Y,_,X){if(_.nodeName==="SELECT")return[];let Z=[],$=_.getAttribute("title");if($){Z.push([{engine:"internal:attr",selector:`[title=${y($,!0)}]`,score:v4}]);for(let U of k0($))Z.push([{engine:"internal:attr",selector:`[title=${y(U.text,!1)}]`,score:$5-U.scoreBonus}])}let J=_.getAttribute("alt");if(J&&["APPLET","AREA","IMG","INPUT"].includes(_.nodeName)){Z.push([{engine:"internal:attr",selector:`[alt=${y(J,!0)}]`,score:h4}]);for(let U of k0(J))Z.push([{engine:"internal:attr",selector:`[alt=${y(U.text,!1)}]`,score:Z5-U.scoreBonus}])}let Q=h(Y._evaluator._cacheText,_).normalized,K=Q?k0(Q):[];if(Q){if(X){if(Q.length<=80)Z.push([{engine:"internal:text",selector:u(Q,!0),score:g4}]);for(let H of K)Z.push([{engine:"internal:text",selector:u(H.text,!1),score:m1-H.scoreBonus}])}let U={engine:"css",selector:Y0(_),score:K5};for(let H of K)Z.push([U,{engine:"internal:has-text",selector:u(H.text,!1),score:m1-H.scoreBonus}]);if(X&&Q.length<=80){let H=new RegExp("^"+z0(Q)+"$");Z.push([U,{engine:"internal:has-text",selector:u(H,!1),score:t8}])}}let G=P(_);if(G&&!["none","presentation"].includes(G)){let U=s(_,!1);if(U&&!U.match(/^\p{Co}+$/u)){let H={engine:"internal:role",selector:`${G}[name=${y(U,!0)}]`,score:S4};Z.push([H]);for(let w of k0(U))Z.push([{engine:"internal:role",selector:`${G}[name=${y(w.text,!1)}]`,score:Y5-w.scoreBonus}])}else{let H={engine:"internal:role",selector:`${G}`,score:J5};for(let w of K)Z.push([H,{engine:"internal:has-text",selector:u(w.text,!1),score:m1-w.scoreBonus}]);if(X&&Q.length<=80){let w=new RegExp("^"+z0(Q)+"$");Z.push([H,{engine:"internal:has-text",selector:u(w,!1),score:t8}])}}}return g6(Z),Z}function Q5(Y){return/^[a-zA-Z][a-zA-Z0-9\-\_]+$/.test(Y)?"#"+Y:`[id=${U0(Y)}]`}function S6(Y){return Y.some((_)=>_.engine==="css"&&(_.selector.startsWith("#")||_.selector.startsWith('[id="')))}function Z1(Y,_,X){let Z=X.root??_.ownerDocument,$=[];function J(K){let G=$.slice();if(K)G.unshift(K);let U=G.join(" > "),H=Y.parseSelector(U);return Y.querySelector(H,Z,!1)===_?U:void 0}function Q(K){let G={engine:"css",selector:K,score:x4},U=Y.parseSelector(K),H=Y.querySelectorAll(U,Z);if(H.length===1)return[G];let w={engine:"nth",selector:String(H.indexOf(_)),score:h6};return[G,w]}for(let K=_;K&&K!==Z;K=N(K)){let G="";if(K.id&&!X.noCSSId){let w=Q5(K.id),W=J(w);if(W)return Q(W);G=w}let U=K.parentNode,H=[...K.classList].map(c4);for(let w=0;w<H.length;++w){let W="."+H.slice(0,w+1).join("."),L=J(W);if(L)return Q(L);if(!G&&U){if(U.querySelectorAll(W).length===1)G=W}}if(U){let w=[...U.children],W=K.nodeName,M=w.filter((q)=>q.nodeName===W).indexOf(K)===0?Y0(K):`${Y0(K)}:nth-child(${1+w.indexOf(K)})`,O=J(M);if(O)return Q(O);if(!G)G=M}else if(!G)G=Y0(K);$.unshift(G)}return Q(J())}function g6(Y){for(let _ of Y)for(let X of _)if(X.score>N4&&X.score<y4)X.score+=Math.min(e8,X.selector.length/10|0)}function d1(Y){let _=[],X="";for(let{engine:Z,selector:$}of Y){if(_.length&&(X!=="css"||Z!=="css"||$.startsWith(":nth-match(")))_.push(">>");if(X=Z,Z==="css")_.push($);else _.push(`${Z}=${$}`)}return _.join(" ")}function W0(Y){let _=0;for(let X=0;X<Y.length;X++)_+=Y[X].score*(Y.length-X);return _}function d4(Y){let _,X=0;for(let Z=0;Z<Y.length;++Z){let $=Y[Z],J;if($==="-"||$==="_")continue;if($>="a"&&$<="z")J="lower";else if($>="A"&&$<="Z")J="upper";else if($>="0"&&$<="9")J="digit";else J="other";if(J==="lower"&&_==="upper"){_=J;continue}if(_&&_!==J)++X;_=J}return X>=Y.length/4}function p1(Y,_){if(Y.length<=_)return Y;Y=Y.substring(0,_);let X=Y.match(/^(.*)\b(.+?)$/);if(!X)return"";return X[1].trimEnd()}function k0(Y){let _=[];{let X=Y.match(/^([\d.,]+)[^.,\w]/),Z=X?X[1].length:0;if(Z){let $=p1(Y.substring(Z).trimStart(),80);_.push({text:$,scoreBonus:$.length<=30?2:1})}}{let X=Y.match(/[^.,\w]([\d.,]+)$/),Z=X?X[1].length:0;if(Z){let $=p1(Y.substring(0,Y.length-Z).trimEnd(),80);_.push({text:$,scoreBonus:$.length<=30?2:1})}}if(Y.length<=30)_.push({text:Y,scoreBonus:0});else _.push({text:p1(Y,80),scoreBonus:0}),_.push({text:p1(Y,30),scoreBonus:1});if(_=_.filter((X)=>X.text),!_.length)_.push({text:Y.substring(0,80),scoreBonus:0});return _}function Y0(Y){return Y.nodeName.toLocaleLowerCase().replace(/[:\.]/g,(_)=>"\\"+_)}function c4(Y){let _="";for(let X=0;X<Y.length;X++)_+=i4(Y,X);return _}function i4(Y,_){let X=Y.charCodeAt(_);if(X===0)return"�";if(X>=1&&X<=31||X>=48&&X<=57&&(_===0||_===1&&Y.charCodeAt(0)===45))return"\\"+X.toString(16)+" ";if(_===0&&X===45&&Y.length===1)return"\\"+Y.charAt(_);if(X>=128||X===45||X===95||X>=48&&X<=57||X>=65&&X<=90||X>=97&&X<=122)return Y.charAt(_);return"\\"+Y.charAt(_)}var y6={queryAll(Y,_){if(_.startsWith("/")&&Y.nodeType!==Node.DOCUMENT_NODE)_="."+_;let X=[],Z=Y.ownerDocument||Y;if(!Z)return X;let $=Z.evaluate(_,Y,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE);for(let J=$.iterateNext();J;J=$.iterateNext())if(J.nodeType===Node.ELEMENT_NODE)X.push(J);return X}};function l4(Y){try{return Y instanceof RegExp||Object.prototype.toString.call(Y)==="[object RegExp]"}catch(_){return!1}}function s4(Y){try{return Y instanceof Date||Object.prototype.toString.call(Y)==="[object Date]"}catch(_){return!1}}function n4(Y){try{return Y instanceof URL||Object.prototype.toString.call(Y)==="[object URL]"}catch(_){return!1}}function r4(Y){try{return Y instanceof Error||Y&&Object.getPrototypeOf(Y)?.name==="Error"}catch(_){return!1}}function a4(Y,_){try{return Y instanceof _||Object.prototype.toString.call(Y)===`[object ${_.name}]`}catch(X){return!1}}function o4(Y){try{return Y instanceof ArrayBuffer||Object.prototype.toString.call(Y)==="[object ArrayBuffer]"}catch(_){return!1}}var w5={i8:Int8Array,ui8:Uint8Array,ui8c:Uint8ClampedArray,i16:Int16Array,ui16:Uint16Array,i32:Int32Array,ui32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:BigInt64Array,bui64:BigUint64Array};function G5(Y){if("toBase64"in Y)return Y.toBase64();let _=Array.from(new Uint8Array(Y.buffer,Y.byteOffset,Y.byteLength)).map((X)=>String.fromCharCode(X)).join("");return btoa(_)}function U5(Y,_){let X=atob(Y),Z=new Uint8Array(X.length);for(let $=0;$<X.length;$++)Z[$]=X.charCodeAt($);return new _(Z.buffer)}function h0(Y,_=[],X=new Map){if(Object.is(Y,void 0))return;if(typeof Y==="object"&&Y){if("ref"in Y)return X.get(Y.ref);if("v"in Y){if(Y.v==="undefined")return;if(Y.v==="null")return null;if(Y.v==="NaN")return NaN;if(Y.v==="Infinity")return 1/0;if(Y.v==="-Infinity")return-1/0;if(Y.v==="-0")return-0;return}if("d"in Y)return new Date(Y.d);if("u"in Y)return new URL(Y.u);if("bi"in Y)return BigInt(Y.bi);if("e"in Y){let Z=Error(Y.e.m);return Z.name=Y.e.n,Z.stack=Y.e.s,Z}if("r"in Y)return new RegExp(Y.r.p,Y.r.f);if("a"in Y){let Z=[];X.set(Y.id,Z);for(let $ of Y.a)Z.push(h0($,_,X));return Z}if("o"in Y){let Z={};X.set(Y.id,Z);for(let{k:$,v:J}of Y.o){if($==="__proto__")continue;Z[$]=h0(J,_,X)}return Z}if("h"in Y)return _[Y.h];if("ta"in Y)return U5(Y.ta.b,w5[Y.ta.k]);if("ab"in Y)return U5(Y.ab.b,Uint8Array).buffer}return Y}function c1(Y,_){return b6(Y,_,{visited:new Map,lastId:0})}function b6(Y,_,X){if(Y&&typeof Y==="object"){if(typeof globalThis.Window==="function"&&Y instanceof globalThis.Window)return"ref: <Window>";if(typeof globalThis.Document==="function"&&Y instanceof globalThis.Document)return"ref: <Document>";if(typeof globalThis.Node==="function"&&Y instanceof globalThis.Node)return"ref: <Node>"}return M5(Y,_,X)}function M5(Y,_,X){let Z=_(Y);if("fallThrough"in Z)Y=Z.fallThrough;else return Z;if(typeof Y==="symbol")return{v:"undefined"};if(Object.is(Y,void 0))return{v:"undefined"};if(Object.is(Y,null))return{v:"null"};if(Object.is(Y,NaN))return{v:"NaN"};if(Object.is(Y,1/0))return{v:"Infinity"};if(Object.is(Y,-1/0))return{v:"-Infinity"};if(Object.is(Y,-0))return{v:"-0"};if(typeof Y==="boolean")return Y;if(typeof Y==="number")return Y;if(typeof Y==="string")return Y;if(typeof Y==="bigint")return{bi:Y.toString()};if(r4(Y)){let J;if(Y.stack?.startsWith(Y.name+": "+Y.message))J=Y.stack;else J=`${Y.name}: ${Y.message}
${Y.stack}`;return{e:{n:Y.name,m:Y.message,s:J}}}if(s4(Y))return{d:Y.toJSON()};if(n4(Y))return{u:Y.toJSON()};if(l4(Y))return{r:{p:Y.source,f:Y.flags}};for(let[J,Q]of Object.entries(w5))if(a4(Y,Q))return{ta:{b:G5(Y),k:J}};if(o4(Y))return{ab:{b:G5(new Uint8Array(Y))}};let $=X.visited.get(Y);if($)return{ref:$};if(Array.isArray(Y)){let J=[],Q=++X.lastId;X.visited.set(Y,Q);for(let K=0;K<Y.length;++K)J.push(b6(Y[K],_,X));return{a:J,id:Q}}if(typeof Y==="object"){let J=[],Q=++X.lastId;X.visited.set(Y,Q);for(let G of Object.keys(Y)){let U;try{U=Y[G]}catch(H){continue}if(G==="toJSON"&&typeof U==="function")J.push({k:G,v:{o:[],id:0}});else J.push({k:G,v:b6(U,_,X)})}let K;try{if(J.length===0&&Y.toJSON&&typeof Y.toJSON==="function")K={value:Y.toJSON()}}catch(G){}if(K)return M5(K.value,_,X);return{o:J,id:Q}}}class g0{global;builtins;isUnderTest;constructor(Y,_){if(this.global=Y,this.isUnderTest=_,Y.__pwClock)this.builtins=Y.__pwClock.builtins;else this.builtins={setTimeout:Y.setTimeout?.bind(Y),clearTimeout:Y.clearTimeout?.bind(Y),setInterval:Y.setInterval?.bind(Y),clearInterval:Y.clearInterval?.bind(Y),requestAnimationFrame:Y.requestAnimationFrame?.bind(Y),cancelAnimationFrame:Y.cancelAnimationFrame?.bind(Y),requestIdleCallback:Y.requestIdleCallback?.bind(Y),cancelIdleCallback:Y.cancelIdleCallback?.bind(Y),performance:Y.performance,Intl:Y.Intl,Date:Y.Date,AbortSignal:Y.AbortSignal};if(this.isUnderTest)Y.builtins=this.builtins}evaluate(Y,_,X,Z,...$){let J=$.slice(0,Z),Q=$.slice(Z),K=[];for(let U=0;U<J.length;U++)K[U]=h0(J[U],Q);let G=this.global.eval(X);if(Y===!0)G=G(...K);else if(Y===!1)G=G;else if(typeof G==="function")G=G(...K);return _?this._promiseAwareJsonValueNoThrow(G):G}jsonValue(Y,_){if(_===void 0)return;return c1(_,(X)=>({fallThrough:X}))}_promiseAwareJsonValueNoThrow(Y){let _=(X)=>{try{return this.jsonValue(!0,X)}catch(Z){return}};if(Y&&typeof Y==="object"&&typeof Y.then==="function")return(async()=>{let X=await Y;return _(X)})();return _(Y)}}class u6{_engines;_evaluator;_stableRafCount;_browserName;_isUtilityWorld;onGlobalListenersRemoved;_hitTargetInterceptor;isUnderTest;_sdkLanguage;_testIdAttributeNameForStrictErrorAndConsoleCodegen="data-testid";_markedElements;window;document;_lastAriaSnapshotForTrack=new Map;_lastAriaSnapshotForQuery;_highlight;utils={asLocator:w0,cacheNormalizedWhitespaces:J8,elementText:h,getAriaRole:P,getElementAccessibleDescription:w6,getElementAccessibleName:s,isElementVisible:b,isInsideScope:i0,normalizeWhiteSpace:j,parseAriaSnapshot:c6,generateAriaTree:C0,findNewElement:l8,builtins:null};_autoClosingTags;_booleanAttributes;_eventTypes;_hoverHitTargetInterceptorEvents;_tapHitTargetInterceptorEvents;_mouseHitTargetInterceptorEvents;_allHitTargetInterceptorEvents;constructor(Y,_){this.window=Y,this.document=Y.document,this.isUnderTest=_.isUnderTest,this.utils.builtins=new g0(Y,_.isUnderTest).builtins,this._sdkLanguage=_.sdkLanguage,this._testIdAttributeNameForStrictErrorAndConsoleCodegen=_.testIdAttributeName,this._evaluator=new N6,this.onGlobalListenersRemoved=new Set,this._autoClosingTags=new Set(["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","MENUITEM","META","PARAM","SOURCE","TRACK","WBR"]),this._booleanAttributes=new Set(["checked","selected","disabled","readonly","multiple"]),this._eventTypes=new Map([["auxclick","mouse"],["click","mouse"],["dblclick","mouse"],["mousedown","mouse"],["mouseeenter","mouse"],["mouseleave","mouse"],["mousemove","mouse"],["mouseout","mouse"],["mouseover","mouse"],["mouseup","mouse"],["mouseleave","mouse"],["mousewheel","mouse"],["keydown","keyboard"],["keyup","keyboard"],["keypress","keyboard"],["textInput","keyboard"],["touchstart","touch"],["touchmove","touch"],["touchend","touch"],["touchcancel","touch"],["pointerover","pointer"],["pointerout","pointer"],["pointerenter","pointer"],["pointerleave","pointer"],["pointerdown","pointer"],["pointerup","pointer"],["pointermove","pointer"],["pointercancel","pointer"],["gotpointercapture","pointer"],["lostpointercapture","pointer"],["focus","focus"],["blur","focus"],["drag","drag"],["dragstart","drag"],["dragend","drag"],["dragover","drag"],["dragenter","drag"],["dragleave","drag"],["dragexit","drag"],["drop","drag"],["wheel","wheel"],["deviceorientation","deviceorientation"],["deviceorientationabsolute","deviceorientation"],["devicemotion","devicemotion"]]),this._hoverHitTargetInterceptorEvents=new Set(["mousemove"]),this._tapHitTargetInterceptorEvents=new Set(["pointerdown","pointerup","touchstart","touchend","touchcancel"]),this._mouseHitTargetInterceptorEvents=new Set(["mousedown","mouseup","pointerdown","pointerup","click","auxclick","dblclick","contextmenu"]),this._allHitTargetInterceptorEvents=new Set([...this._hoverHitTargetInterceptorEvents,...this._tapHitTargetInterceptorEvents,...this._mouseHitTargetInterceptorEvents]),this._engines=new Map,this._engines.set("xpath",y6),this._engines.set("xpath:light",y6),this._engines.set("role",C6(!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",C6(!0)),this._engines.set("internal:describe",this._createDescribeEngine()),this._engines.set("aria-ref",this._createAriaRefEngine());for(let{name:X,source:Z}of _.customEngines)this._engines.set(X,this.eval(Z));if(this._stableRafCount=_.stableRafCount,this._browserName=_.browserName,this._isUtilityWorld=!!_.isUtilityWorld,D8({browserNameForWorkarounds:_.browserName}),this._setupGlobalListenersRemovalDetection(),this._setupHitTargetInterceptors(),this.isUnderTest)this.window.__injectedScript=this}eval(Y){return this.window.eval(Y)}testIdAttributeNameForStrictErrorAndConsoleCodegen(){return this._testIdAttributeNameForStrictErrorAndConsoleCodegen}parseSelector(Y){let _=u0(Y);return $8(_,(X)=>{if(!this._engines.has(X.name))throw this.createStacklessError(`Unknown engine "${X.name}" while parsing selector ${Y}`)}),_}generateSelector(Y,_){return v6(this,Y,_)}generateSelectorSimple(Y,_){return v6(this,Y,{..._,testIdAttributeName:this._testIdAttributeNameForStrictErrorAndConsoleCodegen}).selector}querySelector(Y,_,X){let Z=this.querySelectorAll(Y,_);if(X&&Z.length>1)throw this.strictModeViolationError(Y,Z);return this.checkDeprecatedSelectorUsage(Y,Z),Z[0]}_queryNth(Y,_){let X=[...Y],Z=+_.body;if(Z===-1)Z=X.length-1;return new Set(X.slice(Z,Z+1))}_queryLayoutSelector(Y,_,X){let{name:Z,body:$}=_,J=[],Q=this.querySelectorAll($.parsed,X);for(let K of Y){let G=y1(Z,K,Q,$.distance);if(G!==void 0)J.push({element:K,score:G})}return J.sort((K,G)=>K.score-G.score),new Set(J.map((K)=>K.element))}ariaSnapshot(Y,_){return this.incrementalAriaSnapshot(Y,_).full}incrementalAriaSnapshot(Y,_){if(Y.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Can only capture aria snapshot of Element nodes.");let X=C0(Y,_),Z=f0(X,_),$;if(_.track){let J=this._lastAriaSnapshotForTrack.get(_.track);if(J)$=f0(X,_,J).text;this._lastAriaSnapshotForTrack.set(_.track,X)}return this._lastAriaSnapshotForQuery=X,{full:Z.text,incremental:$,iframeRefs:X.iframeRefs,iframeDepths:Z.iframeDepths}}ariaSnapshotForRecorder(){let Y=C0(this.document.body,{mode:"ai"}),{text:_}=f0(Y,{mode:"ai"});return{ariaSnapshot:_,refs:Y.refs}}getAllElementsMatchingExpectAriaTemplate(Y,_){return m8(Y.documentElement,_)}querySelectorAll(Y,_){if(Y.capture!==void 0){if(Y.parts.some((Z)=>Z.name==="nth"))throw this.createStacklessError("Can't query n-th element in a request with the capture.");let X={parts:Y.parts.slice(0,Y.capture+1)};if(Y.capture<Y.parts.length-1){let Z={parts:Y.parts.slice(Y.capture+1)},$={name:"internal:has",body:{parsed:Z},source:v(Z)};X.parts.push($)}return this.querySelectorAll(X,_)}if(!_.querySelectorAll)throw this.createStacklessError("Node is not queryable.");if(Y.capture!==void 0)throw this.createStacklessError("Internal error: there should not be a capture in the selector.");if(_.nodeType===11&&Y.parts.length===1&&Y.parts[0].name==="css"&&Y.parts[0].source===":scope")return[_];this._evaluator.begin();try{let X=new Set([_]);for(let Z of Y.parts)if(Z.name==="nth")X=this._queryNth(X,Z);else if(Z.name==="internal:and"){let $=this.querySelectorAll(Z.body.parsed,_);X=new Set($.filter((J)=>X.has(J)))}else if(Z.name==="internal:or"){let $=this.querySelectorAll(Z.body.parsed,_);X=new Set(T6(new Set([...X,...$])))}else if(n8.includes(Z.name))X=this._queryLayoutSelector(X,Z,_);else{let $=new Set;for(let J of X){let Q=this._queryEngineAll(Z,J);for(let K of Q)$.add(K)}X=$}return[...X]}finally{this._evaluator.end()}}_queryEngineAll(Y,_){let X=this._engines.get(Y.name).queryAll(_,Y.body);for(let Z of X)if(!("nodeName"in Z))throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(Z)}`);return X}_createAttributeEngine(Y,_){let X=(Z)=>{return[{simples:[{selector:{css:`[${Y}=${JSON.stringify(Z)}]`,functions:[]},combinator:""}]}]};return{queryAll:(Z,$)=>{return this._evaluator.query({scope:Z,pierceShadow:_},X($))}}}_createCSSEngine(){return{queryAll:(Y,_)=>{return this._evaluator.query({scope:Y,pierceShadow:!0},_)}}}_createTextEngine(Y,_){return{queryAll:(Z,$)=>{let{matcher:J,kind:Q}=l1($,_),K=[],G=null,U=(w)=>{if(Q==="lax"&&G&&G.contains(w))return!1;let W=E0(this._evaluator._cacheText,w,J);if(W==="none")G=w;if(W==="self"||W==="selfAndChildren"&&Q==="strict"&&!_)K.push(w)};if(Z.nodeType===Node.ELEMENT_NODE)U(Z);let H=this._evaluator._queryCSS({scope:Z,pierceShadow:Y},"*");for(let w of H)U(w);return K}}}_createInternalHasTextEngine(){return{queryAll:(Y,_)=>{if(Y.nodeType!==1)return[];let X=Y,Z=h(this._evaluator._cacheText,X),{matcher:$}=l1(_,!0);return $(Z)?[X]:[]}}}_createInternalHasNotTextEngine(){return{queryAll:(Y,_)=>{if(Y.nodeType!==1)return[];let X=Y,Z=h(this._evaluator._cacheText,X),{matcher:$}=l1(_,!0);return $(Z)?[]:[X]}}}_createInternalLabelEngine(){return{queryAll:(Y,_)=>{let{matcher:X}=l1(_,!0);return this._evaluator._queryCSS({scope:Y,pierceShadow:!0},"*").filter(($)=>{return x1(this._evaluator._cacheText,$).some((J)=>X(J))})}}}_createNamedAttributeEngine(){return{queryAll:(_,X)=>{let Z=X0(X,!0);if(Z.name||Z.attributes.length!==1)throw Error("Malformed attribute selector: "+X);let{name:$,value:J,caseSensitive:Q}=Z.attributes[0],K=Q?null:J.toLowerCase(),G;if(J instanceof RegExp)G=(H)=>!!H.match(J);else if(Q)G=(H)=>H===J;else G=(H)=>H.toLowerCase().includes(K);return this._evaluator._queryCSS({scope:_,pierceShadow:!0},`[${$}]`).filter((H)=>G(H.getAttribute($)))}}}_createDescribeEngine(){return{queryAll:(_)=>{if(_.nodeType!==1)return[];return[_]}}}_createControlEngine(){return{queryAll(Y,_){if(_==="enter-frame")return[];if(_==="return-empty")return[];if(_==="component"){if(Y.nodeType!==1)return[];return[Y.childElementCount===1?Y.firstElementChild:Y]}throw Error(`Internal error, unknown internal:control selector ${_}`)}}}_createHasEngine(){return{queryAll:(_,X)=>{if(_.nodeType!==1)return[];return this.querySelector(X.parsed,_,!1)?[_]:[]}}}_createHasNotEngine(){return{queryAll:(_,X)=>{if(_.nodeType!==1)return[];return this.querySelector(X.parsed,_,!1)?[]:[_]}}}_createVisibleEngine(){return{queryAll:(_,X)=>{if(_.nodeType!==1)return[];let Z=X==="true";return b(_)===Z?[_]:[]}}}_createInternalChainEngine(){return{queryAll:(_,X)=>{return this.querySelectorAll(X.parsed,_)}}}extend(Y,_){return new(this.window.eval(`
    (() => {
      const module = {};
      ${Y}
      return module.exports.default();
    })()`))(this,_)}async viewportRatio(Y){return await new Promise((_)=>{let X=new IntersectionObserver((Z)=>{_(Z[0].intersectionRatio),X.disconnect()});X.observe(Y),this.utils.builtins.requestAnimationFrame(()=>{})})}getElementBorderWidth(Y){if(Y.nodeType!==Node.ELEMENT_NODE||!Y.ownerDocument||!Y.ownerDocument.defaultView)return{left:0,top:0};let _=Y.ownerDocument.defaultView.getComputedStyle(Y);return{left:parseInt(_.borderLeftWidth||"",10),top:parseInt(_.borderTopWidth||"",10)}}describeIFrameStyle(Y){if(!Y.ownerDocument||!Y.ownerDocument.defaultView)return"error:notconnected";let _=Y.ownerDocument.defaultView;for(let Z=Y;Z;Z=N(Z))if(_.getComputedStyle(Z).transform!=="none")return"transformed";let X=_.getComputedStyle(Y);return{left:parseInt(X.borderLeftWidth||"",10)+parseInt(X.paddingLeft||"",10),top:parseInt(X.borderTopWidth||"",10)+parseInt(X.paddingTop||"",10)}}retarget(Y,_){let X=Y.nodeType===Node.ELEMENT_NODE?Y:Y.parentElement;if(!X)return null;if(_==="none")return X;if(!X.matches("input, textarea, select")&&!X.isContentEditable)if(_==="button-link")X=X.closest("button, [role=button], a, [role=link]")||X;else X=X.closest("button, [role=button], [role=checkbox], [role=radio]")||X;if(_==="follow-label"){if(!X.matches("a, input, textarea, button, select, [role=link], [role=button], [role=checkbox], [role=radio]")&&!X.isContentEditable){let Z=X.closest("label");if(Z&&Z.control)X=Z.control}}return X}async checkElementStates(Y,_){if(_.includes("stable")){let X=await this._checkElementIsStable(Y);if(X===!1)return{missingState:"stable"};if(X==="error:notconnected")return"error:notconnected"}for(let X of _)if(X!=="stable"){let Z=this.elementState(Y,X);if(Z.received==="error:notconnected")return"error:notconnected";if(!Z.matches)return{missingState:X}}}async _checkElementIsStable(Y){let _=Symbol("continuePolling"),X,Z=0,$=0,J=()=>{let H=this.retarget(Y,"no-follow-label");if(!H)return"error:notconnected";let w=this.utils.builtins.performance.now();if(this._stableRafCount>1&&w-$<15)return _;$=w;let W=H.getBoundingClientRect(),L={x:W.top,y:W.left,width:W.width,height:W.height};if(X){if(!(L.x===X.x&&L.y===X.y&&L.width===X.width&&L.height===X.height))return!1;if(++Z>=this._stableRafCount)return!0}return X=L,_},Q,K,G=new Promise((H,w)=>{Q=H,K=w}),U=()=>{try{let H=J();if(H!==_)Q(H);else this.utils.builtins.requestAnimationFrame(U)}catch(H){K(H)}};return this.utils.builtins.requestAnimationFrame(U),G}_createAriaRefEngine(){return{queryAll:(_,X)=>{let Z=this._lastAriaSnapshotForQuery?.elements?.get(X);return Z&&Z.isConnected?[Z]:[]}}}elementState(Y,_){let X=this.retarget(Y,["visible","hidden"].includes(_)?"none":"follow-label");if(!X||!X.isConnected){if(_==="hidden")return{matches:!0,received:"hidden"};return{matches:!1,received:"error:notconnected"}}if(_==="visible"||_==="hidden"){let Z=b(X);return{matches:_==="visible"?Z:!Z,received:Z?"visible":"hidden"}}if(_==="disabled"||_==="enabled"){let Z=r(X);return{matches:_==="disabled"?Z:!Z,received:Z?"disabled":"enabled"}}if(_==="editable"){let Z=r(X),$=k1(X);if($==="error")throw this.createStacklessError("Element is not an <input>, <textarea>, <select> or [contenteditable] and does not have a role allowing [aria-readonly]");return{matches:!Z&&!$,received:Z?"disabled":$?"readOnly":"editable"}}if(_==="checked"||_==="unchecked"){let Z=_==="checked",$=T1(X);if($==="error")throw this.createStacklessError("Not a checkbox or radio button");let J=X.nodeName==="INPUT"&&X.type==="radio";return{matches:Z===$,received:$?"checked":"unchecked",isRadio:J}}if(_==="indeterminate"){let Z=k8(X);if(Z==="error")throw this.createStacklessError("Not a checkbox or radio button");return{matches:Z==="mixed",received:Z===!0?"checked":Z===!1?"unchecked":"mixed"}}throw this.createStacklessError(`Unexpected element state "${_}"`)}selectOptions(Y,_){let X=this.retarget(Y,"follow-label");if(!X)return"error:notconnected";if(X.nodeName.toLowerCase()!=="select")throw this.createStacklessError("Element is not a <select> element");let Z=X,$=[...Z.options],J=[],Q=_.slice();for(let K=0;K<$.length;K++){let G=$[K],U=j(G.label),H=(w)=>{if(w instanceof Node)return G===w;let W=(M)=>M===G.label||j(M)===U,L=!0;if(w.valueOrLabel!==void 0)L=L&&(w.valueOrLabel===G.value||W(w.valueOrLabel));if(w.value!==void 0)L=L&&w.value===G.value;if(w.label!==void 0)L=L&&W(w.label);if(w.index!==void 0)L=L&&w.index===K;return L};if(!Q.some(H))continue;if(!this.elementState(G,"enabled").matches)return"error:optionnotenabled";if(J.push(G),Z.multiple)Q=Q.filter((w)=>!H(w));else{Q=[];break}}if(Q.length)return"error:optionsnotfound";return Z.value=void 0,J.forEach((K)=>K.selected=!0),Z.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),Z.dispatchEvent(new Event("change",{bubbles:!0})),J.map((K)=>K.value)}fill(Y,_){let X=this.retarget(Y,"follow-label");if(!X)return"error:notconnected";if(X.nodeName.toLowerCase()==="input"){let Z=X,$=Z.type.toLowerCase(),J=new Set(["color","date","time","datetime-local","month","range","week"]);if(!new Set(["","email","number","password","search","tel","text","url"]).has($)&&!J.has($))throw this.createStacklessError(`Input of type "${$}" cannot be filled`);if($==="number"){if(_=_.trim(),isNaN(Number(_)))throw this.createStacklessError("Cannot type text into input[type=number]")}if($==="color")_=_.toLowerCase();if(J.has($)){if(_=_.trim(),Z.focus(),Z.value=_,Z.value!==_)throw this.createStacklessError("Malformed value");return X.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),X.dispatchEvent(new Event("change",{bubbles:!0})),"done"}}else if(X.nodeName.toLowerCase()==="textarea");else if(!X.isContentEditable)throw this.createStacklessError("Element is not an <input>, <textarea> or [contenteditable] element");return this.selectText(X),"needsinput"}selectText(Y){let _=this.retarget(Y,"follow-label");if(!_)return"error:notconnected";if(_.nodeName.toLowerCase()==="input"){let $=_;return $.select(),$.focus(),"done"}if(_.nodeName.toLowerCase()==="textarea"){let $=_;return $.selectionStart=0,$.selectionEnd=$.value.length,$.focus(),"done"}_.focus();let X=_.ownerDocument.createRange();X.selectNodeContents(_);let Z=_.ownerDocument.defaultView.getSelection();if(Z)Z.removeAllRanges(),Z.addRange(X);return"done"}_activelyFocused(Y){let _=Y.getRootNode().activeElement,X=_===Y&&!!Y.ownerDocument&&Y.ownerDocument.hasFocus();return{activeElement:_,isFocused:X}}focusNode(Y,_){if(!Y.isConnected)return"error:notconnected";if(Y.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");let{activeElement:X,isFocused:Z}=this._activelyFocused(Y);if(Y.isContentEditable&&!Z&&X&&X.blur)X.blur();if(Y.focus(),Y.focus(),_&&!Z&&Y.nodeName.toLowerCase()==="input")try{Y.setSelectionRange(0,0)}catch($){}return"done"}blurNode(Y){if(!Y.isConnected)return"error:notconnected";if(Y.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");return Y.blur(),"done"}setInputFiles(Y,_){if(Y.nodeType!==Node.ELEMENT_NODE)return"Node is not of type HTMLElement";let X=Y;if(X.nodeName!=="INPUT")return"Not an <input> element";let Z=X;if((Z.getAttribute("type")||"").toLowerCase()!=="file")return"Not an input[type=file] element";let J=_.map((K)=>{let G=Uint8Array.from(atob(K.buffer),(U)=>U.charCodeAt(0));return new File([G],K.name,{type:K.mimeType,lastModified:K.lastModifiedMs})}),Q=new DataTransfer;for(let K of J)Q.items.add(K);Z.files=Q.files,Z.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),Z.dispatchEvent(new Event("change",{bubbles:!0}))}expectHitTarget(Y,_){let X=[],Z=_;while(Z){let U=j1(Z);if(!U)break;if(X.push(U),U.nodeType===9)break;Z=U.host}let $;for(let U=X.length-1;U>=0;U--){let H=X[U],w=H.elementsFromPoint(Y.x,Y.y),W=H.elementFromPoint(Y.x,Y.y);if(W&&w[0]&&N(W)===w[0]){if(this.window.getComputedStyle(W)?.display==="contents")w.unshift(W)}if(w[0]&&w[0].shadowRoot===H&&w[1]===W)w.shift();let L=w[0];if(!L)break;if($=L,U&&L!==X[U-1].host)break}let J=[];while($&&$!==_)J.push($),$=$.assignedSlot??N($);if($===_)return"done";let Q=this.previewNode(J[0]||this.document.documentElement),K,G=_;while(G){let U=J.indexOf(G);if(U!==-1){if(U>1)K=this.previewNode(J[U-1]);break}G=N(G)}if(K)return{hitTargetDescription:`${Q} from ${K} subtree`};return{hitTargetDescription:Q}}setupHitTargetInterceptor(Y,_,X,Z){let $=this.retarget(Y,"button-link");if(!$||!$.isConnected)return"error:notconnected";if(X){let U=this.expectHitTarget(X,$);if(U!=="done")return U.hitTargetDescription}if(_==="drag")return{stop:()=>"done"};let J={hover:this._hoverHitTargetInterceptorEvents,tap:this._tapHitTargetInterceptorEvents,mouse:this._mouseHitTargetInterceptorEvents}[_],Q,K=(U)=>{if(!J.has(U.type))return;if(!U.isTrusted)return;let H=!!this.window.TouchEvent&&U instanceof this.window.TouchEvent?U.touches[0]:U;if(Q===void 0&&H)Q=this.expectHitTarget({x:H.clientX,y:H.clientY},$);if(Z||Q!=="done"&&Q!==void 0)U.preventDefault(),U.stopPropagation(),U.stopImmediatePropagation()},G=()=>{if(this._hitTargetInterceptor===K)this._hitTargetInterceptor=void 0;return Q||"done"};return this._hitTargetInterceptor=K,{stop:G}}dispatchEvent(Y,_,X){let Z,$={bubbles:!0,cancelable:!0,composed:!0,...X};switch(this._eventTypes.get(_)){case"mouse":Z=new MouseEvent(_,$);break;case"keyboard":Z=new KeyboardEvent(_,$);break;case"touch":{if(this._browserName==="webkit"){let J=(K)=>{if(K instanceof Touch)return K;let G=K.pageX;if(G===void 0&&K.clientX!==void 0)G=K.clientX+(this.document.scrollingElement?.scrollLeft||0);let U=K.pageY;if(U===void 0&&K.clientY!==void 0)U=K.clientY+(this.document.scrollingElement?.scrollTop||0);return this.document.createTouch(this.window,K.target??Y,K.identifier,G,U,K.screenX,K.screenY,K.radiusX,K.radiusY,K.rotationAngle,K.force)},Q=(K)=>{if(K instanceof TouchList||!K)return K;return this.document.createTouchList(...K.map(J))};$.target??=Y,$.touches=Q($.touches),$.targetTouches=Q($.targetTouches),$.changedTouches=Q($.changedTouches),Z=new TouchEvent(_,$)}else $.target??=Y,$.touches=$.touches?.map((J)=>J instanceof Touch?J:new Touch({...J,target:J.target??Y})),$.targetTouches=$.targetTouches?.map((J)=>J instanceof Touch?J:new Touch({...J,target:J.target??Y})),$.changedTouches=$.changedTouches?.map((J)=>J instanceof Touch?J:new Touch({...J,target:J.target??Y})),Z=new TouchEvent(_,$);break}case"pointer":Z=new PointerEvent(_,$);break;case"focus":Z=new FocusEvent(_,$);break;case"drag":Z=new DragEvent(_,$);break;case"wheel":Z=new WheelEvent(_,$);break;case"deviceorientation":try{Z=new DeviceOrientationEvent(_,$)}catch{let{bubbles:J,cancelable:Q,alpha:K,beta:G,gamma:U,absolute:H}=$;Z=this.document.createEvent("DeviceOrientationEvent"),Z.initDeviceOrientationEvent(_,J,Q,K,G,U,H)}break;case"devicemotion":try{Z=new DeviceMotionEvent(_,$)}catch{let{bubbles:J,cancelable:Q,acceleration:K,accelerationIncludingGravity:G,rotationRate:U,interval:H}=$;Z=this.document.createEvent("DeviceMotionEvent"),Z.initDeviceMotionEvent(_,J,Q,K,G,U,H)}break;default:Z=new Event(_,$);break}Y.dispatchEvent(Z)}previewNode(Y){if(Y.nodeType===Node.TEXT_NODE)return i1(`#text=${Y.nodeValue||""}`);if(Y.nodeType!==Node.ELEMENT_NODE)return i1(`<${Y.nodeName.toLowerCase()} />`);let _=Y,X=[];for(let K=0;K<_.attributes.length;K++){let{name:G,value:U}=_.attributes[K];if(G==="style")continue;if(!U&&this._booleanAttributes.has(G))X.push(` ${G}`);else X.push(` ${G}="${U}"`)}X.sort((K,G)=>K.length-G.length);let Z=X6(X.join(""),500);if(this._autoClosingTags.has(_.nodeName))return i1(`<${_.nodeName.toLowerCase()}${Z}/>`);let $=_.childNodes,J=!1;if($.length<=5){J=!0;for(let K=0;K<$.length;K++)J=J&&$[K].nodeType===Node.TEXT_NODE}let Q=J?_.textContent||"":$.length?"…":"";return i1(`<${_.nodeName.toLowerCase()}${Z}>${X6(Q,50)}</${_.nodeName.toLowerCase()}>`)}_generateSelectors(Y){this._evaluator.begin(),Z0(),F0();try{let _=this._isUtilityWorld&&this._browserName==="firefox"?2:10;return Y.slice(0,_).map((Z)=>({preview:this.previewNode(Z),selector:this.generateSelectorSimple(Z)})).map((Z,$)=>`${$+1}) ${Z.preview} aka ${w0(this._sdkLanguage,Z.selector)}`)}finally{P0(),$0(),this._evaluator.end()}}strictModeViolationError(Y,_){let X=this._generateSelectors(_).map((Z)=>`
    `+Z);if(X.length<_.length)X.push(`
    ...`);return this.createStacklessError(`strict mode violation: ${w0(this._sdkLanguage,v(Y))} resolved to ${_.length} elements:${X.join("")}
`)}checkDeprecatedSelectorUsage(Y,_){let X=new Set(["_react","_vue","xpath:light","text:light","id:light","data-testid:light","data-test-id:light","data-test:light"]);if(!_.length)return;let Z=Y.parts.find((J)=>X.has(J.name));if(!Z)return;let $=this._generateSelectors(_).map((J)=>`
    `+J);if($.length<_.length)$.push(`
    ...`);throw this.createStacklessError(`"${Z.name}" selector is not supported: ${w0(this._sdkLanguage,v(Y))} resolved to ${_.length} element${_.length===1?"":"s"}:${$.join("")}
`)}createStacklessError(Y){if(this._browserName==="firefox"){let X=Error("Error: "+Y);return X.stack="",X}let _=Error(Y);return delete _.stack,_}markTargetElements(Y,_){if(this._markedElements?.callId!==_)this._markedElements=void 0;let X=this._markedElements?.elements||new Set,Z=new CustomEvent("__playwright_unmark_target__",{bubbles:!0,cancelable:!0,detail:_,composed:!0});for(let J of X)if(!Y.has(J))J.dispatchEvent(Z);let $=new CustomEvent("__playwright_mark_target__",{bubbles:!0,cancelable:!0,detail:_,composed:!0});for(let J of Y)if(!X.has(J))J.dispatchEvent($);this._markedElements={callId:_,elements:Y}}_setupGlobalListenersRemovalDetection(){let _=!1,X=()=>_=!0;this.window.addEventListener("__playwright_global_listeners_check__",X),new MutationObserver((Z)=>{if(!Z.some((J)=>Array.from(J.addedNodes).includes(this.document.documentElement)))return;if(_=!1,this.window.dispatchEvent(new CustomEvent("__playwright_global_listeners_check__")),_)return;this.window.addEventListener("__playwright_global_listeners_check__",X);for(let J of this.onGlobalListenersRemoved)J()}).observe(this.document,{childList:!0})}_setupHitTargetInterceptors(){let Y=(X)=>this._hitTargetInterceptor?.(X),_=()=>{for(let X of this._allHitTargetInterceptorEvents)this.window.addEventListener(X,Y,{capture:!0,passive:!1})};_(),this.onGlobalListenersRemoved.add(_)}async expect(Y,_,X){if(_.expression==="to.have.count"||_.expression.endsWith(".array"))return this.expectArray(X,_);if(!Y){if(!_.isNot&&_.expression==="to.be.hidden")return{matches:!0};if(_.isNot&&_.expression==="to.be.visible")return{matches:!1};if(!_.isNot&&_.expression==="to.be.detached")return{matches:!0};if(_.isNot&&_.expression==="to.be.attached")return{matches:!1};if(_.isNot&&_.expression==="to.be.in.viewport")return{matches:!1};if(_.expression==="to.have.title"&&_?.expectedText?.[0]){let $=new q0(_.expectedText[0]),J=this.document.title;return{received:J,matches:$.matches(J)}}if(_.expression==="to.have.url"&&_?.expectedText?.[0]){let $=new q0(_.expectedText[0]),J=this.document.location.href;return{received:J,matches:$.matches(J)}}if(_.expression==="to.match.aria"&&!_.selector){if(!this.document.body)return{matches:_.isNot,missingReceived:!0};let $=F6(this.document.body,_.expectedValue);return{received:$.received,matches:!!$.matches.length}}return{matches:_.isNot,missingReceived:!0}}return await this.expectSingleElement(Y,_)}async expectSingleElement(Y,_){let X=_.expression;{let Z;if(X==="to.have.attribute"){let $=Y.hasAttribute(_.expressionArg);Z={matches:$,received:$?"attribute present":"attribute not present"}}else if(X==="to.be.checked"){let{checked:$,indeterminate:J}=_.expectedValue;if(J){if($!==void 0)throw this.createStacklessError("Can't assert indeterminate and checked at the same time");Z=this.elementState(Y,"indeterminate")}else Z=this.elementState(Y,$===!1?"unchecked":"checked")}else if(X==="to.be.disabled")Z=this.elementState(Y,"disabled");else if(X==="to.be.editable")Z=this.elementState(Y,"editable");else if(X==="to.be.readonly")Z=this.elementState(Y,"editable"),Z.matches=!Z.matches;else if(X==="to.be.empty")if(Y.nodeName==="INPUT"||Y.nodeName==="TEXTAREA"){let $=Y.value;Z={matches:!$,received:$?"notEmpty":"empty"}}else{let $=Y.textContent?.trim();Z={matches:!$,received:$?"notEmpty":"empty"}}else if(X==="to.be.enabled")Z=this.elementState(Y,"enabled");else if(X==="to.be.focused"){let $=this._activelyFocused(Y).isFocused;Z={matches:$,received:$?"focused":"inactive"}}else if(X==="to.be.hidden")Z=this.elementState(Y,"hidden");else if(X==="to.be.visible")Z=this.elementState(Y,"visible");else if(X==="to.be.attached")Z={matches:!0,received:"attached"};else if(X==="to.be.detached")Z={matches:!1,received:"attached"};if(Z){if(Z.received==="error:notconnected")throw this.createStacklessError("Element is not connected");return Z}}if(X==="to.have.property"){let Z=Y,$=_.expressionArg.split(".");for(let K=0;K<$.length-1;K++){if(typeof Z!=="object"||!($[K]in Z))return{received:void 0,matches:!1};Z=Z[$[K]]}let J=Z[$[$.length-1]],Q=x6(J,_.expectedValue);return{received:J,matches:Q}}if(X==="to.be.in.viewport"){let Z=await this.viewportRatio(Y);return{received:`viewport ratio ${Z}`,matches:Z>0&&Z>(_.expectedNumber??0)-0.000000001}}if(X==="to.have.values"){if(Y=this.retarget(Y,"follow-label"),Y.nodeName!=="SELECT"||!Y.multiple)throw this.createStacklessError("Not a select element with a multiple attribute");let Z=[...Y.selectedOptions].map(($)=>$.value);if(Z.length!==_.expectedText.length)return{received:Z,matches:!1};return{received:Z,matches:Z.map(($,J)=>new q0(_.expectedText[J]).matches($)).every(Boolean)}}if(X==="to.match.aria"){let Z=F6(Y,_.expectedValue);return{received:Z.received,matches:!!Z.matches.length}}{let Z;if(X==="to.have.attribute.value"){let $=Y.getAttribute(_.expressionArg);if($===null)return{received:null,matches:!1};Z=$}else if(["to.have.class","to.contain.class"].includes(X)){if(!_.expectedText)throw this.createStacklessError("Expected text is not provided for "+X);return{received:Y.classList.toString(),matches:new q0(_.expectedText[0]).matchesClassList(this,Y.classList,X==="to.contain.class")}}else if(X==="to.have.css")Z=this.window.getComputedStyle(Y,_.pseudo?`::${_.pseudo}`:void 0).getPropertyValue(_.expressionArg);else if(X==="to.have.id")Z=Y.id;else if(X==="to.have.text")Z=_.useInnerText?Y.innerText:h(new Map,Y).full;else if(X==="to.have.accessible.name")Z=s(Y,!1);else if(X==="to.have.accessible.description")Z=w6(Y,!1);else if(X==="to.have.accessible.error.message")Z=T8(Y);else if(X==="to.have.role")Z=P(Y)||"";else if(X==="to.have.value"){if(Y=this.retarget(Y,"follow-label"),Y.nodeName!=="INPUT"&&Y.nodeName!=="TEXTAREA"&&Y.nodeName!=="SELECT")throw this.createStacklessError("Not an input element");Z=Y.value}if(Z!==void 0&&_.expectedText){let $=new q0(_.expectedText[0]);return{received:Z,matches:$.matches(Z)}}}throw this.createStacklessError("Unknown expect matcher: "+X)}expectArray(Y,_){let X=_.expression;if(X==="to.have.count"){let K=Y.length,G=K===_.expectedNumber;return{received:K,matches:G}}if(!_.expectedText)throw this.createStacklessError("Expected text is not provided for "+X);if(["to.have.class.array","to.contain.class.array"].includes(X)){let K=Y.map((H)=>H.classList),G=K.map(String);if(K.length!==_.expectedText.length)return{received:G,matches:!1};let U=this._matchSequentially(_.expectedText,K,(H,w)=>H.matchesClassList(this,w,X==="to.contain.class.array"));return{received:G,matches:U}}if(!["to.contain.text.array","to.have.text.array"].includes(X))throw this.createStacklessError("Unknown expect matcher: "+X);let Z=Y.map((K)=>_.useInnerText?K.innerText:h(new Map,K).full),$=X!=="to.contain.text.array";if(!(Z.length===_.expectedText.length||!$))return{received:Z,matches:!1};let Q=this._matchSequentially(_.expectedText,Z,(K,G)=>K.matches(G));return{received:Z,matches:Q}}_matchSequentially(Y,_,X){let Z=Y.map((Q)=>new q0(Q)),$=0,J=0;while($<Z.length&&J<_.length){if(X(Z[$],_[J]))++$;++J}return $===Z.length}_ensureHighlight(){if(!this._highlight)this._highlight=new f6(this),this._highlight.install();return this._highlight}addHighlight(Y,_){this._ensureHighlight().addElementHighlight(Y,_)}removeHighlight(Y){this._ensureHighlight().removeElementHighlight(Y)}hideHighlight(){this._highlight?.uninstall(),this._highlight=void 0}}function i1(Y){return Y.replace(/\n/g,"↵").replace(/\t/g,"⇆")}function t4(Y){if(Y=Y.substring(1,Y.length-1),!Y.includes("\\"))return Y;let _=[],X=0;while(X<Y.length){if(Y[X]==="\\"&&X+1<Y.length)X++;_.push(Y[X++])}return _.join("")}function l1(Y,_){if(Y[0]==="/"&&Y.lastIndexOf("/")>0){let $=Y.lastIndexOf("/"),J=new RegExp(Y.substring(1,$),Y.substring($+1));return{matcher:(Q)=>J.test(Q.full),kind:"regex"}}let X=_?JSON.parse.bind(JSON):t4,Z=!1;if(Y.length>1&&Y[0]==='"'&&Y[Y.length-1]==='"')Y=X(Y),Z=!0;else if(_&&Y.length>1&&Y[0]==='"'&&Y[Y.length-2]==='"'&&Y[Y.length-1]==="i")Y=X(Y.substring(0,Y.length-1)),Z=!1;else if(_&&Y.length>1&&Y[0]==='"'&&Y[Y.length-2]==='"'&&Y[Y.length-1]==="s")Y=X(Y.substring(0,Y.length-1)),Z=!0;else if(Y.length>1&&Y[0]==="'"&&Y[Y.length-1]==="'")Y=X(Y),Z=!0;if(Y=j(Y),Z){if(_)return{kind:"strict",matcher:(J)=>J.normalized===Y};return{matcher:(J)=>{if(!Y&&!J.immediate.length)return!0;return J.immediate.some((Q)=>j(Q)===Y)},kind:"strict"}}return Y=Y.toLowerCase(),{kind:"lax",matcher:($)=>$.normalized.toLowerCase().includes(Y)}}class q0{_string;_substring;_regex;_normalizeWhiteSpace;_ignoreCase;constructor(Y){if(this._normalizeWhiteSpace=Y.normalizeWhiteSpace,this._ignoreCase=Y.ignoreCase,this._string=Y.matchSubstring?void 0:this.normalize(Y.string),this._substring=Y.matchSubstring?this.normalize(Y.string):void 0,Y.regexSource){let _=new Set((Y.regexFlags||"").split(""));if(Y.ignoreCase===!1)_.delete("i");if(Y.ignoreCase===!0)_.add("i");this._regex=new RegExp(Y.regexSource,[..._].join(""))}}matches(Y){if(!this._regex)Y=this.normalize(Y);if(this._string!==void 0)return Y===this._string;if(this._substring!==void 0)return Y.includes(this._substring);if(this._regex)return!!this._regex.test(Y);return!1}matchesClassList(Y,_,X){if(X){if(this._regex)throw Y.createStacklessError("Partial matching does not support regular expressions. Please provide a string value.");return this._string.split(/\s+/g).filter(Boolean).every((Z)=>_.contains(Z))}return this.matches(_.toString())}normalize(Y){if(!Y)return Y;if(this._normalizeWhiteSpace)Y=j(Y);if(this._ignoreCase)Y=Y.toLocaleLowerCase();return Y}}function x6(Y,_){if(Y===_)return!0;if(Y&&_&&typeof Y==="object"&&typeof _==="object"){if(Y.constructor!==_.constructor)return!1;if(Array.isArray(Y)){if(Y.length!==_.length)return!1;for(let Z=0;Z<Y.length;++Z)if(!x6(Y[Z],_[Z]))return!1;return!0}if(Y instanceof RegExp)return Y.source===_.source&&Y.flags===_.flags;if(Y.valueOf!==Object.prototype.valueOf)return Y.valueOf()===_.valueOf();if(Y.toString!==Object.prototype.toString)return Y.toString()===_.toString();let X=Object.keys(Y);if(X.length!==Object.keys(_).length)return!1;for(let Z=0;Z<X.length;++Z)if(!_.hasOwnProperty(X[Z]))return!1;for(let Z of X)if(!x6(Y[Z],_[Z]))return!1;return!0}if(typeof Y==="number"&&typeof _==="number")return isNaN(Y)&&isNaN(_);return!1}var F=new u6(window,{isUnderTest:!1,sdkLanguage:"javascript",testIdAttributeName:"data-testid",stableRafCount:1,browserName:"chromium",customEngines:[]});function p6(Y){return Y.map((_)=>{let{engine:X,body:Z}=_,$=Z.startsWith('"')&&Z.endsWith('"'),J=$?Z.slice(1,-1):Z;switch(X){case"text":return`internal:text=${u(J,$)}`;case"label":return`internal:label=${u(J,$)}`;case"placeholder":return`internal:attr=[placeholder=${y(J,$)}]`;case"alt":return`internal:attr=[alt=${y(J,$)}]`;case"title":return`internal:attr=[title=${y(J,$)}]`;case"testid":return`internal:testid=[data-testid=${y(J,!0)}]`;case"role":return`internal:role=${Z}`;case"has":return`internal:has="${Z.replace(/"/g,"\\\"")}"`;case"has-not":return`internal:has-not="${Z.replace(/"/g,"\\\"")}"`;case"has-text":return`internal:has-text=${u(J,$)}`;case"has-not-text":return`internal:has-not-text=${u(J,$)}`;case"internal:text":case"internal:label":case"internal:attr":case"internal:testid":case"internal:role":case"internal:has":case"internal:has-not":case"internal:has-text":case"internal:has-not-text":case"internal:and":case"internal:or":return`${X}=${Z}`;default:return`${X}=${Z}`}}).join(" >> ")}function v0(Y,_){let X=p6(Y);try{let Z=F.parseSelector(X);return F.querySelectorAll(Z,_)}catch{let Z=_===document?[document.documentElement]:[_];for(let $ of Y){if($.engine==="nth"){let K=parseInt($.body,10);Z=K>=0&&K<Z.length?[Z[K]]:[];continue}let J=[],Q=new Set;for(let K of Z){let G=[];try{if($.engine==="css")G=[...K.querySelectorAll($.body)];else if($.engine==="xpath"){let H=(K.ownerDocument||document).evaluate($.body.startsWith("/")?"."+$.body:$.body,K,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE);for(let w=H.iterateNext();w;w=H.iterateNext())if(w.nodeType===Node.ELEMENT_NODE)G.push(w)}else if($.engine==="id"){let U=document.getElementById($.body);if(U)G=[U]}}catch{}for(let U of G)if(!Q.has(U))Q.add(U),J.push(U)}Z=J}return Z}}function W5(Y,_){let X=F.elementState(Y,_);if(typeof X==="object"&&X!==null&&"matches"in X)return X.matches;return X}function e4(Y,_){for(let X of _){let Z=W5(Y,X);if(Z==="error:notconnected")return"error:notconnected";if(!Z)return`error:not${X}`}return"done"}function YY(Y){if(!Y.isConnected)return{actionable:!1,reason:"notconnected"};if(!b(Y))return{actionable:!1,reason:"notvisible"};if(r(Y))return{actionable:!1,reason:"disabled"};return{actionable:!0}}function _Y(Y,_){return F.expectHitTarget(Y,_)}function XY(Y,_,X="mouse"){let Z=window;if(Z.__fd&&Z.__fd._hitInterceptor){try{Z.__fd._hitInterceptor.stop()}catch{}Z.__fd._hitInterceptor=null}let $=F.setupHitTargetInterceptor(Y,X,_,!1);if(typeof $==="string")return $;if($==="error:notconnected")return $;return Z.__fd._hitInterceptor=$,"ok"}function ZY(){let Y=window,_=Y.__fd&&Y.__fd._hitInterceptor;if(!_)return"done";return Y.__fd._hitInterceptor=null,_.stop()}function q5(Y){let _=Y.tagName?.toUpperCase();if(_==="SELECT")return"select";if(_==="INPUT"&&Y.type==="file")return"file";return""}async function B5(Y,_){let X=_.filter(($)=>$!=="stable"),Z=await F.checkElementStates(Y,X);if(Z==="error:notconnected")return"connected";if(Z!==void 0)return Z.missingState;if(_.includes("stable")){if(!await Promise.race([F.checkElementStates(Y,["stable"]).then((J)=>J===void 0),new Promise((J)=>setTimeout(()=>J(!0),1000))]))return"stable"}return}async function $Y(Y,_,X,Z){let $=q5(Y);if($)return{guard:$,actionable:!1,point:null};let J=await B5(Y,X);if(J)return{guard:"",actionable:!1,reason:J,point:null};if(Z)Y.scrollIntoView(Z);else if(typeof Y.scrollIntoViewIfNeeded==="function")Y.scrollIntoViewIfNeeded();else Y.scrollIntoView({block:"center",inline:"center"});let Q,K;if(_){let U=Y.getBoundingClientRect(),H=Y.ownerDocument.defaultView.getComputedStyle(Y);Q=U.x+(parseFloat(H.borderLeftWidth)||0)+_.x,K=U.y+(parseFloat(H.borderTopWidth)||0)+_.y}else{let{innerWidth:U,innerHeight:H}=window,w=null,W=-1;for(let L of Array.from(Y.getClientRects())){let M=Math.max(0,Math.min(L.right,U)-Math.max(L.left,0)),O=Math.max(0,Math.min(L.bottom,H)-Math.max(L.top,0)),q=M*O;if(q>W)W=q,w=L}if(!w||W<=0.99)return{guard:"",actionable:!1,reason:"inviewport",point:null};Q=(Math.max(w.left,0)+Math.min(w.right,U))/2,K=(Math.max(w.top,0)+Math.min(w.bottom,H))/2}let G=Y.ownerDocument.defaultView;while(G&&G!==G.parent&&G.frameElement){let U=G.frameElement.getBoundingClientRect();Q+=U.x,K+=U.y,G=G.parent}return{guard:"",actionable:!0,point:{x:Q,y:K}}}function JY(Y,_){if(Y.focus(),Y.value="",_!==void 0)Y.value=_;Y.dispatchEvent(new Event("input",{bubbles:!0})),Y.dispatchEvent(new Event("change",{bubbles:!0}))}function KY(Y){Y.dispatchEvent(new Event("input",{bubbles:!0})),Y.dispatchEvent(new Event("change",{bubbles:!0}))}function QY(Y,_){return F.fill(Y,_)}function GY(Y,..._){return F.selectOptions(Y,_)}function UY(Y){return{options:[...Y.options].map((_,X)=>({index:X,text:(_.textContent||"").trim(),value:_.value,selected:_.selected}))}}function wY(Y,_){let Z=[...Y.options].find(($)=>$.value===_||H5($.textContent||"")===H5(_));if(!Z)return{selected:!1,error:"Option not found"};return Y.value=Z.value,Y.dispatchEvent(new Event("input",{bubbles:!0})),Y.dispatchEvent(new Event("change",{bubbles:!0})),{selected:!0,value:Z.value}}function MY(Y){F.focusNode(Y,!1)}function HY(Y){F.blurNode(Y)}function WY(Y){F.selectText(Y)}function qY(Y,_){return F.setInputFiles(Y,_)}function H5(Y){return(Y||"").replace(/[\u200b\u00ad]/g,"").trim().replace(/\s+/g," ")}if(!window.__fd)window.__fd={_injected:F,_exec:v0,sel(Y){try{let _=v0(Y,document);return _.forEach((X,Z)=>X.setAttribute("data-fd-sel",""+Z)),JSON.stringify(_.map((X,Z)=>{let $=(X.textContent||"").trim();return{index:Z,tag:X.tagName.toLowerCase(),text:$.length>100?$.slice(0,100)+"...":$}}))}catch(_){return JSON.stringify({error:_.message})}},selOne(Y,_){let X=v0(Y,document);if(_&&X.length>1)throw Error("strict mode violation: "+X.length);return X.length>0?X[0]:null},selAll(Y){return v0(Y,document)},selCount(Y){return v0(Y,document).length},scrollInfo(){return JSON.stringify({scrollY:window.scrollY,scrollHeight:document.documentElement.scrollHeight,viewportHeight:window.innerHeight})},normalizeSelector(Y){let _=v0(Y,document);if(_.length===0)throw Error("normalize: no element found");if(_.length>1)throw Error("strict mode violation: "+_.length);return F.generateSelectorSimple(_[0])},parseSelector:(Y)=>F.parseSelector(Y),querySelector:(Y,_,X)=>F.querySelector(Y,_,X),querySelectorAll:(Y,_)=>F.querySelectorAll(Y,_),addHighlight(Y,_){F.addHighlight(F.parseSelector(p6(Y)),_)},removeHighlight(Y){F.removeHighlight(F.parseSelector(p6(Y)))},hideHighlight(){F.hideHighlight()},elementState:W5,checkElementStates:e4,isActionable:YY,isVisible:b,expectHitTarget:_Y,installHitInterceptor:XY,finalizeHitInterceptor:ZY,clearAndDispatch:JY,dispatchInputEvents:KY,clickGuard:q5,clickPrep:$Y,awaitStates:B5,selectOption:wY,selectOptions:GY,getOptions:UY,fill:QY,focusNode:MY,blurNode:HY,selectText:WY,setInputFiles:qY,getAriaRole:P,getAccessibleName:s,getAriaDisabled:r,getChecked:T1,getReadonly:k1,ariaSnapshot:(Y,_)=>F.ariaSnapshot(Y,{mode:_?.mode||"default",depth:_?.depth}),incrementalAriaSnapshot:(Y,_)=>F.incrementalAriaSnapshot(Y,{mode:_?.mode||"default",depth:_?.depth,refPrefix:_?.refPrefix}),markIframeByAriaRef:(Y,_)=>{let X=document.querySelectorAll("iframe,frame");for(let Z of X){let $=Z._ariaRef;if($&&$.ref===Y)return Z.setAttribute(_,Y),!0}return!1},UtilityScript:g0,newUtilityScript:()=>new g0(window,!1),parseEvaluationResultValue:h0,serializeAsCallArgument:c1};})();
})()