@prosopo/procaptcha-bundle 3.1.6 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/dist/cjs/index.cjs +10 -1
  3. package/dist/cjs/util/configCreator.cjs +0 -1
  4. package/dist/index.js +10 -1
  5. package/dist/util/configCreator.js +0 -1
  6. package/package.json +16 -16
  7. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts +0 -5
  8. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts.map +0 -1
  9. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/components.js +0 -5
  10. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/components.js.map +0 -1
  11. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts +0 -16
  12. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +0 -1
  13. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js +0 -135
  14. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +0 -1
  15. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.d.ts +0 -2
  16. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.d.ts.map +0 -1
  17. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js +0 -36
  18. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js.map +0 -1
  19. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.d.ts +0 -2
  20. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.d.ts.map +0 -1
  21. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.js +0 -69
  22. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.js.map +0 -1
  23. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.d.ts +0 -2
  24. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.d.ts.map +0 -1
  25. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +0 -136
  26. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +0 -1
  27. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts +0 -8
  28. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +0 -1
  29. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +0 -15
  30. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +0 -1
  31. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts +0 -6
  32. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +0 -1
  33. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js +0 -11
  34. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js.map +0 -1
  35. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts +0 -10
  36. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +0 -1
  37. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js +0 -2
  38. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js.map +0 -1
  39. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +0 -24
  40. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +0 -1
  41. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +0 -49
  42. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +0 -1
  43. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts +0 -3
  44. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts.map +0 -1
  45. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js +0 -8
  46. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js.map +0 -1
  47. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts +0 -4
  48. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
  49. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +0 -14
  50. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +0 -1
  51. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts +0 -4
  52. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +0 -1
  53. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js +0 -9
  54. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js.map +0 -1
  55. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts +0 -4
  56. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +0 -1
  57. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js +0 -9
  58. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js.map +0 -1
  59. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts +0 -6
  60. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts.map +0 -1
  61. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js +0 -13
  62. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js.map +0 -1
  63. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts +0 -5
  64. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts.map +0 -1
  65. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js +0 -24
  66. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js.map +0 -1
  67. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/language.d.ts +0 -3
  68. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/language.d.ts.map +0 -1
  69. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js +0 -17
  70. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js.map +0 -1
  71. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.d.ts +0 -3
  72. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.d.ts.map +0 -1
  73. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.js +0 -9
  74. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.js.map +0 -1
  75. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts +0 -18
  76. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +0 -1
  77. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +0 -66
  78. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +0 -1
  79. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts +0 -9
  80. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts.map +0 -1
  81. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js +0 -19
  82. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js.map +0 -1
  83. package/dist/bundle/ProcaptchaWidget-CJ-4hVS1.js +0 -187
  84. package/dist/bundle/ProcaptchaWidget-Cw3s7cGX.js +0 -1014
  85. package/dist/bundle/Signer-DP9drQ55.js +0 -23
  86. package/dist/bundle/bnChunk-DRlDxTFg.js +0 -1137
  87. package/dist/bundle/browser-ponyfill-CvzSbL_o.js +0 -339
  88. package/dist/bundle/builder-ByZ5z580.js +0 -46
  89. package/dist/bundle/captchaComponentProvider-Cn75EmSH.js +0 -1002
  90. package/dist/bundle/captchaRenderer-s4QuLEen.js +0 -71
  91. package/dist/bundle/commonChunk-BjvuHlB1.js +0 -180
  92. package/dist/bundle/components.d.ts +0 -5
  93. package/dist/bundle/components.d.ts.map +0 -1
  94. package/dist/bundle/emotion-element-c39617d8.browser.esm-BNNnmykm.js +0 -916
  95. package/dist/bundle/fp.esm-DYWeNGcH.js +0 -1654
  96. package/dist/bundle/index-BuQg3Zno.js +0 -1884
  97. package/dist/bundle/index-DIdd2cUz.js +0 -5416
  98. package/dist/bundle/index-IgqrmVIs.js +0 -601
  99. package/dist/bundle/index.d.ts +0 -16
  100. package/dist/bundle/index.d.ts.map +0 -1
  101. package/dist/bundle/locales/ar/translation.json +0 -57
  102. package/dist/bundle/locales/az/translation.json +0 -57
  103. package/dist/bundle/locales/cs/translation.json +0 -57
  104. package/dist/bundle/locales/de/translation.json +0 -57
  105. package/dist/bundle/locales/el/translation.json +0 -57
  106. package/dist/bundle/locales/en/translation.json +0 -57
  107. package/dist/bundle/locales/es/translation.json +0 -57
  108. package/dist/bundle/locales/fi/translation.json +0 -57
  109. package/dist/bundle/locales/fr/translation.json +0 -57
  110. package/dist/bundle/locales/hi/translation.json +0 -57
  111. package/dist/bundle/locales/hu/translation.json +0 -57
  112. package/dist/bundle/locales/id/translation.json +0 -57
  113. package/dist/bundle/locales/it/translation.json +0 -57
  114. package/dist/bundle/locales/ja/translation.json +0 -57
  115. package/dist/bundle/locales/jv/translation.json +0 -57
  116. package/dist/bundle/locales/ko/translation.json +0 -57
  117. package/dist/bundle/locales/ml/translation.json +0 -57
  118. package/dist/bundle/locales/ms/translation.json +0 -57
  119. package/dist/bundle/locales/nl/translation.json +0 -57
  120. package/dist/bundle/locales/no/translation.json +0 -57
  121. package/dist/bundle/locales/pl/translation.json +0 -57
  122. package/dist/bundle/locales/pt/translation.json +0 -57
  123. package/dist/bundle/locales/pt-BR/translation.json +0 -57
  124. package/dist/bundle/locales/ro/translation.json +0 -57
  125. package/dist/bundle/locales/ru/translation.json +0 -57
  126. package/dist/bundle/locales/sr/translation.json +0 -57
  127. package/dist/bundle/locales/sv/translation.json +0 -57
  128. package/dist/bundle/locales/th/translation.json +0 -57
  129. package/dist/bundle/locales/tr/translation.json +0 -57
  130. package/dist/bundle/locales/uk/translation.json +0 -57
  131. package/dist/bundle/locales/vi/translation.json +0 -57
  132. package/dist/bundle/locales/zh-CN/translation.json +0 -57
  133. package/dist/bundle/nobleChunk-Bbltwf44.js +0 -2728
  134. package/dist/bundle/procaptcha.bundle.js +0 -8
  135. package/dist/bundle/tests/util/captchaType.test.d.ts +0 -2
  136. package/dist/bundle/tests/util/captchaType.test.d.ts.map +0 -1
  137. package/dist/bundle/tests/util/config.test.d.ts +0 -2
  138. package/dist/bundle/tests/util/config.test.d.ts.map +0 -1
  139. package/dist/bundle/tests/util/renderLogic.test.d.ts +0 -2
  140. package/dist/bundle/tests/util/renderLogic.test.d.ts.map +0 -1
  141. package/dist/bundle/util/captcha/captchaComponentProvider.d.ts +0 -8
  142. package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +0 -1
  143. package/dist/bundle/util/captcha/captchaComponentsList.d.ts +0 -6
  144. package/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +0 -1
  145. package/dist/bundle/util/captcha/captchaProps.d.ts +0 -10
  146. package/dist/bundle/util/captcha/captchaProps.d.ts.map +0 -1
  147. package/dist/bundle/util/captcha/captchaRenderer.d.ts +0 -24
  148. package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +0 -1
  149. package/dist/bundle/util/captcha/captchaType.d.ts +0 -3
  150. package/dist/bundle/util/captcha/captchaType.d.ts.map +0 -1
  151. package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts +0 -4
  152. package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
  153. package/dist/bundle/util/captcha/components/imageCaptcha.d.ts +0 -4
  154. package/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +0 -1
  155. package/dist/bundle/util/captcha/components/powCaptcha.d.ts +0 -4
  156. package/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +0 -1
  157. package/dist/bundle/util/config.d.ts +0 -6
  158. package/dist/bundle/util/config.d.ts.map +0 -1
  159. package/dist/bundle/util/configCreator.d.ts +0 -5
  160. package/dist/bundle/util/configCreator.d.ts.map +0 -1
  161. package/dist/bundle/util/language.d.ts +0 -3
  162. package/dist/bundle/util/language.d.ts.map +0 -1
  163. package/dist/bundle/util/timeout.d.ts +0 -3
  164. package/dist/bundle/util/timeout.d.ts.map +0 -1
  165. package/dist/bundle/util/widgetFactory.d.ts +0 -18
  166. package/dist/bundle/util/widgetFactory.d.ts.map +0 -1
  167. package/dist/bundle/util/widgetThemeResolver.d.ts +0 -9
  168. package/dist/bundle/util/widgetThemeResolver.d.ts.map +0 -1
  169. package/dist/bundle/utilChunk-DPr6oTOj.js +0 -317
  170. package/dist/bundle/utilCryptoChunk-D6ZLkbFV.js +0 -1236
  171. package/dist/bundle/web2Chunk-CNoojUDK.js +0 -3967
  172. package/dist/bundle/web3Chunk-BlYvY4Ea.js +0 -525
  173. package/dist/bundle/zodChunk-aEfPZzrp.js +0 -2882
  174. package/stats.html +0 -4842
@@ -1,136 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { ProcaptchaPow } from "@prosopo/procaptcha-pow";
3
- import { JSDOM } from "jsdom";
4
- import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
5
- import { WidgetFactory } from "../../util/widgetFactory.js";
6
- import { WidgetThemeResolver } from "../../util/widgetThemeResolver.js";
7
- const widgetFactory = new WidgetFactory(new WidgetThemeResolver());
8
- const callbacks = {
9
- onHuman: () => console.log("onHuman"),
10
- onChallengeExpired: () => console.log("onChallengeExpired"),
11
- onExpired: () => console.log("onExpired"),
12
- onError: () => console.log("onError"),
13
- onClose: () => console.log("onClose"),
14
- onOpen: () => console.log("onOpen"),
15
- onFailed: () => console.log("onFailed"),
16
- onReset: () => console.log("onReset"),
17
- onExtensionNotFound: () => console.log("onExtensionNotFound"),
18
- onReload: () => console.log("onReload"),
19
- };
20
- vi.mock("@prosopo/detector", async () => {
21
- return {
22
- isBot: async () => {
23
- return { isBot: true };
24
- },
25
- };
26
- });
27
- vi.mock("@polkadot/extension-dapp", async () => {
28
- return {
29
- web3Enable: async () => {
30
- return [];
31
- },
32
- };
33
- });
34
- vi.mock("@prosopo/procaptcha-pow", async () => {
35
- return {
36
- ProcaptchaPow: vi.fn((props) => {
37
- return (_jsx("div", { config: props.config, callbacks: props.callbacks, children: "ProcaptchaPow" }));
38
- }),
39
- };
40
- });
41
- vi.mock("@prosopo/procaptcha-frictionless", async () => {
42
- return {
43
- ProcaptchaFrictionless: vi.fn((props) => {
44
- return (_jsx("div", { config: props.config, callbacks: props.callbacks, children: "ProcaptchaFrictionless" }));
45
- }),
46
- };
47
- });
48
- describe("Config utility functions", () => {
49
- let dom;
50
- beforeEach((context) => {
51
- dom = new JSDOM("<!DOCTYPE html><html><body></body></html>", {
52
- url: "https://example.com",
53
- });
54
- context.document = dom.window.document;
55
- context.window = dom.window;
56
- global.window = dom.window;
57
- global.document = dom.window.document;
58
- global.HTMLElement = dom.window.HTMLElement;
59
- global.Element = dom.window.Element;
60
- global.Node = dom.window.Node;
61
- global.navigator = dom.window.navigator;
62
- vi.clearAllMocks();
63
- });
64
- afterEach((context) => {
65
- context.document = undefined;
66
- context.window = undefined;
67
- global.HTMLElement = undefined;
68
- global.Element = undefined;
69
- global.Node = undefined;
70
- global.navigator = undefined;
71
- vi.clearAllMocks();
72
- });
73
- it("renders the correct captcha type", async (ctx) => {
74
- const script = ctx.document.createElement("script");
75
- script.src = "https://example.com/procaptcha.js";
76
- document.body.appendChild(script);
77
- expect(ctx.window).toBeDefined();
78
- if (!ctx.window) {
79
- expect(true).toBe(false);
80
- return;
81
- }
82
- await widgetFactory.createWidgets([script], {
83
- siteKey: "1234",
84
- captchaType: "pow",
85
- });
86
- await vi.waitFor(() => {
87
- expect(ProcaptchaPow).toHaveBeenCalledTimes(1);
88
- });
89
- });
90
- it("user callbacks should be set when defined on the window and pulled in via data attributes", async (ctx) => {
91
- const script = ctx.document.createElement("script");
92
- script.src = "https://example.com/procaptcha.js";
93
- script["data-callback"] = "onHuman";
94
- script["data-chalexpired-callback"] = "onChallengeExpired";
95
- script["data-expired-callback"] = "onExpired";
96
- script["data-error-callback"] = "onError";
97
- script["data-close-callback"] = "onClose";
98
- script["data-open-callback"] = "onOpen";
99
- script["data-failed-callback"] = "onFailed";
100
- script["data-reset-callback"] = "onReset";
101
- document.body.appendChild(script);
102
- expect(ctx.window).toBeDefined();
103
- if (!ctx.window) {
104
- expect(true).toBe(false);
105
- return;
106
- }
107
- ctx.window.onHuman = callbacks.onHuman;
108
- ctx.window.onChallengeExpired = callbacks.onChallengeExpired;
109
- ctx.window.onExpired = callbacks.onExpired;
110
- ctx.window.onError = callbacks.onError;
111
- ctx.window.onClose = callbacks.onClose;
112
- ctx.window.onOpen = callbacks.onOpen;
113
- ctx.window.onFailed = callbacks.onFailed;
114
- ctx.window.onReset = callbacks.onReset;
115
- ctx.window.onExtensionNotFound = callbacks.onExtensionNotFound;
116
- ctx.window.onReload = callbacks.onReload;
117
- await widgetFactory.createWidgets([script], {
118
- siteKey: "1234",
119
- captchaType: "pow",
120
- });
121
- await vi.waitFor(() => {
122
- expect(ProcaptchaPow).toHaveBeenCalledTimes(1);
123
- const call = ProcaptchaPow.mock.calls[0];
124
- const props = call[0];
125
- expect(props.config.account.address).toBe("1234");
126
- expect(props.config.web2).toBe(true);
127
- expect(props.config.solutionThreshold).toBe(80);
128
- expect(props.config.dappName).toBe("ProsopoClientDapp");
129
- expect(props.config.theme).toBe("light");
130
- expect(props.config.mode).toBe("visible");
131
- expect(props.callbacks).toBeDefined();
132
- expect(typeof props.callbacks).toBe("object");
133
- });
134
- });
135
- });
136
- //# sourceMappingURL=renderLogic.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderLogic.test.js","sourceRoot":"","sources":["../../../../src/tests/util/renderLogic.test.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAkB,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,IAAI,mBAAmB,EAAE,CAAC,CAAC;AAOnE,MAAM,SAAS,GAAc;IAC5B,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;IACrC,kBAAkB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC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J,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import { CaptchaType } from "@prosopo/types";
2
- import type { ReactNode } from "react";
3
- import type { CaptchaProps } from "./captchaProps.js";
4
- declare class CaptchaComponentProvider {
5
- getCaptchaComponent(captchaType: CaptchaType, captchaProps: CaptchaProps): ReactNode;
6
- }
7
- export { CaptchaComponentProvider };
8
- //# sourceMappingURL=captchaComponentProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captchaComponentProvider.d.ts","sourceRoot":"","sources":["../../../../src/util/captcha/captchaComponentProvider.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,cAAM,wBAAwB;IACtB,mBAAmB,CACzB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,GACxB,SAAS;CAkBZ;AAED,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { CaptchaType } from "@prosopo/types";
3
- import { captchaComponentsList } from "./captchaComponentsList.js";
4
- class CaptchaComponentProvider {
5
- getCaptchaComponent(captchaType, captchaProps) {
6
- if (captchaType === CaptchaType.invisible) {
7
- throw new Error("Not Implemented");
8
- }
9
- const CaptchaComponent = captchaComponentsList[captchaType];
10
- console.log(`rendering ${captchaType}`);
11
- return (_jsx(CaptchaComponent, { config: captchaProps.config, callbacks: captchaProps.callbacks, i18n: captchaProps.i18n, container: captchaProps.container }));
12
- }
13
- }
14
- export { CaptchaComponentProvider };
15
- //# sourceMappingURL=captchaComponentProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captchaComponentProvider.js","sourceRoot":"","sources":["../../../../src/util/captcha/captchaComponentProvider.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,MAAM,wBAAwB;IACtB,mBAAmB,CACzB,WAAwB,EACxB,YAA0B;QAE1B,IAAI,WAAW,KAAK,WAAW,CAAC,SAAS,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACpC,CAAC;QAED,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAE5D,OAAO,CAAC,GAAG,CAAC,aAAa,WAAW,EAAE,CAAC,CAAC;QAExC,OAAO,CACN,KAAC,gBAAgB,IAChB,MAAM,EAAE,YAAY,CAAC,MAAM,EAC3B,SAAS,EAAE,YAAY,CAAC,SAAS,EACjC,IAAI,EAAE,YAAY,CAAC,IAAI,EACvB,SAAS,EAAE,YAAY,CAAC,SAAS,GAChC,CACF,CAAC;IACH,CAAC;CACD;AAED,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
@@ -1,6 +0,0 @@
1
- import { CaptchaType } from "@prosopo/types";
2
- import type React from "react";
3
- import type { CaptchaProps } from "./captchaProps.js";
4
- declare const captchaComponentsList: Pick<Record<CaptchaType, React.ComponentType<CaptchaProps>>, CaptchaType.image | CaptchaType.pow | CaptchaType.frictionless>;
5
- export { captchaComponentsList };
6
- //# sourceMappingURL=captchaComponentsList.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captchaComponentsList.d.ts","sourceRoot":"","sources":["../../../../src/util/captcha/captchaComponentsList.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD,QAAA,MAAM,qBAAqB,EAAE,IAAI,CAChC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,EACtD,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,GAAG,GAAG,WAAW,CAAC,YAAY,CAK9D,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,11 +0,0 @@
1
- import { CaptchaType } from "@prosopo/types";
2
- import { FrictionlessCaptcha } from "./components/frictionlessCaptcha.js";
3
- import { ImageCaptcha } from "./components/imageCaptcha.js";
4
- import { PowCaptcha } from "./components/powCaptcha.js";
5
- const captchaComponentsList = {
6
- [CaptchaType.image]: ImageCaptcha,
7
- [CaptchaType.pow]: PowCaptcha,
8
- [CaptchaType.frictionless]: FrictionlessCaptcha,
9
- };
10
- export { captchaComponentsList };
11
- //# sourceMappingURL=captchaComponentsList.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captchaComponentsList.js","sourceRoot":"","sources":["../../../../src/util/captcha/captchaComponentsList.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,qBAAqB,GAGvB;IACH,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,YAAY;IACjC,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,UAAU;IAC7B,CAAC,WAAW,CAAC,YAAY,CAAC,EAAE,mBAAmB;CAC/C,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { Ti18n } from "@prosopo/locale";
2
- import type { ProcaptchaCallbacks, ProcaptchaClientConfigInput } from "@prosopo/types";
3
- interface CaptchaProps {
4
- config: ProcaptchaClientConfigInput;
5
- callbacks: ProcaptchaCallbacks;
6
- i18n: Ti18n;
7
- container: HTMLElement;
8
- }
9
- export type { CaptchaProps };
10
- //# sourceMappingURL=captchaProps.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captchaProps.d.ts","sourceRoot":"","sources":["../../../../src/util/captcha/captchaProps.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EACX,mBAAmB,EACnB,2BAA2B,EAC3B,MAAM,gBAAgB,CAAC;AAExB,UAAU,YAAY;IACrB,MAAM,EAAE,2BAA2B,CAAC;IACpC,SAAS,EAAE,mBAAmB,CAAC;IAC/B,IAAI,EAAE,KAAK,CAAC;IACZ,SAAS,EAAE,WAAW,CAAC;CACvB;AAED,YAAY,EAAE,YAAY,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=captchaProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captchaProps.js","sourceRoot":"","sources":["../../../../src/util/captcha/captchaProps.ts"],"names":[],"mappings":""}
@@ -1,24 +0,0 @@
1
- import { type EmotionCache } from "@emotion/cache";
2
- import type { Ti18n } from "@prosopo/locale";
3
- import type { Callbacks, ProcaptchaClientConfigOutput, ProcaptchaRenderOptions } from "@prosopo/types";
4
- import type { CaptchaType } from "@prosopo/types";
5
- import type { ReactNode } from "react";
6
- import { type Root } from "react-dom/client";
7
- import type { CaptchaComponentProvider } from "./captchaComponentProvider.js";
8
- interface RenderSettings {
9
- identifierPrefix: string;
10
- emotionCacheKey: string;
11
- webComponentTag: string;
12
- defaultCaptchaType: CaptchaType;
13
- }
14
- declare class CaptchaRenderer {
15
- private readonly captchaComponentProvider;
16
- constructor(captchaComponentProvider: CaptchaComponentProvider);
17
- renderCaptcha(settings: RenderSettings, container: HTMLElement, renderOptions: ProcaptchaRenderOptions, callbacks: Callbacks, isWeb2: boolean, i18n: Ti18n, invisible: boolean, widgetContainer: HTMLElement): Root;
18
- protected readAndValidateSettings(element: Element, config: ProcaptchaClientConfigOutput, renderOptions: ProcaptchaRenderOptions): void;
19
- protected makeEmotionCache(cacheKey: string, container: HTMLElement): EmotionCache;
20
- protected createReactRoot(container: HTMLElement, identifierPrefix: string): Root;
21
- protected renderCaptchaComponent(reactRoot: Root, emotionCache: EmotionCache, captchaComponent: ReactNode): void;
22
- }
23
- export { CaptchaRenderer };
24
- //# sourceMappingURL=captchaRenderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captchaRenderer.d.ts","sourceRoot":"","sources":["../../../../src/util/captcha/captchaRenderer.tsx"],"names":[],"mappings":"AAcA,OAAoB,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EACX,SAAS,EACT,4BAA4B,EAC5B,uBAAuB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,kBAAkB,CAAC;AAIzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9E,UAAU,cAAc;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,WAAW,CAAC;CAChC;AAED,cAAM,eAAe;IACpB,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAA2B;gBAExD,wBAAwB,EAAE,wBAAwB;IAIvD,aAAa,CACnB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,WAAW,EACtB,aAAa,EAAE,uBAAuB,EACtC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,KAAK,EACX,SAAS,EAAE,OAAO,EAClB,eAAe,EAAE,WAAW,GAC1B,IAAI;IAwCP,SAAS,CAAC,uBAAuB,CAChC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,4BAA4B,EACpC,aAAa,EAAE,uBAAuB,GACpC,IAAI;IAKP,SAAS,CAAC,gBAAgB,CACzB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,WAAW,GACpB,YAAY;IAQf,SAAS,CAAC,eAAe,CACxB,SAAS,EAAE,WAAW,EACtB,gBAAgB,EAAE,MAAM,GACtB,IAAI;IAMP,SAAS,CAAC,sBAAsB,CAC/B,SAAS,EAAE,IAAI,EACf,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,SAAS,GACzB,IAAI;CAKP;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,49 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import createCache from "@emotion/cache";
3
- import { CacheProvider } from "@emotion/react";
4
- import { createRoot } from "react-dom/client";
5
- import { createConfig } from "../configCreator.js";
6
- import { setLanguage } from "../language.js";
7
- import { setValidChallengeLength } from "../timeout.js";
8
- class CaptchaRenderer {
9
- constructor(captchaComponentProvider) {
10
- this.captchaComponentProvider = captchaComponentProvider;
11
- }
12
- renderCaptcha(settings, container, renderOptions, callbacks, isWeb2, i18n, invisible, widgetContainer) {
13
- const captchaType = renderOptions?.captchaType ||
14
- settings.defaultCaptchaType;
15
- const config = createConfig(renderOptions.siteKey, renderOptions.theme, renderOptions.language, isWeb2, invisible, renderOptions.userAccountAddress);
16
- this.readAndValidateSettings(container, config, renderOptions);
17
- const reactRoot = this.createReactRoot(container, settings.identifierPrefix);
18
- const emotionCache = this.makeEmotionCache(settings.emotionCacheKey, container);
19
- const captchaComponent = this.captchaComponentProvider.getCaptchaComponent(captchaType, {
20
- config: config,
21
- i18n: i18n,
22
- callbacks,
23
- container: widgetContainer,
24
- });
25
- this.renderCaptchaComponent(reactRoot, emotionCache, captchaComponent);
26
- return reactRoot;
27
- }
28
- readAndValidateSettings(element, config, renderOptions) {
29
- setValidChallengeLength(renderOptions, element, config);
30
- setLanguage(renderOptions, element, config);
31
- }
32
- makeEmotionCache(cacheKey, container) {
33
- return createCache({
34
- key: cacheKey,
35
- prepend: true,
36
- container: container,
37
- });
38
- }
39
- createReactRoot(container, identifierPrefix) {
40
- return createRoot(container, {
41
- identifierPrefix: identifierPrefix,
42
- });
43
- }
44
- renderCaptchaComponent(reactRoot, emotionCache, captchaComponent) {
45
- reactRoot.render(_jsx(CacheProvider, { value: emotionCache, children: captchaComponent }));
46
- }
47
- }
48
- export { CaptchaRenderer };
49
- //# sourceMappingURL=captchaRenderer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captchaRenderer.js","sourceRoot":"","sources":["../../../../src/util/captcha/captchaRenderer.tsx"],"names":[],"mappings":";AAcA,OAAO,WAAkC,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAS/C,OAAO,EAAa,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAUxD,MAAM,eAAe;IAGpB,YAAY,wBAAkD;QAC7D,IAAI,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;IAC1D,CAAC;IAEM,aAAa,CACnB,QAAwB,EACxB,SAAsB,EACtB,aAAsC,EACtC,SAAoB,EACpB,MAAe,EACf,IAAW,EACX,SAAkB,EAClB,eAA4B;QAE5B,MAAM,WAAW,GACf,aAAa,EAAE,WAA2B;YAC3C,QAAQ,CAAC,kBAAkB,CAAC;QAE7B,MAAM,MAAM,GAAG,YAAY,CAC1B,aAAa,CAAC,OAAO,EACrB,aAAa,CAAC,KAAK,EACnB,aAAa,CAAC,QAAQ,EACtB,MAAM,EACN,SAAS,E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ACH,CAAC;CACD;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,3 +0,0 @@
1
- import { CaptchaType } from "@prosopo/types";
2
- export declare function getCaptchaType(elements: Element[]): CaptchaType;
3
- //# sourceMappingURL=captchaType.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captchaType.d.ts","sourceRoot":"","sources":["../../../../src/util/captcha/captchaType.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAS7C,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,eAQjD"}
@@ -1,8 +0,0 @@
1
- import { CaptchaType } from "@prosopo/types";
2
- import { at } from "@prosopo/util";
3
- export function getCaptchaType(elements) {
4
- const features = Object.values(CaptchaType);
5
- const captchaType = features.find((feature) => feature === at(elements, 0).getAttribute("data-captcha-type")) || "frictionless";
6
- return captchaType;
7
- }
8
- //# sourceMappingURL=captchaType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captchaType.js","sourceRoot":"","sources":["../../../../src/util/captcha/captchaType.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAQnC,MAAM,UAAU,cAAc,CAAC,QAAmB;IACjD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,WAAW,GAChB,QAAQ,CAAC,IAAI,CACZ,CAAC,OAAO,EAAE,EAAE,CACX,OAAO,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAC9D,IAAK,cAA8B,CAAC;IACtC,OAAO,WAAW,CAAC;AACpB,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { CaptchaProps } from "../captchaProps.js";
2
- declare const FrictionlessCaptcha: (props: CaptchaProps) => import("react/jsx-runtime").JSX.Element;
3
- export { FrictionlessCaptcha };
4
- //# sourceMappingURL=frictionlessCaptcha.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"frictionlessCaptcha.d.ts","sourceRoot":"","sources":["../../../../../src/util/captcha/components/frictionlessCaptcha.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,QAAA,MAAM,mBAAmB,UAAW,YAAY,4CAmB/C,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { getDefaultEvents } from "@prosopo/procaptcha-common";
3
- import { ProcaptchaFrictionless } from "@prosopo/procaptcha-frictionless";
4
- import { useState } from "react";
5
- const FrictionlessCaptcha = (props) => {
6
- const { config, callbacks, i18n, container } = props;
7
- const [componentKey, setComponentKey] = useState(0);
8
- const restart = () => {
9
- setComponentKey((prevKey) => prevKey + 1);
10
- };
11
- return (_jsx(ProcaptchaFrictionless, { config: config, callbacks: getDefaultEvents(callbacks), restart: restart, i18n: i18n, container: container }, componentKey));
12
- };
13
- export { FrictionlessCaptcha };
14
- //# sourceMappingURL=frictionlessCaptcha.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"frictionlessCaptcha.js","sourceRoot":"","sources":["../../../../../src/util/captcha/components/frictionlessCaptcha.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,MAAM,mBAAmB,GAAG,CAAC,KAAmB,EAAE,EAAE;IACnD,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAErD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEpD,MAAM,OAAO,GAAG,GAAG,EAAE;QACpB,eAAe,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEF,OAAO,CACN,KAAC,sBAAsB,IAEtB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAC,EACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,IALf,YAAY,CAMhB,CACF,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { CaptchaProps } from "../captchaProps.js";
2
- declare const ImageCaptcha: (props: CaptchaProps) => import("react/jsx-runtime").JSX.Element;
3
- export { ImageCaptcha };
4
- //# sourceMappingURL=imageCaptcha.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"imageCaptcha.d.ts","sourceRoot":"","sources":["../../../../../src/util/captcha/components/imageCaptcha.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,QAAA,MAAM,YAAY,UAAW,YAAY,4CAUxC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { getDefaultEvents } from "@prosopo/procaptcha-common";
3
- import { Procaptcha } from "@prosopo/procaptcha-react";
4
- const ImageCaptcha = (props) => {
5
- const { config, callbacks, i18n } = props;
6
- return (_jsx(Procaptcha, { config: config, callbacks: getDefaultEvents(callbacks), i18n: i18n }));
7
- };
8
- export { ImageCaptcha };
9
- //# sourceMappingURL=imageCaptcha.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"imageCaptcha.js","sourceRoot":"","sources":["../../../../../src/util/captcha/components/imageCaptcha.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,MAAM,YAAY,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC5C,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAE1C,OAAO,CACN,KAAC,UAAU,IACV,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAC,EACtC,IAAI,EAAE,IAAI,GACT,CACF,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { CaptchaProps } from "../captchaProps.js";
2
- declare const PowCaptcha: (props: CaptchaProps) => import("react/jsx-runtime").JSX.Element;
3
- export { PowCaptcha };
4
- //# sourceMappingURL=powCaptcha.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"powCaptcha.d.ts","sourceRoot":"","sources":["../../../../../src/util/captcha/components/powCaptcha.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,QAAA,MAAM,UAAU,UAAW,YAAY,4CAUtC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { getDefaultEvents } from "@prosopo/procaptcha-common";
3
- import { ProcaptchaPow } from "@prosopo/procaptcha-pow";
4
- const PowCaptcha = (props) => {
5
- const { config, callbacks, i18n } = props;
6
- return (_jsx(ProcaptchaPow, { config: config, callbacks: getDefaultEvents(callbacks), i18n: i18n }));
7
- };
8
- export { PowCaptcha };
9
- //# sourceMappingURL=powCaptcha.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"powCaptcha.js","sourceRoot":"","sources":["../../../../../src/util/captcha/components/powCaptcha.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC1C,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAE1C,OAAO,CACN,KAAC,aAAa,IACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAC,EACtC,IAAI,EAAE,IAAI,GACT,CACF,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare const getProcaptchaScript: (name: string) => HTMLScriptElement | null;
2
- export declare const extractParams: (name: string) => {
3
- onloadUrlCallback: string | undefined;
4
- renderExplicit: string | undefined;
5
- };
6
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/util/config.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,mBAAmB,SAAU,MAAM,6BACoB,CAAC;AAErE,eAAO,MAAM,aAAa,SAAU,MAAM;;;CAWzC,CAAC"}
@@ -1,13 +0,0 @@
1
- export const getProcaptchaScript = (name) => document.querySelector(`script[src*="${name}"]`);
2
- export const extractParams = (name) => {
3
- const script = getProcaptchaScript(name);
4
- if (script && script.src.indexOf(`${name}`) !== -1) {
5
- const params = new URLSearchParams(script.src.split("?")[1]);
6
- return {
7
- onloadUrlCallback: params.get("onload") || undefined,
8
- renderExplicit: params.get("render") || undefined,
9
- };
10
- }
11
- return { onloadUrlCallback: undefined, renderExplicit: undefined };
12
- };
13
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/util/config.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE,CACnD,QAAQ,CAAC,aAAa,CAAoB,gBAAgB,IAAI,IAAI,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE;IAC7C,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACpD,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7D,OAAO;YACN,iBAAiB,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS;YACpD,cAAc,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS;SACjD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC;AACpE,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { Languages } from "@prosopo/locale";
2
- import { type ProcaptchaClientConfigOutput } from "@prosopo/types";
3
- declare function createConfig(siteKey?: string, theme?: "light" | "dark", language?: (typeof Languages)[keyof typeof Languages], web2?: boolean, invisible?: boolean, userAccountAddress?: string): ProcaptchaClientConfigOutput;
4
- export { createConfig };
5
- //# sourceMappingURL=configCreator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configCreator.d.ts","sourceRoot":"","sources":["../../../src/util/configCreator.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAEN,KAAK,4BAA4B,EAEjC,MAAM,gBAAgB,CAAC;AAExB,iBAAS,YAAY,CACpB,OAAO,CAAC,EAAE,MAAM,EAChB,KAAK,GAAE,OAAO,GAAG,MAAgB,EACjC,QAAQ,CAAC,EAAE,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,EACrD,IAAI,UAAO,EACX,SAAS,UAAQ,EACjB,kBAAkB,CAAC,EAAE,MAAM,GACzB,4BAA4B,CAqB9B;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,24 +0,0 @@
1
- import { EnvironmentTypesSchema, ProcaptchaConfigSchema, } from "@prosopo/types";
2
- function createConfig(siteKey, theme = "light", language, web2 = true, invisible = false, userAccountAddress) {
3
- if (!siteKey) {
4
- siteKey = process.env.PROSOPO_SITE_KEY || "";
5
- }
6
- return ProcaptchaConfigSchema.parse({
7
- defaultEnvironment: process.env.PROSOPO_DEFAULT_ENVIRONMENT
8
- ? EnvironmentTypesSchema.parse(process.env.PROSOPO_DEFAULT_ENVIRONMENT)
9
- : EnvironmentTypesSchema.enum.development,
10
- userAccountAddress: userAccountAddress || "",
11
- account: {
12
- address: siteKey,
13
- },
14
- serverUrl: process.env.PROSOPO_SERVER_URL || "",
15
- mongoAtlasUri: process.env.PROSOPO_MONGO_EVENTS_URI || "",
16
- devOnlyWatchEvents: process.env._DEV_ONLY_WATCH_EVENTS === "true" || false,
17
- web2,
18
- mode: invisible ? "invisible" : "visible",
19
- theme,
20
- language,
21
- });
22
- }
23
- export { createConfig };
24
- //# sourceMappingURL=configCreator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configCreator.js","sourceRoot":"","sources":["../../../src/util/configCreator.ts"],"names":[],"mappings":"AAeA,OAAO,EACN,sBAAsB,EAEtB,sBAAsB,GACtB,MAAM,gBAAgB,CAAC;AAExB,SAAS,YAAY,CACpB,OAAgB,EAChB,QAA0B,OAAO,EACjC,QAAqD,EACrD,IAAI,GAAG,IAAI,EACX,SAAS,GAAG,KAAK,EACjB,kBAA2B;IAE3B,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC;IAC9C,CAAC;IAED,OAAO,sBAAsB,CAAC,KAAK,CAAC;QACnC,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,2BAA2B;YAC1D,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC;YACvE,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,WAAW;QAC1C,kBAAkB,EAAE,kBAAkB,IAAI,EAAE;QAC5C,OAAO,EAAE;YACR,OAAO,EAAE,OAAO;SAChB;QACD,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,EAAE;QAC/C,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,EAAE;QACzD,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,KAAK,MAAM,IAAI,KAAK;QAC1E,IAAI;QACJ,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;QACzC,KAAK;QACL,QAAQ;KACR,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ProcaptchaClientConfigInput, ProcaptchaRenderOptions } from "@prosopo/types";
2
- export declare const setLanguage: (renderOptions: ProcaptchaRenderOptions | undefined, element: Element, config: ProcaptchaClientConfigInput) => void;
3
- //# sourceMappingURL=language.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../../src/util/language.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACX,2BAA2B,EAC3B,uBAAuB,EACvB,MAAM,gBAAgB,CAAC;AAcxB,eAAO,MAAM,WAAW,kBACR,uBAAuB,GAAG,SAAS,WACzC,OAAO,UACR,2BAA2B,SAQnC,CAAC"}
@@ -1,17 +0,0 @@
1
- import { LanguageSchema } from "@prosopo/locale";
2
- export const setLanguage = (renderOptions, element, config) => {
3
- const languageAttribute = renderOptions?.language || element.getAttribute("data-language");
4
- if (languageAttribute) {
5
- config.language = validateLanguage(languageAttribute);
6
- }
7
- };
8
- const validateLanguage = (languageAttribute) => {
9
- try {
10
- return LanguageSchema.parse(languageAttribute);
11
- }
12
- catch (error) {
13
- console.error(`Invalid language attribute: ${languageAttribute}`);
14
- return LanguageSchema.parse("en");
15
- }
16
- };
17
- //# sourceMappingURL=language.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"language.js","sourceRoot":"","sources":["../../../src/util/language.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAkB,MAAM,iBAAiB,CAAC;AAkBjE,MAAM,CAAC,MAAM,WAAW,GAAG,CAC1B,aAAkD,EAClD,OAAgB,EAChB,MAAmC,EAClC,EAAE;IACH,MAAM,iBAAiB,GACtB,aAAa,EAAE,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IAElE,IAAI,iBAAiB,EAAE,CAAC;QACvB,MAAM,CAAC,QAAQ,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IACvD,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,iBAA4C,EAAE,EAAE;IACzE,IAAI,CAAC;QACJ,OAAO,cAAc,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,+BAA+B,iBAAiB,EAAE,CAAC,CAAC;QAClE,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;AACF,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ProcaptchaClientConfigOutput, ProcaptchaRenderOptions } from "@prosopo/types";
2
- export declare const setValidChallengeLength: (renderOptions: ProcaptchaRenderOptions | undefined, element: Element, config: ProcaptchaClientConfigOutput) => void;
3
- //# sourceMappingURL=timeout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../../../src/util/timeout.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACX,4BAA4B,EAC5B,uBAAuB,EACvB,MAAM,gBAAgB,CAAC;AASxB,eAAO,MAAM,uBAAuB,kBACpB,uBAAuB,GAAG,SAAS,WACzC,OAAO,UACR,4BAA4B,KAClC,IAaF,CAAC"}
@@ -1,9 +0,0 @@
1
- export const setValidChallengeLength = (renderOptions, element, config) => {
2
- const challengeValidLengthAttribute = renderOptions?.["challenge-valid-length"] ||
3
- element.getAttribute("data-challenge-valid-length");
4
- if (challengeValidLengthAttribute) {
5
- config.captchas.image.solutionTimeout = Number.parseInt(challengeValidLengthAttribute);
6
- config.captchas.pow.solutionTimeout = Number.parseInt(challengeValidLengthAttribute);
7
- }
8
- };
9
- //# sourceMappingURL=timeout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeout.js","sourceRoot":"","sources":["../../../src/util/timeout.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACtC,aAAkD,EAClD,OAAgB,EAChB,MAAoC,EAC7B,EAAE;IACT,MAAM,6BAA6B,GAClC,aAAa,EAAE,CAAC,wBAAwB,CAAC;QACzC,OAAO,CAAC,YAAY,CAAC,6BAA6B,CAAC,CAAC;IAErD,IAAI,6BAA6B,EAAE,CAAC;QACnC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,QAAQ,CACtD,6BAA6B,CAC7B,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,eAAe,GAAG,MAAM,CAAC,QAAQ,CACpD,6BAA6B,CAC7B,CAAC;IACH,CAAC;AACF,CAAC,CAAC"}
@@ -1,18 +0,0 @@
1
- import type { Ti18n } from "@prosopo/locale";
2
- import { type Callbacks, type ProcaptchaRenderOptions } from "@prosopo/types";
3
- import type { Root } from "react-dom/client";
4
- import type { CaptchaRenderer } from "./captcha/captchaRenderer.js";
5
- import type { WidgetThemeResolver } from "./widgetThemeResolver.js";
6
- declare class WidgetFactory {
7
- private readonly widgetThemeResolver;
8
- private captchaRenderer;
9
- private _i18n;
10
- constructor(widgetThemeResolver: WidgetThemeResolver);
11
- get i18n(): Ti18n;
12
- createWidgets(containers: Element[], renderOptions: ProcaptchaRenderOptions, isWeb2?: boolean, invisible?: boolean): Promise<Root[]>;
13
- createWidget(container: Element, renderOptions: ProcaptchaRenderOptions, callbacks: Callbacks, isWeb2?: boolean, invisible?: boolean): Promise<Root>;
14
- protected getCaptchaRenderer(): Promise<CaptchaRenderer>;
15
- protected createCaptchaRenderer(): Promise<CaptchaRenderer>;
16
- }
17
- export { WidgetFactory };
18
- //# sourceMappingURL=widgetFactory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"widgetFactory.d.ts","sourceRoot":"","sources":["../../../src/util/widgetFactory.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAK7C,OAAO,EACN,KAAK,SAAS,EAGd,KAAK,uBAAuB,EAC5B,MAAM,gBAAgB,CAAC;AAMxB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,cAAM,aAAa;IAKjB,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IAJrC,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,KAAK,CAAsB;gBAGjB,mBAAmB,EAAE,mBAAmB;IAG1D,IAAI,IAAI,IAAI,KAAK,CAKhB;IAEY,aAAa,CACzB,UAAU,EAAE,OAAO,EAAE,EACrB,aAAa,EAAE,uBAAuB,EACtC,MAAM,UAAO,EACb,SAAS,UAAQ,GACf,OAAO,CAAC,IAAI,EAAE,CAAC;IAgBL,YAAY,CACxB,SAAS,EAAE,OAAO,EAClB,aAAa,EAAE,uBAAuB,EACtC,SAAS,EAAE,SAAS,EACpB,MAAM,UAAO,EACb,SAAS,UAAQ,GACf,OAAO,CAAC,IAAI,CAAC;cAoDA,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC;cAY9C,qBAAqB,IAAI,OAAO,CAAC,eAAe,CAAC;CAUjE;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}