@xlxz/markdown-editor 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/index.cjs +1806 -0
  2. package/dist/index.d.ts +23 -0
  3. package/dist/index.js +1774 -0
  4. package/dist/plugins/attachment.d.ts +7 -0
  5. package/dist/plugins/base-extensions.d.ts +8 -0
  6. package/dist/plugins/close-brackets.d.ts +8 -0
  7. package/dist/plugins/expand-text.d.ts +11 -0
  8. package/dist/plugins/fold.d.ts +8 -0
  9. package/dist/plugins/hanging-indent.d.ts +7 -0
  10. package/dist/plugins/indent-guide.d.ts +7 -0
  11. package/dist/plugins/index.d.ts +22 -0
  12. package/dist/plugins/keymap.d.ts +8 -0
  13. package/dist/plugins/line-numbers.d.ts +7 -0
  14. package/dist/plugins/link-handler.d.ts +8 -0
  15. package/dist/plugins/list-continuation.d.ts +8 -0
  16. package/dist/plugins/live-preview.d.ts +8 -0
  17. package/dist/plugins/markdown-language.d.ts +8 -0
  18. package/dist/plugins/on-change.d.ts +7 -0
  19. package/dist/plugins/suggest.d.ts +16 -0
  20. package/dist/plugins/table-continuation.d.ts +9 -0
  21. package/dist/plugins/table.d.ts +7 -0
  22. package/dist/plugins/theme.d.ts +8 -0
  23. package/dist/plugins/types.d.ts +29 -0
  24. package/dist/table/copy-widget.d.ts +17 -0
  25. package/dist/table/detect.d.ts +15 -0
  26. package/dist/table/format.d.ts +15 -0
  27. package/dist/table/index.d.ts +6 -0
  28. package/dist/table/theme.d.ts +8 -0
  29. package/package.json +57 -0
  30. package/vendor/app.css +15715 -0
  31. package/vendor/enhance.js +641 -0
  32. package/vendor/i18n/en.json +2144 -0
  33. package/vendor/i18n/zh.json +2144 -0
  34. package/vendor/lib/codemirror.js +14806 -0
  35. package/vendor/lib/i18next.min.js +2654 -0
  36. package/vendor/lib/markdown.js +1717 -0
  37. package/vendor/lib/mathjax/output/chtml/fonts/tex.js +1 -0
  38. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff +0 -0
  39. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Bold.woff +0 -0
  40. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Regular.woff +0 -0
  41. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Bold.woff +0 -0
  42. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Regular.woff +0 -0
  43. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Bold.woff +0 -0
  44. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Italic.woff +0 -0
  45. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Regular.woff +0 -0
  46. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-BoldItalic.woff +0 -0
  47. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-Italic.woff +0 -0
  48. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-Regular.woff +0 -0
  49. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Bold.woff +0 -0
  50. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Italic.woff +0 -0
  51. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Regular.woff +0 -0
  52. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Script-Regular.woff +0 -0
  53. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Size1-Regular.woff +0 -0
  54. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Size2-Regular.woff +0 -0
  55. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Size3-Regular.woff +0 -0
  56. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Size4-Regular.woff +0 -0
  57. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Typewriter-Regular.woff +0 -0
  58. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Vector-Bold.woff +0 -0
  59. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Vector-Regular.woff +0 -0
  60. package/vendor/lib/mathjax/output/chtml/fonts/woff-v2/MathJax_Zero.woff +0 -0
  61. package/vendor/lib/mathjax/tex-chtml-full.js +36 -0
  62. package/vendor/lib/meta.min.js +1 -0
  63. package/vendor/lib/modes.min.js +236 -0
  64. package/vendor/lib/turndown.js +679 -0
  65. package/vendor/mock.js +28 -0
  66. package/vendor/obsidian-app.patched.js +161786 -0
@@ -0,0 +1,2654 @@
1
+ !(function (e, t) {
2
+ "object" == typeof exports && "undefined" != typeof module
3
+ ? (module.exports = t())
4
+ : "function" == typeof define && define.amd
5
+ ? define(t)
6
+ : ((e = e || self).i18next = t());
7
+ })(this, function () {
8
+ "use strict";
9
+ function e(t) {
10
+ return (e =
11
+ "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
12
+ ? function (e) {
13
+ return typeof e;
14
+ }
15
+ : function (e) {
16
+ return e &&
17
+ "function" == typeof Symbol &&
18
+ e.constructor === Symbol &&
19
+ e !== Symbol.prototype
20
+ ? "symbol"
21
+ : typeof e;
22
+ })(t);
23
+ }
24
+ function t(e, t, n) {
25
+ return (
26
+ t in e
27
+ ? Object.defineProperty(e, t, {
28
+ value: n,
29
+ enumerable: !0,
30
+ configurable: !0,
31
+ writable: !0,
32
+ })
33
+ : (e[t] = n),
34
+ e
35
+ );
36
+ }
37
+ function n(e) {
38
+ for (var n = 1; n < arguments.length; n++) {
39
+ var o = null != arguments[n] ? Object(arguments[n]) : {},
40
+ i = Object.keys(o);
41
+ ("function" == typeof Object.getOwnPropertySymbols &&
42
+ (i = i.concat(
43
+ Object.getOwnPropertySymbols(o).filter(function (e) {
44
+ return Object.getOwnPropertyDescriptor(o, e).enumerable;
45
+ }),
46
+ )),
47
+ i.forEach(function (n) {
48
+ t(e, n, o[n]);
49
+ }));
50
+ }
51
+ return e;
52
+ }
53
+ function o(e, t) {
54
+ if (!(e instanceof t))
55
+ throw new TypeError("Cannot call a class as a function");
56
+ }
57
+ function i(e, t) {
58
+ for (var n = 0; n < t.length; n++) {
59
+ var o = t[n];
60
+ ((o.enumerable = o.enumerable || !1),
61
+ (o.configurable = !0),
62
+ "value" in o && (o.writable = !0),
63
+ Object.defineProperty(e, o.key, o));
64
+ }
65
+ }
66
+ function r(e, t, n) {
67
+ return (t && i(e.prototype, t), n && i(e, n), e);
68
+ }
69
+ function a(e) {
70
+ if (void 0 === e)
71
+ throw new ReferenceError(
72
+ "this hasn't been initialised - super() hasn't been called",
73
+ );
74
+ return e;
75
+ }
76
+ function s(t, n) {
77
+ return !n || ("object" !== e(n) && "function" != typeof n) ? a(t) : n;
78
+ }
79
+ function u(e) {
80
+ return (u = Object.setPrototypeOf
81
+ ? Object.getPrototypeOf
82
+ : function (e) {
83
+ return e.__proto__ || Object.getPrototypeOf(e);
84
+ })(e);
85
+ }
86
+ function l(e, t) {
87
+ return (l =
88
+ Object.setPrototypeOf ||
89
+ function (e, t) {
90
+ return ((e.__proto__ = t), e);
91
+ })(e, t);
92
+ }
93
+ function c(e, t) {
94
+ if ("function" != typeof t && null !== t)
95
+ throw new TypeError("Super expression must either be null or a function");
96
+ ((e.prototype = Object.create(t && t.prototype, {
97
+ constructor: { value: e, writable: !0, configurable: !0 },
98
+ })),
99
+ t && l(e, t));
100
+ }
101
+ var p = {
102
+ type: "logger",
103
+ log: function (e) {
104
+ this.output("log", e);
105
+ },
106
+ warn: function (e) {
107
+ this.output("warn", e);
108
+ },
109
+ error: function (e) {
110
+ this.output("error", e);
111
+ },
112
+ output: function (e, t) {
113
+ console && console[e] && console[e].apply(console, t);
114
+ },
115
+ },
116
+ g = new ((function () {
117
+ function e(t) {
118
+ var n =
119
+ arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
120
+ (o(this, e), this.init(t, n));
121
+ }
122
+ return (
123
+ r(e, [
124
+ {
125
+ key: "init",
126
+ value: function (e) {
127
+ var t =
128
+ arguments.length > 1 && void 0 !== arguments[1]
129
+ ? arguments[1]
130
+ : {};
131
+ ((this.prefix = t.prefix || "i18next:"),
132
+ (this.logger = e || p),
133
+ (this.options = t),
134
+ (this.debug = t.debug));
135
+ },
136
+ },
137
+ {
138
+ key: "setDebug",
139
+ value: function (e) {
140
+ this.debug = e;
141
+ },
142
+ },
143
+ {
144
+ key: "log",
145
+ value: function () {
146
+ for (
147
+ var e = arguments.length, t = new Array(e), n = 0;
148
+ n < e;
149
+ n++
150
+ )
151
+ t[n] = arguments[n];
152
+ return this.forward(t, "log", "", !0);
153
+ },
154
+ },
155
+ {
156
+ key: "warn",
157
+ value: function () {
158
+ for (
159
+ var e = arguments.length, t = new Array(e), n = 0;
160
+ n < e;
161
+ n++
162
+ )
163
+ t[n] = arguments[n];
164
+ return this.forward(t, "warn", "", !0);
165
+ },
166
+ },
167
+ {
168
+ key: "error",
169
+ value: function () {
170
+ for (
171
+ var e = arguments.length, t = new Array(e), n = 0;
172
+ n < e;
173
+ n++
174
+ )
175
+ t[n] = arguments[n];
176
+ return this.forward(t, "error", "");
177
+ },
178
+ },
179
+ {
180
+ key: "deprecate",
181
+ value: function () {
182
+ for (
183
+ var e = arguments.length, t = new Array(e), n = 0;
184
+ n < e;
185
+ n++
186
+ )
187
+ t[n] = arguments[n];
188
+ return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
189
+ },
190
+ },
191
+ {
192
+ key: "forward",
193
+ value: function (e, t, n, o) {
194
+ return o && !this.debug
195
+ ? null
196
+ : ("string" == typeof e[0] &&
197
+ (e[0] = "".concat(n).concat(this.prefix, " ").concat(e[0])),
198
+ this.logger[t](e));
199
+ },
200
+ },
201
+ {
202
+ key: "create",
203
+ value: function (t) {
204
+ return new e(
205
+ this.logger,
206
+ n(
207
+ {},
208
+ { prefix: "".concat(this.prefix, ":").concat(t, ":") },
209
+ this.options,
210
+ ),
211
+ );
212
+ },
213
+ },
214
+ ]),
215
+ e
216
+ );
217
+ })())(),
218
+ f = (function () {
219
+ function e() {
220
+ (o(this, e), (this.observers = {}));
221
+ }
222
+ return (
223
+ r(e, [
224
+ {
225
+ key: "on",
226
+ value: function (e, t) {
227
+ var n = this;
228
+ return (
229
+ e.split(" ").forEach(function (e) {
230
+ ((n.observers[e] = n.observers[e] || []),
231
+ n.observers[e].push(t));
232
+ }),
233
+ this
234
+ );
235
+ },
236
+ },
237
+ {
238
+ key: "off",
239
+ value: function (e, t) {
240
+ this.observers[e] &&
241
+ (t
242
+ ? (this.observers[e] = this.observers[e].filter(function (e) {
243
+ return e !== t;
244
+ }))
245
+ : delete this.observers[e]);
246
+ },
247
+ },
248
+ {
249
+ key: "emit",
250
+ value: function (e) {
251
+ for (
252
+ var t = arguments.length,
253
+ n = new Array(t > 1 ? t - 1 : 0),
254
+ o = 1;
255
+ o < t;
256
+ o++
257
+ )
258
+ n[o - 1] = arguments[o];
259
+ this.observers[e] &&
260
+ [].concat(this.observers[e]).forEach(function (e) {
261
+ e.apply(void 0, n);
262
+ });
263
+ this.observers["*"] &&
264
+ [].concat(this.observers["*"]).forEach(function (t) {
265
+ t.apply(t, [e].concat(n));
266
+ });
267
+ },
268
+ },
269
+ ]),
270
+ e
271
+ );
272
+ })();
273
+ function h() {
274
+ var e,
275
+ t,
276
+ n = new Promise(function (n, o) {
277
+ ((e = n), (t = o));
278
+ });
279
+ return ((n.resolve = e), (n.reject = t), n);
280
+ }
281
+ function d(e) {
282
+ return null == e ? "" : "" + e;
283
+ }
284
+ function v(e, t, n) {
285
+ function o(e) {
286
+ return e && e.indexOf("###") > -1 ? e.replace(/###/g, ".") : e;
287
+ }
288
+ function i() {
289
+ return !e || "string" == typeof e;
290
+ }
291
+ for (
292
+ var r = "string" != typeof t ? [].concat(t) : t.split(".");
293
+ r.length > 1;
294
+ ) {
295
+ if (i()) return {};
296
+ var a = o(r.shift());
297
+ (!e[a] && n && (e[a] = new n()), (e = e[a]));
298
+ }
299
+ return i() ? {} : { obj: e, k: o(r.shift()) };
300
+ }
301
+ function y(e, t, n) {
302
+ var o = v(e, t, Object);
303
+ o.obj[o.k] = n;
304
+ }
305
+ function m(e, t) {
306
+ var n = v(e, t),
307
+ o = n.obj,
308
+ i = n.k;
309
+ if (o) return o[i];
310
+ }
311
+ function b(e, t, n) {
312
+ var o = m(e, n);
313
+ return void 0 !== o ? o : m(t, n);
314
+ }
315
+ function k(e) {
316
+ return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
317
+ }
318
+ var x = {
319
+ "&": "&amp;",
320
+ "<": "&lt;",
321
+ ">": "&gt;",
322
+ '"': "&quot;",
323
+ "'": "&#39;",
324
+ "/": "&#x2F;",
325
+ };
326
+ function w(e) {
327
+ return "string" == typeof e
328
+ ? e.replace(/[&<>"'\/]/g, function (e) {
329
+ return x[e];
330
+ })
331
+ : e;
332
+ }
333
+ var S =
334
+ "undefined" != typeof window &&
335
+ window.navigator &&
336
+ window.navigator.userAgent &&
337
+ window.navigator.userAgent.indexOf("MSIE") > -1,
338
+ L = (function (e) {
339
+ function t(e) {
340
+ var n,
341
+ i =
342
+ arguments.length > 1 && void 0 !== arguments[1]
343
+ ? arguments[1]
344
+ : { ns: ["translation"], defaultNS: "translation" };
345
+ return (
346
+ o(this, t),
347
+ (n = s(this, u(t).call(this))),
348
+ S && f.call(a(n)),
349
+ (n.data = e || {}),
350
+ (n.options = i),
351
+ void 0 === n.options.keySeparator && (n.options.keySeparator = "."),
352
+ n
353
+ );
354
+ }
355
+ return (
356
+ c(t, f),
357
+ r(t, [
358
+ {
359
+ key: "addNamespaces",
360
+ value: function (e) {
361
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
362
+ },
363
+ },
364
+ {
365
+ key: "removeNamespaces",
366
+ value: function (e) {
367
+ var t = this.options.ns.indexOf(e);
368
+ t > -1 && this.options.ns.splice(t, 1);
369
+ },
370
+ },
371
+ {
372
+ key: "getResource",
373
+ value: function (e, t, n) {
374
+ var o =
375
+ arguments.length > 3 && void 0 !== arguments[3]
376
+ ? arguments[3]
377
+ : {},
378
+ i =
379
+ void 0 !== o.keySeparator
380
+ ? o.keySeparator
381
+ : this.options.keySeparator,
382
+ r = [e, t];
383
+ return (
384
+ n && "string" != typeof n && (r = r.concat(n)),
385
+ n && "string" == typeof n && (r = r.concat(i ? n.split(i) : n)),
386
+ e.indexOf(".") > -1 && (r = e.split(".")),
387
+ m(this.data, r)
388
+ );
389
+ },
390
+ },
391
+ {
392
+ key: "addResource",
393
+ value: function (e, t, n, o) {
394
+ var i =
395
+ arguments.length > 4 && void 0 !== arguments[4]
396
+ ? arguments[4]
397
+ : { silent: !1 },
398
+ r = this.options.keySeparator;
399
+ void 0 === r && (r = ".");
400
+ var a = [e, t];
401
+ (n && (a = a.concat(r ? n.split(r) : n)),
402
+ e.indexOf(".") > -1 && ((o = t), (t = (a = e.split("."))[1])),
403
+ this.addNamespaces(t),
404
+ y(this.data, a, o),
405
+ i.silent || this.emit("added", e, t, n, o));
406
+ },
407
+ },
408
+ {
409
+ key: "addResources",
410
+ value: function (e, t, n) {
411
+ var o =
412
+ arguments.length > 3 && void 0 !== arguments[3]
413
+ ? arguments[3]
414
+ : { silent: !1 };
415
+ for (var i in n)
416
+ ("string" != typeof n[i] &&
417
+ "[object Array]" !== Object.prototype.toString.apply(n[i])) ||
418
+ this.addResource(e, t, i, n[i], { silent: !0 });
419
+ o.silent || this.emit("added", e, t, n);
420
+ },
421
+ },
422
+ {
423
+ key: "addResourceBundle",
424
+ value: function (e, t, o, i, r) {
425
+ var a =
426
+ arguments.length > 5 && void 0 !== arguments[5]
427
+ ? arguments[5]
428
+ : { silent: !1 },
429
+ s = [e, t];
430
+ (e.indexOf(".") > -1 &&
431
+ ((i = o), (o = t), (t = (s = e.split("."))[1])),
432
+ this.addNamespaces(t));
433
+ var u = m(this.data, s) || {};
434
+ (i
435
+ ? (function e(t, n, o) {
436
+ for (var i in n)
437
+ "__proto__" !== i &&
438
+ (i in t
439
+ ? "string" == typeof t[i] ||
440
+ t[i] instanceof String ||
441
+ "string" == typeof n[i] ||
442
+ n[i] instanceof String
443
+ ? o && (t[i] = n[i])
444
+ : e(t[i], n[i], o)
445
+ : (t[i] = n[i]));
446
+ return t;
447
+ })(u, o, r)
448
+ : (u = n({}, u, o)),
449
+ y(this.data, s, u),
450
+ a.silent || this.emit("added", e, t, o));
451
+ },
452
+ },
453
+ {
454
+ key: "removeResourceBundle",
455
+ value: function (e, t) {
456
+ (this.hasResourceBundle(e, t) && delete this.data[e][t],
457
+ this.removeNamespaces(t),
458
+ this.emit("removed", e, t));
459
+ },
460
+ },
461
+ {
462
+ key: "hasResourceBundle",
463
+ value: function (e, t) {
464
+ return void 0 !== this.getResource(e, t);
465
+ },
466
+ },
467
+ {
468
+ key: "getResourceBundle",
469
+ value: function (e, t) {
470
+ return (
471
+ t || (t = this.options.defaultNS),
472
+ "v1" === this.options.compatibilityAPI
473
+ ? n({}, {}, this.getResource(e, t))
474
+ : this.getResource(e, t)
475
+ );
476
+ },
477
+ },
478
+ {
479
+ key: "getDataByLanguage",
480
+ value: function (e) {
481
+ return this.data[e];
482
+ },
483
+ },
484
+ {
485
+ key: "toJSON",
486
+ value: function () {
487
+ return this.data;
488
+ },
489
+ },
490
+ ]),
491
+ t
492
+ );
493
+ })(),
494
+ O = {
495
+ processors: {},
496
+ addPostProcessor: function (e) {
497
+ this.processors[e.name] = e;
498
+ },
499
+ handle: function (e, t, n, o, i) {
500
+ var r = this;
501
+ return (
502
+ e.forEach(function (e) {
503
+ r.processors[e] && (t = r.processors[e].process(t, n, o, i));
504
+ }),
505
+ t
506
+ );
507
+ },
508
+ },
509
+ R = {},
510
+ C = (function (t) {
511
+ function i(e) {
512
+ var t,
513
+ n,
514
+ r,
515
+ l,
516
+ c =
517
+ arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
518
+ return (
519
+ o(this, i),
520
+ (t = s(this, u(i).call(this))),
521
+ S && f.call(a(t)),
522
+ (n = [
523
+ "resourceStore",
524
+ "languageUtils",
525
+ "pluralResolver",
526
+ "interpolator",
527
+ "backendConnector",
528
+ "i18nFormat",
529
+ "utils",
530
+ ]),
531
+ (r = e),
532
+ (l = a(t)),
533
+ n.forEach(function (e) {
534
+ r[e] && (l[e] = r[e]);
535
+ }),
536
+ (t.options = c),
537
+ void 0 === t.options.keySeparator && (t.options.keySeparator = "."),
538
+ (t.logger = g.create("translator")),
539
+ t
540
+ );
541
+ }
542
+ return (
543
+ c(i, f),
544
+ r(i, [
545
+ {
546
+ key: "changeLanguage",
547
+ value: function (e) {
548
+ e && (this.language = e);
549
+ },
550
+ },
551
+ {
552
+ key: "exists",
553
+ value: function (e) {
554
+ var t =
555
+ arguments.length > 1 && void 0 !== arguments[1]
556
+ ? arguments[1]
557
+ : { interpolation: {} },
558
+ n = this.resolve(e, t);
559
+ return n && void 0 !== n.res;
560
+ },
561
+ },
562
+ {
563
+ key: "extractFromKey",
564
+ value: function (e, t) {
565
+ var n =
566
+ void 0 !== t.nsSeparator
567
+ ? t.nsSeparator
568
+ : this.options.nsSeparator;
569
+ void 0 === n && (n = ":");
570
+ var o =
571
+ void 0 !== t.keySeparator
572
+ ? t.keySeparator
573
+ : this.options.keySeparator,
574
+ i = t.ns || this.options.defaultNS;
575
+ if (n && e.indexOf(n) > -1) {
576
+ var r = e.match(this.interpolator.nestingRegexp);
577
+ if (r && r.length > 0) return { key: e, namespaces: i };
578
+ var a = e.split(n);
579
+ ((n !== o || (n === o && this.options.ns.indexOf(a[0]) > -1)) &&
580
+ (i = a.shift()),
581
+ (e = a.join(o)));
582
+ }
583
+ return (
584
+ "string" == typeof i && (i = [i]),
585
+ { key: e, namespaces: i }
586
+ );
587
+ },
588
+ },
589
+ {
590
+ key: "translate",
591
+ value: function (t, o, i) {
592
+ var r = this;
593
+ if (
594
+ ("object" !== e(o) &&
595
+ this.options.overloadTranslationOptionHandler &&
596
+ (o =
597
+ this.options.overloadTranslationOptionHandler(arguments)),
598
+ o || (o = {}),
599
+ null == t)
600
+ )
601
+ return "";
602
+ Array.isArray(t) || (t = [String(t)]);
603
+ var a =
604
+ void 0 !== o.keySeparator
605
+ ? o.keySeparator
606
+ : this.options.keySeparator,
607
+ s = this.extractFromKey(t[t.length - 1], o),
608
+ u = s.key,
609
+ l = s.namespaces,
610
+ c = l[l.length - 1],
611
+ p = o.lng || this.language,
612
+ g =
613
+ o.appendNamespaceToCIMode ||
614
+ this.options.appendNamespaceToCIMode;
615
+ if (p && "cimode" === p.toLowerCase()) {
616
+ if (g) {
617
+ var f = o.nsSeparator || this.options.nsSeparator;
618
+ return c + f + u;
619
+ }
620
+ return u;
621
+ }
622
+ var h = this.resolve(t, o),
623
+ d = h && h.res,
624
+ v = (h && h.usedKey) || u,
625
+ y = (h && h.exactUsedKey) || u,
626
+ m = Object.prototype.toString.apply(d),
627
+ b =
628
+ void 0 !== o.joinArrays
629
+ ? o.joinArrays
630
+ : this.options.joinArrays,
631
+ k = !this.i18nFormat || this.i18nFormat.handleAsObject;
632
+ if (
633
+ k &&
634
+ d &&
635
+ "string" != typeof d &&
636
+ "boolean" != typeof d &&
637
+ "number" != typeof d &&
638
+ [
639
+ "[object Number]",
640
+ "[object Function]",
641
+ "[object RegExp]",
642
+ ].indexOf(m) < 0 &&
643
+ ("string" != typeof b || "[object Array]" !== m)
644
+ ) {
645
+ if (!o.returnObjects && !this.options.returnObjects)
646
+ return (
647
+ this.logger.warn(
648
+ "accessing an object - but returnObjects options is not enabled!",
649
+ ),
650
+ this.options.returnedObjectHandler
651
+ ? this.options.returnedObjectHandler(v, d, o)
652
+ : "key '"
653
+ .concat(u, " (")
654
+ .concat(
655
+ this.language,
656
+ ")' returned an object instead of string.",
657
+ )
658
+ );
659
+ if (a) {
660
+ var x = "[object Array]" === m,
661
+ w = x ? [] : {},
662
+ S = x ? y : v;
663
+ for (var L in d)
664
+ if (Object.prototype.hasOwnProperty.call(d, L)) {
665
+ var O = "".concat(S).concat(a).concat(L);
666
+ ((w[L] = this.translate(
667
+ O,
668
+ n({}, o, { joinArrays: !1, ns: l }),
669
+ )),
670
+ w[L] === O && (w[L] = d[L]));
671
+ }
672
+ d = w;
673
+ }
674
+ } else if (k && "string" == typeof b && "[object Array]" === m)
675
+ (d = d.join(b)) && (d = this.extendTranslation(d, t, o, i));
676
+ else {
677
+ var R = !1,
678
+ C = !1;
679
+ if (!this.isValidLookup(d) && void 0 !== o.defaultValue) {
680
+ if (((R = !0), void 0 !== o.count)) {
681
+ var N = this.pluralResolver.getSuffix(p, o.count);
682
+ d = o["defaultValue".concat(N)];
683
+ }
684
+ d || (d = o.defaultValue);
685
+ }
686
+ this.isValidLookup(d) || ((C = !0), (d = u));
687
+ var j =
688
+ o.defaultValue &&
689
+ o.defaultValue !== d &&
690
+ this.options.updateMissing;
691
+ if (C || R || j) {
692
+ if (
693
+ (this.logger.log(
694
+ j ? "updateKey" : "missingKey",
695
+ p,
696
+ c,
697
+ u,
698
+ j ? o.defaultValue : d,
699
+ ),
700
+ a)
701
+ ) {
702
+ var E = this.resolve(u, n({}, o, { keySeparator: !1 }));
703
+ E &&
704
+ E.res &&
705
+ this.logger.warn(
706
+ "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.",
707
+ );
708
+ }
709
+ var P = [],
710
+ F = this.languageUtils.getFallbackCodes(
711
+ this.options.fallbackLng,
712
+ o.lng || this.language,
713
+ );
714
+ if ("fallback" === this.options.saveMissingTo && F && F[0])
715
+ for (var V = 0; V < F.length; V++) P.push(F[V]);
716
+ else
717
+ "all" === this.options.saveMissingTo
718
+ ? (P = this.languageUtils.toResolveHierarchy(
719
+ o.lng || this.language,
720
+ ))
721
+ : P.push(o.lng || this.language);
722
+ var T = function (e, t) {
723
+ (r.options.missingKeyHandler
724
+ ? r.options.missingKeyHandler(
725
+ e,
726
+ c,
727
+ t,
728
+ j ? o.defaultValue : d,
729
+ j,
730
+ o,
731
+ )
732
+ : r.backendConnector &&
733
+ r.backendConnector.saveMissing &&
734
+ r.backendConnector.saveMissing(
735
+ e,
736
+ c,
737
+ t,
738
+ j ? o.defaultValue : d,
739
+ j,
740
+ o,
741
+ ),
742
+ r.emit("missingKey", e, c, t, d));
743
+ };
744
+ if (this.options.saveMissing) {
745
+ var A = void 0 !== o.count && "string" != typeof o.count;
746
+ this.options.saveMissingPlurals && A
747
+ ? P.forEach(function (e) {
748
+ r.pluralResolver
749
+ .getPluralFormsOfKey(e, u)
750
+ .forEach(function (t) {
751
+ return T([e], t);
752
+ });
753
+ })
754
+ : T(P, u);
755
+ }
756
+ }
757
+ ((d = this.extendTranslation(d, t, o, h, i)),
758
+ C &&
759
+ d === u &&
760
+ this.options.appendNamespaceToMissingKey &&
761
+ (d = "".concat(c, ":").concat(u)),
762
+ C &&
763
+ this.options.parseMissingKeyHandler &&
764
+ (d = this.options.parseMissingKeyHandler(d)));
765
+ }
766
+ return d;
767
+ },
768
+ },
769
+ {
770
+ key: "extendTranslation",
771
+ value: function (e, t, o, i, r) {
772
+ var a = this;
773
+ if (this.i18nFormat && this.i18nFormat.parse)
774
+ e = this.i18nFormat.parse(
775
+ e,
776
+ o,
777
+ i.usedLng,
778
+ i.usedNS,
779
+ i.usedKey,
780
+ { resolved: i },
781
+ );
782
+ else if (!o.skipInterpolation) {
783
+ o.interpolation &&
784
+ this.interpolator.init(
785
+ n({}, o, {
786
+ interpolation: n(
787
+ {},
788
+ this.options.interpolation,
789
+ o.interpolation,
790
+ ),
791
+ }),
792
+ );
793
+ var s,
794
+ u =
795
+ (o.interpolation && o.interpolation.skipOnVariables) ||
796
+ this.options.interpolation.skipOnVariables;
797
+ if (u) {
798
+ var l = e.match(this.interpolator.nestingRegexp);
799
+ s = l && l.length;
800
+ }
801
+ var c =
802
+ o.replace && "string" != typeof o.replace ? o.replace : o;
803
+ if (
804
+ (this.options.interpolation.defaultVariables &&
805
+ (c = n({}, this.options.interpolation.defaultVariables, c)),
806
+ (e = this.interpolator.interpolate(
807
+ e,
808
+ c,
809
+ o.lng || this.language,
810
+ o,
811
+ )),
812
+ u)
813
+ ) {
814
+ var p = e.match(this.interpolator.nestingRegexp);
815
+ s < (p && p.length) && (o.nest = !1);
816
+ }
817
+ (!1 !== o.nest &&
818
+ (e = this.interpolator.nest(
819
+ e,
820
+ function () {
821
+ for (
822
+ var e = arguments.length, n = new Array(e), o = 0;
823
+ o < e;
824
+ o++
825
+ )
826
+ n[o] = arguments[o];
827
+ return r && r[0] === n[0]
828
+ ? (a.logger.warn(
829
+ "It seems you are nesting recursively key: "
830
+ .concat(n[0], " in key: ")
831
+ .concat(t[0]),
832
+ ),
833
+ null)
834
+ : a.translate.apply(a, n.concat([t]));
835
+ },
836
+ o,
837
+ )),
838
+ o.interpolation && this.interpolator.reset());
839
+ }
840
+ var g = o.postProcess || this.options.postProcess,
841
+ f = "string" == typeof g ? [g] : g;
842
+ return (
843
+ null != e &&
844
+ f &&
845
+ f.length &&
846
+ !1 !== o.applyPostProcessor &&
847
+ (e = O.handle(
848
+ f,
849
+ e,
850
+ t,
851
+ this.options && this.options.postProcessPassResolved
852
+ ? n({ i18nResolved: i }, o)
853
+ : o,
854
+ this,
855
+ )),
856
+ e
857
+ );
858
+ },
859
+ },
860
+ {
861
+ key: "resolve",
862
+ value: function (e) {
863
+ var t,
864
+ n,
865
+ o,
866
+ i,
867
+ r,
868
+ a = this,
869
+ s =
870
+ arguments.length > 1 && void 0 !== arguments[1]
871
+ ? arguments[1]
872
+ : {};
873
+ return (
874
+ "string" == typeof e && (e = [e]),
875
+ e.forEach(function (e) {
876
+ if (!a.isValidLookup(t)) {
877
+ var u = a.extractFromKey(e, s),
878
+ l = u.key;
879
+ n = l;
880
+ var c = u.namespaces;
881
+ a.options.fallbackNS &&
882
+ (c = c.concat(a.options.fallbackNS));
883
+ var p = void 0 !== s.count && "string" != typeof s.count,
884
+ g =
885
+ void 0 !== s.context &&
886
+ "string" == typeof s.context &&
887
+ "" !== s.context,
888
+ f = s.lngs
889
+ ? s.lngs
890
+ : a.languageUtils.toResolveHierarchy(
891
+ s.lng || a.language,
892
+ s.fallbackLng,
893
+ );
894
+ c.forEach(function (e) {
895
+ a.isValidLookup(t) ||
896
+ ((r = e),
897
+ !R["".concat(f[0], "-").concat(e)] &&
898
+ a.utils &&
899
+ a.utils.hasLoadedNamespace &&
900
+ !a.utils.hasLoadedNamespace(r) &&
901
+ ((R["".concat(f[0], "-").concat(e)] = !0),
902
+ a.logger.warn(
903
+ 'key "'
904
+ .concat(n, '" for languages "')
905
+ .concat(
906
+ f.join(", "),
907
+ '" won\'t get resolved as namespace "',
908
+ )
909
+ .concat(r, '" was not yet loaded'),
910
+ "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!!!",
911
+ )),
912
+ f.forEach(function (n) {
913
+ if (!a.isValidLookup(t)) {
914
+ i = n;
915
+ var r,
916
+ u,
917
+ c = l,
918
+ f = [c];
919
+ if (a.i18nFormat && a.i18nFormat.addLookupKeys)
920
+ a.i18nFormat.addLookupKeys(f, l, n, e, s);
921
+ else
922
+ (p &&
923
+ (r = a.pluralResolver.getSuffix(n, s.count)),
924
+ p && g && f.push(c + r),
925
+ g &&
926
+ f.push(
927
+ (c += ""
928
+ .concat(a.options.contextSeparator)
929
+ .concat(s.context)),
930
+ ),
931
+ p && f.push((c += r)));
932
+ for (; (u = f.pop()); )
933
+ a.isValidLookup(t) ||
934
+ ((o = u), (t = a.getResource(n, e, u, s)));
935
+ }
936
+ }));
937
+ });
938
+ }
939
+ }),
940
+ { res: t, usedKey: n, exactUsedKey: o, usedLng: i, usedNS: r }
941
+ );
942
+ },
943
+ },
944
+ {
945
+ key: "isValidLookup",
946
+ value: function (e) {
947
+ return !(
948
+ void 0 === e ||
949
+ (!this.options.returnNull && null === e) ||
950
+ (!this.options.returnEmptyString && "" === e)
951
+ );
952
+ },
953
+ },
954
+ {
955
+ key: "getResource",
956
+ value: function (e, t, n) {
957
+ var o =
958
+ arguments.length > 3 && void 0 !== arguments[3]
959
+ ? arguments[3]
960
+ : {};
961
+ return this.i18nFormat && this.i18nFormat.getResource
962
+ ? this.i18nFormat.getResource(e, t, n, o)
963
+ : this.resourceStore.getResource(e, t, n, o);
964
+ },
965
+ },
966
+ ]),
967
+ i
968
+ );
969
+ })();
970
+ function N(e) {
971
+ return e.charAt(0).toUpperCase() + e.slice(1);
972
+ }
973
+ var j = (function () {
974
+ function e(t) {
975
+ (o(this, e),
976
+ (this.options = t),
977
+ (this.whitelist = this.options.supportedLngs || !1),
978
+ (this.supportedLngs = this.options.supportedLngs || !1),
979
+ (this.logger = g.create("languageUtils")));
980
+ }
981
+ return (
982
+ r(e, [
983
+ {
984
+ key: "getScriptPartFromCode",
985
+ value: function (e) {
986
+ if (!e || e.indexOf("-") < 0) return null;
987
+ var t = e.split("-");
988
+ return 2 === t.length
989
+ ? null
990
+ : (t.pop(),
991
+ "x" === t[t.length - 1].toLowerCase()
992
+ ? null
993
+ : this.formatLanguageCode(t.join("-")));
994
+ },
995
+ },
996
+ {
997
+ key: "getLanguagePartFromCode",
998
+ value: function (e) {
999
+ if (!e || e.indexOf("-") < 0) return e;
1000
+ var t = e.split("-");
1001
+ return this.formatLanguageCode(t[0]);
1002
+ },
1003
+ },
1004
+ {
1005
+ key: "formatLanguageCode",
1006
+ value: function (e) {
1007
+ if ("string" == typeof e && e.indexOf("-") > -1) {
1008
+ var t = [
1009
+ "hans",
1010
+ "hant",
1011
+ "latn",
1012
+ "cyrl",
1013
+ "cans",
1014
+ "mong",
1015
+ "arab",
1016
+ ],
1017
+ n = e.split("-");
1018
+ return (
1019
+ this.options.lowerCaseLng
1020
+ ? (n = n.map(function (e) {
1021
+ return e.toLowerCase();
1022
+ }))
1023
+ : 2 === n.length
1024
+ ? ((n[0] = n[0].toLowerCase()),
1025
+ (n[1] = n[1].toUpperCase()),
1026
+ t.indexOf(n[1].toLowerCase()) > -1 &&
1027
+ (n[1] = N(n[1].toLowerCase())))
1028
+ : 3 === n.length &&
1029
+ ((n[0] = n[0].toLowerCase()),
1030
+ 2 === n[1].length && (n[1] = n[1].toUpperCase()),
1031
+ "sgn" !== n[0] &&
1032
+ 2 === n[2].length &&
1033
+ (n[2] = n[2].toUpperCase()),
1034
+ t.indexOf(n[1].toLowerCase()) > -1 &&
1035
+ (n[1] = N(n[1].toLowerCase())),
1036
+ t.indexOf(n[2].toLowerCase()) > -1 &&
1037
+ (n[2] = N(n[2].toLowerCase()))),
1038
+ n.join("-")
1039
+ );
1040
+ }
1041
+ return this.options.cleanCode || this.options.lowerCaseLng
1042
+ ? e.toLowerCase()
1043
+ : e;
1044
+ },
1045
+ },
1046
+ {
1047
+ key: "isWhitelisted",
1048
+ value: function (e) {
1049
+ return (
1050
+ this.logger.deprecate(
1051
+ "languageUtils.isWhitelisted",
1052
+ 'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.',
1053
+ ),
1054
+ this.isSupportedCode(e)
1055
+ );
1056
+ },
1057
+ },
1058
+ {
1059
+ key: "isSupportedCode",
1060
+ value: function (e) {
1061
+ return (
1062
+ ("languageOnly" === this.options.load ||
1063
+ this.options.nonExplicitSupportedLngs) &&
1064
+ (e = this.getLanguagePartFromCode(e)),
1065
+ !this.supportedLngs ||
1066
+ !this.supportedLngs.length ||
1067
+ this.supportedLngs.indexOf(e) > -1
1068
+ );
1069
+ },
1070
+ },
1071
+ {
1072
+ key: "getBestMatchFromCodes",
1073
+ value: function (e) {
1074
+ var t,
1075
+ n = this;
1076
+ return e
1077
+ ? (e.forEach(function (e) {
1078
+ if (!t) {
1079
+ var o = n.formatLanguageCode(e);
1080
+ (n.options.supportedLngs && !n.isSupportedCode(o)) ||
1081
+ (t = o);
1082
+ }
1083
+ }),
1084
+ !t &&
1085
+ this.options.supportedLngs &&
1086
+ e.forEach(function (e) {
1087
+ if (!t) {
1088
+ var o = n.getLanguagePartFromCode(e);
1089
+ if (n.isSupportedCode(o)) return (t = o);
1090
+ t = n.options.supportedLngs.find(function (e) {
1091
+ if (0 === e.indexOf(o)) return e;
1092
+ });
1093
+ }
1094
+ }),
1095
+ t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]),
1096
+ t)
1097
+ : null;
1098
+ },
1099
+ },
1100
+ {
1101
+ key: "getFallbackCodes",
1102
+ value: function (e, t) {
1103
+ if (!e) return [];
1104
+ if (
1105
+ ("string" == typeof e && (e = [e]),
1106
+ "[object Array]" === Object.prototype.toString.apply(e))
1107
+ )
1108
+ return e;
1109
+ if (!t) return e.default || [];
1110
+ var n = e[t];
1111
+ return (
1112
+ n || (n = e[this.getScriptPartFromCode(t)]),
1113
+ n || (n = e[this.formatLanguageCode(t)]),
1114
+ n || (n = e[this.getLanguagePartFromCode(t)]),
1115
+ n || (n = e.default),
1116
+ n || []
1117
+ );
1118
+ },
1119
+ },
1120
+ {
1121
+ key: "toResolveHierarchy",
1122
+ value: function (e, t) {
1123
+ var n = this,
1124
+ o = this.getFallbackCodes(
1125
+ t || this.options.fallbackLng || [],
1126
+ e,
1127
+ ),
1128
+ i = [],
1129
+ r = function (e) {
1130
+ e &&
1131
+ (n.isSupportedCode(e)
1132
+ ? i.push(e)
1133
+ : n.logger.warn(
1134
+ "rejecting language code not found in supportedLngs: ".concat(
1135
+ e,
1136
+ ),
1137
+ ));
1138
+ };
1139
+ return (
1140
+ "string" == typeof e && e.indexOf("-") > -1
1141
+ ? ("languageOnly" !== this.options.load &&
1142
+ r(this.formatLanguageCode(e)),
1143
+ "languageOnly" !== this.options.load &&
1144
+ "currentOnly" !== this.options.load &&
1145
+ r(this.getScriptPartFromCode(e)),
1146
+ "currentOnly" !== this.options.load &&
1147
+ r(this.getLanguagePartFromCode(e)))
1148
+ : "string" == typeof e && r(this.formatLanguageCode(e)),
1149
+ o.forEach(function (e) {
1150
+ i.indexOf(e) < 0 && r(n.formatLanguageCode(e));
1151
+ }),
1152
+ i
1153
+ );
1154
+ },
1155
+ },
1156
+ ]),
1157
+ e
1158
+ );
1159
+ })(),
1160
+ E = [
1161
+ {
1162
+ lngs: [
1163
+ "ach",
1164
+ "ak",
1165
+ "am",
1166
+ "arn",
1167
+ "br",
1168
+ "fil",
1169
+ "gun",
1170
+ "ln",
1171
+ "mfe",
1172
+ "mg",
1173
+ "mi",
1174
+ "oc",
1175
+ "pt",
1176
+ "pt-BR",
1177
+ "tg",
1178
+ "ti",
1179
+ "tr",
1180
+ "uz",
1181
+ "wa",
1182
+ ],
1183
+ nr: [1, 2],
1184
+ fc: 1,
1185
+ },
1186
+ {
1187
+ lngs: [
1188
+ "af",
1189
+ "an",
1190
+ "ast",
1191
+ "az",
1192
+ "bg",
1193
+ "bn",
1194
+ "ca",
1195
+ "da",
1196
+ "de",
1197
+ "dev",
1198
+ "el",
1199
+ "en",
1200
+ "eo",
1201
+ "es",
1202
+ "et",
1203
+ "eu",
1204
+ "fi",
1205
+ "fo",
1206
+ "fur",
1207
+ "fy",
1208
+ "gl",
1209
+ "gu",
1210
+ "ha",
1211
+ "hi",
1212
+ "hu",
1213
+ "hy",
1214
+ "ia",
1215
+ "it",
1216
+ "kn",
1217
+ "ku",
1218
+ "lb",
1219
+ "mai",
1220
+ "ml",
1221
+ "mn",
1222
+ "mr",
1223
+ "nah",
1224
+ "nap",
1225
+ "nb",
1226
+ "ne",
1227
+ "nl",
1228
+ "nn",
1229
+ "no",
1230
+ "nso",
1231
+ "pa",
1232
+ "pap",
1233
+ "pms",
1234
+ "ps",
1235
+ "pt-PT",
1236
+ "rm",
1237
+ "sco",
1238
+ "se",
1239
+ "si",
1240
+ "so",
1241
+ "son",
1242
+ "sq",
1243
+ "sv",
1244
+ "sw",
1245
+ "ta",
1246
+ "te",
1247
+ "tk",
1248
+ "ur",
1249
+ "yo",
1250
+ ],
1251
+ nr: [1, 2],
1252
+ fc: 2,
1253
+ },
1254
+ {
1255
+ lngs: [
1256
+ "ay",
1257
+ "bo",
1258
+ "cgg",
1259
+ "fa",
1260
+ "ht",
1261
+ "id",
1262
+ "ja",
1263
+ "jbo",
1264
+ "ka",
1265
+ "kk",
1266
+ "km",
1267
+ "ko",
1268
+ "ky",
1269
+ "lo",
1270
+ "ms",
1271
+ "sah",
1272
+ "su",
1273
+ "th",
1274
+ "tt",
1275
+ "ug",
1276
+ "vi",
1277
+ "wo",
1278
+ "zh",
1279
+ ],
1280
+ nr: [1],
1281
+ fc: 3,
1282
+ },
1283
+ {
1284
+ lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
1285
+ nr: [1, 2, 5],
1286
+ fc: 4,
1287
+ },
1288
+ { lngs: ["ar"], nr: [0, 1, 2, 3, 11, 100], fc: 5 },
1289
+ { lngs: ["cs", "sk"], nr: [1, 2, 5], fc: 6 },
1290
+ { lngs: ["csb", "pl"], nr: [1, 2, 5], fc: 7 },
1291
+ { lngs: ["cy"], nr: [1, 2, 3, 8], fc: 8 },
1292
+ { lngs: ["fr"], nr: [1, 2], fc: 9 },
1293
+ { lngs: ["ga"], nr: [1, 2, 3, 7, 11], fc: 10 },
1294
+ { lngs: ["gd"], nr: [1, 2, 3, 20], fc: 11 },
1295
+ { lngs: ["is"], nr: [1, 2], fc: 12 },
1296
+ { lngs: ["jv"], nr: [0, 1], fc: 13 },
1297
+ { lngs: ["kw"], nr: [1, 2, 3, 4], fc: 14 },
1298
+ { lngs: ["lt"], nr: [1, 2, 10], fc: 15 },
1299
+ { lngs: ["lv"], nr: [1, 2, 0], fc: 16 },
1300
+ { lngs: ["mk"], nr: [1, 2], fc: 17 },
1301
+ { lngs: ["mnk"], nr: [0, 1, 2], fc: 18 },
1302
+ { lngs: ["mt"], nr: [1, 2, 11, 20], fc: 19 },
1303
+ { lngs: ["or"], nr: [2, 1], fc: 2 },
1304
+ { lngs: ["ro"], nr: [1, 2, 20], fc: 20 },
1305
+ { lngs: ["sl"], nr: [5, 1, 2, 3], fc: 21 },
1306
+ { lngs: ["he", "iw"], nr: [1, 2, 20, 21], fc: 22 },
1307
+ ],
1308
+ P = {
1309
+ 1: function (e) {
1310
+ return Number(e > 1);
1311
+ },
1312
+ 2: function (e) {
1313
+ return Number(1 != e);
1314
+ },
1315
+ 3: function (e) {
1316
+ return 0;
1317
+ },
1318
+ 4: function (e) {
1319
+ return Number(
1320
+ e % 10 == 1 && e % 100 != 11
1321
+ ? 0
1322
+ : e % 10 >= 2 && e % 10 <= 4 && (e % 100 < 10 || e % 100 >= 20)
1323
+ ? 1
1324
+ : 2,
1325
+ );
1326
+ },
1327
+ 5: function (e) {
1328
+ return Number(
1329
+ 0 == e
1330
+ ? 0
1331
+ : 1 == e
1332
+ ? 1
1333
+ : 2 == e
1334
+ ? 2
1335
+ : e % 100 >= 3 && e % 100 <= 10
1336
+ ? 3
1337
+ : e % 100 >= 11
1338
+ ? 4
1339
+ : 5,
1340
+ );
1341
+ },
1342
+ 6: function (e) {
1343
+ return Number(1 == e ? 0 : e >= 2 && e <= 4 ? 1 : 2);
1344
+ },
1345
+ 7: function (e) {
1346
+ return Number(
1347
+ 1 == e
1348
+ ? 0
1349
+ : e % 10 >= 2 && e % 10 <= 4 && (e % 100 < 10 || e % 100 >= 20)
1350
+ ? 1
1351
+ : 2,
1352
+ );
1353
+ },
1354
+ 8: function (e) {
1355
+ return Number(1 == e ? 0 : 2 == e ? 1 : 8 != e && 11 != e ? 2 : 3);
1356
+ },
1357
+ 9: function (e) {
1358
+ return Number(e >= 2);
1359
+ },
1360
+ 10: function (e) {
1361
+ return Number(1 == e ? 0 : 2 == e ? 1 : e < 7 ? 2 : e < 11 ? 3 : 4);
1362
+ },
1363
+ 11: function (e) {
1364
+ return Number(
1365
+ 1 == e || 11 == e
1366
+ ? 0
1367
+ : 2 == e || 12 == e
1368
+ ? 1
1369
+ : e > 2 && e < 20
1370
+ ? 2
1371
+ : 3,
1372
+ );
1373
+ },
1374
+ 12: function (e) {
1375
+ return Number(e % 10 != 1 || e % 100 == 11);
1376
+ },
1377
+ 13: function (e) {
1378
+ return Number(0 !== e);
1379
+ },
1380
+ 14: function (e) {
1381
+ return Number(1 == e ? 0 : 2 == e ? 1 : 3 == e ? 2 : 3);
1382
+ },
1383
+ 15: function (e) {
1384
+ return Number(
1385
+ e % 10 == 1 && e % 100 != 11
1386
+ ? 0
1387
+ : e % 10 >= 2 && (e % 100 < 10 || e % 100 >= 20)
1388
+ ? 1
1389
+ : 2,
1390
+ );
1391
+ },
1392
+ 16: function (e) {
1393
+ return Number(e % 10 == 1 && e % 100 != 11 ? 0 : 0 !== e ? 1 : 2);
1394
+ },
1395
+ 17: function (e) {
1396
+ return Number(1 == e || (e % 10 == 1 && e % 100 != 11) ? 0 : 1);
1397
+ },
1398
+ 18: function (e) {
1399
+ return Number(0 == e ? 0 : 1 == e ? 1 : 2);
1400
+ },
1401
+ 19: function (e) {
1402
+ return Number(
1403
+ 1 == e
1404
+ ? 0
1405
+ : 0 == e || (e % 100 > 1 && e % 100 < 11)
1406
+ ? 1
1407
+ : e % 100 > 10 && e % 100 < 20
1408
+ ? 2
1409
+ : 3,
1410
+ );
1411
+ },
1412
+ 20: function (e) {
1413
+ return Number(
1414
+ 1 == e ? 0 : 0 == e || (e % 100 > 0 && e % 100 < 20) ? 1 : 2,
1415
+ );
1416
+ },
1417
+ 21: function (e) {
1418
+ return Number(
1419
+ e % 100 == 1
1420
+ ? 1
1421
+ : e % 100 == 2
1422
+ ? 2
1423
+ : e % 100 == 3 || e % 100 == 4
1424
+ ? 3
1425
+ : 0,
1426
+ );
1427
+ },
1428
+ 22: function (e) {
1429
+ return Number(
1430
+ 1 == e ? 0 : 2 == e ? 1 : (e < 0 || e > 10) && e % 10 == 0 ? 2 : 3,
1431
+ );
1432
+ },
1433
+ };
1434
+ var F = (function () {
1435
+ function e(t) {
1436
+ var n,
1437
+ i =
1438
+ arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1439
+ (o(this, e),
1440
+ (this.languageUtils = t),
1441
+ (this.options = i),
1442
+ (this.logger = g.create("pluralResolver")),
1443
+ (this.rules =
1444
+ ((n = {}),
1445
+ E.forEach(function (e) {
1446
+ e.lngs.forEach(function (t) {
1447
+ n[t] = { numbers: e.nr, plurals: P[e.fc] };
1448
+ });
1449
+ }),
1450
+ n)));
1451
+ }
1452
+ return (
1453
+ r(e, [
1454
+ {
1455
+ key: "addRule",
1456
+ value: function (e, t) {
1457
+ this.rules[e] = t;
1458
+ },
1459
+ },
1460
+ {
1461
+ key: "getRule",
1462
+ value: function (e) {
1463
+ return (
1464
+ this.rules[e] ||
1465
+ this.rules[this.languageUtils.getLanguagePartFromCode(e)]
1466
+ );
1467
+ },
1468
+ },
1469
+ {
1470
+ key: "needsPlural",
1471
+ value: function (e) {
1472
+ var t = this.getRule(e);
1473
+ return t && t.numbers.length > 1;
1474
+ },
1475
+ },
1476
+ {
1477
+ key: "getPluralFormsOfKey",
1478
+ value: function (e, t) {
1479
+ var n = this,
1480
+ o = [],
1481
+ i = this.getRule(e);
1482
+ return i
1483
+ ? (i.numbers.forEach(function (i) {
1484
+ var r = n.getSuffix(e, i);
1485
+ o.push("".concat(t).concat(r));
1486
+ }),
1487
+ o)
1488
+ : o;
1489
+ },
1490
+ },
1491
+ {
1492
+ key: "getSuffix",
1493
+ value: function (e, t) {
1494
+ var n = this,
1495
+ o = this.getRule(e);
1496
+ if (o) {
1497
+ var i = o.noAbs ? o.plurals(t) : o.plurals(Math.abs(t)),
1498
+ r = o.numbers[i];
1499
+ this.options.simplifyPluralSuffix &&
1500
+ 2 === o.numbers.length &&
1501
+ 1 === o.numbers[0] &&
1502
+ (2 === r ? (r = "plural") : 1 === r && (r = ""));
1503
+ var a = function () {
1504
+ return n.options.prepend && r.toString()
1505
+ ? n.options.prepend + r.toString()
1506
+ : r.toString();
1507
+ };
1508
+ return "v1" === this.options.compatibilityJSON
1509
+ ? 1 === r
1510
+ ? ""
1511
+ : "number" == typeof r
1512
+ ? "_plural_".concat(r.toString())
1513
+ : a()
1514
+ : "v2" === this.options.compatibilityJSON
1515
+ ? a()
1516
+ : this.options.simplifyPluralSuffix &&
1517
+ 2 === o.numbers.length &&
1518
+ 1 === o.numbers[0]
1519
+ ? a()
1520
+ : this.options.prepend && i.toString()
1521
+ ? this.options.prepend + i.toString()
1522
+ : i.toString();
1523
+ }
1524
+ return (
1525
+ this.logger.warn("no plural rule found for: ".concat(e)),
1526
+ ""
1527
+ );
1528
+ },
1529
+ },
1530
+ ]),
1531
+ e
1532
+ );
1533
+ })(),
1534
+ V = (function () {
1535
+ function e() {
1536
+ var t =
1537
+ arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
1538
+ (o(this, e),
1539
+ (this.logger = g.create("interpolator")),
1540
+ (this.options = t),
1541
+ (this.format =
1542
+ (t.interpolation && t.interpolation.format) ||
1543
+ function (e) {
1544
+ return e;
1545
+ }),
1546
+ this.init(t));
1547
+ }
1548
+ return (
1549
+ r(e, [
1550
+ {
1551
+ key: "init",
1552
+ value: function () {
1553
+ var e =
1554
+ arguments.length > 0 && void 0 !== arguments[0]
1555
+ ? arguments[0]
1556
+ : {};
1557
+ e.interpolation || (e.interpolation = { escapeValue: !0 });
1558
+ var t = e.interpolation;
1559
+ ((this.escape = void 0 !== t.escape ? t.escape : w),
1560
+ (this.escapeValue = void 0 === t.escapeValue || t.escapeValue),
1561
+ (this.useRawValueToEscape =
1562
+ void 0 !== t.useRawValueToEscape && t.useRawValueToEscape),
1563
+ (this.prefix = t.prefix
1564
+ ? k(t.prefix)
1565
+ : t.prefixEscaped || "{{"),
1566
+ (this.suffix = t.suffix
1567
+ ? k(t.suffix)
1568
+ : t.suffixEscaped || "}}"),
1569
+ (this.formatSeparator = t.formatSeparator
1570
+ ? t.formatSeparator
1571
+ : t.formatSeparator || ","),
1572
+ (this.unescapePrefix = t.unescapeSuffix
1573
+ ? ""
1574
+ : t.unescapePrefix || "-"),
1575
+ (this.unescapeSuffix = this.unescapePrefix
1576
+ ? ""
1577
+ : t.unescapeSuffix || ""),
1578
+ (this.nestingPrefix = t.nestingPrefix
1579
+ ? k(t.nestingPrefix)
1580
+ : t.nestingPrefixEscaped || k("$t(")),
1581
+ (this.nestingSuffix = t.nestingSuffix
1582
+ ? k(t.nestingSuffix)
1583
+ : t.nestingSuffixEscaped || k(")")),
1584
+ (this.nestingOptionsSeparator = t.nestingOptionsSeparator
1585
+ ? t.nestingOptionsSeparator
1586
+ : t.nestingOptionsSeparator || ","),
1587
+ (this.maxReplaces = t.maxReplaces ? t.maxReplaces : 1e3),
1588
+ (this.alwaysFormat =
1589
+ void 0 !== t.alwaysFormat && t.alwaysFormat),
1590
+ this.resetRegExp());
1591
+ },
1592
+ },
1593
+ {
1594
+ key: "reset",
1595
+ value: function () {
1596
+ this.options && this.init(this.options);
1597
+ },
1598
+ },
1599
+ {
1600
+ key: "resetRegExp",
1601
+ value: function () {
1602
+ var e = "".concat(this.prefix, "(.+?)").concat(this.suffix);
1603
+ this.regexp = new RegExp(e, "g");
1604
+ var t = ""
1605
+ .concat(this.prefix)
1606
+ .concat(this.unescapePrefix, "(.+?)")
1607
+ .concat(this.unescapeSuffix)
1608
+ .concat(this.suffix);
1609
+ this.regexpUnescape = new RegExp(t, "g");
1610
+ var n = ""
1611
+ .concat(this.nestingPrefix, "(.+?)")
1612
+ .concat(this.nestingSuffix);
1613
+ this.nestingRegexp = new RegExp(n, "g");
1614
+ },
1615
+ },
1616
+ {
1617
+ key: "interpolate",
1618
+ value: function (e, t, n, o) {
1619
+ var i,
1620
+ r,
1621
+ a,
1622
+ s = this,
1623
+ u =
1624
+ (this.options &&
1625
+ this.options.interpolation &&
1626
+ this.options.interpolation.defaultVariables) ||
1627
+ {};
1628
+ function l(e) {
1629
+ return e.replace(/\$/g, "$$$$");
1630
+ }
1631
+ var c = function (e) {
1632
+ if (e.indexOf(s.formatSeparator) < 0) {
1633
+ var i = b(t, u, e);
1634
+ return s.alwaysFormat ? s.format(i, void 0, n) : i;
1635
+ }
1636
+ var r = e.split(s.formatSeparator),
1637
+ a = r.shift().trim(),
1638
+ l = r.join(s.formatSeparator).trim();
1639
+ return s.format(b(t, u, a), l, n, o);
1640
+ };
1641
+ this.resetRegExp();
1642
+ var p =
1643
+ (o && o.missingInterpolationHandler) ||
1644
+ this.options.missingInterpolationHandler,
1645
+ g =
1646
+ (o && o.interpolation && o.interpolation.skipOnVariables) ||
1647
+ this.options.interpolation.skipOnVariables;
1648
+ return (
1649
+ [
1650
+ {
1651
+ regex: this.regexpUnescape,
1652
+ safeValue: function (e) {
1653
+ return l(e);
1654
+ },
1655
+ },
1656
+ {
1657
+ regex: this.regexp,
1658
+ safeValue: function (e) {
1659
+ return s.escapeValue ? l(s.escape(e)) : l(e);
1660
+ },
1661
+ },
1662
+ ].forEach(function (t) {
1663
+ for (a = 0; (i = t.regex.exec(e)); ) {
1664
+ if (void 0 === (r = c(i[1].trim())))
1665
+ if ("function" == typeof p) {
1666
+ var n = p(e, i, o);
1667
+ r = "string" == typeof n ? n : "";
1668
+ } else {
1669
+ if (g) {
1670
+ r = i[0];
1671
+ continue;
1672
+ }
1673
+ (s.logger.warn(
1674
+ "missed to pass in variable "
1675
+ .concat(i[1], " for interpolating ")
1676
+ .concat(e),
1677
+ ),
1678
+ (r = ""));
1679
+ }
1680
+ else
1681
+ "string" == typeof r ||
1682
+ s.useRawValueToEscape ||
1683
+ (r = d(r));
1684
+ if (
1685
+ ((e = e.replace(i[0], t.safeValue(r))),
1686
+ (t.regex.lastIndex = 0),
1687
+ ++a >= s.maxReplaces)
1688
+ )
1689
+ break;
1690
+ }
1691
+ }),
1692
+ e
1693
+ );
1694
+ },
1695
+ },
1696
+ {
1697
+ key: "nest",
1698
+ value: function (e, t) {
1699
+ var o,
1700
+ i,
1701
+ r = this,
1702
+ a =
1703
+ arguments.length > 2 && void 0 !== arguments[2]
1704
+ ? arguments[2]
1705
+ : {},
1706
+ s = n({}, a);
1707
+ function u(e, t) {
1708
+ var o = this.nestingOptionsSeparator;
1709
+ if (e.indexOf(o) < 0) return e;
1710
+ var i = e.split(new RegExp("".concat(o, "[ ]*{"))),
1711
+ r = "{".concat(i[1]);
1712
+ ((e = i[0]),
1713
+ (r = (r = this.interpolate(r, s)).replace(/'/g, '"')));
1714
+ try {
1715
+ ((s = JSON.parse(r)), t && (s = n({}, t, s)));
1716
+ } catch (t) {
1717
+ return (
1718
+ this.logger.warn(
1719
+ "failed parsing options string in nesting for key ".concat(
1720
+ e,
1721
+ ),
1722
+ t,
1723
+ ),
1724
+ "".concat(e).concat(o).concat(r)
1725
+ );
1726
+ }
1727
+ return (delete s.defaultValue, e);
1728
+ }
1729
+ for (
1730
+ s.applyPostProcessor = !1, delete s.defaultValue;
1731
+ (o = this.nestingRegexp.exec(e));
1732
+ ) {
1733
+ var l = [],
1734
+ c = !1;
1735
+ if (o[0].includes(this.formatSeparator) && !/{.*}/.test(o[1])) {
1736
+ var p = o[1].split(this.formatSeparator).map(function (e) {
1737
+ return e.trim();
1738
+ });
1739
+ ((o[1] = p.shift()), (l = p), (c = !0));
1740
+ }
1741
+ if (
1742
+ (i = t(u.call(this, o[1].trim(), s), s)) &&
1743
+ o[0] === e &&
1744
+ "string" != typeof i
1745
+ )
1746
+ return i;
1747
+ ("string" != typeof i && (i = d(i)),
1748
+ i ||
1749
+ (this.logger.warn(
1750
+ "missed to resolve "
1751
+ .concat(o[1], " for nesting ")
1752
+ .concat(e),
1753
+ ),
1754
+ (i = "")),
1755
+ c &&
1756
+ (i = l.reduce(function (e, t) {
1757
+ return r.format(e, t, a.lng, a);
1758
+ }, i.trim())),
1759
+ (e = e.replace(o[0], i)),
1760
+ (this.regexp.lastIndex = 0));
1761
+ }
1762
+ return e;
1763
+ },
1764
+ },
1765
+ ]),
1766
+ e
1767
+ );
1768
+ })();
1769
+ var T = (function (e) {
1770
+ function t(e, n, i) {
1771
+ var r,
1772
+ l = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
1773
+ return (
1774
+ o(this, t),
1775
+ (r = s(this, u(t).call(this))),
1776
+ S && f.call(a(r)),
1777
+ (r.backend = e),
1778
+ (r.store = n),
1779
+ (r.services = i),
1780
+ (r.languageUtils = i.languageUtils),
1781
+ (r.options = l),
1782
+ (r.logger = g.create("backendConnector")),
1783
+ (r.state = {}),
1784
+ (r.queue = []),
1785
+ r.backend && r.backend.init && r.backend.init(i, l.backend, l),
1786
+ r
1787
+ );
1788
+ }
1789
+ return (
1790
+ c(t, f),
1791
+ r(t, [
1792
+ {
1793
+ key: "queueLoad",
1794
+ value: function (e, t, n, o) {
1795
+ var i = this,
1796
+ r = [],
1797
+ a = [],
1798
+ s = [],
1799
+ u = [];
1800
+ return (
1801
+ e.forEach(function (e) {
1802
+ var o = !0;
1803
+ (t.forEach(function (t) {
1804
+ var s = "".concat(e, "|").concat(t);
1805
+ !n.reload && i.store.hasResourceBundle(e, t)
1806
+ ? (i.state[s] = 2)
1807
+ : i.state[s] < 0 ||
1808
+ (1 === i.state[s]
1809
+ ? a.indexOf(s) < 0 && a.push(s)
1810
+ : ((i.state[s] = 1),
1811
+ (o = !1),
1812
+ a.indexOf(s) < 0 && a.push(s),
1813
+ r.indexOf(s) < 0 && r.push(s),
1814
+ u.indexOf(t) < 0 && u.push(t)));
1815
+ }),
1816
+ o || s.push(e));
1817
+ }),
1818
+ (r.length || a.length) &&
1819
+ this.queue.push({
1820
+ pending: a,
1821
+ loaded: {},
1822
+ errors: [],
1823
+ callback: o,
1824
+ }),
1825
+ { toLoad: r, pending: a, toLoadLanguages: s, toLoadNamespaces: u }
1826
+ );
1827
+ },
1828
+ },
1829
+ {
1830
+ key: "loaded",
1831
+ value: function (e, t, n) {
1832
+ var o = e.split("|"),
1833
+ i = o[0],
1834
+ r = o[1];
1835
+ (t && this.emit("failedLoading", i, r, t),
1836
+ n && this.store.addResourceBundle(i, r, n),
1837
+ (this.state[e] = t ? -1 : 2));
1838
+ var a = {};
1839
+ (this.queue.forEach(function (n) {
1840
+ var o, s, u, l, c, p;
1841
+ ((o = n.loaded),
1842
+ (s = r),
1843
+ (l = v(o, [i], Object)),
1844
+ (c = l.obj),
1845
+ (p = l.k),
1846
+ (c[p] = c[p] || []),
1847
+ u && (c[p] = c[p].concat(s)),
1848
+ u || c[p].push(s),
1849
+ (function (e, t) {
1850
+ for (var n = e.indexOf(t); -1 !== n; )
1851
+ (e.splice(n, 1), (n = e.indexOf(t)));
1852
+ })(n.pending, e),
1853
+ t && n.errors.push(t),
1854
+ 0 !== n.pending.length ||
1855
+ n.done ||
1856
+ (Object.keys(n.loaded).forEach(function (e) {
1857
+ (a[e] || (a[e] = []),
1858
+ n.loaded[e].length &&
1859
+ n.loaded[e].forEach(function (t) {
1860
+ a[e].indexOf(t) < 0 && a[e].push(t);
1861
+ }));
1862
+ }),
1863
+ (n.done = !0),
1864
+ n.errors.length ? n.callback(n.errors) : n.callback()));
1865
+ }),
1866
+ this.emit("loaded", a),
1867
+ (this.queue = this.queue.filter(function (e) {
1868
+ return !e.done;
1869
+ })));
1870
+ },
1871
+ },
1872
+ {
1873
+ key: "read",
1874
+ value: function (e, t, n) {
1875
+ var o = this,
1876
+ i =
1877
+ arguments.length > 3 && void 0 !== arguments[3]
1878
+ ? arguments[3]
1879
+ : 0,
1880
+ r =
1881
+ arguments.length > 4 && void 0 !== arguments[4]
1882
+ ? arguments[4]
1883
+ : 350,
1884
+ a = arguments.length > 5 ? arguments[5] : void 0;
1885
+ return e.length
1886
+ ? this.backend[n](e, t, function (s, u) {
1887
+ s && u && i < 5
1888
+ ? setTimeout(function () {
1889
+ o.read.call(o, e, t, n, i + 1, 2 * r, a);
1890
+ }, r)
1891
+ : a(s, u);
1892
+ })
1893
+ : a(null, {});
1894
+ },
1895
+ },
1896
+ {
1897
+ key: "prepareLoading",
1898
+ value: function (e, t) {
1899
+ var n = this,
1900
+ o =
1901
+ arguments.length > 2 && void 0 !== arguments[2]
1902
+ ? arguments[2]
1903
+ : {},
1904
+ i = arguments.length > 3 ? arguments[3] : void 0;
1905
+ if (!this.backend)
1906
+ return (
1907
+ this.logger.warn(
1908
+ "No backend was added via i18next.use. Will not load resources.",
1909
+ ),
1910
+ i && i()
1911
+ );
1912
+ ("string" == typeof e &&
1913
+ (e = this.languageUtils.toResolveHierarchy(e)),
1914
+ "string" == typeof t && (t = [t]));
1915
+ var r = this.queueLoad(e, t, o, i);
1916
+ if (!r.toLoad.length) return (r.pending.length || i(), null);
1917
+ r.toLoad.forEach(function (e) {
1918
+ n.loadOne(e);
1919
+ });
1920
+ },
1921
+ },
1922
+ {
1923
+ key: "load",
1924
+ value: function (e, t, n) {
1925
+ this.prepareLoading(e, t, {}, n);
1926
+ },
1927
+ },
1928
+ {
1929
+ key: "reload",
1930
+ value: function (e, t, n) {
1931
+ this.prepareLoading(e, t, { reload: !0 }, n);
1932
+ },
1933
+ },
1934
+ {
1935
+ key: "loadOne",
1936
+ value: function (e) {
1937
+ var t = this,
1938
+ n =
1939
+ arguments.length > 1 && void 0 !== arguments[1]
1940
+ ? arguments[1]
1941
+ : "",
1942
+ o = e.split("|"),
1943
+ i = o[0],
1944
+ r = o[1];
1945
+ this.read(i, r, "read", void 0, void 0, function (o, a) {
1946
+ (o &&
1947
+ t.logger.warn(
1948
+ ""
1949
+ .concat(n, "loading namespace ")
1950
+ .concat(r, " for language ")
1951
+ .concat(i, " failed"),
1952
+ o,
1953
+ ),
1954
+ !o &&
1955
+ a &&
1956
+ t.logger.log(
1957
+ ""
1958
+ .concat(n, "loaded namespace ")
1959
+ .concat(r, " for language ")
1960
+ .concat(i),
1961
+ a,
1962
+ ),
1963
+ t.loaded(e, o, a));
1964
+ });
1965
+ },
1966
+ },
1967
+ {
1968
+ key: "saveMissing",
1969
+ value: function (e, t, o, i, r) {
1970
+ var a =
1971
+ arguments.length > 5 && void 0 !== arguments[5]
1972
+ ? arguments[5]
1973
+ : {};
1974
+ this.services.utils &&
1975
+ this.services.utils.hasLoadedNamespace &&
1976
+ !this.services.utils.hasLoadedNamespace(t)
1977
+ ? this.logger.warn(
1978
+ 'did not save key "'
1979
+ .concat(o, '" as the namespace "')
1980
+ .concat(t, '" was not yet loaded'),
1981
+ "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!!!",
1982
+ )
1983
+ : null != o &&
1984
+ "" !== o &&
1985
+ (this.backend &&
1986
+ this.backend.create &&
1987
+ this.backend.create(
1988
+ e,
1989
+ t,
1990
+ o,
1991
+ i,
1992
+ null,
1993
+ n({}, a, { isUpdate: r }),
1994
+ ),
1995
+ e && e[0] && this.store.addResource(e[0], t, o, i));
1996
+ },
1997
+ },
1998
+ ]),
1999
+ t
2000
+ );
2001
+ })();
2002
+ function A(e) {
2003
+ return (
2004
+ "string" == typeof e.ns && (e.ns = [e.ns]),
2005
+ "string" == typeof e.fallbackLng && (e.fallbackLng = [e.fallbackLng]),
2006
+ "string" == typeof e.fallbackNS && (e.fallbackNS = [e.fallbackNS]),
2007
+ e.whitelist &&
2008
+ (e.whitelist &&
2009
+ e.whitelist.indexOf("cimode") < 0 &&
2010
+ (e.whitelist = e.whitelist.concat(["cimode"])),
2011
+ (e.supportedLngs = e.whitelist)),
2012
+ e.nonExplicitWhitelist &&
2013
+ (e.nonExplicitSupportedLngs = e.nonExplicitWhitelist),
2014
+ e.supportedLngs &&
2015
+ e.supportedLngs.indexOf("cimode") < 0 &&
2016
+ (e.supportedLngs = e.supportedLngs.concat(["cimode"])),
2017
+ e
2018
+ );
2019
+ }
2020
+ function U() {}
2021
+ return new ((function (t) {
2022
+ function i() {
2023
+ var e,
2024
+ t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
2025
+ n = arguments.length > 1 ? arguments[1] : void 0;
2026
+ if (
2027
+ (o(this, i),
2028
+ (e = s(this, u(i).call(this))),
2029
+ S && f.call(a(e)),
2030
+ (e.options = A(t)),
2031
+ (e.services = {}),
2032
+ (e.logger = g),
2033
+ (e.modules = { external: [] }),
2034
+ n && !e.isInitialized && !t.isClone)
2035
+ ) {
2036
+ if (!e.options.initImmediate) return (e.init(t, n), s(e, a(e)));
2037
+ setTimeout(function () {
2038
+ e.init(t, n);
2039
+ }, 0);
2040
+ }
2041
+ return e;
2042
+ }
2043
+ return (
2044
+ c(i, f),
2045
+ r(i, [
2046
+ {
2047
+ key: "init",
2048
+ value: function () {
2049
+ var t = this,
2050
+ o =
2051
+ arguments.length > 0 && void 0 !== arguments[0]
2052
+ ? arguments[0]
2053
+ : {},
2054
+ i = arguments.length > 1 ? arguments[1] : void 0;
2055
+ function r(e) {
2056
+ return e ? ("function" == typeof e ? new e() : e) : null;
2057
+ }
2058
+ if (
2059
+ ("function" == typeof o && ((i = o), (o = {})),
2060
+ o.whitelist &&
2061
+ !o.supportedLngs &&
2062
+ this.logger.deprecate(
2063
+ "whitelist",
2064
+ 'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.',
2065
+ ),
2066
+ o.nonExplicitWhitelist &&
2067
+ !o.nonExplicitSupportedLngs &&
2068
+ this.logger.deprecate(
2069
+ "whitelist",
2070
+ 'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.',
2071
+ ),
2072
+ (this.options = n(
2073
+ {},
2074
+ {
2075
+ debug: !1,
2076
+ initImmediate: !0,
2077
+ ns: ["translation"],
2078
+ defaultNS: ["translation"],
2079
+ fallbackLng: ["dev"],
2080
+ fallbackNS: !1,
2081
+ whitelist: !1,
2082
+ nonExplicitWhitelist: !1,
2083
+ supportedLngs: !1,
2084
+ nonExplicitSupportedLngs: !1,
2085
+ load: "all",
2086
+ preload: !1,
2087
+ simplifyPluralSuffix: !0,
2088
+ keySeparator: ".",
2089
+ nsSeparator: ":",
2090
+ pluralSeparator: "_",
2091
+ contextSeparator: "_",
2092
+ partialBundledLanguages: !1,
2093
+ saveMissing: !1,
2094
+ updateMissing: !1,
2095
+ saveMissingTo: "fallback",
2096
+ saveMissingPlurals: !0,
2097
+ missingKeyHandler: !1,
2098
+ missingInterpolationHandler: !1,
2099
+ postProcess: !1,
2100
+ postProcessPassResolved: !1,
2101
+ returnNull: !0,
2102
+ returnEmptyString: !0,
2103
+ returnObjects: !1,
2104
+ joinArrays: !1,
2105
+ returnedObjectHandler: !1,
2106
+ parseMissingKeyHandler: !1,
2107
+ appendNamespaceToMissingKey: !1,
2108
+ appendNamespaceToCIMode: !1,
2109
+ overloadTranslationOptionHandler: function (t) {
2110
+ var n = {};
2111
+ if (
2112
+ ("object" === e(t[1]) && (n = t[1]),
2113
+ "string" == typeof t[1] && (n.defaultValue = t[1]),
2114
+ "string" == typeof t[2] && (n.tDescription = t[2]),
2115
+ "object" === e(t[2]) || "object" === e(t[3]))
2116
+ ) {
2117
+ var o = t[3] || t[2];
2118
+ Object.keys(o).forEach(function (e) {
2119
+ n[e] = o[e];
2120
+ });
2121
+ }
2122
+ return n;
2123
+ },
2124
+ interpolation: {
2125
+ escapeValue: !0,
2126
+ format: function (e, t, n, o) {
2127
+ return e;
2128
+ },
2129
+ prefix: "{{",
2130
+ suffix: "}}",
2131
+ formatSeparator: ",",
2132
+ unescapePrefix: "-",
2133
+ nestingPrefix: "$t(",
2134
+ nestingSuffix: ")",
2135
+ nestingOptionsSeparator: ",",
2136
+ maxReplaces: 1e3,
2137
+ skipOnVariables: !1,
2138
+ },
2139
+ },
2140
+ this.options,
2141
+ A(o),
2142
+ )),
2143
+ (this.format = this.options.interpolation.format),
2144
+ i || (i = U),
2145
+ !this.options.isClone)
2146
+ ) {
2147
+ this.modules.logger
2148
+ ? g.init(r(this.modules.logger), this.options)
2149
+ : g.init(null, this.options);
2150
+ var a = new j(this.options);
2151
+ this.store = new L(this.options.resources, this.options);
2152
+ var s = this.services;
2153
+ ((s.logger = g),
2154
+ (s.resourceStore = this.store),
2155
+ (s.languageUtils = a),
2156
+ (s.pluralResolver = new F(a, {
2157
+ prepend: this.options.pluralSeparator,
2158
+ compatibilityJSON: this.options.compatibilityJSON,
2159
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix,
2160
+ })),
2161
+ (s.interpolator = new V(this.options)),
2162
+ (s.utils = {
2163
+ hasLoadedNamespace: this.hasLoadedNamespace.bind(this),
2164
+ }),
2165
+ (s.backendConnector = new T(
2166
+ r(this.modules.backend),
2167
+ s.resourceStore,
2168
+ s,
2169
+ this.options,
2170
+ )),
2171
+ s.backendConnector.on("*", function (e) {
2172
+ for (
2173
+ var n = arguments.length,
2174
+ o = new Array(n > 1 ? n - 1 : 0),
2175
+ i = 1;
2176
+ i < n;
2177
+ i++
2178
+ )
2179
+ o[i - 1] = arguments[i];
2180
+ t.emit.apply(t, [e].concat(o));
2181
+ }),
2182
+ this.modules.languageDetector &&
2183
+ ((s.languageDetector = r(this.modules.languageDetector)),
2184
+ s.languageDetector.init(
2185
+ s,
2186
+ this.options.detection,
2187
+ this.options,
2188
+ )),
2189
+ this.modules.i18nFormat &&
2190
+ ((s.i18nFormat = r(this.modules.i18nFormat)),
2191
+ s.i18nFormat.init && s.i18nFormat.init(this)),
2192
+ (this.translator = new C(this.services, this.options)),
2193
+ this.translator.on("*", function (e) {
2194
+ for (
2195
+ var n = arguments.length,
2196
+ o = new Array(n > 1 ? n - 1 : 0),
2197
+ i = 1;
2198
+ i < n;
2199
+ i++
2200
+ )
2201
+ o[i - 1] = arguments[i];
2202
+ t.emit.apply(t, [e].concat(o));
2203
+ }),
2204
+ this.modules.external.forEach(function (e) {
2205
+ e.init && e.init(t);
2206
+ }));
2207
+ }
2208
+ this.modules.languageDetector ||
2209
+ this.options.lng ||
2210
+ this.logger.warn(
2211
+ "init: no languageDetector is used and no lng is defined",
2212
+ );
2213
+ [
2214
+ "getResource",
2215
+ "addResource",
2216
+ "addResources",
2217
+ "addResourceBundle",
2218
+ "removeResourceBundle",
2219
+ "hasResourceBundle",
2220
+ "getResourceBundle",
2221
+ "getDataByLanguage",
2222
+ ].forEach(function (e) {
2223
+ t[e] = function () {
2224
+ var n;
2225
+ return (n = t.store)[e].apply(n, arguments);
2226
+ };
2227
+ });
2228
+ var u = h(),
2229
+ l = function () {
2230
+ t.changeLanguage(t.options.lng, function (e, n) {
2231
+ ((t.isInitialized = !0),
2232
+ t.logger.log("initialized", t.options),
2233
+ t.emit("initialized", t.options),
2234
+ u.resolve(n),
2235
+ i(e, n));
2236
+ });
2237
+ };
2238
+ return (
2239
+ this.options.resources || !this.options.initImmediate
2240
+ ? l()
2241
+ : setTimeout(l, 0),
2242
+ u
2243
+ );
2244
+ },
2245
+ },
2246
+ {
2247
+ key: "loadResources",
2248
+ value: function (e) {
2249
+ var t = this,
2250
+ n =
2251
+ arguments.length > 1 && void 0 !== arguments[1]
2252
+ ? arguments[1]
2253
+ : U,
2254
+ o = "string" == typeof e ? e : this.language;
2255
+ if (
2256
+ ("function" == typeof e && (n = e),
2257
+ !this.options.resources || this.options.partialBundledLanguages)
2258
+ ) {
2259
+ if (o && "cimode" === o.toLowerCase()) return n();
2260
+ var i = [],
2261
+ r = function (e) {
2262
+ e &&
2263
+ t.services.languageUtils
2264
+ .toResolveHierarchy(e)
2265
+ .forEach(function (e) {
2266
+ i.indexOf(e) < 0 && i.push(e);
2267
+ });
2268
+ };
2269
+ if (o) r(o);
2270
+ else
2271
+ this.services.languageUtils
2272
+ .getFallbackCodes(this.options.fallbackLng)
2273
+ .forEach(function (e) {
2274
+ return r(e);
2275
+ });
2276
+ (this.options.preload &&
2277
+ this.options.preload.forEach(function (e) {
2278
+ return r(e);
2279
+ }),
2280
+ this.services.backendConnector.load(i, this.options.ns, n));
2281
+ } else n(null);
2282
+ },
2283
+ },
2284
+ {
2285
+ key: "reloadResources",
2286
+ value: function (e, t, n) {
2287
+ var o = h();
2288
+ return (
2289
+ e || (e = this.languages),
2290
+ t || (t = this.options.ns),
2291
+ n || (n = U),
2292
+ this.services.backendConnector.reload(e, t, function (e) {
2293
+ (o.resolve(), n(e));
2294
+ }),
2295
+ o
2296
+ );
2297
+ },
2298
+ },
2299
+ {
2300
+ key: "use",
2301
+ value: function (e) {
2302
+ if (!e)
2303
+ throw new Error(
2304
+ "You are passing an undefined module! Please check the object you are passing to i18next.use()",
2305
+ );
2306
+ if (!e.type)
2307
+ throw new Error(
2308
+ "You are passing a wrong module! Please check the object you are passing to i18next.use()",
2309
+ );
2310
+ return (
2311
+ "backend" === e.type && (this.modules.backend = e),
2312
+ ("logger" === e.type || (e.log && e.warn && e.error)) &&
2313
+ (this.modules.logger = e),
2314
+ "languageDetector" === e.type &&
2315
+ (this.modules.languageDetector = e),
2316
+ "i18nFormat" === e.type && (this.modules.i18nFormat = e),
2317
+ "postProcessor" === e.type && O.addPostProcessor(e),
2318
+ "3rdParty" === e.type && this.modules.external.push(e),
2319
+ this
2320
+ );
2321
+ },
2322
+ },
2323
+ {
2324
+ key: "changeLanguage",
2325
+ value: function (e, t) {
2326
+ var n = this;
2327
+ this.isLanguageChangingTo = e;
2328
+ var o = h();
2329
+ this.emit("languageChanging", e);
2330
+ var i = function (e) {
2331
+ var i =
2332
+ "string" == typeof e
2333
+ ? e
2334
+ : n.services.languageUtils.getBestMatchFromCodes(e);
2335
+ (i &&
2336
+ (n.language ||
2337
+ ((n.language = i),
2338
+ (n.languages =
2339
+ n.services.languageUtils.toResolveHierarchy(i))),
2340
+ n.translator.language || n.translator.changeLanguage(i),
2341
+ n.services.languageDetector &&
2342
+ n.services.languageDetector.cacheUserLanguage(i)),
2343
+ n.loadResources(i, function (e) {
2344
+ !(function (e, i) {
2345
+ (i
2346
+ ? ((n.language = i),
2347
+ (n.languages =
2348
+ n.services.languageUtils.toResolveHierarchy(i)),
2349
+ n.translator.changeLanguage(i),
2350
+ (n.isLanguageChangingTo = void 0),
2351
+ n.emit("languageChanged", i),
2352
+ n.logger.log("languageChanged", i))
2353
+ : (n.isLanguageChangingTo = void 0),
2354
+ o.resolve(function () {
2355
+ return n.t.apply(n, arguments);
2356
+ }),
2357
+ t &&
2358
+ t(e, function () {
2359
+ return n.t.apply(n, arguments);
2360
+ }));
2361
+ })(e, i);
2362
+ }));
2363
+ };
2364
+ return (
2365
+ e ||
2366
+ !this.services.languageDetector ||
2367
+ this.services.languageDetector.async
2368
+ ? !e &&
2369
+ this.services.languageDetector &&
2370
+ this.services.languageDetector.async
2371
+ ? this.services.languageDetector.detect(i)
2372
+ : i(e)
2373
+ : i(this.services.languageDetector.detect()),
2374
+ o
2375
+ );
2376
+ },
2377
+ },
2378
+ {
2379
+ key: "getFixedT",
2380
+ value: function (t, o) {
2381
+ var i = this,
2382
+ r = function t(o, r) {
2383
+ var a;
2384
+ if ("object" !== e(r)) {
2385
+ for (
2386
+ var s = arguments.length,
2387
+ u = new Array(s > 2 ? s - 2 : 0),
2388
+ l = 2;
2389
+ l < s;
2390
+ l++
2391
+ )
2392
+ u[l - 2] = arguments[l];
2393
+ a = i.options.overloadTranslationOptionHandler(
2394
+ [o, r].concat(u),
2395
+ );
2396
+ } else a = n({}, r);
2397
+ return (
2398
+ (a.lng = a.lng || t.lng),
2399
+ (a.lngs = a.lngs || t.lngs),
2400
+ (a.ns = a.ns || t.ns),
2401
+ i.t(o, a)
2402
+ );
2403
+ };
2404
+ return (
2405
+ "string" == typeof t ? (r.lng = t) : (r.lngs = t),
2406
+ (r.ns = o),
2407
+ r
2408
+ );
2409
+ },
2410
+ },
2411
+ {
2412
+ key: "t",
2413
+ value: function () {
2414
+ var e;
2415
+ return (
2416
+ this.translator &&
2417
+ (e = this.translator).translate.apply(e, arguments)
2418
+ );
2419
+ },
2420
+ },
2421
+ {
2422
+ key: "exists",
2423
+ value: function () {
2424
+ var e;
2425
+ return (
2426
+ this.translator &&
2427
+ (e = this.translator).exists.apply(e, arguments)
2428
+ );
2429
+ },
2430
+ },
2431
+ {
2432
+ key: "setDefaultNamespace",
2433
+ value: function (e) {
2434
+ this.options.defaultNS = e;
2435
+ },
2436
+ },
2437
+ {
2438
+ key: "hasLoadedNamespace",
2439
+ value: function (e) {
2440
+ var t = this,
2441
+ n =
2442
+ arguments.length > 1 && void 0 !== arguments[1]
2443
+ ? arguments[1]
2444
+ : {};
2445
+ if (!this.isInitialized)
2446
+ return (
2447
+ this.logger.warn(
2448
+ "hasLoadedNamespace: i18next was not initialized",
2449
+ this.languages,
2450
+ ),
2451
+ !1
2452
+ );
2453
+ if (!this.languages || !this.languages.length)
2454
+ return (
2455
+ this.logger.warn(
2456
+ "hasLoadedNamespace: i18n.languages were undefined or empty",
2457
+ this.languages,
2458
+ ),
2459
+ !1
2460
+ );
2461
+ var o = this.languages[0],
2462
+ i = !!this.options && this.options.fallbackLng,
2463
+ r = this.languages[this.languages.length - 1];
2464
+ if ("cimode" === o.toLowerCase()) return !0;
2465
+ var a = function (e, n) {
2466
+ var o =
2467
+ t.services.backendConnector.state["".concat(e, "|").concat(n)];
2468
+ return -1 === o || 2 === o;
2469
+ };
2470
+ if (n.precheck) {
2471
+ var s = n.precheck(this, a);
2472
+ if (void 0 !== s) return s;
2473
+ }
2474
+ return (
2475
+ !!this.hasResourceBundle(o, e) ||
2476
+ !this.services.backendConnector.backend ||
2477
+ !(!a(o, e) || (i && !a(r, e)))
2478
+ );
2479
+ },
2480
+ },
2481
+ {
2482
+ key: "loadNamespaces",
2483
+ value: function (e, t) {
2484
+ var n = this,
2485
+ o = h();
2486
+ return this.options.ns
2487
+ ? ("string" == typeof e && (e = [e]),
2488
+ e.forEach(function (e) {
2489
+ n.options.ns.indexOf(e) < 0 && n.options.ns.push(e);
2490
+ }),
2491
+ this.loadResources(function (e) {
2492
+ (o.resolve(), t && t(e));
2493
+ }),
2494
+ o)
2495
+ : (t && t(), Promise.resolve());
2496
+ },
2497
+ },
2498
+ {
2499
+ key: "loadLanguages",
2500
+ value: function (e, t) {
2501
+ var n = h();
2502
+ "string" == typeof e && (e = [e]);
2503
+ var o = this.options.preload || [],
2504
+ i = e.filter(function (e) {
2505
+ return o.indexOf(e) < 0;
2506
+ });
2507
+ return i.length
2508
+ ? ((this.options.preload = o.concat(i)),
2509
+ this.loadResources(function (e) {
2510
+ (n.resolve(), t && t(e));
2511
+ }),
2512
+ n)
2513
+ : (t && t(), Promise.resolve());
2514
+ },
2515
+ },
2516
+ {
2517
+ key: "dir",
2518
+ value: function (e) {
2519
+ if (
2520
+ (e ||
2521
+ (e =
2522
+ this.languages && this.languages.length > 0
2523
+ ? this.languages[0]
2524
+ : this.language),
2525
+ !e)
2526
+ )
2527
+ return "rtl";
2528
+ return [
2529
+ "ar",
2530
+ "shu",
2531
+ "sqr",
2532
+ "ssh",
2533
+ "xaa",
2534
+ "yhd",
2535
+ "yud",
2536
+ "aao",
2537
+ "abh",
2538
+ "abv",
2539
+ "acm",
2540
+ "acq",
2541
+ "acw",
2542
+ "acx",
2543
+ "acy",
2544
+ "adf",
2545
+ "ads",
2546
+ "aeb",
2547
+ "aec",
2548
+ "afb",
2549
+ "ajp",
2550
+ "apc",
2551
+ "apd",
2552
+ "arb",
2553
+ "arq",
2554
+ "ars",
2555
+ "ary",
2556
+ "arz",
2557
+ "auz",
2558
+ "avl",
2559
+ "ayh",
2560
+ "ayl",
2561
+ "ayn",
2562
+ "ayp",
2563
+ "bbz",
2564
+ "pga",
2565
+ "he",
2566
+ "iw",
2567
+ "ps",
2568
+ "pbt",
2569
+ "pbu",
2570
+ "pst",
2571
+ "prp",
2572
+ "prd",
2573
+ "ug",
2574
+ "ur",
2575
+ "ydd",
2576
+ "yds",
2577
+ "yih",
2578
+ "ji",
2579
+ "yi",
2580
+ "hbo",
2581
+ "men",
2582
+ "xmn",
2583
+ "fa",
2584
+ "jpr",
2585
+ "peo",
2586
+ "pes",
2587
+ "prs",
2588
+ "dv",
2589
+ "sam",
2590
+ ].indexOf(this.services.languageUtils.getLanguagePartFromCode(e)) >=
2591
+ 0
2592
+ ? "rtl"
2593
+ : "ltr";
2594
+ },
2595
+ },
2596
+ {
2597
+ key: "createInstance",
2598
+ value: function () {
2599
+ return new i(
2600
+ arguments.length > 0 && void 0 !== arguments[0]
2601
+ ? arguments[0]
2602
+ : {},
2603
+ arguments.length > 1 ? arguments[1] : void 0,
2604
+ );
2605
+ },
2606
+ },
2607
+ {
2608
+ key: "cloneInstance",
2609
+ value: function () {
2610
+ var e = this,
2611
+ t =
2612
+ arguments.length > 0 && void 0 !== arguments[0]
2613
+ ? arguments[0]
2614
+ : {},
2615
+ o =
2616
+ arguments.length > 1 && void 0 !== arguments[1]
2617
+ ? arguments[1]
2618
+ : U,
2619
+ r = n({}, this.options, t, { isClone: !0 }),
2620
+ a = new i(r);
2621
+ return (
2622
+ ["store", "services", "language"].forEach(function (t) {
2623
+ a[t] = e[t];
2624
+ }),
2625
+ (a.services = n({}, this.services)),
2626
+ (a.services.utils = {
2627
+ hasLoadedNamespace: a.hasLoadedNamespace.bind(a),
2628
+ }),
2629
+ (a.translator = new C(a.services, a.options)),
2630
+ a.translator.on("*", function (e) {
2631
+ for (
2632
+ var t = arguments.length,
2633
+ n = new Array(t > 1 ? t - 1 : 0),
2634
+ o = 1;
2635
+ o < t;
2636
+ o++
2637
+ )
2638
+ n[o - 1] = arguments[o];
2639
+ a.emit.apply(a, [e].concat(n));
2640
+ }),
2641
+ a.init(r, o),
2642
+ (a.translator.options = a.options),
2643
+ (a.translator.backendConnector.services.utils = {
2644
+ hasLoadedNamespace: a.hasLoadedNamespace.bind(a),
2645
+ }),
2646
+ a
2647
+ );
2648
+ },
2649
+ },
2650
+ ]),
2651
+ i
2652
+ );
2653
+ })())();
2654
+ });