'use strict';

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

var _redux = require('redux');

var _reactRedux = require('../../../../react-redux');

var _modifications = require('../../../../actions/modifications');

var modificationActions = _interopRequireWildcard(_modifications);

var _presenter = require('./presenter');

var _presenter2 = _interopRequireDefault(_presenter);

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

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function mapStateToProps(state, props) {
  return {
    workingStimulus: props.stimulus.getWorkingInstance(),
    errorsShowing: state.getIn(['errorsShowing', props.guid], props.errorsShowing || false)
  };
}

function mapDispatchToProps(dispatch) {
  var modActions = (0, _redux.bindActionCreators)(modificationActions, dispatch);

  return {
    modifyStimulus: modActions.modifyStimulus
  };
}

exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_presenter2.default);