@prosopo/procaptcha-bundle 2.5.1 → 2.5.3
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.
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts +4 -4
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.js +4 -4
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts +3 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.js +83 -13
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +5 -6
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts +8 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +11 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts +6 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha/componentsList.js → captcha/captchaComponentsList.js} +3 -3
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha/captcha.d.ts → captcha/captchaProps.d.ts} +3 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js +2 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +24 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +51 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha → captcha}/components/frictionlessCaptcha.d.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -0
- package/{dist/util/renderLogic → .rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util}/captcha/components/frictionlessCaptcha.js +2 -2
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha → captcha}/components/imageCaptcha.d.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha → captcha}/components/imageCaptcha.js +2 -2
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha → captcha}/components/powCaptcha.d.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha → captcha}/components/powCaptcha.js +2 -2
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts +0 -2
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js +0 -19
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts +5 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js +24 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts +18 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +57 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts +9 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js +19 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js.map +1 -0
- package/dist/bundle/ProcaptchaWidget-BlWWnPeB.js +615 -0
- package/dist/bundle/ProcaptchaWidget-Dnwno-4N.js +156 -0
- package/dist/bundle/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/bundle/{asU8a-Br9wz334.js → asU8a-JliaME7-.js} +1 -1
- package/dist/bundle/{bip39-BtaWByKg.js → bip39-CFjno8fK.js} +2 -2
- package/dist/bundle/{browser-ponyfill-Ck_bwPOY.js → browser-ponyfill-Dy1JBTMg.js} +20 -20
- package/dist/bundle/captchaComponentProvider-dcMua0p9.js +1013 -0
- package/dist/bundle/captchaRenderer-D-du50M4.js +5478 -0
- package/dist/bundle/components.d.ts +4 -4
- package/dist/bundle/components.d.ts.map +1 -1
- package/dist/bundle/emotion-element-5486c51c.browser.esm-Bywq83R5.js +1838 -0
- package/dist/bundle/{hash-KElfghPn.js → hash-CtL1HOjf.js} +1 -1
- package/dist/bundle/i18nFrontend-C_RgmvGh.js +2273 -0
- package/dist/bundle/index-B8oMghZ3.js +1120 -0
- package/dist/bundle/{index-Cb-XcaMX.js → index-BMjJnq60.js} +11 -10
- package/dist/bundle/index-BTlHNFX8.js +504 -0
- package/dist/bundle/{index-B0trzdT2.js → index-DcG_c-Na.js} +20 -19
- package/dist/bundle/index.d.ts +3 -1
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/locales/de/translation.json +2 -1
- package/dist/bundle/locales/en/translation.json +2 -1
- package/dist/bundle/locales/es/translation.json +2 -1
- package/dist/bundle/locales/fr/translation.json +2 -1
- package/dist/bundle/locales/it/translation.json +2 -1
- package/dist/bundle/locales/pt/translation.json +2 -1
- package/dist/bundle/locales/pt-BR/translation.json +2 -1
- package/dist/bundle/procaptcha.bundle.js +4 -3
- package/dist/bundle/translations-B0P9axY3.js +2885 -0
- package/dist/bundle/useTranslation-7b6JJ18N.js +158 -0
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts +8 -0
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -0
- package/dist/bundle/util/captcha/captchaComponentsList.d.ts +6 -0
- package/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -0
- package/dist/{util/renderLogic/captcha/captcha.d.ts → bundle/util/captcha/captchaProps.d.ts} +3 -1
- package/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -0
- package/dist/bundle/util/captcha/captchaRenderer.d.ts +24 -0
- package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -0
- package/dist/bundle/util/captcha/captchaType.d.ts.map +1 -0
- package/dist/bundle/util/{renderLogic/captcha → captcha}/components/frictionlessCaptcha.d.ts +1 -1
- package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -0
- package/dist/bundle/util/{renderLogic/captcha → captcha}/components/imageCaptcha.d.ts +1 -1
- package/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +1 -0
- package/dist/bundle/util/{renderLogic/captcha → captcha}/components/powCaptcha.d.ts +1 -1
- package/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +1 -0
- package/dist/bundle/util/config.d.ts +0 -2
- package/dist/bundle/util/config.d.ts.map +1 -1
- package/dist/bundle/util/configCreator.d.ts +5 -0
- package/dist/bundle/util/configCreator.d.ts.map +1 -0
- package/dist/bundle/util/widgetFactory.d.ts +18 -0
- package/dist/bundle/util/widgetFactory.d.ts.map +1 -0
- package/dist/bundle/util/widgetThemeResolver.d.ts +9 -0
- package/dist/bundle/util/widgetThemeResolver.d.ts.map +1 -0
- package/dist/components.d.ts +4 -4
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +4 -4
- package/dist/components.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +83 -13
- package/dist/index.js.map +1 -1
- package/dist/tests/util/captchaType.test.js +1 -1
- package/dist/tests/util/captchaType.test.js.map +1 -1
- package/dist/tests/util/renderLogic.test.js +5 -6
- package/dist/tests/util/renderLogic.test.js.map +1 -1
- package/dist/util/captcha/captchaComponentProvider.d.ts +8 -0
- package/dist/util/captcha/captchaComponentProvider.d.ts.map +1 -0
- package/dist/util/captcha/captchaComponentProvider.js +11 -0
- package/dist/util/captcha/captchaComponentProvider.js.map +1 -0
- package/dist/util/captcha/captchaComponentsList.d.ts +6 -0
- package/dist/util/captcha/captchaComponentsList.d.ts.map +1 -0
- package/dist/util/{renderLogic/captcha/componentsList.js → captcha/captchaComponentsList.js} +3 -3
- package/dist/util/captcha/captchaComponentsList.js.map +1 -0
- package/dist/{bundle/util/renderLogic/captcha/captcha.d.ts → util/captcha/captchaProps.d.ts} +3 -1
- package/dist/util/captcha/captchaProps.d.ts.map +1 -0
- package/dist/util/captcha/captchaProps.js +2 -0
- package/dist/util/captcha/captchaProps.js.map +1 -0
- package/dist/util/captcha/captchaRenderer.d.ts +24 -0
- package/dist/util/captcha/captchaRenderer.d.ts.map +1 -0
- package/dist/util/captcha/captchaRenderer.js +51 -0
- package/dist/util/captcha/captchaRenderer.js.map +1 -0
- package/dist/util/captcha/captchaType.d.ts.map +1 -0
- package/dist/util/captcha/captchaType.js.map +1 -0
- package/dist/util/{renderLogic/captcha → captcha}/components/frictionlessCaptcha.d.ts +1 -1
- package/dist/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -0
- package/{.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic → dist/util}/captcha/components/frictionlessCaptcha.js +2 -2
- package/dist/util/captcha/components/frictionlessCaptcha.js.map +1 -0
- package/dist/util/{renderLogic/captcha → captcha}/components/imageCaptcha.d.ts +1 -1
- package/dist/util/captcha/components/imageCaptcha.d.ts.map +1 -0
- package/dist/util/{renderLogic/captcha → captcha}/components/imageCaptcha.js +2 -2
- package/dist/util/captcha/components/imageCaptcha.js.map +1 -0
- package/dist/util/{renderLogic/captcha → captcha}/components/powCaptcha.d.ts +1 -1
- package/dist/util/captcha/components/powCaptcha.d.ts.map +1 -0
- package/dist/util/{renderLogic/captcha → captcha}/components/powCaptcha.js +2 -2
- package/dist/util/captcha/components/powCaptcha.js.map +1 -0
- package/dist/util/config.d.ts +0 -2
- package/dist/util/config.d.ts.map +1 -1
- package/dist/util/config.js +0 -19
- package/dist/util/config.js.map +1 -1
- package/dist/util/configCreator.d.ts +5 -0
- package/dist/util/configCreator.d.ts.map +1 -0
- package/dist/util/configCreator.js +24 -0
- package/dist/util/configCreator.js.map +1 -0
- package/dist/util/widgetFactory.d.ts +18 -0
- package/dist/util/widgetFactory.d.ts.map +1 -0
- package/dist/util/widgetFactory.js +57 -0
- package/dist/util/widgetFactory.js.map +1 -0
- package/dist/util/widgetThemeResolver.d.ts +9 -0
- package/dist/util/widgetThemeResolver.d.ts.map +1 -0
- package/dist/util/widgetThemeResolver.js +19 -0
- package/dist/util/widgetThemeResolver.js.map +1 -0
- package/package.json +10 -9
- package/stats.html +1 -1
- package/vite.cjs.config.ts +1 -1
- package/vite.config.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captchaType.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captchaType.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captcha.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captcha.js +0 -2
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captcha.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captchaRenderer.d.ts +0 -8
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captchaRenderer.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captchaRenderer.js +0 -11
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captchaRenderer.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/components/frictionlessCaptcha.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/components/imageCaptcha.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/components/imageCaptcha.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/components/powCaptcha.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/components/powCaptcha.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/componentsList.d.ts +0 -6
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/componentsList.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/componentsList.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/webComponent.d.ts +0 -8
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/webComponent.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/webComponent.js +0 -29
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/webComponent.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/widgetRenderer.d.ts +0 -23
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/widgetRenderer.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/widgetRenderer.js +0 -52
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/widgetRenderer.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic.d.ts +0 -3
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic.js +0 -14
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/theme.d.ts +0 -3
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/theme.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/theme.js +0 -9
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/theme.js.map +0 -1
- package/dist/bundle/ProcaptchaWidget-CAyH6qD7.js +0 -161
- package/dist/bundle/ProcaptchaWidget-CY3qomFu.js +0 -619
- package/dist/bundle/index-VYSrdSle.js +0 -11587
- package/dist/bundle/index-n-2hvBzo.js +0 -1190
- package/dist/bundle/useTranslation-CcYxvTxi.js +0 -2435
- package/dist/bundle/util/captchaType.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/captcha/captcha.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/captcha/captchaRenderer.d.ts +0 -8
- package/dist/bundle/util/renderLogic/captcha/captchaRenderer.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/captcha/components/imageCaptcha.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/captcha/components/powCaptcha.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/captcha/componentsList.d.ts +0 -6
- package/dist/bundle/util/renderLogic/captcha/componentsList.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/webComponent.d.ts +0 -8
- package/dist/bundle/util/renderLogic/webComponent.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/widgetRenderer.d.ts +0 -23
- package/dist/bundle/util/renderLogic/widgetRenderer.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic.d.ts +0 -3
- package/dist/bundle/util/renderLogic.d.ts.map +0 -1
- package/dist/bundle/util/theme.d.ts +0 -3
- package/dist/bundle/util/theme.d.ts.map +0 -1
- package/dist/util/captchaType.d.ts.map +0 -1
- package/dist/util/captchaType.js.map +0 -1
- package/dist/util/renderLogic/captcha/captcha.d.ts.map +0 -1
- package/dist/util/renderLogic/captcha/captcha.js +0 -2
- package/dist/util/renderLogic/captcha/captcha.js.map +0 -1
- package/dist/util/renderLogic/captcha/captchaRenderer.d.ts +0 -8
- package/dist/util/renderLogic/captcha/captchaRenderer.d.ts.map +0 -1
- package/dist/util/renderLogic/captcha/captchaRenderer.js +0 -11
- package/dist/util/renderLogic/captcha/captchaRenderer.js.map +0 -1
- package/dist/util/renderLogic/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
- package/dist/util/renderLogic/captcha/components/frictionlessCaptcha.js.map +0 -1
- package/dist/util/renderLogic/captcha/components/imageCaptcha.d.ts.map +0 -1
- package/dist/util/renderLogic/captcha/components/imageCaptcha.js.map +0 -1
- package/dist/util/renderLogic/captcha/components/powCaptcha.d.ts.map +0 -1
- package/dist/util/renderLogic/captcha/components/powCaptcha.js.map +0 -1
- package/dist/util/renderLogic/captcha/componentsList.d.ts +0 -6
- package/dist/util/renderLogic/captcha/componentsList.d.ts.map +0 -1
- package/dist/util/renderLogic/captcha/componentsList.js.map +0 -1
- package/dist/util/renderLogic/webComponent.d.ts +0 -8
- package/dist/util/renderLogic/webComponent.d.ts.map +0 -1
- package/dist/util/renderLogic/webComponent.js +0 -29
- package/dist/util/renderLogic/webComponent.js.map +0 -1
- package/dist/util/renderLogic/widgetRenderer.d.ts +0 -23
- package/dist/util/renderLogic/widgetRenderer.d.ts.map +0 -1
- package/dist/util/renderLogic/widgetRenderer.js +0 -52
- package/dist/util/renderLogic/widgetRenderer.js.map +0 -1
- package/dist/util/renderLogic.d.ts +0 -3
- package/dist/util/renderLogic.d.ts.map +0 -1
- package/dist/util/renderLogic.js +0 -14
- package/dist/util/renderLogic.js.map +0 -1
- package/dist/util/theme.d.ts +0 -3
- package/dist/util/theme.d.ts.map +0 -1
- package/dist/util/theme.js +0 -9
- package/dist/util/theme.js.map +0 -1
- /package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{captchaType.d.ts → captcha/captchaType.d.ts} +0 -0
- /package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{captchaType.js → captcha/captchaType.js} +0 -0
- /package/dist/bundle/util/{captchaType.d.ts → captcha/captchaType.d.ts} +0 -0
- /package/dist/util/{captchaType.d.ts → captcha/captchaType.d.ts} +0 -0
- /package/dist/util/{captchaType.js → captcha/captchaType.js} +0 -0
|
@@ -1,2435 +0,0 @@
|
|
|
1
|
-
import { z as ot, r as I, B as at, D as ut } from "./index-VYSrdSle.js";
|
|
2
|
-
import { s as lt } from "./toU8a-BWKf-2UU.js";
|
|
3
|
-
function Tn(i) {
|
|
4
|
-
return ot(lt(i));
|
|
5
|
-
}
|
|
6
|
-
const An = (i) => new Promise((e) => setTimeout(e, i)), In = (i, e) => (t) => {
|
|
7
|
-
Object.assign(i, t), e(t);
|
|
8
|
-
}, ee = (i, e) => {
|
|
9
|
-
const t = i(e), n = (r) => {
|
|
10
|
-
t.current = r;
|
|
11
|
-
};
|
|
12
|
-
return [t.current, n];
|
|
13
|
-
}, Fn = (i, e) => {
|
|
14
|
-
const [t, n] = i(!1), [s, r] = i(0), [o, a] = i([]), [u, l] = ee(e, void 0), [f, d] = i(!1), [c, h] = i(void 0), [g, p] = i(!1), [m, S] = i(void 0), [w, O] = i(void 0), [k, N] = ee(e, void 0), [T, L] = ee(e, void 0), [v, P] = ee(e, void 0), [C, x] = i(!1), [$, _] = i(0), [E, j] = i(void 0), [D, K] = i(void 0);
|
|
15
|
-
return [
|
|
16
|
-
{
|
|
17
|
-
isHuman: t,
|
|
18
|
-
index: s,
|
|
19
|
-
solutions: o,
|
|
20
|
-
captchaApi: u,
|
|
21
|
-
showModal: f,
|
|
22
|
-
challenge: c,
|
|
23
|
-
loading: g,
|
|
24
|
-
account: m,
|
|
25
|
-
dappAccount: w,
|
|
26
|
-
submission: k,
|
|
27
|
-
timeout: T,
|
|
28
|
-
successfullChallengeTimeout: v,
|
|
29
|
-
sendData: C,
|
|
30
|
-
attemptCount: $,
|
|
31
|
-
error: E,
|
|
32
|
-
sessionId: D
|
|
33
|
-
},
|
|
34
|
-
(b) => {
|
|
35
|
-
b.account !== void 0 && S(b.account), b.isHuman !== void 0 && n(b.isHuman), b.index !== void 0 && r(b.index), b.solutions !== void 0 && a(b.solutions.slice()), b.captchaApi !== void 0 && l(b.captchaApi), b.showModal !== void 0 && d(b.showModal), b.challenge !== void 0 && h(b.challenge), b.loading !== void 0 && p(b.loading), b.showModal !== void 0 && d(b.showModal), b.dappAccount !== void 0 && O(b.dappAccount), b.submission !== void 0 && N(b.submission), b.timeout !== void 0 && L(b.timeout), b.successfullChallengeTimeout !== void 0 && P(b.timeout), b.sendData !== void 0 && x(b.sendData), b.attemptCount !== void 0 && _(b.attemptCount), b.error !== void 0 && j(b.error), b.sessionId !== void 0 && K(b.sessionId);
|
|
36
|
-
}
|
|
37
|
-
];
|
|
38
|
-
};
|
|
39
|
-
async function Dn(i) {
|
|
40
|
-
return new Promise((e, t) => {
|
|
41
|
-
try {
|
|
42
|
-
Promise.resolve().then(() => En).then(({ default: n }) => {
|
|
43
|
-
e(n());
|
|
44
|
-
});
|
|
45
|
-
} catch (n) {
|
|
46
|
-
t(n);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
const ft = (i, e, t, n) => {
|
|
51
|
-
var r, o, a, u;
|
|
52
|
-
const s = [t, {
|
|
53
|
-
code: e,
|
|
54
|
-
...n || {}
|
|
55
|
-
}];
|
|
56
|
-
if ((o = (r = i == null ? void 0 : i.services) == null ? void 0 : r.logger) != null && o.forward)
|
|
57
|
-
return i.services.logger.forward(s, "warn", "react-i18next::", !0);
|
|
58
|
-
H(s[0]) && (s[0] = `react-i18next:: ${s[0]}`), (u = (a = i == null ? void 0 : i.services) == null ? void 0 : a.logger) != null && u.warn ? i.services.logger.warn(...s) : console != null && console.warn && [...s];
|
|
59
|
-
}, we = {}, ce = (i, e, t, n) => {
|
|
60
|
-
H(t) && we[t] || (H(t) && (we[t] = /* @__PURE__ */ new Date()), ft(i, e, t, n));
|
|
61
|
-
}, Xe = (i, e) => () => {
|
|
62
|
-
if (i.isInitialized)
|
|
63
|
-
e();
|
|
64
|
-
else {
|
|
65
|
-
const t = () => {
|
|
66
|
-
setTimeout(() => {
|
|
67
|
-
i.off("initialized", t);
|
|
68
|
-
}, 0), e();
|
|
69
|
-
};
|
|
70
|
-
i.on("initialized", t);
|
|
71
|
-
}
|
|
72
|
-
}, de = (i, e, t) => {
|
|
73
|
-
i.loadNamespaces(e, Xe(i, t));
|
|
74
|
-
}, xe = (i, e, t, n) => {
|
|
75
|
-
if (H(t) && (t = [t]), i.options.preload && i.options.preload.indexOf(e) > -1) return de(i, t, n);
|
|
76
|
-
t.forEach((s) => {
|
|
77
|
-
i.options.ns.indexOf(s) < 0 && i.options.ns.push(s);
|
|
78
|
-
}), i.loadLanguages(e, Xe(i, n));
|
|
79
|
-
}, ct = (i, e, t = {}) => !e.languages || !e.languages.length ? (ce(e, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
|
|
80
|
-
languages: e.languages
|
|
81
|
-
}), !0) : e.hasLoadedNamespace(i, {
|
|
82
|
-
lng: t.lng,
|
|
83
|
-
precheck: (n, s) => {
|
|
84
|
-
var r;
|
|
85
|
-
if (((r = t.bindI18n) == null ? void 0 : r.indexOf("languageChanging")) > -1 && n.services.backendConnector.backend && n.isLanguageChangingTo && !s(n.isLanguageChangingTo, i)) return !1;
|
|
86
|
-
}
|
|
87
|
-
}), H = (i) => typeof i == "string", dt = (i) => typeof i == "object" && i !== null, ht = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, gt = {
|
|
88
|
-
"&": "&",
|
|
89
|
-
"&": "&",
|
|
90
|
-
"<": "<",
|
|
91
|
-
"<": "<",
|
|
92
|
-
">": ">",
|
|
93
|
-
">": ">",
|
|
94
|
-
"'": "'",
|
|
95
|
-
"'": "'",
|
|
96
|
-
""": '"',
|
|
97
|
-
""": '"',
|
|
98
|
-
" ": " ",
|
|
99
|
-
" ": " ",
|
|
100
|
-
"©": "©",
|
|
101
|
-
"©": "©",
|
|
102
|
-
"®": "®",
|
|
103
|
-
"®": "®",
|
|
104
|
-
"…": "…",
|
|
105
|
-
"…": "…",
|
|
106
|
-
"/": "/",
|
|
107
|
-
"/": "/"
|
|
108
|
-
}, pt = (i) => gt[i], mt = (i) => i.replace(ht, pt);
|
|
109
|
-
let he = {
|
|
110
|
-
bindI18n: "languageChanged",
|
|
111
|
-
bindI18nStore: "",
|
|
112
|
-
transEmptyNodeValue: "",
|
|
113
|
-
transSupportBasicHtmlNodes: !0,
|
|
114
|
-
transWrapTextNodes: "",
|
|
115
|
-
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
116
|
-
useSuspense: !0,
|
|
117
|
-
unescape: mt
|
|
118
|
-
};
|
|
119
|
-
const yt = (i = {}) => {
|
|
120
|
-
he = {
|
|
121
|
-
...he,
|
|
122
|
-
...i
|
|
123
|
-
};
|
|
124
|
-
}, bt = () => he;
|
|
125
|
-
let Je;
|
|
126
|
-
const vt = (i) => {
|
|
127
|
-
Je = i;
|
|
128
|
-
}, wt = () => Je, xt = {
|
|
129
|
-
type: "3rdParty",
|
|
130
|
-
init(i) {
|
|
131
|
-
yt(i.options.react), vt(i);
|
|
132
|
-
}
|
|
133
|
-
}, Ot = I.createContext();
|
|
134
|
-
class St {
|
|
135
|
-
constructor() {
|
|
136
|
-
this.usedNamespaces = {};
|
|
137
|
-
}
|
|
138
|
-
addUsedNamespaces(e) {
|
|
139
|
-
e.forEach((t) => {
|
|
140
|
-
this.usedNamespaces[t] || (this.usedNamespaces[t] = !0);
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
getUsedNamespaces() {
|
|
144
|
-
return Object.keys(this.usedNamespaces);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
const Lt = (i, e) => {
|
|
148
|
-
const t = I.useRef();
|
|
149
|
-
return I.useEffect(() => {
|
|
150
|
-
t.current = i;
|
|
151
|
-
}, [i, e]), t.current;
|
|
152
|
-
}, We = (i, e, t, n) => i.getFixedT(e, t, n), Pt = (i, e, t, n) => I.useCallback(We(i, e, t, n), [i, e, t, n]), Ct = (i, e = {}) => {
|
|
153
|
-
var k, N, T, L;
|
|
154
|
-
const {
|
|
155
|
-
i18n: t
|
|
156
|
-
} = e, {
|
|
157
|
-
i18n: n,
|
|
158
|
-
defaultNS: s
|
|
159
|
-
} = I.useContext(Ot) || {}, r = t || n || wt();
|
|
160
|
-
if (r && !r.reportNamespaces && (r.reportNamespaces = new St()), !r) {
|
|
161
|
-
ce(r, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
|
|
162
|
-
const v = (C, x) => H(x) ? x : dt(x) && H(x.defaultValue) ? x.defaultValue : Array.isArray(C) ? C[C.length - 1] : C, P = [v, {}, !1];
|
|
163
|
-
return P.t = v, P.i18n = {}, P.ready = !1, P;
|
|
164
|
-
}
|
|
165
|
-
(k = r.options.react) != null && k.wait && ce(r, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
166
|
-
const o = {
|
|
167
|
-
...bt(),
|
|
168
|
-
...r.options.react,
|
|
169
|
-
...e
|
|
170
|
-
}, {
|
|
171
|
-
useSuspense: a,
|
|
172
|
-
keyPrefix: u
|
|
173
|
-
} = o;
|
|
174
|
-
let l = i || s || ((N = r.options) == null ? void 0 : N.defaultNS);
|
|
175
|
-
l = H(l) ? [l] : l || ["translation"], (L = (T = r.reportNamespaces).addUsedNamespaces) == null || L.call(T, l);
|
|
176
|
-
const f = (r.isInitialized || r.initializedStoreOnce) && l.every((v) => ct(v, r, o)), d = Pt(r, e.lng || null, o.nsMode === "fallback" ? l : l[0], u), c = () => d, h = () => We(r, e.lng || null, o.nsMode === "fallback" ? l : l[0], u), [g, p] = I.useState(c);
|
|
177
|
-
let m = l.join();
|
|
178
|
-
e.lng && (m = `${e.lng}${m}`);
|
|
179
|
-
const S = Lt(m), w = I.useRef(!0);
|
|
180
|
-
I.useEffect(() => {
|
|
181
|
-
const {
|
|
182
|
-
bindI18n: v,
|
|
183
|
-
bindI18nStore: P
|
|
184
|
-
} = o;
|
|
185
|
-
w.current = !0, !f && !a && (e.lng ? xe(r, e.lng, l, () => {
|
|
186
|
-
w.current && p(h);
|
|
187
|
-
}) : de(r, l, () => {
|
|
188
|
-
w.current && p(h);
|
|
189
|
-
})), f && S && S !== m && w.current && p(h);
|
|
190
|
-
const C = () => {
|
|
191
|
-
w.current && p(h);
|
|
192
|
-
};
|
|
193
|
-
return v && (r == null || r.on(v, C)), P && (r == null || r.store.on(P, C)), () => {
|
|
194
|
-
w.current = !1, r && (v == null || v.split(" ").forEach((x) => r.off(x, C))), P && r && P.split(" ").forEach((x) => r.store.off(x, C));
|
|
195
|
-
};
|
|
196
|
-
}, [r, m]), I.useEffect(() => {
|
|
197
|
-
w.current && f && p(c);
|
|
198
|
-
}, [r, u, f]);
|
|
199
|
-
const O = [g, r, f];
|
|
200
|
-
if (O.t = g, O.i18n = r, O.ready = f, f || !f && !a) return O;
|
|
201
|
-
throw new Promise((v) => {
|
|
202
|
-
e.lng ? xe(r, e.lng, l, () => v()) : de(r, l, () => v());
|
|
203
|
-
});
|
|
204
|
-
}, y = (i) => typeof i == "string", X = () => {
|
|
205
|
-
let i, e;
|
|
206
|
-
const t = new Promise((n, s) => {
|
|
207
|
-
i = n, e = s;
|
|
208
|
-
});
|
|
209
|
-
return t.resolve = i, t.reject = e, t;
|
|
210
|
-
}, Oe = (i) => i == null ? "" : "" + i, kt = (i, e, t) => {
|
|
211
|
-
i.forEach((n) => {
|
|
212
|
-
e[n] && (t[n] = e[n]);
|
|
213
|
-
});
|
|
214
|
-
}, $t = /###/g, Se = (i) => i && i.indexOf("###") > -1 ? i.replace($t, ".") : i, Le = (i) => !i || y(i), Q = (i, e, t) => {
|
|
215
|
-
const n = y(e) ? e.split(".") : e;
|
|
216
|
-
let s = 0;
|
|
217
|
-
for (; s < n.length - 1; ) {
|
|
218
|
-
if (Le(i)) return {};
|
|
219
|
-
const r = Se(n[s]);
|
|
220
|
-
!i[r] && t && (i[r] = new t()), Object.prototype.hasOwnProperty.call(i, r) ? i = i[r] : i = {}, ++s;
|
|
221
|
-
}
|
|
222
|
-
return Le(i) ? {} : {
|
|
223
|
-
obj: i,
|
|
224
|
-
k: Se(n[s])
|
|
225
|
-
};
|
|
226
|
-
}, Pe = (i, e, t) => {
|
|
227
|
-
const {
|
|
228
|
-
obj: n,
|
|
229
|
-
k: s
|
|
230
|
-
} = Q(i, e, Object);
|
|
231
|
-
if (n !== void 0 || e.length === 1) {
|
|
232
|
-
n[s] = t;
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
let r = e[e.length - 1], o = e.slice(0, e.length - 1), a = Q(i, o, Object);
|
|
236
|
-
for (; a.obj === void 0 && o.length; )
|
|
237
|
-
r = `${o[o.length - 1]}.${r}`, o = o.slice(0, o.length - 1), a = Q(i, o, Object), a != null && a.obj && typeof a.obj[`${a.k}.${r}`] < "u" && (a.obj = void 0);
|
|
238
|
-
a.obj[`${a.k}.${r}`] = t;
|
|
239
|
-
}, Rt = (i, e, t, n) => {
|
|
240
|
-
const {
|
|
241
|
-
obj: s,
|
|
242
|
-
k: r
|
|
243
|
-
} = Q(i, e, Object);
|
|
244
|
-
s[r] = s[r] || [], s[r].push(t);
|
|
245
|
-
}, ie = (i, e) => {
|
|
246
|
-
const {
|
|
247
|
-
obj: t,
|
|
248
|
-
k: n
|
|
249
|
-
} = Q(i, e);
|
|
250
|
-
if (t && Object.prototype.hasOwnProperty.call(t, n))
|
|
251
|
-
return t[n];
|
|
252
|
-
}, Et = (i, e, t) => {
|
|
253
|
-
const n = ie(i, t);
|
|
254
|
-
return n !== void 0 ? n : ie(e, t);
|
|
255
|
-
}, Qe = (i, e, t) => {
|
|
256
|
-
for (const n in e)
|
|
257
|
-
n !== "__proto__" && n !== "constructor" && (n in i ? y(i[n]) || i[n] instanceof String || y(e[n]) || e[n] instanceof String ? t && (i[n] = e[n]) : Qe(i[n], e[n], t) : i[n] = e[n]);
|
|
258
|
-
return i;
|
|
259
|
-
}, V = (i) => i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
260
|
-
var jt = {
|
|
261
|
-
"&": "&",
|
|
262
|
-
"<": "<",
|
|
263
|
-
">": ">",
|
|
264
|
-
'"': """,
|
|
265
|
-
"'": "'",
|
|
266
|
-
"/": "/"
|
|
267
|
-
};
|
|
268
|
-
const Nt = (i) => y(i) ? i.replace(/[&<>"'\/]/g, (e) => jt[e]) : i;
|
|
269
|
-
class Tt {
|
|
270
|
-
constructor(e) {
|
|
271
|
-
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
272
|
-
}
|
|
273
|
-
getRegExp(e) {
|
|
274
|
-
const t = this.regExpMap.get(e);
|
|
275
|
-
if (t !== void 0)
|
|
276
|
-
return t;
|
|
277
|
-
const n = new RegExp(e);
|
|
278
|
-
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
const At = [" ", ",", "?", "!", ";"], It = new Tt(20), Ft = (i, e, t) => {
|
|
282
|
-
e = e || "", t = t || "";
|
|
283
|
-
const n = At.filter((o) => e.indexOf(o) < 0 && t.indexOf(o) < 0);
|
|
284
|
-
if (n.length === 0) return !0;
|
|
285
|
-
const s = It.getRegExp(`(${n.map((o) => o === "?" ? "\\?" : o).join("|")})`);
|
|
286
|
-
let r = !s.test(i);
|
|
287
|
-
if (!r) {
|
|
288
|
-
const o = i.indexOf(t);
|
|
289
|
-
o > 0 && !s.test(i.substring(0, o)) && (r = !0);
|
|
290
|
-
}
|
|
291
|
-
return r;
|
|
292
|
-
}, ge = function(i, e) {
|
|
293
|
-
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
|
|
294
|
-
if (!i) return;
|
|
295
|
-
if (i[e])
|
|
296
|
-
return Object.prototype.hasOwnProperty.call(i, e) ? i[e] : void 0;
|
|
297
|
-
const n = e.split(t);
|
|
298
|
-
let s = i;
|
|
299
|
-
for (let r = 0; r < n.length; ) {
|
|
300
|
-
if (!s || typeof s != "object")
|
|
301
|
-
return;
|
|
302
|
-
let o, a = "";
|
|
303
|
-
for (let u = r; u < n.length; ++u)
|
|
304
|
-
if (u !== r && (a += t), a += n[u], o = s[a], o !== void 0) {
|
|
305
|
-
if (["string", "number", "boolean"].indexOf(typeof o) > -1 && u < n.length - 1)
|
|
306
|
-
continue;
|
|
307
|
-
r += u - r + 1;
|
|
308
|
-
break;
|
|
309
|
-
}
|
|
310
|
-
s = o;
|
|
311
|
-
}
|
|
312
|
-
return s;
|
|
313
|
-
}, se = (i) => i == null ? void 0 : i.replace("_", "-"), Dt = {
|
|
314
|
-
type: "logger",
|
|
315
|
-
log(i) {
|
|
316
|
-
this.output("log", i);
|
|
317
|
-
},
|
|
318
|
-
warn(i) {
|
|
319
|
-
this.output("warn", i);
|
|
320
|
-
},
|
|
321
|
-
error(i) {
|
|
322
|
-
this.output("error", i);
|
|
323
|
-
},
|
|
324
|
-
output(i, e) {
|
|
325
|
-
var t, n;
|
|
326
|
-
(n = (t = console == null ? void 0 : console[i]) == null ? void 0 : t.apply) == null || n.call(t, console, e);
|
|
327
|
-
}
|
|
328
|
-
};
|
|
329
|
-
class re {
|
|
330
|
-
constructor(e) {
|
|
331
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
332
|
-
this.init(e, t);
|
|
333
|
-
}
|
|
334
|
-
init(e) {
|
|
335
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
336
|
-
this.prefix = t.prefix || "i18next:", this.logger = e || Dt, this.options = t, this.debug = t.debug;
|
|
337
|
-
}
|
|
338
|
-
log() {
|
|
339
|
-
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
340
|
-
t[n] = arguments[n];
|
|
341
|
-
return this.forward(t, "log", "", !0);
|
|
342
|
-
}
|
|
343
|
-
warn() {
|
|
344
|
-
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
345
|
-
t[n] = arguments[n];
|
|
346
|
-
return this.forward(t, "warn", "", !0);
|
|
347
|
-
}
|
|
348
|
-
error() {
|
|
349
|
-
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
350
|
-
t[n] = arguments[n];
|
|
351
|
-
return this.forward(t, "error", "");
|
|
352
|
-
}
|
|
353
|
-
deprecate() {
|
|
354
|
-
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
355
|
-
t[n] = arguments[n];
|
|
356
|
-
return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
|
|
357
|
-
}
|
|
358
|
-
forward(e, t, n, s) {
|
|
359
|
-
return s && !this.debug ? null : (y(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
360
|
-
}
|
|
361
|
-
create(e) {
|
|
362
|
-
return new re(this.logger, {
|
|
363
|
-
prefix: `${this.prefix}:${e}:`,
|
|
364
|
-
...this.options
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
clone(e) {
|
|
368
|
-
return e = e || this.options, e.prefix = e.prefix || this.prefix, new re(this.logger, e);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
var A = new re();
|
|
372
|
-
class ue {
|
|
373
|
-
constructor() {
|
|
374
|
-
this.observers = {};
|
|
375
|
-
}
|
|
376
|
-
on(e, t) {
|
|
377
|
-
return e.split(" ").forEach((n) => {
|
|
378
|
-
this.observers[n] || (this.observers[n] = /* @__PURE__ */ new Map());
|
|
379
|
-
const s = this.observers[n].get(t) || 0;
|
|
380
|
-
this.observers[n].set(t, s + 1);
|
|
381
|
-
}), this;
|
|
382
|
-
}
|
|
383
|
-
off(e, t) {
|
|
384
|
-
if (this.observers[e]) {
|
|
385
|
-
if (!t) {
|
|
386
|
-
delete this.observers[e];
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
this.observers[e].delete(t);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
emit(e) {
|
|
393
|
-
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
394
|
-
n[s - 1] = arguments[s];
|
|
395
|
-
this.observers[e] && Array.from(this.observers[e].entries()).forEach((o) => {
|
|
396
|
-
let [a, u] = o;
|
|
397
|
-
for (let l = 0; l < u; l++)
|
|
398
|
-
a(...n);
|
|
399
|
-
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((o) => {
|
|
400
|
-
let [a, u] = o;
|
|
401
|
-
for (let l = 0; l < u; l++)
|
|
402
|
-
a.apply(a, [e, ...n]);
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
class Ce extends ue {
|
|
407
|
-
constructor(e) {
|
|
408
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
409
|
-
ns: ["translation"],
|
|
410
|
-
defaultNS: "translation"
|
|
411
|
-
};
|
|
412
|
-
super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
|
|
413
|
-
}
|
|
414
|
-
addNamespaces(e) {
|
|
415
|
-
this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
|
|
416
|
-
}
|
|
417
|
-
removeNamespaces(e) {
|
|
418
|
-
const t = this.options.ns.indexOf(e);
|
|
419
|
-
t > -1 && this.options.ns.splice(t, 1);
|
|
420
|
-
}
|
|
421
|
-
getResource(e, t, n) {
|
|
422
|
-
var l, f;
|
|
423
|
-
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
424
|
-
const r = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, o = s.ignoreJSONStructure !== void 0 ? s.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
425
|
-
let a;
|
|
426
|
-
e.indexOf(".") > -1 ? a = e.split(".") : (a = [e, t], n && (Array.isArray(n) ? a.push(...n) : y(n) && r ? a.push(...n.split(r)) : a.push(n)));
|
|
427
|
-
const u = ie(this.data, a);
|
|
428
|
-
return !u && !t && !n && e.indexOf(".") > -1 && (e = a[0], t = a[1], n = a.slice(2).join(".")), u || !o || !y(n) ? u : ge((f = (l = this.data) == null ? void 0 : l[e]) == null ? void 0 : f[t], n, r);
|
|
429
|
-
}
|
|
430
|
-
addResource(e, t, n, s) {
|
|
431
|
-
let r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
432
|
-
silent: !1
|
|
433
|
-
};
|
|
434
|
-
const o = r.keySeparator !== void 0 ? r.keySeparator : this.options.keySeparator;
|
|
435
|
-
let a = [e, t];
|
|
436
|
-
n && (a = a.concat(o ? n.split(o) : n)), e.indexOf(".") > -1 && (a = e.split("."), s = t, t = a[1]), this.addNamespaces(t), Pe(this.data, a, s), r.silent || this.emit("added", e, t, n, s);
|
|
437
|
-
}
|
|
438
|
-
addResources(e, t, n) {
|
|
439
|
-
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
|
|
440
|
-
silent: !1
|
|
441
|
-
};
|
|
442
|
-
for (const r in n)
|
|
443
|
-
(y(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], {
|
|
444
|
-
silent: !0
|
|
445
|
-
});
|
|
446
|
-
s.silent || this.emit("added", e, t, n);
|
|
447
|
-
}
|
|
448
|
-
addResourceBundle(e, t, n, s, r) {
|
|
449
|
-
let o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
|
|
450
|
-
silent: !1,
|
|
451
|
-
skipCopy: !1
|
|
452
|
-
}, a = [e, t];
|
|
453
|
-
e.indexOf(".") > -1 && (a = e.split("."), s = n, n = t, t = a[1]), this.addNamespaces(t);
|
|
454
|
-
let u = ie(this.data, a) || {};
|
|
455
|
-
o.skipCopy || (n = JSON.parse(JSON.stringify(n))), s ? Qe(u, n, r) : u = {
|
|
456
|
-
...u,
|
|
457
|
-
...n
|
|
458
|
-
}, Pe(this.data, a, u), o.silent || this.emit("added", e, t, n);
|
|
459
|
-
}
|
|
460
|
-
removeResourceBundle(e, t) {
|
|
461
|
-
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
462
|
-
}
|
|
463
|
-
hasResourceBundle(e, t) {
|
|
464
|
-
return this.getResource(e, t) !== void 0;
|
|
465
|
-
}
|
|
466
|
-
getResourceBundle(e, t) {
|
|
467
|
-
return t || (t = this.options.defaultNS), this.getResource(e, t);
|
|
468
|
-
}
|
|
469
|
-
getDataByLanguage(e) {
|
|
470
|
-
return this.data[e];
|
|
471
|
-
}
|
|
472
|
-
hasLanguageSomeTranslations(e) {
|
|
473
|
-
const t = this.getDataByLanguage(e);
|
|
474
|
-
return !!(t && Object.keys(t) || []).find((s) => t[s] && Object.keys(t[s]).length > 0);
|
|
475
|
-
}
|
|
476
|
-
toJSON() {
|
|
477
|
-
return this.data;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
var Ge = {
|
|
481
|
-
processors: {},
|
|
482
|
-
addPostProcessor(i) {
|
|
483
|
-
this.processors[i.name] = i;
|
|
484
|
-
},
|
|
485
|
-
handle(i, e, t, n, s) {
|
|
486
|
-
return i.forEach((r) => {
|
|
487
|
-
var o;
|
|
488
|
-
e = ((o = this.processors[r]) == null ? void 0 : o.process(e, t, n, s)) ?? e;
|
|
489
|
-
}), e;
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
const ke = {}, $e = (i) => !y(i) && typeof i != "boolean" && typeof i != "number";
|
|
493
|
-
class oe extends ue {
|
|
494
|
-
constructor(e) {
|
|
495
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
496
|
-
super(), kt(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = A.create("translator");
|
|
497
|
-
}
|
|
498
|
-
changeLanguage(e) {
|
|
499
|
-
e && (this.language = e);
|
|
500
|
-
}
|
|
501
|
-
exists(e) {
|
|
502
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
503
|
-
interpolation: {}
|
|
504
|
-
};
|
|
505
|
-
if (e == null)
|
|
506
|
-
return !1;
|
|
507
|
-
const n = this.resolve(e, t);
|
|
508
|
-
return (n == null ? void 0 : n.res) !== void 0;
|
|
509
|
-
}
|
|
510
|
-
extractFromKey(e, t) {
|
|
511
|
-
let n = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
|
|
512
|
-
n === void 0 && (n = ":");
|
|
513
|
-
const s = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
514
|
-
let r = t.ns || this.options.defaultNS || [];
|
|
515
|
-
const o = n && e.indexOf(n) > -1, a = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Ft(e, n, s);
|
|
516
|
-
if (o && !a) {
|
|
517
|
-
const u = e.match(this.interpolator.nestingRegexp);
|
|
518
|
-
if (u && u.length > 0)
|
|
519
|
-
return {
|
|
520
|
-
key: e,
|
|
521
|
-
namespaces: y(r) ? [r] : r
|
|
522
|
-
};
|
|
523
|
-
const l = e.split(n);
|
|
524
|
-
(n !== s || n === s && this.options.ns.indexOf(l[0]) > -1) && (r = l.shift()), e = l.join(s);
|
|
525
|
-
}
|
|
526
|
-
return {
|
|
527
|
-
key: e,
|
|
528
|
-
namespaces: y(r) ? [r] : r
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
translate(e, t, n) {
|
|
532
|
-
if (typeof t != "object" && this.options.overloadTranslationOptionHandler && (t = this.options.overloadTranslationOptionHandler(arguments)), typeof t == "object" && (t = {
|
|
533
|
-
...t
|
|
534
|
-
}), t || (t = {}), e == null) return "";
|
|
535
|
-
Array.isArray(e) || (e = [String(e)]);
|
|
536
|
-
const s = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, r = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
|
|
537
|
-
key: o,
|
|
538
|
-
namespaces: a
|
|
539
|
-
} = this.extractFromKey(e[e.length - 1], t), u = a[a.length - 1], l = t.lng || this.language, f = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
540
|
-
if ((l == null ? void 0 : l.toLowerCase()) === "cimode") {
|
|
541
|
-
if (f) {
|
|
542
|
-
const x = t.nsSeparator || this.options.nsSeparator;
|
|
543
|
-
return s ? {
|
|
544
|
-
res: `${u}${x}${o}`,
|
|
545
|
-
usedKey: o,
|
|
546
|
-
exactUsedKey: o,
|
|
547
|
-
usedLng: l,
|
|
548
|
-
usedNS: u,
|
|
549
|
-
usedParams: this.getUsedParamsDetails(t)
|
|
550
|
-
} : `${u}${x}${o}`;
|
|
551
|
-
}
|
|
552
|
-
return s ? {
|
|
553
|
-
res: o,
|
|
554
|
-
usedKey: o,
|
|
555
|
-
exactUsedKey: o,
|
|
556
|
-
usedLng: l,
|
|
557
|
-
usedNS: u,
|
|
558
|
-
usedParams: this.getUsedParamsDetails(t)
|
|
559
|
-
} : o;
|
|
560
|
-
}
|
|
561
|
-
const d = this.resolve(e, t);
|
|
562
|
-
let c = d == null ? void 0 : d.res;
|
|
563
|
-
const h = (d == null ? void 0 : d.usedKey) || o, g = (d == null ? void 0 : d.exactUsedKey) || o, p = ["[object Number]", "[object Function]", "[object RegExp]"], m = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, S = !this.i18nFormat || this.i18nFormat.handleAsObject, w = t.count !== void 0 && !y(t.count), O = oe.hasDefaultValue(t), k = w ? this.pluralResolver.getSuffix(l, t.count, t) : "", N = t.ordinal && w ? this.pluralResolver.getSuffix(l, t.count, {
|
|
564
|
-
ordinal: !1
|
|
565
|
-
}) : "", T = w && !t.ordinal && t.count === 0, L = T && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${k}`] || t[`defaultValue${N}`] || t.defaultValue;
|
|
566
|
-
let v = c;
|
|
567
|
-
S && !c && O && (v = L);
|
|
568
|
-
const P = $e(v), C = Object.prototype.toString.apply(v);
|
|
569
|
-
if (S && v && P && p.indexOf(C) < 0 && !(y(m) && Array.isArray(v))) {
|
|
570
|
-
if (!t.returnObjects && !this.options.returnObjects) {
|
|
571
|
-
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
572
|
-
const x = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h, v, {
|
|
573
|
-
...t,
|
|
574
|
-
ns: a
|
|
575
|
-
}) : `key '${o} (${this.language})' returned an object instead of string.`;
|
|
576
|
-
return s ? (d.res = x, d.usedParams = this.getUsedParamsDetails(t), d) : x;
|
|
577
|
-
}
|
|
578
|
-
if (r) {
|
|
579
|
-
const x = Array.isArray(v), $ = x ? [] : {}, _ = x ? g : h;
|
|
580
|
-
for (const E in v)
|
|
581
|
-
if (Object.prototype.hasOwnProperty.call(v, E)) {
|
|
582
|
-
const j = `${_}${r}${E}`;
|
|
583
|
-
O && !c ? $[E] = this.translate(j, {
|
|
584
|
-
...t,
|
|
585
|
-
defaultValue: $e(L) ? L[E] : void 0,
|
|
586
|
-
joinArrays: !1,
|
|
587
|
-
ns: a
|
|
588
|
-
}) : $[E] = this.translate(j, {
|
|
589
|
-
...t,
|
|
590
|
-
joinArrays: !1,
|
|
591
|
-
ns: a
|
|
592
|
-
}), $[E] === j && ($[E] = v[E]);
|
|
593
|
-
}
|
|
594
|
-
c = $;
|
|
595
|
-
}
|
|
596
|
-
} else if (S && y(m) && Array.isArray(c))
|
|
597
|
-
c = c.join(m), c && (c = this.extendTranslation(c, e, t, n));
|
|
598
|
-
else {
|
|
599
|
-
let x = !1, $ = !1;
|
|
600
|
-
!this.isValidLookup(c) && O && (x = !0, c = L), this.isValidLookup(c) || ($ = !0, c = o);
|
|
601
|
-
const E = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && $ ? void 0 : c, j = O && L !== c && this.options.updateMissing;
|
|
602
|
-
if ($ || x || j) {
|
|
603
|
-
if (this.logger.log(j ? "updateKey" : "missingKey", l, u, o, j ? L : c), r) {
|
|
604
|
-
const R = this.resolve(o, {
|
|
605
|
-
...t,
|
|
606
|
-
keySeparator: !1
|
|
607
|
-
});
|
|
608
|
-
R && R.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.");
|
|
609
|
-
}
|
|
610
|
-
let D = [];
|
|
611
|
-
const K = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
|
|
612
|
-
if (this.options.saveMissingTo === "fallback" && K && K[0])
|
|
613
|
-
for (let R = 0; R < K.length; R++)
|
|
614
|
-
D.push(K[R]);
|
|
615
|
-
else this.options.saveMissingTo === "all" ? D = this.languageUtils.toResolveHierarchy(t.lng || this.language) : D.push(t.lng || this.language);
|
|
616
|
-
const b = (R, M, B) => {
|
|
617
|
-
var ve;
|
|
618
|
-
const be = O && B !== c ? B : E;
|
|
619
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(R, u, M, be, j, t) : (ve = this.backendConnector) != null && ve.saveMissing && this.backendConnector.saveMissing(R, u, M, be, j, t), this.emit("missingKey", R, u, M, c);
|
|
620
|
-
};
|
|
621
|
-
this.options.saveMissing && (this.options.saveMissingPlurals && w ? D.forEach((R) => {
|
|
622
|
-
const M = this.pluralResolver.getSuffixes(R, t);
|
|
623
|
-
T && t[`defaultValue${this.options.pluralSeparator}zero`] && M.indexOf(`${this.options.pluralSeparator}zero`) < 0 && M.push(`${this.options.pluralSeparator}zero`), M.forEach((B) => {
|
|
624
|
-
b([R], o + B, t[`defaultValue${B}`] || L);
|
|
625
|
-
});
|
|
626
|
-
}) : b(D, o, L));
|
|
627
|
-
}
|
|
628
|
-
c = this.extendTranslation(c, e, t, d, n), $ && c === o && this.options.appendNamespaceToMissingKey && (c = `${u}:${o}`), ($ || x) && this.options.parseMissingKeyHandler && (c = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}:${o}` : o, x ? c : void 0));
|
|
629
|
-
}
|
|
630
|
-
return s ? (d.res = c, d.usedParams = this.getUsedParamsDetails(t), d) : c;
|
|
631
|
-
}
|
|
632
|
-
extendTranslation(e, t, n, s, r) {
|
|
633
|
-
var l, f;
|
|
634
|
-
var o = this;
|
|
635
|
-
if ((l = this.i18nFormat) != null && l.parse)
|
|
636
|
-
e = this.i18nFormat.parse(e, {
|
|
637
|
-
...this.options.interpolation.defaultVariables,
|
|
638
|
-
...n
|
|
639
|
-
}, n.lng || this.language || s.usedLng, s.usedNS, s.usedKey, {
|
|
640
|
-
resolved: s
|
|
641
|
-
});
|
|
642
|
-
else if (!n.skipInterpolation) {
|
|
643
|
-
n.interpolation && this.interpolator.init({
|
|
644
|
-
...n,
|
|
645
|
-
interpolation: {
|
|
646
|
-
...this.options.interpolation,
|
|
647
|
-
...n.interpolation
|
|
648
|
-
}
|
|
649
|
-
});
|
|
650
|
-
const d = y(e) && (((f = n == null ? void 0 : n.interpolation) == null ? void 0 : f.skipOnVariables) !== void 0 ? n.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
651
|
-
let c;
|
|
652
|
-
if (d) {
|
|
653
|
-
const g = e.match(this.interpolator.nestingRegexp);
|
|
654
|
-
c = g && g.length;
|
|
655
|
-
}
|
|
656
|
-
let h = n.replace && !y(n.replace) ? n.replace : n;
|
|
657
|
-
if (this.options.interpolation.defaultVariables && (h = {
|
|
658
|
-
...this.options.interpolation.defaultVariables,
|
|
659
|
-
...h
|
|
660
|
-
}), e = this.interpolator.interpolate(e, h, n.lng || this.language || s.usedLng, n), d) {
|
|
661
|
-
const g = e.match(this.interpolator.nestingRegexp), p = g && g.length;
|
|
662
|
-
c < p && (n.nest = !1);
|
|
663
|
-
}
|
|
664
|
-
!n.lng && s && s.res && (n.lng = this.language || s.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, function() {
|
|
665
|
-
for (var g = arguments.length, p = new Array(g), m = 0; m < g; m++)
|
|
666
|
-
p[m] = arguments[m];
|
|
667
|
-
return (r == null ? void 0 : r[0]) === p[0] && !n.context ? (o.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`), null) : o.translate(...p, t);
|
|
668
|
-
}, n)), n.interpolation && this.interpolator.reset();
|
|
669
|
-
}
|
|
670
|
-
const a = n.postProcess || this.options.postProcess, u = y(a) ? [a] : a;
|
|
671
|
-
return e != null && (u != null && u.length) && n.applyPostProcessor !== !1 && (e = Ge.handle(u, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
672
|
-
i18nResolved: {
|
|
673
|
-
...s,
|
|
674
|
-
usedParams: this.getUsedParamsDetails(n)
|
|
675
|
-
},
|
|
676
|
-
...n
|
|
677
|
-
} : n, this)), e;
|
|
678
|
-
}
|
|
679
|
-
resolve(e) {
|
|
680
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n, s, r, o, a;
|
|
681
|
-
return y(e) && (e = [e]), e.forEach((u) => {
|
|
682
|
-
if (this.isValidLookup(n)) return;
|
|
683
|
-
const l = this.extractFromKey(u, t), f = l.key;
|
|
684
|
-
s = f;
|
|
685
|
-
let d = l.namespaces;
|
|
686
|
-
this.options.fallbackNS && (d = d.concat(this.options.fallbackNS));
|
|
687
|
-
const c = t.count !== void 0 && !y(t.count), h = c && !t.ordinal && t.count === 0, g = t.context !== void 0 && (y(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
688
|
-
d.forEach((m) => {
|
|
689
|
-
var S, w;
|
|
690
|
-
this.isValidLookup(n) || (a = m, !ke[`${p[0]}-${m}`] && ((S = this.utils) != null && S.hasLoadedNamespace) && !((w = this.utils) != null && w.hasLoadedNamespace(a)) && (ke[`${p[0]}-${m}`] = !0, this.logger.warn(`key "${s}" for languages "${p.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!!!")), p.forEach((O) => {
|
|
691
|
-
var T;
|
|
692
|
-
if (this.isValidLookup(n)) return;
|
|
693
|
-
o = O;
|
|
694
|
-
const k = [f];
|
|
695
|
-
if ((T = this.i18nFormat) != null && T.addLookupKeys)
|
|
696
|
-
this.i18nFormat.addLookupKeys(k, f, O, m, t);
|
|
697
|
-
else {
|
|
698
|
-
let L;
|
|
699
|
-
c && (L = this.pluralResolver.getSuffix(O, t.count, t));
|
|
700
|
-
const v = `${this.options.pluralSeparator}zero`, P = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
701
|
-
if (c && (k.push(f + L), t.ordinal && L.indexOf(P) === 0 && k.push(f + L.replace(P, this.options.pluralSeparator)), h && k.push(f + v)), g) {
|
|
702
|
-
const C = `${f}${this.options.contextSeparator}${t.context}`;
|
|
703
|
-
k.push(C), c && (k.push(C + L), t.ordinal && L.indexOf(P) === 0 && k.push(C + L.replace(P, this.options.pluralSeparator)), h && k.push(C + v));
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
let N;
|
|
707
|
-
for (; N = k.pop(); )
|
|
708
|
-
this.isValidLookup(n) || (r = N, n = this.getResource(O, m, N, t));
|
|
709
|
-
}));
|
|
710
|
-
});
|
|
711
|
-
}), {
|
|
712
|
-
res: n,
|
|
713
|
-
usedKey: s,
|
|
714
|
-
exactUsedKey: r,
|
|
715
|
-
usedLng: o,
|
|
716
|
-
usedNS: a
|
|
717
|
-
};
|
|
718
|
-
}
|
|
719
|
-
isValidLookup(e) {
|
|
720
|
-
return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
|
|
721
|
-
}
|
|
722
|
-
getResource(e, t, n) {
|
|
723
|
-
var r;
|
|
724
|
-
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
725
|
-
return (r = this.i18nFormat) != null && r.getResource ? this.i18nFormat.getResource(e, t, n, s) : this.resourceStore.getResource(e, t, n, s);
|
|
726
|
-
}
|
|
727
|
-
getUsedParamsDetails() {
|
|
728
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
729
|
-
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], n = e.replace && !y(e.replace);
|
|
730
|
-
let s = n ? e.replace : e;
|
|
731
|
-
if (n && typeof e.count < "u" && (s.count = e.count), this.options.interpolation.defaultVariables && (s = {
|
|
732
|
-
...this.options.interpolation.defaultVariables,
|
|
733
|
-
...s
|
|
734
|
-
}), !n) {
|
|
735
|
-
s = {
|
|
736
|
-
...s
|
|
737
|
-
};
|
|
738
|
-
for (const r of t)
|
|
739
|
-
delete s[r];
|
|
740
|
-
}
|
|
741
|
-
return s;
|
|
742
|
-
}
|
|
743
|
-
static hasDefaultValue(e) {
|
|
744
|
-
const t = "defaultValue";
|
|
745
|
-
for (const n in e)
|
|
746
|
-
if (Object.prototype.hasOwnProperty.call(e, n) && t === n.substring(0, t.length) && e[n] !== void 0)
|
|
747
|
-
return !0;
|
|
748
|
-
return !1;
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
class Re {
|
|
752
|
-
constructor(e) {
|
|
753
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = A.create("languageUtils");
|
|
754
|
-
}
|
|
755
|
-
getScriptPartFromCode(e) {
|
|
756
|
-
if (e = se(e), !e || e.indexOf("-") < 0) return null;
|
|
757
|
-
const t = e.split("-");
|
|
758
|
-
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
759
|
-
}
|
|
760
|
-
getLanguagePartFromCode(e) {
|
|
761
|
-
if (e = se(e), !e || e.indexOf("-") < 0) return e;
|
|
762
|
-
const t = e.split("-");
|
|
763
|
-
return this.formatLanguageCode(t[0]);
|
|
764
|
-
}
|
|
765
|
-
formatLanguageCode(e) {
|
|
766
|
-
if (y(e) && e.indexOf("-") > -1) {
|
|
767
|
-
let t;
|
|
768
|
-
try {
|
|
769
|
-
t = Intl.getCanonicalLocales(e)[0];
|
|
770
|
-
} catch {
|
|
771
|
-
}
|
|
772
|
-
return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
|
|
773
|
-
}
|
|
774
|
-
return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
|
|
775
|
-
}
|
|
776
|
-
isSupportedCode(e) {
|
|
777
|
-
return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
|
|
778
|
-
}
|
|
779
|
-
getBestMatchFromCodes(e) {
|
|
780
|
-
if (!e) return null;
|
|
781
|
-
let t;
|
|
782
|
-
return e.forEach((n) => {
|
|
783
|
-
if (t) return;
|
|
784
|
-
const s = this.formatLanguageCode(n);
|
|
785
|
-
(!this.options.supportedLngs || this.isSupportedCode(s)) && (t = s);
|
|
786
|
-
}), !t && this.options.supportedLngs && e.forEach((n) => {
|
|
787
|
-
if (t) return;
|
|
788
|
-
const s = this.getLanguagePartFromCode(n);
|
|
789
|
-
if (this.isSupportedCode(s)) return t = s;
|
|
790
|
-
t = this.options.supportedLngs.find((r) => {
|
|
791
|
-
if (r === s) return r;
|
|
792
|
-
if (!(r.indexOf("-") < 0 && s.indexOf("-") < 0) && (r.indexOf("-") > 0 && s.indexOf("-") < 0 && r.substring(0, r.indexOf("-")) === s || r.indexOf(s) === 0 && s.length > 1))
|
|
793
|
-
return r;
|
|
794
|
-
});
|
|
795
|
-
}), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
|
|
796
|
-
}
|
|
797
|
-
getFallbackCodes(e, t) {
|
|
798
|
-
if (!e) return [];
|
|
799
|
-
if (typeof e == "function" && (e = e(t)), y(e) && (e = [e]), Array.isArray(e)) return e;
|
|
800
|
-
if (!t) return e.default || [];
|
|
801
|
-
let n = e[t];
|
|
802
|
-
return n || (n = e[this.getScriptPartFromCode(t)]), n || (n = e[this.formatLanguageCode(t)]), n || (n = e[this.getLanguagePartFromCode(t)]), n || (n = e.default), n || [];
|
|
803
|
-
}
|
|
804
|
-
toResolveHierarchy(e, t) {
|
|
805
|
-
const n = this.getFallbackCodes(t || this.options.fallbackLng || [], e), s = [], r = (o) => {
|
|
806
|
-
o && (this.isSupportedCode(o) ? s.push(o) : this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`));
|
|
807
|
-
};
|
|
808
|
-
return y(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))) : y(e) && r(this.formatLanguageCode(e)), n.forEach((o) => {
|
|
809
|
-
s.indexOf(o) < 0 && r(this.formatLanguageCode(o));
|
|
810
|
-
}), s;
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
const Ee = {
|
|
814
|
-
zero: 0,
|
|
815
|
-
one: 1,
|
|
816
|
-
two: 2,
|
|
817
|
-
few: 3,
|
|
818
|
-
many: 4,
|
|
819
|
-
other: 5
|
|
820
|
-
}, je = {
|
|
821
|
-
select: (i) => i === 1 ? "one" : "other",
|
|
822
|
-
resolvedOptions: () => ({
|
|
823
|
-
pluralCategories: ["one", "other"]
|
|
824
|
-
})
|
|
825
|
-
};
|
|
826
|
-
class Mt {
|
|
827
|
-
constructor(e) {
|
|
828
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
829
|
-
this.languageUtils = e, this.options = t, this.logger = A.create("pluralResolver"), this.pluralRulesCache = {};
|
|
830
|
-
}
|
|
831
|
-
addRule(e, t) {
|
|
832
|
-
this.rules[e] = t;
|
|
833
|
-
}
|
|
834
|
-
clearCache() {
|
|
835
|
-
this.pluralRulesCache = {};
|
|
836
|
-
}
|
|
837
|
-
getRule(e) {
|
|
838
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
839
|
-
const n = se(e === "dev" ? "en" : e), s = t.ordinal ? "ordinal" : "cardinal", r = JSON.stringify({
|
|
840
|
-
cleanedCode: n,
|
|
841
|
-
type: s
|
|
842
|
-
});
|
|
843
|
-
if (r in this.pluralRulesCache)
|
|
844
|
-
return this.pluralRulesCache[r];
|
|
845
|
-
let o;
|
|
846
|
-
try {
|
|
847
|
-
o = new Intl.PluralRules(n, {
|
|
848
|
-
type: s
|
|
849
|
-
});
|
|
850
|
-
} catch {
|
|
851
|
-
if (!Intl)
|
|
852
|
-
return this.logger.error("No Intl support, please use an Intl polyfill!"), je;
|
|
853
|
-
if (!e.match(/-|_/)) return je;
|
|
854
|
-
const u = this.languageUtils.getLanguagePartFromCode(e);
|
|
855
|
-
o = this.getRule(u, t);
|
|
856
|
-
}
|
|
857
|
-
return this.pluralRulesCache[r] = o, o;
|
|
858
|
-
}
|
|
859
|
-
needsPlural(e) {
|
|
860
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = this.getRule(e, t);
|
|
861
|
-
return n || (n = this.getRule("dev", t)), (n == null ? void 0 : n.resolvedOptions().pluralCategories.length) > 1;
|
|
862
|
-
}
|
|
863
|
-
getPluralFormsOfKey(e, t) {
|
|
864
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
865
|
-
return this.getSuffixes(e, n).map((s) => `${t}${s}`);
|
|
866
|
-
}
|
|
867
|
-
getSuffixes(e) {
|
|
868
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = this.getRule(e, t);
|
|
869
|
-
return n || (n = this.getRule("dev", t)), n ? n.resolvedOptions().pluralCategories.sort((s, r) => Ee[s] - Ee[r]).map((s) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${s}`) : [];
|
|
870
|
-
}
|
|
871
|
-
getSuffix(e, t) {
|
|
872
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
873
|
-
const s = this.getRule(e, n);
|
|
874
|
-
return s ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${s.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
const Ne = function(i, e, t) {
|
|
878
|
-
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, r = Et(i, e, t);
|
|
879
|
-
return !r && s && y(t) && (r = ge(i, t, n), r === void 0 && (r = ge(e, t, n))), r;
|
|
880
|
-
}, le = (i) => i.replace(/\$/g, "$$$$");
|
|
881
|
-
class Ht {
|
|
882
|
-
constructor() {
|
|
883
|
-
var t;
|
|
884
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
885
|
-
this.logger = A.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((n) => n), this.init(e);
|
|
886
|
-
}
|
|
887
|
-
init() {
|
|
888
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
889
|
-
e.interpolation || (e.interpolation = {
|
|
890
|
-
escapeValue: !0
|
|
891
|
-
});
|
|
892
|
-
const {
|
|
893
|
-
escape: t,
|
|
894
|
-
escapeValue: n,
|
|
895
|
-
useRawValueToEscape: s,
|
|
896
|
-
prefix: r,
|
|
897
|
-
prefixEscaped: o,
|
|
898
|
-
suffix: a,
|
|
899
|
-
suffixEscaped: u,
|
|
900
|
-
formatSeparator: l,
|
|
901
|
-
unescapeSuffix: f,
|
|
902
|
-
unescapePrefix: d,
|
|
903
|
-
nestingPrefix: c,
|
|
904
|
-
nestingPrefixEscaped: h,
|
|
905
|
-
nestingSuffix: g,
|
|
906
|
-
nestingSuffixEscaped: p,
|
|
907
|
-
nestingOptionsSeparator: m,
|
|
908
|
-
maxReplaces: S,
|
|
909
|
-
alwaysFormat: w
|
|
910
|
-
} = e.interpolation;
|
|
911
|
-
this.escape = t !== void 0 ? t : Nt, this.escapeValue = n !== void 0 ? n : !0, this.useRawValueToEscape = s !== void 0 ? s : !1, this.prefix = r ? V(r) : o || "{{", this.suffix = a ? V(a) : u || "}}", this.formatSeparator = l || ",", this.unescapePrefix = f ? "" : d || "-", this.unescapeSuffix = this.unescapePrefix ? "" : f || "", this.nestingPrefix = c ? V(c) : h || V("$t("), this.nestingSuffix = g ? V(g) : p || V(")"), this.nestingOptionsSeparator = m || ",", this.maxReplaces = S || 1e3, this.alwaysFormat = w !== void 0 ? w : !1, this.resetRegExp();
|
|
912
|
-
}
|
|
913
|
-
reset() {
|
|
914
|
-
this.options && this.init(this.options);
|
|
915
|
-
}
|
|
916
|
-
resetRegExp() {
|
|
917
|
-
const e = (t, n) => (t == null ? void 0 : t.source) === n ? (t.lastIndex = 0, t) : new RegExp(n, "g");
|
|
918
|
-
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}`);
|
|
919
|
-
}
|
|
920
|
-
interpolate(e, t, n, s) {
|
|
921
|
-
var h;
|
|
922
|
-
let r, o, a;
|
|
923
|
-
const u = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, l = (g) => {
|
|
924
|
-
if (g.indexOf(this.formatSeparator) < 0) {
|
|
925
|
-
const w = Ne(t, u, g, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
926
|
-
return this.alwaysFormat ? this.format(w, void 0, n, {
|
|
927
|
-
...s,
|
|
928
|
-
...t,
|
|
929
|
-
interpolationkey: g
|
|
930
|
-
}) : w;
|
|
931
|
-
}
|
|
932
|
-
const p = g.split(this.formatSeparator), m = p.shift().trim(), S = p.join(this.formatSeparator).trim();
|
|
933
|
-
return this.format(Ne(t, u, m, this.options.keySeparator, this.options.ignoreJSONStructure), S, n, {
|
|
934
|
-
...s,
|
|
935
|
-
...t,
|
|
936
|
-
interpolationkey: m
|
|
937
|
-
});
|
|
938
|
-
};
|
|
939
|
-
this.resetRegExp();
|
|
940
|
-
const f = (s == null ? void 0 : s.missingInterpolationHandler) || this.options.missingInterpolationHandler, d = ((h = s == null ? void 0 : s.interpolation) == null ? void 0 : h.skipOnVariables) !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
941
|
-
return [{
|
|
942
|
-
regex: this.regexpUnescape,
|
|
943
|
-
safeValue: (g) => le(g)
|
|
944
|
-
}, {
|
|
945
|
-
regex: this.regexp,
|
|
946
|
-
safeValue: (g) => this.escapeValue ? le(this.escape(g)) : le(g)
|
|
947
|
-
}].forEach((g) => {
|
|
948
|
-
for (a = 0; r = g.regex.exec(e); ) {
|
|
949
|
-
const p = r[1].trim();
|
|
950
|
-
if (o = l(p), o === void 0)
|
|
951
|
-
if (typeof f == "function") {
|
|
952
|
-
const S = f(e, r, s);
|
|
953
|
-
o = y(S) ? S : "";
|
|
954
|
-
} else if (s && Object.prototype.hasOwnProperty.call(s, p))
|
|
955
|
-
o = "";
|
|
956
|
-
else if (d) {
|
|
957
|
-
o = r[0];
|
|
958
|
-
continue;
|
|
959
|
-
} else
|
|
960
|
-
this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`), o = "";
|
|
961
|
-
else !y(o) && !this.useRawValueToEscape && (o = Oe(o));
|
|
962
|
-
const m = g.safeValue(o);
|
|
963
|
-
if (e = e.replace(r[0], m), d ? (g.regex.lastIndex += o.length, g.regex.lastIndex -= r[0].length) : g.regex.lastIndex = 0, a++, a >= this.maxReplaces)
|
|
964
|
-
break;
|
|
965
|
-
}
|
|
966
|
-
}), e;
|
|
967
|
-
}
|
|
968
|
-
nest(e, t) {
|
|
969
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s, r, o;
|
|
970
|
-
const a = (u, l) => {
|
|
971
|
-
const f = this.nestingOptionsSeparator;
|
|
972
|
-
if (u.indexOf(f) < 0) return u;
|
|
973
|
-
const d = u.split(new RegExp(`${f}[ ]*{`));
|
|
974
|
-
let c = `{${d[1]}`;
|
|
975
|
-
u = d[0], c = this.interpolate(c, o);
|
|
976
|
-
const h = c.match(/'/g), g = c.match(/"/g);
|
|
977
|
-
(((h == null ? void 0 : h.length) ?? 0) % 2 === 0 && !g || g.length % 2 !== 0) && (c = c.replace(/'/g, '"'));
|
|
978
|
-
try {
|
|
979
|
-
o = JSON.parse(c), l && (o = {
|
|
980
|
-
...l,
|
|
981
|
-
...o
|
|
982
|
-
});
|
|
983
|
-
} catch (p) {
|
|
984
|
-
return this.logger.warn(`failed parsing options string in nesting for key ${u}`, p), `${u}${f}${c}`;
|
|
985
|
-
}
|
|
986
|
-
return o.defaultValue && o.defaultValue.indexOf(this.prefix) > -1 && delete o.defaultValue, u;
|
|
987
|
-
};
|
|
988
|
-
for (; s = this.nestingRegexp.exec(e); ) {
|
|
989
|
-
let u = [];
|
|
990
|
-
o = {
|
|
991
|
-
...n
|
|
992
|
-
}, o = o.replace && !y(o.replace) ? o.replace : o, o.applyPostProcessor = !1, delete o.defaultValue;
|
|
993
|
-
let l = !1;
|
|
994
|
-
if (s[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(s[1])) {
|
|
995
|
-
const f = s[1].split(this.formatSeparator).map((d) => d.trim());
|
|
996
|
-
s[1] = f.shift(), u = f, l = !0;
|
|
997
|
-
}
|
|
998
|
-
if (r = t(a.call(this, s[1].trim(), o), o), r && s[0] === e && !y(r)) return r;
|
|
999
|
-
y(r) || (r = Oe(r)), r || (this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`), r = ""), l && (r = u.reduce((f, d) => this.format(f, d, n.lng, {
|
|
1000
|
-
...n,
|
|
1001
|
-
interpolationkey: s[1].trim()
|
|
1002
|
-
}), r.trim())), e = e.replace(s[0], r), this.regexp.lastIndex = 0;
|
|
1003
|
-
}
|
|
1004
|
-
return e;
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
const Ut = (i) => {
|
|
1008
|
-
let e = i.toLowerCase().trim();
|
|
1009
|
-
const t = {};
|
|
1010
|
-
if (i.indexOf("(") > -1) {
|
|
1011
|
-
const n = i.split("(");
|
|
1012
|
-
e = n[0].toLowerCase().trim();
|
|
1013
|
-
const s = n[1].substring(0, n[1].length - 1);
|
|
1014
|
-
e === "currency" && s.indexOf(":") < 0 ? t.currency || (t.currency = s.trim()) : e === "relativetime" && s.indexOf(":") < 0 ? t.range || (t.range = s.trim()) : s.split(";").forEach((o) => {
|
|
1015
|
-
if (o) {
|
|
1016
|
-
const [a, ...u] = o.split(":"), l = u.join(":").trim().replace(/^'+|'+$/g, ""), f = a.trim();
|
|
1017
|
-
t[f] || (t[f] = l), l === "false" && (t[f] = !1), l === "true" && (t[f] = !0), isNaN(l) || (t[f] = parseInt(l, 10));
|
|
1018
|
-
}
|
|
1019
|
-
});
|
|
1020
|
-
}
|
|
1021
|
-
return {
|
|
1022
|
-
formatName: e,
|
|
1023
|
-
formatOptions: t
|
|
1024
|
-
};
|
|
1025
|
-
}, q = (i) => {
|
|
1026
|
-
const e = {};
|
|
1027
|
-
return (t, n, s) => {
|
|
1028
|
-
let r = s;
|
|
1029
|
-
s && s.interpolationkey && s.formatParams && s.formatParams[s.interpolationkey] && s[s.interpolationkey] && (r = {
|
|
1030
|
-
...r,
|
|
1031
|
-
[s.interpolationkey]: void 0
|
|
1032
|
-
});
|
|
1033
|
-
const o = n + JSON.stringify(r);
|
|
1034
|
-
let a = e[o];
|
|
1035
|
-
return a || (a = i(se(n), s), e[o] = a), a(t);
|
|
1036
|
-
};
|
|
1037
|
-
};
|
|
1038
|
-
class Kt {
|
|
1039
|
-
constructor() {
|
|
1040
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1041
|
-
this.logger = A.create("formatter"), this.options = e, this.formats = {
|
|
1042
|
-
number: q((t, n) => {
|
|
1043
|
-
const s = new Intl.NumberFormat(t, {
|
|
1044
|
-
...n
|
|
1045
|
-
});
|
|
1046
|
-
return (r) => s.format(r);
|
|
1047
|
-
}),
|
|
1048
|
-
currency: q((t, n) => {
|
|
1049
|
-
const s = new Intl.NumberFormat(t, {
|
|
1050
|
-
...n,
|
|
1051
|
-
style: "currency"
|
|
1052
|
-
});
|
|
1053
|
-
return (r) => s.format(r);
|
|
1054
|
-
}),
|
|
1055
|
-
datetime: q((t, n) => {
|
|
1056
|
-
const s = new Intl.DateTimeFormat(t, {
|
|
1057
|
-
...n
|
|
1058
|
-
});
|
|
1059
|
-
return (r) => s.format(r);
|
|
1060
|
-
}),
|
|
1061
|
-
relativetime: q((t, n) => {
|
|
1062
|
-
const s = new Intl.RelativeTimeFormat(t, {
|
|
1063
|
-
...n
|
|
1064
|
-
});
|
|
1065
|
-
return (r) => s.format(r, n.range || "day");
|
|
1066
|
-
}),
|
|
1067
|
-
list: q((t, n) => {
|
|
1068
|
-
const s = new Intl.ListFormat(t, {
|
|
1069
|
-
...n
|
|
1070
|
-
});
|
|
1071
|
-
return (r) => s.format(r);
|
|
1072
|
-
})
|
|
1073
|
-
}, this.init(e);
|
|
1074
|
-
}
|
|
1075
|
-
init(e) {
|
|
1076
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
1077
|
-
interpolation: {}
|
|
1078
|
-
};
|
|
1079
|
-
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
1080
|
-
}
|
|
1081
|
-
add(e, t) {
|
|
1082
|
-
this.formats[e.toLowerCase().trim()] = t;
|
|
1083
|
-
}
|
|
1084
|
-
addCached(e, t) {
|
|
1085
|
-
this.formats[e.toLowerCase().trim()] = q(t);
|
|
1086
|
-
}
|
|
1087
|
-
format(e, t, n) {
|
|
1088
|
-
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
1089
|
-
const r = t.split(this.formatSeparator);
|
|
1090
|
-
if (r.length > 1 && r[0].indexOf("(") > 1 && r[0].indexOf(")") < 0 && r.find((a) => a.indexOf(")") > -1)) {
|
|
1091
|
-
const a = r.findIndex((u) => u.indexOf(")") > -1);
|
|
1092
|
-
r[0] = [r[0], ...r.splice(1, a)].join(this.formatSeparator);
|
|
1093
|
-
}
|
|
1094
|
-
return r.reduce((a, u) => {
|
|
1095
|
-
var d;
|
|
1096
|
-
const {
|
|
1097
|
-
formatName: l,
|
|
1098
|
-
formatOptions: f
|
|
1099
|
-
} = Ut(u);
|
|
1100
|
-
if (this.formats[l]) {
|
|
1101
|
-
let c = a;
|
|
1102
|
-
try {
|
|
1103
|
-
const h = ((d = s == null ? void 0 : s.formatParams) == null ? void 0 : d[s.interpolationkey]) || {}, g = h.locale || h.lng || s.locale || s.lng || n;
|
|
1104
|
-
c = this.formats[l](a, g, {
|
|
1105
|
-
...f,
|
|
1106
|
-
...s,
|
|
1107
|
-
...h
|
|
1108
|
-
});
|
|
1109
|
-
} catch (h) {
|
|
1110
|
-
this.logger.warn(h);
|
|
1111
|
-
}
|
|
1112
|
-
return c;
|
|
1113
|
-
} else
|
|
1114
|
-
this.logger.warn(`there was no format function for ${l}`);
|
|
1115
|
-
return a;
|
|
1116
|
-
}, e);
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
const Vt = (i, e) => {
|
|
1120
|
-
i.pending[e] !== void 0 && (delete i.pending[e], i.pendingCount--);
|
|
1121
|
-
};
|
|
1122
|
-
class qt extends ue {
|
|
1123
|
-
constructor(e, t, n) {
|
|
1124
|
-
var r, o;
|
|
1125
|
-
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
1126
|
-
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = s, this.logger = A.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = s.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = s.maxRetries >= 0 ? s.maxRetries : 5, this.retryTimeout = s.retryTimeout >= 1 ? s.retryTimeout : 350, this.state = {}, this.queue = [], (o = (r = this.backend) == null ? void 0 : r.init) == null || o.call(r, n, s.backend, s);
|
|
1127
|
-
}
|
|
1128
|
-
queueLoad(e, t, n, s) {
|
|
1129
|
-
const r = {}, o = {}, a = {}, u = {};
|
|
1130
|
-
return e.forEach((l) => {
|
|
1131
|
-
let f = !0;
|
|
1132
|
-
t.forEach((d) => {
|
|
1133
|
-
const c = `${l}|${d}`;
|
|
1134
|
-
!n.reload && this.store.hasResourceBundle(l, d) ? this.state[c] = 2 : this.state[c] < 0 || (this.state[c] === 1 ? o[c] === void 0 && (o[c] = !0) : (this.state[c] = 1, f = !1, o[c] === void 0 && (o[c] = !0), r[c] === void 0 && (r[c] = !0), u[d] === void 0 && (u[d] = !0)));
|
|
1135
|
-
}), f || (a[l] = !0);
|
|
1136
|
-
}), (Object.keys(r).length || Object.keys(o).length) && this.queue.push({
|
|
1137
|
-
pending: o,
|
|
1138
|
-
pendingCount: Object.keys(o).length,
|
|
1139
|
-
loaded: {},
|
|
1140
|
-
errors: [],
|
|
1141
|
-
callback: s
|
|
1142
|
-
}), {
|
|
1143
|
-
toLoad: Object.keys(r),
|
|
1144
|
-
pending: Object.keys(o),
|
|
1145
|
-
toLoadLanguages: Object.keys(a),
|
|
1146
|
-
toLoadNamespaces: Object.keys(u)
|
|
1147
|
-
};
|
|
1148
|
-
}
|
|
1149
|
-
loaded(e, t, n) {
|
|
1150
|
-
const s = e.split("|"), r = s[0], o = s[1];
|
|
1151
|
-
t && this.emit("failedLoading", r, o, t), !t && n && this.store.addResourceBundle(r, o, n, void 0, void 0, {
|
|
1152
|
-
skipCopy: !0
|
|
1153
|
-
}), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
|
|
1154
|
-
const a = {};
|
|
1155
|
-
this.queue.forEach((u) => {
|
|
1156
|
-
Rt(u.loaded, [r], o), Vt(u, e), t && u.errors.push(t), u.pendingCount === 0 && !u.done && (Object.keys(u.loaded).forEach((l) => {
|
|
1157
|
-
a[l] || (a[l] = {});
|
|
1158
|
-
const f = u.loaded[l];
|
|
1159
|
-
f.length && f.forEach((d) => {
|
|
1160
|
-
a[l][d] === void 0 && (a[l][d] = !0);
|
|
1161
|
-
});
|
|
1162
|
-
}), u.done = !0, u.errors.length ? u.callback(u.errors) : u.callback());
|
|
1163
|
-
}), this.emit("loaded", a), this.queue = this.queue.filter((u) => !u.done);
|
|
1164
|
-
}
|
|
1165
|
-
read(e, t, n) {
|
|
1166
|
-
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, o = arguments.length > 5 ? arguments[5] : void 0;
|
|
1167
|
-
if (!e.length) return o(null, {});
|
|
1168
|
-
if (this.readingCalls >= this.maxParallelReads) {
|
|
1169
|
-
this.waitingReads.push({
|
|
1170
|
-
lng: e,
|
|
1171
|
-
ns: t,
|
|
1172
|
-
fcName: n,
|
|
1173
|
-
tried: s,
|
|
1174
|
-
wait: r,
|
|
1175
|
-
callback: o
|
|
1176
|
-
});
|
|
1177
|
-
return;
|
|
1178
|
-
}
|
|
1179
|
-
this.readingCalls++;
|
|
1180
|
-
const a = (l, f) => {
|
|
1181
|
-
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
1182
|
-
const d = this.waitingReads.shift();
|
|
1183
|
-
this.read(d.lng, d.ns, d.fcName, d.tried, d.wait, d.callback);
|
|
1184
|
-
}
|
|
1185
|
-
if (l && f && s < this.maxRetries) {
|
|
1186
|
-
setTimeout(() => {
|
|
1187
|
-
this.read.call(this, e, t, n, s + 1, r * 2, o);
|
|
1188
|
-
}, r);
|
|
1189
|
-
return;
|
|
1190
|
-
}
|
|
1191
|
-
o(l, f);
|
|
1192
|
-
}, u = this.backend[n].bind(this.backend);
|
|
1193
|
-
if (u.length === 2) {
|
|
1194
|
-
try {
|
|
1195
|
-
const l = u(e, t);
|
|
1196
|
-
l && typeof l.then == "function" ? l.then((f) => a(null, f)).catch(a) : a(null, l);
|
|
1197
|
-
} catch (l) {
|
|
1198
|
-
a(l);
|
|
1199
|
-
}
|
|
1200
|
-
return;
|
|
1201
|
-
}
|
|
1202
|
-
return u(e, t, a);
|
|
1203
|
-
}
|
|
1204
|
-
prepareLoading(e, t) {
|
|
1205
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s = arguments.length > 3 ? arguments[3] : void 0;
|
|
1206
|
-
if (!this.backend)
|
|
1207
|
-
return this.logger.warn("No backend was added via i18next.use. Will not load resources."), s && s();
|
|
1208
|
-
y(e) && (e = this.languageUtils.toResolveHierarchy(e)), y(t) && (t = [t]);
|
|
1209
|
-
const r = this.queueLoad(e, t, n, s);
|
|
1210
|
-
if (!r.toLoad.length)
|
|
1211
|
-
return r.pending.length || s(), null;
|
|
1212
|
-
r.toLoad.forEach((o) => {
|
|
1213
|
-
this.loadOne(o);
|
|
1214
|
-
});
|
|
1215
|
-
}
|
|
1216
|
-
load(e, t, n) {
|
|
1217
|
-
this.prepareLoading(e, t, {}, n);
|
|
1218
|
-
}
|
|
1219
|
-
reload(e, t, n) {
|
|
1220
|
-
this.prepareLoading(e, t, {
|
|
1221
|
-
reload: !0
|
|
1222
|
-
}, n);
|
|
1223
|
-
}
|
|
1224
|
-
loadOne(e) {
|
|
1225
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
1226
|
-
const n = e.split("|"), s = n[0], r = n[1];
|
|
1227
|
-
this.read(s, r, "read", void 0, void 0, (o, a) => {
|
|
1228
|
-
o && this.logger.warn(`${t}loading namespace ${r} for language ${s} failed`, o), !o && a && this.logger.log(`${t}loaded namespace ${r} for language ${s}`, a), this.loaded(e, o, a);
|
|
1229
|
-
});
|
|
1230
|
-
}
|
|
1231
|
-
saveMissing(e, t, n, s, r) {
|
|
1232
|
-
var u, l, f, d, c;
|
|
1233
|
-
let o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, a = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
|
|
1234
|
-
};
|
|
1235
|
-
if ((l = (u = this.services) == null ? void 0 : u.utils) != null && l.hasLoadedNamespace && !((d = (f = this.services) == null ? void 0 : f.utils) != null && d.hasLoadedNamespace(t))) {
|
|
1236
|
-
this.logger.warn(`did not save key "${n}" 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!!!");
|
|
1237
|
-
return;
|
|
1238
|
-
}
|
|
1239
|
-
if (!(n == null || n === "")) {
|
|
1240
|
-
if ((c = this.backend) != null && c.create) {
|
|
1241
|
-
const h = {
|
|
1242
|
-
...o,
|
|
1243
|
-
isUpdate: r
|
|
1244
|
-
}, g = this.backend.create.bind(this.backend);
|
|
1245
|
-
if (g.length < 6)
|
|
1246
|
-
try {
|
|
1247
|
-
let p;
|
|
1248
|
-
g.length === 5 ? p = g(e, t, n, s, h) : p = g(e, t, n, s), p && typeof p.then == "function" ? p.then((m) => a(null, m)).catch(a) : a(null, p);
|
|
1249
|
-
} catch (p) {
|
|
1250
|
-
a(p);
|
|
1251
|
-
}
|
|
1252
|
-
else
|
|
1253
|
-
g(e, t, n, s, a, h);
|
|
1254
|
-
}
|
|
1255
|
-
!e || !e[0] || this.store.addResource(e[0], t, n, s);
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
const Te = () => ({
|
|
1260
|
-
debug: !1,
|
|
1261
|
-
initAsync: !0,
|
|
1262
|
-
ns: ["translation"],
|
|
1263
|
-
defaultNS: ["translation"],
|
|
1264
|
-
fallbackLng: ["dev"],
|
|
1265
|
-
fallbackNS: !1,
|
|
1266
|
-
supportedLngs: !1,
|
|
1267
|
-
nonExplicitSupportedLngs: !1,
|
|
1268
|
-
load: "all",
|
|
1269
|
-
preload: !1,
|
|
1270
|
-
simplifyPluralSuffix: !0,
|
|
1271
|
-
keySeparator: ".",
|
|
1272
|
-
nsSeparator: ":",
|
|
1273
|
-
pluralSeparator: "_",
|
|
1274
|
-
contextSeparator: "_",
|
|
1275
|
-
partialBundledLanguages: !1,
|
|
1276
|
-
saveMissing: !1,
|
|
1277
|
-
updateMissing: !1,
|
|
1278
|
-
saveMissingTo: "fallback",
|
|
1279
|
-
saveMissingPlurals: !0,
|
|
1280
|
-
missingKeyHandler: !1,
|
|
1281
|
-
missingInterpolationHandler: !1,
|
|
1282
|
-
postProcess: !1,
|
|
1283
|
-
postProcessPassResolved: !1,
|
|
1284
|
-
returnNull: !1,
|
|
1285
|
-
returnEmptyString: !0,
|
|
1286
|
-
returnObjects: !1,
|
|
1287
|
-
joinArrays: !1,
|
|
1288
|
-
returnedObjectHandler: !1,
|
|
1289
|
-
parseMissingKeyHandler: !1,
|
|
1290
|
-
appendNamespaceToMissingKey: !1,
|
|
1291
|
-
appendNamespaceToCIMode: !1,
|
|
1292
|
-
overloadTranslationOptionHandler: (i) => {
|
|
1293
|
-
let e = {};
|
|
1294
|
-
if (typeof i[1] == "object" && (e = i[1]), y(i[1]) && (e.defaultValue = i[1]), y(i[2]) && (e.tDescription = i[2]), typeof i[2] == "object" || typeof i[3] == "object") {
|
|
1295
|
-
const t = i[3] || i[2];
|
|
1296
|
-
Object.keys(t).forEach((n) => {
|
|
1297
|
-
e[n] = t[n];
|
|
1298
|
-
});
|
|
1299
|
-
}
|
|
1300
|
-
return e;
|
|
1301
|
-
},
|
|
1302
|
-
interpolation: {
|
|
1303
|
-
escapeValue: !0,
|
|
1304
|
-
format: (i) => i,
|
|
1305
|
-
prefix: "{{",
|
|
1306
|
-
suffix: "}}",
|
|
1307
|
-
formatSeparator: ",",
|
|
1308
|
-
unescapePrefix: "-",
|
|
1309
|
-
nestingPrefix: "$t(",
|
|
1310
|
-
nestingSuffix: ")",
|
|
1311
|
-
nestingOptionsSeparator: ",",
|
|
1312
|
-
maxReplaces: 1e3,
|
|
1313
|
-
skipOnVariables: !0
|
|
1314
|
-
}
|
|
1315
|
-
}), Ae = (i) => {
|
|
1316
|
-
var e, t;
|
|
1317
|
-
return y(i.ns) && (i.ns = [i.ns]), y(i.fallbackLng) && (i.fallbackLng = [i.fallbackLng]), y(i.fallbackNS) && (i.fallbackNS = [i.fallbackNS]), ((t = (e = i.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (i.supportedLngs = i.supportedLngs.concat(["cimode"])), typeof i.initImmediate == "boolean" && (i.initAsync = i.initImmediate), i;
|
|
1318
|
-
}, te = () => {
|
|
1319
|
-
}, zt = (i) => {
|
|
1320
|
-
Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t) => {
|
|
1321
|
-
typeof i[t] == "function" && (i[t] = i[t].bind(i));
|
|
1322
|
-
});
|
|
1323
|
-
};
|
|
1324
|
-
class G extends ue {
|
|
1325
|
-
constructor() {
|
|
1326
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
1327
|
-
if (super(), this.options = Ae(e), this.services = {}, this.logger = A, this.modules = {
|
|
1328
|
-
external: []
|
|
1329
|
-
}, zt(this), t && !this.isInitialized && !e.isClone) {
|
|
1330
|
-
if (!this.options.initAsync)
|
|
1331
|
-
return this.init(e, t), this;
|
|
1332
|
-
setTimeout(() => {
|
|
1333
|
-
this.init(e, t);
|
|
1334
|
-
}, 0);
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
init() {
|
|
1338
|
-
var e = this;
|
|
1339
|
-
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0;
|
|
1340
|
-
this.isInitializing = !0, typeof t == "function" && (n = t, t = {}), t.defaultNS == null && t.ns && (y(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
|
|
1341
|
-
const s = Te();
|
|
1342
|
-
this.options = {
|
|
1343
|
-
...s,
|
|
1344
|
-
...this.options,
|
|
1345
|
-
...Ae(t)
|
|
1346
|
-
}, this.options.interpolation = {
|
|
1347
|
-
...s.interpolation,
|
|
1348
|
-
...this.options.interpolation
|
|
1349
|
-
}, t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
|
|
1350
|
-
const r = (f) => f ? typeof f == "function" ? new f() : f : null;
|
|
1351
|
-
if (!this.options.isClone) {
|
|
1352
|
-
this.modules.logger ? A.init(r(this.modules.logger), this.options) : A.init(null, this.options);
|
|
1353
|
-
let f;
|
|
1354
|
-
this.modules.formatter ? f = this.modules.formatter : f = Kt;
|
|
1355
|
-
const d = new Re(this.options);
|
|
1356
|
-
this.store = new Ce(this.options.resources, this.options);
|
|
1357
|
-
const c = this.services;
|
|
1358
|
-
c.logger = A, c.resourceStore = this.store, c.languageUtils = d, c.pluralResolver = new Mt(d, {
|
|
1359
|
-
prepend: this.options.pluralSeparator,
|
|
1360
|
-
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1361
|
-
}), f && (!this.options.interpolation.format || this.options.interpolation.format === s.interpolation.format) && (c.formatter = r(f), c.formatter.init(c, this.options), this.options.interpolation.format = c.formatter.format.bind(c.formatter)), c.interpolator = new Ht(this.options), c.utils = {
|
|
1362
|
-
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1363
|
-
}, c.backendConnector = new qt(r(this.modules.backend), c.resourceStore, c, this.options), c.backendConnector.on("*", function(h) {
|
|
1364
|
-
for (var g = arguments.length, p = new Array(g > 1 ? g - 1 : 0), m = 1; m < g; m++)
|
|
1365
|
-
p[m - 1] = arguments[m];
|
|
1366
|
-
e.emit(h, ...p);
|
|
1367
|
-
}), this.modules.languageDetector && (c.languageDetector = r(this.modules.languageDetector), c.languageDetector.init && c.languageDetector.init(c, this.options.detection, this.options)), this.modules.i18nFormat && (c.i18nFormat = r(this.modules.i18nFormat), c.i18nFormat.init && c.i18nFormat.init(this)), this.translator = new oe(this.services, this.options), this.translator.on("*", function(h) {
|
|
1368
|
-
for (var g = arguments.length, p = new Array(g > 1 ? g - 1 : 0), m = 1; m < g; m++)
|
|
1369
|
-
p[m - 1] = arguments[m];
|
|
1370
|
-
e.emit(h, ...p);
|
|
1371
|
-
}), this.modules.external.forEach((h) => {
|
|
1372
|
-
h.init && h.init(this);
|
|
1373
|
-
});
|
|
1374
|
-
}
|
|
1375
|
-
if (this.format = this.options.interpolation.format, n || (n = te), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
1376
|
-
const f = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1377
|
-
f.length > 0 && f[0] !== "dev" && (this.options.lng = f[0]);
|
|
1378
|
-
}
|
|
1379
|
-
!this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((f) => {
|
|
1380
|
-
this[f] = function() {
|
|
1381
|
-
return e.store[f](...arguments);
|
|
1382
|
-
};
|
|
1383
|
-
}), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((f) => {
|
|
1384
|
-
this[f] = function() {
|
|
1385
|
-
return e.store[f](...arguments), e;
|
|
1386
|
-
};
|
|
1387
|
-
});
|
|
1388
|
-
const u = X(), l = () => {
|
|
1389
|
-
const f = (d, c) => {
|
|
1390
|
-
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), u.resolve(c), n(d, c);
|
|
1391
|
-
};
|
|
1392
|
-
if (this.languages && !this.isInitialized) return f(null, this.t.bind(this));
|
|
1393
|
-
this.changeLanguage(this.options.lng, f);
|
|
1394
|
-
};
|
|
1395
|
-
return this.options.resources || !this.options.initAsync ? l() : setTimeout(l, 0), u;
|
|
1396
|
-
}
|
|
1397
|
-
loadResources(e) {
|
|
1398
|
-
var r, o;
|
|
1399
|
-
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : te;
|
|
1400
|
-
const s = y(e) ? e : this.language;
|
|
1401
|
-
if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1402
|
-
if ((s == null ? void 0 : s.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
|
|
1403
|
-
const a = [], u = (l) => {
|
|
1404
|
-
if (!l || l === "cimode") return;
|
|
1405
|
-
this.services.languageUtils.toResolveHierarchy(l).forEach((d) => {
|
|
1406
|
-
d !== "cimode" && a.indexOf(d) < 0 && a.push(d);
|
|
1407
|
-
});
|
|
1408
|
-
};
|
|
1409
|
-
s ? u(s) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((f) => u(f)), (o = (r = this.options.preload) == null ? void 0 : r.forEach) == null || o.call(r, (l) => u(l)), this.services.backendConnector.load(a, this.options.ns, (l) => {
|
|
1410
|
-
!l && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(l);
|
|
1411
|
-
});
|
|
1412
|
-
} else
|
|
1413
|
-
n(null);
|
|
1414
|
-
}
|
|
1415
|
-
reloadResources(e, t, n) {
|
|
1416
|
-
const s = X();
|
|
1417
|
-
return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), n || (n = te), this.services.backendConnector.reload(e, t, (r) => {
|
|
1418
|
-
s.resolve(), n(r);
|
|
1419
|
-
}), s;
|
|
1420
|
-
}
|
|
1421
|
-
use(e) {
|
|
1422
|
-
if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
1423
|
-
if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
1424
|
-
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" && Ge.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
1425
|
-
}
|
|
1426
|
-
setResolvedLanguage(e) {
|
|
1427
|
-
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
|
|
1428
|
-
for (let t = 0; t < this.languages.length; t++) {
|
|
1429
|
-
const n = this.languages[t];
|
|
1430
|
-
if (!(["cimode", "dev"].indexOf(n) > -1) && this.store.hasLanguageSomeTranslations(n)) {
|
|
1431
|
-
this.resolvedLanguage = n;
|
|
1432
|
-
break;
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
changeLanguage(e, t) {
|
|
1437
|
-
var n = this;
|
|
1438
|
-
this.isLanguageChangingTo = e;
|
|
1439
|
-
const s = X();
|
|
1440
|
-
this.emit("languageChanging", e);
|
|
1441
|
-
const r = (u) => {
|
|
1442
|
-
this.language = u, this.languages = this.services.languageUtils.toResolveHierarchy(u), this.resolvedLanguage = void 0, this.setResolvedLanguage(u);
|
|
1443
|
-
}, o = (u, l) => {
|
|
1444
|
-
l ? (r(l), this.translator.changeLanguage(l), this.isLanguageChangingTo = void 0, this.emit("languageChanged", l), this.logger.log("languageChanged", l)) : this.isLanguageChangingTo = void 0, s.resolve(function() {
|
|
1445
|
-
return n.t(...arguments);
|
|
1446
|
-
}), t && t(u, function() {
|
|
1447
|
-
return n.t(...arguments);
|
|
1448
|
-
});
|
|
1449
|
-
}, a = (u) => {
|
|
1450
|
-
var f, d;
|
|
1451
|
-
!e && !u && this.services.languageDetector && (u = []);
|
|
1452
|
-
const l = y(u) ? u : this.services.languageUtils.getBestMatchFromCodes(u);
|
|
1453
|
-
l && (this.language || r(l), this.translator.language || this.translator.changeLanguage(l), (d = (f = this.services.languageDetector) == null ? void 0 : f.cacheUserLanguage) == null || d.call(f, l)), this.loadResources(l, (c) => {
|
|
1454
|
-
o(c, l);
|
|
1455
|
-
});
|
|
1456
|
-
};
|
|
1457
|
-
return !e && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a) : this.services.languageDetector.detect(a) : a(e), s;
|
|
1458
|
-
}
|
|
1459
|
-
getFixedT(e, t, n) {
|
|
1460
|
-
var s = this;
|
|
1461
|
-
const r = function(o, a) {
|
|
1462
|
-
let u;
|
|
1463
|
-
if (typeof a != "object") {
|
|
1464
|
-
for (var l = arguments.length, f = new Array(l > 2 ? l - 2 : 0), d = 2; d < l; d++)
|
|
1465
|
-
f[d - 2] = arguments[d];
|
|
1466
|
-
u = s.options.overloadTranslationOptionHandler([o, a].concat(f));
|
|
1467
|
-
} else
|
|
1468
|
-
u = {
|
|
1469
|
-
...a
|
|
1470
|
-
};
|
|
1471
|
-
u.lng = u.lng || r.lng, u.lngs = u.lngs || r.lngs, u.ns = u.ns || r.ns, u.keyPrefix !== "" && (u.keyPrefix = u.keyPrefix || n || r.keyPrefix);
|
|
1472
|
-
const c = s.options.keySeparator || ".";
|
|
1473
|
-
let h;
|
|
1474
|
-
return u.keyPrefix && Array.isArray(o) ? h = o.map((g) => `${u.keyPrefix}${c}${g}`) : h = u.keyPrefix ? `${u.keyPrefix}${c}${o}` : o, s.t(h, u);
|
|
1475
|
-
};
|
|
1476
|
-
return y(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = n, r;
|
|
1477
|
-
}
|
|
1478
|
-
t() {
|
|
1479
|
-
var s;
|
|
1480
|
-
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
1481
|
-
t[n] = arguments[n];
|
|
1482
|
-
return (s = this.translator) == null ? void 0 : s.translate(...t);
|
|
1483
|
-
}
|
|
1484
|
-
exists() {
|
|
1485
|
-
var s;
|
|
1486
|
-
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
1487
|
-
t[n] = arguments[n];
|
|
1488
|
-
return (s = this.translator) == null ? void 0 : s.exists(...t);
|
|
1489
|
-
}
|
|
1490
|
-
setDefaultNamespace(e) {
|
|
1491
|
-
this.options.defaultNS = e;
|
|
1492
|
-
}
|
|
1493
|
-
hasLoadedNamespace(e) {
|
|
1494
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1495
|
-
if (!this.isInitialized)
|
|
1496
|
-
return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
|
|
1497
|
-
if (!this.languages || !this.languages.length)
|
|
1498
|
-
return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
|
|
1499
|
-
const n = t.lng || this.resolvedLanguage || this.languages[0], s = this.options ? this.options.fallbackLng : !1, r = this.languages[this.languages.length - 1];
|
|
1500
|
-
if (n.toLowerCase() === "cimode") return !0;
|
|
1501
|
-
const o = (a, u) => {
|
|
1502
|
-
const l = this.services.backendConnector.state[`${a}|${u}`];
|
|
1503
|
-
return l === -1 || l === 0 || l === 2;
|
|
1504
|
-
};
|
|
1505
|
-
if (t.precheck) {
|
|
1506
|
-
const a = t.precheck(this, o);
|
|
1507
|
-
if (a !== void 0) return a;
|
|
1508
|
-
}
|
|
1509
|
-
return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || o(n, e) && (!s || o(r, e)));
|
|
1510
|
-
}
|
|
1511
|
-
loadNamespaces(e, t) {
|
|
1512
|
-
const n = X();
|
|
1513
|
-
return this.options.ns ? (y(e) && (e = [e]), e.forEach((s) => {
|
|
1514
|
-
this.options.ns.indexOf(s) < 0 && this.options.ns.push(s);
|
|
1515
|
-
}), this.loadResources((s) => {
|
|
1516
|
-
n.resolve(), t && t(s);
|
|
1517
|
-
}), n) : (t && t(), Promise.resolve());
|
|
1518
|
-
}
|
|
1519
|
-
loadLanguages(e, t) {
|
|
1520
|
-
const n = X();
|
|
1521
|
-
y(e) && (e = [e]);
|
|
1522
|
-
const s = this.options.preload || [], r = e.filter((o) => s.indexOf(o) < 0 && this.services.languageUtils.isSupportedCode(o));
|
|
1523
|
-
return r.length ? (this.options.preload = s.concat(r), this.loadResources((o) => {
|
|
1524
|
-
n.resolve(), t && t(o);
|
|
1525
|
-
}), n) : (t && t(), Promise.resolve());
|
|
1526
|
-
}
|
|
1527
|
-
dir(e) {
|
|
1528
|
-
var s, r;
|
|
1529
|
-
if (e || (e = this.resolvedLanguage || (((s = this.languages) == null ? void 0 : s.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
|
|
1530
|
-
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"], n = ((r = this.services) == null ? void 0 : r.languageUtils) || new Re(Te());
|
|
1531
|
-
return t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
1532
|
-
}
|
|
1533
|
-
static createInstance() {
|
|
1534
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
1535
|
-
return new G(e, t);
|
|
1536
|
-
}
|
|
1537
|
-
cloneInstance() {
|
|
1538
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : te;
|
|
1539
|
-
const n = e.forkResourceStore;
|
|
1540
|
-
n && delete e.forkResourceStore;
|
|
1541
|
-
const s = {
|
|
1542
|
-
...this.options,
|
|
1543
|
-
...e,
|
|
1544
|
-
isClone: !0
|
|
1545
|
-
}, r = new G(s);
|
|
1546
|
-
if ((e.debug !== void 0 || e.prefix !== void 0) && (r.logger = r.logger.clone(e)), ["store", "services", "language"].forEach((a) => {
|
|
1547
|
-
r[a] = this[a];
|
|
1548
|
-
}), r.services = {
|
|
1549
|
-
...this.services
|
|
1550
|
-
}, r.services.utils = {
|
|
1551
|
-
hasLoadedNamespace: r.hasLoadedNamespace.bind(r)
|
|
1552
|
-
}, n) {
|
|
1553
|
-
const a = Object.keys(this.store.data).reduce((u, l) => (u[l] = {
|
|
1554
|
-
...this.store.data[l]
|
|
1555
|
-
}, Object.keys(u[l]).reduce((f, d) => (f[d] = {
|
|
1556
|
-
...u[l][d]
|
|
1557
|
-
}, f), {})), {});
|
|
1558
|
-
r.store = new Ce(a, s), r.services.resourceStore = r.store;
|
|
1559
|
-
}
|
|
1560
|
-
return r.translator = new oe(r.services, s), r.translator.on("*", function(a) {
|
|
1561
|
-
for (var u = arguments.length, l = new Array(u > 1 ? u - 1 : 0), f = 1; f < u; f++)
|
|
1562
|
-
l[f - 1] = arguments[f];
|
|
1563
|
-
r.emit(a, ...l);
|
|
1564
|
-
}), r.init(s, t), r.translator.options = s, r.translator.backendConnector.services.utils = {
|
|
1565
|
-
hasLoadedNamespace: r.hasLoadedNamespace.bind(r)
|
|
1566
|
-
}, r;
|
|
1567
|
-
}
|
|
1568
|
-
toJSON() {
|
|
1569
|
-
return {
|
|
1570
|
-
options: this.options,
|
|
1571
|
-
store: this.store,
|
|
1572
|
-
language: this.language,
|
|
1573
|
-
languages: this.languages,
|
|
1574
|
-
resolvedLanguage: this.resolvedLanguage
|
|
1575
|
-
};
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
const ne = G.createInstance();
|
|
1579
|
-
ne.createInstance = G.createInstance;
|
|
1580
|
-
const {
|
|
1581
|
-
slice: Bt,
|
|
1582
|
-
forEach: Xt
|
|
1583
|
-
} = [];
|
|
1584
|
-
function Jt(i) {
|
|
1585
|
-
return Xt.call(Bt.call(arguments, 1), (e) => {
|
|
1586
|
-
if (e)
|
|
1587
|
-
for (const t in e)
|
|
1588
|
-
i[t] === void 0 && (i[t] = e[t]);
|
|
1589
|
-
}), i;
|
|
1590
|
-
}
|
|
1591
|
-
const Ie = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, Wt = function(i, e) {
|
|
1592
|
-
const n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
1593
|
-
path: "/"
|
|
1594
|
-
}, s = encodeURIComponent(e);
|
|
1595
|
-
let r = `${i}=${s}`;
|
|
1596
|
-
if (n.maxAge > 0) {
|
|
1597
|
-
const o = n.maxAge - 0;
|
|
1598
|
-
if (Number.isNaN(o)) throw new Error("maxAge should be a Number");
|
|
1599
|
-
r += `; Max-Age=${Math.floor(o)}`;
|
|
1600
|
-
}
|
|
1601
|
-
if (n.domain) {
|
|
1602
|
-
if (!Ie.test(n.domain))
|
|
1603
|
-
throw new TypeError("option domain is invalid");
|
|
1604
|
-
r += `; Domain=${n.domain}`;
|
|
1605
|
-
}
|
|
1606
|
-
if (n.path) {
|
|
1607
|
-
if (!Ie.test(n.path))
|
|
1608
|
-
throw new TypeError("option path is invalid");
|
|
1609
|
-
r += `; Path=${n.path}`;
|
|
1610
|
-
}
|
|
1611
|
-
if (n.expires) {
|
|
1612
|
-
if (typeof n.expires.toUTCString != "function")
|
|
1613
|
-
throw new TypeError("option expires is invalid");
|
|
1614
|
-
r += `; Expires=${n.expires.toUTCString()}`;
|
|
1615
|
-
}
|
|
1616
|
-
if (n.httpOnly && (r += "; HttpOnly"), n.secure && (r += "; Secure"), n.sameSite)
|
|
1617
|
-
switch (typeof n.sameSite == "string" ? n.sameSite.toLowerCase() : n.sameSite) {
|
|
1618
|
-
case !0:
|
|
1619
|
-
r += "; SameSite=Strict";
|
|
1620
|
-
break;
|
|
1621
|
-
case "lax":
|
|
1622
|
-
r += "; SameSite=Lax";
|
|
1623
|
-
break;
|
|
1624
|
-
case "strict":
|
|
1625
|
-
r += "; SameSite=Strict";
|
|
1626
|
-
break;
|
|
1627
|
-
case "none":
|
|
1628
|
-
r += "; SameSite=None";
|
|
1629
|
-
break;
|
|
1630
|
-
default:
|
|
1631
|
-
throw new TypeError("option sameSite is invalid");
|
|
1632
|
-
}
|
|
1633
|
-
return r;
|
|
1634
|
-
}, Fe = {
|
|
1635
|
-
create(i, e, t, n) {
|
|
1636
|
-
let s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
1637
|
-
path: "/",
|
|
1638
|
-
sameSite: "strict"
|
|
1639
|
-
};
|
|
1640
|
-
t && (s.expires = /* @__PURE__ */ new Date(), s.expires.setTime(s.expires.getTime() + t * 60 * 1e3)), n && (s.domain = n), document.cookie = Wt(i, encodeURIComponent(e), s);
|
|
1641
|
-
},
|
|
1642
|
-
read(i) {
|
|
1643
|
-
const e = `${i}=`, t = document.cookie.split(";");
|
|
1644
|
-
for (let n = 0; n < t.length; n++) {
|
|
1645
|
-
let s = t[n];
|
|
1646
|
-
for (; s.charAt(0) === " "; ) s = s.substring(1, s.length);
|
|
1647
|
-
if (s.indexOf(e) === 0) return s.substring(e.length, s.length);
|
|
1648
|
-
}
|
|
1649
|
-
return null;
|
|
1650
|
-
},
|
|
1651
|
-
remove(i) {
|
|
1652
|
-
this.create(i, "", -1);
|
|
1653
|
-
}
|
|
1654
|
-
};
|
|
1655
|
-
var Qt = {
|
|
1656
|
-
name: "cookie",
|
|
1657
|
-
// Deconstruct the options object and extract the lookupCookie property
|
|
1658
|
-
lookup(i) {
|
|
1659
|
-
let {
|
|
1660
|
-
lookupCookie: e
|
|
1661
|
-
} = i;
|
|
1662
|
-
if (e && typeof document < "u")
|
|
1663
|
-
return Fe.read(e) || void 0;
|
|
1664
|
-
},
|
|
1665
|
-
// Deconstruct the options object and extract the lookupCookie, cookieMinutes, cookieDomain, and cookieOptions properties
|
|
1666
|
-
cacheUserLanguage(i, e) {
|
|
1667
|
-
let {
|
|
1668
|
-
lookupCookie: t,
|
|
1669
|
-
cookieMinutes: n,
|
|
1670
|
-
cookieDomain: s,
|
|
1671
|
-
cookieOptions: r
|
|
1672
|
-
} = e;
|
|
1673
|
-
t && typeof document < "u" && Fe.create(t, i, n, s, r);
|
|
1674
|
-
}
|
|
1675
|
-
}, Gt = {
|
|
1676
|
-
name: "querystring",
|
|
1677
|
-
// Deconstruct the options object and extract the lookupQuerystring property
|
|
1678
|
-
lookup(i) {
|
|
1679
|
-
var n;
|
|
1680
|
-
let {
|
|
1681
|
-
lookupQuerystring: e
|
|
1682
|
-
} = i, t;
|
|
1683
|
-
if (typeof window < "u") {
|
|
1684
|
-
let {
|
|
1685
|
-
search: s
|
|
1686
|
-
} = window.location;
|
|
1687
|
-
!window.location.search && ((n = window.location.hash) == null ? void 0 : n.indexOf("?")) > -1 && (s = window.location.hash.substring(window.location.hash.indexOf("?")));
|
|
1688
|
-
const o = s.substring(1).split("&");
|
|
1689
|
-
for (let a = 0; a < o.length; a++) {
|
|
1690
|
-
const u = o[a].indexOf("=");
|
|
1691
|
-
u > 0 && o[a].substring(0, u) === e && (t = o[a].substring(u + 1));
|
|
1692
|
-
}
|
|
1693
|
-
}
|
|
1694
|
-
return t;
|
|
1695
|
-
}
|
|
1696
|
-
};
|
|
1697
|
-
let J = null;
|
|
1698
|
-
const De = () => {
|
|
1699
|
-
if (J !== null) return J;
|
|
1700
|
-
try {
|
|
1701
|
-
J = window !== "undefined" && window.localStorage !== null;
|
|
1702
|
-
const i = "i18next.translate.boo";
|
|
1703
|
-
window.localStorage.setItem(i, "foo"), window.localStorage.removeItem(i);
|
|
1704
|
-
} catch {
|
|
1705
|
-
J = !1;
|
|
1706
|
-
}
|
|
1707
|
-
return J;
|
|
1708
|
-
};
|
|
1709
|
-
var Yt = {
|
|
1710
|
-
name: "localStorage",
|
|
1711
|
-
// Deconstruct the options object and extract the lookupLocalStorage property
|
|
1712
|
-
lookup(i) {
|
|
1713
|
-
let {
|
|
1714
|
-
lookupLocalStorage: e
|
|
1715
|
-
} = i;
|
|
1716
|
-
if (e && De())
|
|
1717
|
-
return window.localStorage.getItem(e) || void 0;
|
|
1718
|
-
},
|
|
1719
|
-
// Deconstruct the options object and extract the lookupLocalStorage property
|
|
1720
|
-
cacheUserLanguage(i, e) {
|
|
1721
|
-
let {
|
|
1722
|
-
lookupLocalStorage: t
|
|
1723
|
-
} = e;
|
|
1724
|
-
t && De() && window.localStorage.setItem(t, i);
|
|
1725
|
-
}
|
|
1726
|
-
};
|
|
1727
|
-
let W = null;
|
|
1728
|
-
const Me = () => {
|
|
1729
|
-
if (W !== null) return W;
|
|
1730
|
-
try {
|
|
1731
|
-
W = window !== "undefined" && window.sessionStorage !== null;
|
|
1732
|
-
const i = "i18next.translate.boo";
|
|
1733
|
-
window.sessionStorage.setItem(i, "foo"), window.sessionStorage.removeItem(i);
|
|
1734
|
-
} catch {
|
|
1735
|
-
W = !1;
|
|
1736
|
-
}
|
|
1737
|
-
return W;
|
|
1738
|
-
};
|
|
1739
|
-
var Zt = {
|
|
1740
|
-
name: "sessionStorage",
|
|
1741
|
-
lookup(i) {
|
|
1742
|
-
let {
|
|
1743
|
-
lookupSessionStorage: e
|
|
1744
|
-
} = i;
|
|
1745
|
-
if (e && Me())
|
|
1746
|
-
return window.sessionStorage.getItem(e) || void 0;
|
|
1747
|
-
},
|
|
1748
|
-
cacheUserLanguage(i, e) {
|
|
1749
|
-
let {
|
|
1750
|
-
lookupSessionStorage: t
|
|
1751
|
-
} = e;
|
|
1752
|
-
t && Me() && window.sessionStorage.setItem(t, i);
|
|
1753
|
-
}
|
|
1754
|
-
}, _t = {
|
|
1755
|
-
name: "navigator",
|
|
1756
|
-
lookup(i) {
|
|
1757
|
-
const e = [];
|
|
1758
|
-
if (typeof navigator < "u") {
|
|
1759
|
-
const {
|
|
1760
|
-
languages: t,
|
|
1761
|
-
userLanguage: n,
|
|
1762
|
-
language: s
|
|
1763
|
-
} = navigator;
|
|
1764
|
-
if (t)
|
|
1765
|
-
for (let r = 0; r < t.length; r++)
|
|
1766
|
-
e.push(t[r]);
|
|
1767
|
-
n && e.push(n), s && e.push(s);
|
|
1768
|
-
}
|
|
1769
|
-
return e.length > 0 ? e : void 0;
|
|
1770
|
-
}
|
|
1771
|
-
}, en = {
|
|
1772
|
-
name: "htmlTag",
|
|
1773
|
-
// Deconstruct the options object and extract the htmlTag property
|
|
1774
|
-
lookup(i) {
|
|
1775
|
-
let {
|
|
1776
|
-
htmlTag: e
|
|
1777
|
-
} = i, t;
|
|
1778
|
-
const n = e || (typeof document < "u" ? document.documentElement : null);
|
|
1779
|
-
return n && typeof n.getAttribute == "function" && (t = n.getAttribute("lang")), t;
|
|
1780
|
-
}
|
|
1781
|
-
}, tn = {
|
|
1782
|
-
name: "path",
|
|
1783
|
-
// Deconstruct the options object and extract the lookupFromPathIndex property
|
|
1784
|
-
lookup(i) {
|
|
1785
|
-
var s;
|
|
1786
|
-
let {
|
|
1787
|
-
lookupFromPathIndex: e
|
|
1788
|
-
} = i;
|
|
1789
|
-
if (typeof window > "u") return;
|
|
1790
|
-
const t = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
|
|
1791
|
-
return Array.isArray(t) ? (s = t[typeof e == "number" ? e : 0]) == null ? void 0 : s.replace("/", "") : void 0;
|
|
1792
|
-
}
|
|
1793
|
-
}, nn = {
|
|
1794
|
-
name: "subdomain",
|
|
1795
|
-
lookup(i) {
|
|
1796
|
-
var s, r;
|
|
1797
|
-
let {
|
|
1798
|
-
lookupFromSubdomainIndex: e
|
|
1799
|
-
} = i;
|
|
1800
|
-
const t = typeof e == "number" ? e + 1 : 1, n = typeof window < "u" && ((r = (s = window.location) == null ? void 0 : s.hostname) == null ? void 0 : r.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));
|
|
1801
|
-
if (n)
|
|
1802
|
-
return n[t];
|
|
1803
|
-
}
|
|
1804
|
-
};
|
|
1805
|
-
let Ye = !1;
|
|
1806
|
-
try {
|
|
1807
|
-
Ye = !0;
|
|
1808
|
-
} catch {
|
|
1809
|
-
}
|
|
1810
|
-
const Ze = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
|
|
1811
|
-
Ye || Ze.splice(1, 1);
|
|
1812
|
-
const sn = () => ({
|
|
1813
|
-
order: Ze,
|
|
1814
|
-
lookupQuerystring: "lng",
|
|
1815
|
-
lookupCookie: "i18next",
|
|
1816
|
-
lookupLocalStorage: "i18nextLng",
|
|
1817
|
-
lookupSessionStorage: "i18nextLng",
|
|
1818
|
-
// cache user language
|
|
1819
|
-
caches: ["localStorage"],
|
|
1820
|
-
excludeCacheFor: ["cimode"],
|
|
1821
|
-
// cookieMinutes: 10,
|
|
1822
|
-
// cookieDomain: 'myDomain'
|
|
1823
|
-
convertDetectedLanguage: (i) => i
|
|
1824
|
-
});
|
|
1825
|
-
class _e {
|
|
1826
|
-
constructor(e) {
|
|
1827
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1828
|
-
this.type = "languageDetector", this.detectors = {}, this.init(e, t);
|
|
1829
|
-
}
|
|
1830
|
-
init() {
|
|
1831
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
1832
|
-
languageUtils: {}
|
|
1833
|
-
}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
1834
|
-
this.services = e, this.options = Jt(t, this.options || {}, sn()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (s) => s.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector(Qt), this.addDetector(Gt), this.addDetector(Yt), this.addDetector(Zt), this.addDetector(_t), this.addDetector(en), this.addDetector(tn), this.addDetector(nn);
|
|
1835
|
-
}
|
|
1836
|
-
addDetector(e) {
|
|
1837
|
-
return this.detectors[e.name] = e, this;
|
|
1838
|
-
}
|
|
1839
|
-
detect() {
|
|
1840
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.order, t = [];
|
|
1841
|
-
return e.forEach((n) => {
|
|
1842
|
-
if (this.detectors[n]) {
|
|
1843
|
-
let s = this.detectors[n].lookup(this.options);
|
|
1844
|
-
s && typeof s == "string" && (s = [s]), s && (t = t.concat(s));
|
|
1845
|
-
}
|
|
1846
|
-
}), t = t.map((n) => this.options.convertDetectedLanguage(n)), this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes ? t : t.length > 0 ? t[0] : null;
|
|
1847
|
-
}
|
|
1848
|
-
cacheUserLanguage(e) {
|
|
1849
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.caches;
|
|
1850
|
-
t && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(e) > -1 || t.forEach((n) => {
|
|
1851
|
-
this.detectors[n] && this.detectors[n].cacheUserLanguage(e, this.options);
|
|
1852
|
-
}));
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
_e.type = "languageDetector";
|
|
1856
|
-
function rn(i, e) {
|
|
1857
|
-
if (!(i instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1858
|
-
}
|
|
1859
|
-
function Y(i) {
|
|
1860
|
-
"@babel/helpers - typeof";
|
|
1861
|
-
return Y = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
1862
|
-
return typeof e;
|
|
1863
|
-
} : function(e) {
|
|
1864
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1865
|
-
}, Y(i);
|
|
1866
|
-
}
|
|
1867
|
-
function on(i, e) {
|
|
1868
|
-
if (Y(i) != "object" || !i) return i;
|
|
1869
|
-
var t = i[Symbol.toPrimitive];
|
|
1870
|
-
if (t !== void 0) {
|
|
1871
|
-
var n = t.call(i, e);
|
|
1872
|
-
if (Y(n) != "object") return n;
|
|
1873
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1874
|
-
}
|
|
1875
|
-
return String(i);
|
|
1876
|
-
}
|
|
1877
|
-
function an(i) {
|
|
1878
|
-
var e = on(i, "string");
|
|
1879
|
-
return Y(e) == "symbol" ? e : e + "";
|
|
1880
|
-
}
|
|
1881
|
-
function un(i, e) {
|
|
1882
|
-
for (var t = 0; t < e.length; t++) {
|
|
1883
|
-
var n = e[t];
|
|
1884
|
-
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(i, an(n.key), n);
|
|
1885
|
-
}
|
|
1886
|
-
}
|
|
1887
|
-
function ln(i, e, t) {
|
|
1888
|
-
return e && un(i.prototype, e), Object.defineProperty(i, "prototype", {
|
|
1889
|
-
writable: !1
|
|
1890
|
-
}), i;
|
|
1891
|
-
}
|
|
1892
|
-
var et = [], fn = et.forEach, cn = et.slice;
|
|
1893
|
-
function dn(i) {
|
|
1894
|
-
return fn.call(cn.call(arguments, 1), function(e) {
|
|
1895
|
-
if (e)
|
|
1896
|
-
for (var t in e)
|
|
1897
|
-
i[t] === void 0 && (i[t] = e[t]);
|
|
1898
|
-
}), i;
|
|
1899
|
-
}
|
|
1900
|
-
function hn(i) {
|
|
1901
|
-
return i ? typeof i == "function" ? new i() : i : null;
|
|
1902
|
-
}
|
|
1903
|
-
function gn() {
|
|
1904
|
-
return {
|
|
1905
|
-
handleEmptyResourcesAsFailed: !0,
|
|
1906
|
-
cacheHitMode: "none"
|
|
1907
|
-
// reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000
|
|
1908
|
-
// refreshExpirationTime: 60 * 60 * 1000
|
|
1909
|
-
};
|
|
1910
|
-
}
|
|
1911
|
-
function He(i, e, t, n) {
|
|
1912
|
-
var s = i.read.bind(i);
|
|
1913
|
-
if (s.length === 2) {
|
|
1914
|
-
try {
|
|
1915
|
-
var r = s(e, t);
|
|
1916
|
-
r && typeof r.then == "function" ? r.then(function(o) {
|
|
1917
|
-
return n(null, o);
|
|
1918
|
-
}).catch(n) : n(null, r);
|
|
1919
|
-
} catch (o) {
|
|
1920
|
-
n(o);
|
|
1921
|
-
}
|
|
1922
|
-
return;
|
|
1923
|
-
}
|
|
1924
|
-
s(e, t, n);
|
|
1925
|
-
}
|
|
1926
|
-
var tt = /* @__PURE__ */ function() {
|
|
1927
|
-
function i(e) {
|
|
1928
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
1929
|
-
rn(this, i), this.backends = [], this.type = "backend", this.allOptions = n, this.init(e, t);
|
|
1930
|
-
}
|
|
1931
|
-
return ln(i, [{
|
|
1932
|
-
key: "init",
|
|
1933
|
-
value: function(t) {
|
|
1934
|
-
var n = this, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
1935
|
-
this.services = t, this.options = dn(s, this.options || {}, gn()), this.allOptions = r, this.options.backends && this.options.backends.forEach(function(o, a) {
|
|
1936
|
-
n.backends[a] = n.backends[a] || hn(o), n.backends[a].init(t, n.options.backendOptions && n.options.backendOptions[a] || {}, r);
|
|
1937
|
-
}), this.services && this.options.reloadInterval && setInterval(function() {
|
|
1938
|
-
return n.reload();
|
|
1939
|
-
}, this.options.reloadInterval);
|
|
1940
|
-
}
|
|
1941
|
-
}, {
|
|
1942
|
-
key: "read",
|
|
1943
|
-
value: function(t, n, s) {
|
|
1944
|
-
var r = this, o = this.backends.length, a = function l(f) {
|
|
1945
|
-
if (f >= o) return s(new Error("non of the backend loaded data", !0));
|
|
1946
|
-
var d = f === o - 1, c = r.options.handleEmptyResourcesAsFailed && !d ? 0 : -1, h = r.backends[f];
|
|
1947
|
-
h.read ? He(h, t, n, function(g, p, m) {
|
|
1948
|
-
if (!g && p && Object.keys(p).length > c) {
|
|
1949
|
-
if (s(null, p, f), u(f - 1, p), h.save && r.options.cacheHitMode && ["refresh", "refreshAndUpdateStore"].indexOf(r.options.cacheHitMode) > -1) {
|
|
1950
|
-
if (m && r.options.refreshExpirationTime && m + r.options.refreshExpirationTime > Date.now()) return;
|
|
1951
|
-
var S = r.backends[f + 1];
|
|
1952
|
-
S && S.read && He(S, t, n, function(w, O) {
|
|
1953
|
-
w || O && (Object.keys(O).length <= c || (u(f, O), r.options.cacheHitMode === "refreshAndUpdateStore" && r.services && r.services.resourceStore && r.services.resourceStore.addResourceBundle(t, n, O)));
|
|
1954
|
-
});
|
|
1955
|
-
}
|
|
1956
|
-
} else
|
|
1957
|
-
l(f + 1);
|
|
1958
|
-
}) : l(f + 1);
|
|
1959
|
-
}, u = function l(f, d) {
|
|
1960
|
-
if (!(f < 0)) {
|
|
1961
|
-
var c = r.backends[f];
|
|
1962
|
-
c.save && c.save(t, n, d), l(f - 1, d);
|
|
1963
|
-
}
|
|
1964
|
-
};
|
|
1965
|
-
a(0);
|
|
1966
|
-
}
|
|
1967
|
-
}, {
|
|
1968
|
-
key: "create",
|
|
1969
|
-
value: function(t, n, s, r) {
|
|
1970
|
-
var o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : function() {
|
|
1971
|
-
}, a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
|
|
1972
|
-
this.backends.forEach(function(u) {
|
|
1973
|
-
if (u.create) {
|
|
1974
|
-
var l = u.create.bind(u);
|
|
1975
|
-
if (l.length < 6) {
|
|
1976
|
-
try {
|
|
1977
|
-
var f;
|
|
1978
|
-
l.length === 5 ? f = l(t, n, s, r, a) : f = l(t, n, s, r), f && typeof f.then == "function" ? f.then(function(d) {
|
|
1979
|
-
return o(null, d);
|
|
1980
|
-
}).catch(o) : o(null, f);
|
|
1981
|
-
} catch (d) {
|
|
1982
|
-
o(d);
|
|
1983
|
-
}
|
|
1984
|
-
return;
|
|
1985
|
-
}
|
|
1986
|
-
l(t, n, s, r, o, a);
|
|
1987
|
-
}
|
|
1988
|
-
});
|
|
1989
|
-
}
|
|
1990
|
-
}, {
|
|
1991
|
-
key: "reload",
|
|
1992
|
-
value: function() {
|
|
1993
|
-
var t = this, n = this.services, s = n.backendConnector, r = n.languageUtils, o = n.logger, a = s.language;
|
|
1994
|
-
if (!(a && a.toLowerCase() === "cimode")) {
|
|
1995
|
-
var u = [], l = function(d) {
|
|
1996
|
-
var c = r.toResolveHierarchy(d);
|
|
1997
|
-
c.forEach(function(h) {
|
|
1998
|
-
u.indexOf(h) < 0 && u.push(h);
|
|
1999
|
-
});
|
|
2000
|
-
};
|
|
2001
|
-
l(a), this.allOptions.preload && this.allOptions.preload.forEach(function(f) {
|
|
2002
|
-
return l(f);
|
|
2003
|
-
}), u.forEach(function(f) {
|
|
2004
|
-
t.allOptions.ns.forEach(function(d) {
|
|
2005
|
-
s.read(f, d, "read", null, null, function(c, h) {
|
|
2006
|
-
c && o.warn("loading namespace ".concat(d, " for language ").concat(f, " failed"), c), !c && h && o.log("loaded namespace ".concat(d, " for language ").concat(f), h), s.loaded("".concat(f, "|").concat(d), c, h);
|
|
2007
|
-
});
|
|
2008
|
-
});
|
|
2009
|
-
});
|
|
2010
|
-
}
|
|
2011
|
-
}
|
|
2012
|
-
}]), i;
|
|
2013
|
-
}();
|
|
2014
|
-
tt.type = "backend";
|
|
2015
|
-
function pe(i) {
|
|
2016
|
-
"@babel/helpers - typeof";
|
|
2017
|
-
return pe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2018
|
-
return typeof e;
|
|
2019
|
-
} : function(e) {
|
|
2020
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2021
|
-
}, pe(i);
|
|
2022
|
-
}
|
|
2023
|
-
function nt() {
|
|
2024
|
-
return typeof XMLHttpRequest == "function" || (typeof XMLHttpRequest > "u" ? "undefined" : pe(XMLHttpRequest)) === "object";
|
|
2025
|
-
}
|
|
2026
|
-
function pn(i) {
|
|
2027
|
-
return !!i && typeof i.then == "function";
|
|
2028
|
-
}
|
|
2029
|
-
function mn(i) {
|
|
2030
|
-
return pn(i) ? i : Promise.resolve(i);
|
|
2031
|
-
}
|
|
2032
|
-
function Ue(i, e) {
|
|
2033
|
-
var t = Object.keys(i);
|
|
2034
|
-
if (Object.getOwnPropertySymbols) {
|
|
2035
|
-
var n = Object.getOwnPropertySymbols(i);
|
|
2036
|
-
e && (n = n.filter(function(s) {
|
|
2037
|
-
return Object.getOwnPropertyDescriptor(i, s).enumerable;
|
|
2038
|
-
})), t.push.apply(t, n);
|
|
2039
|
-
}
|
|
2040
|
-
return t;
|
|
2041
|
-
}
|
|
2042
|
-
function Ke(i) {
|
|
2043
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
2044
|
-
var t = arguments[e] != null ? arguments[e] : {};
|
|
2045
|
-
e % 2 ? Ue(Object(t), !0).forEach(function(n) {
|
|
2046
|
-
yn(i, n, t[n]);
|
|
2047
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : Ue(Object(t)).forEach(function(n) {
|
|
2048
|
-
Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
|
|
2049
|
-
});
|
|
2050
|
-
}
|
|
2051
|
-
return i;
|
|
2052
|
-
}
|
|
2053
|
-
function yn(i, e, t) {
|
|
2054
|
-
return (e = bn(e)) in i ? Object.defineProperty(i, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : i[e] = t, i;
|
|
2055
|
-
}
|
|
2056
|
-
function bn(i) {
|
|
2057
|
-
var e = vn(i, "string");
|
|
2058
|
-
return U(e) == "symbol" ? e : e + "";
|
|
2059
|
-
}
|
|
2060
|
-
function vn(i, e) {
|
|
2061
|
-
if (U(i) != "object" || !i) return i;
|
|
2062
|
-
var t = i[Symbol.toPrimitive];
|
|
2063
|
-
if (t !== void 0) {
|
|
2064
|
-
var n = t.call(i, e);
|
|
2065
|
-
if (U(n) != "object") return n;
|
|
2066
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2067
|
-
}
|
|
2068
|
-
return (e === "string" ? String : Number)(i);
|
|
2069
|
-
}
|
|
2070
|
-
function U(i) {
|
|
2071
|
-
"@babel/helpers - typeof";
|
|
2072
|
-
return U = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2073
|
-
return typeof e;
|
|
2074
|
-
} : function(e) {
|
|
2075
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2076
|
-
}, U(i);
|
|
2077
|
-
}
|
|
2078
|
-
var F = typeof fetch == "function" ? fetch : void 0;
|
|
2079
|
-
typeof global < "u" && global.fetch ? F = global.fetch : typeof window < "u" && window.fetch && (F = window.fetch);
|
|
2080
|
-
var Z;
|
|
2081
|
-
nt() && (typeof global < "u" && global.XMLHttpRequest ? Z = global.XMLHttpRequest : typeof window < "u" && window.XMLHttpRequest && (Z = window.XMLHttpRequest));
|
|
2082
|
-
var ae;
|
|
2083
|
-
typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObject ? ae = global.ActiveXObject : typeof window < "u" && window.ActiveXObject && (ae = window.ActiveXObject));
|
|
2084
|
-
typeof F != "function" && (F = void 0);
|
|
2085
|
-
if (!F && !Z && !ae)
|
|
2086
|
-
try {
|
|
2087
|
-
import("./browser-ponyfill-Ck_bwPOY.js").then((i) => i.b).then(function(i) {
|
|
2088
|
-
F = i.default;
|
|
2089
|
-
}).catch(function() {
|
|
2090
|
-
});
|
|
2091
|
-
} catch {
|
|
2092
|
-
}
|
|
2093
|
-
var me = function(e, t) {
|
|
2094
|
-
if (t && U(t) === "object") {
|
|
2095
|
-
var n = "";
|
|
2096
|
-
for (var s in t)
|
|
2097
|
-
n += "&" + encodeURIComponent(s) + "=" + encodeURIComponent(t[s]);
|
|
2098
|
-
if (!n) return e;
|
|
2099
|
-
e = e + (e.indexOf("?") !== -1 ? "&" : "?") + n.slice(1);
|
|
2100
|
-
}
|
|
2101
|
-
return e;
|
|
2102
|
-
}, Ve = function(e, t, n, s) {
|
|
2103
|
-
var r = function(u) {
|
|
2104
|
-
if (!u.ok) return n(u.statusText || "Error", {
|
|
2105
|
-
status: u.status
|
|
2106
|
-
});
|
|
2107
|
-
u.text().then(function(l) {
|
|
2108
|
-
n(null, {
|
|
2109
|
-
status: u.status,
|
|
2110
|
-
data: l
|
|
2111
|
-
});
|
|
2112
|
-
}).catch(n);
|
|
2113
|
-
};
|
|
2114
|
-
if (s) {
|
|
2115
|
-
var o = s(e, t);
|
|
2116
|
-
if (o instanceof Promise) {
|
|
2117
|
-
o.then(r).catch(n);
|
|
2118
|
-
return;
|
|
2119
|
-
}
|
|
2120
|
-
}
|
|
2121
|
-
typeof fetch == "function" ? fetch(e, t).then(r).catch(n) : F(e, t).then(r).catch(n);
|
|
2122
|
-
}, qe = !1, wn = function(e, t, n, s) {
|
|
2123
|
-
e.queryStringParams && (t = me(t, e.queryStringParams));
|
|
2124
|
-
var r = Ke({}, typeof e.customHeaders == "function" ? e.customHeaders() : e.customHeaders);
|
|
2125
|
-
typeof window > "u" && typeof global < "u" && typeof global.process < "u" && global.process.versions && global.process.versions.node && (r["User-Agent"] = "i18next-http-backend (node/".concat(global.process.version, "; ").concat(global.process.platform, " ").concat(global.process.arch, ")")), n && (r["Content-Type"] = "application/json");
|
|
2126
|
-
var o = typeof e.requestOptions == "function" ? e.requestOptions(n) : e.requestOptions, a = Ke({
|
|
2127
|
-
method: n ? "POST" : "GET",
|
|
2128
|
-
body: n ? e.stringify(n) : void 0,
|
|
2129
|
-
headers: r
|
|
2130
|
-
}, qe ? {} : o), u = typeof e.alternateFetch == "function" && e.alternateFetch.length >= 1 ? e.alternateFetch : void 0;
|
|
2131
|
-
try {
|
|
2132
|
-
Ve(t, a, s, u);
|
|
2133
|
-
} catch (l) {
|
|
2134
|
-
if (!o || Object.keys(o).length === 0 || !l.message || l.message.indexOf("not implemented") < 0)
|
|
2135
|
-
return s(l);
|
|
2136
|
-
try {
|
|
2137
|
-
Object.keys(o).forEach(function(f) {
|
|
2138
|
-
delete a[f];
|
|
2139
|
-
}), Ve(t, a, s, u), qe = !0;
|
|
2140
|
-
} catch (f) {
|
|
2141
|
-
s(f);
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
}, xn = function(e, t, n, s) {
|
|
2145
|
-
n && U(n) === "object" && (n = me("", n).slice(1)), e.queryStringParams && (t = me(t, e.queryStringParams));
|
|
2146
|
-
try {
|
|
2147
|
-
var r = Z ? new Z() : new ae("MSXML2.XMLHTTP.3.0");
|
|
2148
|
-
r.open(n ? "POST" : "GET", t, 1), e.crossDomain || r.setRequestHeader("X-Requested-With", "XMLHttpRequest"), r.withCredentials = !!e.withCredentials, n && r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), r.overrideMimeType && r.overrideMimeType("application/json");
|
|
2149
|
-
var o = e.customHeaders;
|
|
2150
|
-
if (o = typeof o == "function" ? o() : o, o)
|
|
2151
|
-
for (var a in o)
|
|
2152
|
-
r.setRequestHeader(a, o[a]);
|
|
2153
|
-
r.onreadystatechange = function() {
|
|
2154
|
-
r.readyState > 3 && s(r.status >= 400 ? r.statusText : null, {
|
|
2155
|
-
status: r.status,
|
|
2156
|
-
data: r.responseText
|
|
2157
|
-
});
|
|
2158
|
-
}, r.send(n);
|
|
2159
|
-
} catch (u) {
|
|
2160
|
-
}
|
|
2161
|
-
}, On = function(e, t, n, s) {
|
|
2162
|
-
if (typeof n == "function" && (s = n, n = void 0), s = s || function() {
|
|
2163
|
-
}, F && t.indexOf("file:") !== 0)
|
|
2164
|
-
return wn(e, t, n, s);
|
|
2165
|
-
if (nt() || typeof ActiveXObject == "function")
|
|
2166
|
-
return xn(e, t, n, s);
|
|
2167
|
-
s(new Error("No fetch and no xhr implementation found!"));
|
|
2168
|
-
};
|
|
2169
|
-
function z(i) {
|
|
2170
|
-
"@babel/helpers - typeof";
|
|
2171
|
-
return z = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2172
|
-
return typeof e;
|
|
2173
|
-
} : function(e) {
|
|
2174
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2175
|
-
}, z(i);
|
|
2176
|
-
}
|
|
2177
|
-
function ze(i, e) {
|
|
2178
|
-
var t = Object.keys(i);
|
|
2179
|
-
if (Object.getOwnPropertySymbols) {
|
|
2180
|
-
var n = Object.getOwnPropertySymbols(i);
|
|
2181
|
-
e && (n = n.filter(function(s) {
|
|
2182
|
-
return Object.getOwnPropertyDescriptor(i, s).enumerable;
|
|
2183
|
-
})), t.push.apply(t, n);
|
|
2184
|
-
}
|
|
2185
|
-
return t;
|
|
2186
|
-
}
|
|
2187
|
-
function fe(i) {
|
|
2188
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
2189
|
-
var t = arguments[e] != null ? arguments[e] : {};
|
|
2190
|
-
e % 2 ? ze(Object(t), !0).forEach(function(n) {
|
|
2191
|
-
it(i, n, t[n]);
|
|
2192
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : ze(Object(t)).forEach(function(n) {
|
|
2193
|
-
Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
|
|
2194
|
-
});
|
|
2195
|
-
}
|
|
2196
|
-
return i;
|
|
2197
|
-
}
|
|
2198
|
-
function Sn(i, e) {
|
|
2199
|
-
if (!(i instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
2200
|
-
}
|
|
2201
|
-
function Ln(i, e) {
|
|
2202
|
-
for (var t = 0; t < e.length; t++) {
|
|
2203
|
-
var n = e[t];
|
|
2204
|
-
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(i, st(n.key), n);
|
|
2205
|
-
}
|
|
2206
|
-
}
|
|
2207
|
-
function Pn(i, e, t) {
|
|
2208
|
-
return e && Ln(i.prototype, e), Object.defineProperty(i, "prototype", { writable: !1 }), i;
|
|
2209
|
-
}
|
|
2210
|
-
function it(i, e, t) {
|
|
2211
|
-
return (e = st(e)) in i ? Object.defineProperty(i, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : i[e] = t, i;
|
|
2212
|
-
}
|
|
2213
|
-
function st(i) {
|
|
2214
|
-
var e = Cn(i, "string");
|
|
2215
|
-
return z(e) == "symbol" ? e : e + "";
|
|
2216
|
-
}
|
|
2217
|
-
function Cn(i, e) {
|
|
2218
|
-
if (z(i) != "object" || !i) return i;
|
|
2219
|
-
var t = i[Symbol.toPrimitive];
|
|
2220
|
-
if (t !== void 0) {
|
|
2221
|
-
var n = t.call(i, e);
|
|
2222
|
-
if (z(n) != "object") return n;
|
|
2223
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2224
|
-
}
|
|
2225
|
-
return String(i);
|
|
2226
|
-
}
|
|
2227
|
-
var kn = function() {
|
|
2228
|
-
return {
|
|
2229
|
-
loadPath: "/locales/{{lng}}/{{ns}}.json",
|
|
2230
|
-
addPath: "/locales/add/{{lng}}/{{ns}}",
|
|
2231
|
-
parse: function(t) {
|
|
2232
|
-
return JSON.parse(t);
|
|
2233
|
-
},
|
|
2234
|
-
stringify: JSON.stringify,
|
|
2235
|
-
parsePayload: function(t, n, s) {
|
|
2236
|
-
return it({}, n, s || "");
|
|
2237
|
-
},
|
|
2238
|
-
parseLoadPayload: function(t, n) {
|
|
2239
|
-
},
|
|
2240
|
-
request: On,
|
|
2241
|
-
reloadInterval: typeof window < "u" ? !1 : 60 * 60 * 1e3,
|
|
2242
|
-
customHeaders: {},
|
|
2243
|
-
queryStringParams: {},
|
|
2244
|
-
crossDomain: !1,
|
|
2245
|
-
withCredentials: !1,
|
|
2246
|
-
overrideMimeType: !1,
|
|
2247
|
-
requestOptions: {
|
|
2248
|
-
mode: "cors",
|
|
2249
|
-
credentials: "same-origin",
|
|
2250
|
-
cache: "default"
|
|
2251
|
-
}
|
|
2252
|
-
};
|
|
2253
|
-
}, rt = function() {
|
|
2254
|
-
function i(e) {
|
|
2255
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2256
|
-
Sn(this, i), this.services = e, this.options = t, this.allOptions = n, this.type = "backend", this.init(e, t, n);
|
|
2257
|
-
}
|
|
2258
|
-
return Pn(i, [{
|
|
2259
|
-
key: "init",
|
|
2260
|
-
value: function(t) {
|
|
2261
|
-
var n = this, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2262
|
-
if (this.services = t, this.options = fe(fe(fe({}, kn()), this.options || {}), s), this.allOptions = r, this.services && this.options.reloadInterval) {
|
|
2263
|
-
var o = setInterval(function() {
|
|
2264
|
-
return n.reload();
|
|
2265
|
-
}, this.options.reloadInterval);
|
|
2266
|
-
z(o) === "object" && typeof o.unref == "function" && o.unref();
|
|
2267
|
-
}
|
|
2268
|
-
}
|
|
2269
|
-
}, {
|
|
2270
|
-
key: "readMulti",
|
|
2271
|
-
value: function(t, n, s) {
|
|
2272
|
-
this._readAny(t, t, n, n, s);
|
|
2273
|
-
}
|
|
2274
|
-
}, {
|
|
2275
|
-
key: "read",
|
|
2276
|
-
value: function(t, n, s) {
|
|
2277
|
-
this._readAny([t], t, [n], n, s);
|
|
2278
|
-
}
|
|
2279
|
-
}, {
|
|
2280
|
-
key: "_readAny",
|
|
2281
|
-
value: function(t, n, s, r, o) {
|
|
2282
|
-
var a = this, u = this.options.loadPath;
|
|
2283
|
-
typeof this.options.loadPath == "function" && (u = this.options.loadPath(t, s)), u = mn(u), u.then(function(l) {
|
|
2284
|
-
if (!l) return o(null, {});
|
|
2285
|
-
var f = a.services.interpolator.interpolate(l, {
|
|
2286
|
-
lng: t.join("+"),
|
|
2287
|
-
ns: s.join("+")
|
|
2288
|
-
});
|
|
2289
|
-
a.loadUrl(f, o, n, r);
|
|
2290
|
-
});
|
|
2291
|
-
}
|
|
2292
|
-
}, {
|
|
2293
|
-
key: "loadUrl",
|
|
2294
|
-
value: function(t, n, s, r) {
|
|
2295
|
-
var o = this, a = typeof s == "string" ? [s] : s, u = typeof r == "string" ? [r] : r, l = this.options.parseLoadPayload(a, u);
|
|
2296
|
-
this.options.request(this.options, t, l, function(f, d) {
|
|
2297
|
-
if (d && (d.status >= 500 && d.status < 600 || !d.status)) return n("failed loading " + t + "; status code: " + d.status, !0);
|
|
2298
|
-
if (d && d.status >= 400 && d.status < 500) return n("failed loading " + t + "; status code: " + d.status, !1);
|
|
2299
|
-
if (!d && f && f.message) {
|
|
2300
|
-
var c = f.message.toLowerCase(), h = ["failed", "fetch", "network", "load"].find(function(m) {
|
|
2301
|
-
return c.indexOf(m) > -1;
|
|
2302
|
-
});
|
|
2303
|
-
if (h)
|
|
2304
|
-
return n("failed loading " + t + ": " + f.message, !0);
|
|
2305
|
-
}
|
|
2306
|
-
if (f) return n(f, !1);
|
|
2307
|
-
var g, p;
|
|
2308
|
-
try {
|
|
2309
|
-
typeof d.data == "string" ? g = o.options.parse(d.data, s, r) : g = d.data;
|
|
2310
|
-
} catch {
|
|
2311
|
-
p = "failed parsing " + t + " to json";
|
|
2312
|
-
}
|
|
2313
|
-
if (p) return n(p, !1);
|
|
2314
|
-
n(null, g);
|
|
2315
|
-
});
|
|
2316
|
-
}
|
|
2317
|
-
}, {
|
|
2318
|
-
key: "create",
|
|
2319
|
-
value: function(t, n, s, r, o) {
|
|
2320
|
-
var a = this;
|
|
2321
|
-
if (this.options.addPath) {
|
|
2322
|
-
typeof t == "string" && (t = [t]);
|
|
2323
|
-
var u = this.options.parsePayload(n, s, r), l = 0, f = [], d = [];
|
|
2324
|
-
t.forEach(function(c) {
|
|
2325
|
-
var h = a.options.addPath;
|
|
2326
|
-
typeof a.options.addPath == "function" && (h = a.options.addPath(c, n));
|
|
2327
|
-
var g = a.services.interpolator.interpolate(h, {
|
|
2328
|
-
lng: c,
|
|
2329
|
-
ns: n
|
|
2330
|
-
});
|
|
2331
|
-
a.options.request(a.options, g, u, function(p, m) {
|
|
2332
|
-
l += 1, f.push(p), d.push(m), l === t.length && typeof o == "function" && o(f, d);
|
|
2333
|
-
});
|
|
2334
|
-
});
|
|
2335
|
-
}
|
|
2336
|
-
}
|
|
2337
|
-
}, {
|
|
2338
|
-
key: "reload",
|
|
2339
|
-
value: function() {
|
|
2340
|
-
var t = this, n = this.services, s = n.backendConnector, r = n.languageUtils, o = n.logger, a = s.language;
|
|
2341
|
-
if (!(a && a.toLowerCase() === "cimode")) {
|
|
2342
|
-
var u = [], l = function(d) {
|
|
2343
|
-
var c = r.toResolveHierarchy(d);
|
|
2344
|
-
c.forEach(function(h) {
|
|
2345
|
-
u.indexOf(h) < 0 && u.push(h);
|
|
2346
|
-
});
|
|
2347
|
-
};
|
|
2348
|
-
l(a), this.allOptions.preload && this.allOptions.preload.forEach(function(f) {
|
|
2349
|
-
return l(f);
|
|
2350
|
-
}), u.forEach(function(f) {
|
|
2351
|
-
t.allOptions.ns.forEach(function(d) {
|
|
2352
|
-
s.read(f, d, "read", null, null, function(c, h) {
|
|
2353
|
-
c && o.warn("loading namespace ".concat(d, " for language ").concat(f, " failed"), c), !c && h && o.log("loaded namespace ".concat(d, " for language ").concat(f), h), s.loaded("".concat(f, "|").concat(d), c, h);
|
|
2354
|
-
});
|
|
2355
|
-
});
|
|
2356
|
-
});
|
|
2357
|
-
}
|
|
2358
|
-
}
|
|
2359
|
-
}]);
|
|
2360
|
-
}();
|
|
2361
|
-
rt.type = "backend";
|
|
2362
|
-
var $n = function(e) {
|
|
2363
|
-
return {
|
|
2364
|
-
type: "backend",
|
|
2365
|
-
init: function(n, s, r) {
|
|
2366
|
-
},
|
|
2367
|
-
read: function(n, s, r) {
|
|
2368
|
-
if (typeof e == "function") {
|
|
2369
|
-
if (e.length < 3) {
|
|
2370
|
-
try {
|
|
2371
|
-
var o = e(n, s);
|
|
2372
|
-
o && typeof o.then == "function" ? o.then(function(a) {
|
|
2373
|
-
return r(null, a && a.default || a);
|
|
2374
|
-
}).catch(r) : r(null, o);
|
|
2375
|
-
} catch (a) {
|
|
2376
|
-
r(a);
|
|
2377
|
-
}
|
|
2378
|
-
return;
|
|
2379
|
-
}
|
|
2380
|
-
e(n, s, r);
|
|
2381
|
-
return;
|
|
2382
|
-
}
|
|
2383
|
-
r(null, e && e[n] && e[n][s]);
|
|
2384
|
-
}
|
|
2385
|
-
};
|
|
2386
|
-
};
|
|
2387
|
-
const Rn = {
|
|
2388
|
-
react: {
|
|
2389
|
-
useSuspense: !0
|
|
2390
|
-
},
|
|
2391
|
-
detection: {
|
|
2392
|
-
order: ["navigator", "htmlTag", "path", "subdomain"],
|
|
2393
|
-
caches: ["localStorage", "cookie"]
|
|
2394
|
-
}
|
|
2395
|
-
}, Be = (i, e) => {
|
|
2396
|
-
const t = import.meta.url.split("/").pop();
|
|
2397
|
-
return `${import.meta.url.replace(`/${t}`, "")}/locales/${i}/${e}.json`;
|
|
2398
|
-
};
|
|
2399
|
-
function ye() {
|
|
2400
|
-
return ne.isInitialized || ne.use(tt).use(_e).use(xt).init({
|
|
2401
|
-
debug: !0,
|
|
2402
|
-
fallbackLng: ut.enum.en,
|
|
2403
|
-
namespace: "translation",
|
|
2404
|
-
supportedLngs: at,
|
|
2405
|
-
backend: {
|
|
2406
|
-
backends: [
|
|
2407
|
-
rt,
|
|
2408
|
-
$n((i, e) => import(Be(i, e)))
|
|
2409
|
-
],
|
|
2410
|
-
backendOptions: [
|
|
2411
|
-
{
|
|
2412
|
-
loadPath: Be("{{lng}}", "{{ns}}")
|
|
2413
|
-
}
|
|
2414
|
-
]
|
|
2415
|
-
},
|
|
2416
|
-
...Rn
|
|
2417
|
-
}), ne;
|
|
2418
|
-
}
|
|
2419
|
-
const En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2420
|
-
__proto__: null,
|
|
2421
|
-
default: ye,
|
|
2422
|
-
initializeI18n: ye
|
|
2423
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2424
|
-
function Mn(i) {
|
|
2425
|
-
const e = ye();
|
|
2426
|
-
return Ct("translation", { i18n: e, ...i });
|
|
2427
|
-
}
|
|
2428
|
-
export {
|
|
2429
|
-
An as a,
|
|
2430
|
-
In as b,
|
|
2431
|
-
Fn as c,
|
|
2432
|
-
Dn as l,
|
|
2433
|
-
Tn as s,
|
|
2434
|
-
Mn as u
|
|
2435
|
-
};
|