"use strict";

exports.__esModule = true;
exports.getEmptyImage = exports.dragCoordinates = void 0;
var dragCoordinates = _ref => {
  var {
    monitor,
    component
  } = _ref;
  var hoverBoundingRect = component.getBoundingClientRect();

  // Get vertical middle
  var hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
  var hoverMiddleX = (hoverBoundingRect.right - hoverBoundingRect.left) / 2;

  // Determine mouse position
  var clientOffset = monitor.getClientOffset();

  // Get pixels to the top
  var hoverClientY = clientOffset.y - hoverBoundingRect.top;
  var hoverClientX = clientOffset.x - hoverBoundingRect.left;
  return {
    hoverMiddleY,
    clientOffset,
    hoverClientY,
    hoverMiddleX,
    hoverClientX
  };
};
exports.dragCoordinates = dragCoordinates;
var emptyImage;
var getEmptyImage = () => {
  if (!emptyImage) {
    emptyImage = new Image();
    emptyImage.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
  }
  return emptyImage;
};
exports.getEmptyImage = getEmptyImage;
//# sourceMappingURL=DragUtils.js.map