import m from "./index-getDocumentElement.js";
import a from "./index-getComputedStyle.js";
import g from "./index-getWindowScrollBarX.js";
import f from "./index-getWindowScroll.js";
import { max as i } from "./index-math.js";
function w(r) {
  var l, o = m(r), e = f(r), t = (l = r.ownerDocument) == null ? void 0 : l.body, c = i(o.scrollWidth, o.clientWidth, t ? t.scrollWidth : 0, t ? t.clientWidth : 0), h = i(o.scrollHeight, o.clientHeight, t ? t.scrollHeight : 0, t ? t.clientHeight : 0), n = -e.scrollLeft + g(r), d = -e.scrollTop;
  return a(t || o).direction === "rtl" && (n += i(o.clientWidth, t ? t.clientWidth : 0) - c), {
    width: c,
    height: h,
    x: n,
    y: d
  };
}
export {
  w as default
};
