"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.normalizeProps = normalizeProps;
exports.suffixCls = void 0;
exports.toUsefulDrawerTransitionName = toUsefulDrawerTransitionName;

var _react = require("react");

var _mobx = require("mobx");

var _isNil = _interopRequireDefault(require("lodash/isNil"));

var _isBoolean = _interopRequireDefault(require("lodash/isBoolean"));

var _isNumber = _interopRequireDefault(require("lodash/isNumber"));

var _isString = _interopRequireDefault(require("lodash/isString"));

var suffixCls = 'modal';
exports.suffixCls = suffixCls;

function normalizeProps(props) {
  if ((0, _isString["default"])(props) || /*#__PURE__*/(0, _react.isValidElement)(props) || (0, _isBoolean["default"])(props) || (0, _isNil["default"])(props) || (0, _isNumber["default"])(props) || (0, _mobx.isArrayLike)(props)) {
    return {
      children: props
    };
  }

  return props;
}

var drawerTransitionNames = ['slide-up', 'slide-right', 'slide-down', 'slide-left'];

function isDrawerTransitionName(drawerTransitionName) {
  return drawerTransitionNames.includes(drawerTransitionName);
}

function toUsefulDrawerTransitionName(drawerTransitionName) {
  if (drawerTransitionName && isDrawerTransitionName(drawerTransitionName)) {
    return drawerTransitionName;
  }

  return 'slide-right';
}
//# sourceMappingURL=utils.js.map
