locize 2.4.6 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (902) hide show
  1. package/.babelrc +3 -0
  2. package/.ts.eslintrc +37 -0
  3. package/CHANGELOG.md +5 -0
  4. package/README.md +10 -19
  5. package/dist/cjs/api/handleCommitKey.js +17 -0
  6. package/dist/cjs/api/handleCommitKeys.js +39 -0
  7. package/dist/cjs/api/handleConfirmInitialized.js +11 -0
  8. package/dist/cjs/api/handleEditKey.js +60 -0
  9. package/dist/cjs/api/handleIsLocizeEnabled.js +11 -0
  10. package/dist/cjs/api/handleRequestPopupChanges.js +21 -0
  11. package/dist/cjs/api/handleRequestResourceBundle.js +27 -0
  12. package/dist/cjs/api/handleSelectedKeys.js +27 -0
  13. package/dist/cjs/api/handleTurnOff.js +8 -0
  14. package/dist/cjs/api/handleTurnOn.js +8 -0
  15. package/dist/cjs/api/postMessage.js +161 -0
  16. package/dist/cjs/clickHandler.js +48 -0
  17. package/dist/cjs/index.d.ts +15 -0
  18. package/dist/cjs/index.js +55 -0
  19. package/dist/cjs/locizePlugin.js +110 -0
  20. package/dist/cjs/observer.js +74 -0
  21. package/dist/cjs/package.json +1 -0
  22. package/dist/cjs/parser.js +122 -0
  23. package/dist/cjs/process.js +63 -0
  24. package/dist/cjs/processLegacy.js +80 -0
  25. package/dist/cjs/shims/uniqueID.js +31 -0
  26. package/dist/cjs/startStandalone.js +24 -0
  27. package/dist/cjs/store.js +49 -0
  28. package/dist/cjs/ui/elements/icons.js +48 -0
  29. package/dist/cjs/ui/elements/popup.js +80 -0
  30. package/dist/cjs/ui/elements/ribbonBox.js +67 -0
  31. package/dist/cjs/ui/highlightNode.js +167 -0
  32. package/dist/cjs/ui/mouseDistance.js +44 -0
  33. package/dist/cjs/ui/popup.js +113 -0
  34. package/dist/cjs/ui/stylesheet.js +12 -0
  35. package/dist/cjs/ui/utils.js +39 -0
  36. package/dist/cjs/uninstrumentedStore.js +43 -0
  37. package/dist/cjs/utils.js +138 -0
  38. package/dist/cjs/vars.js +22 -0
  39. package/dist/esm/api/handleCommitKey.js +15 -0
  40. package/dist/esm/api/handleCommitKeys.js +33 -0
  41. package/dist/esm/api/handleConfirmInitialized.js +9 -0
  42. package/dist/esm/api/handleEditKey.js +56 -0
  43. package/dist/esm/api/handleIsLocizeEnabled.js +9 -0
  44. package/dist/esm/api/handleRequestPopupChanges.js +19 -0
  45. package/dist/esm/api/handleRequestResourceBundle.js +20 -0
  46. package/dist/esm/api/handleSelectedKeys.js +25 -0
  47. package/dist/esm/api/handleTurnOff.js +6 -0
  48. package/dist/esm/api/handleTurnOn.js +6 -0
  49. package/dist/esm/api/postMessage.js +148 -0
  50. package/dist/esm/clickHandler.js +44 -0
  51. package/dist/esm/index.d.mts +1 -0
  52. package/dist/esm/index.d.ts +15 -0
  53. package/dist/esm/index.js +33 -0
  54. package/dist/esm/locizePlugin.js +99 -0
  55. package/dist/esm/observer.js +70 -0
  56. package/dist/esm/parser.js +113 -0
  57. package/dist/esm/process.js +55 -0
  58. package/dist/esm/processLegacy.js +72 -0
  59. package/dist/esm/shims/uniqueID.js +29 -0
  60. package/dist/esm/startStandalone.js +20 -0
  61. package/dist/esm/store.js +41 -0
  62. package/dist/esm/ui/elements/icons.js +39 -0
  63. package/dist/esm/ui/elements/popup.js +76 -0
  64. package/dist/esm/ui/elements/ribbonBox.js +62 -0
  65. package/dist/esm/ui/highlightNode.js +156 -0
  66. package/dist/esm/ui/mouseDistance.js +39 -0
  67. package/dist/esm/ui/popup.js +108 -0
  68. package/dist/esm/ui/stylesheet.js +8 -0
  69. package/dist/esm/ui/utils.js +34 -0
  70. package/dist/esm/uninstrumentedStore.js +35 -0
  71. package/dist/esm/utils.js +123 -0
  72. package/dist/esm/vars.js +16 -0
  73. package/dist/umd/locize.js +2790 -286
  74. package/dist/umd/locize.min.js +1 -1
  75. package/index.d.mts +1 -0
  76. package/index.d.ts +5 -6
  77. package/locize.js +2790 -286
  78. package/locize.min.js +1 -1
  79. package/package.json +64 -31
  80. package/rollup.config.js +62 -29
  81. package/src/api/handleCommitKey.js +17 -0
  82. package/src/api/handleCommitKeys.js +39 -0
  83. package/src/api/handleConfirmInitialized.js +10 -0
  84. package/src/api/handleEditKey.js +81 -0
  85. package/src/api/handleIsLocizeEnabled.js +13 -0
  86. package/src/api/handleRequestPopupChanges.js +25 -0
  87. package/src/api/handleRequestResourceBundle.js +11 -0
  88. package/src/api/handleSelectedKeys.js +32 -0
  89. package/src/api/handleTurnOff.js +8 -0
  90. package/src/api/handleTurnOn.js +8 -0
  91. package/src/api/index.js +19 -0
  92. package/src/api/postMessage.js +169 -0
  93. package/src/clickHandler.js +48 -0
  94. package/src/index.js +30 -0
  95. package/src/locizePlugin.js +117 -0
  96. package/src/observer.js +93 -0
  97. package/src/parser.js +162 -0
  98. package/src/process.js +55 -0
  99. package/src/processLegacy.js +69 -0
  100. package/src/shims/uniqueID.js +49 -0
  101. package/src/startStandalone.js +19 -0
  102. package/src/store.js +47 -0
  103. package/src/ui/elements/icons.js +92 -0
  104. package/src/ui/elements/popup.js +226 -0
  105. package/src/ui/elements/ribbonBox.js +76 -0
  106. package/src/ui/highlightNode.js +203 -0
  107. package/src/ui/mouseDistance.js +46 -0
  108. package/src/ui/popup.js +135 -0
  109. package/src/ui/stylesheet.js +8 -0
  110. package/src/ui/utils.js +37 -0
  111. package/src/uninstrumentedStore.js +39 -0
  112. package/src/utils.js +158 -0
  113. package/src/vars.js +18 -0
  114. package/tsconfig.json +4 -4
  115. package/.eslintrc.js +0 -20
  116. package/debuggingApp/README.md +0 -11
  117. package/debuggingApp/debugEditor.html +0 -28
  118. package/debuggingApp/index.html +0 -151
  119. package/debuggingApp/node_modules/.package-lock.json +0 -668
  120. package/debuggingApp/node_modules/@babel/runtime/LICENSE +0 -22
  121. package/debuggingApp/node_modules/@babel/runtime/README.md +0 -19
  122. package/debuggingApp/node_modules/@babel/runtime/helpers/AsyncGenerator.js +0 -98
  123. package/debuggingApp/node_modules/@babel/runtime/helpers/AwaitValue.js +0 -5
  124. package/debuggingApp/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js +0 -30
  125. package/debuggingApp/node_modules/@babel/runtime/helpers/applyDecs.js +0 -284
  126. package/debuggingApp/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +0 -11
  127. package/debuggingApp/node_modules/@babel/runtime/helpers/arrayWithHoles.js +0 -5
  128. package/debuggingApp/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +0 -7
  129. package/debuggingApp/node_modules/@babel/runtime/helpers/assertThisInitialized.js +0 -9
  130. package/debuggingApp/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js +0 -56
  131. package/debuggingApp/node_modules/@babel/runtime/helpers/asyncIterator.js +0 -50
  132. package/debuggingApp/node_modules/@babel/runtime/helpers/asyncToGenerator.js +0 -37
  133. package/debuggingApp/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js +0 -7
  134. package/debuggingApp/node_modules/@babel/runtime/helpers/checkPrivateRedeclaration.js +0 -7
  135. package/debuggingApp/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js +0 -22
  136. package/debuggingApp/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js +0 -9
  137. package/debuggingApp/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js +0 -13
  138. package/debuggingApp/node_modules/@babel/runtime/helpers/classCallCheck.js +0 -7
  139. package/debuggingApp/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js +0 -7
  140. package/debuggingApp/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js +0 -7
  141. package/debuggingApp/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js +0 -9
  142. package/debuggingApp/node_modules/@babel/runtime/helpers/classNameTDZError.js +0 -5
  143. package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js +0 -10
  144. package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js +0 -10
  145. package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateFieldInitSpec.js +0 -8
  146. package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js +0 -9
  147. package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js +0 -7
  148. package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js +0 -11
  149. package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js +0 -9
  150. package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateMethodInitSpec.js +0 -8
  151. package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js +0 -5
  152. package/debuggingApp/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js +0 -13
  153. package/debuggingApp/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js +0 -13
  154. package/debuggingApp/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js +0 -14
  155. package/debuggingApp/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js +0 -8
  156. package/debuggingApp/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js +0 -5
  157. package/debuggingApp/node_modules/@babel/runtime/helpers/construct.js +0 -22
  158. package/debuggingApp/node_modules/@babel/runtime/helpers/createClass.js +0 -20
  159. package/debuggingApp/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js +0 -60
  160. package/debuggingApp/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js +0 -24
  161. package/debuggingApp/node_modules/@babel/runtime/helpers/createSuper.js +0 -24
  162. package/debuggingApp/node_modules/@babel/runtime/helpers/decorate.js +0 -400
  163. package/debuggingApp/node_modules/@babel/runtime/helpers/defaults.js +0 -16
  164. package/debuggingApp/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js +0 -24
  165. package/debuggingApp/node_modules/@babel/runtime/helpers/defineProperty.js +0 -16
  166. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/AsyncGenerator.js +0 -95
  167. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/AwaitValue.js +0 -3
  168. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js +0 -28
  169. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/applyDecs.js +0 -282
  170. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +0 -9
  171. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +0 -3
  172. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +0 -4
  173. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +0 -7
  174. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js +0 -54
  175. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/asyncIterator.js +0 -48
  176. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +0 -35
  177. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js +0 -4
  178. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js +0 -5
  179. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js +0 -20
  180. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js +0 -7
  181. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js +0 -11
  182. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +0 -5
  183. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js +0 -5
  184. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +0 -5
  185. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js +0 -7
  186. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js +0 -3
  187. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js +0 -6
  188. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js +0 -6
  189. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js +0 -5
  190. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js +0 -7
  191. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js +0 -4
  192. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js +0 -7
  193. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js +0 -7
  194. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js +0 -5
  195. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js +0 -3
  196. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js +0 -8
  197. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js +0 -8
  198. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js +0 -9
  199. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js +0 -5
  200. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js +0 -3
  201. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/construct.js +0 -18
  202. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/createClass.js +0 -18
  203. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js +0 -57
  204. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js +0 -21
  205. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/createSuper.js +0 -19
  206. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/decorate.js +0 -396
  207. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/defaults.js +0 -14
  208. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js +0 -22
  209. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -14
  210. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/extends.js +0 -16
  211. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/get.js +0 -20
  212. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +0 -6
  213. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/identity.js +0 -3
  214. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/inherits.js +0 -18
  215. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +0 -6
  216. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js +0 -9
  217. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js +0 -3
  218. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/instanceof.js +0 -7
  219. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js +0 -5
  220. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js +0 -51
  221. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js +0 -3
  222. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +0 -12
  223. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +0 -3
  224. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +0 -29
  225. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js +0 -14
  226. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/jsx.js +0 -26
  227. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js +0 -9
  228. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js +0 -5
  229. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +0 -3
  230. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +0 -3
  231. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js +0 -3
  232. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/objectSpread.js +0 -19
  233. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +0 -27
  234. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +0 -19
  235. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -14
  236. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/package.json +0 -3
  237. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +0 -11
  238. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/readOnlyError.js +0 -3
  239. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +0 -352
  240. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/set.js +0 -51
  241. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -7
  242. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js +0 -7
  243. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +0 -7
  244. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/slicedToArrayLoose.js +0 -7
  245. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/superPropBase.js +0 -9
  246. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +0 -11
  247. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js +0 -8
  248. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/tdz.js +0 -3
  249. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/temporalRef.js +0 -5
  250. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js +0 -1
  251. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/toArray.js +0 -7
  252. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +0 -7
  253. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -13
  254. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -6
  255. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -9
  256. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +0 -9
  257. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js +0 -6
  258. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +0 -37
  259. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +0 -50
  260. package/debuggingApp/node_modules/@babel/runtime/helpers/esm/writeOnlyError.js +0 -3
  261. package/debuggingApp/node_modules/@babel/runtime/helpers/extends.js +0 -18
  262. package/debuggingApp/node_modules/@babel/runtime/helpers/get.js +0 -23
  263. package/debuggingApp/node_modules/@babel/runtime/helpers/getPrototypeOf.js +0 -8
  264. package/debuggingApp/node_modules/@babel/runtime/helpers/identity.js +0 -5
  265. package/debuggingApp/node_modules/@babel/runtime/helpers/inherits.js +0 -21
  266. package/debuggingApp/node_modules/@babel/runtime/helpers/inheritsLoose.js +0 -9
  267. package/debuggingApp/node_modules/@babel/runtime/helpers/initializerDefineProperty.js +0 -11
  268. package/debuggingApp/node_modules/@babel/runtime/helpers/initializerWarningHelper.js +0 -5
  269. package/debuggingApp/node_modules/@babel/runtime/helpers/instanceof.js +0 -9
  270. package/debuggingApp/node_modules/@babel/runtime/helpers/interopRequireDefault.js +0 -7
  271. package/debuggingApp/node_modules/@babel/runtime/helpers/interopRequireWildcard.js +0 -53
  272. package/debuggingApp/node_modules/@babel/runtime/helpers/isNativeFunction.js +0 -5
  273. package/debuggingApp/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js +0 -14
  274. package/debuggingApp/node_modules/@babel/runtime/helpers/iterableToArray.js +0 -5
  275. package/debuggingApp/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +0 -31
  276. package/debuggingApp/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js +0 -16
  277. package/debuggingApp/node_modules/@babel/runtime/helpers/jsx.js +0 -29
  278. package/debuggingApp/node_modules/@babel/runtime/helpers/maybeArrayLike.js +0 -12
  279. package/debuggingApp/node_modules/@babel/runtime/helpers/newArrowCheck.js +0 -7
  280. package/debuggingApp/node_modules/@babel/runtime/helpers/nonIterableRest.js +0 -5
  281. package/debuggingApp/node_modules/@babel/runtime/helpers/nonIterableSpread.js +0 -5
  282. package/debuggingApp/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js +0 -5
  283. package/debuggingApp/node_modules/@babel/runtime/helpers/objectSpread.js +0 -22
  284. package/debuggingApp/node_modules/@babel/runtime/helpers/objectSpread2.js +0 -29
  285. package/debuggingApp/node_modules/@babel/runtime/helpers/objectWithoutProperties.js +0 -22
  286. package/debuggingApp/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +0 -16
  287. package/debuggingApp/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js +0 -15
  288. package/debuggingApp/node_modules/@babel/runtime/helpers/readOnlyError.js +0 -5
  289. package/debuggingApp/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +0 -354
  290. package/debuggingApp/node_modules/@babel/runtime/helpers/set.js +0 -54
  291. package/debuggingApp/node_modules/@babel/runtime/helpers/setPrototypeOf.js +0 -9
  292. package/debuggingApp/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js +0 -9
  293. package/debuggingApp/node_modules/@babel/runtime/helpers/slicedToArray.js +0 -13
  294. package/debuggingApp/node_modules/@babel/runtime/helpers/slicedToArrayLoose.js +0 -13
  295. package/debuggingApp/node_modules/@babel/runtime/helpers/superPropBase.js +0 -12
  296. package/debuggingApp/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js +0 -13
  297. package/debuggingApp/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js +0 -10
  298. package/debuggingApp/node_modules/@babel/runtime/helpers/tdz.js +0 -5
  299. package/debuggingApp/node_modules/@babel/runtime/helpers/temporalRef.js +0 -9
  300. package/debuggingApp/node_modules/@babel/runtime/helpers/temporalUndefined.js +0 -3
  301. package/debuggingApp/node_modules/@babel/runtime/helpers/toArray.js +0 -13
  302. package/debuggingApp/node_modules/@babel/runtime/helpers/toConsumableArray.js +0 -13
  303. package/debuggingApp/node_modules/@babel/runtime/helpers/toPrimitive.js +0 -16
  304. package/debuggingApp/node_modules/@babel/runtime/helpers/toPropertyKey.js +0 -10
  305. package/debuggingApp/node_modules/@babel/runtime/helpers/typeof.js +0 -11
  306. package/debuggingApp/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +0 -12
  307. package/debuggingApp/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js +0 -9
  308. package/debuggingApp/node_modules/@babel/runtime/helpers/wrapNativeSuper.js +0 -42
  309. package/debuggingApp/node_modules/@babel/runtime/helpers/wrapRegExp.js +0 -55
  310. package/debuggingApp/node_modules/@babel/runtime/helpers/writeOnlyError.js +0 -5
  311. package/debuggingApp/node_modules/@babel/runtime/package.json +0 -876
  312. package/debuggingApp/node_modules/@babel/runtime/regenerator/index.js +0 -15
  313. package/debuggingApp/node_modules/accepts/HISTORY.md +0 -243
  314. package/debuggingApp/node_modules/accepts/LICENSE +0 -23
  315. package/debuggingApp/node_modules/accepts/README.md +0 -140
  316. package/debuggingApp/node_modules/accepts/index.js +0 -238
  317. package/debuggingApp/node_modules/accepts/package.json +0 -47
  318. package/debuggingApp/node_modules/array-flatten/LICENSE +0 -21
  319. package/debuggingApp/node_modules/array-flatten/README.md +0 -43
  320. package/debuggingApp/node_modules/array-flatten/array-flatten.js +0 -64
  321. package/debuggingApp/node_modules/array-flatten/package.json +0 -39
  322. package/debuggingApp/node_modules/body-parser/HISTORY.md +0 -651
  323. package/debuggingApp/node_modules/body-parser/LICENSE +0 -23
  324. package/debuggingApp/node_modules/body-parser/README.md +0 -464
  325. package/debuggingApp/node_modules/body-parser/SECURITY.md +0 -25
  326. package/debuggingApp/node_modules/body-parser/index.js +0 -157
  327. package/debuggingApp/node_modules/body-parser/lib/read.js +0 -205
  328. package/debuggingApp/node_modules/body-parser/lib/types/json.js +0 -236
  329. package/debuggingApp/node_modules/body-parser/lib/types/raw.js +0 -101
  330. package/debuggingApp/node_modules/body-parser/lib/types/text.js +0 -121
  331. package/debuggingApp/node_modules/body-parser/lib/types/urlencoded.js +0 -284
  332. package/debuggingApp/node_modules/body-parser/package.json +0 -56
  333. package/debuggingApp/node_modules/bytes/History.md +0 -97
  334. package/debuggingApp/node_modules/bytes/LICENSE +0 -23
  335. package/debuggingApp/node_modules/bytes/Readme.md +0 -152
  336. package/debuggingApp/node_modules/bytes/index.js +0 -170
  337. package/debuggingApp/node_modules/bytes/package.json +0 -42
  338. package/debuggingApp/node_modules/call-bind/.github/FUNDING.yml +0 -12
  339. package/debuggingApp/node_modules/call-bind/.nycrc +0 -13
  340. package/debuggingApp/node_modules/call-bind/CHANGELOG.md +0 -42
  341. package/debuggingApp/node_modules/call-bind/LICENSE +0 -21
  342. package/debuggingApp/node_modules/call-bind/README.md +0 -2
  343. package/debuggingApp/node_modules/call-bind/callBound.js +0 -15
  344. package/debuggingApp/node_modules/call-bind/index.js +0 -47
  345. package/debuggingApp/node_modules/call-bind/package.json +0 -80
  346. package/debuggingApp/node_modules/call-bind/test/callBound.js +0 -55
  347. package/debuggingApp/node_modules/call-bind/test/index.js +0 -66
  348. package/debuggingApp/node_modules/content-disposition/HISTORY.md +0 -60
  349. package/debuggingApp/node_modules/content-disposition/LICENSE +0 -22
  350. package/debuggingApp/node_modules/content-disposition/README.md +0 -142
  351. package/debuggingApp/node_modules/content-disposition/index.js +0 -458
  352. package/debuggingApp/node_modules/content-disposition/package.json +0 -44
  353. package/debuggingApp/node_modules/content-type/HISTORY.md +0 -24
  354. package/debuggingApp/node_modules/content-type/LICENSE +0 -22
  355. package/debuggingApp/node_modules/content-type/README.md +0 -92
  356. package/debuggingApp/node_modules/content-type/index.js +0 -222
  357. package/debuggingApp/node_modules/content-type/package.json +0 -40
  358. package/debuggingApp/node_modules/cookie/HISTORY.md +0 -142
  359. package/debuggingApp/node_modules/cookie/LICENSE +0 -24
  360. package/debuggingApp/node_modules/cookie/README.md +0 -302
  361. package/debuggingApp/node_modules/cookie/SECURITY.md +0 -25
  362. package/debuggingApp/node_modules/cookie/index.js +0 -270
  363. package/debuggingApp/node_modules/cookie/package.json +0 -44
  364. package/debuggingApp/node_modules/cookie-signature/History.md +0 -38
  365. package/debuggingApp/node_modules/cookie-signature/Readme.md +0 -42
  366. package/debuggingApp/node_modules/cookie-signature/index.js +0 -51
  367. package/debuggingApp/node_modules/cookie-signature/package.json +0 -18
  368. package/debuggingApp/node_modules/cookies/History.md +0 -62
  369. package/debuggingApp/node_modules/cookies/LICENSE.txt +0 -22
  370. package/debuggingApp/node_modules/cookies/README.md +0 -121
  371. package/debuggingApp/node_modules/cookies/lib/cookies.js +0 -181
  372. package/debuggingApp/node_modules/cookies/package.json +0 -24
  373. package/debuggingApp/node_modules/debug/.coveralls.yml +0 -1
  374. package/debuggingApp/node_modules/debug/.travis.yml +0 -14
  375. package/debuggingApp/node_modules/debug/CHANGELOG.md +0 -362
  376. package/debuggingApp/node_modules/debug/LICENSE +0 -19
  377. package/debuggingApp/node_modules/debug/Makefile +0 -50
  378. package/debuggingApp/node_modules/debug/README.md +0 -312
  379. package/debuggingApp/node_modules/debug/component.json +0 -19
  380. package/debuggingApp/node_modules/debug/node.js +0 -1
  381. package/debuggingApp/node_modules/debug/package.json +0 -49
  382. package/debuggingApp/node_modules/debug/src/browser.js +0 -185
  383. package/debuggingApp/node_modules/debug/src/debug.js +0 -202
  384. package/debuggingApp/node_modules/debug/src/index.js +0 -10
  385. package/debuggingApp/node_modules/debug/src/inspector-log.js +0 -15
  386. package/debuggingApp/node_modules/debug/src/node.js +0 -248
  387. package/debuggingApp/node_modules/depd/History.md +0 -103
  388. package/debuggingApp/node_modules/depd/LICENSE +0 -22
  389. package/debuggingApp/node_modules/depd/Readme.md +0 -280
  390. package/debuggingApp/node_modules/depd/index.js +0 -538
  391. package/debuggingApp/node_modules/depd/lib/browser/index.js +0 -77
  392. package/debuggingApp/node_modules/depd/package.json +0 -45
  393. package/debuggingApp/node_modules/destroy/LICENSE +0 -23
  394. package/debuggingApp/node_modules/destroy/README.md +0 -63
  395. package/debuggingApp/node_modules/destroy/index.js +0 -209
  396. package/debuggingApp/node_modules/destroy/package.json +0 -48
  397. package/debuggingApp/node_modules/ee-first/LICENSE +0 -22
  398. package/debuggingApp/node_modules/ee-first/README.md +0 -80
  399. package/debuggingApp/node_modules/ee-first/index.js +0 -95
  400. package/debuggingApp/node_modules/ee-first/package.json +0 -29
  401. package/debuggingApp/node_modules/encodeurl/HISTORY.md +0 -14
  402. package/debuggingApp/node_modules/encodeurl/LICENSE +0 -22
  403. package/debuggingApp/node_modules/encodeurl/README.md +0 -128
  404. package/debuggingApp/node_modules/encodeurl/index.js +0 -60
  405. package/debuggingApp/node_modules/encodeurl/package.json +0 -40
  406. package/debuggingApp/node_modules/escape-html/LICENSE +0 -24
  407. package/debuggingApp/node_modules/escape-html/Readme.md +0 -43
  408. package/debuggingApp/node_modules/escape-html/index.js +0 -78
  409. package/debuggingApp/node_modules/escape-html/package.json +0 -24
  410. package/debuggingApp/node_modules/etag/HISTORY.md +0 -83
  411. package/debuggingApp/node_modules/etag/LICENSE +0 -22
  412. package/debuggingApp/node_modules/etag/README.md +0 -159
  413. package/debuggingApp/node_modules/etag/index.js +0 -131
  414. package/debuggingApp/node_modules/etag/package.json +0 -47
  415. package/debuggingApp/node_modules/express/History.md +0 -3579
  416. package/debuggingApp/node_modules/express/LICENSE +0 -24
  417. package/debuggingApp/node_modules/express/Readme.md +0 -166
  418. package/debuggingApp/node_modules/express/index.js +0 -11
  419. package/debuggingApp/node_modules/express/lib/application.js +0 -661
  420. package/debuggingApp/node_modules/express/lib/express.js +0 -116
  421. package/debuggingApp/node_modules/express/lib/middleware/init.js +0 -43
  422. package/debuggingApp/node_modules/express/lib/middleware/query.js +0 -47
  423. package/debuggingApp/node_modules/express/lib/request.js +0 -525
  424. package/debuggingApp/node_modules/express/lib/response.js +0 -1169
  425. package/debuggingApp/node_modules/express/lib/router/index.js +0 -673
  426. package/debuggingApp/node_modules/express/lib/router/layer.js +0 -181
  427. package/debuggingApp/node_modules/express/lib/router/route.js +0 -225
  428. package/debuggingApp/node_modules/express/lib/utils.js +0 -304
  429. package/debuggingApp/node_modules/express/lib/view.js +0 -182
  430. package/debuggingApp/node_modules/express/package.json +0 -99
  431. package/debuggingApp/node_modules/finalhandler/HISTORY.md +0 -195
  432. package/debuggingApp/node_modules/finalhandler/LICENSE +0 -22
  433. package/debuggingApp/node_modules/finalhandler/README.md +0 -147
  434. package/debuggingApp/node_modules/finalhandler/SECURITY.md +0 -25
  435. package/debuggingApp/node_modules/finalhandler/index.js +0 -336
  436. package/debuggingApp/node_modules/finalhandler/package.json +0 -46
  437. package/debuggingApp/node_modules/forwarded/HISTORY.md +0 -21
  438. package/debuggingApp/node_modules/forwarded/LICENSE +0 -22
  439. package/debuggingApp/node_modules/forwarded/README.md +0 -57
  440. package/debuggingApp/node_modules/forwarded/index.js +0 -90
  441. package/debuggingApp/node_modules/forwarded/package.json +0 -45
  442. package/debuggingApp/node_modules/fresh/HISTORY.md +0 -70
  443. package/debuggingApp/node_modules/fresh/LICENSE +0 -23
  444. package/debuggingApp/node_modules/fresh/README.md +0 -119
  445. package/debuggingApp/node_modules/fresh/index.js +0 -137
  446. package/debuggingApp/node_modules/fresh/package.json +0 -46
  447. package/debuggingApp/node_modules/function-bind/.jscs.json +0 -176
  448. package/debuggingApp/node_modules/function-bind/.travis.yml +0 -168
  449. package/debuggingApp/node_modules/function-bind/LICENSE +0 -20
  450. package/debuggingApp/node_modules/function-bind/README.md +0 -48
  451. package/debuggingApp/node_modules/function-bind/implementation.js +0 -52
  452. package/debuggingApp/node_modules/function-bind/index.js +0 -5
  453. package/debuggingApp/node_modules/function-bind/package.json +0 -63
  454. package/debuggingApp/node_modules/function-bind/test/index.js +0 -252
  455. package/debuggingApp/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
  456. package/debuggingApp/node_modules/get-intrinsic/.nycrc +0 -9
  457. package/debuggingApp/node_modules/get-intrinsic/CHANGELOG.md +0 -91
  458. package/debuggingApp/node_modules/get-intrinsic/LICENSE +0 -21
  459. package/debuggingApp/node_modules/get-intrinsic/README.md +0 -71
  460. package/debuggingApp/node_modules/get-intrinsic/index.js +0 -334
  461. package/debuggingApp/node_modules/get-intrinsic/package.json +0 -88
  462. package/debuggingApp/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
  463. package/debuggingApp/node_modules/has/LICENSE-MIT +0 -22
  464. package/debuggingApp/node_modules/has/README.md +0 -18
  465. package/debuggingApp/node_modules/has/package.json +0 -48
  466. package/debuggingApp/node_modules/has/src/index.js +0 -5
  467. package/debuggingApp/node_modules/has/test/index.js +0 -10
  468. package/debuggingApp/node_modules/has-symbols/.github/FUNDING.yml +0 -12
  469. package/debuggingApp/node_modules/has-symbols/.nycrc +0 -9
  470. package/debuggingApp/node_modules/has-symbols/CHANGELOG.md +0 -75
  471. package/debuggingApp/node_modules/has-symbols/LICENSE +0 -21
  472. package/debuggingApp/node_modules/has-symbols/README.md +0 -46
  473. package/debuggingApp/node_modules/has-symbols/index.js +0 -13
  474. package/debuggingApp/node_modules/has-symbols/package.json +0 -101
  475. package/debuggingApp/node_modules/has-symbols/shams.js +0 -42
  476. package/debuggingApp/node_modules/has-symbols/test/index.js +0 -22
  477. package/debuggingApp/node_modules/has-symbols/test/shams/core-js.js +0 -28
  478. package/debuggingApp/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -28
  479. package/debuggingApp/node_modules/has-symbols/test/tests.js +0 -56
  480. package/debuggingApp/node_modules/http-errors/HISTORY.md +0 -180
  481. package/debuggingApp/node_modules/http-errors/LICENSE +0 -23
  482. package/debuggingApp/node_modules/http-errors/README.md +0 -169
  483. package/debuggingApp/node_modules/http-errors/index.js +0 -289
  484. package/debuggingApp/node_modules/http-errors/package.json +0 -50
  485. package/debuggingApp/node_modules/i18next/CONTRIBUTING.md +0 -22
  486. package/debuggingApp/node_modules/i18next/LICENSE +0 -21
  487. package/debuggingApp/node_modules/i18next/README.md +0 -60
  488. package/debuggingApp/node_modules/i18next/dist/cjs/i18next.js +0 -2801
  489. package/debuggingApp/node_modules/i18next/dist/esm/i18next.bundled.js +0 -2954
  490. package/debuggingApp/node_modules/i18next/dist/esm/i18next.js +0 -2802
  491. package/debuggingApp/node_modules/i18next/dist/esm/package.json +0 -1
  492. package/debuggingApp/node_modules/i18next/dist/umd/i18next.js +0 -2922
  493. package/debuggingApp/node_modules/i18next/dist/umd/i18next.min.js +0 -1
  494. package/debuggingApp/node_modules/i18next/i18next.js +0 -2922
  495. package/debuggingApp/node_modules/i18next/i18next.min.js +0 -1
  496. package/debuggingApp/node_modules/i18next/index.d.ts +0 -1257
  497. package/debuggingApp/node_modules/i18next/index.js +0 -5
  498. package/debuggingApp/node_modules/i18next/package.json +0 -126
  499. package/debuggingApp/node_modules/i18next-express-middleware/LICENSE +0 -22
  500. package/debuggingApp/node_modules/i18next-express-middleware/README.md +0 -167
  501. package/debuggingApp/node_modules/i18next-express-middleware/lib/LanguageDetector.js +0 -138
  502. package/debuggingApp/node_modules/i18next-express-middleware/lib/index.js +0 -152
  503. package/debuggingApp/node_modules/i18next-express-middleware/lib/languageLookups/cookie.js +0 -47
  504. package/debuggingApp/node_modules/i18next-express-middleware/lib/languageLookups/header.js +0 -59
  505. package/debuggingApp/node_modules/i18next-express-middleware/lib/languageLookups/path.js +0 -27
  506. package/debuggingApp/node_modules/i18next-express-middleware/lib/languageLookups/querystring.js +0 -31
  507. package/debuggingApp/node_modules/i18next-express-middleware/lib/languageLookups/session.js +0 -27
  508. package/debuggingApp/node_modules/i18next-express-middleware/lib/utils.js +0 -70
  509. package/debuggingApp/node_modules/i18next-express-middleware/package.json +0 -43
  510. package/debuggingApp/node_modules/i18next-node-fs-backend/LICENSE +0 -22
  511. package/debuggingApp/node_modules/i18next-node-fs-backend/README.md +0 -72
  512. package/debuggingApp/node_modules/i18next-node-fs-backend/lib/index.js +0 -162
  513. package/debuggingApp/node_modules/i18next-node-fs-backend/lib/utils.js +0 -78
  514. package/debuggingApp/node_modules/i18next-node-fs-backend/package.json +0 -43
  515. package/debuggingApp/node_modules/iconv-lite/Changelog.md +0 -162
  516. package/debuggingApp/node_modules/iconv-lite/LICENSE +0 -21
  517. package/debuggingApp/node_modules/iconv-lite/README.md +0 -156
  518. package/debuggingApp/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -555
  519. package/debuggingApp/node_modules/iconv-lite/encodings/dbcs-data.js +0 -176
  520. package/debuggingApp/node_modules/iconv-lite/encodings/index.js +0 -22
  521. package/debuggingApp/node_modules/iconv-lite/encodings/internal.js +0 -188
  522. package/debuggingApp/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
  523. package/debuggingApp/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
  524. package/debuggingApp/node_modules/iconv-lite/encodings/sbcs-data.js +0 -174
  525. package/debuggingApp/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
  526. package/debuggingApp/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
  527. package/debuggingApp/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
  528. package/debuggingApp/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
  529. package/debuggingApp/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
  530. package/debuggingApp/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
  531. package/debuggingApp/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -55
  532. package/debuggingApp/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
  533. package/debuggingApp/node_modules/iconv-lite/encodings/utf16.js +0 -177
  534. package/debuggingApp/node_modules/iconv-lite/encodings/utf7.js +0 -290
  535. package/debuggingApp/node_modules/iconv-lite/lib/bom-handling.js +0 -52
  536. package/debuggingApp/node_modules/iconv-lite/lib/extend-node.js +0 -217
  537. package/debuggingApp/node_modules/iconv-lite/lib/index.d.ts +0 -24
  538. package/debuggingApp/node_modules/iconv-lite/lib/index.js +0 -153
  539. package/debuggingApp/node_modules/iconv-lite/lib/streams.js +0 -121
  540. package/debuggingApp/node_modules/iconv-lite/package.json +0 -46
  541. package/debuggingApp/node_modules/inherits/LICENSE +0 -16
  542. package/debuggingApp/node_modules/inherits/README.md +0 -42
  543. package/debuggingApp/node_modules/inherits/inherits.js +0 -9
  544. package/debuggingApp/node_modules/inherits/inherits_browser.js +0 -27
  545. package/debuggingApp/node_modules/inherits/package.json +0 -29
  546. package/debuggingApp/node_modules/ipaddr.js/LICENSE +0 -19
  547. package/debuggingApp/node_modules/ipaddr.js/README.md +0 -233
  548. package/debuggingApp/node_modules/ipaddr.js/ipaddr.min.js +0 -1
  549. package/debuggingApp/node_modules/ipaddr.js/lib/ipaddr.js +0 -673
  550. package/debuggingApp/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +0 -68
  551. package/debuggingApp/node_modules/ipaddr.js/package.json +0 -35
  552. package/debuggingApp/node_modules/json5/.travis.yml +0 -5
  553. package/debuggingApp/node_modules/json5/CHANGELOG.md +0 -144
  554. package/debuggingApp/node_modules/json5/README.md +0 -271
  555. package/debuggingApp/node_modules/json5/lib/cli.js +0 -41
  556. package/debuggingApp/node_modules/json5/lib/json5.js +0 -754
  557. package/debuggingApp/node_modules/json5/lib/require.js +0 -18
  558. package/debuggingApp/node_modules/json5/package.json +0 -30
  559. package/debuggingApp/node_modules/json5/package.json5 +0 -30
  560. package/debuggingApp/node_modules/json5/test/parse-cases/arrays/empty-array.json +0 -1
  561. package/debuggingApp/node_modules/json5/test/parse-cases/arrays/leading-comma-array.js +0 -3
  562. package/debuggingApp/node_modules/json5/test/parse-cases/arrays/lone-trailing-comma-array.js +0 -3
  563. package/debuggingApp/node_modules/json5/test/parse-cases/arrays/no-comma-array.txt +0 -4
  564. package/debuggingApp/node_modules/json5/test/parse-cases/arrays/regular-array.json +0 -5
  565. package/debuggingApp/node_modules/json5/test/parse-cases/arrays/trailing-comma-array.json5 +0 -3
  566. package/debuggingApp/node_modules/json5/test/parse-cases/comments/block-comment-following-array-element.json5 +0 -6
  567. package/debuggingApp/node_modules/json5/test/parse-cases/comments/block-comment-following-top-level-value.json5 +0 -5
  568. package/debuggingApp/node_modules/json5/test/parse-cases/comments/block-comment-in-string.json +0 -1
  569. package/debuggingApp/node_modules/json5/test/parse-cases/comments/block-comment-preceding-top-level-value.json5 +0 -5
  570. package/debuggingApp/node_modules/json5/test/parse-cases/comments/block-comment-with-asterisks.json5 +0 -7
  571. package/debuggingApp/node_modules/json5/test/parse-cases/comments/inline-comment-following-array-element.json5 +0 -3
  572. package/debuggingApp/node_modules/json5/test/parse-cases/comments/inline-comment-following-top-level-value.json5 +0 -1
  573. package/debuggingApp/node_modules/json5/test/parse-cases/comments/inline-comment-in-string.json +0 -1
  574. package/debuggingApp/node_modules/json5/test/parse-cases/comments/inline-comment-preceding-top-level-value.json5 +0 -2
  575. package/debuggingApp/node_modules/json5/test/parse-cases/comments/top-level-block-comment.txt +0 -4
  576. package/debuggingApp/node_modules/json5/test/parse-cases/comments/top-level-inline-comment.txt +0 -1
  577. package/debuggingApp/node_modules/json5/test/parse-cases/comments/unterminated-block-comment.txt +0 -5
  578. package/debuggingApp/node_modules/json5/test/parse-cases/misc/empty.txt +0 -0
  579. package/debuggingApp/node_modules/json5/test/parse-cases/misc/npm-package.json +0 -106
  580. package/debuggingApp/node_modules/json5/test/parse-cases/misc/npm-package.json5 +0 -106
  581. package/debuggingApp/node_modules/json5/test/parse-cases/misc/readme-example.json5 +0 -25
  582. package/debuggingApp/node_modules/json5/test/parse-cases/misc/valid-whitespace.json5 +0 -5
  583. package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/.gitattributes +0 -4
  584. package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/comment-cr.json5 +0 -1
  585. package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/comment-crlf.json5 +0 -3
  586. package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/comment-lf.json5 +0 -3
  587. package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/escaped-cr.json5 +0 -1
  588. package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/escaped-crlf.json5 +0 -5
  589. package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/escaped-lf.json5 +0 -5
  590. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/binary-coffeescript.txt +0 -1
  591. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/float-leading-decimal-point.json5 +0 -1
  592. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/float-leading-zero.json +0 -1
  593. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/float-trailing-decimal-point-with-integer-exponent.json5 +0 -1
  594. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/float-trailing-decimal-point.json5 +0 -1
  595. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/float-with-integer-exponent.json +0 -1
  596. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/float.json +0 -1
  597. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/hexadecimal-empty.txt +0 -1
  598. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/hexadecimal-lowercase-letter.json5 +0 -1
  599. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/hexadecimal-uppercase-x.json5 +0 -1
  600. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/hexadecimal-with-integer-exponent.json5 +0 -1
  601. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/hexadecimal.json5 +0 -1
  602. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/infinity.json5 +0 -1
  603. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-float-exponent.txt +0 -1
  604. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-hexadecimal-exponent.txt +0 -1
  605. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-integer-exponent.json +0 -1
  606. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-negative-float-exponent.txt +0 -1
  607. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-negative-hexadecimal-exponent.txt +0 -1
  608. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-negative-integer-exponent.json +0 -1
  609. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-negative-zero-integer-exponent.json +0 -1
  610. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-positive-float-exponent.txt +0 -1
  611. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-positive-hexadecimal-exponent.txt +0 -1
  612. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-positive-integer-exponent.json +0 -1
  613. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-positive-zero-integer-exponent.json +0 -1
  614. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-zero-integer-exponent.json +0 -1
  615. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer.json +0 -1
  616. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/lone-decimal-point.txt +0 -1
  617. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/nan.json5 +0 -1
  618. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-binary-coffeescript.txt +0 -1
  619. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-float-leading-decimal-point.json5 +0 -1
  620. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-float-leading-zero.json +0 -1
  621. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-float-trailing-decimal-point.json5 +0 -1
  622. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-float.json +0 -1
  623. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-hexadecimal.json5 +0 -1
  624. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-infinity.json5 +0 -1
  625. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-integer.json +0 -1
  626. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-noctal.js +0 -1
  627. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-octal-coffeescript.txt +0 -1
  628. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-octal.txt +0 -1
  629. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-binary-coffeescript.txt +0 -1
  630. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-float-leading-decimal-point.json5 +0 -1
  631. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-float-trailing-decimal-point.json5 +0 -1
  632. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-float.json +0 -1
  633. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-hexadecimal.json5 +0 -1
  634. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-integer.json +0 -1
  635. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-octal-coffeescript.txt +0 -1
  636. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-octal.txt +0 -1
  637. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/noctal-with-leading-octal-digit.js +0 -1
  638. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/noctal.js +0 -1
  639. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/octal-coffeescript.txt +0 -1
  640. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/octal.txt +0 -1
  641. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-binary-coffeescript.txt +0 -1
  642. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-float-leading-decimal-point.json5 +0 -1
  643. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-float-leading-zero.json5 +0 -1
  644. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-float-trailing-decimal-point.json5 +0 -1
  645. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-float.json5 +0 -1
  646. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-hexadecimal.json5 +0 -1
  647. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-infinity.json5 +0 -1
  648. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-integer.json5 +0 -1
  649. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-noctal.js +0 -1
  650. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-octal-coffeescript.txt +0 -1
  651. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-octal.txt +0 -1
  652. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-binary-coffeescript.txt +0 -1
  653. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-float-leading-decimal-point.json5 +0 -1
  654. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-float-trailing-decimal-point.json5 +0 -1
  655. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-float.json5 +0 -1
  656. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-hexadecimal.json5 +0 -1
  657. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-integer.json5 +0 -1
  658. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-octal-coffeescript.txt +0 -1
  659. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-octal.txt +0 -1
  660. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-binary-coffeescript.txt +0 -1
  661. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-float-leading-decimal-point.json5 +0 -1
  662. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-float-trailing-decimal-point.json5 +0 -1
  663. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-float.json +0 -1
  664. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-hexadecimal.json5 +0 -1
  665. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-integer-with-integer-exponent.json +0 -1
  666. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-integer.json +0 -1
  667. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-octal-coffeescript.txt +0 -1
  668. package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-octal.txt +0 -1
  669. package/debuggingApp/node_modules/json5/test/parse-cases/objects/duplicate-keys.json +0 -4
  670. package/debuggingApp/node_modules/json5/test/parse-cases/objects/empty-object.json +0 -1
  671. package/debuggingApp/node_modules/json5/test/parse-cases/objects/illegal-unquoted-key-number.txt +0 -3
  672. package/debuggingApp/node_modules/json5/test/parse-cases/objects/illegal-unquoted-key-symbol.txt +0 -3
  673. package/debuggingApp/node_modules/json5/test/parse-cases/objects/leading-comma-object.txt +0 -3
  674. package/debuggingApp/node_modules/json5/test/parse-cases/objects/lone-trailing-comma-object.txt +0 -3
  675. package/debuggingApp/node_modules/json5/test/parse-cases/objects/no-comma-object.txt +0 -4
  676. package/debuggingApp/node_modules/json5/test/parse-cases/objects/reserved-unquoted-key.json5 +0 -3
  677. package/debuggingApp/node_modules/json5/test/parse-cases/objects/single-quoted-key.json5 +0 -3
  678. package/debuggingApp/node_modules/json5/test/parse-cases/objects/trailing-comma-object.json5 +0 -3
  679. package/debuggingApp/node_modules/json5/test/parse-cases/objects/unquoted-keys.json5 +0 -8
  680. package/debuggingApp/node_modules/json5/test/parse-cases/strings/escaped-single-quoted-string.json5 +0 -1
  681. package/debuggingApp/node_modules/json5/test/parse-cases/strings/multi-line-string.json5 +0 -2
  682. package/debuggingApp/node_modules/json5/test/parse-cases/strings/single-quoted-string.json5 +0 -1
  683. package/debuggingApp/node_modules/json5/test/parse-cases/strings/unescaped-multi-line-string.txt +0 -2
  684. package/debuggingApp/node_modules/json5/test/parse-cases/todo/unicode-escaped-unquoted-key.json5 +0 -3
  685. package/debuggingApp/node_modules/json5/test/parse-cases/todo/unicode-unquoted-key.json5 +0 -3
  686. package/debuggingApp/node_modules/json5/test/parse.js +0 -89
  687. package/debuggingApp/node_modules/json5/test/readme.md +0 -23
  688. package/debuggingApp/node_modules/json5/test/require.js +0 -18
  689. package/debuggingApp/node_modules/json5/test/stringify.js +0 -498
  690. package/debuggingApp/node_modules/keygrip/HISTORY.md +0 -20
  691. package/debuggingApp/node_modules/keygrip/LICENSE +0 -21
  692. package/debuggingApp/node_modules/keygrip/README.md +0 -103
  693. package/debuggingApp/node_modules/keygrip/index.js +0 -71
  694. package/debuggingApp/node_modules/keygrip/package.json +0 -25
  695. package/debuggingApp/node_modules/media-typer/HISTORY.md +0 -22
  696. package/debuggingApp/node_modules/media-typer/LICENSE +0 -22
  697. package/debuggingApp/node_modules/media-typer/README.md +0 -81
  698. package/debuggingApp/node_modules/media-typer/index.js +0 -270
  699. package/debuggingApp/node_modules/media-typer/package.json +0 -26
  700. package/debuggingApp/node_modules/merge-descriptors/HISTORY.md +0 -21
  701. package/debuggingApp/node_modules/merge-descriptors/LICENSE +0 -23
  702. package/debuggingApp/node_modules/merge-descriptors/README.md +0 -48
  703. package/debuggingApp/node_modules/merge-descriptors/index.js +0 -60
  704. package/debuggingApp/node_modules/merge-descriptors/package.json +0 -32
  705. package/debuggingApp/node_modules/methods/HISTORY.md +0 -29
  706. package/debuggingApp/node_modules/methods/LICENSE +0 -24
  707. package/debuggingApp/node_modules/methods/README.md +0 -51
  708. package/debuggingApp/node_modules/methods/index.js +0 -69
  709. package/debuggingApp/node_modules/methods/package.json +0 -36
  710. package/debuggingApp/node_modules/mime/CHANGELOG.md +0 -164
  711. package/debuggingApp/node_modules/mime/LICENSE +0 -21
  712. package/debuggingApp/node_modules/mime/README.md +0 -90
  713. package/debuggingApp/node_modules/mime/cli.js +0 -8
  714. package/debuggingApp/node_modules/mime/mime.js +0 -108
  715. package/debuggingApp/node_modules/mime/package.json +0 -44
  716. package/debuggingApp/node_modules/mime/src/build.js +0 -53
  717. package/debuggingApp/node_modules/mime/src/test.js +0 -60
  718. package/debuggingApp/node_modules/mime/types.json +0 -1
  719. package/debuggingApp/node_modules/mime-db/HISTORY.md +0 -507
  720. package/debuggingApp/node_modules/mime-db/LICENSE +0 -23
  721. package/debuggingApp/node_modules/mime-db/README.md +0 -100
  722. package/debuggingApp/node_modules/mime-db/db.json +0 -8519
  723. package/debuggingApp/node_modules/mime-db/index.js +0 -12
  724. package/debuggingApp/node_modules/mime-db/package.json +0 -60
  725. package/debuggingApp/node_modules/mime-types/HISTORY.md +0 -397
  726. package/debuggingApp/node_modules/mime-types/LICENSE +0 -23
  727. package/debuggingApp/node_modules/mime-types/README.md +0 -113
  728. package/debuggingApp/node_modules/mime-types/index.js +0 -188
  729. package/debuggingApp/node_modules/mime-types/package.json +0 -44
  730. package/debuggingApp/node_modules/ms/index.js +0 -152
  731. package/debuggingApp/node_modules/ms/license.md +0 -21
  732. package/debuggingApp/node_modules/ms/package.json +0 -37
  733. package/debuggingApp/node_modules/ms/readme.md +0 -51
  734. package/debuggingApp/node_modules/negotiator/HISTORY.md +0 -108
  735. package/debuggingApp/node_modules/negotiator/LICENSE +0 -24
  736. package/debuggingApp/node_modules/negotiator/README.md +0 -203
  737. package/debuggingApp/node_modules/negotiator/index.js +0 -82
  738. package/debuggingApp/node_modules/negotiator/lib/charset.js +0 -169
  739. package/debuggingApp/node_modules/negotiator/lib/encoding.js +0 -184
  740. package/debuggingApp/node_modules/negotiator/lib/language.js +0 -179
  741. package/debuggingApp/node_modules/negotiator/lib/mediaType.js +0 -294
  742. package/debuggingApp/node_modules/negotiator/package.json +0 -42
  743. package/debuggingApp/node_modules/object-inspect/.github/FUNDING.yml +0 -12
  744. package/debuggingApp/node_modules/object-inspect/.nycrc +0 -13
  745. package/debuggingApp/node_modules/object-inspect/CHANGELOG.md +0 -360
  746. package/debuggingApp/node_modules/object-inspect/LICENSE +0 -21
  747. package/debuggingApp/node_modules/object-inspect/example/all.js +0 -23
  748. package/debuggingApp/node_modules/object-inspect/example/circular.js +0 -6
  749. package/debuggingApp/node_modules/object-inspect/example/fn.js +0 -5
  750. package/debuggingApp/node_modules/object-inspect/example/inspect.js +0 -10
  751. package/debuggingApp/node_modules/object-inspect/index.js +0 -512
  752. package/debuggingApp/node_modules/object-inspect/package-support.json +0 -20
  753. package/debuggingApp/node_modules/object-inspect/package.json +0 -94
  754. package/debuggingApp/node_modules/object-inspect/readme.markdown +0 -86
  755. package/debuggingApp/node_modules/object-inspect/test/bigint.js +0 -58
  756. package/debuggingApp/node_modules/object-inspect/test/browser/dom.js +0 -15
  757. package/debuggingApp/node_modules/object-inspect/test/circular.js +0 -16
  758. package/debuggingApp/node_modules/object-inspect/test/deep.js +0 -12
  759. package/debuggingApp/node_modules/object-inspect/test/element.js +0 -53
  760. package/debuggingApp/node_modules/object-inspect/test/err.js +0 -48
  761. package/debuggingApp/node_modules/object-inspect/test/fakes.js +0 -29
  762. package/debuggingApp/node_modules/object-inspect/test/fn.js +0 -76
  763. package/debuggingApp/node_modules/object-inspect/test/has.js +0 -15
  764. package/debuggingApp/node_modules/object-inspect/test/holes.js +0 -15
  765. package/debuggingApp/node_modules/object-inspect/test/indent-option.js +0 -271
  766. package/debuggingApp/node_modules/object-inspect/test/inspect.js +0 -139
  767. package/debuggingApp/node_modules/object-inspect/test/lowbyte.js +0 -12
  768. package/debuggingApp/node_modules/object-inspect/test/number.js +0 -58
  769. package/debuggingApp/node_modules/object-inspect/test/quoteStyle.js +0 -17
  770. package/debuggingApp/node_modules/object-inspect/test/toStringTag.js +0 -40
  771. package/debuggingApp/node_modules/object-inspect/test/undef.js +0 -12
  772. package/debuggingApp/node_modules/object-inspect/test/values.js +0 -211
  773. package/debuggingApp/node_modules/object-inspect/test-core-js.js +0 -26
  774. package/debuggingApp/node_modules/object-inspect/util.inspect.js +0 -1
  775. package/debuggingApp/node_modules/on-finished/HISTORY.md +0 -98
  776. package/debuggingApp/node_modules/on-finished/LICENSE +0 -23
  777. package/debuggingApp/node_modules/on-finished/README.md +0 -162
  778. package/debuggingApp/node_modules/on-finished/index.js +0 -234
  779. package/debuggingApp/node_modules/on-finished/package.json +0 -39
  780. package/debuggingApp/node_modules/parseurl/HISTORY.md +0 -58
  781. package/debuggingApp/node_modules/parseurl/LICENSE +0 -24
  782. package/debuggingApp/node_modules/parseurl/README.md +0 -133
  783. package/debuggingApp/node_modules/parseurl/index.js +0 -158
  784. package/debuggingApp/node_modules/parseurl/package.json +0 -40
  785. package/debuggingApp/node_modules/path-to-regexp/History.md +0 -36
  786. package/debuggingApp/node_modules/path-to-regexp/LICENSE +0 -21
  787. package/debuggingApp/node_modules/path-to-regexp/Readme.md +0 -35
  788. package/debuggingApp/node_modules/path-to-regexp/index.js +0 -129
  789. package/debuggingApp/node_modules/path-to-regexp/package.json +0 -30
  790. package/debuggingApp/node_modules/proxy-addr/HISTORY.md +0 -161
  791. package/debuggingApp/node_modules/proxy-addr/LICENSE +0 -22
  792. package/debuggingApp/node_modules/proxy-addr/README.md +0 -139
  793. package/debuggingApp/node_modules/proxy-addr/index.js +0 -327
  794. package/debuggingApp/node_modules/proxy-addr/package.json +0 -47
  795. package/debuggingApp/node_modules/qs/.github/FUNDING.yml +0 -12
  796. package/debuggingApp/node_modules/qs/.nycrc +0 -13
  797. package/debuggingApp/node_modules/qs/CHANGELOG.md +0 -388
  798. package/debuggingApp/node_modules/qs/LICENSE.md +0 -29
  799. package/debuggingApp/node_modules/qs/README.md +0 -623
  800. package/debuggingApp/node_modules/qs/dist/qs.js +0 -2044
  801. package/debuggingApp/node_modules/qs/lib/formats.js +0 -23
  802. package/debuggingApp/node_modules/qs/lib/index.js +0 -11
  803. package/debuggingApp/node_modules/qs/lib/parse.js +0 -263
  804. package/debuggingApp/node_modules/qs/lib/stringify.js +0 -317
  805. package/debuggingApp/node_modules/qs/lib/utils.js +0 -252
  806. package/debuggingApp/node_modules/qs/package.json +0 -73
  807. package/debuggingApp/node_modules/qs/test/parse.js +0 -841
  808. package/debuggingApp/node_modules/qs/test/stringify.js +0 -865
  809. package/debuggingApp/node_modules/qs/test/utils.js +0 -136
  810. package/debuggingApp/node_modules/range-parser/HISTORY.md +0 -56
  811. package/debuggingApp/node_modules/range-parser/LICENSE +0 -23
  812. package/debuggingApp/node_modules/range-parser/README.md +0 -84
  813. package/debuggingApp/node_modules/range-parser/index.js +0 -162
  814. package/debuggingApp/node_modules/range-parser/package.json +0 -44
  815. package/debuggingApp/node_modules/raw-body/HISTORY.md +0 -303
  816. package/debuggingApp/node_modules/raw-body/LICENSE +0 -22
  817. package/debuggingApp/node_modules/raw-body/README.md +0 -223
  818. package/debuggingApp/node_modules/raw-body/SECURITY.md +0 -24
  819. package/debuggingApp/node_modules/raw-body/index.d.ts +0 -87
  820. package/debuggingApp/node_modules/raw-body/index.js +0 -329
  821. package/debuggingApp/node_modules/raw-body/package.json +0 -49
  822. package/debuggingApp/node_modules/regenerator-runtime/LICENSE +0 -21
  823. package/debuggingApp/node_modules/regenerator-runtime/README.md +0 -31
  824. package/debuggingApp/node_modules/regenerator-runtime/package.json +0 -19
  825. package/debuggingApp/node_modules/regenerator-runtime/path.js +0 -11
  826. package/debuggingApp/node_modules/regenerator-runtime/runtime.js +0 -754
  827. package/debuggingApp/node_modules/safe-buffer/LICENSE +0 -21
  828. package/debuggingApp/node_modules/safe-buffer/README.md +0 -584
  829. package/debuggingApp/node_modules/safe-buffer/index.d.ts +0 -187
  830. package/debuggingApp/node_modules/safe-buffer/index.js +0 -65
  831. package/debuggingApp/node_modules/safe-buffer/package.json +0 -51
  832. package/debuggingApp/node_modules/safer-buffer/LICENSE +0 -21
  833. package/debuggingApp/node_modules/safer-buffer/Porting-Buffer.md +0 -268
  834. package/debuggingApp/node_modules/safer-buffer/Readme.md +0 -156
  835. package/debuggingApp/node_modules/safer-buffer/dangerous.js +0 -58
  836. package/debuggingApp/node_modules/safer-buffer/package.json +0 -34
  837. package/debuggingApp/node_modules/safer-buffer/safer.js +0 -77
  838. package/debuggingApp/node_modules/safer-buffer/tests.js +0 -406
  839. package/debuggingApp/node_modules/send/HISTORY.md +0 -521
  840. package/debuggingApp/node_modules/send/LICENSE +0 -23
  841. package/debuggingApp/node_modules/send/README.md +0 -327
  842. package/debuggingApp/node_modules/send/SECURITY.md +0 -24
  843. package/debuggingApp/node_modules/send/index.js +0 -1143
  844. package/debuggingApp/node_modules/send/node_modules/ms/index.js +0 -162
  845. package/debuggingApp/node_modules/send/node_modules/ms/license.md +0 -21
  846. package/debuggingApp/node_modules/send/node_modules/ms/package.json +0 -38
  847. package/debuggingApp/node_modules/send/node_modules/ms/readme.md +0 -59
  848. package/debuggingApp/node_modules/send/package.json +0 -62
  849. package/debuggingApp/node_modules/serve-static/HISTORY.md +0 -471
  850. package/debuggingApp/node_modules/serve-static/LICENSE +0 -25
  851. package/debuggingApp/node_modules/serve-static/README.md +0 -257
  852. package/debuggingApp/node_modules/serve-static/index.js +0 -210
  853. package/debuggingApp/node_modules/serve-static/package.json +0 -42
  854. package/debuggingApp/node_modules/setprototypeof/LICENSE +0 -13
  855. package/debuggingApp/node_modules/setprototypeof/README.md +0 -31
  856. package/debuggingApp/node_modules/setprototypeof/index.d.ts +0 -2
  857. package/debuggingApp/node_modules/setprototypeof/index.js +0 -17
  858. package/debuggingApp/node_modules/setprototypeof/package.json +0 -38
  859. package/debuggingApp/node_modules/setprototypeof/test/index.js +0 -24
  860. package/debuggingApp/node_modules/side-channel/.github/FUNDING.yml +0 -12
  861. package/debuggingApp/node_modules/side-channel/.nycrc +0 -13
  862. package/debuggingApp/node_modules/side-channel/CHANGELOG.md +0 -65
  863. package/debuggingApp/node_modules/side-channel/LICENSE +0 -21
  864. package/debuggingApp/node_modules/side-channel/README.md +0 -2
  865. package/debuggingApp/node_modules/side-channel/index.js +0 -124
  866. package/debuggingApp/node_modules/side-channel/package.json +0 -67
  867. package/debuggingApp/node_modules/side-channel/test/index.js +0 -78
  868. package/debuggingApp/node_modules/statuses/HISTORY.md +0 -82
  869. package/debuggingApp/node_modules/statuses/LICENSE +0 -23
  870. package/debuggingApp/node_modules/statuses/README.md +0 -136
  871. package/debuggingApp/node_modules/statuses/codes.json +0 -65
  872. package/debuggingApp/node_modules/statuses/index.js +0 -146
  873. package/debuggingApp/node_modules/statuses/package.json +0 -49
  874. package/debuggingApp/node_modules/toidentifier/HISTORY.md +0 -9
  875. package/debuggingApp/node_modules/toidentifier/LICENSE +0 -21
  876. package/debuggingApp/node_modules/toidentifier/README.md +0 -61
  877. package/debuggingApp/node_modules/toidentifier/index.js +0 -32
  878. package/debuggingApp/node_modules/toidentifier/package.json +0 -38
  879. package/debuggingApp/node_modules/type-is/HISTORY.md +0 -259
  880. package/debuggingApp/node_modules/type-is/LICENSE +0 -23
  881. package/debuggingApp/node_modules/type-is/README.md +0 -170
  882. package/debuggingApp/node_modules/type-is/index.js +0 -266
  883. package/debuggingApp/node_modules/type-is/package.json +0 -45
  884. package/debuggingApp/node_modules/unpipe/HISTORY.md +0 -4
  885. package/debuggingApp/node_modules/unpipe/LICENSE +0 -22
  886. package/debuggingApp/node_modules/unpipe/README.md +0 -43
  887. package/debuggingApp/node_modules/unpipe/index.js +0 -69
  888. package/debuggingApp/node_modules/unpipe/package.json +0 -27
  889. package/debuggingApp/node_modules/utils-merge/LICENSE +0 -20
  890. package/debuggingApp/node_modules/utils-merge/README.md +0 -34
  891. package/debuggingApp/node_modules/utils-merge/index.js +0 -23
  892. package/debuggingApp/node_modules/utils-merge/package.json +0 -40
  893. package/debuggingApp/node_modules/vary/HISTORY.md +0 -39
  894. package/debuggingApp/node_modules/vary/LICENSE +0 -22
  895. package/debuggingApp/node_modules/vary/README.md +0 -101
  896. package/debuggingApp/node_modules/vary/index.js +0 -149
  897. package/debuggingApp/node_modules/vary/package.json +0 -43
  898. package/debuggingApp/package-lock.json +0 -1162
  899. package/debuggingApp/package.json +0 -18
  900. package/debuggingApp/server.js +0 -42
  901. package/dist/cjs/locize.js +0 -464
  902. package/dist/esm/locize.js +0 -454
@@ -1,2954 +0,0 @@
1
- function ownKeys(object, enumerableOnly) {
2
- var keys = Object.keys(object);
3
-
4
- if (Object.getOwnPropertySymbols) {
5
- var symbols = Object.getOwnPropertySymbols(object);
6
-
7
- if (enumerableOnly) {
8
- symbols = symbols.filter(function (sym) {
9
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
10
- });
11
- }
12
-
13
- keys.push.apply(keys, symbols);
14
- }
15
-
16
- return keys;
17
- }
18
-
19
- function _objectSpread2(target) {
20
- for (var i = 1; i < arguments.length; i++) {
21
- var source = arguments[i] != null ? arguments[i] : {};
22
-
23
- if (i % 2) {
24
- ownKeys(Object(source), true).forEach(function (key) {
25
- _defineProperty(target, key, source[key]);
26
- });
27
- } else if (Object.getOwnPropertyDescriptors) {
28
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
29
- } else {
30
- ownKeys(Object(source)).forEach(function (key) {
31
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
32
- });
33
- }
34
- }
35
-
36
- return target;
37
- }
38
-
39
- function _typeof(obj) {
40
- "@babel/helpers - typeof";
41
-
42
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
43
- _typeof = function (obj) {
44
- return typeof obj;
45
- };
46
- } else {
47
- _typeof = function (obj) {
48
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
49
- };
50
- }
51
-
52
- return _typeof(obj);
53
- }
54
-
55
- function _classCallCheck(instance, Constructor) {
56
- if (!(instance instanceof Constructor)) {
57
- throw new TypeError("Cannot call a class as a function");
58
- }
59
- }
60
-
61
- function _defineProperties(target, props) {
62
- for (var i = 0; i < props.length; i++) {
63
- var descriptor = props[i];
64
- descriptor.enumerable = descriptor.enumerable || false;
65
- descriptor.configurable = true;
66
- if ("value" in descriptor) descriptor.writable = true;
67
- Object.defineProperty(target, descriptor.key, descriptor);
68
- }
69
- }
70
-
71
- function _createClass(Constructor, protoProps, staticProps) {
72
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
73
- if (staticProps) _defineProperties(Constructor, staticProps);
74
- return Constructor;
75
- }
76
-
77
- function _defineProperty(obj, key, value) {
78
- if (key in obj) {
79
- Object.defineProperty(obj, key, {
80
- value: value,
81
- enumerable: true,
82
- configurable: true,
83
- writable: true
84
- });
85
- } else {
86
- obj[key] = value;
87
- }
88
-
89
- return obj;
90
- }
91
-
92
- function _inherits(subClass, superClass) {
93
- if (typeof superClass !== "function" && superClass !== null) {
94
- throw new TypeError("Super expression must either be null or a function");
95
- }
96
-
97
- subClass.prototype = Object.create(superClass && superClass.prototype, {
98
- constructor: {
99
- value: subClass,
100
- writable: true,
101
- configurable: true
102
- }
103
- });
104
- if (superClass) _setPrototypeOf(subClass, superClass);
105
- }
106
-
107
- function _getPrototypeOf(o) {
108
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
109
- return o.__proto__ || Object.getPrototypeOf(o);
110
- };
111
- return _getPrototypeOf(o);
112
- }
113
-
114
- function _setPrototypeOf(o, p) {
115
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
116
- o.__proto__ = p;
117
- return o;
118
- };
119
-
120
- return _setPrototypeOf(o, p);
121
- }
122
-
123
- function _isNativeReflectConstruct() {
124
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
125
- if (Reflect.construct.sham) return false;
126
- if (typeof Proxy === "function") return true;
127
-
128
- try {
129
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
130
- return true;
131
- } catch (e) {
132
- return false;
133
- }
134
- }
135
-
136
- function _assertThisInitialized(self) {
137
- if (self === void 0) {
138
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
139
- }
140
-
141
- return self;
142
- }
143
-
144
- function _possibleConstructorReturn(self, call) {
145
- if (call && (typeof call === "object" || typeof call === "function")) {
146
- return call;
147
- } else if (call !== void 0) {
148
- throw new TypeError("Derived constructors may only return object or undefined");
149
- }
150
-
151
- return _assertThisInitialized(self);
152
- }
153
-
154
- function _createSuper(Derived) {
155
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
156
-
157
- return function _createSuperInternal() {
158
- var Super = _getPrototypeOf(Derived),
159
- result;
160
-
161
- if (hasNativeReflectConstruct) {
162
- var NewTarget = _getPrototypeOf(this).constructor;
163
-
164
- result = Reflect.construct(Super, arguments, NewTarget);
165
- } else {
166
- result = Super.apply(this, arguments);
167
- }
168
-
169
- return _possibleConstructorReturn(this, result);
170
- };
171
- }
172
-
173
- function _toArray(arr) {
174
- return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
175
- }
176
-
177
- function _arrayWithHoles(arr) {
178
- if (Array.isArray(arr)) return arr;
179
- }
180
-
181
- function _iterableToArray(iter) {
182
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
183
- }
184
-
185
- function _unsupportedIterableToArray(o, minLen) {
186
- if (!o) return;
187
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
188
- var n = Object.prototype.toString.call(o).slice(8, -1);
189
- if (n === "Object" && o.constructor) n = o.constructor.name;
190
- if (n === "Map" || n === "Set") return Array.from(o);
191
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
192
- }
193
-
194
- function _arrayLikeToArray(arr, len) {
195
- if (len == null || len > arr.length) len = arr.length;
196
-
197
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
198
-
199
- return arr2;
200
- }
201
-
202
- function _nonIterableRest() {
203
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
204
- }
205
-
206
- var consoleLogger = {
207
- type: 'logger',
208
- log: function log(args) {
209
- this.output('log', args);
210
- },
211
- warn: function warn(args) {
212
- this.output('warn', args);
213
- },
214
- error: function error(args) {
215
- this.output('error', args);
216
- },
217
- output: function output(type, args) {
218
- if (console && console[type]) console[type].apply(console, args);
219
- }
220
- };
221
-
222
- var Logger = function () {
223
- function Logger(concreteLogger) {
224
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
225
-
226
- _classCallCheck(this, Logger);
227
-
228
- this.init(concreteLogger, options);
229
- }
230
-
231
- _createClass(Logger, [{
232
- key: "init",
233
- value: function init(concreteLogger) {
234
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
235
- this.prefix = options.prefix || 'i18next:';
236
- this.logger = concreteLogger || consoleLogger;
237
- this.options = options;
238
- this.debug = options.debug;
239
- }
240
- }, {
241
- key: "setDebug",
242
- value: function setDebug(bool) {
243
- this.debug = bool;
244
- }
245
- }, {
246
- key: "log",
247
- value: function log() {
248
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
249
- args[_key] = arguments[_key];
250
- }
251
-
252
- return this.forward(args, 'log', '', true);
253
- }
254
- }, {
255
- key: "warn",
256
- value: function warn() {
257
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
258
- args[_key2] = arguments[_key2];
259
- }
260
-
261
- return this.forward(args, 'warn', '', true);
262
- }
263
- }, {
264
- key: "error",
265
- value: function error() {
266
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
267
- args[_key3] = arguments[_key3];
268
- }
269
-
270
- return this.forward(args, 'error', '');
271
- }
272
- }, {
273
- key: "deprecate",
274
- value: function deprecate() {
275
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
276
- args[_key4] = arguments[_key4];
277
- }
278
-
279
- return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);
280
- }
281
- }, {
282
- key: "forward",
283
- value: function forward(args, lvl, prefix, debugOnly) {
284
- if (debugOnly && !this.debug) return null;
285
- if (typeof args[0] === 'string') args[0] = "".concat(prefix).concat(this.prefix, " ").concat(args[0]);
286
- return this.logger[lvl](args);
287
- }
288
- }, {
289
- key: "create",
290
- value: function create(moduleName) {
291
- return new Logger(this.logger, _objectSpread2(_objectSpread2({}, {
292
- prefix: "".concat(this.prefix, ":").concat(moduleName, ":")
293
- }), this.options));
294
- }
295
- }]);
296
-
297
- return Logger;
298
- }();
299
-
300
- var baseLogger = new Logger();
301
-
302
- var EventEmitter = function () {
303
- function EventEmitter() {
304
- _classCallCheck(this, EventEmitter);
305
-
306
- this.observers = {};
307
- }
308
-
309
- _createClass(EventEmitter, [{
310
- key: "on",
311
- value: function on(events, listener) {
312
- var _this = this;
313
-
314
- events.split(' ').forEach(function (event) {
315
- _this.observers[event] = _this.observers[event] || [];
316
-
317
- _this.observers[event].push(listener);
318
- });
319
- return this;
320
- }
321
- }, {
322
- key: "off",
323
- value: function off(event, listener) {
324
- if (!this.observers[event]) return;
325
-
326
- if (!listener) {
327
- delete this.observers[event];
328
- return;
329
- }
330
-
331
- this.observers[event] = this.observers[event].filter(function (l) {
332
- return l !== listener;
333
- });
334
- }
335
- }, {
336
- key: "emit",
337
- value: function emit(event) {
338
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
339
- args[_key - 1] = arguments[_key];
340
- }
341
-
342
- if (this.observers[event]) {
343
- var cloned = [].concat(this.observers[event]);
344
- cloned.forEach(function (observer) {
345
- observer.apply(void 0, args);
346
- });
347
- }
348
-
349
- if (this.observers['*']) {
350
- var _cloned = [].concat(this.observers['*']);
351
-
352
- _cloned.forEach(function (observer) {
353
- observer.apply(observer, [event].concat(args));
354
- });
355
- }
356
- }
357
- }]);
358
-
359
- return EventEmitter;
360
- }();
361
-
362
- function defer() {
363
- var res;
364
- var rej;
365
- var promise = new Promise(function (resolve, reject) {
366
- res = resolve;
367
- rej = reject;
368
- });
369
- promise.resolve = res;
370
- promise.reject = rej;
371
- return promise;
372
- }
373
- function makeString(object) {
374
- if (object == null) return '';
375
- return '' + object;
376
- }
377
- function copy(a, s, t) {
378
- a.forEach(function (m) {
379
- if (s[m]) t[m] = s[m];
380
- });
381
- }
382
-
383
- function getLastOfPath(object, path, Empty) {
384
- function cleanKey(key) {
385
- return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key;
386
- }
387
-
388
- function canNotTraverseDeeper() {
389
- return !object || typeof object === 'string';
390
- }
391
-
392
- var stack = typeof path !== 'string' ? [].concat(path) : path.split('.');
393
-
394
- while (stack.length > 1) {
395
- if (canNotTraverseDeeper()) return {};
396
- var key = cleanKey(stack.shift());
397
- if (!object[key] && Empty) object[key] = new Empty();
398
-
399
- if (Object.prototype.hasOwnProperty.call(object, key)) {
400
- object = object[key];
401
- } else {
402
- object = {};
403
- }
404
- }
405
-
406
- if (canNotTraverseDeeper()) return {};
407
- return {
408
- obj: object,
409
- k: cleanKey(stack.shift())
410
- };
411
- }
412
-
413
- function setPath(object, path, newValue) {
414
- var _getLastOfPath = getLastOfPath(object, path, Object),
415
- obj = _getLastOfPath.obj,
416
- k = _getLastOfPath.k;
417
-
418
- obj[k] = newValue;
419
- }
420
- function pushPath(object, path, newValue, concat) {
421
- var _getLastOfPath2 = getLastOfPath(object, path, Object),
422
- obj = _getLastOfPath2.obj,
423
- k = _getLastOfPath2.k;
424
-
425
- obj[k] = obj[k] || [];
426
- if (concat) obj[k] = obj[k].concat(newValue);
427
- if (!concat) obj[k].push(newValue);
428
- }
429
- function getPath(object, path) {
430
- var _getLastOfPath3 = getLastOfPath(object, path),
431
- obj = _getLastOfPath3.obj,
432
- k = _getLastOfPath3.k;
433
-
434
- if (!obj) return undefined;
435
- return obj[k];
436
- }
437
- function getPathWithDefaults(data, defaultData, key) {
438
- var value = getPath(data, key);
439
-
440
- if (value !== undefined) {
441
- return value;
442
- }
443
-
444
- return getPath(defaultData, key);
445
- }
446
- function deepExtend(target, source, overwrite) {
447
- for (var prop in source) {
448
- if (prop !== '__proto__' && prop !== 'constructor') {
449
- if (prop in target) {
450
- if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) {
451
- if (overwrite) target[prop] = source[prop];
452
- } else {
453
- deepExtend(target[prop], source[prop], overwrite);
454
- }
455
- } else {
456
- target[prop] = source[prop];
457
- }
458
- }
459
- }
460
-
461
- return target;
462
- }
463
- function regexEscape(str) {
464
- return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
465
- }
466
- var _entityMap = {
467
- '&': '&amp;',
468
- '<': '&lt;',
469
- '>': '&gt;',
470
- '"': '&quot;',
471
- "'": '&#39;',
472
- '/': '&#x2F;'
473
- };
474
- function escape(data) {
475
- if (typeof data === 'string') {
476
- return data.replace(/[&<>"'\/]/g, function (s) {
477
- return _entityMap[s];
478
- });
479
- }
480
-
481
- return data;
482
- }
483
- var isIE10 = typeof window !== 'undefined' && window.navigator && typeof window.navigator.userAgentData === 'undefined' && window.navigator.userAgent && window.navigator.userAgent.indexOf('MSIE') > -1;
484
- var chars = [' ', ',', '?', '!', ';'];
485
- function looksLikeObjectPath(key, nsSeparator, keySeparator) {
486
- nsSeparator = nsSeparator || '';
487
- keySeparator = keySeparator || '';
488
- var possibleChars = chars.filter(function (c) {
489
- return nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0;
490
- });
491
- if (possibleChars.length === 0) return true;
492
- var r = new RegExp("(".concat(possibleChars.map(function (c) {
493
- return c === '?' ? '\\?' : c;
494
- }).join('|'), ")"));
495
- var matched = !r.test(key);
496
-
497
- if (!matched) {
498
- var ki = key.indexOf(keySeparator);
499
-
500
- if (ki > 0 && !r.test(key.substring(0, ki))) {
501
- matched = true;
502
- }
503
- }
504
-
505
- return matched;
506
- }
507
-
508
- function deepFind(obj, path) {
509
- var keySeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
510
- if (!obj) return undefined;
511
- if (obj[path]) return obj[path];
512
- var paths = path.split(keySeparator);
513
- var current = obj;
514
-
515
- for (var i = 0; i < paths.length; ++i) {
516
- if (!current) return undefined;
517
-
518
- if (typeof current[paths[i]] === 'string' && i + 1 < paths.length) {
519
- return undefined;
520
- }
521
-
522
- if (current[paths[i]] === undefined) {
523
- var j = 2;
524
- var p = paths.slice(i, i + j).join(keySeparator);
525
- var mix = current[p];
526
-
527
- while (mix === undefined && paths.length > i + j) {
528
- j++;
529
- p = paths.slice(i, i + j).join(keySeparator);
530
- mix = current[p];
531
- }
532
-
533
- if (mix === undefined) return undefined;
534
- if (mix === null) return null;
535
-
536
- if (path.endsWith(p)) {
537
- if (typeof mix === 'string') return mix;
538
- if (p && typeof mix[p] === 'string') return mix[p];
539
- }
540
-
541
- var joinedPath = paths.slice(i + j).join(keySeparator);
542
- if (joinedPath) return deepFind(mix, joinedPath, keySeparator);
543
- return undefined;
544
- }
545
-
546
- current = current[paths[i]];
547
- }
548
-
549
- return current;
550
- }
551
-
552
- var ResourceStore = function (_EventEmitter) {
553
- _inherits(ResourceStore, _EventEmitter);
554
-
555
- var _super = _createSuper(ResourceStore);
556
-
557
- function ResourceStore(data) {
558
- var _this;
559
-
560
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
561
- ns: ['translation'],
562
- defaultNS: 'translation'
563
- };
564
-
565
- _classCallCheck(this, ResourceStore);
566
-
567
- _this = _super.call(this);
568
-
569
- if (isIE10) {
570
- EventEmitter.call(_assertThisInitialized(_this));
571
- }
572
-
573
- _this.data = data || {};
574
- _this.options = options;
575
-
576
- if (_this.options.keySeparator === undefined) {
577
- _this.options.keySeparator = '.';
578
- }
579
-
580
- if (_this.options.ignoreJSONStructure === undefined) {
581
- _this.options.ignoreJSONStructure = true;
582
- }
583
-
584
- return _this;
585
- }
586
-
587
- _createClass(ResourceStore, [{
588
- key: "addNamespaces",
589
- value: function addNamespaces(ns) {
590
- if (this.options.ns.indexOf(ns) < 0) {
591
- this.options.ns.push(ns);
592
- }
593
- }
594
- }, {
595
- key: "removeNamespaces",
596
- value: function removeNamespaces(ns) {
597
- var index = this.options.ns.indexOf(ns);
598
-
599
- if (index > -1) {
600
- this.options.ns.splice(index, 1);
601
- }
602
- }
603
- }, {
604
- key: "getResource",
605
- value: function getResource(lng, ns, key) {
606
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
607
- var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
608
- var ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;
609
- var path = [lng, ns];
610
- if (key && typeof key !== 'string') path = path.concat(key);
611
- if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key);
612
-
613
- if (lng.indexOf('.') > -1) {
614
- path = lng.split('.');
615
- }
616
-
617
- var result = getPath(this.data, path);
618
- if (result || !ignoreJSONStructure || typeof key !== 'string') return result;
619
- return deepFind(this.data && this.data[lng] && this.data[lng][ns], key, keySeparator);
620
- }
621
- }, {
622
- key: "addResource",
623
- value: function addResource(lng, ns, key, value) {
624
- var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
625
- silent: false
626
- };
627
- var keySeparator = this.options.keySeparator;
628
- if (keySeparator === undefined) keySeparator = '.';
629
- var path = [lng, ns];
630
- if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
631
-
632
- if (lng.indexOf('.') > -1) {
633
- path = lng.split('.');
634
- value = ns;
635
- ns = path[1];
636
- }
637
-
638
- this.addNamespaces(ns);
639
- setPath(this.data, path, value);
640
- if (!options.silent) this.emit('added', lng, ns, key, value);
641
- }
642
- }, {
643
- key: "addResources",
644
- value: function addResources(lng, ns, resources) {
645
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
646
- silent: false
647
- };
648
-
649
- for (var m in resources) {
650
- if (typeof resources[m] === 'string' || Object.prototype.toString.apply(resources[m]) === '[object Array]') this.addResource(lng, ns, m, resources[m], {
651
- silent: true
652
- });
653
- }
654
-
655
- if (!options.silent) this.emit('added', lng, ns, resources);
656
- }
657
- }, {
658
- key: "addResourceBundle",
659
- value: function addResourceBundle(lng, ns, resources, deep, overwrite) {
660
- var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {
661
- silent: false
662
- };
663
- var path = [lng, ns];
664
-
665
- if (lng.indexOf('.') > -1) {
666
- path = lng.split('.');
667
- deep = resources;
668
- resources = ns;
669
- ns = path[1];
670
- }
671
-
672
- this.addNamespaces(ns);
673
- var pack = getPath(this.data, path) || {};
674
-
675
- if (deep) {
676
- deepExtend(pack, resources, overwrite);
677
- } else {
678
- pack = _objectSpread2(_objectSpread2({}, pack), resources);
679
- }
680
-
681
- setPath(this.data, path, pack);
682
- if (!options.silent) this.emit('added', lng, ns, resources);
683
- }
684
- }, {
685
- key: "removeResourceBundle",
686
- value: function removeResourceBundle(lng, ns) {
687
- if (this.hasResourceBundle(lng, ns)) {
688
- delete this.data[lng][ns];
689
- }
690
-
691
- this.removeNamespaces(ns);
692
- this.emit('removed', lng, ns);
693
- }
694
- }, {
695
- key: "hasResourceBundle",
696
- value: function hasResourceBundle(lng, ns) {
697
- return this.getResource(lng, ns) !== undefined;
698
- }
699
- }, {
700
- key: "getResourceBundle",
701
- value: function getResourceBundle(lng, ns) {
702
- if (!ns) ns = this.options.defaultNS;
703
- if (this.options.compatibilityAPI === 'v1') return _objectSpread2(_objectSpread2({}, {}), this.getResource(lng, ns));
704
- return this.getResource(lng, ns);
705
- }
706
- }, {
707
- key: "getDataByLanguage",
708
- value: function getDataByLanguage(lng) {
709
- return this.data[lng];
710
- }
711
- }, {
712
- key: "hasLanguageSomeTranslations",
713
- value: function hasLanguageSomeTranslations(lng) {
714
- var data = this.getDataByLanguage(lng);
715
- var n = data && Object.keys(data) || [];
716
- return !!n.find(function (v) {
717
- return data[v] && Object.keys(data[v]).length > 0;
718
- });
719
- }
720
- }, {
721
- key: "toJSON",
722
- value: function toJSON() {
723
- return this.data;
724
- }
725
- }]);
726
-
727
- return ResourceStore;
728
- }(EventEmitter);
729
-
730
- var postProcessor = {
731
- processors: {},
732
- addPostProcessor: function addPostProcessor(module) {
733
- this.processors[module.name] = module;
734
- },
735
- handle: function handle(processors, value, key, options, translator) {
736
- var _this = this;
737
-
738
- processors.forEach(function (processor) {
739
- if (_this.processors[processor]) value = _this.processors[processor].process(value, key, options, translator);
740
- });
741
- return value;
742
- }
743
- };
744
-
745
- var checkedLoadedFor = {};
746
-
747
- var Translator = function (_EventEmitter) {
748
- _inherits(Translator, _EventEmitter);
749
-
750
- var _super = _createSuper(Translator);
751
-
752
- function Translator(services) {
753
- var _this;
754
-
755
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
756
-
757
- _classCallCheck(this, Translator);
758
-
759
- _this = _super.call(this);
760
-
761
- if (isIE10) {
762
- EventEmitter.call(_assertThisInitialized(_this));
763
- }
764
-
765
- copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, _assertThisInitialized(_this));
766
- _this.options = options;
767
-
768
- if (_this.options.keySeparator === undefined) {
769
- _this.options.keySeparator = '.';
770
- }
771
-
772
- _this.logger = baseLogger.create('translator');
773
- return _this;
774
- }
775
-
776
- _createClass(Translator, [{
777
- key: "changeLanguage",
778
- value: function changeLanguage(lng) {
779
- if (lng) this.language = lng;
780
- }
781
- }, {
782
- key: "exists",
783
- value: function exists(key) {
784
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
785
- interpolation: {}
786
- };
787
-
788
- if (key === undefined || key === null) {
789
- return false;
790
- }
791
-
792
- var resolved = this.resolve(key, options);
793
- return resolved && resolved.res !== undefined;
794
- }
795
- }, {
796
- key: "extractFromKey",
797
- value: function extractFromKey(key, options) {
798
- var nsSeparator = options.nsSeparator !== undefined ? options.nsSeparator : this.options.nsSeparator;
799
- if (nsSeparator === undefined) nsSeparator = ':';
800
- var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
801
- var namespaces = options.ns || this.options.defaultNS || [];
802
- var wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;
803
- var seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !options.keySeparator && !this.options.userDefinedNsSeparator && !options.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
804
-
805
- if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
806
- var m = key.match(this.interpolator.nestingRegexp);
807
-
808
- if (m && m.length > 0) {
809
- return {
810
- key: key,
811
- namespaces: namespaces
812
- };
813
- }
814
-
815
- var parts = key.split(nsSeparator);
816
- if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();
817
- key = parts.join(keySeparator);
818
- }
819
-
820
- if (typeof namespaces === 'string') namespaces = [namespaces];
821
- return {
822
- key: key,
823
- namespaces: namespaces
824
- };
825
- }
826
- }, {
827
- key: "translate",
828
- value: function translate(keys, options, lastKey) {
829
- var _this2 = this;
830
-
831
- if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) {
832
- options = this.options.overloadTranslationOptionHandler(arguments);
833
- }
834
-
835
- if (!options) options = {};
836
- if (keys === undefined || keys === null) return '';
837
- if (!Array.isArray(keys)) keys = [String(keys)];
838
- var returnDetails = options.returnDetails !== undefined ? options.returnDetails : this.options.returnDetails;
839
- var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
840
-
841
- var _this$extractFromKey = this.extractFromKey(keys[keys.length - 1], options),
842
- key = _this$extractFromKey.key,
843
- namespaces = _this$extractFromKey.namespaces;
844
-
845
- var namespace = namespaces[namespaces.length - 1];
846
- var lng = options.lng || this.language;
847
- var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
848
-
849
- if (lng && lng.toLowerCase() === 'cimode') {
850
- if (appendNamespaceToCIMode) {
851
- var nsSeparator = options.nsSeparator || this.options.nsSeparator;
852
-
853
- if (returnDetails) {
854
- resolved.res = "".concat(namespace).concat(nsSeparator).concat(key);
855
- return resolved;
856
- }
857
-
858
- return "".concat(namespace).concat(nsSeparator).concat(key);
859
- }
860
-
861
- if (returnDetails) {
862
- resolved.res = key;
863
- return resolved;
864
- }
865
-
866
- return key;
867
- }
868
-
869
- var resolved = this.resolve(keys, options);
870
- var res = resolved && resolved.res;
871
- var resUsedKey = resolved && resolved.usedKey || key;
872
- var resExactUsedKey = resolved && resolved.exactUsedKey || key;
873
- var resType = Object.prototype.toString.apply(res);
874
- var noObject = ['[object Number]', '[object Function]', '[object RegExp]'];
875
- var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays;
876
- var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
877
- var handleAsObject = typeof res !== 'string' && typeof res !== 'boolean' && typeof res !== 'number';
878
-
879
- if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === 'string' && resType === '[object Array]')) {
880
- if (!options.returnObjects && !this.options.returnObjects) {
881
- if (!this.options.returnedObjectHandler) {
882
- this.logger.warn('accessing an object - but returnObjects options is not enabled!');
883
- }
884
-
885
- var r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, _objectSpread2(_objectSpread2({}, options), {}, {
886
- ns: namespaces
887
- })) : "key '".concat(key, " (").concat(this.language, ")' returned an object instead of string.");
888
-
889
- if (returnDetails) {
890
- resolved.res = r;
891
- return resolved;
892
- }
893
-
894
- return r;
895
- }
896
-
897
- if (keySeparator) {
898
- var resTypeIsArray = resType === '[object Array]';
899
- var copy = resTypeIsArray ? [] : {};
900
- var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;
901
-
902
- for (var m in res) {
903
- if (Object.prototype.hasOwnProperty.call(res, m)) {
904
- var deepKey = "".concat(newKeyToUse).concat(keySeparator).concat(m);
905
- copy[m] = this.translate(deepKey, _objectSpread2(_objectSpread2({}, options), {
906
- joinArrays: false,
907
- ns: namespaces
908
- }));
909
- if (copy[m] === deepKey) copy[m] = res[m];
910
- }
911
- }
912
-
913
- res = copy;
914
- }
915
- } else if (handleAsObjectInI18nFormat && typeof joinArrays === 'string' && resType === '[object Array]') {
916
- res = res.join(joinArrays);
917
- if (res) res = this.extendTranslation(res, keys, options, lastKey);
918
- } else {
919
- var usedDefault = false;
920
- var usedKey = false;
921
- var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';
922
- var hasDefaultValue = Translator.hasDefaultValue(options);
923
- var defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, options) : '';
924
- var defaultValue = options["defaultValue".concat(defaultValueSuffix)] || options.defaultValue;
925
-
926
- if (!this.isValidLookup(res) && hasDefaultValue) {
927
- usedDefault = true;
928
- res = defaultValue;
929
- }
930
-
931
- if (!this.isValidLookup(res)) {
932
- usedKey = true;
933
- res = key;
934
- }
935
-
936
- var missingKeyNoValueFallbackToKey = options.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;
937
- var resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;
938
- var updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;
939
-
940
- if (usedKey || usedDefault || updateMissing) {
941
- this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);
942
-
943
- if (keySeparator) {
944
- var fk = this.resolve(key, _objectSpread2(_objectSpread2({}, options), {}, {
945
- keySeparator: false
946
- }));
947
- if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');
948
- }
949
-
950
- var lngs = [];
951
- var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language);
952
-
953
- if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {
954
- for (var i = 0; i < fallbackLngs.length; i++) {
955
- lngs.push(fallbackLngs[i]);
956
- }
957
- } else if (this.options.saveMissingTo === 'all') {
958
- lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language);
959
- } else {
960
- lngs.push(options.lng || this.language);
961
- }
962
-
963
- var send = function send(l, k, specificDefaultValue) {
964
- var defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
965
-
966
- if (_this2.options.missingKeyHandler) {
967
- _this2.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options);
968
- } else if (_this2.backendConnector && _this2.backendConnector.saveMissing) {
969
- _this2.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options);
970
- }
971
-
972
- _this2.emit('missingKey', l, namespace, k, res);
973
- };
974
-
975
- if (this.options.saveMissing) {
976
- if (this.options.saveMissingPlurals && needsPluralHandling) {
977
- lngs.forEach(function (language) {
978
- _this2.pluralResolver.getSuffixes(language, options).forEach(function (suffix) {
979
- send([language], key + suffix, options["defaultValue".concat(suffix)] || defaultValue);
980
- });
981
- });
982
- } else {
983
- send(lngs, key, defaultValue);
984
- }
985
- }
986
- }
987
-
988
- res = this.extendTranslation(res, keys, options, resolved, lastKey);
989
- if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = "".concat(namespace, ":").concat(key);
990
-
991
- if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
992
- if (this.options.compatibilityAPI !== 'v1') {
993
- res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? "".concat(namespace, ":").concat(key) : key, usedDefault ? res : undefined);
994
- } else {
995
- res = this.options.parseMissingKeyHandler(res);
996
- }
997
- }
998
- }
999
-
1000
- if (returnDetails) {
1001
- resolved.res = res;
1002
- return resolved;
1003
- }
1004
-
1005
- return res;
1006
- }
1007
- }, {
1008
- key: "extendTranslation",
1009
- value: function extendTranslation(res, key, options, resolved, lastKey) {
1010
- var _this3 = this;
1011
-
1012
- if (this.i18nFormat && this.i18nFormat.parse) {
1013
- res = this.i18nFormat.parse(res, _objectSpread2(_objectSpread2({}, this.options.interpolation.defaultVariables), options), resolved.usedLng, resolved.usedNS, resolved.usedKey, {
1014
- resolved: resolved
1015
- });
1016
- } else if (!options.skipInterpolation) {
1017
- if (options.interpolation) this.interpolator.init(_objectSpread2(_objectSpread2({}, options), {
1018
- interpolation: _objectSpread2(_objectSpread2({}, this.options.interpolation), options.interpolation)
1019
- }));
1020
- var skipOnVariables = typeof res === 'string' && (options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
1021
- var nestBef;
1022
-
1023
- if (skipOnVariables) {
1024
- var nb = res.match(this.interpolator.nestingRegexp);
1025
- nestBef = nb && nb.length;
1026
- }
1027
-
1028
- var data = options.replace && typeof options.replace !== 'string' ? options.replace : options;
1029
- if (this.options.interpolation.defaultVariables) data = _objectSpread2(_objectSpread2({}, this.options.interpolation.defaultVariables), data);
1030
- res = this.interpolator.interpolate(res, data, options.lng || this.language, options);
1031
-
1032
- if (skipOnVariables) {
1033
- var na = res.match(this.interpolator.nestingRegexp);
1034
- var nestAft = na && na.length;
1035
- if (nestBef < nestAft) options.nest = false;
1036
- }
1037
-
1038
- if (options.nest !== false) res = this.interpolator.nest(res, function () {
1039
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1040
- args[_key] = arguments[_key];
1041
- }
1042
-
1043
- if (lastKey && lastKey[0] === args[0] && !options.context) {
1044
- _this3.logger.warn("It seems you are nesting recursively key: ".concat(args[0], " in key: ").concat(key[0]));
1045
-
1046
- return null;
1047
- }
1048
-
1049
- return _this3.translate.apply(_this3, args.concat([key]));
1050
- }, options);
1051
- if (options.interpolation) this.interpolator.reset();
1052
- }
1053
-
1054
- var postProcess = options.postProcess || this.options.postProcess;
1055
- var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess;
1056
-
1057
- if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {
1058
- res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread2({
1059
- i18nResolved: resolved
1060
- }, options) : options, this);
1061
- }
1062
-
1063
- return res;
1064
- }
1065
- }, {
1066
- key: "resolve",
1067
- value: function resolve(keys) {
1068
- var _this4 = this;
1069
-
1070
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1071
- var found;
1072
- var usedKey;
1073
- var exactUsedKey;
1074
- var usedLng;
1075
- var usedNS;
1076
- if (typeof keys === 'string') keys = [keys];
1077
- keys.forEach(function (k) {
1078
- if (_this4.isValidLookup(found)) return;
1079
-
1080
- var extracted = _this4.extractFromKey(k, options);
1081
-
1082
- var key = extracted.key;
1083
- usedKey = key;
1084
- var namespaces = extracted.namespaces;
1085
- if (_this4.options.fallbackNS) namespaces = namespaces.concat(_this4.options.fallbackNS);
1086
- var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';
1087
-
1088
- var needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && _this4.pluralResolver.shouldUseIntlApi();
1089
-
1090
- var needsContextHandling = options.context !== undefined && (typeof options.context === 'string' || typeof options.context === 'number') && options.context !== '';
1091
- var codes = options.lngs ? options.lngs : _this4.languageUtils.toResolveHierarchy(options.lng || _this4.language, options.fallbackLng);
1092
- namespaces.forEach(function (ns) {
1093
- if (_this4.isValidLookup(found)) return;
1094
- usedNS = ns;
1095
-
1096
- if (!checkedLoadedFor["".concat(codes[0], "-").concat(ns)] && _this4.utils && _this4.utils.hasLoadedNamespace && !_this4.utils.hasLoadedNamespace(usedNS)) {
1097
- checkedLoadedFor["".concat(codes[0], "-").concat(ns)] = true;
1098
-
1099
- _this4.logger.warn("key \"".concat(usedKey, "\" for languages \"").concat(codes.join(', '), "\" won't get resolved as namespace \"").concat(usedNS, "\" was not yet loaded"), 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
1100
- }
1101
-
1102
- codes.forEach(function (code) {
1103
- if (_this4.isValidLookup(found)) return;
1104
- usedLng = code;
1105
- var finalKeys = [key];
1106
-
1107
- if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) {
1108
- _this4.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);
1109
- } else {
1110
- var pluralSuffix;
1111
- if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count, options);
1112
- var zeroSuffix = '_zero';
1113
-
1114
- if (needsPluralHandling) {
1115
- finalKeys.push(key + pluralSuffix);
1116
-
1117
- if (needsZeroSuffixLookup) {
1118
- finalKeys.push(key + zeroSuffix);
1119
- }
1120
- }
1121
-
1122
- if (needsContextHandling) {
1123
- var contextKey = "".concat(key).concat(_this4.options.contextSeparator).concat(options.context);
1124
- finalKeys.push(contextKey);
1125
-
1126
- if (needsPluralHandling) {
1127
- finalKeys.push(contextKey + pluralSuffix);
1128
-
1129
- if (needsZeroSuffixLookup) {
1130
- finalKeys.push(contextKey + zeroSuffix);
1131
- }
1132
- }
1133
- }
1134
- }
1135
-
1136
- var possibleKey;
1137
-
1138
- while (possibleKey = finalKeys.pop()) {
1139
- if (!_this4.isValidLookup(found)) {
1140
- exactUsedKey = possibleKey;
1141
- found = _this4.getResource(code, ns, possibleKey, options);
1142
- }
1143
- }
1144
- });
1145
- });
1146
- });
1147
- return {
1148
- res: found,
1149
- usedKey: usedKey,
1150
- exactUsedKey: exactUsedKey,
1151
- usedLng: usedLng,
1152
- usedNS: usedNS
1153
- };
1154
- }
1155
- }, {
1156
- key: "isValidLookup",
1157
- value: function isValidLookup(res) {
1158
- return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');
1159
- }
1160
- }, {
1161
- key: "getResource",
1162
- value: function getResource(code, ns, key) {
1163
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1164
- if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options);
1165
- return this.resourceStore.getResource(code, ns, key, options);
1166
- }
1167
- }], [{
1168
- key: "hasDefaultValue",
1169
- value: function hasDefaultValue(options) {
1170
- var prefix = 'defaultValue';
1171
-
1172
- for (var option in options) {
1173
- if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {
1174
- return true;
1175
- }
1176
- }
1177
-
1178
- return false;
1179
- }
1180
- }]);
1181
-
1182
- return Translator;
1183
- }(EventEmitter);
1184
-
1185
- function capitalize(string) {
1186
- return string.charAt(0).toUpperCase() + string.slice(1);
1187
- }
1188
-
1189
- var LanguageUtil = function () {
1190
- function LanguageUtil(options) {
1191
- _classCallCheck(this, LanguageUtil);
1192
-
1193
- this.options = options;
1194
- this.supportedLngs = this.options.supportedLngs || false;
1195
- this.logger = baseLogger.create('languageUtils');
1196
- }
1197
-
1198
- _createClass(LanguageUtil, [{
1199
- key: "getScriptPartFromCode",
1200
- value: function getScriptPartFromCode(code) {
1201
- if (!code || code.indexOf('-') < 0) return null;
1202
- var p = code.split('-');
1203
- if (p.length === 2) return null;
1204
- p.pop();
1205
- if (p[p.length - 1].toLowerCase() === 'x') return null;
1206
- return this.formatLanguageCode(p.join('-'));
1207
- }
1208
- }, {
1209
- key: "getLanguagePartFromCode",
1210
- value: function getLanguagePartFromCode(code) {
1211
- if (!code || code.indexOf('-') < 0) return code;
1212
- var p = code.split('-');
1213
- return this.formatLanguageCode(p[0]);
1214
- }
1215
- }, {
1216
- key: "formatLanguageCode",
1217
- value: function formatLanguageCode(code) {
1218
- if (typeof code === 'string' && code.indexOf('-') > -1) {
1219
- var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab'];
1220
- var p = code.split('-');
1221
-
1222
- if (this.options.lowerCaseLng) {
1223
- p = p.map(function (part) {
1224
- return part.toLowerCase();
1225
- });
1226
- } else if (p.length === 2) {
1227
- p[0] = p[0].toLowerCase();
1228
- p[1] = p[1].toUpperCase();
1229
- if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
1230
- } else if (p.length === 3) {
1231
- p[0] = p[0].toLowerCase();
1232
- if (p[1].length === 2) p[1] = p[1].toUpperCase();
1233
- if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase();
1234
- if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
1235
- if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());
1236
- }
1237
-
1238
- return p.join('-');
1239
- }
1240
-
1241
- return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
1242
- }
1243
- }, {
1244
- key: "isSupportedCode",
1245
- value: function isSupportedCode(code) {
1246
- if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {
1247
- code = this.getLanguagePartFromCode(code);
1248
- }
1249
-
1250
- return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
1251
- }
1252
- }, {
1253
- key: "getBestMatchFromCodes",
1254
- value: function getBestMatchFromCodes(codes) {
1255
- var _this = this;
1256
-
1257
- if (!codes) return null;
1258
- var found;
1259
- codes.forEach(function (code) {
1260
- if (found) return;
1261
-
1262
- var cleanedLng = _this.formatLanguageCode(code);
1263
-
1264
- if (!_this.options.supportedLngs || _this.isSupportedCode(cleanedLng)) found = cleanedLng;
1265
- });
1266
-
1267
- if (!found && this.options.supportedLngs) {
1268
- codes.forEach(function (code) {
1269
- if (found) return;
1270
-
1271
- var lngOnly = _this.getLanguagePartFromCode(code);
1272
-
1273
- if (_this.isSupportedCode(lngOnly)) return found = lngOnly;
1274
- found = _this.options.supportedLngs.find(function (supportedLng) {
1275
- if (supportedLng.indexOf(lngOnly) === 0) return supportedLng;
1276
- });
1277
- });
1278
- }
1279
-
1280
- if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];
1281
- return found;
1282
- }
1283
- }, {
1284
- key: "getFallbackCodes",
1285
- value: function getFallbackCodes(fallbacks, code) {
1286
- if (!fallbacks) return [];
1287
- if (typeof fallbacks === 'function') fallbacks = fallbacks(code);
1288
- if (typeof fallbacks === 'string') fallbacks = [fallbacks];
1289
- if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks;
1290
- if (!code) return fallbacks["default"] || [];
1291
- var found = fallbacks[code];
1292
- if (!found) found = fallbacks[this.getScriptPartFromCode(code)];
1293
- if (!found) found = fallbacks[this.formatLanguageCode(code)];
1294
- if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];
1295
- if (!found) found = fallbacks["default"];
1296
- return found || [];
1297
- }
1298
- }, {
1299
- key: "toResolveHierarchy",
1300
- value: function toResolveHierarchy(code, fallbackCode) {
1301
- var _this2 = this;
1302
-
1303
- var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);
1304
- var codes = [];
1305
-
1306
- var addCode = function addCode(c) {
1307
- if (!c) return;
1308
-
1309
- if (_this2.isSupportedCode(c)) {
1310
- codes.push(c);
1311
- } else {
1312
- _this2.logger.warn("rejecting language code not found in supportedLngs: ".concat(c));
1313
- }
1314
- };
1315
-
1316
- if (typeof code === 'string' && code.indexOf('-') > -1) {
1317
- if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));
1318
- if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));
1319
- if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));
1320
- } else if (typeof code === 'string') {
1321
- addCode(this.formatLanguageCode(code));
1322
- }
1323
-
1324
- fallbackCodes.forEach(function (fc) {
1325
- if (codes.indexOf(fc) < 0) addCode(_this2.formatLanguageCode(fc));
1326
- });
1327
- return codes;
1328
- }
1329
- }]);
1330
-
1331
- return LanguageUtil;
1332
- }();
1333
-
1334
- var sets = [{
1335
- lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'pt', 'pt-BR', 'tg', 'tl', 'ti', 'tr', 'uz', 'wa'],
1336
- nr: [1, 2],
1337
- fc: 1
1338
- }, {
1339
- lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'hi', 'hu', 'hy', 'ia', 'it', 'kk', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt-PT', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'],
1340
- nr: [1, 2],
1341
- fc: 2
1342
- }, {
1343
- lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
1344
- nr: [1],
1345
- fc: 3
1346
- }, {
1347
- lngs: ['be', 'bs', 'cnr', 'dz', 'hr', 'ru', 'sr', 'uk'],
1348
- nr: [1, 2, 5],
1349
- fc: 4
1350
- }, {
1351
- lngs: ['ar'],
1352
- nr: [0, 1, 2, 3, 11, 100],
1353
- fc: 5
1354
- }, {
1355
- lngs: ['cs', 'sk'],
1356
- nr: [1, 2, 5],
1357
- fc: 6
1358
- }, {
1359
- lngs: ['csb', 'pl'],
1360
- nr: [1, 2, 5],
1361
- fc: 7
1362
- }, {
1363
- lngs: ['cy'],
1364
- nr: [1, 2, 3, 8],
1365
- fc: 8
1366
- }, {
1367
- lngs: ['fr'],
1368
- nr: [1, 2],
1369
- fc: 9
1370
- }, {
1371
- lngs: ['ga'],
1372
- nr: [1, 2, 3, 7, 11],
1373
- fc: 10
1374
- }, {
1375
- lngs: ['gd'],
1376
- nr: [1, 2, 3, 20],
1377
- fc: 11
1378
- }, {
1379
- lngs: ['is'],
1380
- nr: [1, 2],
1381
- fc: 12
1382
- }, {
1383
- lngs: ['jv'],
1384
- nr: [0, 1],
1385
- fc: 13
1386
- }, {
1387
- lngs: ['kw'],
1388
- nr: [1, 2, 3, 4],
1389
- fc: 14
1390
- }, {
1391
- lngs: ['lt'],
1392
- nr: [1, 2, 10],
1393
- fc: 15
1394
- }, {
1395
- lngs: ['lv'],
1396
- nr: [1, 2, 0],
1397
- fc: 16
1398
- }, {
1399
- lngs: ['mk'],
1400
- nr: [1, 2],
1401
- fc: 17
1402
- }, {
1403
- lngs: ['mnk'],
1404
- nr: [0, 1, 2],
1405
- fc: 18
1406
- }, {
1407
- lngs: ['mt'],
1408
- nr: [1, 2, 11, 20],
1409
- fc: 19
1410
- }, {
1411
- lngs: ['or'],
1412
- nr: [2, 1],
1413
- fc: 2
1414
- }, {
1415
- lngs: ['ro'],
1416
- nr: [1, 2, 20],
1417
- fc: 20
1418
- }, {
1419
- lngs: ['sl'],
1420
- nr: [5, 1, 2, 3],
1421
- fc: 21
1422
- }, {
1423
- lngs: ['he', 'iw'],
1424
- nr: [1, 2, 20, 21],
1425
- fc: 22
1426
- }];
1427
- var _rulesPluralsTypes = {
1428
- 1: function _(n) {
1429
- return Number(n > 1);
1430
- },
1431
- 2: function _(n) {
1432
- return Number(n != 1);
1433
- },
1434
- 3: function _(n) {
1435
- return 0;
1436
- },
1437
- 4: function _(n) {
1438
- return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
1439
- },
1440
- 5: function _(n) {
1441
- return Number(n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5);
1442
- },
1443
- 6: function _(n) {
1444
- return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2);
1445
- },
1446
- 7: function _(n) {
1447
- return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
1448
- },
1449
- 8: function _(n) {
1450
- return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3);
1451
- },
1452
- 9: function _(n) {
1453
- return Number(n >= 2);
1454
- },
1455
- 10: function _(n) {
1456
- return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4);
1457
- },
1458
- 11: function _(n) {
1459
- return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3);
1460
- },
1461
- 12: function _(n) {
1462
- return Number(n % 10 != 1 || n % 100 == 11);
1463
- },
1464
- 13: function _(n) {
1465
- return Number(n !== 0);
1466
- },
1467
- 14: function _(n) {
1468
- return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3);
1469
- },
1470
- 15: function _(n) {
1471
- return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
1472
- },
1473
- 16: function _(n) {
1474
- return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2);
1475
- },
1476
- 17: function _(n) {
1477
- return Number(n == 1 || n % 10 == 1 && n % 100 != 11 ? 0 : 1);
1478
- },
1479
- 18: function _(n) {
1480
- return Number(n == 0 ? 0 : n == 1 ? 1 : 2);
1481
- },
1482
- 19: function _(n) {
1483
- return Number(n == 1 ? 0 : n == 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3);
1484
- },
1485
- 20: function _(n) {
1486
- return Number(n == 1 ? 0 : n == 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2);
1487
- },
1488
- 21: function _(n) {
1489
- return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0);
1490
- },
1491
- 22: function _(n) {
1492
- return Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3);
1493
- }
1494
- };
1495
- var deprecatedJsonVersions = ['v1', 'v2', 'v3'];
1496
- var suffixesOrder = {
1497
- zero: 0,
1498
- one: 1,
1499
- two: 2,
1500
- few: 3,
1501
- many: 4,
1502
- other: 5
1503
- };
1504
-
1505
- function createRules() {
1506
- var rules = {};
1507
- sets.forEach(function (set) {
1508
- set.lngs.forEach(function (l) {
1509
- rules[l] = {
1510
- numbers: set.nr,
1511
- plurals: _rulesPluralsTypes[set.fc]
1512
- };
1513
- });
1514
- });
1515
- return rules;
1516
- }
1517
-
1518
- var PluralResolver = function () {
1519
- function PluralResolver(languageUtils) {
1520
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1521
-
1522
- _classCallCheck(this, PluralResolver);
1523
-
1524
- this.languageUtils = languageUtils;
1525
- this.options = options;
1526
- this.logger = baseLogger.create('pluralResolver');
1527
-
1528
- if ((!this.options.compatibilityJSON || this.options.compatibilityJSON === 'v4') && (typeof Intl === 'undefined' || !Intl.PluralRules)) {
1529
- this.options.compatibilityJSON = 'v3';
1530
- this.logger.error('Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.');
1531
- }
1532
-
1533
- this.rules = createRules();
1534
- }
1535
-
1536
- _createClass(PluralResolver, [{
1537
- key: "addRule",
1538
- value: function addRule(lng, obj) {
1539
- this.rules[lng] = obj;
1540
- }
1541
- }, {
1542
- key: "getRule",
1543
- value: function getRule(code) {
1544
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1545
-
1546
- if (this.shouldUseIntlApi()) {
1547
- try {
1548
- return new Intl.PluralRules(code, {
1549
- type: options.ordinal ? 'ordinal' : 'cardinal'
1550
- });
1551
- } catch (_unused) {
1552
- return;
1553
- }
1554
- }
1555
-
1556
- return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];
1557
- }
1558
- }, {
1559
- key: "needsPlural",
1560
- value: function needsPlural(code) {
1561
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1562
- var rule = this.getRule(code, options);
1563
-
1564
- if (this.shouldUseIntlApi()) {
1565
- return rule && rule.resolvedOptions().pluralCategories.length > 1;
1566
- }
1567
-
1568
- return rule && rule.numbers.length > 1;
1569
- }
1570
- }, {
1571
- key: "getPluralFormsOfKey",
1572
- value: function getPluralFormsOfKey(code, key) {
1573
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1574
- return this.getSuffixes(code, options).map(function (suffix) {
1575
- return "".concat(key).concat(suffix);
1576
- });
1577
- }
1578
- }, {
1579
- key: "getSuffixes",
1580
- value: function getSuffixes(code) {
1581
- var _this = this;
1582
-
1583
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1584
- var rule = this.getRule(code, options);
1585
-
1586
- if (!rule) {
1587
- return [];
1588
- }
1589
-
1590
- if (this.shouldUseIntlApi()) {
1591
- return rule.resolvedOptions().pluralCategories.sort(function (pluralCategory1, pluralCategory2) {
1592
- return suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2];
1593
- }).map(function (pluralCategory) {
1594
- return "".concat(_this.options.prepend).concat(pluralCategory);
1595
- });
1596
- }
1597
-
1598
- return rule.numbers.map(function (number) {
1599
- return _this.getSuffix(code, number, options);
1600
- });
1601
- }
1602
- }, {
1603
- key: "getSuffix",
1604
- value: function getSuffix(code, count) {
1605
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1606
- var rule = this.getRule(code, options);
1607
-
1608
- if (rule) {
1609
- if (this.shouldUseIntlApi()) {
1610
- return "".concat(this.options.prepend).concat(rule.select(count));
1611
- }
1612
-
1613
- return this.getSuffixRetroCompatible(rule, count);
1614
- }
1615
-
1616
- this.logger.warn("no plural rule found for: ".concat(code));
1617
- return '';
1618
- }
1619
- }, {
1620
- key: "getSuffixRetroCompatible",
1621
- value: function getSuffixRetroCompatible(rule, count) {
1622
- var _this2 = this;
1623
-
1624
- var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));
1625
- var suffix = rule.numbers[idx];
1626
-
1627
- if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
1628
- if (suffix === 2) {
1629
- suffix = 'plural';
1630
- } else if (suffix === 1) {
1631
- suffix = '';
1632
- }
1633
- }
1634
-
1635
- var returnSuffix = function returnSuffix() {
1636
- return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString();
1637
- };
1638
-
1639
- if (this.options.compatibilityJSON === 'v1') {
1640
- if (suffix === 1) return '';
1641
- if (typeof suffix === 'number') return "_plural_".concat(suffix.toString());
1642
- return returnSuffix();
1643
- } else if (this.options.compatibilityJSON === 'v2') {
1644
- return returnSuffix();
1645
- } else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
1646
- return returnSuffix();
1647
- }
1648
-
1649
- return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();
1650
- }
1651
- }, {
1652
- key: "shouldUseIntlApi",
1653
- value: function shouldUseIntlApi() {
1654
- return !deprecatedJsonVersions.includes(this.options.compatibilityJSON);
1655
- }
1656
- }]);
1657
-
1658
- return PluralResolver;
1659
- }();
1660
-
1661
- var Interpolator = function () {
1662
- function Interpolator() {
1663
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1664
-
1665
- _classCallCheck(this, Interpolator);
1666
-
1667
- this.logger = baseLogger.create('interpolator');
1668
- this.options = options;
1669
-
1670
- this.format = options.interpolation && options.interpolation.format || function (value) {
1671
- return value;
1672
- };
1673
-
1674
- this.init(options);
1675
- }
1676
-
1677
- _createClass(Interpolator, [{
1678
- key: "init",
1679
- value: function init() {
1680
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1681
- if (!options.interpolation) options.interpolation = {
1682
- escapeValue: true
1683
- };
1684
- var iOpts = options.interpolation;
1685
- this.escape = iOpts.escape !== undefined ? iOpts.escape : escape;
1686
- this.escapeValue = iOpts.escapeValue !== undefined ? iOpts.escapeValue : true;
1687
- this.useRawValueToEscape = iOpts.useRawValueToEscape !== undefined ? iOpts.useRawValueToEscape : false;
1688
- this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{';
1689
- this.suffix = iOpts.suffix ? regexEscape(iOpts.suffix) : iOpts.suffixEscaped || '}}';
1690
- this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';
1691
- this.unescapePrefix = iOpts.unescapeSuffix ? '' : iOpts.unescapePrefix || '-';
1692
- this.unescapeSuffix = this.unescapePrefix ? '' : iOpts.unescapeSuffix || '';
1693
- this.nestingPrefix = iOpts.nestingPrefix ? regexEscape(iOpts.nestingPrefix) : iOpts.nestingPrefixEscaped || regexEscape('$t(');
1694
- this.nestingSuffix = iOpts.nestingSuffix ? regexEscape(iOpts.nestingSuffix) : iOpts.nestingSuffixEscaped || regexEscape(')');
1695
- this.nestingOptionsSeparator = iOpts.nestingOptionsSeparator ? iOpts.nestingOptionsSeparator : iOpts.nestingOptionsSeparator || ',';
1696
- this.maxReplaces = iOpts.maxReplaces ? iOpts.maxReplaces : 1000;
1697
- this.alwaysFormat = iOpts.alwaysFormat !== undefined ? iOpts.alwaysFormat : false;
1698
- this.resetRegExp();
1699
- }
1700
- }, {
1701
- key: "reset",
1702
- value: function reset() {
1703
- if (this.options) this.init(this.options);
1704
- }
1705
- }, {
1706
- key: "resetRegExp",
1707
- value: function resetRegExp() {
1708
- var regexpStr = "".concat(this.prefix, "(.+?)").concat(this.suffix);
1709
- this.regexp = new RegExp(regexpStr, 'g');
1710
- var regexpUnescapeStr = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix);
1711
- this.regexpUnescape = new RegExp(regexpUnescapeStr, 'g');
1712
- var nestingRegexpStr = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix);
1713
- this.nestingRegexp = new RegExp(nestingRegexpStr, 'g');
1714
- }
1715
- }, {
1716
- key: "interpolate",
1717
- value: function interpolate(str, data, lng, options) {
1718
- var _this = this;
1719
-
1720
- var match;
1721
- var value;
1722
- var replaces;
1723
- var defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
1724
-
1725
- function regexSafe(val) {
1726
- return val.replace(/\$/g, '$$$$');
1727
- }
1728
-
1729
- var handleFormat = function handleFormat(key) {
1730
- if (key.indexOf(_this.formatSeparator) < 0) {
1731
- var path = getPathWithDefaults(data, defaultData, key);
1732
- return _this.alwaysFormat ? _this.format(path, undefined, lng, _objectSpread2(_objectSpread2(_objectSpread2({}, options), data), {}, {
1733
- interpolationkey: key
1734
- })) : path;
1735
- }
1736
-
1737
- var p = key.split(_this.formatSeparator);
1738
- var k = p.shift().trim();
1739
- var f = p.join(_this.formatSeparator).trim();
1740
- return _this.format(getPathWithDefaults(data, defaultData, k), f, lng, _objectSpread2(_objectSpread2(_objectSpread2({}, options), data), {}, {
1741
- interpolationkey: k
1742
- }));
1743
- };
1744
-
1745
- this.resetRegExp();
1746
- var missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;
1747
- var skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
1748
- var todos = [{
1749
- regex: this.regexpUnescape,
1750
- safeValue: function safeValue(val) {
1751
- return regexSafe(val);
1752
- }
1753
- }, {
1754
- regex: this.regexp,
1755
- safeValue: function safeValue(val) {
1756
- return _this.escapeValue ? regexSafe(_this.escape(val)) : regexSafe(val);
1757
- }
1758
- }];
1759
- todos.forEach(function (todo) {
1760
- replaces = 0;
1761
-
1762
- while (match = todo.regex.exec(str)) {
1763
- var matchedVar = match[1].trim();
1764
- value = handleFormat(matchedVar);
1765
-
1766
- if (value === undefined) {
1767
- if (typeof missingInterpolationHandler === 'function') {
1768
- var temp = missingInterpolationHandler(str, match, options);
1769
- value = typeof temp === 'string' ? temp : '';
1770
- } else if (options && options.hasOwnProperty(matchedVar)) {
1771
- value = '';
1772
- } else if (skipOnVariables) {
1773
- value = match[0];
1774
- continue;
1775
- } else {
1776
- _this.logger.warn("missed to pass in variable ".concat(matchedVar, " for interpolating ").concat(str));
1777
-
1778
- value = '';
1779
- }
1780
- } else if (typeof value !== 'string' && !_this.useRawValueToEscape) {
1781
- value = makeString(value);
1782
- }
1783
-
1784
- var safeValue = todo.safeValue(value);
1785
- str = str.replace(match[0], safeValue);
1786
-
1787
- if (skipOnVariables) {
1788
- todo.regex.lastIndex += value.length;
1789
- todo.regex.lastIndex -= match[0].length;
1790
- } else {
1791
- todo.regex.lastIndex = 0;
1792
- }
1793
-
1794
- replaces++;
1795
-
1796
- if (replaces >= _this.maxReplaces) {
1797
- break;
1798
- }
1799
- }
1800
- });
1801
- return str;
1802
- }
1803
- }, {
1804
- key: "nest",
1805
- value: function nest(str, fc) {
1806
- var _this2 = this;
1807
-
1808
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1809
- var match;
1810
- var value;
1811
-
1812
- var clonedOptions = _objectSpread2({}, options);
1813
-
1814
- clonedOptions.applyPostProcessor = false;
1815
- delete clonedOptions.defaultValue;
1816
-
1817
- function handleHasOptions(key, inheritedOptions) {
1818
- var sep = this.nestingOptionsSeparator;
1819
- if (key.indexOf(sep) < 0) return key;
1820
- var c = key.split(new RegExp("".concat(sep, "[ ]*{")));
1821
- var optionsString = "{".concat(c[1]);
1822
- key = c[0];
1823
- optionsString = this.interpolate(optionsString, clonedOptions);
1824
- optionsString = optionsString.replace(/'/g, '"');
1825
-
1826
- try {
1827
- clonedOptions = JSON.parse(optionsString);
1828
- if (inheritedOptions) clonedOptions = _objectSpread2(_objectSpread2({}, inheritedOptions), clonedOptions);
1829
- } catch (e) {
1830
- this.logger.warn("failed parsing options string in nesting for key ".concat(key), e);
1831
- return "".concat(key).concat(sep).concat(optionsString);
1832
- }
1833
-
1834
- delete clonedOptions.defaultValue;
1835
- return key;
1836
- }
1837
-
1838
- while (match = this.nestingRegexp.exec(str)) {
1839
- var formatters = [];
1840
- var doReduce = false;
1841
-
1842
- if (match[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(match[1])) {
1843
- var r = match[1].split(this.formatSeparator).map(function (elem) {
1844
- return elem.trim();
1845
- });
1846
- match[1] = r.shift();
1847
- formatters = r;
1848
- doReduce = true;
1849
- }
1850
-
1851
- value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);
1852
- if (value && match[0] === str && typeof value !== 'string') return value;
1853
- if (typeof value !== 'string') value = makeString(value);
1854
-
1855
- if (!value) {
1856
- this.logger.warn("missed to resolve ".concat(match[1], " for nesting ").concat(str));
1857
- value = '';
1858
- }
1859
-
1860
- if (doReduce) {
1861
- value = formatters.reduce(function (v, f) {
1862
- return _this2.format(v, f, options.lng, _objectSpread2(_objectSpread2({}, options), {}, {
1863
- interpolationkey: match[1].trim()
1864
- }));
1865
- }, value.trim());
1866
- }
1867
-
1868
- str = str.replace(match[0], value);
1869
- this.regexp.lastIndex = 0;
1870
- }
1871
-
1872
- return str;
1873
- }
1874
- }]);
1875
-
1876
- return Interpolator;
1877
- }();
1878
-
1879
- function parseFormatStr(formatStr) {
1880
- var formatName = formatStr.toLowerCase().trim();
1881
- var formatOptions = {};
1882
-
1883
- if (formatStr.indexOf('(') > -1) {
1884
- var p = formatStr.split('(');
1885
- formatName = p[0].toLowerCase().trim();
1886
- var optStr = p[1].substring(0, p[1].length - 1);
1887
-
1888
- if (formatName === 'currency' && optStr.indexOf(':') < 0) {
1889
- if (!formatOptions.currency) formatOptions.currency = optStr.trim();
1890
- } else if (formatName === 'relativetime' && optStr.indexOf(':') < 0) {
1891
- if (!formatOptions.range) formatOptions.range = optStr.trim();
1892
- } else {
1893
- var opts = optStr.split(';');
1894
- opts.forEach(function (opt) {
1895
- if (!opt) return;
1896
-
1897
- var _opt$split = opt.split(':'),
1898
- _opt$split2 = _toArray(_opt$split),
1899
- key = _opt$split2[0],
1900
- rest = _opt$split2.slice(1);
1901
-
1902
- var val = rest.join(':').trim().replace(/^'+|'+$/g, '');
1903
- if (!formatOptions[key.trim()]) formatOptions[key.trim()] = val;
1904
- if (val === 'false') formatOptions[key.trim()] = false;
1905
- if (val === 'true') formatOptions[key.trim()] = true;
1906
- if (!isNaN(val)) formatOptions[key.trim()] = parseInt(val, 10);
1907
- });
1908
- }
1909
- }
1910
-
1911
- return {
1912
- formatName: formatName,
1913
- formatOptions: formatOptions
1914
- };
1915
- }
1916
-
1917
- var Formatter = function () {
1918
- function Formatter() {
1919
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1920
-
1921
- _classCallCheck(this, Formatter);
1922
-
1923
- this.logger = baseLogger.create('formatter');
1924
- this.options = options;
1925
- this.formats = {
1926
- number: function number(val, lng, options) {
1927
- return new Intl.NumberFormat(lng, options).format(val);
1928
- },
1929
- currency: function currency(val, lng, options) {
1930
- return new Intl.NumberFormat(lng, _objectSpread2(_objectSpread2({}, options), {}, {
1931
- style: 'currency'
1932
- })).format(val);
1933
- },
1934
- datetime: function datetime(val, lng, options) {
1935
- return new Intl.DateTimeFormat(lng, _objectSpread2({}, options)).format(val);
1936
- },
1937
- relativetime: function relativetime(val, lng, options) {
1938
- return new Intl.RelativeTimeFormat(lng, _objectSpread2({}, options)).format(val, options.range || 'day');
1939
- },
1940
- list: function list(val, lng, options) {
1941
- return new Intl.ListFormat(lng, _objectSpread2({}, options)).format(val);
1942
- }
1943
- };
1944
- this.init(options);
1945
- }
1946
-
1947
- _createClass(Formatter, [{
1948
- key: "init",
1949
- value: function init(services) {
1950
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
1951
- interpolation: {}
1952
- };
1953
- var iOpts = options.interpolation;
1954
- this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';
1955
- }
1956
- }, {
1957
- key: "add",
1958
- value: function add(name, fc) {
1959
- this.formats[name.toLowerCase().trim()] = fc;
1960
- }
1961
- }, {
1962
- key: "format",
1963
- value: function format(value, _format, lng, options) {
1964
- var _this = this;
1965
-
1966
- var formats = _format.split(this.formatSeparator);
1967
-
1968
- var result = formats.reduce(function (mem, f) {
1969
- var _parseFormatStr = parseFormatStr(f),
1970
- formatName = _parseFormatStr.formatName,
1971
- formatOptions = _parseFormatStr.formatOptions;
1972
-
1973
- if (_this.formats[formatName]) {
1974
- var formatted = mem;
1975
-
1976
- try {
1977
- var valOptions = options && options.formatParams && options.formatParams[options.interpolationkey] || {};
1978
- var l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
1979
- formatted = _this.formats[formatName](mem, l, _objectSpread2(_objectSpread2(_objectSpread2({}, formatOptions), options), valOptions));
1980
- } catch (error) {
1981
- _this.logger.warn(error);
1982
- }
1983
-
1984
- return formatted;
1985
- } else {
1986
- _this.logger.warn("there was no format function for ".concat(formatName));
1987
- }
1988
-
1989
- return mem;
1990
- }, value);
1991
- return result;
1992
- }
1993
- }]);
1994
-
1995
- return Formatter;
1996
- }();
1997
-
1998
- function removePending(q, name) {
1999
- if (q.pending[name] !== undefined) {
2000
- delete q.pending[name];
2001
- q.pendingCount--;
2002
- }
2003
- }
2004
-
2005
- var Connector = function (_EventEmitter) {
2006
- _inherits(Connector, _EventEmitter);
2007
-
2008
- var _super = _createSuper(Connector);
2009
-
2010
- function Connector(backend, store, services) {
2011
- var _this;
2012
-
2013
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2014
-
2015
- _classCallCheck(this, Connector);
2016
-
2017
- _this = _super.call(this);
2018
-
2019
- if (isIE10) {
2020
- EventEmitter.call(_assertThisInitialized(_this));
2021
- }
2022
-
2023
- _this.backend = backend;
2024
- _this.store = store;
2025
- _this.services = services;
2026
- _this.languageUtils = services.languageUtils;
2027
- _this.options = options;
2028
- _this.logger = baseLogger.create('backendConnector');
2029
- _this.waitingReads = [];
2030
- _this.maxParallelReads = options.maxParallelReads || 10;
2031
- _this.readingCalls = 0;
2032
- _this.state = {};
2033
- _this.queue = [];
2034
-
2035
- if (_this.backend && _this.backend.init) {
2036
- _this.backend.init(services, options.backend, options);
2037
- }
2038
-
2039
- return _this;
2040
- }
2041
-
2042
- _createClass(Connector, [{
2043
- key: "queueLoad",
2044
- value: function queueLoad(languages, namespaces, options, callback) {
2045
- var _this2 = this;
2046
-
2047
- var toLoad = {};
2048
- var pending = {};
2049
- var toLoadLanguages = {};
2050
- var toLoadNamespaces = {};
2051
- languages.forEach(function (lng) {
2052
- var hasAllNamespaces = true;
2053
- namespaces.forEach(function (ns) {
2054
- var name = "".concat(lng, "|").concat(ns);
2055
-
2056
- if (!options.reload && _this2.store.hasResourceBundle(lng, ns)) {
2057
- _this2.state[name] = 2;
2058
- } else if (_this2.state[name] < 0) ; else if (_this2.state[name] === 1) {
2059
- if (pending[name] === undefined) pending[name] = true;
2060
- } else {
2061
- _this2.state[name] = 1;
2062
- hasAllNamespaces = false;
2063
- if (pending[name] === undefined) pending[name] = true;
2064
- if (toLoad[name] === undefined) toLoad[name] = true;
2065
- if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true;
2066
- }
2067
- });
2068
- if (!hasAllNamespaces) toLoadLanguages[lng] = true;
2069
- });
2070
-
2071
- if (Object.keys(toLoad).length || Object.keys(pending).length) {
2072
- this.queue.push({
2073
- pending: pending,
2074
- pendingCount: Object.keys(pending).length,
2075
- loaded: {},
2076
- errors: [],
2077
- callback: callback
2078
- });
2079
- }
2080
-
2081
- return {
2082
- toLoad: Object.keys(toLoad),
2083
- pending: Object.keys(pending),
2084
- toLoadLanguages: Object.keys(toLoadLanguages),
2085
- toLoadNamespaces: Object.keys(toLoadNamespaces)
2086
- };
2087
- }
2088
- }, {
2089
- key: "loaded",
2090
- value: function loaded(name, err, data) {
2091
- var s = name.split('|');
2092
- var lng = s[0];
2093
- var ns = s[1];
2094
- if (err) this.emit('failedLoading', lng, ns, err);
2095
-
2096
- if (data) {
2097
- this.store.addResourceBundle(lng, ns, data);
2098
- }
2099
-
2100
- this.state[name] = err ? -1 : 2;
2101
- var loaded = {};
2102
- this.queue.forEach(function (q) {
2103
- pushPath(q.loaded, [lng], ns);
2104
- removePending(q, name);
2105
- if (err) q.errors.push(err);
2106
-
2107
- if (q.pendingCount === 0 && !q.done) {
2108
- Object.keys(q.loaded).forEach(function (l) {
2109
- if (!loaded[l]) loaded[l] = {};
2110
- var loadedKeys = q.loaded[l];
2111
-
2112
- if (loadedKeys.length) {
2113
- loadedKeys.forEach(function (ns) {
2114
- if (loaded[l][ns] === undefined) loaded[l][ns] = true;
2115
- });
2116
- }
2117
- });
2118
- q.done = true;
2119
-
2120
- if (q.errors.length) {
2121
- q.callback(q.errors);
2122
- } else {
2123
- q.callback();
2124
- }
2125
- }
2126
- });
2127
- this.emit('loaded', loaded);
2128
- this.queue = this.queue.filter(function (q) {
2129
- return !q.done;
2130
- });
2131
- }
2132
- }, {
2133
- key: "read",
2134
- value: function read(lng, ns, fcName) {
2135
- var _this3 = this;
2136
-
2137
- var tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
2138
- var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 350;
2139
- var callback = arguments.length > 5 ? arguments[5] : undefined;
2140
- if (!lng.length) return callback(null, {});
2141
-
2142
- if (this.readingCalls >= this.maxParallelReads) {
2143
- this.waitingReads.push({
2144
- lng: lng,
2145
- ns: ns,
2146
- fcName: fcName,
2147
- tried: tried,
2148
- wait: wait,
2149
- callback: callback
2150
- });
2151
- return;
2152
- }
2153
-
2154
- this.readingCalls++;
2155
- return this.backend[fcName](lng, ns, function (err, data) {
2156
- if (err && data && tried < 5) {
2157
- setTimeout(function () {
2158
- _this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback);
2159
- }, wait);
2160
- return;
2161
- }
2162
-
2163
- _this3.readingCalls--;
2164
-
2165
- if (_this3.waitingReads.length > 0) {
2166
- var next = _this3.waitingReads.shift();
2167
-
2168
- _this3.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);
2169
- }
2170
-
2171
- callback(err, data);
2172
- });
2173
- }
2174
- }, {
2175
- key: "prepareLoading",
2176
- value: function prepareLoading(languages, namespaces) {
2177
- var _this4 = this;
2178
-
2179
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2180
- var callback = arguments.length > 3 ? arguments[3] : undefined;
2181
-
2182
- if (!this.backend) {
2183
- this.logger.warn('No backend was added via i18next.use. Will not load resources.');
2184
- return callback && callback();
2185
- }
2186
-
2187
- if (typeof languages === 'string') languages = this.languageUtils.toResolveHierarchy(languages);
2188
- if (typeof namespaces === 'string') namespaces = [namespaces];
2189
- var toLoad = this.queueLoad(languages, namespaces, options, callback);
2190
-
2191
- if (!toLoad.toLoad.length) {
2192
- if (!toLoad.pending.length) callback();
2193
- return null;
2194
- }
2195
-
2196
- toLoad.toLoad.forEach(function (name) {
2197
- _this4.loadOne(name);
2198
- });
2199
- }
2200
- }, {
2201
- key: "load",
2202
- value: function load(languages, namespaces, callback) {
2203
- this.prepareLoading(languages, namespaces, {}, callback);
2204
- }
2205
- }, {
2206
- key: "reload",
2207
- value: function reload(languages, namespaces, callback) {
2208
- this.prepareLoading(languages, namespaces, {
2209
- reload: true
2210
- }, callback);
2211
- }
2212
- }, {
2213
- key: "loadOne",
2214
- value: function loadOne(name) {
2215
- var _this5 = this;
2216
-
2217
- var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
2218
- var s = name.split('|');
2219
- var lng = s[0];
2220
- var ns = s[1];
2221
- this.read(lng, ns, 'read', undefined, undefined, function (err, data) {
2222
- if (err) _this5.logger.warn("".concat(prefix, "loading namespace ").concat(ns, " for language ").concat(lng, " failed"), err);
2223
- if (!err && data) _this5.logger.log("".concat(prefix, "loaded namespace ").concat(ns, " for language ").concat(lng), data);
2224
-
2225
- _this5.loaded(name, err, data);
2226
- });
2227
- }
2228
- }, {
2229
- key: "saveMissing",
2230
- value: function saveMissing(languages, namespace, key, fallbackValue, isUpdate) {
2231
- var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
2232
-
2233
- if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {
2234
- this.logger.warn("did not save key \"".concat(key, "\" as the namespace \"").concat(namespace, "\" was not yet loaded"), 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
2235
- return;
2236
- }
2237
-
2238
- if (key === undefined || key === null || key === '') return;
2239
-
2240
- if (this.backend && this.backend.create) {
2241
- this.backend.create(languages, namespace, key, fallbackValue, null, _objectSpread2(_objectSpread2({}, options), {}, {
2242
- isUpdate: isUpdate
2243
- }));
2244
- }
2245
-
2246
- if (!languages || !languages[0]) return;
2247
- this.store.addResource(languages[0], namespace, key, fallbackValue);
2248
- }
2249
- }]);
2250
-
2251
- return Connector;
2252
- }(EventEmitter);
2253
-
2254
- function get() {
2255
- return {
2256
- debug: false,
2257
- initImmediate: true,
2258
- ns: ['translation'],
2259
- defaultNS: ['translation'],
2260
- fallbackLng: ['dev'],
2261
- fallbackNS: false,
2262
- supportedLngs: false,
2263
- nonExplicitSupportedLngs: false,
2264
- load: 'all',
2265
- preload: false,
2266
- simplifyPluralSuffix: true,
2267
- keySeparator: '.',
2268
- nsSeparator: ':',
2269
- pluralSeparator: '_',
2270
- contextSeparator: '_',
2271
- partialBundledLanguages: false,
2272
- saveMissing: false,
2273
- updateMissing: false,
2274
- saveMissingTo: 'fallback',
2275
- saveMissingPlurals: true,
2276
- missingKeyHandler: false,
2277
- missingInterpolationHandler: false,
2278
- postProcess: false,
2279
- postProcessPassResolved: false,
2280
- returnNull: true,
2281
- returnEmptyString: true,
2282
- returnObjects: false,
2283
- joinArrays: false,
2284
- returnedObjectHandler: false,
2285
- parseMissingKeyHandler: false,
2286
- appendNamespaceToMissingKey: false,
2287
- appendNamespaceToCIMode: false,
2288
- overloadTranslationOptionHandler: function handle(args) {
2289
- var ret = {};
2290
- if (_typeof(args[1]) === 'object') ret = args[1];
2291
- if (typeof args[1] === 'string') ret.defaultValue = args[1];
2292
- if (typeof args[2] === 'string') ret.tDescription = args[2];
2293
-
2294
- if (_typeof(args[2]) === 'object' || _typeof(args[3]) === 'object') {
2295
- var options = args[3] || args[2];
2296
- Object.keys(options).forEach(function (key) {
2297
- ret[key] = options[key];
2298
- });
2299
- }
2300
-
2301
- return ret;
2302
- },
2303
- interpolation: {
2304
- escapeValue: true,
2305
- format: function format(value, _format, lng, options) {
2306
- return value;
2307
- },
2308
- prefix: '{{',
2309
- suffix: '}}',
2310
- formatSeparator: ',',
2311
- unescapePrefix: '-',
2312
- nestingPrefix: '$t(',
2313
- nestingSuffix: ')',
2314
- nestingOptionsSeparator: ',',
2315
- maxReplaces: 1000,
2316
- skipOnVariables: true
2317
- }
2318
- };
2319
- }
2320
- function transformOptions(options) {
2321
- if (typeof options.ns === 'string') options.ns = [options.ns];
2322
- if (typeof options.fallbackLng === 'string') options.fallbackLng = [options.fallbackLng];
2323
- if (typeof options.fallbackNS === 'string') options.fallbackNS = [options.fallbackNS];
2324
-
2325
- if (options.supportedLngs && options.supportedLngs.indexOf('cimode') < 0) {
2326
- options.supportedLngs = options.supportedLngs.concat(['cimode']);
2327
- }
2328
-
2329
- return options;
2330
- }
2331
-
2332
- function noop() {}
2333
-
2334
- function bindMemberFunctions(inst) {
2335
- var mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
2336
- mems.forEach(function (mem) {
2337
- if (typeof inst[mem] === 'function') {
2338
- inst[mem] = inst[mem].bind(inst);
2339
- }
2340
- });
2341
- }
2342
-
2343
- var I18n = function (_EventEmitter) {
2344
- _inherits(I18n, _EventEmitter);
2345
-
2346
- var _super = _createSuper(I18n);
2347
-
2348
- function I18n() {
2349
- var _this;
2350
-
2351
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2352
- var callback = arguments.length > 1 ? arguments[1] : undefined;
2353
-
2354
- _classCallCheck(this, I18n);
2355
-
2356
- _this = _super.call(this);
2357
-
2358
- if (isIE10) {
2359
- EventEmitter.call(_assertThisInitialized(_this));
2360
- }
2361
-
2362
- _this.options = transformOptions(options);
2363
- _this.services = {};
2364
- _this.logger = baseLogger;
2365
- _this.modules = {
2366
- external: []
2367
- };
2368
- bindMemberFunctions(_assertThisInitialized(_this));
2369
-
2370
- if (callback && !_this.isInitialized && !options.isClone) {
2371
- if (!_this.options.initImmediate) {
2372
- _this.init(options, callback);
2373
-
2374
- return _possibleConstructorReturn(_this, _assertThisInitialized(_this));
2375
- }
2376
-
2377
- setTimeout(function () {
2378
- _this.init(options, callback);
2379
- }, 0);
2380
- }
2381
-
2382
- return _this;
2383
- }
2384
-
2385
- _createClass(I18n, [{
2386
- key: "init",
2387
- value: function init() {
2388
- var _this2 = this;
2389
-
2390
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2391
- var callback = arguments.length > 1 ? arguments[1] : undefined;
2392
-
2393
- if (typeof options === 'function') {
2394
- callback = options;
2395
- options = {};
2396
- }
2397
-
2398
- if (!options.defaultNS && options.ns) {
2399
- if (typeof options.ns === 'string') {
2400
- options.defaultNS = options.ns;
2401
- } else if (options.ns.indexOf('translation') < 0) {
2402
- options.defaultNS = options.ns[0];
2403
- }
2404
- }
2405
-
2406
- var defOpts = get();
2407
- this.options = _objectSpread2(_objectSpread2(_objectSpread2({}, defOpts), this.options), transformOptions(options));
2408
-
2409
- if (this.options.compatibilityAPI !== 'v1') {
2410
- this.options.interpolation = _objectSpread2(_objectSpread2({}, defOpts.interpolation), this.options.interpolation);
2411
- }
2412
-
2413
- if (options.keySeparator !== undefined) {
2414
- this.options.userDefinedKeySeparator = options.keySeparator;
2415
- }
2416
-
2417
- if (options.nsSeparator !== undefined) {
2418
- this.options.userDefinedNsSeparator = options.nsSeparator;
2419
- }
2420
-
2421
- function createClassOnDemand(ClassOrObject) {
2422
- if (!ClassOrObject) return null;
2423
- if (typeof ClassOrObject === 'function') return new ClassOrObject();
2424
- return ClassOrObject;
2425
- }
2426
-
2427
- if (!this.options.isClone) {
2428
- if (this.modules.logger) {
2429
- baseLogger.init(createClassOnDemand(this.modules.logger), this.options);
2430
- } else {
2431
- baseLogger.init(null, this.options);
2432
- }
2433
-
2434
- var formatter;
2435
-
2436
- if (this.modules.formatter) {
2437
- formatter = this.modules.formatter;
2438
- } else if (typeof Intl !== 'undefined') {
2439
- formatter = Formatter;
2440
- }
2441
-
2442
- var lu = new LanguageUtil(this.options);
2443
- this.store = new ResourceStore(this.options.resources, this.options);
2444
- var s = this.services;
2445
- s.logger = baseLogger;
2446
- s.resourceStore = this.store;
2447
- s.languageUtils = lu;
2448
- s.pluralResolver = new PluralResolver(lu, {
2449
- prepend: this.options.pluralSeparator,
2450
- compatibilityJSON: this.options.compatibilityJSON,
2451
- simplifyPluralSuffix: this.options.simplifyPluralSuffix
2452
- });
2453
-
2454
- if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
2455
- s.formatter = createClassOnDemand(formatter);
2456
- s.formatter.init(s, this.options);
2457
- this.options.interpolation.format = s.formatter.format.bind(s.formatter);
2458
- }
2459
-
2460
- s.interpolator = new Interpolator(this.options);
2461
- s.utils = {
2462
- hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
2463
- };
2464
- s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);
2465
- s.backendConnector.on('*', function (event) {
2466
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2467
- args[_key - 1] = arguments[_key];
2468
- }
2469
-
2470
- _this2.emit.apply(_this2, [event].concat(args));
2471
- });
2472
-
2473
- if (this.modules.languageDetector) {
2474
- s.languageDetector = createClassOnDemand(this.modules.languageDetector);
2475
- s.languageDetector.init(s, this.options.detection, this.options);
2476
- }
2477
-
2478
- if (this.modules.i18nFormat) {
2479
- s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
2480
- if (s.i18nFormat.init) s.i18nFormat.init(this);
2481
- }
2482
-
2483
- this.translator = new Translator(this.services, this.options);
2484
- this.translator.on('*', function (event) {
2485
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
2486
- args[_key2 - 1] = arguments[_key2];
2487
- }
2488
-
2489
- _this2.emit.apply(_this2, [event].concat(args));
2490
- });
2491
- this.modules.external.forEach(function (m) {
2492
- if (m.init) m.init(_this2);
2493
- });
2494
- }
2495
-
2496
- this.format = this.options.interpolation.format;
2497
- if (!callback) callback = noop;
2498
-
2499
- if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
2500
- var codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
2501
- if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];
2502
- }
2503
-
2504
- if (!this.services.languageDetector && !this.options.lng) {
2505
- this.logger.warn('init: no languageDetector is used and no lng is defined');
2506
- }
2507
-
2508
- var storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
2509
- storeApi.forEach(function (fcName) {
2510
- _this2[fcName] = function () {
2511
- var _this2$store;
2512
-
2513
- return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);
2514
- };
2515
- });
2516
- var storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];
2517
- storeApiChained.forEach(function (fcName) {
2518
- _this2[fcName] = function () {
2519
- var _this2$store2;
2520
-
2521
- (_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments);
2522
-
2523
- return _this2;
2524
- };
2525
- });
2526
- var deferred = defer();
2527
-
2528
- var load = function load() {
2529
- var finish = function finish(err, t) {
2530
- if (_this2.isInitialized && !_this2.initializedStoreOnce) _this2.logger.warn('init: i18next is already initialized. You should call init just once!');
2531
- _this2.isInitialized = true;
2532
- if (!_this2.options.isClone) _this2.logger.log('initialized', _this2.options);
2533
-
2534
- _this2.emit('initialized', _this2.options);
2535
-
2536
- deferred.resolve(t);
2537
- callback(err, t);
2538
- };
2539
-
2540
- if (_this2.languages && _this2.options.compatibilityAPI !== 'v1' && !_this2.isInitialized) return finish(null, _this2.t.bind(_this2));
2541
-
2542
- _this2.changeLanguage(_this2.options.lng, finish);
2543
- };
2544
-
2545
- if (this.options.resources || !this.options.initImmediate) {
2546
- load();
2547
- } else {
2548
- setTimeout(load, 0);
2549
- }
2550
-
2551
- return deferred;
2552
- }
2553
- }, {
2554
- key: "loadResources",
2555
- value: function loadResources(language) {
2556
- var _this3 = this;
2557
-
2558
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
2559
- var usedCallback = callback;
2560
- var usedLng = typeof language === 'string' ? language : this.language;
2561
- if (typeof language === 'function') usedCallback = language;
2562
-
2563
- if (!this.options.resources || this.options.partialBundledLanguages) {
2564
- if (usedLng && usedLng.toLowerCase() === 'cimode') return usedCallback();
2565
- var toLoad = [];
2566
-
2567
- var append = function append(lng) {
2568
- if (!lng) return;
2569
-
2570
- var lngs = _this3.services.languageUtils.toResolveHierarchy(lng);
2571
-
2572
- lngs.forEach(function (l) {
2573
- if (toLoad.indexOf(l) < 0) toLoad.push(l);
2574
- });
2575
- };
2576
-
2577
- if (!usedLng) {
2578
- var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
2579
- fallbacks.forEach(function (l) {
2580
- return append(l);
2581
- });
2582
- } else {
2583
- append(usedLng);
2584
- }
2585
-
2586
- if (this.options.preload) {
2587
- this.options.preload.forEach(function (l) {
2588
- return append(l);
2589
- });
2590
- }
2591
-
2592
- this.services.backendConnector.load(toLoad, this.options.ns, function (e) {
2593
- if (!e && !_this3.resolvedLanguage && _this3.language) _this3.setResolvedLanguage(_this3.language);
2594
- usedCallback(e);
2595
- });
2596
- } else {
2597
- usedCallback(null);
2598
- }
2599
- }
2600
- }, {
2601
- key: "reloadResources",
2602
- value: function reloadResources(lngs, ns, callback) {
2603
- var deferred = defer();
2604
- if (!lngs) lngs = this.languages;
2605
- if (!ns) ns = this.options.ns;
2606
- if (!callback) callback = noop;
2607
- this.services.backendConnector.reload(lngs, ns, function (err) {
2608
- deferred.resolve();
2609
- callback(err);
2610
- });
2611
- return deferred;
2612
- }
2613
- }, {
2614
- key: "use",
2615
- value: function use(module) {
2616
- if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');
2617
- if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');
2618
-
2619
- if (module.type === 'backend') {
2620
- this.modules.backend = module;
2621
- }
2622
-
2623
- if (module.type === 'logger' || module.log && module.warn && module.error) {
2624
- this.modules.logger = module;
2625
- }
2626
-
2627
- if (module.type === 'languageDetector') {
2628
- this.modules.languageDetector = module;
2629
- }
2630
-
2631
- if (module.type === 'i18nFormat') {
2632
- this.modules.i18nFormat = module;
2633
- }
2634
-
2635
- if (module.type === 'postProcessor') {
2636
- postProcessor.addPostProcessor(module);
2637
- }
2638
-
2639
- if (module.type === 'formatter') {
2640
- this.modules.formatter = module;
2641
- }
2642
-
2643
- if (module.type === '3rdParty') {
2644
- this.modules.external.push(module);
2645
- }
2646
-
2647
- return this;
2648
- }
2649
- }, {
2650
- key: "setResolvedLanguage",
2651
- value: function setResolvedLanguage(l) {
2652
- if (!l || !this.languages) return;
2653
- if (['cimode', 'dev'].indexOf(l) > -1) return;
2654
-
2655
- for (var li = 0; li < this.languages.length; li++) {
2656
- var lngInLngs = this.languages[li];
2657
- if (['cimode', 'dev'].indexOf(lngInLngs) > -1) continue;
2658
-
2659
- if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
2660
- this.resolvedLanguage = lngInLngs;
2661
- break;
2662
- }
2663
- }
2664
- }
2665
- }, {
2666
- key: "changeLanguage",
2667
- value: function changeLanguage(lng, callback) {
2668
- var _this4 = this;
2669
-
2670
- this.isLanguageChangingTo = lng;
2671
- var deferred = defer();
2672
- this.emit('languageChanging', lng);
2673
-
2674
- var setLngProps = function setLngProps(l) {
2675
- _this4.language = l;
2676
- _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);
2677
- _this4.resolvedLanguage = undefined;
2678
-
2679
- _this4.setResolvedLanguage(l);
2680
- };
2681
-
2682
- var done = function done(err, l) {
2683
- if (l) {
2684
- setLngProps(l);
2685
-
2686
- _this4.translator.changeLanguage(l);
2687
-
2688
- _this4.isLanguageChangingTo = undefined;
2689
-
2690
- _this4.emit('languageChanged', l);
2691
-
2692
- _this4.logger.log('languageChanged', l);
2693
- } else {
2694
- _this4.isLanguageChangingTo = undefined;
2695
- }
2696
-
2697
- deferred.resolve(function () {
2698
- return _this4.t.apply(_this4, arguments);
2699
- });
2700
- if (callback) callback(err, function () {
2701
- return _this4.t.apply(_this4, arguments);
2702
- });
2703
- };
2704
-
2705
- var setLng = function setLng(lngs) {
2706
- if (!lng && !lngs && _this4.services.languageDetector) lngs = [];
2707
- var l = typeof lngs === 'string' ? lngs : _this4.services.languageUtils.getBestMatchFromCodes(lngs);
2708
-
2709
- if (l) {
2710
- if (!_this4.language) {
2711
- setLngProps(l);
2712
- }
2713
-
2714
- if (!_this4.translator.language) _this4.translator.changeLanguage(l);
2715
- if (_this4.services.languageDetector) _this4.services.languageDetector.cacheUserLanguage(l);
2716
- }
2717
-
2718
- _this4.loadResources(l, function (err) {
2719
- done(err, l);
2720
- });
2721
- };
2722
-
2723
- if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {
2724
- setLng(this.services.languageDetector.detect());
2725
- } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {
2726
- this.services.languageDetector.detect(setLng);
2727
- } else {
2728
- setLng(lng);
2729
- }
2730
-
2731
- return deferred;
2732
- }
2733
- }, {
2734
- key: "getFixedT",
2735
- value: function getFixedT(lng, ns, keyPrefix) {
2736
- var _this5 = this;
2737
-
2738
- var fixedT = function fixedT(key, opts) {
2739
- var options;
2740
-
2741
- if (_typeof(opts) !== 'object') {
2742
- for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
2743
- rest[_key3 - 2] = arguments[_key3];
2744
- }
2745
-
2746
- options = _this5.options.overloadTranslationOptionHandler([key, opts].concat(rest));
2747
- } else {
2748
- options = _objectSpread2({}, opts);
2749
- }
2750
-
2751
- options.lng = options.lng || fixedT.lng;
2752
- options.lngs = options.lngs || fixedT.lngs;
2753
- options.ns = options.ns || fixedT.ns;
2754
- var keySeparator = _this5.options.keySeparator || '.';
2755
- var resultKey = keyPrefix ? "".concat(keyPrefix).concat(keySeparator).concat(key) : key;
2756
- return _this5.t(resultKey, options);
2757
- };
2758
-
2759
- if (typeof lng === 'string') {
2760
- fixedT.lng = lng;
2761
- } else {
2762
- fixedT.lngs = lng;
2763
- }
2764
-
2765
- fixedT.ns = ns;
2766
- fixedT.keyPrefix = keyPrefix;
2767
- return fixedT;
2768
- }
2769
- }, {
2770
- key: "t",
2771
- value: function t() {
2772
- var _this$translator;
2773
-
2774
- return this.translator && (_this$translator = this.translator).translate.apply(_this$translator, arguments);
2775
- }
2776
- }, {
2777
- key: "exists",
2778
- value: function exists() {
2779
- var _this$translator2;
2780
-
2781
- return this.translator && (_this$translator2 = this.translator).exists.apply(_this$translator2, arguments);
2782
- }
2783
- }, {
2784
- key: "setDefaultNamespace",
2785
- value: function setDefaultNamespace(ns) {
2786
- this.options.defaultNS = ns;
2787
- }
2788
- }, {
2789
- key: "hasLoadedNamespace",
2790
- value: function hasLoadedNamespace(ns) {
2791
- var _this6 = this;
2792
-
2793
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2794
-
2795
- if (!this.isInitialized) {
2796
- this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);
2797
- return false;
2798
- }
2799
-
2800
- if (!this.languages || !this.languages.length) {
2801
- this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);
2802
- return false;
2803
- }
2804
-
2805
- var lng = this.resolvedLanguage || this.languages[0];
2806
- var fallbackLng = this.options ? this.options.fallbackLng : false;
2807
- var lastLng = this.languages[this.languages.length - 1];
2808
- if (lng.toLowerCase() === 'cimode') return true;
2809
-
2810
- var loadNotPending = function loadNotPending(l, n) {
2811
- var loadState = _this6.services.backendConnector.state["".concat(l, "|").concat(n)];
2812
-
2813
- return loadState === -1 || loadState === 2;
2814
- };
2815
-
2816
- if (options.precheck) {
2817
- var preResult = options.precheck(this, loadNotPending);
2818
- if (preResult !== undefined) return preResult;
2819
- }
2820
-
2821
- if (this.hasResourceBundle(lng, ns)) return true;
2822
- if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;
2823
- if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
2824
- return false;
2825
- }
2826
- }, {
2827
- key: "loadNamespaces",
2828
- value: function loadNamespaces(ns, callback) {
2829
- var _this7 = this;
2830
-
2831
- var deferred = defer();
2832
-
2833
- if (!this.options.ns) {
2834
- callback && callback();
2835
- return Promise.resolve();
2836
- }
2837
-
2838
- if (typeof ns === 'string') ns = [ns];
2839
- ns.forEach(function (n) {
2840
- if (_this7.options.ns.indexOf(n) < 0) _this7.options.ns.push(n);
2841
- });
2842
- this.loadResources(function (err) {
2843
- deferred.resolve();
2844
- if (callback) callback(err);
2845
- });
2846
- return deferred;
2847
- }
2848
- }, {
2849
- key: "loadLanguages",
2850
- value: function loadLanguages(lngs, callback) {
2851
- var deferred = defer();
2852
- if (typeof lngs === 'string') lngs = [lngs];
2853
- var preloaded = this.options.preload || [];
2854
- var newLngs = lngs.filter(function (lng) {
2855
- return preloaded.indexOf(lng) < 0;
2856
- });
2857
-
2858
- if (!newLngs.length) {
2859
- if (callback) callback();
2860
- return Promise.resolve();
2861
- }
2862
-
2863
- this.options.preload = preloaded.concat(newLngs);
2864
- this.loadResources(function (err) {
2865
- deferred.resolve();
2866
- if (callback) callback(err);
2867
- });
2868
- return deferred;
2869
- }
2870
- }, {
2871
- key: "dir",
2872
- value: function dir(lng) {
2873
- if (!lng) lng = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language);
2874
- if (!lng) return 'rtl';
2875
- var rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];
2876
- return rtlLngs.indexOf(this.services.languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';
2877
- }
2878
- }, {
2879
- key: "cloneInstance",
2880
- value: function cloneInstance() {
2881
- var _this8 = this;
2882
-
2883
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2884
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
2885
-
2886
- var mergedOptions = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), options), {
2887
- isClone: true
2888
- });
2889
-
2890
- var clone = new I18n(mergedOptions);
2891
- var membersToCopy = ['store', 'services', 'language'];
2892
- membersToCopy.forEach(function (m) {
2893
- clone[m] = _this8[m];
2894
- });
2895
- clone.services = _objectSpread2({}, this.services);
2896
- clone.services.utils = {
2897
- hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
2898
- };
2899
- clone.translator = new Translator(clone.services, clone.options);
2900
- clone.translator.on('*', function (event) {
2901
- for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
2902
- args[_key4 - 1] = arguments[_key4];
2903
- }
2904
-
2905
- clone.emit.apply(clone, [event].concat(args));
2906
- });
2907
- clone.init(mergedOptions, callback);
2908
- clone.translator.options = clone.options;
2909
- clone.translator.backendConnector.services.utils = {
2910
- hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
2911
- };
2912
- return clone;
2913
- }
2914
- }, {
2915
- key: "toJSON",
2916
- value: function toJSON() {
2917
- return {
2918
- options: this.options,
2919
- store: this.store,
2920
- language: this.language,
2921
- languages: this.languages,
2922
- resolvedLanguage: this.resolvedLanguage
2923
- };
2924
- }
2925
- }]);
2926
-
2927
- return I18n;
2928
- }(EventEmitter);
2929
-
2930
- _defineProperty(I18n, "createInstance", function () {
2931
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2932
- var callback = arguments.length > 1 ? arguments[1] : undefined;
2933
- return new I18n(options, callback);
2934
- });
2935
-
2936
- var instance = I18n.createInstance();
2937
- instance.createInstance = I18n.createInstance;
2938
-
2939
- var createInstance = instance.createInstance;
2940
- var init = instance.init;
2941
- var loadResources = instance.loadResources;
2942
- var reloadResources = instance.reloadResources;
2943
- var use = instance.use;
2944
- var changeLanguage = instance.changeLanguage;
2945
- var getFixedT = instance.getFixedT;
2946
- var t = instance.t;
2947
- var exists = instance.exists;
2948
- var setDefaultNamespace = instance.setDefaultNamespace;
2949
- var hasLoadedNamespace = instance.hasLoadedNamespace;
2950
- var loadNamespaces = instance.loadNamespaces;
2951
- var loadLanguages = instance.loadLanguages;
2952
-
2953
- export default instance;
2954
- export { changeLanguage, createInstance, exists, getFixedT, hasLoadedNamespace, init, loadLanguages, loadNamespaces, loadResources, reloadResources, setDefaultNamespace, t, use };