@pie-element/simple-cloze 0.1.4-next.11 → 0.1.4-next.12

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.
@@ -0,0 +1,1614 @@
1
+ //#region ../../shared/math-rendering-mathjax/dist/index.js
2
+ var e = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading");
3
+ function t(t) {
4
+ if (typeof window > "u" || window.MathJax?.typesetPromise) return Promise.resolve();
5
+ let n = globalThis, r = n[e];
6
+ if (r) return r;
7
+ let i = new Promise((e, n) => {
8
+ let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: a = !0, srcUrl: o } = t, s = {
9
+ loader: { load: i ? ["a11y/assistive-mml"] : [] },
10
+ tex: {
11
+ packages: [
12
+ "base",
13
+ "ams",
14
+ "autoload"
15
+ ],
16
+ macros: {
17
+ parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
18
+ overarc: "\\overparen",
19
+ napprox: "\\not\\approx",
20
+ longdiv: "\\enclose{longdiv}"
21
+ }
22
+ },
23
+ options: {
24
+ enableMenu: i,
25
+ enableExplorer: i,
26
+ enableAssistiveMml: i
27
+ },
28
+ startup: {
29
+ ready: () => {
30
+ window.MathJax?.startup.defaultReady && (window.MathJax.startup.defaultReady(), e());
31
+ },
32
+ defaultReady: () => {}
33
+ }
34
+ };
35
+ r && s.tex && (s.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], s.tex.processEscapes = !0), a || (s.chtml = { fontURL: "" }), window.MathJax = s;
36
+ let c = document.createElement("script");
37
+ c.src = o || "https://cdn.jsdelivr.net/npm/mathjax@4/tex-chtml.js", c.async = !0, c.onload = () => {
38
+ setTimeout(e, 100);
39
+ }, c.onerror = () => {
40
+ n(/* @__PURE__ */ Error("Failed to load MathJax"));
41
+ }, document.head.appendChild(c);
42
+ });
43
+ return n[e] = i, i;
44
+ }
45
+ function n() {
46
+ let e = window.MathJax?.startup?.document;
47
+ if (typeof e?.assistiveMml == "function") try {
48
+ e.assistiveMml().updateDocument?.();
49
+ } catch (e) {
50
+ console.warn("[mathjax-renderer] Failed to attach assistive MathML:", e);
51
+ }
52
+ }
53
+ function r(e = {}) {
54
+ return async (r) => {
55
+ if (await t(e), !window.MathJax?.typesetPromise) {
56
+ console.warn("[mathjax-renderer] MathJax not loaded or missing typesetPromise.");
57
+ return;
58
+ }
59
+ await window.MathJax.typesetPromise([r]), n();
60
+ };
61
+ }
62
+ var i = "@pie-lib/math-rendering", a = null;
63
+ function o() {
64
+ return a ||= r({
65
+ accessibility: !0,
66
+ useSingleDollar: !0
67
+ }), a;
68
+ }
69
+ function s() {
70
+ if (typeof window > "u") return null;
71
+ let e = window[i];
72
+ return typeof e?.renderMath == "function" ? e : null;
73
+ }
74
+ var c = async (e) => {
75
+ if (typeof window > "u") return;
76
+ let t = typeof e == "string", n;
77
+ t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
78
+ let r = s();
79
+ return r ? await r.renderMath?.(n) : await o()(n), t ? n.innerHTML : void 0;
80
+ }, l = {
81
+ translation: {
82
+ categorize: {
83
+ limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
84
+ maxChoicesPerCategoryRestriction: "To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."
85
+ },
86
+ ebsr: { part: "Part {{index}}" },
87
+ numberLine: {
88
+ addElementLimit_one: "You can only add {{count}} element",
89
+ addElementLimit_other: "You can only add {{count}} elements",
90
+ clearAll: "Clear all"
91
+ },
92
+ imageClozeAssociation: {
93
+ reachedLimit_one: "You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",
94
+ reachedLimit_other: "Full"
95
+ },
96
+ drawingResponse: {
97
+ fillColor: "Fill color",
98
+ outlineColor: "Outline color",
99
+ noFill: "No fill",
100
+ lightblue: "Light blue",
101
+ lightyellow: "Light yellow",
102
+ red: "Red",
103
+ orange: "Orange",
104
+ yellow: "Yellow",
105
+ violet: "Violet",
106
+ blue: "Blue",
107
+ green: "Green",
108
+ white: "White",
109
+ black: "Black",
110
+ onDoubleClick: "Double click to edit this text. Press Enter to submit."
111
+ },
112
+ charting: {
113
+ addCategory: "Add category",
114
+ actions: "Actions",
115
+ add: "Add",
116
+ delete: "Delete",
117
+ newLabel: "New label",
118
+ reachedLimit_other: "There can't be more than {{count}} categories.",
119
+ keyLegend: {
120
+ incorrectAnswer: "Student incorrect answer",
121
+ correctAnswer: "Student correct answer",
122
+ correctKeyAnswer: "Answer key correct"
123
+ }
124
+ },
125
+ graphing: {
126
+ point: "Point",
127
+ circle: "Circle",
128
+ line: "Line",
129
+ parabola: "Parabola",
130
+ absolute: "Absolute Value",
131
+ exponential: "Exponential",
132
+ polygon: "Polygon",
133
+ ray: "Ray",
134
+ segment: "Segment",
135
+ sine: "Sine",
136
+ vector: "Vector",
137
+ label: "Label",
138
+ redo: "Redo",
139
+ reset: "Reset"
140
+ },
141
+ mathInline: { primaryCorrectWithAlternates: "Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct." },
142
+ mcPopulatedBlank: {
143
+ answerChoices: "Answer choices",
144
+ blankLabel: "blank",
145
+ emptyBlank: "(blank)",
146
+ blankPreSelectionHint: "The answer you choose will appear on the blank line above.",
147
+ correctAnswerSelected: "Correct answer selected",
148
+ incorrectAnswerSelected: "Incorrect answer selected",
149
+ selectedAnswerImage: "Selected answer image",
150
+ choiceImage: "Choice {{id}}",
151
+ clickToEnableAutoplay: "Click to enable audio autoplay",
152
+ audioResourceUnavailable: "Audio is enabled but no playable audio URL is configured.",
153
+ listen: "Listen",
154
+ listenSilentAlt: "Repeat instructions",
155
+ listenPlayingAlt: "Instructions are playing",
156
+ printAudio: "Audio:",
157
+ printTranscript: "Transcript:"
158
+ },
159
+ multipleChoice: {
160
+ minSelections: "Select at least {{minSelections}}.",
161
+ maxSelections_one: "Only {{maxSelections}} answer is allowed.",
162
+ maxSelections_other: "Only {{maxSelections}} answers are allowed.",
163
+ minmaxSelections_equal: "Select {{minSelections}}.",
164
+ minmaxSelections_range: "Select between {{minSelections}} and {{maxSelections}}."
165
+ },
166
+ selectText: {
167
+ correctAnswerSelected: "Correct",
168
+ correctAnswerNotSelected: "Correct Answer Not Selected",
169
+ incorrectSelection: "Incorrect Selection",
170
+ key: "Key"
171
+ },
172
+ simpleCloze: {
173
+ correctAnswerShown: "Correct answer",
174
+ correct: "Correct",
175
+ incorrect: "Incorrect",
176
+ unanswered: "No answer",
177
+ placeholder: "Enter your answer...",
178
+ answerInput: "Your answer",
179
+ printCorrectAnswer: "Correct answer:",
180
+ printAnswerBlank: "Answer blank"
181
+ },
182
+ vennClassification: {
183
+ tray: "Tiles to classify",
184
+ unknownTarget: "unknown",
185
+ cancelled: "Cancelled",
186
+ returnedToTray: "{{name}} returned to tray",
187
+ placedIn: "{{name}} placed in {{target}}",
188
+ pickedUp: "Picked up {{name}}",
189
+ pickedUpWithKeyboard: "Picked up {{name}}, drop target: {{target}}. Use arrow keys to choose a drop target, Enter to drop, Escape to cancel.",
190
+ dropTarget: "Drop target: {{target}}",
191
+ unsupportedCircles_one: "This diagram cannot be shown: it has {{count}} circle, and only {{supported}} are supported.",
192
+ unsupportedCircles_other: "This diagram cannot be shown: it has {{count}} circles, and only {{supported}} are supported.",
193
+ setNumber: "Set {{number}}",
194
+ regionOnly: "{{set}} only",
195
+ regionNeither: "Neither {{first}} nor {{second}}",
196
+ regionNoneOf: "None of {{sets}}",
197
+ regionAndSeparator: " and ",
198
+ tileFallbackName: "Tile",
199
+ tileNotPlaced: "not placed",
200
+ tileInRegion: "in {{region}}",
201
+ tileCorrect: "correct",
202
+ tileIncorrect: "incorrect"
203
+ }
204
+ },
205
+ common: {
206
+ undo: "Undo",
207
+ clearAll: "Clear all",
208
+ correct: "Correct",
209
+ incorrect: "Incorrect",
210
+ showCorrectAnswer: "Show correct answer",
211
+ hideCorrectAnswer: "Hide correct answer",
212
+ showTeacherInstructions: "Show Teacher Instructions",
213
+ hideTeacherInstructions: "Hide Teacher Instructions",
214
+ commonCorrectAnswerWithAlternates: "Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",
215
+ warning: "Warning",
216
+ showNote: "Show Note",
217
+ hideNote: "Hide Note",
218
+ cancel: "Cancel"
219
+ }
220
+ }, u = {
221
+ translation: {
222
+ categorize: {
223
+ limitMaxChoicesPerCategory: "Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
224
+ maxChoicesPerCategoryRestriction: "Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"
225
+ },
226
+ ebsr: { part: "Parte {{index}}" },
227
+ numberLine: {
228
+ addElementLimit_one: "Solo puedes agregar {{count}} elemento",
229
+ addElementLimit_other: "Solo puedes agregar {{count}} elementos",
230
+ clearAll: "Borrar todo"
231
+ },
232
+ imageClozeAssociation: {
233
+ reachedLimit_one: "Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
234
+ reachedLimit_other: "Lleno"
235
+ },
236
+ drawingResponse: {
237
+ fillColor: "Color de relleno",
238
+ outlineColor: "Color del contorno",
239
+ noFill: "Sin relleno",
240
+ lightblue: "Azul claro",
241
+ lightyellow: "Amarillo claro",
242
+ red: "Rojo",
243
+ orange: "Naranja",
244
+ yellow: "Amarillo",
245
+ violet: "Violeta",
246
+ blue: "Azul",
247
+ green: "Verde",
248
+ white: "Blanco",
249
+ black: "Negro",
250
+ onDoubleClick: "Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"
251
+ },
252
+ charting: {
253
+ addCategory: "Añadir categoría",
254
+ actions: "Acciones",
255
+ add: "Añadir",
256
+ delete: "Eliminar",
257
+ newLabel: "Nueva etiqueta",
258
+ reachedLimit_other: "No puede haber más de {{count}} categorías.",
259
+ keyLegend: {
260
+ incorrectAnswer: "Respuesta incorrecta del estudiante",
261
+ correctAnswer: "Respuesta correcta del estudiante",
262
+ correctKeyAnswer: "Clave de respuesta correcta"
263
+ }
264
+ },
265
+ graphing: {
266
+ point: "Punto",
267
+ circle: "Circulo",
268
+ line: "Línea",
269
+ parabola: "Parábola",
270
+ absolute: "Valor absoluto",
271
+ exponential: "Exponencial",
272
+ polygon: "Polígono",
273
+ ray: "Semirrecta",
274
+ segment: "Segmento ",
275
+ sine: "Seno",
276
+ vector: "Vector",
277
+ label: "Etiqueta",
278
+ redo: "Rehacer",
279
+ reset: "Reiniciar"
280
+ },
281
+ mathInline: { primaryCorrectWithAlternates: "Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas." },
282
+ mcPopulatedBlank: {
283
+ answerChoices: "Opciones de respuesta",
284
+ blankLabel: "espacio en blanco",
285
+ emptyBlank: "(en blanco)",
286
+ blankPreSelectionHint: "La respuesta que elijas aparecerá en la línea en blanco de arriba.",
287
+ correctAnswerSelected: "Respuesta correcta seleccionada",
288
+ incorrectAnswerSelected: "Respuesta incorrecta seleccionada",
289
+ selectedAnswerImage: "Imagen de la respuesta seleccionada",
290
+ choiceImage: "Opción {{id}}",
291
+ clickToEnableAutoplay: "Haz clic para activar la reproducción automática del audio",
292
+ audioResourceUnavailable: "El audio está activado, pero no hay una URL de audio reproducible configurada.",
293
+ listen: "Escuchar",
294
+ listenSilentAlt: "Escuchar. Repetir las instrucciones.",
295
+ listenPlayingAlt: "Escuchar. Estas son las instrucciones.",
296
+ printAudio: "Audio:",
297
+ printTranscript: "Transcripción:"
298
+ },
299
+ multipleChoice: {
300
+ minSelections: "Seleccione al menos {{minSelections}}.",
301
+ maxSelections_one: "Sólo se permite {{maxSelections}} respuesta.",
302
+ maxSelections_other: "Sólo se permiten {{maxSelections}} respuestas.",
303
+ minmaxSelections_equal: "Seleccione {{minSelections}}.",
304
+ minmaxSelections_range: "Seleccione entre {{minSelections}} y {{maxSelections}}."
305
+ },
306
+ selectText: {
307
+ correctAnswerSelected: "Respuesta Correcta",
308
+ correctAnswerNotSelected: "Respuesta Correcta No Seleccionada",
309
+ incorrectSelection: "Selección Incorrecta",
310
+ key: "Clave"
311
+ },
312
+ simpleCloze: {
313
+ correctAnswerShown: "Respuesta correcta",
314
+ correct: "Correcto",
315
+ incorrect: "Incorrecto",
316
+ unanswered: "Sin respuesta",
317
+ placeholder: "Escribe tu respuesta...",
318
+ answerInput: "Tu respuesta",
319
+ printCorrectAnswer: "Respuesta correcta:",
320
+ printAnswerBlank: "Espacio para la respuesta"
321
+ },
322
+ vennClassification: {
323
+ tray: "Fichas para clasificar",
324
+ unknownTarget: "desconocido",
325
+ cancelled: "Cancelado",
326
+ returnedToTray: "Se devolvió {{name}} a la bandeja",
327
+ placedIn: "Se colocó {{name}} en {{target}}",
328
+ pickedUp: "Se tomó {{name}}",
329
+ pickedUpWithKeyboard: "Se tomó {{name}}, destino: {{target}}. Usa las flechas para elegir un destino, Enter para soltar y Escape para cancelar.",
330
+ dropTarget: "Destino: {{target}}",
331
+ unsupportedCircles_one: "No se puede mostrar este diagrama: tiene {{count}} círculo, y solo se admiten {{supported}}.",
332
+ unsupportedCircles_other: "No se puede mostrar este diagrama: tiene {{count}} círculos, y solo se admiten {{supported}}.",
333
+ setNumber: "Conjunto {{number}}",
334
+ regionOnly: "Solo {{set}}",
335
+ regionNeither: "Ni {{first}} ni {{second}}",
336
+ regionNoneOf: "Ninguno de {{sets}}",
337
+ regionAndSeparator: " y ",
338
+ tileFallbackName: "Ficha",
339
+ tileNotPlaced: "sin colocar",
340
+ tileInRegion: "en {{region}}",
341
+ tileCorrect: "correcta",
342
+ tileIncorrect: "incorrecta"
343
+ }
344
+ },
345
+ common: {
346
+ undo: "Deshacer",
347
+ clearAll: "Borrar todo",
348
+ correct: "Correcto",
349
+ incorrect: "Incorrecto",
350
+ showCorrectAnswer: "Mostrar respuesta correcta",
351
+ hideCorrectAnswer: "Ocultar respuesta correcta",
352
+ showTeacherInstructions: "Mostrar instrucciones para el maestro",
353
+ hideTeacherInstructions: "Ocultar instrucciones para el maestro",
354
+ commonCorrectAnswerWithAlternates: "Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",
355
+ warning: "Advertencia",
356
+ showNote: "Mostrar Nota",
357
+ hideNote: "Ocultar Nota",
358
+ cancel: "Cancelar"
359
+ }
360
+ }, d = (e) => typeof e == "string", f = () => {
361
+ let e, t, n = new Promise((n, r) => {
362
+ e = n, t = r;
363
+ });
364
+ return n.resolve = e, n.reject = t, n;
365
+ }, p = (e) => e == null ? "" : "" + e, m = (e, t, n) => {
366
+ e.forEach((e) => {
367
+ t[e] && (n[e] = t[e]);
368
+ });
369
+ }, h = /###/g, g = (e) => e && e.indexOf("###") > -1 ? e.replace(h, ".") : e, _ = (e) => !e || d(e), v = (e, t, n) => {
370
+ let r = d(t) ? t.split(".") : t, i = 0;
371
+ for (; i < r.length - 1;) {
372
+ if (_(e)) return {};
373
+ let t = g(r[i]);
374
+ !e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
375
+ }
376
+ return _(e) ? {} : {
377
+ obj: e,
378
+ k: g(r[i])
379
+ };
380
+ }, y = (e, t, n) => {
381
+ let { obj: r, k: i } = v(e, t, Object);
382
+ if (r !== void 0 || t.length === 1) {
383
+ r[i] = n;
384
+ return;
385
+ }
386
+ let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = v(e, o, Object);
387
+ for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = v(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
388
+ s.obj[`${s.k}.${a}`] = n;
389
+ }, b = (e, t, n, r) => {
390
+ let { obj: i, k: a } = v(e, t, Object);
391
+ i[a] = i[a] || [], i[a].push(n);
392
+ }, x = (e, t) => {
393
+ let { obj: n, k: r } = v(e, t);
394
+ if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
395
+ }, S = (e, t, n) => {
396
+ let r = x(e, n);
397
+ return r === void 0 ? x(t, n) : r;
398
+ }, C = (e, t, n) => {
399
+ for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? d(e[r]) || e[r] instanceof String || d(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : C(e[r], t[r], n) : e[r] = t[r]);
400
+ return e;
401
+ }, w = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), T = {
402
+ "&": "&amp;",
403
+ "<": "&lt;",
404
+ ">": "&gt;",
405
+ "\"": "&quot;",
406
+ "'": "&#39;",
407
+ "/": "&#x2F;"
408
+ }, E = (e) => d(e) ? e.replace(/[&<>"'\/]/g, (e) => T[e]) : e, D = class {
409
+ constructor(e) {
410
+ this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
411
+ }
412
+ getRegExp(e) {
413
+ let t = this.regExpMap.get(e);
414
+ if (t !== void 0) return t;
415
+ let n = new RegExp(e);
416
+ return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
417
+ }
418
+ }, O = [
419
+ " ",
420
+ ",",
421
+ "?",
422
+ "!",
423
+ ";"
424
+ ], k = new D(20), ee = (e, t, n) => {
425
+ t ||= "", n ||= "";
426
+ let r = O.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
427
+ if (r.length === 0) return !0;
428
+ let i = k.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
429
+ if (!a) {
430
+ let t = e.indexOf(n);
431
+ t > 0 && !i.test(e.substring(0, t)) && (a = !0);
432
+ }
433
+ return a;
434
+ }, A = (e, t, n = ".") => {
435
+ if (!e) return;
436
+ if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
437
+ let r = t.split(n), i = e;
438
+ for (let e = 0; e < r.length;) {
439
+ if (!i || typeof i != "object") return;
440
+ let t, a = "";
441
+ for (let o = e; o < r.length; ++o) if (o !== e && (a += n), a += r[o], t = i[a], t !== void 0) {
442
+ if ([
443
+ "string",
444
+ "number",
445
+ "boolean"
446
+ ].indexOf(typeof t) > -1 && o < r.length - 1) continue;
447
+ e += o - e + 1;
448
+ break;
449
+ }
450
+ i = t;
451
+ }
452
+ return i;
453
+ }, j = (e) => e?.replace(/_/g, "-"), te = {
454
+ type: "logger",
455
+ log(e) {
456
+ this.output("log", e);
457
+ },
458
+ warn(e) {
459
+ this.output("warn", e);
460
+ },
461
+ error(e) {
462
+ this.output("error", e);
463
+ },
464
+ output(e, t) {
465
+ console?.[e]?.apply?.(console, t);
466
+ }
467
+ }, M = new class e {
468
+ constructor(e, t = {}) {
469
+ this.init(e, t);
470
+ }
471
+ init(e, t = {}) {
472
+ this.prefix = t.prefix || "i18next:", this.logger = e || te, this.options = t, this.debug = t.debug;
473
+ }
474
+ log(...e) {
475
+ return this.forward(e, "log", "", !0);
476
+ }
477
+ warn(...e) {
478
+ return this.forward(e, "warn", "", !0);
479
+ }
480
+ error(...e) {
481
+ return this.forward(e, "error", "");
482
+ }
483
+ deprecate(...e) {
484
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
485
+ }
486
+ forward(e, t, n, r) {
487
+ return r && !this.debug ? null : (d(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
488
+ }
489
+ create(t) {
490
+ return new e(this.logger, {
491
+ prefix: `${this.prefix}:${t}:`,
492
+ ...this.options
493
+ });
494
+ }
495
+ clone(t) {
496
+ return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
497
+ }
498
+ }(), N = class {
499
+ constructor() {
500
+ this.observers = {};
501
+ }
502
+ on(e, t) {
503
+ return e.split(" ").forEach((e) => {
504
+ this.observers[e] || (this.observers[e] = /* @__PURE__ */ new Map());
505
+ let n = this.observers[e].get(t) || 0;
506
+ this.observers[e].set(t, n + 1);
507
+ }), this;
508
+ }
509
+ off(e, t) {
510
+ if (this.observers[e]) {
511
+ if (!t) {
512
+ delete this.observers[e];
513
+ return;
514
+ }
515
+ this.observers[e].delete(t);
516
+ }
517
+ }
518
+ emit(e, ...t) {
519
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach(([e, n]) => {
520
+ for (let r = 0; r < n; r++) e(...t);
521
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([n, r]) => {
522
+ for (let i = 0; i < r; i++) n.apply(n, [e, ...t]);
523
+ });
524
+ }
525
+ }, P = class extends N {
526
+ constructor(e, t = {
527
+ ns: ["translation"],
528
+ defaultNS: "translation"
529
+ }) {
530
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
531
+ }
532
+ addNamespaces(e) {
533
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
534
+ }
535
+ removeNamespaces(e) {
536
+ let t = this.options.ns.indexOf(e);
537
+ t > -1 && this.options.ns.splice(t, 1);
538
+ }
539
+ getResource(e, t, n, r = {}) {
540
+ let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
541
+ e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : d(n) && i ? o.push(...n.split(i)) : o.push(n)));
542
+ let s = x(this.data, o);
543
+ return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !d(n) ? s : A(this.data?.[e]?.[t], n, i);
544
+ }
545
+ addResource(e, t, n, r, i = { silent: !1 }) {
546
+ let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
547
+ n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), y(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
548
+ }
549
+ addResources(e, t, n, r = { silent: !1 }) {
550
+ for (let r in n) (d(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
551
+ r.silent || this.emit("added", e, t, n);
552
+ }
553
+ addResourceBundle(e, t, n, r, i, a = {
554
+ silent: !1,
555
+ skipCopy: !1
556
+ }) {
557
+ let o = [e, t];
558
+ e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
559
+ let s = x(this.data, o) || {};
560
+ a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? C(s, n, i) : s = {
561
+ ...s,
562
+ ...n
563
+ }, y(this.data, o, s), a.silent || this.emit("added", e, t, n);
564
+ }
565
+ removeResourceBundle(e, t) {
566
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
567
+ }
568
+ hasResourceBundle(e, t) {
569
+ return this.getResource(e, t) !== void 0;
570
+ }
571
+ getResourceBundle(e, t) {
572
+ return t ||= this.options.defaultNS, this.getResource(e, t);
573
+ }
574
+ getDataByLanguage(e) {
575
+ return this.data[e];
576
+ }
577
+ hasLanguageSomeTranslations(e) {
578
+ let t = this.getDataByLanguage(e);
579
+ return !!(t && Object.keys(t) || []).find((e) => t[e] && Object.keys(t[e]).length > 0);
580
+ }
581
+ toJSON() {
582
+ return this.data;
583
+ }
584
+ }, F = {
585
+ processors: {},
586
+ addPostProcessor(e) {
587
+ this.processors[e.name] = e;
588
+ },
589
+ handle(e, t, n, r, i) {
590
+ return e.forEach((e) => {
591
+ t = this.processors[e]?.process(t, n, r, i) ?? t;
592
+ }), t;
593
+ }
594
+ }, I = Symbol("i18next/PATH_KEY");
595
+ function ne() {
596
+ let e = [], t = Object.create(null), n;
597
+ return t.get = (r, i) => (n?.revoke?.(), i === I ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
598
+ }
599
+ function L(e, t) {
600
+ let { [I]: n } = e(ne()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
601
+ if (n.length > 1 && i) {
602
+ let e = t?.ns, a = Array.isArray(e) ? e : null;
603
+ if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
604
+ }
605
+ return n.join(r);
606
+ }
607
+ var R = {}, z = (e) => !d(e) && typeof e != "boolean" && typeof e != "number", B = class e extends N {
608
+ constructor(e, t = {}) {
609
+ super(), m([
610
+ "resourceStore",
611
+ "languageUtils",
612
+ "pluralResolver",
613
+ "interpolator",
614
+ "backendConnector",
615
+ "i18nFormat",
616
+ "utils"
617
+ ], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = M.create("translator");
618
+ }
619
+ changeLanguage(e) {
620
+ e && (this.language = e);
621
+ }
622
+ exists(e, t = { interpolation: {} }) {
623
+ let n = { ...t };
624
+ if (e == null) return !1;
625
+ let r = this.resolve(e, n);
626
+ if (r?.res === void 0) return !1;
627
+ let i = z(r.res);
628
+ return !(n.returnObjects === !1 && i);
629
+ }
630
+ extractFromKey(e, t) {
631
+ let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
632
+ n === void 0 && (n = ":");
633
+ let r = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, i = t.ns || this.options.defaultNS || [], a = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !ee(e, n, r);
634
+ if (a && !o) {
635
+ let t = e.match(this.interpolator.nestingRegexp);
636
+ if (t && t.length > 0) return {
637
+ key: e,
638
+ namespaces: d(i) ? [i] : i
639
+ };
640
+ let a = e.split(n);
641
+ (n !== r || n === r && this.options.ns.indexOf(a[0]) > -1) && (i = a.shift()), e = a.join(r);
642
+ }
643
+ return {
644
+ key: e,
645
+ namespaces: d(i) ? [i] : i
646
+ };
647
+ }
648
+ translate(t, n, r) {
649
+ let i = typeof n == "object" ? { ...n } : n;
650
+ if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
651
+ typeof t == "function" && (t = L(t, {
652
+ ...this.options,
653
+ ...i
654
+ })), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? L(e, {
655
+ ...this.options,
656
+ ...i
657
+ }) : String(e));
658
+ let a = i.returnDetails === void 0 ? this.options.returnDetails : i.returnDetails, o = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, { key: s, namespaces: c } = this.extractFromKey(t[t.length - 1], i), l = c[c.length - 1], u = i.nsSeparator === void 0 ? this.options.nsSeparator : i.nsSeparator;
659
+ u === void 0 && (u = ":");
660
+ let f = i.lng || this.language, p = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
661
+ if (f?.toLowerCase() === "cimode") return p ? a ? {
662
+ res: `${l}${u}${s}`,
663
+ usedKey: s,
664
+ exactUsedKey: s,
665
+ usedLng: f,
666
+ usedNS: l,
667
+ usedParams: this.getUsedParamsDetails(i)
668
+ } : `${l}${u}${s}` : a ? {
669
+ res: s,
670
+ usedKey: s,
671
+ exactUsedKey: s,
672
+ usedLng: f,
673
+ usedNS: l,
674
+ usedParams: this.getUsedParamsDetails(i)
675
+ } : s;
676
+ let m = this.resolve(t, i), h = m?.res, g = m?.usedKey || s, _ = m?.exactUsedKey || s, v = [
677
+ "[object Number]",
678
+ "[object Function]",
679
+ "[object RegExp]"
680
+ ], y = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, b = !this.i18nFormat || this.i18nFormat.handleAsObject, x = i.count !== void 0 && !d(i.count), S = e.hasDefaultValue(i), C = x ? this.pluralResolver.getSuffix(f, i.count, i) : "", w = i.ordinal && x ? this.pluralResolver.getSuffix(f, i.count, { ordinal: !1 }) : "", T = x && !i.ordinal && i.count === 0, E = T && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${C}`] || i[`defaultValue${w}`] || i.defaultValue, D = h;
681
+ b && !h && S && (D = E);
682
+ let O = z(D), k = Object.prototype.toString.apply(D);
683
+ if (b && D && O && v.indexOf(k) < 0 && !(d(y) && Array.isArray(D))) {
684
+ if (!i.returnObjects && !this.options.returnObjects) {
685
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
686
+ let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(g, D, {
687
+ ...i,
688
+ ns: c
689
+ }) : `key '${s} (${this.language})' returned an object instead of string.`;
690
+ return a ? (m.res = e, m.usedParams = this.getUsedParamsDetails(i), m) : e;
691
+ }
692
+ if (o) {
693
+ let e = Array.isArray(D), t = e ? [] : {}, n = e ? _ : g;
694
+ for (let e in D) if (Object.prototype.hasOwnProperty.call(D, e)) {
695
+ let r = `${n}${o}${e}`;
696
+ S && !h ? t[e] = this.translate(r, {
697
+ ...i,
698
+ defaultValue: z(E) ? E[e] : void 0,
699
+ joinArrays: !1,
700
+ ns: c
701
+ }) : t[e] = this.translate(r, {
702
+ ...i,
703
+ joinArrays: !1,
704
+ ns: c
705
+ }), t[e] === r && (t[e] = D[e]);
706
+ }
707
+ h = t;
708
+ }
709
+ } else if (b && d(y) && Array.isArray(h)) h = h.join(y), h &&= this.extendTranslation(h, t, i, r);
710
+ else {
711
+ let e = !1, n = !1;
712
+ !this.isValidLookup(h) && S && (e = !0, h = E), this.isValidLookup(h) || (n = !0, h = s);
713
+ let a = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n ? void 0 : h, c = S && E !== h && this.options.updateMissing;
714
+ if (n || e || c) {
715
+ if (this.logger.log(c ? "updateKey" : "missingKey", f, l, s, c ? E : h), o) {
716
+ let e = this.resolve(s, {
717
+ ...i,
718
+ keySeparator: !1
719
+ });
720
+ e && e.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.");
721
+ }
722
+ let e = [], t = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
723
+ if (this.options.saveMissingTo === "fallback" && t && t[0]) for (let n = 0; n < t.length; n++) e.push(t[n]);
724
+ else this.options.saveMissingTo === "all" ? e = this.languageUtils.toResolveHierarchy(i.lng || this.language) : e.push(i.lng || this.language);
725
+ let n = (e, t, n) => {
726
+ let r = S && n !== h ? n : a;
727
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(e, l, t, r, c, i) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(e, l, t, r, c, i), this.emit("missingKey", e, l, t, h);
728
+ };
729
+ this.options.saveMissing && (this.options.saveMissingPlurals && x ? e.forEach((e) => {
730
+ let t = this.pluralResolver.getSuffixes(e, i);
731
+ T && i[`defaultValue${this.options.pluralSeparator}zero`] && t.indexOf(`${this.options.pluralSeparator}zero`) < 0 && t.push(`${this.options.pluralSeparator}zero`), t.forEach((t) => {
732
+ n([e], s + t, i[`defaultValue${t}`] || E);
733
+ });
734
+ }) : n(e, s, E));
735
+ }
736
+ h = this.extendTranslation(h, t, i, m, r), n && h === s && this.options.appendNamespaceToMissingKey && (h = `${l}${u}${s}`), (n || e) && this.options.parseMissingKeyHandler && (h = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}${u}${s}` : s, e ? h : void 0, i));
737
+ }
738
+ return a ? (m.res = h, m.usedParams = this.getUsedParamsDetails(i), m) : h;
739
+ }
740
+ extendTranslation(e, t, n, r, i) {
741
+ if (this.i18nFormat?.parse) e = this.i18nFormat.parse(e, {
742
+ ...this.options.interpolation.defaultVariables,
743
+ ...n
744
+ }, n.lng || this.language || r.usedLng, r.usedNS, r.usedKey, { resolved: r });
745
+ else if (!n.skipInterpolation) {
746
+ n.interpolation && this.interpolator.init({
747
+ ...n,
748
+ interpolation: {
749
+ ...this.options.interpolation,
750
+ ...n.interpolation
751
+ }
752
+ });
753
+ let a = d(e) && (n?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n.interpolation.skipOnVariables), o;
754
+ if (a) {
755
+ let t = e.match(this.interpolator.nestingRegexp);
756
+ o = t && t.length;
757
+ }
758
+ let s = n.replace && !d(n.replace) ? n.replace : n;
759
+ if (this.options.interpolation.defaultVariables && (s = {
760
+ ...this.options.interpolation.defaultVariables,
761
+ ...s
762
+ }), e = this.interpolator.interpolate(e, s, n.lng || this.language || r.usedLng, n), a) {
763
+ let t = e.match(this.interpolator.nestingRegexp), r = t && t.length;
764
+ o < r && (n.nest = !1);
765
+ }
766
+ !n.lng && r && r.res && (n.lng = this.language || r.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, (...e) => i?.[0] === e[0] && !n.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`), null) : this.translate(...e, t), n)), n.interpolation && this.interpolator.reset();
767
+ }
768
+ let a = n.postProcess || this.options.postProcess, o = d(a) ? [a] : a;
769
+ return e != null && o?.length && n.applyPostProcessor !== !1 && (e = F.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
770
+ i18nResolved: {
771
+ ...r,
772
+ usedParams: this.getUsedParamsDetails(n)
773
+ },
774
+ ...n
775
+ } : n, this)), e;
776
+ }
777
+ resolve(e, t = {}) {
778
+ let n, r, i, a, o;
779
+ return d(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? L(e, {
780
+ ...this.options,
781
+ ...t
782
+ }) : e)), e.forEach((e) => {
783
+ if (this.isValidLookup(n)) return;
784
+ let s = this.extractFromKey(e, t), c = s.key;
785
+ r = c;
786
+ let l = s.namespaces;
787
+ this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
788
+ let u = t.count !== void 0 && !d(t.count), f = u && !t.ordinal && t.count === 0, p = t.context !== void 0 && (d(t.context) || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
789
+ l.forEach((e) => {
790
+ this.isValidLookup(n) || (o = e, !R[`${m[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (R[`${m[0]}-${e}`] = !0, this.logger.warn(`key "${r}" for languages "${m.join(", ")}" won't get resolved as namespace "${o}" 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!!!")), m.forEach((r) => {
791
+ if (this.isValidLookup(n)) return;
792
+ a = r;
793
+ let o = [c];
794
+ if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(o, c, r, e, t);
795
+ else {
796
+ let e;
797
+ u && (e = this.pluralResolver.getSuffix(r, t.count, t));
798
+ let n = `${this.options.pluralSeparator}zero`, i = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
799
+ if (u && (t.ordinal && e.indexOf(i) === 0 && o.push(c + e.replace(i, this.options.pluralSeparator)), o.push(c + e), f && o.push(c + n)), p) {
800
+ let r = `${c}${this.options.contextSeparator || "_"}${t.context}`;
801
+ o.push(r), u && (t.ordinal && e.indexOf(i) === 0 && o.push(r + e.replace(i, this.options.pluralSeparator)), o.push(r + e), f && o.push(r + n));
802
+ }
803
+ }
804
+ let s;
805
+ for (; s = o.pop();) this.isValidLookup(n) || (i = s, n = this.getResource(r, e, s, t));
806
+ }));
807
+ });
808
+ }), {
809
+ res: n,
810
+ usedKey: r,
811
+ exactUsedKey: i,
812
+ usedLng: a,
813
+ usedNS: o
814
+ };
815
+ }
816
+ isValidLookup(e) {
817
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
818
+ }
819
+ getResource(e, t, n, r = {}) {
820
+ return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, n, r) : this.resourceStore.getResource(e, t, n, r);
821
+ }
822
+ getUsedParamsDetails(e = {}) {
823
+ let t = [
824
+ "defaultValue",
825
+ "ordinal",
826
+ "context",
827
+ "replace",
828
+ "lng",
829
+ "lngs",
830
+ "fallbackLng",
831
+ "ns",
832
+ "keySeparator",
833
+ "nsSeparator",
834
+ "returnObjects",
835
+ "returnDetails",
836
+ "joinArrays",
837
+ "postProcess",
838
+ "interpolation"
839
+ ], n = e.replace && !d(e.replace), r = n ? e.replace : e;
840
+ if (n && e.count !== void 0 && (r.count = e.count), this.options.interpolation.defaultVariables && (r = {
841
+ ...this.options.interpolation.defaultVariables,
842
+ ...r
843
+ }), !n) {
844
+ r = { ...r };
845
+ for (let e of t) delete r[e];
846
+ }
847
+ return r;
848
+ }
849
+ static hasDefaultValue(e) {
850
+ for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.substring(0, 12) === "defaultValue" && e[t] !== void 0) return !0;
851
+ return !1;
852
+ }
853
+ }, V = class {
854
+ constructor(e) {
855
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = M.create("languageUtils");
856
+ }
857
+ getScriptPartFromCode(e) {
858
+ if (e = j(e), !e || e.indexOf("-") < 0) return null;
859
+ let t = e.split("-");
860
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
861
+ }
862
+ getLanguagePartFromCode(e) {
863
+ if (e = j(e), !e || e.indexOf("-") < 0) return e;
864
+ let t = e.split("-");
865
+ return this.formatLanguageCode(t[0]);
866
+ }
867
+ formatLanguageCode(e) {
868
+ if (d(e) && e.indexOf("-") > -1) {
869
+ let t;
870
+ try {
871
+ t = Intl.getCanonicalLocales(e)[0];
872
+ } catch {}
873
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
874
+ }
875
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
876
+ }
877
+ isSupportedCode(e) {
878
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
879
+ }
880
+ getBestMatchFromCodes(e) {
881
+ if (!e) return null;
882
+ let t;
883
+ return e.forEach((e) => {
884
+ if (t) return;
885
+ let n = this.formatLanguageCode(e);
886
+ (!this.options.supportedLngs || this.isSupportedCode(n)) && (t = n);
887
+ }), !t && this.options.supportedLngs && e.forEach((e) => {
888
+ if (t) return;
889
+ let n = this.getScriptPartFromCode(e);
890
+ if (this.isSupportedCode(n)) return t = n;
891
+ let r = this.getLanguagePartFromCode(e);
892
+ if (this.isSupportedCode(r)) return t = r;
893
+ t = this.options.supportedLngs.find((e) => {
894
+ if (e === r || !(e.indexOf("-") < 0 && r.indexOf("-") < 0) && (e.indexOf("-") > 0 && r.indexOf("-") < 0 && e.substring(0, e.indexOf("-")) === r || e.indexOf(r) === 0 && r.length > 1)) return e;
895
+ });
896
+ }), t ||= this.getFallbackCodes(this.options.fallbackLng)[0], t;
897
+ }
898
+ getFallbackCodes(e, t) {
899
+ if (!e) return [];
900
+ if (typeof e == "function" && (e = e(t)), d(e) && (e = [e]), Array.isArray(e)) return e;
901
+ if (!t) return e.default || [];
902
+ let n = e[t];
903
+ return n ||= e[this.getScriptPartFromCode(t)], n ||= e[this.formatLanguageCode(t)], n ||= e[this.getLanguagePartFromCode(t)], n ||= e.default, n || [];
904
+ }
905
+ toResolveHierarchy(e, t) {
906
+ let n = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), r = [], i = (e) => {
907
+ e && (this.isSupportedCode(e) ? r.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
908
+ };
909
+ return d(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && i(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && i(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && i(this.getLanguagePartFromCode(e))) : d(e) && i(this.formatLanguageCode(e)), n.forEach((e) => {
910
+ r.indexOf(e) < 0 && i(this.formatLanguageCode(e));
911
+ }), r;
912
+ }
913
+ }, H = {
914
+ zero: 0,
915
+ one: 1,
916
+ two: 2,
917
+ few: 3,
918
+ many: 4,
919
+ other: 5
920
+ }, U = {
921
+ select: (e) => e === 1 ? "one" : "other",
922
+ resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
923
+ }, re = class {
924
+ constructor(e, t = {}) {
925
+ this.languageUtils = e, this.options = t, this.logger = M.create("pluralResolver"), this.pluralRulesCache = {};
926
+ }
927
+ clearCache() {
928
+ this.pluralRulesCache = {};
929
+ }
930
+ getRule(e, t = {}) {
931
+ let n = j(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
932
+ cleanedCode: n,
933
+ type: r
934
+ });
935
+ if (i in this.pluralRulesCache) return this.pluralRulesCache[i];
936
+ let a;
937
+ try {
938
+ a = new Intl.PluralRules(n, { type: r });
939
+ } catch {
940
+ if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), U;
941
+ if (!e.match(/-|_/)) return U;
942
+ let n = this.languageUtils.getLanguagePartFromCode(e);
943
+ a = this.getRule(n, t);
944
+ }
945
+ return this.pluralRulesCache[i] = a, a;
946
+ }
947
+ needsPlural(e, t = {}) {
948
+ let n = this.getRule(e, t);
949
+ return n ||= this.getRule("dev", t), n?.resolvedOptions().pluralCategories.length > 1;
950
+ }
951
+ getPluralFormsOfKey(e, t, n = {}) {
952
+ return this.getSuffixes(e, n).map((e) => `${t}${e}`);
953
+ }
954
+ getSuffixes(e, t = {}) {
955
+ let n = this.getRule(e, t);
956
+ return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => H[e] - H[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
957
+ }
958
+ getSuffix(e, t, n = {}) {
959
+ let r = this.getRule(e, n);
960
+ return r ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${r.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
961
+ }
962
+ }, W = (e, t, n, r = ".", i = !0) => {
963
+ let a = S(e, t, n);
964
+ return !a && i && d(n) && (a = A(e, n, r), a === void 0 && (a = A(t, n, r))), a;
965
+ }, G = (e) => e.replace(/\$/g, "$$$$"), K = class {
966
+ constructor(e = {}) {
967
+ this.logger = M.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
968
+ }
969
+ init(e = {}) {
970
+ e.interpolation ||= { escapeValue: !0 };
971
+ let { escape: t, escapeValue: n, useRawValueToEscape: r, prefix: i, prefixEscaped: a, suffix: o, suffixEscaped: s, formatSeparator: c, unescapeSuffix: l, unescapePrefix: u, nestingPrefix: d, nestingPrefixEscaped: f, nestingSuffix: p, nestingSuffixEscaped: m, nestingOptionsSeparator: h, maxReplaces: g, alwaysFormat: _ } = e.interpolation;
972
+ this.escape = t === void 0 ? E : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? w(i) : a || "{{", this.suffix = o ? w(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? w(d) : f || w("$t("), this.nestingSuffix = p ? w(p) : m || w(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ !== void 0 && _, this.resetRegExp();
973
+ }
974
+ reset() {
975
+ this.options && this.init(this.options);
976
+ }
977
+ resetRegExp() {
978
+ let e = (e, t) => e?.source === t ? (e.lastIndex = 0, e) : new RegExp(t, "g");
979
+ this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
980
+ }
981
+ interpolate(e, t, n, r) {
982
+ let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
983
+ if (e.indexOf(this.formatSeparator) < 0) {
984
+ let i = W(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
985
+ return this.alwaysFormat ? this.format(i, void 0, n, {
986
+ ...r,
987
+ ...t,
988
+ interpolationkey: e
989
+ }) : i;
990
+ }
991
+ let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
992
+ return this.format(W(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
993
+ ...r,
994
+ ...t,
995
+ interpolationkey: a
996
+ });
997
+ };
998
+ this.resetRegExp();
999
+ let l = r?.missingInterpolationHandler || this.options.missingInterpolationHandler, u = r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables;
1000
+ return [{
1001
+ regex: this.regexpUnescape,
1002
+ safeValue: (e) => G(e)
1003
+ }, {
1004
+ regex: this.regexp,
1005
+ safeValue: (e) => this.escapeValue ? G(this.escape(e)) : G(e)
1006
+ }].forEach((t) => {
1007
+ for (o = 0; i = t.regex.exec(e);) {
1008
+ let n = i[1].trim();
1009
+ if (a = c(n), a === void 0) if (typeof l == "function") {
1010
+ let t = l(e, i, r);
1011
+ a = d(t) ? t : "";
1012
+ } else if (r && Object.prototype.hasOwnProperty.call(r, n)) a = "";
1013
+ else if (u) {
1014
+ a = i[0];
1015
+ continue;
1016
+ } else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
1017
+ else !d(a) && !this.useRawValueToEscape && (a = p(a));
1018
+ let s = t.safeValue(a);
1019
+ if (e = e.replace(i[0], s), u ? (t.regex.lastIndex += a.length, t.regex.lastIndex -= i[0].length) : t.regex.lastIndex = 0, o++, o >= this.maxReplaces) break;
1020
+ }
1021
+ }), e;
1022
+ }
1023
+ nest(e, t, n = {}) {
1024
+ let r, i, a, o = (e, t) => {
1025
+ let n = this.nestingOptionsSeparator;
1026
+ if (e.indexOf(n) < 0) return e;
1027
+ let r = e.split(RegExp(`${w(n)}[ ]*{`)), i = `{${r[1]}`;
1028
+ e = r[0], i = this.interpolate(i, a);
1029
+ let o = i.match(/'/g), s = i.match(/"/g);
1030
+ ((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
1031
+ try {
1032
+ a = JSON.parse(i), t && (a = {
1033
+ ...t,
1034
+ ...a
1035
+ });
1036
+ } catch (t) {
1037
+ return this.logger.warn(`failed parsing options string in nesting for key ${e}`, t), `${e}${n}${i}`;
1038
+ }
1039
+ return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, e;
1040
+ };
1041
+ for (; r = this.nestingRegexp.exec(e);) {
1042
+ let s = [];
1043
+ a = { ...n }, a = a.replace && !d(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
1044
+ let c = /{.*}/.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
1045
+ if (c !== -1 && (s = r[1].slice(c).split(this.formatSeparator).map((e) => e.trim()).filter(Boolean), r[1] = r[1].slice(0, c)), i = t(o.call(this, r[1].trim(), a), a), i && r[0] === e && !d(i)) return i;
1046
+ d(i) || (i = p(i)), i ||= (this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`), ""), s.length && (i = s.reduce((e, t) => this.format(e, t, n.lng, {
1047
+ ...n,
1048
+ interpolationkey: r[1].trim()
1049
+ }), i.trim())), e = e.replace(r[0], i), this.regexp.lastIndex = 0;
1050
+ }
1051
+ return e;
1052
+ }
1053
+ }, ie = (e) => {
1054
+ let t = e.toLowerCase().trim(), n = {};
1055
+ if (e.indexOf("(") > -1) {
1056
+ let r = e.split("(");
1057
+ t = r[0].toLowerCase().trim();
1058
+ let i = r[1].substring(0, r[1].length - 1);
1059
+ t === "currency" && i.indexOf(":") < 0 ? n.currency ||= i.trim() : t === "relativetime" && i.indexOf(":") < 0 ? n.range ||= i.trim() : i.split(";").forEach((e) => {
1060
+ if (e) {
1061
+ let [t, ...r] = e.split(":"), i = r.join(":").trim().replace(/^'+|'+$/g, ""), a = t.trim();
1062
+ n[a] || (n[a] = i), i === "false" && (n[a] = !1), i === "true" && (n[a] = !0), isNaN(i) || (n[a] = parseInt(i, 10));
1063
+ }
1064
+ });
1065
+ }
1066
+ return {
1067
+ formatName: t,
1068
+ formatOptions: n
1069
+ };
1070
+ }, q = (e) => {
1071
+ let t = {};
1072
+ return (n, r, i) => {
1073
+ let a = i;
1074
+ i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (a = {
1075
+ ...a,
1076
+ [i.interpolationkey]: void 0
1077
+ });
1078
+ let o = r + JSON.stringify(a), s = t[o];
1079
+ return s || (s = e(j(r), i), t[o] = s), s(n);
1080
+ };
1081
+ }, ae = (e) => (t, n, r) => e(j(n), r)(t), oe = class {
1082
+ constructor(e = {}) {
1083
+ this.logger = M.create("formatter"), this.options = e, this.init(e);
1084
+ }
1085
+ init(e, t = { interpolation: {} }) {
1086
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
1087
+ let n = t.cacheInBuiltFormats ? q : ae;
1088
+ this.formats = {
1089
+ number: n((e, t) => {
1090
+ let n = new Intl.NumberFormat(e, { ...t });
1091
+ return (e) => n.format(e);
1092
+ }),
1093
+ currency: n((e, t) => {
1094
+ let n = new Intl.NumberFormat(e, {
1095
+ ...t,
1096
+ style: "currency"
1097
+ });
1098
+ return (e) => n.format(e);
1099
+ }),
1100
+ datetime: n((e, t) => {
1101
+ let n = new Intl.DateTimeFormat(e, { ...t });
1102
+ return (e) => n.format(e);
1103
+ }),
1104
+ relativetime: n((e, t) => {
1105
+ let n = new Intl.RelativeTimeFormat(e, { ...t });
1106
+ return (e) => n.format(e, t.range || "day");
1107
+ }),
1108
+ list: n((e, t) => {
1109
+ let n = new Intl.ListFormat(e, { ...t });
1110
+ return (e) => n.format(e);
1111
+ })
1112
+ };
1113
+ }
1114
+ add(e, t) {
1115
+ this.formats[e.toLowerCase().trim()] = t;
1116
+ }
1117
+ addCached(e, t) {
1118
+ this.formats[e.toLowerCase().trim()] = q(t);
1119
+ }
1120
+ format(e, t, n, r = {}) {
1121
+ let i = t.split(this.formatSeparator);
1122
+ if (i.length > 1 && i[0].indexOf("(") > 1 && i[0].indexOf(")") < 0 && i.find((e) => e.indexOf(")") > -1)) {
1123
+ let e = i.findIndex((e) => e.indexOf(")") > -1);
1124
+ i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
1125
+ }
1126
+ return i.reduce((e, t) => {
1127
+ let { formatName: i, formatOptions: a } = ie(t);
1128
+ if (this.formats[i]) {
1129
+ let t = e;
1130
+ try {
1131
+ let o = r?.formatParams?.[r.interpolationkey] || {}, s = o.locale || o.lng || r.locale || r.lng || n;
1132
+ t = this.formats[i](e, s, {
1133
+ ...a,
1134
+ ...r,
1135
+ ...o
1136
+ });
1137
+ } catch (e) {
1138
+ this.logger.warn(e);
1139
+ }
1140
+ return t;
1141
+ } else this.logger.warn(`there was no format function for ${i}`);
1142
+ return e;
1143
+ }, e);
1144
+ }
1145
+ }, se = (e, t) => {
1146
+ e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
1147
+ }, ce = class extends N {
1148
+ constructor(e, t, n, r = {}) {
1149
+ super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = M.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = r.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r.maxRetries >= 0 ? r.maxRetries : 5, this.retryTimeout = r.retryTimeout >= 1 ? r.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n, r.backend, r);
1150
+ }
1151
+ queueLoad(e, t, n, r) {
1152
+ let i = {}, a = {}, o = {}, s = {};
1153
+ return e.forEach((e) => {
1154
+ let r = !0;
1155
+ t.forEach((t) => {
1156
+ let o = `${e}|${t}`;
1157
+ !n.reload && this.store.hasResourceBundle(e, t) ? this.state[o] = 2 : this.state[o] < 0 || (this.state[o] === 1 ? a[o] === void 0 && (a[o] = !0) : (this.state[o] = 1, r = !1, a[o] === void 0 && (a[o] = !0), i[o] === void 0 && (i[o] = !0), s[t] === void 0 && (s[t] = !0)));
1158
+ }), r || (o[e] = !0);
1159
+ }), (Object.keys(i).length || Object.keys(a).length) && this.queue.push({
1160
+ pending: a,
1161
+ pendingCount: Object.keys(a).length,
1162
+ loaded: {},
1163
+ errors: [],
1164
+ callback: r
1165
+ }), {
1166
+ toLoad: Object.keys(i),
1167
+ pending: Object.keys(a),
1168
+ toLoadLanguages: Object.keys(o),
1169
+ toLoadNamespaces: Object.keys(s)
1170
+ };
1171
+ }
1172
+ loaded(e, t, n) {
1173
+ let r = e.split("|"), i = r[0], a = r[1];
1174
+ t && this.emit("failedLoading", i, a, t), !t && n && this.store.addResourceBundle(i, a, n, void 0, void 0, { skipCopy: !0 }), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
1175
+ let o = {};
1176
+ this.queue.forEach((n) => {
1177
+ b(n.loaded, [i], a), se(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
1178
+ o[e] || (o[e] = {});
1179
+ let t = n.loaded[e];
1180
+ t.length && t.forEach((t) => {
1181
+ o[e][t] === void 0 && (o[e][t] = !0);
1182
+ });
1183
+ }), n.done = !0, n.errors.length ? n.callback(n.errors) : n.callback());
1184
+ }), this.emit("loaded", o), this.queue = this.queue.filter((e) => !e.done);
1185
+ }
1186
+ read(e, t, n, r = 0, i = this.retryTimeout, a) {
1187
+ if (!e.length) return a(null, {});
1188
+ if (this.readingCalls >= this.maxParallelReads) {
1189
+ this.waitingReads.push({
1190
+ lng: e,
1191
+ ns: t,
1192
+ fcName: n,
1193
+ tried: r,
1194
+ wait: i,
1195
+ callback: a
1196
+ });
1197
+ return;
1198
+ }
1199
+ this.readingCalls++;
1200
+ let o = (o, s) => {
1201
+ if (this.readingCalls--, this.waitingReads.length > 0) {
1202
+ let e = this.waitingReads.shift();
1203
+ this.read(e.lng, e.ns, e.fcName, e.tried, e.wait, e.callback);
1204
+ }
1205
+ if (o && s && r < this.maxRetries) {
1206
+ setTimeout(() => {
1207
+ this.read.call(this, e, t, n, r + 1, i * 2, a);
1208
+ }, i);
1209
+ return;
1210
+ }
1211
+ a(o, s);
1212
+ }, s = this.backend[n].bind(this.backend);
1213
+ if (s.length === 2) {
1214
+ try {
1215
+ let n = s(e, t);
1216
+ n && typeof n.then == "function" ? n.then((e) => o(null, e)).catch(o) : o(null, n);
1217
+ } catch (e) {
1218
+ o(e);
1219
+ }
1220
+ return;
1221
+ }
1222
+ return s(e, t, o);
1223
+ }
1224
+ prepareLoading(e, t, n = {}, r) {
1225
+ if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), r && r();
1226
+ d(e) && (e = this.languageUtils.toResolveHierarchy(e)), d(t) && (t = [t]);
1227
+ let i = this.queueLoad(e, t, n, r);
1228
+ if (!i.toLoad.length) return i.pending.length || r(), null;
1229
+ i.toLoad.forEach((e) => {
1230
+ this.loadOne(e);
1231
+ });
1232
+ }
1233
+ load(e, t, n) {
1234
+ this.prepareLoading(e, t, {}, n);
1235
+ }
1236
+ reload(e, t, n) {
1237
+ this.prepareLoading(e, t, { reload: !0 }, n);
1238
+ }
1239
+ loadOne(e, t = "") {
1240
+ let n = e.split("|"), r = n[0], i = n[1];
1241
+ this.read(r, i, "read", void 0, void 0, (n, a) => {
1242
+ n && this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`, n), !n && a && this.logger.log(`${t}loaded namespace ${i} for language ${r}`, a), this.loaded(e, n, a);
1243
+ });
1244
+ }
1245
+ saveMissing(e, t, n, r, i, a = {}, o = () => {}) {
1246
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
1247
+ this.logger.warn(`did not save key "${n}" as the namespace "${t}" 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!!!");
1248
+ return;
1249
+ }
1250
+ if (!(n == null || n === "")) {
1251
+ if (this.backend?.create) {
1252
+ let s = {
1253
+ ...a,
1254
+ isUpdate: i
1255
+ }, c = this.backend.create.bind(this.backend);
1256
+ if (c.length < 6) try {
1257
+ let i;
1258
+ i = c.length === 5 ? c(e, t, n, r, s) : c(e, t, n, r), i && typeof i.then == "function" ? i.then((e) => o(null, e)).catch(o) : o(null, i);
1259
+ } catch (e) {
1260
+ o(e);
1261
+ }
1262
+ else c(e, t, n, r, o, s);
1263
+ }
1264
+ !e || !e[0] || this.store.addResource(e[0], t, n, r);
1265
+ }
1266
+ }
1267
+ }, J = () => ({
1268
+ debug: !1,
1269
+ initAsync: !0,
1270
+ ns: ["translation"],
1271
+ defaultNS: ["translation"],
1272
+ fallbackLng: ["dev"],
1273
+ fallbackNS: !1,
1274
+ supportedLngs: !1,
1275
+ nonExplicitSupportedLngs: !1,
1276
+ load: "all",
1277
+ preload: !1,
1278
+ simplifyPluralSuffix: !0,
1279
+ keySeparator: ".",
1280
+ nsSeparator: ":",
1281
+ pluralSeparator: "_",
1282
+ contextSeparator: "_",
1283
+ partialBundledLanguages: !1,
1284
+ saveMissing: !1,
1285
+ updateMissing: !1,
1286
+ saveMissingTo: "fallback",
1287
+ saveMissingPlurals: !0,
1288
+ missingKeyHandler: !1,
1289
+ missingInterpolationHandler: !1,
1290
+ postProcess: !1,
1291
+ postProcessPassResolved: !1,
1292
+ returnNull: !1,
1293
+ returnEmptyString: !0,
1294
+ returnObjects: !1,
1295
+ joinArrays: !1,
1296
+ returnedObjectHandler: !1,
1297
+ parseMissingKeyHandler: !1,
1298
+ appendNamespaceToMissingKey: !1,
1299
+ appendNamespaceToCIMode: !1,
1300
+ overloadTranslationOptionHandler: (e) => {
1301
+ let t = {};
1302
+ if (typeof e[1] == "object" && (t = e[1]), d(e[1]) && (t.defaultValue = e[1]), d(e[2]) && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
1303
+ let n = e[3] || e[2];
1304
+ Object.keys(n).forEach((e) => {
1305
+ t[e] = n[e];
1306
+ });
1307
+ }
1308
+ return t;
1309
+ },
1310
+ interpolation: {
1311
+ escapeValue: !0,
1312
+ format: (e) => e,
1313
+ prefix: "{{",
1314
+ suffix: "}}",
1315
+ formatSeparator: ",",
1316
+ unescapePrefix: "-",
1317
+ nestingPrefix: "$t(",
1318
+ nestingSuffix: ")",
1319
+ nestingOptionsSeparator: ",",
1320
+ maxReplaces: 1e3,
1321
+ skipOnVariables: !0
1322
+ },
1323
+ cacheInBuiltFormats: !0
1324
+ }), Y = (e) => (d(e.ns) && (e.ns = [e.ns]), d(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), d(e.fallbackNS) && (e.fallbackNS = [e.fallbackNS]), e.supportedLngs?.indexOf?.("cimode") < 0 && (e.supportedLngs = e.supportedLngs.concat(["cimode"])), typeof e.initImmediate == "boolean" && (e.initAsync = e.initImmediate), e), X = () => {}, le = (e) => {
1325
+ Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
1326
+ typeof e[t] == "function" && (e[t] = e[t].bind(e));
1327
+ });
1328
+ }, Z = "__i18next_supportNoticeShown", ue = () => !!(typeof globalThis < "u" && globalThis[Z] || typeof process < "u" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE || typeof process < "u" && process.env), de = () => {
1329
+ typeof globalThis < "u" && (globalThis[Z] = !0);
1330
+ }, fe = (e) => !!(e?.modules?.backend?.name?.indexOf("Locize") > 0 || e?.modules?.backend?.constructor?.name?.indexOf("Locize") > 0 || e?.options?.backend?.backends && e.options.backend.backends.some((e) => e?.name?.indexOf("Locize") > 0 || e?.constructor?.name?.indexOf("Locize") > 0) || e?.options?.backend?.projectId || e?.options?.backend?.backendOptions && e.options.backend.backendOptions.some((e) => e?.projectId)), Q = class e extends N {
1331
+ constructor(e = {}, t) {
1332
+ if (super(), this.options = Y(e), this.services = {}, this.logger = M, this.modules = { external: [] }, le(this), t && !this.isInitialized && !e.isClone) {
1333
+ if (!this.options.initAsync) return this.init(e, t), this;
1334
+ setTimeout(() => {
1335
+ this.init(e, t);
1336
+ }, 0);
1337
+ }
1338
+ }
1339
+ init(e = {}, t) {
1340
+ this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (d(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
1341
+ let n = J();
1342
+ this.options = {
1343
+ ...n,
1344
+ ...this.options,
1345
+ ...Y(e)
1346
+ }, this.options.interpolation = {
1347
+ ...n.interpolation,
1348
+ ...this.options.interpolation
1349
+ }, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = n.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !fe(this) && !ue() && (typeof console < "u" && console.info !== void 0 && console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"), de());
1350
+ let r = (e) => e ? typeof e == "function" ? new e() : e : null;
1351
+ if (!this.options.isClone) {
1352
+ this.modules.logger ? M.init(r(this.modules.logger), this.options) : M.init(null, this.options);
1353
+ let e;
1354
+ e = this.modules.formatter ? this.modules.formatter : oe;
1355
+ let t = new V(this.options);
1356
+ this.store = new P(this.options.resources, this.options);
1357
+ let i = this.services;
1358
+ i.logger = M, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new re(t, {
1359
+ prepend: this.options.pluralSeparator,
1360
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
1361
+ }), this.options.interpolation.format && this.options.interpolation.format !== n.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), e && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (i.formatter = r(e), i.formatter.init && i.formatter.init(i, this.options), this.options.interpolation.format = i.formatter.format.bind(i.formatter)), i.interpolator = new K(this.options), i.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i.backendConnector = new ce(r(this.modules.backend), i.resourceStore, i, this.options), i.backendConnector.on("*", (e, ...t) => {
1362
+ this.emit(e, ...t);
1363
+ }), this.modules.languageDetector && (i.languageDetector = r(this.modules.languageDetector), i.languageDetector.init && i.languageDetector.init(i, this.options.detection, this.options)), this.modules.i18nFormat && (i.i18nFormat = r(this.modules.i18nFormat), i.i18nFormat.init && i.i18nFormat.init(this)), this.translator = new B(this.services, this.options), this.translator.on("*", (e, ...t) => {
1364
+ this.emit(e, ...t);
1365
+ }), this.modules.external.forEach((e) => {
1366
+ e.init && e.init(this);
1367
+ });
1368
+ }
1369
+ if (this.format = this.options.interpolation.format, t ||= X, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1370
+ let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1371
+ e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
1372
+ }
1373
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), [
1374
+ "getResource",
1375
+ "hasResourceBundle",
1376
+ "getResourceBundle",
1377
+ "getDataByLanguage"
1378
+ ].forEach((e) => {
1379
+ this[e] = (...t) => this.store[e](...t);
1380
+ }), [
1381
+ "addResource",
1382
+ "addResources",
1383
+ "addResourceBundle",
1384
+ "removeResourceBundle"
1385
+ ].forEach((e) => {
1386
+ this[e] = (...t) => (this.store[e](...t), this);
1387
+ });
1388
+ let i = f(), a = () => {
1389
+ let e = (e, n) => {
1390
+ this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), i.resolve(n), t(e, n);
1391
+ };
1392
+ if (this.languages && !this.isInitialized) return e(null, this.t.bind(this));
1393
+ this.changeLanguage(this.options.lng, e);
1394
+ };
1395
+ return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
1396
+ }
1397
+ loadResources(e, t = X) {
1398
+ let n = t, r = d(e) ? e : this.language;
1399
+ if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
1400
+ if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
1401
+ let e = [], t = (t) => {
1402
+ t && t !== "cimode" && this.services.languageUtils.toResolveHierarchy(t).forEach((t) => {
1403
+ t !== "cimode" && e.indexOf(t) < 0 && e.push(t);
1404
+ });
1405
+ };
1406
+ r ? t(r) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e) => t(e)), this.options.preload?.forEach?.((e) => t(e)), this.services.backendConnector.load(e, this.options.ns, (e) => {
1407
+ !e && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(e);
1408
+ });
1409
+ } else n(null);
1410
+ }
1411
+ reloadResources(e, t, n) {
1412
+ let r = f();
1413
+ return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e ||= this.languages, t ||= this.options.ns, n ||= X, this.services.backendConnector.reload(e, t, (e) => {
1414
+ r.resolve(), n(e);
1415
+ }), r;
1416
+ }
1417
+ use(e) {
1418
+ if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1419
+ if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1420
+ 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" && F.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1421
+ }
1422
+ setResolvedLanguage(e) {
1423
+ if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
1424
+ for (let e = 0; e < this.languages.length; e++) {
1425
+ let t = this.languages[e];
1426
+ if (!(["cimode", "dev"].indexOf(t) > -1) && this.store.hasLanguageSomeTranslations(t)) {
1427
+ this.resolvedLanguage = t;
1428
+ break;
1429
+ }
1430
+ }
1431
+ !this.resolvedLanguage && this.languages.indexOf(e) < 0 && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
1432
+ }
1433
+ }
1434
+ changeLanguage(e, t) {
1435
+ this.isLanguageChangingTo = e;
1436
+ let n = f();
1437
+ this.emit("languageChanging", e);
1438
+ let r = (e) => {
1439
+ this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
1440
+ }, i = (i, a) => {
1441
+ a ? this.isLanguageChangingTo === e && (r(a), this.translator.changeLanguage(a), this.isLanguageChangingTo = void 0, this.emit("languageChanged", a), this.logger.log("languageChanged", a)) : this.isLanguageChangingTo = void 0, n.resolve((...e) => this.t(...e)), t && t(i, (...e) => this.t(...e));
1442
+ }, a = (t) => {
1443
+ !e && !t && this.services.languageDetector && (t = []);
1444
+ let n = d(t) ? t : t && t[0], a = this.store.hasLanguageSomeTranslations(n) ? n : this.services.languageUtils.getBestMatchFromCodes(d(t) ? [t] : t);
1445
+ a && (this.language || r(a), this.translator.language || this.translator.changeLanguage(a), this.services.languageDetector?.cacheUserLanguage?.(a)), this.loadResources(a, (e) => {
1446
+ i(e, a);
1447
+ });
1448
+ };
1449
+ return !e && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a) : this.services.languageDetector.detect(a) : a(e), n;
1450
+ }
1451
+ getFixedT(e, t, n) {
1452
+ let r = (e, t, ...i) => {
1453
+ let a;
1454
+ a = typeof t == "object" ? { ...t } : this.options.overloadTranslationOptionHandler([e, t].concat(i)), a.lng = a.lng || r.lng, a.lngs = a.lngs || r.lngs, a.ns = a.ns || r.ns, a.keyPrefix !== "" && (a.keyPrefix = a.keyPrefix || n || r.keyPrefix);
1455
+ let o = {
1456
+ ...this.options,
1457
+ ...a
1458
+ };
1459
+ typeof a.keyPrefix == "function" && (a.keyPrefix = L(a.keyPrefix, o));
1460
+ let s = this.options.keySeparator || ".", c;
1461
+ return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = L(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = L(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
1462
+ };
1463
+ return d(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = n, r;
1464
+ }
1465
+ t(...e) {
1466
+ return this.translator?.translate(...e);
1467
+ }
1468
+ exists(...e) {
1469
+ return this.translator?.exists(...e);
1470
+ }
1471
+ setDefaultNamespace(e) {
1472
+ this.options.defaultNS = e;
1473
+ }
1474
+ hasLoadedNamespace(e, t = {}) {
1475
+ if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1476
+ if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1477
+ let n = t.lng || this.resolvedLanguage || this.languages[0], r = this.options ? this.options.fallbackLng : !1, i = this.languages[this.languages.length - 1];
1478
+ if (n.toLowerCase() === "cimode") return !0;
1479
+ let a = (e, t) => {
1480
+ let n = this.services.backendConnector.state[`${e}|${t}`];
1481
+ return n === -1 || n === 0 || n === 2;
1482
+ };
1483
+ if (t.precheck) {
1484
+ let e = t.precheck(this, a);
1485
+ if (e !== void 0) return e;
1486
+ }
1487
+ return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
1488
+ }
1489
+ loadNamespaces(e, t) {
1490
+ let n = f();
1491
+ return this.options.ns ? (d(e) && (e = [e]), e.forEach((e) => {
1492
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
1493
+ }), this.loadResources((e) => {
1494
+ n.resolve(), t && t(e);
1495
+ }), n) : (t && t(), Promise.resolve());
1496
+ }
1497
+ loadLanguages(e, t) {
1498
+ let n = f();
1499
+ d(e) && (e = [e]);
1500
+ let r = this.options.preload || [], i = e.filter((e) => r.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
1501
+ return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
1502
+ n.resolve(), t && t(e);
1503
+ }), n) : (t && t(), Promise.resolve());
1504
+ }
1505
+ dir(e) {
1506
+ if (e ||= this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language), !e) return "rtl";
1507
+ try {
1508
+ let t = new Intl.Locale(e);
1509
+ if (t && t.getTextInfo) {
1510
+ let e = t.getTextInfo();
1511
+ if (e && e.direction) return e.direction;
1512
+ }
1513
+ } catch {}
1514
+ let t = /* @__PURE__ */ "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".split("."), n = this.services?.languageUtils || new V(J());
1515
+ return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1516
+ }
1517
+ static createInstance(t = {}, n) {
1518
+ let r = new e(t, n);
1519
+ return r.createInstance = e.createInstance, r;
1520
+ }
1521
+ cloneInstance(t = {}, n = X) {
1522
+ let r = t.forkResourceStore;
1523
+ r && delete t.forkResourceStore;
1524
+ let i = {
1525
+ ...this.options,
1526
+ ...t,
1527
+ isClone: !0
1528
+ }, a = new e(i);
1529
+ if ((t.debug !== void 0 || t.prefix !== void 0) && (a.logger = a.logger.clone(t)), [
1530
+ "store",
1531
+ "services",
1532
+ "language"
1533
+ ].forEach((e) => {
1534
+ a[e] = this[e];
1535
+ }), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new P(Object.keys(this.store.data).reduce((e, t) => (e[t] = { ...this.store.data[t] }, e[t] = Object.keys(e[t]).reduce((n, r) => (n[r] = { ...e[t][r] }, n), e[t]), e), {}), i), a.services.resourceStore = a.store), t.interpolation) {
1536
+ let e = {
1537
+ ...J().interpolation,
1538
+ ...this.options.interpolation,
1539
+ ...t.interpolation
1540
+ }, n = {
1541
+ ...i,
1542
+ interpolation: e
1543
+ };
1544
+ a.services.interpolator = new K(n);
1545
+ }
1546
+ return a.translator = new B(a.services, i), a.translator.on("*", (e, ...t) => {
1547
+ a.emit(e, ...t);
1548
+ }), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
1549
+ }
1550
+ toJSON() {
1551
+ return {
1552
+ options: this.options,
1553
+ store: this.store,
1554
+ language: this.language,
1555
+ languages: this.languages,
1556
+ resolvedLanguage: this.resolvedLanguage
1557
+ };
1558
+ }
1559
+ }.createInstance();
1560
+ //#endregion
1561
+ //#region ../../shared/translator/dist/index.js
1562
+ Q.createInstance, Q.dir, Q.init, Q.loadResources, Q.reloadResources, Q.use, Q.changeLanguage, Q.getFixedT, Q.t, Q.exists, Q.setDefaultNamespace, Q.hasLoadedNamespace, Q.loadNamespaces, Q.loadLanguages, Q.init({
1563
+ fallbackLng: "en",
1564
+ lng: "en",
1565
+ showSupportNotice: !1,
1566
+ resources: {
1567
+ en: l,
1568
+ es: u
1569
+ }
1570
+ });
1571
+ //#endregion
1572
+ //#region src/i18n.ts
1573
+ var { translator: $ } = {
1574
+ translator: {
1575
+ ...Q,
1576
+ t: (e, t) => {
1577
+ let { lng: n } = t;
1578
+ switch (n) {
1579
+ case "en_US":
1580
+ case "en-US":
1581
+ t.lng = "en";
1582
+ break;
1583
+ case "es_ES":
1584
+ case "es-ES":
1585
+ case "es_MX":
1586
+ case "es-MX":
1587
+ t.lng = "es";
1588
+ break;
1589
+ default: break;
1590
+ }
1591
+ return Q.t(e, {
1592
+ lng: n,
1593
+ ...t
1594
+ });
1595
+ }
1596
+ },
1597
+ languageOptions: [{
1598
+ value: "en_US",
1599
+ label: "English (US)"
1600
+ }, {
1601
+ value: "es_ES",
1602
+ label: "Spanish"
1603
+ }]
1604
+ };
1605
+ function pe(e, t) {
1606
+ return $.t(`translation:simpleCloze:${e}`, { lng: t });
1607
+ }
1608
+ function me(e, t) {
1609
+ return $.t(`common:${e}`, { lng: t });
1610
+ }
1611
+ //#endregion
1612
+ export { me as n, c as r, pe as t };
1613
+
1614
+ //# sourceMappingURL=i18n-BDkxR45Z.js.map