"use strict";

exports.__esModule = true;
exports.default = void 0;

var _flatten = require("./flatten");

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

/* Replaces a locale string structure with the string for the given locale. */
var setTranslation = function setTranslation(locale, obj) {
  for (var _len = arguments.length, field = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    field[_key - 2] = arguments[_key];
  }

  if (!obj || !obj.getIn((0, _flatten.flatten)([field]))) return obj;
  var value = obj.getIn((0, _flatten.flatten)([field, locale])) || obj.getIn((0, _flatten.flatten)([field])).filter(function (i) {
    return i;
  }).first() || "";
  return obj.setIn((0, _flatten.flatten)([field]), value);
};

var _default = setTranslation;
var _default2 = _default;
var _default3 = _default2;
exports.default = _default3;
;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(setTranslation, "setTranslation", "/home/vsts/work/1/s/src/utils/setTranslation.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/utils/setTranslation.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(setTranslation, "setTranslation", "/home/vsts/work/1/s/src/utils/setTranslation.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/utils/setTranslation.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();