{"ast":null,"code":"import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { Trans, useTranslation, withTranslation } from 'react-i18next';\nimport { appWithTranslation, withInternals } from './hocs';\nimport { Link } from './components';\nimport { consoleMessage } from './utils';\nimport { createConfig } from './config/create-config';\nimport createI18NextClient from './create-i18next-client';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { wrapRouter } from './router';\nexport { withTranslation } from 'react-i18next';\n\nvar NextI18Next = function NextI18Next(userConfig) {\n  _classCallCheck(this, NextI18Next);\n\n  _defineProperty(this, \"Trans\", void 0);\n\n  _defineProperty(this, \"Link\", void 0);\n\n  _defineProperty(this, \"Router\", void 0);\n\n  _defineProperty(this, \"i18n\", void 0);\n\n  _defineProperty(this, \"initPromise\", void 0);\n\n  _defineProperty(this, \"config\", void 0);\n\n  _defineProperty(this, \"useTranslation\", void 0);\n\n  _defineProperty(this, \"withTranslation\", void 0);\n\n  _defineProperty(this, \"appWithTranslation\", void 0);\n\n  _defineProperty(this, \"consoleMessage\", void 0);\n\n  _defineProperty(this, \"withNamespaces\", void 0);\n\n  this.config = createConfig(userConfig);\n  this.consoleMessage = consoleMessage.bind(this);\n  /* Validation */\n\n  if (this.config.otherLanguages.length <= 0) {\n    throw new Error('To properly initialise a next-i18next instance you must provide one or more locale codes in config.otherLanguages.');\n  }\n\n  this.withNamespaces = function () {\n    throw new Error('next-i18next has upgraded to react-i18next v10 - please rename withNamespaces to withTranslation.');\n  };\n\n  var _createI18NextClient = createI18NextClient(this.config),\n      i18n = _createI18NextClient.i18n,\n      initPromise = _createI18NextClient.initPromise;\n\n  this.i18n = i18n;\n  this.initPromise = initPromise || Promise.resolve();\n  this.appWithTranslation = appWithTranslation.bind(this);\n\n  this.withTranslation = function (namespace, options) {\n    return function (Component) {\n      return hoistNonReactStatics(withTranslation(namespace, options)(Component), Component);\n    };\n  };\n\n  var nextI18NextInternals = {\n    config: this.config,\n    i18n: this.i18n\n  };\n  this.Link = withInternals(Link, nextI18NextInternals);\n  this.Router = wrapRouter(nextI18NextInternals);\n  /* Directly export `react-i18next` methods */\n\n  this.Trans = Trans;\n  this.useTranslation = useTranslation;\n};\n\nexport { NextI18Next as default };","map":null,"metadata":{},"sourceType":"module"}