export function isElWithinAnotherEl(el, container) {
  if (el.left > container.right) return false;
  if (el.right < container.left) return false;
  return true;
}
var buffer = 13;
export function isElWithinAnotherElWithDiff(el, container) {
  var elWidth = el.right - el.left;
  var containerWidth = container.right - container.left;
  var space = containerWidth - elWidth;
  if (el.right > container.right) {
    var diff = container.right - el.right - space / 2;
    if (el.left + diff < container.left + buffer) {
      //too far to the left -- aka diff too negative
      diff += container.left + buffer - el.left - diff;
    }
    return [false, diff];
  }
  if (el.left < container.left) {
    var _diff = container.left - el.left + space / 2;
    if (el.right + _diff + buffer > container.right) {
      //too far to the right -- aka diff too big
      _diff -= el.right + _diff + buffer - container.right;
    }
    return [false, _diff];
  }
  return [true];
}