"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 React = _interopRequireWildcard(require("react"));
require("./index.scss");
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 rules = function rules(_ref) {
  var text = _ref.text,
    font = _ref.font,
    fontSize = _ref.fontSize,
    fontColor = _ref.fontColor,
    fontOpacity = _ref.fontOpacity,
    MessageCssfont = _ref.MessageCssfont,
    MessageCssfontSize = _ref.MessageCssfontSize,
    MessageCssfontColor = _ref.MessageCssfontColor,
    MessageCssfontOpacity = _ref.MessageCssfontOpacity,
    MessageLintHight = _ref.MessageLintHight,
    bgImg = _ref.bgImg,
    rulesText = _ref.rulesText;
  var bottomBg = {
    style: {
      backgroundImage: "url(" + bgImg + "?imageMogr2/interlace/1)"
    }
  };
  var fontTextCss = {
    style: {
      color: fontColor,
      fontSize: fontSize + "px",
      fontFamily: font,
      opacity: fontOpacity / 100
    }
  };
  var MessageCss = {
    style: {
      color: MessageCssfontColor,
      fontSize: MessageCssfontSize + "px",
      fontFamily: MessageCssfont,
      opacity: MessageCssfontOpacity / 100
    }
  };
  var MessageLiCSS = {
    style: {
      lineHeight: MessageLintHight + "vw"
    }
  };
  var result = rulesText.split(/\n/g).filter(function (item) {
    return !!item;
  });
  return /*#__PURE__*/React.createElement("div", {
    className: "bottom"
  }, /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
    className: "title"
  }, fontTextCss), text), /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
    className: "activity-rules"
  }, MessageCss), /*#__PURE__*/React.createElement("ul", null, result && result.length > 0 && result.map(function (item, index) {
    return /*#__PURE__*/React.createElement("li", (0, _extends2["default"])({
      key: index
    }, MessageLiCSS), item);
  }))), /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
    className: "bottomBG"
  }, bottomBg)));
};
var _default = rules;
exports["default"] = _default;