@myrasec/eu-captcha 0.0.8
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/LICENSE +9 -0
- package/README.md +44 -0
- package/dist/eu-captcha.js +289 -0
- package/dist/eu-captcha.umd.cjs +6 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Copyright (c) 2026 Myra Security GmbH
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
4
|
+
|
|
5
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
6
|
+
|
|
7
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
8
|
+
|
|
9
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
This package provides an easy integration of Myra Security's EU Captcha.
|
|
2
|
+
|
|
3
|
+
You can use it with or without react.
|
|
4
|
+
|
|
5
|
+
How to use with react:
|
|
6
|
+
|
|
7
|
+
(0) npm i @myrasec/eu-captcha
|
|
8
|
+
|
|
9
|
+
(1) In your code add:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
import { EuCaptcha } from "@myrasec/eu-captcha";
|
|
13
|
+
|
|
14
|
+
// use the public sitekey you find in the customer's backend here.
|
|
15
|
+
const captchaSitekey = "YOUR-SITEKEY-HERE";
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
(2) And then render the widget using the following syntax:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
<EuCaptcha sitekey={captchaSitekey} />
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
You can test the integration using any fake sitekey. If a sitekey
|
|
25
|
+
does not exist, then the captcha runs with default parameters which
|
|
26
|
+
allow traffic to pass.
|
|
27
|
+
|
|
28
|
+
Without react, you can use the library like this:
|
|
29
|
+
|
|
30
|
+
(0) npm i @myrasec/eu-captcha
|
|
31
|
+
|
|
32
|
+
(1) Load the JS components asynchronously:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
import { loadEuCaptcha } from "@myrasec/eu-captcha";
|
|
36
|
+
|
|
37
|
+
loadEuCaptcha();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
(2) Create the <div> inside your <form>..</form> manually.
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
<div class="eu-captcha" data-sitekey="YOUR-SITEKEY-HERE"></div>
|
|
44
|
+
```
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import re from "react";
|
|
2
|
+
var b = { exports: {} }, E = {};
|
|
3
|
+
var I;
|
|
4
|
+
function te() {
|
|
5
|
+
if (I) return E;
|
|
6
|
+
I = 1;
|
|
7
|
+
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), c = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
+
function i(l, s, u) {
|
|
9
|
+
var d = null;
|
|
10
|
+
if (u !== void 0 && (d = "" + u), s.key !== void 0 && (d = "" + s.key), "key" in s) {
|
|
11
|
+
u = {};
|
|
12
|
+
for (var m in s)
|
|
13
|
+
m !== "key" && (u[m] = s[m]);
|
|
14
|
+
} else u = s;
|
|
15
|
+
return s = u.ref, {
|
|
16
|
+
$$typeof: t,
|
|
17
|
+
type: l,
|
|
18
|
+
key: d,
|
|
19
|
+
ref: s !== void 0 ? s : null,
|
|
20
|
+
props: u
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return E.Fragment = c, E.jsx = i, E.jsxs = i, E;
|
|
24
|
+
}
|
|
25
|
+
var _ = {};
|
|
26
|
+
var D;
|
|
27
|
+
function ne() {
|
|
28
|
+
return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
29
|
+
function t(e) {
|
|
30
|
+
if (e == null) return null;
|
|
31
|
+
if (typeof e == "function")
|
|
32
|
+
return e.$$typeof === Q ? null : e.displayName || e.name || null;
|
|
33
|
+
if (typeof e == "string") return e;
|
|
34
|
+
switch (e) {
|
|
35
|
+
case T:
|
|
36
|
+
return "Fragment";
|
|
37
|
+
case J:
|
|
38
|
+
return "Profiler";
|
|
39
|
+
case q:
|
|
40
|
+
return "StrictMode";
|
|
41
|
+
case X:
|
|
42
|
+
return "Suspense";
|
|
43
|
+
case B:
|
|
44
|
+
return "SuspenseList";
|
|
45
|
+
case Z:
|
|
46
|
+
return "Activity";
|
|
47
|
+
}
|
|
48
|
+
if (typeof e == "object")
|
|
49
|
+
switch (typeof e.tag == "number" && console.error(
|
|
50
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
51
|
+
), e.$$typeof) {
|
|
52
|
+
case U:
|
|
53
|
+
return "Portal";
|
|
54
|
+
case z:
|
|
55
|
+
return e.displayName || "Context";
|
|
56
|
+
case V:
|
|
57
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
58
|
+
case G:
|
|
59
|
+
var r = e.render;
|
|
60
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
61
|
+
case H:
|
|
62
|
+
return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
|
|
63
|
+
case k:
|
|
64
|
+
r = e._payload, e = e._init;
|
|
65
|
+
try {
|
|
66
|
+
return t(e(r));
|
|
67
|
+
} catch {
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
function c(e) {
|
|
73
|
+
return "" + e;
|
|
74
|
+
}
|
|
75
|
+
function i(e) {
|
|
76
|
+
try {
|
|
77
|
+
c(e);
|
|
78
|
+
var r = !1;
|
|
79
|
+
} catch {
|
|
80
|
+
r = !0;
|
|
81
|
+
}
|
|
82
|
+
if (r) {
|
|
83
|
+
r = console;
|
|
84
|
+
var n = r.error, a = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
85
|
+
return n.call(
|
|
86
|
+
r,
|
|
87
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
|
+
a
|
|
89
|
+
), c(e);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function l(e) {
|
|
93
|
+
if (e === T) return "<>";
|
|
94
|
+
if (typeof e == "object" && e !== null && e.$$typeof === k)
|
|
95
|
+
return "<...>";
|
|
96
|
+
try {
|
|
97
|
+
var r = t(e);
|
|
98
|
+
return r ? "<" + r + ">" : "<...>";
|
|
99
|
+
} catch {
|
|
100
|
+
return "<...>";
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function s() {
|
|
104
|
+
var e = y.A;
|
|
105
|
+
return e === null ? null : e.getOwner();
|
|
106
|
+
}
|
|
107
|
+
function u() {
|
|
108
|
+
return Error("react-stack-top-frame");
|
|
109
|
+
}
|
|
110
|
+
function d(e) {
|
|
111
|
+
if (x.call(e, "key")) {
|
|
112
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
113
|
+
if (r && r.isReactWarning) return !1;
|
|
114
|
+
}
|
|
115
|
+
return e.key !== void 0;
|
|
116
|
+
}
|
|
117
|
+
function m(e, r) {
|
|
118
|
+
function n() {
|
|
119
|
+
N || (N = !0, console.error(
|
|
120
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
121
|
+
r
|
|
122
|
+
));
|
|
123
|
+
}
|
|
124
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
125
|
+
get: n,
|
|
126
|
+
configurable: !0
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function M() {
|
|
130
|
+
var e = t(this.type);
|
|
131
|
+
return C[e] || (C[e] = !0, console.error(
|
|
132
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
133
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
134
|
+
}
|
|
135
|
+
function W(e, r, n, a, R, h) {
|
|
136
|
+
var o = n.ref;
|
|
137
|
+
return e = {
|
|
138
|
+
$$typeof: j,
|
|
139
|
+
type: e,
|
|
140
|
+
key: r,
|
|
141
|
+
props: n,
|
|
142
|
+
_owner: a
|
|
143
|
+
}, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
|
|
144
|
+
enumerable: !1,
|
|
145
|
+
get: M
|
|
146
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
147
|
+
configurable: !1,
|
|
148
|
+
enumerable: !1,
|
|
149
|
+
writable: !0,
|
|
150
|
+
value: 0
|
|
151
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
152
|
+
configurable: !1,
|
|
153
|
+
enumerable: !1,
|
|
154
|
+
writable: !0,
|
|
155
|
+
value: null
|
|
156
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
157
|
+
configurable: !1,
|
|
158
|
+
enumerable: !1,
|
|
159
|
+
writable: !0,
|
|
160
|
+
value: R
|
|
161
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
162
|
+
configurable: !1,
|
|
163
|
+
enumerable: !1,
|
|
164
|
+
writable: !0,
|
|
165
|
+
value: h
|
|
166
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
|
+
}
|
|
168
|
+
function w(e, r, n, a, R, h) {
|
|
169
|
+
var o = r.children;
|
|
170
|
+
if (o !== void 0)
|
|
171
|
+
if (a)
|
|
172
|
+
if (K(o)) {
|
|
173
|
+
for (a = 0; a < o.length; a++)
|
|
174
|
+
A(o[a]);
|
|
175
|
+
Object.freeze && Object.freeze(o);
|
|
176
|
+
} else
|
|
177
|
+
console.error(
|
|
178
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
179
|
+
);
|
|
180
|
+
else A(o);
|
|
181
|
+
if (x.call(r, "key")) {
|
|
182
|
+
o = t(e);
|
|
183
|
+
var f = Object.keys(r).filter(function(ee) {
|
|
184
|
+
return ee !== "key";
|
|
185
|
+
});
|
|
186
|
+
a = 0 < f.length ? "{key: someKey, " + f.join(": ..., ") + ": ...}" : "{key: someKey}", F[o + a] || (f = 0 < f.length ? "{" + f.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
187
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
188
|
+
let props = %s;
|
|
189
|
+
<%s {...props} />
|
|
190
|
+
React keys must be passed directly to JSX without using spread:
|
|
191
|
+
let props = %s;
|
|
192
|
+
<%s key={someKey} {...props} />`,
|
|
193
|
+
a,
|
|
194
|
+
o,
|
|
195
|
+
f,
|
|
196
|
+
o
|
|
197
|
+
), F[o + a] = !0);
|
|
198
|
+
}
|
|
199
|
+
if (o = null, n !== void 0 && (i(n), o = "" + n), d(r) && (i(r.key), o = "" + r.key), "key" in r) {
|
|
200
|
+
n = {};
|
|
201
|
+
for (var P in r)
|
|
202
|
+
P !== "key" && (n[P] = r[P]);
|
|
203
|
+
} else n = r;
|
|
204
|
+
return o && m(
|
|
205
|
+
n,
|
|
206
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
207
|
+
), W(
|
|
208
|
+
e,
|
|
209
|
+
o,
|
|
210
|
+
n,
|
|
211
|
+
s(),
|
|
212
|
+
R,
|
|
213
|
+
h
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
function A(e) {
|
|
217
|
+
g(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === k && (e._payload.status === "fulfilled" ? g(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
218
|
+
}
|
|
219
|
+
function g(e) {
|
|
220
|
+
return typeof e == "object" && e !== null && e.$$typeof === j;
|
|
221
|
+
}
|
|
222
|
+
var p = re, j = /* @__PURE__ */ Symbol.for("react.transitional.element"), U = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), q = /* @__PURE__ */ Symbol.for("react.strict_mode"), J = /* @__PURE__ */ Symbol.for("react.profiler"), V = /* @__PURE__ */ Symbol.for("react.consumer"), z = /* @__PURE__ */ Symbol.for("react.context"), G = /* @__PURE__ */ Symbol.for("react.forward_ref"), X = /* @__PURE__ */ Symbol.for("react.suspense"), B = /* @__PURE__ */ Symbol.for("react.suspense_list"), H = /* @__PURE__ */ Symbol.for("react.memo"), k = /* @__PURE__ */ Symbol.for("react.lazy"), Z = /* @__PURE__ */ Symbol.for("react.activity"), Q = /* @__PURE__ */ Symbol.for("react.client.reference"), y = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, x = Object.prototype.hasOwnProperty, K = Array.isArray, O = console.createTask ? console.createTask : function() {
|
|
223
|
+
return null;
|
|
224
|
+
};
|
|
225
|
+
p = {
|
|
226
|
+
react_stack_bottom_frame: function(e) {
|
|
227
|
+
return e();
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
var N, C = {}, Y = p.react_stack_bottom_frame.bind(
|
|
231
|
+
p,
|
|
232
|
+
u
|
|
233
|
+
)(), $ = O(l(u)), F = {};
|
|
234
|
+
_.Fragment = T, _.jsx = function(e, r, n) {
|
|
235
|
+
var a = 1e4 > y.recentlyCreatedOwnerStacks++;
|
|
236
|
+
return w(
|
|
237
|
+
e,
|
|
238
|
+
r,
|
|
239
|
+
n,
|
|
240
|
+
!1,
|
|
241
|
+
a ? Error("react-stack-top-frame") : Y,
|
|
242
|
+
a ? O(l(e)) : $
|
|
243
|
+
);
|
|
244
|
+
}, _.jsxs = function(e, r, n) {
|
|
245
|
+
var a = 1e4 > y.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return w(
|
|
247
|
+
e,
|
|
248
|
+
r,
|
|
249
|
+
n,
|
|
250
|
+
!0,
|
|
251
|
+
a ? Error("react-stack-top-frame") : Y,
|
|
252
|
+
a ? O(l(e)) : $
|
|
253
|
+
);
|
|
254
|
+
};
|
|
255
|
+
})()), _;
|
|
256
|
+
}
|
|
257
|
+
var L;
|
|
258
|
+
function ae() {
|
|
259
|
+
return L || (L = 1, process.env.NODE_ENV === "production" ? b.exports = te() : b.exports = ne()), b.exports;
|
|
260
|
+
}
|
|
261
|
+
var oe = ae();
|
|
262
|
+
let S = {
|
|
263
|
+
sitekey: "",
|
|
264
|
+
locale: ""
|
|
265
|
+
}, v = null;
|
|
266
|
+
function le(t) {
|
|
267
|
+
return typeof window > "u" ? Promise.reject("Cannot load script on server") : v || (v = new Promise((c, i) => {
|
|
268
|
+
if (document.querySelector(`script[src="${t}"]`)) {
|
|
269
|
+
c();
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
const l = document.createElement("script");
|
|
273
|
+
l.src = t, l.async = !0, l.onload = () => c(), l.onerror = () => i(new Error(`Failed to load ${t}`)), document.head.appendChild(l);
|
|
274
|
+
}), v);
|
|
275
|
+
}
|
|
276
|
+
function se(t) {
|
|
277
|
+
t = t || {}, typeof t.sitekey == "string" && (S.sitekey = t.sitekey), typeof t.locale == "string" && (S.locale = t.locale), le("https://cdn.eu-captcha.eu/verify.js").then(() => {
|
|
278
|
+
console.log("loaded successfully myra eu captcha library");
|
|
279
|
+
}, (c) => {
|
|
280
|
+
console.log("error occured: " + c);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
function ce(t) {
|
|
284
|
+
return t && t.sitekey && se({ sitekey: t.sitekey }), /* @__PURE__ */ oe.jsx("div", { className: "eu-captcha", "data-sitekey": S.sitekey });
|
|
285
|
+
}
|
|
286
|
+
export {
|
|
287
|
+
ce as EuCaptcha,
|
|
288
|
+
se as loadEuCaptcha
|
|
289
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(i,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(i=typeof globalThis<"u"?globalThis:i||self,m(i["@myra/eu-captcha"]={},i.React))})(this,(function(i,m){"use strict";var b={exports:{}},E={};var g;function q(){if(g)return E;g=1;var t=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function f(s,u,l){var _=null;if(l!==void 0&&(_=""+l),u.key!==void 0&&(_=""+u.key),"key"in u){l={};for(var R in u)R!=="key"&&(l[R]=u[R])}else l=u;return u=l.ref,{$$typeof:t,type:s,key:_,ref:u!==void 0?u:null,props:l}}return E.Fragment=c,E.jsx=f,E.jsxs=f,E}var p={};var j;function J(){return j||(j=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case h:return"Fragment";case K:return"Profiler";case Q:return"StrictMode";case ne:return"Suspense";case ae:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Z:return"Portal";case re:return e.displayName||"Context";case ee:return(e._context.displayName||"Context")+".Consumer";case te:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oe:return r=e.displayName||null,r!==null?r:t(e.type)||"Memo";case O:r=e._payload,e=e._init;try{return t(e(r))}catch{}}return null}function c(e){return""+e}function f(e){try{c(e);var r=!1}catch{r=!0}if(r){r=console;var n=r.error,a=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",a),c(e)}}function s(e){if(e===h)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var r=t(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function u(){var e=S.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function _(e){if(I.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function R(e,r){function n(){D||(D=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function B(){var e=t(this.type);return M[e]||(M[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function H(e,r,n,a,y,w){var o=n.ref;return e={$$typeof:F,type:e,key:r,props:n,_owner:a},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:B}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:y}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:w}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function C(e,r,n,a,y,w){var o=r.children;if(o!==void 0)if(a)if(le(o)){for(a=0;a<o.length;a++)Y(o[a]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Y(o);if(I.call(r,"key")){o=t(e);var d=Object.keys(r).filter(function(ce){return ce!=="key"});a=0<d.length?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}",U[o+a]||(d=0<d.length?"{"+d.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,a,o,d,o),U[o+a]=!0)}if(o=null,n!==void 0&&(f(n),o=""+n),_(r)&&(f(r.key),o=""+r.key),"key"in r){n={};for(var A in r)A!=="key"&&(n[A]=r[A])}else n=r;return o&&R(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),H(e,o,n,u(),y,w)}function Y(e){$(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?$(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function $(e){return typeof e=="object"&&e!==null&&e.$$typeof===F}var T=m,F=Symbol.for("react.transitional.element"),Z=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),ee=Symbol.for("react.consumer"),re=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),oe=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),ue=Symbol.for("react.client.reference"),S=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.prototype.hasOwnProperty,le=Array.isArray,P=console.createTask?console.createTask:function(){return null};T={react_stack_bottom_frame:function(e){return e()}};var D,M={},L=T.react_stack_bottom_frame.bind(T,l)(),W=P(s(l)),U={};p.Fragment=h,p.jsx=function(e,r,n){var a=1e4>S.recentlyCreatedOwnerStacks++;return C(e,r,n,!1,a?Error("react-stack-top-frame"):L,a?P(s(e)):W)},p.jsxs=function(e,r,n){var a=1e4>S.recentlyCreatedOwnerStacks++;return C(e,r,n,!0,a?Error("react-stack-top-frame"):L,a?P(s(e)):W)}})()),p}var x;function V(){return x||(x=1,process.env.NODE_ENV==="production"?b.exports=q():b.exports=J()),b.exports}var z=V();let k={sitekey:"",locale:""},v=null;function G(t){return typeof window>"u"?Promise.reject("Cannot load script on server"):v||(v=new Promise((c,f)=>{if(document.querySelector(`script[src="${t}"]`)){c();return}const s=document.createElement("script");s.src=t,s.async=!0,s.onload=()=>c(),s.onerror=()=>f(new Error(`Failed to load ${t}`)),document.head.appendChild(s)}),v)}function N(t){t=t||{},typeof t.sitekey=="string"&&(k.sitekey=t.sitekey),typeof t.locale=="string"&&(k.locale=t.locale),G("https://cdn.eu-captcha.eu/verify.js").then(()=>{console.log("loaded successfully myra eu captcha library")},c=>{console.log("error occured: "+c)})}function X(t){return t&&t.sitekey&&N({sitekey:t.sitekey}),z.jsx("div",{className:"eu-captcha","data-sitekey":k.sitekey})}i.EuCaptcha=X,i.loadEuCaptcha=N,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@myrasec/eu-captcha",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.8",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/eu-captcha.umd.cjs",
|
|
7
|
+
"module": "./dist/eu-captcha.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/eu-captcha.js",
|
|
11
|
+
"require": "./dist/eu-captcha.umd.cjs"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"dev": "vite",
|
|
16
|
+
"build": "tsc -b && vite build",
|
|
17
|
+
"lint": "eslint .",
|
|
18
|
+
"preview": "vite preview"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"react": ">=18",
|
|
22
|
+
"react-dom": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@eslint/js": "^9.39.1",
|
|
26
|
+
"@types/node": "^24.10.1",
|
|
27
|
+
"@types/react": "^19.2.5",
|
|
28
|
+
"@types/react-dom": "^19.2.3",
|
|
29
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
30
|
+
"eslint": "^9.39.1",
|
|
31
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
32
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
33
|
+
"globals": "^16.5.0",
|
|
34
|
+
"typescript": "~5.9.3",
|
|
35
|
+
"typescript-eslint": "^8.46.4",
|
|
36
|
+
"vite": "^7.2.4"
|
|
37
|
+
}
|
|
38
|
+
}
|