"use strict";

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

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

var _SwitchCollapse = _interopRequireDefault(require("../../../../../common/SwitchCollapse"));

var _TextConfig = _interopRequireDefault(require("../../../../../meta-comp/config-panels/TextConfig"));

var _businessUtil = require("../../../../../utils/businessUtil");

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

var __extends = void 0 && (void 0).__extends || function () {
  var _extendStatics = function extendStatics(d, b) {
    _extendStatics = Object.setPrototypeOf || {
      __proto__: []
    } instanceof Array && function (d, b) {
      d.__proto__ = b;
    } || function (d, b) {
      for (var p in b) {
        if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
      }
    };

    return _extendStatics(d, b);
  };

  return function (d, b) {
    if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");

    _extendStatics(d, b);

    function __() {
      this.constructor = d;
    }

    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();

var debug = require('debug')('worker:TextConfigTitle');

var TextConfigTitle =
/** @class */
function (_super) {
  __extends(TextConfigTitle, _super);

  function TextConfigTitle() {
    var _this = _super !== null && _super.apply(this, arguments) || this;

    _this.state = {};
    return _this;
  }

  TextConfigTitle.prototype.render = function () {
    var data = this.props.data;
    var source = [{
      key: 'title',
      name: 'title',
      value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
        data: data.setting.title
      }),
      metaOption: data.setting.title
    }, {
      key: 'subtitle',
      name: 'subtitle',
      value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
        data: data.setting.subtitle
      }),
      metaOption: data.setting.subtitle
    }];
    return /*#__PURE__*/_react["default"].createElement(_SwitchCollapse["default"], {
      onRefresh: function onRefresh() {
        return (0, _businessUtil.renderPreview)();
      },
      source: source
    });
  };

  TextConfigTitle.defaultProps = {
    option: {}
  };
  return TextConfigTitle;
}(_react["default"].Component);

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