{"version":3,"file":"context.3cb5807b.js","sources":["../../../node_modules/react-i18next/dist/es/unescape.js","../../../node_modules/react-i18next/dist/es/context.js"],"sourcesContent":["var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g;\nvar htmlEntities = {\n  '&amp;': '&',\n  '&#38;': '&',\n  '&lt;': '<',\n  '&#60;': '<',\n  '&gt;': '>',\n  '&#62;': '>',\n  '&apos;': \"'\",\n  '&#39;': \"'\",\n  '&quot;': '\"',\n  '&#34;': '\"'\n};\n\nvar unescapeHtmlEntity = function unescapeHtmlEntity(m) {\n  return htmlEntities[m];\n};\n\nexport var unescape = function unescape(text) {\n  return text.replace(matchHtmlEntity, unescapeHtmlEntity);\n};","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport { createContext } from 'react';\nimport { unescape } from './unescape';\nvar defaultOptions = {\n  bindI18n: 'languageChanged',\n  bindI18nStore: '',\n  transEmptyNodeValue: '',\n  transSupportBasicHtmlNodes: true,\n  transWrapTextNodes: '',\n  transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],\n  useSuspense: true,\n  unescape: unescape\n};\nvar i18nInstance;\nexport var I18nContext = createContext();\nexport function setDefaults() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  defaultOptions = _objectSpread(_objectSpread({}, defaultOptions), options);\n}\nexport function getDefaults() {\n  return defaultOptions;\n}\nexport var ReportNamespaces = function () {\n  function ReportNamespaces() {\n    _classCallCheck(this, ReportNamespaces);\n\n    this.usedNamespaces = {};\n  }\n\n  _createClass(ReportNamespaces, [{\n    key: \"addUsedNamespaces\",\n    value: function addUsedNamespaces(namespaces) {\n      var _this = this;\n\n      namespaces.forEach(function (ns) {\n        if (!_this.usedNamespaces[ns]) _this.usedNamespaces[ns] = true;\n      });\n    }\n  }, {\n    key: \"getUsedNamespaces\",\n    value: function getUsedNamespaces() {\n      return Object.keys(this.usedNamespaces);\n    }\n  }]);\n\n  return ReportNamespaces;\n}();\nexport function setI18n(instance) {\n  i18nInstance = instance;\n}\nexport function getI18n() {\n  return i18nInstance;\n}\nexport var initReactI18next = {\n  type: '3rdParty',\n  init: function init(instance) {\n    setDefaults(instance.options.react);\n    setI18n(instance);\n  }\n};\nexport function composeInitialProps(ForComponent) {\n  return function (ctx) {\n    return new Promise(function (resolve) {\n      var i18nInitialProps = getInitialProps();\n\n      if (ForComponent.getInitialProps) {\n        ForComponent.getInitialProps(ctx).then(function (componentsInitialProps) {\n          resolve(_objectSpread(_objectSpread({}, componentsInitialProps), i18nInitialProps));\n        });\n      } else {\n        resolve(i18nInitialProps);\n      }\n    });\n  };\n}\nexport function getInitialProps() {\n  var i18n = getI18n();\n  var namespaces = i18n.reportNamespaces ? i18n.reportNamespaces.getUsedNamespaces() : [];\n  var ret = {};\n  var initialI18nStore = {};\n  i18n.languages.forEach(function (l) {\n    initialI18nStore[l] = {};\n    namespaces.forEach(function (ns) {\n      initialI18nStore[l][ns] = i18n.getResourceBundle(l, ns) || {};\n    });\n  });\n  ret.initialI18nStore = initialI18nStore;\n  ret.initialLanguage = i18n.language;\n  return ret;\n}"],"names":["matchHtmlEntity","htmlEntities","unescapeHtmlEntity","m","unescape","text","defaultOptions","i18nInstance","I18nContext","createContext","getDefaults","ReportNamespaces","_classCallCheck","_createClass","namespaces","_this","ns","getI18n"],"mappings":"wZAAA,IAAIA,EAAkB,iDAClBC,EAAe,CACjB,QAAS,IACT,QAAS,IACT,OAAQ,IACR,QAAS,IACT,OAAQ,IACR,QAAS,IACT,SAAU,IACV,QAAS,IACT,SAAU,IACV,QAAS,GACX,EAEIC,EAAqB,SAA4BC,EAAG,CACtD,OAAOF,EAAaE,EACtB,EAEWC,EAAW,SAAkBC,EAAM,CAC5C,OAAOA,EAAK,QAAQL,EAAiBE,CAAkB,CACzD,ECVII,EAAiB,CACnB,SAAU,kBACV,cAAe,GACf,oBAAqB,GACrB,2BAA4B,GAC5B,mBAAoB,GACpB,2BAA4B,CAAC,KAAM,SAAU,IAAK,GAAG,EACrD,YAAa,GACb,SAAUF,CACZ,EACIG,EACOC,EAAcC,EAAAA,QAAAA,cAAgB,EAKlC,SAASC,GAAc,CAC5B,OAAOJ,CACT,CACU,IAACK,EAAmB,UAAY,CACxC,SAASA,GAAmB,CAC1BC,EAAgB,KAAMD,CAAgB,EAEtC,KAAK,eAAiB,EACvB,CAED,OAAAE,EAAaF,EAAkB,CAAC,CAC9B,IAAK,oBACL,MAAO,SAA2BG,EAAY,CAC5C,IAAIC,EAAQ,KAEZD,EAAW,QAAQ,SAAUE,EAAI,CAC1BD,EAAM,eAAeC,KAAKD,EAAM,eAAeC,GAAM,GAClE,CAAO,CACF,CACL,EAAK,CACD,IAAK,oBACL,MAAO,UAA6B,CAClC,OAAO,OAAO,KAAK,KAAK,cAAc,CACvC,CACF,CAAA,CAAC,EAEKL,CACT,EAAI,EAIG,SAASM,GAAU,CACxB,OAAOV,CACT"}