"use strict";
Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.getCatalogPanelOffset = exports.getCatalogOffset = exports.getMousePos = void 0;
var getMousePos = function(t) {
  var e = t || window.event,
    o = document.documentElement.scrollLeft || document.body.scrollLeft,
    t = document.documentElement.scrollTop || document.body.scrollTop;
  return {
    left: e.pageX || e.clientX + o,
    top: e.pageY || e.clientY + t
  }
};
exports.getMousePos = getMousePos;
var getCatalogOffset = function(t) {
  var e, o, l, n, f = 0 < arguments.length && void 0 !== t ? t : {},
    s = {
      top: 0,
      left: 0,
      height: 0,
      width: 0
    };
  return void 0 !== f.getBoundingClientRect && (e = f.getBoundingClientRect(), o = (n = f.ownerDocument).body, t = (l = n.documentElement).clientTop || o.clientTop || 0, n = l.clientLeft || o.clientLeft || 0, s = {
    top: e.top + (window.pageYOffset || l && l.scrollTop || o.scrollTop) - t,
    left: e.left + (window.pageXOffset || l && l.scrollLeft || o.scrollLeft) - n,
    width: (null === e.width ? f.offsetWidth : e.width) || 0,
    height: (null === e.height ? f.offsetHeight : e.height) || 0
  }), s
};
exports.getCatalogOffset = getCatalogOffset;
var getCatalogPanelOffset = function(t) {
  t = getCatalogOffset(t);
  return {
    left: t.left + t.width + 20,
    top: t.top
  }
};
exports.getCatalogPanelOffset = getCatalogPanelOffset;
