"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
require("./index.scss");
var React = _interopRequireWildcard(require("react"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
var rules02 = function rules02(rules02Props) {
  var isBgColor = rules02Props.isBgColor,
    bgColor = rules02Props.bgColor,
    lineHeight = rules02Props.lineHeight,
    textColor = rules02Props.textColor,
    textFontFamily = rules02Props.textFontFamily,
    textFontSize = rules02Props.textFontSize,
    titleBold = rules02Props.titleBold,
    titleTextAlign = rules02Props.titleTextAlign,
    titleFontSize = rules02Props.titleFontSize,
    titleFontFamily = rules02Props.titleFontFamily,
    titleColor = rules02Props.titleColor,
    arrayRules = rules02Props.arrayRules;
  var getContent = function getContent(item) {
    var result = item && item.toString().split(/\n/g).filter(function (e) {
      return !!e;
    });
    return result;
  };
  var mainStyle = {
    style: {
      backgroundColor: isBgColor ? bgColor : '',
      lineHeight: lineHeight + "px"
    }
  };
  var titleStyle = {
    style: {
      fontWeight: titleBold ? 'bolder' : 'normal',
      textAlign: titleTextAlign,
      fontSize: titleFontSize,
      fontFamily: titleFontFamily,
      color: titleColor,
      paddingBottom: '2vw'
    }
  };
  var textStyle = {
    style: {
      color: textColor,
      fontSize: textFontSize + "px",
      fontFamily: textFontFamily
    }
  };
  var otherStyle = {
    style: {
      // background: isContentBgColor ? contentBgColor : '',
    }
  };
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
    className: "rules"
  }, mainStyle), /*#__PURE__*/React.createElement("div", otherStyle, arrayRules && arrayRules.length > 0 && arrayRules.map(function (item, index) {
    return /*#__PURE__*/React.createElement("div", {
      key: index
    }, /*#__PURE__*/React.createElement("div", titleStyle, item.title), /*#__PURE__*/React.createElement("ul", textStyle, getContent(item.content).map(function (item2, index2) {
      return /*#__PURE__*/React.createElement("li", {
        key: index2
      }, item2);
    })));
  })));
};
var _default = rules02;
exports["default"] = _default;