@prosopo/procaptcha-bundle 3.2.2 → 3.2.9

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 (262) hide show
  1. package/CHANGELOG.md +91 -0
  2. package/dist/cjs/util/captcha/captchaComponentProvider.cjs +1 -1
  3. package/dist/cjs/util/captcha/captchaRenderer.cjs +1 -1
  4. package/dist/cjs/util/captcha/components/frictionlessCaptcha.cjs +1 -1
  5. package/dist/cjs/util/captcha/components/imageCaptcha.cjs +1 -1
  6. package/dist/cjs/util/captcha/components/powCaptcha.cjs +1 -1
  7. package/dist/util/captcha/captchaComponentProvider.js +1 -1
  8. package/dist/util/captcha/captchaRenderer.js +1 -1
  9. package/dist/util/captcha/components/frictionlessCaptcha.js +1 -1
  10. package/dist/util/captcha/components/imageCaptcha.js +1 -1
  11. package/dist/util/captcha/components/powCaptcha.js +1 -1
  12. package/package.json +13 -13
  13. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts +0 -5
  14. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts.map +0 -1
  15. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.js +0 -5
  16. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.js.map +0 -1
  17. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts +0 -16
  18. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +0 -1
  19. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.js +0 -144
  20. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +0 -1
  21. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/procaptchaReady.unit.test.d.ts +0 -2
  22. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/procaptchaReady.unit.test.d.ts.map +0 -1
  23. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/procaptchaReady.unit.test.js +0 -32
  24. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/procaptchaReady.unit.test.js.map +0 -1
  25. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.d.ts +0 -2
  26. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.d.ts.map +0 -1
  27. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js +0 -36
  28. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js.map +0 -1
  29. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.d.ts +0 -2
  30. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.d.ts.map +0 -1
  31. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.js +0 -69
  32. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.js.map +0 -1
  33. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.d.ts +0 -2
  34. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.d.ts.map +0 -1
  35. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +0 -136
  36. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +0 -1
  37. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts +0 -8
  38. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +0 -1
  39. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +0 -15
  40. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +0 -1
  41. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts +0 -6
  42. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +0 -1
  43. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js +0 -11
  44. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js.map +0 -1
  45. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts +0 -10
  46. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +0 -1
  47. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js +0 -2
  48. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js.map +0 -1
  49. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +0 -24
  50. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +0 -1
  51. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +0 -49
  52. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +0 -1
  53. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts +0 -3
  54. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts.map +0 -1
  55. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js +0 -8
  56. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js.map +0 -1
  57. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts +0 -4
  58. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
  59. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +0 -14
  60. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +0 -1
  61. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts +0 -4
  62. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +0 -1
  63. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js +0 -9
  64. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js.map +0 -1
  65. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts +0 -4
  66. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +0 -1
  67. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js +0 -9
  68. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js.map +0 -1
  69. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts +0 -6
  70. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts.map +0 -1
  71. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js +0 -13
  72. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js.map +0 -1
  73. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts +0 -5
  74. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts.map +0 -1
  75. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js +0 -23
  76. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js.map +0 -1
  77. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/language.d.ts +0 -3
  78. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/language.d.ts.map +0 -1
  79. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js +0 -17
  80. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js.map +0 -1
  81. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.d.ts +0 -3
  82. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.d.ts.map +0 -1
  83. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.js +0 -9
  84. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.js.map +0 -1
  85. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts +0 -18
  86. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +0 -1
  87. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +0 -66
  88. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +0 -1
  89. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts +0 -9
  90. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts.map +0 -1
  91. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js +0 -19
  92. package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js.map +0 -1
  93. package/coverage/base.css +0 -224
  94. package/coverage/block-navigation.js +0 -87
  95. package/coverage/clover.xml +0 -599
  96. package/coverage/coverage-final.json +0 -17
  97. package/coverage/favicon.png +0 -0
  98. package/coverage/index.html +0 -161
  99. package/coverage/prettify.css +0 -1
  100. package/coverage/prettify.js +0 -2
  101. package/coverage/sort-arrow-sprite.png +0 -0
  102. package/coverage/sorter.js +0 -210
  103. package/coverage/src/components.ts.html +0 -139
  104. package/coverage/src/index.html +0 -131
  105. package/coverage/src/index.ts.html +0 -844
  106. package/coverage/src/util/captcha/captchaComponentProvider.tsx.html +0 -214
  107. package/coverage/src/util/captcha/captchaComponentsList.ts.html +0 -178
  108. package/coverage/src/util/captcha/captchaProps.ts.html +0 -166
  109. package/coverage/src/util/captcha/captchaRenderer.tsx.html +0 -481
  110. package/coverage/src/util/captcha/captchaType.ts.html +0 -181
  111. package/coverage/src/util/captcha/components/frictionlessCaptcha.tsx.html +0 -205
  112. package/coverage/src/util/captcha/components/imageCaptcha.tsx.html +0 -178
  113. package/coverage/src/util/captcha/components/index.html +0 -146
  114. package/coverage/src/util/captcha/components/powCaptcha.tsx.html +0 -178
  115. package/coverage/src/util/captcha/index.html +0 -176
  116. package/coverage/src/util/config.ts.html +0 -172
  117. package/coverage/src/util/configCreator.ts.html +0 -241
  118. package/coverage/src/util/index.html +0 -191
  119. package/coverage/src/util/language.ts.html +0 -244
  120. package/coverage/src/util/timeout.ts.html +0 -214
  121. package/coverage/src/util/widgetFactory.ts.html +0 -532
  122. package/coverage/src/util/widgetThemeResolver.ts.html +0 -205
  123. package/dist/bundle/ProcaptchaWidget-CuMH13Bh.js +0 -1012
  124. package/dist/bundle/ProcaptchaWidget-DsflBBn_.js +0 -187
  125. package/dist/bundle/Signer-DP9drQ55.js +0 -23
  126. package/dist/bundle/bnChunk-DRlDxTFg.js +0 -1137
  127. package/dist/bundle/browser-ponyfill-DXriyH6D.js +0 -339
  128. package/dist/bundle/builder-ByZ5z580.js +0 -46
  129. package/dist/bundle/captchaComponentProvider-D02Su4nd.js +0 -1013
  130. package/dist/bundle/captchaRenderer-BV-WgbEA.js +0 -70
  131. package/dist/bundle/commonChunk-PB26mndo.js +0 -183
  132. package/dist/bundle/components.d.ts.map +0 -1
  133. package/dist/bundle/emotion-element-c39617d8.browser.esm-DG1XhEZ1.js +0 -916
  134. package/dist/bundle/fp.esm-DYWeNGcH.js +0 -1654
  135. package/dist/bundle/index-B9KeZfID.js +0 -5416
  136. package/dist/bundle/index-Calnfnac.js +0 -609
  137. package/dist/bundle/index-DU371vQ0.js +0 -1634
  138. package/dist/bundle/index.d.ts.map +0 -1
  139. package/dist/bundle/locales/ar/translation.json +0 -57
  140. package/dist/bundle/locales/az/translation.json +0 -57
  141. package/dist/bundle/locales/cs/translation.json +0 -57
  142. package/dist/bundle/locales/de/translation.json +0 -57
  143. package/dist/bundle/locales/el/translation.json +0 -57
  144. package/dist/bundle/locales/en/translation.json +0 -57
  145. package/dist/bundle/locales/es/translation.json +0 -57
  146. package/dist/bundle/locales/fi/translation.json +0 -57
  147. package/dist/bundle/locales/fr/translation.json +0 -57
  148. package/dist/bundle/locales/hi/translation.json +0 -57
  149. package/dist/bundle/locales/hu/translation.json +0 -57
  150. package/dist/bundle/locales/id/translation.json +0 -57
  151. package/dist/bundle/locales/it/translation.json +0 -57
  152. package/dist/bundle/locales/ja/translation.json +0 -57
  153. package/dist/bundle/locales/jv/translation.json +0 -57
  154. package/dist/bundle/locales/ko/translation.json +0 -57
  155. package/dist/bundle/locales/ml/translation.json +0 -57
  156. package/dist/bundle/locales/ms/translation.json +0 -57
  157. package/dist/bundle/locales/nl/translation.json +0 -57
  158. package/dist/bundle/locales/no/translation.json +0 -57
  159. package/dist/bundle/locales/pl/translation.json +0 -57
  160. package/dist/bundle/locales/pt/translation.json +0 -57
  161. package/dist/bundle/locales/pt-BR/translation.json +0 -57
  162. package/dist/bundle/locales/ro/translation.json +0 -57
  163. package/dist/bundle/locales/ru/translation.json +0 -57
  164. package/dist/bundle/locales/sr/translation.json +0 -57
  165. package/dist/bundle/locales/sv/translation.json +0 -57
  166. package/dist/bundle/locales/th/translation.json +0 -57
  167. package/dist/bundle/locales/tr/translation.json +0 -57
  168. package/dist/bundle/locales/uk/translation.json +0 -57
  169. package/dist/bundle/locales/vi/translation.json +0 -57
  170. package/dist/bundle/locales/zh-CN/translation.json +0 -57
  171. package/dist/bundle/nobleChunk-Bbltwf44.js +0 -2728
  172. package/dist/bundle/procaptcha.bundle.js +0 -8
  173. package/dist/bundle/tests/procaptchaReady.unit.test.d.ts.map +0 -1
  174. package/dist/bundle/tests/util/captchaType.test.d.ts.map +0 -1
  175. package/dist/bundle/tests/util/config.test.d.ts.map +0 -1
  176. package/dist/bundle/tests/util/renderLogic.test.d.ts.map +0 -1
  177. package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +0 -1
  178. package/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +0 -1
  179. package/dist/bundle/util/captcha/captchaProps.d.ts.map +0 -1
  180. package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +0 -1
  181. package/dist/bundle/util/captcha/captchaType.d.ts.map +0 -1
  182. package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
  183. package/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +0 -1
  184. package/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +0 -1
  185. package/dist/bundle/util/config.d.ts.map +0 -1
  186. package/dist/bundle/util/configCreator.d.ts.map +0 -1
  187. package/dist/bundle/util/language.d.ts.map +0 -1
  188. package/dist/bundle/util/timeout.d.ts.map +0 -1
  189. package/dist/bundle/util/widgetFactory.d.ts.map +0 -1
  190. package/dist/bundle/util/widgetThemeResolver.d.ts.map +0 -1
  191. package/dist/bundle/utilChunk-WRTGKXbU.js +0 -324
  192. package/dist/bundle/utilCryptoChunk-B4ZdOwus.js +0 -1236
  193. package/dist/bundle/web2Chunk-BGN6Hv-C.js +0 -3972
  194. package/dist/bundle/web3Chunk-BIX2T9Eo.js +0 -525
  195. package/dist/bundle/zodChunk-CaINhWMQ.js +0 -2882
  196. package/dist/components.d.ts +0 -5
  197. package/dist/components.d.ts.map +0 -1
  198. package/dist/components.js +0 -5
  199. package/dist/components.js.map +0 -1
  200. package/dist/index.d.ts +0 -16
  201. package/dist/index.d.ts.map +0 -1
  202. package/dist/index.js.map +0 -1
  203. package/dist/tests/procaptchaReady.unit.test.d.ts +0 -2
  204. package/dist/tests/procaptchaReady.unit.test.d.ts.map +0 -1
  205. package/dist/tests/procaptchaReady.unit.test.js +0 -32
  206. package/dist/tests/procaptchaReady.unit.test.js.map +0 -1
  207. package/dist/tests/util/captchaType.test.d.ts +0 -2
  208. package/dist/tests/util/captchaType.test.d.ts.map +0 -1
  209. package/dist/tests/util/captchaType.test.js +0 -36
  210. package/dist/tests/util/captchaType.test.js.map +0 -1
  211. package/dist/tests/util/config.test.d.ts +0 -2
  212. package/dist/tests/util/config.test.d.ts.map +0 -1
  213. package/dist/tests/util/config.test.js +0 -69
  214. package/dist/tests/util/config.test.js.map +0 -1
  215. package/dist/tests/util/renderLogic.test.d.ts +0 -2
  216. package/dist/tests/util/renderLogic.test.d.ts.map +0 -1
  217. package/dist/tests/util/renderLogic.test.js +0 -136
  218. package/dist/tests/util/renderLogic.test.js.map +0 -1
  219. package/dist/util/captcha/captchaComponentProvider.d.ts +0 -8
  220. package/dist/util/captcha/captchaComponentProvider.d.ts.map +0 -1
  221. package/dist/util/captcha/captchaComponentProvider.js.map +0 -1
  222. package/dist/util/captcha/captchaComponentsList.d.ts +0 -6
  223. package/dist/util/captcha/captchaComponentsList.d.ts.map +0 -1
  224. package/dist/util/captcha/captchaComponentsList.js.map +0 -1
  225. package/dist/util/captcha/captchaProps.d.ts +0 -10
  226. package/dist/util/captcha/captchaProps.d.ts.map +0 -1
  227. package/dist/util/captcha/captchaProps.js +0 -2
  228. package/dist/util/captcha/captchaProps.js.map +0 -1
  229. package/dist/util/captcha/captchaRenderer.d.ts +0 -24
  230. package/dist/util/captcha/captchaRenderer.d.ts.map +0 -1
  231. package/dist/util/captcha/captchaRenderer.js.map +0 -1
  232. package/dist/util/captcha/captchaType.d.ts +0 -3
  233. package/dist/util/captcha/captchaType.d.ts.map +0 -1
  234. package/dist/util/captcha/captchaType.js.map +0 -1
  235. package/dist/util/captcha/components/frictionlessCaptcha.d.ts +0 -4
  236. package/dist/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
  237. package/dist/util/captcha/components/frictionlessCaptcha.js.map +0 -1
  238. package/dist/util/captcha/components/imageCaptcha.d.ts +0 -4
  239. package/dist/util/captcha/components/imageCaptcha.d.ts.map +0 -1
  240. package/dist/util/captcha/components/imageCaptcha.js.map +0 -1
  241. package/dist/util/captcha/components/powCaptcha.d.ts +0 -4
  242. package/dist/util/captcha/components/powCaptcha.d.ts.map +0 -1
  243. package/dist/util/captcha/components/powCaptcha.js.map +0 -1
  244. package/dist/util/config.d.ts +0 -6
  245. package/dist/util/config.d.ts.map +0 -1
  246. package/dist/util/config.js.map +0 -1
  247. package/dist/util/configCreator.d.ts +0 -5
  248. package/dist/util/configCreator.d.ts.map +0 -1
  249. package/dist/util/configCreator.js.map +0 -1
  250. package/dist/util/language.d.ts +0 -3
  251. package/dist/util/language.d.ts.map +0 -1
  252. package/dist/util/language.js.map +0 -1
  253. package/dist/util/timeout.d.ts +0 -3
  254. package/dist/util/timeout.d.ts.map +0 -1
  255. package/dist/util/timeout.js.map +0 -1
  256. package/dist/util/widgetFactory.d.ts +0 -18
  257. package/dist/util/widgetFactory.d.ts.map +0 -1
  258. package/dist/util/widgetFactory.js.map +0 -1
  259. package/dist/util/widgetThemeResolver.d.ts +0 -9
  260. package/dist/util/widgetThemeResolver.d.ts.map +0 -1
  261. package/dist/util/widgetThemeResolver.js.map +0 -1
  262. package/stats.html +0 -4949
@@ -1,1012 +0,0 @@
1
- import { j as d, a as P, g as ie, p as z, b as ce, P as le, E as de, c as ue, C as he } from "./captchaComponentProvider-D02Su4nd.js";
2
- import { r as C, u as Z, a as v, A, g as pe, h as ge, i as fe, s as me, P as Q, j as xe, l as Ce } from "./web2Chunk-BGN6Hv-C.js";
3
- import { b as _, P as T, a as H } from "./commonChunk-PB26mndo.js";
4
- import { b as we, u as be } from "./builder-ByZ5z580.js";
5
- import { u as U, v as ye } from "./utilCryptoChunk-B4ZdOwus.js";
6
- import { w as Ae } from "./utilChunk-WRTGKXbU.js";
7
- import { l as M, d as D } from "./index-Calnfnac.js";
8
- import { r as ve } from "./index-B9KeZfID.js";
9
- const Ee = {
10
- border: "none",
11
- paddingTop: "6px",
12
- paddingBottom: "6px",
13
- cursor: "pointer",
14
- height: "39px",
15
- width: "39px",
16
- borderRadius: "50%",
17
- display: "flex"
18
- }, Te = ({
19
- themeColor: r,
20
- onReload: e
21
- }) => {
22
- const n = C.useMemo(
23
- () => r === "light" ? M : D,
24
- [r]
25
- ), [o, t] = C.useState(!1), i = C.useMemo(() => ({
26
- ...{
27
- ...Ee,
28
- backgroundColor: n.palette.background.default,
29
- color: o ? n.palette.primary.contrastText : n.palette.background.contrastText,
30
- border: `1px solid ${n.palette.grey[500]}`,
31
- borderRadius: "50%",
32
- transition: "background-color 0.3s",
33
- boxShadow: `0px 1px 3px 0px ${n.palette.grey[500]}`,
34
- justifyContent: "center",
35
- alignItems: "center",
36
- margin: "0 auto"
37
- },
38
- backgroundColor: o ? n.palette.grey[700] : n.palette.background.default
39
- }), [o, n]);
40
- return /* @__PURE__ */ d(
41
- "button",
42
- {
43
- className: "reload-button",
44
- "aria-label": "Reload",
45
- type: "button",
46
- style: i,
47
- onMouseEnter: () => t(!0),
48
- onMouseLeave: () => t(!1),
49
- onClick: (a) => {
50
- a.preventDefault(), e();
51
- },
52
- children: /* @__PURE__ */ P(
53
- "svg",
54
- {
55
- width: "16px",
56
- height: "16px",
57
- viewBox: "0 0 16 16",
58
- version: "1.1",
59
- xmlns: "http://www.w3.org/2000/svg",
60
- xmlnsXlink: "http://www.w3.org/1999/xlink",
61
- style: { display: "flex" },
62
- children: [
63
- /* @__PURE__ */ d("title", { children: "reload" }),
64
- /* @__PURE__ */ d(
65
- "path",
66
- {
67
- shapeRendering: "optimizeQuality",
68
- fill: o ? n.palette.primary.contrastText : n.palette.grey[700],
69
- transform: "scale(0.0416)",
70
- 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"
71
- }
72
- )
73
- ]
74
- }
75
- )
76
- }
77
- );
78
- }, Ie = (r) => {
79
- if (!r.hash)
80
- throw new _("CAPTCHA.MISSING_ITEM_HASH", {
81
- context: { item: r }
82
- });
83
- return r.hash;
84
- }, Ne = ({
85
- challenge: r,
86
- solution: e,
87
- onClick: n,
88
- themeColor: o
89
- }) => {
90
- const t = r.items, i = C.useMemo(
91
- () => o === "light" ? M : D,
92
- [o]
93
- ), a = `${i.spacing.unit}px`;
94
- return /* @__PURE__ */ d(
95
- "div",
96
- {
97
- style: {
98
- // expand to full height / width of parent
99
- width: "100%",
100
- height: "100%",
101
- // display children in flex, spreading them evenly and wrapping when row length exceeded
102
- display: "flex",
103
- flexDirection: "row",
104
- flexWrap: "wrap",
105
- justifyContent: "space-between",
106
- paddingBottom: a,
107
- paddingTop: a,
108
- gap: "10px"
109
- },
110
- children: t.map((s, l) => {
111
- const h = Ie(s);
112
- return /* @__PURE__ */ d("div", { style: {
113
- // enable the items in the grid to grow in width to use up excess space
114
- flexGrow: 1,
115
- // make the width of each item 1/3rd of the width overall, i.e. 3 columns
116
- flexBasis: "calc(33.333% - 10px)",
117
- // include the padding / margin / border in the width
118
- boxSizing: "border-box"
119
- }, children: /* @__PURE__ */ P(
120
- "div",
121
- {
122
- style: {
123
- position: "relative",
124
- cursor: "pointer",
125
- height: "100%",
126
- width: "100%",
127
- padding: 0,
128
- margin: 0
129
- },
130
- onClick: (u) => {
131
- if (u.isTrusted) {
132
- if ("touches" in u && u.touches.length > 0 && u.touches[0]) {
133
- n(h, u.touches[0].clientX, u.touches[0].clientY);
134
- return;
135
- }
136
- if ("clientX" in u && "clientY" in u) {
137
- n(h, u.clientX, u.clientY);
138
- return;
139
- }
140
- n(h, 0, 0);
141
- }
142
- },
143
- children: [
144
- /* @__PURE__ */ d(
145
- "img",
146
- {
147
- style: {
148
- width: "100%",
149
- // image should be full width / height of the item
150
- display: "block",
151
- // removes whitespace below imgs
152
- objectFit: "cover",
153
- // contain the entire image in the img tag
154
- aspectRatio: "1/1",
155
- // force AR to be 1, letterboxing images with different aspect ratios
156
- height: "auto",
157
- // make the img tag responsive to its container
158
- overflow: "hidden",
159
- borderStyle: "solid",
160
- borderWidth: "1px",
161
- borderColor: i.palette.grey[300]
162
- },
163
- src: s.data,
164
- alt: `Captcha image ${l + 1}`,
165
- onError: (u) => {
166
- const f = u.currentTarget;
167
- f._retryCount = (f._retryCount || 0) + 1, f._retryCount <= 3 && (f.src = `${s.data}?retry=${Date.now()}`);
168
- }
169
- }
170
- ),
171
- /* @__PURE__ */ d(
172
- "div",
173
- {
174
- style: {
175
- position: "absolute",
176
- top: 0,
177
- left: 0,
178
- bottom: 0,
179
- right: 0,
180
- height: "100%",
181
- width: "100%",
182
- // display overlays in center
183
- display: "flex",
184
- alignItems: "center",
185
- justifyContent: "center",
186
- // make bg half opacity, i.e. shadowing the item's img
187
- backgroundColor: "rgba(0,0,0,0.5)",
188
- visibility: e.some((u) => u[0] === h) ? "visible" : "hidden"
189
- },
190
- children: /* @__PURE__ */ d(
191
- "svg",
192
- {
193
- style: {
194
- backgroundColor: "transparent",
195
- // img must be displayed as block otherwise gets a bottom whitespace border
196
- display: "block",
197
- // how big the overlay icon is
198
- width: "35%",
199
- height: "35%",
200
- transition: "fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
201
- userSelect: "none",
202
- fill: "currentcolor"
203
- },
204
- focusable: "false",
205
- color: "#fff",
206
- "aria-hidden": "true",
207
- viewBox: "0 0 24 24",
208
- "data-testid": "CheckIcon",
209
- "aria-label": "Check icon",
210
- children: /* @__PURE__ */ d("path", { d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" })
211
- }
212
- )
213
- }
214
- )
215
- ]
216
- }
217
- ) }, s.hash);
218
- })
219
- }
220
- );
221
- };
222
- function He(r = {}) {
223
- return Object.keys(r).reduce(
224
- // biome-ignore lint/performance/noAccumulatingSpread: TODO fix
225
- (e, n) => ({ ...e, [`data-${n}`]: r[n] }),
226
- {}
227
- );
228
- }
229
- function J({
230
- general: r,
231
- dev: e
232
- }) {
233
- return {
234
- ...He(r)
235
- };
236
- }
237
- const Pe = {
238
- display: "inline-flex",
239
- alignItems: "center",
240
- justifyContent: "center",
241
- position: "relative",
242
- boxSizing: "border-box",
243
- outline: "0px",
244
- margin: "0px",
245
- cursor: "pointer",
246
- userSelect: "none",
247
- verticalAlign: "middle",
248
- appearance: void 0,
249
- textDecoration: "none",
250
- fontWeight: "500",
251
- fontSize: "0.875rem",
252
- lineHeight: "1.75",
253
- letterSpacing: "0.02857em",
254
- textTransform: "uppercase",
255
- minWidth: "64px",
256
- padding: "6px 16px",
257
- borderRadius: "4px",
258
- 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",
259
- backgroundColor: "#ffffff"
260
- }, F = ({
261
- themeColor: r,
262
- buttonType: e,
263
- text: n,
264
- onClick: o
265
- }) => {
266
- const t = C.useMemo(
267
- () => r === "light" ? M : D,
268
- [r]
269
- ), [i, a] = C.useState(!1), s = C.useMemo(() => {
270
- const l = {
271
- ...Pe,
272
- border: `1px solid ${t.palette.grey[500]}`,
273
- boxShadow: `0px 1px 3px 0px ${t.palette.grey[500]}`,
274
- fontFamily: t.font.fontFamily,
275
- width: "100%",
276
- color: i ? t.palette.primary.contrastText : t.palette.background.contrastText
277
- };
278
- return e === "cancel" ? {
279
- ...l,
280
- backgroundColor: i ? t.palette.grey[600] : "transparent"
281
- } : {
282
- ...l,
283
- backgroundColor: i ? t.palette.primary.main : t.palette.background.default
284
- };
285
- }, [e, i, t]);
286
- return /* @__PURE__ */ d(
287
- "button",
288
- {
289
- ...J({ dev: {} }),
290
- onMouseEnter: () => a(!0),
291
- onMouseLeave: () => a(!1),
292
- style: s,
293
- onClick: (l) => {
294
- l.isTrusted && (l.preventDefault(), o());
295
- },
296
- "aria-label": n,
297
- children: n
298
- }
299
- );
300
- }, K = ({
301
- challenge: r,
302
- index: e,
303
- solutions: n,
304
- onSubmit: o,
305
- onCancel: t,
306
- onClick: i,
307
- onNext: a,
308
- onReload: s,
309
- themeColor: l
310
- }) => {
311
- const { t: h } = Z(), b = r.captchas ? v(r.captchas, e) : null, u = n ? v(n, e) : [], f = C.useMemo(
312
- () => l === "light" ? M : D,
313
- [l]
314
- ), R = `${f.spacing.unit * 2}px`, g = `${f.spacing.unit}px`;
315
- return /* @__PURE__ */ d(C.Suspense, { fallback: /* @__PURE__ */ d("div", { children: "Loading..." }), children: /* @__PURE__ */ d(
316
- "div",
317
- {
318
- style: {
319
- // introduce scroll bars when screen < minWidth of children
320
- overflowX: "auto",
321
- overflowY: "auto",
322
- maxWidth: "500px",
323
- maxHeight: "100%",
324
- display: "flex",
325
- flexDirection: "column",
326
- border: "1px solid #dddddd",
327
- boxShadow: "rgba(255, 255, 255, 0.2) 0px 0px 4px",
328
- borderRadius: "4px",
329
- backgroundColor: f.palette.background.default,
330
- userSelect: "none",
331
- touchAction: "none",
332
- overscrollBehavior: "none"
333
- },
334
- children: /* @__PURE__ */ P(
335
- "div",
336
- {
337
- style: {
338
- backgroundColor: f.palette.background.default,
339
- display: "flex",
340
- flexDirection: "column",
341
- minWidth: "300px",
342
- marginLeft: g,
343
- marginRight: g,
344
- justifyContent: "center"
345
- },
346
- children: [
347
- /* @__PURE__ */ d(
348
- "div",
349
- {
350
- style: {
351
- display: "flex",
352
- alignItems: "center",
353
- width: "100%"
354
- },
355
- children: /* @__PURE__ */ d(
356
- "div",
357
- {
358
- style: {
359
- backgroundColor: f.palette.primary.main,
360
- width: "100%",
361
- marginTop: g
362
- },
363
- children: /* @__PURE__ */ P(
364
- "div",
365
- {
366
- style: {
367
- padding: `${f.spacing.half}px`,
368
- fontFamily: f.font.fontFamily
369
- },
370
- children: [
371
- /* @__PURE__ */ P(
372
- "p",
373
- {
374
- style: {
375
- color: "#ffffff",
376
- fontWeight: 700,
377
- lineHeight: 1.5
378
- },
379
- children: [
380
- h("WIDGET.SELECT_ALL"),
381
- ":",
382
- " ",
383
- /* @__PURE__ */ d("span", { children: `${v(r.captchas, e).target} ` })
384
- ]
385
- }
386
- ),
387
- /* @__PURE__ */ d(
388
- "p",
389
- {
390
- style: {
391
- color: "#ffffff",
392
- fontWeight: 500,
393
- lineHeight: 0.8,
394
- fontSize: "0.8rem"
395
- },
396
- children: h("WIDGET.IF_NONE_CLICK_NEXT")
397
- }
398
- )
399
- ]
400
- }
401
- )
402
- }
403
- )
404
- }
405
- ),
406
- /* @__PURE__ */ d(
407
- "div",
408
- {
409
- ...J({ dev: {} }),
410
- style: { overflow: "hidden" },
411
- children: b && /* @__PURE__ */ d(
412
- Ne,
413
- {
414
- challenge: b,
415
- solution: u,
416
- onClick: i,
417
- themeColor: l
418
- }
419
- )
420
- }
421
- ),
422
- /* @__PURE__ */ d(
423
- "div",
424
- {
425
- style: {
426
- display: "flex",
427
- alignItems: "center",
428
- justifyContent: "space-between",
429
- lineHeight: 1.75,
430
- padding: `${g} 0 ${R} 0`
431
- },
432
- children: /* @__PURE__ */ P(
433
- "div",
434
- {
435
- style: {
436
- // expand to full height / width of parent
437
- width: "100%",
438
- height: "100%",
439
- // display children in flex, spreading them evenly
440
- display: "flex",
441
- flexDirection: "row",
442
- justifyContent: "space-between",
443
- gap: "10px"
444
- },
445
- children: [
446
- /* @__PURE__ */ d(
447
- "div",
448
- {
449
- style: {
450
- position: "relative",
451
- flexGrow: 1,
452
- // make the width of each item 1/3rd of the width overall, i.e. 3 columns
453
- flexBasis: "calc(33.333% - 10px)"
454
- },
455
- children: /* @__PURE__ */ d(
456
- F,
457
- {
458
- themeColor: l,
459
- buttonType: "cancel",
460
- onClick: t,
461
- text: h("WIDGET.CANCEL"),
462
- "aria-label": h("WIDGET.CANCEL")
463
- }
464
- )
465
- }
466
- ),
467
- /* @__PURE__ */ d(
468
- "div",
469
- {
470
- style: {
471
- position: "relative",
472
- flexGrow: 1,
473
- // make the width of each item 1/3rd of the width overall, i.e. 3 columns
474
- flexBasis: "calc(33.333% - 10px)"
475
- },
476
- children: /* @__PURE__ */ d(Te, { themeColor: l, onReload: s })
477
- }
478
- ),
479
- /* @__PURE__ */ d(
480
- "div",
481
- {
482
- style: {
483
- position: "relative",
484
- flexGrow: 1,
485
- // make the width of each item 1/3rd of the width overall, i.e. 3 columns
486
- flexBasis: "calc(33.333% - 10px)"
487
- },
488
- children: /* @__PURE__ */ d(
489
- F,
490
- {
491
- themeColor: l,
492
- buttonType: "next",
493
- text: e < r.captchas.length - 1 ? h("WIDGET.NEXT") : h("WIDGET.SUBMIT"),
494
- onClick: e < r.captchas.length - 1 ? a : o,
495
- "aria-label": e < r.captchas.length - 1 ? h("WIDGET.NEXT") : h("WIDGET.SUBMIT"),
496
- "data-cy": "button-next"
497
- }
498
- )
499
- }
500
- )
501
- ]
502
- }
503
- )
504
- }
505
- )
506
- ]
507
- }
508
- )
509
- }
510
- ) });
511
- };
512
- function Re(r) {
513
- return U([
514
- r.captchaId,
515
- r.captchaContentId,
516
- [...r.solution].sort(),
517
- r.salt
518
- ]);
519
- }
520
- class V {
521
- constructor(e) {
522
- this.hash = e, this.parent = null;
523
- }
524
- }
525
- class ke {
526
- constructor() {
527
- this.leaves = [], this.layers = [];
528
- }
529
- getRoot() {
530
- if (this.root === void 0)
531
- throw new T("DATASET.MERKLE_ERROR", {
532
- context: {
533
- error: "root undefined",
534
- failedFuncName: this.getRoot.name
535
- }
536
- });
537
- return this.root;
538
- }
539
- build(e) {
540
- this.layers.length && (this.layers = []);
541
- const n = [];
542
- for (const o of e) {
543
- const t = new V(o);
544
- this.leaves.push(t), n.push(t.hash);
545
- }
546
- this.layers.push(n), this.root = this.buildMerkleTree(this.leaves)[0];
547
- }
548
- buildMerkleTree(e) {
549
- const n = e.length;
550
- if (n === 1)
551
- return e;
552
- const o = [];
553
- let t = 0;
554
- const i = [];
555
- for (; t < n; ) {
556
- const a = e[t];
557
- if (a === void 0)
558
- throw new T("DEVELOPER.GENERAL", {
559
- context: { error: "leftChild undefined" }
560
- });
561
- const s = t + 1 < n ? v(e, t + 1) : a, l = this.createParent(a, s);
562
- i.push(l.hash), o.push(l), t += 2;
563
- }
564
- return this.layers.push(i), this.buildMerkleTree(o);
565
- }
566
- createParent(e, n) {
567
- const o = new V(U([e.hash, n.hash]));
568
- return e.parent = o.hash, n.parent = o.hash, o;
569
- }
570
- proof(e) {
571
- const n = [];
572
- let o = 0;
573
- for (; o < this.layers.length - 1; ) {
574
- const i = this.layers[o];
575
- if (i === void 0)
576
- throw new T("DATASET.MERKLE_ERROR", {
577
- context: {
578
- error: "layer undefined",
579
- failedFuncName: this.proof.name,
580
- layerNum: o
581
- }
582
- });
583
- const a = i.indexOf(e);
584
- let s = a % 2 && a > 0 ? a - 1 : a + 1;
585
- s > i.length - 1 && (s = a);
586
- const l = [e], h = v(i, s);
587
- s > a ? l.push(h) : l.unshift(h), n.push([v(l, 0), v(l, 1)]), o += 1, e = U(l);
588
- }
589
- const t = v(this.layers, this.layers.length - 1);
590
- return [...n, [v(t, 0)]];
591
- }
592
- }
593
- class X {
594
- constructor(e, n, o, t, i) {
595
- this.userAccount = e, this.provider = n, this.providerApi = o, this._web2 = t, this.dappAccount = i;
596
- }
597
- get web2() {
598
- return this._web2;
599
- }
600
- async getCaptchaChallenge(e) {
601
- try {
602
- const n = await this.providerApi.getCaptchaChallenge(
603
- this.userAccount,
604
- this.provider,
605
- e
606
- );
607
- if (n[A.error])
608
- return n;
609
- for (const o of n.captchas)
610
- for (const t of o.items)
611
- t.data && (t.data = `https://${t.data.replace(/^http(s)*:\/\//, "")}`);
612
- return n;
613
- } catch (n) {
614
- throw new H("CAPTCHA.INVALID_CAPTCHA_CHALLENGE", {
615
- context: { error: n }
616
- });
617
- }
618
- }
619
- async submitCaptchaSolution(e, n, o, t, i) {
620
- const a = new ke(), s = o.map(
621
- (b) => Re(b)
622
- );
623
- if (a.build(s), !a.root)
624
- throw new _("CAPTCHA.INVALID_CAPTCHA_CHALLENGE", {
625
- context: { error: "Merkle tree root is undefined" }
626
- });
627
- const l = a.root.hash;
628
- let h;
629
- try {
630
- h = await this.providerApi.submitCaptchaSolution(
631
- o,
632
- n,
633
- this.userAccount,
634
- t,
635
- i,
636
- e
637
- );
638
- } catch (b) {
639
- throw new _("CAPTCHA.INVALID_CAPTCHA_CHALLENGE", {
640
- context: { error: b }
641
- });
642
- }
643
- return [h, l];
644
- }
645
- }
646
- const Le = () => ({
647
- // note order matters! see buildUpdateState. These fields are set in order, so disable modal first, then set loading to false, etc.
648
- showModal: !1,
649
- loading: !1,
650
- index: 0,
651
- challenge: void 0,
652
- solutions: void 0,
653
- isHuman: !1,
654
- captchaApi: void 0,
655
- account: void 0
656
- // don't handle timeout here, this should be handled by the state management
657
- });
658
- function _e(r, e, n, o, t) {
659
- const i = ie(o), a = we(e, n), s = () => {
660
- const c = {
661
- userAccountAddress: "",
662
- ...r
663
- };
664
- return e.account && (c.userAccountAddress = e.account.account.address), Q.parse(c);
665
- }, l = async () => {
666
- i.onOpen(), await z(
667
- async () => {
668
- var I;
669
- if (e.loading || e.isHuman)
670
- return;
671
- a({ loading: !0 }), a({
672
- attemptCount: e.attemptCount ? e.attemptCount + 1 : 1
673
- }), a({
674
- sessionId: t == null ? void 0 : t.sessionId
675
- });
676
- const c = s();
677
- a({ dappAccount: c.account.address }), await me(100);
678
- const m = await ee();
679
- let x = e.captchaApi;
680
- if (t != null && t.provider) {
681
- const w = t.provider.provider.url, y = await g(w);
682
- x = new X(
683
- m.account.address,
684
- t.provider,
685
- y,
686
- c.web2,
687
- c.account.address || ""
688
- ), a({ captchaApi: x });
689
- } else {
690
- const w = await ce(
691
- s().defaultEnvironment
692
- ), y = w.provider.url, E = await g(y);
693
- x = new X(
694
- m.account.address,
695
- w,
696
- E,
697
- c.web2,
698
- c.account.address || ""
699
- ), a({ captchaApi: x });
700
- }
701
- const p = await (x == null ? void 0 : x.getCaptchaChallenge(
702
- e.sessionId
703
- ));
704
- if (p.error)
705
- a({
706
- loading: !1,
707
- error: {
708
- message: p.error.message,
709
- key: p.error.key || "API.UNKNOWN_ERROR"
710
- }
711
- }), i.onError(new Error((I = p.error) == null ? void 0 : I.message));
712
- else {
713
- if (p.captchas.length <= 0)
714
- throw new _("DEVELOPER.PROVIDER_NO_CAPTCHA");
715
- const w = p.captchas.map(
716
- (E) => E.timeLimitMs || c.captchas.image.challengeTimeout
717
- ).reduce((E, W) => E + W), y = setTimeout(() => {
718
- i.onChallengeExpired(), a({ isHuman: !1, showModal: !1, loading: !1 });
719
- }, w);
720
- a({
721
- index: 0,
722
- solutions: p.captchas.map(() => []),
723
- challenge: p,
724
- showModal: !0,
725
- timeout: y,
726
- loading: !1
727
- });
728
- }
729
- },
730
- l,
731
- L,
732
- e.attemptCount,
733
- 10
734
- );
735
- }, h = async () => {
736
- await z(
737
- async () => {
738
- if (N(), !e.challenge)
739
- throw new T("CAPTCHA.NO_CAPTCHA", {
740
- context: { error: "Cannot submit, no Captcha found in state" }
741
- });
742
- a({ showModal: !1 });
743
- const c = e.challenge, m = e.challenge.captchas.map(
744
- (O, oe) => {
745
- const B = v(e.solutions, oe), j = B.flatMap(([k, $, se]) => [$, se]), ae = ye(
746
- j.map((k) => k.toString(16).length + 4).reduce((k, $) => k + $, 0)
747
- ), re = pe(ae, j);
748
- return {
749
- captchaId: O.captchaId,
750
- captchaContentId: O.captchaContentId,
751
- salt: re,
752
- solution: B.flatMap((k) => k[0])
753
- };
754
- }
755
- ), x = G(), p = ne(x).signer;
756
- if (!v(c.captchas, 0).datasetId)
757
- throw new _("CAPTCHA.INVALID_CAPTCHA_ID", {
758
- context: { error: "No datasetId set for challenge" }
759
- });
760
- const w = e.captchaApi;
761
- if (!w)
762
- throw new T("CAPTCHA.INVALID_TOKEN", {
763
- context: { error: "No Captcha API found in state" }
764
- });
765
- if (!p || !p.signRaw)
766
- throw new H("GENERAL.CANT_FIND_KEYRINGPAIR", {
767
- context: {
768
- error: "Signer is not defined, cannot sign message to prove account ownership"
769
- }
770
- });
771
- const y = await p.signRaw({
772
- address: x.account.address,
773
- data: Ae(c[A.timestamp]),
774
- type: "bytes"
775
- }), E = await w.submitCaptchaSolution(
776
- y.signature,
777
- c.requestHash,
778
- m,
779
- c.timestamp,
780
- c.signature.provider.requestHash
781
- ), W = E[0].verified;
782
- if (a({
783
- submission: E,
784
- isHuman: W,
785
- loading: !1
786
- }), e.isHuman) {
787
- const O = w.provider.provider.url;
788
- i.onHuman(
789
- ge({
790
- [A.providerUrl]: O,
791
- [A.user]: x.account.address,
792
- [A.dapp]: te(),
793
- [A.commitmentId]: fe(E[1]),
794
- [A.timestamp]: c.timestamp,
795
- [A.signature]: {
796
- [A.provider]: {
797
- [A.requestHash]: c.signature.provider.requestHash
798
- },
799
- [A.user]: {
800
- [A.timestamp]: y.signature
801
- }
802
- }
803
- })
804
- ), S();
805
- } else
806
- i.onFailed(), L(t == null ? void 0 : t.restart);
807
- },
808
- l,
809
- L,
810
- e.attemptCount,
811
- 10
812
- );
813
- }, b = async () => {
814
- N(), L(t == null ? void 0 : t.restart), i.onClose();
815
- }, u = async () => {
816
- N(), i.onReload(), L(t == null ? void 0 : t.restart), t != null && t.restart || await l();
817
- }, f = (c, m, x) => {
818
- if (!e.challenge)
819
- throw new T("CAPTCHA.NO_CAPTCHA", {
820
- context: { error: "Cannot select, no Captcha found in state" }
821
- });
822
- if (e.index >= e.challenge.captchas.length || e.index < 0)
823
- throw new T("CAPTCHA.NO_CAPTCHA", {
824
- context: {
825
- error: "Cannot select, index is out of range for this Captcha"
826
- }
827
- });
828
- const p = e.index, I = e.solutions, w = v(I, p);
829
- if (w.some((y) => y[0] === c)) {
830
- const y = w.filter((E) => E[0] !== c);
831
- I[p] = y;
832
- } else
833
- I[p] = [...w, [c, m || 0, x || 0]];
834
- a({ solutions: I });
835
- }, R = () => {
836
- if (!e.challenge)
837
- throw new T("CAPTCHA.NO_CAPTCHA", {
838
- context: { error: "Cannot select, no Captcha found in state" }
839
- });
840
- if (e.index + 1 >= e.challenge.captchas.length)
841
- throw new T("CAPTCHA.NO_CAPTCHA", {
842
- context: {
843
- error: "Cannot select, index is out of range for this Captcha"
844
- }
845
- });
846
- a({ index: e.index + 1 });
847
- }, g = async (c) => {
848
- const m = s();
849
- if (!m.account.address)
850
- throw new H("GENERAL.SITE_KEY_MISSING");
851
- return new le(c, m.account.address);
852
- }, N = () => {
853
- window.clearTimeout(Number(e.timeout)), a({ timeout: void 0 });
854
- }, S = () => {
855
- const c = r.captchas.image.solutionTimeout, m = setTimeout(() => {
856
- a({ isHuman: !1 }), i.onExpired();
857
- }, c);
858
- a({ successfullChallengeTimeout: m });
859
- }, L = (c) => {
860
- N(), a(Le()), i.onReset(), c && c();
861
- }, ee = async () => {
862
- const c = s();
863
- if (!c.web2 && !c.userAccountAddress)
864
- throw new H("GENERAL.ACCOUNT_NOT_FOUND", {
865
- context: { error: "Account address has not been set for web3 mode" }
866
- });
867
- const x = await (async () => {
868
- const p = new (await de(c.web2))();
869
- return t ? t.userAccount : await p.getAccount(c);
870
- })();
871
- return a({ account: x }), G();
872
- }, G = () => {
873
- if (!e.account)
874
- throw new H("GENERAL.ACCOUNT_NOT_FOUND", {
875
- context: { error: "Account not loaded" }
876
- });
877
- return e.account;
878
- }, te = () => {
879
- if (!e.dappAccount)
880
- throw new H("GENERAL.SITE_KEY_MISSING");
881
- return e.dappAccount;
882
- }, ne = (c) => {
883
- const m = c || G();
884
- if (!m.extension)
885
- throw new H("ACCOUNT.NO_POLKADOT_EXTENSION", {
886
- context: { error: "Extension not loaded" }
887
- });
888
- return m.extension;
889
- };
890
- return {
891
- start: l,
892
- cancel: b,
893
- submit: h,
894
- select: f,
895
- nextRound: R,
896
- reload: u
897
- };
898
- }
899
- const Me = ue`
900
- position: absolute;
901
- top: 50%;
902
- left: 50%;
903
- transform: translate(-50%, -50%);
904
- max-width: 500px;
905
- background-color: transparent;
906
- border: none;
907
- border-radius: 4px;
908
- z-index: 2147483647;
909
- align-self: center;
910
- box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px,
911
- rgba(0, 0, 0, 0.14) 0px 24px 38px 3px,
912
- rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;
913
- box-sizing: border-box; /* Ensures border is part of width */
914
- /* iOS only */
915
- @supports (-webkit-touch-callout: none) {
916
- transform: translate(-50%, -100%);
917
- }
918
- `, Y = xe.memo((r) => {
919
- const { show: e, children: n } = r, t = {
920
- position: "fixed",
921
- zIndex: 2147483646,
922
- inset: 0,
923
- display: e ? "flex" : "none",
924
- alignItems: "center",
925
- justifyContent: "center",
926
- minHeight: "100vh"
927
- };
928
- return ve.createPortal(
929
- /* @__PURE__ */ d("div", { className: "prosopo-modalOuter", style: t, children: /* @__PURE__ */ d("div", { className: "prosopo-modalInner", css: Me, children: n }) }),
930
- document.body
931
- );
932
- }), q = "procaptcha:execute", je = (r) => {
933
- var R;
934
- const { t: e, ready: n } = Z(), o = Q.parse(r.config), t = r.frictionlessState, i = r.i18n, a = r.callbacks || {}, [s, l] = be(C.useState, C.useRef), [h, b] = C.useState(!1), u = _e(
935
- o,
936
- s,
937
- l,
938
- a,
939
- t
940
- ), f = r.config.theme === "light" ? M : D;
941
- return C.useEffect(() => {
942
- o.language && (i ? i.language !== o.language && i.changeLanguage(o.language).then((g) => g) : Ce().then((g) => {
943
- g.language !== o.language && g.changeLanguage(o.language).then((N) => N);
944
- }));
945
- }, [i, o.language]), C.useEffect(() => {
946
- s.error && (b(!1), s.error.key === "CAPTCHA.NO_SESSION_FOUND" && t && setTimeout(() => {
947
- t.restart();
948
- }, 3e3));
949
- }, [s.error, t]), C.useEffect(() => {
950
- const g = (N) => {
951
- if (l({
952
- showModal: !0
953
- }), !s.challenge && u.start)
954
- try {
955
- u.start();
956
- } catch (S) {
957
- console.error("Error starting verification:", S);
958
- }
959
- };
960
- return document.addEventListener(q, g), () => {
961
- document.removeEventListener(
962
- q,
963
- g
964
- );
965
- };
966
- }, [u, s.challenge, l]), o.mode === "invisible" ? /* @__PURE__ */ d(Y, { show: s.showModal, children: s.challenge ? /* @__PURE__ */ d(
967
- K,
968
- {
969
- challenge: s.challenge,
970
- index: s.index,
971
- solutions: s.solutions,
972
- onSubmit: u.submit,
973
- onCancel: u.cancel,
974
- onClick: u.select,
975
- onNext: u.nextRound,
976
- onReload: u.reload,
977
- themeColor: o.theme ?? "light"
978
- }
979
- ) : null }) : /* @__PURE__ */ P("div", { className: "image-captcha", children: [
980
- /* @__PURE__ */ d(Y, { show: s.showModal, children: s.challenge ? /* @__PURE__ */ d(
981
- K,
982
- {
983
- challenge: s.challenge,
984
- index: s.index,
985
- solutions: s.solutions,
986
- onSubmit: u.submit,
987
- onCancel: u.cancel,
988
- onClick: u.select,
989
- onNext: u.nextRound,
990
- onReload: u.reload,
991
- themeColor: o.theme ?? "light"
992
- }
993
- ) : /* @__PURE__ */ d("div", { children: "No challenge set." }) }),
994
- /* @__PURE__ */ d(
995
- he,
996
- {
997
- theme: f,
998
- onChange: async (g) => {
999
- g.isTrusted && (h || (b(!0), await u.start(), b(!1)));
1000
- },
1001
- checked: s.isHuman,
1002
- labelText: n ? e("WIDGET.I_AM_HUMAN") : "",
1003
- error: (R = s.error) == null ? void 0 : R.message,
1004
- "aria-label": "human checkbox",
1005
- loading: h
1006
- }
1007
- )
1008
- ] });
1009
- };
1010
- export {
1011
- je as default
1012
- };