"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactRedux = require("react-redux");
var _reactIntl = require("react-intl");
var _locale = require("../selectors/locale");
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 _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var I18n = function I18n(props) {
  var _navigator$language;
  var locale = (0, _reactRedux.useSelector)(_locale.currentLocaleOrDefault);
  var messages = require("translations/" + locale + ".json");
  var language = (_navigator$language = navigator.language) != null ? _navigator$language : locale;
  return /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, _extends({
    key: language // TODO: Remove this when react-intl suports new React context API
    ,
    locale: language,
    messages: messages
  }, props));
};
__signature__(I18n, "useSelector{locale}", function () {
  return [_reactRedux.useSelector];
});
__signature__(I18n, "useSelector{locale}", function () {
  return [_reactRedux.useSelector];
});
var _default = I18n;
var _default2 = _default;
var _default3 = exports.default = _default2;
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(I18n, "I18n", "/home/vsts/work/1/s/src/components/I18n.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/I18n.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(I18n, "I18n", "/home/vsts/work/1/s/src/components/I18n.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/I18n.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();