"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _balloon = _interopRequireDefault(require("@alifd/next/lib/balloon"));
var _excluded = ["__designMode", "defaultVisible", "visible", "mode", "children"];
var Tooltip = _balloon["default"].Tooltip;
var _default = function _default(props) {
  if (props === void 0) {
    props = {};
  }
  var _ref = props || {},
    __designMode = _ref.__designMode,
    defaultVisible = _ref.defaultVisible,
    visible = _ref.visible,
    mode = _ref.mode,
    children = _ref.children,
    otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
  console.log('props: ', props);
  var RealComponent = mode === 'Tooltip' ? Tooltip : _balloon["default"];
  var finalValue = __designMode === 'design' ? defaultVisible : visible;
  var finalProps = (0, _extends2["default"])({}, otherProps);
  if (typeof finalValue !== 'undefined') {
    finalProps.visible = finalValue;
  }
  if (typeof defaultVisible !== 'undefined') {
    finalProps.defaultVisible = defaultVisible;
  }
  return /*#__PURE__*/React.createElement(RealComponent, finalProps, children);
};
exports["default"] = _default;