{"version":3,"file":"doesSomeParentMatch.mjs","names":[],"sources":["../../../src/parser/doesSomeParentMatch.ts"],"sourcesContent":["import { selectorMatches } from './selectorMatches';\n\nexport function doesSomeParentMatch(\n  element: HTMLElement | SVGElement,\n  selectors: string[],\n) {\n  let selector: string,\n    parentMatching = true;\n  while (\n    element.parentElement &&\n    element.parentElement.nodeType === 1 &&\n    selectors.length\n  ) {\n    if (parentMatching) {\n      selector = selectors.pop()!;\n    }\n    element = element.parentElement;\n    parentMatching = selectorMatches(element, selector!);\n  }\n  return selectors.length === 0;\n}\n"],"mappings":";;AAEA,SAAgB,oBACd,SACA,WACA;CACA,IAAI,UACF,iBAAiB;AACnB,QACE,QAAQ,iBACR,QAAQ,cAAc,aAAa,KACnC,UAAU,QACV;AACA,MAAI,eACF,YAAW,UAAU,KAAK;AAE5B,YAAU,QAAQ;AAClB,mBAAiB,gBAAgB,SAAS,SAAU;;AAEtD,QAAO,UAAU,WAAW"}