@prosopo/procaptcha-bundle 2.4.1 → 2.5.0

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 (28) hide show
  1. package/dist/bundle/{ProcaptchaWidget-DOETad4N.js → ProcaptchaWidget-CAyH6qD7.js} +33 -31
  2. package/dist/bundle/{ProcaptchaWidget-79FRw4Va.js → ProcaptchaWidget-CY3qomFu.js} +153 -149
  3. package/dist/bundle/{asU8a-2GgUBNjQ.js → asU8a-Br9wz334.js} +1 -1
  4. package/dist/bundle/{bip39-C01p7UHO.js → bip39-BtaWByKg.js} +7 -7
  5. package/dist/bundle/browser-ponyfill-Ck_bwPOY.js +339 -0
  6. package/dist/bundle/{hash-0yoKUuST.js → hash-KElfghPn.js} +7 -7
  7. package/dist/bundle/{index-Ckreqz7Q.js → index-B0trzdT2.js} +3 -3
  8. package/dist/bundle/index-Cb-XcaMX.js +4372 -0
  9. package/dist/bundle/index-VYSrdSle.js +11587 -0
  10. package/dist/bundle/{index-DlBTo0Xd.js → index-n-2hvBzo.js} +405 -405
  11. package/dist/bundle/locales/de/translation.json +405 -0
  12. package/dist/bundle/locales/en/translation.json +405 -0
  13. package/dist/bundle/locales/es/translation.json +405 -0
  14. package/dist/bundle/locales/fr/translation.json +405 -0
  15. package/dist/bundle/locales/it/translation.json +405 -0
  16. package/dist/bundle/locales/pt/translation.json +405 -0
  17. package/dist/bundle/locales/pt-BR/translation.json +405 -0
  18. package/dist/bundle/procaptcha.bundle.js +1 -1
  19. package/dist/bundle/useTranslation-CcYxvTxi.js +2435 -0
  20. package/package.json +11 -11
  21. package/stats.html +1 -1
  22. package/vite.cjs.config.ts +1 -1
  23. package/vite.config.ts +32 -1
  24. package/vite.test.config.ts +1 -1
  25. package/webpack.config.cjs +1 -1
  26. package/dist/bundle/index-C8sSamyh.js +0 -6521
  27. package/dist/bundle/index-DOFIggts.js +0 -17295
  28. package/dist/bundle/useTranslation-CgamIJ5S.js +0 -550
@@ -1,550 +0,0 @@
1
- import { B as re, _ as q, D as J, r as m, F as Q, G as ae, H as ie, I as se, m as W, J as ue, K as ce } from "./index-DOFIggts.js";
2
- import { s as fe } from "./toU8a-BWKf-2UU.js";
3
- function Qe(t) {
4
- return re(fe(t));
5
- }
6
- const We = (t) => new Promise((e) => setTimeout(e, t)), Ke = (t, e) => (n) => {
7
- Object.assign(t, n), e(n);
8
- }, N = (t, e) => {
9
- const n = t(e), o = (r) => {
10
- n.current = r;
11
- };
12
- return [n.current, o];
13
- }, Ge = (t, e) => {
14
- const [n, o] = t(!1), [a, r] = t(0), [i, u] = t([]), [c, g] = N(e, void 0), [p, f] = t(!1), [h, w] = t(void 0), [x, L] = t(!1), [D, y] = t(void 0), [O, T] = t(void 0), [v, P] = N(e, void 0), [b, l] = N(e, void 0), [d, k] = N(e, void 0), [S, Y] = t(!1), [Z, X] = t(0), [ee, ne] = t(void 0), [te, oe] = t(void 0);
15
- return [
16
- {
17
- isHuman: n,
18
- index: a,
19
- solutions: i,
20
- captchaApi: c,
21
- showModal: p,
22
- challenge: h,
23
- loading: x,
24
- account: D,
25
- dappAccount: O,
26
- submission: v,
27
- timeout: b,
28
- successfullChallengeTimeout: d,
29
- sendData: S,
30
- attemptCount: Z,
31
- error: ee,
32
- sessionId: te
33
- },
34
- (s) => {
35
- s.account !== void 0 && y(s.account), s.isHuman !== void 0 && o(s.isHuman), s.index !== void 0 && r(s.index), s.solutions !== void 0 && u(s.solutions.slice()), s.captchaApi !== void 0 && g(s.captchaApi), s.showModal !== void 0 && f(s.showModal), s.challenge !== void 0 && w(s.challenge), s.loading !== void 0 && L(s.loading), s.showModal !== void 0 && f(s.showModal), s.dappAccount !== void 0 && T(s.dappAccount), s.submission !== void 0 && P(s.submission), s.timeout !== void 0 && l(s.timeout), s.successfullChallengeTimeout !== void 0 && k(s.timeout), s.sendData !== void 0 && Y(s.sendData), s.attemptCount !== void 0 && X(s.attemptCount), s.error !== void 0 && ne(s.error), s.sessionId !== void 0 && oe(s.sessionId);
36
- }
37
- ];
38
- };
39
- var K = [], le = K.forEach, de = K.slice;
40
- function ge(t) {
41
- return le.call(de.call(arguments, 1), function(e) {
42
- if (e)
43
- for (var n in e)
44
- t[n] === void 0 && (t[n] = e[n]);
45
- }), t;
46
- }
47
- var j = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, pe = function(e, n, o) {
48
- var a = o || {};
49
- a.path = a.path || "/";
50
- var r = encodeURIComponent(n), i = "".concat(e, "=").concat(r);
51
- if (a.maxAge > 0) {
52
- var u = a.maxAge - 0;
53
- if (Number.isNaN(u)) throw new Error("maxAge should be a Number");
54
- i += "; Max-Age=".concat(Math.floor(u));
55
- }
56
- if (a.domain) {
57
- if (!j.test(a.domain))
58
- throw new TypeError("option domain is invalid");
59
- i += "; Domain=".concat(a.domain);
60
- }
61
- if (a.path) {
62
- if (!j.test(a.path))
63
- throw new TypeError("option path is invalid");
64
- i += "; Path=".concat(a.path);
65
- }
66
- if (a.expires) {
67
- if (typeof a.expires.toUTCString != "function")
68
- throw new TypeError("option expires is invalid");
69
- i += "; Expires=".concat(a.expires.toUTCString());
70
- }
71
- if (a.httpOnly && (i += "; HttpOnly"), a.secure && (i += "; Secure"), a.sameSite) {
72
- var c = typeof a.sameSite == "string" ? a.sameSite.toLowerCase() : a.sameSite;
73
- switch (c) {
74
- case !0:
75
- i += "; SameSite=Strict";
76
- break;
77
- case "lax":
78
- i += "; SameSite=Lax";
79
- break;
80
- case "strict":
81
- i += "; SameSite=Strict";
82
- break;
83
- case "none":
84
- i += "; SameSite=None";
85
- break;
86
- default:
87
- throw new TypeError("option sameSite is invalid");
88
- }
89
- }
90
- return i;
91
- }, F = {
92
- create: function(e, n, o, a) {
93
- var r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
94
- path: "/",
95
- sameSite: "strict"
96
- };
97
- o && (r.expires = /* @__PURE__ */ new Date(), r.expires.setTime(r.expires.getTime() + o * 60 * 1e3)), a && (r.domain = a), document.cookie = pe(e, encodeURIComponent(n), r);
98
- },
99
- read: function(e) {
100
- for (var n = "".concat(e, "="), o = document.cookie.split(";"), a = 0; a < o.length; a++) {
101
- for (var r = o[a]; r.charAt(0) === " "; ) r = r.substring(1, r.length);
102
- if (r.indexOf(n) === 0) return r.substring(n.length, r.length);
103
- }
104
- return null;
105
- },
106
- remove: function(e) {
107
- this.create(e, "", -1);
108
- }
109
- }, me = {
110
- name: "cookie",
111
- lookup: function(e) {
112
- var n;
113
- if (e.lookupCookie && typeof document < "u") {
114
- var o = F.read(e.lookupCookie);
115
- o && (n = o);
116
- }
117
- return n;
118
- },
119
- cacheUserLanguage: function(e, n) {
120
- n.lookupCookie && typeof document < "u" && F.create(n.lookupCookie, e, n.cookieMinutes, n.cookieDomain, n.cookieOptions);
121
- }
122
- }, he = {
123
- name: "querystring",
124
- lookup: function(e) {
125
- var n;
126
- if (typeof window < "u") {
127
- var o = window.location.search;
128
- !window.location.search && window.location.hash && window.location.hash.indexOf("?") > -1 && (o = window.location.hash.substring(window.location.hash.indexOf("?")));
129
- for (var a = o.substring(1), r = a.split("&"), i = 0; i < r.length; i++) {
130
- var u = r[i].indexOf("=");
131
- if (u > 0) {
132
- var c = r[i].substring(0, u);
133
- c === e.lookupQuerystring && (n = r[i].substring(u + 1));
134
- }
135
- }
136
- }
137
- return n;
138
- }
139
- }, I = null, H = function() {
140
- if (I !== null) return I;
141
- try {
142
- I = window !== "undefined" && window.localStorage !== null;
143
- var e = "i18next.translate.boo";
144
- window.localStorage.setItem(e, "foo"), window.localStorage.removeItem(e);
145
- } catch {
146
- I = !1;
147
- }
148
- return I;
149
- }, ve = {
150
- name: "localStorage",
151
- lookup: function(e) {
152
- var n;
153
- if (e.lookupLocalStorage && H()) {
154
- var o = window.localStorage.getItem(e.lookupLocalStorage);
155
- o && (n = o);
156
- }
157
- return n;
158
- },
159
- cacheUserLanguage: function(e, n) {
160
- n.lookupLocalStorage && H() && window.localStorage.setItem(n.lookupLocalStorage, e);
161
- }
162
- }, C = null, M = function() {
163
- if (C !== null) return C;
164
- try {
165
- C = window !== "undefined" && window.sessionStorage !== null;
166
- var e = "i18next.translate.boo";
167
- window.sessionStorage.setItem(e, "foo"), window.sessionStorage.removeItem(e);
168
- } catch {
169
- C = !1;
170
- }
171
- return C;
172
- }, we = {
173
- name: "sessionStorage",
174
- lookup: function(e) {
175
- var n;
176
- if (e.lookupSessionStorage && M()) {
177
- var o = window.sessionStorage.getItem(e.lookupSessionStorage);
178
- o && (n = o);
179
- }
180
- return n;
181
- },
182
- cacheUserLanguage: function(e, n) {
183
- n.lookupSessionStorage && M() && window.sessionStorage.setItem(n.lookupSessionStorage, e);
184
- }
185
- }, be = {
186
- name: "navigator",
187
- lookup: function(e) {
188
- var n = [];
189
- if (typeof navigator < "u") {
190
- if (navigator.languages)
191
- for (var o = 0; o < navigator.languages.length; o++)
192
- n.push(navigator.languages[o]);
193
- navigator.userLanguage && n.push(navigator.userLanguage), navigator.language && n.push(navigator.language);
194
- }
195
- return n.length > 0 ? n : void 0;
196
- }
197
- }, ye = {
198
- name: "htmlTag",
199
- lookup: function(e) {
200
- var n, o = e.htmlTag || (typeof document < "u" ? document.documentElement : null);
201
- return o && typeof o.getAttribute == "function" && (n = o.getAttribute("lang")), n;
202
- }
203
- }, ke = {
204
- name: "path",
205
- lookup: function(e) {
206
- var n;
207
- if (typeof window < "u") {
208
- var o = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
209
- if (o instanceof Array)
210
- if (typeof e.lookupFromPathIndex == "number") {
211
- if (typeof o[e.lookupFromPathIndex] != "string")
212
- return;
213
- n = o[e.lookupFromPathIndex].replace("/", "");
214
- } else
215
- n = o[0].replace("/", "");
216
- }
217
- return n;
218
- }
219
- }, Oe = {
220
- name: "subdomain",
221
- lookup: function(e) {
222
- var n = typeof e.lookupFromSubdomainIndex == "number" ? e.lookupFromSubdomainIndex + 1 : 1, o = typeof window < "u" && window.location && window.location.hostname && window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
223
- if (o)
224
- return o[n];
225
- }
226
- };
227
- function Se() {
228
- return {
229
- order: ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"],
230
- lookupQuerystring: "lng",
231
- lookupCookie: "i18next",
232
- lookupLocalStorage: "i18nextLng",
233
- lookupSessionStorage: "i18nextLng",
234
- // cache user language
235
- caches: ["localStorage"],
236
- excludeCacheFor: ["cimode"],
237
- // cookieMinutes: 10,
238
- // cookieDomain: 'myDomain'
239
- convertDetectedLanguage: function(e) {
240
- return e;
241
- }
242
- };
243
- }
244
- var G = /* @__PURE__ */ function() {
245
- function t(e) {
246
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
247
- J(this, t), this.type = "languageDetector", this.detectors = {}, this.init(e, n);
248
- }
249
- return q(t, [{
250
- key: "init",
251
- value: function(n) {
252
- var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
253
- this.services = n || {
254
- languageUtils: {}
255
- }, this.options = ge(o, this.options || {}, Se()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = function(r) {
256
- return r.replace("-", "_");
257
- }), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = a, this.addDetector(me), this.addDetector(he), this.addDetector(ve), this.addDetector(we), this.addDetector(be), this.addDetector(ye), this.addDetector(ke), this.addDetector(Oe);
258
- }
259
- }, {
260
- key: "addDetector",
261
- value: function(n) {
262
- return this.detectors[n.name] = n, this;
263
- }
264
- }, {
265
- key: "detect",
266
- value: function(n) {
267
- var o = this;
268
- n || (n = this.options.order);
269
- var a = [];
270
- return n.forEach(function(r) {
271
- if (o.detectors[r]) {
272
- var i = o.detectors[r].lookup(o.options);
273
- i && typeof i == "string" && (i = [i]), i && (a = a.concat(i));
274
- }
275
- }), a = a.map(function(r) {
276
- return o.options.convertDetectedLanguage(r);
277
- }), this.services.languageUtils.getBestMatchFromCodes ? a : a.length > 0 ? a[0] : null;
278
- }
279
- }, {
280
- key: "cacheUserLanguage",
281
- value: function(n, o) {
282
- var a = this;
283
- o || (o = this.options.caches), o && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(n) > -1 || o.forEach(function(r) {
284
- a.detectors[r] && a.detectors[r].cacheUserLanguage(n, a.options);
285
- }));
286
- }
287
- }]), t;
288
- }();
289
- G.type = "languageDetector";
290
- var Ie = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, Ce = {
291
- "&amp;": "&",
292
- "&#38;": "&",
293
- "&lt;": "<",
294
- "&#60;": "<",
295
- "&gt;": ">",
296
- "&#62;": ">",
297
- "&apos;": "'",
298
- "&#39;": "'",
299
- "&quot;": '"',
300
- "&#34;": '"',
301
- "&nbsp;": " ",
302
- "&#160;": " ",
303
- "&copy;": "©",
304
- "&#169;": "©",
305
- "&reg;": "®",
306
- "&#174;": "®",
307
- "&hellip;": "…",
308
- "&#8230;": "…",
309
- "&#x2F;": "/",
310
- "&#47;": "/"
311
- }, Le = function(e) {
312
- return Ce[e];
313
- }, De = function(e) {
314
- return e.replace(Ie, Le);
315
- };
316
- function z(t, e) {
317
- var n = Object.keys(t);
318
- if (Object.getOwnPropertySymbols) {
319
- var o = Object.getOwnPropertySymbols(t);
320
- e && (o = o.filter(function(a) {
321
- return Object.getOwnPropertyDescriptor(t, a).enumerable;
322
- })), n.push.apply(n, o);
323
- }
324
- return n;
325
- }
326
- function _(t) {
327
- for (var e = 1; e < arguments.length; e++) {
328
- var n = arguments[e] != null ? arguments[e] : {};
329
- e % 2 ? z(Object(n), !0).forEach(function(o) {
330
- Q(t, o, n[o]);
331
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : z(Object(n)).forEach(function(o) {
332
- Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(n, o));
333
- });
334
- }
335
- return t;
336
- }
337
- var E = {
338
- bindI18n: "languageChanged",
339
- bindI18nStore: "",
340
- transEmptyNodeValue: "",
341
- transSupportBasicHtmlNodes: !0,
342
- transWrapTextNodes: "",
343
- transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
344
- useSuspense: !0,
345
- unescape: De
346
- }, V, Te = m.createContext();
347
- function Pe() {
348
- var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
349
- E = _(_({}, E), t);
350
- }
351
- function Ne() {
352
- return E;
353
- }
354
- var xe = function() {
355
- function t() {
356
- J(this, t), this.usedNamespaces = {};
357
- }
358
- return q(t, [{
359
- key: "addUsedNamespaces",
360
- value: function(n) {
361
- var o = this;
362
- n.forEach(function(a) {
363
- o.usedNamespaces[a] || (o.usedNamespaces[a] = !0);
364
- });
365
- }
366
- }, {
367
- key: "getUsedNamespaces",
368
- value: function() {
369
- return Object.keys(this.usedNamespaces);
370
- }
371
- }]), t;
372
- }();
373
- function Ae(t) {
374
- V = t;
375
- }
376
- function Ee() {
377
- return V;
378
- }
379
- var Ue = {
380
- type: "3rdParty",
381
- init: function(e) {
382
- Pe(e.options.react), Ae(e);
383
- }
384
- };
385
- function je() {
386
- if (console && console.warn) {
387
- for (var t, e = arguments.length, n = new Array(e), o = 0; o < e; o++)
388
- n[o] = arguments[o];
389
- typeof n[0] == "string" && (n[0] = "react-i18next:: ".concat(n[0])), (t = console).warn.apply(t, n);
390
- }
391
- }
392
- var B = {};
393
- function U() {
394
- for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
395
- e[n] = arguments[n];
396
- typeof e[0] == "string" && B[e[0]] || (typeof e[0] == "string" && (B[e[0]] = /* @__PURE__ */ new Date()), je.apply(void 0, e));
397
- }
398
- function R(t, e, n) {
399
- t.loadNamespaces(e, function() {
400
- if (t.isInitialized)
401
- n();
402
- else {
403
- var o = function a() {
404
- setTimeout(function() {
405
- t.off("initialized", a);
406
- }, 0), n();
407
- };
408
- t.on("initialized", o);
409
- }
410
- });
411
- }
412
- function Fe(t, e) {
413
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = e.languages[0], a = e.options ? e.options.fallbackLng : !1, r = e.languages[e.languages.length - 1];
414
- if (o.toLowerCase() === "cimode") return !0;
415
- var i = function(c, g) {
416
- var p = e.services.backendConnector.state["".concat(c, "|").concat(g)];
417
- return p === -1 || p === 2;
418
- };
419
- return n.bindI18n && n.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !i(e.isLanguageChangingTo, t) ? !1 : !!(e.hasResourceBundle(o, t) || !e.services.backendConnector.backend || e.options.resources && !e.options.partialBundledLanguages || i(o, t) && (!a || i(r, t)));
420
- }
421
- function He(t, e) {
422
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
423
- if (!e.languages || !e.languages.length)
424
- return U("i18n.languages were undefined or empty", e.languages), !0;
425
- var o = e.options.ignoreJSONStructure !== void 0;
426
- return o ? e.hasLoadedNamespace(t, {
427
- precheck: function(r, i) {
428
- if (n.bindI18n && n.bindI18n.indexOf("languageChanging") > -1 && r.services.backendConnector.backend && r.isLanguageChangingTo && !i(r.isLanguageChangingTo, t)) return !1;
429
- }
430
- }) : Fe(t, e, n);
431
- }
432
- function Me(t, e) {
433
- var n = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
434
- if (n != null) {
435
- var o, a, r, i, u = [], c = !0, g = !1;
436
- try {
437
- if (r = (n = n.call(t)).next, e !== 0) for (; !(c = (o = r.call(n)).done) && (u.push(o.value), u.length !== e); c = !0) ;
438
- } catch (p) {
439
- g = !0, a = p;
440
- } finally {
441
- try {
442
- if (!c && n.return != null && (i = n.return(), Object(i) !== i)) return;
443
- } finally {
444
- if (g) throw a;
445
- }
446
- }
447
- return u;
448
- }
449
- }
450
- function ze(t, e) {
451
- return ae(t) || Me(t, e) || ie(t, e) || se();
452
- }
453
- function $(t, e) {
454
- var n = Object.keys(t);
455
- if (Object.getOwnPropertySymbols) {
456
- var o = Object.getOwnPropertySymbols(t);
457
- e && (o = o.filter(function(a) {
458
- return Object.getOwnPropertyDescriptor(t, a).enumerable;
459
- })), n.push.apply(n, o);
460
- }
461
- return n;
462
- }
463
- function A(t) {
464
- for (var e = 1; e < arguments.length; e++) {
465
- var n = arguments[e] != null ? arguments[e] : {};
466
- e % 2 ? $(Object(n), !0).forEach(function(o) {
467
- Q(t, o, n[o]);
468
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : $(Object(n)).forEach(function(o) {
469
- Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(n, o));
470
- });
471
- }
472
- return t;
473
- }
474
- var _e = function(e, n) {
475
- var o = m.useRef();
476
- return m.useEffect(function() {
477
- o.current = e;
478
- }, [e, n]), o.current;
479
- };
480
- function Be(t) {
481
- var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = e.i18n, o = m.useContext(Te) || {}, a = o.i18n, r = n || a || Ee();
482
- if (r && !r.reportNamespaces && (r.reportNamespaces = new xe()), !r) {
483
- U("You will need to pass in an i18next instance by using initReactI18next");
484
- var i = function(d) {
485
- return Array.isArray(d) ? d[d.length - 1] : d;
486
- }, u = [i, {}, !1];
487
- return u.t = i, u.i18n = {}, u.ready = !1, u;
488
- }
489
- r.options.react && r.options.react.wait !== void 0 && U("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
490
- var c = A(A(A({}, Ne()), r.options.react), e), g = c.useSuspense, p = c.keyPrefix, f = t;
491
- f = typeof f == "string" ? [f] : f || ["translation"], r.reportNamespaces.addUsedNamespaces && r.reportNamespaces.addUsedNamespaces(f);
492
- var h = (r.isInitialized || r.initializedStoreOnce) && f.every(function(l) {
493
- return He(l, r, c);
494
- });
495
- function w() {
496
- return r.getFixedT(null, c.nsMode === "fallback" ? f : f[0], p);
497
- }
498
- var x = m.useState(w), L = ze(x, 2), D = L[0], y = L[1], O = f.join(), T = _e(O), v = m.useRef(!0);
499
- m.useEffect(function() {
500
- var l = c.bindI18n, d = c.bindI18nStore;
501
- v.current = !0, !h && !g && R(r, f, function() {
502
- v.current && y(w);
503
- }), h && T && T !== O && v.current && y(w);
504
- function k() {
505
- v.current && y(w);
506
- }
507
- return l && r && r.on(l, k), d && r && r.store.on(d, k), function() {
508
- v.current = !1, l && r && l.split(" ").forEach(function(S) {
509
- return r.off(S, k);
510
- }), d && r && d.split(" ").forEach(function(S) {
511
- return r.store.off(S, k);
512
- });
513
- };
514
- }, [r, O]);
515
- var P = m.useRef(!0);
516
- m.useEffect(function() {
517
- v.current && !P.current && y(w), P.current = !1;
518
- }, [r, p]);
519
- var b = [D, r, h];
520
- if (b.t = D, b.i18n = r, b.ready = h, h || !h && !g) return b;
521
- throw new Promise(function(l) {
522
- R(r, f, function() {
523
- l();
524
- });
525
- });
526
- }
527
- const Re = {
528
- debug: !1,
529
- fallbackLng: ue.enum.en,
530
- resources: ce
531
- }, $e = {
532
- react: {
533
- useSuspense: !0
534
- },
535
- detection: {
536
- order: ["navigator", "htmlTag", "path", "subdomain"],
537
- caches: ["localStorage", "cookie"]
538
- }
539
- };
540
- W.use(G).use(Ue).init({ ...Re, ...$e });
541
- function Ve(t) {
542
- return Be("translation", { i18n: W, ...t });
543
- }
544
- export {
545
- Qe as a,
546
- Ke as b,
547
- Ge as c,
548
- We as s,
549
- Ve as u
550
- };