"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require("react");

var _react2 = _interopRequireDefault(_react);

var _bioParsers = require("bio-parsers");

var _withEditorProps = require("../../withEditorProps");

var _recompose = require("recompose");

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

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

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
// import { Button } from "@blueprintjs/core";


var GenbankView = function (_React$Component) {
  _inherits(GenbankView, _React$Component);

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

    return _possibleConstructorReturn(this, (GenbankView.__proto__ || Object.getPrototypeOf(GenbankView)).apply(this, arguments));
  }

  _createClass(GenbankView, [{
    key: "render",
    value: function render() {
      var _props$sequenceData = this.props.sequenceData,
          sequenceData = _props$sequenceData === undefined ? {} : _props$sequenceData;

      var genbankString = (0, _bioParsers.jsonToGenbank)(sequenceData);
      return _react2.default.createElement("textarea", {
        "data-test": "ve-genbank-text",
        readOnly: true
        // wrap="soft"
        , style: {
          whiteSpace: "pre",
          overflowWrap: "normal",
          overflowX: "scroll",
          fontSize: 11,
          fontFamily: "monospace",
          width: 540,
          height: 350
        },
        value: genbankString
      });
    }
  }]);

  return GenbankView;
}(_react2.default.Component);

exports.default = (0, _recompose.compose)((0, _withEditorProps.connectToEditor)(function (_ref) {
  var _ref$sequenceData = _ref.sequenceData,
      sequenceData = _ref$sequenceData === undefined ? {} : _ref$sequenceData;

  return {
    sequenceData: sequenceData
  };
}))(GenbankView);