function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
import React from 'react';
import { arrowSize, StyledArrow } from './OverlayArrow.styles';
export var Arrow = /*#__PURE__*/React.forwardRef(function Arrow(_ref, ref) {
  var _arrow$x, _arrow$y;
  var placement = _ref.placement,
    arrow = _ref.arrow;
  var staticSide = {
    top: 'bottom',
    right: 'left',
    bottom: 'top',
    left: 'right'
  }[placement.split('-')[0]];
  var arrowX = (_arrow$x = arrow === null || arrow === void 0 ? void 0 : arrow.x) !== null && _arrow$x !== void 0 ? _arrow$x : null;
  var arrowY = (_arrow$y = arrow === null || arrow === void 0 ? void 0 : arrow.y) !== null && _arrow$y !== void 0 ? _arrow$y : null;
  return /*#__PURE__*/React.createElement(StyledArrow, {
    ref: ref,
    style: _defineProperty({
      position: 'absolute',
      left: arrowX !== null ? "".concat(arrowX, "px") : undefined,
      top: arrowY !== null ? "".concat(arrowY, "px") : undefined,
      right: '',
      bottom: ''
    }, staticSide, "-".concat(arrowSize / 2, "px")),
    "data-overlay-arrow": true
  });
});
//# sourceMappingURL=OverlayArrow.js.map