@prosopo/procaptcha-bundle 2.5.3 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +1 -1
  2. package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/index.js +15 -17
  3. package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +1 -1
  4. package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +23 -27
  5. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +1 -0
  6. package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +2 -2
  7. package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
  8. package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +4 -7
  9. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -0
  10. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts +5 -0
  11. package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts.map +1 -1
  12. package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js.map +1 -1
  13. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js.map +1 -0
  14. package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts +2 -2
  15. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +1 -0
  16. package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +9 -4
  17. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +1 -0
  18. package/CHANGELOG.md +29 -0
  19. package/dist/bundle/ProcaptchaWidget-3gKvjeiH.js +636 -0
  20. package/dist/bundle/ProcaptchaWidget-D6-M7iAv.js +360 -0
  21. package/dist/bundle/{asU8a-JliaME7-.js → asU8a-DCECA0Qe.js} +1 -1
  22. package/dist/bundle/bip39-BQoZog_M.js +365 -0
  23. package/dist/bundle/captchaComponentProvider-BW2eXmc3.js +1242 -0
  24. package/dist/bundle/captchaRenderer-B_MgGzr9.js +70 -0
  25. package/dist/bundle/{emotion-element-5486c51c.browser.esm-Bywq83R5.js → emotion-element-5486c51c.browser.esm-CCAJ8JId.js} +713 -746
  26. package/dist/bundle/{fp.esm-C0kLYOiJ.js → fp.esm-DYWeNGcH.js} +17 -0
  27. package/dist/bundle/{hash-CtL1HOjf.js → hash-BR0YLxPF.js} +796 -483
  28. package/dist/bundle/{i18nFrontend-C_RgmvGh.js → i18nFrontend-CsPT71ro.js} +1 -1
  29. package/dist/bundle/index-2or4-1WF.js +596 -0
  30. package/dist/bundle/{captchaRenderer-D-du50M4.js → index-BCjHZ8o6.js} +1293 -1355
  31. package/dist/bundle/{index-DcG_c-Na.js → index-BYUYvvuq.js} +11 -11
  32. package/dist/bundle/index-BjRdPnnE.js +1198 -0
  33. package/dist/bundle/index-WqEmiYQ_.js +4386 -0
  34. package/dist/bundle/index.d.ts.map +1 -1
  35. package/dist/bundle/locales/ar/translation.json +56 -0
  36. package/dist/bundle/locales/az/translation.json +56 -0
  37. package/dist/bundle/locales/cs/translation.json +56 -0
  38. package/dist/bundle/locales/de/translation.json +55 -405
  39. package/dist/bundle/locales/el/translation.json +56 -0
  40. package/dist/bundle/locales/en/translation.json +55 -405
  41. package/dist/bundle/locales/es/translation.json +55 -405
  42. package/dist/bundle/locales/fi/translation.json +56 -0
  43. package/dist/bundle/locales/fr/translation.json +55 -405
  44. package/dist/bundle/locales/hi/translation.json +56 -0
  45. package/dist/bundle/locales/hu/translation.json +56 -0
  46. package/dist/bundle/locales/id/translation.json +56 -0
  47. package/dist/bundle/locales/it/translation.json +55 -405
  48. package/dist/bundle/locales/ja/translation.json +56 -0
  49. package/dist/bundle/locales/jv/translation.json +56 -0
  50. package/dist/bundle/locales/ko/translation.json +56 -0
  51. package/dist/bundle/locales/ml/translation.json +56 -0
  52. package/dist/bundle/locales/ms/translation.json +56 -0
  53. package/dist/bundle/locales/nl/translation.json +56 -0
  54. package/dist/bundle/locales/no/translation.json +56 -0
  55. package/dist/bundle/locales/pl/translation.json +56 -0
  56. package/dist/bundle/locales/pt/translation.json +55 -405
  57. package/dist/bundle/locales/pt-br/translation.json +56 -0
  58. package/dist/bundle/locales/ro/translation.json +56 -0
  59. package/dist/bundle/locales/ru/translation.json +56 -0
  60. package/dist/bundle/locales/sr/translation.json +56 -0
  61. package/dist/bundle/locales/sv/translation.json +56 -0
  62. package/dist/bundle/locales/th/translation.json +56 -0
  63. package/dist/bundle/locales/tr/translation.json +56 -0
  64. package/dist/bundle/locales/uk/translation.json +56 -0
  65. package/dist/bundle/locales/vi/translation.json +56 -0
  66. package/dist/bundle/locales/zh-cn/translation.json +56 -0
  67. package/dist/bundle/procaptcha.bundle.js +1 -1
  68. package/dist/bundle/toU8a-C68WUzs_.js +24 -0
  69. package/dist/bundle/{translations-B0P9axY3.js → translations-DEL070wJ.js} +59 -26
  70. package/dist/bundle/{useTranslation-7b6JJ18N.js → useTranslation-BPbGzrhj.js} +3 -3
  71. package/dist/bundle/util/captcha/captchaRenderer.d.ts +2 -2
  72. package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
  73. package/dist/bundle/util/configCreator.d.ts +2 -2
  74. package/dist/bundle/util/configCreator.d.ts.map +1 -1
  75. package/dist/bundle/util/widgetFactory.d.ts +2 -2
  76. package/dist/bundle/util/widgetFactory.d.ts.map +1 -1
  77. package/dist/cjs/index.cjs +163 -0
  78. package/dist/cjs/util/captcha/captchaComponentProvider.cjs +19 -0
  79. package/dist/cjs/util/captcha/captchaComponentsList.cjs +12 -0
  80. package/dist/cjs/util/captcha/captchaRenderer.cjs +65 -0
  81. package/dist/cjs/util/captcha/captchaType.cjs +12 -0
  82. package/dist/cjs/util/captcha/components/frictionlessCaptcha.cjs +24 -0
  83. package/dist/cjs/util/captcha/components/imageCaptcha.cjs +17 -0
  84. package/dist/cjs/util/captcha/components/powCaptcha.cjs +17 -0
  85. package/dist/cjs/util/config.cjs +16 -0
  86. package/dist/cjs/util/configCreator.cjs +23 -0
  87. package/dist/cjs/util/language.cjs +18 -0
  88. package/dist/cjs/util/timeout.cjs +14 -0
  89. package/dist/cjs/util/widgetFactory.cjs +84 -0
  90. package/dist/cjs/util/widgetThemeResolver.cjs +16 -0
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +15 -17
  93. package/dist/index.js.map +1 -1
  94. package/dist/tests/util/renderLogic.test.js +23 -27
  95. package/dist/tests/util/renderLogic.test.js.map +1 -1
  96. package/dist/util/captcha/captchaRenderer.d.ts +2 -2
  97. package/dist/util/captcha/captchaRenderer.d.ts.map +1 -1
  98. package/dist/util/captcha/captchaRenderer.js +4 -7
  99. package/dist/util/captcha/captchaRenderer.js.map +1 -1
  100. package/dist/util/configCreator.d.ts +2 -2
  101. package/dist/util/configCreator.d.ts.map +1 -1
  102. package/dist/util/configCreator.js.map +1 -1
  103. package/dist/util/language.js.map +1 -1
  104. package/dist/util/widgetFactory.d.ts +2 -2
  105. package/dist/util/widgetFactory.d.ts.map +1 -1
  106. package/dist/util/widgetFactory.js +9 -4
  107. package/dist/util/widgetFactory.js.map +1 -1
  108. package/package.json +25 -16
  109. package/stats.html +1 -1
  110. package/vite.config.ts +18 -3
  111. package/vite.serve.config.ts +24 -0
  112. package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +0 -1
  113. package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +0 -1
  114. package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts +0 -5
  115. package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js.map +0 -1
  116. package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +0 -1
  117. package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +0 -1
  118. package/dist/bundle/ProcaptchaWidget-BlWWnPeB.js +0 -615
  119. package/dist/bundle/ProcaptchaWidget-Dnwno-4N.js +0 -156
  120. package/dist/bundle/bip39-CFjno8fK.js +0 -260
  121. package/dist/bundle/captchaComponentProvider-dcMua0p9.js +0 -1013
  122. package/dist/bundle/index-B8oMghZ3.js +0 -1120
  123. package/dist/bundle/index-BMjJnq60.js +0 -4373
  124. package/dist/bundle/index-BTlHNFX8.js +0 -504
  125. package/dist/bundle/locales/pt-BR/translation.json +0 -406
  126. package/dist/bundle/sha256-Cxc9Hrlx.js +0 -171
  127. package/dist/bundle/toU8a-BWKf-2UU.js +0 -133
  128. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts +0 -0
  129. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts.map +0 -0
  130. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/components.js +0 -0
  131. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/components.js.map +0 -0
  132. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts +0 -0
  133. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.d.ts +0 -0
  134. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.d.ts.map +0 -0
  135. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js +0 -0
  136. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js.map +0 -0
  137. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.d.ts +0 -0
  138. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.d.ts.map +0 -0
  139. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.js +0 -0
  140. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.js.map +0 -0
  141. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.d.ts +0 -0
  142. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.d.ts.map +0 -0
  143. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts +0 -0
  144. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +0 -0
  145. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +0 -0
  146. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +0 -0
  147. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts +0 -0
  148. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +0 -0
  149. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js +0 -0
  150. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js.map +0 -0
  151. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts +0 -0
  152. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +0 -0
  153. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js +0 -0
  154. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js.map +0 -0
  155. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts +0 -0
  156. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts.map +0 -0
  157. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js +0 -0
  158. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js.map +0 -0
  159. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts +0 -0
  160. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -0
  161. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +0 -0
  162. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +0 -0
  163. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts +0 -0
  164. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +0 -0
  165. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js +0 -0
  166. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js.map +0 -0
  167. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts +0 -0
  168. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +0 -0
  169. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js +0 -0
  170. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js.map +0 -0
  171. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts +0 -0
  172. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts.map +0 -0
  173. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js +0 -0
  174. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js.map +0 -0
  175. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js +0 -0
  176. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/language.d.ts +0 -0
  177. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/language.d.ts.map +0 -0
  178. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js +0 -0
  179. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.d.ts +0 -0
  180. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.d.ts.map +0 -0
  181. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.js +0 -0
  182. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.js.map +0 -0
  183. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts +0 -0
  184. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts.map +0 -0
  185. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js +0 -0
  186. /package/.rollup.cache/home/runner/work/{captcha-private/captcha-private → captcha}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js.map +0 -0
@@ -1,615 +0,0 @@
1
- import { j as i, a as I, P as _, b as T, c as k, g as ae, p as B, d as se, e as ce, E as ie, C as le } from "./captchaComponentProvider-dcMua0p9.js";
2
- import { r as f, A as b, o as de, P as X, R as ue } from "./emotion-element-5486c51c.browser.esm-Bywq83R5.js";
3
- import { b as M, d as S, a as w, l as he } from "./index-BTlHNFX8.js";
4
- import { u as q, b as pe, s as ge, a as fe, c as me } from "./useTranslation-7b6JJ18N.js";
5
- import { h as W } from "./hash-CtL1HOjf.js";
6
- import { r as xe } from "./asU8a-JliaME7-.js";
7
- const Ce = (t) => Array.isArray(t) && t !== null, O = new Array(256), Y = new Array(256 * 256);
8
- for (let t = 0; t < 256; t++)
9
- O[t] = t.toString(16).padStart(2, "0");
10
- for (let t = 0; t < 256; t++) {
11
- const e = t << 8;
12
- for (let r = 0; r < 256; r++)
13
- Y[e | r] = O[t] + O[r];
14
- }
15
- function U(t, e) {
16
- const r = t.length % 2 | 0, a = t.length - r | 0;
17
- for (let n = 0; n < a; n += 2)
18
- e += Y[t[n] << 8 | t[n + 1]];
19
- return r && (e += O[t[a] | 0]), e;
20
- }
21
- function be(t, e = -1, r = !0) {
22
- const a = r ? "0x" : "";
23
- if (!(t != null && t.length))
24
- return a;
25
- if (e > 0) {
26
- const n = Math.ceil(e / 8);
27
- if (t.length > n)
28
- return `${U(t.subarray(0, n / 2), a)}…${U(t.subarray(t.length - n / 2), "")}`;
29
- }
30
- return U(t, a);
31
- }
32
- const we = (t) => Ce(t) ? be(new Uint8Array(t)) : t.toString(), Ae = {
33
- border: "none",
34
- paddingTop: "6px",
35
- paddingBottom: "6px",
36
- cursor: "pointer",
37
- height: "39px",
38
- width: "39px",
39
- borderRadius: "50%"
40
- }, ye = ({ themeColor: t, onReload: e }) => {
41
- const r = f.useMemo(() => t === "light" ? M : S, [t]), [a, n] = f.useState(!1), s = f.useMemo(() => ({
42
- ...{
43
- ...Ae,
44
- backgroundColor: r.palette.background.default,
45
- color: a ? r.palette.primary.contrastText : r.palette.background.contrastText
46
- },
47
- backgroundColor: a ? r.palette.grey[700] : r.palette.background.default
48
- }), [a, r]);
49
- return i("button", { className: "reload-button", "aria-label": "Reload", type: "button", style: s, onMouseEnter: () => n(!0), onMouseLeave: () => n(!1), onClick: (o) => {
50
- o.preventDefault(), e();
51
- }, children: I("svg", { width: "27px", height: "27px", viewBox: "0 0 27 27", version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", children: [i("title", { children: "reload" }), i("path", { fill: s.color, transform: "scale(0.0703125)", d: "M234.666667,149.333333 L234.666667,106.666667 L314.564847,106.664112 C287.579138,67.9778918 242.745446,42.6666667 192,42.6666667 C109.525477,42.6666667 42.6666667,109.525477 42.6666667,192 C42.6666667,274.474523 109.525477,341.333333 192,341.333333 C268.201293,341.333333 331.072074,284.258623 340.195444,210.526102 L382.537159,215.817985 C370.807686,310.617565 289.973536,384 192,384 C85.961328,384 1.42108547e-14,298.038672 1.42108547e-14,192 C1.42108547e-14,85.961328 85.961328,1.42108547e-14 192,1.42108547e-14 C252.316171,1.42108547e-14 306.136355,27.8126321 341.335366,71.3127128 L341.333333,1.42108547e-14 L384,1.42108547e-14 L384,149.333333 L234.666667,149.333333 Z" })] }) });
52
- }, Ee = (t) => {
53
- if (!t.hash)
54
- throw new _("CAPTCHA.MISSING_ITEM_HASH", {
55
- context: { item: t }
56
- });
57
- return t.hash;
58
- }, Te = ({ challenge: t, solution: e, onClick: r, themeColor: a }) => {
59
- const n = t.items, s = f.useMemo(() => a === "light" ? M : S, [a]), o = `${s.spacing.half}px`;
60
- return i("div", { style: {
61
- width: "100%",
62
- height: "100%",
63
- display: "flex",
64
- flexDirection: "row",
65
- flexWrap: "wrap",
66
- justifyContent: "space-between",
67
- paddingBottom: o,
68
- paddingRight: o
69
- }, children: n.map((d, l) => {
70
- const u = Ee(d);
71
- return i("div", { style: {
72
- flexGrow: 1,
73
- flexBasis: "33.3333%",
74
- boxSizing: "border-box",
75
- paddingLeft: o,
76
- paddingTop: o
77
- }, children: I("div", { style: {
78
- position: "relative",
79
- cursor: "pointer",
80
- height: "100%",
81
- width: "100%",
82
- border: 1,
83
- padding: 0,
84
- margin: 0,
85
- borderStyle: "solid",
86
- borderColor: s.palette.grey[300]
87
- }, onClick: () => r(u), children: [i("img", { style: {
88
- width: "100%",
89
- backgroundColor: s.palette.grey[300],
90
- display: "block",
91
- objectFit: "contain",
92
- aspectRatio: "1/1",
93
- height: "auto"
94
- }, src: d.data, alt: `Captcha image ${l + 1}` }), i("div", { style: {
95
- position: "absolute",
96
- top: 0,
97
- left: 0,
98
- bottom: 0,
99
- right: 0,
100
- height: "100%",
101
- width: "100%",
102
- display: "flex",
103
- alignItems: "center",
104
- justifyContent: "center",
105
- backgroundColor: "rgba(0,0,0,0.5)",
106
- visibility: e.includes(u) ? "visible" : "hidden"
107
- }, children: i("svg", { style: {
108
- backgroundColor: "transparent",
109
- display: "block",
110
- width: "35%",
111
- height: "35%",
112
- transition: "fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
113
- userSelect: "none",
114
- fill: "currentcolor"
115
- }, focusable: "false", color: "#fff", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "CheckIcon", "aria-label": "Check icon", children: i("path", { d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }) }) })] }) }, d.hash);
116
- }) });
117
- };
118
- function ve(t = {}) {
119
- return Object.keys(t).reduce((e, r) => ({ ...e, [`data-${r}`]: t[r] }), {});
120
- }
121
- function Z({ general: t, dev: e }) {
122
- return {
123
- ...ve(t)
124
- };
125
- }
126
- const Ie = {
127
- display: "inline-flex",
128
- alignItems: "center",
129
- justifyContent: "center",
130
- position: "relative",
131
- boxSizing: "border-box",
132
- outline: "0px",
133
- border: "0px",
134
- margin: "0px",
135
- cursor: "pointer",
136
- userSelect: "none",
137
- verticalAlign: "middle",
138
- appearance: void 0,
139
- textDecoration: "none",
140
- fontWeight: "500",
141
- fontSize: "0.875rem",
142
- lineHeight: "1.75",
143
- letterSpacing: "0.02857em",
144
- textTransform: "uppercase",
145
- minWidth: "64px",
146
- padding: "6px 16px",
147
- borderRadius: "4px",
148
- transition: "background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
149
- color: "rgb(0, 0, 0)",
150
- backgroundColor: "#ffffff",
151
- boxShadow: "rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px"
152
- }, j = ({ themeColor: t, buttonType: e, text: r, onClick: a }) => {
153
- const n = f.useMemo(() => t === "light" ? M : S, [t]), [s, o] = f.useState(!1), d = f.useMemo(() => {
154
- const l = {
155
- ...Ie,
156
- color: s ? n.palette.primary.contrastText : n.palette.background.contrastText
157
- };
158
- return e === "cancel" ? {
159
- ...l,
160
- backgroundColor: s ? n.palette.grey[600] : "transparent"
161
- } : {
162
- ...l,
163
- backgroundColor: s ? n.palette.primary.main : n.palette.background.default
164
- };
165
- }, [e, s, n]);
166
- return i("button", { ...Z({ dev: {} }), onMouseEnter: () => o(!0), onMouseLeave: () => o(!1), style: d, onClick: (l) => {
167
- l.preventDefault(), a();
168
- }, "aria-label": r, children: r });
169
- }, z = ({ challenge: t, index: e, solutions: r, onSubmit: a, onCancel: n, onClick: s, onNext: o, onReload: d, themeColor: l }) => {
170
- const { t: u } = q(), h = t.captchas ? w(t.captchas, e) : null, y = r ? w(r, e) : [], C = f.useMemo(() => l === "light" ? M : S, [l]), m = `${C.spacing.unit}px`, A = `${C.spacing.half}px`;
171
- return i(f.Suspense, { fallback: i("div", { children: "Loading..." }), children: i("div", { style: {
172
- overflowX: "auto",
173
- overflowY: "auto",
174
- width: "100%",
175
- maxWidth: "500px",
176
- maxHeight: "100%",
177
- display: "flex",
178
- flexDirection: "column",
179
- border: "1px solid #dddddd",
180
- boxShadow: "rgba(255, 255, 255, 0.2) 0px 0px 4px",
181
- borderRadius: "4px",
182
- backgroundColor: C.palette.background.default,
183
- userSelect: "none",
184
- touchAction: "none",
185
- overscrollBehavior: "none"
186
- }, children: I("div", { style: {
187
- backgroundColor: C.palette.background.default,
188
- display: "flex",
189
- flexDirection: "column",
190
- minWidth: "300px"
191
- }, children: [i("div", { style: {
192
- display: "flex",
193
- alignItems: "center",
194
- width: "100%"
195
- }, children: i("div", { style: {
196
- backgroundColor: C.palette.primary.main,
197
- width: "100%",
198
- marginTop: m,
199
- marginLeft: m,
200
- marginRight: m
201
- }, children: I("div", { style: {
202
- paddingLeft: `${C.spacing.half}px`,
203
- paddingRight: `${C.spacing.half}px`
204
- }, children: [I("p", { style: {
205
- color: "#ffffff",
206
- fontWeight: 700,
207
- lineHeight: 1.5
208
- }, children: [u("WIDGET.SELECT_ALL"), ":", " ", i("span", { children: `${u(w(t.captchas, e).target)} ` })] }), i("p", { style: {
209
- color: "#ffffff",
210
- fontWeight: 500,
211
- lineHeight: 0.8,
212
- fontSize: "0.8rem"
213
- }, children: u("WIDGET.IF_NONE_CLICK_NEXT") })] }) }) }), i("div", { ...Z({ dev: {} }), style: {
214
- paddingRight: A,
215
- paddingLeft: A
216
- }, children: h && i(Te, { challenge: h, solution: y, onClick: s, themeColor: l }) }), i("div", { style: {
217
- display: "flex",
218
- alignItems: "center",
219
- justifyContent: "space-between",
220
- lineHeight: 1.75,
221
- padding: m,
222
- paddingBottom: A,
223
- paddingTop: A
224
- }, children: I("div", { style: {
225
- display: "grid",
226
- gridAutoFlow: "column",
227
- gridTemplateColumns: "repeat(3, minmax(0, 1fr)",
228
- width: "100%"
229
- }, children: [i("div", { style: { justifySelf: "left" }, children: i(j, { themeColor: l, buttonType: "cancel", onClick: n, text: u("WIDGET.CANCEL"), "aria-label": u("WIDGET.CANCEL") }) }), i("div", { style: { justifySelf: "center" }, children: i(ye, { themeColor: l, onReload: d }) }), i("div", { style: { justifySelf: "right" }, children: i(j, { themeColor: l, buttonType: "next", text: e < t.captchas.length - 1 ? u("WIDGET.NEXT") : u("WIDGET.SUBMIT"), onClick: e < t.captchas.length - 1 ? o : a, "aria-label": e < t.captchas.length - 1 ? u("WIDGET.NEXT") : u("WIDGET.SUBMIT"), "data-cy": "button-next" }) })] }) })] }) }) });
230
- };
231
- function Ne(t) {
232
- return W([
233
- t.captchaId,
234
- t.captchaContentId,
235
- [...t.solution].sort(),
236
- t.salt
237
- ]);
238
- }
239
- class $ {
240
- constructor(e) {
241
- this.hash = e, this.parent = null;
242
- }
243
- }
244
- class ke {
245
- constructor() {
246
- this.leaves = [], this.layers = [];
247
- }
248
- getRoot() {
249
- if (this.root === void 0)
250
- throw new T("DATASET.MERKLE_ERROR", {
251
- context: {
252
- error: "root undefined",
253
- failedFuncName: this.getRoot.name
254
- }
255
- });
256
- return this.root;
257
- }
258
- build(e) {
259
- this.layers.length && (this.layers = []);
260
- const r = [];
261
- for (const a of e) {
262
- const n = new $(a);
263
- this.leaves.push(n), r.push(n.hash);
264
- }
265
- this.layers.push(r), this.root = this.buildMerkleTree(this.leaves)[0];
266
- }
267
- buildMerkleTree(e) {
268
- const r = e.length;
269
- if (r === 1)
270
- return e;
271
- const a = [];
272
- let n = 0;
273
- const s = [];
274
- for (; n < r; ) {
275
- const o = e[n];
276
- if (o === void 0)
277
- throw new T("DEVELOPER.GENERAL", {
278
- context: { error: "leftChild undefined" }
279
- });
280
- const d = n + 1 < r ? w(e, n + 1) : o, l = this.createParent(o, d);
281
- s.push(l.hash), a.push(l), n += 2;
282
- }
283
- return this.layers.push(s), this.buildMerkleTree(a);
284
- }
285
- createParent(e, r) {
286
- const a = new $(W([e.hash, r.hash]));
287
- return e.parent = a.hash, r.parent = a.hash, a;
288
- }
289
- proof(e) {
290
- const r = [];
291
- let a = 0;
292
- for (; a < this.layers.length - 1; ) {
293
- const s = this.layers[a];
294
- if (s === void 0)
295
- throw new T("DATASET.MERKLE_ERROR", {
296
- context: {
297
- error: "layer undefined",
298
- failedFuncName: this.proof.name,
299
- layerNum: a
300
- }
301
- });
302
- const o = s.indexOf(e);
303
- let d = o % 2 && o > 0 ? o - 1 : o + 1;
304
- d > s.length - 1 && (d = o);
305
- const l = [e], u = w(s, d);
306
- d > o ? l.push(u) : l.unshift(u), r.push([w(l, 0), w(l, 1)]), a += 1, e = W(l);
307
- }
308
- const n = w(this.layers, this.layers.length - 1);
309
- return [...r, [w(n, 0)]];
310
- }
311
- }
312
- class F {
313
- constructor(e, r, a, n, s) {
314
- this.userAccount = e, this.provider = r, this.providerApi = a, this._web2 = n, this.dappAccount = s;
315
- }
316
- get web2() {
317
- return this._web2;
318
- }
319
- async getCaptchaChallenge(e) {
320
- try {
321
- const r = await this.providerApi.getCaptchaChallenge(this.userAccount, this.provider, e);
322
- if (r[b.error])
323
- return r;
324
- for (const a of r.captchas)
325
- for (const n of a.items)
326
- n.data && (n.data = `https://${n.data.replace(/^http(s)*:\/\//, "")}`);
327
- return r;
328
- } catch (r) {
329
- throw new k("CAPTCHA.INVALID_CAPTCHA_CHALLENGE", {
330
- context: { error: r }
331
- });
332
- }
333
- }
334
- async submitCaptchaSolution(e, r, a, n, s) {
335
- const o = new ke(), d = a.map((y) => Ne(y));
336
- if (o.build(d), !o.root)
337
- throw new _("CAPTCHA.INVALID_CAPTCHA_CHALLENGE", {
338
- context: { error: "Merkle tree root is undefined" }
339
- });
340
- const l = o.root.hash, u = void 0;
341
- let h;
342
- try {
343
- h = await this.providerApi.submitCaptchaSolution(a, r, this.userAccount, n, s, e);
344
- } catch (y) {
345
- throw new _("CAPTCHA.INVALID_CAPTCHA_CHALLENGE", {
346
- context: { error: y }
347
- });
348
- }
349
- return [h, l, u];
350
- }
351
- }
352
- const He = () => ({
353
- showModal: !1,
354
- loading: !1,
355
- index: 0,
356
- challenge: void 0,
357
- solutions: void 0,
358
- isHuman: !1,
359
- captchaApi: void 0,
360
- account: void 0
361
- });
362
- function Re(t, e, r, a, n) {
363
- const s = ae(a), o = pe(e, r), d = () => {
364
- const c = {
365
- userAccountAddress: "",
366
- ...t
367
- };
368
- return e.account && (c.userAccountAddress = e.account.account.address), X.parse(c);
369
- }, l = async () => {
370
- s.onOpen(), await B(async () => {
371
- var R;
372
- if (e.loading || e.isHuman)
373
- return;
374
- o({ loading: !0 }), o({
375
- attemptCount: e.attemptCount ? e.attemptCount + 1 : 1
376
- }), o({
377
- sessionId: n == null ? void 0 : n.sessionId
378
- });
379
- const c = d();
380
- o({ dappAccount: c.account.address }), await fe(100);
381
- const g = await Q();
382
- let x = e.captchaApi;
383
- if (n != null && n.provider) {
384
- const N = n.provider.provider.url, E = await A(N);
385
- x = new F(g.account.address, n.provider, E, c.web2, c.account.address || ""), o({ captchaApi: x });
386
- } else {
387
- const N = await se(d()), E = N.provider.url, v = await A(E);
388
- x = new F(g.account.address, N, v, c.web2, c.account.address || ""), o({ captchaApi: x });
389
- }
390
- const p = await (x == null ? void 0 : x.getCaptchaChallenge(e.sessionId));
391
- if (p.error)
392
- o({
393
- loading: !1,
394
- error: {
395
- message: p.error.message,
396
- key: p.error.key || "API.UNKNOWN_ERROR"
397
- }
398
- }), s.onError(new Error((R = p.error) == null ? void 0 : R.message));
399
- else {
400
- if (p.captchas.length <= 0)
401
- throw new _("DEVELOPER.PROVIDER_NO_CAPTCHA");
402
- const N = p.captchas.map((v) => v.timeLimitMs || c.captchas.image.challengeTimeout).reduce((v, P) => v + P), E = setTimeout(() => {
403
- s.onChallengeExpired(), o({ isHuman: !1, showModal: !1, loading: !1 });
404
- }, N);
405
- o({
406
- index: 0,
407
- solutions: p.captchas.map(() => []),
408
- challenge: p,
409
- showModal: !0,
410
- timeout: E,
411
- loading: !1
412
- });
413
- }
414
- }, l, L, e.attemptCount, 10);
415
- }, u = async () => {
416
- await B(async () => {
417
- if (H(), !e.challenge)
418
- throw new T("CAPTCHA.NO_CAPTCHA", {
419
- context: { error: "Cannot submit, no Captcha found in state" }
420
- });
421
- o({ showModal: !1 });
422
- const c = e.challenge, g = xe(), x = e.challenge.captchas.map((D, oe) => {
423
- const re = w(e.solutions, oe);
424
- return {
425
- captchaId: D.captchaId,
426
- captchaContentId: D.captchaContentId,
427
- salt: g,
428
- solution: re
429
- };
430
- }), p = G(), R = te(p).signer;
431
- if (!w(c.captchas, 0).datasetId)
432
- throw new _("CAPTCHA.INVALID_CAPTCHA_ID", {
433
- context: { error: "No datasetId set for challenge" }
434
- });
435
- const E = e.captchaApi;
436
- if (!E)
437
- throw new T("CAPTCHA.INVALID_TOKEN", {
438
- context: { error: "No Captcha API found in state" }
439
- });
440
- if (!R || !R.signRaw)
441
- throw new k("GENERAL.CANT_FIND_KEYRINGPAIR", {
442
- context: {
443
- error: "Signer is not defined, cannot sign message to prove account ownership"
444
- }
445
- });
446
- const v = await R.signRaw({
447
- address: p.account.address,
448
- data: ge(c[b.timestamp]),
449
- type: "bytes"
450
- }), P = await E.submitCaptchaSolution(v.signature, c.requestHash, x, c.timestamp, c.signature.provider.requestHash), ne = P[0].verified;
451
- if (o({
452
- submission: P,
453
- isHuman: ne,
454
- loading: !1
455
- }), e.isHuman) {
456
- const D = E.provider.provider.url;
457
- s.onHuman(de({
458
- [b.providerUrl]: D,
459
- [b.user]: p.account.address,
460
- [b.dapp]: ee(),
461
- [b.commitmentId]: we(P[1]),
462
- [b.timestamp]: c.timestamp,
463
- [b.signature]: {
464
- [b.provider]: {
465
- [b.requestHash]: c.signature.provider.requestHash
466
- },
467
- [b.user]: {
468
- [b.timestamp]: v.signature
469
- }
470
- }
471
- })), J();
472
- } else
473
- s.onFailed(), L(n == null ? void 0 : n.restart);
474
- }, l, L, e.attemptCount, 10);
475
- }, h = async () => {
476
- H(), L(n == null ? void 0 : n.restart), s.onClose();
477
- }, y = async () => {
478
- H(), s.onReload(), L(n == null ? void 0 : n.restart), n != null && n.restart || await l();
479
- }, C = (c) => {
480
- if (!e.challenge)
481
- throw new T("CAPTCHA.NO_CAPTCHA", {
482
- context: { error: "Cannot select, no Captcha found in state" }
483
- });
484
- if (e.index >= e.challenge.captchas.length || e.index < 0)
485
- throw new T("CAPTCHA.NO_CAPTCHA", {
486
- context: {
487
- error: "Cannot select, index is out of range for this Captcha"
488
- }
489
- });
490
- const g = e.index, x = e.solutions, p = w(x, g);
491
- p.includes(c) ? p.splice(p.indexOf(c), 1) : p.push(c), o({ solutions: x });
492
- }, m = () => {
493
- if (!e.challenge)
494
- throw new T("CAPTCHA.NO_CAPTCHA", {
495
- context: { error: "Cannot select, no Captcha found in state" }
496
- });
497
- if (e.index + 1 >= e.challenge.captchas.length)
498
- throw new T("CAPTCHA.NO_CAPTCHA", {
499
- context: {
500
- error: "Cannot select, index is out of range for this Captcha"
501
- }
502
- });
503
- o({ index: e.index + 1 });
504
- }, A = async (c) => {
505
- const g = d();
506
- if (!g.account.address)
507
- throw new k("GENERAL.SITE_KEY_MISSING");
508
- return new ce(c, g.account.address);
509
- }, H = () => {
510
- window.clearTimeout(Number(e.timeout)), o({ timeout: void 0 });
511
- }, J = () => {
512
- const c = t.captchas.image.solutionTimeout, g = setTimeout(() => {
513
- o({ isHuman: !1 }), s.onExpired();
514
- }, c);
515
- o({ successfullChallengeTimeout: g });
516
- }, L = (c) => {
517
- H(), o(He()), s.onReset(), c && c();
518
- }, Q = async () => {
519
- const c = d();
520
- if (!c.web2 && !c.userAccountAddress)
521
- throw new k("GENERAL.ACCOUNT_NOT_FOUND", {
522
- context: { error: "Account address has not been set for web3 mode" }
523
- });
524
- const x = await (async () => {
525
- const p = new (await ie(c.web2))();
526
- return n ? n.userAccount : await p.getAccount(c);
527
- })();
528
- return o({ account: x }), G();
529
- }, G = () => {
530
- if (!e.account)
531
- throw new k("GENERAL.ACCOUNT_NOT_FOUND", {
532
- context: { error: "Account not loaded" }
533
- });
534
- return e.account;
535
- }, ee = () => {
536
- if (!e.dappAccount)
537
- throw new k("GENERAL.SITE_KEY_MISSING");
538
- return e.dappAccount;
539
- }, te = (c) => {
540
- const g = c || G();
541
- if (!g.extension)
542
- throw new k("ACCOUNT.NO_POLKADOT_EXTENSION", {
543
- context: { error: "Extension not loaded" }
544
- });
545
- return g.extension;
546
- };
547
- return {
548
- start: l,
549
- cancel: h,
550
- submit: u,
551
- select: C,
552
- nextRound: m,
553
- reload: y
554
- };
555
- }
556
- const K = ue.memo((t, e) => {
557
- const { show: r, children: a } = t, s = {
558
- position: "fixed",
559
- zIndex: 2147483646,
560
- inset: 0,
561
- display: r ? "block" : "none"
562
- }, o = {
563
- position: "fixed",
564
- display: "flex",
565
- alignItems: "center",
566
- justifyContent: "center",
567
- right: 0,
568
- bottom: 0,
569
- top: 0,
570
- left: 0,
571
- backgroundColor: "rgba(0, 0, 0, 0.5)",
572
- zIndex: -1
573
- }, d = {
574
- position: "absolute",
575
- top: "50%",
576
- left: "50%",
577
- transform: "translate(-50%, -50%)",
578
- width: "inherit",
579
- backgroundColor: "transparent",
580
- border: "none",
581
- boxShadow: "rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px,"
582
- };
583
- return I("div", { className: "prosopo-modalOuter", style: s, children: [i("div", { className: "prosopo-modalBackground", style: o }), i("div", { className: "prosopo-modalInner", style: d, children: a })] });
584
- }), V = "procaptcha:execute", Oe = (t) => {
585
- var C;
586
- const { t: e } = q(), r = X.parse(t.config), a = t.frictionlessState, n = t.i18n, s = t.callbacks || {}, [o, d] = me(f.useState, f.useRef), [l, u] = f.useState(!1), h = Re(r, o, d, s, a), y = t.config.theme === "light" ? M : S;
587
- return f.useEffect(() => {
588
- r.language && (n ? n.language !== r.language && n.changeLanguage(r.language).then((m) => m) : he().then((m) => {
589
- m.language !== r.language && m.changeLanguage(r.language).then((A) => A);
590
- }));
591
- }, [n, r.language]), f.useEffect(() => {
592
- o.error && (u(!1), o.error.key === "CAPTCHA.NO_SESSION_FOUND" && a && setTimeout(() => {
593
- a.restart();
594
- }, 3e3));
595
- }, [o.error, a]), f.useEffect(() => {
596
- const m = (A) => {
597
- if (d({
598
- showModal: !0
599
- }), !o.challenge && h.start)
600
- try {
601
- h.start();
602
- } catch (H) {
603
- console.error("Error starting verification:", H);
604
- }
605
- };
606
- return document.addEventListener(V, m), () => {
607
- document.removeEventListener(V, m);
608
- };
609
- }, [h, o.challenge, d]), r.mode === "invisible" ? i(K, { show: o.showModal, children: o.challenge ? i(z, { challenge: o.challenge, index: o.index, solutions: o.solutions, onSubmit: h.submit, onCancel: h.cancel, onClick: h.select, onNext: h.nextRound, onReload: h.reload, themeColor: r.theme ?? "light" }) : null }) : I("div", { className: "image-captcha", children: [i(K, { show: o.showModal, children: o.challenge ? i(z, { challenge: o.challenge, index: o.index, solutions: o.solutions, onSubmit: h.submit, onCancel: h.cancel, onClick: h.select, onNext: h.nextRound, onReload: h.reload, themeColor: r.theme ?? "light" }) : i("div", { children: "No challenge set." }) }), i(le, { theme: y, onChange: async () => {
610
- l || (u(!0), await h.start(), u(!1));
611
- }, checked: o.isHuman, labelText: e("WIDGET.I_AM_HUMAN"), error: (C = o.error) == null ? void 0 : C.message, "aria-label": "human checkbox", loading: l })] });
612
- };
613
- export {
614
- Oe as default
615
- };