aoi-comp 1.0.13 → 1.0.14
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/README.md +4 -1
- package/dist/{BufferResource-CR9WZiPf.js → BufferResource-DwkktoH2.js} +2 -2
- package/dist/{CanvasPool-oGKrpinT.js → CanvasPool-CbJemwqD.js} +1 -1
- package/dist/{Geometry-HXFlKI4P.js → Geometry-CQNqhx0Z.js} +1 -1
- package/dist/{RenderTargetSystem-CF18-b0v.js → RenderTargetSystem-BHmTK9nr.js} +1 -1
- package/dist/{browserAll-Cz0iKBkb.js → browserAll-BLacNsSI.js} +3 -3
- package/dist/{canvasUtils-Dc-V9sO2.js → canvasUtils-BRobvpth.js} +1 -1
- package/dist/comps.js +11 -11
- package/dist/{getTextureBatchBindGroup-FDqjUm2N.js → getTextureBatchBindGroup-B2MLavMF.js} +1 -1
- package/dist/{hooks-D2FBYBv8.js → hooks-Dbbx_ZCW.js} +1 -1
- package/dist/hooks.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{init-UwEQ9uRH.js → init--NRY9BXQ.js} +2 -2
- package/dist/{init-DWNh-mhB.js → init-DCipAX9y.js} +3 -3
- package/dist/{packages-h0Ej7Ed3.js → packages-Sbaw1wWA.js} +299 -288
- package/dist/utils.js +1 -1
- package/dist/webworkerAll-B-8Lcex_.js +2 -0
- package/package.json +1 -1
- package/dist/webworkerAll-BAHCx4FJ.js +0 -2
|
@@ -1748,7 +1748,7 @@ var j = {
|
|
|
1748
1748
|
}, fe = "os-theme-light", pe = "small", me = {
|
|
1749
1749
|
ok: "#00c291",
|
|
1750
1750
|
ng: "#f56c6c"
|
|
1751
|
-
}, he = O("os-theme-light".includes("light") ? "#ffffff" : "#000000").alpha(.44).string(), ge = "#ffffff", _e = "#000000", ve = O(j.colorText).alpha(.45).string(), ye = O(j.colorPrimary).alpha(.3).string(), be = O(j.colorPrimary).desaturate(.45).string(), xe = O(M.borderColor).whiten(.25).string(), Se = O(M.compBgc).mix(O("white"), .1).string(), N = O(M.hoverWhite).alpha(.15).string(), Ce = `linear-gradient(90deg, ${O(j.colorPrimary).alpha(.92).string()} 0%, ${O(j.colorPrimary).darken(.3).string()} 100%)`,
|
|
1751
|
+
}, he = O("os-theme-light".includes("light") ? "#ffffff" : "#000000").alpha(.44).string(), ge = "#ffffff", _e = "#000000", ve = O(j.colorText).alpha(.45).string(), ye = O(j.colorPrimary).alpha(.3).string(), be = O(j.colorPrimary).desaturate(.45).string(), xe = O(M.borderColor).whiten(.25).string(), Se = O(M.compBgc).mix(O("white"), .1).string(), N = O(M.hoverWhite).alpha(.15).string(), Ce = `linear-gradient(90deg, ${O(j.colorPrimary).alpha(.92).string()} 0%, ${O(j.colorPrimary).darken(.3).string()} 100%)`, we = {
|
|
1752
1752
|
token: {
|
|
1753
1753
|
colorPrimary: j.colorPrimary,
|
|
1754
1754
|
colorWarning: j.colorWarning,
|
|
@@ -1855,65 +1855,65 @@ var j = {
|
|
|
1855
1855
|
colorTextSecondary: j.colorText
|
|
1856
1856
|
}
|
|
1857
1857
|
}
|
|
1858
|
-
},
|
|
1859
|
-
let t = e.split("."), n =
|
|
1858
|
+
}, Te = (e) => {
|
|
1859
|
+
let t = e.split("."), n = we.components;
|
|
1860
1860
|
for (let e of t) n = n[e];
|
|
1861
|
-
return n ===
|
|
1862
|
-
}, { getDesignToken:
|
|
1863
|
-
...
|
|
1861
|
+
return n === we.components ? null : n;
|
|
1862
|
+
}, { getDesignToken: Ee } = e, De = Ee(we), Oe = {
|
|
1863
|
+
...we.token,
|
|
1864
1864
|
...M
|
|
1865
|
-
},
|
|
1866
|
-
...
|
|
1865
|
+
}, ke = {
|
|
1866
|
+
...De,
|
|
1867
1867
|
...M
|
|
1868
|
-
},
|
|
1868
|
+
}, P = (e) => typeof e == "string", Ae = () => {
|
|
1869
1869
|
let e, t, n = new Promise((n, r) => {
|
|
1870
1870
|
e = n, t = r;
|
|
1871
1871
|
});
|
|
1872
1872
|
return n.resolve = e, n.reject = t, n;
|
|
1873
|
-
},
|
|
1873
|
+
}, je = (e) => e == null ? "" : String(e), Me = (e, t, n) => {
|
|
1874
1874
|
e.forEach((e) => {
|
|
1875
1875
|
t[e] && (n[e] = t[e]);
|
|
1876
1876
|
});
|
|
1877
|
-
},
|
|
1878
|
-
let r =
|
|
1877
|
+
}, Ne = /###/g, Pe = (e) => e && e.includes("###") ? e.replace(Ne, ".") : e, Fe = (e) => !e || P(e), F = (e, t, n) => {
|
|
1878
|
+
let r = P(t) ? t.split(".") : t, i = 0;
|
|
1879
1879
|
for (; i < r.length - 1;) {
|
|
1880
|
-
if (
|
|
1881
|
-
let t =
|
|
1880
|
+
if (Fe(e)) return {};
|
|
1881
|
+
let t = Pe(r[i]);
|
|
1882
1882
|
!e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
|
|
1883
1883
|
}
|
|
1884
|
-
return
|
|
1884
|
+
return Fe(e) ? {} : {
|
|
1885
1885
|
obj: e,
|
|
1886
|
-
k:
|
|
1886
|
+
k: Pe(r[i])
|
|
1887
1887
|
};
|
|
1888
|
-
},
|
|
1889
|
-
let { obj: r, k: i } =
|
|
1888
|
+
}, Ie = (e, t, n) => {
|
|
1889
|
+
let { obj: r, k: i } = F(e, t, Object);
|
|
1890
1890
|
if (r !== void 0 || t.length === 1) {
|
|
1891
1891
|
r[i] = n;
|
|
1892
1892
|
return;
|
|
1893
1893
|
}
|
|
1894
|
-
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s =
|
|
1895
|
-
for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s =
|
|
1894
|
+
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = F(e, o, Object);
|
|
1895
|
+
for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = F(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
|
|
1896
1896
|
s.obj[`${s.k}.${a}`] = n;
|
|
1897
|
-
},
|
|
1898
|
-
let { obj: i, k: a } =
|
|
1897
|
+
}, Le = (e, t, n, r) => {
|
|
1898
|
+
let { obj: i, k: a } = F(e, t, Object);
|
|
1899
1899
|
i[a] = i[a] || [], i[a].push(n);
|
|
1900
|
-
},
|
|
1901
|
-
let { obj: n, k: r } =
|
|
1900
|
+
}, Re = (e, t) => {
|
|
1901
|
+
let { obj: n, k: r } = F(e, t);
|
|
1902
1902
|
if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
|
|
1903
|
-
},
|
|
1904
|
-
let r =
|
|
1905
|
-
return r === void 0 ?
|
|
1906
|
-
},
|
|
1907
|
-
for (let r in t) r !== "__proto__" && r !== "constructor" && (Object.prototype.hasOwnProperty.call(e, r) ?
|
|
1903
|
+
}, ze = (e, t, n) => {
|
|
1904
|
+
let r = Re(e, n);
|
|
1905
|
+
return r === void 0 ? Re(t, n) : r;
|
|
1906
|
+
}, Be = (e, t, n) => {
|
|
1907
|
+
for (let r in t) r !== "__proto__" && r !== "constructor" && (Object.prototype.hasOwnProperty.call(e, r) ? P(e[r]) || e[r] instanceof String || P(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : Be(e[r], t[r], n) : e[r] = t[r]);
|
|
1908
1908
|
return e;
|
|
1909
|
-
},
|
|
1909
|
+
}, I = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), Ve = {
|
|
1910
1910
|
"&": "&",
|
|
1911
1911
|
"<": "<",
|
|
1912
1912
|
">": ">",
|
|
1913
1913
|
"\"": """,
|
|
1914
1914
|
"'": "'",
|
|
1915
1915
|
"/": "/"
|
|
1916
|
-
},
|
|
1916
|
+
}, He = (e) => P(e) ? e.replace(/[&<>"'\/]/g, (e) => Ve[e]) : e, Ue = class {
|
|
1917
1917
|
constructor(e) {
|
|
1918
1918
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
1919
1919
|
}
|
|
@@ -1923,23 +1923,23 @@ var j = {
|
|
|
1923
1923
|
let n = new RegExp(e);
|
|
1924
1924
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
|
|
1925
1925
|
}
|
|
1926
|
-
},
|
|
1926
|
+
}, We = [
|
|
1927
1927
|
" ",
|
|
1928
1928
|
",",
|
|
1929
1929
|
"?",
|
|
1930
1930
|
"!",
|
|
1931
1931
|
";"
|
|
1932
|
-
],
|
|
1932
|
+
], Ge = new Ue(20), Ke = (e, t, n) => {
|
|
1933
1933
|
t ||= "", n ||= "";
|
|
1934
|
-
let r =
|
|
1934
|
+
let r = We.filter((e) => !t.includes(e) && !n.includes(e));
|
|
1935
1935
|
if (r.length === 0) return !0;
|
|
1936
|
-
let i =
|
|
1936
|
+
let i = Ge.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
|
|
1937
1937
|
if (!a) {
|
|
1938
1938
|
let t = e.indexOf(n);
|
|
1939
1939
|
t > 0 && !i.test(e.substring(0, t)) && (a = !0);
|
|
1940
1940
|
}
|
|
1941
1941
|
return a;
|
|
1942
|
-
},
|
|
1942
|
+
}, qe = (e, t, n = ".") => {
|
|
1943
1943
|
if (!e) return;
|
|
1944
1944
|
if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
1945
1945
|
let r = t.split(n), i = e;
|
|
@@ -1958,7 +1958,7 @@ var j = {
|
|
|
1958
1958
|
i = t;
|
|
1959
1959
|
}
|
|
1960
1960
|
return i;
|
|
1961
|
-
},
|
|
1961
|
+
}, L = (e) => e?.replace(/_/g, "-"), Je = {
|
|
1962
1962
|
type: "logger",
|
|
1963
1963
|
log(e) {
|
|
1964
1964
|
this.output("log", e);
|
|
@@ -1972,12 +1972,12 @@ var j = {
|
|
|
1972
1972
|
output(e, t) {
|
|
1973
1973
|
console?.[e]?.apply?.(console, t);
|
|
1974
1974
|
}
|
|
1975
|
-
},
|
|
1975
|
+
}, R = new class e {
|
|
1976
1976
|
constructor(e, t = {}) {
|
|
1977
1977
|
this.init(e, t);
|
|
1978
1978
|
}
|
|
1979
1979
|
init(e, t = {}) {
|
|
1980
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
1980
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || Je, this.options = t, this.debug = t.debug;
|
|
1981
1981
|
}
|
|
1982
1982
|
log(...e) {
|
|
1983
1983
|
return this.forward(e, "log", "", !0);
|
|
@@ -1992,7 +1992,7 @@ var j = {
|
|
|
1992
1992
|
return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
|
|
1993
1993
|
}
|
|
1994
1994
|
forward(e, t, n, r) {
|
|
1995
|
-
return r && !this.debug ? null : (e = e.map((e) =>
|
|
1995
|
+
return r && !this.debug ? null : (e = e.map((e) => P(e) ? e.replace(/[\r\n\x00-\x1F\x7F]/g, " ") : e), P(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
1996
1996
|
}
|
|
1997
1997
|
create(t) {
|
|
1998
1998
|
return new e(this.logger, {
|
|
@@ -2003,7 +2003,7 @@ var j = {
|
|
|
2003
2003
|
clone(t) {
|
|
2004
2004
|
return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
|
|
2005
2005
|
}
|
|
2006
|
-
}(),
|
|
2006
|
+
}(), Ye = class {
|
|
2007
2007
|
constructor() {
|
|
2008
2008
|
this.observers = {};
|
|
2009
2009
|
}
|
|
@@ -2036,7 +2036,7 @@ var j = {
|
|
|
2036
2036
|
for (let i = 0; i < r; i++) n(e, ...t);
|
|
2037
2037
|
});
|
|
2038
2038
|
}
|
|
2039
|
-
},
|
|
2039
|
+
}, Xe = class extends Ye {
|
|
2040
2040
|
constructor(e, t = {
|
|
2041
2041
|
ns: ["translation"],
|
|
2042
2042
|
defaultNS: "translation"
|
|
@@ -2052,16 +2052,16 @@ var j = {
|
|
|
2052
2052
|
}
|
|
2053
2053
|
getResource(e, t, n, r = {}) {
|
|
2054
2054
|
let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
|
|
2055
|
-
e.includes(".") ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) :
|
|
2056
|
-
let s =
|
|
2057
|
-
return !s && !t && !n && e.includes(".") && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !
|
|
2055
|
+
e.includes(".") ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : P(n) && i ? o.push(...n.split(i)) : o.push(n)));
|
|
2056
|
+
let s = Re(this.data, o);
|
|
2057
|
+
return !s && !t && !n && e.includes(".") && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !P(n) ? s : qe(this.data?.[e]?.[t], n, i);
|
|
2058
2058
|
}
|
|
2059
2059
|
addResource(e, t, n, r, i = { silent: !1 }) {
|
|
2060
2060
|
let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
|
|
2061
|
-
n && (o = o.concat(a ? n.split(a) : n)), e.includes(".") && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t),
|
|
2061
|
+
n && (o = o.concat(a ? n.split(a) : n)), e.includes(".") && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), Ie(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
|
|
2062
2062
|
}
|
|
2063
2063
|
addResources(e, t, n, r = { silent: !1 }) {
|
|
2064
|
-
for (let r in n) (
|
|
2064
|
+
for (let r in n) (P(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
|
|
2065
2065
|
r.silent || this.emit("added", e, t, n);
|
|
2066
2066
|
}
|
|
2067
2067
|
addResourceBundle(e, t, n, r, i, a = {
|
|
@@ -2070,11 +2070,11 @@ var j = {
|
|
|
2070
2070
|
}) {
|
|
2071
2071
|
let o = [e, t];
|
|
2072
2072
|
e.includes(".") && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
|
|
2073
|
-
let s =
|
|
2074
|
-
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ?
|
|
2073
|
+
let s = Re(this.data, o) || {};
|
|
2074
|
+
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? Be(s, n, i) : s = {
|
|
2075
2075
|
...s,
|
|
2076
2076
|
...n
|
|
2077
|
-
},
|
|
2077
|
+
}, Ie(this.data, o, s), a.silent || this.emit("added", e, t, n);
|
|
2078
2078
|
}
|
|
2079
2079
|
removeResourceBundle(e, t) {
|
|
2080
2080
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -2095,7 +2095,7 @@ var j = {
|
|
|
2095
2095
|
toJSON() {
|
|
2096
2096
|
return this.data;
|
|
2097
2097
|
}
|
|
2098
|
-
},
|
|
2098
|
+
}, Ze = {
|
|
2099
2099
|
processors: {},
|
|
2100
2100
|
addPostProcessor(e) {
|
|
2101
2101
|
this.processors[e.name] = e;
|
|
@@ -2105,22 +2105,22 @@ var j = {
|
|
|
2105
2105
|
t = this.processors[e]?.process(t, n, r, i) ?? t;
|
|
2106
2106
|
}), t;
|
|
2107
2107
|
}
|
|
2108
|
-
},
|
|
2109
|
-
function
|
|
2108
|
+
}, Qe = Symbol("i18next/PATH_KEY");
|
|
2109
|
+
function $e() {
|
|
2110
2110
|
let e = [], t = Object.create(null), n;
|
|
2111
|
-
return t.get = (r, i) => (n?.revoke?.(), i ===
|
|
2111
|
+
return t.get = (r, i) => (n?.revoke?.(), i === Qe ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
|
|
2112
2112
|
}
|
|
2113
|
-
function
|
|
2114
|
-
let { [
|
|
2113
|
+
function z(e, t) {
|
|
2114
|
+
let { [Qe]: n } = e($e()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":", a = t?.enableSelector === "strict";
|
|
2115
2115
|
if (n.length > 1 && i) {
|
|
2116
2116
|
let e = t?.ns, o = a ? Array.isArray(e) ? e : e ? [e] : null : Array.isArray(e) ? e : null;
|
|
2117
2117
|
if (o && (a ? o : o.length > 1 ? o.slice(1) : []).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
|
|
2118
2118
|
}
|
|
2119
2119
|
return n.join(r);
|
|
2120
2120
|
}
|
|
2121
|
-
var
|
|
2121
|
+
var et = (e) => !P(e) && typeof e != "boolean" && typeof e != "number", tt = class e extends Ye {
|
|
2122
2122
|
constructor(e, t = {}) {
|
|
2123
|
-
super(),
|
|
2123
|
+
super(), Me([
|
|
2124
2124
|
"resourceStore",
|
|
2125
2125
|
"languageUtils",
|
|
2126
2126
|
"pluralResolver",
|
|
@@ -2128,7 +2128,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2128
2128
|
"backendConnector",
|
|
2129
2129
|
"i18nFormat",
|
|
2130
2130
|
"utils"
|
|
2131
|
-
], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger =
|
|
2131
|
+
], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = R.create("translator"), this.checkedLoadedFor = {};
|
|
2132
2132
|
}
|
|
2133
2133
|
changeLanguage(e) {
|
|
2134
2134
|
e && (this.language = e);
|
|
@@ -2138,34 +2138,34 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2138
2138
|
if (e == null) return !1;
|
|
2139
2139
|
let r = this.resolve(e, n);
|
|
2140
2140
|
if (r?.res === void 0) return !1;
|
|
2141
|
-
let i =
|
|
2141
|
+
let i = et(r.res);
|
|
2142
2142
|
return !(n.returnObjects === !1 && i);
|
|
2143
2143
|
}
|
|
2144
2144
|
extractFromKey(e, t) {
|
|
2145
2145
|
let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
|
|
2146
2146
|
n === void 0 && (n = ":");
|
|
2147
|
-
let r = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, i = t.ns || this.options.defaultNS || [], a = n && e.includes(n), o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !
|
|
2147
|
+
let r = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, i = t.ns || this.options.defaultNS || [], a = n && e.includes(n), o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Ke(e, n, r);
|
|
2148
2148
|
if (a && !o) {
|
|
2149
2149
|
let t = e.match(this.interpolator.nestingRegexp);
|
|
2150
2150
|
if (t && t.length > 0) return {
|
|
2151
2151
|
key: e,
|
|
2152
|
-
namespaces:
|
|
2152
|
+
namespaces: P(i) ? [i] : i
|
|
2153
2153
|
};
|
|
2154
2154
|
let a = e.split(n);
|
|
2155
2155
|
(n !== r || n === r && this.options.ns.includes(a[0])) && (i = a.shift()), e = a.join(r);
|
|
2156
2156
|
}
|
|
2157
2157
|
return {
|
|
2158
2158
|
key: e,
|
|
2159
|
-
namespaces:
|
|
2159
|
+
namespaces: P(i) ? [i] : i
|
|
2160
2160
|
};
|
|
2161
2161
|
}
|
|
2162
2162
|
translate(t, n, r) {
|
|
2163
2163
|
let i = typeof n == "object" ? { ...n } : n;
|
|
2164
2164
|
if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
|
|
2165
|
-
typeof t == "function" && (t =
|
|
2165
|
+
typeof t == "function" && (t = z(t, {
|
|
2166
2166
|
...this.options,
|
|
2167
2167
|
...i
|
|
2168
|
-
})), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ?
|
|
2168
|
+
})), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? z(e, {
|
|
2169
2169
|
...this.options,
|
|
2170
2170
|
...i
|
|
2171
2171
|
}) : String(e));
|
|
@@ -2191,10 +2191,10 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2191
2191
|
"[object Number]",
|
|
2192
2192
|
"[object Function]",
|
|
2193
2193
|
"[object RegExp]"
|
|
2194
|
-
], v = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject, b = i.count !== void 0 && !
|
|
2194
|
+
], v = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject, b = i.count !== void 0 && !P(i.count), x = e.hasDefaultValue(i), S = b ? this.pluralResolver.getSuffix(d, i.count, i) : "", C = i.ordinal && b ? this.pluralResolver.getSuffix(d, i.count, { ordinal: !1 }) : "", w = b && !i.ordinal && i.count === 0, T = w && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${S}`] || i[`defaultValue${C}`] || i.defaultValue, E = m;
|
|
2195
2195
|
y && !m && x && (E = T);
|
|
2196
|
-
let ee =
|
|
2197
|
-
if (y && E && ee && !_.includes(te) && !(
|
|
2196
|
+
let ee = et(E), te = Object.prototype.toString.apply(E);
|
|
2197
|
+
if (y && E && ee && !_.includes(te) && !(P(v) && Array.isArray(E))) {
|
|
2198
2198
|
if (!i.returnObjects && !this.options.returnObjects) {
|
|
2199
2199
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
2200
2200
|
let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h, E, {
|
|
@@ -2209,7 +2209,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2209
2209
|
let r = `${n}${o}${e}`;
|
|
2210
2210
|
t[e] = x && !m ? this.translate(r, {
|
|
2211
2211
|
...i,
|
|
2212
|
-
defaultValue:
|
|
2212
|
+
defaultValue: et(T) ? T[e] : void 0,
|
|
2213
2213
|
joinArrays: !1,
|
|
2214
2214
|
ns: c
|
|
2215
2215
|
}) : this.translate(r, {
|
|
@@ -2220,7 +2220,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2220
2220
|
}
|
|
2221
2221
|
m = t;
|
|
2222
2222
|
}
|
|
2223
|
-
} else if (y &&
|
|
2223
|
+
} else if (y && P(v) && Array.isArray(m)) m = m.join(v), m &&= this.extendTranslation(m, t, i, r);
|
|
2224
2224
|
else {
|
|
2225
2225
|
let e = !1, n = !1;
|
|
2226
2226
|
!this.isValidLookup(m) && x && (e = !0, m = T), this.isValidLookup(m) || (n = !0, m = s);
|
|
@@ -2264,12 +2264,12 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2264
2264
|
...n.interpolation
|
|
2265
2265
|
}
|
|
2266
2266
|
});
|
|
2267
|
-
let a =
|
|
2267
|
+
let a = P(e) && (n?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n.interpolation.skipOnVariables), o;
|
|
2268
2268
|
if (a) {
|
|
2269
2269
|
let t = e.match(this.interpolator.nestingRegexp);
|
|
2270
2270
|
o = t && t.length;
|
|
2271
2271
|
}
|
|
2272
|
-
let s = n.replace && !
|
|
2272
|
+
let s = n.replace && !P(n.replace) ? n.replace : n;
|
|
2273
2273
|
if (this.options.interpolation.defaultVariables && (s = {
|
|
2274
2274
|
...this.options.interpolation.defaultVariables,
|
|
2275
2275
|
...s
|
|
@@ -2279,8 +2279,8 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2279
2279
|
}
|
|
2280
2280
|
!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();
|
|
2281
2281
|
}
|
|
2282
|
-
let a = n.postProcess || this.options.postProcess, o =
|
|
2283
|
-
return e != null && o?.length && n.applyPostProcessor !== !1 && (e =
|
|
2282
|
+
let a = n.postProcess || this.options.postProcess, o = P(a) ? [a] : a;
|
|
2283
|
+
return e != null && o?.length && n.applyPostProcessor !== !1 && (e = Ze.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
2284
2284
|
i18nResolved: {
|
|
2285
2285
|
...r,
|
|
2286
2286
|
usedParams: this.getUsedParamsDetails(n)
|
|
@@ -2290,7 +2290,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2290
2290
|
}
|
|
2291
2291
|
resolve(e, t = {}) {
|
|
2292
2292
|
let n, r, i, a, o;
|
|
2293
|
-
return
|
|
2293
|
+
return P(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? z(e, {
|
|
2294
2294
|
...this.options,
|
|
2295
2295
|
...t
|
|
2296
2296
|
}) : e)), e.forEach((e) => {
|
|
@@ -2299,7 +2299,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2299
2299
|
r = c;
|
|
2300
2300
|
let l = s.namespaces;
|
|
2301
2301
|
this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
|
|
2302
|
-
let u = t.count !== void 0 && !
|
|
2302
|
+
let u = t.count !== void 0 && !P(t.count), d = u && !t.ordinal && t.count === 0, f = t.context !== void 0 && (P(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
2303
2303
|
l.forEach((e) => {
|
|
2304
2304
|
this.isValidLookup(n) || (o = e, !this.checkedLoadedFor[`${p[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (this.checkedLoadedFor[`${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) => {
|
|
2305
2305
|
if (this.isValidLookup(n)) return;
|
|
@@ -2350,7 +2350,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2350
2350
|
"joinArrays",
|
|
2351
2351
|
"postProcess",
|
|
2352
2352
|
"interpolation"
|
|
2353
|
-
], n = e.replace && !
|
|
2353
|
+
], n = e.replace && !P(e.replace), r = n ? e.replace : e;
|
|
2354
2354
|
if (n && e.count !== void 0 && (r = {
|
|
2355
2355
|
...r,
|
|
2356
2356
|
count: e.count
|
|
@@ -2367,25 +2367,25 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2367
2367
|
for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.startsWith("defaultValue") && e[t] !== void 0) return !0;
|
|
2368
2368
|
return !1;
|
|
2369
2369
|
}
|
|
2370
|
-
},
|
|
2370
|
+
}, nt = class {
|
|
2371
2371
|
constructor(e) {
|
|
2372
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger =
|
|
2372
|
+
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = R.create("languageUtils"), this.resolveHierarchyCache = {};
|
|
2373
2373
|
}
|
|
2374
2374
|
clearCache() {
|
|
2375
2375
|
this.resolveHierarchyCache = {};
|
|
2376
2376
|
}
|
|
2377
2377
|
getScriptPartFromCode(e) {
|
|
2378
|
-
if (e =
|
|
2378
|
+
if (e = L(e), !e || !e.includes("-")) return null;
|
|
2379
2379
|
let t = e.split("-");
|
|
2380
2380
|
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
2381
2381
|
}
|
|
2382
2382
|
getLanguagePartFromCode(e) {
|
|
2383
|
-
if (e =
|
|
2383
|
+
if (e = L(e), !e || !e.includes("-")) return e;
|
|
2384
2384
|
let t = e.split("-");
|
|
2385
2385
|
return this.formatLanguageCode(t[0]);
|
|
2386
2386
|
}
|
|
2387
2387
|
formatLanguageCode(e) {
|
|
2388
|
-
if (
|
|
2388
|
+
if (P(e) && e.includes("-")) {
|
|
2389
2389
|
let t;
|
|
2390
2390
|
try {
|
|
2391
2391
|
t = Intl.getCanonicalLocales(e)[0];
|
|
@@ -2415,7 +2415,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2415
2415
|
}
|
|
2416
2416
|
getFallbackCodes(e, t) {
|
|
2417
2417
|
if (!e) return [];
|
|
2418
|
-
if (typeof e == "function" && (e = e(t)),
|
|
2418
|
+
if (typeof e == "function" && (e = e(t)), P(e) && (e = [e]), Array.isArray(e)) return e;
|
|
2419
2419
|
if (!t) return e.default || [];
|
|
2420
2420
|
let n = e[t];
|
|
2421
2421
|
return n ||= e[this.getScriptPartFromCode(t)], n ||= e[this.formatLanguageCode(t)], n ||= e[this.getLanguagePartFromCode(t)], n ||= e.default, n || [];
|
|
@@ -2423,7 +2423,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2423
2423
|
toResolveHierarchy(e, t) {
|
|
2424
2424
|
let n = this.options.fallbackLng, r = Array.isArray(n) ? n.join("|") : n;
|
|
2425
2425
|
r !== this._cachedFallbackLng && (this.resolveHierarchyCache = {}, this._cachedFallbackLng = r);
|
|
2426
|
-
let i = t === void 0 || t === !1 ||
|
|
2426
|
+
let i = t === void 0 || t === !1 || P(t), a = t === void 0 && typeof this.options.fallbackLng == "function", o = P(e) && i && !a, s = null;
|
|
2427
2427
|
if (o) {
|
|
2428
2428
|
let n;
|
|
2429
2429
|
n = t === void 0 ? "undefined" : t === !1 ? "boolean:false" : `string:${t}`, s = `${e.length}:${e}|${n}`;
|
|
@@ -2435,29 +2435,29 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2435
2435
|
let c = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), l = [], u = (e) => {
|
|
2436
2436
|
e && (this.isSupportedCode(e) ? l.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
|
|
2437
2437
|
};
|
|
2438
|
-
return
|
|
2438
|
+
return P(e) && (e.includes("-") || e.includes("_")) ? (this.options.load !== "languageOnly" && u(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && u(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && u(this.getLanguagePartFromCode(e))) : P(e) && u(this.formatLanguageCode(e)), c.forEach((e) => {
|
|
2439
2439
|
l.includes(e) || u(this.formatLanguageCode(e));
|
|
2440
2440
|
}), s === null ? l : (this.resolveHierarchyCache[s] = l, l.slice());
|
|
2441
2441
|
}
|
|
2442
|
-
},
|
|
2442
|
+
}, rt = {
|
|
2443
2443
|
zero: 0,
|
|
2444
2444
|
one: 1,
|
|
2445
2445
|
two: 2,
|
|
2446
2446
|
few: 3,
|
|
2447
2447
|
many: 4,
|
|
2448
2448
|
other: 5
|
|
2449
|
-
},
|
|
2449
|
+
}, it = {
|
|
2450
2450
|
select: (e) => e === 1 ? "one" : "other",
|
|
2451
2451
|
resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
|
|
2452
|
-
},
|
|
2452
|
+
}, at = class {
|
|
2453
2453
|
constructor(e, t = {}) {
|
|
2454
|
-
this.languageUtils = e, this.options = t, this.logger =
|
|
2454
|
+
this.languageUtils = e, this.options = t, this.logger = R.create("pluralResolver"), this.pluralRulesCache = {};
|
|
2455
2455
|
}
|
|
2456
2456
|
clearCache() {
|
|
2457
2457
|
this.pluralRulesCache = {};
|
|
2458
2458
|
}
|
|
2459
2459
|
getRule(e, t = {}) {
|
|
2460
|
-
let n =
|
|
2460
|
+
let n = L(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
|
|
2461
2461
|
cleanedCode: n,
|
|
2462
2462
|
type: r
|
|
2463
2463
|
});
|
|
@@ -2466,8 +2466,8 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2466
2466
|
try {
|
|
2467
2467
|
a = new Intl.PluralRules(n, { type: r });
|
|
2468
2468
|
} catch {
|
|
2469
|
-
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
2470
|
-
if (!e.match(/-|_/)) return
|
|
2469
|
+
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), it;
|
|
2470
|
+
if (!e.match(/-|_/)) return it;
|
|
2471
2471
|
let n = this.languageUtils.getLanguagePartFromCode(e);
|
|
2472
2472
|
a = this.getRule(n, t);
|
|
2473
2473
|
}
|
|
@@ -2482,23 +2482,23 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2482
2482
|
}
|
|
2483
2483
|
getSuffixes(e, t = {}) {
|
|
2484
2484
|
let n = this.getRule(e, t);
|
|
2485
|
-
return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) =>
|
|
2485
|
+
return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => rt[e] - rt[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
|
|
2486
2486
|
}
|
|
2487
2487
|
getSuffix(e, t, n = {}) {
|
|
2488
2488
|
let r = this.getRule(e, n);
|
|
2489
2489
|
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));
|
|
2490
2490
|
}
|
|
2491
|
-
},
|
|
2492
|
-
let a =
|
|
2493
|
-
return !a && i &&
|
|
2494
|
-
},
|
|
2491
|
+
}, ot = (e, t, n, r = ".", i = !0) => {
|
|
2492
|
+
let a = ze(e, t, n);
|
|
2493
|
+
return !a && i && P(n) && (a = qe(e, n, r), a === void 0 && (a = qe(t, n, r))), a;
|
|
2494
|
+
}, st = (e) => e.replace(/\$/g, "$$$$"), ct = class {
|
|
2495
2495
|
constructor(e = {}) {
|
|
2496
|
-
this.logger =
|
|
2496
|
+
this.logger = R.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
|
|
2497
2497
|
}
|
|
2498
2498
|
init(e = {}) {
|
|
2499
2499
|
e.interpolation ||= { escapeValue: !0 };
|
|
2500
2500
|
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;
|
|
2501
|
-
this.escape = t === void 0 ?
|
|
2501
|
+
this.escape = t === void 0 ? He : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? I(i) : a || "{{", this.suffix = o ? I(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u ? I(u) : "-", this.unescapeSuffix = this.unescapePrefix ? "" : l ? I(l) : "", this.nestingPrefix = d ? I(d) : f || I("$t("), this.nestingSuffix = p ? I(p) : m || I(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ !== void 0 && _, this.resetRegExp();
|
|
2502
2502
|
}
|
|
2503
2503
|
reset() {
|
|
2504
2504
|
this.options && this.init(this.options);
|
|
@@ -2510,7 +2510,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2510
2510
|
interpolate(e, t, n, r) {
|
|
2511
2511
|
let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
|
|
2512
2512
|
if (!e.includes(this.formatSeparator)) {
|
|
2513
|
-
let i =
|
|
2513
|
+
let i = ot(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
2514
2514
|
return this.alwaysFormat ? this.format(i, void 0, n, {
|
|
2515
2515
|
...r,
|
|
2516
2516
|
...t,
|
|
@@ -2518,7 +2518,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2518
2518
|
}) : i;
|
|
2519
2519
|
}
|
|
2520
2520
|
let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
|
|
2521
|
-
return this.format(
|
|
2521
|
+
return this.format(ot(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
|
|
2522
2522
|
...r,
|
|
2523
2523
|
...t,
|
|
2524
2524
|
interpolationkey: a
|
|
@@ -2538,15 +2538,15 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2538
2538
|
if (a = c(n), a === void 0) {
|
|
2539
2539
|
if (typeof l == "function") {
|
|
2540
2540
|
let t = l(e, i, r);
|
|
2541
|
-
a =
|
|
2541
|
+
a = P(t) ? t : "";
|
|
2542
2542
|
} else if (r && Object.prototype.hasOwnProperty.call(r, n)) a = "";
|
|
2543
2543
|
else if (u) {
|
|
2544
2544
|
a = i[0];
|
|
2545
2545
|
continue;
|
|
2546
2546
|
} else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
|
|
2547
|
-
} else !
|
|
2547
|
+
} else !P(a) && !this.useRawValueToEscape && (a = je(a));
|
|
2548
2548
|
let s = t.safeValue(a);
|
|
2549
|
-
if (e = e.replace(i[0],
|
|
2549
|
+
if (e = e.replace(i[0], st(s)), u ? (t.regex.lastIndex += s.length, t.regex.lastIndex -= i[0].length) : t.regex.lastIndex = 0, o++, o >= this.maxReplaces) break;
|
|
2550
2550
|
}
|
|
2551
2551
|
}), e;
|
|
2552
2552
|
}
|
|
@@ -2554,7 +2554,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2554
2554
|
let r, i, a, o = (e, t) => {
|
|
2555
2555
|
let n = this.nestingOptionsSeparator;
|
|
2556
2556
|
if (!e.includes(n)) return e;
|
|
2557
|
-
let r = e.split(RegExp(`${
|
|
2557
|
+
let r = e.split(RegExp(`${I(n)}[ ]*{`)), i = `{${r[1]}`;
|
|
2558
2558
|
e = r[0], i = this.interpolate(i, a);
|
|
2559
2559
|
let o = i.match(/'/g), s = i.match(/"/g);
|
|
2560
2560
|
((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
|
|
@@ -2570,17 +2570,17 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2570
2570
|
};
|
|
2571
2571
|
for (; r = this.nestingRegexp.exec(e);) {
|
|
2572
2572
|
let s = [];
|
|
2573
|
-
a = { ...n }, a = a.replace && !
|
|
2573
|
+
a = { ...n }, a = a.replace && !P(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
2574
2574
|
let c = /{.*}/s.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
|
|
2575
|
-
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 && !
|
|
2576
|
-
|
|
2575
|
+
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 && !P(i)) return i;
|
|
2576
|
+
P(i) || (i = je(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, {
|
|
2577
2577
|
...n,
|
|
2578
2578
|
interpolationkey: r[1].trim()
|
|
2579
|
-
}), i.trim())), e = e.replace(r[0],
|
|
2579
|
+
}), i.trim())), e = e.replace(r[0], st(je(i))), this.regexp.lastIndex = 0;
|
|
2580
2580
|
}
|
|
2581
2581
|
return e;
|
|
2582
2582
|
}
|
|
2583
|
-
},
|
|
2583
|
+
}, lt = (e) => {
|
|
2584
2584
|
let t = e.toLowerCase().trim(), n = {};
|
|
2585
2585
|
if (e.includes("(")) {
|
|
2586
2586
|
let r = e.split("(");
|
|
@@ -2597,7 +2597,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2597
2597
|
formatName: t,
|
|
2598
2598
|
formatOptions: n
|
|
2599
2599
|
};
|
|
2600
|
-
},
|
|
2600
|
+
}, ut = (e) => {
|
|
2601
2601
|
let t = {};
|
|
2602
2602
|
return (n, r, i) => {
|
|
2603
2603
|
let a = i;
|
|
@@ -2606,15 +2606,15 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2606
2606
|
[i.interpolationkey]: void 0
|
|
2607
2607
|
});
|
|
2608
2608
|
let o = r + JSON.stringify(a), s = t[o];
|
|
2609
|
-
return s || (s = e(
|
|
2609
|
+
return s || (s = e(L(r), i), t[o] = s), s(n);
|
|
2610
2610
|
};
|
|
2611
|
-
},
|
|
2611
|
+
}, dt = (e) => (t, n, r) => e(L(n), r)(t), ft = class {
|
|
2612
2612
|
constructor(e = {}) {
|
|
2613
|
-
this.logger =
|
|
2613
|
+
this.logger = R.create("formatter"), this.options = e, this.init(e);
|
|
2614
2614
|
}
|
|
2615
2615
|
init(e, t = { interpolation: {} }) {
|
|
2616
2616
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
2617
|
-
let n = t.cacheInBuiltFormats ?
|
|
2617
|
+
let n = t.cacheInBuiltFormats ? ut : dt;
|
|
2618
2618
|
this.formats = {
|
|
2619
2619
|
number: n((e, t) => {
|
|
2620
2620
|
let n = new Intl.NumberFormat(e, { ...t });
|
|
@@ -2645,7 +2645,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2645
2645
|
this.formats[e.toLowerCase().trim()] = t;
|
|
2646
2646
|
}
|
|
2647
2647
|
addCached(e, t) {
|
|
2648
|
-
this.formats[e.toLowerCase().trim()] =
|
|
2648
|
+
this.formats[e.toLowerCase().trim()] = ut(t);
|
|
2649
2649
|
}
|
|
2650
2650
|
format(e, t, n, r = {}) {
|
|
2651
2651
|
if (!t || e == null) return e;
|
|
@@ -2656,7 +2656,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2656
2656
|
a.push(t);
|
|
2657
2657
|
}
|
|
2658
2658
|
return a.reduce((e, t) => {
|
|
2659
|
-
let { formatName: i, formatOptions: a } =
|
|
2659
|
+
let { formatName: i, formatOptions: a } = lt(t);
|
|
2660
2660
|
if (this.formats[i]) {
|
|
2661
2661
|
let t = e;
|
|
2662
2662
|
try {
|
|
@@ -2674,11 +2674,11 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2674
2674
|
return this.logger.warn(`there was no format function for ${i}`), e;
|
|
2675
2675
|
}, e);
|
|
2676
2676
|
}
|
|
2677
|
-
},
|
|
2677
|
+
}, pt = (e, t) => {
|
|
2678
2678
|
e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
|
|
2679
|
-
},
|
|
2679
|
+
}, mt = class extends Ye {
|
|
2680
2680
|
constructor(e, t, n, r = {}) {
|
|
2681
|
-
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger =
|
|
2681
|
+
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = R.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);
|
|
2682
2682
|
}
|
|
2683
2683
|
queueLoad(e, t, n, r) {
|
|
2684
2684
|
let i = {}, a = {}, o = {}, s = {};
|
|
@@ -2706,7 +2706,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2706
2706
|
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);
|
|
2707
2707
|
let o = {};
|
|
2708
2708
|
this.queue.forEach((n) => {
|
|
2709
|
-
|
|
2709
|
+
Le(n.loaded, [i], a), pt(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
|
|
2710
2710
|
o[e] || (o[e] = {});
|
|
2711
2711
|
let t = n.loaded[e];
|
|
2712
2712
|
t.length && t.forEach((t) => {
|
|
@@ -2755,7 +2755,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2755
2755
|
}
|
|
2756
2756
|
prepareLoading(e, t, n = {}, r) {
|
|
2757
2757
|
if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), r && r();
|
|
2758
|
-
|
|
2758
|
+
P(e) && (e = this.languageUtils.toResolveHierarchy(e)), P(t) && (t = [t]);
|
|
2759
2759
|
let i = this.queueLoad(e, t, n, r);
|
|
2760
2760
|
if (!i.toLoad.length) return i.pending.length || r(), null;
|
|
2761
2761
|
i.toLoad.forEach((e) => {
|
|
@@ -2796,7 +2796,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2796
2796
|
e && e[0] && this.store.addResource(e[0], t, n, r);
|
|
2797
2797
|
}
|
|
2798
2798
|
}
|
|
2799
|
-
},
|
|
2799
|
+
}, ht = () => ({
|
|
2800
2800
|
debug: !1,
|
|
2801
2801
|
initAsync: !0,
|
|
2802
2802
|
ns: ["translation"],
|
|
@@ -2831,7 +2831,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2831
2831
|
appendNamespaceToCIMode: !1,
|
|
2832
2832
|
overloadTranslationOptionHandler: (e) => {
|
|
2833
2833
|
let t = {};
|
|
2834
|
-
if (typeof e[1] == "object" && (t = e[1]),
|
|
2834
|
+
if (typeof e[1] == "object" && (t = e[1]), P(e[1]) && (t.defaultValue = e[1]), P(e[2]) && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
|
|
2835
2835
|
let n = e[3] || e[2];
|
|
2836
2836
|
Object.keys(n).forEach((e) => {
|
|
2837
2837
|
t[e] = n[e];
|
|
@@ -2852,13 +2852,13 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2852
2852
|
skipOnVariables: !0
|
|
2853
2853
|
},
|
|
2854
2854
|
cacheInBuiltFormats: !0
|
|
2855
|
-
}),
|
|
2855
|
+
}), gt = (e) => (P(e.ns) && (e.ns = [e.ns]), P(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), P(e.fallbackNS) && (e.fallbackNS = [e.fallbackNS]), e.supportedLngs && !e.supportedLngs.includes("cimode") && (e.supportedLngs = e.supportedLngs.concat(["cimode"])), e), _t = () => {}, vt = (e) => {
|
|
2856
2856
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
|
|
2857
2857
|
typeof e[t] == "function" && (e[t] = e[t].bind(e));
|
|
2858
2858
|
});
|
|
2859
|
-
},
|
|
2859
|
+
}, B = class e extends Ye {
|
|
2860
2860
|
constructor(e = {}, t) {
|
|
2861
|
-
if (super(), this.options =
|
|
2861
|
+
if (super(), this.options = gt(e), this.services = {}, this.logger = R, this.modules = { external: [] }, vt(this), t && !this.isInitialized && !e.isClone) {
|
|
2862
2862
|
if (!this.options.initAsync) return this.init(e, t), this;
|
|
2863
2863
|
setTimeout(() => {
|
|
2864
2864
|
this.init(e, t);
|
|
@@ -2866,33 +2866,33 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2866
2866
|
}
|
|
2867
2867
|
}
|
|
2868
2868
|
init(e = {}, t) {
|
|
2869
|
-
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (
|
|
2870
|
-
let n =
|
|
2869
|
+
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (P(e.ns) ? e.defaultNS = e.ns : e.ns.includes("translation") || (e.defaultNS = e.ns[0]));
|
|
2870
|
+
let n = ht();
|
|
2871
2871
|
this.options = {
|
|
2872
2872
|
...n,
|
|
2873
2873
|
...this.options,
|
|
2874
|
-
...
|
|
2874
|
+
...gt(e)
|
|
2875
2875
|
}, this.options.interpolation = {
|
|
2876
2876
|
...n.interpolation,
|
|
2877
2877
|
...this.options.interpolation
|
|
2878
2878
|
}, 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);
|
|
2879
2879
|
let r = (e) => e ? typeof e == "function" ? new e() : e : null;
|
|
2880
2880
|
if (!this.options.isClone) {
|
|
2881
|
-
this.modules.logger ?
|
|
2881
|
+
this.modules.logger ? R.init(r(this.modules.logger), this.options) : R.init(null, this.options);
|
|
2882
2882
|
let e;
|
|
2883
|
-
e = this.modules.formatter ? this.modules.formatter :
|
|
2884
|
-
let t = new
|
|
2885
|
-
this.store = new
|
|
2883
|
+
e = this.modules.formatter ? this.modules.formatter : ft;
|
|
2884
|
+
let t = new nt(this.options);
|
|
2885
|
+
this.store = new Xe(this.options.resources, this.options);
|
|
2886
2886
|
let n = this.services;
|
|
2887
|
-
n.logger =
|
|
2887
|
+
n.logger = R, n.resourceStore = this.store, n.languageUtils = t, n.pluralResolver = new at(t, { prepend: this.options.pluralSeparator }), e && (n.formatter = r(e), n.formatter.init && n.formatter.init(n, this.options), this.options.interpolation.format = n.formatter.format.bind(n.formatter)), n.interpolator = new ct(this.options), n.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n.backendConnector = new mt(r(this.modules.backend), n.resourceStore, n, this.options), n.backendConnector.on("*", (e, ...t) => {
|
|
2888
2888
|
this.emit(e, ...t);
|
|
2889
|
-
}), this.modules.languageDetector && (n.languageDetector = r(this.modules.languageDetector), n.languageDetector.init && n.languageDetector.init(n, this.options.detection, this.options)), this.modules.i18nFormat && (n.i18nFormat = r(this.modules.i18nFormat), n.i18nFormat.init && n.i18nFormat.init(this)), this.translator = new
|
|
2889
|
+
}), this.modules.languageDetector && (n.languageDetector = r(this.modules.languageDetector), n.languageDetector.init && n.languageDetector.init(n, this.options.detection, this.options)), this.modules.i18nFormat && (n.i18nFormat = r(this.modules.i18nFormat), n.i18nFormat.init && n.i18nFormat.init(this)), this.translator = new tt(this.services, this.options), this.translator.on("*", (e, ...t) => {
|
|
2890
2890
|
this.emit(e, ...t);
|
|
2891
2891
|
}), this.modules.external.forEach((e) => {
|
|
2892
2892
|
e.init && e.init(this);
|
|
2893
2893
|
});
|
|
2894
2894
|
}
|
|
2895
|
-
if (this.format = this.options.interpolation.format, t ||=
|
|
2895
|
+
if (this.format = this.options.interpolation.format, t ||= _t, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
2896
2896
|
let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
2897
2897
|
e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
|
|
2898
2898
|
}
|
|
@@ -2911,7 +2911,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2911
2911
|
].forEach((e) => {
|
|
2912
2912
|
this[e] = (...t) => (this.store[e](...t), this);
|
|
2913
2913
|
});
|
|
2914
|
-
let i =
|
|
2914
|
+
let i = Ae(), a = () => {
|
|
2915
2915
|
let e = (e, n) => {
|
|
2916
2916
|
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);
|
|
2917
2917
|
};
|
|
@@ -2920,8 +2920,8 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2920
2920
|
};
|
|
2921
2921
|
return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
|
|
2922
2922
|
}
|
|
2923
|
-
loadResources(e, t =
|
|
2924
|
-
let n = t, r =
|
|
2923
|
+
loadResources(e, t = _t) {
|
|
2924
|
+
let n = t, r = P(e) ? e : this.language;
|
|
2925
2925
|
if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
2926
2926
|
if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
|
|
2927
2927
|
let e = [], t = (t) => {
|
|
@@ -2935,15 +2935,15 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2935
2935
|
} else n(null);
|
|
2936
2936
|
}
|
|
2937
2937
|
reloadResources(e, t, n) {
|
|
2938
|
-
let r =
|
|
2939
|
-
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 ||=
|
|
2938
|
+
let r = Ae();
|
|
2939
|
+
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 ||= _t, this.services.backendConnector.reload(e, t, (e) => {
|
|
2940
2940
|
r.resolve(), n(e);
|
|
2941
2941
|
}), r;
|
|
2942
2942
|
}
|
|
2943
2943
|
use(e) {
|
|
2944
2944
|
if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
2945
2945
|
if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
2946
|
-
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" &&
|
|
2946
|
+
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" && Ze.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
2947
2947
|
}
|
|
2948
2948
|
setResolvedLanguage(e) {
|
|
2949
2949
|
if (e && this.languages && !["cimode", "dev"].includes(e)) {
|
|
@@ -2959,7 +2959,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2959
2959
|
}
|
|
2960
2960
|
changeLanguage(e, t) {
|
|
2961
2961
|
this.isLanguageChangingTo = e;
|
|
2962
|
-
let n =
|
|
2962
|
+
let n = Ae();
|
|
2963
2963
|
this.emit("languageChanging", e);
|
|
2964
2964
|
let r = (e) => {
|
|
2965
2965
|
this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
|
|
@@ -2967,7 +2967,7 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2967
2967
|
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));
|
|
2968
2968
|
}, a = (t) => {
|
|
2969
2969
|
!e && !t && this.services.languageDetector && (t = []);
|
|
2970
|
-
let n =
|
|
2970
|
+
let n = P(t) ? t : t && t[0], a = this.store.hasLanguageSomeTranslations(n) ? n : this.services.languageUtils.getBestMatchFromCodes(P(t) ? [t] : t);
|
|
2971
2971
|
a && (this.language || r(a), this.translator.language || this.translator.changeLanguage(a), this.services.languageDetector?.cacheUserLanguage?.(a)), this.loadResources(a, (e) => {
|
|
2972
2972
|
i(e, a);
|
|
2973
2973
|
});
|
|
@@ -2984,11 +2984,11 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
2984
2984
|
...this.options,
|
|
2985
2985
|
...o
|
|
2986
2986
|
};
|
|
2987
|
-
Array.isArray(i) && !s && (c.ns = i), typeof o.keyPrefix == "function" && (o.keyPrefix =
|
|
2987
|
+
Array.isArray(i) && !s && (c.ns = i), typeof o.keyPrefix == "function" && (o.keyPrefix = z(o.keyPrefix, c));
|
|
2988
2988
|
let l = this.options.keySeparator || ".", u;
|
|
2989
|
-
return o.keyPrefix && Array.isArray(e) ? u = e.map((e) => (typeof e == "function" && (e =
|
|
2989
|
+
return o.keyPrefix && Array.isArray(e) ? u = e.map((e) => (typeof e == "function" && (e = z(e, c)), `${o.keyPrefix}${l}${e}`)) : (typeof e == "function" && (e = z(e, c)), u = o.keyPrefix ? `${o.keyPrefix}${l}${e}` : e), this.t(u, o);
|
|
2990
2990
|
};
|
|
2991
|
-
return
|
|
2991
|
+
return P(e) ? a.lng = e : a.lngs = e, a.ns = t, a.keyPrefix = n, a;
|
|
2992
2992
|
}
|
|
2993
2993
|
t(...e) {
|
|
2994
2994
|
return this.translator?.translate(...e);
|
|
@@ -3015,16 +3015,16 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
3015
3015
|
return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
|
|
3016
3016
|
}
|
|
3017
3017
|
loadNamespaces(e, t) {
|
|
3018
|
-
let n =
|
|
3019
|
-
return this.options.ns ? (
|
|
3018
|
+
let n = Ae();
|
|
3019
|
+
return this.options.ns ? (P(e) && (e = [e]), e.forEach((e) => {
|
|
3020
3020
|
this.options.ns.includes(e) || this.options.ns.push(e);
|
|
3021
3021
|
}), this.loadResources((e) => {
|
|
3022
3022
|
n.resolve(), t && t(e);
|
|
3023
3023
|
}), n) : (t && t(), Promise.resolve());
|
|
3024
3024
|
}
|
|
3025
3025
|
loadLanguages(e, t) {
|
|
3026
|
-
let n =
|
|
3027
|
-
|
|
3026
|
+
let n = Ae();
|
|
3027
|
+
P(e) && (e = [e]);
|
|
3028
3028
|
let r = this.options.preload || [], i = e.filter((e) => !r.includes(e) && this.services.languageUtils.isSupportedCode(e));
|
|
3029
3029
|
return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
|
|
3030
3030
|
n.resolve(), t && t(e);
|
|
@@ -3039,14 +3039,14 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
3039
3039
|
if (e && e.direction) return e.direction;
|
|
3040
3040
|
}
|
|
3041
3041
|
} catch {}
|
|
3042
|
-
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
|
|
3042
|
+
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 nt(ht());
|
|
3043
3043
|
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.includes(n.getLanguagePartFromCode(e)) || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
3044
3044
|
}
|
|
3045
3045
|
static createInstance(t = {}, n) {
|
|
3046
3046
|
let r = new e(t, n);
|
|
3047
3047
|
return r.createInstance = e.createInstance, r;
|
|
3048
3048
|
}
|
|
3049
|
-
cloneInstance(t = {}, n =
|
|
3049
|
+
cloneInstance(t = {}, n = _t) {
|
|
3050
3050
|
let r = t.forkResourceStore;
|
|
3051
3051
|
r && delete t.forkResourceStore;
|
|
3052
3052
|
let i = {
|
|
@@ -3060,18 +3060,18 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
3060
3060
|
"language"
|
|
3061
3061
|
].forEach((e) => {
|
|
3062
3062
|
a[e] = this[e];
|
|
3063
|
-
}), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new
|
|
3063
|
+
}), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new Xe(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) {
|
|
3064
3064
|
let e = {
|
|
3065
|
-
...
|
|
3065
|
+
...ht().interpolation,
|
|
3066
3066
|
...this.options.interpolation,
|
|
3067
3067
|
...t.interpolation
|
|
3068
3068
|
}, n = {
|
|
3069
3069
|
...i,
|
|
3070
3070
|
interpolation: e
|
|
3071
3071
|
};
|
|
3072
|
-
a.services.interpolator = new
|
|
3072
|
+
a.services.interpolator = new ct(n);
|
|
3073
3073
|
}
|
|
3074
|
-
return a.translator = new
|
|
3074
|
+
return a.translator = new tt(a.services, i), a.translator.on("*", (e, ...t) => {
|
|
3075
3075
|
a.emit(e, ...t);
|
|
3076
3076
|
}), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
|
|
3077
3077
|
}
|
|
@@ -3085,10 +3085,10 @@ var Qe = (e) => !F(e) && typeof e != "boolean" && typeof e != "number", $e = cla
|
|
|
3085
3085
|
};
|
|
3086
3086
|
}
|
|
3087
3087
|
}.createInstance();
|
|
3088
|
-
|
|
3088
|
+
B.createInstance, B.dir, B.init, B.loadResources, B.reloadResources, B.use, B.changeLanguage, B.getFixedT, B.t, B.exists, B.setDefaultNamespace, B.hasLoadedNamespace, B.loadNamespaces, B.loadLanguages;
|
|
3089
3089
|
//#endregion
|
|
3090
3090
|
//#region node_modules/.pnpm/react-i18next@17.0.13_i18ne_77b937ecedfb676debf3096b5685165d/node_modules/react-i18next/dist/es/unescape.js
|
|
3091
|
-
var
|
|
3091
|
+
var yt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, bt = {
|
|
3092
3092
|
"&": "&",
|
|
3093
3093
|
"&": "&",
|
|
3094
3094
|
"<": "<",
|
|
@@ -3109,7 +3109,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3109
3109
|
"…": "…",
|
|
3110
3110
|
"/": "/",
|
|
3111
3111
|
"/": "/"
|
|
3112
|
-
},
|
|
3112
|
+
}, xt = (e) => bt[e], St = (e) => e.replace(yt, xt), Ct = {
|
|
3113
3113
|
bindI18n: "languageChanged",
|
|
3114
3114
|
bindI18nStore: "",
|
|
3115
3115
|
transEmptyNodeValue: "",
|
|
@@ -3122,21 +3122,21 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3122
3122
|
"p"
|
|
3123
3123
|
],
|
|
3124
3124
|
useSuspense: !0,
|
|
3125
|
-
unescape:
|
|
3125
|
+
unescape: St,
|
|
3126
3126
|
transDefaultProps: void 0
|
|
3127
|
-
},
|
|
3128
|
-
|
|
3129
|
-
...
|
|
3127
|
+
}, wt = (e = {}) => {
|
|
3128
|
+
Ct = {
|
|
3129
|
+
...Ct,
|
|
3130
3130
|
...e
|
|
3131
3131
|
};
|
|
3132
|
-
},
|
|
3133
|
-
|
|
3134
|
-
},
|
|
3132
|
+
}, Tt = () => Ct, Et, Dt = (e) => {
|
|
3133
|
+
Et = e;
|
|
3134
|
+
}, Ot = () => Et, kt = {
|
|
3135
3135
|
type: "3rdParty",
|
|
3136
3136
|
init(e) {
|
|
3137
|
-
|
|
3137
|
+
wt(e.options.react), Dt(e);
|
|
3138
3138
|
}
|
|
3139
|
-
},
|
|
3139
|
+
}, At = /* @__PURE__ */ s(((e, t) => {
|
|
3140
3140
|
(function(n, r) {
|
|
3141
3141
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
|
|
3142
3142
|
})(e, (function() {
|
|
@@ -3430,19 +3430,19 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3430
3430
|
return w(1e3 * e);
|
|
3431
3431
|
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
3432
3432
|
}));
|
|
3433
|
-
})),
|
|
3433
|
+
})), jt = /* @__PURE__ */ u(At(), 1), Mt = (e = Date.now(), t = "YYYY-MM-DD HH:mm:ss") => (0, jt.default)(e).format(t), Nt = (e) => Object.prototype.toString.call(e).slice(8, -1).toLowerCase(), Pt = (e, t) => Nt(e).includes(t), Ft = (e = {}, t = {}) => {
|
|
3434
3434
|
for (let n of Object.keys(t)) {
|
|
3435
3435
|
let r = t[n];
|
|
3436
|
-
|
|
3436
|
+
Pt(r, "object") ? (e[n] || (e[n] = {}), Ft(e[n], r)) : e[n] = r;
|
|
3437
3437
|
}
|
|
3438
3438
|
return e;
|
|
3439
|
-
},
|
|
3439
|
+
}, V = (e, t, n) => {
|
|
3440
3440
|
for (let r of t) Reflect.defineProperty(e, r, {
|
|
3441
3441
|
value: e[r],
|
|
3442
3442
|
...n
|
|
3443
3443
|
});
|
|
3444
3444
|
return e;
|
|
3445
|
-
},
|
|
3445
|
+
}, It = { ui: {
|
|
3446
3446
|
tool: {
|
|
3447
3447
|
add: "添加",
|
|
3448
3448
|
cancel: "取消",
|
|
@@ -3576,7 +3576,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3576
3576
|
dayNg: "当日NG",
|
|
3577
3577
|
clearTime: "清空时间"
|
|
3578
3578
|
}
|
|
3579
|
-
} },
|
|
3579
|
+
} }, Lt = { ui: {
|
|
3580
3580
|
tool: {
|
|
3581
3581
|
add: "Add",
|
|
3582
3582
|
cancel: "Cancel",
|
|
@@ -3710,22 +3710,23 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3710
3710
|
dayNg: "Daily NG",
|
|
3711
3711
|
clearTime: "Clear time"
|
|
3712
3712
|
}
|
|
3713
|
-
} },
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3713
|
+
} }, Rt = (e, t) => {
|
|
3714
|
+
if (!t) return [];
|
|
3715
|
+
let n = [], r = Ft(e, {
|
|
3716
|
+
zh: It,
|
|
3717
|
+
en: Lt
|
|
3717
3718
|
}), i = Object.keys(r), a = i.reduce((e, t) => {
|
|
3718
3719
|
let i = r[t];
|
|
3719
3720
|
return e[t] = { translation: i }, i?.ui || n.push(t), e;
|
|
3720
3721
|
}, {});
|
|
3721
|
-
return
|
|
3722
|
+
return B.use(kt).init({
|
|
3722
3723
|
lng: t,
|
|
3723
3724
|
resources: a,
|
|
3724
3725
|
interpolation: { escapeValue: !1 }
|
|
3725
3726
|
}), n.length ? [] : i;
|
|
3726
|
-
},
|
|
3727
|
-
return n === "toString" || typeof n == "symbol" ? void 0 :
|
|
3728
|
-
} }),
|
|
3727
|
+
}, zt = (e = "") => new Proxy((t) => B.t(e, t), { get(t, n) {
|
|
3728
|
+
return n === "toString" || typeof n == "symbol" ? void 0 : zt(e ? `${e}.${n}` : n);
|
|
3729
|
+
} }), H = zt("ui"), Bt = class {
|
|
3729
3730
|
#e = {};
|
|
3730
3731
|
#t = new EventTarget();
|
|
3731
3732
|
emit = (e, t) => (this.#t.dispatchEvent(new CustomEvent(e, { detail: t })), this);
|
|
@@ -3748,18 +3749,18 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3748
3749
|
}
|
|
3749
3750
|
return this;
|
|
3750
3751
|
};
|
|
3751
|
-
},
|
|
3752
|
+
}, Vt = [
|
|
3752
3753
|
"systemError",
|
|
3753
3754
|
"messageUpdated",
|
|
3754
3755
|
"defectUpdated",
|
|
3755
3756
|
"systemMode",
|
|
3756
3757
|
"historyUpdated",
|
|
3757
3758
|
"recordUpdated"
|
|
3758
|
-
],
|
|
3759
|
-
let t = [...
|
|
3760
|
-
for (let e of t)
|
|
3761
|
-
return t.length ===
|
|
3762
|
-
}, { emit:
|
|
3759
|
+
], U = {}, Ht = (e = []) => {
|
|
3760
|
+
let t = [...Vt, ...e];
|
|
3761
|
+
for (let e of t) U[e] = e.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
3762
|
+
return t.length === Vt.length + e.length;
|
|
3763
|
+
}, { emit: W, emitSync: Ut, on: Wt, off: Gt, once: Kt, clear: qt } = new Bt(), Jt = {
|
|
3763
3764
|
0: {
|
|
3764
3765
|
editing: !0,
|
|
3765
3766
|
visible: !0,
|
|
@@ -3775,7 +3776,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3775
3776
|
visible: !1,
|
|
3776
3777
|
operate: !1
|
|
3777
3778
|
}
|
|
3778
|
-
},
|
|
3779
|
+
}, Yt = V({
|
|
3779
3780
|
dayOk: {
|
|
3780
3781
|
type: "text",
|
|
3781
3782
|
value: 0
|
|
@@ -3786,7 +3787,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3786
3787
|
},
|
|
3787
3788
|
date: {
|
|
3788
3789
|
type: "text",
|
|
3789
|
-
value: (0,
|
|
3790
|
+
value: (0, jt.default)().subtract(1, "day").format("YYYY-MM-DD"),
|
|
3790
3791
|
visible: !1
|
|
3791
3792
|
},
|
|
3792
3793
|
clearTime: {
|
|
@@ -3795,27 +3796,30 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3795
3796
|
},
|
|
3796
3797
|
toProps: () => {
|
|
3797
3798
|
let e = {};
|
|
3798
|
-
for (let t in
|
|
3799
|
+
for (let t in Yt) e[t] = Yt[t].value;
|
|
3799
3800
|
return e;
|
|
3800
3801
|
}
|
|
3801
3802
|
}, ["toProps"], {
|
|
3802
3803
|
enumerable: !1,
|
|
3803
3804
|
writable: !1,
|
|
3804
3805
|
configurable: !1
|
|
3805
|
-
}),
|
|
3806
|
+
}), Xt = [
|
|
3806
3807
|
15,
|
|
3807
3808
|
25,
|
|
3808
3809
|
50,
|
|
3809
3810
|
100
|
|
3810
|
-
],
|
|
3811
|
+
], Zt = [
|
|
3811
3812
|
24,
|
|
3812
3813
|
240,
|
|
3813
3814
|
138
|
|
3814
|
-
],
|
|
3815
|
+
], Qt = "#808080", $t = "app-config-set", en = {
|
|
3815
3816
|
INFO: 0,
|
|
3816
3817
|
WARN: 1,
|
|
3817
3818
|
ERROR: 2
|
|
3818
|
-
},
|
|
3819
|
+
}, tn = {
|
|
3820
|
+
0: "zh",
|
|
3821
|
+
1: "en"
|
|
3822
|
+
}, nn = new class {
|
|
3819
3823
|
#e = !1;
|
|
3820
3824
|
#t = [];
|
|
3821
3825
|
#n = "";
|
|
@@ -3829,26 +3833,26 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3829
3833
|
return this.#e;
|
|
3830
3834
|
}
|
|
3831
3835
|
set work(e) {
|
|
3832
|
-
this.#e = e, this.#n = e ?
|
|
3836
|
+
this.#e = e, this.#n = e ? G.workDefectPath : G.globalDefectPath, this.read(this.#n, this.#e);
|
|
3833
3837
|
}
|
|
3834
3838
|
constructor() {
|
|
3835
3839
|
this.#t.splice(0, this.#t.length);
|
|
3836
3840
|
}
|
|
3837
3841
|
#r() {
|
|
3838
|
-
|
|
3842
|
+
W(U.defectUpdated);
|
|
3839
3843
|
}
|
|
3840
3844
|
setValue(e, t = null) {
|
|
3841
|
-
this.value = e, t?.(
|
|
3845
|
+
this.value = e, t?.(H.tool.setOk(), { key: $t });
|
|
3842
3846
|
}
|
|
3843
3847
|
read(e, t = this.#e) {
|
|
3844
3848
|
this.#n = e, this.#e = t, Y.access(this.#n, Y.constants.F_OK, (e) => {
|
|
3845
|
-
e ?
|
|
3849
|
+
e ? En(this.#n, this.#t) : Tn(this.#n, (e) => {
|
|
3846
3850
|
this.#t = e, this.#r();
|
|
3847
3851
|
});
|
|
3848
3852
|
});
|
|
3849
3853
|
}
|
|
3850
3854
|
write() {
|
|
3851
|
-
|
|
3855
|
+
En(this.#n, this.#t);
|
|
3852
3856
|
}
|
|
3853
3857
|
get(e) {
|
|
3854
3858
|
return this.#t.find((t) => t.type === e);
|
|
@@ -3893,7 +3897,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3893
3897
|
t && e[t.type]++;
|
|
3894
3898
|
}
|
|
3895
3899
|
}
|
|
3896
|
-
}(),
|
|
3900
|
+
}(), rn = "basic_config.json", G = V({
|
|
3897
3901
|
workDir: "{workDir}",
|
|
3898
3902
|
rootDir: "{rootDir}",
|
|
3899
3903
|
dataDir: "{workDir}/Data",
|
|
@@ -3908,7 +3912,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3908
3912
|
enumerable: !1,
|
|
3909
3913
|
writable: !0,
|
|
3910
3914
|
configurable: !0
|
|
3911
|
-
}),
|
|
3915
|
+
}), an = {
|
|
3912
3916
|
saveDir: "",
|
|
3913
3917
|
recordSaveTime: 30,
|
|
3914
3918
|
ngImageSaveTime: 30,
|
|
@@ -3923,28 +3927,28 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3923
3927
|
DatabaseName: "aoi",
|
|
3924
3928
|
UserName: "root",
|
|
3925
3929
|
Password: "123456"
|
|
3926
|
-
},
|
|
3927
|
-
let e = JSON.stringify(
|
|
3928
|
-
return
|
|
3929
|
-
},
|
|
3930
|
-
let t = await
|
|
3931
|
-
return t &&
|
|
3932
|
-
},
|
|
3930
|
+
}, on = () => {
|
|
3931
|
+
let e = JSON.stringify(K, void 0, 4);
|
|
3932
|
+
return En(G.settingPath, e), !0;
|
|
3933
|
+
}, sn = async (e = !0) => {
|
|
3934
|
+
let t = await Tn(G.settingPath, e);
|
|
3935
|
+
return t && cn(t, !1), K.onChange?.(), !0;
|
|
3936
|
+
}, cn = (e = {}, t = !0) => {
|
|
3933
3937
|
let n = !1, r = {};
|
|
3934
|
-
for (let t of Object.keys(
|
|
3935
|
-
Object.keys(r).length > 0 &&
|
|
3936
|
-
},
|
|
3938
|
+
for (let t of Object.keys(K)) e[t] === void 0 ? (e[t] = an[t], n = !0) : (K[t] !== e[t] && (K[t] = e[t], n = !0), t.endsWith("Mode") && (r[t] = e[t]));
|
|
3939
|
+
Object.keys(r).length > 0 && W(U.systemMode, r), t && n && on();
|
|
3940
|
+
}, ln = async (e = !0) => {
|
|
3937
3941
|
let { exe: t } = $;
|
|
3938
|
-
return
|
|
3939
|
-
},
|
|
3940
|
-
...
|
|
3941
|
-
setConfig:
|
|
3942
|
+
return q.level = (await Tn(G.userPath, e))?.UserLevel ?? 0, q.userName = t.getUserName(), q.onChange?.(), !0;
|
|
3943
|
+
}, K = V({
|
|
3944
|
+
...an,
|
|
3945
|
+
setConfig: cn,
|
|
3942
3946
|
onChange: void 0
|
|
3943
3947
|
}, ["setConfig", "onChange"], {
|
|
3944
3948
|
enumerable: !1,
|
|
3945
3949
|
writable: !0,
|
|
3946
3950
|
configurable: !0
|
|
3947
|
-
}),
|
|
3951
|
+
}), q = V({
|
|
3948
3952
|
level: 0,
|
|
3949
3953
|
userName: null,
|
|
3950
3954
|
onChange: void 0
|
|
@@ -3952,14 +3956,21 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3952
3956
|
enumerable: !1,
|
|
3953
3957
|
writable: !0,
|
|
3954
3958
|
configurable: !0
|
|
3955
|
-
}),
|
|
3956
|
-
let
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
},
|
|
3959
|
+
}), un = (e = {}) => {
|
|
3960
|
+
let t = Tn(`${G.rootDir}/${rn}`, !1), n = { ...e };
|
|
3961
|
+
if (t && t?.basic_config) {
|
|
3962
|
+
let { language: e } = t.basic_config;
|
|
3963
|
+
n.lang ??= tn?.[e];
|
|
3964
|
+
}
|
|
3965
|
+
return n;
|
|
3966
|
+
}, dn = (e = {}, t = {}) => {
|
|
3967
|
+
let { exe: n } = $, r = n.getWorkDir(), i = n.getCurrentPath();
|
|
3968
|
+
G.workDir = r, G.rootDir = i;
|
|
3969
|
+
for (let e in G) G[e] = G[e].replace(/\{(\w+)\}/g, (e, t) => G[t]);
|
|
3970
|
+
K.saveDir = G.dataDir, Object.assign(K, e), Kt(U.systemMode, ({ detail: e }) => nn.work = !!e?.defectMode);
|
|
3971
|
+
for (let e of ["dataDir", "ngImagesDir"]) Y.mkdir(G[e], { recursive: !0 }, () => {});
|
|
3972
|
+
return Y.existsSync(G.settingPath) ? sn(!1) : on(), Y.existsSync(G.userPath) && ln(!1), setTimeout(() => Dn(G.settingPath, sn), 1e3), setTimeout(() => Dn(G.userPath, ln), 1e3), un(t);
|
|
3973
|
+
}, fn = () => G.workDir.replace(/\\/g, "/").match(/[^/]+$/)?.[0], J = new class {
|
|
3963
3974
|
maxLength = 100;
|
|
3964
3975
|
#e = [];
|
|
3965
3976
|
get value() {
|
|
@@ -3972,7 +3983,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3972
3983
|
this.#e.splice(0, this.#e.length);
|
|
3973
3984
|
}
|
|
3974
3985
|
#t() {
|
|
3975
|
-
|
|
3986
|
+
W(U.messageUpdated);
|
|
3976
3987
|
}
|
|
3977
3988
|
#n(e, t, n, r = {}) {
|
|
3978
3989
|
let i = Date.now();
|
|
@@ -3986,13 +3997,13 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3986
3997
|
}), this.#e.length > this.maxLength && this.#e.pop(), this.#t(), i;
|
|
3987
3998
|
}
|
|
3988
3999
|
error(e, t, n) {
|
|
3989
|
-
return this.#n("error", e, t ??
|
|
4000
|
+
return this.#n("error", e, t ?? H.tool.error(), n);
|
|
3990
4001
|
}
|
|
3991
4002
|
warning(e, t, n) {
|
|
3992
|
-
return this.#n("warning", e, t ??
|
|
4003
|
+
return this.#n("warning", e, t ?? H.tool.warning(), n);
|
|
3993
4004
|
}
|
|
3994
4005
|
info(e, t, n) {
|
|
3995
|
-
return this.#n("info", e, t ??
|
|
4006
|
+
return this.#n("info", e, t ?? H.tool.info(), n);
|
|
3996
4007
|
}
|
|
3997
4008
|
delete(e) {
|
|
3998
4009
|
let t = this.#e.findIndex((t) => t.id === e);
|
|
@@ -4009,31 +4020,31 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4009
4020
|
clear() {
|
|
4010
4021
|
this.#e.splice(0, this.#e.length), this.#t();
|
|
4011
4022
|
}
|
|
4012
|
-
}(), Y = typeof __non_webpack_require__ == "function" ? __non_webpack_require__("fs") : typeof globalThis.require == "function" ? globalThis.require("fs") : null,
|
|
4023
|
+
}(), Y = typeof __non_webpack_require__ == "function" ? __non_webpack_require__("fs") : typeof globalThis.require == "function" ? globalThis.require("fs") : null, pn = (e, t = 1500) => {
|
|
4013
4024
|
let n = null;
|
|
4014
4025
|
return function(...r) {
|
|
4015
4026
|
n && clearTimeout(n), n = setTimeout(e.bind(this, ...r), t);
|
|
4016
4027
|
};
|
|
4017
|
-
},
|
|
4028
|
+
}, mn = (e, t = 1500) => {
|
|
4018
4029
|
let n = null;
|
|
4019
4030
|
return function(...r) {
|
|
4020
4031
|
n ||= setTimeout(() => {
|
|
4021
4032
|
e.call(this, ...r), n = null;
|
|
4022
4033
|
}, t);
|
|
4023
4034
|
};
|
|
4024
|
-
},
|
|
4035
|
+
}, hn = (e) => {
|
|
4025
4036
|
if (!e || typeof e != "object") return e;
|
|
4026
4037
|
let t = e.constructor();
|
|
4027
|
-
for (let n in e) Object.hasOwn(e, n) && (t[n] =
|
|
4038
|
+
for (let n in e) Object.hasOwn(e, n) && (t[n] = hn(e[n]));
|
|
4028
4039
|
return t;
|
|
4029
|
-
},
|
|
4040
|
+
}, gn = (e, t) => {
|
|
4030
4041
|
if (e === t) return !0;
|
|
4031
4042
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
4032
4043
|
let n = Object.keys(e), r = Object.keys(t);
|
|
4033
4044
|
if (n.length !== r.length) return !1;
|
|
4034
|
-
for (let i of n) if (!r.includes(i) || !
|
|
4045
|
+
for (let i of n) if (!r.includes(i) || !gn(e[i], t[i])) return !1;
|
|
4035
4046
|
return !0;
|
|
4036
|
-
},
|
|
4047
|
+
}, _n = (e = "_") => `${Date.now()}${e}${Math.floor(Math.random() * 1e4)}`, vn = (e) => e == null ? !1 : typeof e == "string" || Array.isArray(e) ? e.length > 0 : typeof e != "object" || Object.keys(e).length > 0, yn = (e, t = {}) => {
|
|
4037
4048
|
try {
|
|
4038
4049
|
let n = O(e);
|
|
4039
4050
|
for (let e in t) n = n[e]?.(t[e]);
|
|
@@ -4041,10 +4052,10 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4041
4052
|
} catch {
|
|
4042
4053
|
return !1;
|
|
4043
4054
|
}
|
|
4044
|
-
},
|
|
4055
|
+
}, bn = (e) => {
|
|
4045
4056
|
let t = $.token?.[e];
|
|
4046
|
-
return
|
|
4047
|
-
},
|
|
4057
|
+
return vn(t) ? t : getComputedStyle(document.getElementById("root")).getPropertyValue(`--aoi-${e}`).trim();
|
|
4058
|
+
}, xn = (e = pe) => {
|
|
4048
4059
|
let t;
|
|
4049
4060
|
switch (e) {
|
|
4050
4061
|
case "small":
|
|
@@ -4056,18 +4067,18 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4056
4067
|
default: t = $.token.controlHeight ?? 32;
|
|
4057
4068
|
}
|
|
4058
4069
|
return Number.parseInt(t);
|
|
4059
|
-
},
|
|
4070
|
+
}, Sn = (e, t = 2) => {
|
|
4060
4071
|
let n = Number(e);
|
|
4061
4072
|
return Number.isNaN(n) ? 0 : Number(n.toFixed(t));
|
|
4062
|
-
},
|
|
4073
|
+
}, Cn = (e, t = {}, n = {}) => {
|
|
4063
4074
|
let r = e.constructor === String ? document.createElement(e) : e;
|
|
4064
|
-
for (let [e, n] of Object.entries(t)) n.constructor === Object ?
|
|
4075
|
+
for (let [e, n] of Object.entries(t)) n.constructor === Object ? Cn(r[e], n) : e.startsWith("--") ? r.setProperty(e, n) : r[e] = n;
|
|
4065
4076
|
for (let [e, t] of Object.entries(n)) r.addEventListener(e, t);
|
|
4066
4077
|
return r;
|
|
4067
|
-
},
|
|
4078
|
+
}, wn = (e) => {
|
|
4068
4079
|
e?.stopPropagation(), e?.preventDefault(), e.cancelBubble = !0;
|
|
4069
|
-
},
|
|
4070
|
-
if (
|
|
4080
|
+
}, Tn = (e, t = !1) => {
|
|
4081
|
+
if (Pt(t, "function")) {
|
|
4071
4082
|
Y.readFile(e, "utf-8", (n, r) => {
|
|
4072
4083
|
if (n || !r) {
|
|
4073
4084
|
n && $.dev && console.error(n);
|
|
@@ -4075,7 +4086,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4075
4086
|
}
|
|
4076
4087
|
let i = X(r);
|
|
4077
4088
|
if (!i) {
|
|
4078
|
-
J.error(
|
|
4089
|
+
J.error(H.file.filePath({ path: e }), H.file.readErr());
|
|
4079
4090
|
return;
|
|
4080
4091
|
}
|
|
4081
4092
|
t(i);
|
|
@@ -4094,14 +4105,14 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4094
4105
|
return t ? X(t) : null;
|
|
4095
4106
|
}
|
|
4096
4107
|
} catch (t) {
|
|
4097
|
-
return J.error(
|
|
4108
|
+
return J.error(H.file.filePath({ path: e }), H.file.readErr()), $.dev && console.error(t), null;
|
|
4098
4109
|
}
|
|
4099
|
-
},
|
|
4100
|
-
Y.writeFile(e,
|
|
4101
|
-
n?.(t), t && (J.error(
|
|
4110
|
+
}, En = (e, t, n) => {
|
|
4111
|
+
Y.writeFile(e, On(t), "utf-8", (t) => {
|
|
4112
|
+
n?.(t), t && (J.error(H.file.filePath({ path: e }), H.file.writeErr()), $.dev && console.error(t));
|
|
4102
4113
|
});
|
|
4103
|
-
},
|
|
4104
|
-
|
|
4114
|
+
}, Dn = (e, t) => {
|
|
4115
|
+
Pt(t, "function") && Y.watch(e, (e) => {
|
|
4105
4116
|
e === "change" && (clearTimeout(t?.timer), t.timer = setTimeout(t, 1e3));
|
|
4106
4117
|
});
|
|
4107
4118
|
}, X = (e, t = null) => {
|
|
@@ -4111,15 +4122,15 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4111
4122
|
} catch {
|
|
4112
4123
|
return t;
|
|
4113
4124
|
}
|
|
4114
|
-
},
|
|
4125
|
+
}, On = (e, t = "") => {
|
|
4115
4126
|
if (typeof e == "string") return e;
|
|
4116
4127
|
try {
|
|
4117
4128
|
return JSON.stringify(e);
|
|
4118
4129
|
} catch {
|
|
4119
4130
|
return t;
|
|
4120
4131
|
}
|
|
4121
|
-
},
|
|
4122
|
-
let { x: n = 0, y: r = 0, w: i = 0, h: a = 0, fileName: o, prefixDir: s =
|
|
4132
|
+
}, kn = (e, t = {}) => {
|
|
4133
|
+
let { x: n = 0, y: r = 0, w: i = 0, h: a = 0, fileName: o, prefixDir: s = G.ngImagesDir, ratio: c = K.ngImgRatio } = t;
|
|
4123
4134
|
if (!e || n <= 0 || r <= 0 || i <= 0 || a <= 0 || !o) return !0;
|
|
4124
4135
|
try {
|
|
4125
4136
|
let t = `${s}/${o}`, l = t.split(".").pop().toLowerCase();
|
|
@@ -4128,7 +4139,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4128
4139
|
"jpeg",
|
|
4129
4140
|
"png",
|
|
4130
4141
|
"bmp"
|
|
4131
|
-
].includes(l) || (t += `.${
|
|
4142
|
+
].includes(l) || (t += `.${K.ngImgSuffix}`);
|
|
4132
4143
|
let u = t.substring(0, t.lastIndexOf("/"));
|
|
4133
4144
|
Y.existsSync(u) || Y.mkdirSync(u, { recursive: !0 });
|
|
4134
4145
|
let { cv: d } = $, f = d.cropSharedMemImage(e, n, r, n + i, r + a);
|
|
@@ -4140,8 +4151,8 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4140
4151
|
} catch (e) {
|
|
4141
4152
|
return $.dev && console.error(e), !0;
|
|
4142
4153
|
}
|
|
4143
|
-
},
|
|
4144
|
-
let { fileName: t, prefixDir: n =
|
|
4154
|
+
}, An = (e = {}) => {
|
|
4155
|
+
let { fileName: t, prefixDir: n = G.ngImagesDir } = e;
|
|
4145
4156
|
if (!t) return;
|
|
4146
4157
|
let r = `${n}/${t}`, i = r.split(".").pop().toLowerCase();
|
|
4147
4158
|
[
|
|
@@ -4149,26 +4160,26 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4149
4160
|
"jpeg",
|
|
4150
4161
|
"png",
|
|
4151
4162
|
"bmp"
|
|
4152
|
-
].includes(i) || (r += `.${
|
|
4163
|
+
].includes(i) || (r += `.${K.ngImgSuffix}`);
|
|
4153
4164
|
let { cv: a } = $;
|
|
4154
4165
|
return new Promise((e, t) => {
|
|
4155
4166
|
a.imread(r, (t, n) => {
|
|
4156
4167
|
t ? ($.dev && console.error("error read image: ", t), e(!1)) : e(n);
|
|
4157
4168
|
});
|
|
4158
4169
|
});
|
|
4159
|
-
},
|
|
4160
|
-
let { fileName: t, prefixDir: n =
|
|
4170
|
+
}, jn = async (e = {}) => {
|
|
4171
|
+
let { fileName: t, prefixDir: n = G.ngImagesDir } = e;
|
|
4161
4172
|
if (!t) return;
|
|
4162
4173
|
let r = n ? `${n}/${t}` : t;
|
|
4163
4174
|
if (!Y.existsSync(r)) return;
|
|
4164
4175
|
let { exe: i } = $;
|
|
4165
4176
|
return await i.deletePath(r) === "delete successed";
|
|
4166
|
-
},
|
|
4167
|
-
let { cv: r } = $, i =
|
|
4177
|
+
}, Mn = (e, t = "", n = []) => {
|
|
4178
|
+
let { cv: r } = $, i = G.dataDir;
|
|
4168
4179
|
return e ? r.getOpenFileName(t, `*${n.join(";*")}`, i) : r.getExistingDirectory(t, i);
|
|
4169
|
-
},
|
|
4180
|
+
}, Nn = (e, ...t) => e.replace(/\?/g, () => {
|
|
4170
4181
|
let e = t.shift();
|
|
4171
|
-
return e instanceof Object && (e =
|
|
4182
|
+
return e instanceof Object && (e = On(e, void 0)), typeof e == "string" ? e.length ? `'${e}'` : "null" : e === void 0 ? "null" : e;
|
|
4172
4183
|
}).replace(/[\n\r\s]+/g, " "), Z = "journal", Q = {
|
|
4173
4184
|
tableName: Z,
|
|
4174
4185
|
fields: {
|
|
@@ -4188,7 +4199,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4188
4199
|
},
|
|
4189
4200
|
operate: "operate",
|
|
4190
4201
|
message: "message"
|
|
4191
|
-
},
|
|
4202
|
+
}, Pn = class {
|
|
4192
4203
|
#e = [];
|
|
4193
4204
|
#t = !1;
|
|
4194
4205
|
get sqls() {
|
|
@@ -4199,28 +4210,28 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4199
4210
|
}
|
|
4200
4211
|
constructor(e = []) {
|
|
4201
4212
|
let { exe: t } = $;
|
|
4202
|
-
this.#e = [...e, Q], this.#t = this.#e?.length <= 1 || this.#e.some((e) => t.verifyDatabase(e.tableName,
|
|
4213
|
+
this.#e = [...e, Q], this.#t = this.#e?.length <= 1 || this.#e.some((e) => t.verifyDatabase(e.tableName, On(e.fields)));
|
|
4203
4214
|
}
|
|
4204
4215
|
async #n({ tableName: e, sqlKey: t, typeErr: n, execFunc: r }, ...i) {
|
|
4205
4216
|
let a = this.getTable(e);
|
|
4206
4217
|
if (!a) return !1;
|
|
4207
|
-
let { exe: o } = $, s =
|
|
4218
|
+
let { exe: o } = $, s = Nn(a.sqls?.[t] ?? t, ...i);
|
|
4208
4219
|
try {
|
|
4209
4220
|
let e = await r(o, s);
|
|
4210
4221
|
if (e) return e;
|
|
4211
4222
|
throw Error();
|
|
4212
4223
|
} catch (e) {
|
|
4213
|
-
return J.error(
|
|
4224
|
+
return J.error(H.sql.execErr({ error: s }), n), $.dev && console.error(e), !1;
|
|
4214
4225
|
}
|
|
4215
4226
|
}
|
|
4216
4227
|
getTable(e) {
|
|
4217
|
-
return this.#e.find((t) => t.tableName === e) || (J.error(
|
|
4228
|
+
return this.#e.find((t) => t.tableName === e) || (J.error(H.sql.tableErr({ tableName: e }), H.sql.error()), !1);
|
|
4218
4229
|
}
|
|
4219
4230
|
update(e, t, ...n) {
|
|
4220
4231
|
return this.#n({
|
|
4221
4232
|
tableName: e,
|
|
4222
4233
|
sqlKey: t,
|
|
4223
|
-
typeErr:
|
|
4234
|
+
typeErr: H.sql.updateErr(),
|
|
4224
4235
|
execFunc: async (e, t) => await e.writeDataBase(t) === 0
|
|
4225
4236
|
}, ...n);
|
|
4226
4237
|
}
|
|
@@ -4228,7 +4239,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4228
4239
|
return this.#n({
|
|
4229
4240
|
tableName: e,
|
|
4230
4241
|
sqlKey: t,
|
|
4231
|
-
typeErr:
|
|
4242
|
+
typeErr: H.sql.selectErr(),
|
|
4232
4243
|
execFunc: async (e, t) => {
|
|
4233
4244
|
let n = await e.findDataBaseData(t);
|
|
4234
4245
|
return n?.length ? X(n, []) : [];
|
|
@@ -4239,7 +4250,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4239
4250
|
return this.#n({
|
|
4240
4251
|
tableName: e,
|
|
4241
4252
|
sqlKey: t,
|
|
4242
|
-
typeErr:
|
|
4253
|
+
typeErr: H.sql.selectErr(),
|
|
4243
4254
|
execFunc: async (e, t) => {
|
|
4244
4255
|
let n = await e.findSingleDataBaseData(t);
|
|
4245
4256
|
return n?.length ? X(n) : null;
|
|
@@ -4250,24 +4261,24 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4250
4261
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
4251
4262
|
for (let r of e) {
|
|
4252
4263
|
let e = this.#e.find((e) => e.tableName === r.name);
|
|
4253
|
-
e ? n.push(
|
|
4264
|
+
e ? n.push(Nn(e.sqls?.[r.key] ?? r.key, ...r?.params ?? [])) : t.add(r.name);
|
|
4254
4265
|
}
|
|
4255
4266
|
if (t.size) {
|
|
4256
4267
|
let e = Array.from(t).join(", ");
|
|
4257
|
-
return J.error(
|
|
4268
|
+
return J.error(H.sql.tableErr({ tableName: e }), H.sql.error()), !1;
|
|
4258
4269
|
}
|
|
4259
4270
|
let { exe: r } = $, i = n.join("&");
|
|
4260
4271
|
try {
|
|
4261
4272
|
if (await r.batchWriteDataBase(i)) return !0;
|
|
4262
4273
|
throw Error();
|
|
4263
4274
|
} catch (e) {
|
|
4264
|
-
return J.error(
|
|
4275
|
+
return J.error(H.sql.execErr({ error: i }), H.sql.batchErr()), $.dev && console.error(e), !1;
|
|
4265
4276
|
}
|
|
4266
4277
|
}
|
|
4267
4278
|
async #r({ type: e, grade: t, user: n, content: r }) {
|
|
4268
|
-
let { exe: i } = $, a = Date.now(), o =
|
|
4279
|
+
let { exe: i } = $, a = Date.now(), o = Mt(a), s = n ?? q.userName;
|
|
4269
4280
|
try {
|
|
4270
|
-
let n =
|
|
4281
|
+
let n = Nn(Q.sqls.insertSql, a, o, e, t, s, r);
|
|
4271
4282
|
await i.writeDataBase(n);
|
|
4272
4283
|
} catch (e) {
|
|
4273
4284
|
$.dev && console.error(e);
|
|
@@ -4279,7 +4290,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4279
4290
|
grade: e,
|
|
4280
4291
|
user: n,
|
|
4281
4292
|
content: t
|
|
4282
|
-
}),
|
|
4293
|
+
}), W(U.recordUpdated, Q.operate);
|
|
4283
4294
|
}
|
|
4284
4295
|
async logMessage(e, t, n) {
|
|
4285
4296
|
await this.#r({
|
|
@@ -4287,12 +4298,12 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4287
4298
|
grade: e,
|
|
4288
4299
|
user: n,
|
|
4289
4300
|
content: t
|
|
4290
|
-
}),
|
|
4301
|
+
}), W(U.recordUpdated, Q.message);
|
|
4291
4302
|
}
|
|
4292
|
-
},
|
|
4293
|
-
let t = new
|
|
4303
|
+
}, Fn = (e) => {
|
|
4304
|
+
let t = new Pn(e);
|
|
4294
4305
|
return !t.error && t;
|
|
4295
|
-
},
|
|
4306
|
+
}, In = new class {
|
|
4296
4307
|
maxLength = 3;
|
|
4297
4308
|
#e = [];
|
|
4298
4309
|
get length() {
|
|
@@ -4323,7 +4334,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4323
4334
|
this.#e.splice(0, this.#e.length);
|
|
4324
4335
|
}
|
|
4325
4336
|
}(), $ = {
|
|
4326
|
-
token:
|
|
4337
|
+
token: ke,
|
|
4327
4338
|
langs: [],
|
|
4328
4339
|
exe: null,
|
|
4329
4340
|
cv: null,
|
|
@@ -4333,8 +4344,8 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4333
4344
|
dev: !1,
|
|
4334
4345
|
level: null,
|
|
4335
4346
|
project: {}
|
|
4336
|
-
},
|
|
4337
|
-
$.exe = e, $.cv = t, $.neat = n, $.dev = r, $.level =
|
|
4347
|
+
}, Ln = ({ exe: e = null, cv: t = null, neat: n = !1, dev: r = !1, resource: i = {}, defaultLang: a = "zh", lang: o, sqls: s = [], evt: c = [], level: l = {}, config: u = {}, project: d = {}, imgQueueLen: f = 3, msgMaxLen: p = 100 } = {}) => {
|
|
4348
|
+
$.exe = e, $.cv = t, $.neat = n, $.dev = r, $.level = l, $.db = Fn(s), $.evt = Ht(c), $.langs = Rt(i, dn(u, { lang: o }).lang ?? a), $.project = Object.assign(d, Yt.toProps()), J.maxLength = p, In.maxLength = f;
|
|
4338
4349
|
};
|
|
4339
4350
|
//#endregion
|
|
4340
|
-
export {
|
|
4351
|
+
export { Pt as $, dn as A, Xt as B, Sn as C, En as D, Dn as E, Qt as F, Ut as G, U as H, $t as I, Wt as J, Ht as K, Zt as L, K as M, q as N, J as O, nn as P, Mt as Q, Yt as R, xn as S, _n as T, qt as U, Jt as V, W, H as X, Kt as Y, Ft as Z, Cn as _, d as _t, Fn as a, St as at, mn as b, gn as c, Oe as ct, vn as d, pe as dt, V as et, X as f, me as ft, kn as g, c as gt, jn as h, s as ht, Q as i, Tt as it, fn as j, G as k, Y as l, we as lt, An as m, O as mt, Ln as n, At as nt, pn as o, B as ot, Tn as p, fe as pt, Gt as q, In as r, Ot as rt, hn as s, z as st, $ as t, Nt as tt, Mn as u, Te as ut, wn as v, u as vt, bn as w, yn as x, On as y, en as z };
|