"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _tslib = require("tslib");

var _classnames = _interopRequireDefault(require("classnames"));

var React = _interopRequireWildcard(require("react"));

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var Flex =
/** @class */
function (_super) {
  (0, _tslib.__extends)(Flex, _super);

  function Flex() {
    return _super !== null && _super.apply(this, arguments) || this;
  }

  Flex.prototype.render = function () {
    var _a;

    var _b = this.props,
        direction = _b.direction,
        wrap = _b.wrap,
        justify = _b.justify,
        align = _b.align,
        alignContent = _b.alignContent,
        className = _b.className,
        children = _b.children,
        prefixCls = _b.prefixCls,
        style = _b.style,
        restProps = (0, _tslib.__rest)(_b, ["direction", "wrap", "justify", "align", "alignContent", "className", "children", "prefixCls", "style"]);
    var wrapCls = (0, _classnames["default"])("lp-flexbox", className, (_a = {}, _a[prefixCls + "dir-row"] = direction === 'row', _a[prefixCls + "dir-row-reverse"] = direction === 'row-reverse', _a[prefixCls + "dir-column"] = direction === 'column', _a[prefixCls + "dir-column-reverse"] = direction === 'column-reverse', _a[prefixCls + "nowrap"] = wrap === 'nowrap', _a[prefixCls + "wrap"] = wrap === 'wrap', _a[prefixCls + "wrap-reverse"] = wrap === 'wrap-reverse', _a[prefixCls + "justify-start"] = justify === 'start', _a[prefixCls + "justify-end"] = justify === 'end', _a[prefixCls + "justify-center"] = justify === 'center', _a[prefixCls + "justify-between"] = justify === 'between', _a[prefixCls + "justify-around"] = justify === 'around', _a[prefixCls + "align-start"] = align === 'start', _a[prefixCls + "align-center"] = align === 'center', _a[prefixCls + "align-end"] = align === 'end', _a[prefixCls + "align-baseline"] = align === 'baseline', _a[prefixCls + "align-stretch"] = align === 'stretch', _a[prefixCls + "align-content-start"] = alignContent === 'start', _a[prefixCls + "align-content-end"] = alignContent === 'end', _a[prefixCls + "align-content-center"] = alignContent === 'center', _a[prefixCls + "align-content-between"] = alignContent === 'between', _a[prefixCls + "align-content-around"] = alignContent === 'around', _a[prefixCls + "align-content-stretch"] = alignContent === 'stretch', _a));
    return /*#__PURE__*/React.createElement("div", (0, _tslib.__assign)({
      className: wrapCls,
      style: style
    }, restProps), children);
  };

  Flex.defaultProps = {
    prefixCls: 'next-',
    align: 'center'
  };
  return Flex;
}(React.Component);

var _default = Flex;
exports["default"] = _default;