import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "shouldFitContainer", "shouldRenderToParent"],
  _excluded2 = ["children", "shouldFitContainer", "shouldRenderToParent"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import React from 'react';
/**
 * The purpose of this component is to hide the default Popup border.
 * HoverCard border implementation is in ContentContainer where it can
 * change between the default border and prism border during runtime.
 */
var CustomPopupContainer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
  var children = _ref.children,
    _ = _ref.shouldFitContainer,
    __ = _ref.shouldRenderToParent,
    props = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
    ref: ref
  }), children);
});

/**
 * Factory function to create a CustomPopupContainer with a specific z-index
 */
export var createCustomPopupContainer = function createCustomPopupContainer(zIndex) {
  return /*#__PURE__*/React.forwardRef(
  // FIXME: ...props spreads all props to the div, including isReferenceHidden, which is not a valid prop for a div.
  // Find another way but adding exceptions with _, __, ___ etc.
  function (_ref2, ref) {
    var children = _ref2.children,
      _ = _ref2.shouldFitContainer,
      __ = _ref2.shouldRenderToParent,
      props = _objectWithoutProperties(_ref2, _excluded2);
    return /*#__PURE__*/React.createElement("div", _extends({}, props, {
      ref: ref
    }, zIndex !== undefined && {
      style: _objectSpread(_objectSpread({}, props.style), {}, {
        zIndex: zIndex
      })
    }), children);
  });
};
export default CustomPopupContainer;