"use strict";

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

var _react = _interopRequireDefault(require("react"));

var _MagicBox = _interopRequireDefault(require("../../../core/MagicBox"));

var _MBaseComponent2 = _interopRequireDefault(require("../../MBaseComponent"));

var _pageTitle = _interopRequireDefault(require("../components/page-title"));

require("./index.less");

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

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var MPageTitle = /*#__PURE__*/function (_MBaseComponent) {
  _inherits(MPageTitle, _MBaseComponent);

  var _super = _createSuper(MPageTitle);

  function MPageTitle() {
    _classCallCheck(this, MPageTitle);

    return _super.apply(this, arguments);
  }

  _createClass(MPageTitle, [{
    key: "render",
    value:
    /**
     * @required
     * React 会根据 type 动态创建组件的实例。
     */
    function render() {
      console.log('=====', this.props);

      var tempProps = _objectSpread({}, this.props, {
        isLeaf: true,
        onComponentClick: this.onComponentClick,
        style: {// background: '#fff',
        }
      });

      var data = {
        icon: this.props.iconInfo && this.props.iconInfo.imgUrl || 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAB6VBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+MAXszAAAAonRSTlMAAQIDBAUGCAoLDA0PEBESFhgbHR4fIiQlKCkqKywtLi8xMjM1Njc4OTo9P0JERkdIS01PUFJXW11eYGFiY2RmZ2hpamtscHFzeXp9f4CGiIyNj5CRkpOUlZudnp+goaSmp6ipqqusrbCys7S1tre5u7zBwsPExcbIysvMzc7P0NLT1NXW19jZ3N7h4ubn6Orr7O3u7/Dx8vT19vf5+vv8/f4o2yynAAACHElEQVQYGcXB91/McQDH8fd1KQ0jm0hl5ewREg0j43BmMkO2ri47GUVJ0tDUnavr9Ze6Pj30+N6+fuH51P+R/nKbZucX9+ZrNsagK1fJm0/QQKGSVsCU/hVK1kGMr5lK0h2m3VJy7P1Mm9yhpOzhr45UafUWJdLAjDLJ9m2l4lsVYEanTXrVNldxPcBil9TIZUW3RFMKA1jcl1oIbFZUzxRke42VLyvTB+9TFMVi8iSVEar4BEGliqKCU9KiAUK9GSOoK1WRXvBYtkaiK1GENZN8URUxfFCE29C/6TexrFOYpX4Y7yamqwpTQ3zfFSrHRwJ5CuEikeOySutjSntVEwSqrgBPDxU7e6g9OuUMQddktRvDLRdMyAHHZM/Sws4jGemak7GWoLeyqsFwywUTclCvop+Bi9oKHjkxumX1EcOtc36/Tw726TlMLlcfHjkxhmQ1hOGW4aBQI8BevcMjJ4ZfVuMYbm2srCyTg/XqBXbqMx45MUZk1Yfhlgu8clCu6zCcne3HIydGp6xaMdxygVcO2tKyLtUV6Sx45MR4IqtaDLdc4JUDHs6TbJXj4JET47Ss9mMMN/+AQHMHMNLwqIug0U89GPmyWjBGAq0KdYEEShUqZ5S42uwKc4B4xjcowg3iOKlIqXXEVK1o7DeJ4bxiKBklCt9hxbTsboBwLbmKJ792EKve8hQlkFJQUd3UPuj1DrfVu7an6p/7A+2xSG/B7/HrAAAAAElFTkSuQmCC',
        pageName: this.props.pageName || 'Group Buy',
        shareDescription: this.props.des || '1'
      };
      return /*#__PURE__*/_react["default"].createElement(_MagicBox["default"], tempProps, /*#__PURE__*/_react["default"].createElement(_pageTitle["default"], {
        data: data,
        style: tempProps.nodeData.style
      }));
    }
  }]);

  return MPageTitle;
}(_MBaseComponent2["default"]);

exports["default"] = MPageTitle;

_defineProperty(MPageTitle, "type", 'MPageTitle');