"use strict";

exports.__esModule = true;
exports.history = exports.getBaseUrl = exports.default = exports.buildReducer = void 0;
var _redux = require("redux");
var _immutable = _interopRequireDefault(require("immutable"));
var _reduxApiMiddleware = require("redux-api-middleware");
var _immutable2 = require("connected-react-router/immutable");
var _history = require("history");
var _reduxImmutable = require("redux-immutable");
var _spawnerMiddleware = require("./spawnerMiddleware");
var _applications = _interopRequireDefault(require("./reducers/applications"));
var _authentication = _interopRequireDefault(require("./reducers/authentication"));
var _localeFactory = _interopRequireWildcard(require("./reducers/localeFactory"));
var _navigation = _interopRequireDefault(require("./reducers/navigation"));
var _request = _interopRequireDefault(require("./reducers/request"));
var _scopes = _interopRequireDefault(require("./reducers/scopes"));
var _scopesExtendedConfiguration = _interopRequireDefault(require("./reducers/scopesExtendedConfiguration"));
var _settings = _interopRequireDefault(require("./reducers/settings"));
var _toasts = _interopRequireDefault(require("./reducers/toasts"));
var _view = _interopRequireDefault(require("./reducers/view"));
var _versionInfo = _interopRequireDefault(require("./reducers/versionInfo"));
var _countries = _interopRequireDefault(require("./reducers/countries"));
var _timezones = _interopRequireDefault(require("./reducers/timezones"));
var _modules = _interopRequireDefault(require("./reducers/modules"));
var _metadata = _interopRequireDefault(require("./reducers/metadata"));
var _requestStates = _interopRequireDefault(require("./reducers/requestStates"));
var _tasks = _interopRequireDefault(require("./reducers/tasks"));
var _globalErrorMessages = _interopRequireDefault(require("./reducers/globalErrorMessages"));
var _scopeRouteState = _interopRequireDefault(require("./reducers/scopeRouteState"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
window.BUILD_ID = BUILD_ID;
window.BUILD_NUMBER = BUILD_NUMBER;
var basename = window.BASE_PATH || "";
var getBaseUrl = exports.getBaseUrl = function getBaseUrl() {
  var appBasePath = (window.BASE_PATH || "").split("/")[1] || "";
  return appBasePath ? window.location.origin.concat("/", appBasePath) : window.location.origin;
};
var history = exports.history = (0, _history.createBrowserHistory)({
  basename: basename
});
var buildReducer;
var initialState = _immutable.default.Map();
var buildStore = function buildStore(reducers, devOptions) {
  if (devOptions === void 0) {
    devOptions = {};
  }
  var composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__(devOptions) : _redux.compose;
  var enhancer = composeEnhancers((0, _redux.applyMiddleware)((0, _immutable2.routerMiddleware)(history), _reduxApiMiddleware.apiMiddleware, _spawnerMiddleware.spawnerMiddleware));
  var supportedLocales = SUPPORTED_LOCALES || [{
    language: "English",
    cultureIso: _localeFactory.cultureByDefault
  }];
  var localeReducer = (0, _localeFactory.default)(supportedLocales);
  exports.buildReducer = buildReducer = function buildReducer(reducers) {
    return (0, _reduxImmutable.combineReducers)(_objectSpread(_objectSpread({}, reducers), {}, {
      applications: _applications.default,
      authentication: _authentication.default,
      locale: localeReducer,
      navigation: _navigation.default,
      router: (0, _immutable2.connectRouter)(history),
      requests: _request.default,
      scopes: _scopes.default,
      scopesExtendedConfiguration: _scopesExtendedConfiguration.default,
      settings: _settings.default,
      toasts: _toasts.default,
      versionInfo: _versionInfo.default,
      view: _view.default,
      countries: _countries.default,
      timezones: _timezones.default,
      modules: _modules.default,
      metadata: _metadata.default,
      requestStates: _requestStates.default,
      tasks: _tasks.default,
      globalErrorMessages: _globalErrorMessages.default,
      scopeRouteState: _scopeRouteState.default
    }));
  };
  var rootReducer = buildReducer(reducers);
  return (0, _redux.createStore)(rootReducer, initialState, enhancer);
};
var _default = buildStore;
var _default2 = _default;
var _default3 = exports.default = _default2;
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(basename, "basename", "/home/vsts/work/1/s/src/buildStore.js");
  reactHotLoader.register(getBaseUrl, "getBaseUrl", "/home/vsts/work/1/s/src/buildStore.js");
  reactHotLoader.register(history, "history", "/home/vsts/work/1/s/src/buildStore.js");
  reactHotLoader.register(buildReducer, "buildReducer", "/home/vsts/work/1/s/src/buildStore.js");
  reactHotLoader.register(initialState, "initialState", "/home/vsts/work/1/s/src/buildStore.js");
  reactHotLoader.register(buildStore, "buildStore", "/home/vsts/work/1/s/src/buildStore.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/buildStore.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(basename, "basename", "/home/vsts/work/1/s/src/buildStore.js");
  reactHotLoader.register(getBaseUrl, "getBaseUrl", "/home/vsts/work/1/s/src/buildStore.js");
  reactHotLoader.register(history, "history", "/home/vsts/work/1/s/src/buildStore.js");
  reactHotLoader.register(buildReducer, "buildReducer", "/home/vsts/work/1/s/src/buildStore.js");
  reactHotLoader.register(initialState, "initialState", "/home/vsts/work/1/s/src/buildStore.js");
  reactHotLoader.register(buildStore, "buildStore", "/home/vsts/work/1/s/src/buildStore.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/buildStore.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();