@prosopo/procaptcha-bundle 2.5.3 → 2.5.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-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.js +15 -17
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +23 -27
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +2 -2
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +4 -7
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts +2 -2
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +9 -4
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +1 -1
- package/dist/bundle/ProcaptchaWidget-CCSN3Dxj.js +636 -0
- package/dist/bundle/{ProcaptchaWidget-Dnwno-4N.js → ProcaptchaWidget-Dfex8hc8.js} +4 -4
- package/dist/bundle/{asU8a-JliaME7-.js → asU8a-CAsEnbuP.js} +1 -1
- package/dist/bundle/{bip39-CFjno8fK.js → bip39-DCaMcFzo.js} +2 -2
- package/dist/bundle/{captchaComponentProvider-dcMua0p9.js → captchaComponentProvider-Dm44AMrY.js} +23 -18
- package/dist/bundle/captchaRenderer-BBodRhQu.js +70 -0
- package/dist/bundle/{emotion-element-5486c51c.browser.esm-Bywq83R5.js → emotion-element-5486c51c.browser.esm-CQHFV-dS.js} +711 -746
- package/dist/bundle/{fp.esm-C0kLYOiJ.js → fp.esm-DYWeNGcH.js} +17 -0
- package/dist/bundle/{hash-CtL1HOjf.js → hash-D-64Vz5z.js} +1 -1
- package/dist/bundle/{captchaRenderer-D-du50M4.js → index-9I1Aae33.js} +1293 -1355
- package/dist/bundle/index-DCHEbWAs.js +1242 -0
- package/dist/bundle/{index-DcG_c-Na.js → index-DkQ4njKa.js} +12 -12
- package/dist/bundle/{index-BTlHNFX8.js → index-DxswvPTy.js} +285 -183
- package/dist/bundle/{index-BMjJnq60.js → index-nNwZuute.js} +252 -252
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/locales/de/translation.json +55 -405
- package/dist/bundle/locales/en/translation.json +55 -405
- package/dist/bundle/locales/es/translation.json +55 -405
- package/dist/bundle/locales/fr/translation.json +55 -405
- package/dist/bundle/locales/it/translation.json +55 -405
- package/dist/bundle/locales/pt/translation.json +55 -405
- package/dist/bundle/locales/pt-BR/translation.json +55 -405
- package/dist/bundle/procaptcha.bundle.js +1 -1
- package/dist/bundle/{useTranslation-7b6JJ18N.js → useTranslation-CEt2t9kE.js} +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts +2 -2
- package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/dist/bundle/util/widgetFactory.d.ts +2 -2
- package/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -17
- package/dist/index.js.map +1 -1
- package/dist/tests/util/renderLogic.test.js +23 -27
- package/dist/tests/util/renderLogic.test.js.map +1 -1
- package/dist/util/captcha/captchaRenderer.d.ts +2 -2
- package/dist/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/dist/util/captcha/captchaRenderer.js +4 -7
- package/dist/util/captcha/captchaRenderer.js.map +1 -1
- package/dist/util/widgetFactory.d.ts +2 -2
- package/dist/util/widgetFactory.d.ts.map +1 -1
- package/dist/util/widgetFactory.js +9 -4
- package/dist/util/widgetFactory.js.map +1 -1
- package/package.json +20 -14
- package/stats.html +1 -1
- package/vite.config.ts +18 -3
- package/vite.serve.config.ts +24 -0
- package/dist/bundle/ProcaptchaWidget-BlWWnPeB.js +0 -615
- package/dist/bundle/index-B8oMghZ3.js +0 -1120
|
@@ -1,51 +1,143 @@
|
|
|
1
|
-
function
|
|
2
|
-
if (
|
|
1
|
+
function k(e, t, o) {
|
|
2
|
+
if (e.length === 0)
|
|
3
3
|
throw new Error("Array is empty");
|
|
4
|
-
if (!Number.isFinite(
|
|
5
|
-
throw new Error(`Index ${
|
|
6
|
-
if (
|
|
7
|
-
throw new Error(`Index ${
|
|
8
|
-
if (
|
|
9
|
-
throw new Error(`Index ${
|
|
10
|
-
return t
|
|
11
|
-
}
|
|
12
|
-
var
|
|
13
|
-
(function(
|
|
14
|
-
|
|
15
|
-
})(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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 u;
|
|
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";
|
|
15
|
+
})(u || (u = {}));
|
|
16
|
+
var g;
|
|
17
|
+
(function(e) {
|
|
18
|
+
e.image = "image", e.pow = "pow", e.frictionless = "frictionless";
|
|
19
|
+
})(g || (g = {}));
|
|
20
|
+
let _;
|
|
21
|
+
async function N(e) {
|
|
22
|
+
return new Promise((t, o) => {
|
|
19
23
|
try {
|
|
20
24
|
import("./i18nFrontend-C_RgmvGh.js").then((a) => a.b).then(({ default: a }) => {
|
|
21
|
-
|
|
25
|
+
_ || (_ = a()), t(_);
|
|
22
26
|
});
|
|
23
27
|
} catch (a) {
|
|
24
28
|
o(a);
|
|
25
29
|
}
|
|
26
30
|
});
|
|
27
31
|
}
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
throw new Error(`Callback ${t} is not defined on the window object`);
|
|
32
|
-
return e;
|
|
33
|
-
}, S = "https://prosopo.io", R = "Visit prosopo.io to learn more about the service and its accessibility options.", I = 74, f = 80, A = "80px", m = "302px", W = "8px", D = "2px", $ = "1px solid", w = "checkbox__loading-spinner";
|
|
34
|
-
function L(t) {
|
|
35
|
-
const e = document.createElement("div");
|
|
36
|
-
return e.className = "checkbox", e.innerHTML = z(t) + q, e;
|
|
32
|
+
function q(e) {
|
|
33
|
+
const t = e.getRootNode();
|
|
34
|
+
return (t instanceof ShadowRoot ? t.host : e).closest("form");
|
|
37
35
|
}
|
|
38
|
-
const
|
|
36
|
+
const r = () => {
|
|
37
|
+
Array.from(document.getElementsByName(u.procaptchaResponse)).map((t) => t.remove());
|
|
38
|
+
}, m = (e) => {
|
|
39
|
+
const t = window[e.replace("window.", "")];
|
|
40
|
+
if (typeof t != "function")
|
|
41
|
+
throw new Error(`Callback ${e} is not defined on the window object`);
|
|
42
|
+
return t;
|
|
43
|
+
}, M = (e) => ({
|
|
44
|
+
onHuman: (t) => D(t, e),
|
|
45
|
+
onChallengeExpired: () => {
|
|
46
|
+
r();
|
|
47
|
+
},
|
|
48
|
+
onExtensionNotFound: () => {
|
|
49
|
+
console.error("Extension not found");
|
|
50
|
+
},
|
|
51
|
+
onExpired: () => {
|
|
52
|
+
r();
|
|
53
|
+
},
|
|
54
|
+
onError: (t) => {
|
|
55
|
+
r(), console.error(t);
|
|
56
|
+
},
|
|
57
|
+
onClose: () => {
|
|
58
|
+
},
|
|
59
|
+
onOpen: () => {
|
|
60
|
+
},
|
|
61
|
+
onFailed: () => {
|
|
62
|
+
alert("Captcha challenge failed. Please try again");
|
|
63
|
+
},
|
|
64
|
+
onReset: () => {
|
|
65
|
+
r();
|
|
66
|
+
},
|
|
67
|
+
onReload: () => {
|
|
68
|
+
}
|
|
69
|
+
}), s = (e, t, o) => {
|
|
70
|
+
const a = t.getAttribute(`data-${e}`);
|
|
71
|
+
if (a) {
|
|
72
|
+
const n = m(a);
|
|
73
|
+
if (n)
|
|
74
|
+
return n;
|
|
75
|
+
}
|
|
76
|
+
if (typeof o == "function")
|
|
77
|
+
return o;
|
|
78
|
+
if (typeof o == "string")
|
|
79
|
+
return m(o);
|
|
80
|
+
};
|
|
81
|
+
function z(e, t, o) {
|
|
82
|
+
const a = s("callback", o, e == null ? void 0 : e.callback);
|
|
83
|
+
a && (t.onHuman = (f) => {
|
|
84
|
+
D(f, o), a(f);
|
|
85
|
+
});
|
|
86
|
+
const n = s("chalexpired-callback", o, e == null ? void 0 : e["chalexpired-callback"]);
|
|
87
|
+
n && (t.onChallengeExpired = () => {
|
|
88
|
+
r(), n();
|
|
89
|
+
});
|
|
90
|
+
const c = s("expired-callback", o, e == null ? void 0 : e["expired-callback"]);
|
|
91
|
+
c && (t.onExpired = () => {
|
|
92
|
+
r(), c();
|
|
93
|
+
});
|
|
94
|
+
const i = s("error-callback", o, e == null ? void 0 : e["error-callback"]);
|
|
95
|
+
i && (t.onError = (f) => {
|
|
96
|
+
r(), i(f);
|
|
97
|
+
});
|
|
98
|
+
const l = s("close-callback", o, e == null ? void 0 : e["close-callback"]);
|
|
99
|
+
l && (t.onClose = () => {
|
|
100
|
+
l();
|
|
101
|
+
});
|
|
102
|
+
const v = s("open-callback", o, e == null ? void 0 : e["open-callback"]);
|
|
103
|
+
v && (t.onOpen = () => {
|
|
104
|
+
v();
|
|
105
|
+
});
|
|
106
|
+
const x = s("failed-callback", o, e == null ? void 0 : e["failed-callback"]);
|
|
107
|
+
x && (t.onFailed = () => {
|
|
108
|
+
x();
|
|
109
|
+
});
|
|
110
|
+
const h = s("reset-callback", o, e == null ? void 0 : e["reset-callback"]);
|
|
111
|
+
h && (t.onReset = () => {
|
|
112
|
+
r(), h();
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
const D = (e, t) => {
|
|
116
|
+
if (r(), t) {
|
|
117
|
+
const o = q(t);
|
|
118
|
+
if (!o) {
|
|
119
|
+
console.error("Parent form not found for the element:", t);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const a = document.createElement("input");
|
|
123
|
+
a.type = "hidden", a.name = u.procaptchaResponse, a.value = e, o.appendChild(a);
|
|
124
|
+
}
|
|
125
|
+
}, U = "https://prosopo.io", H = "Visit prosopo.io to learn more about the service and its accessibility options.", F = 74, C = 80, G = "80px", T = "302px", j = "8px", B = "2px", K = "1px solid", R = "checkbox__loading-spinner";
|
|
126
|
+
function A(e) {
|
|
127
|
+
const t = document.createElement("div");
|
|
128
|
+
return t.className = "checkbox", t.innerHTML = Y(e) + V, t;
|
|
129
|
+
}
|
|
130
|
+
const X = (e) => (e.shadowRoot || e).querySelector(".checkbox__content"), V = `
|
|
39
131
|
<div class="checkbox__outer">
|
|
40
132
|
<div class="checkbox__wrapper">
|
|
41
133
|
<div class="checkbox__inner">
|
|
42
134
|
<div class="checkbox__content">
|
|
43
|
-
<div class="${
|
|
135
|
+
<div class="${R}" aria-label="Loading spinner"></div>
|
|
44
136
|
</div>
|
|
45
137
|
</div>
|
|
46
138
|
</div>
|
|
47
139
|
</div>
|
|
48
|
-
`,
|
|
140
|
+
`, Y = (e) => `
|
|
49
141
|
<style>
|
|
50
142
|
.checkbox {
|
|
51
143
|
display: flex;
|
|
@@ -73,21 +165,22 @@ const M = (t) => (t.shadowRoot || t).querySelector(".checkbox__content"), q = `
|
|
|
73
165
|
display: inline-flex;
|
|
74
166
|
}
|
|
75
167
|
|
|
76
|
-
.${
|
|
168
|
+
.${R} {
|
|
77
169
|
margin-top: 0;
|
|
78
170
|
margin-left: 15px;
|
|
79
171
|
margin-right: 15px;
|
|
80
172
|
width: 2em;
|
|
81
173
|
height: 2em;
|
|
82
|
-
border: 4px solid ${
|
|
174
|
+
border: 4px solid ${e.palette.background.contrastText};
|
|
83
175
|
border-bottom-color: transparent;
|
|
84
176
|
border-radius: 50%;
|
|
85
177
|
display: inherit;
|
|
86
178
|
box-sizing: border-box;
|
|
87
179
|
animation: checkbox__loading-spinner-rotation 1s linear infinite;
|
|
180
|
+
will-change: transform;
|
|
88
181
|
}
|
|
89
182
|
|
|
90
|
-
@keyframes ${
|
|
183
|
+
@keyframes ${R}-rotation {
|
|
91
184
|
0% {
|
|
92
185
|
transform: rotate(0deg);
|
|
93
186
|
}
|
|
@@ -97,11 +190,11 @@ const M = (t) => (t.shadowRoot || t).querySelector(".checkbox__content"), q = `
|
|
|
97
190
|
}
|
|
98
191
|
</style>
|
|
99
192
|
`;
|
|
100
|
-
function
|
|
101
|
-
const
|
|
102
|
-
return
|
|
193
|
+
function J(e) {
|
|
194
|
+
const t = document.createElement("div");
|
|
195
|
+
return t.className = "logo", t.innerHTML = Q + Z(e), t;
|
|
103
196
|
}
|
|
104
|
-
const
|
|
197
|
+
const Q = `
|
|
105
198
|
<style>
|
|
106
199
|
.logo {
|
|
107
200
|
display: inline-flex;
|
|
@@ -122,11 +215,11 @@ const P = `
|
|
|
122
215
|
}
|
|
123
216
|
</style>
|
|
124
217
|
`;
|
|
125
|
-
function
|
|
218
|
+
function Z(e) {
|
|
126
219
|
return `
|
|
127
|
-
<a href="${
|
|
220
|
+
<a href="${U}"
|
|
128
221
|
target="_blank"
|
|
129
|
-
aria-label="${
|
|
222
|
+
aria-label="${H}">
|
|
130
223
|
<div class="logo__outer">
|
|
131
224
|
<div class="logo__wrapper">
|
|
132
225
|
<div class="logo__inner">
|
|
@@ -135,7 +228,7 @@ function H(t) {
|
|
|
135
228
|
xmlns="http://www.w3.org/2000/svg"
|
|
136
229
|
viewBox="0 0 468.67004 487.99998"
|
|
137
230
|
height="35px"
|
|
138
|
-
style="fill: ${
|
|
231
|
+
style="fill: ${e.palette.logoFill};"
|
|
139
232
|
aria-label="Prosopo Logo With Text">
|
|
140
233
|
<title>Prosopo Logo With Text</title>
|
|
141
234
|
<g id="g1960" transform="translate(0,-35.903035)">
|
|
@@ -172,19 +265,19 @@ function H(t) {
|
|
|
172
265
|
</a>
|
|
173
266
|
`;
|
|
174
267
|
}
|
|
175
|
-
function
|
|
176
|
-
var n,
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
const o =
|
|
180
|
-
return
|
|
268
|
+
function P(e) {
|
|
269
|
+
var n, c;
|
|
270
|
+
const t = document.createElement("div");
|
|
271
|
+
t.className = "widget";
|
|
272
|
+
const o = A(e), a = J(e);
|
|
273
|
+
return t.innerHTML = ee(e) + O(oe()), (n = t.querySelector(".widget__checkbox")) == null || n.replaceWith(o), (c = t.querySelector(".widget__logo")) == null || c.replaceWith(a), t;
|
|
181
274
|
}
|
|
182
|
-
function
|
|
275
|
+
function O(e) {
|
|
183
276
|
return `
|
|
184
277
|
<div class="widget__outer">
|
|
185
278
|
<div class="widget__wrapper">
|
|
186
279
|
<div class="widget__inner">
|
|
187
|
-
<div class="widget__dimensions" ${
|
|
280
|
+
<div class="widget__dimensions" ${e ? 'data-cy="captcha-checkbox"' : ""}>
|
|
188
281
|
<div class="widget__content">
|
|
189
282
|
<div class="widget__checkbox"></div>
|
|
190
283
|
<div class="widget__logo"></div>
|
|
@@ -195,91 +288,91 @@ function G(t) {
|
|
|
195
288
|
</div>
|
|
196
289
|
`;
|
|
197
290
|
}
|
|
198
|
-
function
|
|
291
|
+
function ee(e) {
|
|
199
292
|
return `
|
|
200
293
|
<style>
|
|
201
294
|
.widget {
|
|
202
295
|
width: 100%;
|
|
203
|
-
min-height: ${
|
|
296
|
+
min-height: ${G}
|
|
204
297
|
}
|
|
205
298
|
|
|
206
299
|
.widget__outer {
|
|
207
|
-
max-width: ${
|
|
300
|
+
max-width: ${T};
|
|
208
301
|
min-height: 100%;
|
|
209
302
|
overflow-x: auto;
|
|
210
303
|
width: 100%;
|
|
211
|
-
font-family: ${
|
|
212
|
-
color: ${
|
|
304
|
+
font-family: ${e.font.fontFamily};
|
|
305
|
+
color: ${e.font.color};
|
|
213
306
|
}
|
|
214
307
|
|
|
215
308
|
.widget__wrapper {
|
|
216
309
|
container-type: size;
|
|
217
310
|
display: flex;
|
|
218
311
|
flex-direction: column;
|
|
219
|
-
height: ${
|
|
312
|
+
height: ${C}px;
|
|
220
313
|
}
|
|
221
314
|
|
|
222
315
|
.widget__inner {
|
|
223
316
|
max-height: 100%;
|
|
224
317
|
min-width: 100%;
|
|
225
318
|
overflow: hidden;
|
|
226
|
-
height: ${
|
|
319
|
+
height: ${C}px;
|
|
227
320
|
width: 100%;
|
|
228
321
|
display: grid;
|
|
229
322
|
}
|
|
230
323
|
|
|
231
324
|
.widget__dimensions {
|
|
232
|
-
max-width: ${
|
|
233
|
-
min-height: ${
|
|
325
|
+
max-width: ${T};
|
|
326
|
+
min-height: ${C}px;
|
|
234
327
|
}
|
|
235
328
|
|
|
236
329
|
.widget__content {
|
|
237
|
-
padding: ${
|
|
238
|
-
border: ${
|
|
239
|
-
background-color: ${
|
|
240
|
-
border-color: ${
|
|
241
|
-
border-radius: ${
|
|
330
|
+
padding: ${B};
|
|
331
|
+
border: ${K};
|
|
332
|
+
background-color: ${e.palette.background.default};
|
|
333
|
+
border-color: ${e.palette.grey[300]};
|
|
334
|
+
border-radius: ${j};
|
|
242
335
|
display: flex;
|
|
243
336
|
align-items: center;
|
|
244
337
|
flex-wrap: wrap;
|
|
245
338
|
justify-content: space-between;
|
|
246
|
-
min-height: ${
|
|
339
|
+
min-height: ${F}px;
|
|
247
340
|
overflow: hidden;
|
|
248
341
|
}
|
|
249
342
|
</style>
|
|
250
343
|
`;
|
|
251
344
|
}
|
|
252
|
-
function
|
|
253
|
-
var
|
|
254
|
-
return typeof process < "u" ? "production" : (
|
|
345
|
+
function te() {
|
|
346
|
+
var t;
|
|
347
|
+
return typeof process < "u" ? "production" : (t = import.meta.env) == null ? void 0 : t.MODE;
|
|
255
348
|
}
|
|
256
|
-
const
|
|
257
|
-
function
|
|
258
|
-
const o = document.createElement(
|
|
259
|
-
|
|
349
|
+
const oe = () => te() !== "production", ae = 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"';
|
|
350
|
+
function ne(e, t = "") {
|
|
351
|
+
const o = document.createElement(e);
|
|
352
|
+
ie(o);
|
|
260
353
|
const a = o.attachShadow({ mode: "open" });
|
|
261
|
-
return a.innerHTML =
|
|
354
|
+
return a.innerHTML = ce(t), o;
|
|
262
355
|
}
|
|
263
|
-
const
|
|
356
|
+
const ce = (e) => `
|
|
264
357
|
<style>
|
|
265
|
-
*{font-family: ${
|
|
358
|
+
*{font-family: ${ae};}
|
|
266
359
|
</style>
|
|
267
360
|
|
|
268
361
|
<style>
|
|
269
|
-
${
|
|
362
|
+
${e}
|
|
270
363
|
</style>
|
|
271
|
-
`,
|
|
272
|
-
|
|
364
|
+
`, ie = (e) => {
|
|
365
|
+
e.style.display = "flex", e.style.flexDirection = "column", e.style.width = "100%", e.style.maxWidth = T;
|
|
273
366
|
};
|
|
274
|
-
function
|
|
275
|
-
const a =
|
|
276
|
-
|
|
277
|
-
const i =
|
|
367
|
+
function re(e, t, o) {
|
|
368
|
+
const a = P(t), n = ne(o);
|
|
369
|
+
le(n).appendChild(a), e.innerHTML = "", e.appendChild(n);
|
|
370
|
+
const i = X(n);
|
|
278
371
|
if (!(i instanceof HTMLElement))
|
|
279
372
|
throw new Error("Fail to initialize widget: interactive area is not found");
|
|
280
373
|
return i;
|
|
281
374
|
}
|
|
282
|
-
const
|
|
375
|
+
const le = (e) => e.shadowRoot || e, y = {
|
|
283
376
|
0: "#fff",
|
|
284
377
|
100: "#f5f5f5",
|
|
285
378
|
200: "#eeeeee",
|
|
@@ -290,7 +383,7 @@ const J = (t) => t.shadowRoot || t, d = {
|
|
|
290
383
|
700: "#616161",
|
|
291
384
|
800: "#424242",
|
|
292
385
|
900: "#212121"
|
|
293
|
-
},
|
|
386
|
+
}, b = 10, se = {
|
|
294
387
|
palette: {
|
|
295
388
|
mode: "light",
|
|
296
389
|
primary: {
|
|
@@ -301,22 +394,22 @@ const J = (t) => t.shadowRoot || t, d = {
|
|
|
301
394
|
default: "#fff",
|
|
302
395
|
contrastText: "#000"
|
|
303
396
|
},
|
|
304
|
-
border:
|
|
397
|
+
border: y[400],
|
|
305
398
|
error: {
|
|
306
399
|
main: "#f44336"
|
|
307
400
|
},
|
|
308
401
|
logoFill: "#1d1d1b",
|
|
309
|
-
grey:
|
|
402
|
+
grey: y
|
|
310
403
|
},
|
|
311
404
|
spacing: {
|
|
312
|
-
unit:
|
|
313
|
-
half: Math.floor(
|
|
405
|
+
unit: b,
|
|
406
|
+
half: Math.floor(b / 2)
|
|
314
407
|
},
|
|
315
408
|
font: {
|
|
316
409
|
fontFamily: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
|
|
317
410
|
color: "#000"
|
|
318
411
|
}
|
|
319
|
-
},
|
|
412
|
+
}, de = {
|
|
320
413
|
palette: {
|
|
321
414
|
mode: "dark",
|
|
322
415
|
primary: {
|
|
@@ -327,29 +420,29 @@ const J = (t) => t.shadowRoot || t, d = {
|
|
|
327
420
|
default: "#303030",
|
|
328
421
|
contrastText: "#fff"
|
|
329
422
|
},
|
|
330
|
-
border:
|
|
423
|
+
border: y[300],
|
|
331
424
|
error: {
|
|
332
425
|
main: "#f44336"
|
|
333
426
|
},
|
|
334
427
|
logoFill: "#fff",
|
|
335
|
-
grey:
|
|
428
|
+
grey: y
|
|
336
429
|
},
|
|
337
430
|
spacing: {
|
|
338
|
-
unit:
|
|
339
|
-
half: Math.floor(
|
|
431
|
+
unit: b,
|
|
432
|
+
half: Math.floor(b / 2)
|
|
340
433
|
},
|
|
341
434
|
font: {
|
|
342
435
|
fontFamily: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
|
|
343
436
|
color: "#fff"
|
|
344
437
|
}
|
|
345
438
|
};
|
|
346
|
-
function
|
|
347
|
-
return Object.values(
|
|
439
|
+
function I(e) {
|
|
440
|
+
return Object.values(g).find((a) => a === k(e, 0).getAttribute("data-captcha-type")) || "frictionless";
|
|
348
441
|
}
|
|
349
|
-
const
|
|
350
|
-
const
|
|
351
|
-
if (
|
|
352
|
-
const o = new URLSearchParams(
|
|
442
|
+
const S = (e) => document.querySelector('script[src*="'.concat(e, '"]')), he = (e) => {
|
|
443
|
+
const t = S(e);
|
|
444
|
+
if (t && t.src.indexOf("".concat(e)) !== -1) {
|
|
445
|
+
const o = new URLSearchParams(t.src.split("?")[1]);
|
|
353
446
|
return {
|
|
354
447
|
onloadUrlCallback: o.get("onload") || void 0,
|
|
355
448
|
renderExplicit: o.get("render") || void 0
|
|
@@ -357,105 +450,110 @@ const x = (t) => document.querySelector('script[src*="'.concat(t, '"]')), tt = (
|
|
|
357
450
|
}
|
|
358
451
|
return { onloadUrlCallback: void 0, renderExplicit: void 0 };
|
|
359
452
|
};
|
|
360
|
-
class
|
|
361
|
-
constructor(
|
|
362
|
-
this.widgetThemeResolver =
|
|
453
|
+
class pe {
|
|
454
|
+
constructor(t) {
|
|
455
|
+
this.widgetThemeResolver = t, this.captchaRenderer = null, this._i18n = null;
|
|
363
456
|
}
|
|
364
457
|
get i18n() {
|
|
365
458
|
if (this._i18n === null)
|
|
366
459
|
throw new Error("I18n is not initialized");
|
|
367
460
|
return this._i18n;
|
|
368
461
|
}
|
|
369
|
-
async createWidgets(
|
|
370
|
-
return Promise.all(
|
|
462
|
+
async createWidgets(t, o, a = !0, n = !1) {
|
|
463
|
+
return Promise.all(t.map((c) => {
|
|
464
|
+
const i = M(c);
|
|
465
|
+
return z(o, i, c), this.createWidget(c, o, i, a, n);
|
|
466
|
+
}));
|
|
371
467
|
}
|
|
372
|
-
async createWidget(
|
|
373
|
-
o.theme = this.widgetThemeResolver.resolveWidgetTheme(
|
|
374
|
-
const
|
|
375
|
-
let
|
|
376
|
-
if (
|
|
377
|
-
const
|
|
378
|
-
|
|
468
|
+
async createWidget(t, o, a, n = !0, c = !1) {
|
|
469
|
+
o.theme = this.widgetThemeResolver.resolveWidgetTheme(t, o);
|
|
470
|
+
const i = o.theme === "light" ? se : de;
|
|
471
|
+
let l;
|
|
472
|
+
if (c) {
|
|
473
|
+
const h = document.createElement("div");
|
|
474
|
+
t.appendChild(h), l = h;
|
|
379
475
|
} else
|
|
380
|
-
|
|
476
|
+
l = re(t, i, "prosopo-procaptcha");
|
|
381
477
|
return (await this.getCaptchaRenderer()).renderCaptcha({
|
|
382
478
|
identifierPrefix: "procaptcha-",
|
|
383
479
|
emotionCacheKey: "procaptcha",
|
|
384
480
|
webComponentTag: "prosopo-procaptcha",
|
|
385
|
-
defaultCaptchaType:
|
|
386
|
-
},
|
|
481
|
+
defaultCaptchaType: g.frictionless
|
|
482
|
+
}, l, o, a, n, this.i18n, c);
|
|
387
483
|
}
|
|
388
484
|
async getCaptchaRenderer() {
|
|
389
|
-
return this._i18n === null && (this._i18n = await
|
|
485
|
+
return this._i18n === null && (this._i18n = await N()), this.captchaRenderer === null && (this.captchaRenderer = await this.createCaptchaRenderer()), this.captchaRenderer;
|
|
390
486
|
}
|
|
391
487
|
async createCaptchaRenderer() {
|
|
392
|
-
const
|
|
393
|
-
return new
|
|
488
|
+
const t = (await import("./captchaRenderer-BBodRhQu.js")).CaptchaRenderer, o = (await import("./captchaComponentProvider-Dm44AMrY.js").then((a) => a.h)).CaptchaComponentProvider;
|
|
489
|
+
return new t(new o());
|
|
394
490
|
}
|
|
395
491
|
}
|
|
396
|
-
class
|
|
492
|
+
class fe {
|
|
397
493
|
constructor() {
|
|
398
494
|
this.themesSet = /* @__PURE__ */ new Set(["light", "dark"]), this.defaultTheme = "light";
|
|
399
495
|
}
|
|
400
|
-
resolveWidgetTheme(
|
|
401
|
-
const a = o.theme ||
|
|
496
|
+
resolveWidgetTheme(t, o) {
|
|
497
|
+
const a = o.theme || t.getAttribute("data-theme") || this.defaultTheme;
|
|
402
498
|
return this.validateTheme(a);
|
|
403
499
|
}
|
|
404
|
-
validateTheme(
|
|
405
|
-
return this.themesSet.has(
|
|
500
|
+
validateTheme(t) {
|
|
501
|
+
return this.themesSet.has(t) ? t : this.defaultTheme;
|
|
406
502
|
}
|
|
407
503
|
}
|
|
408
|
-
const
|
|
409
|
-
let
|
|
410
|
-
const
|
|
411
|
-
const
|
|
412
|
-
if (
|
|
413
|
-
const o =
|
|
504
|
+
const E = "procaptcha.bundle.js";
|
|
505
|
+
let d = [];
|
|
506
|
+
const w = new pe(new fe()), ue = "procaptcha:execute", W = async () => {
|
|
507
|
+
const e = Array.from(document.getElementsByClassName("procaptcha")).filter((o) => o.tagName.toLowerCase() !== "button");
|
|
508
|
+
if (e.length) {
|
|
509
|
+
const o = k(e, 0).getAttribute("data-sitekey"), a = k(e, 0).getAttribute("data-web3");
|
|
414
510
|
if (!o) {
|
|
415
511
|
console.error("No siteKey found");
|
|
416
512
|
return;
|
|
417
513
|
}
|
|
418
|
-
const n =
|
|
514
|
+
const n = I(e), c = await w.createWidgets(e, {
|
|
419
515
|
captchaType: n,
|
|
420
516
|
siteKey: o
|
|
421
517
|
}, a !== "true");
|
|
422
|
-
|
|
518
|
+
d.push(...c);
|
|
423
519
|
}
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
426
|
-
for (const o of
|
|
427
|
-
const a = o.getAttribute("data-sitekey") || "", n = o.getAttribute("data-callback") || "",
|
|
428
|
-
captchaType:
|
|
520
|
+
const t = Array.from(document.getElementsByClassName("procaptcha")).filter((o) => o.tagName.toLowerCase() === "button");
|
|
521
|
+
if (t.length)
|
|
522
|
+
for (const o of t) {
|
|
523
|
+
const a = o.getAttribute("data-sitekey") || "", n = o.getAttribute("data-callback") || "", c = I([o]), i = await w.createWidgets([o], {
|
|
524
|
+
captchaType: c,
|
|
429
525
|
siteKey: a,
|
|
430
526
|
callback: n
|
|
431
527
|
}, !0, !0);
|
|
432
|
-
|
|
433
|
-
|
|
528
|
+
d.push(...i), o.addEventListener("click", async (l) => {
|
|
529
|
+
l.preventDefault(), L();
|
|
434
530
|
});
|
|
435
531
|
}
|
|
436
|
-
},
|
|
437
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
438
|
-
const n = await
|
|
439
|
-
|
|
532
|
+
}, ge = async (e, t) => {
|
|
533
|
+
if (Object.prototype.hasOwnProperty.call(t, "size") && t.size === "invisible" || e.tagName.toLowerCase() === "button") {
|
|
534
|
+
const n = await w.createWidgets([e], t, !0, !0);
|
|
535
|
+
d.push(...n);
|
|
440
536
|
return;
|
|
441
537
|
}
|
|
442
|
-
const a = await
|
|
443
|
-
|
|
538
|
+
const a = await w.createWidgets([e], t);
|
|
539
|
+
d.push(...a);
|
|
444
540
|
};
|
|
445
|
-
function
|
|
446
|
-
document && document.readyState !== "loading" ?
|
|
541
|
+
function p(e) {
|
|
542
|
+
document && document.readyState !== "loading" ? e() : document.addEventListener("DOMContentLoaded", () => {
|
|
543
|
+
e();
|
|
544
|
+
});
|
|
447
545
|
}
|
|
448
|
-
const
|
|
449
|
-
var
|
|
450
|
-
const
|
|
451
|
-
if (
|
|
546
|
+
const L = () => {
|
|
547
|
+
var e;
|
|
548
|
+
const t = me();
|
|
549
|
+
if (t.length === 0) {
|
|
452
550
|
console.error("No Procaptcha containers found for execution");
|
|
453
551
|
return;
|
|
454
552
|
}
|
|
455
|
-
const o = new CustomEvent(
|
|
553
|
+
const o = new CustomEvent(ue, {
|
|
456
554
|
detail: {
|
|
457
|
-
containerId: ((
|
|
458
|
-
containerCount:
|
|
555
|
+
containerId: ((e = t[0]) == null ? void 0 : e.id) || "procaptcha-container",
|
|
556
|
+
containerCount: t.length,
|
|
459
557
|
timestamp: Date.now()
|
|
460
558
|
},
|
|
461
559
|
bubbles: !0,
|
|
@@ -463,42 +561,46 @@ const E = () => {
|
|
|
463
561
|
});
|
|
464
562
|
document.dispatchEvent(o);
|
|
465
563
|
};
|
|
466
|
-
function
|
|
467
|
-
const
|
|
468
|
-
|
|
564
|
+
function me() {
|
|
565
|
+
const e = [], t = Array.from(document.querySelectorAll('[data-size="invisible"]'));
|
|
566
|
+
e.push(...t);
|
|
469
567
|
const o = Array.from(document.querySelectorAll('#procaptcha-container, [id$="-procaptcha-container"]')), a = Array.from(document.getElementsByClassName("p-procaptcha"));
|
|
470
|
-
|
|
568
|
+
e.push(...a);
|
|
471
569
|
for (const n of o)
|
|
472
|
-
|
|
473
|
-
return
|
|
570
|
+
e.includes(n) || e.push(n);
|
|
571
|
+
return e;
|
|
474
572
|
}
|
|
475
|
-
const
|
|
476
|
-
var t;
|
|
477
|
-
const { onloadUrlCallback:
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
573
|
+
const $ = () => {
|
|
574
|
+
var e, t;
|
|
575
|
+
const { onloadUrlCallback: o, renderExplicit: a } = he(E);
|
|
576
|
+
let n = !1;
|
|
577
|
+
if (a !== "explicit" && ((e = S(E)) == null || e.addEventListener("load", () => {
|
|
578
|
+
p(W), n = !0;
|
|
579
|
+
}), document.readyState === "complete" && !n && p(W)), o && ((t = S(E)) == null || t.addEventListener("load", () => {
|
|
580
|
+
const c = m(o);
|
|
581
|
+
p(c);
|
|
582
|
+
}), document.readyState === "complete" && !n)) {
|
|
583
|
+
const c = m(o);
|
|
584
|
+
p(c);
|
|
484
585
|
}
|
|
485
|
-
},
|
|
486
|
-
for (const
|
|
487
|
-
|
|
488
|
-
|
|
586
|
+
}, ye = () => {
|
|
587
|
+
for (const e of d)
|
|
588
|
+
e.unmount();
|
|
589
|
+
d = [], $();
|
|
489
590
|
};
|
|
490
|
-
window.procaptcha = { ready:
|
|
491
|
-
|
|
591
|
+
window.procaptcha = { ready: p, render: ge, reset: ye, execute: L };
|
|
592
|
+
$();
|
|
492
593
|
export {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
594
|
+
u as A,
|
|
595
|
+
g as C,
|
|
596
|
+
R as W,
|
|
597
|
+
k as a,
|
|
598
|
+
se as b,
|
|
599
|
+
p as c,
|
|
600
|
+
de as d,
|
|
601
|
+
L as e,
|
|
602
|
+
ye as f,
|
|
603
|
+
M as g,
|
|
604
|
+
N as l,
|
|
605
|
+
ge as r
|
|
504
606
|
};
|