markdown-flow-ui 0.3.6 → 0.3.7

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 (322) hide show
  1. package/dist/_virtual/index8.cjs +1 -1
  2. package/dist/_virtual/index8.es.js +2 -2
  3. package/dist/_virtual/index9.cjs +1 -1
  4. package/dist/_virtual/index9.es.js +2 -2
  5. package/dist/assets/markdown-flow-ui.css +1 -1
  6. package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs +3 -3
  7. package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs.map +1 -1
  8. package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js +145 -143
  9. package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js.map +1 -1
  10. package/dist/markdown-flow-ui-lib.css +1 -1
  11. package/dist/markdown-flow-ui.css +1 -1
  12. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
  13. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  14. package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +1 -0
  15. package/dist/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +1 -0
  16. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +1 -1
  17. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +1 -1
  18. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +92 -89
  19. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +1 -1
  20. package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +2 -0
  21. package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs.map +1 -0
  22. package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-popper → react-popper}/dist/index.es.js +5 -5
  23. package/dist/node_modules/@radix-ui/react-popper/dist/index.es.js.map +1 -0
  24. package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +1 -1
  25. package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
  26. package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js +50 -47
  27. package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -1
  28. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs +1 -1
  29. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs.map +1 -1
  30. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.es.js +9 -9
  31. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +1 -1
  32. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +1 -1
  33. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +10 -7
  34. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +1 -1
  35. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +1 -1
  36. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs.map +1 -1
  37. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.es.js +1 -1
  38. package/dist/node_modules/classnames/index.cjs +1 -1
  39. package/dist/node_modules/classnames/index.es.js +1 -1
  40. package/dist/node_modules/i18next/dist/esm/i18next.cjs +1 -1
  41. package/dist/node_modules/i18next/dist/esm/i18next.cjs.map +1 -1
  42. package/dist/node_modules/i18next/dist/esm/i18next.es.js +809 -900
  43. package/dist/node_modules/i18next/dist/esm/i18next.es.js.map +1 -1
  44. package/dist/node_modules/katex/dist/katex.cjs +14 -14
  45. package/dist/node_modules/katex/dist/katex.cjs.map +1 -1
  46. package/dist/node_modules/katex/dist/katex.es.js +1302 -1192
  47. package/dist/node_modules/katex/dist/katex.es.js.map +1 -1
  48. package/dist/node_modules/lucide-react/dist/esm/Icon.cjs +1 -1
  49. package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.map +1 -1
  50. package/dist/node_modules/lucide-react/dist/esm/Icon.es.js +52 -29
  51. package/dist/node_modules/lucide-react/dist/esm/Icon.es.js.map +1 -1
  52. package/dist/node_modules/lucide-react/dist/esm/context.cjs +2 -0
  53. package/dist/node_modules/lucide-react/dist/esm/context.cjs.map +1 -0
  54. package/dist/node_modules/lucide-react/dist/esm/context.es.js +6 -0
  55. package/dist/node_modules/lucide-react/dist/esm/context.es.js.map +1 -0
  56. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +1 -1
  57. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs.map +1 -1
  58. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.es.js +13 -16
  59. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.es.js.map +1 -1
  60. package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.cjs +1 -1
  61. package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.cjs.map +1 -1
  62. package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.es.js +16 -10
  63. package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.es.js.map +1 -1
  64. package/dist/node_modules/lucide-react/dist/esm/icons/captions.cjs +1 -1
  65. package/dist/node_modules/lucide-react/dist/esm/icons/captions.cjs.map +1 -1
  66. package/dist/node_modules/lucide-react/dist/esm/icons/captions.es.js +13 -6
  67. package/dist/node_modules/lucide-react/dist/esm/icons/captions.es.js.map +1 -1
  68. package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs +1 -1
  69. package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs.map +1 -1
  70. package/dist/node_modules/lucide-react/dist/esm/icons/check.es.js +8 -2
  71. package/dist/node_modules/lucide-react/dist/esm/icons/check.es.js.map +1 -1
  72. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs +1 -1
  73. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs.map +1 -1
  74. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js +10 -4
  75. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js.map +1 -1
  76. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs +1 -1
  77. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs.map +1 -1
  78. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js +12 -6
  79. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js.map +1 -1
  80. package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs +1 -1
  81. package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs.map +1 -1
  82. package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.es.js +14 -7
  83. package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.es.js.map +1 -1
  84. package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs +1 -1
  85. package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs.map +1 -1
  86. package/dist/node_modules/lucide-react/dist/esm/icons/copy.es.js +11 -5
  87. package/dist/node_modules/lucide-react/dist/esm/icons/copy.es.js.map +1 -1
  88. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs +1 -1
  89. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs.map +1 -1
  90. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js +13 -6
  91. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js.map +1 -1
  92. package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.cjs +1 -1
  93. package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.cjs.map +1 -1
  94. package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.es.js +22 -7
  95. package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.es.js.map +1 -1
  96. package/dist/node_modules/lucide-react/dist/esm/icons/file-type.cjs +1 -1
  97. package/dist/node_modules/lucide-react/dist/esm/icons/file-type.cjs.map +1 -1
  98. package/dist/node_modules/lucide-react/dist/esm/icons/file-type.es.js +20 -8
  99. package/dist/node_modules/lucide-react/dist/esm/icons/file-type.es.js.map +1 -1
  100. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs +1 -1
  101. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs.map +1 -1
  102. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js +17 -11
  103. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js.map +1 -1
  104. package/dist/node_modules/lucide-react/dist/esm/icons/image.cjs +1 -1
  105. package/dist/node_modules/lucide-react/dist/esm/icons/image.cjs.map +1 -1
  106. package/dist/node_modules/lucide-react/dist/esm/icons/image.es.js +14 -8
  107. package/dist/node_modules/lucide-react/dist/esm/icons/image.es.js.map +1 -1
  108. package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs +1 -1
  109. package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs.map +1 -1
  110. package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.es.js +11 -4
  111. package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.es.js.map +1 -1
  112. package/dist/node_modules/lucide-react/dist/esm/icons/maximize.cjs +1 -1
  113. package/dist/node_modules/lucide-react/dist/esm/icons/maximize.cjs.map +1 -1
  114. package/dist/node_modules/lucide-react/dist/esm/icons/maximize.es.js +15 -9
  115. package/dist/node_modules/lucide-react/dist/esm/icons/maximize.es.js.map +1 -1
  116. package/dist/node_modules/lucide-react/dist/esm/icons/rewind.cjs +1 -1
  117. package/dist/node_modules/lucide-react/dist/esm/icons/rewind.cjs.map +1 -1
  118. package/dist/node_modules/lucide-react/dist/esm/icons/rewind.es.js +25 -7
  119. package/dist/node_modules/lucide-react/dist/esm/icons/rewind.es.js.map +1 -1
  120. package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.cjs +1 -1
  121. package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.cjs.map +1 -1
  122. package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.es.js +16 -10
  123. package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.es.js.map +1 -1
  124. package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs +1 -1
  125. package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs.map +1 -1
  126. package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js +19 -7
  127. package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js.map +1 -1
  128. package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs +1 -1
  129. package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs.map +1 -1
  130. package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js +19 -7
  131. package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js.map +1 -1
  132. package/dist/node_modules/lucide-react/dist/esm/icons/square-check.cjs +1 -1
  133. package/dist/node_modules/lucide-react/dist/esm/icons/square-check.cjs.map +1 -1
  134. package/dist/node_modules/lucide-react/dist/esm/icons/square-check.es.js +14 -7
  135. package/dist/node_modules/lucide-react/dist/esm/icons/square-check.es.js.map +1 -1
  136. package/dist/node_modules/lucide-react/dist/esm/icons/square-play.cjs +1 -1
  137. package/dist/node_modules/lucide-react/dist/esm/icons/square-play.cjs.map +1 -1
  138. package/dist/node_modules/lucide-react/dist/esm/icons/square-play.es.js +19 -6
  139. package/dist/node_modules/lucide-react/dist/esm/icons/square-play.es.js.map +1 -1
  140. package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs +1 -1
  141. package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs.map +1 -1
  142. package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.es.js +15 -9
  143. package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.es.js.map +1 -1
  144. package/dist/node_modules/lucide-react/dist/esm/icons/upload.cjs +1 -1
  145. package/dist/node_modules/lucide-react/dist/esm/icons/upload.cjs.map +1 -1
  146. package/dist/node_modules/lucide-react/dist/esm/icons/upload.es.js +13 -7
  147. package/dist/node_modules/lucide-react/dist/esm/icons/upload.es.js.map +1 -1
  148. package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.cjs +1 -1
  149. package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.cjs.map +1 -1
  150. package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.es.js +19 -13
  151. package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.es.js.map +1 -1
  152. package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs +1 -1
  153. package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs.map +1 -1
  154. package/dist/node_modules/lucide-react/dist/esm/icons/x.es.js +13 -7
  155. package/dist/node_modules/lucide-react/dist/esm/icons/x.es.js.map +1 -1
  156. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.cjs +2 -0
  157. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.cjs.map +1 -0
  158. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.es.js +18 -0
  159. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.es.js.map +1 -0
  160. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.cjs +2 -0
  161. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.cjs.map +1 -0
  162. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.es.js +44 -0
  163. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.es.js.map +1 -0
  164. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.cjs +2 -0
  165. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.cjs.map +1 -0
  166. package/dist/node_modules/lucide-react/dist/esm/{defaultAttributes.es.js → shared/src/build/defaultAttributes.es.js} +4 -4
  167. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.es.js.map +1 -0
  168. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.cjs +2 -0
  169. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.cjs.map +1 -0
  170. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.es.js +10 -0
  171. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.es.js.map +1 -0
  172. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.cjs +2 -0
  173. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.cjs.map +1 -0
  174. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.es.js +5 -0
  175. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.es.js.map +1 -0
  176. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.cjs +2 -0
  177. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.cjs.map +1 -0
  178. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.es.js +15 -0
  179. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.es.js.map +1 -0
  180. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.cjs +2 -0
  181. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.cjs.map +1 -0
  182. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.es.js +5 -0
  183. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.es.js.map +1 -0
  184. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.cjs +2 -0
  185. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.cjs.map +1 -0
  186. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.es.js +15 -0
  187. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.es.js.map +1 -0
  188. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs +2 -0
  189. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs.map +1 -0
  190. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.es.js +9 -0
  191. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.es.js.map +1 -0
  192. package/dist/node_modules/micromark/lib/create-tokenizer.cjs +3 -3
  193. package/dist/node_modules/micromark/lib/create-tokenizer.cjs.map +1 -1
  194. package/dist/node_modules/micromark/lib/create-tokenizer.es.js +78 -76
  195. package/dist/node_modules/micromark/lib/create-tokenizer.es.js.map +1 -1
  196. package/dist/node_modules/micromark/lib/initialize/document.cjs +1 -1
  197. package/dist/node_modules/micromark/lib/initialize/document.cjs.map +1 -1
  198. package/dist/node_modules/micromark/lib/initialize/document.es.js +77 -75
  199. package/dist/node_modules/micromark/lib/initialize/document.es.js.map +1 -1
  200. package/dist/node_modules/micromark/lib/initialize/text.cjs +1 -1
  201. package/dist/node_modules/micromark/lib/initialize/text.cjs.map +1 -1
  202. package/dist/node_modules/micromark/lib/initialize/text.es.js +67 -64
  203. package/dist/node_modules/micromark/lib/initialize/text.es.js.map +1 -1
  204. package/dist/node_modules/micromark/lib/preprocess.cjs +1 -1
  205. package/dist/node_modules/micromark/lib/preprocess.cjs.map +1 -1
  206. package/dist/node_modules/micromark/lib/preprocess.es.js +19 -14
  207. package/dist/node_modules/micromark/lib/preprocess.es.js.map +1 -1
  208. package/dist/node_modules/micromark-core-commonmark/lib/attention.cjs +1 -1
  209. package/dist/node_modules/micromark-core-commonmark/lib/attention.cjs.map +1 -1
  210. package/dist/node_modules/micromark-core-commonmark/lib/attention.es.js +36 -32
  211. package/dist/node_modules/micromark-core-commonmark/lib/attention.es.js.map +1 -1
  212. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.cjs +1 -1
  213. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.cjs.map +1 -1
  214. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.es.js +49 -61
  215. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.es.js.map +1 -1
  216. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.cjs +1 -1
  217. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.cjs.map +1 -1
  218. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.es.js +21 -27
  219. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.es.js.map +1 -1
  220. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.cjs +1 -1
  221. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.cjs.map +1 -1
  222. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.es.js +18 -14
  223. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.es.js.map +1 -1
  224. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.cjs +1 -1
  225. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.cjs.map +1 -1
  226. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.es.js +59 -71
  227. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.es.js.map +1 -1
  228. package/dist/node_modules/micromark-core-commonmark/lib/label-end.cjs +1 -1
  229. package/dist/node_modules/micromark-core-commonmark/lib/label-end.cjs.map +1 -1
  230. package/dist/node_modules/micromark-core-commonmark/lib/label-end.es.js +87 -85
  231. package/dist/node_modules/micromark-core-commonmark/lib/label-end.es.js.map +1 -1
  232. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.cjs +1 -1
  233. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.cjs.map +1 -1
  234. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.es.js +11 -10
  235. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.es.js.map +1 -1
  236. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.cjs +1 -1
  237. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.cjs.map +1 -1
  238. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.es.js +12 -11
  239. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.es.js.map +1 -1
  240. package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.cjs +2 -0
  241. package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.cjs.map +1 -0
  242. package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.es.js +18 -0
  243. package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.es.js.map +1 -0
  244. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.cjs +1 -1
  245. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.cjs.map +1 -1
  246. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.es.js +35 -33
  247. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.es.js.map +1 -1
  248. package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.cjs +1 -1
  249. package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.cjs.map +1 -1
  250. package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.es.js +32 -28
  251. package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.es.js.map +1 -1
  252. package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.cjs +1 -1
  253. package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.cjs.map +1 -1
  254. package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.es.js +18 -14
  255. package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.es.js.map +1 -1
  256. package/dist/node_modules/micromark-factory-space/index.cjs +1 -1
  257. package/dist/node_modules/micromark-factory-space/index.cjs.map +1 -1
  258. package/dist/node_modules/micromark-factory-space/index.es.js +24 -10
  259. package/dist/node_modules/micromark-factory-space/index.es.js.map +1 -1
  260. package/dist/node_modules/micromark-util-edit-map/index.cjs +2 -0
  261. package/dist/node_modules/micromark-util-edit-map/index.cjs.map +1 -0
  262. package/dist/node_modules/micromark-util-edit-map/index.es.js +83 -0
  263. package/dist/node_modules/micromark-util-edit-map/index.es.js.map +1 -0
  264. package/package.json +24 -17
  265. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.cjs +0 -2
  266. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.cjs.map +0 -1
  267. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.es.js +0 -50
  268. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.es.js.map +0 -1
  269. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +0 -1
  270. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +0 -1
  271. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.cjs +0 -2
  272. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.cjs.map +0 -1
  273. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.es.js +0 -82
  274. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.es.js.map +0 -1
  275. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +0 -2
  276. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs.map +0 -1
  277. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js +0 -216
  278. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js.map +0 -1
  279. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +0 -2
  280. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +0 -1
  281. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +0 -105
  282. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +0 -1
  283. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.cjs +0 -2
  284. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.cjs.map +0 -1
  285. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.es.js.map +0 -1
  286. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.cjs +0 -2
  287. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.cjs.map +0 -1
  288. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.es.js +0 -18
  289. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.es.js.map +0 -1
  290. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -2
  291. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +0 -1
  292. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.es.js +0 -39
  293. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +0 -1
  294. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -2
  295. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.cjs.map +0 -1
  296. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js +0 -99
  297. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js.map +0 -1
  298. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +0 -2
  299. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +0 -1
  300. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +0 -16
  301. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +0 -1
  302. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +0 -2
  303. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs.map +0 -1
  304. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js +0 -70
  305. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js.map +0 -1
  306. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -2
  307. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +0 -1
  308. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.es.js +0 -39
  309. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +0 -1
  310. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -2
  311. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.cjs.map +0 -1
  312. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.es.js +0 -99
  313. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.es.js.map +0 -1
  314. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +0 -2
  315. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs.map +0 -1
  316. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.es.js.map +0 -1
  317. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +0 -2
  318. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs.map +0 -1
  319. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.es.js +0 -19
  320. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.es.js.map +0 -1
  321. /package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-arrow → react-arrow}/dist/index.cjs +0 -0
  322. /package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-arrow → react-arrow}/dist/index.es.js +0 -0
@@ -1,69 +1,67 @@
1
- const d = (n) => typeof n == "string", A = () => {
2
- let n, e;
1
+ const d = (o) => typeof o == "string", H = () => {
2
+ let o, e;
3
3
  const t = new Promise((s, i) => {
4
- n = s, e = i;
4
+ o = s, e = i;
5
5
  });
6
- return t.resolve = n, t.reject = e, t;
7
- }, q = (n) => n == null ? "" : "" + n, ce = (n, e, t) => {
8
- n.forEach((s) => {
6
+ return t.resolve = o, t.reject = e, t;
7
+ }, z = (o) => o == null ? "" : String(o), Le = (o, e, t) => {
8
+ o.forEach((s) => {
9
9
  e[s] && (t[s] = e[s]);
10
10
  });
11
- }, de = /###/g, _ = (n) => n && n.indexOf("###") > -1 ? n.replace(de, ".") : n, ee = (n) => !n || d(n), D = (n, e, t) => {
11
+ }, be = /###/g, ie = (o) => o && o.includes("###") ? o.replace(be, ".") : o, ne = (o) => !o || d(o), U = (o, e, t) => {
12
12
  const s = d(e) ? e.split(".") : e;
13
13
  let i = 0;
14
14
  for (; i < s.length - 1; ) {
15
- if (ee(n)) return {};
16
- const r = _(s[i]);
17
- !n[r] && t && (n[r] = new t()), Object.prototype.hasOwnProperty.call(n, r) ? n = n[r] : n = {}, ++i;
15
+ if (ne(o)) return {};
16
+ const n = ie(s[i]);
17
+ !o[n] && t && (o[n] = new t()), Object.prototype.hasOwnProperty.call(o, n) ? o = o[n] : o = {}, ++i;
18
18
  }
19
- return ee(n) ? {} : {
20
- obj: n,
21
- k: _(s[i])
19
+ return ne(o) ? {} : {
20
+ obj: o,
21
+ k: ie(s[i])
22
22
  };
23
- }, te = (n, e, t) => {
23
+ }, re = (o, e, t) => {
24
24
  const {
25
25
  obj: s,
26
26
  k: i
27
- } = D(n, e, Object);
27
+ } = U(o, e, Object);
28
28
  if (s !== void 0 || e.length === 1) {
29
29
  s[i] = t;
30
30
  return;
31
31
  }
32
- let r = e[e.length - 1], a = e.slice(0, e.length - 1), o = D(n, a, Object);
33
- for (; o.obj === void 0 && a.length; )
34
- r = `${a[a.length - 1]}.${r}`, a = a.slice(0, a.length - 1), o = D(n, a, Object), o && o.obj && typeof o.obj[`${o.k}.${r}`] < "u" && (o.obj = void 0);
35
- o.obj[`${o.k}.${r}`] = t;
36
- }, pe = (n, e, t, s) => {
32
+ let n = e[e.length - 1], r = e.slice(0, e.length - 1), a = U(o, r, Object);
33
+ for (; a.obj === void 0 && r.length; )
34
+ n = `${r[r.length - 1]}.${n}`, r = r.slice(0, r.length - 1), a = U(o, r, Object), a?.obj && typeof a.obj[`${a.k}.${n}`] < "u" && (a.obj = void 0);
35
+ a.obj[`${a.k}.${n}`] = t;
36
+ }, ve = (o, e, t, s) => {
37
37
  const {
38
38
  obj: i,
39
- k: r
40
- } = D(n, e, Object);
41
- i[r] = i[r] || [], i[r].push(t);
42
- }, M = (n, e) => {
39
+ k: n
40
+ } = U(o, e, Object);
41
+ i[n] = i[n] || [], i[n].push(t);
42
+ }, _ = (o, e) => {
43
43
  const {
44
44
  obj: t,
45
45
  k: s
46
- } = D(n, e);
47
- if (t)
46
+ } = U(o, e);
47
+ if (t && Object.prototype.hasOwnProperty.call(t, s))
48
48
  return t[s];
49
- }, me = (n, e, t) => {
50
- const s = M(n, t);
51
- return s !== void 0 ? s : M(e, t);
52
- }, ue = (n, e, t) => {
49
+ }, Oe = (o, e, t) => {
50
+ const s = _(o, t);
51
+ return s !== void 0 ? s : _(e, t);
52
+ }, ge = (o, e, t) => {
53
53
  for (const s in e)
54
- s !== "__proto__" && s !== "constructor" && (s in n ? d(n[s]) || n[s] instanceof String || d(e[s]) || e[s] instanceof String ? t && (n[s] = e[s]) : ue(n[s], e[s], t) : n[s] = e[s]);
55
- return n;
56
- }, P = (n) => n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
57
- var xe = {
54
+ s !== "__proto__" && s !== "constructor" && (Object.prototype.hasOwnProperty.call(o, s) ? d(o[s]) || o[s] instanceof String || d(e[s]) || e[s] instanceof String ? t && (o[s] = e[s]) : ge(o[s], e[s], t) : o[s] = e[s]);
55
+ return o;
56
+ }, j = (o) => o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), we = {
58
57
  "&": "&amp;",
59
58
  "<": "&lt;",
60
59
  ">": "&gt;",
61
60
  '"': "&quot;",
62
61
  "'": "&#39;",
63
62
  "/": "&#x2F;"
64
- };
65
- const be = (n) => d(n) ? n.replace(/[&<>"'\/]/g, (e) => xe[e]) : n;
66
- class ye {
63
+ }, Ce = (o) => d(o) ? o.replace(/[&<>"'\/]/g, (e) => we[e]) : o;
64
+ class Re {
67
65
  constructor(e) {
68
66
  this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
69
67
  }
@@ -75,96 +73,86 @@ class ye {
75
73
  return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, s), this.regExpQueue.push(e), s;
76
74
  }
77
75
  }
78
- const Se = [" ", ",", "?", "!", ";"], Le = new ye(20), Oe = (n, e, t) => {
76
+ const $e = [" ", ",", "?", "!", ";"], Pe = new Re(20), Ne = (o, e, t) => {
79
77
  e = e || "", t = t || "";
80
- const s = Se.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
78
+ const s = $e.filter((r) => !e.includes(r) && !t.includes(r));
81
79
  if (s.length === 0) return !0;
82
- const i = Le.getRegExp(`(${s.map((a) => a === "?" ? "\\?" : a).join("|")})`);
83
- let r = !i.test(n);
84
- if (!r) {
85
- const a = n.indexOf(t);
86
- a > 0 && !i.test(n.substring(0, a)) && (r = !0);
87
- }
88
- return r;
89
- }, Y = function(n, e) {
90
- let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
91
- if (!n) return;
92
- if (n[e]) return n[e];
80
+ const i = Pe.getRegExp(`(${s.map((r) => r === "?" ? "\\?" : r).join("|")})`);
81
+ let n = !i.test(o);
82
+ if (!n) {
83
+ const r = o.indexOf(t);
84
+ r > 0 && !i.test(o.substring(0, r)) && (n = !0);
85
+ }
86
+ return n;
87
+ }, X = (o, e, t = ".") => {
88
+ if (!o) return;
89
+ if (o[e])
90
+ return Object.prototype.hasOwnProperty.call(o, e) ? o[e] : void 0;
93
91
  const s = e.split(t);
94
- let i = n;
95
- for (let r = 0; r < s.length; ) {
92
+ let i = o;
93
+ for (let n = 0; n < s.length; ) {
96
94
  if (!i || typeof i != "object")
97
95
  return;
98
- let a, o = "";
99
- for (let l = r; l < s.length; ++l)
100
- if (l !== r && (o += t), o += s[l], a = i[o], a !== void 0) {
101
- if (["string", "number", "boolean"].indexOf(typeof a) > -1 && l < s.length - 1)
96
+ let r, a = "";
97
+ for (let u = n; u < s.length; ++u)
98
+ if (u !== n && (a += t), a += s[u], r = i[a], (typeof r == "function" || a === "__proto__") && !Object.prototype.hasOwnProperty.call(i, a) && (r = void 0), r !== void 0) {
99
+ if (["string", "number", "boolean"].includes(typeof r) && u < s.length - 1)
102
100
  continue;
103
- r += l - r + 1;
101
+ n += u - n + 1;
104
102
  break;
105
103
  }
106
- i = a;
104
+ i = r;
107
105
  }
108
106
  return i;
109
- }, H = (n) => n && n.replace("_", "-"), ve = {
107
+ }, A = (o) => o?.replace(/_/g, "-"), Fe = {
110
108
  type: "logger",
111
- log(n) {
112
- this.output("log", n);
109
+ log(o) {
110
+ this.output("log", o);
113
111
  },
114
- warn(n) {
115
- this.output("warn", n);
112
+ warn(o) {
113
+ this.output("warn", o);
116
114
  },
117
- error(n) {
118
- this.output("error", n);
115
+ error(o) {
116
+ this.output("error", o);
119
117
  },
120
- output(n, e) {
121
- console && console[n] && console[n].apply(console, e);
118
+ output(o, e) {
119
+ console?.[o]?.apply?.(console, e);
122
120
  }
123
121
  };
124
- class z {
125
- constructor(e) {
126
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
122
+ class W {
123
+ constructor(e, t = {}) {
127
124
  this.init(e, t);
128
125
  }
129
- init(e) {
130
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
131
- this.prefix = t.prefix || "i18next:", this.logger = e || ve, this.options = t, this.debug = t.debug;
126
+ init(e, t = {}) {
127
+ this.prefix = t.prefix || "i18next:", this.logger = e || Fe, this.options = t, this.debug = t.debug;
132
128
  }
133
- log() {
134
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
135
- t[s] = arguments[s];
136
- return this.forward(t, "log", "", !0);
129
+ log(...e) {
130
+ return this.forward(e, "log", "", !0);
137
131
  }
138
- warn() {
139
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
140
- t[s] = arguments[s];
141
- return this.forward(t, "warn", "", !0);
132
+ warn(...e) {
133
+ return this.forward(e, "warn", "", !0);
142
134
  }
143
- error() {
144
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
145
- t[s] = arguments[s];
146
- return this.forward(t, "error", "");
135
+ error(...e) {
136
+ return this.forward(e, "error", "");
147
137
  }
148
- deprecate() {
149
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
150
- t[s] = arguments[s];
151
- return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
138
+ deprecate(...e) {
139
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
152
140
  }
153
141
  forward(e, t, s, i) {
154
- return i && !this.debug ? null : (d(e[0]) && (e[0] = `${s}${this.prefix} ${e[0]}`), this.logger[t](e));
142
+ return i && !this.debug ? null : (e = e.map((n) => d(n) ? n.replace(/[\r\n\x00-\x1F\x7F]/g, " ") : n), d(e[0]) && (e[0] = `${s}${this.prefix} ${e[0]}`), this.logger[t](e));
155
143
  }
156
144
  create(e) {
157
- return new z(this.logger, {
145
+ return new W(this.logger, {
158
146
  prefix: `${this.prefix}:${e}:`,
159
147
  ...this.options
160
148
  });
161
149
  }
162
150
  clone(e) {
163
- return e = e || this.options, e.prefix = e.prefix || this.prefix, new z(this.logger, e);
151
+ return e = e || this.options, e.prefix = e.prefix || this.prefix, new W(this.logger, e);
164
152
  }
165
153
  }
166
- var N = new z();
167
- class B {
154
+ var F = new W();
155
+ class Q {
168
156
  constructor() {
169
157
  this.observers = {};
170
158
  }
@@ -184,72 +172,71 @@ class B {
184
172
  this.observers[e].delete(t);
185
173
  }
186
174
  }
187
- emit(e) {
188
- for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
189
- s[i - 1] = arguments[i];
190
- this.observers[e] && Array.from(this.observers[e].entries()).forEach((a) => {
191
- let [o, l] = a;
192
- for (let f = 0; f < l; f++)
193
- o(...s);
194
- }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((a) => {
195
- let [o, l] = a;
196
- for (let f = 0; f < l; f++)
197
- o.apply(o, [e, ...s]);
175
+ once(e, t) {
176
+ const s = (...i) => {
177
+ t(...i), this.off(e, s);
178
+ };
179
+ return this.on(e, s), this;
180
+ }
181
+ emit(e, ...t) {
182
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach(([i, n]) => {
183
+ for (let r = 0; r < n; r++)
184
+ i(...t);
185
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([i, n]) => {
186
+ for (let r = 0; r < n; r++)
187
+ i(e, ...t);
198
188
  });
199
189
  }
200
190
  }
201
- class se extends B {
202
- constructor(e) {
203
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
204
- ns: ["translation"],
205
- defaultNS: "translation"
206
- };
191
+ const ae = /* @__PURE__ */ new WeakSet();
192
+ class oe extends Q {
193
+ constructor(e, t = {
194
+ ns: ["translation"],
195
+ defaultNS: "translation"
196
+ }) {
207
197
  super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
208
198
  }
209
199
  addNamespaces(e) {
210
- this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
200
+ this.options.ns.includes(e) || this.options.ns.push(e);
211
201
  }
212
202
  removeNamespaces(e) {
213
203
  const t = this.options.ns.indexOf(e);
214
204
  t > -1 && this.options.ns.splice(t, 1);
215
205
  }
216
- getResource(e, t, s) {
217
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
218
- const r = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, a = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
219
- let o;
220
- e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], s && (Array.isArray(s) ? o.push(...s) : d(s) && r ? o.push(...s.split(r)) : o.push(s)));
221
- const l = M(this.data, o);
222
- return !l && !t && !s && e.indexOf(".") > -1 && (e = o[0], t = o[1], s = o.slice(2).join(".")), l || !a || !d(s) ? l : Y(this.data && this.data[e] && this.data[e][t], s, r);
223
- }
224
- addResource(e, t, s, i) {
225
- let r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
226
- silent: !1
227
- };
228
- const a = r.keySeparator !== void 0 ? r.keySeparator : this.options.keySeparator;
229
- let o = [e, t];
230
- s && (o = o.concat(a ? s.split(a) : s)), e.indexOf(".") > -1 && (o = e.split("."), i = t, t = o[1]), this.addNamespaces(t), te(this.data, o, i), r.silent || this.emit("added", e, t, s, i);
231
- }
232
- addResources(e, t, s) {
233
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
234
- silent: !1
235
- };
236
- for (const r in s)
237
- (d(s[r]) || Array.isArray(s[r])) && this.addResource(e, t, r, s[r], {
206
+ getResource(e, t, s, i = {}) {
207
+ const n = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, r = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
208
+ let a;
209
+ e.includes(".") ? a = e.split(".") : (a = [e, t], s && (Array.isArray(s) ? a.push(...s) : d(s) && n ? a.push(...s.split(n)) : a.push(s)));
210
+ const u = _(this.data, a);
211
+ return u == null && !t && !s && e.includes(".") && (e = a[0], t = a[1], s = a.slice(2).join(".")), u != null || !r || !d(s) ? u : X(this.data?.[e]?.[t], s, n);
212
+ }
213
+ addResource(e, t, s, i, n = {
214
+ silent: !1
215
+ }) {
216
+ const r = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator;
217
+ let a = [e, t];
218
+ s && (a = a.concat(r ? s.split(r) : s)), e.includes(".") && (a = e.split("."), i = t, t = a[1]), this.addNamespaces(t), re(this.data, a, i), n.silent || this.emit("added", e, t, s, i);
219
+ }
220
+ addResources(e, t, s, i = {
221
+ silent: !1
222
+ }) {
223
+ for (const n in s)
224
+ (d(s[n]) || Array.isArray(s[n])) && this.addResource(e, t, n, s[n], {
238
225
  silent: !0
239
226
  });
240
227
  i.silent || this.emit("added", e, t, s);
241
228
  }
242
- addResourceBundle(e, t, s, i, r) {
243
- let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
244
- silent: !1,
245
- skipCopy: !1
246
- }, o = [e, t];
247
- e.indexOf(".") > -1 && (o = e.split("."), i = s, s = t, t = o[1]), this.addNamespaces(t);
248
- let l = M(this.data, o) || {};
249
- a.skipCopy || (s = JSON.parse(JSON.stringify(s))), i ? ue(l, s, r) : l = {
250
- ...l,
229
+ addResourceBundle(e, t, s, i, n, r = {
230
+ silent: !1,
231
+ skipCopy: !1
232
+ }) {
233
+ let a = [e, t];
234
+ e.includes(".") && (a = e.split("."), i = s, s = t, t = a[1]), this.addNamespaces(t);
235
+ let u = _(this.data, a) || {};
236
+ r.skipCopy || (s = JSON.parse(JSON.stringify(s))), i ? ge(u, s, n) : u = {
237
+ ...u,
251
238
  ...s
252
- }, te(this.data, o, l), a.silent || this.emit("added", e, t, s);
239
+ }, re(this.data, a, u), r.silent || this.emit("added", e, t, s);
253
240
  }
254
241
  removeResourceBundle(e, t) {
255
242
  this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
@@ -258,167 +245,200 @@ class se extends B {
258
245
  return this.getResource(e, t) !== void 0;
259
246
  }
260
247
  getResourceBundle(e, t) {
261
- return t || (t = this.options.defaultNS), this.options.compatibilityAPI === "v1" ? {
262
- ...this.getResource(e, t)
263
- } : this.getResource(e, t);
248
+ return t || (t = this.options.defaultNS), this.getResource(e, t);
264
249
  }
265
250
  getDataByLanguage(e) {
266
251
  return this.data[e];
267
252
  }
268
253
  hasLanguageSomeTranslations(e) {
269
254
  const t = this.getDataByLanguage(e);
270
- return !!(t && Object.keys(t) || []).find((i) => t[i] && Object.keys(t[i]).length > 0);
255
+ return !!(t && Object.keys(t) || []).find((i) => {
256
+ const n = t[i];
257
+ return ae.has(n) ? !0 : !n || Object.keys(n).length === 0 ? !1 : (typeof n == "object" && ae.add(n), !0);
258
+ });
271
259
  }
272
260
  toJSON() {
273
261
  return this.data;
274
262
  }
275
263
  }
276
- var fe = {
264
+ var me = {
277
265
  processors: {},
278
- addPostProcessor(n) {
279
- this.processors[n.name] = n;
266
+ addPostProcessor(o) {
267
+ this.processors[o.name] = o;
280
268
  },
281
- handle(n, e, t, s, i) {
282
- return n.forEach((r) => {
283
- this.processors[r] && (e = this.processors[r].process(e, t, s, i));
269
+ handle(o, e, t, s, i) {
270
+ return o.forEach((n) => {
271
+ e = this.processors[n]?.process(e, t, s, i) ?? e;
284
272
  }), e;
285
273
  }
286
274
  };
287
- const ie = {};
288
- class J extends B {
289
- constructor(e) {
290
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
291
- super(), ce(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = N.create("translator");
275
+ const ye = /* @__PURE__ */ Symbol("i18next/PATH_KEY");
276
+ function je() {
277
+ const o = [], e = /* @__PURE__ */ Object.create(null);
278
+ let t;
279
+ return e.get = (s, i) => (t?.revoke?.(), i === ye ? o : (o.push(i), t = Proxy.revocable(s, e), t.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), e).proxy;
280
+ }
281
+ function V(o, e) {
282
+ const {
283
+ [ye]: t
284
+ } = o(je()), s = e?.keySeparator ?? ".", i = e?.nsSeparator ?? ":", n = e?.enableSelector === "strict";
285
+ if (t.length > 1 && i) {
286
+ const r = e?.ns, a = n ? Array.isArray(r) ? r : r ? [r] : null : Array.isArray(r) ? r : null;
287
+ if (a && (n ? a : a.length > 1 ? a.slice(1) : []).includes(t[0]))
288
+ return `${t[0]}${i}${t.slice(1).join(s)}`;
289
+ }
290
+ return t.join(s);
291
+ }
292
+ const G = (o) => !d(o) && typeof o != "boolean" && typeof o != "number";
293
+ class Y extends Q {
294
+ constructor(e, t = {}) {
295
+ super(), Le(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = F.create("translator"), this.checkedLoadedFor = {};
292
296
  }
293
297
  changeLanguage(e) {
294
298
  e && (this.language = e);
295
299
  }
296
- exists(e) {
297
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
298
- interpolation: {}
300
+ exists(e, t = {
301
+ interpolation: {}
302
+ }) {
303
+ const s = {
304
+ ...t
299
305
  };
300
- if (e == null)
301
- return !1;
302
- const s = this.resolve(e, t);
303
- return s && s.res !== void 0;
306
+ if (e == null) return !1;
307
+ const i = this.resolve(e, s);
308
+ if (i?.res === void 0) return !1;
309
+ const n = G(i.res);
310
+ return !(s.returnObjects === !1 && n);
304
311
  }
305
312
  extractFromKey(e, t) {
306
313
  let s = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
307
314
  s === void 0 && (s = ":");
308
315
  const i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
309
- let r = t.ns || this.options.defaultNS || [];
310
- const a = s && e.indexOf(s) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Oe(e, s, i);
311
- if (a && !o) {
312
- const l = e.match(this.interpolator.nestingRegexp);
313
- if (l && l.length > 0)
316
+ let n = t.ns || this.options.defaultNS || [];
317
+ const r = s && e.includes(s), a = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Ne(e, s, i);
318
+ if (r && !a) {
319
+ const u = e.match(this.interpolator.nestingRegexp);
320
+ if (u && u.length > 0)
314
321
  return {
315
322
  key: e,
316
- namespaces: d(r) ? [r] : r
323
+ namespaces: d(n) ? [n] : n
317
324
  };
318
- const f = e.split(s);
319
- (s !== i || s === i && this.options.ns.indexOf(f[0]) > -1) && (r = f.shift()), e = f.join(i);
325
+ const l = e.split(s);
326
+ (s !== i || s === i && this.options.ns.includes(l[0])) && (n = l.shift()), e = l.join(i);
320
327
  }
321
328
  return {
322
329
  key: e,
323
- namespaces: d(r) ? [r] : r
330
+ namespaces: d(n) ? [n] : n
324
331
  };
325
332
  }
326
333
  translate(e, t, s) {
327
- if (typeof t != "object" && this.options.overloadTranslationOptionHandler && (t = this.options.overloadTranslationOptionHandler(arguments)), typeof t == "object" && (t = {
334
+ let i = typeof t == "object" ? {
328
335
  ...t
329
- }), t || (t = {}), e == null) return "";
330
- Array.isArray(e) || (e = [String(e)]);
331
- const i = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, r = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
336
+ } : t;
337
+ if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = {
338
+ ...i
339
+ }), i || (i = {}), e == null) return "";
340
+ typeof e == "function" && (e = V(e, {
341
+ ...this.options,
342
+ ...i
343
+ })), Array.isArray(e) || (e = [String(e)]), e = e.map((v) => typeof v == "function" ? V(v, {
344
+ ...this.options,
345
+ ...i
346
+ }) : String(v));
347
+ const n = i.returnDetails !== void 0 ? i.returnDetails : this.options.returnDetails, r = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, {
332
348
  key: a,
333
- namespaces: o
334
- } = this.extractFromKey(e[e.length - 1], t), l = o[o.length - 1], f = t.lng || this.language, h = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
335
- if (f && f.toLowerCase() === "cimode") {
336
- if (h) {
337
- const b = t.nsSeparator || this.options.nsSeparator;
338
- return i ? {
339
- res: `${l}${b}${a}`,
340
- usedKey: a,
341
- exactUsedKey: a,
342
- usedLng: f,
343
- usedNS: l,
344
- usedParams: this.getUsedParamsDetails(t)
345
- } : `${l}${b}${a}`;
346
- }
347
- return i ? {
349
+ namespaces: u
350
+ } = this.extractFromKey(e[e.length - 1], i), l = u[u.length - 1];
351
+ let c = i.nsSeparator !== void 0 ? i.nsSeparator : this.options.nsSeparator;
352
+ c === void 0 && (c = ":");
353
+ const h = i.lng || this.language, f = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
354
+ if (h?.toLowerCase() === "cimode")
355
+ return f ? n ? {
356
+ res: `${l}${c}${a}`,
357
+ usedKey: a,
358
+ exactUsedKey: a,
359
+ usedLng: h,
360
+ usedNS: l,
361
+ usedParams: this.getUsedParamsDetails(i)
362
+ } : `${l}${c}${a}` : n ? {
348
363
  res: a,
349
364
  usedKey: a,
350
365
  exactUsedKey: a,
351
- usedLng: f,
366
+ usedLng: h,
352
367
  usedNS: l,
353
- usedParams: this.getUsedParamsDetails(t)
368
+ usedParams: this.getUsedParamsDetails(i)
354
369
  } : a;
355
- }
356
- const g = this.resolve(e, t);
357
- let u = g && g.res;
358
- const c = g && g.usedKey || a, p = g && g.exactUsedKey || a, x = Object.prototype.toString.apply(u), m = ["[object Number]", "[object Function]", "[object RegExp]"], O = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject, k = !d(u) && typeof u != "boolean" && typeof u != "number";
359
- if (y && u && k && m.indexOf(x) < 0 && !(d(O) && Array.isArray(u))) {
360
- if (!t.returnObjects && !this.options.returnObjects) {
370
+ const g = this.resolve(e, i);
371
+ let p = g?.res;
372
+ const m = g?.usedKey || a, S = g?.exactUsedKey || a, L = ["[object Number]", "[object Function]", "[object RegExp]"], y = i.joinArrays !== void 0 ? i.joinArrays : this.options.joinArrays, b = !this.i18nFormat || this.i18nFormat.handleAsObject, x = i.count !== void 0 && !d(i.count), R = Y.hasDefaultValue(i), T = x ? this.pluralResolver.getSuffix(h, i.count, i) : "", I = i.ordinal && x ? this.pluralResolver.getSuffix(h, i.count, {
373
+ ordinal: !1
374
+ }) : "", q = x && !i.ordinal && i.count === 0, k = q && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${T}`] || i[`defaultValue${I}`] || i.defaultValue;
375
+ let $ = p;
376
+ b && !p && R && ($ = k);
377
+ const xe = G($), Se = Object.prototype.toString.apply($);
378
+ if (b && $ && xe && !L.includes(Se) && !(d(y) && Array.isArray($))) {
379
+ if (!i.returnObjects && !this.options.returnObjects) {
361
380
  this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
362
- const b = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(c, u, {
363
- ...t,
364
- ns: o
381
+ const v = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(m, $, {
382
+ ...i,
383
+ ns: u
365
384
  }) : `key '${a} (${this.language})' returned an object instead of string.`;
366
- return i ? (g.res = b, g.usedParams = this.getUsedParamsDetails(t), g) : b;
385
+ return n ? (g.res = v, g.usedParams = this.getUsedParamsDetails(i), g) : v;
367
386
  }
368
387
  if (r) {
369
- const b = Array.isArray(u), v = b ? [] : {}, C = b ? p : c;
370
- for (const S in u)
371
- if (Object.prototype.hasOwnProperty.call(u, S)) {
372
- const T = `${C}${r}${S}`;
373
- v[S] = this.translate(T, {
374
- ...t,
388
+ const v = Array.isArray($), C = v ? [] : {}, ee = v ? S : m;
389
+ for (const P in $)
390
+ if (Object.prototype.hasOwnProperty.call($, P)) {
391
+ const N = `${ee}${r}${P}`;
392
+ R && !p ? C[P] = this.translate(N, {
393
+ ...i,
394
+ defaultValue: G(k) ? k[P] : void 0,
395
+ joinArrays: !1,
396
+ ns: u
397
+ }) : C[P] = this.translate(N, {
398
+ ...i,
375
399
  joinArrays: !1,
376
- ns: o
377
- }), v[S] === T && (v[S] = u[S]);
400
+ ns: u
401
+ }), C[P] === N && (C[P] = $[P]);
378
402
  }
379
- u = v;
403
+ p = C;
380
404
  }
381
- } else if (y && d(O) && Array.isArray(u))
382
- u = u.join(O), u && (u = this.extendTranslation(u, e, t, s));
405
+ } else if (b && d(y) && Array.isArray(p))
406
+ p = p.join(y), p && (p = this.extendTranslation(p, e, i, g, s));
383
407
  else {
384
- let b = !1, v = !1;
385
- const C = t.count !== void 0 && !d(t.count), S = J.hasDefaultValue(t), T = C ? this.pluralResolver.getSuffix(f, t.count, t) : "", he = t.ordinal && C ? this.pluralResolver.getSuffix(f, t.count, {
386
- ordinal: !1
387
- }) : "", G = C && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), E = G && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${T}`] || t[`defaultValue${he}`] || t.defaultValue;
388
- !this.isValidLookup(u) && S && (b = !0, u = E), this.isValidLookup(u) || (v = !0, u = a);
389
- const ge = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && v ? void 0 : u, F = S && E !== u && this.options.updateMissing;
390
- if (v || b || F) {
391
- if (this.logger.log(F ? "updateKey" : "missingKey", f, l, a, F ? E : u), r) {
408
+ let v = !1, C = !1;
409
+ !this.isValidLookup(p) && R && (v = !0, p = k), this.isValidLookup(p) || (C = !0, p = a);
410
+ const P = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && C ? void 0 : p, N = R && k !== p && this.options.updateMissing;
411
+ if (C || v || N) {
412
+ if (this.logger.log(N ? "updateKey" : "missingKey", h, l, x && !N ? `${a}${this.pluralResolver.getSuffix(h, i.count, i)}` : a, N ? k : p), r) {
392
413
  const w = this.resolve(a, {
393
- ...t,
414
+ ...i,
394
415
  keySeparator: !1
395
416
  });
396
417
  w && w.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.");
397
418
  }
398
- let I = [];
399
- const K = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
400
- if (this.options.saveMissingTo === "fallback" && K && K[0])
401
- for (let w = 0; w < K.length; w++)
402
- I.push(K[w]);
403
- else this.options.saveMissingTo === "all" ? I = this.languageUtils.toResolveHierarchy(t.lng || this.language) : I.push(t.lng || this.language);
404
- const Z = (w, R, j) => {
405
- const X = S && j !== u ? j : ge;
406
- this.options.missingKeyHandler ? this.options.missingKeyHandler(w, l, R, X, F, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(w, l, R, X, F, t), this.emit("missingKey", w, l, R, u);
419
+ let K = [];
420
+ const B = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
421
+ if (this.options.saveMissingTo === "fallback" && B && B[0])
422
+ for (let w = 0; w < B.length; w++)
423
+ K.push(B[w]);
424
+ else this.options.saveMissingTo === "all" ? K = this.languageUtils.toResolveHierarchy(i.lng || this.language) : K.push(i.lng || this.language);
425
+ const te = (w, E, D) => {
426
+ const se = R && D !== p ? D : P;
427
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(w, l, E, se, N, i) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(w, l, E, se, N, i), this.emit("missingKey", w, l, E, p);
407
428
  };
408
- this.options.saveMissing && (this.options.saveMissingPlurals && C ? I.forEach((w) => {
409
- const R = this.pluralResolver.getSuffixes(w, t);
410
- G && t[`defaultValue${this.options.pluralSeparator}zero`] && R.indexOf(`${this.options.pluralSeparator}zero`) < 0 && R.push(`${this.options.pluralSeparator}zero`), R.forEach((j) => {
411
- Z([w], a + j, t[`defaultValue${j}`] || E);
429
+ this.options.saveMissing && (this.options.saveMissingPlurals && x ? K.forEach((w) => {
430
+ const E = this.pluralResolver.getSuffixes(w, i);
431
+ q && i[`defaultValue${this.options.pluralSeparator}zero`] && !E.includes(`${this.options.pluralSeparator}zero`) && E.push(`${this.options.pluralSeparator}zero`), E.forEach((D) => {
432
+ te([w], a + D, i[`defaultValue${D}`] || k);
412
433
  });
413
- }) : Z(I, a, E));
434
+ }) : te(K, a, k));
414
435
  }
415
- u = this.extendTranslation(u, e, t, g, s), v && u === a && this.options.appendNamespaceToMissingKey && (u = `${l}:${a}`), (v || b) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? u = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}:${a}` : a, b ? u : void 0) : u = this.options.parseMissingKeyHandler(u));
436
+ p = this.extendTranslation(p, e, i, g, s), C && p === a && this.options.appendNamespaceToMissingKey && (p = `${l}${c}${a}`), (C || v) && this.options.parseMissingKeyHandler && (p = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}${c}${a}` : a, v ? p : void 0, i));
416
437
  }
417
- return i ? (g.res = u, g.usedParams = this.getUsedParamsDetails(t), g) : u;
438
+ return n ? (g.res = p, g.usedParams = this.getUsedParamsDetails(i), g) : p;
418
439
  }
419
- extendTranslation(e, t, s, i, r) {
420
- var a = this;
421
- if (this.i18nFormat && this.i18nFormat.parse)
440
+ extendTranslation(e, t, s, i, n) {
441
+ if (this.i18nFormat?.parse)
422
442
  e = this.i18nFormat.parse(e, {
423
443
  ...this.options.interpolation.defaultVariables,
424
444
  ...s
@@ -433,28 +453,24 @@ class J extends B {
433
453
  ...s.interpolation
434
454
  }
435
455
  });
436
- const f = d(e) && (s && s.interpolation && s.interpolation.skipOnVariables !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
437
- let h;
438
- if (f) {
439
- const u = e.match(this.interpolator.nestingRegexp);
440
- h = u && u.length;
456
+ const u = d(e) && (s?.interpolation?.skipOnVariables !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
457
+ let l;
458
+ if (u) {
459
+ const h = e.match(this.interpolator.nestingRegexp);
460
+ l = h && h.length;
441
461
  }
442
- let g = s.replace && !d(s.replace) ? s.replace : s;
443
- if (this.options.interpolation.defaultVariables && (g = {
462
+ let c = s.replace && !d(s.replace) ? s.replace : s;
463
+ if (this.options.interpolation.defaultVariables && (c = {
444
464
  ...this.options.interpolation.defaultVariables,
445
- ...g
446
- }), e = this.interpolator.interpolate(e, g, s.lng || this.language || i.usedLng, s), f) {
447
- const u = e.match(this.interpolator.nestingRegexp), c = u && u.length;
448
- h < c && (s.nest = !1);
465
+ ...c
466
+ }), e = this.interpolator.interpolate(e, c, s.lng || this.language || i.usedLng, s), u) {
467
+ const h = e.match(this.interpolator.nestingRegexp), f = h && h.length;
468
+ l < f && (s.nest = !1);
449
469
  }
450
- !s.lng && this.options.compatibilityAPI !== "v1" && i && i.res && (s.lng = this.language || i.usedLng), s.nest !== !1 && (e = this.interpolator.nest(e, function() {
451
- for (var u = arguments.length, c = new Array(u), p = 0; p < u; p++)
452
- c[p] = arguments[p];
453
- return r && r[0] === c[0] && !s.context ? (a.logger.warn(`It seems you are nesting recursively key: ${c[0]} in key: ${t[0]}`), null) : a.translate(...c, t);
454
- }, s)), s.interpolation && this.interpolator.reset();
470
+ !s.lng && i && i.res && (s.lng = this.language || i.usedLng), s.nest !== !1 && (e = this.interpolator.nest(e, (...h) => n?.[0] === h[0] && !s.context ? (this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${t[0]}`), null) : this.translate(...h, t), s)), s.interpolation && this.interpolator.reset();
455
471
  }
456
- const o = s.postProcess || this.options.postProcess, l = d(o) ? [o] : o;
457
- return e != null && l && l.length && s.applyPostProcessor !== !1 && (e = fe.handle(l, e, t, this.options && this.options.postProcessPassResolved ? {
472
+ const r = s.postProcess || this.options.postProcess, a = d(r) ? [r] : r;
473
+ return e != null && a?.length && s.applyPostProcessor !== !1 && (e = me.handle(a, e, t, this.options && this.options.postProcessPassResolved ? {
458
474
  i18nResolved: {
459
475
  ...i,
460
476
  usedParams: this.getUsedParamsDetails(s)
@@ -462,106 +478,109 @@ class J extends B {
462
478
  ...s
463
479
  } : s, this)), e;
464
480
  }
465
- resolve(e) {
466
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, i, r, a, o;
467
- return d(e) && (e = [e]), e.forEach((l) => {
481
+ resolve(e, t = {}) {
482
+ let s, i, n, r, a;
483
+ return d(e) && (e = [e]), Array.isArray(e) && (e = e.map((u) => typeof u == "function" ? V(u, {
484
+ ...this.options,
485
+ ...t
486
+ }) : u)), e.forEach((u) => {
468
487
  if (this.isValidLookup(s)) return;
469
- const f = this.extractFromKey(l, t), h = f.key;
470
- i = h;
471
- let g = f.namespaces;
472
- this.options.fallbackNS && (g = g.concat(this.options.fallbackNS));
473
- const u = t.count !== void 0 && !d(t.count), c = u && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), p = t.context !== void 0 && (d(t.context) || typeof t.context == "number") && t.context !== "", x = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
474
- g.forEach((m) => {
475
- this.isValidLookup(s) || (o = m, !ie[`${x[0]}-${m}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(o) && (ie[`${x[0]}-${m}`] = !0, this.logger.warn(`key "${i}" for languages "${x.join(", ")}" won't get resolved as namespace "${o}" 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!!!")), x.forEach((O) => {
488
+ const l = this.extractFromKey(u, t), c = l.key;
489
+ i = c;
490
+ let h = l.namespaces;
491
+ this.options.fallbackNS && (h = h.concat(this.options.fallbackNS));
492
+ const f = t.count !== void 0 && !d(t.count), g = f && !t.ordinal && t.count === 0, p = t.context !== void 0 && (d(t.context) || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
493
+ h.forEach((S) => {
494
+ this.isValidLookup(s) || (a = S, !this.checkedLoadedFor[`${m[0]}-${S}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(a) && (this.checkedLoadedFor[`${m[0]}-${S}`] = !0, this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${a}" 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!!!")), m.forEach((L) => {
476
495
  if (this.isValidLookup(s)) return;
477
- a = O;
478
- const y = [h];
479
- if (this.i18nFormat && this.i18nFormat.addLookupKeys)
480
- this.i18nFormat.addLookupKeys(y, h, O, m, t);
496
+ r = L;
497
+ const y = [c];
498
+ if (this.i18nFormat?.addLookupKeys)
499
+ this.i18nFormat.addLookupKeys(y, c, L, S, t);
481
500
  else {
482
- let b;
483
- u && (b = this.pluralResolver.getSuffix(O, t.count, t));
484
- const v = `${this.options.pluralSeparator}zero`, C = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
485
- if (u && (y.push(h + b), t.ordinal && b.indexOf(C) === 0 && y.push(h + b.replace(C, this.options.pluralSeparator)), c && y.push(h + v)), p) {
486
- const S = `${h}${this.options.contextSeparator}${t.context}`;
487
- y.push(S), u && (y.push(S + b), t.ordinal && b.indexOf(C) === 0 && y.push(S + b.replace(C, this.options.pluralSeparator)), c && y.push(S + v));
501
+ let x;
502
+ f && (x = this.pluralResolver.getSuffix(L, t.count, t));
503
+ const R = `${this.options.pluralSeparator}zero`, T = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
504
+ if (f && (t.ordinal && x.startsWith(T) && y.push(c + x.replace(T, this.options.pluralSeparator)), y.push(c + x), g && y.push(c + R)), p) {
505
+ const I = `${c}${this.options.contextSeparator || "_"}${t.context}`;
506
+ y.push(I), f && (t.ordinal && x.startsWith(T) && y.push(I + x.replace(T, this.options.pluralSeparator)), y.push(I + x), g && y.push(I + R));
488
507
  }
489
508
  }
490
- let k;
491
- for (; k = y.pop(); )
492
- this.isValidLookup(s) || (r = k, s = this.getResource(O, m, k, t));
509
+ let b;
510
+ for (; b = y.pop(); )
511
+ this.isValidLookup(s) || (n = b, s = this.getResource(L, S, b, t));
493
512
  }));
494
513
  });
495
514
  }), {
496
515
  res: s,
497
516
  usedKey: i,
498
- exactUsedKey: r,
499
- usedLng: a,
500
- usedNS: o
517
+ exactUsedKey: n,
518
+ usedLng: r,
519
+ usedNS: a
501
520
  };
502
521
  }
503
522
  isValidLookup(e) {
504
523
  return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
505
524
  }
506
- getResource(e, t, s) {
507
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
508
- return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(e, t, s, i) : this.resourceStore.getResource(e, t, s, i);
525
+ getResource(e, t, s, i = {}) {
526
+ return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, s, i) : this.resourceStore.getResource(e, t, s, i);
509
527
  }
510
- getUsedParamsDetails() {
511
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
528
+ getUsedParamsDetails(e = {}) {
512
529
  const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], s = e.replace && !d(e.replace);
513
530
  let i = s ? e.replace : e;
514
- if (s && typeof e.count < "u" && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
531
+ if (s && typeof e.count < "u" && (i = {
532
+ ...i,
533
+ count: e.count
534
+ }), this.options.interpolation.defaultVariables && (i = {
515
535
  ...this.options.interpolation.defaultVariables,
516
536
  ...i
517
537
  }), !s) {
518
538
  i = {
519
539
  ...i
520
540
  };
521
- for (const r of t)
522
- delete i[r];
541
+ for (const n of t)
542
+ delete i[n];
523
543
  }
524
544
  return i;
525
545
  }
526
546
  static hasDefaultValue(e) {
527
547
  const t = "defaultValue";
528
548
  for (const s in e)
529
- if (Object.prototype.hasOwnProperty.call(e, s) && t === s.substring(0, t.length) && e[s] !== void 0)
549
+ if (Object.prototype.hasOwnProperty.call(e, s) && s.startsWith(t) && e[s] !== void 0)
530
550
  return !0;
531
551
  return !1;
532
552
  }
533
553
  }
534
- const W = (n) => n.charAt(0).toUpperCase() + n.slice(1);
535
- class ne {
554
+ class le {
536
555
  constructor(e) {
537
- this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = N.create("languageUtils");
556
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = F.create("languageUtils"), this.resolveHierarchyCache = {};
557
+ }
558
+ clearCache() {
559
+ this.resolveHierarchyCache = {};
538
560
  }
539
561
  getScriptPartFromCode(e) {
540
- if (e = H(e), !e || e.indexOf("-") < 0) return null;
562
+ if (e = A(e), !e || !e.includes("-")) return null;
541
563
  const t = e.split("-");
542
564
  return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
543
565
  }
544
566
  getLanguagePartFromCode(e) {
545
- if (e = H(e), !e || e.indexOf("-") < 0) return e;
567
+ if (e = A(e), !e || !e.includes("-")) return e;
546
568
  const t = e.split("-");
547
569
  return this.formatLanguageCode(t[0]);
548
570
  }
549
571
  formatLanguageCode(e) {
550
- if (d(e) && e.indexOf("-") > -1) {
551
- if (typeof Intl < "u" && typeof Intl.getCanonicalLocales < "u")
552
- try {
553
- let i = Intl.getCanonicalLocales(e)[0];
554
- if (i && this.options.lowerCaseLng && (i = i.toLowerCase()), i) return i;
555
- } catch {
556
- }
557
- const t = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"];
558
- let s = e.split("-");
559
- return this.options.lowerCaseLng ? s = s.map((i) => i.toLowerCase()) : s.length === 2 ? (s[0] = s[0].toLowerCase(), s[1] = s[1].toUpperCase(), t.indexOf(s[1].toLowerCase()) > -1 && (s[1] = W(s[1].toLowerCase()))) : s.length === 3 && (s[0] = s[0].toLowerCase(), s[1].length === 2 && (s[1] = s[1].toUpperCase()), s[0] !== "sgn" && s[2].length === 2 && (s[2] = s[2].toUpperCase()), t.indexOf(s[1].toLowerCase()) > -1 && (s[1] = W(s[1].toLowerCase())), t.indexOf(s[2].toLowerCase()) > -1 && (s[2] = W(s[2].toLowerCase()))), s.join("-");
572
+ if (d(e) && e.includes("-")) {
573
+ let t;
574
+ try {
575
+ t = Intl.getCanonicalLocales(e)[0];
576
+ } catch {
577
+ }
578
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
560
579
  }
561
580
  return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
562
581
  }
563
582
  isSupportedCode(e) {
564
- return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
583
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.includes(e);
565
584
  }
566
585
  getBestMatchFromCodes(e) {
567
586
  if (!e) return null;
@@ -572,13 +591,11 @@ class ne {
572
591
  (!this.options.supportedLngs || this.isSupportedCode(i)) && (t = i);
573
592
  }), !t && this.options.supportedLngs && e.forEach((s) => {
574
593
  if (t) return;
575
- const i = this.getLanguagePartFromCode(s);
594
+ const i = this.getScriptPartFromCode(s);
576
595
  if (this.isSupportedCode(i)) return t = i;
577
- t = this.options.supportedLngs.find((r) => {
578
- if (r === i) return r;
579
- if (!(r.indexOf("-") < 0 && i.indexOf("-") < 0) && (r.indexOf("-") > 0 && i.indexOf("-") < 0 && r.substring(0, r.indexOf("-")) === i || r.indexOf(i) === 0 && i.length > 1))
580
- return r;
581
- });
596
+ const n = this.getLanguagePartFromCode(s);
597
+ if (this.isSupportedCode(n)) return t = n;
598
+ t = this.options.supportedLngs.find((r) => r === n ? !0 : !r.includes("-") && !n.includes("-") ? !1 : !!(r.includes("-") && !n.includes("-") && r.slice(0, r.indexOf("-")) === n));
582
599
  }), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
583
600
  }
584
601
  getFallbackCodes(e, t) {
@@ -589,223 +606,93 @@ class ne {
589
606
  return s || (s = e[this.getScriptPartFromCode(t)]), s || (s = e[this.formatLanguageCode(t)]), s || (s = e[this.getLanguagePartFromCode(t)]), s || (s = e.default), s || [];
590
607
  }
591
608
  toResolveHierarchy(e, t) {
592
- const s = this.getFallbackCodes(t || this.options.fallbackLng || [], e), i = [], r = (a) => {
593
- a && (this.isSupportedCode(a) ? i.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
609
+ const s = this.options.fallbackLng, i = Array.isArray(s) ? s.join("|") : s;
610
+ i !== this._cachedFallbackLng && (this.resolveHierarchyCache = {}, this._cachedFallbackLng = i);
611
+ const n = t === void 0 || t === !1 || d(t), r = t === void 0 && typeof this.options.fallbackLng == "function", a = d(e) && n && !r;
612
+ let u = null;
613
+ if (a) {
614
+ let f;
615
+ t === void 0 ? f = "undefined" : t === !1 ? f = "boolean:false" : f = `string:${t}`, u = `${e.length}:${e}|${f}`;
616
+ }
617
+ if (u !== null) {
618
+ const f = this.resolveHierarchyCache[u];
619
+ if (f !== void 0) return f.slice();
620
+ }
621
+ const l = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), c = [], h = (f) => {
622
+ f && (this.isSupportedCode(f) ? c.push(f) : this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`));
594
623
  };
595
- return d(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && r(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && r(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && r(this.getLanguagePartFromCode(e))) : d(e) && r(this.formatLanguageCode(e)), s.forEach((a) => {
596
- i.indexOf(a) < 0 && r(this.formatLanguageCode(a));
597
- }), i;
624
+ return d(e) && (e.includes("-") || e.includes("_")) ? (this.options.load !== "languageOnly" && h(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && h(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && h(this.getLanguagePartFromCode(e))) : d(e) && h(this.formatLanguageCode(e)), l.forEach((f) => {
625
+ const g = this.formatLanguageCode(f);
626
+ c.includes(g) || h(g);
627
+ }), u !== null ? (this.resolveHierarchyCache[u] = c, c.slice()) : c;
598
628
  }
599
629
  }
600
- let we = [{
601
- lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
602
- nr: [1, 2],
603
- fc: 1
604
- }, {
605
- 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"],
606
- nr: [1, 2],
607
- fc: 2
608
- }, {
609
- lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"],
610
- nr: [1],
611
- fc: 3
612
- }, {
613
- lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
614
- nr: [1, 2, 5],
615
- fc: 4
616
- }, {
617
- lngs: ["ar"],
618
- nr: [0, 1, 2, 3, 11, 100],
619
- fc: 5
620
- }, {
621
- lngs: ["cs", "sk"],
622
- nr: [1, 2, 5],
623
- fc: 6
624
- }, {
625
- lngs: ["csb", "pl"],
626
- nr: [1, 2, 5],
627
- fc: 7
628
- }, {
629
- lngs: ["cy"],
630
- nr: [1, 2, 3, 8],
631
- fc: 8
632
- }, {
633
- lngs: ["fr"],
634
- nr: [1, 2],
635
- fc: 9
636
- }, {
637
- lngs: ["ga"],
638
- nr: [1, 2, 3, 7, 11],
639
- fc: 10
640
- }, {
641
- lngs: ["gd"],
642
- nr: [1, 2, 3, 20],
643
- fc: 11
644
- }, {
645
- lngs: ["is"],
646
- nr: [1, 2],
647
- fc: 12
648
- }, {
649
- lngs: ["jv"],
650
- nr: [0, 1],
651
- fc: 13
652
- }, {
653
- lngs: ["kw"],
654
- nr: [1, 2, 3, 4],
655
- fc: 14
656
- }, {
657
- lngs: ["lt"],
658
- nr: [1, 2, 10],
659
- fc: 15
660
- }, {
661
- lngs: ["lv"],
662
- nr: [1, 2, 0],
663
- fc: 16
664
- }, {
665
- lngs: ["mk"],
666
- nr: [1, 2],
667
- fc: 17
668
- }, {
669
- lngs: ["mnk"],
670
- nr: [0, 1, 2],
671
- fc: 18
672
- }, {
673
- lngs: ["mt"],
674
- nr: [1, 2, 11, 20],
675
- fc: 19
676
- }, {
677
- lngs: ["or"],
678
- nr: [2, 1],
679
- fc: 2
680
- }, {
681
- lngs: ["ro"],
682
- nr: [1, 2, 20],
683
- fc: 20
684
- }, {
685
- lngs: ["sl"],
686
- nr: [5, 1, 2, 3],
687
- fc: 21
688
- }, {
689
- lngs: ["he", "iw"],
690
- nr: [1, 2, 20, 21],
691
- fc: 22
692
- }], Ce = {
693
- 1: (n) => +(n > 1),
694
- 2: (n) => +(n != 1),
695
- 3: (n) => 0,
696
- 4: (n) => n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2,
697
- 5: (n) => n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5,
698
- 6: (n) => n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2,
699
- 7: (n) => n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2,
700
- 8: (n) => n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3,
701
- 9: (n) => +(n >= 2),
702
- 10: (n) => n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4,
703
- 11: (n) => n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3,
704
- 12: (n) => +(n % 10 != 1 || n % 100 == 11),
705
- 13: (n) => +(n !== 0),
706
- 14: (n) => n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3,
707
- 15: (n) => n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2,
708
- 16: (n) => n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2,
709
- 17: (n) => n == 1 || n % 10 == 1 && n % 100 != 11 ? 0 : 1,
710
- 18: (n) => n == 0 ? 0 : n == 1 ? 1 : 2,
711
- 19: (n) => n == 1 ? 0 : n == 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3,
712
- 20: (n) => n == 1 ? 0 : n == 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2,
713
- 21: (n) => n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0,
714
- 22: (n) => n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3
715
- };
716
- const Ne = ["v1", "v2", "v3"], Re = ["v4"], re = {
630
+ const ue = {
717
631
  zero: 0,
718
632
  one: 1,
719
633
  two: 2,
720
634
  few: 3,
721
635
  many: 4,
722
636
  other: 5
723
- }, Pe = () => {
724
- const n = {};
725
- return we.forEach((e) => {
726
- e.lngs.forEach((t) => {
727
- n[t] = {
728
- numbers: e.nr,
729
- plurals: Ce[e.fc]
730
- };
731
- });
732
- }), n;
637
+ }, ce = {
638
+ select: (o) => o === 1 ? "one" : "other",
639
+ resolvedOptions: () => ({
640
+ pluralCategories: ["one", "other"]
641
+ })
733
642
  };
734
- class $e {
735
- constructor(e) {
736
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
737
- this.languageUtils = e, this.options = t, this.logger = N.create("pluralResolver"), (!this.options.compatibilityJSON || Re.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", 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.")), this.rules = Pe(), this.pluralRulesCache = {};
738
- }
739
- addRule(e, t) {
740
- this.rules[e] = t;
643
+ class ke {
644
+ constructor(e, t = {}) {
645
+ this.languageUtils = e, this.options = t, this.logger = F.create("pluralResolver"), this.pluralRulesCache = {};
741
646
  }
742
647
  clearCache() {
743
648
  this.pluralRulesCache = {};
744
649
  }
745
- getRule(e) {
746
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
747
- if (this.shouldUseIntlApi()) {
748
- const s = H(e === "dev" ? "en" : e), i = t.ordinal ? "ordinal" : "cardinal", r = JSON.stringify({
749
- cleanedCode: s,
650
+ getRule(e, t = {}) {
651
+ const s = A(e === "dev" ? "en" : e), i = t.ordinal ? "ordinal" : "cardinal", n = JSON.stringify({
652
+ cleanedCode: s,
653
+ type: i
654
+ });
655
+ if (n in this.pluralRulesCache)
656
+ return this.pluralRulesCache[n];
657
+ let r;
658
+ try {
659
+ r = new Intl.PluralRules(s, {
750
660
  type: i
751
661
  });
752
- if (r in this.pluralRulesCache)
753
- return this.pluralRulesCache[r];
754
- let a;
755
- try {
756
- a = new Intl.PluralRules(s, {
757
- type: i
758
- });
759
- } catch {
760
- if (!e.match(/-|_/)) return;
761
- const l = this.languageUtils.getLanguagePartFromCode(e);
762
- a = this.getRule(l, t);
763
- }
764
- return this.pluralRulesCache[r] = a, a;
662
+ } catch {
663
+ if (typeof Intl > "u")
664
+ return this.logger.error("No Intl support, please use an Intl polyfill!"), ce;
665
+ if (!e.match(/-|_/)) return ce;
666
+ const u = this.languageUtils.getLanguagePartFromCode(e);
667
+ r = this.getRule(u, t);
765
668
  }
766
- return this.rules[e] || this.rules[this.languageUtils.getLanguagePartFromCode(e)];
669
+ return this.pluralRulesCache[n] = r, r;
767
670
  }
768
- needsPlural(e) {
769
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
770
- const s = this.getRule(e, t);
771
- return this.shouldUseIntlApi() ? s && s.resolvedOptions().pluralCategories.length > 1 : s && s.numbers.length > 1;
671
+ needsPlural(e, t = {}) {
672
+ let s = this.getRule(e, t);
673
+ return s || (s = this.getRule("dev", t)), s?.resolvedOptions().pluralCategories.length > 1;
772
674
  }
773
- getPluralFormsOfKey(e, t) {
774
- let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
675
+ getPluralFormsOfKey(e, t, s = {}) {
775
676
  return this.getSuffixes(e, s).map((i) => `${t}${i}`);
776
677
  }
777
- getSuffixes(e) {
778
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
779
- const s = this.getRule(e, t);
780
- return s ? this.shouldUseIntlApi() ? s.resolvedOptions().pluralCategories.sort((i, r) => re[i] - re[r]).map((i) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : s.numbers.map((i) => this.getSuffix(e, i, t)) : [];
678
+ getSuffixes(e, t = {}) {
679
+ let s = this.getRule(e, t);
680
+ return s || (s = this.getRule("dev", t)), s ? s.resolvedOptions().pluralCategories.sort((i, n) => ue[i] - ue[n]).map((i) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : [];
781
681
  }
782
- getSuffix(e, t) {
783
- let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
682
+ getSuffix(e, t, s = {}) {
784
683
  const i = this.getRule(e, s);
785
- return i ? this.shouldUseIntlApi() ? `${this.options.prepend}${s.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(t)}` : this.getSuffixRetroCompatible(i, t) : (this.logger.warn(`no plural rule found for: ${e}`), "");
786
- }
787
- getSuffixRetroCompatible(e, t) {
788
- const s = e.noAbs ? e.plurals(t) : e.plurals(Math.abs(t));
789
- let i = e.numbers[s];
790
- this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 && (i === 2 ? i = "plural" : i === 1 && (i = ""));
791
- const r = () => this.options.prepend && i.toString() ? this.options.prepend + i.toString() : i.toString();
792
- return this.options.compatibilityJSON === "v1" ? i === 1 ? "" : typeof i == "number" ? `_plural_${i.toString()}` : r() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 ? r() : this.options.prepend && s.toString() ? this.options.prepend + s.toString() : s.toString();
793
- }
794
- shouldUseIntlApi() {
795
- return !Ne.includes(this.options.compatibilityJSON);
684
+ return i ? `${this.options.prepend}${s.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, s));
796
685
  }
797
686
  }
798
- const ae = function(n, e, t) {
799
- let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, r = me(n, e, t);
800
- return !r && i && d(t) && (r = Y(n, t, s), r === void 0 && (r = Y(e, t, s))), r;
801
- }, Q = (n) => n.replace(/\$/g, "$$$$");
802
- class ke {
803
- constructor() {
804
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
805
- this.logger = N.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
687
+ const he = (o, e, t, s = ".", i = !0) => {
688
+ let n = Oe(o, e, t);
689
+ return n == null && i && d(t) && (n = X(o, t, s), n === void 0 && (n = X(e, t, s))), n;
690
+ };
691
+ class fe {
692
+ constructor(e = {}) {
693
+ this.logger = F.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((t) => t), this.init(e);
806
694
  }
807
- init() {
808
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
695
+ init(e = {}) {
809
696
  e.interpolation || (e.interpolation = {
810
697
  escapeValue: !0
811
698
  });
@@ -813,127 +700,130 @@ class ke {
813
700
  escape: t,
814
701
  escapeValue: s,
815
702
  useRawValueToEscape: i,
816
- prefix: r,
817
- prefixEscaped: a,
818
- suffix: o,
819
- suffixEscaped: l,
820
- formatSeparator: f,
821
- unescapeSuffix: h,
822
- unescapePrefix: g,
823
- nestingPrefix: u,
824
- nestingPrefixEscaped: c,
703
+ prefix: n,
704
+ prefixEscaped: r,
705
+ suffix: a,
706
+ suffixEscaped: u,
707
+ formatSeparator: l,
708
+ unescapeSuffix: c,
709
+ unescapePrefix: h,
710
+ nestingPrefix: f,
711
+ nestingPrefixEscaped: g,
825
712
  nestingSuffix: p,
826
- nestingSuffixEscaped: x,
827
- nestingOptionsSeparator: m,
828
- maxReplaces: O,
713
+ nestingSuffixEscaped: m,
714
+ nestingOptionsSeparator: S,
715
+ maxReplaces: L,
829
716
  alwaysFormat: y
830
717
  } = e.interpolation;
831
- this.escape = t !== void 0 ? t : be, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = r ? P(r) : a || "{{", this.suffix = o ? P(o) : l || "}}", this.formatSeparator = f || ",", this.unescapePrefix = h ? "" : g || "-", this.unescapeSuffix = this.unescapePrefix ? "" : h || "", this.nestingPrefix = u ? P(u) : c || P("$t("), this.nestingSuffix = p ? P(p) : x || P(")"), this.nestingOptionsSeparator = m || ",", this.maxReplaces = O || 1e3, this.alwaysFormat = y !== void 0 ? y : !1, this.resetRegExp();
718
+ this.escape = t !== void 0 ? t : Ce, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = n ? j(n) : r || "{{", this.suffix = a ? j(a) : u || "}}", this.formatSeparator = l || ",", this.unescapePrefix = c ? "" : h ? j(h) : "-", this.unescapeSuffix = this.unescapePrefix ? "" : c ? j(c) : "", this.nestingPrefix = f ? j(f) : g || j("$t("), this.nestingSuffix = p ? j(p) : m || j(")"), this.nestingOptionsSeparator = S || ",", this.maxReplaces = L || 1e3, this.alwaysFormat = y !== void 0 ? y : !1, this.resetRegExp();
832
719
  }
833
720
  reset() {
834
721
  this.options && this.init(this.options);
835
722
  }
836
723
  resetRegExp() {
837
- const e = (t, s) => t && t.source === s ? (t.lastIndex = 0, t) : new RegExp(s, "g");
838
- this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
724
+ const e = (t, s) => t?.source === s ? (t.lastIndex = 0, t) : new RegExp(s, "g");
725
+ this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
839
726
  }
840
727
  interpolate(e, t, s, i) {
841
- let r, a, o;
842
- const l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, f = (c) => {
843
- if (c.indexOf(this.formatSeparator) < 0) {
844
- const O = ae(t, l, c, this.options.keySeparator, this.options.ignoreJSONStructure);
845
- return this.alwaysFormat ? this.format(O, void 0, s, {
728
+ let n, r, a;
729
+ const u = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, l = (m) => {
730
+ if (!m.includes(this.formatSeparator)) {
731
+ const b = he(t, u, m, this.options.keySeparator, this.options.ignoreJSONStructure);
732
+ return this.alwaysFormat ? this.format(b, void 0, s, {
846
733
  ...i,
847
734
  ...t,
848
- interpolationkey: c
849
- }) : O;
735
+ interpolationkey: m
736
+ }) : b;
850
737
  }
851
- const p = c.split(this.formatSeparator), x = p.shift().trim(), m = p.join(this.formatSeparator).trim();
852
- return this.format(ae(t, l, x, this.options.keySeparator, this.options.ignoreJSONStructure), m, s, {
738
+ const S = m.split(this.formatSeparator), L = S.shift().trim(), y = S.join(this.formatSeparator).trim();
739
+ return this.format(he(t, u, L, this.options.keySeparator, this.options.ignoreJSONStructure), y, s, {
853
740
  ...i,
854
741
  ...t,
855
- interpolationkey: x
742
+ interpolationkey: L
856
743
  });
857
744
  };
858
- this.resetRegExp();
859
- const h = i && i.missingInterpolationHandler || this.options.missingInterpolationHandler, g = i && i.interpolation && i.interpolation.skipOnVariables !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
860
- return [{
745
+ this.resetRegExp(), !this.escapeValue && typeof e == "string" && /\$t\([^)]*\{[^}]*\{\{/.test(e) && this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");
746
+ const c = i?.missingInterpolationHandler || this.options.missingInterpolationHandler, h = i?.interpolation?.skipOnVariables !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables, f = [{
861
747
  regex: this.regexpUnescape,
862
- safeValue: (c) => Q(c)
748
+ safeValue: (m) => m
863
749
  }, {
864
750
  regex: this.regexp,
865
- safeValue: (c) => this.escapeValue ? Q(this.escape(c)) : Q(c)
866
- }].forEach((c) => {
867
- for (o = 0; r = c.regex.exec(e); ) {
868
- const p = r[1].trim();
869
- if (a = f(p), a === void 0)
870
- if (typeof h == "function") {
871
- const m = h(e, r, i);
872
- a = d(m) ? m : "";
873
- } else if (i && Object.prototype.hasOwnProperty.call(i, p))
874
- a = "";
875
- else if (g) {
876
- a = r[0];
751
+ safeValue: (m) => this.escapeValue ? this.escape(m) : m
752
+ }], g = [];
753
+ let p = 0;
754
+ return f.forEach((m) => {
755
+ for (a = 0; n = m.regex.exec(e); ) {
756
+ const S = n.index - p, L = g.find(([x, R]) => S >= x && S < R);
757
+ if (L) {
758
+ m.regex.lastIndex = L[1] + p;
759
+ continue;
760
+ }
761
+ const y = n[1].trim();
762
+ if (r = l(y), r === void 0)
763
+ if (typeof c == "function") {
764
+ const x = c(e, n, i);
765
+ r = d(x) ? x : "";
766
+ } else if (i && Object.prototype.hasOwnProperty.call(i, y))
767
+ r = "";
768
+ else if (h) {
769
+ r = n[0];
877
770
  continue;
878
771
  } else
879
- this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`), a = "";
880
- else !d(a) && !this.useRawValueToEscape && (a = q(a));
881
- const x = c.safeValue(a);
882
- if (e = e.replace(r[0], x), g ? (c.regex.lastIndex += a.length, c.regex.lastIndex -= r[0].length) : c.regex.lastIndex = 0, o++, o >= this.maxReplaces)
772
+ this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`), r = "";
773
+ else !d(r) && !this.useRawValueToEscape && (r = z(r));
774
+ const b = z(m.safeValue(r));
775
+ if (e = e.slice(0, n.index) + b + e.slice(n.index + n[0].length), h ? (m.regex === this.regexpUnescape ? g.push([n.index, n.index + b.length]) : p += b.length - n[0].length, m.regex.lastIndex += b.length, m.regex.lastIndex -= n[0].length) : m.regex.lastIndex = 0, a++, a >= this.maxReplaces)
883
776
  break;
884
777
  }
885
778
  }), e;
886
779
  }
887
- nest(e, t) {
888
- let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i, r, a;
889
- const o = (l, f) => {
890
- const h = this.nestingOptionsSeparator;
891
- if (l.indexOf(h) < 0) return l;
892
- const g = l.split(new RegExp(`${h}[ ]*{`));
893
- let u = `{${g[1]}`;
894
- l = g[0], u = this.interpolate(u, a);
895
- const c = u.match(/'/g), p = u.match(/"/g);
896
- (c && c.length % 2 === 0 && !p || p.length % 2 !== 0) && (u = u.replace(/'/g, '"'));
780
+ nest(e, t, s = {}) {
781
+ let i, n, r;
782
+ const a = (h, f) => {
783
+ const g = this.nestingOptionsSeparator;
784
+ if (!h.includes(g)) return h;
785
+ const p = h.split(new RegExp(`${j(g)}[ ]*{`));
786
+ let m = `{${p[1]}`;
787
+ h = p[0], m = this.interpolate(m, r);
788
+ const S = m.match(/'/g), L = m.match(/"/g);
789
+ ((S?.length ?? 0) % 2 === 0 && !L || (L?.length ?? 0) % 2 !== 0) && (m = m.replace(/'/g, '"'));
897
790
  try {
898
- a = JSON.parse(u), f && (a = {
791
+ r = JSON.parse(m), f && (r = {
899
792
  ...f,
900
- ...a
793
+ ...r
901
794
  });
902
- } catch (x) {
903
- return this.logger.warn(`failed parsing options string in nesting for key ${l}`, x), `${l}${h}${u}`;
795
+ } catch (y) {
796
+ return this.logger.warn(`failed parsing options string in nesting for key ${h}`, y), `${h}${g}${m}`;
904
797
  }
905
- return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, l;
906
- };
907
- for (; i = this.nestingRegexp.exec(e); ) {
908
- let l = [];
909
- a = {
798
+ return r.defaultValue && r.defaultValue.includes(this.prefix) && delete r.defaultValue, h;
799
+ }, u = new RegExp(this.nestingRegexp);
800
+ let l = "", c = 0;
801
+ for (; i = u.exec(e); ) {
802
+ let h = [];
803
+ r = {
910
804
  ...s
911
- }, a = a.replace && !d(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
912
- let f = !1;
913
- if (i[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(i[1])) {
914
- const h = i[1].split(this.formatSeparator).map((g) => g.trim());
915
- i[1] = h.shift(), l = h, f = !0;
916
- }
917
- if (r = t(o.call(this, i[1].trim(), a), a), r && i[0] === e && !d(r)) return r;
918
- d(r) || (r = q(r)), r || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), r = ""), f && (r = l.reduce((h, g) => this.format(h, g, s.lng, {
805
+ }, r = r.replace && !d(r.replace) ? r.replace : r, r.applyPostProcessor = !1, delete r.defaultValue;
806
+ const f = /{.*}/s.test(i[1]) ? i[1].lastIndexOf("}") + 1 : i[1].indexOf(this.formatSeparator);
807
+ if (f !== -1 && (h = i[1].slice(f).split(this.formatSeparator).map((g) => g.trim()).filter(Boolean), i[1] = i[1].slice(0, f)), n = t(a.call(this, i[1].trim(), r), r), n && i[0] === e && !d(n)) return n;
808
+ d(n) || (n = z(n)), n || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), n = ""), h.length && (n = h.reduce((g, p) => this.format(g, p, s.lng, {
919
809
  ...s,
920
810
  interpolationkey: i[1].trim()
921
- }), r.trim())), e = e.replace(i[0], r), this.regexp.lastIndex = 0;
811
+ }), n.trim())), l += e.slice(c, i.index) + z(n), c = u.lastIndex, this.regexp.lastIndex = 0;
922
812
  }
923
- return e;
813
+ return c ? l + e.slice(c) : e;
924
814
  }
925
815
  }
926
- const Ee = (n) => {
927
- let e = n.toLowerCase().trim();
816
+ const Ee = (o) => {
817
+ let e = o.toLowerCase().trim();
928
818
  const t = {};
929
- if (n.indexOf("(") > -1) {
930
- const s = n.split("(");
819
+ if (o.includes("(")) {
820
+ const s = o.split("(");
931
821
  e = s[0].toLowerCase().trim();
932
- const i = s[1].substring(0, s[1].length - 1);
933
- e === "currency" && i.indexOf(":") < 0 ? t.currency || (t.currency = i.trim()) : e === "relativetime" && i.indexOf(":") < 0 ? t.range || (t.range = i.trim()) : i.split(";").forEach((a) => {
934
- if (a) {
935
- const [o, ...l] = a.split(":"), f = l.join(":").trim().replace(/^'+|'+$/g, ""), h = o.trim();
936
- t[h] || (t[h] = f), f === "false" && (t[h] = !1), f === "true" && (t[h] = !0), isNaN(f) || (t[h] = parseInt(f, 10));
822
+ const i = s[1].slice(0, -1);
823
+ e === "currency" && !i.includes(":") ? t.currency || (t.currency = i.trim()) : e === "relativetime" && !i.includes(":") ? t.range || (t.range = i.trim()) : i.split(";").forEach((r) => {
824
+ if (r) {
825
+ const [a, ...u] = r.split(":"), l = u.join(":").trim().replace(/^'+|'+$/g, ""), c = a.trim();
826
+ t[c] || (t[c] = l), l === "false" && (t[c] = !1), l === "true" && (t[c] = !0), isNaN(l) || (t[c] = parseInt(l, 10));
937
827
  }
938
828
  });
939
829
  }
@@ -941,193 +831,197 @@ const Ee = (n) => {
941
831
  formatName: e,
942
832
  formatOptions: t
943
833
  };
944
- }, $ = (n) => {
834
+ }, de = (o) => {
945
835
  const e = {};
946
836
  return (t, s, i) => {
947
- let r = i;
948
- i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (r = {
949
- ...r,
837
+ let n = i;
838
+ i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (n = {
839
+ ...n,
950
840
  [i.interpolationkey]: void 0
951
841
  });
952
- const a = s + JSON.stringify(r);
953
- let o = e[a];
954
- return o || (o = n(H(s), i), e[a] = o), o(t);
842
+ let r;
843
+ try {
844
+ r = s + JSON.stringify(n);
845
+ } catch {
846
+ return o(A(s), i)(t);
847
+ }
848
+ let a = e[r];
849
+ return a || (a = o(A(s), i), e[r] = a), a(t);
955
850
  };
956
- };
957
- class Fe {
958
- constructor() {
959
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
960
- this.logger = N.create("formatter"), this.options = e, this.formats = {
961
- number: $((t, s) => {
962
- const i = new Intl.NumberFormat(t, {
963
- ...s
851
+ }, Te = (o) => (e, t, s) => o(A(t), s)(e);
852
+ class Ie {
853
+ constructor(e = {}) {
854
+ this.logger = F.create("formatter"), this.options = e, this.init(e);
855
+ }
856
+ init(e, t = {
857
+ interpolation: {}
858
+ }) {
859
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
860
+ const s = t.cacheInBuiltFormats ? de : Te;
861
+ this.formats = {
862
+ number: s((i, n) => {
863
+ const r = new Intl.NumberFormat(i, {
864
+ ...n
964
865
  });
965
- return (r) => i.format(r);
866
+ return (a) => r.format(a);
966
867
  }),
967
- currency: $((t, s) => {
968
- const i = new Intl.NumberFormat(t, {
969
- ...s,
868
+ currency: s((i, n) => {
869
+ const r = new Intl.NumberFormat(i, {
870
+ ...n,
970
871
  style: "currency"
971
872
  });
972
- return (r) => i.format(r);
873
+ return (a) => r.format(a);
973
874
  }),
974
- datetime: $((t, s) => {
975
- const i = new Intl.DateTimeFormat(t, {
976
- ...s
875
+ datetime: s((i, n) => {
876
+ const r = new Intl.DateTimeFormat(i, {
877
+ ...n
977
878
  });
978
- return (r) => i.format(r);
879
+ return (a) => r.format(a);
979
880
  }),
980
- relativetime: $((t, s) => {
981
- const i = new Intl.RelativeTimeFormat(t, {
982
- ...s
881
+ relativetime: s((i, n) => {
882
+ const r = new Intl.RelativeTimeFormat(i, {
883
+ ...n
983
884
  });
984
- return (r) => i.format(r, s.range || "day");
885
+ return (a) => r.format(a, n.range || "day");
985
886
  }),
986
- list: $((t, s) => {
987
- const i = new Intl.ListFormat(t, {
988
- ...s
887
+ list: s((i, n) => {
888
+ const r = new Intl.ListFormat(i, {
889
+ ...n
989
890
  });
990
- return (r) => i.format(r);
891
+ return (a) => r.format(a);
991
892
  })
992
- }, this.init(e);
993
- }
994
- init(e) {
995
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
996
- interpolation: {}
997
893
  };
998
- this.formatSeparator = t.interpolation.formatSeparator || ",";
999
894
  }
1000
895
  add(e, t) {
1001
896
  this.formats[e.toLowerCase().trim()] = t;
1002
897
  }
1003
898
  addCached(e, t) {
1004
- this.formats[e.toLowerCase().trim()] = $(t);
1005
- }
1006
- format(e, t, s) {
1007
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1008
- const r = t.split(this.formatSeparator);
1009
- if (r.length > 1 && r[0].indexOf("(") > 1 && r[0].indexOf(")") < 0 && r.find((o) => o.indexOf(")") > -1)) {
1010
- const o = r.findIndex((l) => l.indexOf(")") > -1);
1011
- r[0] = [r[0], ...r.splice(1, o)].join(this.formatSeparator);
899
+ this.formats[e.toLowerCase().trim()] = de(t);
900
+ }
901
+ format(e, t, s, i = {}) {
902
+ if (!t || e == null) return e;
903
+ const n = t.split(this.formatSeparator), r = [];
904
+ for (let u = 0; u < n.length; u++) {
905
+ let l = n[u];
906
+ for (; l.indexOf("(") > -1 && !l.includes(")") && u + 1 < n.length; )
907
+ l = `${l}${this.formatSeparator}${n[++u]}`;
908
+ r.push(l);
1012
909
  }
1013
- return r.reduce((o, l) => {
910
+ return r.reduce((u, l) => {
1014
911
  const {
1015
- formatName: f,
912
+ formatName: c,
1016
913
  formatOptions: h
1017
914
  } = Ee(l);
1018
- if (this.formats[f]) {
1019
- let g = o;
915
+ if (this.formats[c]) {
916
+ let f = u;
1020
917
  try {
1021
- const u = i && i.formatParams && i.formatParams[i.interpolationkey] || {}, c = u.locale || u.lng || i.locale || i.lng || s;
1022
- g = this.formats[f](o, c, {
918
+ const g = i?.formatParams?.[i.interpolationkey] || {}, p = g.locale || g.lng || i.locale || i.lng || s;
919
+ f = this.formats[c](u, p, {
1023
920
  ...h,
1024
921
  ...i,
1025
- ...u
922
+ ...g
1026
923
  });
1027
- } catch (u) {
1028
- this.logger.warn(u);
924
+ } catch (g) {
925
+ this.logger.warn(g);
1029
926
  }
1030
- return g;
927
+ return f;
1031
928
  } else
1032
- this.logger.warn(`there was no format function for ${f}`);
1033
- return o;
929
+ this.logger.warn(`there was no format function for ${c}`);
930
+ return u;
1034
931
  }, e);
1035
932
  }
1036
933
  }
1037
- const Ie = (n, e) => {
1038
- n.pending[e] !== void 0 && (delete n.pending[e], n.pendingCount--);
934
+ const Ve = (o, e) => {
935
+ o.pending[e] !== void 0 && (delete o.pending[e], o.pendingCount--);
1039
936
  };
1040
- class je extends B {
1041
- constructor(e, t, s) {
1042
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1043
- super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = i, this.logger = N.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(s, i.backend, i);
937
+ class Ae extends Q {
938
+ constructor(e, t, s, i = {}) {
939
+ super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = i, this.logger = F.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(s, i.backend, i);
1044
940
  }
1045
941
  queueLoad(e, t, s, i) {
1046
- const r = {}, a = {}, o = {}, l = {};
1047
- return e.forEach((f) => {
1048
- let h = !0;
1049
- t.forEach((g) => {
1050
- const u = `${f}|${g}`;
1051
- !s.reload && this.store.hasResourceBundle(f, g) ? this.state[u] = 2 : this.state[u] < 0 || (this.state[u] === 1 ? a[u] === void 0 && (a[u] = !0) : (this.state[u] = 1, h = !1, a[u] === void 0 && (a[u] = !0), r[u] === void 0 && (r[u] = !0), l[g] === void 0 && (l[g] = !0)));
1052
- }), h || (o[f] = !0);
1053
- }), (Object.keys(r).length || Object.keys(a).length) && this.queue.push({
1054
- pending: a,
1055
- pendingCount: Object.keys(a).length,
942
+ const n = {}, r = {}, a = {}, u = {};
943
+ return e.forEach((l) => {
944
+ let c = !0;
945
+ t.forEach((h) => {
946
+ const f = `${l}|${h}`;
947
+ !s.reload && this.store.hasResourceBundle(l, h) ? this.state[f] = 2 : this.state[f] < 0 || (this.state[f] === 1 ? r[f] === void 0 && (r[f] = !0) : (this.state[f] = 1, c = !1, r[f] === void 0 && (r[f] = !0), n[f] === void 0 && (n[f] = !0), u[h] === void 0 && (u[h] = !0)));
948
+ }), c || (a[l] = !0);
949
+ }), (Object.keys(n).length || Object.keys(r).length) && this.queue.push({
950
+ pending: r,
951
+ pendingCount: Object.keys(r).length,
1056
952
  loaded: {},
1057
953
  errors: [],
1058
954
  callback: i
1059
955
  }), {
1060
- toLoad: Object.keys(r),
1061
- pending: Object.keys(a),
1062
- toLoadLanguages: Object.keys(o),
1063
- toLoadNamespaces: Object.keys(l)
956
+ toLoad: Object.keys(n),
957
+ pending: Object.keys(r),
958
+ toLoadLanguages: Object.keys(a),
959
+ toLoadNamespaces: Object.keys(u)
1064
960
  };
1065
961
  }
1066
962
  loaded(e, t, s) {
1067
- const i = e.split("|"), r = i[0], a = i[1];
1068
- t && this.emit("failedLoading", r, a, t), !t && s && this.store.addResourceBundle(r, a, s, void 0, void 0, {
963
+ const i = e.split("|"), n = i[0], r = i[1];
964
+ t && this.emit("failedLoading", n, r, t), !t && s && this.store.addResourceBundle(n, r, s, void 0, void 0, {
1069
965
  skipCopy: !0
1070
966
  }), this.state[e] = t ? -1 : 2, t && s && (this.state[e] = 0);
1071
- const o = {};
1072
- this.queue.forEach((l) => {
1073
- pe(l.loaded, [r], a), Ie(l, e), t && l.errors.push(t), l.pendingCount === 0 && !l.done && (Object.keys(l.loaded).forEach((f) => {
1074
- o[f] || (o[f] = {});
1075
- const h = l.loaded[f];
1076
- h.length && h.forEach((g) => {
1077
- o[f][g] === void 0 && (o[f][g] = !0);
967
+ const a = {};
968
+ this.queue.forEach((u) => {
969
+ ve(u.loaded, [n], r), Ve(u, e), t && u.errors.push(t), u.pendingCount === 0 && !u.done && (Object.keys(u.loaded).forEach((l) => {
970
+ a[l] || (a[l] = {});
971
+ const c = u.loaded[l];
972
+ c.length && c.forEach((h) => {
973
+ a[l][h] === void 0 && (a[l][h] = !0);
1078
974
  });
1079
- }), l.done = !0, l.errors.length ? l.callback(l.errors) : l.callback());
1080
- }), this.emit("loaded", o), this.queue = this.queue.filter((l) => !l.done);
975
+ }), u.done = !0, u.errors.length ? u.callback(u.errors) : u.callback());
976
+ }), this.emit("loaded", a), this.queue = this.queue.filter((u) => !u.done);
1081
977
  }
1082
- read(e, t, s) {
1083
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, a = arguments.length > 5 ? arguments[5] : void 0;
1084
- if (!e.length) return a(null, {});
978
+ read(e, t, s, i = 0, n = this.retryTimeout, r) {
979
+ if (!e.length) return r(null, {});
1085
980
  if (this.readingCalls >= this.maxParallelReads) {
1086
981
  this.waitingReads.push({
1087
982
  lng: e,
1088
983
  ns: t,
1089
984
  fcName: s,
1090
985
  tried: i,
1091
- wait: r,
1092
- callback: a
986
+ wait: n,
987
+ callback: r
1093
988
  });
1094
989
  return;
1095
990
  }
1096
991
  this.readingCalls++;
1097
- const o = (f, h) => {
992
+ const a = (l, c) => {
1098
993
  if (this.readingCalls--, this.waitingReads.length > 0) {
1099
- const g = this.waitingReads.shift();
1100
- this.read(g.lng, g.ns, g.fcName, g.tried, g.wait, g.callback);
994
+ const h = this.waitingReads.shift();
995
+ this.read(h.lng, h.ns, h.fcName, h.tried, h.wait, h.callback);
1101
996
  }
1102
- if (f && h && i < this.maxRetries) {
997
+ if (l && c && i < this.maxRetries) {
1103
998
  setTimeout(() => {
1104
- this.read.call(this, e, t, s, i + 1, r * 2, a);
1105
- }, r);
999
+ this.read(e, t, s, i + 1, n * 2, r);
1000
+ }, n);
1106
1001
  return;
1107
1002
  }
1108
- a(f, h);
1109
- }, l = this.backend[s].bind(this.backend);
1110
- if (l.length === 2) {
1003
+ r(l, c);
1004
+ }, u = this.backend[s].bind(this.backend);
1005
+ if (u.length === 2) {
1111
1006
  try {
1112
- const f = l(e, t);
1113
- f && typeof f.then == "function" ? f.then((h) => o(null, h)).catch(o) : o(null, f);
1114
- } catch (f) {
1115
- o(f);
1007
+ const l = u(e, t);
1008
+ l && typeof l.then == "function" ? l.then((c) => a(null, c)).catch(a) : a(null, l);
1009
+ } catch (l) {
1010
+ a(l);
1116
1011
  }
1117
1012
  return;
1118
1013
  }
1119
- return l(e, t, o);
1014
+ return u(e, t, a);
1120
1015
  }
1121
- prepareLoading(e, t) {
1122
- let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = arguments.length > 3 ? arguments[3] : void 0;
1016
+ prepareLoading(e, t, s = {}, i) {
1123
1017
  if (!this.backend)
1124
1018
  return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
1125
1019
  d(e) && (e = this.languageUtils.toResolveHierarchy(e)), d(t) && (t = [t]);
1126
- const r = this.queueLoad(e, t, s, i);
1127
- if (!r.toLoad.length)
1128
- return r.pending.length || i(), null;
1129
- r.toLoad.forEach((a) => {
1130
- this.loadOne(a);
1020
+ const n = this.queueLoad(e, t, s, i);
1021
+ if (!n.toLoad.length)
1022
+ return n.pending.length || i(), null;
1023
+ n.toLoad.forEach((r) => {
1024
+ this.loadOne(r);
1131
1025
  });
1132
1026
  }
1133
1027
  load(e, t, s) {
@@ -1138,43 +1032,41 @@ class je extends B {
1138
1032
  reload: !0
1139
1033
  }, s);
1140
1034
  }
1141
- loadOne(e) {
1142
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1143
- const s = e.split("|"), i = s[0], r = s[1];
1144
- this.read(i, r, "read", void 0, void 0, (a, o) => {
1145
- a && this.logger.warn(`${t}loading namespace ${r} for language ${i} failed`, a), !a && o && this.logger.log(`${t}loaded namespace ${r} for language ${i}`, o), this.loaded(e, a, o);
1035
+ loadOne(e, t = "") {
1036
+ const s = e.split("|"), i = s[0], n = s[1];
1037
+ this.read(i, n, "read", void 0, void 0, (r, a) => {
1038
+ r && this.logger.warn(`${t}loading namespace ${n} for language ${i} failed`, r), !r && a && this.logger.log(`${t}loaded namespace ${n} for language ${i}`, a), this.loaded(e, r, a);
1146
1039
  });
1147
1040
  }
1148
- saveMissing(e, t, s, i, r) {
1149
- let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, o = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
1150
- };
1151
- if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(t)) {
1041
+ saveMissing(e, t, s, i, n, r = {}, a = () => {
1042
+ }) {
1043
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
1152
1044
  this.logger.warn(`did not save key "${s}" as the namespace "${t}" 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!!!");
1153
1045
  return;
1154
1046
  }
1155
1047
  if (!(s == null || s === "")) {
1156
- if (this.backend && this.backend.create) {
1157
- const l = {
1158
- ...a,
1159
- isUpdate: r
1160
- }, f = this.backend.create.bind(this.backend);
1161
- if (f.length < 6)
1048
+ if (this.backend?.create) {
1049
+ const u = {
1050
+ ...r,
1051
+ isUpdate: n
1052
+ }, l = this.backend.create.bind(this.backend);
1053
+ if (l.length < 6)
1162
1054
  try {
1163
- let h;
1164
- f.length === 5 ? h = f(e, t, s, i, l) : h = f(e, t, s, i), h && typeof h.then == "function" ? h.then((g) => o(null, g)).catch(o) : o(null, h);
1165
- } catch (h) {
1166
- o(h);
1055
+ let c;
1056
+ l.length === 5 ? c = l(e, t, s, i, u) : c = l(e, t, s, i), c && typeof c.then == "function" ? c.then((h) => a(null, h)).catch(a) : a(null, c);
1057
+ } catch (c) {
1058
+ a(c);
1167
1059
  }
1168
1060
  else
1169
- f(e, t, s, i, o, l);
1061
+ l(e, t, s, i, a, u);
1170
1062
  }
1171
1063
  !e || !e[0] || this.store.addResource(e[0], t, s, i);
1172
1064
  }
1173
1065
  }
1174
1066
  }
1175
- const oe = () => ({
1067
+ const Z = () => ({
1176
1068
  debug: !1,
1177
- initImmediate: !0,
1069
+ initAsync: !0,
1178
1070
  ns: ["translation"],
1179
1071
  defaultNS: ["translation"],
1180
1072
  fallbackLng: ["dev"],
@@ -1183,11 +1075,11 @@ const oe = () => ({
1183
1075
  nonExplicitSupportedLngs: !1,
1184
1076
  load: "all",
1185
1077
  preload: !1,
1186
- simplifyPluralSuffix: !0,
1187
1078
  keySeparator: ".",
1188
1079
  nsSeparator: ":",
1189
1080
  pluralSeparator: "_",
1190
1081
  contextSeparator: "_",
1082
+ enableSelector: !1,
1191
1083
  partialBundledLanguages: !1,
1192
1084
  saveMissing: !1,
1193
1085
  updateMissing: !1,
@@ -1205,10 +1097,10 @@ const oe = () => ({
1205
1097
  parseMissingKeyHandler: !1,
1206
1098
  appendNamespaceToMissingKey: !1,
1207
1099
  appendNamespaceToCIMode: !1,
1208
- overloadTranslationOptionHandler: (n) => {
1100
+ overloadTranslationOptionHandler: (o) => {
1209
1101
  let e = {};
1210
- if (typeof n[1] == "object" && (e = n[1]), d(n[1]) && (e.defaultValue = n[1]), d(n[2]) && (e.tDescription = n[2]), typeof n[2] == "object" || typeof n[3] == "object") {
1211
- const t = n[3] || n[2];
1102
+ if (typeof o[1] == "object" && (e = o[1]), d(o[1]) && (e.defaultValue = o[1]), d(o[2]) && (e.tDescription = o[2]), typeof o[2] == "object" || typeof o[3] == "object") {
1103
+ const t = o[3] || o[2];
1212
1104
  Object.keys(t).forEach((s) => {
1213
1105
  e[s] = t[s];
1214
1106
  });
@@ -1217,7 +1109,6 @@ const oe = () => ({
1217
1109
  },
1218
1110
  interpolation: {
1219
1111
  escapeValue: !0,
1220
- format: (n) => n,
1221
1112
  prefix: "{{",
1222
1113
  suffix: "}}",
1223
1114
  formatSeparator: ",",
@@ -1227,240 +1118,258 @@ const oe = () => ({
1227
1118
  nestingOptionsSeparator: ",",
1228
1119
  maxReplaces: 1e3,
1229
1120
  skipOnVariables: !0
1230
- }
1231
- }), le = (n) => (d(n.ns) && (n.ns = [n.ns]), d(n.fallbackLng) && (n.fallbackLng = [n.fallbackLng]), d(n.fallbackNS) && (n.fallbackNS = [n.fallbackNS]), n.supportedLngs && n.supportedLngs.indexOf("cimode") < 0 && (n.supportedLngs = n.supportedLngs.concat(["cimode"])), n), U = () => {
1232
- }, Ae = (n) => {
1233
- Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((t) => {
1234
- typeof n[t] == "function" && (n[t] = n[t].bind(n));
1121
+ },
1122
+ cacheInBuiltFormats: !0
1123
+ }), pe = (o) => (d(o.ns) && (o.ns = [o.ns]), d(o.fallbackLng) && (o.fallbackLng = [o.fallbackLng]), d(o.fallbackNS) && (o.fallbackNS = [o.fallbackNS]), o.supportedLngs && !o.supportedLngs.includes("cimode") && (o.supportedLngs = o.supportedLngs.concat(["cimode"])), o), J = () => {
1124
+ }, Ke = (o) => {
1125
+ Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach((t) => {
1126
+ typeof o[t] == "function" && (o[t] = o[t].bind(o));
1235
1127
  });
1236
1128
  };
1237
- class V extends B {
1238
- constructor() {
1239
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1240
- if (super(), this.options = le(e), this.services = {}, this.logger = N, this.modules = {
1129
+ class M extends Q {
1130
+ constructor(e = {}, t) {
1131
+ if (super(), this.options = pe(e), this.services = {}, this.logger = F, this.modules = {
1241
1132
  external: []
1242
- }, Ae(this), t && !this.isInitialized && !e.isClone) {
1243
- if (!this.options.initImmediate)
1133
+ }, Ke(this), t && !this.isInitialized && !e.isClone) {
1134
+ if (!this.options.initAsync)
1244
1135
  return this.init(e, t), this;
1245
1136
  setTimeout(() => {
1246
1137
  this.init(e, t);
1247
1138
  }, 0);
1248
1139
  }
1249
1140
  }
1250
- init() {
1251
- var e = this;
1252
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, s = arguments.length > 1 ? arguments[1] : void 0;
1253
- this.isInitializing = !0, typeof t == "function" && (s = t, t = {}), !t.defaultNS && t.defaultNS !== !1 && t.ns && (d(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
1254
- const i = oe();
1141
+ init(e = {}, t) {
1142
+ this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (d(e.ns) ? e.defaultNS = e.ns : e.ns.includes("translation") || (e.defaultNS = e.ns[0]));
1143
+ const s = Z();
1255
1144
  this.options = {
1256
- ...i,
1145
+ ...s,
1257
1146
  ...this.options,
1258
- ...le(t)
1259
- }, this.options.compatibilityAPI !== "v1" && (this.options.interpolation = {
1260
- ...i.interpolation,
1147
+ ...pe(e)
1148
+ }, this.options.interpolation = {
1149
+ ...s.interpolation,
1261
1150
  ...this.options.interpolation
1262
- }), t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
1263
- const r = (h) => h ? typeof h == "function" ? new h() : h : null;
1151
+ }, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = s.overloadTranslationOptionHandler);
1152
+ const i = (l) => l ? typeof l == "function" ? new l() : l : null;
1264
1153
  if (!this.options.isClone) {
1265
- this.modules.logger ? N.init(r(this.modules.logger), this.options) : N.init(null, this.options);
1266
- let h;
1267
- this.modules.formatter ? h = this.modules.formatter : typeof Intl < "u" && (h = Fe);
1268
- const g = new ne(this.options);
1269
- this.store = new se(this.options.resources, this.options);
1270
- const u = this.services;
1271
- u.logger = N, u.resourceStore = this.store, u.languageUtils = g, u.pluralResolver = new $e(g, {
1272
- prepend: this.options.pluralSeparator,
1273
- compatibilityJSON: this.options.compatibilityJSON,
1274
- simplifyPluralSuffix: this.options.simplifyPluralSuffix
1275
- }), h && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (u.formatter = r(h), u.formatter.init(u, this.options), this.options.interpolation.format = u.formatter.format.bind(u.formatter)), u.interpolator = new ke(this.options), u.utils = {
1154
+ this.modules.logger ? F.init(i(this.modules.logger), this.options) : F.init(null, this.options);
1155
+ let l;
1156
+ this.modules.formatter ? l = this.modules.formatter : l = Ie;
1157
+ const c = new le(this.options);
1158
+ this.store = new oe(this.options.resources, this.options);
1159
+ const h = this.services;
1160
+ h.logger = F, h.resourceStore = this.store, h.languageUtils = c, h.pluralResolver = new ke(c, {
1161
+ prepend: this.options.pluralSeparator
1162
+ }), l && (h.formatter = i(l), h.formatter.init && h.formatter.init(h, this.options), this.options.interpolation.format = h.formatter.format.bind(h.formatter)), h.interpolator = new fe(this.options), h.utils = {
1276
1163
  hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
1277
- }, u.backendConnector = new je(r(this.modules.backend), u.resourceStore, u, this.options), u.backendConnector.on("*", function(c) {
1278
- for (var p = arguments.length, x = new Array(p > 1 ? p - 1 : 0), m = 1; m < p; m++)
1279
- x[m - 1] = arguments[m];
1280
- e.emit(c, ...x);
1281
- }), this.modules.languageDetector && (u.languageDetector = r(this.modules.languageDetector), u.languageDetector.init && u.languageDetector.init(u, this.options.detection, this.options)), this.modules.i18nFormat && (u.i18nFormat = r(this.modules.i18nFormat), u.i18nFormat.init && u.i18nFormat.init(this)), this.translator = new J(this.services, this.options), this.translator.on("*", function(c) {
1282
- for (var p = arguments.length, x = new Array(p > 1 ? p - 1 : 0), m = 1; m < p; m++)
1283
- x[m - 1] = arguments[m];
1284
- e.emit(c, ...x);
1285
- }), this.modules.external.forEach((c) => {
1286
- c.init && c.init(this);
1164
+ }, h.backendConnector = new Ae(i(this.modules.backend), h.resourceStore, h, this.options), h.backendConnector.on("*", (f, ...g) => {
1165
+ this.emit(f, ...g);
1166
+ }), this.modules.languageDetector && (h.languageDetector = i(this.modules.languageDetector), h.languageDetector.init && h.languageDetector.init(h, this.options.detection, this.options)), this.modules.i18nFormat && (h.i18nFormat = i(this.modules.i18nFormat), h.i18nFormat.init && h.i18nFormat.init(this)), this.translator = new Y(this.services, this.options), this.translator.on("*", (f, ...g) => {
1167
+ this.emit(f, ...g);
1168
+ }), this.modules.external.forEach((f) => {
1169
+ f.init && f.init(this);
1287
1170
  });
1288
1171
  }
1289
- if (this.format = this.options.interpolation.format, s || (s = U), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1290
- const h = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1291
- h.length > 0 && h[0] !== "dev" && (this.options.lng = h[0]);
1172
+ if (this.format = this.options.interpolation.format, t || (t = J), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1173
+ const l = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1174
+ l.length > 0 && l[0] !== "dev" && (this.options.lng = l[0]);
1292
1175
  }
1293
- !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((h) => {
1294
- this[h] = function() {
1295
- return e.store[h](...arguments);
1296
- };
1297
- }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((h) => {
1298
- this[h] = function() {
1299
- return e.store[h](...arguments), e;
1300
- };
1176
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((l) => {
1177
+ this[l] = (...c) => this.store[l](...c);
1178
+ }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((l) => {
1179
+ this[l] = (...c) => (this.store[l](...c), this);
1301
1180
  });
1302
- const l = A(), f = () => {
1303
- const h = (g, u) => {
1304
- this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), l.resolve(u), s(g, u);
1181
+ const a = H(), u = () => {
1182
+ const l = (c, h) => {
1183
+ this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), a.resolve(h), t(c, h);
1305
1184
  };
1306
- if (this.languages && this.options.compatibilityAPI !== "v1" && !this.isInitialized) return h(null, this.t.bind(this));
1307
- this.changeLanguage(this.options.lng, h);
1185
+ if ((this.languages || this.isLanguageChangingTo) && !this.isInitialized) return l(null, this.t.bind(this));
1186
+ this.changeLanguage(this.options.lng, l);
1308
1187
  };
1309
- return this.options.resources || !this.options.initImmediate ? f() : setTimeout(f, 0), l;
1188
+ return this.options.resources || !this.options.initAsync ? u() : setTimeout(u, 0), a;
1310
1189
  }
1311
- loadResources(e) {
1312
- let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : U;
1190
+ loadResources(e, t = J) {
1191
+ let s = t;
1313
1192
  const i = d(e) ? e : this.language;
1314
1193
  if (typeof e == "function" && (s = e), !this.options.resources || this.options.partialBundledLanguages) {
1315
- if (i && i.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return s();
1316
- const r = [], a = (o) => {
1317
- if (!o || o === "cimode") return;
1318
- this.services.languageUtils.toResolveHierarchy(o).forEach((f) => {
1319
- f !== "cimode" && r.indexOf(f) < 0 && r.push(f);
1194
+ if (i?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return s();
1195
+ const n = [], r = (a) => {
1196
+ if (!a || a === "cimode") return;
1197
+ this.services.languageUtils.toResolveHierarchy(a).forEach((l) => {
1198
+ l !== "cimode" && (n.includes(l) || n.push(l));
1320
1199
  });
1321
1200
  };
1322
- i ? a(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((l) => a(l)), this.options.preload && this.options.preload.forEach((o) => a(o)), this.services.backendConnector.load(r, this.options.ns, (o) => {
1323
- !o && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), s(o);
1201
+ i ? r(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((u) => r(u)), this.options.preload?.forEach?.((a) => r(a)), this.services.backendConnector.load(n, this.options.ns, (a) => {
1202
+ !a && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), s(a);
1324
1203
  });
1325
1204
  } else
1326
1205
  s(null);
1327
1206
  }
1328
1207
  reloadResources(e, t, s) {
1329
- const i = A();
1330
- return typeof e == "function" && (s = e, e = void 0), typeof t == "function" && (s = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), s || (s = U), this.services.backendConnector.reload(e, t, (r) => {
1331
- i.resolve(), s(r);
1208
+ const i = H();
1209
+ return typeof e == "function" && (s = e, e = void 0), typeof t == "function" && (s = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), s || (s = J), this.services.backendConnector.reload(e, t, (n) => {
1210
+ i.resolve(), s(n);
1332
1211
  }), i;
1333
1212
  }
1334
1213
  use(e) {
1335
1214
  if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1336
1215
  if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1337
- return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && fe.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1216
+ return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && me.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1338
1217
  }
1339
1218
  setResolvedLanguage(e) {
1340
- if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
1219
+ if (!(!e || !this.languages) && !["cimode", "dev"].includes(e)) {
1341
1220
  for (let t = 0; t < this.languages.length; t++) {
1342
1221
  const s = this.languages[t];
1343
- if (!(["cimode", "dev"].indexOf(s) > -1) && this.store.hasLanguageSomeTranslations(s)) {
1222
+ if (!["cimode", "dev"].includes(s) && this.store.hasLanguageSomeTranslations(s)) {
1344
1223
  this.resolvedLanguage = s;
1345
1224
  break;
1346
1225
  }
1347
1226
  }
1227
+ !this.resolvedLanguage && !this.languages.includes(e) && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
1228
+ }
1348
1229
  }
1349
1230
  changeLanguage(e, t) {
1350
- var s = this;
1351
1231
  this.isLanguageChangingTo = e;
1352
- const i = A();
1232
+ const s = H();
1353
1233
  this.emit("languageChanging", e);
1354
- const r = (l) => {
1355
- this.language = l, this.languages = this.services.languageUtils.toResolveHierarchy(l), this.resolvedLanguage = void 0, this.setResolvedLanguage(l);
1356
- }, a = (l, f) => {
1357
- f ? (r(f), this.translator.changeLanguage(f), this.isLanguageChangingTo = void 0, this.emit("languageChanged", f), this.logger.log("languageChanged", f)) : this.isLanguageChangingTo = void 0, i.resolve(function() {
1358
- return s.t(...arguments);
1359
- }), t && t(l, function() {
1360
- return s.t(...arguments);
1361
- });
1362
- }, o = (l) => {
1363
- !e && !l && this.services.languageDetector && (l = []);
1364
- const f = d(l) ? l : this.services.languageUtils.getBestMatchFromCodes(l);
1365
- f && (this.language || r(f), this.translator.language || this.translator.changeLanguage(f), this.services.languageDetector && this.services.languageDetector.cacheUserLanguage && this.services.languageDetector.cacheUserLanguage(f)), this.loadResources(f, (h) => {
1366
- a(h, f);
1234
+ const i = (a) => {
1235
+ this.language = a, this.languages = this.services.languageUtils.toResolveHierarchy(a), this.resolvedLanguage = void 0, this.setResolvedLanguage(a);
1236
+ }, n = (a, u) => {
1237
+ u ? this.isLanguageChangingTo === e && (i(u), this.translator.changeLanguage(u), this.isLanguageChangingTo = void 0, this.emit("languageChanged", u), this.logger.log("languageChanged", u)) : this.isLanguageChangingTo = void 0, s.resolve((...l) => this.t(...l)), t && t(a, (...l) => this.t(...l));
1238
+ }, r = (a) => {
1239
+ !e && !a && this.services.languageDetector && (a = []);
1240
+ const u = d(a) ? a : a && a[0], l = this.store.hasLanguageSomeTranslations(u) ? u : this.services.languageUtils.getBestMatchFromCodes(d(a) ? [a] : a);
1241
+ l && (this.language || i(l), this.translator.language || this.translator.changeLanguage(l), this.services.languageDetector?.cacheUserLanguage?.(l)), this.loadResources(l, (c) => {
1242
+ n(c, l);
1367
1243
  });
1368
1244
  };
1369
- return !e && this.services.languageDetector && !this.services.languageDetector.async ? o(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(o) : this.services.languageDetector.detect(o) : o(e), i;
1245
+ return !e && this.services.languageDetector && !this.services.languageDetector.async ? r(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(r) : this.services.languageDetector.detect(r) : r(e), s;
1370
1246
  }
1371
- getFixedT(e, t, s) {
1372
- var i = this;
1373
- const r = function(a, o) {
1374
- let l;
1375
- if (typeof o != "object") {
1376
- for (var f = arguments.length, h = new Array(f > 2 ? f - 2 : 0), g = 2; g < f; g++)
1377
- h[g - 2] = arguments[g];
1378
- l = i.options.overloadTranslationOptionHandler([a, o].concat(h));
1379
- } else
1380
- l = {
1381
- ...o
1382
- };
1383
- l.lng = l.lng || r.lng, l.lngs = l.lngs || r.lngs, l.ns = l.ns || r.ns, l.keyPrefix !== "" && (l.keyPrefix = l.keyPrefix || s || r.keyPrefix);
1384
- const u = i.options.keySeparator || ".";
1247
+ getFixedT(e, t, s, i) {
1248
+ const n = i?.scopeNs, r = (a, u, ...l) => {
1385
1249
  let c;
1386
- return l.keyPrefix && Array.isArray(a) ? c = a.map((p) => `${l.keyPrefix}${u}${p}`) : c = l.keyPrefix ? `${l.keyPrefix}${u}${a}` : a, i.t(c, l);
1250
+ typeof u != "object" ? c = this.options.overloadTranslationOptionHandler([a, u].concat(l)) : c = {
1251
+ ...u
1252
+ }, c.lng = c.lng || r.lng, c.lngs = c.lngs || r.lngs;
1253
+ const h = c.ns !== void 0 && c.ns !== null;
1254
+ c.ns = c.ns || r.ns, c.keyPrefix !== "" && (c.keyPrefix = c.keyPrefix || s || r.keyPrefix);
1255
+ const f = {
1256
+ ...this.options,
1257
+ ...c
1258
+ };
1259
+ Array.isArray(n) && !h && (f.ns = n), typeof c.keyPrefix == "function" && (c.keyPrefix = V(c.keyPrefix, f));
1260
+ const g = this.options.keySeparator || ".";
1261
+ let p;
1262
+ return c.keyPrefix && Array.isArray(a) ? p = a.map((m) => (typeof m == "function" && (m = V(m, f)), `${c.keyPrefix}${g}${m}`)) : (typeof a == "function" && (a = V(a, f)), p = c.keyPrefix ? `${c.keyPrefix}${g}${a}` : a), this.t(p, c);
1387
1263
  };
1388
1264
  return d(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = s, r;
1389
1265
  }
1390
- t() {
1391
- return this.translator && this.translator.translate(...arguments);
1266
+ t(...e) {
1267
+ return this.translator?.translate(...e);
1392
1268
  }
1393
- exists() {
1394
- return this.translator && this.translator.exists(...arguments);
1269
+ exists(...e) {
1270
+ return this.translator?.exists(...e);
1395
1271
  }
1396
1272
  setDefaultNamespace(e) {
1397
1273
  this.options.defaultNS = e;
1398
1274
  }
1399
- hasLoadedNamespace(e) {
1400
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1275
+ hasLoadedNamespace(e, t = {}) {
1401
1276
  if (!this.isInitialized)
1402
1277
  return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1403
1278
  if (!this.languages || !this.languages.length)
1404
1279
  return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1405
- const s = t.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, r = this.languages[this.languages.length - 1];
1280
+ const s = t.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, n = this.languages[this.languages.length - 1];
1406
1281
  if (s.toLowerCase() === "cimode") return !0;
1407
- const a = (o, l) => {
1408
- const f = this.services.backendConnector.state[`${o}|${l}`];
1409
- return f === -1 || f === 0 || f === 2;
1282
+ const r = (l, c) => {
1283
+ const h = this.services.backendConnector.state[`${l}|${c}`];
1284
+ return h === -1 || h === 0 || h === 2;
1410
1285
  };
1411
1286
  if (t.precheck) {
1412
- const o = t.precheck(this, a);
1413
- if (o !== void 0) return o;
1287
+ const l = t.precheck(this, r);
1288
+ if (l !== void 0) return l;
1414
1289
  }
1415
- return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(s, e) && (!i || a(r, e)));
1290
+ if (this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return !0;
1291
+ const {
1292
+ languageUtils: a
1293
+ } = this.services, u = t.lng ? a.isSupportedCode(s) && a.toResolveHierarchy(s, !1)[0] : s;
1294
+ return !!((!u || r(u, e)) && (!i || r(n, e)));
1416
1295
  }
1417
1296
  loadNamespaces(e, t) {
1418
- const s = A();
1297
+ const s = H();
1419
1298
  return this.options.ns ? (d(e) && (e = [e]), e.forEach((i) => {
1420
- this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
1299
+ this.options.ns.includes(i) || this.options.ns.push(i);
1421
1300
  }), this.loadResources((i) => {
1422
1301
  s.resolve(), t && t(i);
1423
1302
  }), s) : (t && t(), Promise.resolve());
1424
1303
  }
1425
1304
  loadLanguages(e, t) {
1426
- const s = A();
1305
+ const s = H();
1427
1306
  d(e) && (e = [e]);
1428
- const i = this.options.preload || [], r = e.filter((a) => i.indexOf(a) < 0 && this.services.languageUtils.isSupportedCode(a));
1429
- return r.length ? (this.options.preload = i.concat(r), this.loadResources((a) => {
1430
- s.resolve(), t && t(a);
1307
+ const i = this.options.preload || [], n = e.filter((r) => !i.includes(r) && this.services.languageUtils.isSupportedCode(r));
1308
+ return n.length ? (this.options.preload = i.concat(n), this.loadResources((r) => {
1309
+ s.resolve(), t && t(r);
1431
1310
  }), s) : (t && t(), Promise.resolve());
1432
1311
  }
1433
1312
  dir(e) {
1434
- if (e || (e = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e) return "rtl";
1435
- const t = ["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"], s = this.services && this.services.languageUtils || new ne(oe());
1436
- return t.indexOf(s.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1313
+ if (e || (e = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language)), !e) return "rtl";
1314
+ try {
1315
+ const i = new Intl.Locale(e);
1316
+ if (i && i.getTextInfo) {
1317
+ const n = i.getTextInfo();
1318
+ if (n && n.direction) return n.direction;
1319
+ }
1320
+ } catch {
1321
+ }
1322
+ const t = ["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"], s = this.services?.languageUtils || new le(Z());
1323
+ return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.includes(s.getLanguagePartFromCode(e)) || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1437
1324
  }
1438
- static createInstance() {
1439
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1440
- return new V(e, t);
1325
+ static createInstance(e = {}, t) {
1326
+ const s = new M(e, t);
1327
+ return s.createInstance = M.createInstance, s;
1441
1328
  }
1442
- cloneInstance() {
1443
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : U;
1329
+ cloneInstance(e = {}, t = J) {
1444
1330
  const s = e.forkResourceStore;
1445
- s && delete e.forkResourceStore;
1331
+ s && (e = {
1332
+ ...e
1333
+ }, delete e.forkResourceStore);
1446
1334
  const i = {
1447
1335
  ...this.options,
1336
+ preload: !1,
1448
1337
  ...e,
1449
1338
  isClone: !0
1450
- }, r = new V(i);
1451
- return (e.debug !== void 0 || e.prefix !== void 0) && (r.logger = r.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
1452
- r[o] = this[o];
1453
- }), r.services = {
1339
+ }, n = new M(i);
1340
+ if ((e.debug !== void 0 || e.prefix !== void 0) && (n.logger = n.logger.clone(e)), ["store", "services", "language"].forEach((a) => {
1341
+ n[a] = this[a];
1342
+ }), n.services = {
1454
1343
  ...this.services
1455
- }, r.services.utils = {
1456
- hasLoadedNamespace: r.hasLoadedNamespace.bind(r)
1457
- }, s && (r.store = new se(this.store.data, i), r.services.resourceStore = r.store), r.translator = new J(r.services, i), r.translator.on("*", function(o) {
1458
- for (var l = arguments.length, f = new Array(l > 1 ? l - 1 : 0), h = 1; h < l; h++)
1459
- f[h - 1] = arguments[h];
1460
- r.emit(o, ...f);
1461
- }), r.init(i, t), r.translator.options = i, r.translator.backendConnector.services.utils = {
1462
- hasLoadedNamespace: r.hasLoadedNamespace.bind(r)
1463
- }, r;
1344
+ }, n.services.utils = {
1345
+ hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
1346
+ }, s) {
1347
+ const a = (l) => {
1348
+ const c = Array.isArray(l) ? [...l] : {
1349
+ ...l
1350
+ };
1351
+ return Object.keys(c).forEach((h) => {
1352
+ c[h] && typeof c[h] == "object" && (c[h] = a(c[h]));
1353
+ }), c;
1354
+ }, u = a(this.store.data);
1355
+ n.store = new oe(u, i), n.services.resourceStore = n.store;
1356
+ }
1357
+ if (e.interpolation) {
1358
+ const u = {
1359
+ ...Z().interpolation,
1360
+ ...this.options.interpolation,
1361
+ ...e.interpolation
1362
+ }, l = {
1363
+ ...i,
1364
+ interpolation: u
1365
+ };
1366
+ n.services.interpolator = new fe(l);
1367
+ }
1368
+ return n.translator = new Y(n.services, i), n.translator.on("*", (a, ...u) => {
1369
+ n.emit(a, ...u);
1370
+ }), n.init(i, t), n.translator.options = i, n.translator.backendConnector.services.utils = {
1371
+ hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
1372
+ }, n;
1464
1373
  }
1465
1374
  toJSON() {
1466
1375
  return {
@@ -1472,23 +1381,23 @@ class V extends B {
1472
1381
  };
1473
1382
  }
1474
1383
  }
1475
- const L = V.createInstance();
1476
- L.createInstance = V.createInstance;
1477
- L.createInstance;
1478
- L.dir;
1479
- L.init;
1480
- L.loadResources;
1481
- L.reloadResources;
1482
- L.use;
1483
- L.changeLanguage;
1484
- L.getFixedT;
1485
- L.t;
1486
- L.exists;
1487
- L.setDefaultNamespace;
1488
- L.hasLoadedNamespace;
1489
- L.loadNamespaces;
1490
- L.loadLanguages;
1384
+ const O = M.createInstance();
1385
+ O.createInstance;
1386
+ O.dir;
1387
+ O.init;
1388
+ O.loadResources;
1389
+ O.reloadResources;
1390
+ O.use;
1391
+ O.changeLanguage;
1392
+ O.getFixedT;
1393
+ O.t;
1394
+ O.exists;
1395
+ O.setDefaultNamespace;
1396
+ O.hasLoadedNamespace;
1397
+ O.loadNamespaces;
1398
+ O.loadLanguages;
1491
1399
  export {
1492
- L as default
1400
+ O as default,
1401
+ V as keyFromSelector
1493
1402
  };
1494
1403
  //# sourceMappingURL=i18next.es.js.map