'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getUserUsername = getUserUsername;
exports.getLoginContinuation = getLoginContinuation;
exports.getLoginUsername = getLoginUsername;
exports.isLoginPending = isLoginPending;
exports.getLoginResponse = getLoginResponse;
exports.getLoginError = getLoginError;
exports.isLogoutPending = isLogoutPending;
exports.getLogoutResponse = getLogoutResponse;
exports.getRecordData = getRecordData;
exports.getNewRecordData = getNewRecordData;
exports.isRecordReadPending = isRecordReadPending;
exports.isRecordSavePending = isRecordSavePending;
exports.isRecordModified = isRecordModified;
exports.getPrefs = getPrefs;
exports.isPanelCollapsed = isPanelCollapsed;
exports.getSearchPageSize = getSearchPageSize;
exports.getSearchPanelPageSize = getSearchPanelPageSize;
exports.getOptionList = getOptionList;
exports.getVocabulary = getVocabulary;
exports.getPartialTermSearchMatches = getPartialTermSearchMatches;
exports.getIDGenerator = getIDGenerator;
exports.getKeywordSearchKeyword = getKeywordSearchKeyword;
exports.getKeywordSearchRecordType = getKeywordSearchRecordType;
exports.getKeywordSearchVocabulary = getKeywordSearchVocabulary;
exports.isSearchPending = isSearchPending;
exports.getSearchResult = getSearchResult;
exports.getSearchError = getSearchError;

var _redux = require('redux');

var _reactRouterRedux = require('react-router-redux');

var _cspace = require('./cspace');

var _cspace2 = _interopRequireDefault(_cspace);

var _idGenerator = require('./idGenerator');

var fromIDGenerator = _interopRequireWildcard(_idGenerator);

var _keywordSearch = require('./keywordSearch');

var fromKeywordSearch = _interopRequireWildcard(_keywordSearch);

var _login = require('./login');

var fromLogin = _interopRequireWildcard(_login);

var _logout = require('./logout');

var fromLogout = _interopRequireWildcard(_logout);

var _optionList = require('./optionList');

var fromOptionList = _interopRequireWildcard(_optionList);

var _partialTermSearch = require('./partialTermSearch');

var fromPartialTermSearch = _interopRequireWildcard(_partialTermSearch);

var _prefs = require('./prefs');

var fromPrefs = _interopRequireWildcard(_prefs);

var _record = require('./record');

var fromRecord = _interopRequireWildcard(_record);

var _search = require('./search');

var fromSearch = _interopRequireWildcard(_search);

var _user = require('./user');

var fromUser = _interopRequireWildcard(_user);

var _vocabulary = require('./vocabulary');

var fromVocabulary = _interopRequireWildcard(_vocabulary);

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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = (0, _redux.combineReducers)({
  cspace: _cspace2.default,
  idGenerator: fromIDGenerator.default,
  keywordSearch: fromKeywordSearch.default,
  login: fromLogin.default,
  logout: fromLogout.default,
  optionList: fromOptionList.default,
  partialTermSearch: fromPartialTermSearch.default,
  prefs: fromPrefs.default,
  record: fromRecord.default,
  routing: _reactRouterRedux.routerReducer,
  search: fromSearch.default,
  user: fromUser.default,
  vocabulary: fromVocabulary.default
});
function getUserUsername(state) {
  return fromUser.getUsername(state.user);
}

function getLoginContinuation(state) {
  return fromLogin.getContinuation(state.login);
}

function getLoginUsername(state) {
  return fromLogin.getUsername(state.login);
}

function isLoginPending(state) {
  return fromLogin.isPending(state.login);
}

function getLoginResponse(state) {
  return fromLogin.getResponse(state.login);
}

function getLoginError(state) {
  return fromLogin.getError(state.login);
}

function isLogoutPending(state) {
  return fromLogout.isPending(state.logout);
}

function getLogoutResponse(state) {
  return fromLogout.getResponse(state.logout);
}

function getRecordData(state, csid) {
  return fromRecord.getData(state.record, csid);
}

function getNewRecordData(state) {
  return fromRecord.getNewData(state.record);
}

function isRecordReadPending(state, csid) {
  return fromRecord.isReadPending(state.record, csid);
}

function isRecordSavePending(state, csid) {
  return fromRecord.isSavePending(state.record, csid);
}

function isRecordModified(state, csid) {
  return fromRecord.isModified(state.record, csid);
}

function getPrefs(state) {
  return state.prefs;
}

function isPanelCollapsed(state, recordType, name) {
  return fromPrefs.isPanelCollapsed(state.prefs, recordType, name);
}

function getSearchPageSize(state) {
  return fromPrefs.getSearchPageSize(state.prefs);
}

function getSearchPanelPageSize(state, recordType, name) {
  return fromPrefs.getSearchPanelPageSize(state.prefs, recordType, name);
}

function getOptionList(state, optionListName) {
  return fromOptionList.get(state.optionList, optionListName);
}

function getVocabulary(state, vocabularyName) {
  return fromVocabulary.get(state.vocabulary, vocabularyName);
}

function getPartialTermSearchMatches(state) {
  return fromPartialTermSearch.getMatches(state.partialTermSearch);
}

function getIDGenerator(state, idGeneratorName) {
  return fromIDGenerator.get(state.idGenerator, idGeneratorName);
}

function getKeywordSearchKeyword(state) {
  return fromKeywordSearch.getKeyword(state.keywordSearch);
}

function getKeywordSearchRecordType(state) {
  return fromPrefs.getKeywordSearchRecordType(state.prefs);
}

function getKeywordSearchVocabulary(state) {
  return fromPrefs.getKeywordSearchVocabulary(state.prefs);
}

function isSearchPending(state, searchName, searchDescriptor) {
  return fromSearch.isPending(state.search, searchName, searchDescriptor);
}

function getSearchResult(state, searchName, searchDescriptor) {
  return fromSearch.getResult(state.search, searchName, searchDescriptor);
}

function getSearchError(state, searchName, searchDescriptor) {
  return fromSearch.getError(state.search, searchName, searchDescriptor);
}