@prosopo/procaptcha-bundle 3.0.12 → 3.1.6

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 (61) hide show
  1. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +17 -7
  2. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +1 -1
  3. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
  4. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +1 -1
  5. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +1 -1
  6. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
  7. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
  8. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
  9. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
  10. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +2 -1
  11. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -1
  12. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
  13. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +2 -2
  14. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +1 -1
  15. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +1 -1
  16. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +6 -2
  17. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +1 -1
  18. package/CHANGELOG.md +374 -0
  19. package/dist/bundle/{ProcaptchaWidget-48FxVPQd.js → ProcaptchaWidget-CJ-4hVS1.js} +25 -25
  20. package/dist/bundle/{ProcaptchaWidget-B2BzhXLv.js → ProcaptchaWidget-Cw3s7cGX.js} +290 -268
  21. package/dist/bundle/{builder-DNHtDoNG.js → builder-ByZ5z580.js} +3 -1
  22. package/dist/bundle/captchaComponentProvider-Cn75EmSH.js +1002 -0
  23. package/dist/bundle/{captchaRenderer-DdOlOCKw.js → captchaRenderer-s4QuLEen.js} +23 -22
  24. package/dist/bundle/{commonChunk-HCVkoCqn.js → commonChunk-BjvuHlB1.js} +62 -68
  25. package/dist/bundle/{emotion-element-5486c51c.browser.esm-D7qvHZDV.js → emotion-element-c39617d8.browser.esm-BNNnmykm.js} +343 -345
  26. package/dist/bundle/index-BuQg3Zno.js +1884 -0
  27. package/dist/bundle/{index-DyYmvHVN.js → index-DIdd2cUz.js} +1 -1
  28. package/dist/bundle/{index-C00_J7av.js → index-IgqrmVIs.js} +61 -59
  29. package/dist/bundle/nobleChunk-Bbltwf44.js +2728 -0
  30. package/dist/bundle/procaptcha.bundle.js +2 -2
  31. package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
  32. package/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
  33. package/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
  34. package/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
  35. package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
  36. package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
  37. package/dist/bundle/util/widgetFactory.d.ts.map +1 -1
  38. package/dist/bundle/{utilChunk-sqstc6C5.js → utilChunk-DPr6oTOj.js} +22 -22
  39. package/dist/bundle/{utilCryptoChunk-qm-BM2eT.js → utilCryptoChunk-D6ZLkbFV.js} +176 -167
  40. package/dist/bundle/{web2Chunk-DCsWA5PR.js → web2Chunk-CNoojUDK.js} +1083 -983
  41. package/dist/bundle/web3Chunk-BlYvY4Ea.js +525 -0
  42. package/dist/bundle/{zodChunk-wTu9ZHzV.js → zodChunk-aEfPZzrp.js} +3 -3
  43. package/dist/cjs/util/captcha/captchaComponentProvider.cjs +3 -2
  44. package/dist/cjs/util/captcha/captchaRenderer.cjs +4 -3
  45. package/dist/cjs/util/captcha/components/frictionlessCaptcha.cjs +4 -3
  46. package/dist/cjs/util/captcha/components/imageCaptcha.cjs +1 -1
  47. package/dist/cjs/util/captcha/components/powCaptcha.cjs +1 -1
  48. package/dist/cjs/util/widgetFactory.cjs +7 -2
  49. package/dist/util/captcha/captchaComponentProvider.js +3 -2
  50. package/dist/util/captcha/captchaRenderer.js +4 -3
  51. package/dist/util/captcha/components/frictionlessCaptcha.js +4 -3
  52. package/dist/util/captcha/components/imageCaptcha.js +1 -1
  53. package/dist/util/captcha/components/powCaptcha.js +1 -1
  54. package/dist/util/widgetFactory.js +7 -2
  55. package/package.json +25 -26
  56. package/stats.html +1 -1
  57. package/vite.test.config.ts +3 -2
  58. package/dist/bundle/captchaComponentProvider-B7Vxx339.js +0 -968
  59. package/dist/bundle/index-7Xh-Mf8v.js +0 -1318
  60. package/dist/bundle/nobleChunk-Qozzkbsq.js +0 -3648
  61. package/dist/bundle/web3Chunk-B8txCqUJ.js +0 -517
@@ -1,11 +1,11 @@
1
- import { g as k, p as M, b as D, P as G, E as F, j as S, C as W } from "./captchaComponentProvider-B7Vxx339.js";
2
- import { s as K, i as j, A as r, f as V, P as Y, u as X, r as l, l as q, M as H } from "./web2Chunk-DCsWA5PR.js";
3
- import { b as L, u as z } from "./builder-DNHtDoNG.js";
4
- import { l as B, d as J } from "./index-C00_J7av.js";
5
- import { a as v } from "./commonChunk-HCVkoCqn.js";
6
- import { w as Q } from "./utilChunk-sqstc6C5.js";
7
- const Z = (d, n, w, t, e) => {
8
- const g = k(t), m = () => ({
1
+ import { g as L, p as M, b as D, P as G, E as F, j as S, C as W } from "./captchaComponentProvider-Cn75EmSH.js";
2
+ import { s as K, k as j, A as r, h as V, P as Y, u as X, r as l, l as q, M as H } from "./web2Chunk-CNoojUDK.js";
3
+ import { b as k, u as z } from "./builder-ByZ5z580.js";
4
+ import { l as B, d as J } from "./index-IgqrmVIs.js";
5
+ import { a as v } from "./commonChunk-BjvuHlB1.js";
6
+ import { w as Q } from "./utilChunk-DPr6oTOj.js";
7
+ const Z = (d, n, E, t, e) => {
8
+ const g = L(t), m = () => ({
9
9
  // note order matters! see buildUpdateState. These fields are set in order, so disable modal first, then set loading to false, etc.
10
10
  showModal: !1,
11
11
  loading: !1,
@@ -16,7 +16,7 @@ const Z = (d, n, w, t, e) => {
16
16
  captchaApi: void 0,
17
17
  account: void 0
18
18
  // don't handle timeout here, this should be handled by the state management
19
- }), E = () => {
19
+ }), w = () => {
20
20
  window.clearTimeout(Number(n.timeout)), a({ timeout: void 0 });
21
21
  }, s = () => {
22
22
  a({
@@ -31,18 +31,18 @@ const Z = (d, n, w, t, e) => {
31
31
  ...d
32
32
  };
33
33
  return n.account && (o.userAccountAddress = n.account.account.address), Y.parse(o);
34
- }, f = () => {
34
+ }, h = () => {
35
35
  if (!n.account)
36
36
  throw new v("GENERAL.ACCOUNT_NOT_FOUND", {
37
37
  context: { error: "Account not loaded" }
38
38
  });
39
39
  return { account: n.account };
40
- }, h = () => {
40
+ }, f = () => {
41
41
  if (!n.dappAccount)
42
42
  throw new v("GENERAL.SITE_KEY_MISSING");
43
43
  return n.dappAccount;
44
- }, a = L(n, w), i = (o) => {
45
- E(), T(), a(m()), g.onReset(), o && o();
44
+ }, a = k(n, E), i = (o) => {
45
+ w(), T(), a(m()), g.onReset(), o && o();
46
46
  }, u = () => {
47
47
  const o = p().captchas.pow.solutionTimeout, R = setTimeout(() => {
48
48
  a({ isHuman: !1 }), g.onExpired(), i(e == null ? void 0 : e.restart);
@@ -68,11 +68,11 @@ const Z = (d, n, w, t, e) => {
68
68
  });
69
69
  let P;
70
70
  e != null && e.provider ? P = e.provider : P = await D(
71
- p()
71
+ p().defaultEnvironment
72
72
  );
73
- const _ = P.provider.url, y = new G(_, h()), c = await y.getPowCaptchaChallenge(
73
+ const _ = P.provider.url, y = new G(_, f()), c = await y.getPowCaptchaChallenge(
74
74
  N,
75
- h(),
75
+ f(),
76
76
  e == null ? void 0 : e.sessionId
77
77
  );
78
78
  if (c.error)
@@ -98,8 +98,8 @@ const Z = (d, n, w, t, e) => {
98
98
  });
99
99
  (await y.submitPowCaptchaSolution(
100
100
  c,
101
- f().account.account.address,
102
- h(),
101
+ h().account.account.address,
102
+ f(),
103
103
  b,
104
104
  U.signature.toString(),
105
105
  o.captchas.pow.verifiedTimeout
@@ -109,8 +109,8 @@ const Z = (d, n, w, t, e) => {
109
109
  }), g.onHuman(
110
110
  V({
111
111
  [r.providerUrl]: _,
112
- [r.user]: f().account.account.address,
113
- [r.dapp]: h(),
112
+ [r.user]: h().account.account.address,
113
+ [r.dapp]: f(),
114
114
  [r.challenge]: c.challenge,
115
115
  [r.nonce]: b,
116
116
  [r.timestamp]: c.timestamp,
@@ -138,15 +138,15 @@ const Z = (d, n, w, t, e) => {
138
138
  };
139
139
  }, I = "procaptcha:execute", ce = (d) => {
140
140
  var i;
141
- const { t: n, ready: w } = X(), t = d.config, e = d.i18n, g = t.theme === "light" ? B : J, m = d.frictionlessState, E = d.callbacks || {}, [s, T] = z(l.useState, l.useRef), [p, f] = l.useState(!1), h = L(s, T), a = l.useRef(
142
- Z(t, s, h, E, m)
141
+ const { t: n, ready: E } = X(), t = d.config, e = d.i18n, g = t.theme === "light" ? B : J, m = d.frictionlessState, w = d.callbacks || {}, [s, T] = z(l.useState, l.useRef), [p, h] = l.useState(!1), f = k(s, T), a = l.useRef(
142
+ Z(t, s, f, w, m)
143
143
  );
144
144
  return l.useEffect(() => {
145
145
  t.language && (e ? e.language !== t.language && e.changeLanguage(t.language).then((u) => u) : q().then((u) => {
146
146
  u.language !== t.language && u.changeLanguage(t.language).then((A) => A);
147
147
  }));
148
148
  }, [e, t.language]), l.useEffect(() => {
149
- s.error && (f(!1), s.error.key === "CAPTCHA.NO_SESSION_FOUND" && m && setTimeout(() => {
149
+ s.error && (h(!1), s.error.key === "CAPTCHA.NO_SESSION_FOUND" && m && setTimeout(() => {
150
150
  m.restart();
151
151
  }, 3e3));
152
152
  }, [s.error, m]), l.useEffect(() => {
@@ -172,10 +172,10 @@ const Z = (d, n, w, t, e) => {
172
172
  {
173
173
  checked: s.isHuman,
174
174
  onChange: async () => {
175
- p || (f(!0), await a.current.start(), f(!1));
175
+ p || (h(!0), await a.current.start(), h(!1));
176
176
  },
177
177
  theme: g,
178
- labelText: w ? n("WIDGET.I_AM_HUMAN") : "",
178
+ labelText: E ? n("WIDGET.I_AM_HUMAN") : "",
179
179
  error: (i = s.error) == null ? void 0 : i.message,
180
180
  "aria-label": "human checkbox",
181
181
  loading: p