var getScrollParent=function(o){if(o===null){return null}if(o.classList.contains("element_scrolled")||(o===null||o===void 0?void 0:o.tagName)==="BODY"){return o}else{return getScrollParent(o.offsetParent)}};function positionElement(o){var n=o.actionElement,l=o.changedElement,i=o.intoView;var r=i?i:document.body;var v=r.offsetParent;var e=!!r.classList.contains("element_scrolled");var t=e?n.offsetTop-r.scrollTop+v.offsetTop:n.offsetTop-window.scrollY;var d=e?n.offsetLeft+v.offsetLeft:n.offsetLeft;var a=(l===null||l===void 0?void 0:l.offsetHeight)>window.innerHeight-t?t-(l===null||l===void 0?void 0:l.offsetHeight)-16:t+(n===null||n===void 0?void 0:n.offsetHeight)+16;var u=(l===null||l===void 0?void 0:l.offsetWidth)>window.innerWidth-d?d+(n===null||n===void 0?void 0:n.offsetWidth)-(l===null||l===void 0?void 0:l.offsetWidth):d;var w=window.innerHeight-(l===null||l===void 0?void 0:l.offsetHeight);var s=window.innerWidth-(l===null||l===void 0?void 0:l.offsetWidth);var c={top:a<8?8:a>w?w-8:a,left:u<0?0:u>s?s:u};return c}function positionAbsoluteElement(o){var n=o.actionElement,l=o.changedElement,i=o.intoView;var r=i?i:document.body;var v=r.offsetHeight<l.offsetHeight?window.screen.height:r.offsetHeight;var e=r.offsetWidth<l.offsetWidth?window.screen.width:r.offsetWidth;var t=v-n.offsetTop;var d=e-n.offsetLeft;var a={y:t<l.offsetHeight+n.offsetHeight?"top":"bottom",x:d<l.offsetWidth?"right":"left"};return a}export{positionElement as a,getScrollParent as g,positionAbsoluteElement as p};
//# sourceMappingURL=position-element-4e9000bc.js.map