"use strict";

exports.__esModule = true;
exports["default"] = void 0;
var _core = require("@blueprintjs/core");
var _react = _interopRequireDefault(require("react"));
var _copyToClipboard = _interopRequireDefault(require("copy-to-clipboard"));
var _RowItem = _interopRequireDefault(require("../RowItem"));
require("./style.css");
var _classnames = _interopRequireDefault(require("classnames"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _default = function _default(_ref) {
  var _ref$extraClasses = _ref.extraClasses,
    extraClasses = _ref$extraClasses === void 0 ? "" : _ref$extraClasses,
    _ref$sequence = _ref.sequence,
    sequence = _ref$sequence === void 0 ? "nnnnn" : _ref$sequence,
    _ref$paddingEnd = _ref.paddingEnd,
    paddingEnd = _ref$paddingEnd === void 0 ? "-------" : _ref$paddingEnd,
    _ref$paddingStart = _ref.paddingStart,
    paddingStart = _ref$paddingStart === void 0 ? "-------" : _ref$paddingStart,
    reverseSnipPosition = _ref.reverseSnipPosition,
    forwardSnipPosition = _ref.forwardSnipPosition,
    _ref$charWidth = _ref.charWidth,
    charWidth = _ref$charWidth === void 0 ? 13 : _ref$charWidth,
    noCopy = _ref.noCopy;
  var seqPlusPadding = paddingStart + sequence + paddingEnd;
  return /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      cursor: noCopy ? "" : "pointer",
      position: "relative"
    },
    onClick: noCopy ? function () {} : function () {
      (0, _copyToClipboard["default"])(sequence);
      window.toastr.success("Recognition Site Copied");
    },
    className: (0, _classnames["default"])("enzyme-rowitem", extraClasses, {
      noCopy: noCopy
    })
  }, /*#__PURE__*/_react["default"].createElement(_core.Icon, {
    className: "tg-icon-duplicate-inner",
    style: {
      display: "none",
      position: "absolute",
      top: 3,
      left: 3
    },
    icon: "duplicate"
  }), /*#__PURE__*/_react["default"].createElement(_RowItem["default"], {
    charWidth: charWidth,
    tickSpacing: 1,
    annotationVisibility: {
      cutsites: true,
      cutsiteLabels: false,
      axis: false,
      reverseSequence: true,
      sequence: true
    },
    annotationLabelVisibility: {
      cutsites: false
    },
    sequenceLength: seqPlusPadding.length,
    bpsPerRow: seqPlusPadding.length,
    row: {
      sequence: seqPlusPadding,
      start: 0,
      end: seqPlusPadding.length - 1,
      cutsites: {
        fake1: {
          annotation: {
            recognitionSiteRange: {
              start: paddingStart.length,
              end: paddingStart.length + sequence.length - 1
            },
            topSnipBeforeBottom: forwardSnipPosition < reverseSnipPosition,
            bottomSnipPosition: paddingStart.length + reverseSnipPosition,
            topSnipPosition: paddingStart.length + forwardSnipPosition,
            id: "fake1",
            restrictionEnzyme: {}
          }
        }
      }
    }
  }));
};
exports["default"] = _default;
module.exports = exports.default;