{"version":3,"file":"elementMatchesRule.min.mjs","names":[],"sources":["../../../src/parser/elementMatchesRule.ts"],"sourcesContent":["import { selectorMatches } from './selectorMatches';\nimport { doesSomeParentMatch } from './doesSomeParentMatch';\n\n/**\n * @private\n */\n\nexport function elementMatchesRule(\n  element: HTMLElement | SVGElement,\n  selectors: string[],\n) {\n  let parentMatching = true;\n  // start from rightmost selector.\n  const firstMatching = selectorMatches(element, selectors.pop()!);\n  if (firstMatching && selectors.length) {\n    parentMatching = doesSomeParentMatch(element, selectors);\n  }\n  return firstMatching && parentMatching && selectors.length === 0;\n}\n"],"mappings":"gIAOA,SAAgB,EACd,EACA,EAAA,CAEA,IAAI,EAAA,CAAiB,EAEf,EAAgB,EAAgB,EAAS,EAAU,KAAA,CAAA,CAIzD,OAHI,GAAiB,EAAU,SAC7B,EAAiB,EAAoB,EAAS,EAAA,EAEzC,GAAiB,GAAkB,EAAU,SAAW,EAAX,OAAA,KAAA"}