@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,968 +0,0 @@
1
- import { h as ce, j as v, E as le, a as ue, s as de, w as Se, T as Pe, u as Pt, i as xe, r as we, b as Ce, g as Te, m as Ee } from "./emotion-element-5486c51c.browser.esm-D7qvHZDV.js";
2
- import { a as Ae, r as m, c as x, A as i, S as ke, d as Ie, e as B, U as te, l as Oe, P as je, C as _ } from "./web2Chunk-DCsWA5PR.js";
3
- import { g as Re, W as _e, l as Ne, d as Me } from "./index-C00_J7av.js";
4
- import { a as pe } from "./commonChunk-HCVkoCqn.js";
5
- import { g as Et } from "./bnChunk-DRlDxTFg.js";
6
- const re = (e) => Object.values(e), Le = async (e) => {
7
- if (e === "production") {
8
- const t = await fetch(
9
- "https://provider-list.prosopo.io/",
10
- {
11
- method: "GET",
12
- mode: "cors"
13
- }
14
- ).then((r) => r.json());
15
- return re(t);
16
- }
17
- if (e === "staging") {
18
- const t = await fetch(
19
- "https://provider-list.prosopo.io/staging.json",
20
- { method: "GET", mode: "cors" }
21
- ).then((r) => r.json());
22
- return re(t);
23
- }
24
- if (e === "development")
25
- return [
26
- {
27
- address: "5EjTA28bKSbFPPyMbUjNtArxyqjwq38r1BapVmLZShaqEedV",
28
- url: "http://localhost:9229",
29
- datasetId: "0x9f460e81ac9c71b486f796a21bb36e2263694756a6621134d110da217fd3ef25"
30
- }
31
- ];
32
- throw new pe("CONFIG.UNKNOWN_ENVIRONMENT", {
33
- context: { environment: e }
34
- });
35
- };
36
- let R = [];
37
- const Fe = async (e) => {
38
- const t = (o, a) => Math.floor(Math.random() * (a - o + 1) + o);
39
- R.length === 0 && (R = await Le(e.defaultEnvironment));
40
- const r = Ae(
41
- R,
42
- t(0, R.length - 1)
43
- );
44
- return {
45
- providerAccount: r.address,
46
- provider: {
47
- url: r.url,
48
- datasetId: r.datasetId
49
- }
50
- };
51
- }, $e = async (e, t, r, o, a) => {
52
- try {
53
- await e();
54
- } catch (n) {
55
- if (o >= a)
56
- return console.error(n), console.error(
57
- `Max retries (${o} of ${a}) reached, aborting`
58
- ), r();
59
- console.error(n), r(), await t();
60
- }
61
- }, M = (e) => ({
62
- ...Re(void 0),
63
- ...e
64
- }), De = async (e) => e ? (await import("./web2Chunk-DCsWA5PR.js").then((t) => t.j)).default : (await import("./web3Chunk-B8txCqUJ.js")).default;
65
- function V() {
66
- return V = Object.assign ? Object.assign.bind() : function(e) {
67
- for (var t = 1; t < arguments.length; t++) {
68
- var r = arguments[t];
69
- for (var o in r) ({}).hasOwnProperty.call(r, o) && (e[o] = r[o]);
70
- }
71
- return e;
72
- }, V.apply(null, arguments);
73
- }
74
- var fe = { exports: {} }, c = {};
75
- var d = typeof Symbol == "function" && Symbol.for, X = d ? Symbol.for("react.element") : 60103, J = d ? Symbol.for("react.portal") : 60106, L = d ? Symbol.for("react.fragment") : 60107, F = d ? Symbol.for("react.strict_mode") : 60108, $ = d ? Symbol.for("react.profiler") : 60114, D = d ? Symbol.for("react.provider") : 60109, z = d ? Symbol.for("react.context") : 60110, Z = d ? Symbol.for("react.async_mode") : 60111, U = d ? Symbol.for("react.concurrent_mode") : 60111, H = d ? Symbol.for("react.forward_ref") : 60112, K = d ? Symbol.for("react.suspense") : 60113, ze = d ? Symbol.for("react.suspense_list") : 60120, W = d ? Symbol.for("react.memo") : 60115, q = d ? Symbol.for("react.lazy") : 60116, Ue = d ? Symbol.for("react.block") : 60121, He = d ? Symbol.for("react.fundamental") : 60117, Ke = d ? Symbol.for("react.responder") : 60118, We = d ? Symbol.for("react.scope") : 60119;
76
- function y(e) {
77
- if (typeof e == "object" && e !== null) {
78
- var t = e.$$typeof;
79
- switch (t) {
80
- case X:
81
- switch (e = e.type, e) {
82
- case Z:
83
- case U:
84
- case L:
85
- case $:
86
- case F:
87
- case K:
88
- return e;
89
- default:
90
- switch (e = e && e.$$typeof, e) {
91
- case z:
92
- case H:
93
- case q:
94
- case W:
95
- case D:
96
- return e;
97
- default:
98
- return t;
99
- }
100
- }
101
- case J:
102
- return t;
103
- }
104
- }
105
- }
106
- function he(e) {
107
- return y(e) === U;
108
- }
109
- c.AsyncMode = Z;
110
- c.ConcurrentMode = U;
111
- c.ContextConsumer = z;
112
- c.ContextProvider = D;
113
- c.Element = X;
114
- c.ForwardRef = H;
115
- c.Fragment = L;
116
- c.Lazy = q;
117
- c.Memo = W;
118
- c.Portal = J;
119
- c.Profiler = $;
120
- c.StrictMode = F;
121
- c.Suspense = K;
122
- c.isAsyncMode = function(e) {
123
- return he(e) || y(e) === Z;
124
- };
125
- c.isConcurrentMode = he;
126
- c.isContextConsumer = function(e) {
127
- return y(e) === z;
128
- };
129
- c.isContextProvider = function(e) {
130
- return y(e) === D;
131
- };
132
- c.isElement = function(e) {
133
- return typeof e == "object" && e !== null && e.$$typeof === X;
134
- };
135
- c.isForwardRef = function(e) {
136
- return y(e) === H;
137
- };
138
- c.isFragment = function(e) {
139
- return y(e) === L;
140
- };
141
- c.isLazy = function(e) {
142
- return y(e) === q;
143
- };
144
- c.isMemo = function(e) {
145
- return y(e) === W;
146
- };
147
- c.isPortal = function(e) {
148
- return y(e) === J;
149
- };
150
- c.isProfiler = function(e) {
151
- return y(e) === $;
152
- };
153
- c.isStrictMode = function(e) {
154
- return y(e) === F;
155
- };
156
- c.isSuspense = function(e) {
157
- return y(e) === K;
158
- };
159
- c.isValidElementType = function(e) {
160
- return typeof e == "string" || typeof e == "function" || e === L || e === U || e === $ || e === F || e === K || e === ze || typeof e == "object" && e !== null && (e.$$typeof === q || e.$$typeof === W || e.$$typeof === D || e.$$typeof === z || e.$$typeof === H || e.$$typeof === He || e.$$typeof === Ke || e.$$typeof === We || e.$$typeof === Ue);
161
- };
162
- c.typeOf = y;
163
- fe.exports = c;
164
- var qe = fe.exports, me = qe;
165
- var Be = {
166
- $$typeof: !0,
167
- render: !0,
168
- defaultProps: !0,
169
- displayName: !0,
170
- propTypes: !0
171
- }, Ge = {
172
- $$typeof: !0,
173
- compare: !0,
174
- defaultProps: !0,
175
- displayName: !0,
176
- propTypes: !0,
177
- type: !0
178
- }, ye = {};
179
- ye[me.ForwardRef] = Be;
180
- ye[me.Memo] = Ge;
181
- var At = Object.prototype;
182
- function w(e, t, r) {
183
- return ce.call(t, "css") ? v.jsx(le, ue(e, t), r) : v.jsx(e, t, r);
184
- }
185
- function Ve(e, t, r) {
186
- return ce.call(t, "css") ? v.jsxs(le, ue(e, t), r) : v.jsxs(e, t, r);
187
- }
188
- function Ye() {
189
- for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
190
- t[r] = arguments[r];
191
- return de(t);
192
- }
193
- var Xe = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, Je = /* @__PURE__ */ Ee(
194
- function(e) {
195
- return Xe.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91;
196
- }
197
- /* Z+1 */
198
- ), Ze = Je, Qe = function(t) {
199
- return t !== "theme";
200
- }, oe = function(t) {
201
- return typeof t == "string" && // 96 is one less than the char code
202
- // for "a" so this is checking that
203
- // it's a lowercase character
204
- t.charCodeAt(0) > 96 ? Ze : Qe;
205
- }, ae = function(t, r, o) {
206
- var a;
207
- if (r) {
208
- var n = r.shouldForwardProp;
209
- a = t.__emotion_forwardProp && n ? function(s) {
210
- return t.__emotion_forwardProp(s) && n(s);
211
- } : n;
212
- }
213
- return typeof a != "function" && o && (a = t.__emotion_forwardProp), a;
214
- }, et = function(t) {
215
- var r = t.cache, o = t.serialized, a = t.isStringTag;
216
- return we(r, o, a), Ce(function() {
217
- return xe(r, o, a);
218
- }), null;
219
- }, tt = function e(t, r) {
220
- var o = t.__emotion_real === t, a = o && t.__emotion_base || t, n, s;
221
- r !== void 0 && (n = r.label, s = r.target);
222
- var u = ae(t, r, o), b = u || oe(a), P = !b("as");
223
- return function() {
224
- var g = arguments, f = o && t.__emotion_styles !== void 0 ? t.__emotion_styles.slice(0) : [];
225
- if (n !== void 0 && f.push("label:" + n + ";"), g[0] == null || g[0].raw === void 0)
226
- f.push.apply(f, g);
227
- else {
228
- f.push(g[0][0]);
229
- for (var T = g.length, h = 1; h < T; h++)
230
- f.push(g[h], g[0][h]);
231
- }
232
- var l = Se(function(p, S, A) {
233
- var E = P && p.as || a, C = "", k = [], I = p;
234
- if (p.theme == null) {
235
- I = {};
236
- for (var Q in p)
237
- I[Q] = p[Q];
238
- I.theme = m.useContext(Pe);
239
- }
240
- typeof p.className == "string" ? C = Te(S.registered, k, p.className) : p.className != null && (C = p.className + " ");
241
- var ee = de(f.concat(k), S.registered, I);
242
- C += S.key + "-" + ee.name, s !== void 0 && (C += " " + s);
243
- var be = P && u === void 0 ? oe(E) : b, O = {};
244
- for (var j in p)
245
- P && j === "as" || be(j) && (O[j] = p[j]);
246
- return O.className = C, A && (O.ref = A), /* @__PURE__ */ m.createElement(m.Fragment, null, /* @__PURE__ */ m.createElement(et, {
247
- cache: S,
248
- serialized: ee,
249
- isStringTag: typeof E == "string"
250
- }), /* @__PURE__ */ m.createElement(E, O));
251
- });
252
- return l.displayName = n !== void 0 ? n : "Styled(" + (typeof a == "string" ? a : a.displayName || a.name || "Component") + ")", l.defaultProps = t.defaultProps, l.__emotion_real = l, l.__emotion_base = a, l.__emotion_styles = f, l.__emotion_forwardProp = u, Object.defineProperty(l, "toString", {
253
- value: function() {
254
- return "." + s;
255
- }
256
- }), l.withComponent = function(p, S) {
257
- return e(p, V({}, r, S, {
258
- shouldForwardProp: ae(l, S, !0)
259
- })).apply(void 0, f);
260
- }, l;
261
- };
262
- }, rt = [
263
- "a",
264
- "abbr",
265
- "address",
266
- "area",
267
- "article",
268
- "aside",
269
- "audio",
270
- "b",
271
- "base",
272
- "bdi",
273
- "bdo",
274
- "big",
275
- "blockquote",
276
- "body",
277
- "br",
278
- "button",
279
- "canvas",
280
- "caption",
281
- "cite",
282
- "code",
283
- "col",
284
- "colgroup",
285
- "data",
286
- "datalist",
287
- "dd",
288
- "del",
289
- "details",
290
- "dfn",
291
- "dialog",
292
- "div",
293
- "dl",
294
- "dt",
295
- "em",
296
- "embed",
297
- "fieldset",
298
- "figcaption",
299
- "figure",
300
- "footer",
301
- "form",
302
- "h1",
303
- "h2",
304
- "h3",
305
- "h4",
306
- "h5",
307
- "h6",
308
- "head",
309
- "header",
310
- "hgroup",
311
- "hr",
312
- "html",
313
- "i",
314
- "iframe",
315
- "img",
316
- "input",
317
- "ins",
318
- "kbd",
319
- "keygen",
320
- "label",
321
- "legend",
322
- "li",
323
- "link",
324
- "main",
325
- "map",
326
- "mark",
327
- "marquee",
328
- "menu",
329
- "menuitem",
330
- "meta",
331
- "meter",
332
- "nav",
333
- "noscript",
334
- "object",
335
- "ol",
336
- "optgroup",
337
- "option",
338
- "output",
339
- "p",
340
- "param",
341
- "picture",
342
- "pre",
343
- "progress",
344
- "q",
345
- "rp",
346
- "rt",
347
- "ruby",
348
- "s",
349
- "samp",
350
- "script",
351
- "section",
352
- "select",
353
- "small",
354
- "source",
355
- "span",
356
- "strong",
357
- "style",
358
- "sub",
359
- "summary",
360
- "sup",
361
- "table",
362
- "tbody",
363
- "td",
364
- "textarea",
365
- "tfoot",
366
- "th",
367
- "thead",
368
- "time",
369
- "title",
370
- "tr",
371
- "track",
372
- "u",
373
- "ul",
374
- "var",
375
- "video",
376
- "wbr",
377
- // SVG
378
- "circle",
379
- "clipPath",
380
- "defs",
381
- "ellipse",
382
- "foreignObject",
383
- "g",
384
- "image",
385
- "line",
386
- "linearGradient",
387
- "mask",
388
- "path",
389
- "pattern",
390
- "polygon",
391
- "polyline",
392
- "radialGradient",
393
- "rect",
394
- "stop",
395
- "svg",
396
- "text",
397
- "tspan"
398
- ], Y = tt.bind();
399
- rt.forEach(function(e) {
400
- Y[e] = Y(e);
401
- });
402
- const ot = Ye`{
403
- &:before {
404
- content: '""';
405
- position: absolute;
406
- height: 100%;
407
- width: 100%;
408
- }
409
- }`, at = {
410
- width: "28px",
411
- height: "28px",
412
- minWidth: "14px",
413
- minHeight: "14px",
414
- top: "auto",
415
- left: "auto",
416
- opacity: "1",
417
- borderRadius: "12.5%",
418
- appearance: "none",
419
- cursor: "pointer",
420
- margin: "0",
421
- borderStyle: "solid",
422
- borderWidth: "1px"
423
- }, ne = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", nt = "https://docs.prosopo.io/en/basics/faq/", st = () => Array.from(
424
- { length: 8 },
425
- () => ne[Math.floor(Math.random() * ne.length)]
426
- ).join(""), it = ({
427
- theme: e,
428
- onChange: t,
429
- checked: r,
430
- labelText: o,
431
- error: a,
432
- loading: n
433
- }) => {
434
- const s = {
435
- ...at,
436
- border: `1px solid ${e.palette.background.contrastText}`
437
- }, [u, b] = m.useState(!1), P = Y.label`
438
- color: ${e.palette.background.contrastText};
439
- position: relative;
440
- display: flex;
441
- cursor: pointer;
442
- user-select: none;
443
-
444
- @container widget (max-width: 219px) {
445
- display: none;
446
- }
447
- @container widget (min-width: 220px) {
448
- font-size: 12px;
449
- }
450
- @container widget (min-width: 250px) {
451
- font-size: 14px;
452
- }
453
- @container widget (min-width: 270px) {
454
- font-size: 16px;
455
- }
456
- `, g = m.useMemo(() => ({
457
- ...s,
458
- borderColor: u ? e.palette.background.contrastText : e.palette.border,
459
- appearance: r ? "auto" : "none",
460
- flex: 1,
461
- margin: "15px",
462
- minWidth: "28px",
463
- minHeight: "28px"
464
- }), [u, e, r]), f = st();
465
- return /* @__PURE__ */ Ve(
466
- "span",
467
- {
468
- style: {
469
- display: "inline-flex",
470
- alignItems: "center",
471
- minHeight: "58px"
472
- },
473
- children: [
474
- n ? /* @__PURE__ */ w(
475
- "div",
476
- {
477
- className: _e,
478
- "aria-label": "Loading spinner"
479
- }
480
- ) : /* @__PURE__ */ w(
481
- "input",
482
- {
483
- name: f,
484
- id: f,
485
- onMouseEnter: () => b(!0),
486
- onMouseLeave: () => b(!1),
487
- css: ot,
488
- type: "checkbox",
489
- "aria-live": "assertive",
490
- "aria-label": o,
491
- onChange: (T) => {
492
- T.preventDefault(), T.stopPropagation(), b(!1), t();
493
- },
494
- checked: r,
495
- style: g,
496
- disabled: a !== void 0,
497
- className: n ? "checkbox__loading-spinner" : "",
498
- "data-cy": "captcha-checkbox"
499
- }
500
- ),
501
- a ? /* @__PURE__ */ w(P, { htmFor: f, children: /* @__PURE__ */ w(
502
- "a",
503
- {
504
- css: {
505
- color: e.palette.error.main
506
- },
507
- href: nt,
508
- children: a
509
- }
510
- ) }) : /* @__PURE__ */ w(P, { htmFor: f, children: o })
511
- ]
512
- }
513
- );
514
- };
515
- class G extends Error {
516
- constructor(t, r, o) {
517
- super(`HTTP error! status: ${t} (${r}) for URL: ${o}`), this.status = t, this.statusText = r, this.url = o, this.name = "HttpError";
518
- }
519
- }
520
- class ct {
521
- constructor(t, r = "") {
522
- this.baseURL = t + r;
523
- }
524
- async fetch(t, r) {
525
- var o;
526
- try {
527
- const a = await fetch(this.baseURL + t, r);
528
- if (!a.ok && // Only throw an error if the response is not JSON and not a 400 error
529
- a.status !== 400 && !((o = a.headers.get("content-type")) != null && o.includes("application/json")))
530
- throw new G(a.status, a.statusText, a.url);
531
- return this.responseHandler(a);
532
- } catch (a) {
533
- return this.errorHandler(a);
534
- }
535
- }
536
- async post(t, r, o) {
537
- var n;
538
- const a = {
539
- "Content-Type": "application/json",
540
- ...(o == null ? void 0 : o.headers) || {}
541
- };
542
- try {
543
- const s = await fetch(this.baseURL + t, {
544
- method: "POST",
545
- body: JSON.stringify(r),
546
- ...o,
547
- headers: a
548
- });
549
- if (!s.ok && // Only throw an error if the response is not JSON and not a 400 error
550
- s.status !== 400 && !((n = s.headers.get("content-type")) != null && n.includes("application/json")))
551
- throw new G(s.status, s.statusText, s.url);
552
- return this.responseHandler(s);
553
- } catch (s) {
554
- return this.errorHandler(s);
555
- }
556
- }
557
- async responseHandler(t) {
558
- try {
559
- return await t.json();
560
- } catch (r) {
561
- throw console.error("Error parsing JSON:", r), r;
562
- }
563
- }
564
- errorHandler(t) {
565
- return t instanceof G ? console.error("HTTP error:", t) : console.error("API request error:", t), Promise.reject(t);
566
- }
567
- }
568
- var N = /* @__PURE__ */ ((e) => (e.INSERT_MANY = "/v1/prosopo/user-access-policy/rules/insert-many", e.DELETE_MANY = "/v1/prosopo/user-access-policy/rules/delete-many", e.DELETE_ALL = "/v1/prosopo/user-access-policy/rules/delete-all", e))(N || {});
569
- class lt extends ct {
570
- constructor(t, r) {
571
- const o = t.startsWith("http") ? t : `https://${t}`;
572
- super(o), this.account = r;
573
- }
574
- getCaptchaChallenge(t, r, o) {
575
- const { provider: a } = r, n = this.account, s = {
576
- [i.dapp]: n,
577
- [i.user]: t,
578
- [i.datasetId]: a.datasetId
579
- };
580
- return o && (s[i.sessionId] = o), this.post(x.GetImageCaptchaChallenge, s, {
581
- headers: {
582
- "Prosopo-Site-Key": this.account,
583
- "Prosopo-User": t
584
- }
585
- });
586
- }
587
- submitCaptchaSolution(t, r, o, a, n, s) {
588
- const u = {
589
- [i.user]: o,
590
- [i.dapp]: this.account,
591
- [i.captchas]: t,
592
- [i.requestHash]: r,
593
- [i.timestamp]: a,
594
- [i.signature]: {
595
- [i.user]: {
596
- [i.timestamp]: s
597
- },
598
- [i.provider]: {
599
- [i.requestHash]: n
600
- }
601
- }
602
- };
603
- return this.post(x.SubmitImageCaptchaSolution, u, {
604
- headers: {
605
- "Prosopo-Site-Key": this.account,
606
- "Prosopo-User": o
607
- }
608
- });
609
- }
610
- verifyDappUser(t, r, o, a, n) {
611
- const s = {
612
- [i.token]: t,
613
- [i.dappSignature]: r,
614
- [i.ip]: n
615
- };
616
- return a && (s[i.maxVerifiedTime] = a), this.post(x.VerifyImageCaptchaSolutionDapp, s, {
617
- headers: {
618
- "Prosopo-Site-Key": this.account,
619
- "Prosopo-User": o
620
- }
621
- });
622
- }
623
- getPowCaptchaChallenge(t, r, o) {
624
- const a = {
625
- [i.user]: t.toString(),
626
- [i.dapp]: r.toString(),
627
- ...o && { [i.sessionId]: o }
628
- };
629
- return this.post(x.GetPowCaptchaChallenge, a, {
630
- headers: {
631
- "Prosopo-Site-Key": this.account,
632
- "Prosopo-User": t
633
- }
634
- });
635
- }
636
- submitPowCaptchaSolution(t, r, o, a, n, s) {
637
- const u = ke.parse({
638
- [i.challenge]: t.challenge,
639
- [i.difficulty]: t.difficulty,
640
- [i.timestamp]: t.timestamp,
641
- [i.user]: r.toString(),
642
- [i.dapp]: o.toString(),
643
- [i.nonce]: a,
644
- [i.verifiedTimeout]: s,
645
- [i.signature]: {
646
- [i.provider]: t[i.signature][i.provider],
647
- [i.user]: {
648
- [i.timestamp]: n
649
- }
650
- }
651
- });
652
- return this.post(x.SubmitPowCaptchaSolution, u, {
653
- headers: {
654
- "Prosopo-Site-Key": this.account,
655
- "Prosopo-User": r
656
- }
657
- });
658
- }
659
- getFrictionlessCaptcha(t, r, o) {
660
- const a = {
661
- [i.token]: t,
662
- [i.dapp]: r,
663
- [i.user]: o
664
- };
665
- return this.post(x.GetFrictionlessCaptchaChallenge, a, {
666
- headers: {
667
- "Prosopo-Site-Key": this.account,
668
- "Prosopo-User": o
669
- }
670
- });
671
- }
672
- submitUserEvents(t, r) {
673
- return this.post(
674
- x.SubmitUserEvents,
675
- { events: t, string: r },
676
- {
677
- headers: {
678
- "Prosopo-Site-Key": this.account
679
- }
680
- }
681
- );
682
- }
683
- getProviderStatus() {
684
- return this.fetch(x.GetProviderStatus, {
685
- headers: {
686
- "Prosopo-Site-Key": this.account
687
- }
688
- });
689
- }
690
- getProviderDetails() {
691
- return this.fetch(Ie.GetProviderDetails, {
692
- headers: {
693
- "Prosopo-Site-Key": this.account
694
- }
695
- });
696
- }
697
- submitPowCaptchaVerify(t, r, o, a, n) {
698
- const s = {
699
- [i.token]: t,
700
- [i.dappSignature]: r,
701
- [i.verifiedTimeout]: o,
702
- [i.ip]: n
703
- };
704
- return this.post(x.VerifyPowCaptchaSolution, s, {
705
- headers: {
706
- "Prosopo-Site-Key": this.account,
707
- "Prosopo-User": a
708
- }
709
- });
710
- }
711
- registerSiteKey(t, r, o, a, n) {
712
- const s = { siteKey: t, tier: r, settings: o };
713
- return this.post(B.SiteKeyRegister, s, {
714
- headers: {
715
- "Prosopo-Site-Key": this.account,
716
- timestamp: a,
717
- signature: n
718
- }
719
- });
720
- }
721
- updateDetectorKey(t, r, o) {
722
- return this.post(
723
- B.UpdateDetectorKey,
724
- te.parse({ detectorKey: t }),
725
- {
726
- headers: {
727
- "Prosopo-Site-Key": this.account,
728
- timestamp: r,
729
- signature: o
730
- }
731
- }
732
- );
733
- }
734
- removeDetectorKey(t, r, o) {
735
- return this.post(
736
- B.RemoveDetectorKey,
737
- te.parse({ detectorKey: t }),
738
- {
739
- headers: {
740
- "Prosopo-Site-Key": this.account,
741
- timestamp: r,
742
- signature: o
743
- }
744
- }
745
- );
746
- }
747
- insertUserAccessPolicies(t, r, o) {
748
- return this.post(N.INSERT_MANY, t, {
749
- headers: {
750
- "Prosopo-Site-Key": this.account,
751
- timestamp: r,
752
- signature: o
753
- }
754
- });
755
- }
756
- deleteUserAccessPolicies(t, r, o) {
757
- return this.post(N.DELETE_MANY, t, {
758
- headers: {
759
- "Prosopo-Site-Key": this.account,
760
- timestamp: r,
761
- signature: o
762
- }
763
- });
764
- }
765
- deleteAllUserAccessPolicies(t, r) {
766
- return this.post(
767
- N.DELETE_ALL,
768
- {},
769
- {
770
- headers: {
771
- "Prosopo-Site-Key": this.account,
772
- timestamp: t,
773
- signature: r
774
- }
775
- }
776
- );
777
- }
778
- }
779
- const ut = m.lazy(
780
- async () => import("./ProcaptchaWidget-48FxVPQd.js")
781
- ), ge = (e) => /* @__PURE__ */ w(m.Suspense, { children: /* @__PURE__ */ w(
782
- ut,
783
- {
784
- config: e.config,
785
- callbacks: e.callbacks,
786
- frictionlessState: e.frictionlessState,
787
- i18n: e.i18n
788
- }
789
- ) }), dt = m.lazy(async () => import("./ProcaptchaWidget-B2BzhXLv.js")), ve = (e) => /* @__PURE__ */ w(m.Suspense, { children: /* @__PURE__ */ w(dt, { ...e }) }), pt = async () => (await import("./index-7Xh-Mf8v.js")).default, ft = async (e) => {
790
- const r = await (await pt())(), a = await new (await De(e.web2))().getAccount(e);
791
- if (!e.account.address)
792
- throw new pe("GENERAL.SITE_KEY_MISSING");
793
- const n = await Fe(e), u = await new lt(
794
- n.provider.url,
795
- e.account.address
796
- ).getFrictionlessCaptcha(
797
- r.token,
798
- e.account.address,
799
- a.account.address
800
- );
801
- return {
802
- captchaType: u.captchaType,
803
- sessionId: u.sessionId,
804
- provider: n,
805
- status: u.status,
806
- userAccount: a,
807
- error: u.error
808
- };
809
- }, se = (e, t, r, o, a, n) => {
810
- const s = e === "light" ? Ne : Me;
811
- return t === "invisible" ? null : /* @__PURE__ */ v.jsx(
812
- it,
813
- {
814
- theme: s,
815
- onChange: async () => {
816
- },
817
- checked: !1,
818
- labelText: o ? a("WIDGET.I_AM_HUMAN") : "",
819
- error: r,
820
- "aria-label": "human checkbox",
821
- loading: n
822
- }
823
- );
824
- }, ie = (e) => ({
825
- loading: !1,
826
- attemptCount: e || 0
827
- }), ht = ({
828
- config: e,
829
- callbacks: t,
830
- restart: r,
831
- i18n: o,
832
- detectBot: a = ft
833
- }) => {
834
- const n = m.useRef(ie(0)), s = M(t);
835
- m.useEffect(() => {
836
- e.language && (o ? o.language !== e.language && o.changeLanguage(e.language).then((h) => h) : Oe().then((h) => {
837
- h.language !== e.language && h.changeLanguage(e.language).then((l) => l);
838
- }));
839
- }, [o, e.language]);
840
- const [u, b] = m.useState(
841
- se(
842
- e.theme,
843
- e.mode,
844
- n.current.errorMessage,
845
- o.isInitialized,
846
- o.t,
847
- !0
848
- )
849
- ), P = (h) => {
850
- n.current = ie(
851
- h || n.current.attemptCount
852
- );
853
- }, g = (h, l) => {
854
- l === "CAPTCHA.NO_SESSION_FOUND" && setTimeout(() => {
855
- f();
856
- }, 0), b(
857
- se(
858
- e.theme,
859
- e.mode,
860
- h || "Cannot load CAPTCHA",
861
- o.isInitialized,
862
- o.t,
863
- !1
864
- )
865
- );
866
- }, f = () => {
867
- setTimeout(() => {
868
- P(0), s.onReset(), r();
869
- }, 1e4);
870
- }, T = async () => {
871
- await $e(
872
- async () => {
873
- var S, A, E, C, k;
874
- n.current.attemptCount += 1;
875
- const h = je.parse(e), l = await a(h);
876
- if ((S = l.error) != null && S.message) {
877
- n.current = {
878
- ...n.current,
879
- loading: !1,
880
- errorMessage: (A = l.error) == null ? void 0 : A.message
881
- }, s.onError(new Error((E = l.error) == null ? void 0 : E.message)), g((C = l.error) == null ? void 0 : C.message, (k = l.error) == null ? void 0 : k.key);
882
- return;
883
- }
884
- const p = {
885
- provider: l.provider,
886
- sessionId: l.sessionId,
887
- userAccount: l.userAccount,
888
- restart: r
889
- // Pass restart function
890
- };
891
- l.captchaType === "image" ? b(
892
- /* @__PURE__ */ v.jsx(
893
- ve,
894
- {
895
- config: e,
896
- callbacks: t,
897
- frictionlessState: p,
898
- i18n: o
899
- }
900
- )
901
- ) : (b(
902
- /* @__PURE__ */ v.jsx(
903
- ge,
904
- {
905
- config: e,
906
- callbacks: t,
907
- frictionlessState: p,
908
- i18n: o
909
- }
910
- )
911
- ), n.current = {
912
- ...n.current,
913
- loading: !1
914
- });
915
- },
916
- T,
917
- P,
918
- n.current.attemptCount,
919
- 5
920
- ).finally(() => {
921
- n.current.attemptCount >= 5 && (g(), f());
922
- });
923
- };
924
- return m.useEffect(() => {
925
- (async () => {
926
- await T();
927
- })();
928
- }, [e, t, a, e.language]), u;
929
- }, mt = (e) => {
930
- const { config: t, callbacks: r, i18n: o } = e, [a, n] = m.useState(0), s = () => {
931
- n((u) => u + 1);
932
- };
933
- return v.jsx(ht, { config: t, callbacks: M(r), restart: s, i18n: o }, a);
934
- }, yt = (e) => {
935
- const { config: t, callbacks: r, i18n: o } = e;
936
- return v.jsx(ve, { config: t, callbacks: M(r), i18n: o });
937
- }, gt = (e) => {
938
- const { config: t, callbacks: r, i18n: o } = e;
939
- return v.jsx(ge, { config: t, callbacks: M(r), i18n: o });
940
- }, vt = {
941
- [_.image]: yt,
942
- [_.pow]: gt,
943
- [_.frictionless]: mt
944
- };
945
- class bt {
946
- getCaptchaComponent(t, r) {
947
- if (t === _.invisible)
948
- throw new Error("Not Implemented");
949
- const o = vt[t];
950
- return "rendering ".concat(t), v.jsx(o, { config: r.config, callbacks: r.callbacks, i18n: r.i18n });
951
- }
952
- }
953
- const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
954
- __proto__: null,
955
- CaptchaComponentProvider: bt
956
- }, Symbol.toStringTag, { value: "Module" }));
957
- export {
958
- it as C,
959
- De as E,
960
- lt as P,
961
- Ve as a,
962
- Fe as b,
963
- Ye as c,
964
- kt as d,
965
- M as g,
966
- w as j,
967
- $e as p
968
- };