function ancestorMatchClass(n,t){for(;n&&n!==document;n=n.parentNode)if(n.classList.contains(t))return n;return null}function ancestorMatchTag(n,t){t=t.toUpperCase();do if(n.nodeName===t)return n;while(n=n.parentNode);return null}