@prosopo/procaptcha-bundle 2.6.12 → 3.0.5
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/index.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js +3 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.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 +4 -0
- 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/captchaComponentsList.d.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +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 +1 -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/configCreator.d.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js +2 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js.map +1 -1
- package/CHANGELOG.md +132 -0
- package/dist/bundle/ProcaptchaWidget-BpzncYOb.js +612 -0
- package/dist/bundle/ProcaptchaWidget-D961oZ27.js +148 -0
- package/dist/bundle/bnChunk-DRlDxTFg.js +1137 -0
- package/dist/bundle/{browser-ponyfill-Bctlk3uB.js → browser-ponyfill-CvzSbL_o.js} +31 -30
- package/dist/bundle/builder-CQlqPNRd.js +37 -0
- package/dist/bundle/captchaComponentProvider-Dw6ydLe3.js +802 -0
- package/dist/bundle/{captchaRenderer-BAMErqQN.js → captchaRenderer-CY8KuZK-.js} +22 -22
- package/dist/bundle/commonChunk-24zMb_mF.js +189 -0
- package/dist/bundle/emotion-element-5486c51c.browser.esm-PRDDgd_k.js +918 -0
- package/dist/bundle/{fp.esm-DYWeNGcH.js → fp.esm-BADUiinQ.js} +548 -648
- package/dist/bundle/index-BRg_gWPo.js +1328 -0
- package/dist/bundle/{index-ByKGlSkE.js → index-BzOMq-ud.js} +2 -2
- package/dist/bundle/{index-1qH2dz7u.js → index-DqwVRCwA.js} +166 -199
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/locales/ar/translation.json +4 -3
- package/dist/bundle/locales/az/translation.json +4 -3
- package/dist/bundle/locales/cs/translation.json +4 -3
- package/dist/bundle/locales/de/translation.json +4 -3
- package/dist/bundle/locales/el/translation.json +4 -3
- package/dist/bundle/locales/en/translation.json +4 -3
- package/dist/bundle/locales/es/translation.json +4 -3
- package/dist/bundle/locales/fi/translation.json +4 -3
- package/dist/bundle/locales/fr/translation.json +4 -3
- package/dist/bundle/locales/hi/translation.json +4 -3
- package/dist/bundle/locales/hu/translation.json +4 -3
- package/dist/bundle/locales/id/translation.json +4 -3
- package/dist/bundle/locales/it/translation.json +4 -3
- package/dist/bundle/locales/ja/translation.json +4 -3
- package/dist/bundle/locales/jv/translation.json +4 -3
- package/dist/bundle/locales/ko/translation.json +4 -3
- package/dist/bundle/locales/ml/translation.json +4 -3
- package/dist/bundle/locales/ms/translation.json +4 -3
- package/dist/bundle/locales/nl/translation.json +4 -3
- package/dist/bundle/locales/no/translation.json +4 -3
- package/dist/bundle/locales/pl/translation.json +4 -3
- package/dist/bundle/locales/pt/translation.json +4 -3
- package/dist/bundle/locales/{pt-br → pt-BR}/translation.json +4 -3
- package/dist/bundle/locales/ro/translation.json +4 -3
- package/dist/bundle/locales/ru/translation.json +4 -3
- package/dist/bundle/locales/sr/translation.json +4 -3
- package/dist/bundle/locales/sv/translation.json +4 -3
- package/dist/bundle/locales/th/translation.json +4 -3
- package/dist/bundle/locales/tr/translation.json +4 -3
- package/dist/bundle/locales/uk/translation.json +4 -3
- package/dist/bundle/locales/vi/translation.json +4 -3
- package/dist/bundle/locales/{zh-cn → zh-CN}/translation.json +4 -3
- package/dist/bundle/nobleChunk-Xl5XLrx3.js +3635 -0
- package/dist/bundle/procaptcha.bundle.js +6 -5
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaComponentsList.d.ts +1 -1
- package/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/dist/bundle/util/configCreator.d.ts +1 -1
- package/dist/bundle/util/configCreator.d.ts.map +1 -1
- package/dist/bundle/utilChunk-sqstc6C5.js +317 -0
- package/dist/bundle/utilCryptoChunk-CIPUtfoO.js +1256 -0
- package/dist/bundle/web2Chunk-7Vd8yt2r.js +3711 -0
- package/dist/bundle/{hash-CrwduMDb.js → web3Chunk-DrUvbVNW.js} +257 -695
- package/dist/bundle/{translations-DEL070wJ.js → zodChunk-wTu9ZHzV.js} +46 -82
- package/dist/cjs/index.cjs +8 -2
- package/dist/cjs/util/captcha/captchaComponentProvider.cjs +4 -0
- package/dist/cjs/util/captcha/captchaRenderer.cjs +2 -1
- package/dist/cjs/util/configCreator.cjs +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/util/captcha/captchaComponentProvider.d.ts +1 -1
- package/dist/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/dist/util/captcha/captchaComponentProvider.js +4 -0
- package/dist/util/captcha/captchaComponentProvider.js.map +1 -1
- package/dist/util/captcha/captchaComponentsList.d.ts +1 -1
- package/dist/util/captcha/captchaComponentsList.d.ts.map +1 -1
- package/dist/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/dist/util/captcha/captchaRenderer.js +1 -1
- package/dist/util/captcha/captchaRenderer.js.map +1 -1
- package/dist/util/configCreator.d.ts +1 -1
- package/dist/util/configCreator.d.ts.map +1 -1
- package/dist/util/configCreator.js +2 -2
- package/dist/util/configCreator.js.map +1 -1
- package/package.json +21 -14
- package/stats.html +1 -1
- package/vite.config.ts +47 -4
- package/vite.serve.config.ts +2 -0
- package/vite.test.config.ts +1 -1
- package/webpack.config.cjs +5 -0
- package/dist/bundle/ProcaptchaWidget-DPyDGPiI.js +0 -156
- package/dist/bundle/ProcaptchaWidget-DoqUlwHS.js +0 -636
- package/dist/bundle/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/bundle/asU8a-BixKX-w0.js +0 -9
- package/dist/bundle/bip39-D7YSihxf.js +0 -260
- package/dist/bundle/captchaComponentProvider-BL18T1UE.js +0 -1242
- package/dist/bundle/emotion-element-5486c51c.browser.esm-Bjt1gs1F.js +0 -1807
- package/dist/bundle/i18nFrontend-DCv3P9jv.js +0 -2273
- package/dist/bundle/index-BeN3et18.js +0 -4844
- package/dist/bundle/index-BjRdPnnE.js +0 -1198
- package/dist/bundle/index-CBquknc2.js +0 -81
- package/dist/bundle/index-QVME9Prx.js +0 -32
- package/dist/bundle/sha256-CGE_4eEY.js +0 -171
- package/dist/bundle/spread-DEmVz7RJ.js +0 -15
- package/dist/bundle/toU8a-CPMbkkSw.js +0 -109
- package/dist/bundle/useTranslation-BJsfZyOx.js +0 -158
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as Dc } from "./
|
|
2
|
-
import { r as _a } from "./
|
|
1
|
+
import { g as Dc } from "./bnChunk-DRlDxTFg.js";
|
|
2
|
+
import { r as _a } from "./web2Chunk-7Vd8yt2r.js";
|
|
3
3
|
var Co = { exports: {} }, ve = {}, xo = { exports: {} }, _o = {};
|
|
4
4
|
(function(e) {
|
|
5
5
|
function t(C, z) {
|
|
@@ -1,58 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
throw new Error("Array is empty");
|
|
4
|
-
if (!Number.isFinite(t))
|
|
5
|
-
throw new Error(`Index ${t} is not a finite number`);
|
|
6
|
-
if (t > 0 ? t = t % e.length : t = Math.ceil(Math.abs(t) / e.length) * e.length + t, t >= e.length)
|
|
7
|
-
throw new Error(`Index ${t} larger than array length ${e.length}`);
|
|
8
|
-
if (t < 0)
|
|
9
|
-
throw new Error(`Index ${t} smaller than 0`);
|
|
10
|
-
return e[t];
|
|
11
|
-
}
|
|
12
|
-
var p;
|
|
13
|
-
(function(e) {
|
|
14
|
-
e.datasetId = "datasetId", e.user = "user", e.dapp = "dapp", e.provider = "provider", e.blockNumber = "blockNumber", e.requestHash = "requestHash", e.captchas = "captchas", e.commitmentId = "commitmentId", e.proof = "proof", e.dappSignature = "dappSignature", e.dappUserSignature = "dappUserSignature", e.providerUrl = "providerUrl", e.procaptchaResponse = "procaptcha-response", e.verifiedTimeout = "verifiedTimeout", e.maxVerifiedTime = "maxVerifiedTime", e.verified = "verified", e.status = "status", e.challenge = "challenge", e.difficulty = "difficulty", e.nonce = "nonce", e.timeouts = "timeouts", e.token = "token", e.secret = "secret", e.timestamp = "timestamp", e.signature = "signature", e.error = "error", e.siteKey = "siteKey", e.captchaType = "captchaType", e.sessionId = "sessionId", e.settings = "settings", e.domains = "domains", e.frictionlessThreshold = "frictionlessThreshold", e.powDifficulty = "powDifficulty", e.score = "score", e.tier = "tier", e.detectorKey = "detectorKey", e.ip = "ip";
|
|
15
|
-
})(p || (p = {}));
|
|
16
|
-
var g;
|
|
17
|
-
(function(e) {
|
|
18
|
-
e.image = "image", e.pow = "pow", e.frictionless = "frictionless";
|
|
19
|
-
})(g || (g = {}));
|
|
20
|
-
let C;
|
|
21
|
-
async function M(e) {
|
|
22
|
-
return new Promise((t, o) => {
|
|
23
|
-
try {
|
|
24
|
-
import("./i18nFrontend-DCv3P9jv.js").then((n) => n.b).then(({ default: n }) => {
|
|
25
|
-
C || (C = n()), t(C);
|
|
26
|
-
});
|
|
27
|
-
} catch (n) {
|
|
28
|
-
o(n);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function H(e) {
|
|
1
|
+
import { A, C as W, a as _, l as $ } from "./web2Chunk-7Vd8yt2r.js";
|
|
2
|
+
function N(e) {
|
|
33
3
|
const t = e.getRootNode();
|
|
34
4
|
return (t instanceof ShadowRoot ? t.host : e).closest("form");
|
|
35
5
|
}
|
|
36
|
-
const
|
|
37
|
-
Array.from(document.getElementsByName(
|
|
38
|
-
},
|
|
6
|
+
const l = () => {
|
|
7
|
+
Array.from(document.getElementsByName(A.procaptchaResponse)).map((t) => t.remove());
|
|
8
|
+
}, u = (e) => {
|
|
39
9
|
const t = window[e.replace("window.", "")];
|
|
40
10
|
if (typeof t != "function")
|
|
41
11
|
throw new Error(`Callback ${e} is not defined on the window object`);
|
|
42
12
|
return t;
|
|
43
|
-
},
|
|
44
|
-
onHuman: (t) =>
|
|
13
|
+
}, M = (e) => ({
|
|
14
|
+
onHuman: (t) => I(t, e),
|
|
45
15
|
onChallengeExpired: () => {
|
|
46
|
-
|
|
16
|
+
l();
|
|
47
17
|
},
|
|
48
18
|
onExtensionNotFound: () => {
|
|
49
19
|
console.error("Extension not found");
|
|
50
20
|
},
|
|
51
21
|
onExpired: () => {
|
|
52
|
-
|
|
22
|
+
l();
|
|
53
23
|
},
|
|
54
24
|
onError: (t) => {
|
|
55
|
-
|
|
25
|
+
l(), console.error(t);
|
|
56
26
|
},
|
|
57
27
|
onClose: () => {
|
|
58
28
|
},
|
|
@@ -62,82 +32,82 @@ const r = () => {
|
|
|
62
32
|
alert("Captcha challenge failed. Please try again");
|
|
63
33
|
},
|
|
64
34
|
onReset: () => {
|
|
65
|
-
|
|
35
|
+
l();
|
|
66
36
|
},
|
|
67
37
|
onReload: () => {
|
|
68
38
|
}
|
|
69
39
|
}), s = (e, t, o) => {
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
return
|
|
40
|
+
const a = t.getAttribute(`data-${e}`);
|
|
41
|
+
if (a) {
|
|
42
|
+
const n = u(a);
|
|
43
|
+
if (n)
|
|
44
|
+
return n;
|
|
75
45
|
}
|
|
76
46
|
if (typeof o == "function")
|
|
77
47
|
return o;
|
|
78
48
|
if (typeof o == "string")
|
|
79
|
-
return
|
|
49
|
+
return u(o);
|
|
80
50
|
};
|
|
81
|
-
function
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
51
|
+
function H(e, t, o) {
|
|
52
|
+
const a = s("callback", o, e == null ? void 0 : e.callback);
|
|
53
|
+
a && (t.onHuman = (f) => {
|
|
54
|
+
I(f, o), a(f);
|
|
85
55
|
});
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
56
|
+
const n = s("chalexpired-callback", o, e == null ? void 0 : e["chalexpired-callback"]);
|
|
57
|
+
n && (t.onChallengeExpired = () => {
|
|
58
|
+
l(), n();
|
|
89
59
|
});
|
|
90
60
|
const c = s("expired-callback", o, e == null ? void 0 : e["expired-callback"]);
|
|
91
61
|
c && (t.onExpired = () => {
|
|
92
|
-
|
|
62
|
+
l(), c();
|
|
93
63
|
});
|
|
94
64
|
const i = s("error-callback", o, e == null ? void 0 : e["error-callback"]);
|
|
95
|
-
i && (t.onError = (
|
|
96
|
-
|
|
65
|
+
i && (t.onError = (f) => {
|
|
66
|
+
l(), i(f);
|
|
97
67
|
});
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
68
|
+
const r = s("close-callback", o, e == null ? void 0 : e["close-callback"]);
|
|
69
|
+
r && (t.onClose = () => {
|
|
70
|
+
r();
|
|
101
71
|
});
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
72
|
+
const y = s("open-callback", o, e == null ? void 0 : e["open-callback"]);
|
|
73
|
+
y && (t.onOpen = () => {
|
|
74
|
+
y();
|
|
105
75
|
});
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
76
|
+
const w = s("failed-callback", o, e == null ? void 0 : e["failed-callback"]);
|
|
77
|
+
w && (t.onFailed = () => {
|
|
78
|
+
w();
|
|
109
79
|
});
|
|
110
80
|
const h = s("reset-callback", o, e == null ? void 0 : e["reset-callback"]);
|
|
111
81
|
h && (t.onReset = () => {
|
|
112
|
-
|
|
82
|
+
l(), h();
|
|
113
83
|
});
|
|
114
84
|
}
|
|
115
|
-
const
|
|
116
|
-
if (
|
|
117
|
-
const o =
|
|
85
|
+
const I = (e, t) => {
|
|
86
|
+
if (l(), t) {
|
|
87
|
+
const o = N(t);
|
|
118
88
|
if (!o) {
|
|
119
89
|
console.error("Parent form not found for the element:", t);
|
|
120
90
|
return;
|
|
121
91
|
}
|
|
122
|
-
const
|
|
123
|
-
|
|
92
|
+
const a = document.createElement("input");
|
|
93
|
+
a.type = "hidden", a.name = A.procaptchaResponse, a.value = e, o.appendChild(a);
|
|
124
94
|
}
|
|
125
|
-
},
|
|
126
|
-
function
|
|
95
|
+
}, P = "https://prosopo.io", T = "Visit prosopo.io to learn more about the service and its accessibility options.", U = 74, x = 80, F = "80px", v = "302px", G = "8px", j = "2px", z = "1px solid", E = "checkbox__loading-spinner";
|
|
96
|
+
function B(e) {
|
|
127
97
|
const t = document.createElement("div");
|
|
128
|
-
return t.className = "checkbox", t.innerHTML =
|
|
98
|
+
return t.className = "checkbox", t.innerHTML = X(e) + q, t;
|
|
129
99
|
}
|
|
130
|
-
const
|
|
100
|
+
const K = (e) => (e.shadowRoot || e).querySelector(".checkbox__content"), q = `
|
|
131
101
|
<div class="checkbox__outer">
|
|
132
102
|
<div class="checkbox__wrapper">
|
|
133
103
|
<div class="checkbox__inner">
|
|
134
104
|
<div class="checkbox__content">
|
|
135
|
-
<div class="${
|
|
105
|
+
<div class="${E}" aria-label="Loading spinner"></div>
|
|
136
106
|
</div>
|
|
137
107
|
</div>
|
|
138
108
|
</div>
|
|
139
109
|
</div>
|
|
140
|
-
`,
|
|
110
|
+
`, X = (e) => `
|
|
141
111
|
<style>
|
|
142
112
|
.checkbox {
|
|
143
113
|
display: flex;
|
|
@@ -165,7 +135,7 @@ const V = (e) => (e.shadowRoot || e).querySelector(".checkbox__content"), X = `
|
|
|
165
135
|
display: inline-flex;
|
|
166
136
|
}
|
|
167
137
|
|
|
168
|
-
.${
|
|
138
|
+
.${E} {
|
|
169
139
|
margin-top: 0;
|
|
170
140
|
margin-left: 15px;
|
|
171
141
|
margin-right: 15px;
|
|
@@ -180,7 +150,7 @@ const V = (e) => (e.shadowRoot || e).querySelector(".checkbox__content"), X = `
|
|
|
180
150
|
will-change: transform;
|
|
181
151
|
}
|
|
182
152
|
|
|
183
|
-
@keyframes ${
|
|
153
|
+
@keyframes ${E}-rotation {
|
|
184
154
|
0% {
|
|
185
155
|
transform: rotate(0deg);
|
|
186
156
|
}
|
|
@@ -190,11 +160,11 @@ const V = (e) => (e.shadowRoot || e).querySelector(".checkbox__content"), X = `
|
|
|
190
160
|
}
|
|
191
161
|
</style>
|
|
192
162
|
`;
|
|
193
|
-
function
|
|
163
|
+
function V(e) {
|
|
194
164
|
const t = document.createElement("div");
|
|
195
|
-
return t.className = "logo", t.innerHTML =
|
|
165
|
+
return t.className = "logo", t.innerHTML = Y + Z(e), t;
|
|
196
166
|
}
|
|
197
|
-
const
|
|
167
|
+
const Y = `
|
|
198
168
|
<style>
|
|
199
169
|
.logo {
|
|
200
170
|
display: inline-flex;
|
|
@@ -228,15 +198,15 @@ const J = `
|
|
|
228
198
|
|
|
229
199
|
</style>
|
|
230
200
|
`;
|
|
231
|
-
function
|
|
201
|
+
function Z(e) {
|
|
232
202
|
return `
|
|
233
|
-
<a href="${
|
|
234
|
-
aria-label="${
|
|
203
|
+
<a href="${P}?utm_campaign=widget" tabindex="0" target="_blank" role="button"
|
|
204
|
+
aria-label="${T}"
|
|
235
205
|
style="text-decoration: none;">
|
|
236
206
|
<div class="prosopo-logo">
|
|
237
207
|
<svg id="logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 49.010001 49.009997" style="fill: ${e.palette.logoFill};"
|
|
238
208
|
aria-label="Prosopo Logo With Text">
|
|
239
|
-
<title>${
|
|
209
|
+
<title>${T}</title>
|
|
240
210
|
<g transform="matrix(0.11319331,0,0,0.11319331,6.504999,-2.2052113e-4)">
|
|
241
211
|
<g>
|
|
242
212
|
<path d="m 119.79,50.5 a 147.75,147.75 0 0 1 147.75,147.75 h 50.5 C 318.04,88.76 229.28,0 119.79,0 Z"></path>
|
|
@@ -253,14 +223,14 @@ function Q(e) {
|
|
|
253
223
|
</a>
|
|
254
224
|
`;
|
|
255
225
|
}
|
|
256
|
-
function
|
|
257
|
-
var
|
|
226
|
+
function J(e) {
|
|
227
|
+
var n, c;
|
|
258
228
|
const t = document.createElement("div");
|
|
259
229
|
t.className = "widget";
|
|
260
|
-
const o =
|
|
261
|
-
return t.innerHTML =
|
|
230
|
+
const o = B(e), a = V(e);
|
|
231
|
+
return t.innerHTML = O(e) + Q(te()), (n = t.querySelector(".widget__checkbox")) == null || n.replaceWith(o), (c = t.querySelector(".widget__logo")) == null || c.replaceWith(a), t;
|
|
262
232
|
}
|
|
263
|
-
function
|
|
233
|
+
function Q(e) {
|
|
264
234
|
return `
|
|
265
235
|
<div class="widget__outer">
|
|
266
236
|
<div class="widget__wrapper">
|
|
@@ -276,16 +246,16 @@ function O(e) {
|
|
|
276
246
|
</div>
|
|
277
247
|
`;
|
|
278
248
|
}
|
|
279
|
-
function
|
|
249
|
+
function O(e) {
|
|
280
250
|
return `
|
|
281
251
|
<style>
|
|
282
252
|
.widget {
|
|
283
253
|
width: 100%;
|
|
284
|
-
min-height: ${
|
|
254
|
+
min-height: ${F}
|
|
285
255
|
}
|
|
286
256
|
|
|
287
257
|
.widget__outer {
|
|
288
|
-
max-width: ${
|
|
258
|
+
max-width: ${v};
|
|
289
259
|
min-height: 100%;
|
|
290
260
|
overflow-x: auto;
|
|
291
261
|
width: 100%;
|
|
@@ -298,7 +268,7 @@ function ee(e) {
|
|
|
298
268
|
container-name: widget;
|
|
299
269
|
display: flex;
|
|
300
270
|
flex-direction: column;
|
|
301
|
-
height: ${
|
|
271
|
+
height: ${x}px;
|
|
302
272
|
min-width: 220px;
|
|
303
273
|
}
|
|
304
274
|
|
|
@@ -306,63 +276,63 @@ function ee(e) {
|
|
|
306
276
|
max-height: 100%;
|
|
307
277
|
min-width: 100%;
|
|
308
278
|
overflow: hidden;
|
|
309
|
-
height: ${
|
|
279
|
+
height: ${x}px;
|
|
310
280
|
width: 100%;
|
|
311
281
|
display: grid;
|
|
312
282
|
}
|
|
313
283
|
|
|
314
284
|
.widget__dimensions {
|
|
315
|
-
max-width: ${
|
|
316
|
-
min-height: ${
|
|
285
|
+
max-width: ${v};
|
|
286
|
+
min-height: ${x}px;
|
|
317
287
|
}
|
|
318
288
|
|
|
319
289
|
.widget__content {
|
|
320
|
-
padding: ${
|
|
321
|
-
border: ${
|
|
290
|
+
padding: ${j};
|
|
291
|
+
border: ${z};
|
|
322
292
|
background-color: ${e.palette.background.default};
|
|
323
293
|
border-color: ${e.palette.grey[300]};
|
|
324
|
-
border-radius: ${
|
|
294
|
+
border-radius: ${G};
|
|
325
295
|
display: flex;
|
|
326
296
|
align-items: center;
|
|
327
297
|
flex-wrap: wrap;
|
|
328
298
|
justify-content: space-between;
|
|
329
|
-
min-height: ${
|
|
299
|
+
min-height: ${U}px;
|
|
330
300
|
overflow: hidden;
|
|
331
301
|
}
|
|
332
302
|
</style>
|
|
333
303
|
`;
|
|
334
304
|
}
|
|
335
|
-
function
|
|
305
|
+
function ee() {
|
|
336
306
|
var t;
|
|
337
307
|
return typeof process < "u" ? "production" : (t = import.meta.env) == null ? void 0 : t.MODE;
|
|
338
308
|
}
|
|
339
|
-
const
|
|
309
|
+
const te = () => ee() !== "production", oe = 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"';
|
|
340
310
|
function ae(e, t = "") {
|
|
341
311
|
const o = document.createElement(e);
|
|
342
|
-
|
|
343
|
-
const
|
|
344
|
-
return
|
|
312
|
+
ce(o);
|
|
313
|
+
const a = o.attachShadow({ mode: "open" });
|
|
314
|
+
return a.innerHTML = ne(t), o;
|
|
345
315
|
}
|
|
346
|
-
const
|
|
316
|
+
const ne = (e) => `
|
|
347
317
|
<style>
|
|
348
|
-
*{font-family: ${
|
|
318
|
+
*{font-family: ${oe};}
|
|
349
319
|
</style>
|
|
350
320
|
|
|
351
321
|
<style>
|
|
352
322
|
${e}
|
|
353
323
|
</style>
|
|
354
|
-
`,
|
|
355
|
-
e.style.display = "flex", e.style.flexDirection = "column", e.style.width = "100%", e.style.maxWidth =
|
|
324
|
+
`, ce = (e) => {
|
|
325
|
+
e.style.display = "flex", e.style.flexDirection = "column", e.style.width = "100%", e.style.maxWidth = v;
|
|
356
326
|
};
|
|
357
|
-
function
|
|
358
|
-
const
|
|
359
|
-
le(
|
|
360
|
-
const i =
|
|
327
|
+
function ie(e, t, o) {
|
|
328
|
+
const a = J(t), n = ae(o);
|
|
329
|
+
le(n).appendChild(a), e.innerHTML = "", e.appendChild(n);
|
|
330
|
+
const i = K(n);
|
|
361
331
|
if (!(i instanceof HTMLElement))
|
|
362
332
|
throw new Error("Fail to initialize widget: interactive area is not found");
|
|
363
333
|
return i;
|
|
364
334
|
}
|
|
365
|
-
const le = (e) => e.shadowRoot || e,
|
|
335
|
+
const le = (e) => e.shadowRoot || e, g = {
|
|
366
336
|
0: "#fff",
|
|
367
337
|
100: "#f5f5f5",
|
|
368
338
|
200: "#eeeeee",
|
|
@@ -373,7 +343,7 @@ const le = (e) => e.shadowRoot || e, b = {
|
|
|
373
343
|
700: "#616161",
|
|
374
344
|
800: "#424242",
|
|
375
345
|
900: "#212121"
|
|
376
|
-
},
|
|
346
|
+
}, m = 10, re = {
|
|
377
347
|
palette: {
|
|
378
348
|
mode: "light",
|
|
379
349
|
primary: {
|
|
@@ -384,22 +354,22 @@ const le = (e) => e.shadowRoot || e, b = {
|
|
|
384
354
|
default: "#fff",
|
|
385
355
|
contrastText: "#000"
|
|
386
356
|
},
|
|
387
|
-
border:
|
|
357
|
+
border: g[400],
|
|
388
358
|
error: {
|
|
389
359
|
main: "#f44336"
|
|
390
360
|
},
|
|
391
361
|
logoFill: "#1d1d1b",
|
|
392
|
-
grey:
|
|
362
|
+
grey: g
|
|
393
363
|
},
|
|
394
364
|
spacing: {
|
|
395
|
-
unit:
|
|
396
|
-
half: Math.floor(
|
|
365
|
+
unit: m,
|
|
366
|
+
half: Math.floor(m / 2)
|
|
397
367
|
},
|
|
398
368
|
font: {
|
|
399
369
|
fontFamily: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
|
|
400
370
|
color: "#000"
|
|
401
371
|
}
|
|
402
|
-
},
|
|
372
|
+
}, se = {
|
|
403
373
|
palette: {
|
|
404
374
|
mode: "dark",
|
|
405
375
|
primary: {
|
|
@@ -410,27 +380,27 @@ const le = (e) => e.shadowRoot || e, b = {
|
|
|
410
380
|
default: "#303030",
|
|
411
381
|
contrastText: "#fff"
|
|
412
382
|
},
|
|
413
|
-
border:
|
|
383
|
+
border: g[300],
|
|
414
384
|
error: {
|
|
415
385
|
main: "#f44336"
|
|
416
386
|
},
|
|
417
387
|
logoFill: "#fff",
|
|
418
|
-
grey:
|
|
388
|
+
grey: g
|
|
419
389
|
},
|
|
420
390
|
spacing: {
|
|
421
|
-
unit:
|
|
422
|
-
half: Math.floor(
|
|
391
|
+
unit: m,
|
|
392
|
+
half: Math.floor(m / 2)
|
|
423
393
|
},
|
|
424
394
|
font: {
|
|
425
395
|
fontFamily: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
|
|
426
396
|
color: "#fff"
|
|
427
397
|
}
|
|
428
398
|
};
|
|
429
|
-
function
|
|
430
|
-
return Object.values(
|
|
399
|
+
function R(e) {
|
|
400
|
+
return Object.values(W).find((a) => a === _(e, 0).getAttribute("data-captcha-type")) || "frictionless";
|
|
431
401
|
}
|
|
432
|
-
const
|
|
433
|
-
const t =
|
|
402
|
+
const k = (e) => document.querySelector('script[src*="'.concat(e, '"]')), de = (e) => {
|
|
403
|
+
const t = k(e);
|
|
434
404
|
if (t && t.src.indexOf("".concat(e)) !== -1) {
|
|
435
405
|
const o = new URLSearchParams(t.src.split("?")[1]);
|
|
436
406
|
return {
|
|
@@ -440,7 +410,7 @@ const R = (e) => document.querySelector('script[src*="'.concat(e, '"]')), he = (
|
|
|
440
410
|
}
|
|
441
411
|
return { onloadUrlCallback: void 0, renderExplicit: void 0 };
|
|
442
412
|
};
|
|
443
|
-
class
|
|
413
|
+
class he {
|
|
444
414
|
constructor(t) {
|
|
445
415
|
this.widgetThemeResolver = t, this.captchaRenderer = null, this._i18n = null;
|
|
446
416
|
}
|
|
@@ -449,98 +419,99 @@ class fe {
|
|
|
449
419
|
throw new Error("I18n is not initialized");
|
|
450
420
|
return this._i18n;
|
|
451
421
|
}
|
|
452
|
-
async createWidgets(t, o,
|
|
422
|
+
async createWidgets(t, o, a = !0, n = !1) {
|
|
453
423
|
return Promise.all(t.map((c) => {
|
|
454
|
-
const i =
|
|
455
|
-
return
|
|
424
|
+
const i = M(c);
|
|
425
|
+
return H(o, i, c), this.createWidget(c, o, i, a, n);
|
|
456
426
|
}));
|
|
457
427
|
}
|
|
458
|
-
async createWidget(t, o,
|
|
428
|
+
async createWidget(t, o, a, n = !0, c = !1) {
|
|
459
429
|
o.theme = this.widgetThemeResolver.resolveWidgetTheme(t, o);
|
|
460
|
-
const i = o.theme === "light" ?
|
|
461
|
-
let
|
|
430
|
+
const i = o.theme === "light" ? re : se;
|
|
431
|
+
let r;
|
|
462
432
|
if (c) {
|
|
463
433
|
const h = document.createElement("div");
|
|
464
|
-
t.appendChild(h),
|
|
434
|
+
t.appendChild(h), r = h;
|
|
465
435
|
} else
|
|
466
|
-
|
|
436
|
+
r = ie(t, i, "prosopo-procaptcha");
|
|
467
437
|
return (await this.getCaptchaRenderer()).renderCaptcha({
|
|
468
438
|
identifierPrefix: "procaptcha-",
|
|
469
439
|
emotionCacheKey: "procaptcha",
|
|
470
440
|
webComponentTag: "prosopo-procaptcha",
|
|
471
|
-
defaultCaptchaType:
|
|
472
|
-
},
|
|
441
|
+
defaultCaptchaType: W.frictionless
|
|
442
|
+
}, r, o, a, n, this.i18n, c);
|
|
473
443
|
}
|
|
474
444
|
async getCaptchaRenderer() {
|
|
475
|
-
return this._i18n === null && (this._i18n = await
|
|
445
|
+
return this._i18n === null && (this._i18n = await $()), this.captchaRenderer === null && (this.captchaRenderer = await this.createCaptchaRenderer()), this.captchaRenderer;
|
|
476
446
|
}
|
|
477
447
|
async createCaptchaRenderer() {
|
|
478
|
-
const t = (await import("./captchaRenderer-
|
|
448
|
+
const t = (await import("./captchaRenderer-CY8KuZK-.js")).CaptchaRenderer, o = (await import("./captchaComponentProvider-Dw6ydLe3.js").then((a) => a.d)).CaptchaComponentProvider;
|
|
479
449
|
return new t(new o());
|
|
480
450
|
}
|
|
481
451
|
}
|
|
482
|
-
class
|
|
452
|
+
class pe {
|
|
483
453
|
constructor() {
|
|
484
454
|
this.themesSet = /* @__PURE__ */ new Set(["light", "dark"]), this.defaultTheme = "light";
|
|
485
455
|
}
|
|
486
456
|
resolveWidgetTheme(t, o) {
|
|
487
|
-
const
|
|
488
|
-
return this.validateTheme(
|
|
457
|
+
const a = o.theme || t.getAttribute("data-theme") || this.defaultTheme;
|
|
458
|
+
return this.validateTheme(a);
|
|
489
459
|
}
|
|
490
460
|
validateTheme(t) {
|
|
491
461
|
return this.themesSet.has(t) ? t : this.defaultTheme;
|
|
492
462
|
}
|
|
493
463
|
}
|
|
494
|
-
const
|
|
464
|
+
const C = "procaptcha.bundle.js";
|
|
495
465
|
let d = [];
|
|
496
|
-
const
|
|
466
|
+
const b = new he(new pe()), fe = "procaptcha:execute", S = async () => {
|
|
497
467
|
const e = Array.from(document.getElementsByClassName("procaptcha")).filter((o) => o.tagName.toLowerCase() !== "button");
|
|
498
468
|
if (e.length) {
|
|
499
|
-
const o =
|
|
469
|
+
const o = _(e, 0).getAttribute("data-sitekey"), a = _(e, 0).getAttribute("data-web3");
|
|
500
470
|
if (!o) {
|
|
501
471
|
console.error("No siteKey found");
|
|
502
472
|
return;
|
|
503
473
|
}
|
|
504
|
-
const
|
|
505
|
-
captchaType:
|
|
474
|
+
const n = R(e), c = await b.createWidgets(e, {
|
|
475
|
+
captchaType: n,
|
|
506
476
|
siteKey: o
|
|
507
|
-
},
|
|
477
|
+
}, a !== "true");
|
|
508
478
|
d.push(...c);
|
|
509
479
|
}
|
|
510
480
|
const t = Array.from(document.getElementsByClassName("procaptcha")).filter((o) => o.tagName.toLowerCase() === "button");
|
|
511
481
|
if (t.length)
|
|
512
482
|
for (const o of t) {
|
|
513
|
-
const
|
|
483
|
+
const a = o.getAttribute("data-sitekey") || "", n = o.getAttribute("data-callback") || "", c = R([o]), i = await b.createWidgets([o], {
|
|
514
484
|
captchaType: c,
|
|
515
|
-
siteKey:
|
|
516
|
-
callback:
|
|
485
|
+
siteKey: a,
|
|
486
|
+
callback: n
|
|
517
487
|
}, !0, !0);
|
|
518
|
-
d.push(...i), o.addEventListener("click", async (
|
|
519
|
-
|
|
488
|
+
d.push(...i), o.addEventListener("click", async (r) => {
|
|
489
|
+
r.preventDefault(), D();
|
|
520
490
|
});
|
|
521
491
|
}
|
|
522
|
-
},
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
492
|
+
}, ue = async (e, t) => {
|
|
493
|
+
const o = Object.prototype.hasOwnProperty.call(t, "size") && t.size === "invisible", a = !t.web3;
|
|
494
|
+
if (o || e.tagName.toLowerCase() === "button") {
|
|
495
|
+
const c = await b.createWidgets([e], t, a, !0);
|
|
496
|
+
d.push(...c);
|
|
526
497
|
return;
|
|
527
498
|
}
|
|
528
|
-
const n = await
|
|
499
|
+
const n = await b.createWidgets([e], t, a, !1);
|
|
529
500
|
d.push(...n);
|
|
530
501
|
};
|
|
531
|
-
function
|
|
502
|
+
function p(e) {
|
|
532
503
|
document && document.readyState !== "loading" ? e() : document.addEventListener("DOMContentLoaded", () => {
|
|
533
504
|
e();
|
|
534
505
|
});
|
|
535
506
|
}
|
|
536
|
-
const
|
|
507
|
+
const D = () => {
|
|
537
508
|
var e;
|
|
538
|
-
const t =
|
|
509
|
+
const t = ge();
|
|
539
510
|
if (t.length === 0) {
|
|
540
511
|
console.error("No Procaptcha containers found for execution");
|
|
541
512
|
return;
|
|
542
513
|
}
|
|
543
|
-
const o = new CustomEvent(
|
|
514
|
+
const o = new CustomEvent(fe, {
|
|
544
515
|
detail: {
|
|
545
516
|
containerId: ((e = t[0]) == null ? void 0 : e.id) || "procaptcha-container",
|
|
546
517
|
containerCount: t.length,
|
|
@@ -551,46 +522,42 @@ const L = () => {
|
|
|
551
522
|
});
|
|
552
523
|
document.dispatchEvent(o);
|
|
553
524
|
};
|
|
554
|
-
function
|
|
525
|
+
function ge() {
|
|
555
526
|
const e = [], t = Array.from(document.querySelectorAll('[data-size="invisible"]'));
|
|
556
527
|
e.push(...t);
|
|
557
|
-
const o = Array.from(document.querySelectorAll('#procaptcha-container, [id$="-procaptcha-container"]')),
|
|
558
|
-
e.push(...
|
|
559
|
-
for (const
|
|
560
|
-
e.includes(
|
|
528
|
+
const o = Array.from(document.querySelectorAll('#procaptcha-container, [id$="-procaptcha-container"]')), a = Array.from(document.getElementsByClassName("p-procaptcha"));
|
|
529
|
+
e.push(...a);
|
|
530
|
+
for (const n of o)
|
|
531
|
+
e.includes(n) || e.push(n);
|
|
561
532
|
return e;
|
|
562
533
|
}
|
|
563
|
-
const
|
|
534
|
+
const L = () => {
|
|
564
535
|
var e, t;
|
|
565
|
-
const { onloadUrlCallback: o, renderExplicit:
|
|
566
|
-
let
|
|
567
|
-
if (
|
|
568
|
-
|
|
569
|
-
}), document.readyState === "complete" && !
|
|
570
|
-
const c =
|
|
571
|
-
|
|
572
|
-
}), document.readyState === "complete" && !
|
|
573
|
-
const c =
|
|
574
|
-
|
|
536
|
+
const { onloadUrlCallback: o, renderExplicit: a } = de(C);
|
|
537
|
+
let n = !1;
|
|
538
|
+
if (a !== "explicit" && ((e = k(C)) == null || e.addEventListener("load", () => {
|
|
539
|
+
p(S), n = !0;
|
|
540
|
+
}), document.readyState === "complete" && !n && p(S)), o && ((t = k(C)) == null || t.addEventListener("load", () => {
|
|
541
|
+
const c = u(o);
|
|
542
|
+
p(c);
|
|
543
|
+
}), document.readyState === "complete" && !n)) {
|
|
544
|
+
const c = u(o);
|
|
545
|
+
p(c);
|
|
575
546
|
}
|
|
576
|
-
},
|
|
547
|
+
}, me = () => {
|
|
577
548
|
for (const e of d)
|
|
578
549
|
e.unmount();
|
|
579
|
-
d = [],
|
|
550
|
+
d = [], L();
|
|
580
551
|
};
|
|
581
|
-
window.procaptcha = { ready:
|
|
582
|
-
|
|
552
|
+
window.procaptcha = { ready: p, render: ue, reset: me, execute: D };
|
|
553
|
+
L();
|
|
583
554
|
export {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
be as f,
|
|
593
|
-
U as g,
|
|
594
|
-
M as l,
|
|
595
|
-
ge as r
|
|
555
|
+
E as W,
|
|
556
|
+
p as a,
|
|
557
|
+
me as b,
|
|
558
|
+
se as d,
|
|
559
|
+
D as e,
|
|
560
|
+
M as g,
|
|
561
|
+
re as l,
|
|
562
|
+
ue as r
|
|
596
563
|
};
|