function i(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(;t;){if(n?l(t):r(t))return t;t=t.parentElement}return document.scrollingElement}function a(t,n){const e=[];if(n&&t&&!n.contains(t))return e;for(;t&&(r(t)&&e.push(t),t!==n);)t=t.parentElement;return e}function r(t){if(!t||t.nodeType!==Node.ELEMENT_NODE)return!1;const n=window.getComputedStyle(t),e=n.overflowY==="scroll"||n.overflowY==="auto"&&t.scrollHeight>t.clientHeight,o=n.overflowX==="scroll"||n.overflowX==="auto"&&t.scrollWidth>t.clientWidth;return e||o}function l(t){if(!t||t.nodeType!==Node.ELEMENT_NODE)return!1;const n=window.getComputedStyle(t);return["scroll","auto"].includes(n.overflowY)}export{i as a,a as g,r as h};
