"use strict";

var __extends = this && this.__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 (b.hasOwnProperty(p)) d[p] = b[p];
    };
    return _extendStatics(d, b);
  };
  return function (d, b) {
    _extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var __assign = this && this.__assign || function () {
  __assign = Object.assign || function (t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];
      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
    }
    return t;
  };
  return __assign.apply(this, arguments);
};
exports.__esModule = true;
var react_1 = require("react");
var index_module_scss_1 = require("./index.module.scss");
var bannerPsd = /** @class */function (_super) {
  __extends(bannerPsd, _super);
  function bannerPsd() {
    return _super !== null && _super.apply(this, arguments) || this;
  }
  bannerPsd.prototype.render = function () {
    var _a;
    var psdParse = this.props.psdParse;
    var _b = psdParse || {},
      selectIdx = _b.selectIdx,
      psdList = _b.psdList;
    var curPsdParse = !(selectIdx === undefined || psdList === undefined) ? psdList[selectIdx] : {
      bgImg: '',
      layers: [],
      source: ''
    };
    var imgStyle = (curPsdParse === null || curPsdParse === void 0 ? void 0 : curPsdParse.bgImg) ? {
      style: {
        backgroundImage: "url(" + (curPsdParse === null || curPsdParse === void 0 ? void 0 : curPsdParse.bgImg) + ")"
      }
    } : {};
    return react_1["default"].createElement("div", {
      className: index_module_scss_1["default"]['banner-wrap'],
      id: "banner-psd"
    }, react_1["default"].createElement("div", __assign({
      className: index_module_scss_1["default"].banner + " " + (!(curPsdParse === null || curPsdParse === void 0 ? void 0 : curPsdParse.bgImg) ? index_module_scss_1["default"]['banner-none'] : '')
    }, imgStyle), (_a = curPsdParse === null || curPsdParse === void 0 ? void 0 : curPsdParse.layers) === null || _a === void 0 ? void 0 : _a.map(function (res, idx) {
      return react_1["default"].createElement("div", {
        className: index_module_scss_1["default"]['banner-fonts'],
        key: idx,
        style: res.style
      }, res.text);
    })));
  };
  return bannerPsd;
}(react_1.Component);
exports["default"] = bannerPsd;