@prosopo/procaptcha-bundle 3.0.13 → 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.
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +19 -9
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +2 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +2 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +6 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +1 -1
- package/CHANGELOG.md +347 -0
- package/dist/bundle/{ProcaptchaWidget-BIt2pcrz.js → ProcaptchaWidget-CJ-4hVS1.js} +24 -24
- package/dist/bundle/{ProcaptchaWidget-CXxnCzl2.js → ProcaptchaWidget-Cw3s7cGX.js} +290 -268
- package/dist/bundle/{builder-DNHtDoNG.js → builder-ByZ5z580.js} +3 -1
- package/dist/bundle/captchaComponentProvider-Cn75EmSH.js +1002 -0
- package/dist/bundle/{captchaRenderer-CqnUYyKY.js → captchaRenderer-s4QuLEen.js} +23 -22
- package/dist/bundle/{commonChunk-BKceWhtS.js → commonChunk-BjvuHlB1.js} +62 -68
- package/dist/bundle/{emotion-element-5486c51c.browser.esm-CimrRZxS.js → emotion-element-c39617d8.browser.esm-BNNnmykm.js} +343 -345
- package/dist/bundle/index-BuQg3Zno.js +1884 -0
- package/dist/bundle/{index-KHTbPva_.js → index-DIdd2cUz.js} +1 -1
- package/dist/bundle/{index-hrOz2CPm.js → index-IgqrmVIs.js} +61 -59
- package/dist/bundle/nobleChunk-Bbltwf44.js +2728 -0
- package/dist/bundle/procaptcha.bundle.js +2 -2
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
- package/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
- package/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/dist/bundle/{utilCryptoChunk-BKe3CKqn.js → utilCryptoChunk-D6ZLkbFV.js} +252 -243
- package/dist/bundle/{web2Chunk-Cqw91v-J.js → web2Chunk-CNoojUDK.js} +1067 -977
- package/dist/bundle/web3Chunk-BlYvY4Ea.js +525 -0
- package/dist/bundle/{zodChunk-wTu9ZHzV.js → zodChunk-aEfPZzrp.js} +3 -3
- package/dist/cjs/util/captcha/captchaComponentProvider.cjs +3 -2
- package/dist/cjs/util/captcha/captchaRenderer.cjs +4 -3
- package/dist/cjs/util/captcha/components/frictionlessCaptcha.cjs +4 -3
- package/dist/cjs/util/captcha/components/imageCaptcha.cjs +1 -1
- package/dist/cjs/util/captcha/components/powCaptcha.cjs +1 -1
- package/dist/cjs/util/widgetFactory.cjs +7 -2
- package/dist/util/captcha/captchaComponentProvider.js +3 -2
- package/dist/util/captcha/captchaRenderer.js +4 -3
- package/dist/util/captcha/components/frictionlessCaptcha.js +4 -3
- package/dist/util/captcha/components/imageCaptcha.js +1 -1
- package/dist/util/captcha/components/powCaptcha.js +1 -1
- package/dist/util/widgetFactory.js +7 -2
- package/package.json +19 -20
- package/stats.html +1 -1
- package/vite.test.config.ts +3 -2
- package/dist/bundle/captchaComponentProvider-BGEAkC9Y.js +0 -968
- package/dist/bundle/index-7Xh-Mf8v.js +0 -1318
- package/dist/bundle/nobleChunk-CQ4ENyKh.js +0 -3769
- package/dist/bundle/web3Chunk-BcwDKvjL.js +0 -517
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import { s as K,
|
|
3
|
-
import { b as
|
|
4
|
-
import { l as B, d as J } from "./index-
|
|
5
|
-
import { a as v } from "./commonChunk-
|
|
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
6
|
import { w as Q } from "./utilChunk-DPr6oTOj.js";
|
|
7
|
-
const Z = (d, n,
|
|
8
|
-
const g =
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
40
|
+
}, f = () => {
|
|
41
41
|
if (!n.dappAccount)
|
|
42
42
|
throw new v("GENERAL.SITE_KEY_MISSING");
|
|
43
43
|
return n.dappAccount;
|
|
44
|
-
}, a =
|
|
45
|
-
|
|
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(_,
|
|
73
|
+
const _ = P.provider.url, y = new G(_, f()), c = await y.getPowCaptchaChallenge(
|
|
74
74
|
N,
|
|
75
|
-
|
|
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
|
-
|
|
102
|
-
|
|
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]:
|
|
113
|
-
[r.dapp]:
|
|
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:
|
|
142
|
-
Z(t, s,
|
|
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 && (
|
|
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 || (
|
|
175
|
+
p || (h(!0), await a.current.start(), h(!1));
|
|
176
176
|
},
|
|
177
177
|
theme: g,
|
|
178
|
-
labelText:
|
|
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
|