Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@asamuzakjp/dom-selector

Package Overview
Dependencies
Maintainers
0
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asamuzakjp/dom-selector - npm Package Compare versions

Comparing version 4.4.13 to 4.5.0-b.1

2

dist/cjs/js/constant.js

@@ -1,2 +0,2 @@

var T=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var w=(e,t)=>{for(var x in t)T(e,x,{get:t[x],enumerable:!0})},X=(e,t,x,M)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of f(t))!m.call(e,r)&&r!==x&&T(e,r,{get:()=>t[r],enumerable:!(M=H(t,r))||M.enumerable});return e};var g=e=>X(T({},"__esModule",{value:!0}),e);var so={};w(so,{ALPHA_NUM:()=>R,ANB:()=>a,AN_PLUS_B:()=>h,BIT_01:()=>Et,BIT_02:()=>rt,BIT_04:()=>nt,BIT_08:()=>_t,BIT_16:()=>pt,BIT_32:()=>xt,BIT_FFFF:()=>ct,BIT_HYPHEN:()=>Ot,CHILD_IDX:()=>i,COMBINATOR:()=>b,COMBO_A:()=>O,COMBO_B:()=>$,COMPLEX_A:()=>L,COMPLEX_B:()=>A,COMPLEX_C:()=>D,COMPLEX_D:()=>P,COMPOUND:()=>s,COMPOUND_A:()=>N,COMPOUND_B:()=>S,COMPOUND_C:()=>G,COMPOUND_I:()=>I,DIGIT:()=>c,DOCUMENT_FRAGMENT_NODE:()=>St,DOCUMENT_NODE:()=>Nt,DOCUMENT_POSITION_CONTAINED_BY:()=>Dt,DOCUMENT_POSITION_CONTAINS:()=>It,DOCUMENT_POSITION_PRECEDING:()=>Gt,DUO:()=>$t,ELEMENT_NODE:()=>Lt,EMPTY:()=>W,HEX:()=>Tt,IDENTIFIER:()=>y,LANG_PART:()=>l,LOGICAL_COMPLEX_A:()=>F,LOGICAL_COMPLEX_B:()=>Y,LOGICAL_COMPOUND:()=>u,LOGICAL_KEY:()=>p,NESTED_LOGICAL_A:()=>U,NESTED_LOGICAL_B:()=>d,NESTED_LOGICAL_C:()=>B,NOT_SUPPORTED_ERR:()=>k,NTH:()=>K,N_TH:()=>_,PSEUDO_CLASSES:()=>n,RAW:()=>Z,REG_ANCHOR:()=>Ut,REG_CHILD_INDEXED:()=>dt,REG_COMPLEX_A:()=>Bt,REG_COMPLEX_B:()=>Ft,REG_DIR:()=>Yt,REG_FORM:()=>ut,REG_FORM_CTRL:()=>Ht,REG_FORM_GROUP:()=>ft,REG_FORM_VALID:()=>mt,REG_HEX:()=>wt,REG_INTERACT:()=>Xt,REG_INVALID_SELECTOR:()=>gt,REG_LANG:()=>ht,REG_LANG_QUOTED:()=>bt,REG_LOGICAL_COMPLEX_A:()=>Wt,REG_LOGICAL_COMPLEX_B:()=>yt,REG_LOGICAL_COMPOUND:()=>kt,REG_LOGICAL_EMPTY:()=>Kt,REG_LOGICAL_KEY:()=>Zt,REG_LOGICAL_PSEUDO:()=>vt,REG_SHADOW_HOST:()=>zt,REG_SHADOW_MODE:()=>Vt,REG_SHADOW_PSEUDO:()=>Qt,REG_TYPE_CHECK:()=>jt,REG_TYPE_DATE:()=>qt,REG_TYPE_RANGE:()=>Jt,REG_TYPE_RESET:()=>to,REG_TYPE_SUBMIT:()=>oo,REG_TYPE_TEXT:()=>eo,SELECTOR:()=>v,SELECTOR_ATTR:()=>z,SELECTOR_CLASS:()=>V,SELECTOR_ID:()=>Q,SELECTOR_LIST:()=>j,SELECTOR_PSEUDO_CLASS:()=>q,SELECTOR_PSEUDO_ELEMENT:()=>J,SELECTOR_TYPE:()=>tt,SHOW_ALL:()=>Pt,SHOW_DOCUMENT:()=>Mt,SHOW_DOCUMENT_FRAGMENT:()=>it,SHOW_ELEMENT:()=>lt,STRING:()=>ot,SUB_TYPE:()=>E,SYNTAX_ERR:()=>et,TAG_TYPE:()=>o,TAG_TYPE_I:()=>C,TEXT_NODE:()=>At,TYPE_FROM:()=>Rt,TYPE_TO:()=>Ct,U_FFFD:()=>st,WALKER_FILTER:()=>at});module.exports=g(so);const h="AnPlusB",b="Combinator",W="__EMPTY__",y="Identifier",k="NotSupportedError",K="Nth",Z="Raw",v="Selector",z="AttributeSelector",V="ClassSelector",Q="IdSelector",j="SelectorList",q="PseudoClassSelector",J="PseudoElementSelector",tt="TypeSelector",ot="String",et="SyntaxError",st="\uFFFD",Et=1,rt=2,nt=4,_t=8,pt=16,xt=32,ct=65535,Ot=45,$t=2,Tt=16,Rt=8,Ct=-1,Lt=1,At=3,Nt=9,St=11,Gt=2,It=8,Dt=16,Pt=4294967295,Mt=256,it=1024,lt=1,at=1281,R="[A-Z\\d]+",i="(?:first|last|only)-(?:child|of-type)",c="(?:0|[1-9]\\d*)",l=`(?:-${R})*`,n=`(?:any-)?link|${i}|checked|empty|indeterminate|root|target|visited`,a=`[+-]?(?:${c}n?|n)|(?:[+-]?${c})?n\\s*[+-]\\s*${c}`,_=`nth-(?:last-)?(?:child|of-type)\\(\\s*(?:even|odd|${a})\\s*\\)`,E="\\[[^\\]]+\\]|[#.:][\\w-]+",o="\\*|[A-Za-z][\\w-]*",C="\\*|[A-Z][\\w-]*",p="(?:is|not)",s=`(?:${o}|(?:${o})?(?:${E})+)`,O="\\s?[\\s>~+]\\s?",$="\\s?[~+]\\s?",L=`${s}(?:${O}${s})*`,A=`${s}(?:${$}${s})*`,U=`:is\\(\\s*${s}(?:\\s*,\\s*${s})*\\s*\\)`,d=`:is\\(\\s*${L}(?:\\s*,\\s*${L})*\\s*\\)`,B=`:is\\(\\s*${A}(?:\\s*,\\s*${A})*\\s*\\)`,N=`(?:${o}|(?:${o})?(?:${E}|${U})+)`,S=`(?:${o}|(?:${o})?(?:${E}|${d})+)`,G=`(?:${o}|(?:${o})?(?:${E}|${B})+)`,I=`(?:${C}|(?:${C})?(?:${E})+)`,D=`${S}(?:${O}${S})*`,P=`${G}(?:${$}${G})*`,F=`${p}\\(\\s*${D}(?:\\s*,\\s*${D})*\\s*\\)`,Y=`${p}\\(\\s*${P}(?:\\s*,\\s*${P})*\\s*\\)`,u=`${p}\\(\\s*${N}(?:\\s*,\\s*${N})*\\s*\\)`,Ut=/^a(?:rea)?$/,dt=new RegExp(`:(?!${n}|${_})`),Bt=new RegExp(`${O}${I}`,"i"),Ft=new RegExp(`${$}${I}`,"i"),Yt=/^(?:ltr|rtl)$/,ut=/^(?:(?:fieldse|inpu|selec)t|button|form|textarea)$/,Ht=/^(?:button|fieldset|input|optgroup|option|select|textarea)$/,ft=/^(?:fieldset|optgroup|select)$/,mt=/^(?:button|form|input|select|textarea)$/,wt=/^([\da-f]{1,6}\s?)/i,Xt=/^(?:details|dialog)$/,gt=/^$|^\s*>|,\s*$/,ht=new RegExp(`^(?:\\*-)?${R}${l}$`,"i"),bt=/(:lang\(\s*("[A-Za-z\d\-*]*")\s*\))/,Wt=new RegExp(`:(?!${n}|${_}|${F})`),yt=new RegExp(`:(?!${n}|${_}|${Y})`),kt=new RegExp(`:(?!${n}|${_}|${u})`),Kt=/(:(is|where)\(\s*\))/,Zt=new RegExp(`:${p}\\(`),vt=/^(?:has|is|not|where)$/,zt=/^host(?:-context)?$/,Vt=/^(?:close|open)$/,Qt=/^part|slotted$/,jt=/^(?:checkbox|radio)$/,qt=/^(?:date(?:time-local)?|month|time|week)$/,Jt=/(?:date(?:time-local)?|month|number|range|time|week)$/,to=/^(?:button|reset)$/,oo=/^(?:image|submit)$/,eo=/^(?:email|number|password|search|tel|text|url)$/;0&&(module.exports={ALPHA_NUM,ANB,AN_PLUS_B,BIT_01,BIT_02,BIT_04,BIT_08,BIT_16,BIT_32,BIT_FFFF,BIT_HYPHEN,CHILD_IDX,COMBINATOR,COMBO_A,COMBO_B,COMPLEX_A,COMPLEX_B,COMPLEX_C,COMPLEX_D,COMPOUND,COMPOUND_A,COMPOUND_B,COMPOUND_C,COMPOUND_I,DIGIT,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,DOCUMENT_POSITION_CONTAINS,DOCUMENT_POSITION_PRECEDING,DUO,ELEMENT_NODE,EMPTY,HEX,IDENTIFIER,LANG_PART,LOGICAL_COMPLEX_A,LOGICAL_COMPLEX_B,LOGICAL_COMPOUND,LOGICAL_KEY,NESTED_LOGICAL_A,NESTED_LOGICAL_B,NESTED_LOGICAL_C,NOT_SUPPORTED_ERR,NTH,N_TH,PSEUDO_CLASSES,RAW,REG_ANCHOR,REG_CHILD_INDEXED,REG_COMPLEX_A,REG_COMPLEX_B,REG_DIR,REG_FORM,REG_FORM_CTRL,REG_FORM_GROUP,REG_FORM_VALID,REG_HEX,REG_INTERACT,REG_INVALID_SELECTOR,REG_LANG,REG_LANG_QUOTED,REG_LOGICAL_COMPLEX_A,REG_LOGICAL_COMPLEX_B,REG_LOGICAL_COMPOUND,REG_LOGICAL_EMPTY,REG_LOGICAL_KEY,REG_LOGICAL_PSEUDO,REG_SHADOW_HOST,REG_SHADOW_MODE,REG_SHADOW_PSEUDO,REG_TYPE_CHECK,REG_TYPE_DATE,REG_TYPE_RANGE,REG_TYPE_RESET,REG_TYPE_SUBMIT,REG_TYPE_TEXT,SELECTOR,SELECTOR_ATTR,SELECTOR_CLASS,SELECTOR_ID,SELECTOR_LIST,SELECTOR_PSEUDO_CLASS,SELECTOR_PSEUDO_ELEMENT,SELECTOR_TYPE,SHOW_ALL,SHOW_DOCUMENT,SHOW_DOCUMENT_FRAGMENT,SHOW_ELEMENT,STRING,SUB_TYPE,SYNTAX_ERR,TAG_TYPE,TAG_TYPE_I,TEXT_NODE,TYPE_FROM,TYPE_TO,U_FFFD,WALKER_FILTER});
var T=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var m=(e,t)=>{for(var p in t)T(e,p,{get:t[p],enumerable:!0})},X=(e,t,p,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of H(t))!w.call(e,r)&&r!==p&&T(e,r,{get:()=>t[r],enumerable:!(i=f(t,r))||i.enumerable});return e};var g=e=>X(T({},"__esModule",{value:!0}),e);var Eo={};m(Eo,{ALPHA_NUM:()=>R,ANB:()=>a,AN_PLUS_B:()=>h,BIT_01:()=>Et,BIT_02:()=>rt,BIT_04:()=>nt,BIT_08:()=>_t,BIT_16:()=>ct,BIT_32:()=>pt,BIT_FFFF:()=>xt,BIT_HYPHEN:()=>Ot,CHILD_IDX:()=>M,COMBINATOR:()=>b,COMBO_A:()=>O,COMBO_B:()=>$,COMPLEX_A:()=>L,COMPLEX_B:()=>A,COMPLEX_C:()=>D,COMPLEX_D:()=>P,COMPOUND:()=>s,COMPOUND_A:()=>N,COMPOUND_B:()=>S,COMPOUND_C:()=>G,COMPOUND_I:()=>I,DIGIT:()=>x,DOCUMENT_FRAGMENT_NODE:()=>St,DOCUMENT_NODE:()=>Nt,DOCUMENT_POSITION_CONTAINED_BY:()=>Dt,DOCUMENT_POSITION_CONTAINS:()=>It,DOCUMENT_POSITION_PRECEDING:()=>Gt,DUO:()=>$t,ELEMENT_NODE:()=>Lt,EMPTY:()=>W,HEX:()=>Tt,IDENTIFIER:()=>y,LANG_PART:()=>l,LOGICAL_COMPLEX_A:()=>F,LOGICAL_COMPLEX_B:()=>u,LOGICAL_COMPOUND:()=>Y,LOGICAL_KEY:()=>c,NESTED_LOGICAL_A:()=>U,NESTED_LOGICAL_B:()=>d,NESTED_LOGICAL_C:()=>B,NOT_SUPPORTED_ERR:()=>k,NTH:()=>v,N_TH:()=>_,PSEUDO_CLASSES:()=>n,RAW:()=>K,REG_ANCHOR:()=>Ut,REG_CHILD_INDEXED:()=>dt,REG_COMPLEX_A:()=>Bt,REG_COMPLEX_B:()=>Ft,REG_DIR:()=>ut,REG_FORM:()=>Yt,REG_FORM_CTRL:()=>ft,REG_FORM_GROUP:()=>Ht,REG_FORM_VALID:()=>wt,REG_HEX:()=>mt,REG_INTERACT:()=>Xt,REG_INVALID_SELECTOR:()=>gt,REG_LANG:()=>ht,REG_LANG_QUOTED:()=>bt,REG_LOGICAL_COMPLEX_A:()=>Wt,REG_LOGICAL_COMPLEX_B:()=>yt,REG_LOGICAL_COMPOUND:()=>kt,REG_LOGICAL_EMPTY:()=>vt,REG_LOGICAL_KEY:()=>Kt,REG_LOGICAL_PSEUDO:()=>Zt,REG_SHADOW_HOST:()=>zt,REG_SHADOW_MODE:()=>Vt,REG_SHADOW_PSEUDO:()=>Qt,REG_TYPE_CHECK:()=>jt,REG_TYPE_DATE:()=>qt,REG_TYPE_RANGE:()=>Jt,REG_TYPE_RESET:()=>to,REG_TYPE_SUBMIT:()=>oo,REG_TYPE_TEXT:()=>eo,REG_USER_ACTION:()=>so,SELECTOR:()=>Z,SELECTOR_ATTR:()=>z,SELECTOR_CLASS:()=>V,SELECTOR_ID:()=>Q,SELECTOR_LIST:()=>j,SELECTOR_PSEUDO_CLASS:()=>q,SELECTOR_PSEUDO_ELEMENT:()=>J,SELECTOR_TYPE:()=>tt,SHOW_ALL:()=>Pt,SHOW_DOCUMENT:()=>it,SHOW_DOCUMENT_FRAGMENT:()=>Mt,SHOW_ELEMENT:()=>lt,STRING:()=>ot,SUB_TYPE:()=>E,SYNTAX_ERR:()=>et,TAG_TYPE:()=>o,TAG_TYPE_I:()=>C,TEXT_NODE:()=>At,TYPE_FROM:()=>Rt,TYPE_TO:()=>Ct,U_FFFD:()=>st,WALKER_FILTER:()=>at});module.exports=g(Eo);const h="AnPlusB",b="Combinator",W="__EMPTY__",y="Identifier",k="NotSupportedError",v="Nth",K="Raw",Z="Selector",z="AttributeSelector",V="ClassSelector",Q="IdSelector",j="SelectorList",q="PseudoClassSelector",J="PseudoElementSelector",tt="TypeSelector",ot="String",et="SyntaxError",st="\uFFFD",Et=1,rt=2,nt=4,_t=8,ct=16,pt=32,xt=65535,Ot=45,$t=2,Tt=16,Rt=8,Ct=-1,Lt=1,At=3,Nt=9,St=11,Gt=2,It=8,Dt=16,Pt=4294967295,it=256,Mt=1024,lt=1,at=1281,R="[A-Z\\d]+",M="(?:first|last|only)-(?:child|of-type)",x="(?:0|[1-9]\\d*)",l=`(?:-${R})*`,n=`(?:any-)?link|${M}|checked|empty|indeterminate|root|target|visited`,a=`[+-]?(?:${x}n?|n)|(?:[+-]?${x})?n\\s*[+-]\\s*${x}`,_=`nth-(?:last-)?(?:child|of-type)\\(\\s*(?:even|odd|${a})\\s*\\)`,E="\\[[^\\]]+\\]|[#.:][\\w-]+",o="\\*|[A-Za-z][\\w-]*",C="\\*|[A-Z][\\w-]*",c="(?:is|not)",s=`(?:${o}|(?:${o})?(?:${E})+)`,O="\\s?[\\s>~+]\\s?",$="\\s?[~+]\\s?",L=`${s}(?:${O}${s})*`,A=`${s}(?:${$}${s})*`,U=`:is\\(\\s*${s}(?:\\s*,\\s*${s})*\\s*\\)`,d=`:is\\(\\s*${L}(?:\\s*,\\s*${L})*\\s*\\)`,B=`:is\\(\\s*${A}(?:\\s*,\\s*${A})*\\s*\\)`,N=`(?:${o}|(?:${o})?(?:${E}|${U})+)`,S=`(?:${o}|(?:${o})?(?:${E}|${d})+)`,G=`(?:${o}|(?:${o})?(?:${E}|${B})+)`,I=`(?:${C}|(?:${C})?(?:${E})+)`,D=`${S}(?:${O}${S})*`,P=`${G}(?:${$}${G})*`,F=`${c}\\(\\s*${D}(?:\\s*,\\s*${D})*\\s*\\)`,u=`${c}\\(\\s*${P}(?:\\s*,\\s*${P})*\\s*\\)`,Y=`${c}\\(\\s*${N}(?:\\s*,\\s*${N})*\\s*\\)`,Ut=/^a(?:rea)?$/,dt=new RegExp(`:(?!${n}|${_})`),Bt=new RegExp(`${O}${I}`,"i"),Ft=new RegExp(`${$}${I}`,"i"),ut=/^(?:ltr|rtl)$/,Yt=/^(?:(?:fieldse|inpu|selec)t|button|form|textarea)$/,ft=/^(?:button|fieldset|input|optgroup|option|select|textarea)$/,Ht=/^(?:fieldset|optgroup|select)$/,wt=/^(?:button|form|input|select|textarea)$/,mt=/^([\da-f]{1,6}\s?)/i,Xt=/^(?:details|dialog)$/,gt=/^$|^\s*>|,\s*$/,ht=new RegExp(`^(?:\\*-)?${R}${l}$`,"i"),bt=/(:lang\(\s*("[A-Za-z\d\-*]*")\s*\))/,Wt=new RegExp(`:(?!${n}|${_}|${F})`),yt=new RegExp(`:(?!${n}|${_}|${u})`),kt=new RegExp(`:(?!${n}|${_}|${Y})`),vt=/(:(is|where)\(\s*\))/,Kt=new RegExp(`:${c}\\(`),Zt=/^(?:has|is|not|where)$/,zt=/^host(?:-context)?$/,Vt=/^(?:close|open)$/,Qt=/^part|slotted$/,jt=/^(?:checkbox|radio)$/,qt=/^(?:date(?:time-local)?|month|time|week)$/,Jt=/(?:date(?:time-local)?|month|number|range|time|week)$/,to=/^(?:button|reset)$/,oo=/^(?:image|submit)$/,eo=/^(?:email|number|password|search|tel|text|url)$/,so=/active|focus(?:-(?:visible|within))?|hover/;0&&(module.exports={ALPHA_NUM,ANB,AN_PLUS_B,BIT_01,BIT_02,BIT_04,BIT_08,BIT_16,BIT_32,BIT_FFFF,BIT_HYPHEN,CHILD_IDX,COMBINATOR,COMBO_A,COMBO_B,COMPLEX_A,COMPLEX_B,COMPLEX_C,COMPLEX_D,COMPOUND,COMPOUND_A,COMPOUND_B,COMPOUND_C,COMPOUND_I,DIGIT,DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,DOCUMENT_POSITION_CONTAINS,DOCUMENT_POSITION_PRECEDING,DUO,ELEMENT_NODE,EMPTY,HEX,IDENTIFIER,LANG_PART,LOGICAL_COMPLEX_A,LOGICAL_COMPLEX_B,LOGICAL_COMPOUND,LOGICAL_KEY,NESTED_LOGICAL_A,NESTED_LOGICAL_B,NESTED_LOGICAL_C,NOT_SUPPORTED_ERR,NTH,N_TH,PSEUDO_CLASSES,RAW,REG_ANCHOR,REG_CHILD_INDEXED,REG_COMPLEX_A,REG_COMPLEX_B,REG_DIR,REG_FORM,REG_FORM_CTRL,REG_FORM_GROUP,REG_FORM_VALID,REG_HEX,REG_INTERACT,REG_INVALID_SELECTOR,REG_LANG,REG_LANG_QUOTED,REG_LOGICAL_COMPLEX_A,REG_LOGICAL_COMPLEX_B,REG_LOGICAL_COMPOUND,REG_LOGICAL_EMPTY,REG_LOGICAL_KEY,REG_LOGICAL_PSEUDO,REG_SHADOW_HOST,REG_SHADOW_MODE,REG_SHADOW_PSEUDO,REG_TYPE_CHECK,REG_TYPE_DATE,REG_TYPE_RANGE,REG_TYPE_RESET,REG_TYPE_SUBMIT,REG_TYPE_TEXT,REG_USER_ACTION,SELECTOR,SELECTOR_ATTR,SELECTOR_CLASS,SELECTOR_ID,SELECTOR_LIST,SELECTOR_PSEUDO_CLASS,SELECTOR_PSEUDO_ELEMENT,SELECTOR_TYPE,SHOW_ALL,SHOW_DOCUMENT,SHOW_DOCUMENT_FRAGMENT,SHOW_ELEMENT,STRING,SUB_TYPE,SYNTAX_ERR,TAG_TYPE,TAG_TYPE_I,TEXT_NODE,TYPE_FROM,TYPE_TO,U_FFFD,WALKER_FILTER});
//# sourceMappingURL=constant.js.map

@@ -1,2 +0,2 @@

var O=Object.create;var p=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var r in t)p(e,r,{get:t[r],enumerable:!0})},b=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of w(t))!_.call(e,o)&&o!==r&&p(e,o,{get:()=>t[o],enumerable:!(s=k(t,o))||s.enumerable});return e};var R=(e,t,r)=>(r=e!=null?O(C(e)):{},b(t||!e||!e.__esModule?p(r,"default",{value:e,enumerable:!0}):r,e)),v=e=>b(p({},"__esModule",{value:!0}),e);var S={};I(S,{getDirectionality:()=>m,getNamespaceURI:()=>h,getSlottedTextContent:()=>f,isContentEditable:()=>g,isInShadowTree:()=>d,isNamespaceDeclared:()=>U,isPreceding:()=>D,resolveContent:()=>M,sortNodes:()=>P,verifyNode:()=>x});module.exports=v(S);var E=R(require("bidi-js"),1),i=require("./constant.js");const x=e=>{if(!e||!e.nodeType||!e.nodeName){const r=`Unexpected type ${Object.prototype.toString.call(e).slice(i.TYPE_FROM,i.TYPE_TO)}`;throw new TypeError(r)}else if(!(e.nodeType===i.DOCUMENT_NODE||e.nodeType===i.DOCUMENT_FRAGMENT_NODE||e.nodeType===i.ELEMENT_NODE)){const t=`Unexpected node ${e.nodeName}`;throw new TypeError(t)}return e},M=e=>{e=x(e);let t,r;switch(e.nodeType){case i.DOCUMENT_NODE:{t=e,r=e;break}case i.DOCUMENT_FRAGMENT_NODE:{t=e.ownerDocument,r=e;break}case i.ELEMENT_NODE:default:{t=e.ownerDocument;let o=e;for(;o&&o.parentNode;)o=o.parentNode;r=o;break}}const s=t.createTreeWalker(r,i.WALKER_FILTER);return[t,r,s]},d=(e={})=>{let t;if(e.nodeType===i.ELEMENT_NODE||e.nodeType===i.DOCUMENT_FRAGMENT_NODE){let r=e;for(;r;){const{host:s,mode:o,nodeType:a,parentNode:l}=r;if(s&&o&&a===i.DOCUMENT_FRAGMENT_NODE&&i.REG_SHADOW_MODE.test(o)){t=!0;break}r=l}}return!!t},f=(e={})=>{let t;if(e.localName==="slot"&&d(e)){const r=e.assignedNodes();if(r.length){for(const s of r)if(t=s.textContent.trim(),t)break}else t=e.textContent.trim()}return t??null},m=(e={})=>{let t;if(e.nodeType===i.ELEMENT_NODE){const{dir:r,localName:s,parentNode:o}=e,{getEmbeddingLevels:a}=(0,E.default)();if(i.REG_DIR.test(r))t=r;else if(r==="auto"){let l;switch(s){case"input":{!e.type||/^(?:button|email|hidden|password|reset|search|submit|tel|text|url)$/.test(e.type)?l=e.value:/^(?:checkbox|color|date|image|number|radio|range|time)$/.test(e.type)&&(t="ltr");break}case"slot":{l=f(e);break}case"textarea":{l=e.value;break}default:{const n=[].slice.call(e.childNodes);for(const c of n){const{dir:u,localName:T,nodeType:N,textContent:y}=c;if(N===i.TEXT_NODE?l=y.trim():N===i.ELEMENT_NODE&&!/^(?:bdi|script|style|textarea)$/.test(T)&&(!u||!i.REG_DIR.test(u))&&(T==="slot"?l=f(c):l=y.trim()),l)break}}}if(l){const{paragraphs:[{level:n}]}=a(l);n%2===1?t="rtl":t="ltr"}if(!t)if(o){const{nodeType:n}=o;n===i.ELEMENT_NODE?t=m(o):(n===i.DOCUMENT_NODE||n===i.DOCUMENT_FRAGMENT_NODE)&&(t="ltr")}else t="ltr"}else if(s==="bdi"){const l=e.textContent.trim();if(l){const{paragraphs:[{level:n}]}=a(l);n%2===1?t="rtl":t="ltr"}t||o||(t="ltr")}else if(s==="input"&&e.type==="tel")t="ltr";else if(o){if(s==="slot"){const l=f(e);if(l){const{paragraphs:[{level:n}]}=a(l);n%2===1?t="rtl":t="ltr"}}if(!t){const{nodeType:l}=o;l===i.ELEMENT_NODE?t=m(o):(l===i.DOCUMENT_NODE||l===i.DOCUMENT_FRAGMENT_NODE)&&(t="ltr")}}else t="ltr"}return t??null},g=(e={})=>{let t;if(e.nodeType===i.ELEMENT_NODE){if(typeof e.isContentEditable=="boolean")t=e.isContentEditable;else if(e.ownerDocument.designMode==="on")t=!0;else if(e.hasAttribute("contenteditable")){const r=e.getAttribute("contenteditable");if(r===""||/^(?:plaintext-only|true)$/.test(r))t=!0;else if(r==="inherit"){let s=e.parentNode;for(;s;){if(g(s)){t=!0;break}s=s.parentNode}}}}return!!t},h=(e,t)=>{let r;if(e&&typeof e=="string"&&t?.nodeType===i.ELEMENT_NODE){const{attributes:s}=t;for(const o of s){const{name:a,namespaceURI:l,prefix:n,value:c}=o;if(a===`xmlns:${e}`){r=c;break}else if(n===e){r=l;break}}}return r??null},U=(e="",t={})=>{let r;if(e&&typeof e=="string"&&t.nodeType===i.ELEMENT_NODE&&(r=t.lookupNamespaceURI(e),!r)){const s=t.ownerDocument.documentElement;let o=t;for(;o&&(r=h(e,o),!(r||o===s));)o=o.parentNode}return!!r},D=(e={},t={})=>{let r;if(e.nodeType===i.ELEMENT_NODE&&t.nodeType===i.ELEMENT_NODE){const s=t.compareDocumentPosition(e);r=s&i.DOCUMENT_POSITION_PRECEDING||s&i.DOCUMENT_POSITION_CONTAINS}return!!r},P=(e=[])=>{const t=[...e];return t.length>1&&t.sort((r,s)=>{let o;return D(s,r)?o=1:o=-1,o}),t};0&&(module.exports={getDirectionality,getNamespaceURI,getSlottedTextContent,isContentEditable,isInShadowTree,isNamespaceDeclared,isPreceding,resolveContent,sortNodes,verifyNode});
var C=Object.create;var f=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},x=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of k(t))!d.call(e,l)&&l!==r&&f(e,l,{get:()=>t[l],enumerable:!(i=_(t,l))||i.enumerable});return e};var R=(e,t,r)=>(r=e!=null?C(w(e)):{},x(t||!e||!e.__esModule?f(r,"default",{value:e,enumerable:!0}):r,e)),v=e=>x(f({},"__esModule",{value:!0}),e);var $={};I($,{getDirectionality:()=>u,getNamespaceURI:()=>D,getSlottedTextContent:()=>T,isContentEditable:()=>g,isInShadowTree:()=>h,isNamespaceDeclared:()=>P,isPreceding:()=>O,resolveContent:()=>M,sortNodes:()=>S,traverseNode:()=>U,verifyNode:()=>n});module.exports=v($);var E=R(require("bidi-js"),1),s=require("./constant.js");const n=e=>{if(!e||!e.nodeType||!e.nodeName){const r=`Unexpected type ${Object.prototype.toString.call(e).slice(s.TYPE_FROM,s.TYPE_TO)}`;throw new TypeError(r)}else if(!(e.nodeType===s.DOCUMENT_NODE||e.nodeType===s.DOCUMENT_FRAGMENT_NODE||e.nodeType===s.ELEMENT_NODE)){const t=`Unexpected node ${e.nodeName}`;throw new TypeError(t)}return e},M=e=>{e=n(e);let t,r;switch(e.nodeType){case s.DOCUMENT_NODE:{t=e,r=e;break}case s.DOCUMENT_FRAGMENT_NODE:{t=e.ownerDocument,r=e;break}case s.ELEMENT_NODE:default:{t=e.ownerDocument;let l=e;for(;l&&l.parentNode;)l=l.parentNode;r=l;break}}const i=t.createTreeWalker(r,s.WALKER_FILTER);return[t,r,i]},U=(e,t)=>{(!e||!e.nodeType)&&n(e);let r;if(t?.currentNode){let i=t.currentNode;if(i===e)r=i;else if(i.contains(e))for(i=t.nextNode();i;){if(i===e){r=i;break}i=t.nextNode()}else{if(i!==t.root)for(;i&&!(i===t.root||i===e);)i=t.parentNode();if(e.nodeType===s.ELEMENT_NODE)for(;i;){if(i===e){r=i;break}i=t.nextNode()}else r=i}}return r??null},h=e=>{(!e||!e.type)&&n(e);let t;if(e.nodeType===s.ELEMENT_NODE||e.nodeType===s.DOCUMENT_FRAGMENT_NODE){let r=e;for(;r;){const{host:i,mode:l,nodeType:p,parentNode:o}=r;if(i&&l&&p===s.DOCUMENT_FRAGMENT_NODE&&s.REG_SHADOW_MODE.test(l)){t=!0;break}r=o}}return!!t},T=e=>{(!e||!e.nodeType)&&n(e);let t;if(e.localName==="slot"&&h(e)){const r=e.assignedNodes();if(r.length){for(const i of r)if(t=i.textContent.trim(),t)break}else t=e.textContent.trim()}return t??null},u=e=>{(!e||!e.nodeType)&&n(e);let t;if(e.nodeType===s.ELEMENT_NODE){const{dir:r,localName:i,parentNode:l}=e,{getEmbeddingLevels:p}=(0,E.default)();if(s.REG_DIR.test(r))t=r;else if(r==="auto"){let o;switch(i){case"input":{!e.type||/^(?:button|email|hidden|password|reset|search|submit|tel|text|url)$/.test(e.type)?o=e.value:/^(?:checkbox|color|date|image|number|radio|range|time)$/.test(e.type)&&(t="ltr");break}case"slot":{o=T(e);break}case"textarea":{o=e.value;break}default:{const a=[].slice.call(e.childNodes);for(const c of a){const{dir:y,localName:N,nodeType:m,textContent:b}=c;if(m===s.TEXT_NODE?o=b.trim():m===s.ELEMENT_NODE&&!/^(?:bdi|script|style|textarea)$/.test(N)&&(!y||!s.REG_DIR.test(y))&&(N==="slot"?o=T(c):o=b.trim()),o)break}}}if(o){const{paragraphs:[{level:a}]}=p(o);a%2===1?t="rtl":t="ltr"}if(!t)if(l){const{nodeType:a}=l;a===s.ELEMENT_NODE?t=u(l):(a===s.DOCUMENT_NODE||a===s.DOCUMENT_FRAGMENT_NODE)&&(t="ltr")}else t="ltr"}else if(i==="bdi"){const o=e.textContent.trim();if(o){const{paragraphs:[{level:a}]}=p(o);a%2===1?t="rtl":t="ltr"}t||l||(t="ltr")}else if(i==="input"&&e.type==="tel")t="ltr";else if(l){if(i==="slot"){const o=T(e);if(o){const{paragraphs:[{level:a}]}=p(o);a%2===1?t="rtl":t="ltr"}}if(!t){const{nodeType:o}=l;o===s.ELEMENT_NODE?t=u(l):(o===s.DOCUMENT_NODE||o===s.DOCUMENT_FRAGMENT_NODE)&&(t="ltr")}}else t="ltr"}return t??null},g=e=>{(!e||!e.nodeType)&&n(e);let t;if(e.nodeType===s.ELEMENT_NODE){if(typeof e.isContentEditable=="boolean")t=e.isContentEditable;else if(e.ownerDocument.designMode==="on")t=!0;else if(e.hasAttribute("contenteditable")){const r=e.getAttribute("contenteditable");if(r===""||/^(?:plaintext-only|true)$/.test(r))t=!0;else if(r==="inherit"){let i=e.parentNode;for(;i;){if(g(i)){t=!0;break}i=i.parentNode}}}}return!!t},D=(e,t)=>{(!t||!t.nodeType)&&n(t);let r;if(e&&typeof e=="string"&&t.nodeType===s.ELEMENT_NODE){const{attributes:i}=t;for(const l of i){const{name:p,namespaceURI:o,prefix:a,value:c}=l;if(p===`xmlns:${e}`){r=c;break}else if(a===e){r=o;break}}}return r??null},P=(e="",t={})=>{let r;if(e&&typeof e=="string"&&t.nodeType===s.ELEMENT_NODE&&(r=t.lookupNamespaceURI(e),!r)){const i=t.ownerDocument.documentElement;let l=t;for(;l&&(r=D(e,l),!(r||l===i));)l=l.parentNode}return!!r},O=(e,t)=>{!e||!e.nodeType?n(e):(!t||!t.nodeType)&&n(t);let r;if(e.nodeType===s.ELEMENT_NODE&&t.nodeType===s.ELEMENT_NODE){const i=t.compareDocumentPosition(e);r=i&s.DOCUMENT_POSITION_PRECEDING||i&s.DOCUMENT_POSITION_CONTAINS}return!!r},S=(e=[])=>{const t=[...e];return t.length>1&&t.sort((r,i)=>{let l;return O(i,r)?l=1:l=-1,l}),t};0&&(module.exports={getDirectionality,getNamespaceURI,getSlottedTextContent,isContentEditable,isInShadowTree,isNamespaceDeclared,isPreceding,resolveContent,sortNodes,traverseNode,verifyNode});
//# sourceMappingURL=dom-util.js.map

@@ -1,2 +0,2 @@

var H=Object.create;var P=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var V=(y,l)=>{for(var e in l)P(y,e,{get:l[e],enumerable:!0})},I=(y,l,e,o)=>{if(l&&typeof l=="object"||typeof l=="function")for(let r of j(l))!q.call(y,r)&&r!==e&&P(y,r,{get:()=>l[r],enumerable:!(o=B(l,r))||o.enumerable});return y};var U=(y,l,e)=>(e=y!=null?H(Y(y)):{},I(l||!y||!y.__esModule?P(e,"default",{value:y,enumerable:!0}):e,y)),X=y=>I(P({},"__esModule",{value:!0}),y);var Q={};V(Q,{Finder:()=>K});module.exports=X(Q);var M=U(require("is-potential-custom-element-name"),1),G=U(require("@asamuzakjp/nwsapi"),1),v=require("./dom-util.js"),O=require("./matcher.js"),k=require("./parser.js"),n=require("./constant.js");const x="next",S="prev",L="all",g="first",C="lineal",R="self";class K{#l;#r;#s;#p;#c;#b;#e;#h;#w;#o;#f;#_;#t;#d;#u;#n;#m;#i;#a;constructor(l,e){this.#a=l,this.#c=e??l.document,this.#r=new WeakMap,this.#_=new WeakMap,this._initNwsapi()}_onError(l){if(!this.#w)if(l instanceof DOMException||l instanceof this.#a.DOMException)if(l.name===n.NOT_SUPPORTED_ERR)this.#i&&console.warn(l.message);else throw new this.#a.DOMException(l.message,l.name);else throw l}_setup(l,e,o={}){const{event:r,invalidate:a,noexcept:f,warn:c}=o;return a&&e.nodeType===n.ELEMENT_NODE&&(this.#r=new WeakMap),this.#w=!!f,this.#i=!!c,this.#b=this._setEvent(r),this.#e=e,[this.#s,this.#t,this.#n]=(0,v.resolveContent)(e),this.#d=(0,v.isInShadowTree)(e),[this.#l,this.#h]=this._correspond(l),this.#m=new WeakMap,e}_initNwsapi(){return this.#o=(0,G.default)({DOMException:this.#a.DOMException,document:this.#c}),this.#o.configure({LOGERRORS:!1}),this.#o}_setEvent(l){return l instanceof this.#a.MouseEvent||l instanceof this.#a.KeyboardEvent?l:null}_correspond(l){const e=[];this.#p=!1;let o;if(this.#s){const r=this.#r.get(this.#s);if(r&&r.has(`${l}`)){const a=r.get(`${l}`);this.#p=a.descendant,o=a.ast}}if(o){const r=o.length;for(let a=0;a<r;a++)o[a].collected=!1,o[a].dir=null,o[a].filtered=!1,o[a].find=!1,e[a]=[]}else{let r;try{r=(0,k.parseSelector)(l)}catch(d){this._onError(d)}const{branches:a,info:{hasPseudo:f}}=(0,k.walkAST)(r);let c=!1,u=0;o=[];for(const[...d]of a){const i=[];let t=d.shift();if(t&&t.type!==n.COMBINATOR){const s=new Set;for(;t;){if(t.type===n.COMBINATOR){const[h]=d;if(h.type===n.COMBINATOR){const b=`Invalid selector ${l}`;throw new DOMException(b,n.SYNTAX_ERR)}const m=t.name;/^[\s>]$/.test(m)&&(c=!0),i.push({combo:t,leaves:(0,k.sortAST)(s)}),s.clear()}else if(t){let{name:h}=t;h&&typeof h=="string"&&(h=(0,k.unescapeSelector)(h),typeof h=="string"&&h!==t.name&&(t.name=h),/[|:]/.test(h)&&(t.namespace=!0)),s.add(t)}if(d.length)t=d.shift();else{i.push({combo:null,leaves:(0,k.sortAST)(s)}),s.clear();break}}}o.push({branch:i,collected:!1,dir:null,filtered:!1,find:!1}),e[u]=[],u++}if(this.#s&&!f){let d;this.#r.has(this.#s)?d=this.#r.get(this.#s):d=new Map,d.set(`${l}`,{ast:o,descendant:c}),this.#r.set(this.#s,d)}this.#p=c}return[o,e]}_createTreeWalker(l){let e;return this.#m.has(l)?e=this.#m.get(l):(e=this.#c.createTreeWalker(l,n.WALKER_FILTER),this.#m.set(l,e)),e}_prepareQuerySelectorWalker(){return this.#f=this._createTreeWalker(this.#e),this.#u=!1,this.#f}_traverse(l,e=this.#n){let o=e.currentNode,r;if(o===l)r=o;else if(o.contains(l))for(o=e.nextNode();o;){if(o===l){r=o;break}o=e.nextNode()}else{if(o!==e.root)for(;o&&!(o===e.root||o===l);)o=e.parentNode();if(l?.nodeType===n.ELEMENT_NODE)for(;o;){if(o===l){r=o;break}o=e.nextNode()}else r=o}return r??null}_collectNthChild(l,e,o){const{a:r,b:a,reverse:f,selector:c}=l,{parentNode:u}=e,d=new Set;let i;if(c)if(this.#r.has(c))i=this.#r.get(c);else{const{branches:t}=(0,k.walkAST)(c);i=t,this.#r.set(c,i)}if(u){const t=this.#n;let s=this._traverse(u,t);s=t.firstChild();let h=0;for(;s;)h++,s=t.nextSibling();s=this._traverse(u,t);const m=new Set;if(i)for(s=t.firstChild();s;){let b;for(const p of i)if(b=this._matchLeaves(p,s,o),!b)break;b&&m.add(s),s=t.nextSibling()}if(r===0){if(a>0&&a<=h){if(m.size){s=this._traverse(u,t),f?s=t.lastChild():s=t.firstChild();let b=0;for(;s;){if(m.has(s)){if(b===a-1){d.add(s);break}b++}f?s=t.previousSibling():s=t.nextSibling()}}else if(!c){s=this._traverse(u,t),f?s=t.lastChild():s=t.firstChild();let b=0;for(;s;){if(b===a-1){d.add(s);break}f?s=t.previousSibling():s=t.nextSibling(),b++}}}}else{let b=a-1;if(r>0)for(;b<0;)b+=r;if(b>=0&&b<h){s=this._traverse(u,t),f?s=t.lastChild():s=t.firstChild();let p=0,_=r>0?0:a-1;for(;s&&(s&&b>=0&&b<h);)m.size?m.has(s)&&(_===b&&(d.add(s),b+=r),r>0?_++:_--):p===b&&(c||d.add(s),b+=r),f?s=t.previousSibling():s=t.nextSibling(),p++}}if(f&&d.size>1){const b=[...d];return new Set(b.reverse())}}else if(e===this.#t&&r+a===1)if(i){let t;for(const s of i)if(t=this._matchLeaves(s,e,o),t)break;t&&d.add(e)}else d.add(e);return d}_collectNthOfType(l,e){const{a:o,b:r,reverse:a}=l,{localName:f,parentNode:c,prefix:u}=e,d=new Set;if(c){const i=this.#n;let t=this._traverse(c,i);t=i.firstChild();let s=0;for(;t;)s++,t=i.nextSibling();if(o===0){if(r>0&&r<=s){t=this._traverse(c,i),a?t=i.lastChild():t=i.firstChild();let h=0;for(;t;){const{localName:m,prefix:b}=t;if(m===f&&b===u){if(h===r-1){d.add(t);break}h++}a?t=i.previousSibling():t=i.nextSibling()}}}else{let h=r-1;if(o>0)for(;h<0;)h+=o;if(h>=0&&h<s){t=this._traverse(c,i),a?t=i.lastChild():t=i.firstChild();let m=o>0?0:r-1;for(;t;){const{localName:b,prefix:p}=t;if(b===f&&p===u){if(m===h&&(d.add(t),h+=o),h<0||h>=s)break;o>0?m++:m--}a?t=i.previousSibling():t=i.nextSibling()}}}if(a&&d.size>1){const h=[...d];return new Set(h.reverse())}}else e===this.#t&&o+r===1&&d.add(e);return d}_matchAnPlusB(l,e,o,r){const{nth:{a,b:f,name:c},selector:u}=l,d=new Map;if(c?(c==="even"?(d.set("a",2),d.set("b",0)):c==="odd"&&(d.set("a",2),d.set("b",1)),o.indexOf("last")>-1&&d.set("reverse",!0)):(typeof a=="string"&&/-?\d+/.test(a)?d.set("a",a*1):d.set("a",0),typeof f=="string"&&/-?\d+/.test(f)?d.set("b",f*1):d.set("b",0),o.indexOf("last")>-1&&d.set("reverse",!0)),/^nth-(?:last-)?child$/.test(o)){u&&d.set("selector",u);const i=Object.fromEntries(d);return this._collectNthChild(i,e,r)}else if(/^nth-(?:last-)?of-type$/.test(o)){const i=Object.fromEntries(d);return this._collectNthOfType(i,e)}return new Set}_matchHasPseudoFunc(l,e,o={}){let r;if(Array.isArray(l)&&l.length){const a=l.map(s=>s),[f]=a,{type:c}=f;let u;c===n.COMBINATOR?u=a.shift():u={name:" ",type:n.COMBINATOR};const d=[];for(;a.length;){const[s]=a,{type:h}=s;if(h===n.COMBINATOR)break;d.push(a.shift())}const i={combo:u,leaves:d};o.dir=x;const t=this._matchCombinator(i,e,o);if(t.size)if(a.length){for(const s of t)if(r=this._matchHasPseudoFunc(a,s,o),r)break}else r=!0}return!!r}_matchLogicalPseudoFunc(l,e,o={}){const{astName:r="",branches:a=[],selector:f="",twigBranches:c=[]}=l;let u;if(r==="has")if(f.includes(":has("))u=null;else{let d;for(const i of a)if(d=this._matchHasPseudoFunc(i,e,o),d)break;d&&(u=e)}else{const d=/^(?:is|where)$/.test(r);o.forgive=d;const i=c.length;let t;for(let s=0;s<i;s++){const h=c[s],m=h.length-1,{leaves:b}=h[m];if(t=this._matchLeaves(b,e,o),t&&m>0){let p=new Set([e]);for(let _=m-1;_>=0;_--){const w=h[_],N=[];o.dir=S;for(const A of p){const E=this._matchCombinator(w,A,o);E.size&&N.push(...E)}if(N.length)_===0?t=!0:p=new Set(N);else{t=!1;break}}}if(t)break}r==="not"?t||(u=e):t&&(u=e)}return u??null}_matchPseudoClassSelector(l,e,o={}){const{children:r,name:a}=l,{localName:f,parentNode:c}=e,{forgive:u,warn:d=this.#i}=o,i=new Set;if(n.REG_LOGICAL_PSEUDO.test(a)){let t;if(this.#r.has(l))t=this.#r.get(l);else{const{branches:h}=(0,k.walkAST)(l),m=[],b=[];for(const[...p]of h){for(const A of p){const E=(0,k.generateCSS)(A);m.push(E)}const _=[],w=new Set;let N=p.shift();for(;N;)if(N.type===n.COMBINATOR?(_.push({combo:N,leaves:[...w]}),w.clear()):N&&w.add(N),p.length)N=p.shift();else{_.push({combo:null,leaves:[...w]}),w.clear();break}b.push(_)}t={astName:a,branches:h,twigBranches:b,selector:m.join(",")},this.#r.set(l,t)}const s=this._matchLogicalPseudoFunc(t,e,o);s&&i.add(s)}else if(Array.isArray(r))if(/^nth-(?:last-)?(?:child|of-type)$/.test(a)){const[t]=r;return this._matchAnPlusB(t,e,a,o)}else switch(a){case"dir":case"lang":{const t=O.matcher.matchSelector(l,e);t&&i.add(t);break}case"current":case"nth-col":case"nth-last-col":{if(d){const t=`Unsupported pseudo-class :${a}()`;throw new DOMException(t,n.NOT_SUPPORTED_ERR)}break}case"host":case"host-context":break;case"contains":{if(d){const t=`Unknown pseudo-class :${a}()`;throw new DOMException(t,n.NOT_SUPPORTED_ERR)}break}default:if(!u){const t=`Unknown pseudo-class :${a}()`;throw new DOMException(t,n.SYNTAX_ERR)}}else switch(a){case"any-link":case"link":{n.REG_ANCHOR.test(f)&&e.hasAttribute("href")&&i.add(e);break}case"local-link":{if(n.REG_ANCHOR.test(f)&&e.hasAttribute("href")){const{href:t,origin:s,pathname:h}=new URL(this.#s.URL),m=new URL(e.getAttribute("href"),t);m.origin===s&&m.pathname===h&&i.add(e)}break}case"visited":break;case"hover":{const{target:t,type:s}=this.#b??{};(s==="mouseover"||s==="pointerover")&&e.contains(t)&&i.add(e);break}case"active":{const{buttons:t,target:s,type:h}=this.#b??{};(h==="mousedown"||h==="pointerdown")&&t&n.BIT_01&&e.contains(s)&&i.add(e);break}case"target":{const{hash:t}=new URL(this.#s.URL);e.id&&t===`#${e.id}`&&this.#s.contains(e)&&i.add(e);break}case"target-within":{const{hash:t}=new URL(this.#s.URL);if(t){const s=t.replace(/^#/,"");let h=this.#s.getElementById(s);for(;h;){if(h===e){i.add(e);break}h=h.parentNode}}break}case"scope":{this.#e.nodeType===n.ELEMENT_NODE?!this.#d&&e===this.#e&&i.add(e):e===this.#s.documentElement&&i.add(e);break}case"focus":case"focus-visible":{const{target:t,type:s}=this.#b??{};if(e===this.#s.activeElement&&e.tabIndex>=0&&(a==="focus"||s==="keydown"&&e.contains(t))){let h=e,m=!0;for(;h;){if(h.disabled||h.hasAttribute("disabled")||h.hidden||h.hasAttribute("hidden")){m=!1;break}else{const{display:b,visibility:p}=this.#a.getComputedStyle(h);if(m=!(b==="none"||p==="hidden"),!m)break}if(h.parentNode&&h.parentNode.nodeType===n.ELEMENT_NODE)h=h.parentNode;else break}m&&i.add(e)}break}case"focus-within":{let t,s=this.#s.activeElement;if(s.tabIndex>=0)for(;s;){if(s===e){t=!0;break}s=s.parentNode}if(t){let h=e,m=!0;for(;h;){if(h.disabled||h.hasAttribute("disabled")||h.hidden||h.hasAttribute("hidden")){m=!1;break}else{const{display:b,visibility:p}=this.#a.getComputedStyle(h);if(m=!(b==="none"||p==="hidden"),!m)break}if(h.parentNode&&h.parentNode.nodeType===n.ELEMENT_NODE)h=h.parentNode;else break}m&&i.add(e)}break}case"open":{n.REG_INTERACT.test(f)&&e.hasAttribute("open")&&i.add(e);break}case"closed":{n.REG_INTERACT.test(f)&&!e.hasAttribute("open")&&i.add(e);break}case"disabled":{if(n.REG_FORM_CTRL.test(f)||(0,M.default)(f))if(e.disabled||e.hasAttribute("disabled"))i.add(e);else{let t=c;for(;t;){if(n.REG_FORM_GROUP.test(t.localName))if(t.localName==="fieldset"){if(t.disabled&&t.hasAttribute("disabled"))break}else break;t=t.parentNode}t&&c.localName!=="legend"&&(t.disabled||t.hasAttribute("disabled"))&&i.add(e)}break}case"enabled":{(n.REG_FORM_CTRL.test(f)||(0,M.default)(f))&&!(e.disabled&&e.hasAttribute("disabled"))&&i.add(e);break}case"read-only":{switch(f){case"textarea":{(e.readonly||e.hasAttribute("readonly")||e.disabled||e.hasAttribute("disabled"))&&i.add(e);break}case"input":{(!e.type||n.REG_TYPE_DATE.test(e.type)||n.REG_TYPE_TEXT.test(e.type))&&(e.readonly||e.hasAttribute("readonly")||e.disabled||e.hasAttribute("disabled"))&&i.add(e);break}default:(0,v.isContentEditable)(e)||i.add(e)}break}case"read-write":{switch(f){case"textarea":{e.readonly||e.hasAttribute("readonly")||e.disabled||e.hasAttribute("disabled")||i.add(e);break}case"input":{(!e.type||n.REG_TYPE_DATE.test(e.type)||n.REG_TYPE_TEXT.test(e.type))&&!(e.readonly||e.hasAttribute("readonly")||e.disabled||e.hasAttribute("disabled"))&&i.add(e);break}default:(0,v.isContentEditable)(e)&&i.add(e)}break}case"placeholder-shown":{let t;if(e.placeholder?t=e.placeholder:e.hasAttribute("placeholder")&&(t=e.getAttribute("placeholder")),typeof t=="string"&&!/[\r\n]/.test(t)){let s;f==="textarea"?s=e:f==="input"&&(e.hasAttribute("type")?n.REG_TYPE_TEXT.test(e.getAttribute("type"))&&(s=e):s=e),s&&e.value===""&&i.add(e)}break}case"checked":{(e.checked&&f==="input"&&e.hasAttribute("type")&&n.REG_TYPE_CHECK.test(e.getAttribute("type"))||e.selected&&f==="option")&&i.add(e);break}case"indeterminate":{if(e.indeterminate&&f==="input"&&e.type==="checkbox"||f==="progress"&&!e.hasAttribute("value"))i.add(e);else if(f==="input"&&e.type==="radio"&&!e.hasAttribute("checked")){const t=e.name;let s=e.parentNode;for(;s&&s.localName!=="form";)s=s.parentNode;s||(s=this.#s.documentElement);const h=s.getElementsByTagName("input"),m=h.length;let b;for(let p=0;p<m;p++){const _=h[p];if(_.getAttribute("type")==="radio"&&(t?_.getAttribute("name")===t&&(b=!!_.checked):_.hasAttribute("name")||(b=!!_.checked),b))break}b||i.add(e)}break}case"default":{if(f==="button"&&!(e.hasAttribute("type")&&n.REG_TYPE_RESET.test(e.getAttribute("type")))||f==="input"&&e.hasAttribute("type")&&n.REG_TYPE_SUBMIT.test(e.getAttribute("type"))){let t=e.parentNode;for(;t&&t.localName!=="form";)t=t.parentNode;if(t){const s=this.#n;let h=this._traverse(t,s);for(h=s.firstChild();h&&t.contains(h);){const m=h.localName;let b;if(m==="button"?b=!(h.hasAttribute("type")&&n.REG_TYPE_RESET.test(h.getAttribute("type"))):m==="input"&&(b=h.hasAttribute("type")&&n.REG_TYPE_SUBMIT.test(h.getAttribute("type"))),b){h===e&&i.add(e);break}h=s.nextNode()}}}else if(f==="input"&&e.hasAttribute("type")&&n.REG_TYPE_CHECK.test(e.getAttribute("type"))&&(e.checked||e.hasAttribute("checked")))i.add(e);else if(f==="option"){let t=c,s=!1;for(;t&&t.localName!=="datalist";){if(t.localName==="select"){(t.multiple||t.hasAttribute("multiple"))&&(s=!0);break}t=t.parentNode}if(s)(e.selected||e.hasAttribute("selected"))&&i.add(e);else{const h=new Set,m=this.#n;let b=this._traverse(c,m);for(b=m.firstChild();b;){if(b.selected||b.hasAttribute("selected")){h.add(b);break}b=m.nextSibling()}h.size&&h.has(e)&&i.add(e)}}break}case"valid":{if(n.REG_FORM_VALID.test(f))e.checkValidity()&&(e.maxLength>=0?e.maxLength>=e.value.length&&i.add(e):i.add(e));else if(f==="fieldset"){const t=this.#n;let s=this._traverse(e,t);s=t.firstChild();let h;if(!s)h=!0;else for(;s&&e.contains(s)&&!(n.REG_FORM_VALID.test(s.localName)&&(s.checkValidity()?s.maxLength>=0?h=s.maxLength>=s.value.length:h=!0:h=!1,!h));)s=t.nextNode();h&&i.add(e)}break}case"invalid":{if(n.REG_FORM_VALID.test(f))e.checkValidity()?e.maxLength>=0&&e.maxLength<e.value.length&&i.add(e):i.add(e);else if(f==="fieldset"){const t=this.#n;let s=this._traverse(e,t);s=t.firstChild();let h;if(!s)h=!0;else for(;s&&e.contains(s)&&!(n.REG_FORM_VALID.test(s.localName)&&(s.checkValidity()?s.maxLength>=0?h=s.maxLength>=s.value.length:h=!0:h=!1,!h));)s=t.nextNode();h||i.add(e)}break}case"in-range":{f==="input"&&!(e.readonly||e.hasAttribute("readonly"))&&!(e.disabled||e.hasAttribute("disabled"))&&e.hasAttribute("type")&&n.REG_TYPE_RANGE.test(e.getAttribute("type"))&&!(e.validity.rangeUnderflow||e.validity.rangeOverflow)&&(e.hasAttribute("min")||e.hasAttribute("max")||e.getAttribute("type")==="range")&&i.add(e);break}case"out-of-range":{f==="input"&&!(e.readonly||e.hasAttribute("readonly"))&&!(e.disabled||e.hasAttribute("disabled"))&&e.hasAttribute("type")&&n.REG_TYPE_RANGE.test(e.getAttribute("type"))&&(e.validity.rangeUnderflow||e.validity.rangeOverflow)&&i.add(e);break}case"required":{let t;if(/^(?:select|textarea)$/.test(f))t=e;else if(f==="input")if(e.hasAttribute("type")){const s=e.getAttribute("type");(s==="file"||n.REG_TYPE_CHECK.test(s)||n.REG_TYPE_DATE.test(s)||n.REG_TYPE_TEXT.test(s))&&(t=e)}else t=e;t&&(e.required||e.hasAttribute("required"))&&i.add(e);break}case"optional":{let t;if(/^(?:select|textarea)$/.test(f))t=e;else if(f==="input")if(e.hasAttribute("type")){const s=e.getAttribute("type");(s==="file"||n.REG_TYPE_CHECK.test(s)||n.REG_TYPE_DATE.test(s)||n.REG_TYPE_TEXT.test(s))&&(t=e)}else t=e;t&&!(e.required||e.hasAttribute("required"))&&i.add(e);break}case"root":{e===this.#s.documentElement&&i.add(e);break}case"empty":{if(e.hasChildNodes()){const t=this.#c.createTreeWalker(e,n.SHOW_ALL);let s=t.firstChild(),h;for(;s&&(h=s.nodeType!==n.ELEMENT_NODE&&s.nodeType!==n.TEXT_NODE,!!h);)s=t.nextSibling();h&&i.add(e)}else i.add(e);break}case"first-child":{(c&&e===c.firstElementChild||e===this.#t)&&i.add(e);break}case"last-child":{(c&&e===c.lastElementChild||e===this.#t)&&i.add(e);break}case"only-child":{(c&&e===c.firstElementChild&&e===c.lastElementChild||e===this.#t)&&i.add(e);break}case"first-of-type":{if(c){const[t]=this._collectNthOfType({a:0,b:1},e);t&&i.add(t)}else e===this.#t&&i.add(e);break}case"last-of-type":{if(c){const[t]=this._collectNthOfType({a:0,b:1,reverse:!0},e);t&&i.add(t)}else e===this.#t&&i.add(e);break}case"only-of-type":{if(c){const[t]=this._collectNthOfType({a:0,b:1},e);if(t===e){const[s]=this._collectNthOfType({a:0,b:1,reverse:!0},e);s===e&&i.add(e)}}else e===this.#t&&i.add(e);break}case"defined":{const t=e.getAttribute("is");t?(0,M.default)(t)&&this.#a.customElements.get(t)&&i.add(e):(0,M.default)(f)?this.#a.customElements.get(f)&&i.add(e):(e instanceof this.#a.HTMLElement||e instanceof this.#a.SVGElement)&&i.add(e);break}case"popover-open":{if(e.popover){const{display:t}=this.#a.getComputedStyle(e);t!=="none"&&i.add(e)}break}case"host":case"host-context":break;case"after":case"before":case"first-letter":case"first-line":{if(d){const t=`Unsupported pseudo-element ::${a}`;throw new DOMException(t,n.NOT_SUPPORTED_ERR)}break}case"autofill":case"blank":case"buffering":case"current":case"fullscreen":case"future":case"modal":case"muted":case"past":case"paused":case"picture-in-picture":case"playing":case"seeking":case"stalled":case"user-invalid":case"user-valid":case"volume-locked":case"-webkit-autofill":{if(d){const t=`Unsupported pseudo-class :${a}`;throw new DOMException(t,n.NOT_SUPPORTED_ERR)}break}default:if(a.startsWith("-webkit-")){if(d){const t=`Unsupported pseudo-class :${a}`;throw new DOMException(t,n.NOT_SUPPORTED_ERR)}}else if(!u){const t=`Unknown pseudo-class :${a}`;throw new DOMException(t,n.SYNTAX_ERR)}}return i}_matchShadowHostPseudoClass(l,e){const{children:o,name:r}=l;let a;if(Array.isArray(o)){const{branches:f}=(0,k.walkAST)(o[0]),[c]=f,[...u]=c,{host:d}=e;if(r==="host"){let i;for(const t of u){const{type:s}=t;if(s===n.COMBINATOR){const m=`Invalid selector ${(0,k.generateCSS)(l)}`;throw new DOMException(m,n.SYNTAX_ERR)}if(i=this._matchSelector(t,d).has(d),!i)break}i&&(a=e)}else if(r==="host-context"){let i=d,t;for(;i;){for(const s of u){const{type:h}=s;if(h===n.COMBINATOR){const b=`Invalid selector ${(0,k.generateCSS)(l)}`;throw new DOMException(b,n.SYNTAX_ERR)}if(t=this._matchSelector(s,i).has(i),!t)break}if(t)break;i=i.parentNode}t&&(a=e)}}else if(r==="host")a=e;else{const f=`Invalid selector :${r}`;throw new DOMException(f,n.SYNTAX_ERR)}return a??null}_matchSelector(l,e,o){const{type:r}=l,a=new Set;if(l.name===n.EMPTY)return a;const f=(0,k.unescapeSelector)(l.name);if(typeof f=="string"&&f!==l.name&&(l.name=f),e.nodeType===n.ELEMENT_NODE)switch(r){case n.SELECTOR_PSEUDO_ELEMENT:{O.matcher.matchPseudoElementSelector(f,o);break}case n.SELECTOR_ID:{e.id===f&&a.add(e);break}case n.SELECTOR_CLASS:{e.classList.contains(f)&&a.add(e);break}case n.SELECTOR_PSEUDO_CLASS:return this._matchPseudoClassSelector(l,e,o);default:{const c=O.matcher.matchSelector(l,e,o);c&&a.add(c)}}else if(this.#d&&r===n.SELECTOR_PSEUDO_CLASS&&e.nodeType===n.DOCUMENT_FRAGMENT_NODE){if(f!=="has"&&n.REG_LOGICAL_PSEUDO.test(f))return this._matchPseudoClassSelector(l,e,o);if(n.REG_SHADOW_HOST.test(f)){const c=this._matchShadowHostPseudoClass(l,e,o);c&&a.add(c)}}return a}_matchLeaves(l,e,o){const{attributes:r,localName:a,nodeType:f}=e;let c=this.#_.get(l),u;if(c&&c.has(e)){const{attr:d,matched:i}=c.get(e);r?.length===d&&(u=i)}if(typeof u!="boolean"){let d;f===n.ELEMENT_NODE&&n.REG_FORM.test(a)?d=!1:d=!0;for(const i of l){const{name:t,type:s}=i;if(s===n.SELECTOR_PSEUDO_CLASS&&t==="dir"&&(d=!1),u=this._matchSelector(i,e,o).has(e),!u)break}d&&(c||(c=new WeakMap),c.set(e,{attr:r?.length,matched:u}),this.#_.set(l,c))}return!!u}_matchHTMLCollection(l,e={}){const{compound:o,filterLeaves:r}=e,a=new Set,f=l.length;if(f)if(o)for(let c=0;c<f;c++){const u=l[c];this._matchLeaves(r,u,e)&&a.add(u)}else{const c=[].slice.call(l);return new Set(c)}return a}_findDescendantNodes(l,e,o){const[r,...a]=l,f=a.length>0,{type:c}=r,u=(0,k.unescapeSelector)(r.name);typeof u=="string"&&u!==r.name&&(r.name=u);let d=new Set,i=!1;if(this.#d)i=!0;else switch(c){case n.SELECTOR_PSEUDO_ELEMENT:{O.matcher.matchPseudoElementSelector(u,o);break}case n.SELECTOR_ID:{if(this.#t.nodeType===n.ELEMENT_NODE)i=!0;else{const t=this.#t.getElementById(u);t&&t!==e&&e.contains(t)&&(f?this._matchLeaves(a,t,o)&&d.add(t):d.add(t))}break}case n.SELECTOR_CLASS:{const t=e.getElementsByClassName(u);d=this._matchHTMLCollection(t,{compound:f,filterLeaves:a});break}case n.SELECTOR_TYPE:{if(this.#s.contentType==="text/html"&&!/[*|]/.test(u)){const t=e.getElementsByTagName(u);d=this._matchHTMLCollection(t,{compound:f,filterLeaves:a})}else i=!0;break}default:i=!0}return{nodes:d,pending:i}}_matchCombinator(l,e,o={}){const{combo:r,leaves:a}=l,{name:f}=r,{parentNode:c}=e,{dir:u}=o,d=new Set;if(u===x)switch(f){case"+":{const i=e.nextElementSibling;i&&this._matchLeaves(a,i,o)&&d.add(i);break}case"~":{if(c){const i=this._createTreeWalker(c);let t=this._traverse(e,i);for(t=i.nextSibling();t;)this._matchLeaves(a,t,o)&&d.add(t),t=i.nextSibling()}break}case">":{const i=this._createTreeWalker(e);let t=this._traverse(e,i);for(t=i.firstChild();t;)this._matchLeaves(a,t,o)&&d.add(t),t=i.nextSibling();break}case" ":default:{const{nodes:i,pending:t}=this._findDescendantNodes(a,e);if(i.size)return i;if(t){const s=this._createTreeWalker(e);let h=this._traverse(e,s);for(h=s.nextNode();h&&e.contains(h);)this._matchLeaves(a,h,o)&&d.add(h),h=s.nextNode()}}}else switch(f){case"+":{const i=e.previousElementSibling;i&&this._matchLeaves(a,i,o)&&d.add(i);break}case"~":{if(c){const i=this._createTreeWalker(c);let t=this._traverse(c,i);for(t=i.firstChild();t&&t!==e;)this._matchLeaves(a,t,o)&&d.add(t),t=i.nextSibling()}break}case">":{c&&this._matchLeaves(a,c,o)&&d.add(c);break}case" ":default:{const i=[];let t=c;for(;t;)this._matchLeaves(a,t,o)&&i.push(t),t=t.parentNode;if(i.length)return new Set(i.reverse())}}return d}_findNode(l,e){const{node:o}=e;let r=this._traverse(o,this.#f),a;if(r)for(r.nodeType!==n.ELEMENT_NODE?r=this.#f.nextNode():r===o&&r!==this.#t&&(r=this.#f.nextNode());r;){if(this._matchLeaves(l,r,{warn:this.#i})){a=r;break}r=this.#f.nextNode()}return a??null}_matchSelf(l){const e=[],o=this._matchLeaves(l,this.#e,{warn:this.#i});let r=!1;return o&&(e.push(this.#e),r=!0),[e,r]}_findLineal(l,e={}){const{complex:o}=e,r=[];let a=this._matchLeaves(l,this.#e,{warn:this.#i}),f=!1;if(a&&(r.push(this.#e),f=!0),!a||o){let c=this.#e.parentNode;for(;c&&(a=this._matchLeaves(l,c,{warn:this.#i}),a&&(r.push(c),f=!0),c.parentNode);)c=c.parentNode}return[r,f]}_findFirst(l){const e=[],o=this._findNode(l,{node:this.#e});let r=!1;return o&&(e.push(o),r=!0),[e,r]}_findFromHTMLCollection(l,e={}){const{complex:o,compound:r,filterLeaves:a,targetType:f}=e;let c=[],u=!1,d=!1;const i=l.length;if(i)if(this.#e.nodeType===n.ELEMENT_NODE)for(let t=0;t<i;t++){const s=l[t];if(s!==this.#e&&(this.#e.contains(s)||s.contains(this.#e))){if(r){if(this._matchLeaves(a,s,{warn:this.#i})&&(c.push(s),u=!0,f===g))break}else if(c.push(s),u=!0,f===g)break}}else if(o)if(r)for(let t=0;t<i;t++){const s=l[t];if(this._matchLeaves(a,s,{warn:this.#i})&&(c.push(s),u=!0,f===g))break}else c=[].slice.call(l),u=!0,d=!0;else if(r)for(let t=0;t<i;t++){const s=l[t];if(this._matchLeaves(a,s,{warn:this.#i})&&(c.push(s),u=!0,f===g))break}else c=[].slice.call(l),u=!0,d=!0;return[c,u,d]}_findEntryNodes(l,e,o){const{leaves:r}=l,[a,...f]=r,c=f.length>0,{name:u,type:d}=a;let i=[],t=!1,s=!1,h=!1;switch(d){case n.SELECTOR_PSEUDO_ELEMENT:{O.matcher.matchPseudoElementSelector(u,{warn:this.#i});break}case n.SELECTOR_ID:{if(e===R)[i,s]=this._matchSelf(r);else if(e===C)[i,s]=this._findLineal(r,{complex:o});else if(e===g&&this.#t.nodeType!==n.ELEMENT_NODE){const m=this.#t.getElementById(u);m&&(c?this._matchLeaves(f,m,{warn:this.#i})&&(i.push(m),s=!0):(i.push(m),s=!0))}else e===g?[i,s]=this._findFirst(r):h=!0;break}case n.SELECTOR_CLASS:{if(e===R)[i,s]=this._matchSelf(r);else if(e===C)[i,s]=this._findLineal(r,{complex:o});else if(this.#t.nodeType===n.DOCUMENT_NODE){const m=this.#t.getElementsByClassName(u);m.length&&([i,s,t]=this._findFromHTMLCollection(m,{complex:o,compound:c,filterLeaves:f,targetType:e}))}else e===g?[i,s]=this._findFirst(r):h=!0;break}case n.SELECTOR_TYPE:{if(e===R)[i,s]=this._matchSelf(r);else if(e===C)[i,s]=this._findLineal(r,{complex:o});else if(this.#s.contentType==="text/html"&&this.#t.nodeType===n.DOCUMENT_NODE&&!/[*|]/.test(u)){const m=this.#t.getElementsByTagName(u);m.length&&([i,s,t]=this._findFromHTMLCollection(m,{complex:o,compound:c,filterLeaves:f,targetType:e}))}else e===g?[i,s]=this._findFirst(r):h=!0;break}default:if(e!==C&&n.REG_SHADOW_HOST.test(u)){if(this.#d&&this.#e.nodeType===n.DOCUMENT_FRAGMENT_NODE){const m=this._matchShadowHostPseudoClass(a,this.#e);m&&(i.push(m),s=!0)}}else e===R?[i,s]=this._matchSelf(r):e===C?[i,s]=this._findLineal(r,{complex:o}):e===g?[i,s]=this._findFirst(r):h=!0}return{collected:t,compound:c,filtered:s,nodes:i,pending:h}}_collectNodes(l){const e=this.#l.values();if(l===L||l===g){const o=new Set;let r=0;for(const{branch:a}of e){const f=a.length,c=f>1,u=a[0];let d,i;if(c){const{combo:p,leaves:[{name:_,type:w}]}=u,N=a[f-1],{leaves:[{name:A,type:E}]}=N;if(E===n.SELECTOR_PSEUDO_ELEMENT||E===n.SELECTOR_ID)d=S,i=N;else if(w===n.SELECTOR_PSEUDO_ELEMENT||w===n.SELECTOR_ID)d=x,i=u;else if(l===L)if(_==="*"&&w===n.SELECTOR_TYPE)d=S,i=N;else if(A==="*"&&E===n.SELECTOR_TYPE)d=x,i=u;else if(f===2){const{name:T}=p;/^[+~]$/.test(T)?(d=S,i=N):(d=x,i=u)}else d=x,i=u;else if(A==="*"&&E===n.SELECTOR_TYPE)d=x,i=u;else if(_==="*"&&w===n.SELECTOR_TYPE)d=S,i=N;else{let T;for(const{combo:D,leaves:[$]}of a){const{name:F,type:z}=$;if(z===n.SELECTOR_PSEUDO_CLASS&&F==="dir"){T=!1;break}if(!T&&D){const{name:W}=D;/^[+~]$/.test(W)&&(T=!0)}}T?(d=x,i=u):(d=S,i=N)}}else d=S,i=u;const{collected:t,compound:s,filtered:h,nodes:m,pending:b}=this._findEntryNodes(i,l,c);m.length?(this.#l[r].find=!0,this.#h[r]=m):b&&o.add(new Map([["index",r],["twig",i]])),this.#l[r].collected=t,this.#l[r].dir=d,this.#l[r].filtered=h||!s,r++}if(o.size){let a,f;this.#e!==this.#t&&this.#e.nodeType===n.ELEMENT_NODE?(a=this.#e,f=this.#f):(a=this.#t,f=this.#n);let c=this._traverse(a,f);for(;c;){let u=!1;if(this.#e.nodeType===n.ELEMENT_NODE?c===this.#e?u=!0:u=this.#e.contains(c):u=!0,u)for(const d of o){const{leaves:i}=d.get("twig");if(this._matchLeaves(i,c,{warn:this.#i})){const s=d.get("index");this.#l[s].filtered=!0,this.#l[s].find=!0,this.#h[s].push(c)}}c!==f.currentNode&&(c=this._traverse(c,f)),c=f.nextNode()}}}else{let o=0;for(const{branch:r}of e){const a=r[r.length-1],f=r.length>1,{compound:c,filtered:u,nodes:d}=this._findEntryNodes(a,l,f);d.length&&(this.#l[o].find=!0,this.#h[o]=d),this.#l[o].dir=S,this.#l[o].filtered=u||!c,o++}}return[this.#l,this.#h]}_getCombinedNodes(l,e,o){const r=[];for(const a of e){const f=this._matchCombinator(l,a,{dir:o,warn:this.#i});f.size&&r.push(...f)}return r.length?new Set(r):new Set}_matchNodeNext(l,e,o){const{combo:r,index:a}=o,{combo:f,leaves:c}=l[a],u={combo:r,leaves:c},d=this._getCombinedNodes(u,e,x);let i;if(d.size)if(a===l.length-1){const[t]=(0,v.sortNodes)(d);i=t}else i=this._matchNodeNext(l,d,{combo:f,index:a+1});return i??null}_matchNodePrev(l,e,o){const{index:r}=o,a=l[r],f=new Set([e]),c=this._getCombinedNodes(a,f,S);let u;if(c.size){if(r===0)u=e;else for(const d of c)if(this._matchNodePrev(l,d,{index:r-1}))return e}return u??null}_find(l){(l===L||l===g)&&this._prepareQuerySelectorWalker();const[[...e],o]=this._collectNodes(l),r=e.length;let a=new Set;for(let f=0;f<r;f++){const{branch:c,collected:u,dir:d,find:i}=e[f],t=c.length;if(t&&i){const s=o[f],h=s.length,m=t-1;if(m===0)if((l===L||l===g)&&this.#e.nodeType===n.ELEMENT_NODE)for(let b=0;b<h;b++){const p=s[b];if(p!==this.#e&&this.#e.contains(p)&&(a.add(p),l!==L))break}else if(l===L)if(a.size){const b=[...a];a=new Set([...b,...s]),this.#u=!0}else a=new Set(s);else{const[b]=s;a.add(b)}else if(l===L)if(d===x){let{combo:b}=c[0];for(const p of s){let _=new Set([p]);for(let w=1;w<t;w++){const{combo:N,leaves:A}=c[w],E={combo:b,leaves:A};if(_=this._getCombinedNodes(E,_,d),_.size)if(w===m)if(a.size){const T=[...a];a=new Set([...T,..._]),this.#u=!0}else a=_;else b=N;else break}}}else for(const b of s){let p=new Set([b]);for(let _=m-1;_>=0;_--){const w=c[_];if(p=this._getCombinedNodes(w,p,d),p.size)_===0&&(a.add(b),t>1&&a.size>1&&(this.#u=!0));else break}}else if(l===g&&d===x){const{combo:b}=c[0];let p;for(const _ of s)if(p=this._matchNodeNext(c,new Set([_]),{combo:b,index:1}),p){a.add(p);break}if(!p&&!u){const{leaves:_}=c[0],[w]=s;let N=this._findNode(_,{node:w});for(;N;){if(p=this._matchNodeNext(c,new Set([N]),{combo:b,index:1}),p){a.add(p);break}N=this._findNode(_,{node:N})}}}else{let b;for(const p of s)if(b=this._matchNodePrev(c,p,{index:m-1}),b){a.add(p);break}if(!b&&!u&&l===g){const{leaves:p}=c[m],[_]=s;let w=this._findNode(p,{node:_});for(;w;){if(b=this._matchNodePrev(c,w,{index:m-1}),b){a.add(w);break}w=this._findNode(p,{node:w})}}}}}return a}matches(l,e,o){let r;try{if(e?.nodeType!==n.ELEMENT_NODE){const c=`Unexpected node ${e?.nodeName}`;throw new TypeError(c)}const a=e.ownerDocument;if(a===this.#c&&a.contentType==="text/html"&&(0,k.filterSelector)(l,{complex:n.REG_COMPLEX_A.test(l),descendant:!0}))return this.#o.match(l,e);this._setup(l,e,o),r=this._find(R).size}catch(a){this._onError(a)}return!!r}closest(l,e,o){let r;try{if(e?.nodeType!==n.ELEMENT_NODE){const c=`Unexpected node ${e?.nodeName}`;throw new TypeError(c)}const a=e.ownerDocument;if(a===this.#c&&a.contentType==="text/html"&&(0,k.filterSelector)(l,{complex:n.REG_COMPLEX_A.test(l),descendant:!0}))return this.#o.closest(l,e);this._setup(l,e,o);const f=this._find(C);if(f.size){let c=this.#e;for(;c;){if(f.has(c)){r=c;break}c=c.parentNode}}}catch(a){this._onError(a)}return r??null}querySelector(l,e,o){let r;try{(0,v.verifyNode)(e);let a;if(e.nodeType===n.DOCUMENT_NODE?a=e:a=e.ownerDocument,a===this.#c&&a.contentType==="text/html"&&(0,k.filterSelector)(l,{complex:n.REG_COMPLEX_B.test(l),descendant:!1}))return this.#o.first(l,e);this._setup(l,e,o);const f=this._find(g);f.delete(this.#e),f.size&&([r]=(0,v.sortNodes)(f))}catch(a){this._onError(a)}return r??null}querySelectorAll(l,e,o){let r;try{(0,v.verifyNode)(e);let a;if(e.nodeType===n.DOCUMENT_NODE?a=e:a=e.ownerDocument,a===this.#c&&a.contentType==="text/html"&&(0,k.filterSelector)(l,{complex:n.REG_COMPLEX_B.test(l),descendant:!0}))return this.#o.select(l,e);this._setup(l,e,o);const f=this._find(L);f.delete(this.#e),f.size&&(this.#u?r=(0,v.sortNodes)(f):r=[...f])}catch(a){this._onError(a)}return r??[]}}0&&(module.exports={Finder});
var W=Object.create;var P=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var V=(g,l)=>{for(var e in l)P(g,e,{get:l[e],enumerable:!0})},I=(g,l,e,h)=>{if(l&&typeof l=="object"||typeof l=="function")for(let n of j(l))!q.call(g,n)&&n!==e&&P(g,n,{get:()=>l[n],enumerable:!(h=B(l,n))||h.enumerable});return g};var U=(g,l,e)=>(e=g!=null?W(Y(g)):{},I(l||!g||!g.__esModule?P(e,"default",{value:g,enumerable:!0}):e,g)),X=g=>I(P({},"__esModule",{value:!0}),g);var Q={};V(Q,{Finder:()=>K});module.exports=X(Q);var M=U(require("is-potential-custom-element-name"),1),G=U(require("@asamuzakjp/nwsapi"),1),_=require("./dom-util.js"),O=require("./matcher.js"),y=require("./parser.js"),c=require("./constant.js");const x="next",S="prev",L="all",E="first",C="lineal",R="self";class K{#l;#r;#s;#p;#n;#b;#e;#h;#_;#o;#f;#w;#t;#d;#u;#c;#m;#i;#a;constructor(l,e){this.#a=l,this.#n=e??l.document,this.#r=new WeakMap,this.#w=new WeakMap,this._initNwsapi()}_onError(l){if(!this.#_)if(l instanceof DOMException||l instanceof this.#a.DOMException)if(l.name===c.NOT_SUPPORTED_ERR)this.#i&&console.warn(l.message);else throw new this.#a.DOMException(l.message,l.name);else throw l}_setup(l,e,h={}){const{event:n,invalidate:a,noexcept:o,warn:r}=h;return a&&e.nodeType===c.ELEMENT_NODE&&(this.#r=new WeakMap),this.#_=!!o,this.#i=!!r,this.#b=this._setEvent(n),this.#e=e,[this.#s,this.#t,this.#c]=(0,_.resolveContent)(e),this.#d=(0,_.isInShadowTree)(e),[this.#l,this.#h]=this._correspond(l),this.#m=new WeakMap,e}_initNwsapi(){return this.#o=(0,G.default)({DOMException:this.#a.DOMException,document:this.#n}),this.#o.configure({LOGERRORS:!1}),this.#o}_setEvent(l){return l instanceof this.#a.KeyboardEvent||l instanceof this.#a.MouseEvent?l:null}_correspond(l){const e=[];this.#p=!1;let h;if(this.#s){const n=this.#r.get(this.#s);if(n&&n.has(`${l}`)){const a=n.get(`${l}`);this.#p=a.descendant,h=a.ast}}if(h){const n=h.length;for(let a=0;a<n;a++)h[a].collected=!1,h[a].dir=null,h[a].filtered=!1,h[a].find=!1,e[a]=[]}else{let n;try{n=(0,y.parseSelector)(l)}catch(t){this._onError(t)}const{branches:a,info:{hasHasPseudoFunc:o,hasUserActionPseudo:r}}=(0,y.walkAST)(n),u=!(o||r);let d=!1,i=0;h=[];for(const[...t]of a){const s=[];let f=t.shift();if(f&&f.type!==c.COMBINATOR){const m=new Set;for(;f;){if(f.type===c.COMBINATOR){const[b]=t;if(b.type===c.COMBINATOR){const w=`Invalid selector ${l}`;throw new DOMException(w,c.SYNTAX_ERR)}const p=f.name;/^[\s>]$/.test(p)&&(d=!0),s.push({combo:f,leaves:(0,y.sortAST)(m)}),m.clear()}else if(f){let{name:b}=f;b&&typeof b=="string"&&(b=(0,y.unescapeSelector)(b),typeof b=="string"&&b!==f.name&&(f.name=b),/[|:]/.test(b)&&(f.namespace=!0)),m.add(f)}if(t.length)f=t.shift();else{s.push({combo:null,leaves:(0,y.sortAST)(m)}),m.clear();break}}}h.push({branch:s,collected:!1,dir:null,filtered:!1,find:!1}),e[i]=[],i++}if(this.#s&&u){let t;this.#r.has(this.#s)?t=this.#r.get(this.#s):t=new Map,t.set(`${l}`,{ast:h,descendant:d}),this.#r.set(this.#s,t)}this.#p=d}return[h,e]}_createTreeWalker(l){let e;return this.#m.has(l)?e=this.#m.get(l):(e=this.#n.createTreeWalker(l,c.WALKER_FILTER),this.#m.set(l,e)),e}_prepareQuerySelectorWalker(){return this.#f=this._createTreeWalker(this.#e),this.#u=!1,this.#f}_collectNthChild(l,e,h){const{a:n,b:a,reverse:o,selector:r}=l,{parentNode:u}=e,d=new Set;let i;if(r)if(this.#r.has(r))i=this.#r.get(r);else{const{branches:t}=(0,y.walkAST)(r);i=t,this.#r.set(r,i)}if(u){const t=this.#c;let s=(0,_.traverseNode)(u,t);s=t.firstChild();let f=0;for(;s;)f++,s=t.nextSibling();s=(0,_.traverseNode)(u,t);const m=new Set;if(i)for(s=t.firstChild();s;){let b;for(const p of i)if(b=this._matchLeaves(p,s,h),!b)break;b&&m.add(s),s=t.nextSibling()}if(n===0){if(a>0&&a<=f){if(m.size){s=(0,_.traverseNode)(u,t),o?s=t.lastChild():s=t.firstChild();let b=0;for(;s;){if(m.has(s)){if(b===a-1){d.add(s);break}b++}o?s=t.previousSibling():s=t.nextSibling()}}else if(!r){s=(0,_.traverseNode)(u,t),o?s=t.lastChild():s=t.firstChild();let b=0;for(;s;){if(b===a-1){d.add(s);break}o?s=t.previousSibling():s=t.nextSibling(),b++}}}}else{let b=a-1;if(n>0)for(;b<0;)b+=n;if(b>=0&&b<f){s=(0,_.traverseNode)(u,t),o?s=t.lastChild():s=t.firstChild();let p=0,w=n>0?0:a-1;for(;s&&(s&&b>=0&&b<f);)m.size?m.has(s)&&(w===b&&(d.add(s),b+=n),n>0?w++:w--):p===b&&(r||d.add(s),b+=n),o?s=t.previousSibling():s=t.nextSibling(),p++}}if(o&&d.size>1){const b=[...d];return new Set(b.reverse())}}else if(e===this.#t&&n+a===1)if(i){let t;for(const s of i)if(t=this._matchLeaves(s,e,h),t)break;t&&d.add(e)}else d.add(e);return d}_collectNthOfType(l,e){const{a:h,b:n,reverse:a}=l,{localName:o,parentNode:r,prefix:u}=e,d=new Set;if(r){const i=this.#c;let t=(0,_.traverseNode)(r,i);t=i.firstChild();let s=0;for(;t;)s++,t=i.nextSibling();if(h===0){if(n>0&&n<=s){t=(0,_.traverseNode)(r,i),a?t=i.lastChild():t=i.firstChild();let f=0;for(;t;){const{localName:m,prefix:b}=t;if(m===o&&b===u){if(f===n-1){d.add(t);break}f++}a?t=i.previousSibling():t=i.nextSibling()}}}else{let f=n-1;if(h>0)for(;f<0;)f+=h;if(f>=0&&f<s){t=(0,_.traverseNode)(r,i),a?t=i.lastChild():t=i.firstChild();let m=h>0?0:n-1;for(;t;){const{localName:b,prefix:p}=t;if(b===o&&p===u){if(m===f&&(d.add(t),f+=h),f<0||f>=s)break;h>0?m++:m--}a?t=i.previousSibling():t=i.nextSibling()}}}if(a&&d.size>1){const f=[...d];return new Set(f.reverse())}}else e===this.#t&&h+n===1&&d.add(e);return d}_matchAnPlusB(l,e,h,n){const{nth:{a,b:o,name:r},selector:u}=l,d=new Map;if(r?(r==="even"?(d.set("a",2),d.set("b",0)):r==="odd"&&(d.set("a",2),d.set("b",1)),h.indexOf("last")>-1&&d.set("reverse",!0)):(typeof a=="string"&&/-?\d+/.test(a)?d.set("a",a*1):d.set("a",0),typeof o=="string"&&/-?\d+/.test(o)?d.set("b",o*1):d.set("b",0),h.indexOf("last")>-1&&d.set("reverse",!0)),/^nth-(?:last-)?child$/.test(h)){u&&d.set("selector",u);const i=Object.fromEntries(d);return this._collectNthChild(i,e,n)}else if(/^nth-(?:last-)?of-type$/.test(h)){const i=Object.fromEntries(d);return this._collectNthOfType(i,e)}return new Set}_matchHasPseudoFunc(l,e,h={}){let n;if(Array.isArray(l)&&l.length){const a=l.map(s=>s),[o]=a,{type:r}=o;let u;r===c.COMBINATOR?u=a.shift():u={name:" ",type:c.COMBINATOR};const d=[];for(;a.length;){const[s]=a,{type:f}=s;if(f===c.COMBINATOR)break;d.push(a.shift())}const i={combo:u,leaves:d};h.dir=x;const t=this._matchCombinator(i,e,h);if(t.size)if(a.length){for(const s of t)if(n=this._matchHasPseudoFunc(a,s,h),n)break}else n=!0}return!!n}_matchLogicalPseudoFunc(l,e,h={}){const{astName:n="",branches:a=[],selector:o="",twigBranches:r=[]}=l;let u;if(n==="has")if(o.includes(":has("))u=null;else{let d;for(const i of a)if(d=this._matchHasPseudoFunc(i,e,h),d)break;d&&(u=e)}else{const d=/^(?:is|where)$/.test(n);h.forgive=d;const i=r.length;let t;for(let s=0;s<i;s++){const f=r[s],m=f.length-1,{leaves:b}=f[m];if(t=this._matchLeaves(b,e,h),t&&m>0){let p=new Set([e]);for(let w=m-1;w>=0;w--){const k=f[w],N=[];h.dir=S;for(const A of p){const v=this._matchCombinator(k,A,h);v.size&&N.push(...v)}if(N.length)w===0?t=!0:p=new Set(N);else{t=!1;break}}}if(t)break}n==="not"?t||(u=e):t&&(u=e)}return u??null}_matchPseudoClassSelector(l,e,h={}){const{children:n,name:a}=l,{localName:o,parentNode:r}=e,{forgive:u,warn:d=this.#i}=h,i=new Set;if(c.REG_LOGICAL_PSEUDO.test(a)){let t;if(this.#r.has(l))t=this.#r.get(l);else{const{branches:f}=(0,y.walkAST)(l),m=[],b=[];for(const[...p]of f){for(const A of p){const v=(0,y.generateCSS)(A);m.push(v)}const w=[],k=new Set;let N=p.shift();for(;N;)if(N.type===c.COMBINATOR?(w.push({combo:N,leaves:[...k]}),k.clear()):N&&k.add(N),p.length)N=p.shift();else{w.push({combo:null,leaves:[...k]}),k.clear();break}b.push(w)}t={astName:a,branches:f,twigBranches:b,selector:m.join(",")},this.#r.set(l,t)}const s=this._matchLogicalPseudoFunc(t,e,h);s&&i.add(s)}else if(Array.isArray(n))if(/^nth-(?:last-)?(?:child|of-type)$/.test(a)){const[t]=n;return this._matchAnPlusB(t,e,a,h)}else switch(a){case"dir":case"lang":{const t=O.matcher.matchSelector(l,e);t&&i.add(t);break}case"current":case"nth-col":case"nth-last-col":{if(d){const t=`Unsupported pseudo-class :${a}()`;throw new DOMException(t,c.NOT_SUPPORTED_ERR)}break}case"host":case"host-context":break;case"contains":{if(d){const t=`Unknown pseudo-class :${a}()`;throw new DOMException(t,c.NOT_SUPPORTED_ERR)}break}default:if(!u){const t=`Unknown pseudo-class :${a}()`;throw new DOMException(t,c.SYNTAX_ERR)}}else switch(a){case"any-link":case"link":{c.REG_ANCHOR.test(o)&&e.hasAttribute("href")&&i.add(e);break}case"local-link":{if(c.REG_ANCHOR.test(o)&&e.hasAttribute("href")){const{href:t,origin:s,pathname:f}=new URL(this.#s.URL),m=new URL(e.getAttribute("href"),t);m.origin===s&&m.pathname===f&&i.add(e)}break}case"visited":break;case"hover":{const{target:t,type:s}=this.#b??{};(s==="mouseover"||s==="pointerover")&&e.contains(t)&&i.add(e);break}case"active":{const{buttons:t,target:s,type:f}=this.#b??{};(f==="mousedown"||f==="pointerdown")&&t&c.BIT_01&&e.contains(s)&&i.add(e);break}case"target":{const{hash:t}=new URL(this.#s.URL);e.id&&t===`#${e.id}`&&this.#s.contains(e)&&i.add(e);break}case"target-within":{const{hash:t}=new URL(this.#s.URL);if(t){const s=t.replace(/^#/,"");let f=this.#s.getElementById(s);for(;f;){if(f===e){i.add(e);break}f=f.parentNode}}break}case"scope":{this.#e.nodeType===c.ELEMENT_NODE?!this.#d&&e===this.#e&&i.add(e):e===this.#s.documentElement&&i.add(e);break}case"focus":case"focus-visible":{const{target:t,type:s}=this.#b??{};if(e===this.#s.activeElement&&e.tabIndex>=0&&(a==="focus"||s==="keydown"&&e.contains(t))){let f=e,m=!0;for(;f;){if(f.disabled||f.hasAttribute("disabled")||f.hidden||f.hasAttribute("hidden")){m=!1;break}else{const{display:b,visibility:p}=this.#a.getComputedStyle(f);if(m=!(b==="none"||p==="hidden"),!m)break}if(f.parentNode&&f.parentNode.nodeType===c.ELEMENT_NODE)f=f.parentNode;else break}m&&i.add(e)}break}case"focus-within":{let t,s=this.#s.activeElement;if(s.tabIndex>=0)for(;s;){if(s===e){t=!0;break}s=s.parentNode}if(t){let f=e,m=!0;for(;f;){if(f.disabled||f.hasAttribute("disabled")||f.hidden||f.hasAttribute("hidden")){m=!1;break}else{const{display:b,visibility:p}=this.#a.getComputedStyle(f);if(m=!(b==="none"||p==="hidden"),!m)break}if(f.parentNode&&f.parentNode.nodeType===c.ELEMENT_NODE)f=f.parentNode;else break}m&&i.add(e)}break}case"open":{c.REG_INTERACT.test(o)&&e.hasAttribute("open")&&i.add(e);break}case"closed":{c.REG_INTERACT.test(o)&&!e.hasAttribute("open")&&i.add(e);break}case"disabled":{if(c.REG_FORM_CTRL.test(o)||(0,M.default)(o))if(e.disabled||e.hasAttribute("disabled"))i.add(e);else{let t=r;for(;t;){if(c.REG_FORM_GROUP.test(t.localName))if(t.localName==="fieldset"){if(t.disabled&&t.hasAttribute("disabled"))break}else break;t=t.parentNode}t&&r.localName!=="legend"&&(t.disabled||t.hasAttribute("disabled"))&&i.add(e)}break}case"enabled":{(c.REG_FORM_CTRL.test(o)||(0,M.default)(o))&&!(e.disabled&&e.hasAttribute("disabled"))&&i.add(e);break}case"read-only":{switch(o){case"textarea":{(e.readonly||e.hasAttribute("readonly")||e.disabled||e.hasAttribute("disabled"))&&i.add(e);break}case"input":{(!e.type||c.REG_TYPE_DATE.test(e.type)||c.REG_TYPE_TEXT.test(e.type))&&(e.readonly||e.hasAttribute("readonly")||e.disabled||e.hasAttribute("disabled"))&&i.add(e);break}default:(0,_.isContentEditable)(e)||i.add(e)}break}case"read-write":{switch(o){case"textarea":{e.readonly||e.hasAttribute("readonly")||e.disabled||e.hasAttribute("disabled")||i.add(e);break}case"input":{(!e.type||c.REG_TYPE_DATE.test(e.type)||c.REG_TYPE_TEXT.test(e.type))&&!(e.readonly||e.hasAttribute("readonly")||e.disabled||e.hasAttribute("disabled"))&&i.add(e);break}default:(0,_.isContentEditable)(e)&&i.add(e)}break}case"placeholder-shown":{let t;if(e.placeholder?t=e.placeholder:e.hasAttribute("placeholder")&&(t=e.getAttribute("placeholder")),typeof t=="string"&&!/[\r\n]/.test(t)){let s;o==="textarea"?s=e:o==="input"&&(e.hasAttribute("type")?c.REG_TYPE_TEXT.test(e.getAttribute("type"))&&(s=e):s=e),s&&e.value===""&&i.add(e)}break}case"checked":{(e.checked&&o==="input"&&e.hasAttribute("type")&&c.REG_TYPE_CHECK.test(e.getAttribute("type"))||e.selected&&o==="option")&&i.add(e);break}case"indeterminate":{if(e.indeterminate&&o==="input"&&e.type==="checkbox"||o==="progress"&&!e.hasAttribute("value"))i.add(e);else if(o==="input"&&e.type==="radio"&&!e.hasAttribute("checked")){const t=e.name;let s=e.parentNode;for(;s&&s.localName!=="form";)s=s.parentNode;s||(s=this.#s.documentElement);const f=s.getElementsByTagName("input"),m=f.length;let b;for(let p=0;p<m;p++){const w=f[p];if(w.getAttribute("type")==="radio"&&(t?w.getAttribute("name")===t&&(b=!!w.checked):w.hasAttribute("name")||(b=!!w.checked),b))break}b||i.add(e)}break}case"default":{if(o==="button"&&!(e.hasAttribute("type")&&c.REG_TYPE_RESET.test(e.getAttribute("type")))||o==="input"&&e.hasAttribute("type")&&c.REG_TYPE_SUBMIT.test(e.getAttribute("type"))){let t=e.parentNode;for(;t&&t.localName!=="form";)t=t.parentNode;if(t){const s=this.#c;let f=(0,_.traverseNode)(t,s);for(f=s.firstChild();f&&t.contains(f);){const m=f.localName;let b;if(m==="button"?b=!(f.hasAttribute("type")&&c.REG_TYPE_RESET.test(f.getAttribute("type"))):m==="input"&&(b=f.hasAttribute("type")&&c.REG_TYPE_SUBMIT.test(f.getAttribute("type"))),b){f===e&&i.add(e);break}f=s.nextNode()}}}else if(o==="input"&&e.hasAttribute("type")&&c.REG_TYPE_CHECK.test(e.getAttribute("type"))&&(e.checked||e.hasAttribute("checked")))i.add(e);else if(o==="option"){let t=r,s=!1;for(;t&&t.localName!=="datalist";){if(t.localName==="select"){(t.multiple||t.hasAttribute("multiple"))&&(s=!0);break}t=t.parentNode}if(s)(e.selected||e.hasAttribute("selected"))&&i.add(e);else{const f=new Set,m=this.#c;let b=(0,_.traverseNode)(r,m);for(b=m.firstChild();b;){if(b.selected||b.hasAttribute("selected")){f.add(b);break}b=m.nextSibling()}f.size&&f.has(e)&&i.add(e)}}break}case"valid":{if(c.REG_FORM_VALID.test(o))e.checkValidity()&&(e.maxLength>=0?e.maxLength>=e.value.length&&i.add(e):i.add(e));else if(o==="fieldset"){const t=this.#c;let s=(0,_.traverseNode)(e,t);s=t.firstChild();let f;if(!s)f=!0;else for(;s&&e.contains(s)&&!(c.REG_FORM_VALID.test(s.localName)&&(s.checkValidity()?s.maxLength>=0?f=s.maxLength>=s.value.length:f=!0:f=!1,!f));)s=t.nextNode();f&&i.add(e)}break}case"invalid":{if(c.REG_FORM_VALID.test(o))e.checkValidity()?e.maxLength>=0&&e.maxLength<e.value.length&&i.add(e):i.add(e);else if(o==="fieldset"){const t=this.#c;let s=(0,_.traverseNode)(e,t);s=t.firstChild();let f;if(!s)f=!0;else for(;s&&e.contains(s)&&!(c.REG_FORM_VALID.test(s.localName)&&(s.checkValidity()?s.maxLength>=0?f=s.maxLength>=s.value.length:f=!0:f=!1,!f));)s=t.nextNode();f||i.add(e)}break}case"in-range":{o==="input"&&!(e.readonly||e.hasAttribute("readonly"))&&!(e.disabled||e.hasAttribute("disabled"))&&e.hasAttribute("type")&&c.REG_TYPE_RANGE.test(e.getAttribute("type"))&&!(e.validity.rangeUnderflow||e.validity.rangeOverflow)&&(e.hasAttribute("min")||e.hasAttribute("max")||e.getAttribute("type")==="range")&&i.add(e);break}case"out-of-range":{o==="input"&&!(e.readonly||e.hasAttribute("readonly"))&&!(e.disabled||e.hasAttribute("disabled"))&&e.hasAttribute("type")&&c.REG_TYPE_RANGE.test(e.getAttribute("type"))&&(e.validity.rangeUnderflow||e.validity.rangeOverflow)&&i.add(e);break}case"required":{let t;if(/^(?:select|textarea)$/.test(o))t=e;else if(o==="input")if(e.hasAttribute("type")){const s=e.getAttribute("type");(s==="file"||c.REG_TYPE_CHECK.test(s)||c.REG_TYPE_DATE.test(s)||c.REG_TYPE_TEXT.test(s))&&(t=e)}else t=e;t&&(e.required||e.hasAttribute("required"))&&i.add(e);break}case"optional":{let t;if(/^(?:select|textarea)$/.test(o))t=e;else if(o==="input")if(e.hasAttribute("type")){const s=e.getAttribute("type");(s==="file"||c.REG_TYPE_CHECK.test(s)||c.REG_TYPE_DATE.test(s)||c.REG_TYPE_TEXT.test(s))&&(t=e)}else t=e;t&&!(e.required||e.hasAttribute("required"))&&i.add(e);break}case"root":{e===this.#s.documentElement&&i.add(e);break}case"empty":{if(e.hasChildNodes()){const t=this.#n.createTreeWalker(e,c.SHOW_ALL);let s=t.firstChild(),f;for(;s&&(f=s.nodeType!==c.ELEMENT_NODE&&s.nodeType!==c.TEXT_NODE,!!f);)s=t.nextSibling();f&&i.add(e)}else i.add(e);break}case"first-child":{(r&&e===r.firstElementChild||e===this.#t)&&i.add(e);break}case"last-child":{(r&&e===r.lastElementChild||e===this.#t)&&i.add(e);break}case"only-child":{(r&&e===r.firstElementChild&&e===r.lastElementChild||e===this.#t)&&i.add(e);break}case"first-of-type":{if(r){const[t]=this._collectNthOfType({a:0,b:1},e);t&&i.add(t)}else e===this.#t&&i.add(e);break}case"last-of-type":{if(r){const[t]=this._collectNthOfType({a:0,b:1,reverse:!0},e);t&&i.add(t)}else e===this.#t&&i.add(e);break}case"only-of-type":{if(r){const[t]=this._collectNthOfType({a:0,b:1},e);if(t===e){const[s]=this._collectNthOfType({a:0,b:1,reverse:!0},e);s===e&&i.add(e)}}else e===this.#t&&i.add(e);break}case"defined":{const t=e.getAttribute("is");t?(0,M.default)(t)&&this.#a.customElements.get(t)&&i.add(e):(0,M.default)(o)?this.#a.customElements.get(o)&&i.add(e):(e instanceof this.#a.HTMLElement||e instanceof this.#a.SVGElement)&&i.add(e);break}case"popover-open":{if(e.popover){const{display:t}=this.#a.getComputedStyle(e);t!=="none"&&i.add(e)}break}case"host":case"host-context":break;case"after":case"before":case"first-letter":case"first-line":{if(d){const t=`Unsupported pseudo-element ::${a}`;throw new DOMException(t,c.NOT_SUPPORTED_ERR)}break}case"autofill":case"blank":case"buffering":case"current":case"fullscreen":case"future":case"modal":case"muted":case"past":case"paused":case"picture-in-picture":case"playing":case"seeking":case"stalled":case"user-invalid":case"user-valid":case"volume-locked":case"-webkit-autofill":{if(d){const t=`Unsupported pseudo-class :${a}`;throw new DOMException(t,c.NOT_SUPPORTED_ERR)}break}default:if(a.startsWith("-webkit-")){if(d){const t=`Unsupported pseudo-class :${a}`;throw new DOMException(t,c.NOT_SUPPORTED_ERR)}}else if(!u){const t=`Unknown pseudo-class :${a}`;throw new DOMException(t,c.SYNTAX_ERR)}}return i}_matchShadowHostPseudoClass(l,e){const{children:h,name:n}=l;let a;if(Array.isArray(h)){const{branches:o}=(0,y.walkAST)(h[0]),[r]=o,[...u]=r,{host:d}=e;if(n==="host"){let i;for(const t of u){const{type:s}=t;if(s===c.COMBINATOR){const m=`Invalid selector ${(0,y.generateCSS)(l)}`;throw new DOMException(m,c.SYNTAX_ERR)}if(i=this._matchSelector(t,d).has(d),!i)break}i&&(a=e)}else if(n==="host-context"){let i=d,t;for(;i;){for(const s of u){const{type:f}=s;if(f===c.COMBINATOR){const b=`Invalid selector ${(0,y.generateCSS)(l)}`;throw new DOMException(b,c.SYNTAX_ERR)}if(t=this._matchSelector(s,i).has(i),!t)break}if(t)break;i=i.parentNode}t&&(a=e)}}else if(n==="host")a=e;else{const o=`Invalid selector :${n}`;throw new DOMException(o,c.SYNTAX_ERR)}return a??null}_matchSelector(l,e,h){const{type:n}=l,a=new Set;if(l.name===c.EMPTY)return a;const o=(0,y.unescapeSelector)(l.name);if(typeof o=="string"&&o!==l.name&&(l.name=o),e.nodeType===c.ELEMENT_NODE)switch(n){case c.SELECTOR_PSEUDO_ELEMENT:{O.matcher.matchPseudoElementSelector(o,h);break}case c.SELECTOR_ID:{e.id===o&&a.add(e);break}case c.SELECTOR_CLASS:{e.classList.contains(o)&&a.add(e);break}case c.SELECTOR_PSEUDO_CLASS:return this._matchPseudoClassSelector(l,e,h);default:{const r=O.matcher.matchSelector(l,e,h);r&&a.add(r)}}else if(this.#d&&n===c.SELECTOR_PSEUDO_CLASS&&e.nodeType===c.DOCUMENT_FRAGMENT_NODE){if(o!=="has"&&c.REG_LOGICAL_PSEUDO.test(o))return this._matchPseudoClassSelector(l,e,h);if(c.REG_SHADOW_HOST.test(o)){const r=this._matchShadowHostPseudoClass(l,e,h);r&&a.add(r)}}return a}_matchLeaves(l,e,h){const{attributes:n,localName:a,nodeType:o}=e;let r=this.#w.get(l),u;if(r&&r.has(e)){const{attr:d,matched:i}=r.get(e);n?.length===d&&(u=i)}if(typeof u!="boolean"){let d;o===c.ELEMENT_NODE&&c.REG_FORM.test(a)?d=!1:d=!0;for(const i of l){const{name:t,type:s}=i;if(s===c.SELECTOR_PSEUDO_CLASS&&t==="dir"&&(d=!1),u=this._matchSelector(i,e,h).has(e),!u)break}d&&(r||(r=new WeakMap),r.set(e,{attr:n?.length,matched:u}),this.#w.set(l,r))}return!!u}_matchHTMLCollection(l,e={}){const{compound:h,filterLeaves:n}=e,a=new Set,o=l.length;if(o)if(h)for(let r=0;r<o;r++){const u=l[r];this._matchLeaves(n,u,e)&&a.add(u)}else{const r=[].slice.call(l);return new Set(r)}return a}_findDescendantNodes(l,e,h){const[n,...a]=l,o=a.length>0,{type:r}=n,u=(0,y.unescapeSelector)(n.name);typeof u=="string"&&u!==n.name&&(n.name=u);let d=new Set,i=!1;if(this.#d)i=!0;else switch(r){case c.SELECTOR_PSEUDO_ELEMENT:{O.matcher.matchPseudoElementSelector(u,h);break}case c.SELECTOR_ID:{if(this.#t.nodeType===c.ELEMENT_NODE)i=!0;else{const t=this.#t.getElementById(u);t&&t!==e&&e.contains(t)&&(o?this._matchLeaves(a,t,h)&&d.add(t):d.add(t))}break}case c.SELECTOR_CLASS:{const t=e.getElementsByClassName(u);d=this._matchHTMLCollection(t,{compound:o,filterLeaves:a});break}case c.SELECTOR_TYPE:{if(this.#s.contentType==="text/html"&&!/[*|]/.test(u)){const t=e.getElementsByTagName(u);d=this._matchHTMLCollection(t,{compound:o,filterLeaves:a})}else i=!0;break}default:i=!0}return{nodes:d,pending:i}}_matchCombinator(l,e,h={}){const{combo:n,leaves:a}=l,{name:o}=n,{parentNode:r}=e,{dir:u}=h,d=new Set;if(u===x)switch(o){case"+":{const i=e.nextElementSibling;i&&this._matchLeaves(a,i,h)&&d.add(i);break}case"~":{if(r){const i=this._createTreeWalker(r);let t=(0,_.traverseNode)(e,i);for(t=i.nextSibling();t;)this._matchLeaves(a,t,h)&&d.add(t),t=i.nextSibling()}break}case">":{const i=this._createTreeWalker(e);let t=(0,_.traverseNode)(e,i);for(t=i.firstChild();t;)this._matchLeaves(a,t,h)&&d.add(t),t=i.nextSibling();break}case" ":default:{const{nodes:i,pending:t}=this._findDescendantNodes(a,e);if(i.size)return i;if(t){const s=this._createTreeWalker(e);let f=(0,_.traverseNode)(e,s);for(f=s.nextNode();f&&e.contains(f);)this._matchLeaves(a,f,h)&&d.add(f),f=s.nextNode()}}}else switch(o){case"+":{const i=e.previousElementSibling;i&&this._matchLeaves(a,i,h)&&d.add(i);break}case"~":{if(r){const i=this._createTreeWalker(r);let t=(0,_.traverseNode)(r,i);for(t=i.firstChild();t&&t!==e;)this._matchLeaves(a,t,h)&&d.add(t),t=i.nextSibling()}break}case">":{r&&this._matchLeaves(a,r,h)&&d.add(r);break}case" ":default:{const i=[];let t=r;for(;t;)this._matchLeaves(a,t,h)&&i.push(t),t=t.parentNode;if(i.length)return new Set(i.reverse())}}return d}_findNode(l,e){const{node:h}=e;let n=(0,_.traverseNode)(h,this.#f),a;if(n)for(n.nodeType!==c.ELEMENT_NODE?n=this.#f.nextNode():n===h&&n!==this.#t&&(n=this.#f.nextNode());n;){if(this._matchLeaves(l,n,{warn:this.#i})){a=n;break}n=this.#f.nextNode()}return a??null}_matchSelf(l){const e=[],h=this._matchLeaves(l,this.#e,{warn:this.#i});let n=!1;return h&&(e.push(this.#e),n=!0),[e,n]}_findLineal(l,e={}){const{complex:h}=e,n=[];let a=this._matchLeaves(l,this.#e,{warn:this.#i}),o=!1;if(a&&(n.push(this.#e),o=!0),!a||h){let r=this.#e.parentNode;for(;r&&(a=this._matchLeaves(l,r,{warn:this.#i}),a&&(n.push(r),o=!0),r.parentNode);)r=r.parentNode}return[n,o]}_findFirst(l){const e=[],h=this._findNode(l,{node:this.#e});let n=!1;return h&&(e.push(h),n=!0),[e,n]}_findFromHTMLCollection(l,e={}){const{complex:h,compound:n,filterLeaves:a,targetType:o}=e;let r=[],u=!1,d=!1;const i=l.length;if(i)if(this.#e.nodeType===c.ELEMENT_NODE)for(let t=0;t<i;t++){const s=l[t];if(s!==this.#e&&(this.#e.contains(s)||s.contains(this.#e))){if(n){if(this._matchLeaves(a,s,{warn:this.#i})&&(r.push(s),u=!0,o===E))break}else if(r.push(s),u=!0,o===E)break}}else if(h)if(n)for(let t=0;t<i;t++){const s=l[t];if(this._matchLeaves(a,s,{warn:this.#i})&&(r.push(s),u=!0,o===E))break}else r=[].slice.call(l),u=!0,d=!0;else if(n)for(let t=0;t<i;t++){const s=l[t];if(this._matchLeaves(a,s,{warn:this.#i})&&(r.push(s),u=!0,o===E))break}else r=[].slice.call(l),u=!0,d=!0;return[r,u,d]}_findEntryNodes(l,e,h){const{leaves:n}=l,[a,...o]=n,r=o.length>0,{name:u,type:d}=a;let i=[],t=!1,s=!1,f=!1;switch(d){case c.SELECTOR_PSEUDO_ELEMENT:{O.matcher.matchPseudoElementSelector(u,{warn:this.#i});break}case c.SELECTOR_ID:{if(e===R)[i,s]=this._matchSelf(n);else if(e===C)[i,s]=this._findLineal(n,{complex:h});else if(e===E&&this.#t.nodeType!==c.ELEMENT_NODE){const m=this.#t.getElementById(u);m&&(r?this._matchLeaves(o,m,{warn:this.#i})&&(i.push(m),s=!0):(i.push(m),s=!0))}else e===E?[i,s]=this._findFirst(n):f=!0;break}case c.SELECTOR_CLASS:{if(e===R)[i,s]=this._matchSelf(n);else if(e===C)[i,s]=this._findLineal(n,{complex:h});else if(this.#t.nodeType===c.DOCUMENT_NODE){const m=this.#t.getElementsByClassName(u);m.length&&([i,s,t]=this._findFromHTMLCollection(m,{complex:h,compound:r,filterLeaves:o,targetType:e}))}else e===E?[i,s]=this._findFirst(n):f=!0;break}case c.SELECTOR_TYPE:{if(e===R)[i,s]=this._matchSelf(n);else if(e===C)[i,s]=this._findLineal(n,{complex:h});else if(this.#s.contentType==="text/html"&&this.#t.nodeType===c.DOCUMENT_NODE&&!/[*|]/.test(u)){const m=this.#t.getElementsByTagName(u);m.length&&([i,s,t]=this._findFromHTMLCollection(m,{complex:h,compound:r,filterLeaves:o,targetType:e}))}else e===E?[i,s]=this._findFirst(n):f=!0;break}default:if(e!==C&&c.REG_SHADOW_HOST.test(u)){if(this.#d&&this.#e.nodeType===c.DOCUMENT_FRAGMENT_NODE){const m=this._matchShadowHostPseudoClass(a,this.#e);m&&(i.push(m),s=!0)}}else e===R?[i,s]=this._matchSelf(n):e===C?[i,s]=this._findLineal(n,{complex:h}):e===E?[i,s]=this._findFirst(n):f=!0}return{collected:t,compound:r,filtered:s,nodes:i,pending:f}}_collectNodes(l){const e=this.#l.values();if(l===L||l===E){const h=new Set;let n=0;for(const{branch:a}of e){const o=a.length,r=o>1,u=a[0];let d,i;if(r){const{combo:p,leaves:[{name:w,type:k}]}=u,N=a[o-1],{leaves:[{name:A,type:v}]}=N;if(v===c.SELECTOR_PSEUDO_ELEMENT||v===c.SELECTOR_ID)d=S,i=N;else if(k===c.SELECTOR_PSEUDO_ELEMENT||k===c.SELECTOR_ID)d=x,i=u;else if(l===L)if(w==="*"&&k===c.SELECTOR_TYPE)d=S,i=N;else if(A==="*"&&v===c.SELECTOR_TYPE)d=x,i=u;else if(o===2){const{name:T}=p;/^[+~]$/.test(T)?(d=S,i=N):(d=x,i=u)}else d=x,i=u;else if(A==="*"&&v===c.SELECTOR_TYPE)d=x,i=u;else if(w==="*"&&k===c.SELECTOR_TYPE)d=S,i=N;else{let T;for(const{combo:D,leaves:[$]}of a){const{name:F,type:z}=$;if(z===c.SELECTOR_PSEUDO_CLASS&&F==="dir"){T=!1;break}if(!T&&D){const{name:H}=D;/^[+~]$/.test(H)&&(T=!0)}}T?(d=x,i=u):(d=S,i=N)}}else d=S,i=u;const{collected:t,compound:s,filtered:f,nodes:m,pending:b}=this._findEntryNodes(i,l,r);m.length?(this.#l[n].find=!0,this.#h[n]=m):b&&h.add(new Map([["index",n],["twig",i]])),this.#l[n].collected=t,this.#l[n].dir=d,this.#l[n].filtered=f||!s,n++}if(h.size){let a,o;this.#e!==this.#t&&this.#e.nodeType===c.ELEMENT_NODE?(a=this.#e,o=this.#f):(a=this.#t,o=this.#c);let r=(0,_.traverseNode)(a,o);for(;r;){let u=!1;if(this.#e.nodeType===c.ELEMENT_NODE?r===this.#e?u=!0:u=this.#e.contains(r):u=!0,u)for(const d of h){const{leaves:i}=d.get("twig");if(this._matchLeaves(i,r,{warn:this.#i})){const s=d.get("index");this.#l[s].filtered=!0,this.#l[s].find=!0,this.#h[s].push(r)}}r!==o.currentNode&&(r=(0,_.traverseNode)(r,o)),r=o.nextNode()}}}else{let h=0;for(const{branch:n}of e){const a=n[n.length-1],o=n.length>1,{compound:r,filtered:u,nodes:d}=this._findEntryNodes(a,l,o);d.length&&(this.#l[h].find=!0,this.#h[h]=d),this.#l[h].dir=S,this.#l[h].filtered=u||!r,h++}}return[this.#l,this.#h]}_getCombinedNodes(l,e,h){const n=[];for(const a of e){const o=this._matchCombinator(l,a,{dir:h,warn:this.#i});o.size&&n.push(...o)}return n.length?new Set(n):new Set}_matchNodeNext(l,e,h){const{combo:n,index:a}=h,{combo:o,leaves:r}=l[a],u={combo:n,leaves:r},d=this._getCombinedNodes(u,e,x);let i;if(d.size)if(a===l.length-1){const[t]=(0,_.sortNodes)(d);i=t}else i=this._matchNodeNext(l,d,{combo:o,index:a+1});return i??null}_matchNodePrev(l,e,h){const{index:n}=h,a=l[n],o=new Set([e]),r=this._getCombinedNodes(a,o,S);let u;if(r.size){if(n===0)u=e;else for(const d of r)if(this._matchNodePrev(l,d,{index:n-1}))return e}return u??null}_find(l){(l===L||l===E)&&this._prepareQuerySelectorWalker();const[[...e],h]=this._collectNodes(l),n=e.length;let a=new Set;for(let o=0;o<n;o++){const{branch:r,collected:u,dir:d,find:i}=e[o],t=r.length;if(t&&i){const s=h[o],f=s.length,m=t-1;if(m===0)if((l===L||l===E)&&this.#e.nodeType===c.ELEMENT_NODE)for(let b=0;b<f;b++){const p=s[b];if(p!==this.#e&&this.#e.contains(p)&&(a.add(p),l!==L))break}else if(l===L)if(a.size){const b=[...a];a=new Set([...b,...s]),this.#u=!0}else a=new Set(s);else{const[b]=s;a.add(b)}else if(l===L)if(d===x){let{combo:b}=r[0];for(const p of s){let w=new Set([p]);for(let k=1;k<t;k++){const{combo:N,leaves:A}=r[k],v={combo:b,leaves:A};if(w=this._getCombinedNodes(v,w,d),w.size)if(k===m)if(a.size){const T=[...a];a=new Set([...T,...w]),this.#u=!0}else a=w;else b=N;else break}}}else for(const b of s){let p=new Set([b]);for(let w=m-1;w>=0;w--){const k=r[w];if(p=this._getCombinedNodes(k,p,d),p.size)w===0&&(a.add(b),t>1&&a.size>1&&(this.#u=!0));else break}}else if(l===E&&d===x){const{combo:b}=r[0];let p;for(const w of s)if(p=this._matchNodeNext(r,new Set([w]),{combo:b,index:1}),p){a.add(p);break}if(!p&&!u){const{leaves:w}=r[0],[k]=s;let N=this._findNode(w,{node:k});for(;N;){if(p=this._matchNodeNext(r,new Set([N]),{combo:b,index:1}),p){a.add(p);break}N=this._findNode(w,{node:N})}}}else{let b;for(const p of s)if(b=this._matchNodePrev(r,p,{index:m-1}),b){a.add(p);break}if(!b&&!u&&l===E){const{leaves:p}=r[m],[w]=s;let k=this._findNode(p,{node:w});for(;k;){if(b=this._matchNodePrev(r,k,{index:m-1}),b){a.add(k);break}k=this._findNode(p,{node:k})}}}}}return a}matches(l,e,h){let n;try{if(e?.nodeType!==c.ELEMENT_NODE){const r=`Unexpected node ${e?.nodeName}`;throw new TypeError(r)}const a=e.ownerDocument;if(a===this.#n&&a.contentType==="text/html"){const r={complex:c.REG_COMPLEX_A.test(l),descendant:!0};if((0,y.filterSelector)(l,r))return this.#o.match(l,e)}this._setup(l,e,h),n=this._find(R).size}catch(a){this._onError(a)}return!!n}closest(l,e,h){let n;try{if(e?.nodeType!==c.ELEMENT_NODE){const r=`Unexpected node ${e?.nodeName}`;throw new TypeError(r)}const a=e.ownerDocument;if(a===this.#n&&a.contentType==="text/html"){const r={complex:c.REG_COMPLEX_A.test(l),descendant:!0};if((0,y.filterSelector)(l,r))return this.#o.closest(l,e)}this._setup(l,e,h);const o=this._find(C);if(o.size){let r=this.#e;for(;r;){if(o.has(r)){n=r;break}r=r.parentNode}}}catch(a){this._onError(a)}return n??null}querySelector(l,e,h){let n;try{(0,_.verifyNode)(e);let a;if(e.nodeType===c.DOCUMENT_NODE?a=e:a=e.ownerDocument,a===this.#n&&a.contentType==="text/html"){const r={complex:c.REG_COMPLEX_B.test(l),descendant:!1};if((0,y.filterSelector)(l,r))return this.#o.first(l,e)}this._setup(l,e,h);const o=this._find(E);o.delete(this.#e),o.size&&([n]=(0,_.sortNodes)(o))}catch(a){this._onError(a)}return n??null}querySelectorAll(l,e,h){let n;try{(0,_.verifyNode)(e);let a;if(e.nodeType===c.DOCUMENT_NODE?a=e:a=e.ownerDocument,a===this.#n&&a.contentType==="text/html"){const r={complex:c.REG_COMPLEX_B.test(l),descendant:!0};if((0,y.filterSelector)(l,r))return this.#o.select(l,e)}this._setup(l,e,h);const o=this._find(L);o.delete(this.#e),o.size&&(this.#u?n=(0,_.sortNodes)(o):n=[...o])}catch(a){this._onError(a)}return n??[]}}0&&(module.exports={Finder});
//# sourceMappingURL=finder.js.map

@@ -1,3 +0,3 @@

var g=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var T=(n,t)=>{for(var s in t)g(n,s,{get:t[s],enumerable:!0})},$=(n,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of S(t))!I.call(n,i)&&i!==s&&g(n,i,{get:()=>t[i],enumerable:!(r=L(t,i))||r.enumerable});return n};var C=n=>$(g({},"__esModule",{value:!0}),n);var R={};T(R,{filterSelector:()=>D,generateCSS:()=>_.generate,parseAstName:()=>m,parseSelector:()=>u,preprocess:()=>O,sortAST:()=>A,unescapeSelector:()=>w,walkAST:()=>y});module.exports=C(R);var d=require("css-tree"),e=require("./constant.js"),_=require("css-tree");const w=(n="")=>{if(typeof n=="string"&&n.indexOf("\\",0)>=0){const t=n.split("\\"),s=t.length;for(let r=1;r<s;r++){let i=t[r];if(i===""&&r===s-1)i=e.U_FFFD;else{const f=e.REG_HEX.exec(i);if(f){const[,o]=f;let a;try{const c=parseInt("D800",e.HEX),E=parseInt("DFFF",e.HEX),l=parseInt(o,e.HEX);l===0||l>=c&&l<=E?a=e.U_FFFD:a=String.fromCodePoint(l)}catch{a=e.U_FFFD}let p="";i.length>o.length&&(p=i.substring(o.length)),i=`${a}${p}`}else/^[\n\r\f]/.test(i)&&(i="\\"+i)}t[r]=i}n=t.join("")}return n},O=(...n)=>{if(!n.length)throw new TypeError("1 argument required, but only 0 present.");let[t]=n;if(typeof t=="string"){let s=0;for(;s>=0&&(s=t.indexOf("#",s),!(s<0));){const r=t.substring(0,s+1);let i=t.substring(s+1);if(/^\d$/.test(i.substring(0,1)))throw new DOMException(`Invalid selector ${t}`,e.SYNTAX_ERR);const f=i.codePointAt(0);if(f===e.BIT_HYPHEN){if(/^\d$/.test(i.substring(1,2)))throw new DOMException(`Invalid selector ${t}`,e.SYNTAX_ERR)}else if(f>e.BIT_FFFF){const o=`\\${f.toString(e.HEX)} `;i.length===e.DUO?i=o:i=`${o}${i.substring(e.DUO)}`}t=`${r}${i}`,s++}t=t.replace(/\f|\r\n?/g,`
`).replace(/[\0\uD800-\uDFFF]|\\$/g,e.U_FFFD)}else if(t==null)t=Object.prototype.toString.call(t).slice(e.TYPE_FROM,e.TYPE_TO).toLowerCase();else if(Array.isArray(t))t=t.join(",");else if(Object.prototype.hasOwnProperty.call(t,"toString"))t=t.toString();else throw new DOMException(`Invalid selector ${t}`,e.SYNTAX_ERR);return t},u=n=>{if(n=O(n),e.REG_INVALID_SELECTOR.test(n))throw new DOMException(`Invalid selector ${n}`,e.SYNTAX_ERR);let t;try{const s=(0,d.parse)(n,{context:"selectorList",parseCustomProperty:!0});t=(0,d.toPlainObject)(s)}catch(s){const{message:r}=s;if(r==="Identifier is expected"&&e.REG_LANG_QUOTED.test(n)){const[,i,f]=e.REG_LANG_QUOTED.exec(n),o=f.replaceAll("*","\\*").replace(/^"/,"").replace(/"$/,"");let a=i.replace(f,o);a===":lang()"&&(a=`:lang(${e.EMPTY})`),t=u(n.replace(i,a))}else if(/^(?:Identifier|Selector) is expected$/.test(r)&&e.REG_LOGICAL_EMPTY.test(n)){const[,i,f]=e.REG_LOGICAL_EMPTY.exec(n);t=u(n.replace(i,`:${f}(${e.EMPTY})`))}else if(/^(?:"\]"|Attribute selector [()\s,=~^$*|]+) is expected$/.test(r)&&!n.endsWith("]")){const i=n.lastIndexOf("["),f=n.substring(i);f.includes('"')?f.match(/"/g).length%2?t=u(`${n}"]`):t=u(`${n}]`):t=u(`${n}]`)}else if(r==='")" is expected'&&!n.endsWith(")"))t=u(`${n})`);else throw new DOMException(r,e.SYNTAX_ERR)}return t},y=(n={})=>{const t=new Set;let s,r;(0,d.walk)(n,{enter:o=>{o.type===e.SELECTOR?t.add(o.children):o.type===e.SELECTOR_PSEUDO_CLASS?(s=!0,e.REG_LOGICAL_PSEUDO.test(o.name)&&(r=!0)):o.type===e.SELECTOR_PSEUDO_ELEMENT&&(s=!0,e.REG_SHADOW_PSEUDO.test(o.name)&&(r=!0))}}),r&&(0,d.findAll)(n,(o,a,p)=>{if(p){if(o.type===e.SELECTOR_PSEUDO_CLASS&&e.REG_LOGICAL_PSEUDO.test(o.name)){const c=p.filter(E=>{const{name:l,type:h}=E;return h===e.SELECTOR_PSEUDO_CLASS&&e.REG_LOGICAL_PSEUDO.test(l)});for(const{children:E}of c)for(const{children:l}of E)for(const{children:h}of l)t.has(h)&&t.delete(h)}else if(o.type===e.SELECTOR_PSEUDO_ELEMENT&&e.REG_SHADOW_PSEUDO.test(o.name)){const c=p.filter(E=>{const{name:l,type:h}=E;return h===e.SELECTOR_PSEUDO_ELEMENT&&e.REG_SHADOW_PSEUDO.test(l)});for(const{children:E}of c)for(const{children:l}of E)t.has(l)&&t.delete(l)}}});const f={};return s&&(f.hasPseudo=s),r&&(f.hasPseudoFunc=r),{info:f,branches:[...t]}},A=n=>{const t=[...n];if(t.length>1){const s=new Map([[e.SELECTOR_PSEUDO_ELEMENT,e.BIT_01],[e.SELECTOR_ID,e.BIT_02],[e.SELECTOR_CLASS,e.BIT_04],[e.SELECTOR_TYPE,e.BIT_08],[e.SELECTOR_ATTR,e.BIT_16],[e.SELECTOR_PSEUDO_CLASS,e.BIT_32]]);t.sort((r,i)=>{const{type:f}=r,{type:o}=i,a=s.get(f),p=s.get(o);let c;return a===p?c=0:a>p?c=1:c=-1,c})}return t},m=n=>{let t,s;if(n&&typeof n=="string")n.indexOf("|")>-1?[t,s]=n.split("|"):(t="*",s=n);else throw new DOMException(`Invalid selector ${n}`,e.SYNTAX_ERR);return{prefix:t,localName:s}},D=(n,t={})=>{if(!n||typeof n!="string")return!1;if(n.includes("[")){const s=n.lastIndexOf("[");if(n.substring(s).lastIndexOf("]")<0)return!1}if(/\||::|\[\s*[\w$*=^|~-]+(?:(?:"[\w$*=^|~\s'-]+"|'[\w$*=^|~\s"-]+')?(?:\s+[\w$*=^|~-]+)+|"[^"\]]{1,255}|'[^'\]]{1,255})\s*\]/.test(n))return!1;if(n.includes(":")){let s;if(e.REG_LOGICAL_KEY.test(n)){if(e.REG_LOGICAL_EMPTY.test(n))return!1;const{complex:r,descendant:i}=t;r&&i?s=e.REG_LOGICAL_COMPLEX_A:r?s=e.REG_LOGICAL_COMPLEX_B:s=e.REG_LOGICAL_COMPOUND}else s=e.REG_CHILD_INDEXED;if(s.test(n))return!1}return!0};0&&(module.exports={filterSelector,generateCSS,parseAstName,parseSelector,preprocess,sortAST,unescapeSelector,walkAST});
var h=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var I=(s,t)=>{for(var i in t)h(s,i,{get:t[i],enumerable:!0})},L=(s,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of x(t))!S.call(s,n)&&n!==i&&h(s,n,{get:()=>t[n],enumerable:!(r=_(t,n))||r.enumerable});return s};var T=s=>L(h({},"__esModule",{value:!0}),s);var P={};I(P,{filterSelector:()=>A,generateCSS:()=>O.generate,parseAstName:()=>w,parseSelector:()=>u,preprocess:()=>g,sortAST:()=>m,unescapeSelector:()=>$,walkAST:()=>C});module.exports=T(P);var E=require("css-tree"),e=require("./constant.js"),O=require("css-tree");const $=(s="")=>{if(typeof s=="string"&&s.indexOf("\\",0)>=0){const t=s.split("\\"),i=t.length;for(let r=1;r<i;r++){let n=t[r];if(n===""&&r===i-1)n=e.U_FFFD;else{const o=e.REG_HEX.exec(n);if(o){const[,a]=o;let l;try{const f=parseInt("D800",e.HEX),p=parseInt("DFFF",e.HEX),d=parseInt(a,e.HEX);d===0||d>=f&&d<=p?l=e.U_FFFD:l=String.fromCodePoint(d)}catch{l=e.U_FFFD}let c="";n.length>a.length&&(c=n.substring(a.length)),n=`${l}${c}`}else/^[\n\r\f]/.test(n)&&(n="\\"+n)}t[r]=n}s=t.join("")}return s},g=(...s)=>{if(!s.length)throw new TypeError("1 argument required, but only 0 present.");let[t]=s;if(typeof t=="string"){let i=0;for(;i>=0&&(i=t.indexOf("#",i),!(i<0));){const r=t.substring(0,i+1);let n=t.substring(i+1);if(/^\d$/.test(n.substring(0,1)))throw new DOMException(`Invalid selector ${t}`,e.SYNTAX_ERR);const o=n.codePointAt(0);if(o===e.BIT_HYPHEN){if(/^\d$/.test(n.substring(1,2)))throw new DOMException(`Invalid selector ${t}`,e.SYNTAX_ERR)}else if(o>e.BIT_FFFF){const a=`\\${o.toString(e.HEX)} `;n.length===e.DUO?n=a:n=`${a}${n.substring(e.DUO)}`}t=`${r}${n}`,i++}t=t.replace(/\f|\r\n?/g,`
`).replace(/[\0\uD800-\uDFFF]|\\$/g,e.U_FFFD)}else if(t==null)t=Object.prototype.toString.call(t).slice(e.TYPE_FROM,e.TYPE_TO).toLowerCase();else if(Array.isArray(t))t=t.join(",");else if(Object.prototype.hasOwnProperty.call(t,"toString"))t=t.toString();else throw new DOMException(`Invalid selector ${t}`,e.SYNTAX_ERR);return t},u=s=>{if(s=g(s),e.REG_INVALID_SELECTOR.test(s))throw new DOMException(`Invalid selector ${s}`,e.SYNTAX_ERR);let t;try{const i=(0,E.parse)(s,{context:"selectorList",parseCustomProperty:!0});t=(0,E.toPlainObject)(i)}catch(i){const{message:r}=i;if(r==="Identifier is expected"&&e.REG_LANG_QUOTED.test(s)){const[,n,o]=e.REG_LANG_QUOTED.exec(s),a=o.replaceAll("*","\\*").replace(/^"/,"").replace(/"$/,"");let l=n.replace(o,a);l===":lang()"&&(l=`:lang(${e.EMPTY})`),t=u(s.replace(n,l))}else if(/^(?:Identifier|Selector) is expected$/.test(r)&&e.REG_LOGICAL_EMPTY.test(s)){const[,n,o]=e.REG_LOGICAL_EMPTY.exec(s);t=u(s.replace(n,`:${o}(${e.EMPTY})`))}else if(/^(?:"\]"|Attribute selector [()\s,=~^$*|]+) is expected$/.test(r)&&!s.endsWith("]")){const n=s.lastIndexOf("["),o=s.substring(n);o.includes('"')?o.match(/"/g).length%2?t=u(`${s}"]`):t=u(`${s}]`):t=u(`${s}]`)}else if(r==='")" is expected'&&!s.endsWith(")"))t=u(`${s})`);else throw new DOMException(r,e.SYNTAX_ERR)}return t},C=(s={})=>{const t=new Set,i=new Map;return(0,E.walk)(s,{enter:n=>{n.type===e.SELECTOR?t.add(n.children):n.type===e.SELECTOR_PSEUDO_CLASS?(i.set("hasPseudo",!0),e.REG_LOGICAL_PSEUDO.test(n.name)?(i.set("hasPseudoFunc",!0),n.name==="has"&&i.set("hasHasPseudoFunc",!0)):e.REG_USER_ACTION.test(n.name)&&i.set("hasUserActionPseudo",!0)):n.type===e.SELECTOR_PSEUDO_ELEMENT&&(i.set("hasPseudo",!0),e.REG_SHADOW_PSEUDO.test(n.name)&&i.set("hasPseudoFunc",!0))}}),i.get("hasPseudoFunc")&&(0,E.findAll)(s,(n,o,a)=>{if(a){if(n.type===e.SELECTOR_PSEUDO_CLASS&&e.REG_LOGICAL_PSEUDO.test(n.name)){const l=a.filter(c=>{const{name:f,type:p}=c;return p===e.SELECTOR_PSEUDO_CLASS&&e.REG_LOGICAL_PSEUDO.test(f)});for(const{children:c}of l)for(const{children:f}of c)for(const{children:p}of f)t.has(p)&&t.delete(p)}else if(n.type===e.SELECTOR_PSEUDO_ELEMENT&&e.REG_SHADOW_PSEUDO.test(n.name)){const l=a.filter(c=>{const{name:f,type:p}=c;return p===e.SELECTOR_PSEUDO_ELEMENT&&e.REG_SHADOW_PSEUDO.test(f)});for(const{children:c}of l)for(const{children:f}of c)t.has(f)&&t.delete(f)}}}),{branches:[...t],info:Object.fromEntries(i)}},m=s=>{const t=[...s];if(t.length>1){const i=new Map([[e.SELECTOR_PSEUDO_ELEMENT,e.BIT_01],[e.SELECTOR_ID,e.BIT_02],[e.SELECTOR_CLASS,e.BIT_04],[e.SELECTOR_TYPE,e.BIT_08],[e.SELECTOR_ATTR,e.BIT_16],[e.SELECTOR_PSEUDO_CLASS,e.BIT_32]]);t.sort((r,n)=>{const{type:o}=r,{type:a}=n,l=i.get(o),c=i.get(a);let f;return l===c?f=0:l>c?f=1:f=-1,f})}return t},w=s=>{let t,i;if(s&&typeof s=="string")s.indexOf("|")>-1?[t,i]=s.split("|"):(t="*",i=s);else throw new DOMException(`Invalid selector ${s}`,e.SYNTAX_ERR);return{prefix:t,localName:i}},A=(s,t={})=>{if(!s||typeof s!="string")return!1;if(s.includes("[")){const i=s.lastIndexOf("[");if(s.substring(i).lastIndexOf("]")<0)return!1}if(/\||::|\[\s*[\w$*=^|~-]+(?:(?:"[\w$*=^|~\s'-]+"|'[\w$*=^|~\s"-]+')?(?:\s+[\w$*=^|~-]+)+|"[^"\]]{1,255}|'[^'\]]{1,255})\s*\]/.test(s))return!1;if(s.includes(":")){let i;if(e.REG_LOGICAL_KEY.test(s)){if(e.REG_LOGICAL_EMPTY.test(s))return!1;const{complex:r,descendant:n}=t;r&&n?i=e.REG_LOGICAL_COMPLEX_A:r?i=e.REG_LOGICAL_COMPLEX_B:i=e.REG_LOGICAL_COMPOUND}else i=e.REG_CHILD_INDEXED;if(i.test(s))return!1}return!0};0&&(module.exports={filterSelector,generateCSS,parseAstName,parseSelector,preprocess,sortAST,unescapeSelector,walkAST});
//# sourceMappingURL=parser.js.map

@@ -34,3 +34,3 @@ {

"benchmark": "^2.1.4",
"c8": "^10.1.1",
"c8": "^10.1.2",
"chai": "^5.1.1",

@@ -42,5 +42,5 @@ "commander": "^12.1.0",

"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.2.9",
"eslint-plugin-jsdoc": "^48.2.12",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-unicorn": "^53.0.0",
"eslint-plugin-unicorn": "^54.0.0",
"happy-dom": "^14.12.0",

@@ -65,3 +65,3 @@ "jsdom": "^24.1.0",

},
"version": "4.4.13"
"version": "4.5.0-b.1"
}

@@ -137,1 +137,2 @@ /**

export const REG_TYPE_TEXT = /^(?:email|number|password|search|tel|text|url)$/;
export const REG_USER_ACTION = /active|focus(?:-(?:visible|within))?|hover/;

@@ -70,7 +70,7 @@ /**

}
const tree = document.createTreeWalker(root, WALKER_FILTER);
const walker = document.createTreeWalker(root, WALKER_FILTER);
return [
document,
root,
tree
walker
];

@@ -80,2 +80,53 @@ };

/**
* traverse node tree
* @private
* @param {object} node - node
* @param {object} walker - tree walker
* @returns {?object} - current node
*/
export const traverseNode = (node, walker) => {
if (!node || !node.nodeType) {
// throws
verifyNode(node);
}
let current;
if (walker?.currentNode) {
let refNode = walker.currentNode;
if (refNode === node) {
current = refNode;
} else if (refNode.contains(node)) {
refNode = walker.nextNode();
while (refNode) {
if (refNode === node) {
current = refNode;
break;
}
refNode = walker.nextNode();
}
} else {
if (refNode !== walker.root) {
while (refNode) {
if (refNode === walker.root || refNode === node) {
break;
}
refNode = walker.parentNode();
}
}
if (node.nodeType === ELEMENT_NODE) {
while (refNode) {
if (refNode === node) {
current = refNode;
break;
}
refNode = walker.nextNode();
}
} else {
current = refNode;
}
}
}
return current ?? null;
};
/**
* is in shadow tree

@@ -85,3 +136,7 @@ * @param {object} node - node

*/
export const isInShadowTree = (node = {}) => {
export const isInShadowTree = node => {
if (!node || !node.type) {
// throws
verifyNode(node);
}
let bool;

@@ -109,3 +164,7 @@ if (node.nodeType === ELEMENT_NODE ||

*/
export const getSlottedTextContent = (node = {}) => {
export const getSlottedTextContent = node => {
if (!node || !node.nodeType) {
// throws
verifyNode(node);
}
let res;

@@ -134,3 +193,7 @@ if (node.localName === 'slot' && isInShadowTree(node)) {

*/
export const getDirectionality = (node = {}) => {
export const getDirectionality = node => {
if (!node || !node.nodeType) {
// throws
verifyNode(node);
}
let res;

@@ -256,3 +319,7 @@ if (node.nodeType === ELEMENT_NODE) {

*/
export const isContentEditable = (node = {}) => {
export const isContentEditable = node => {
if (!node || !node.nodeType) {
// throws
verifyNode(node);
}
let res;

@@ -290,4 +357,8 @@ if (node.nodeType === ELEMENT_NODE) {

export const getNamespaceURI = (ns, node) => {
if (!node || !node.nodeType) {
// throws
verifyNode(node);
}
let res;
if (ns && typeof ns === 'string' && node?.nodeType === ELEMENT_NODE) {
if (ns && typeof ns === 'string' && node.nodeType === ELEMENT_NODE) {
const { attributes } = node;

@@ -339,3 +410,10 @@ for (const attr of attributes) {

*/
export const isPreceding = (nodeA = {}, nodeB = {}) => {
export const isPreceding = (nodeA, nodeB) => {
if (!nodeA || !nodeA.nodeType) {
// throws
verifyNode(nodeA);
} else if (!nodeB || !nodeB.nodeType) {
// throws
verifyNode(nodeB);
}
let res;

@@ -342,0 +420,0 @@ if (nodeA.nodeType === ELEMENT_NODE && nodeB.nodeType === ELEMENT_NODE) {

@@ -14,5 +14,5 @@ /**

REG_LOGICAL_COMPOUND, REG_LOGICAL_EMPTY, REG_LOGICAL_KEY, REG_LOGICAL_PSEUDO,
REG_SHADOW_PSEUDO, SELECTOR, SELECTOR_ATTR, SELECTOR_CLASS, SELECTOR_ID,
SELECTOR_PSEUDO_CLASS, SELECTOR_PSEUDO_ELEMENT, SELECTOR_TYPE, SYNTAX_ERR,
TYPE_FROM, TYPE_TO, U_FFFD
REG_SHADOW_PSEUDO, REG_USER_ACTION, SELECTOR, SELECTOR_ATTR, SELECTOR_CLASS,
SELECTOR_ID, SELECTOR_PSEUDO_CLASS, SELECTOR_PSEUDO_ELEMENT, SELECTOR_TYPE,
SYNTAX_ERR, TYPE_FROM, TYPE_TO, U_FFFD
} from './constant.js';

@@ -189,4 +189,3 @@

const branches = new Set();
let hasPseudo;
let hasPseudoFunc;
const info = new Map();
const opt = {

@@ -197,10 +196,15 @@ enter: node => {

} else if (node.type === SELECTOR_PSEUDO_CLASS) {
hasPseudo = true;
info.set('hasPseudo', true);
if (REG_LOGICAL_PSEUDO.test(node.name)) {
hasPseudoFunc = true;
info.set('hasPseudoFunc', true);
if (node.name === 'has') {
info.set('hasHasPseudoFunc', true);
}
} else if (REG_USER_ACTION.test(node.name)) {
info.set('hasUserActionPseudo', true);
}
} else if (node.type === SELECTOR_PSEUDO_ELEMENT) {
hasPseudo = true;
info.set('hasPseudo', true);
if (REG_SHADOW_PSEUDO.test(node.name)) {
hasPseudoFunc = true;
info.set('hasPseudoFunc', true);
}

@@ -211,3 +215,3 @@ }

walk(ast, opt);
if (hasPseudoFunc) {
if (info.get('hasPseudoFunc')) {
findAll(ast, (node, item, list) => {

@@ -254,12 +258,5 @@ if (list) {

}
const info = {};
if (hasPseudo) {
info.hasPseudo = hasPseudo;
}
if (hasPseudoFunc) {
info.hasPseudoFunc = hasPseudoFunc;
}
return {
info,
branches: [...branches]
branches: [...branches],
info: Object.fromEntries(info)
};

@@ -266,0 +263,0 @@ };

@@ -100,1 +100,2 @@ export const AN_PLUS_B: "AnPlusB";

export const REG_TYPE_TEXT: RegExp;
export const REG_USER_ACTION: RegExp;
export function verifyNode(node: any): object;
export function resolveContent(node: object): Array<object>;
export function isInShadowTree(node?: object): boolean;
export function getSlottedTextContent(node?: object): string | null;
export function getDirectionality(node?: object): string | null;
export function isContentEditable(node?: object): boolean;
export function traverseNode(node: object, walker: object): object | null;
export function isInShadowTree(node: object): boolean;
export function getSlottedTextContent(node: object): string | null;
export function getDirectionality(node: object): string | null;
export function isContentEditable(node: object): boolean;
export function getNamespaceURI(ns: string, node: any[]): string | null;
export function isNamespaceDeclared(ns?: string, node?: object): boolean;
export function isPreceding(nodeA?: object, nodeB?: object): boolean;
export function isPreceding(nodeA: object, nodeB: object): boolean;
export function sortNodes(nodes?: Array<object> | Set<object>): Array<object | undefined>;

@@ -10,3 +10,2 @@ export class Finder {

private _prepareQuerySelectorWalker;
private _traverse;
private _collectNthChild;

@@ -13,0 +12,0 @@ private _collectNthOfType;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc