"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRect = void 0; var getWindow_1 = require("./getWindow"); /** * Helper to get bounding client rect. Passing in window will get the window size. * * @public */ function getRect(element, win) { var theWin = (win !== null && win !== void 0 ? win : (!element || (element && element.hasOwnProperty('devicePixelRatio')))) ? (0, getWindow_1.getWindow)() : (0, getWindow_1.getWindow)(element); var rect; if (element) { if (element === theWin) { rect = { left: 0, top: 0, width: theWin.innerWidth, height: theWin.innerHeight, right: theWin.innerWidth, bottom: theWin.innerHeight, }; } else if (element.getBoundingClientRect) { rect = element.getBoundingClientRect(); } } return rect; } exports.getRect = getRect; //# sourceMappingURL=getRect.js.map