@ukpc-lib/react 0.13.1-dev.25 → 0.13.1-dev.27

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 (26) hide show
  1. package/dist/components/StyledDateRangePicker/index.d.ts +0 -1
  2. package/dist/components/index.cjs +2 -2
  3. package/dist/components/index.js +584 -586
  4. package/dist/{index.esm2017-DiJ5f9ER.js → index.esm2017-hAdqPAqn.js} +5550 -5539
  5. package/dist/{index.esm2017-BRdyW06b.cjs → index.esm2017-xBWZcO2U.cjs} +94 -94
  6. package/dist/share/index.cjs +1 -1
  7. package/dist/share/index.js +12 -12
  8. package/package.json +1 -1
  9. package/web-components-bundle/{SaasThemeProvider-8W2MaSUF.js → SaasThemeProvider-A_eMJWqw.js} +9 -9
  10. package/web-components-bundle/access-denied/index.js +2 -3
  11. package/web-components-bundle/base-breadcrumbs/index.js +3 -3
  12. package/web-components-bundle/favorite-menu/index.js +7 -7
  13. package/web-components-bundle/global-menu/index.js +6 -6
  14. package/web-components-bundle/global-topbar/index.js +7 -7
  15. package/web-components-bundle/has-permission/index.js +2 -2
  16. package/web-components-bundle/{index-CHcaOev7.js → index-CE4KNS10.js} +946 -946
  17. package/web-components-bundle/{index-Bu7DHdEJ.js → index-DFUmn1bB.js} +18 -20
  18. package/web-components-bundle/index-DQQeBZzF.js +3527 -0
  19. package/web-components-bundle/{index-CDpevgH4.js → index-fssXU5ga.js} +7265 -7253
  20. package/web-components-bundle/page-not-found/index.js +4 -5
  21. package/web-components-bundle/{react-to-web-component-CXwKHjZr.js → react-to-web-component-BOygDorD.js} +1535 -1527
  22. package/web-components-bundle/{react-toastify.esm-CrTD7cpE.js → react-toastify.esm-DnABvuky.js} +21 -21
  23. package/web-components-bundle/toast-config/index.js +2 -2
  24. package/web-components-bundle/toast-config-notification/index.js +2 -2
  25. package/web-components-bundle/index-Bk42Mf7H.js +0 -3206
  26. package/web-components-bundle/useTranslation-Xt9Mgi4Q.js +0 -337
@@ -1,3206 +0,0 @@
1
- import { r as Ue, c as ue, g as _t, s as Et, j as L } from "./react-to-web-component-CXwKHjZr.js";
2
- import { _ as Y, a as Ct, b as Nt, c as At, d as T, e as G, f as I, s as Dt, g as Tt, I as It, u as Ft } from "./useTranslation-Xt9Mgi4Q.js";
3
- import { a as Ut, _ as J } from "./setPrototypeOf-CP0c5ut2.js";
4
- function Bt(a, r) {
5
- for (var n = 0; n < r.length; n++) {
6
- const t = r[n];
7
- if (typeof t != "string" && !Array.isArray(t)) {
8
- for (const e in t)
9
- if (e !== "default" && !(e in a)) {
10
- const i = Object.getOwnPropertyDescriptor(t, e);
11
- i && Object.defineProperty(a, e, i.get ? i : {
12
- enumerable: !0,
13
- get: () => t[e]
14
- });
15
- }
16
- }
17
- }
18
- return Object.freeze(Object.defineProperty(a, Symbol.toStringTag, { value: "Module" }));
19
- }
20
- function Oe(a, r) {
21
- if (typeof r != "function" && r !== null)
22
- throw new TypeError("Super expression must either be null or a function");
23
- a.prototype = Object.create(r && r.prototype, {
24
- constructor: {
25
- value: a,
26
- writable: !0,
27
- configurable: !0
28
- }
29
- }), Object.defineProperty(a, "prototype", {
30
- writable: !1
31
- }), r && Ut(a, r);
32
- }
33
- function ce(a, r) {
34
- if (r && (Y(r) == "object" || typeof r == "function"))
35
- return r;
36
- if (r !== void 0)
37
- throw new TypeError("Derived constructors may only return object or undefined");
38
- return J(a);
39
- }
40
- function q(a) {
41
- return q = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(r) {
42
- return r.__proto__ || Object.getPrototypeOf(r);
43
- }, q(a);
44
- }
45
- function Ht(a) {
46
- if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null)
47
- return Array.from(a);
48
- }
49
- function Mt(a) {
50
- return Ct(a) || Ht(a) || Nt(a) || At();
51
- }
52
- function Be(a, r) {
53
- var n = Object.keys(a);
54
- if (Object.getOwnPropertySymbols) {
55
- var t = Object.getOwnPropertySymbols(a);
56
- r && (t = t.filter(function(e) {
57
- return Object.getOwnPropertyDescriptor(a, e).enumerable;
58
- })), n.push.apply(n, t);
59
- }
60
- return n;
61
- }
62
- function He(a) {
63
- for (var r = 1; r < arguments.length; r++) {
64
- var n = arguments[r] != null ? arguments[r] : {};
65
- r % 2 ? Be(Object(n), !0).forEach(function(t) {
66
- G(a, t, n[t]);
67
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(n)) : Be(Object(n)).forEach(function(t) {
68
- Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(n, t));
69
- });
70
- }
71
- return a;
72
- }
73
- var $t = {
74
- type: "logger",
75
- log: function(r) {
76
- this.output("log", r);
77
- },
78
- warn: function(r) {
79
- this.output("warn", r);
80
- },
81
- error: function(r) {
82
- this.output("error", r);
83
- },
84
- output: function(r, n) {
85
- console && console[r] && console[r].apply(console, n);
86
- }
87
- }, qt = function() {
88
- function a(r) {
89
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
90
- I(this, a), this.init(r, n);
91
- }
92
- return T(a, [{
93
- key: "init",
94
- value: function(n) {
95
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
96
- this.prefix = t.prefix || "i18next:", this.logger = n || $t, this.options = t, this.debug = t.debug;
97
- }
98
- }, {
99
- key: "setDebug",
100
- value: function(n) {
101
- this.debug = n;
102
- }
103
- }, {
104
- key: "log",
105
- value: function() {
106
- for (var n = arguments.length, t = new Array(n), e = 0; e < n; e++)
107
- t[e] = arguments[e];
108
- return this.forward(t, "log", "", !0);
109
- }
110
- }, {
111
- key: "warn",
112
- value: function() {
113
- for (var n = arguments.length, t = new Array(n), e = 0; e < n; e++)
114
- t[e] = arguments[e];
115
- return this.forward(t, "warn", "", !0);
116
- }
117
- }, {
118
- key: "error",
119
- value: function() {
120
- for (var n = arguments.length, t = new Array(n), e = 0; e < n; e++)
121
- t[e] = arguments[e];
122
- return this.forward(t, "error", "");
123
- }
124
- }, {
125
- key: "deprecate",
126
- value: function() {
127
- for (var n = arguments.length, t = new Array(n), e = 0; e < n; e++)
128
- t[e] = arguments[e];
129
- return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
130
- }
131
- }, {
132
- key: "forward",
133
- value: function(n, t, e, i) {
134
- return i && !this.debug ? null : (typeof n[0] == "string" && (n[0] = "".concat(e).concat(this.prefix, " ").concat(n[0])), this.logger[t](n));
135
- }
136
- }, {
137
- key: "create",
138
- value: function(n) {
139
- return new a(this.logger, He(He({}, {
140
- prefix: "".concat(this.prefix, ":").concat(n, ":")
141
- }), this.options));
142
- }
143
- }, {
144
- key: "clone",
145
- value: function(n) {
146
- return n = n || this.options, n.prefix = n.prefix || this.prefix, new a(this.logger, n);
147
- }
148
- }]), a;
149
- }(), $ = new qt(), X = function() {
150
- function a() {
151
- I(this, a), this.observers = {};
152
- }
153
- return T(a, [{
154
- key: "on",
155
- value: function(n, t) {
156
- var e = this;
157
- return n.split(" ").forEach(function(i) {
158
- e.observers[i] = e.observers[i] || [], e.observers[i].push(t);
159
- }), this;
160
- }
161
- }, {
162
- key: "off",
163
- value: function(n, t) {
164
- if (this.observers[n]) {
165
- if (!t) {
166
- delete this.observers[n];
167
- return;
168
- }
169
- this.observers[n] = this.observers[n].filter(function(e) {
170
- return e !== t;
171
- });
172
- }
173
- }
174
- }, {
175
- key: "emit",
176
- value: function(n) {
177
- for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
178
- e[i - 1] = arguments[i];
179
- if (this.observers[n]) {
180
- var o = [].concat(this.observers[n]);
181
- o.forEach(function(u) {
182
- u.apply(void 0, e);
183
- });
184
- }
185
- if (this.observers["*"]) {
186
- var s = [].concat(this.observers["*"]);
187
- s.forEach(function(u) {
188
- u.apply(u, [n].concat(e));
189
- });
190
- }
191
- }
192
- }]), a;
193
- }();
194
- function ae() {
195
- var a, r, n = new Promise(function(t, e) {
196
- a = t, r = e;
197
- });
198
- return n.resolve = a, n.reject = r, n;
199
- }
200
- function Me(a) {
201
- return a == null ? "" : "" + a;
202
- }
203
- function Kt(a, r, n) {
204
- a.forEach(function(t) {
205
- r[t] && (n[t] = r[t]);
206
- });
207
- }
208
- function Ae(a, r, n) {
209
- function t(s) {
210
- return s && s.indexOf("###") > -1 ? s.replace(/###/g, ".") : s;
211
- }
212
- function e() {
213
- return !a || typeof a == "string";
214
- }
215
- for (var i = typeof r != "string" ? [].concat(r) : r.split("."); i.length > 1; ) {
216
- if (e())
217
- return {};
218
- var o = t(i.shift());
219
- !a[o] && n && (a[o] = new n()), Object.prototype.hasOwnProperty.call(a, o) ? a = a[o] : a = {};
220
- }
221
- return e() ? {} : {
222
- obj: a,
223
- k: t(i.shift())
224
- };
225
- }
226
- function $e(a, r, n) {
227
- var t = Ae(a, r, Object), e = t.obj, i = t.k;
228
- e[i] = n;
229
- }
230
- function Vt(a, r, n, t) {
231
- var e = Ae(a, r, Object), i = e.obj, o = e.k;
232
- i[o] = i[o] || [], i[o].push(n);
233
- }
234
- function me(a, r) {
235
- var n = Ae(a, r), t = n.obj, e = n.k;
236
- if (t)
237
- return t[e];
238
- }
239
- function zt(a, r, n) {
240
- var t = me(a, n);
241
- return t !== void 0 ? t : me(r, n);
242
- }
243
- function gt(a, r, n) {
244
- for (var t in r)
245
- t !== "__proto__" && t !== "constructor" && (t in a ? typeof a[t] == "string" || a[t] instanceof String || typeof r[t] == "string" || r[t] instanceof String ? n && (a[t] = r[t]) : gt(a[t], r[t], n) : a[t] = r[t]);
246
- return a;
247
- }
248
- function te(a) {
249
- return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
250
- }
251
- var Jt = {
252
- "&": "&amp;",
253
- "<": "&lt;",
254
- ">": "&gt;",
255
- '"': "&quot;",
256
- "'": "&#39;",
257
- "/": "&#x2F;"
258
- };
259
- function Xt(a) {
260
- return typeof a == "string" ? a.replace(/[&<>"'\/]/g, function(r) {
261
- return Jt[r];
262
- }) : a;
263
- }
264
- var Se = typeof window < "u" && window.navigator && typeof window.navigator.userAgentData > "u" && window.navigator.userAgent && window.navigator.userAgent.indexOf("MSIE") > -1, Wt = [" ", ",", "?", "!", ";"];
265
- function Gt(a, r, n) {
266
- r = r || "", n = n || "";
267
- var t = Wt.filter(function(s) {
268
- return r.indexOf(s) < 0 && n.indexOf(s) < 0;
269
- });
270
- if (t.length === 0)
271
- return !0;
272
- var e = new RegExp("(".concat(t.map(function(s) {
273
- return s === "?" ? "\\?" : s;
274
- }).join("|"), ")")), i = !e.test(a);
275
- if (!i) {
276
- var o = a.indexOf(n);
277
- o > 0 && !e.test(a.substring(0, o)) && (i = !0);
278
- }
279
- return i;
280
- }
281
- function ye(a, r) {
282
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
283
- if (a) {
284
- if (a[r])
285
- return a[r];
286
- for (var t = r.split(n), e = a, i = 0; i < t.length; ++i) {
287
- if (!e || typeof e[t[i]] == "string" && i + 1 < t.length)
288
- return;
289
- if (e[t[i]] === void 0) {
290
- for (var o = 2, s = t.slice(i, i + o).join(n), u = e[s]; u === void 0 && t.length > i + o; )
291
- o++, s = t.slice(i, i + o).join(n), u = e[s];
292
- if (u === void 0)
293
- return;
294
- if (u === null)
295
- return null;
296
- if (r.endsWith(s)) {
297
- if (typeof u == "string")
298
- return u;
299
- if (s && typeof u[s] == "string")
300
- return u[s];
301
- }
302
- var d = t.slice(i + o).join(n);
303
- return d ? ye(u, d, n) : void 0;
304
- }
305
- e = e[t[i]];
306
- }
307
- return e;
308
- }
309
- }
310
- function qe(a, r) {
311
- var n = Object.keys(a);
312
- if (Object.getOwnPropertySymbols) {
313
- var t = Object.getOwnPropertySymbols(a);
314
- r && (t = t.filter(function(e) {
315
- return Object.getOwnPropertyDescriptor(a, e).enumerable;
316
- })), n.push.apply(n, t);
317
- }
318
- return n;
319
- }
320
- function he(a) {
321
- for (var r = 1; r < arguments.length; r++) {
322
- var n = arguments[r] != null ? arguments[r] : {};
323
- r % 2 ? qe(Object(n), !0).forEach(function(t) {
324
- G(a, t, n[t]);
325
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(n)) : qe(Object(n)).forEach(function(t) {
326
- Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(n, t));
327
- });
328
- }
329
- return a;
330
- }
331
- function Qt(a) {
332
- var r = Yt();
333
- return function() {
334
- var t = q(a), e;
335
- if (r) {
336
- var i = q(this).constructor;
337
- e = Reflect.construct(t, arguments, i);
338
- } else
339
- e = t.apply(this, arguments);
340
- return ce(this, e);
341
- };
342
- }
343
- function Yt() {
344
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
345
- return !1;
346
- if (typeof Proxy == "function")
347
- return !0;
348
- try {
349
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
350
- })), !0;
351
- } catch {
352
- return !1;
353
- }
354
- }
355
- var Zt = function(a) {
356
- Oe(n, a);
357
- var r = Qt(n);
358
- function n(t) {
359
- var e, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
360
- ns: ["translation"],
361
- defaultNS: "translation"
362
- };
363
- return I(this, n), e = r.call(this), Se && X.call(J(e)), e.data = t || {}, e.options = i, e.options.keySeparator === void 0 && (e.options.keySeparator = "."), e.options.ignoreJSONStructure === void 0 && (e.options.ignoreJSONStructure = !0), e;
364
- }
365
- return T(n, [{
366
- key: "addNamespaces",
367
- value: function(e) {
368
- this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
369
- }
370
- }, {
371
- key: "removeNamespaces",
372
- value: function(e) {
373
- var i = this.options.ns.indexOf(e);
374
- i > -1 && this.options.ns.splice(i, 1);
375
- }
376
- }, {
377
- key: "getResource",
378
- value: function(e, i, o) {
379
- var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, u = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, d = s.ignoreJSONStructure !== void 0 ? s.ignoreJSONStructure : this.options.ignoreJSONStructure, c = [e, i];
380
- o && typeof o != "string" && (c = c.concat(o)), o && typeof o == "string" && (c = c.concat(u ? o.split(u) : o)), e.indexOf(".") > -1 && (c = e.split("."));
381
- var f = me(this.data, c);
382
- return f || !d || typeof o != "string" ? f : ye(this.data && this.data[e] && this.data[e][i], o, u);
383
- }
384
- }, {
385
- key: "addResource",
386
- value: function(e, i, o, s) {
387
- var u = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
388
- silent: !1
389
- }, d = u.keySeparator !== void 0 ? u.keySeparator : this.options.keySeparator, c = [e, i];
390
- o && (c = c.concat(d ? o.split(d) : o)), e.indexOf(".") > -1 && (c = e.split("."), s = i, i = c[1]), this.addNamespaces(i), $e(this.data, c, s), u.silent || this.emit("added", e, i, o, s);
391
- }
392
- }, {
393
- key: "addResources",
394
- value: function(e, i, o) {
395
- var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
396
- silent: !1
397
- };
398
- for (var u in o)
399
- (typeof o[u] == "string" || Object.prototype.toString.apply(o[u]) === "[object Array]") && this.addResource(e, i, u, o[u], {
400
- silent: !0
401
- });
402
- s.silent || this.emit("added", e, i, o);
403
- }
404
- }, {
405
- key: "addResourceBundle",
406
- value: function(e, i, o, s, u) {
407
- var d = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
408
- silent: !1
409
- }, c = [e, i];
410
- e.indexOf(".") > -1 && (c = e.split("."), s = o, o = i, i = c[1]), this.addNamespaces(i);
411
- var f = me(this.data, c) || {};
412
- s ? gt(f, o, u) : f = he(he({}, f), o), $e(this.data, c, f), d.silent || this.emit("added", e, i, o);
413
- }
414
- }, {
415
- key: "removeResourceBundle",
416
- value: function(e, i) {
417
- this.hasResourceBundle(e, i) && delete this.data[e][i], this.removeNamespaces(i), this.emit("removed", e, i);
418
- }
419
- }, {
420
- key: "hasResourceBundle",
421
- value: function(e, i) {
422
- return this.getResource(e, i) !== void 0;
423
- }
424
- }, {
425
- key: "getResourceBundle",
426
- value: function(e, i) {
427
- return i || (i = this.options.defaultNS), this.options.compatibilityAPI === "v1" ? he(he({}, {}), this.getResource(e, i)) : this.getResource(e, i);
428
- }
429
- }, {
430
- key: "getDataByLanguage",
431
- value: function(e) {
432
- return this.data[e];
433
- }
434
- }, {
435
- key: "hasLanguageSomeTranslations",
436
- value: function(e) {
437
- var i = this.getDataByLanguage(e), o = i && Object.keys(i) || [];
438
- return !!o.find(function(s) {
439
- return i[s] && Object.keys(i[s]).length > 0;
440
- });
441
- }
442
- }, {
443
- key: "toJSON",
444
- value: function() {
445
- return this.data;
446
- }
447
- }]), n;
448
- }(X), vt = {
449
- processors: {},
450
- addPostProcessor: function(r) {
451
- this.processors[r.name] = r;
452
- },
453
- handle: function(r, n, t, e, i) {
454
- var o = this;
455
- return r.forEach(function(s) {
456
- o.processors[s] && (n = o.processors[s].process(n, t, e, i));
457
- }), n;
458
- }
459
- };
460
- function Ke(a, r) {
461
- var n = Object.keys(a);
462
- if (Object.getOwnPropertySymbols) {
463
- var t = Object.getOwnPropertySymbols(a);
464
- r && (t = t.filter(function(e) {
465
- return Object.getOwnPropertyDescriptor(a, e).enumerable;
466
- })), n.push.apply(n, t);
467
- }
468
- return n;
469
- }
470
- function C(a) {
471
- for (var r = 1; r < arguments.length; r++) {
472
- var n = arguments[r] != null ? arguments[r] : {};
473
- r % 2 ? Ke(Object(n), !0).forEach(function(t) {
474
- G(a, t, n[t]);
475
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(n)) : Ke(Object(n)).forEach(function(t) {
476
- Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(n, t));
477
- });
478
- }
479
- return a;
480
- }
481
- function en(a) {
482
- var r = tn();
483
- return function() {
484
- var t = q(a), e;
485
- if (r) {
486
- var i = q(this).constructor;
487
- e = Reflect.construct(t, arguments, i);
488
- } else
489
- e = t.apply(this, arguments);
490
- return ce(this, e);
491
- };
492
- }
493
- function tn() {
494
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
495
- return !1;
496
- if (typeof Proxy == "function")
497
- return !0;
498
- try {
499
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
500
- })), !0;
501
- } catch {
502
- return !1;
503
- }
504
- }
505
- var Ve = {}, ze = function(a) {
506
- Oe(n, a);
507
- var r = en(n);
508
- function n(t) {
509
- var e, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
510
- return I(this, n), e = r.call(this), Se && X.call(J(e)), Kt(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], t, J(e)), e.options = i, e.options.keySeparator === void 0 && (e.options.keySeparator = "."), e.logger = $.create("translator"), e;
511
- }
512
- return T(n, [{
513
- key: "changeLanguage",
514
- value: function(e) {
515
- e && (this.language = e);
516
- }
517
- }, {
518
- key: "exists",
519
- value: function(e) {
520
- var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
521
- interpolation: {}
522
- };
523
- if (e == null)
524
- return !1;
525
- var o = this.resolve(e, i);
526
- return o && o.res !== void 0;
527
- }
528
- }, {
529
- key: "extractFromKey",
530
- value: function(e, i) {
531
- var o = i.nsSeparator !== void 0 ? i.nsSeparator : this.options.nsSeparator;
532
- o === void 0 && (o = ":");
533
- var s = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, u = i.ns || this.options.defaultNS || [], d = o && e.indexOf(o) > -1, c = !this.options.userDefinedKeySeparator && !i.keySeparator && !this.options.userDefinedNsSeparator && !i.nsSeparator && !Gt(e, o, s);
534
- if (d && !c) {
535
- var f = e.match(this.interpolator.nestingRegexp);
536
- if (f && f.length > 0)
537
- return {
538
- key: e,
539
- namespaces: u
540
- };
541
- var h = e.split(o);
542
- (o !== s || o === s && this.options.ns.indexOf(h[0]) > -1) && (u = h.shift()), e = h.join(s);
543
- }
544
- return typeof u == "string" && (u = [u]), {
545
- key: e,
546
- namespaces: u
547
- };
548
- }
549
- }, {
550
- key: "translate",
551
- value: function(e, i, o) {
552
- var s = this;
553
- if (Y(i) !== "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), Y(i) === "object" && (i = C({}, i)), i || (i = {}), e == null)
554
- return "";
555
- Array.isArray(e) || (e = [String(e)]);
556
- var u = i.returnDetails !== void 0 ? i.returnDetails : this.options.returnDetails, d = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, c = this.extractFromKey(e[e.length - 1], i), f = c.key, h = c.namespaces, p = h[h.length - 1], b = i.lng || this.language, m = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
557
- if (b && b.toLowerCase() === "cimode") {
558
- if (m) {
559
- var w = i.nsSeparator || this.options.nsSeparator;
560
- return u ? {
561
- res: "".concat(p).concat(w).concat(f),
562
- usedKey: f,
563
- exactUsedKey: f,
564
- usedLng: b,
565
- usedNS: p
566
- } : "".concat(p).concat(w).concat(f);
567
- }
568
- return u ? {
569
- res: f,
570
- usedKey: f,
571
- exactUsedKey: f,
572
- usedLng: b,
573
- usedNS: p
574
- } : f;
575
- }
576
- var v = this.resolve(e, i), y = v && v.res, S = v && v.usedKey || f, x = v && v.exactUsedKey || f, R = Object.prototype.toString.apply(y), D = ["[object Number]", "[object Function]", "[object RegExp]"], K = i.joinArrays !== void 0 ? i.joinArrays : this.options.joinArrays, Q = !this.i18nFormat || this.i18nFormat.handleAsObject, N = typeof y != "string" && typeof y != "boolean" && typeof y != "number";
577
- if (Q && y && N && D.indexOf(R) < 0 && !(typeof K == "string" && R === "[object Array]")) {
578
- if (!i.returnObjects && !this.options.returnObjects) {
579
- this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
580
- var z = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(S, y, C(C({}, i), {}, {
581
- ns: h
582
- })) : "key '".concat(f, " (").concat(this.language, ")' returned an object instead of string.");
583
- return u ? (v.res = z, v) : z;
584
- }
585
- if (d) {
586
- var le = R === "[object Array]", E = le ? [] : {}, xe = le ? x : S;
587
- for (var U in y)
588
- if (Object.prototype.hasOwnProperty.call(y, U)) {
589
- var l = "".concat(xe).concat(d).concat(U);
590
- E[U] = this.translate(l, C(C({}, i), {
591
- joinArrays: !1,
592
- ns: h
593
- })), E[U] === l && (E[U] = y[U]);
594
- }
595
- y = E;
596
- }
597
- } else if (Q && typeof K == "string" && R === "[object Array]")
598
- y = y.join(K), y && (y = this.extendTranslation(y, e, i, o));
599
- else {
600
- var g = !1, O = !1, k = i.count !== void 0 && typeof i.count != "string", j = n.hasDefaultValue(i), P = k ? this.pluralResolver.getSuffix(b, i.count, i) : "", B = i["defaultValue".concat(P)] || i.defaultValue;
601
- !this.isValidLookup(y) && j && (g = !0, y = B), this.isValidLookup(y) || (O = !0, y = f);
602
- var Pe = i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey, A = Pe && O ? void 0 : y, H = j && B !== y && this.options.updateMissing;
603
- if (O || g || H) {
604
- if (this.logger.log(H ? "updateKey" : "missingKey", b, p, f, H ? B : y), d) {
605
- var De = this.resolve(f, C(C({}, i), {}, {
606
- keySeparator: !1
607
- }));
608
- De && De.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
609
- }
610
- var ie = [], de = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
611
- if (this.options.saveMissingTo === "fallback" && de && de[0])
612
- for (var ke = 0; ke < de.length; ke++)
613
- ie.push(de[ke]);
614
- else
615
- this.options.saveMissingTo === "all" ? ie = this.languageUtils.toResolveHierarchy(i.lng || this.language) : ie.push(i.lng || this.language);
616
- var Te = function(ee, Le, Ie) {
617
- var Fe = j && Ie !== y ? Ie : A;
618
- s.options.missingKeyHandler ? s.options.missingKeyHandler(ee, p, Le, Fe, H, i) : s.backendConnector && s.backendConnector.saveMissing && s.backendConnector.saveMissing(ee, p, Le, Fe, H, i), s.emit("missingKey", ee, p, Le, y);
619
- };
620
- this.options.saveMissing && (this.options.saveMissingPlurals && k ? ie.forEach(function(je) {
621
- s.pluralResolver.getSuffixes(je, i).forEach(function(ee) {
622
- Te([je], f + ee, i["defaultValue".concat(ee)] || B);
623
- });
624
- }) : Te(ie, f, B));
625
- }
626
- y = this.extendTranslation(y, e, i, v, o), O && y === f && this.options.appendNamespaceToMissingKey && (y = "".concat(p, ":").concat(f)), (O || g) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? y = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? "".concat(p, ":").concat(f) : f, g ? y : void 0) : y = this.options.parseMissingKeyHandler(y));
627
- }
628
- return u ? (v.res = y, v) : y;
629
- }
630
- }, {
631
- key: "extendTranslation",
632
- value: function(e, i, o, s, u) {
633
- var d = this;
634
- if (this.i18nFormat && this.i18nFormat.parse)
635
- e = this.i18nFormat.parse(e, C(C({}, this.options.interpolation.defaultVariables), o), s.usedLng, s.usedNS, s.usedKey, {
636
- resolved: s
637
- });
638
- else if (!o.skipInterpolation) {
639
- o.interpolation && this.interpolator.init(C(C({}, o), {
640
- interpolation: C(C({}, this.options.interpolation), o.interpolation)
641
- }));
642
- var c = typeof e == "string" && (o && o.interpolation && o.interpolation.skipOnVariables !== void 0 ? o.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables), f;
643
- if (c) {
644
- var h = e.match(this.interpolator.nestingRegexp);
645
- f = h && h.length;
646
- }
647
- var p = o.replace && typeof o.replace != "string" ? o.replace : o;
648
- if (this.options.interpolation.defaultVariables && (p = C(C({}, this.options.interpolation.defaultVariables), p)), e = this.interpolator.interpolate(e, p, o.lng || this.language, o), c) {
649
- var b = e.match(this.interpolator.nestingRegexp), m = b && b.length;
650
- f < m && (o.nest = !1);
651
- }
652
- !o.lng && this.options.compatibilityAPI !== "v1" && s && s.res && (o.lng = s.usedLng), o.nest !== !1 && (e = this.interpolator.nest(e, function() {
653
- for (var y = arguments.length, S = new Array(y), x = 0; x < y; x++)
654
- S[x] = arguments[x];
655
- return u && u[0] === S[0] && !o.context ? (d.logger.warn("It seems you are nesting recursively key: ".concat(S[0], " in key: ").concat(i[0])), null) : d.translate.apply(d, S.concat([i]));
656
- }, o)), o.interpolation && this.interpolator.reset();
657
- }
658
- var w = o.postProcess || this.options.postProcess, v = typeof w == "string" ? [w] : w;
659
- return e != null && v && v.length && o.applyPostProcessor !== !1 && (e = vt.handle(v, e, i, this.options && this.options.postProcessPassResolved ? C({
660
- i18nResolved: s
661
- }, o) : o, this)), e;
662
- }
663
- }, {
664
- key: "resolve",
665
- value: function(e) {
666
- var i = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, u, d, c, f;
667
- return typeof e == "string" && (e = [e]), e.forEach(function(h) {
668
- if (!i.isValidLookup(s)) {
669
- var p = i.extractFromKey(h, o), b = p.key;
670
- u = b;
671
- var m = p.namespaces;
672
- i.options.fallbackNS && (m = m.concat(i.options.fallbackNS));
673
- var w = o.count !== void 0 && typeof o.count != "string", v = w && !o.ordinal && o.count === 0 && i.pluralResolver.shouldUseIntlApi(), y = o.context !== void 0 && (typeof o.context == "string" || typeof o.context == "number") && o.context !== "", S = o.lngs ? o.lngs : i.languageUtils.toResolveHierarchy(o.lng || i.language, o.fallbackLng);
674
- m.forEach(function(x) {
675
- i.isValidLookup(s) || (f = x, !Ve["".concat(S[0], "-").concat(x)] && i.utils && i.utils.hasLoadedNamespace && !i.utils.hasLoadedNamespace(f) && (Ve["".concat(S[0], "-").concat(x)] = !0, i.logger.warn('key "'.concat(u, '" for languages "').concat(S.join(", "), `" won't get resolved as namespace "`).concat(f, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), S.forEach(function(R) {
676
- if (!i.isValidLookup(s)) {
677
- c = R;
678
- var D = [b];
679
- if (i.i18nFormat && i.i18nFormat.addLookupKeys)
680
- i.i18nFormat.addLookupKeys(D, b, R, x, o);
681
- else {
682
- var K;
683
- w && (K = i.pluralResolver.getSuffix(R, o.count, o));
684
- var Q = "".concat(i.options.pluralSeparator, "zero");
685
- if (w && (D.push(b + K), v && D.push(b + Q)), y) {
686
- var N = "".concat(b).concat(i.options.contextSeparator).concat(o.context);
687
- D.push(N), w && (D.push(N + K), v && D.push(N + Q));
688
- }
689
- }
690
- for (var z; z = D.pop(); )
691
- i.isValidLookup(s) || (d = z, s = i.getResource(R, x, z, o));
692
- }
693
- }));
694
- });
695
- }
696
- }), {
697
- res: s,
698
- usedKey: u,
699
- exactUsedKey: d,
700
- usedLng: c,
701
- usedNS: f
702
- };
703
- }
704
- }, {
705
- key: "isValidLookup",
706
- value: function(e) {
707
- return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
708
- }
709
- }, {
710
- key: "getResource",
711
- value: function(e, i, o) {
712
- var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
713
- return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(e, i, o, s) : this.resourceStore.getResource(e, i, o, s);
714
- }
715
- }], [{
716
- key: "hasDefaultValue",
717
- value: function(e) {
718
- var i = "defaultValue";
719
- for (var o in e)
720
- if (Object.prototype.hasOwnProperty.call(e, o) && i === o.substring(0, i.length) && e[o] !== void 0)
721
- return !0;
722
- return !1;
723
- }
724
- }]), n;
725
- }(X);
726
- function Re(a) {
727
- return a.charAt(0).toUpperCase() + a.slice(1);
728
- }
729
- var Je = function() {
730
- function a(r) {
731
- I(this, a), this.options = r, this.supportedLngs = this.options.supportedLngs || !1, this.logger = $.create("languageUtils");
732
- }
733
- return T(a, [{
734
- key: "getScriptPartFromCode",
735
- value: function(n) {
736
- if (!n || n.indexOf("-") < 0)
737
- return null;
738
- var t = n.split("-");
739
- return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
740
- }
741
- }, {
742
- key: "getLanguagePartFromCode",
743
- value: function(n) {
744
- if (!n || n.indexOf("-") < 0)
745
- return n;
746
- var t = n.split("-");
747
- return this.formatLanguageCode(t[0]);
748
- }
749
- }, {
750
- key: "formatLanguageCode",
751
- value: function(n) {
752
- if (typeof n == "string" && n.indexOf("-") > -1) {
753
- var t = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"], e = n.split("-");
754
- return this.options.lowerCaseLng ? e = e.map(function(i) {
755
- return i.toLowerCase();
756
- }) : e.length === 2 ? (e[0] = e[0].toLowerCase(), e[1] = e[1].toUpperCase(), t.indexOf(e[1].toLowerCase()) > -1 && (e[1] = Re(e[1].toLowerCase()))) : e.length === 3 && (e[0] = e[0].toLowerCase(), e[1].length === 2 && (e[1] = e[1].toUpperCase()), e[0] !== "sgn" && e[2].length === 2 && (e[2] = e[2].toUpperCase()), t.indexOf(e[1].toLowerCase()) > -1 && (e[1] = Re(e[1].toLowerCase())), t.indexOf(e[2].toLowerCase()) > -1 && (e[2] = Re(e[2].toLowerCase()))), e.join("-");
757
- }
758
- return this.options.cleanCode || this.options.lowerCaseLng ? n.toLowerCase() : n;
759
- }
760
- }, {
761
- key: "isSupportedCode",
762
- value: function(n) {
763
- return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (n = this.getLanguagePartFromCode(n)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(n) > -1;
764
- }
765
- }, {
766
- key: "getBestMatchFromCodes",
767
- value: function(n) {
768
- var t = this;
769
- if (!n)
770
- return null;
771
- var e;
772
- return n.forEach(function(i) {
773
- if (!e) {
774
- var o = t.formatLanguageCode(i);
775
- (!t.options.supportedLngs || t.isSupportedCode(o)) && (e = o);
776
- }
777
- }), !e && this.options.supportedLngs && n.forEach(function(i) {
778
- if (!e) {
779
- var o = t.getLanguagePartFromCode(i);
780
- if (t.isSupportedCode(o))
781
- return e = o;
782
- e = t.options.supportedLngs.find(function(s) {
783
- if (s === o)
784
- return s;
785
- if (!(s.indexOf("-") < 0 && o.indexOf("-") < 0) && s.indexOf(o) === 0)
786
- return s;
787
- });
788
- }
789
- }), e || (e = this.getFallbackCodes(this.options.fallbackLng)[0]), e;
790
- }
791
- }, {
792
- key: "getFallbackCodes",
793
- value: function(n, t) {
794
- if (!n)
795
- return [];
796
- if (typeof n == "function" && (n = n(t)), typeof n == "string" && (n = [n]), Object.prototype.toString.apply(n) === "[object Array]")
797
- return n;
798
- if (!t)
799
- return n.default || [];
800
- var e = n[t];
801
- return e || (e = n[this.getScriptPartFromCode(t)]), e || (e = n[this.formatLanguageCode(t)]), e || (e = n[this.getLanguagePartFromCode(t)]), e || (e = n.default), e || [];
802
- }
803
- }, {
804
- key: "toResolveHierarchy",
805
- value: function(n, t) {
806
- var e = this, i = this.getFallbackCodes(t || this.options.fallbackLng || [], n), o = [], s = function(d) {
807
- d && (e.isSupportedCode(d) ? o.push(d) : e.logger.warn("rejecting language code not found in supportedLngs: ".concat(d)));
808
- };
809
- return typeof n == "string" && n.indexOf("-") > -1 ? (this.options.load !== "languageOnly" && s(this.formatLanguageCode(n)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && s(this.getScriptPartFromCode(n)), this.options.load !== "currentOnly" && s(this.getLanguagePartFromCode(n))) : typeof n == "string" && s(this.formatLanguageCode(n)), i.forEach(function(u) {
810
- o.indexOf(u) < 0 && s(e.formatLanguageCode(u));
811
- }), o;
812
- }
813
- }]), a;
814
- }(), nn = [{
815
- lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
816
- nr: [1, 2],
817
- fc: 1
818
- }, {
819
- lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"],
820
- nr: [1, 2],
821
- fc: 2
822
- }, {
823
- lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"],
824
- nr: [1],
825
- fc: 3
826
- }, {
827
- lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
828
- nr: [1, 2, 5],
829
- fc: 4
830
- }, {
831
- lngs: ["ar"],
832
- nr: [0, 1, 2, 3, 11, 100],
833
- fc: 5
834
- }, {
835
- lngs: ["cs", "sk"],
836
- nr: [1, 2, 5],
837
- fc: 6
838
- }, {
839
- lngs: ["csb", "pl"],
840
- nr: [1, 2, 5],
841
- fc: 7
842
- }, {
843
- lngs: ["cy"],
844
- nr: [1, 2, 3, 8],
845
- fc: 8
846
- }, {
847
- lngs: ["fr"],
848
- nr: [1, 2],
849
- fc: 9
850
- }, {
851
- lngs: ["ga"],
852
- nr: [1, 2, 3, 7, 11],
853
- fc: 10
854
- }, {
855
- lngs: ["gd"],
856
- nr: [1, 2, 3, 20],
857
- fc: 11
858
- }, {
859
- lngs: ["is"],
860
- nr: [1, 2],
861
- fc: 12
862
- }, {
863
- lngs: ["jv"],
864
- nr: [0, 1],
865
- fc: 13
866
- }, {
867
- lngs: ["kw"],
868
- nr: [1, 2, 3, 4],
869
- fc: 14
870
- }, {
871
- lngs: ["lt"],
872
- nr: [1, 2, 10],
873
- fc: 15
874
- }, {
875
- lngs: ["lv"],
876
- nr: [1, 2, 0],
877
- fc: 16
878
- }, {
879
- lngs: ["mk"],
880
- nr: [1, 2],
881
- fc: 17
882
- }, {
883
- lngs: ["mnk"],
884
- nr: [0, 1, 2],
885
- fc: 18
886
- }, {
887
- lngs: ["mt"],
888
- nr: [1, 2, 11, 20],
889
- fc: 19
890
- }, {
891
- lngs: ["or"],
892
- nr: [2, 1],
893
- fc: 2
894
- }, {
895
- lngs: ["ro"],
896
- nr: [1, 2, 20],
897
- fc: 20
898
- }, {
899
- lngs: ["sl"],
900
- nr: [5, 1, 2, 3],
901
- fc: 21
902
- }, {
903
- lngs: ["he", "iw"],
904
- nr: [1, 2, 20, 21],
905
- fc: 22
906
- }], rn = {
907
- 1: function(r) {
908
- return +(r > 1);
909
- },
910
- 2: function(r) {
911
- return +(r != 1);
912
- },
913
- 3: function(r) {
914
- return 0;
915
- },
916
- 4: function(r) {
917
- return r % 10 == 1 && r % 100 != 11 ? 0 : r % 10 >= 2 && r % 10 <= 4 && (r % 100 < 10 || r % 100 >= 20) ? 1 : 2;
918
- },
919
- 5: function(r) {
920
- return r == 0 ? 0 : r == 1 ? 1 : r == 2 ? 2 : r % 100 >= 3 && r % 100 <= 10 ? 3 : r % 100 >= 11 ? 4 : 5;
921
- },
922
- 6: function(r) {
923
- return r == 1 ? 0 : r >= 2 && r <= 4 ? 1 : 2;
924
- },
925
- 7: function(r) {
926
- return r == 1 ? 0 : r % 10 >= 2 && r % 10 <= 4 && (r % 100 < 10 || r % 100 >= 20) ? 1 : 2;
927
- },
928
- 8: function(r) {
929
- return r == 1 ? 0 : r == 2 ? 1 : r != 8 && r != 11 ? 2 : 3;
930
- },
931
- 9: function(r) {
932
- return +(r >= 2);
933
- },
934
- 10: function(r) {
935
- return r == 1 ? 0 : r == 2 ? 1 : r < 7 ? 2 : r < 11 ? 3 : 4;
936
- },
937
- 11: function(r) {
938
- return r == 1 || r == 11 ? 0 : r == 2 || r == 12 ? 1 : r > 2 && r < 20 ? 2 : 3;
939
- },
940
- 12: function(r) {
941
- return +(r % 10 != 1 || r % 100 == 11);
942
- },
943
- 13: function(r) {
944
- return +(r !== 0);
945
- },
946
- 14: function(r) {
947
- return r == 1 ? 0 : r == 2 ? 1 : r == 3 ? 2 : 3;
948
- },
949
- 15: function(r) {
950
- return r % 10 == 1 && r % 100 != 11 ? 0 : r % 10 >= 2 && (r % 100 < 10 || r % 100 >= 20) ? 1 : 2;
951
- },
952
- 16: function(r) {
953
- return r % 10 == 1 && r % 100 != 11 ? 0 : r !== 0 ? 1 : 2;
954
- },
955
- 17: function(r) {
956
- return r == 1 || r % 10 == 1 && r % 100 != 11 ? 0 : 1;
957
- },
958
- 18: function(r) {
959
- return r == 0 ? 0 : r == 1 ? 1 : 2;
960
- },
961
- 19: function(r) {
962
- return r == 1 ? 0 : r == 0 || r % 100 > 1 && r % 100 < 11 ? 1 : r % 100 > 10 && r % 100 < 20 ? 2 : 3;
963
- },
964
- 20: function(r) {
965
- return r == 1 ? 0 : r == 0 || r % 100 > 0 && r % 100 < 20 ? 1 : 2;
966
- },
967
- 21: function(r) {
968
- return r % 100 == 1 ? 1 : r % 100 == 2 ? 2 : r % 100 == 3 || r % 100 == 4 ? 3 : 0;
969
- },
970
- 22: function(r) {
971
- return r == 1 ? 0 : r == 2 ? 1 : (r < 0 || r > 10) && r % 10 == 0 ? 2 : 3;
972
- }
973
- }, an = ["v1", "v2", "v3"], Xe = {
974
- zero: 0,
975
- one: 1,
976
- two: 2,
977
- few: 3,
978
- many: 4,
979
- other: 5
980
- };
981
- function on() {
982
- var a = {};
983
- return nn.forEach(function(r) {
984
- r.lngs.forEach(function(n) {
985
- a[n] = {
986
- numbers: r.nr,
987
- plurals: rn[r.fc]
988
- };
989
- });
990
- }), a;
991
- }
992
- var sn = function() {
993
- function a(r) {
994
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
995
- I(this, a), this.languageUtils = r, this.options = n, this.logger = $.create("pluralResolver"), (!this.options.compatibilityJSON || this.options.compatibilityJSON === "v4") && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = on();
996
- }
997
- return T(a, [{
998
- key: "addRule",
999
- value: function(n, t) {
1000
- this.rules[n] = t;
1001
- }
1002
- }, {
1003
- key: "getRule",
1004
- value: function(n) {
1005
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1006
- if (this.shouldUseIntlApi())
1007
- try {
1008
- return new Intl.PluralRules(n, {
1009
- type: t.ordinal ? "ordinal" : "cardinal"
1010
- });
1011
- } catch {
1012
- return;
1013
- }
1014
- return this.rules[n] || this.rules[this.languageUtils.getLanguagePartFromCode(n)];
1015
- }
1016
- }, {
1017
- key: "needsPlural",
1018
- value: function(n) {
1019
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = this.getRule(n, t);
1020
- return this.shouldUseIntlApi() ? e && e.resolvedOptions().pluralCategories.length > 1 : e && e.numbers.length > 1;
1021
- }
1022
- }, {
1023
- key: "getPluralFormsOfKey",
1024
- value: function(n, t) {
1025
- var e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1026
- return this.getSuffixes(n, e).map(function(i) {
1027
- return "".concat(t).concat(i);
1028
- });
1029
- }
1030
- }, {
1031
- key: "getSuffixes",
1032
- value: function(n) {
1033
- var t = this, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = this.getRule(n, e);
1034
- return i ? this.shouldUseIntlApi() ? i.resolvedOptions().pluralCategories.sort(function(o, s) {
1035
- return Xe[o] - Xe[s];
1036
- }).map(function(o) {
1037
- return "".concat(t.options.prepend).concat(o);
1038
- }) : i.numbers.map(function(o) {
1039
- return t.getSuffix(n, o, e);
1040
- }) : [];
1041
- }
1042
- }, {
1043
- key: "getSuffix",
1044
- value: function(n, t) {
1045
- var e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = this.getRule(n, e);
1046
- return i ? this.shouldUseIntlApi() ? "".concat(this.options.prepend).concat(i.select(t)) : this.getSuffixRetroCompatible(i, t) : (this.logger.warn("no plural rule found for: ".concat(n)), "");
1047
- }
1048
- }, {
1049
- key: "getSuffixRetroCompatible",
1050
- value: function(n, t) {
1051
- var e = this, i = n.noAbs ? n.plurals(t) : n.plurals(Math.abs(t)), o = n.numbers[i];
1052
- this.options.simplifyPluralSuffix && n.numbers.length === 2 && n.numbers[0] === 1 && (o === 2 ? o = "plural" : o === 1 && (o = ""));
1053
- var s = function() {
1054
- return e.options.prepend && o.toString() ? e.options.prepend + o.toString() : o.toString();
1055
- };
1056
- return this.options.compatibilityJSON === "v1" ? o === 1 ? "" : typeof o == "number" ? "_plural_".concat(o.toString()) : s() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && n.numbers.length === 2 && n.numbers[0] === 1 ? s() : this.options.prepend && i.toString() ? this.options.prepend + i.toString() : i.toString();
1057
- }
1058
- }, {
1059
- key: "shouldUseIntlApi",
1060
- value: function() {
1061
- return !an.includes(this.options.compatibilityJSON);
1062
- }
1063
- }]), a;
1064
- }();
1065
- function We(a, r) {
1066
- var n = Object.keys(a);
1067
- if (Object.getOwnPropertySymbols) {
1068
- var t = Object.getOwnPropertySymbols(a);
1069
- r && (t = t.filter(function(e) {
1070
- return Object.getOwnPropertyDescriptor(a, e).enumerable;
1071
- })), n.push.apply(n, t);
1072
- }
1073
- return n;
1074
- }
1075
- function F(a) {
1076
- for (var r = 1; r < arguments.length; r++) {
1077
- var n = arguments[r] != null ? arguments[r] : {};
1078
- r % 2 ? We(Object(n), !0).forEach(function(t) {
1079
- G(a, t, n[t]);
1080
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(n)) : We(Object(n)).forEach(function(t) {
1081
- Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(n, t));
1082
- });
1083
- }
1084
- return a;
1085
- }
1086
- function Ge(a, r, n) {
1087
- var t = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", e = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, i = zt(a, r, n);
1088
- return !i && e && typeof n == "string" && (i = ye(a, n, t), i === void 0 && (i = ye(r, n, t))), i;
1089
- }
1090
- var un = function() {
1091
- function a() {
1092
- var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1093
- I(this, a), this.logger = $.create("interpolator"), this.options = r, this.format = r.interpolation && r.interpolation.format || function(n) {
1094
- return n;
1095
- }, this.init(r);
1096
- }
1097
- return T(a, [{
1098
- key: "init",
1099
- value: function() {
1100
- var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1101
- n.interpolation || (n.interpolation = {
1102
- escapeValue: !0
1103
- });
1104
- var t = n.interpolation;
1105
- this.escape = t.escape !== void 0 ? t.escape : Xt, this.escapeValue = t.escapeValue !== void 0 ? t.escapeValue : !0, this.useRawValueToEscape = t.useRawValueToEscape !== void 0 ? t.useRawValueToEscape : !1, this.prefix = t.prefix ? te(t.prefix) : t.prefixEscaped || "{{", this.suffix = t.suffix ? te(t.suffix) : t.suffixEscaped || "}}", this.formatSeparator = t.formatSeparator ? t.formatSeparator : t.formatSeparator || ",", this.unescapePrefix = t.unescapeSuffix ? "" : t.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : t.unescapeSuffix || "", this.nestingPrefix = t.nestingPrefix ? te(t.nestingPrefix) : t.nestingPrefixEscaped || te("$t("), this.nestingSuffix = t.nestingSuffix ? te(t.nestingSuffix) : t.nestingSuffixEscaped || te(")"), this.nestingOptionsSeparator = t.nestingOptionsSeparator ? t.nestingOptionsSeparator : t.nestingOptionsSeparator || ",", this.maxReplaces = t.maxReplaces ? t.maxReplaces : 1e3, this.alwaysFormat = t.alwaysFormat !== void 0 ? t.alwaysFormat : !1, this.resetRegExp();
1106
- }
1107
- }, {
1108
- key: "reset",
1109
- value: function() {
1110
- this.options && this.init(this.options);
1111
- }
1112
- }, {
1113
- key: "resetRegExp",
1114
- value: function() {
1115
- var n = "".concat(this.prefix, "(.+?)").concat(this.suffix);
1116
- this.regexp = new RegExp(n, "g");
1117
- var t = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix);
1118
- this.regexpUnescape = new RegExp(t, "g");
1119
- var e = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix);
1120
- this.nestingRegexp = new RegExp(e, "g");
1121
- }
1122
- }, {
1123
- key: "interpolate",
1124
- value: function(n, t, e, i) {
1125
- var o = this, s, u, d, c = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
1126
- function f(w) {
1127
- return w.replace(/\$/g, "$$$$");
1128
- }
1129
- var h = function(v) {
1130
- if (v.indexOf(o.formatSeparator) < 0) {
1131
- var y = Ge(t, c, v, o.options.keySeparator, o.options.ignoreJSONStructure);
1132
- return o.alwaysFormat ? o.format(y, void 0, e, F(F(F({}, i), t), {}, {
1133
- interpolationkey: v
1134
- })) : y;
1135
- }
1136
- var S = v.split(o.formatSeparator), x = S.shift().trim(), R = S.join(o.formatSeparator).trim();
1137
- return o.format(Ge(t, c, x, o.options.keySeparator, o.options.ignoreJSONStructure), R, e, F(F(F({}, i), t), {}, {
1138
- interpolationkey: x
1139
- }));
1140
- };
1141
- this.resetRegExp();
1142
- var p = i && i.missingInterpolationHandler || this.options.missingInterpolationHandler, b = i && i.interpolation && i.interpolation.skipOnVariables !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables, m = [{
1143
- regex: this.regexpUnescape,
1144
- safeValue: function(v) {
1145
- return f(v);
1146
- }
1147
- }, {
1148
- regex: this.regexp,
1149
- safeValue: function(v) {
1150
- return o.escapeValue ? f(o.escape(v)) : f(v);
1151
- }
1152
- }];
1153
- return m.forEach(function(w) {
1154
- for (d = 0; s = w.regex.exec(n); ) {
1155
- var v = s[1].trim();
1156
- if (u = h(v), u === void 0)
1157
- if (typeof p == "function") {
1158
- var y = p(n, s, i);
1159
- u = typeof y == "string" ? y : "";
1160
- } else if (i && Object.prototype.hasOwnProperty.call(i, v))
1161
- u = "";
1162
- else if (b) {
1163
- u = s[0];
1164
- continue;
1165
- } else
1166
- o.logger.warn("missed to pass in variable ".concat(v, " for interpolating ").concat(n)), u = "";
1167
- else
1168
- typeof u != "string" && !o.useRawValueToEscape && (u = Me(u));
1169
- var S = w.safeValue(u);
1170
- if (n = n.replace(s[0], S), b ? (w.regex.lastIndex += u.length, w.regex.lastIndex -= s[0].length) : w.regex.lastIndex = 0, d++, d >= o.maxReplaces)
1171
- break;
1172
- }
1173
- }), n;
1174
- }
1175
- }, {
1176
- key: "nest",
1177
- value: function(n, t) {
1178
- var e = this, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o, s, u;
1179
- function d(p, b) {
1180
- var m = this.nestingOptionsSeparator;
1181
- if (p.indexOf(m) < 0)
1182
- return p;
1183
- var w = p.split(new RegExp("".concat(m, "[ ]*{"))), v = "{".concat(w[1]);
1184
- p = w[0], v = this.interpolate(v, u);
1185
- var y = v.match(/'/g), S = v.match(/"/g);
1186
- (y && y.length % 2 === 0 && !S || S.length % 2 !== 0) && (v = v.replace(/'/g, '"'));
1187
- try {
1188
- u = JSON.parse(v), b && (u = F(F({}, b), u));
1189
- } catch (x) {
1190
- return this.logger.warn("failed parsing options string in nesting for key ".concat(p), x), "".concat(p).concat(m).concat(v);
1191
- }
1192
- return delete u.defaultValue, p;
1193
- }
1194
- for (; o = this.nestingRegexp.exec(n); ) {
1195
- var c = [];
1196
- u = F({}, i), u = u.replace && typeof u.replace != "string" ? u.replace : u, u.applyPostProcessor = !1, delete u.defaultValue;
1197
- var f = !1;
1198
- if (o[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(o[1])) {
1199
- var h = o[1].split(this.formatSeparator).map(function(p) {
1200
- return p.trim();
1201
- });
1202
- o[1] = h.shift(), c = h, f = !0;
1203
- }
1204
- if (s = t(d.call(this, o[1].trim(), u), u), s && o[0] === n && typeof s != "string")
1205
- return s;
1206
- typeof s != "string" && (s = Me(s)), s || (this.logger.warn("missed to resolve ".concat(o[1], " for nesting ").concat(n)), s = ""), f && (s = c.reduce(function(p, b) {
1207
- return e.format(p, b, i.lng, F(F({}, i), {}, {
1208
- interpolationkey: o[1].trim()
1209
- }));
1210
- }, s.trim())), n = n.replace(o[0], s), this.regexp.lastIndex = 0;
1211
- }
1212
- return n;
1213
- }
1214
- }]), a;
1215
- }();
1216
- function Qe(a, r) {
1217
- var n = Object.keys(a);
1218
- if (Object.getOwnPropertySymbols) {
1219
- var t = Object.getOwnPropertySymbols(a);
1220
- r && (t = t.filter(function(e) {
1221
- return Object.getOwnPropertyDescriptor(a, e).enumerable;
1222
- })), n.push.apply(n, t);
1223
- }
1224
- return n;
1225
- }
1226
- function V(a) {
1227
- for (var r = 1; r < arguments.length; r++) {
1228
- var n = arguments[r] != null ? arguments[r] : {};
1229
- r % 2 ? Qe(Object(n), !0).forEach(function(t) {
1230
- G(a, t, n[t]);
1231
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(n)) : Qe(Object(n)).forEach(function(t) {
1232
- Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(n, t));
1233
- });
1234
- }
1235
- return a;
1236
- }
1237
- function fn(a) {
1238
- var r = a.toLowerCase().trim(), n = {};
1239
- if (a.indexOf("(") > -1) {
1240
- var t = a.split("(");
1241
- r = t[0].toLowerCase().trim();
1242
- var e = t[1].substring(0, t[1].length - 1);
1243
- if (r === "currency" && e.indexOf(":") < 0)
1244
- n.currency || (n.currency = e.trim());
1245
- else if (r === "relativetime" && e.indexOf(":") < 0)
1246
- n.range || (n.range = e.trim());
1247
- else {
1248
- var i = e.split(";");
1249
- i.forEach(function(o) {
1250
- if (o) {
1251
- var s = o.split(":"), u = Mt(s), d = u[0], c = u.slice(1), f = c.join(":").trim().replace(/^'+|'+$/g, "");
1252
- n[d.trim()] || (n[d.trim()] = f), f === "false" && (n[d.trim()] = !1), f === "true" && (n[d.trim()] = !0), isNaN(f) || (n[d.trim()] = parseInt(f, 10));
1253
- }
1254
- });
1255
- }
1256
- }
1257
- return {
1258
- formatName: r,
1259
- formatOptions: n
1260
- };
1261
- }
1262
- function ne(a) {
1263
- var r = {};
1264
- return function(t, e, i) {
1265
- var o = e + JSON.stringify(i), s = r[o];
1266
- return s || (s = a(e, i), r[o] = s), s(t);
1267
- };
1268
- }
1269
- var cn = function() {
1270
- function a() {
1271
- var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1272
- I(this, a), this.logger = $.create("formatter"), this.options = r, this.formats = {
1273
- number: ne(function(n, t) {
1274
- var e = new Intl.NumberFormat(n, V({}, t));
1275
- return function(i) {
1276
- return e.format(i);
1277
- };
1278
- }),
1279
- currency: ne(function(n, t) {
1280
- var e = new Intl.NumberFormat(n, V(V({}, t), {}, {
1281
- style: "currency"
1282
- }));
1283
- return function(i) {
1284
- return e.format(i);
1285
- };
1286
- }),
1287
- datetime: ne(function(n, t) {
1288
- var e = new Intl.DateTimeFormat(n, V({}, t));
1289
- return function(i) {
1290
- return e.format(i);
1291
- };
1292
- }),
1293
- relativetime: ne(function(n, t) {
1294
- var e = new Intl.RelativeTimeFormat(n, V({}, t));
1295
- return function(i) {
1296
- return e.format(i, t.range || "day");
1297
- };
1298
- }),
1299
- list: ne(function(n, t) {
1300
- var e = new Intl.ListFormat(n, V({}, t));
1301
- return function(i) {
1302
- return e.format(i);
1303
- };
1304
- })
1305
- }, this.init(r);
1306
- }
1307
- return T(a, [{
1308
- key: "init",
1309
- value: function(n) {
1310
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
1311
- interpolation: {}
1312
- }, e = t.interpolation;
1313
- this.formatSeparator = e.formatSeparator ? e.formatSeparator : e.formatSeparator || ",";
1314
- }
1315
- }, {
1316
- key: "add",
1317
- value: function(n, t) {
1318
- this.formats[n.toLowerCase().trim()] = t;
1319
- }
1320
- }, {
1321
- key: "addCached",
1322
- value: function(n, t) {
1323
- this.formats[n.toLowerCase().trim()] = ne(t);
1324
- }
1325
- }, {
1326
- key: "format",
1327
- value: function(n, t, e) {
1328
- var i = this, o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, s = t.split(this.formatSeparator), u = s.reduce(function(d, c) {
1329
- var f = fn(c), h = f.formatName, p = f.formatOptions;
1330
- if (i.formats[h]) {
1331
- var b = d;
1332
- try {
1333
- var m = o && o.formatParams && o.formatParams[o.interpolationkey] || {}, w = m.locale || m.lng || o.locale || o.lng || e;
1334
- b = i.formats[h](d, w, V(V(V({}, p), o), m));
1335
- } catch (v) {
1336
- i.logger.warn(v);
1337
- }
1338
- return b;
1339
- } else
1340
- i.logger.warn("there was no format function for ".concat(h));
1341
- return d;
1342
- }, n);
1343
- return u;
1344
- }
1345
- }]), a;
1346
- }();
1347
- function Ye(a, r) {
1348
- var n = Object.keys(a);
1349
- if (Object.getOwnPropertySymbols) {
1350
- var t = Object.getOwnPropertySymbols(a);
1351
- r && (t = t.filter(function(e) {
1352
- return Object.getOwnPropertyDescriptor(a, e).enumerable;
1353
- })), n.push.apply(n, t);
1354
- }
1355
- return n;
1356
- }
1357
- function Ze(a) {
1358
- for (var r = 1; r < arguments.length; r++) {
1359
- var n = arguments[r] != null ? arguments[r] : {};
1360
- r % 2 ? Ye(Object(n), !0).forEach(function(t) {
1361
- G(a, t, n[t]);
1362
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(n)) : Ye(Object(n)).forEach(function(t) {
1363
- Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(n, t));
1364
- });
1365
- }
1366
- return a;
1367
- }
1368
- function ln(a) {
1369
- var r = dn();
1370
- return function() {
1371
- var t = q(a), e;
1372
- if (r) {
1373
- var i = q(this).constructor;
1374
- e = Reflect.construct(t, arguments, i);
1375
- } else
1376
- e = t.apply(this, arguments);
1377
- return ce(this, e);
1378
- };
1379
- }
1380
- function dn() {
1381
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
1382
- return !1;
1383
- if (typeof Proxy == "function")
1384
- return !0;
1385
- try {
1386
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
1387
- })), !0;
1388
- } catch {
1389
- return !1;
1390
- }
1391
- }
1392
- function hn(a, r) {
1393
- a.pending[r] !== void 0 && (delete a.pending[r], a.pendingCount--);
1394
- }
1395
- var pn = function(a) {
1396
- Oe(n, a);
1397
- var r = ln(n);
1398
- function n(t, e, i) {
1399
- var o, s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1400
- return I(this, n), o = r.call(this), Se && X.call(J(o)), o.backend = t, o.store = e, o.services = i, o.languageUtils = i.languageUtils, o.options = s, o.logger = $.create("backendConnector"), o.waitingReads = [], o.maxParallelReads = s.maxParallelReads || 10, o.readingCalls = 0, o.maxRetries = s.maxRetries >= 0 ? s.maxRetries : 5, o.retryTimeout = s.retryTimeout >= 1 ? s.retryTimeout : 350, o.state = {}, o.queue = [], o.backend && o.backend.init && o.backend.init(i, s.backend, s), o;
1401
- }
1402
- return T(n, [{
1403
- key: "queueLoad",
1404
- value: function(e, i, o, s) {
1405
- var u = this, d = {}, c = {}, f = {}, h = {};
1406
- return e.forEach(function(p) {
1407
- var b = !0;
1408
- i.forEach(function(m) {
1409
- var w = "".concat(p, "|").concat(m);
1410
- !o.reload && u.store.hasResourceBundle(p, m) ? u.state[w] = 2 : u.state[w] < 0 || (u.state[w] === 1 ? c[w] === void 0 && (c[w] = !0) : (u.state[w] = 1, b = !1, c[w] === void 0 && (c[w] = !0), d[w] === void 0 && (d[w] = !0), h[m] === void 0 && (h[m] = !0)));
1411
- }), b || (f[p] = !0);
1412
- }), (Object.keys(d).length || Object.keys(c).length) && this.queue.push({
1413
- pending: c,
1414
- pendingCount: Object.keys(c).length,
1415
- loaded: {},
1416
- errors: [],
1417
- callback: s
1418
- }), {
1419
- toLoad: Object.keys(d),
1420
- pending: Object.keys(c),
1421
- toLoadLanguages: Object.keys(f),
1422
- toLoadNamespaces: Object.keys(h)
1423
- };
1424
- }
1425
- }, {
1426
- key: "loaded",
1427
- value: function(e, i, o) {
1428
- var s = e.split("|"), u = s[0], d = s[1];
1429
- i && this.emit("failedLoading", u, d, i), o && this.store.addResourceBundle(u, d, o), this.state[e] = i ? -1 : 2;
1430
- var c = {};
1431
- this.queue.forEach(function(f) {
1432
- Vt(f.loaded, [u], d), hn(f, e), i && f.errors.push(i), f.pendingCount === 0 && !f.done && (Object.keys(f.loaded).forEach(function(h) {
1433
- c[h] || (c[h] = {});
1434
- var p = f.loaded[h];
1435
- p.length && p.forEach(function(b) {
1436
- c[h][b] === void 0 && (c[h][b] = !0);
1437
- });
1438
- }), f.done = !0, f.errors.length ? f.callback(f.errors) : f.callback());
1439
- }), this.emit("loaded", c), this.queue = this.queue.filter(function(f) {
1440
- return !f.done;
1441
- });
1442
- }
1443
- }, {
1444
- key: "read",
1445
- value: function(e, i, o) {
1446
- var s = this, u = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, d = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, c = arguments.length > 5 ? arguments[5] : void 0;
1447
- if (!e.length)
1448
- return c(null, {});
1449
- if (this.readingCalls >= this.maxParallelReads) {
1450
- this.waitingReads.push({
1451
- lng: e,
1452
- ns: i,
1453
- fcName: o,
1454
- tried: u,
1455
- wait: d,
1456
- callback: c
1457
- });
1458
- return;
1459
- }
1460
- this.readingCalls++;
1461
- var f = function(m, w) {
1462
- if (s.readingCalls--, s.waitingReads.length > 0) {
1463
- var v = s.waitingReads.shift();
1464
- s.read(v.lng, v.ns, v.fcName, v.tried, v.wait, v.callback);
1465
- }
1466
- if (m && w && u < s.maxRetries) {
1467
- setTimeout(function() {
1468
- s.read.call(s, e, i, o, u + 1, d * 2, c);
1469
- }, d);
1470
- return;
1471
- }
1472
- c(m, w);
1473
- }, h = this.backend[o].bind(this.backend);
1474
- if (h.length === 2) {
1475
- try {
1476
- var p = h(e, i);
1477
- p && typeof p.then == "function" ? p.then(function(b) {
1478
- return f(null, b);
1479
- }).catch(f) : f(null, p);
1480
- } catch (b) {
1481
- f(b);
1482
- }
1483
- return;
1484
- }
1485
- return h(e, i, f);
1486
- }
1487
- }, {
1488
- key: "prepareLoading",
1489
- value: function(e, i) {
1490
- var o = this, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, u = arguments.length > 3 ? arguments[3] : void 0;
1491
- if (!this.backend)
1492
- return this.logger.warn("No backend was added via i18next.use. Will not load resources."), u && u();
1493
- typeof e == "string" && (e = this.languageUtils.toResolveHierarchy(e)), typeof i == "string" && (i = [i]);
1494
- var d = this.queueLoad(e, i, s, u);
1495
- if (!d.toLoad.length)
1496
- return d.pending.length || u(), null;
1497
- d.toLoad.forEach(function(c) {
1498
- o.loadOne(c);
1499
- });
1500
- }
1501
- }, {
1502
- key: "load",
1503
- value: function(e, i, o) {
1504
- this.prepareLoading(e, i, {}, o);
1505
- }
1506
- }, {
1507
- key: "reload",
1508
- value: function(e, i, o) {
1509
- this.prepareLoading(e, i, {
1510
- reload: !0
1511
- }, o);
1512
- }
1513
- }, {
1514
- key: "loadOne",
1515
- value: function(e) {
1516
- var i = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", s = e.split("|"), u = s[0], d = s[1];
1517
- this.read(u, d, "read", void 0, void 0, function(c, f) {
1518
- c && i.logger.warn("".concat(o, "loading namespace ").concat(d, " for language ").concat(u, " failed"), c), !c && f && i.logger.log("".concat(o, "loaded namespace ").concat(d, " for language ").concat(u), f), i.loaded(e, c, f);
1519
- });
1520
- }
1521
- }, {
1522
- key: "saveMissing",
1523
- value: function(e, i, o, s, u) {
1524
- var d = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, c = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : function() {
1525
- };
1526
- if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(i)) {
1527
- this.logger.warn('did not save key "'.concat(o, '" as the namespace "').concat(i, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
1528
- return;
1529
- }
1530
- if (!(o == null || o === "")) {
1531
- if (this.backend && this.backend.create) {
1532
- var f = Ze(Ze({}, d), {}, {
1533
- isUpdate: u
1534
- }), h = this.backend.create.bind(this.backend);
1535
- if (h.length < 6)
1536
- try {
1537
- var p;
1538
- h.length === 5 ? p = h(e, i, o, s, f) : p = h(e, i, o, s), p && typeof p.then == "function" ? p.then(function(b) {
1539
- return c(null, b);
1540
- }).catch(c) : c(null, p);
1541
- } catch (b) {
1542
- c(b);
1543
- }
1544
- else
1545
- h(e, i, o, s, c, f);
1546
- }
1547
- !e || !e[0] || this.store.addResource(e[0], i, o, s);
1548
- }
1549
- }
1550
- }]), n;
1551
- }(X);
1552
- function et() {
1553
- return {
1554
- debug: !1,
1555
- initImmediate: !0,
1556
- ns: ["translation"],
1557
- defaultNS: ["translation"],
1558
- fallbackLng: ["dev"],
1559
- fallbackNS: !1,
1560
- supportedLngs: !1,
1561
- nonExplicitSupportedLngs: !1,
1562
- load: "all",
1563
- preload: !1,
1564
- simplifyPluralSuffix: !0,
1565
- keySeparator: ".",
1566
- nsSeparator: ":",
1567
- pluralSeparator: "_",
1568
- contextSeparator: "_",
1569
- partialBundledLanguages: !1,
1570
- saveMissing: !1,
1571
- updateMissing: !1,
1572
- saveMissingTo: "fallback",
1573
- saveMissingPlurals: !0,
1574
- missingKeyHandler: !1,
1575
- missingInterpolationHandler: !1,
1576
- postProcess: !1,
1577
- postProcessPassResolved: !1,
1578
- returnNull: !0,
1579
- returnEmptyString: !0,
1580
- returnObjects: !1,
1581
- joinArrays: !1,
1582
- returnedObjectHandler: !1,
1583
- parseMissingKeyHandler: !1,
1584
- appendNamespaceToMissingKey: !1,
1585
- appendNamespaceToCIMode: !1,
1586
- overloadTranslationOptionHandler: function(r) {
1587
- var n = {};
1588
- if (Y(r[1]) === "object" && (n = r[1]), typeof r[1] == "string" && (n.defaultValue = r[1]), typeof r[2] == "string" && (n.tDescription = r[2]), Y(r[2]) === "object" || Y(r[3]) === "object") {
1589
- var t = r[3] || r[2];
1590
- Object.keys(t).forEach(function(e) {
1591
- n[e] = t[e];
1592
- });
1593
- }
1594
- return n;
1595
- },
1596
- interpolation: {
1597
- escapeValue: !0,
1598
- format: function(r, n, t, e) {
1599
- return r;
1600
- },
1601
- prefix: "{{",
1602
- suffix: "}}",
1603
- formatSeparator: ",",
1604
- unescapePrefix: "-",
1605
- nestingPrefix: "$t(",
1606
- nestingSuffix: ")",
1607
- nestingOptionsSeparator: ",",
1608
- maxReplaces: 1e3,
1609
- skipOnVariables: !0
1610
- }
1611
- };
1612
- }
1613
- function tt(a) {
1614
- return typeof a.ns == "string" && (a.ns = [a.ns]), typeof a.fallbackLng == "string" && (a.fallbackLng = [a.fallbackLng]), typeof a.fallbackNS == "string" && (a.fallbackNS = [a.fallbackNS]), a.supportedLngs && a.supportedLngs.indexOf("cimode") < 0 && (a.supportedLngs = a.supportedLngs.concat(["cimode"])), a;
1615
- }
1616
- function nt(a, r) {
1617
- var n = Object.keys(a);
1618
- if (Object.getOwnPropertySymbols) {
1619
- var t = Object.getOwnPropertySymbols(a);
1620
- r && (t = t.filter(function(e) {
1621
- return Object.getOwnPropertyDescriptor(a, e).enumerable;
1622
- })), n.push.apply(n, t);
1623
- }
1624
- return n;
1625
- }
1626
- function M(a) {
1627
- for (var r = 1; r < arguments.length; r++) {
1628
- var n = arguments[r] != null ? arguments[r] : {};
1629
- r % 2 ? nt(Object(n), !0).forEach(function(t) {
1630
- G(a, t, n[t]);
1631
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(n)) : nt(Object(n)).forEach(function(t) {
1632
- Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(n, t));
1633
- });
1634
- }
1635
- return a;
1636
- }
1637
- function gn(a) {
1638
- var r = vn();
1639
- return function() {
1640
- var t = q(a), e;
1641
- if (r) {
1642
- var i = q(this).constructor;
1643
- e = Reflect.construct(t, arguments, i);
1644
- } else
1645
- e = t.apply(this, arguments);
1646
- return ce(this, e);
1647
- };
1648
- }
1649
- function vn() {
1650
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
1651
- return !1;
1652
- if (typeof Proxy == "function")
1653
- return !0;
1654
- try {
1655
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
1656
- })), !0;
1657
- } catch {
1658
- return !1;
1659
- }
1660
- }
1661
- function pe() {
1662
- }
1663
- function mn(a) {
1664
- var r = Object.getOwnPropertyNames(Object.getPrototypeOf(a));
1665
- r.forEach(function(n) {
1666
- typeof a[n] == "function" && (a[n] = a[n].bind(a));
1667
- });
1668
- }
1669
- var be = function(a) {
1670
- Oe(n, a);
1671
- var r = gn(n);
1672
- function n() {
1673
- var t, e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = arguments.length > 1 ? arguments[1] : void 0;
1674
- if (I(this, n), t = r.call(this), Se && X.call(J(t)), t.options = tt(e), t.services = {}, t.logger = $, t.modules = {
1675
- external: []
1676
- }, mn(J(t)), i && !t.isInitialized && !e.isClone) {
1677
- if (!t.options.initImmediate)
1678
- return t.init(e, i), ce(t, J(t));
1679
- setTimeout(function() {
1680
- t.init(e, i);
1681
- }, 0);
1682
- }
1683
- return t;
1684
- }
1685
- return T(n, [{
1686
- key: "init",
1687
- value: function() {
1688
- var e = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = arguments.length > 1 ? arguments[1] : void 0;
1689
- typeof i == "function" && (o = i, i = {}), !i.defaultNS && i.defaultNS !== !1 && i.ns && (typeof i.ns == "string" ? i.defaultNS = i.ns : i.ns.indexOf("translation") < 0 && (i.defaultNS = i.ns[0]));
1690
- var s = et();
1691
- this.options = M(M(M({}, s), this.options), tt(i)), this.options.compatibilityAPI !== "v1" && (this.options.interpolation = M(M({}, s.interpolation), this.options.interpolation)), i.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = i.keySeparator), i.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = i.nsSeparator);
1692
- function u(v) {
1693
- return v ? typeof v == "function" ? new v() : v : null;
1694
- }
1695
- if (!this.options.isClone) {
1696
- this.modules.logger ? $.init(u(this.modules.logger), this.options) : $.init(null, this.options);
1697
- var d;
1698
- this.modules.formatter ? d = this.modules.formatter : typeof Intl < "u" && (d = cn);
1699
- var c = new Je(this.options);
1700
- this.store = new Zt(this.options.resources, this.options);
1701
- var f = this.services;
1702
- f.logger = $, f.resourceStore = this.store, f.languageUtils = c, f.pluralResolver = new sn(c, {
1703
- prepend: this.options.pluralSeparator,
1704
- compatibilityJSON: this.options.compatibilityJSON,
1705
- simplifyPluralSuffix: this.options.simplifyPluralSuffix
1706
- }), d && (!this.options.interpolation.format || this.options.interpolation.format === s.interpolation.format) && (f.formatter = u(d), f.formatter.init(f, this.options), this.options.interpolation.format = f.formatter.format.bind(f.formatter)), f.interpolator = new un(this.options), f.utils = {
1707
- hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
1708
- }, f.backendConnector = new pn(u(this.modules.backend), f.resourceStore, f, this.options), f.backendConnector.on("*", function(v) {
1709
- for (var y = arguments.length, S = new Array(y > 1 ? y - 1 : 0), x = 1; x < y; x++)
1710
- S[x - 1] = arguments[x];
1711
- e.emit.apply(e, [v].concat(S));
1712
- }), this.modules.languageDetector && (f.languageDetector = u(this.modules.languageDetector), f.languageDetector.init && f.languageDetector.init(f, this.options.detection, this.options)), this.modules.i18nFormat && (f.i18nFormat = u(this.modules.i18nFormat), f.i18nFormat.init && f.i18nFormat.init(this)), this.translator = new ze(this.services, this.options), this.translator.on("*", function(v) {
1713
- for (var y = arguments.length, S = new Array(y > 1 ? y - 1 : 0), x = 1; x < y; x++)
1714
- S[x - 1] = arguments[x];
1715
- e.emit.apply(e, [v].concat(S));
1716
- }), this.modules.external.forEach(function(v) {
1717
- v.init && v.init(e);
1718
- });
1719
- }
1720
- if (this.format = this.options.interpolation.format, o || (o = pe), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1721
- var h = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1722
- h.length > 0 && h[0] !== "dev" && (this.options.lng = h[0]);
1723
- }
1724
- !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined");
1725
- var p = ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"];
1726
- p.forEach(function(v) {
1727
- e[v] = function() {
1728
- var y;
1729
- return (y = e.store)[v].apply(y, arguments);
1730
- };
1731
- });
1732
- var b = ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"];
1733
- b.forEach(function(v) {
1734
- e[v] = function() {
1735
- var y;
1736
- return (y = e.store)[v].apply(y, arguments), e;
1737
- };
1738
- });
1739
- var m = ae(), w = function() {
1740
- var y = function(x, R) {
1741
- e.isInitialized && !e.initializedStoreOnce && e.logger.warn("init: i18next is already initialized. You should call init just once!"), e.isInitialized = !0, e.options.isClone || e.logger.log("initialized", e.options), e.emit("initialized", e.options), m.resolve(R), o(x, R);
1742
- };
1743
- if (e.languages && e.options.compatibilityAPI !== "v1" && !e.isInitialized)
1744
- return y(null, e.t.bind(e));
1745
- e.changeLanguage(e.options.lng, y);
1746
- };
1747
- return this.options.resources || !this.options.initImmediate ? w() : setTimeout(w, 0), m;
1748
- }
1749
- }, {
1750
- key: "loadResources",
1751
- value: function(e) {
1752
- var i = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : pe, s = o, u = typeof e == "string" ? e : this.language;
1753
- if (typeof e == "function" && (s = e), !this.options.resources || this.options.partialBundledLanguages) {
1754
- if (u && u.toLowerCase() === "cimode")
1755
- return s();
1756
- var d = [], c = function(p) {
1757
- if (p) {
1758
- var b = i.services.languageUtils.toResolveHierarchy(p);
1759
- b.forEach(function(m) {
1760
- d.indexOf(m) < 0 && d.push(m);
1761
- });
1762
- }
1763
- };
1764
- if (u)
1765
- c(u);
1766
- else {
1767
- var f = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1768
- f.forEach(function(h) {
1769
- return c(h);
1770
- });
1771
- }
1772
- this.options.preload && this.options.preload.forEach(function(h) {
1773
- return c(h);
1774
- }), this.services.backendConnector.load(d, this.options.ns, function(h) {
1775
- !h && !i.resolvedLanguage && i.language && i.setResolvedLanguage(i.language), s(h);
1776
- });
1777
- } else
1778
- s(null);
1779
- }
1780
- }, {
1781
- key: "reloadResources",
1782
- value: function(e, i, o) {
1783
- var s = ae();
1784
- return e || (e = this.languages), i || (i = this.options.ns), o || (o = pe), this.services.backendConnector.reload(e, i, function(u) {
1785
- s.resolve(), o(u);
1786
- }), s;
1787
- }
1788
- }, {
1789
- key: "use",
1790
- value: function(e) {
1791
- if (!e)
1792
- throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1793
- if (!e.type)
1794
- throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1795
- return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && vt.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1796
- }
1797
- }, {
1798
- key: "setResolvedLanguage",
1799
- value: function(e) {
1800
- if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
1801
- for (var i = 0; i < this.languages.length; i++) {
1802
- var o = this.languages[i];
1803
- if (!(["cimode", "dev"].indexOf(o) > -1) && this.store.hasLanguageSomeTranslations(o)) {
1804
- this.resolvedLanguage = o;
1805
- break;
1806
- }
1807
- }
1808
- }
1809
- }, {
1810
- key: "changeLanguage",
1811
- value: function(e, i) {
1812
- var o = this;
1813
- this.isLanguageChangingTo = e;
1814
- var s = ae();
1815
- this.emit("languageChanging", e);
1816
- var u = function(h) {
1817
- o.language = h, o.languages = o.services.languageUtils.toResolveHierarchy(h), o.resolvedLanguage = void 0, o.setResolvedLanguage(h);
1818
- }, d = function(h, p) {
1819
- p ? (u(p), o.translator.changeLanguage(p), o.isLanguageChangingTo = void 0, o.emit("languageChanged", p), o.logger.log("languageChanged", p)) : o.isLanguageChangingTo = void 0, s.resolve(function() {
1820
- return o.t.apply(o, arguments);
1821
- }), i && i(h, function() {
1822
- return o.t.apply(o, arguments);
1823
- });
1824
- }, c = function(h) {
1825
- !e && !h && o.services.languageDetector && (h = []);
1826
- var p = typeof h == "string" ? h : o.services.languageUtils.getBestMatchFromCodes(h);
1827
- p && (o.language || u(p), o.translator.language || o.translator.changeLanguage(p), o.services.languageDetector && o.services.languageDetector.cacheUserLanguage && o.services.languageDetector.cacheUserLanguage(p)), o.loadResources(p, function(b) {
1828
- d(b, p);
1829
- });
1830
- };
1831
- return !e && this.services.languageDetector && !this.services.languageDetector.async ? c(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(c) : this.services.languageDetector.detect(c) : c(e), s;
1832
- }
1833
- }, {
1834
- key: "getFixedT",
1835
- value: function(e, i, o) {
1836
- var s = this, u = function d(c, f) {
1837
- var h;
1838
- if (Y(f) !== "object") {
1839
- for (var p = arguments.length, b = new Array(p > 2 ? p - 2 : 0), m = 2; m < p; m++)
1840
- b[m - 2] = arguments[m];
1841
- h = s.options.overloadTranslationOptionHandler([c, f].concat(b));
1842
- } else
1843
- h = M({}, f);
1844
- h.lng = h.lng || d.lng, h.lngs = h.lngs || d.lngs, h.ns = h.ns || d.ns, h.keyPrefix = h.keyPrefix || o || d.keyPrefix;
1845
- var w = s.options.keySeparator || ".", v;
1846
- return h.keyPrefix && Array.isArray(c) ? v = c.map(function(y) {
1847
- return "".concat(h.keyPrefix).concat(w).concat(y);
1848
- }) : v = h.keyPrefix ? "".concat(h.keyPrefix).concat(w).concat(c) : c, s.t(v, h);
1849
- };
1850
- return typeof e == "string" ? u.lng = e : u.lngs = e, u.ns = i, u.keyPrefix = o, u;
1851
- }
1852
- }, {
1853
- key: "t",
1854
- value: function() {
1855
- var e;
1856
- return this.translator && (e = this.translator).translate.apply(e, arguments);
1857
- }
1858
- }, {
1859
- key: "exists",
1860
- value: function() {
1861
- var e;
1862
- return this.translator && (e = this.translator).exists.apply(e, arguments);
1863
- }
1864
- }, {
1865
- key: "setDefaultNamespace",
1866
- value: function(e) {
1867
- this.options.defaultNS = e;
1868
- }
1869
- }, {
1870
- key: "hasLoadedNamespace",
1871
- value: function(e) {
1872
- var i = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1873
- if (!this.isInitialized)
1874
- return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1875
- if (!this.languages || !this.languages.length)
1876
- return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1877
- var s = o.lng || this.resolvedLanguage || this.languages[0], u = this.options ? this.options.fallbackLng : !1, d = this.languages[this.languages.length - 1];
1878
- if (s.toLowerCase() === "cimode")
1879
- return !0;
1880
- var c = function(p, b) {
1881
- var m = i.services.backendConnector.state["".concat(p, "|").concat(b)];
1882
- return m === -1 || m === 2;
1883
- };
1884
- if (o.precheck) {
1885
- var f = o.precheck(this, c);
1886
- if (f !== void 0)
1887
- return f;
1888
- }
1889
- return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || c(s, e) && (!u || c(d, e)));
1890
- }
1891
- }, {
1892
- key: "loadNamespaces",
1893
- value: function(e, i) {
1894
- var o = this, s = ae();
1895
- return this.options.ns ? (typeof e == "string" && (e = [e]), e.forEach(function(u) {
1896
- o.options.ns.indexOf(u) < 0 && o.options.ns.push(u);
1897
- }), this.loadResources(function(u) {
1898
- s.resolve(), i && i(u);
1899
- }), s) : (i && i(), Promise.resolve());
1900
- }
1901
- }, {
1902
- key: "loadLanguages",
1903
- value: function(e, i) {
1904
- var o = ae();
1905
- typeof e == "string" && (e = [e]);
1906
- var s = this.options.preload || [], u = e.filter(function(d) {
1907
- return s.indexOf(d) < 0;
1908
- });
1909
- return u.length ? (this.options.preload = s.concat(u), this.loadResources(function(d) {
1910
- o.resolve(), i && i(d);
1911
- }), o) : (i && i(), Promise.resolve());
1912
- }
1913
- }, {
1914
- key: "dir",
1915
- value: function(e) {
1916
- if (e || (e = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e)
1917
- return "rtl";
1918
- var i = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], o = this.services && this.services.languageUtils || new Je(et());
1919
- return i.indexOf(o.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1920
- }
1921
- }, {
1922
- key: "cloneInstance",
1923
- value: function() {
1924
- var e = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : pe, s = M(M(M({}, this.options), i), {
1925
- isClone: !0
1926
- }), u = new n(s);
1927
- (i.debug !== void 0 || i.prefix !== void 0) && (u.logger = u.logger.clone(i));
1928
- var d = ["store", "services", "language"];
1929
- return d.forEach(function(c) {
1930
- u[c] = e[c];
1931
- }), u.services = M({}, this.services), u.services.utils = {
1932
- hasLoadedNamespace: u.hasLoadedNamespace.bind(u)
1933
- }, u.translator = new ze(u.services, u.options), u.translator.on("*", function(c) {
1934
- for (var f = arguments.length, h = new Array(f > 1 ? f - 1 : 0), p = 1; p < f; p++)
1935
- h[p - 1] = arguments[p];
1936
- u.emit.apply(u, [c].concat(h));
1937
- }), u.init(s, o), u.translator.options = u.options, u.translator.backendConnector.services.utils = {
1938
- hasLoadedNamespace: u.hasLoadedNamespace.bind(u)
1939
- }, u;
1940
- }
1941
- }, {
1942
- key: "toJSON",
1943
- value: function() {
1944
- return {
1945
- options: this.options,
1946
- store: this.store,
1947
- language: this.language,
1948
- languages: this.languages,
1949
- resolvedLanguage: this.resolvedLanguage
1950
- };
1951
- }
1952
- }]), n;
1953
- }(X);
1954
- G(be, "createInstance", function() {
1955
- var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 ? arguments[1] : void 0;
1956
- return new be(a, r);
1957
- });
1958
- var _ = be.createInstance();
1959
- _.createInstance = be.createInstance;
1960
- _.createInstance;
1961
- _.dir;
1962
- _.init;
1963
- _.loadResources;
1964
- _.reloadResources;
1965
- _.use;
1966
- _.changeLanguage;
1967
- _.getFixedT;
1968
- var sr = _.t;
1969
- _.exists;
1970
- _.setDefaultNamespace;
1971
- _.hasLoadedNamespace;
1972
- _.loadNamespaces;
1973
- _.loadLanguages;
1974
- var yn = {
1975
- type: "3rdParty",
1976
- init: function(r) {
1977
- Dt(r.options.react), Tt(r);
1978
- }
1979
- };
1980
- function bn(a) {
1981
- var r = a.i18n, n = a.defaultNS, t = a.children, e = Ue.useMemo(function() {
1982
- return {
1983
- i18n: r,
1984
- defaultNS: n
1985
- };
1986
- }, [r, n]);
1987
- return Ue.createElement(It.Provider, {
1988
- value: e
1989
- }, t);
1990
- }
1991
- var mt = [], wn = mt.forEach, On = mt.slice;
1992
- function Sn(a) {
1993
- return wn.call(On.call(arguments, 1), function(r) {
1994
- if (r)
1995
- for (var n in r)
1996
- a[n] === void 0 && (a[n] = r[n]);
1997
- }), a;
1998
- }
1999
- var rt = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, xn = function(r, n, t) {
2000
- var e = t || {};
2001
- e.path = e.path || "/";
2002
- var i = encodeURIComponent(n), o = "".concat(r, "=").concat(i);
2003
- if (e.maxAge > 0) {
2004
- var s = e.maxAge - 0;
2005
- if (Number.isNaN(s))
2006
- throw new Error("maxAge should be a Number");
2007
- o += "; Max-Age=".concat(Math.floor(s));
2008
- }
2009
- if (e.domain) {
2010
- if (!rt.test(e.domain))
2011
- throw new TypeError("option domain is invalid");
2012
- o += "; Domain=".concat(e.domain);
2013
- }
2014
- if (e.path) {
2015
- if (!rt.test(e.path))
2016
- throw new TypeError("option path is invalid");
2017
- o += "; Path=".concat(e.path);
2018
- }
2019
- if (e.expires) {
2020
- if (typeof e.expires.toUTCString != "function")
2021
- throw new TypeError("option expires is invalid");
2022
- o += "; Expires=".concat(e.expires.toUTCString());
2023
- }
2024
- if (e.httpOnly && (o += "; HttpOnly"), e.secure && (o += "; Secure"), e.sameSite) {
2025
- var u = typeof e.sameSite == "string" ? e.sameSite.toLowerCase() : e.sameSite;
2026
- switch (u) {
2027
- case !0:
2028
- o += "; SameSite=Strict";
2029
- break;
2030
- case "lax":
2031
- o += "; SameSite=Lax";
2032
- break;
2033
- case "strict":
2034
- o += "; SameSite=Strict";
2035
- break;
2036
- case "none":
2037
- o += "; SameSite=None";
2038
- break;
2039
- default:
2040
- throw new TypeError("option sameSite is invalid");
2041
- }
2042
- }
2043
- return o;
2044
- }, it = {
2045
- create: function(r, n, t, e) {
2046
- var i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
2047
- path: "/",
2048
- sameSite: "strict"
2049
- };
2050
- t && (i.expires = /* @__PURE__ */ new Date(), i.expires.setTime(i.expires.getTime() + t * 60 * 1e3)), e && (i.domain = e), document.cookie = xn(r, encodeURIComponent(n), i);
2051
- },
2052
- read: function(r) {
2053
- for (var n = "".concat(r, "="), t = document.cookie.split(";"), e = 0; e < t.length; e++) {
2054
- for (var i = t[e]; i.charAt(0) === " "; )
2055
- i = i.substring(1, i.length);
2056
- if (i.indexOf(n) === 0)
2057
- return i.substring(n.length, i.length);
2058
- }
2059
- return null;
2060
- },
2061
- remove: function(r) {
2062
- this.create(r, "", -1);
2063
- }
2064
- }, Pn = {
2065
- name: "cookie",
2066
- lookup: function(r) {
2067
- var n;
2068
- if (r.lookupCookie && typeof document < "u") {
2069
- var t = it.read(r.lookupCookie);
2070
- t && (n = t);
2071
- }
2072
- return n;
2073
- },
2074
- cacheUserLanguage: function(r, n) {
2075
- n.lookupCookie && typeof document < "u" && it.create(n.lookupCookie, r, n.cookieMinutes, n.cookieDomain, n.cookieOptions);
2076
- }
2077
- }, kn = {
2078
- name: "querystring",
2079
- lookup: function(r) {
2080
- var n;
2081
- if (typeof window < "u") {
2082
- var t = window.location.search;
2083
- !window.location.search && window.location.hash && window.location.hash.indexOf("?") > -1 && (t = window.location.hash.substring(window.location.hash.indexOf("?")));
2084
- for (var e = t.substring(1), i = e.split("&"), o = 0; o < i.length; o++) {
2085
- var s = i[o].indexOf("=");
2086
- if (s > 0) {
2087
- var u = i[o].substring(0, s);
2088
- u === r.lookupQuerystring && (n = i[o].substring(s + 1));
2089
- }
2090
- }
2091
- }
2092
- return n;
2093
- }
2094
- }, oe = null, at = function() {
2095
- if (oe !== null)
2096
- return oe;
2097
- try {
2098
- oe = window !== "undefined" && window.localStorage !== null;
2099
- var r = "i18next.translate.boo";
2100
- window.localStorage.setItem(r, "foo"), window.localStorage.removeItem(r);
2101
- } catch {
2102
- oe = !1;
2103
- }
2104
- return oe;
2105
- }, jn = {
2106
- name: "localStorage",
2107
- lookup: function(r) {
2108
- var n;
2109
- if (r.lookupLocalStorage && at()) {
2110
- var t = window.localStorage.getItem(r.lookupLocalStorage);
2111
- t && (n = t);
2112
- }
2113
- return n;
2114
- },
2115
- cacheUserLanguage: function(r, n) {
2116
- n.lookupLocalStorage && at() && window.localStorage.setItem(n.lookupLocalStorage, r);
2117
- }
2118
- }, se = null, ot = function() {
2119
- if (se !== null)
2120
- return se;
2121
- try {
2122
- se = window !== "undefined" && window.sessionStorage !== null;
2123
- var r = "i18next.translate.boo";
2124
- window.sessionStorage.setItem(r, "foo"), window.sessionStorage.removeItem(r);
2125
- } catch {
2126
- se = !1;
2127
- }
2128
- return se;
2129
- }, Ln = {
2130
- name: "sessionStorage",
2131
- lookup: function(r) {
2132
- var n;
2133
- if (r.lookupSessionStorage && ot()) {
2134
- var t = window.sessionStorage.getItem(r.lookupSessionStorage);
2135
- t && (n = t);
2136
- }
2137
- return n;
2138
- },
2139
- cacheUserLanguage: function(r, n) {
2140
- n.lookupSessionStorage && ot() && window.sessionStorage.setItem(n.lookupSessionStorage, r);
2141
- }
2142
- }, Rn = {
2143
- name: "navigator",
2144
- lookup: function(r) {
2145
- var n = [];
2146
- if (typeof navigator < "u") {
2147
- if (navigator.languages)
2148
- for (var t = 0; t < navigator.languages.length; t++)
2149
- n.push(navigator.languages[t]);
2150
- navigator.userLanguage && n.push(navigator.userLanguage), navigator.language && n.push(navigator.language);
2151
- }
2152
- return n.length > 0 ? n : void 0;
2153
- }
2154
- }, _n = {
2155
- name: "htmlTag",
2156
- lookup: function(r) {
2157
- var n, t = r.htmlTag || (typeof document < "u" ? document.documentElement : null);
2158
- return t && typeof t.getAttribute == "function" && (n = t.getAttribute("lang")), n;
2159
- }
2160
- }, En = {
2161
- name: "path",
2162
- lookup: function(r) {
2163
- var n;
2164
- if (typeof window < "u") {
2165
- var t = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
2166
- if (t instanceof Array)
2167
- if (typeof r.lookupFromPathIndex == "number") {
2168
- if (typeof t[r.lookupFromPathIndex] != "string")
2169
- return;
2170
- n = t[r.lookupFromPathIndex].replace("/", "");
2171
- } else
2172
- n = t[0].replace("/", "");
2173
- }
2174
- return n;
2175
- }
2176
- }, Cn = {
2177
- name: "subdomain",
2178
- lookup: function(r) {
2179
- var n = typeof r.lookupFromSubdomainIndex == "number" ? r.lookupFromSubdomainIndex + 1 : 1, t = 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);
2180
- if (t)
2181
- return t[n];
2182
- }
2183
- }, yt = !1;
2184
- try {
2185
- document.cookie, yt = !0;
2186
- } catch {
2187
- }
2188
- var bt = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
2189
- yt || bt.splice(1, 1);
2190
- function Nn() {
2191
- return {
2192
- order: bt,
2193
- lookupQuerystring: "lng",
2194
- lookupCookie: "i18next",
2195
- lookupLocalStorage: "i18nextLng",
2196
- lookupSessionStorage: "i18nextLng",
2197
- // cache user language
2198
- caches: ["localStorage"],
2199
- excludeCacheFor: ["cimode"],
2200
- // cookieMinutes: 10,
2201
- // cookieDomain: 'myDomain'
2202
- convertDetectedLanguage: function(r) {
2203
- return r;
2204
- }
2205
- };
2206
- }
2207
- var wt = /* @__PURE__ */ function() {
2208
- function a(r) {
2209
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2210
- I(this, a), this.type = "languageDetector", this.detectors = {}, this.init(r, n);
2211
- }
2212
- return T(a, [{
2213
- key: "init",
2214
- value: function(n) {
2215
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2216
- this.services = n || {
2217
- languageUtils: {}
2218
- }, this.options = Sn(t, this.options || {}, Nn()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = function(i) {
2219
- return i.replace("-", "_");
2220
- }), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = e, this.addDetector(Pn), this.addDetector(kn), this.addDetector(jn), this.addDetector(Ln), this.addDetector(Rn), this.addDetector(_n), this.addDetector(En), this.addDetector(Cn);
2221
- }
2222
- }, {
2223
- key: "addDetector",
2224
- value: function(n) {
2225
- return this.detectors[n.name] = n, this;
2226
- }
2227
- }, {
2228
- key: "detect",
2229
- value: function(n) {
2230
- var t = this;
2231
- n || (n = this.options.order);
2232
- var e = [];
2233
- return n.forEach(function(i) {
2234
- if (t.detectors[i]) {
2235
- var o = t.detectors[i].lookup(t.options);
2236
- o && typeof o == "string" && (o = [o]), o && (e = e.concat(o));
2237
- }
2238
- }), e = e.map(function(i) {
2239
- return t.options.convertDetectedLanguage(i);
2240
- }), this.services.languageUtils.getBestMatchFromCodes ? e : e.length > 0 ? e[0] : null;
2241
- }
2242
- }, {
2243
- key: "cacheUserLanguage",
2244
- value: function(n, t) {
2245
- var e = this;
2246
- t || (t = this.options.caches), t && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(n) > -1 || t.forEach(function(i) {
2247
- e.detectors[i] && e.detectors[i].cacheUserLanguage(n, e.options);
2248
- }));
2249
- }
2250
- }]);
2251
- }();
2252
- wt.type = "languageDetector";
2253
- var Ot = [], An = Ot.forEach, Dn = Ot.slice;
2254
- function Tn(a) {
2255
- return An.call(Dn.call(arguments, 1), function(r) {
2256
- if (r)
2257
- for (var n in r)
2258
- a[n] === void 0 && (a[n] = r[n]);
2259
- }), a;
2260
- }
2261
- function In(a) {
2262
- return a ? typeof a == "function" ? new a() : a : null;
2263
- }
2264
- function Fn() {
2265
- return {
2266
- handleEmptyResourcesAsFailed: !0,
2267
- cacheHitMode: "none"
2268
- // reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000
2269
- // refreshExpirationTime: 60 * 60 * 1000
2270
- };
2271
- }
2272
- function st(a, r, n, t) {
2273
- var e = a.read.bind(a);
2274
- if (e.length === 2) {
2275
- try {
2276
- var i = e(r, n);
2277
- i && typeof i.then == "function" ? i.then(function(o) {
2278
- return t(null, o);
2279
- }).catch(t) : t(null, i);
2280
- } catch (o) {
2281
- t(o);
2282
- }
2283
- return;
2284
- }
2285
- e(r, n, t);
2286
- }
2287
- var St = /* @__PURE__ */ function() {
2288
- function a(r) {
2289
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2290
- I(this, a), this.backends = [], this.type = "backend", this.allOptions = t, this.init(r, n);
2291
- }
2292
- return T(a, [{
2293
- key: "init",
2294
- value: function(n) {
2295
- var t = this, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2296
- this.services = n, this.options = Tn(e, this.options || {}, Fn()), this.allOptions = i, this.options.backends && this.options.backends.forEach(function(o, s) {
2297
- t.backends[s] = t.backends[s] || In(o), t.backends[s].init(n, t.options.backendOptions && t.options.backendOptions[s] || {}, i);
2298
- }), this.services && this.options.reloadInterval && setInterval(function() {
2299
- return t.reload();
2300
- }, this.options.reloadInterval);
2301
- }
2302
- }, {
2303
- key: "read",
2304
- value: function(n, t, e) {
2305
- var i = this, o = this.backends.length, s = function d(c) {
2306
- if (c >= o)
2307
- return e(new Error("non of the backend loaded data", !0));
2308
- var f = c === o - 1, h = i.options.handleEmptyResourcesAsFailed && !f ? 0 : -1, p = i.backends[c];
2309
- p.read ? st(p, n, t, function(b, m, w) {
2310
- if (!b && m && Object.keys(m).length > h) {
2311
- if (e(null, m, c), u(c - 1, m), p.save && i.options.cacheHitMode && ["refresh", "refreshAndUpdateStore"].indexOf(i.options.cacheHitMode) > -1) {
2312
- if (w && i.options.refreshExpirationTime && w + i.options.refreshExpirationTime > Date.now())
2313
- return;
2314
- var v = i.backends[c + 1];
2315
- v && v.read && st(v, n, t, function(y, S) {
2316
- y || S && (Object.keys(S).length <= h || (u(c, S), i.options.cacheHitMode === "refreshAndUpdateStore" && i.services && i.services.resourceStore && i.services.resourceStore.addResourceBundle(n, t, S)));
2317
- });
2318
- }
2319
- } else
2320
- d(c + 1);
2321
- }) : d(c + 1);
2322
- }, u = function d(c, f) {
2323
- if (!(c < 0)) {
2324
- var h = i.backends[c];
2325
- h.save && h.save(n, t, f), d(c - 1, f);
2326
- }
2327
- };
2328
- s(0);
2329
- }
2330
- }, {
2331
- key: "create",
2332
- value: function(n, t, e, i) {
2333
- var o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : function() {
2334
- }, s = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
2335
- this.backends.forEach(function(u) {
2336
- if (u.create) {
2337
- var d = u.create.bind(u);
2338
- if (d.length < 6) {
2339
- try {
2340
- var c;
2341
- d.length === 5 ? c = d(n, t, e, i, s) : c = d(n, t, e, i), c && typeof c.then == "function" ? c.then(function(f) {
2342
- return o(null, f);
2343
- }).catch(o) : o(null, c);
2344
- } catch (f) {
2345
- o(f);
2346
- }
2347
- return;
2348
- }
2349
- d(n, t, e, i, o, s);
2350
- }
2351
- });
2352
- }
2353
- }, {
2354
- key: "reload",
2355
- value: function() {
2356
- var n = this, t = this.services, e = t.backendConnector, i = t.languageUtils, o = t.logger, s = e.language;
2357
- if (!(s && s.toLowerCase() === "cimode")) {
2358
- var u = [], d = function(f) {
2359
- var h = i.toResolveHierarchy(f);
2360
- h.forEach(function(p) {
2361
- u.indexOf(p) < 0 && u.push(p);
2362
- });
2363
- };
2364
- d(s), this.allOptions.preload && this.allOptions.preload.forEach(function(c) {
2365
- return d(c);
2366
- }), u.forEach(function(c) {
2367
- n.allOptions.ns.forEach(function(f) {
2368
- e.read(c, f, "read", null, null, function(h, p) {
2369
- h && o.warn("loading namespace ".concat(f, " for language ").concat(c, " failed"), h), !h && p && o.log("loaded namespace ".concat(f, " for language ").concat(c), p), e.loaded("".concat(c, "|").concat(f), h, p);
2370
- });
2371
- });
2372
- });
2373
- }
2374
- }
2375
- }]), a;
2376
- }();
2377
- St.type = "backend";
2378
- function Ee(a) {
2379
- "@babel/helpers - typeof";
2380
- return Ee = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
2381
- return typeof r;
2382
- } : function(r) {
2383
- return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
2384
- }, Ee(a);
2385
- }
2386
- function xt() {
2387
- return typeof XMLHttpRequest == "function" || (typeof XMLHttpRequest > "u" ? "undefined" : Ee(XMLHttpRequest)) === "object";
2388
- }
2389
- function Un(a) {
2390
- return !!a && typeof a.then == "function";
2391
- }
2392
- function Bn(a) {
2393
- return Un(a) ? a : Promise.resolve(a);
2394
- }
2395
- function Hn(a) {
2396
- throw new Error('Could not dynamically require "' + a + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
2397
- }
2398
- var Ce = { exports: {} }, ge = { exports: {} }, ut;
2399
- function Mn() {
2400
- return ut || (ut = 1, function(a, r) {
2401
- var n = typeof globalThis < "u" && globalThis || typeof self < "u" && self || typeof ue < "u" && ue, t = function() {
2402
- function i() {
2403
- this.fetch = !1, this.DOMException = n.DOMException;
2404
- }
2405
- return i.prototype = n, new i();
2406
- }();
2407
- (function(i) {
2408
- (function(o) {
2409
- var s = typeof i < "u" && i || typeof self < "u" && self || typeof s < "u" && s, u = {
2410
- searchParams: "URLSearchParams" in s,
2411
- iterable: "Symbol" in s && "iterator" in Symbol,
2412
- blob: "FileReader" in s && "Blob" in s && function() {
2413
- try {
2414
- return new Blob(), !0;
2415
- } catch {
2416
- return !1;
2417
- }
2418
- }(),
2419
- formData: "FormData" in s,
2420
- arrayBuffer: "ArrayBuffer" in s
2421
- };
2422
- function d(l) {
2423
- return l && DataView.prototype.isPrototypeOf(l);
2424
- }
2425
- if (u.arrayBuffer)
2426
- var c = [
2427
- "[object Int8Array]",
2428
- "[object Uint8Array]",
2429
- "[object Uint8ClampedArray]",
2430
- "[object Int16Array]",
2431
- "[object Uint16Array]",
2432
- "[object Int32Array]",
2433
- "[object Uint32Array]",
2434
- "[object Float32Array]",
2435
- "[object Float64Array]"
2436
- ], f = ArrayBuffer.isView || function(l) {
2437
- return l && c.indexOf(Object.prototype.toString.call(l)) > -1;
2438
- };
2439
- function h(l) {
2440
- if (typeof l != "string" && (l = String(l)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(l) || l === "")
2441
- throw new TypeError('Invalid character in header field name: "' + l + '"');
2442
- return l.toLowerCase();
2443
- }
2444
- function p(l) {
2445
- return typeof l != "string" && (l = String(l)), l;
2446
- }
2447
- function b(l) {
2448
- var g = {
2449
- next: function() {
2450
- var O = l.shift();
2451
- return { done: O === void 0, value: O };
2452
- }
2453
- };
2454
- return u.iterable && (g[Symbol.iterator] = function() {
2455
- return g;
2456
- }), g;
2457
- }
2458
- function m(l) {
2459
- this.map = {}, l instanceof m ? l.forEach(function(g, O) {
2460
- this.append(O, g);
2461
- }, this) : Array.isArray(l) ? l.forEach(function(g) {
2462
- this.append(g[0], g[1]);
2463
- }, this) : l && Object.getOwnPropertyNames(l).forEach(function(g) {
2464
- this.append(g, l[g]);
2465
- }, this);
2466
- }
2467
- m.prototype.append = function(l, g) {
2468
- l = h(l), g = p(g);
2469
- var O = this.map[l];
2470
- this.map[l] = O ? O + ", " + g : g;
2471
- }, m.prototype.delete = function(l) {
2472
- delete this.map[h(l)];
2473
- }, m.prototype.get = function(l) {
2474
- return l = h(l), this.has(l) ? this.map[l] : null;
2475
- }, m.prototype.has = function(l) {
2476
- return this.map.hasOwnProperty(h(l));
2477
- }, m.prototype.set = function(l, g) {
2478
- this.map[h(l)] = p(g);
2479
- }, m.prototype.forEach = function(l, g) {
2480
- for (var O in this.map)
2481
- this.map.hasOwnProperty(O) && l.call(g, this.map[O], O, this);
2482
- }, m.prototype.keys = function() {
2483
- var l = [];
2484
- return this.forEach(function(g, O) {
2485
- l.push(O);
2486
- }), b(l);
2487
- }, m.prototype.values = function() {
2488
- var l = [];
2489
- return this.forEach(function(g) {
2490
- l.push(g);
2491
- }), b(l);
2492
- }, m.prototype.entries = function() {
2493
- var l = [];
2494
- return this.forEach(function(g, O) {
2495
- l.push([O, g]);
2496
- }), b(l);
2497
- }, u.iterable && (m.prototype[Symbol.iterator] = m.prototype.entries);
2498
- function w(l) {
2499
- if (l.bodyUsed)
2500
- return Promise.reject(new TypeError("Already read"));
2501
- l.bodyUsed = !0;
2502
- }
2503
- function v(l) {
2504
- return new Promise(function(g, O) {
2505
- l.onload = function() {
2506
- g(l.result);
2507
- }, l.onerror = function() {
2508
- O(l.error);
2509
- };
2510
- });
2511
- }
2512
- function y(l) {
2513
- var g = new FileReader(), O = v(g);
2514
- return g.readAsArrayBuffer(l), O;
2515
- }
2516
- function S(l) {
2517
- var g = new FileReader(), O = v(g);
2518
- return g.readAsText(l), O;
2519
- }
2520
- function x(l) {
2521
- for (var g = new Uint8Array(l), O = new Array(g.length), k = 0; k < g.length; k++)
2522
- O[k] = String.fromCharCode(g[k]);
2523
- return O.join("");
2524
- }
2525
- function R(l) {
2526
- if (l.slice)
2527
- return l.slice(0);
2528
- var g = new Uint8Array(l.byteLength);
2529
- return g.set(new Uint8Array(l)), g.buffer;
2530
- }
2531
- function D() {
2532
- return this.bodyUsed = !1, this._initBody = function(l) {
2533
- this.bodyUsed = this.bodyUsed, this._bodyInit = l, l ? typeof l == "string" ? this._bodyText = l : u.blob && Blob.prototype.isPrototypeOf(l) ? this._bodyBlob = l : u.formData && FormData.prototype.isPrototypeOf(l) ? this._bodyFormData = l : u.searchParams && URLSearchParams.prototype.isPrototypeOf(l) ? this._bodyText = l.toString() : u.arrayBuffer && u.blob && d(l) ? (this._bodyArrayBuffer = R(l.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : u.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(l) || f(l)) ? this._bodyArrayBuffer = R(l) : this._bodyText = l = Object.prototype.toString.call(l) : this._bodyText = "", this.headers.get("content-type") || (typeof l == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : u.searchParams && URLSearchParams.prototype.isPrototypeOf(l) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
2534
- }, u.blob && (this.blob = function() {
2535
- var l = w(this);
2536
- if (l)
2537
- return l;
2538
- if (this._bodyBlob)
2539
- return Promise.resolve(this._bodyBlob);
2540
- if (this._bodyArrayBuffer)
2541
- return Promise.resolve(new Blob([this._bodyArrayBuffer]));
2542
- if (this._bodyFormData)
2543
- throw new Error("could not read FormData body as blob");
2544
- return Promise.resolve(new Blob([this._bodyText]));
2545
- }, this.arrayBuffer = function() {
2546
- if (this._bodyArrayBuffer) {
2547
- var l = w(this);
2548
- return l || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(
2549
- this._bodyArrayBuffer.buffer.slice(
2550
- this._bodyArrayBuffer.byteOffset,
2551
- this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
2552
- )
2553
- ) : Promise.resolve(this._bodyArrayBuffer));
2554
- } else
2555
- return this.blob().then(y);
2556
- }), this.text = function() {
2557
- var l = w(this);
2558
- if (l)
2559
- return l;
2560
- if (this._bodyBlob)
2561
- return S(this._bodyBlob);
2562
- if (this._bodyArrayBuffer)
2563
- return Promise.resolve(x(this._bodyArrayBuffer));
2564
- if (this._bodyFormData)
2565
- throw new Error("could not read FormData body as text");
2566
- return Promise.resolve(this._bodyText);
2567
- }, u.formData && (this.formData = function() {
2568
- return this.text().then(z);
2569
- }), this.json = function() {
2570
- return this.text().then(JSON.parse);
2571
- }, this;
2572
- }
2573
- var K = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
2574
- function Q(l) {
2575
- var g = l.toUpperCase();
2576
- return K.indexOf(g) > -1 ? g : l;
2577
- }
2578
- function N(l, g) {
2579
- if (!(this instanceof N))
2580
- throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
2581
- g = g || {};
2582
- var O = g.body;
2583
- if (l instanceof N) {
2584
- if (l.bodyUsed)
2585
- throw new TypeError("Already read");
2586
- this.url = l.url, this.credentials = l.credentials, g.headers || (this.headers = new m(l.headers)), this.method = l.method, this.mode = l.mode, this.signal = l.signal, !O && l._bodyInit != null && (O = l._bodyInit, l.bodyUsed = !0);
2587
- } else
2588
- this.url = String(l);
2589
- if (this.credentials = g.credentials || this.credentials || "same-origin", (g.headers || !this.headers) && (this.headers = new m(g.headers)), this.method = Q(g.method || this.method || "GET"), this.mode = g.mode || this.mode || null, this.signal = g.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && O)
2590
- throw new TypeError("Body not allowed for GET or HEAD requests");
2591
- if (this._initBody(O), (this.method === "GET" || this.method === "HEAD") && (g.cache === "no-store" || g.cache === "no-cache")) {
2592
- var k = /([?&])_=[^&]*/;
2593
- if (k.test(this.url))
2594
- this.url = this.url.replace(k, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
2595
- else {
2596
- var j = /\?/;
2597
- this.url += (j.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
2598
- }
2599
- }
2600
- }
2601
- N.prototype.clone = function() {
2602
- return new N(this, { body: this._bodyInit });
2603
- };
2604
- function z(l) {
2605
- var g = new FormData();
2606
- return l.trim().split("&").forEach(function(O) {
2607
- if (O) {
2608
- var k = O.split("="), j = k.shift().replace(/\+/g, " "), P = k.join("=").replace(/\+/g, " ");
2609
- g.append(decodeURIComponent(j), decodeURIComponent(P));
2610
- }
2611
- }), g;
2612
- }
2613
- function le(l) {
2614
- var g = new m(), O = l.replace(/\r?\n[\t ]+/g, " ");
2615
- return O.split("\r").map(function(k) {
2616
- return k.indexOf(`
2617
- `) === 0 ? k.substr(1, k.length) : k;
2618
- }).forEach(function(k) {
2619
- var j = k.split(":"), P = j.shift().trim();
2620
- if (P) {
2621
- var B = j.join(":").trim();
2622
- g.append(P, B);
2623
- }
2624
- }), g;
2625
- }
2626
- D.call(N.prototype);
2627
- function E(l, g) {
2628
- if (!(this instanceof E))
2629
- throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
2630
- g || (g = {}), this.type = "default", this.status = g.status === void 0 ? 200 : g.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = g.statusText === void 0 ? "" : "" + g.statusText, this.headers = new m(g.headers), this.url = g.url || "", this._initBody(l);
2631
- }
2632
- D.call(E.prototype), E.prototype.clone = function() {
2633
- return new E(this._bodyInit, {
2634
- status: this.status,
2635
- statusText: this.statusText,
2636
- headers: new m(this.headers),
2637
- url: this.url
2638
- });
2639
- }, E.error = function() {
2640
- var l = new E(null, { status: 0, statusText: "" });
2641
- return l.type = "error", l;
2642
- };
2643
- var xe = [301, 302, 303, 307, 308];
2644
- E.redirect = function(l, g) {
2645
- if (xe.indexOf(g) === -1)
2646
- throw new RangeError("Invalid status code");
2647
- return new E(null, { status: g, headers: { location: l } });
2648
- }, o.DOMException = s.DOMException;
2649
- try {
2650
- new o.DOMException();
2651
- } catch {
2652
- o.DOMException = function(g, O) {
2653
- this.message = g, this.name = O;
2654
- var k = Error(g);
2655
- this.stack = k.stack;
2656
- }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
2657
- }
2658
- function U(l, g) {
2659
- return new Promise(function(O, k) {
2660
- var j = new N(l, g);
2661
- if (j.signal && j.signal.aborted)
2662
- return k(new o.DOMException("Aborted", "AbortError"));
2663
- var P = new XMLHttpRequest();
2664
- function B() {
2665
- P.abort();
2666
- }
2667
- P.onload = function() {
2668
- var A = {
2669
- status: P.status,
2670
- statusText: P.statusText,
2671
- headers: le(P.getAllResponseHeaders() || "")
2672
- };
2673
- A.url = "responseURL" in P ? P.responseURL : A.headers.get("X-Request-URL");
2674
- var H = "response" in P ? P.response : P.responseText;
2675
- setTimeout(function() {
2676
- O(new E(H, A));
2677
- }, 0);
2678
- }, P.onerror = function() {
2679
- setTimeout(function() {
2680
- k(new TypeError("Network request failed"));
2681
- }, 0);
2682
- }, P.ontimeout = function() {
2683
- setTimeout(function() {
2684
- k(new TypeError("Network request failed"));
2685
- }, 0);
2686
- }, P.onabort = function() {
2687
- setTimeout(function() {
2688
- k(new o.DOMException("Aborted", "AbortError"));
2689
- }, 0);
2690
- };
2691
- function Pe(A) {
2692
- try {
2693
- return A === "" && s.location.href ? s.location.href : A;
2694
- } catch {
2695
- return A;
2696
- }
2697
- }
2698
- P.open(j.method, Pe(j.url), !0), j.credentials === "include" ? P.withCredentials = !0 : j.credentials === "omit" && (P.withCredentials = !1), "responseType" in P && (u.blob ? P.responseType = "blob" : u.arrayBuffer && j.headers.get("Content-Type") && j.headers.get("Content-Type").indexOf("application/octet-stream") !== -1 && (P.responseType = "arraybuffer")), g && typeof g.headers == "object" && !(g.headers instanceof m) ? Object.getOwnPropertyNames(g.headers).forEach(function(A) {
2699
- P.setRequestHeader(A, p(g.headers[A]));
2700
- }) : j.headers.forEach(function(A, H) {
2701
- P.setRequestHeader(H, A);
2702
- }), j.signal && (j.signal.addEventListener("abort", B), P.onreadystatechange = function() {
2703
- P.readyState === 4 && j.signal.removeEventListener("abort", B);
2704
- }), P.send(typeof j._bodyInit > "u" ? null : j._bodyInit);
2705
- });
2706
- }
2707
- return U.polyfill = !0, s.fetch || (s.fetch = U, s.Headers = m, s.Request = N, s.Response = E), o.Headers = m, o.Request = N, o.Response = E, o.fetch = U, o;
2708
- })({});
2709
- })(t), t.fetch.ponyfill = !0, delete t.fetch.polyfill;
2710
- var e = n.fetch ? n : t;
2711
- r = e.fetch, r.default = e.fetch, r.fetch = e.fetch, r.Headers = e.Headers, r.Request = e.Request, r.Response = e.Response, a.exports = r;
2712
- }(ge, ge.exports)), ge.exports;
2713
- }
2714
- (function(a, r) {
2715
- var n = typeof fetch == "function" ? fetch : void 0;
2716
- if (typeof ue < "u" && ue.fetch ? n = ue.fetch : typeof window < "u" && window.fetch && (n = window.fetch), typeof Hn < "u" && typeof window > "u") {
2717
- var t = n || Mn();
2718
- t.default && (t = t.default), r.default = t, a.exports = r.default;
2719
- }
2720
- })(Ce, Ce.exports);
2721
- var Pt = Ce.exports;
2722
- const kt = /* @__PURE__ */ _t(Pt), ft = /* @__PURE__ */ Bt({
2723
- __proto__: null,
2724
- default: kt
2725
- }, [Pt]);
2726
- function ct(a, r) {
2727
- var n = Object.keys(a);
2728
- if (Object.getOwnPropertySymbols) {
2729
- var t = Object.getOwnPropertySymbols(a);
2730
- r && (t = t.filter(function(e) {
2731
- return Object.getOwnPropertyDescriptor(a, e).enumerable;
2732
- })), n.push.apply(n, t);
2733
- }
2734
- return n;
2735
- }
2736
- function lt(a) {
2737
- for (var r = 1; r < arguments.length; r++) {
2738
- var n = arguments[r] != null ? arguments[r] : {};
2739
- r % 2 ? ct(Object(n), !0).forEach(function(t) {
2740
- $n(a, t, n[t]);
2741
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(n)) : ct(Object(n)).forEach(function(t) {
2742
- Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(n, t));
2743
- });
2744
- }
2745
- return a;
2746
- }
2747
- function $n(a, r, n) {
2748
- return (r = qn(r)) in a ? Object.defineProperty(a, r, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : a[r] = n, a;
2749
- }
2750
- function qn(a) {
2751
- var r = Kn(a, "string");
2752
- return Z(r) == "symbol" ? r : r + "";
2753
- }
2754
- function Kn(a, r) {
2755
- if (Z(a) != "object" || !a)
2756
- return a;
2757
- var n = a[Symbol.toPrimitive];
2758
- if (n !== void 0) {
2759
- var t = n.call(a, r);
2760
- if (Z(t) != "object")
2761
- return t;
2762
- throw new TypeError("@@toPrimitive must return a primitive value.");
2763
- }
2764
- return (r === "string" ? String : Number)(a);
2765
- }
2766
- function Z(a) {
2767
- "@babel/helpers - typeof";
2768
- return Z = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
2769
- return typeof r;
2770
- } : function(r) {
2771
- return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
2772
- }, Z(a);
2773
- }
2774
- var W = typeof fetch == "function" ? fetch : void 0;
2775
- typeof global < "u" && global.fetch ? W = global.fetch : typeof window < "u" && window.fetch && (W = window.fetch);
2776
- var fe;
2777
- xt() && (typeof global < "u" && global.XMLHttpRequest ? fe = global.XMLHttpRequest : typeof window < "u" && window.XMLHttpRequest && (fe = window.XMLHttpRequest));
2778
- var we;
2779
- typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObject ? we = global.ActiveXObject : typeof window < "u" && window.ActiveXObject && (we = window.ActiveXObject));
2780
- !W && ft && !fe && !we && (W = kt || ft);
2781
- typeof W != "function" && (W = void 0);
2782
- var Ne = function(r, n) {
2783
- if (n && Z(n) === "object") {
2784
- var t = "";
2785
- for (var e in n)
2786
- t += "&" + encodeURIComponent(e) + "=" + encodeURIComponent(n[e]);
2787
- if (!t)
2788
- return r;
2789
- r = r + (r.indexOf("?") !== -1 ? "&" : "?") + t.slice(1);
2790
- }
2791
- return r;
2792
- }, dt = function(r, n, t, e) {
2793
- var i = function(u) {
2794
- if (!u.ok)
2795
- return t(u.statusText || "Error", {
2796
- status: u.status
2797
- });
2798
- u.text().then(function(d) {
2799
- t(null, {
2800
- status: u.status,
2801
- data: d
2802
- });
2803
- }).catch(t);
2804
- };
2805
- if (e) {
2806
- var o = e(r, n);
2807
- if (o instanceof Promise) {
2808
- o.then(i).catch(t);
2809
- return;
2810
- }
2811
- }
2812
- typeof fetch == "function" ? fetch(r, n).then(i).catch(t) : W(r, n).then(i).catch(t);
2813
- }, ht = !1, Vn = function(r, n, t, e) {
2814
- r.queryStringParams && (n = Ne(n, r.queryStringParams));
2815
- var i = lt({}, typeof r.customHeaders == "function" ? r.customHeaders() : r.customHeaders);
2816
- typeof window > "u" && typeof global < "u" && typeof global.process < "u" && global.process.versions && global.process.versions.node && (i["User-Agent"] = "i18next-http-backend (node/".concat(global.process.version, "; ").concat(global.process.platform, " ").concat(global.process.arch, ")")), t && (i["Content-Type"] = "application/json");
2817
- var o = typeof r.requestOptions == "function" ? r.requestOptions(t) : r.requestOptions, s = lt({
2818
- method: t ? "POST" : "GET",
2819
- body: t ? r.stringify(t) : void 0,
2820
- headers: i
2821
- }, ht ? {} : o), u = typeof r.alternateFetch == "function" && r.alternateFetch.length >= 1 ? r.alternateFetch : void 0;
2822
- try {
2823
- dt(n, s, e, u);
2824
- } catch (d) {
2825
- if (!o || Object.keys(o).length === 0 || !d.message || d.message.indexOf("not implemented") < 0)
2826
- return e(d);
2827
- try {
2828
- Object.keys(o).forEach(function(c) {
2829
- delete s[c];
2830
- }), dt(n, s, e, u), ht = !0;
2831
- } catch (c) {
2832
- e(c);
2833
- }
2834
- }
2835
- }, zn = function(r, n, t, e) {
2836
- t && Z(t) === "object" && (t = Ne("", t).slice(1)), r.queryStringParams && (n = Ne(n, r.queryStringParams));
2837
- try {
2838
- var i;
2839
- fe ? i = new fe() : i = new we("MSXML2.XMLHTTP.3.0"), i.open(t ? "POST" : "GET", n, 1), r.crossDomain || i.setRequestHeader("X-Requested-With", "XMLHttpRequest"), i.withCredentials = !!r.withCredentials, t && i.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), i.overrideMimeType && i.overrideMimeType("application/json");
2840
- var o = r.customHeaders;
2841
- if (o = typeof o == "function" ? o() : o, o)
2842
- for (var s in o)
2843
- i.setRequestHeader(s, o[s]);
2844
- i.onreadystatechange = function() {
2845
- i.readyState > 3 && e(i.status >= 400 ? i.statusText : null, {
2846
- status: i.status,
2847
- data: i.responseText
2848
- });
2849
- }, i.send(t);
2850
- } catch (u) {
2851
- console && console.log(u);
2852
- }
2853
- }, Jn = function(r, n, t, e) {
2854
- if (typeof t == "function" && (e = t, t = void 0), e = e || function() {
2855
- }, W && n.indexOf("file:") !== 0)
2856
- return Vn(r, n, t, e);
2857
- if (xt() || typeof ActiveXObject == "function")
2858
- return zn(r, n, t, e);
2859
- e(new Error("No fetch and no xhr implementation found!"));
2860
- };
2861
- function re(a) {
2862
- "@babel/helpers - typeof";
2863
- return re = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
2864
- return typeof r;
2865
- } : function(r) {
2866
- return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
2867
- }, re(a);
2868
- }
2869
- function pt(a, r) {
2870
- var n = Object.keys(a);
2871
- if (Object.getOwnPropertySymbols) {
2872
- var t = Object.getOwnPropertySymbols(a);
2873
- r && (t = t.filter(function(e) {
2874
- return Object.getOwnPropertyDescriptor(a, e).enumerable;
2875
- })), n.push.apply(n, t);
2876
- }
2877
- return n;
2878
- }
2879
- function _e(a) {
2880
- for (var r = 1; r < arguments.length; r++) {
2881
- var n = arguments[r] != null ? arguments[r] : {};
2882
- r % 2 ? pt(Object(n), !0).forEach(function(t) {
2883
- jt(a, t, n[t]);
2884
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(n)) : pt(Object(n)).forEach(function(t) {
2885
- Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(n, t));
2886
- });
2887
- }
2888
- return a;
2889
- }
2890
- function Xn(a, r) {
2891
- if (!(a instanceof r))
2892
- throw new TypeError("Cannot call a class as a function");
2893
- }
2894
- function Wn(a, r) {
2895
- for (var n = 0; n < r.length; n++) {
2896
- var t = r[n];
2897
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(a, Lt(t.key), t);
2898
- }
2899
- }
2900
- function Gn(a, r, n) {
2901
- return r && Wn(a.prototype, r), Object.defineProperty(a, "prototype", { writable: !1 }), a;
2902
- }
2903
- function jt(a, r, n) {
2904
- return (r = Lt(r)) in a ? Object.defineProperty(a, r, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : a[r] = n, a;
2905
- }
2906
- function Lt(a) {
2907
- var r = Qn(a, "string");
2908
- return re(r) == "symbol" ? r : r + "";
2909
- }
2910
- function Qn(a, r) {
2911
- if (re(a) != "object" || !a)
2912
- return a;
2913
- var n = a[Symbol.toPrimitive];
2914
- if (n !== void 0) {
2915
- var t = n.call(a, r);
2916
- if (re(t) != "object")
2917
- return t;
2918
- throw new TypeError("@@toPrimitive must return a primitive value.");
2919
- }
2920
- return String(a);
2921
- }
2922
- var Yn = function() {
2923
- return {
2924
- loadPath: "/locales/{{lng}}/{{ns}}.json",
2925
- addPath: "/locales/add/{{lng}}/{{ns}}",
2926
- parse: function(n) {
2927
- return JSON.parse(n);
2928
- },
2929
- stringify: JSON.stringify,
2930
- parsePayload: function(n, t, e) {
2931
- return jt({}, t, e || "");
2932
- },
2933
- parseLoadPayload: function(n, t) {
2934
- },
2935
- request: Jn,
2936
- reloadInterval: typeof window < "u" ? !1 : 60 * 60 * 1e3,
2937
- customHeaders: {},
2938
- queryStringParams: {},
2939
- crossDomain: !1,
2940
- withCredentials: !1,
2941
- overrideMimeType: !1,
2942
- requestOptions: {
2943
- mode: "cors",
2944
- credentials: "same-origin",
2945
- cache: "default"
2946
- }
2947
- };
2948
- }, Rt = function() {
2949
- function a(r) {
2950
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2951
- Xn(this, a), this.services = r, this.options = n, this.allOptions = t, this.type = "backend", this.init(r, n, t);
2952
- }
2953
- return Gn(a, [{
2954
- key: "init",
2955
- value: function(n) {
2956
- var t = this, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2957
- if (this.services = n, this.options = _e(_e(_e({}, Yn()), this.options || {}), e), this.allOptions = i, this.services && this.options.reloadInterval) {
2958
- var o = setInterval(function() {
2959
- return t.reload();
2960
- }, this.options.reloadInterval);
2961
- re(o) === "object" && typeof o.unref == "function" && o.unref();
2962
- }
2963
- }
2964
- }, {
2965
- key: "readMulti",
2966
- value: function(n, t, e) {
2967
- this._readAny(n, n, t, t, e);
2968
- }
2969
- }, {
2970
- key: "read",
2971
- value: function(n, t, e) {
2972
- this._readAny([n], n, [t], t, e);
2973
- }
2974
- }, {
2975
- key: "_readAny",
2976
- value: function(n, t, e, i, o) {
2977
- var s = this, u = this.options.loadPath;
2978
- typeof this.options.loadPath == "function" && (u = this.options.loadPath(n, e)), u = Bn(u), u.then(function(d) {
2979
- if (!d)
2980
- return o(null, {});
2981
- var c = s.services.interpolator.interpolate(d, {
2982
- lng: n.join("+"),
2983
- ns: e.join("+")
2984
- });
2985
- s.loadUrl(c, o, t, i);
2986
- });
2987
- }
2988
- }, {
2989
- key: "loadUrl",
2990
- value: function(n, t, e, i) {
2991
- var o = this, s = typeof e == "string" ? [e] : e, u = typeof i == "string" ? [i] : i, d = this.options.parseLoadPayload(s, u);
2992
- this.options.request(this.options, n, d, function(c, f) {
2993
- if (f && (f.status >= 500 && f.status < 600 || !f.status))
2994
- return t("failed loading " + n + "; status code: " + f.status, !0);
2995
- if (f && f.status >= 400 && f.status < 500)
2996
- return t("failed loading " + n + "; status code: " + f.status, !1);
2997
- if (!f && c && c.message) {
2998
- var h = c.message.toLowerCase(), p = ["failed", "fetch", "network", "load"].find(function(w) {
2999
- return h.indexOf(w) > -1;
3000
- });
3001
- if (p)
3002
- return t("failed loading " + n + ": " + c.message, !0);
3003
- }
3004
- if (c)
3005
- return t(c, !1);
3006
- var b, m;
3007
- try {
3008
- typeof f.data == "string" ? b = o.options.parse(f.data, e, i) : b = f.data;
3009
- } catch {
3010
- m = "failed parsing " + n + " to json";
3011
- }
3012
- if (m)
3013
- return t(m, !1);
3014
- t(null, b);
3015
- });
3016
- }
3017
- }, {
3018
- key: "create",
3019
- value: function(n, t, e, i, o) {
3020
- var s = this;
3021
- if (this.options.addPath) {
3022
- typeof n == "string" && (n = [n]);
3023
- var u = this.options.parsePayload(t, e, i), d = 0, c = [], f = [];
3024
- n.forEach(function(h) {
3025
- var p = s.options.addPath;
3026
- typeof s.options.addPath == "function" && (p = s.options.addPath(h, t));
3027
- var b = s.services.interpolator.interpolate(p, {
3028
- lng: h,
3029
- ns: t
3030
- });
3031
- s.options.request(s.options, b, u, function(m, w) {
3032
- d += 1, c.push(m), f.push(w), d === n.length && typeof o == "function" && o(c, f);
3033
- });
3034
- });
3035
- }
3036
- }
3037
- }, {
3038
- key: "reload",
3039
- value: function() {
3040
- var n = this, t = this.services, e = t.backendConnector, i = t.languageUtils, o = t.logger, s = e.language;
3041
- if (!(s && s.toLowerCase() === "cimode")) {
3042
- var u = [], d = function(f) {
3043
- var h = i.toResolveHierarchy(f);
3044
- h.forEach(function(p) {
3045
- u.indexOf(p) < 0 && u.push(p);
3046
- });
3047
- };
3048
- d(s), this.allOptions.preload && this.allOptions.preload.forEach(function(c) {
3049
- return d(c);
3050
- }), u.forEach(function(c) {
3051
- n.allOptions.ns.forEach(function(f) {
3052
- e.read(c, f, "read", null, null, function(h, p) {
3053
- h && o.warn("loading namespace ".concat(f, " for language ").concat(c, " failed"), h), !h && p && o.log("loaded namespace ".concat(f, " for language ").concat(c), p), e.loaded("".concat(c, "|").concat(f), h, p);
3054
- });
3055
- });
3056
- });
3057
- }
3058
- }
3059
- }]);
3060
- }();
3061
- Rt.type = "backend";
3062
- var Zn = /* @__PURE__ */ ((a) => (a.en = "en", a.de = "de", a))(Zn || {});
3063
- const er = {
3064
- en: "English",
3065
- de: "German"
3066
- };
3067
- _.use(St).use(yn).use(wt).init({
3068
- // defaultNS: "translation",
3069
- // resources,
3070
- initImmediate: !0,
3071
- ns: ["translation"],
3072
- fallbackLng: Object.keys(er),
3073
- fallbackNS: "translation",
3074
- partialBundledLanguages: !0,
3075
- resources: {},
3076
- interpolation: {
3077
- escapeValue: !1
3078
- },
3079
- backend: {
3080
- backends: [Rt],
3081
- backendOptions: [
3082
- {
3083
- // loadPath: 'https://ukpcsaprod.blob.core.windows.net/lib/translations/{{lng}}/{{ns}}.json',
3084
- loadPath: () => {
3085
- var r, n, t;
3086
- if ((r = window == null ? void 0 : window.env) != null && r.TRANSLATION_URL)
3087
- return `${window.env.TRANSLATION_URL}/{{lng}}`;
3088
- const a = ((n = window == null ? void 0 : window.env) == null ? void 0 : n.VITE_BASE_URL) || ((t = window == null ? void 0 : window.env) == null ? void 0 : t.REACT_APP_BASE_URL) || location.protocol + "//" + location.host;
3089
- return console.log("url", a), `${a}/translations/{{lng}}`;
3090
- },
3091
- crossDomain: !0,
3092
- cacheHitMode: "refresh"
3093
- }
3094
- ]
3095
- }
3096
- });
3097
- const ve = {
3098
- "page-container": "_page-container_1pwo1_1",
3099
- "page-main-content": "_page-main-content_1pwo1_8",
3100
- "page-title": "_page-title_1pwo1_19",
3101
- "text-base": "_text-base_1pwo1_26",
3102
- "mt-4": "_mt-4_1pwo1_33"
3103
- }, tr = () => {
3104
- const { t: a } = Ft();
3105
- return /* @__PURE__ */ L.jsx("div", { className: "unauth__container " + ve["page-container"], children: /* @__PURE__ */ L.jsxs("div", { className: "unauth__main-content " + ve["page-main-content"], children: [
3106
- /* @__PURE__ */ L.jsx(nr, {}),
3107
- /* @__PURE__ */ L.jsxs("div", { className: "unauth__main-text", children: [
3108
- /* @__PURE__ */ L.jsx("h2", { className: "unauth__main-text__title " + ve["page-title"], children: a("components.unauthorizedPage.title") }),
3109
- /* @__PURE__ */ L.jsxs("p", { className: "unauth__main-text__desc " + ve["text-base"], children: [
3110
- a("components.unauthorizedPage.description1"),
3111
- " ",
3112
- /* @__PURE__ */ L.jsx("br", {}),
3113
- " ",
3114
- a("components.unauthorizedPage.description2")
3115
- ] })
3116
- ] })
3117
- ] }) });
3118
- }, nr = () => /* @__PURE__ */ L.jsxs(
3119
- "svg",
3120
- {
3121
- width: "61",
3122
- height: "60",
3123
- viewBox: "0 0 61 60",
3124
- fill: "none",
3125
- xmlns: "http://www.w3.org/2000/svg",
3126
- children: [
3127
- /* @__PURE__ */ L.jsxs("g", { filter: "url(#filter0_d_10800_50471)", children: [
3128
- /* @__PURE__ */ L.jsx("rect", { x: "2.5", y: "1", width: "56", height: "56", rx: "28", fill: "white" }),
3129
- /* @__PURE__ */ L.jsx(
3130
- "path",
3131
- {
3132
- d: "M24.6667 27.833V23.1663C24.6667 21.6192 25.2812 20.1355 26.3752 19.0416C27.4692 17.9476 28.9529 17.333 30.5 17.333C32.0471 17.333 33.5308 17.9476 34.6248 19.0416C35.7188 20.1355 36.3333 21.6192 36.3333 23.1663V27.833M22.3333 27.833H38.6667C39.9553 27.833 41 28.8777 41 30.1663V38.333C41 39.6217 39.9553 40.6663 38.6667 40.6663H22.3333C21.0447 40.6663 20 39.6217 20 38.333V30.1663C20 28.8777 21.0447 27.833 22.3333 27.833Z",
3133
- stroke: "#292929",
3134
- "stroke-width": "2.33333",
3135
- "stroke-linecap": "round",
3136
- "stroke-linejoin": "round"
3137
- }
3138
- )
3139
- ] }),
3140
- /* @__PURE__ */ L.jsx("defs", { children: /* @__PURE__ */ L.jsxs(
3141
- "filter",
3142
- {
3143
- id: "filter0_d_10800_50471",
3144
- x: "0.5",
3145
- y: "0",
3146
- width: "60",
3147
- height: "60",
3148
- filterUnits: "userSpaceOnUse",
3149
- "color-interpolation-filters": "sRGB",
3150
- children: [
3151
- /* @__PURE__ */ L.jsx("feFlood", { "flood-opacity": "0", result: "BackgroundImageFix" }),
3152
- /* @__PURE__ */ L.jsx(
3153
- "feColorMatrix",
3154
- {
3155
- in: "SourceAlpha",
3156
- type: "matrix",
3157
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
3158
- result: "hardAlpha"
3159
- }
3160
- ),
3161
- /* @__PURE__ */ L.jsx("feOffset", { dy: "1" }),
3162
- /* @__PURE__ */ L.jsx("feGaussianBlur", { stdDeviation: "1" }),
3163
- /* @__PURE__ */ L.jsx(
3164
- "feColorMatrix",
3165
- {
3166
- type: "matrix",
3167
- values: "0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.05 0"
3168
- }
3169
- ),
3170
- /* @__PURE__ */ L.jsx(
3171
- "feBlend",
3172
- {
3173
- mode: "normal",
3174
- in2: "BackgroundImageFix",
3175
- result: "effect1_dropShadow_10800_50471"
3176
- }
3177
- ),
3178
- /* @__PURE__ */ L.jsx(
3179
- "feBlend",
3180
- {
3181
- mode: "normal",
3182
- in: "SourceGraphic",
3183
- in2: "effect1_dropShadow_10800_50471",
3184
- result: "shape"
3185
- }
3186
- )
3187
- ]
3188
- }
3189
- ) })
3190
- ]
3191
- }
3192
- );
3193
- function rr() {
3194
- return /* @__PURE__ */ L.jsx(bn, { i18n: _, children: /* @__PURE__ */ L.jsx(tr, {}) });
3195
- }
3196
- {
3197
- const a = Et(rr);
3198
- customElements.define("access-denied", a);
3199
- }
3200
- export {
3201
- bn as I,
3202
- Zn as L,
3203
- tr as U,
3204
- _ as i,
3205
- sr as t
3206
- };