'use strict';

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

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

var _FilterPane = require('../components/FilterPane');

var _FilterPane2 = _interopRequireDefault(_FilterPane);

var _filter_fields = require('../selectors/filter_fields');

var _filter_fields2 = _interopRequireDefault(_filter_fields);

var _field_analysis = require('../selectors/field_analysis');

var _field_analysis2 = _interopRequireDefault(_field_analysis);

var _field_mapping = require('../selectors/field_mapping');

var _field_mapping2 = _interopRequireDefault(_field_mapping);

var _color_index = require('../selectors/color_index');

var _color_index2 = _interopRequireDefault(_color_index);

var _action_creators = require('../action_creators');

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

function mapStateToProps(state) {
  return {
    filters: state.filters,
    filterFields: (0, _filter_fields2.default)(state),
    fieldStats: (0, _field_analysis2.default)(state),
    coloredField: (0, _field_mapping2.default)(state).color,
    colorIndex: (0, _color_index2.default)(state)
  };
}

function mapDispatchToProps(dispatch) {
  return {
    onUpdateFilter: function onUpdateFilter(filter) {
      return dispatch((0, _action_creators.updateFilter)(filter));
    },
    onClickSettings: function onClickSettings() {
      return dispatch((0, _action_creators.openSettings)('filters'));
    }
  };
}

exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_FilterPane2.default);
//# sourceMappingURL=ConnectFilterPane.js.map