import{isHTMLElement as t,isElement as o}from"./instanceOf.js";import{round as i}from"../utils/math.js";import e from"./getWindow.js";import f from"./isLayoutViewport.js";function r(r,h,s){void 0===h&&(h=!1),void 0===s&&(s=!1);var d=r.getBoundingClientRect(),m=1,n=1;h&&t(r)&&(m=r.offsetWidth>0&&i(d.width)/r.offsetWidth||1,n=r.offsetHeight>0&&i(d.height)/r.offsetHeight||1);var p=(o(r)?e(r):window).visualViewport,g=!f()&&s,a=(d.left+(g&&p?p.offsetLeft:0))/m,w=(d.top+(g&&p?p.offsetTop:0))/n,u=d.width/m,l=d.height/n;return{width:u,height:l,top:w,right:a+u,bottom:w+l,left:a,x:a,y:w}}export{r as default};
//# sourceMappingURL=getBoundingClientRect.js.map
