"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, l = document.documentElement.scrollTop || document.body.scrollTop;
  return {
    left: e.pageX || e.clientX + o,
    top: e.pageY || e.clientY + l
  };
};

exports.getMousePos = getMousePos;

var getCatalogOffset = function() {
  var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, e = {
    top: 0,
    left: 0,
    height: 0,
    width: 0
  };
  if (void 0 !== t.getBoundingClientRect) {
    var o = t.getBoundingClientRect(), l = t.ownerDocument, n = l.body, f = l.documentElement, s = f.clientTop || n.clientTop || 0, g = f.clientLeft || n.clientLeft || 0;
    e = {
      top: o.top + (window.pageYOffset || f && f.scrollTop || n.scrollTop) - s,
      left: o.left + (window.pageXOffset || f && f.scrollLeft || n.scrollLeft) - g,
      width: (null === o.width ? t.offsetWidth : o.width) || 0,
      height: (null === o.height ? t.offsetHeight : o.height) || 0
    };
  }
  return e;
};

exports.getCatalogOffset = getCatalogOffset;

var getCatalogPanelOffset = function(t) {
  var e = getCatalogOffset(t);
  return {
    left: e.left + e.width + 20,
    top: e.top
  };
};

exports.getCatalogPanelOffset = getCatalogPanelOffset;