@pie-element/simple-cloze 0.1.4-next.12 → 0.1.4-next.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/delivery/index.js +1 -1
- package/dist/browser/editor-runtime/delivery/index.js +1 -1
- package/dist/browser/editor-runtime/{i18n-BDkxR45Z.js → i18n-BgA-56QR.js} +288 -255
- package/dist/browser/editor-runtime/i18n-BgA-56QR.js.map +1 -0
- package/dist/browser/editor-runtime/print/index.js +1 -1
- package/dist/browser/{i18n-BDkxR45Z.js → i18n-BgA-56QR.js} +288 -255
- package/dist/browser/i18n-BgA-56QR.js.map +1 -0
- package/dist/browser/print/index.js +1 -1
- package/dist/delivery/index.js +103 -63
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.js +2 -2
- package/dist/print/index.js +103 -63
- package/dist/print/index.js.map +1 -1
- package/module/print.js +237 -204
- package/module/print.js.map +1 -1
- package/package.json +5 -1
- package/dist/browser/editor-runtime/i18n-BDkxR45Z.js.map +0 -1
- package/dist/browser/i18n-BDkxR45Z.js.map +0 -1
package/module/print.js
CHANGED
|
@@ -2067,92 +2067,125 @@ function Hr(e, t, n, r, i, a) {
|
|
|
2067
2067
|
}
|
|
2068
2068
|
//#endregion
|
|
2069
2069
|
//#region ../../shared/math-rendering-mathjax/dist/index.js
|
|
2070
|
-
var Ur =
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2070
|
+
var Ur = {
|
|
2071
|
+
parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
|
|
2072
|
+
overarc: "\\overparen",
|
|
2073
|
+
napprox: "\\not\\approx",
|
|
2074
|
+
longdiv: "\\enclose{longdiv}",
|
|
2075
|
+
abs: ["\\left|#1\\right|", 1]
|
|
2076
|
+
}, Wr = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)", Gr = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/, Kr = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/, qr = /\\embed\{newLine\}\[\]/g, Jr = [
|
|
2077
|
+
["$$", "$$"],
|
|
2078
|
+
["$", "$"],
|
|
2079
|
+
["\\[", "\\]"],
|
|
2080
|
+
["\\(", "\\)"]
|
|
2081
|
+
], Yr = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading");
|
|
2082
|
+
function Xr() {
|
|
2083
|
+
return window.MathJax;
|
|
2084
|
+
}
|
|
2085
|
+
function Zr(e) {
|
|
2086
|
+
let t = e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e;
|
|
2087
|
+
for (let [e, n] of Jr) if (t.startsWith(e) && t.endsWith(n)) return t.substring(e.length, t.length - n.length);
|
|
2088
|
+
return t;
|
|
2089
|
+
}
|
|
2090
|
+
function Qr(e) {
|
|
2091
|
+
for (let t of e.querySelectorAll("[data-latex]")) {
|
|
2092
|
+
if (t.dataset.mathHandled || t.closest("mjx-container")) continue;
|
|
2093
|
+
let e = t.textContent;
|
|
2094
|
+
e && (t.textContent = `\\(${Zr(e)}\\)`.replace(qr, "\\newline "), t.dataset.mathHandled = "true");
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
function $r(e, t) {
|
|
2098
|
+
for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
|
|
2099
|
+
return (t ? Kr : Gr).test(e.textContent ?? "");
|
|
2100
|
+
}
|
|
2101
|
+
function ei(e) {
|
|
2102
|
+
return new Promise((t, n) => {
|
|
2076
2103
|
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: a = !0, srcUrl: o } = e, s = {
|
|
2077
|
-
loader: {
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
overarc: "\\overparen",
|
|
2087
|
-
napprox: "\\not\\approx",
|
|
2088
|
-
longdiv: "\\enclose{longdiv}"
|
|
2104
|
+
loader: {
|
|
2105
|
+
load: i ? ["a11y/assistive-mml"] : [],
|
|
2106
|
+
failed: (e) => n(e)
|
|
2107
|
+
},
|
|
2108
|
+
startup: {
|
|
2109
|
+
typeset: !1,
|
|
2110
|
+
ready: () => {
|
|
2111
|
+
let e = Xr()?.startup;
|
|
2112
|
+
e?.defaultReady?.(), Promise.resolve(e?.promise).then(() => t(), n);
|
|
2089
2113
|
}
|
|
2090
2114
|
},
|
|
2115
|
+
tex: { macros: { ...Ur } },
|
|
2091
2116
|
options: {
|
|
2092
2117
|
enableMenu: i,
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
window.MathJax?.startup.defaultReady && (window.MathJax.startup.defaultReady(), t());
|
|
2099
|
-
},
|
|
2100
|
-
defaultReady: () => {}
|
|
2118
|
+
menuOptions: { settings: {
|
|
2119
|
+
assistiveMml: i,
|
|
2120
|
+
enrich: !1,
|
|
2121
|
+
inTabOrder: !1
|
|
2122
|
+
} }
|
|
2101
2123
|
}
|
|
2102
2124
|
};
|
|
2103
|
-
r && s.tex && (s.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], s.tex.processEscapes = !0), a || (s.chtml = { fontURL: "" }), window.MathJax = s;
|
|
2125
|
+
r && s.tex && (console.warn(Wr), s.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], s.tex.processEscapes = !0), a || (s.chtml = { fontURL: "" }), window.MathJax = s;
|
|
2104
2126
|
let c = document.createElement("script");
|
|
2105
|
-
c.src = o || "https://cdn.jsdelivr.net/npm/mathjax@4/tex-chtml.js", c.async = !0, c.
|
|
2106
|
-
setTimeout(t, 100);
|
|
2107
|
-
}, c.onerror = () => {
|
|
2108
|
-
n(/* @__PURE__ */ Error("Failed to load MathJax"));
|
|
2109
|
-
}, document.head.appendChild(c);
|
|
2127
|
+
c.src = o || "https://cdn.jsdelivr.net/npm/mathjax@4.1.3/tex-mml-chtml.js", c.async = !0, c.onerror = () => n(/* @__PURE__ */ Error("Failed to load MathJax")), document.head.appendChild(c);
|
|
2110
2128
|
});
|
|
2111
|
-
return t[Ur] = r, r;
|
|
2112
2129
|
}
|
|
2113
|
-
function
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
e.
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2130
|
+
function ti(e) {
|
|
2131
|
+
return new Promise((t, n) => {
|
|
2132
|
+
let r = e.startup ?? {};
|
|
2133
|
+
e.startup = r;
|
|
2134
|
+
let i = r.ready;
|
|
2135
|
+
r.ready = () => {
|
|
2136
|
+
let e = Xr()?.startup;
|
|
2137
|
+
i ? i.call(r) : e?.defaultReady?.(), Promise.resolve(e?.promise).then(() => t(), n);
|
|
2138
|
+
};
|
|
2139
|
+
});
|
|
2120
2140
|
}
|
|
2121
|
-
function
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2141
|
+
function ni(e) {
|
|
2142
|
+
let t = Xr();
|
|
2143
|
+
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : ti(t) : ei(e);
|
|
2144
|
+
}
|
|
2145
|
+
function ri(e) {
|
|
2146
|
+
return ni(e).then(() => {
|
|
2147
|
+
typeof Xr()?.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
function ii(e) {
|
|
2151
|
+
let t = globalThis, n = t[Yr];
|
|
2152
|
+
return n || (n = ri(e), t[Yr] = n), n;
|
|
2153
|
+
}
|
|
2154
|
+
function ai(e = {}) {
|
|
2155
|
+
let t = e.useSingleDollar ?? !1;
|
|
2156
|
+
return async (n) => {
|
|
2157
|
+
if (typeof window > "u" || (Qr(n), !$r(n, t))) return;
|
|
2158
|
+
await ii(e);
|
|
2159
|
+
let r = Xr();
|
|
2160
|
+
await r?.startup?.promise, typeof r?.typesetPromise == "function" && await r.typesetPromise([n]);
|
|
2128
2161
|
};
|
|
2129
2162
|
}
|
|
2130
|
-
var
|
|
2131
|
-
function
|
|
2132
|
-
return
|
|
2133
|
-
accessibility: !0,
|
|
2134
|
-
useSingleDollar: !0
|
|
2135
|
-
}), Jr;
|
|
2163
|
+
var oi = "@pie-lib/math-rendering", si = "@pie-lib/math-rendering@2", ci = null;
|
|
2164
|
+
function li() {
|
|
2165
|
+
return !!window[si]?.opts?.useSingleDollar;
|
|
2136
2166
|
}
|
|
2137
|
-
function
|
|
2167
|
+
function ui() {
|
|
2168
|
+
return ci ||= ai({ useSingleDollar: li() }), ci;
|
|
2169
|
+
}
|
|
2170
|
+
function di() {
|
|
2138
2171
|
if (typeof window > "u") return null;
|
|
2139
|
-
let e = window[
|
|
2172
|
+
let e = window[oi];
|
|
2140
2173
|
return typeof e?.renderMath == "function" ? e : null;
|
|
2141
2174
|
}
|
|
2142
|
-
var
|
|
2175
|
+
var fi = async (e) => {
|
|
2143
2176
|
if (typeof window > "u") return;
|
|
2144
2177
|
let t = typeof e == "string", n;
|
|
2145
2178
|
t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
|
|
2146
|
-
let r =
|
|
2147
|
-
return r ? await r.renderMath?.(n) : await
|
|
2148
|
-
},
|
|
2179
|
+
let r = di();
|
|
2180
|
+
return r ? await r.renderMath?.(n) : await ui()(n), t ? n.innerHTML : void 0;
|
|
2181
|
+
}, pi = [
|
|
2149
2182
|
"nbsp iexcl cent pound curren yen brvbar sect uml copy ordf laquo not shy reg macr",
|
|
2150
2183
|
"deg plusmn sup2 sup3 acute micro para middot cedil sup1 ordm raquo frac14 frac12 frac34 iquest",
|
|
2151
2184
|
"Agrave Aacute Acirc Atilde Auml Aring AElig Ccedil Egrave Eacute Ecirc Euml Igrave Iacute Icirc Iuml",
|
|
2152
2185
|
"ETH Ntilde Ograve Oacute Ocirc Otilde Ouml times Oslash Ugrave Uacute Ucirc Uuml Yacute THORN szlig",
|
|
2153
2186
|
"agrave aacute acirc atilde auml aring aelig ccedil egrave eacute ecirc euml igrave iacute icirc iuml",
|
|
2154
2187
|
"eth ntilde ograve oacute ocirc otilde ouml divide oslash ugrave uacute ucirc uuml yacute thorn yuml"
|
|
2155
|
-
].join(" "),
|
|
2188
|
+
].join(" "), mi = "alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho sigmaf sigma tau upsilon phi chi psi omega", hi = new Map(Object.entries({
|
|
2156
2189
|
quot: 34,
|
|
2157
2190
|
amp: 38,
|
|
2158
2191
|
apos: 39,
|
|
@@ -2183,16 +2216,16 @@ var Zr = async (e) => {
|
|
|
2183
2216
|
le: 8804,
|
|
2184
2217
|
ge: 8805
|
|
2185
2218
|
}));
|
|
2186
|
-
for (let [e, t] of
|
|
2187
|
-
for (let [e, t] of
|
|
2188
|
-
var
|
|
2219
|
+
for (let [e, t] of pi.split(" ").entries()) hi.set(t, 160 + e);
|
|
2220
|
+
for (let [e, t] of mi.split(" ").entries()) hi.set(t, 945 + e), t !== "sigmaf" && hi.set(t[0].toUpperCase() + t.slice(1), 913 + e);
|
|
2221
|
+
var gi = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, _i = /<\/?[a-z][^>]*>|<!--[\s\S]*?-->/gi, vi = /&(#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]*);/gi, yi = (e, t) => {
|
|
2189
2222
|
if (t[0] === "#") {
|
|
2190
2223
|
let e = t[1] === "x" || t[1] === "X", n = Number.parseInt(t.slice(e ? 2 : 1), e ? 16 : 10), r = n > 0 && n <= 1114111 && (n < 55296 || n > 57343);
|
|
2191
2224
|
return String.fromCodePoint(r ? n : 65533);
|
|
2192
2225
|
}
|
|
2193
|
-
let n =
|
|
2226
|
+
let n = hi.get(t);
|
|
2194
2227
|
return n === void 0 ? e : String.fromCodePoint(n);
|
|
2195
|
-
},
|
|
2228
|
+
}, bi = (e) => typeof e == "string" ? e.replace(gi, " ").replace(_i, "").replace(vi, yi).replace(/\s+/g, " ").trim() : "", xi = {
|
|
2196
2229
|
translation: {
|
|
2197
2230
|
categorize: {
|
|
2198
2231
|
limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
|
|
@@ -2332,7 +2365,7 @@ var ti = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ni = /<
|
|
|
2332
2365
|
hideNote: "Hide Note",
|
|
2333
2366
|
cancel: "Cancel"
|
|
2334
2367
|
}
|
|
2335
|
-
},
|
|
2368
|
+
}, Si = {
|
|
2336
2369
|
translation: {
|
|
2337
2370
|
categorize: {
|
|
2338
2371
|
limitMaxChoicesPerCategory: "Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
|
|
@@ -2472,55 +2505,55 @@ var ti = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ni = /<
|
|
|
2472
2505
|
hideNote: "Ocultar Nota",
|
|
2473
2506
|
cancel: "Cancelar"
|
|
2474
2507
|
}
|
|
2475
|
-
}, Z = (e) => typeof e == "string",
|
|
2508
|
+
}, Z = (e) => typeof e == "string", Ci = () => {
|
|
2476
2509
|
let e, t, n = new Promise((n, r) => {
|
|
2477
2510
|
e = n, t = r;
|
|
2478
2511
|
});
|
|
2479
2512
|
return n.resolve = e, n.reject = t, n;
|
|
2480
|
-
},
|
|
2513
|
+
}, wi = (e) => e == null ? "" : "" + e, Ti = (e, t, n) => {
|
|
2481
2514
|
e.forEach((e) => {
|
|
2482
2515
|
t[e] && (n[e] = t[e]);
|
|
2483
2516
|
});
|
|
2484
|
-
},
|
|
2517
|
+
}, Ei = /###/g, Di = (e) => e && e.indexOf("###") > -1 ? e.replace(Ei, ".") : e, Oi = (e) => !e || Z(e), ki = (e, t, n) => {
|
|
2485
2518
|
let r = Z(t) ? t.split(".") : t, i = 0;
|
|
2486
2519
|
for (; i < r.length - 1;) {
|
|
2487
|
-
if (
|
|
2488
|
-
let t =
|
|
2520
|
+
if (Oi(e)) return {};
|
|
2521
|
+
let t = Di(r[i]);
|
|
2489
2522
|
!e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
|
|
2490
2523
|
}
|
|
2491
|
-
return
|
|
2524
|
+
return Oi(e) ? {} : {
|
|
2492
2525
|
obj: e,
|
|
2493
|
-
k:
|
|
2526
|
+
k: Di(r[i])
|
|
2494
2527
|
};
|
|
2495
|
-
},
|
|
2496
|
-
let { obj: r, k: i } =
|
|
2528
|
+
}, Ai = (e, t, n) => {
|
|
2529
|
+
let { obj: r, k: i } = ki(e, t, Object);
|
|
2497
2530
|
if (r !== void 0 || t.length === 1) {
|
|
2498
2531
|
r[i] = n;
|
|
2499
2532
|
return;
|
|
2500
2533
|
}
|
|
2501
|
-
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s =
|
|
2502
|
-
for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s =
|
|
2534
|
+
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = ki(e, o, Object);
|
|
2535
|
+
for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = ki(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
|
|
2503
2536
|
s.obj[`${s.k}.${a}`] = n;
|
|
2504
|
-
},
|
|
2505
|
-
let { obj: i, k: a } =
|
|
2537
|
+
}, ji = (e, t, n, r) => {
|
|
2538
|
+
let { obj: i, k: a } = ki(e, t, Object);
|
|
2506
2539
|
i[a] = i[a] || [], i[a].push(n);
|
|
2507
|
-
},
|
|
2508
|
-
let { obj: n, k: r } =
|
|
2540
|
+
}, Mi = (e, t) => {
|
|
2541
|
+
let { obj: n, k: r } = ki(e, t);
|
|
2509
2542
|
if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
|
|
2510
|
-
},
|
|
2511
|
-
let r =
|
|
2512
|
-
return r === void 0 ?
|
|
2513
|
-
},
|
|
2514
|
-
for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? Z(e[r]) || e[r] instanceof String || Z(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) :
|
|
2543
|
+
}, Ni = (e, t, n) => {
|
|
2544
|
+
let r = Mi(e, n);
|
|
2545
|
+
return r === void 0 ? Mi(t, n) : r;
|
|
2546
|
+
}, Pi = (e, t, n) => {
|
|
2547
|
+
for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? Z(e[r]) || e[r] instanceof String || Z(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : Pi(e[r], t[r], n) : e[r] = t[r]);
|
|
2515
2548
|
return e;
|
|
2516
|
-
},
|
|
2549
|
+
}, Fi = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), Ii = {
|
|
2517
2550
|
"&": "&",
|
|
2518
2551
|
"<": "<",
|
|
2519
2552
|
">": ">",
|
|
2520
2553
|
"\"": """,
|
|
2521
2554
|
"'": "'",
|
|
2522
2555
|
"/": "/"
|
|
2523
|
-
},
|
|
2556
|
+
}, Li = (e) => Z(e) ? e.replace(/[&<>"'\/]/g, (e) => Ii[e]) : e, Ri = class {
|
|
2524
2557
|
constructor(e) {
|
|
2525
2558
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
2526
2559
|
}
|
|
@@ -2530,23 +2563,23 @@ var ti = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ni = /<
|
|
|
2530
2563
|
let n = new RegExp(e);
|
|
2531
2564
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
|
|
2532
2565
|
}
|
|
2533
|
-
},
|
|
2566
|
+
}, zi = [
|
|
2534
2567
|
" ",
|
|
2535
2568
|
",",
|
|
2536
2569
|
"?",
|
|
2537
2570
|
"!",
|
|
2538
2571
|
";"
|
|
2539
|
-
],
|
|
2572
|
+
], Bi = new Ri(20), Vi = (e, t, n) => {
|
|
2540
2573
|
t ||= "", n ||= "";
|
|
2541
|
-
let r =
|
|
2574
|
+
let r = zi.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
|
|
2542
2575
|
if (r.length === 0) return !0;
|
|
2543
|
-
let i =
|
|
2576
|
+
let i = Bi.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
|
|
2544
2577
|
if (!a) {
|
|
2545
2578
|
let t = e.indexOf(n);
|
|
2546
2579
|
t > 0 && !i.test(e.substring(0, t)) && (a = !0);
|
|
2547
2580
|
}
|
|
2548
2581
|
return a;
|
|
2549
|
-
},
|
|
2582
|
+
}, Hi = (e, t, n = ".") => {
|
|
2550
2583
|
if (!e) return;
|
|
2551
2584
|
if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
2552
2585
|
let r = t.split(n), i = e;
|
|
@@ -2565,7 +2598,7 @@ var ti = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ni = /<
|
|
|
2565
2598
|
i = t;
|
|
2566
2599
|
}
|
|
2567
2600
|
return i;
|
|
2568
|
-
},
|
|
2601
|
+
}, Ui = (e) => e?.replace(/_/g, "-"), Wi = {
|
|
2569
2602
|
type: "logger",
|
|
2570
2603
|
log(e) {
|
|
2571
2604
|
this.output("log", e);
|
|
@@ -2584,7 +2617,7 @@ var ti = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ni = /<
|
|
|
2584
2617
|
this.init(e, t);
|
|
2585
2618
|
}
|
|
2586
2619
|
init(e, t = {}) {
|
|
2587
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
2620
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || Wi, this.options = t, this.debug = t.debug;
|
|
2588
2621
|
}
|
|
2589
2622
|
log(...e) {
|
|
2590
2623
|
return this.forward(e, "log", "", !0);
|
|
@@ -2610,7 +2643,7 @@ var ti = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ni = /<
|
|
|
2610
2643
|
clone(t) {
|
|
2611
2644
|
return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
|
|
2612
2645
|
}
|
|
2613
|
-
}(),
|
|
2646
|
+
}(), Gi = class {
|
|
2614
2647
|
constructor() {
|
|
2615
2648
|
this.observers = {};
|
|
2616
2649
|
}
|
|
@@ -2637,7 +2670,7 @@ var ti = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ni = /<
|
|
|
2637
2670
|
for (let i = 0; i < r; i++) n.apply(n, [e, ...t]);
|
|
2638
2671
|
});
|
|
2639
2672
|
}
|
|
2640
|
-
},
|
|
2673
|
+
}, Ki = class extends Gi {
|
|
2641
2674
|
constructor(e, t = {
|
|
2642
2675
|
ns: ["translation"],
|
|
2643
2676
|
defaultNS: "translation"
|
|
@@ -2654,12 +2687,12 @@ var ti = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ni = /<
|
|
|
2654
2687
|
getResource(e, t, n, r = {}) {
|
|
2655
2688
|
let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
|
|
2656
2689
|
e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : Z(n) && i ? o.push(...n.split(i)) : o.push(n)));
|
|
2657
|
-
let s =
|
|
2658
|
-
return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !Z(n) ? s :
|
|
2690
|
+
let s = Mi(this.data, o);
|
|
2691
|
+
return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !Z(n) ? s : Hi(this.data?.[e]?.[t], n, i);
|
|
2659
2692
|
}
|
|
2660
2693
|
addResource(e, t, n, r, i = { silent: !1 }) {
|
|
2661
2694
|
let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
|
|
2662
|
-
n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t),
|
|
2695
|
+
n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), Ai(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
|
|
2663
2696
|
}
|
|
2664
2697
|
addResources(e, t, n, r = { silent: !1 }) {
|
|
2665
2698
|
for (let r in n) (Z(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
|
|
@@ -2671,11 +2704,11 @@ var ti = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ni = /<
|
|
|
2671
2704
|
}) {
|
|
2672
2705
|
let o = [e, t];
|
|
2673
2706
|
e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
|
|
2674
|
-
let s =
|
|
2675
|
-
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ?
|
|
2707
|
+
let s = Mi(this.data, o) || {};
|
|
2708
|
+
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? Pi(s, n, i) : s = {
|
|
2676
2709
|
...s,
|
|
2677
2710
|
...n
|
|
2678
|
-
},
|
|
2711
|
+
}, Ai(this.data, o, s), a.silent || this.emit("added", e, t, n);
|
|
2679
2712
|
}
|
|
2680
2713
|
removeResourceBundle(e, t) {
|
|
2681
2714
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -2696,7 +2729,7 @@ var ti = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ni = /<
|
|
|
2696
2729
|
toJSON() {
|
|
2697
2730
|
return this.data;
|
|
2698
2731
|
}
|
|
2699
|
-
},
|
|
2732
|
+
}, qi = {
|
|
2700
2733
|
processors: {},
|
|
2701
2734
|
addPostProcessor(e) {
|
|
2702
2735
|
this.processors[e.name] = e;
|
|
@@ -2706,22 +2739,22 @@ var ti = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ni = /<
|
|
|
2706
2739
|
t = this.processors[e]?.process(t, n, r, i) ?? t;
|
|
2707
2740
|
}), t;
|
|
2708
2741
|
}
|
|
2709
|
-
},
|
|
2710
|
-
function
|
|
2742
|
+
}, Ji = Symbol("i18next/PATH_KEY");
|
|
2743
|
+
function Yi() {
|
|
2711
2744
|
let e = [], t = Object.create(null), n;
|
|
2712
|
-
return t.get = (r, i) => (n?.revoke?.(), i ===
|
|
2745
|
+
return t.get = (r, i) => (n?.revoke?.(), i === Ji ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
|
|
2713
2746
|
}
|
|
2714
|
-
function
|
|
2715
|
-
let { [
|
|
2747
|
+
function Xi(e, t) {
|
|
2748
|
+
let { [Ji]: n } = e(Yi()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
|
|
2716
2749
|
if (n.length > 1 && i) {
|
|
2717
2750
|
let e = t?.ns, a = Array.isArray(e) ? e : null;
|
|
2718
2751
|
if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
|
|
2719
2752
|
}
|
|
2720
2753
|
return n.join(r);
|
|
2721
2754
|
}
|
|
2722
|
-
var
|
|
2755
|
+
var Zi = {}, Qi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number", $i = class e extends Gi {
|
|
2723
2756
|
constructor(e, t = {}) {
|
|
2724
|
-
super(),
|
|
2757
|
+
super(), Ti([
|
|
2725
2758
|
"resourceStore",
|
|
2726
2759
|
"languageUtils",
|
|
2727
2760
|
"pluralResolver",
|
|
@@ -2739,13 +2772,13 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2739
2772
|
if (e == null) return !1;
|
|
2740
2773
|
let r = this.resolve(e, n);
|
|
2741
2774
|
if (r?.res === void 0) return !1;
|
|
2742
|
-
let i =
|
|
2775
|
+
let i = Qi(r.res);
|
|
2743
2776
|
return !(n.returnObjects === !1 && i);
|
|
2744
2777
|
}
|
|
2745
2778
|
extractFromKey(e, t) {
|
|
2746
2779
|
let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
|
|
2747
2780
|
n === void 0 && (n = ":");
|
|
2748
|
-
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 && !
|
|
2781
|
+
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 && !Vi(e, n, r);
|
|
2749
2782
|
if (a && !o) {
|
|
2750
2783
|
let t = e.match(this.interpolator.nestingRegexp);
|
|
2751
2784
|
if (t && t.length > 0) return {
|
|
@@ -2763,10 +2796,10 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2763
2796
|
translate(t, n, r) {
|
|
2764
2797
|
let i = typeof n == "object" ? { ...n } : n;
|
|
2765
2798
|
if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
|
|
2766
|
-
typeof t == "function" && (t =
|
|
2799
|
+
typeof t == "function" && (t = Xi(t, {
|
|
2767
2800
|
...this.options,
|
|
2768
2801
|
...i
|
|
2769
|
-
})), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ?
|
|
2802
|
+
})), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? Xi(e, {
|
|
2770
2803
|
...this.options,
|
|
2771
2804
|
...i
|
|
2772
2805
|
}) : String(e));
|
|
@@ -2794,7 +2827,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2794
2827
|
"[object RegExp]"
|
|
2795
2828
|
], _ = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, v = !this.i18nFormat || this.i18nFormat.handleAsObject, y = i.count !== void 0 && !Z(i.count), b = e.hasDefaultValue(i), te = y ? this.pluralResolver.getSuffix(d, i.count, i) : "", ne = i.ordinal && y ? this.pluralResolver.getSuffix(d, i.count, { ordinal: !1 }) : "", re = y && !i.ordinal && i.count === 0, x = re && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${te}`] || i[`defaultValue${ne}`] || i.defaultValue, S = m;
|
|
2796
2829
|
v && !m && b && (S = x);
|
|
2797
|
-
let ie =
|
|
2830
|
+
let ie = Qi(S), ae = Object.prototype.toString.apply(S);
|
|
2798
2831
|
if (v && S && ie && ee.indexOf(ae) < 0 && !(Z(_) && Array.isArray(S))) {
|
|
2799
2832
|
if (!i.returnObjects && !this.options.returnObjects) {
|
|
2800
2833
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
@@ -2810,7 +2843,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2810
2843
|
let r = `${n}${o}${e}`;
|
|
2811
2844
|
b && !m ? t[e] = this.translate(r, {
|
|
2812
2845
|
...i,
|
|
2813
|
-
defaultValue:
|
|
2846
|
+
defaultValue: Qi(x) ? x[e] : void 0,
|
|
2814
2847
|
joinArrays: !1,
|
|
2815
2848
|
ns: c
|
|
2816
2849
|
}) : t[e] = this.translate(r, {
|
|
@@ -2881,7 +2914,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2881
2914
|
!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();
|
|
2882
2915
|
}
|
|
2883
2916
|
let a = n.postProcess || this.options.postProcess, o = Z(a) ? [a] : a;
|
|
2884
|
-
return e != null && o?.length && n.applyPostProcessor !== !1 && (e =
|
|
2917
|
+
return e != null && o?.length && n.applyPostProcessor !== !1 && (e = qi.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
2885
2918
|
i18nResolved: {
|
|
2886
2919
|
...r,
|
|
2887
2920
|
usedParams: this.getUsedParamsDetails(n)
|
|
@@ -2891,7 +2924,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2891
2924
|
}
|
|
2892
2925
|
resolve(e, t = {}) {
|
|
2893
2926
|
let n, r, i, a, o;
|
|
2894
|
-
return Z(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ?
|
|
2927
|
+
return Z(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? Xi(e, {
|
|
2895
2928
|
...this.options,
|
|
2896
2929
|
...t
|
|
2897
2930
|
}) : e)), e.forEach((e) => {
|
|
@@ -2902,7 +2935,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2902
2935
|
this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
|
|
2903
2936
|
let u = t.count !== void 0 && !Z(t.count), d = u && !t.ordinal && t.count === 0, f = t.context !== void 0 && (Z(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
2904
2937
|
l.forEach((e) => {
|
|
2905
|
-
this.isValidLookup(n) || (o = e, !
|
|
2938
|
+
this.isValidLookup(n) || (o = e, !Zi[`${p[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (Zi[`${p[0]}-${e}`] = !0, this.logger.warn(`key "${r}" for languages "${p.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!!!")), p.forEach((r) => {
|
|
2906
2939
|
if (this.isValidLookup(n)) return;
|
|
2907
2940
|
a = r;
|
|
2908
2941
|
let o = [c];
|
|
@@ -2965,17 +2998,17 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2965
2998
|
for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.substring(0, 12) === "defaultValue" && e[t] !== void 0) return !0;
|
|
2966
2999
|
return !1;
|
|
2967
3000
|
}
|
|
2968
|
-
},
|
|
3001
|
+
}, ea = class {
|
|
2969
3002
|
constructor(e) {
|
|
2970
3003
|
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = Q.create("languageUtils");
|
|
2971
3004
|
}
|
|
2972
3005
|
getScriptPartFromCode(e) {
|
|
2973
|
-
if (e =
|
|
3006
|
+
if (e = Ui(e), !e || e.indexOf("-") < 0) return null;
|
|
2974
3007
|
let t = e.split("-");
|
|
2975
3008
|
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
2976
3009
|
}
|
|
2977
3010
|
getLanguagePartFromCode(e) {
|
|
2978
|
-
if (e =
|
|
3011
|
+
if (e = Ui(e), !e || e.indexOf("-") < 0) return e;
|
|
2979
3012
|
let t = e.split("-");
|
|
2980
3013
|
return this.formatLanguageCode(t[0]);
|
|
2981
3014
|
}
|
|
@@ -3025,17 +3058,17 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3025
3058
|
r.indexOf(e) < 0 && i(this.formatLanguageCode(e));
|
|
3026
3059
|
}), r;
|
|
3027
3060
|
}
|
|
3028
|
-
},
|
|
3061
|
+
}, ta = {
|
|
3029
3062
|
zero: 0,
|
|
3030
3063
|
one: 1,
|
|
3031
3064
|
two: 2,
|
|
3032
3065
|
few: 3,
|
|
3033
3066
|
many: 4,
|
|
3034
3067
|
other: 5
|
|
3035
|
-
},
|
|
3068
|
+
}, na = {
|
|
3036
3069
|
select: (e) => e === 1 ? "one" : "other",
|
|
3037
3070
|
resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
|
|
3038
|
-
},
|
|
3071
|
+
}, ra = class {
|
|
3039
3072
|
constructor(e, t = {}) {
|
|
3040
3073
|
this.languageUtils = e, this.options = t, this.logger = Q.create("pluralResolver"), this.pluralRulesCache = {};
|
|
3041
3074
|
}
|
|
@@ -3043,7 +3076,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3043
3076
|
this.pluralRulesCache = {};
|
|
3044
3077
|
}
|
|
3045
3078
|
getRule(e, t = {}) {
|
|
3046
|
-
let n =
|
|
3079
|
+
let n = Ui(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
|
|
3047
3080
|
cleanedCode: n,
|
|
3048
3081
|
type: r
|
|
3049
3082
|
});
|
|
@@ -3052,8 +3085,8 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3052
3085
|
try {
|
|
3053
3086
|
a = new Intl.PluralRules(n, { type: r });
|
|
3054
3087
|
} catch {
|
|
3055
|
-
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
3056
|
-
if (!e.match(/-|_/)) return
|
|
3088
|
+
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), na;
|
|
3089
|
+
if (!e.match(/-|_/)) return na;
|
|
3057
3090
|
let n = this.languageUtils.getLanguagePartFromCode(e);
|
|
3058
3091
|
a = this.getRule(n, t);
|
|
3059
3092
|
}
|
|
@@ -3068,23 +3101,23 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3068
3101
|
}
|
|
3069
3102
|
getSuffixes(e, t = {}) {
|
|
3070
3103
|
let n = this.getRule(e, t);
|
|
3071
|
-
return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) =>
|
|
3104
|
+
return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => ta[e] - ta[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
|
|
3072
3105
|
}
|
|
3073
3106
|
getSuffix(e, t, n = {}) {
|
|
3074
3107
|
let r = this.getRule(e, n);
|
|
3075
3108
|
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));
|
|
3076
3109
|
}
|
|
3077
|
-
},
|
|
3078
|
-
let a =
|
|
3079
|
-
return !a && i && Z(n) && (a =
|
|
3080
|
-
},
|
|
3110
|
+
}, ia = (e, t, n, r = ".", i = !0) => {
|
|
3111
|
+
let a = Ni(e, t, n);
|
|
3112
|
+
return !a && i && Z(n) && (a = Hi(e, n, r), a === void 0 && (a = Hi(t, n, r))), a;
|
|
3113
|
+
}, aa = (e) => e.replace(/\$/g, "$$$$"), oa = class {
|
|
3081
3114
|
constructor(e = {}) {
|
|
3082
3115
|
this.logger = Q.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
|
|
3083
3116
|
}
|
|
3084
3117
|
init(e = {}) {
|
|
3085
3118
|
e.interpolation ||= { escapeValue: !0 };
|
|
3086
3119
|
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: ee } = e.interpolation;
|
|
3087
|
-
this.escape = t === void 0 ?
|
|
3120
|
+
this.escape = t === void 0 ? Li : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? Fi(i) : a || "{{", this.suffix = o ? Fi(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? Fi(d) : f || Fi("$t("), this.nestingSuffix = p ? Fi(p) : m || Fi(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = ee !== void 0 && ee, this.resetRegExp();
|
|
3088
3121
|
}
|
|
3089
3122
|
reset() {
|
|
3090
3123
|
this.options && this.init(this.options);
|
|
@@ -3096,7 +3129,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3096
3129
|
interpolate(e, t, n, r) {
|
|
3097
3130
|
let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
|
|
3098
3131
|
if (e.indexOf(this.formatSeparator) < 0) {
|
|
3099
|
-
let i =
|
|
3132
|
+
let i = ia(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
3100
3133
|
return this.alwaysFormat ? this.format(i, void 0, n, {
|
|
3101
3134
|
...r,
|
|
3102
3135
|
...t,
|
|
@@ -3104,7 +3137,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3104
3137
|
}) : i;
|
|
3105
3138
|
}
|
|
3106
3139
|
let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
|
|
3107
|
-
return this.format(
|
|
3140
|
+
return this.format(ia(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
|
|
3108
3141
|
...r,
|
|
3109
3142
|
...t,
|
|
3110
3143
|
interpolationkey: a
|
|
@@ -3114,10 +3147,10 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3114
3147
|
let l = r?.missingInterpolationHandler || this.options.missingInterpolationHandler, u = r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables;
|
|
3115
3148
|
return [{
|
|
3116
3149
|
regex: this.regexpUnescape,
|
|
3117
|
-
safeValue: (e) =>
|
|
3150
|
+
safeValue: (e) => aa(e)
|
|
3118
3151
|
}, {
|
|
3119
3152
|
regex: this.regexp,
|
|
3120
|
-
safeValue: (e) => this.escapeValue ?
|
|
3153
|
+
safeValue: (e) => this.escapeValue ? aa(this.escape(e)) : aa(e)
|
|
3121
3154
|
}].forEach((t) => {
|
|
3122
3155
|
for (o = 0; i = t.regex.exec(e);) {
|
|
3123
3156
|
let n = i[1].trim();
|
|
@@ -3129,7 +3162,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3129
3162
|
a = i[0];
|
|
3130
3163
|
continue;
|
|
3131
3164
|
} else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
|
|
3132
|
-
else !Z(a) && !this.useRawValueToEscape && (a =
|
|
3165
|
+
else !Z(a) && !this.useRawValueToEscape && (a = wi(a));
|
|
3133
3166
|
let s = t.safeValue(a);
|
|
3134
3167
|
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;
|
|
3135
3168
|
}
|
|
@@ -3139,7 +3172,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3139
3172
|
let r, i, a, o = (e, t) => {
|
|
3140
3173
|
let n = this.nestingOptionsSeparator;
|
|
3141
3174
|
if (e.indexOf(n) < 0) return e;
|
|
3142
|
-
let r = e.split(RegExp(`${
|
|
3175
|
+
let r = e.split(RegExp(`${Fi(n)}[ ]*{`)), i = `{${r[1]}`;
|
|
3143
3176
|
e = r[0], i = this.interpolate(i, a);
|
|
3144
3177
|
let o = i.match(/'/g), s = i.match(/"/g);
|
|
3145
3178
|
((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
|
|
@@ -3158,14 +3191,14 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3158
3191
|
a = { ...n }, a = a.replace && !Z(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
3159
3192
|
let c = /{.*}/.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
|
|
3160
3193
|
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 && !Z(i)) return i;
|
|
3161
|
-
Z(i) || (i =
|
|
3194
|
+
Z(i) || (i = wi(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, {
|
|
3162
3195
|
...n,
|
|
3163
3196
|
interpolationkey: r[1].trim()
|
|
3164
3197
|
}), i.trim())), e = e.replace(r[0], i), this.regexp.lastIndex = 0;
|
|
3165
3198
|
}
|
|
3166
3199
|
return e;
|
|
3167
3200
|
}
|
|
3168
|
-
},
|
|
3201
|
+
}, sa = (e) => {
|
|
3169
3202
|
let t = e.toLowerCase().trim(), n = {};
|
|
3170
3203
|
if (e.indexOf("(") > -1) {
|
|
3171
3204
|
let r = e.split("(");
|
|
@@ -3182,7 +3215,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3182
3215
|
formatName: t,
|
|
3183
3216
|
formatOptions: n
|
|
3184
3217
|
};
|
|
3185
|
-
},
|
|
3218
|
+
}, ca = (e) => {
|
|
3186
3219
|
let t = {};
|
|
3187
3220
|
return (n, r, i) => {
|
|
3188
3221
|
let a = i;
|
|
@@ -3191,15 +3224,15 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3191
3224
|
[i.interpolationkey]: void 0
|
|
3192
3225
|
});
|
|
3193
3226
|
let o = r + JSON.stringify(a), s = t[o];
|
|
3194
|
-
return s || (s = e(
|
|
3227
|
+
return s || (s = e(Ui(r), i), t[o] = s), s(n);
|
|
3195
3228
|
};
|
|
3196
|
-
},
|
|
3229
|
+
}, la = (e) => (t, n, r) => e(Ui(n), r)(t), ua = class {
|
|
3197
3230
|
constructor(e = {}) {
|
|
3198
3231
|
this.logger = Q.create("formatter"), this.options = e, this.init(e);
|
|
3199
3232
|
}
|
|
3200
3233
|
init(e, t = { interpolation: {} }) {
|
|
3201
3234
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
3202
|
-
let n = t.cacheInBuiltFormats ?
|
|
3235
|
+
let n = t.cacheInBuiltFormats ? ca : la;
|
|
3203
3236
|
this.formats = {
|
|
3204
3237
|
number: n((e, t) => {
|
|
3205
3238
|
let n = new Intl.NumberFormat(e, { ...t });
|
|
@@ -3230,7 +3263,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3230
3263
|
this.formats[e.toLowerCase().trim()] = t;
|
|
3231
3264
|
}
|
|
3232
3265
|
addCached(e, t) {
|
|
3233
|
-
this.formats[e.toLowerCase().trim()] =
|
|
3266
|
+
this.formats[e.toLowerCase().trim()] = ca(t);
|
|
3234
3267
|
}
|
|
3235
3268
|
format(e, t, n, r = {}) {
|
|
3236
3269
|
let i = t.split(this.formatSeparator);
|
|
@@ -3239,7 +3272,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3239
3272
|
i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
|
|
3240
3273
|
}
|
|
3241
3274
|
return i.reduce((e, t) => {
|
|
3242
|
-
let { formatName: i, formatOptions: a } =
|
|
3275
|
+
let { formatName: i, formatOptions: a } = sa(t);
|
|
3243
3276
|
if (this.formats[i]) {
|
|
3244
3277
|
let t = e;
|
|
3245
3278
|
try {
|
|
@@ -3257,9 +3290,9 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3257
3290
|
return e;
|
|
3258
3291
|
}, e);
|
|
3259
3292
|
}
|
|
3260
|
-
},
|
|
3293
|
+
}, da = (e, t) => {
|
|
3261
3294
|
e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
|
|
3262
|
-
},
|
|
3295
|
+
}, fa = class extends Gi {
|
|
3263
3296
|
constructor(e, t, n, r = {}) {
|
|
3264
3297
|
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = Q.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);
|
|
3265
3298
|
}
|
|
@@ -3289,7 +3322,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3289
3322
|
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);
|
|
3290
3323
|
let o = {};
|
|
3291
3324
|
this.queue.forEach((n) => {
|
|
3292
|
-
|
|
3325
|
+
ji(n.loaded, [i], a), da(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
|
|
3293
3326
|
o[e] || (o[e] = {});
|
|
3294
3327
|
let t = n.loaded[e];
|
|
3295
3328
|
t.length && t.forEach((t) => {
|
|
@@ -3379,7 +3412,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3379
3412
|
!e || !e[0] || this.store.addResource(e[0], t, n, r);
|
|
3380
3413
|
}
|
|
3381
3414
|
}
|
|
3382
|
-
},
|
|
3415
|
+
}, pa = () => ({
|
|
3383
3416
|
debug: !1,
|
|
3384
3417
|
initAsync: !0,
|
|
3385
3418
|
ns: ["translation"],
|
|
@@ -3436,15 +3469,15 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3436
3469
|
skipOnVariables: !0
|
|
3437
3470
|
},
|
|
3438
3471
|
cacheInBuiltFormats: !0
|
|
3439
|
-
}),
|
|
3472
|
+
}), ma = (e) => (Z(e.ns) && (e.ns = [e.ns]), Z(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), Z(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), ha = () => {}, ga = (e) => {
|
|
3440
3473
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
|
|
3441
3474
|
typeof e[t] == "function" && (e[t] = e[t].bind(e));
|
|
3442
3475
|
});
|
|
3443
|
-
},
|
|
3444
|
-
typeof globalThis < "u" && (globalThis[
|
|
3445
|
-
},
|
|
3476
|
+
}, _a = "__i18next_supportNoticeShown", va = () => !!(typeof globalThis < "u" && globalThis[_a] || typeof process < "u" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE || typeof process < "u" && process.env), ya = () => {
|
|
3477
|
+
typeof globalThis < "u" && (globalThis[_a] = !0);
|
|
3478
|
+
}, ba = (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)), $ = class e extends Gi {
|
|
3446
3479
|
constructor(e = {}, t) {
|
|
3447
|
-
if (super(), this.options =
|
|
3480
|
+
if (super(), this.options = ma(e), this.services = {}, this.logger = Q, this.modules = { external: [] }, ga(this), t && !this.isInitialized && !e.isClone) {
|
|
3448
3481
|
if (!this.options.initAsync) return this.init(e, t), this;
|
|
3449
3482
|
setTimeout(() => {
|
|
3450
3483
|
this.init(e, t);
|
|
@@ -3453,35 +3486,35 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3453
3486
|
}
|
|
3454
3487
|
init(e = {}, t) {
|
|
3455
3488
|
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (Z(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
|
|
3456
|
-
let n =
|
|
3489
|
+
let n = pa();
|
|
3457
3490
|
this.options = {
|
|
3458
3491
|
...n,
|
|
3459
3492
|
...this.options,
|
|
3460
|
-
|
|
3493
|
+
...ma(e)
|
|
3461
3494
|
}, this.options.interpolation = {
|
|
3462
3495
|
...n.interpolation,
|
|
3463
3496
|
...this.options.interpolation
|
|
3464
|
-
}, 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 && !
|
|
3497
|
+
}, 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 && !ba(this) && !va() && (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 💙"), ya());
|
|
3465
3498
|
let r = (e) => e ? typeof e == "function" ? new e() : e : null;
|
|
3466
3499
|
if (!this.options.isClone) {
|
|
3467
3500
|
this.modules.logger ? Q.init(r(this.modules.logger), this.options) : Q.init(null, this.options);
|
|
3468
3501
|
let e;
|
|
3469
|
-
e = this.modules.formatter ? this.modules.formatter :
|
|
3470
|
-
let t = new
|
|
3471
|
-
this.store = new
|
|
3502
|
+
e = this.modules.formatter ? this.modules.formatter : ua;
|
|
3503
|
+
let t = new ea(this.options);
|
|
3504
|
+
this.store = new Ki(this.options.resources, this.options);
|
|
3472
3505
|
let i = this.services;
|
|
3473
|
-
i.logger = Q, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new
|
|
3506
|
+
i.logger = Q, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new ra(t, {
|
|
3474
3507
|
prepend: this.options.pluralSeparator,
|
|
3475
3508
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
3476
|
-
}), 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
|
|
3509
|
+
}), 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 oa(this.options), i.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i.backendConnector = new fa(r(this.modules.backend), i.resourceStore, i, this.options), i.backendConnector.on("*", (e, ...t) => {
|
|
3477
3510
|
this.emit(e, ...t);
|
|
3478
|
-
}), 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
|
|
3511
|
+
}), 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 $i(this.services, this.options), this.translator.on("*", (e, ...t) => {
|
|
3479
3512
|
this.emit(e, ...t);
|
|
3480
3513
|
}), this.modules.external.forEach((e) => {
|
|
3481
3514
|
e.init && e.init(this);
|
|
3482
3515
|
});
|
|
3483
3516
|
}
|
|
3484
|
-
if (this.format = this.options.interpolation.format, t ||=
|
|
3517
|
+
if (this.format = this.options.interpolation.format, t ||= ha, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
3485
3518
|
let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
3486
3519
|
e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
|
|
3487
3520
|
}
|
|
@@ -3500,7 +3533,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3500
3533
|
].forEach((e) => {
|
|
3501
3534
|
this[e] = (...t) => (this.store[e](...t), this);
|
|
3502
3535
|
});
|
|
3503
|
-
let i =
|
|
3536
|
+
let i = Ci(), a = () => {
|
|
3504
3537
|
let e = (e, n) => {
|
|
3505
3538
|
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);
|
|
3506
3539
|
};
|
|
@@ -3509,7 +3542,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3509
3542
|
};
|
|
3510
3543
|
return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
|
|
3511
3544
|
}
|
|
3512
|
-
loadResources(e, t =
|
|
3545
|
+
loadResources(e, t = ha) {
|
|
3513
3546
|
let n = t, r = Z(e) ? e : this.language;
|
|
3514
3547
|
if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
3515
3548
|
if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
|
|
@@ -3524,15 +3557,15 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3524
3557
|
} else n(null);
|
|
3525
3558
|
}
|
|
3526
3559
|
reloadResources(e, t, n) {
|
|
3527
|
-
let r =
|
|
3528
|
-
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 ||=
|
|
3560
|
+
let r = Ci();
|
|
3561
|
+
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 ||= ha, this.services.backendConnector.reload(e, t, (e) => {
|
|
3529
3562
|
r.resolve(), n(e);
|
|
3530
3563
|
}), r;
|
|
3531
3564
|
}
|
|
3532
3565
|
use(e) {
|
|
3533
3566
|
if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
3534
3567
|
if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
3535
|
-
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" &&
|
|
3568
|
+
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" && qi.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
3536
3569
|
}
|
|
3537
3570
|
setResolvedLanguage(e) {
|
|
3538
3571
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
|
|
@@ -3548,7 +3581,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3548
3581
|
}
|
|
3549
3582
|
changeLanguage(e, t) {
|
|
3550
3583
|
this.isLanguageChangingTo = e;
|
|
3551
|
-
let n =
|
|
3584
|
+
let n = Ci();
|
|
3552
3585
|
this.emit("languageChanging", e);
|
|
3553
3586
|
let r = (e) => {
|
|
3554
3587
|
this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
|
|
@@ -3571,9 +3604,9 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3571
3604
|
...this.options,
|
|
3572
3605
|
...a
|
|
3573
3606
|
};
|
|
3574
|
-
typeof a.keyPrefix == "function" && (a.keyPrefix =
|
|
3607
|
+
typeof a.keyPrefix == "function" && (a.keyPrefix = Xi(a.keyPrefix, o));
|
|
3575
3608
|
let s = this.options.keySeparator || ".", c;
|
|
3576
|
-
return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e =
|
|
3609
|
+
return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = Xi(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = Xi(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
|
|
3577
3610
|
};
|
|
3578
3611
|
return Z(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = n, r;
|
|
3579
3612
|
}
|
|
@@ -3602,7 +3635,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3602
3635
|
return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
|
|
3603
3636
|
}
|
|
3604
3637
|
loadNamespaces(e, t) {
|
|
3605
|
-
let n =
|
|
3638
|
+
let n = Ci();
|
|
3606
3639
|
return this.options.ns ? (Z(e) && (e = [e]), e.forEach((e) => {
|
|
3607
3640
|
this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
|
|
3608
3641
|
}), this.loadResources((e) => {
|
|
@@ -3610,7 +3643,7 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3610
3643
|
}), n) : (t && t(), Promise.resolve());
|
|
3611
3644
|
}
|
|
3612
3645
|
loadLanguages(e, t) {
|
|
3613
|
-
let n =
|
|
3646
|
+
let n = Ci();
|
|
3614
3647
|
Z(e) && (e = [e]);
|
|
3615
3648
|
let r = this.options.preload || [], i = e.filter((e) => r.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
|
|
3616
3649
|
return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
|
|
@@ -3626,14 +3659,14 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3626
3659
|
if (e && e.direction) return e.direction;
|
|
3627
3660
|
}
|
|
3628
3661
|
} catch {}
|
|
3629
|
-
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
|
|
3662
|
+
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 ea(pa());
|
|
3630
3663
|
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
3631
3664
|
}
|
|
3632
3665
|
static createInstance(t = {}, n) {
|
|
3633
3666
|
let r = new e(t, n);
|
|
3634
3667
|
return r.createInstance = e.createInstance, r;
|
|
3635
3668
|
}
|
|
3636
|
-
cloneInstance(t = {}, n =
|
|
3669
|
+
cloneInstance(t = {}, n = ha) {
|
|
3637
3670
|
let r = t.forkResourceStore;
|
|
3638
3671
|
r && delete t.forkResourceStore;
|
|
3639
3672
|
let i = {
|
|
@@ -3647,18 +3680,18 @@ var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3647
3680
|
"language"
|
|
3648
3681
|
].forEach((e) => {
|
|
3649
3682
|
a[e] = this[e];
|
|
3650
|
-
}), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new
|
|
3683
|
+
}), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new Ki(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) {
|
|
3651
3684
|
let e = {
|
|
3652
|
-
...
|
|
3685
|
+
...pa().interpolation,
|
|
3653
3686
|
...this.options.interpolation,
|
|
3654
3687
|
...t.interpolation
|
|
3655
3688
|
}, n = {
|
|
3656
3689
|
...i,
|
|
3657
3690
|
interpolation: e
|
|
3658
3691
|
};
|
|
3659
|
-
a.services.interpolator = new
|
|
3692
|
+
a.services.interpolator = new oa(n);
|
|
3660
3693
|
}
|
|
3661
|
-
return a.translator = new
|
|
3694
|
+
return a.translator = new $i(a.services, i), a.translator.on("*", (e, ...t) => {
|
|
3662
3695
|
a.emit(e, ...t);
|
|
3663
3696
|
}), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
|
|
3664
3697
|
}
|
|
@@ -3679,13 +3712,13 @@ $.createInstance, $.dir, $.init, $.loadResources, $.reloadResources, $.use, $.ch
|
|
|
3679
3712
|
lng: "en",
|
|
3680
3713
|
showSupportNotice: !1,
|
|
3681
3714
|
resources: {
|
|
3682
|
-
en:
|
|
3683
|
-
es:
|
|
3715
|
+
en: xi,
|
|
3716
|
+
es: Si
|
|
3684
3717
|
}
|
|
3685
3718
|
});
|
|
3686
3719
|
//#endregion
|
|
3687
3720
|
//#region src/i18n.ts
|
|
3688
|
-
var { translator:
|
|
3721
|
+
var { translator: xa } = {
|
|
3689
3722
|
translator: {
|
|
3690
3723
|
...$,
|
|
3691
3724
|
t: (e, t) => {
|
|
@@ -3717,23 +3750,23 @@ var { translator: oa } = {
|
|
|
3717
3750
|
label: "Spanish"
|
|
3718
3751
|
}]
|
|
3719
3752
|
};
|
|
3720
|
-
function
|
|
3721
|
-
return
|
|
3753
|
+
function Sa(e, t) {
|
|
3754
|
+
return xa.t(`translation:simpleCloze:${e}`, { lng: t });
|
|
3722
3755
|
}
|
|
3723
3756
|
//#endregion
|
|
3724
3757
|
//#region src/print/Print.svelte
|
|
3725
|
-
var
|
|
3758
|
+
var Ca = /* @__PURE__ */ cr("<div class=\"simple-cloze-print-teacher-instructions svelte-1fx5wwa\"></div>"), wa = /* @__PURE__ */ cr("<div class=\"simple-cloze-print-prompt svelte-1fx5wwa\"></div>"), Ta = /* @__PURE__ */ cr("<span class=\"simple-cloze-print-key-label svelte-1fx5wwa\"> </span> <span class=\"simple-cloze-print-blank simple-cloze-print-blank--key svelte-1fx5wwa\"> </span>", 1), Ea = /* @__PURE__ */ cr("<span class=\"simple-cloze-print-blank svelte-1fx5wwa\" role=\"img\"></span>"), Da = /* @__PURE__ */ cr("<div class=\"simple-cloze-print svelte-1fx5wwa\"><!> <!> <div class=\"simple-cloze-print-response svelte-1fx5wwa\"><!></div></div>"), Oa = {
|
|
3726
3759
|
hash: "svelte-1fx5wwa",
|
|
3727
3760
|
code: "\n /* Self-contained: print players ship no Tailwind or CSS reset. */.simple-cloze-print.svelte-1fx5wwa {padding:1rem;color:var(--pie-text, black);}.simple-cloze-print-teacher-instructions.svelte-1fx5wwa,\n .simple-cloze-print-prompt.svelte-1fx5wwa {margin-bottom:1rem;}.simple-cloze-print-teacher-instructions.svelte-1fx5wwa p,\n .simple-cloze-print-prompt.svelte-1fx5wwa p {margin:0.5em 0;}.simple-cloze-print-prompt.svelte-1fx5wwa strong {font-weight:600;}.simple-cloze-print-response.svelte-1fx5wwa {display:inline-flex;align-items:baseline;gap:0.5rem;}.simple-cloze-print-key-label.svelte-1fx5wwa {font-size:0.875rem;line-height:1.25rem;font-weight:600;}.simple-cloze-print-blank.svelte-1fx5wwa {display:inline-block;min-width:12rem;min-height:1.5rem;padding:0.5rem 0.75rem;border-bottom:2px solid var(--pie-text, black);}.simple-cloze-print-blank--key.svelte-1fx5wwa {min-width:6rem;font-weight:600;}\n\n @media print {.simple-cloze-print.svelte-1fx5wwa {padding:0;}\n }"
|
|
3728
3761
|
};
|
|
3729
|
-
function
|
|
3730
|
-
Ge(t, !0), Er(e,
|
|
3731
|
-
let n = Ir(t, "model", 7, null), r = Ir(t, "options", 7, null), i = /* @__PURE__ */ pt(() => r()?.role === "instructor"), a = /* @__PURE__ */ pt(() => n()?.promptEnabled !== !1 && typeof n()?.prompt == "string" ? n().prompt : ""), o = /* @__PURE__ */ pt(() =>
|
|
3762
|
+
function ka(e, t) {
|
|
3763
|
+
Ge(t, !0), Er(e, Oa);
|
|
3764
|
+
let n = Ir(t, "model", 7, null), r = Ir(t, "options", 7, null), i = /* @__PURE__ */ pt(() => r()?.role === "instructor"), a = /* @__PURE__ */ pt(() => n()?.promptEnabled !== !1 && typeof n()?.prompt == "string" ? n().prompt : ""), o = /* @__PURE__ */ pt(() => bi(n()?.correctAnswer)), s = /* @__PURE__ */ pt(() => X(i) && !!X(o)), c = /* @__PURE__ */ pt(() => X(i) && n()?.teacherInstructionsEnabled !== !1 && n()?.teacherInstructions || ""), l = /* @__PURE__ */ M(null);
|
|
3732
3765
|
pn(() => {
|
|
3733
3766
|
if (!X(l) || !X(a)) return;
|
|
3734
3767
|
let e = (e) => console.warn("simple-cloze: MathJax render failed", e);
|
|
3735
3768
|
try {
|
|
3736
|
-
Promise.resolve(
|
|
3769
|
+
Promise.resolve(fi(X(l))).catch(e);
|
|
3737
3770
|
} catch (t) {
|
|
3738
3771
|
e(t);
|
|
3739
3772
|
}
|
|
@@ -3751,41 +3784,41 @@ function ma(e, t) {
|
|
|
3751
3784
|
set options(e = null) {
|
|
3752
3785
|
r(e), At();
|
|
3753
3786
|
}
|
|
3754
|
-
}, d =
|
|
3755
|
-
var t =
|
|
3787
|
+
}, d = Da(), f = $t(d), p = (e) => {
|
|
3788
|
+
var t = Ca();
|
|
3756
3789
|
Tr(t, () => X(c), !0), Ee(t), lr(e, t);
|
|
3757
3790
|
};
|
|
3758
3791
|
wr(f, (e) => {
|
|
3759
3792
|
X(c) && e(p);
|
|
3760
3793
|
});
|
|
3761
3794
|
var m = nn(f, 2), h = (e) => {
|
|
3762
|
-
var t =
|
|
3795
|
+
var t = wa();
|
|
3763
3796
|
Tr(t, () => X(a), !0), Ee(t), Fr(t, (e) => N(l, e), () => X(l)), lr(e, t);
|
|
3764
3797
|
};
|
|
3765
3798
|
wr(m, (e) => {
|
|
3766
3799
|
X(a) && e(h);
|
|
3767
3800
|
});
|
|
3768
3801
|
var g = nn(m, 2), ee = $t(g), _ = (e) => {
|
|
3769
|
-
var t =
|
|
3802
|
+
var t = Ta(), r = en(t), i = tn(r, !0), a = tn(nn(r, 2), !0);
|
|
3770
3803
|
bn((e) => {
|
|
3771
3804
|
gr(i, e), gr(a, X(o));
|
|
3772
|
-
}, [() =>
|
|
3805
|
+
}, [() => Sa("printCorrectAnswer", n()?.language)]), lr(e, t);
|
|
3773
3806
|
}, v = (e) => {
|
|
3774
|
-
var t =
|
|
3775
|
-
bn((e) => Ar(t, "aria-label", e), [() =>
|
|
3807
|
+
var t = Ea();
|
|
3808
|
+
bn((e) => Ar(t, "aria-label", e), [() => Sa("printAnswerBlank", n()?.language)]), lr(e, t);
|
|
3776
3809
|
};
|
|
3777
3810
|
return wr(ee, (e) => {
|
|
3778
3811
|
X(s) ? e(_) : e(v, -1);
|
|
3779
3812
|
}), Ee(g), Ee(d), lr(e, d), Ke(u);
|
|
3780
3813
|
}
|
|
3781
|
-
Hr(
|
|
3814
|
+
Hr(ka, {
|
|
3782
3815
|
model: { type: "Object" },
|
|
3783
3816
|
options: { type: "Object" }
|
|
3784
3817
|
}, [], []);
|
|
3785
3818
|
//#endregion
|
|
3786
3819
|
//#region src/print/index.ts
|
|
3787
|
-
var
|
|
3820
|
+
var Aa = ka.element;
|
|
3788
3821
|
//#endregion
|
|
3789
|
-
export {
|
|
3822
|
+
export { Aa as default };
|
|
3790
3823
|
|
|
3791
3824
|
//# sourceMappingURL=print.js.map
|