import { fromHTMlElement } from '@modusoperandi/licit-ui-commands';
export default function isElementFullyVisible(el) {
  var _fromHTMlElement = fromHTMlElement(el),
    x = _fromHTMlElement.x,
    y = _fromHTMlElement.y,
    w = _fromHTMlElement.w,
    h = _fromHTMlElement.h;
  // to handle the rounded border scenario.
  var factor = '10px' === el.style.borderRadius ? 3 : 1;
  // Only checks the top-left point.
  var nwEl = w && h ? el.ownerDocument.elementFromPoint(x + factor, y + factor) : null;
  return !nwEl ? false : nwEl === el || el.contains(nwEl);
}