@embeddable.com/remarkable-pro 0.1.22 → 0.1.23
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/BarChartDefaultHorizontalPro.js +1 -1
- package/dist/BarChartDefaultPro.js +1 -1
- package/dist/BarChartGroupedHorizontalPro.js +1 -1
- package/dist/BarChartGroupedPro.js +1 -1
- package/dist/BarChartStackedHorizontalPro.js +1 -1
- package/dist/BarChartStackedPro.js +1 -1
- package/dist/{ChartCard-BFcOkho8.js → ChartCard-DTKoe0RT.js} +2 -2
- package/dist/{ChartCard-BFcOkho8.js.map → ChartCard-DTKoe0RT.js.map} +1 -1
- package/dist/ComparisonPeriodSelectFieldPro.js +1 -1
- package/dist/DateRangePickerCustomPro.js +1 -1
- package/dist/DateRangeSelectFieldPro.js +1 -1
- package/dist/{DimensionAndMeasureSingleSelectField-2wIcQDeB.js → DimensionAndMeasureSingleSelectField-ZjxP2UaF.js} +2 -2
- package/dist/{DimensionAndMeasureSingleSelectField-2wIcQDeB.js.map → DimensionAndMeasureSingleSelectField-ZjxP2UaF.js.map} +1 -1
- package/dist/DimensionMeasureMultiSelectFieldPro.js +1 -1
- package/dist/DimensionSingleSelectFieldPro.js +1 -1
- package/dist/DonutChartPro.js +1 -1
- package/dist/DonutLabelChartPro.js +1 -1
- package/dist/{EditorCard-3dZSYRt5.js → EditorCard-DhASZ5NL.js} +2 -2
- package/dist/{EditorCard-3dZSYRt5.js.map → EditorCard-DhASZ5NL.js.map} +1 -1
- package/dist/{GranularitySelectField-UPP_rxg_.js → GranularitySelectField-USDUQ-JX.js} +2 -2
- package/dist/{GranularitySelectField-UPP_rxg_.js.map → GranularitySelectField-USDUQ-JX.js.map} +1 -1
- package/dist/GranularitySelectFieldPro.js +1 -1
- package/dist/HeatMapPro.js +1 -1
- package/dist/KpiChartNumberComparisonPro.js +1 -1
- package/dist/KpiChartNumberPro.js +1 -1
- package/dist/LineChartComparisonDefaultPro.js +1 -1
- package/dist/LineChartDefaultPro.js +1 -1
- package/dist/LineChartGroupedPro.js +1 -1
- package/dist/MarkdownPro.js +1 -1
- package/dist/MeasureMultiSelectFieldPro.js +1 -1
- package/dist/MeasureSingleSelectFieldPro.js +1 -1
- package/dist/MultiSelectFieldPro.js +1 -1
- package/dist/PieChartPro.js +1 -1
- package/dist/PivotTablePro.js +1 -1
- package/dist/SingleSelectFieldPro.js +1 -1
- package/dist/TableChartPaginated.js +1 -1
- package/dist/TableScrollable.js +1 -1
- package/dist/TextFieldPro.js +1 -1
- package/dist/{bars.utils-DUjwVBN_.js → bars.utils-DUfgYLSr.js} +3 -3
- package/dist/{bars.utils-DUjwVBN_.js.map → bars.utils-DUfgYLSr.js.map} +1 -1
- package/dist/{charts.utils-Bev0mIbU.js → charts.utils-c8yku90J.js} +3 -3
- package/dist/{charts.utils-Bev0mIbU.js.map → charts.utils-c8yku90J.js.map} +1 -1
- package/dist/{component.utils-CTxZ73OE.js → component.utils-CbnwaSi1.js} +520 -514
- package/dist/component.utils-CbnwaSi1.js.map +1 -0
- package/dist/components/charts/bars/BarChartStackedHorizontalPro/definition.d.ts +1 -1
- package/dist/components/charts/bars/BarChartStackedHorizontalPro/index.d.ts +3 -3
- package/dist/{definition-DnUR3kHo.js → definition-BFuxOQNH.js} +5 -5
- package/dist/{definition-DnUR3kHo.js.map → definition-BFuxOQNH.js.map} +1 -1
- package/dist/{definition-DBYWMAQ6.js → definition-BSqRW5IT.js} +5 -5
- package/dist/{definition-DBYWMAQ6.js.map → definition-BSqRW5IT.js.map} +1 -1
- package/dist/{definition-B061AHXa.js → definition-BSwWyWnH.js} +6 -6
- package/dist/{definition-B061AHXa.js.map → definition-BSwWyWnH.js.map} +1 -1
- package/dist/{definition-G959ELzF.js → definition-BeeYKKmk.js} +5 -5
- package/dist/{definition-G959ELzF.js.map → definition-BeeYKKmk.js.map} +1 -1
- package/dist/{definition-Bu_cHsdd.js → definition-BsgCyaQ7.js} +4 -4
- package/dist/{definition-Bu_cHsdd.js.map → definition-BsgCyaQ7.js.map} +1 -1
- package/dist/{definition-DFjrZcQZ.js → definition-Bvgmq0Y0.js} +5 -5
- package/dist/{definition-DFjrZcQZ.js.map → definition-Bvgmq0Y0.js.map} +1 -1
- package/dist/{definition-Ba8O8VWB.js → definition-C-atn8UX.js} +5 -5
- package/dist/{definition-Ba8O8VWB.js.map → definition-C-atn8UX.js.map} +1 -1
- package/dist/{definition-DLj9Mme1.js → definition-C3gy5J0u.js} +5 -5
- package/dist/{definition-DLj9Mme1.js.map → definition-C3gy5J0u.js.map} +1 -1
- package/dist/{definition-y5mDf3Zy.js → definition-CCbRSqPX.js} +5 -5
- package/dist/{definition-y5mDf3Zy.js.map → definition-CCbRSqPX.js.map} +1 -1
- package/dist/{definition-Ig1OO-qQ.js → definition-CP4ychWJ.js} +6 -6
- package/dist/{definition-Ig1OO-qQ.js.map → definition-CP4ychWJ.js.map} +1 -1
- package/dist/{definition-B5xzjNln.js → definition-CmBHiNwT.js} +5 -5
- package/dist/{definition-B5xzjNln.js.map → definition-CmBHiNwT.js.map} +1 -1
- package/dist/{definition-Do1r7afD.js → definition-CpilKf_f.js} +4 -4
- package/dist/{definition-Do1r7afD.js.map → definition-CpilKf_f.js.map} +1 -1
- package/dist/{definition-DqjuCD5Y.js → definition-Crkfoxb6.js} +5 -5
- package/dist/{definition-DqjuCD5Y.js.map → definition-Crkfoxb6.js.map} +1 -1
- package/dist/{definition-DD10XLFE.js → definition-CxcF8TcQ.js} +6 -6
- package/dist/{definition-DD10XLFE.js.map → definition-CxcF8TcQ.js.map} +1 -1
- package/dist/{definition-DyyAUko-.js → definition-Cy7jirkQ.js} +6 -6
- package/dist/{definition-DyyAUko-.js.map → definition-Cy7jirkQ.js.map} +1 -1
- package/dist/{definition-B82TKgiF.js → definition-CyqvuOwz.js} +3 -3
- package/dist/{definition-B82TKgiF.js.map → definition-CyqvuOwz.js.map} +1 -1
- package/dist/{definition-B9OPK4En.js → definition-D2O-mHJv.js} +4 -4
- package/dist/{definition-B9OPK4En.js.map → definition-D2O-mHJv.js.map} +1 -1
- package/dist/{definition-HDGe_q3m.js → definition-DMDXT1Tj.js} +6 -6
- package/dist/{definition-HDGe_q3m.js.map → definition-DMDXT1Tj.js.map} +1 -1
- package/dist/{definition-CSJ_pLef.js → definition-DMbgucms.js} +4 -4
- package/dist/{definition-CSJ_pLef.js.map → definition-DMbgucms.js.map} +1 -1
- package/dist/{definition--pOi48-R.js → definition-DP0Iwp6_.js} +5 -5
- package/dist/{definition--pOi48-R.js.map → definition-DP0Iwp6_.js.map} +1 -1
- package/dist/{definition-DD7z33zE.js → definition-DbTSq8TE.js} +6 -6
- package/dist/{definition-DD7z33zE.js.map → definition-DbTSq8TE.js.map} +1 -1
- package/dist/{definition-C3n8pYdt.js → definition-DnMzopoJ.js} +6 -6
- package/dist/{definition-C3n8pYdt.js.map → definition-DnMzopoJ.js.map} +1 -1
- package/dist/{definition-DrNmuv-a.js → definition-Dx_ekjOR.js} +2 -2
- package/dist/{definition-DrNmuv-a.js.map → definition-Dx_ekjOR.js.map} +1 -1
- package/dist/{definition-DYBdv5XU.js → definition-Dy6sdVbU.js} +3 -3
- package/dist/{definition-DYBdv5XU.js.map → definition-Dy6sdVbU.js.map} +1 -1
- package/dist/{definition-L50PXibn.js → definition-DyMdJqf8.js} +3 -3
- package/dist/{definition-L50PXibn.js.map → definition-DyMdJqf8.js.map} +1 -1
- package/dist/{definition-CtYj3y9T.js → definition-DzFPFv2i.js} +4 -4
- package/dist/{definition-CtYj3y9T.js.map → definition-DzFPFv2i.js.map} +1 -1
- package/dist/{definition-BCTnPonR.js → definition-EyeTQ0qK.js} +5 -5
- package/dist/{definition-BCTnPonR.js.map → definition-EyeTQ0qK.js.map} +1 -1
- package/dist/{definition-DrM7zQEH.js → definition-Sr664oUL.js} +4 -4
- package/dist/{definition-DrM7zQEH.js.map → definition-Sr664oUL.js.map} +1 -1
- package/dist/{definition-eFwBL-is.js → definition-cZxEU0FY.js} +3 -3
- package/dist/{definition-eFwBL-is.js.map → definition-cZxEU0FY.js.map} +1 -1
- package/dist/{definition-XOUClcrs.js → definition-ghLrDO7_.js} +5 -5
- package/dist/{definition-XOUClcrs.js.map → definition-ghLrDO7_.js.map} +1 -1
- package/dist/{dimensionsAndMeasures.utils-AOS4mAPS.js → dimensionsAndMeasures.utils-TtQ5NCLw.js} +2 -2
- package/dist/{dimensionsAndMeasures.utils-AOS4mAPS.js.map → dimensionsAndMeasures.utils-TtQ5NCLw.js.map} +1 -1
- package/dist/embeddable-components.json +48 -48
- package/dist/embeddable-theme-0137e.js +1112 -1106
- package/dist/{granularity.utils-B8nX3ssF.js → granularity.utils-zeE7RDIY.js} +2 -2
- package/dist/{granularity.utils-B8nX3ssF.js.map → granularity.utils-zeE7RDIY.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +43 -43
- package/dist/{pies.utils-Nb2hTKaS.js → pies.utils-CjGWf1L1.js} +4 -4
- package/dist/{pies.utils-Nb2hTKaS.js.map → pies.utils-CjGWf1L1.js.map} +1 -1
- package/dist/{preview.data.constants-jTLhNUWo.js → preview.data.constants-BZ8b6ZQ1.js} +2 -2
- package/dist/{preview.data.constants-jTLhNUWo.js.map → preview.data.constants-BZ8b6ZQ1.js.map} +1 -1
- package/dist/{tables.utils-DmkkqjdL.js → tables.utils-o7rLEWDn.js} +2 -2
- package/dist/{tables.utils-DmkkqjdL.js.map → tables.utils-o7rLEWDn.js.map} +1 -1
- package/dist/{timeRange.utils-BklklYoE.js → timeRange.utils-HfS6K7Bt.js} +2 -2
- package/dist/{timeRange.utils-BklklYoE.js.map → timeRange.utils-HfS6K7Bt.js.map} +1 -1
- package/package.json +1 -1
- package/dist/component.utils-CTxZ73OE.js.map +0 -1
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
const g = (a) => typeof a == "string",
|
|
1
|
+
const g = (a) => typeof a == "string", A = () => {
|
|
2
2
|
let a, e;
|
|
3
|
-
const t = new Promise((
|
|
4
|
-
a =
|
|
3
|
+
const t = new Promise((s, i) => {
|
|
4
|
+
a = s, e = i;
|
|
5
5
|
});
|
|
6
6
|
return t.resolve = a, t.reject = e, t;
|
|
7
7
|
}, ne = (a) => a == null ? "" : "" + a, we = (a, e, t) => {
|
|
8
|
-
a.forEach((
|
|
9
|
-
e[
|
|
8
|
+
a.forEach((s) => {
|
|
9
|
+
e[s] && (t[s] = e[s]);
|
|
10
10
|
});
|
|
11
|
-
}, Ce = /###/g, re = (a) => a && a.indexOf("###") > -1 ? a.replace(Ce, ".") : a, ae = (a) => !a || g(a),
|
|
12
|
-
const
|
|
13
|
-
let
|
|
14
|
-
for (;
|
|
11
|
+
}, Ce = /###/g, re = (a) => a && a.indexOf("###") > -1 ? a.replace(Ce, ".") : a, ae = (a) => !a || g(a), K = (a, e, t) => {
|
|
12
|
+
const s = g(e) ? e.split(".") : e;
|
|
13
|
+
let i = 0;
|
|
14
|
+
for (; i < s.length - 1; ) {
|
|
15
15
|
if (ae(a)) return {};
|
|
16
|
-
const n = re(i
|
|
17
|
-
!a[n] && t && (a[n] = new t()), Object.prototype.hasOwnProperty.call(a, n) ? a = a[n] : a = {}, ++
|
|
16
|
+
const n = re(s[i]);
|
|
17
|
+
!a[n] && t && (a[n] = new t()), Object.prototype.hasOwnProperty.call(a, n) ? a = a[n] : a = {}, ++i;
|
|
18
18
|
}
|
|
19
19
|
return ae(a) ? {} : {
|
|
20
20
|
obj: a,
|
|
21
|
-
k: re(i
|
|
21
|
+
k: re(s[i])
|
|
22
22
|
};
|
|
23
23
|
}, oe = (a, e, t) => {
|
|
24
24
|
const {
|
|
25
|
-
obj:
|
|
26
|
-
k:
|
|
27
|
-
} =
|
|
28
|
-
if (
|
|
29
|
-
i
|
|
25
|
+
obj: s,
|
|
26
|
+
k: i
|
|
27
|
+
} = K(a, e, Object);
|
|
28
|
+
if (s !== void 0 || e.length === 1) {
|
|
29
|
+
s[i] = t;
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
let n = e[e.length - 1], r = e.slice(0, e.length - 1), o =
|
|
32
|
+
let n = e[e.length - 1], r = e.slice(0, e.length - 1), o = K(a, r, Object);
|
|
33
33
|
for (; o.obj === void 0 && r.length; )
|
|
34
|
-
n = `${r[r.length - 1]}.${n}`, r = r.slice(0, r.length - 1), o =
|
|
34
|
+
n = `${r[r.length - 1]}.${n}`, r = r.slice(0, r.length - 1), o = K(a, r, Object), o != null && o.obj && typeof o.obj[`${o.k}.${n}`] < "u" && (o.obj = void 0);
|
|
35
35
|
o.obj[`${o.k}.${n}`] = t;
|
|
36
|
-
}, ve = (a, e, t,
|
|
36
|
+
}, ve = (a, e, t, s) => {
|
|
37
37
|
const {
|
|
38
|
-
obj:
|
|
38
|
+
obj: i,
|
|
39
39
|
k: n
|
|
40
|
-
} =
|
|
41
|
-
|
|
42
|
-
},
|
|
40
|
+
} = K(a, e, Object);
|
|
41
|
+
i[n] = i[n] || [], i[n].push(t);
|
|
42
|
+
}, _ = (a, e) => {
|
|
43
43
|
const {
|
|
44
44
|
obj: t,
|
|
45
|
-
k:
|
|
46
|
-
} =
|
|
47
|
-
if (t && Object.prototype.hasOwnProperty.call(t,
|
|
48
|
-
return t[
|
|
45
|
+
k: s
|
|
46
|
+
} = K(a, e);
|
|
47
|
+
if (t && Object.prototype.hasOwnProperty.call(t, s))
|
|
48
|
+
return t[s];
|
|
49
49
|
}, Pe = (a, e, t) => {
|
|
50
|
-
const
|
|
51
|
-
return
|
|
50
|
+
const s = _(a, t);
|
|
51
|
+
return s !== void 0 ? s : _(e, t);
|
|
52
52
|
}, xe = (a, e, t) => {
|
|
53
|
-
for (const
|
|
54
|
-
|
|
53
|
+
for (const s in e)
|
|
54
|
+
s !== "__proto__" && s !== "constructor" && (s in a ? g(a[s]) || a[s] instanceof String || g(e[s]) || e[s] instanceof String ? t && (a[s] = e[s]) : xe(a[s], e[s], t) : a[s] = e[s]);
|
|
55
55
|
return a;
|
|
56
56
|
}, I = (a) => a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
57
57
|
var $e = {
|
|
@@ -71,42 +71,42 @@ class Ne {
|
|
|
71
71
|
const t = this.regExpMap.get(e);
|
|
72
72
|
if (t !== void 0)
|
|
73
73
|
return t;
|
|
74
|
-
const
|
|
75
|
-
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e,
|
|
74
|
+
const s = new RegExp(e);
|
|
75
|
+
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, s), this.regExpQueue.push(e), s;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
const ke = [" ", ",", "?", "!", ";"], je = new Ne(20), Fe = (a, e, t) => {
|
|
79
79
|
e = e || "", t = t || "";
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
let n = !
|
|
80
|
+
const s = ke.filter((r) => e.indexOf(r) < 0 && t.indexOf(r) < 0);
|
|
81
|
+
if (s.length === 0) return !0;
|
|
82
|
+
const i = je.getRegExp(`(${s.map((r) => r === "?" ? "\\?" : r).join("|")})`);
|
|
83
|
+
let n = !i.test(a);
|
|
84
84
|
if (!n) {
|
|
85
85
|
const r = a.indexOf(t);
|
|
86
|
-
r > 0 && !
|
|
86
|
+
r > 0 && !i.test(a.substring(0, r)) && (n = !0);
|
|
87
87
|
}
|
|
88
88
|
return n;
|
|
89
|
-
},
|
|
89
|
+
}, q = (a, e, t = ".") => {
|
|
90
90
|
if (!a) return;
|
|
91
91
|
if (a[e])
|
|
92
92
|
return Object.prototype.hasOwnProperty.call(a, e) ? a[e] : void 0;
|
|
93
|
-
const
|
|
94
|
-
let
|
|
95
|
-
for (let n = 0; n <
|
|
96
|
-
if (!
|
|
93
|
+
const s = e.split(t);
|
|
94
|
+
let i = a;
|
|
95
|
+
for (let n = 0; n < s.length; ) {
|
|
96
|
+
if (!i || typeof i != "object")
|
|
97
97
|
return;
|
|
98
98
|
let r, o = "";
|
|
99
|
-
for (let
|
|
100
|
-
if (
|
|
101
|
-
if (["string", "number", "boolean"].indexOf(typeof r) > -1 &&
|
|
99
|
+
for (let l = n; l < s.length; ++l)
|
|
100
|
+
if (l !== n && (o += t), o += s[l], r = i[o], r !== void 0) {
|
|
101
|
+
if (["string", "number", "boolean"].indexOf(typeof r) > -1 && l < s.length - 1)
|
|
102
102
|
continue;
|
|
103
|
-
n +=
|
|
103
|
+
n += l - n + 1;
|
|
104
104
|
break;
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
i = r;
|
|
107
107
|
}
|
|
108
|
-
return
|
|
109
|
-
},
|
|
108
|
+
return i;
|
|
109
|
+
}, M = (a) => a == null ? void 0 : a.replace(/_/g, "-"), Ee = {
|
|
110
110
|
type: "logger",
|
|
111
111
|
log(a) {
|
|
112
112
|
this.output("log", a);
|
|
@@ -118,11 +118,11 @@ const ke = [" ", ",", "?", "!", ";"], je = new Ne(20), Fe = (a, e, t) => {
|
|
|
118
118
|
this.output("error", a);
|
|
119
119
|
},
|
|
120
120
|
output(a, e) {
|
|
121
|
-
var t,
|
|
122
|
-
(
|
|
121
|
+
var t, s;
|
|
122
|
+
(s = (t = console == null ? void 0 : console[a]) == null ? void 0 : t.apply) == null || s.call(t, console, e);
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
|
-
class
|
|
125
|
+
class W {
|
|
126
126
|
constructor(e, t = {}) {
|
|
127
127
|
this.init(e, t);
|
|
128
128
|
}
|
|
@@ -141,29 +141,29 @@ class _ {
|
|
|
141
141
|
deprecate(...e) {
|
|
142
142
|
return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
|
|
143
143
|
}
|
|
144
|
-
forward(e, t,
|
|
145
|
-
return
|
|
144
|
+
forward(e, t, s, i) {
|
|
145
|
+
return i && !this.debug ? null : (g(e[0]) && (e[0] = `${s}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
146
146
|
}
|
|
147
147
|
create(e) {
|
|
148
|
-
return new
|
|
148
|
+
return new W(this.logger, {
|
|
149
149
|
prefix: `${this.prefix}:${e}:`,
|
|
150
150
|
...this.options
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
clone(e) {
|
|
154
|
-
return e = e || this.options, e.prefix = e.prefix || this.prefix, new
|
|
154
|
+
return e = e || this.options, e.prefix = e.prefix || this.prefix, new W(this.logger, e);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
var R = new
|
|
158
|
-
class
|
|
157
|
+
var R = new W();
|
|
158
|
+
class G {
|
|
159
159
|
constructor() {
|
|
160
160
|
this.observers = {};
|
|
161
161
|
}
|
|
162
162
|
on(e, t) {
|
|
163
|
-
return e.split(" ").forEach((
|
|
164
|
-
this.observers[
|
|
165
|
-
const
|
|
166
|
-
this.observers[
|
|
163
|
+
return e.split(" ").forEach((s) => {
|
|
164
|
+
this.observers[s] || (this.observers[s] = /* @__PURE__ */ new Map());
|
|
165
|
+
const i = this.observers[s].get(t) || 0;
|
|
166
|
+
this.observers[s].set(t, i + 1);
|
|
167
167
|
}), this;
|
|
168
168
|
}
|
|
169
169
|
off(e, t) {
|
|
@@ -176,16 +176,16 @@ class Y {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
emit(e, ...t) {
|
|
179
|
-
this.observers[e] && Array.from(this.observers[e].entries()).forEach(([
|
|
179
|
+
this.observers[e] && Array.from(this.observers[e].entries()).forEach(([i, n]) => {
|
|
180
180
|
for (let r = 0; r < n; r++)
|
|
181
|
-
|
|
182
|
-
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([
|
|
181
|
+
i(...t);
|
|
182
|
+
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([i, n]) => {
|
|
183
183
|
for (let r = 0; r < n; r++)
|
|
184
|
-
|
|
184
|
+
i.apply(i, [e, ...t]);
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
class le extends
|
|
188
|
+
class le extends G {
|
|
189
189
|
constructor(e, t = {
|
|
190
190
|
ns: ["translation"],
|
|
191
191
|
defaultNS: "translation"
|
|
@@ -199,41 +199,41 @@ class le extends Y {
|
|
|
199
199
|
const t = this.options.ns.indexOf(e);
|
|
200
200
|
t > -1 && this.options.ns.splice(t, 1);
|
|
201
201
|
}
|
|
202
|
-
getResource(e, t,
|
|
203
|
-
var
|
|
204
|
-
const n =
|
|
202
|
+
getResource(e, t, s, i = {}) {
|
|
203
|
+
var u, c;
|
|
204
|
+
const n = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, r = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
205
205
|
let o;
|
|
206
|
-
e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t],
|
|
207
|
-
const
|
|
208
|
-
return !
|
|
206
|
+
e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], s && (Array.isArray(s) ? o.push(...s) : g(s) && n ? o.push(...s.split(n)) : o.push(s)));
|
|
207
|
+
const l = _(this.data, o);
|
|
208
|
+
return !l && !t && !s && e.indexOf(".") > -1 && (e = o[0], t = o[1], s = o.slice(2).join(".")), l || !r || !g(s) ? l : q((c = (u = this.data) == null ? void 0 : u[e]) == null ? void 0 : c[t], s, n);
|
|
209
209
|
}
|
|
210
|
-
addResource(e, t,
|
|
210
|
+
addResource(e, t, s, i, n = {
|
|
211
211
|
silent: !1
|
|
212
212
|
}) {
|
|
213
213
|
const r = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator;
|
|
214
214
|
let o = [e, t];
|
|
215
|
-
|
|
215
|
+
s && (o = o.concat(r ? s.split(r) : s)), e.indexOf(".") > -1 && (o = e.split("."), i = t, t = o[1]), this.addNamespaces(t), oe(this.data, o, i), n.silent || this.emit("added", e, t, s, i);
|
|
216
216
|
}
|
|
217
|
-
addResources(e, t,
|
|
217
|
+
addResources(e, t, s, i = {
|
|
218
218
|
silent: !1
|
|
219
219
|
}) {
|
|
220
|
-
for (const n in
|
|
221
|
-
(g(
|
|
220
|
+
for (const n in s)
|
|
221
|
+
(g(s[n]) || Array.isArray(s[n])) && this.addResource(e, t, n, s[n], {
|
|
222
222
|
silent: !0
|
|
223
223
|
});
|
|
224
|
-
|
|
224
|
+
i.silent || this.emit("added", e, t, s);
|
|
225
225
|
}
|
|
226
|
-
addResourceBundle(e, t,
|
|
226
|
+
addResourceBundle(e, t, s, i, n, r = {
|
|
227
227
|
silent: !1,
|
|
228
228
|
skipCopy: !1
|
|
229
229
|
}) {
|
|
230
230
|
let o = [e, t];
|
|
231
|
-
e.indexOf(".") > -1 && (o = e.split("."),
|
|
232
|
-
let
|
|
233
|
-
r.skipCopy || (
|
|
234
|
-
...
|
|
235
|
-
...
|
|
236
|
-
}, oe(this.data, o,
|
|
231
|
+
e.indexOf(".") > -1 && (o = e.split("."), i = s, s = t, t = o[1]), this.addNamespaces(t);
|
|
232
|
+
let l = _(this.data, o) || {};
|
|
233
|
+
r.skipCopy || (s = JSON.parse(JSON.stringify(s))), i ? xe(l, s, n) : l = {
|
|
234
|
+
...l,
|
|
235
|
+
...s
|
|
236
|
+
}, oe(this.data, o, l), r.silent || this.emit("added", e, t, s);
|
|
237
237
|
}
|
|
238
238
|
removeResourceBundle(e, t) {
|
|
239
239
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -249,7 +249,7 @@ class le extends Y {
|
|
|
249
249
|
}
|
|
250
250
|
hasLanguageSomeTranslations(e) {
|
|
251
251
|
const t = this.getDataByLanguage(e);
|
|
252
|
-
return !!(t && Object.keys(t) || []).find((
|
|
252
|
+
return !!(t && Object.keys(t) || []).find((i) => t[i] && Object.keys(t[i]).length > 0);
|
|
253
253
|
}
|
|
254
254
|
toJSON() {
|
|
255
255
|
return this.data;
|
|
@@ -260,10 +260,10 @@ var ye = {
|
|
|
260
260
|
addPostProcessor(a) {
|
|
261
261
|
this.processors[a.name] = a;
|
|
262
262
|
},
|
|
263
|
-
handle(a, e, t,
|
|
263
|
+
handle(a, e, t, s, i) {
|
|
264
264
|
return a.forEach((n) => {
|
|
265
265
|
var r;
|
|
266
|
-
e = ((r = this.processors[n]) == null ? void 0 : r.process(e, t,
|
|
266
|
+
e = ((r = this.processors[n]) == null ? void 0 : r.process(e, t, s, i)) ?? e;
|
|
267
267
|
}), e;
|
|
268
268
|
}
|
|
269
269
|
};
|
|
@@ -271,24 +271,24 @@ const Se = Symbol("i18next/PATH_KEY");
|
|
|
271
271
|
function Ie() {
|
|
272
272
|
const a = [], e = /* @__PURE__ */ Object.create(null);
|
|
273
273
|
let t;
|
|
274
|
-
return e.get = (
|
|
274
|
+
return e.get = (s, i) => {
|
|
275
275
|
var n;
|
|
276
|
-
return (n = t == null ? void 0 : t.revoke) == null || n.call(t),
|
|
276
|
+
return (n = t == null ? void 0 : t.revoke) == null || n.call(t), i === Se ? a : (a.push(i), t = Proxy.revocable(s, e), t.proxy);
|
|
277
277
|
}, Proxy.revocable(/* @__PURE__ */ Object.create(null), e).proxy;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function U(a, e) {
|
|
280
280
|
const {
|
|
281
281
|
[Se]: t
|
|
282
|
-
} = a(Ie()),
|
|
283
|
-
if (t.length > 1 &&
|
|
282
|
+
} = a(Ie()), s = (e == null ? void 0 : e.keySeparator) ?? ".", i = (e == null ? void 0 : e.nsSeparator) ?? ":";
|
|
283
|
+
if (t.length > 1 && i) {
|
|
284
284
|
const n = e == null ? void 0 : e.ns;
|
|
285
285
|
if ((n ? Array.isArray(n) ? n : [n] : []).includes(t[0]))
|
|
286
|
-
return `${t[0]}${
|
|
286
|
+
return `${t[0]}${i}${t.slice(1).join(s)}`;
|
|
287
287
|
}
|
|
288
|
-
return t.join(
|
|
288
|
+
return t.join(s);
|
|
289
289
|
}
|
|
290
|
-
const ue = {},
|
|
291
|
-
class
|
|
290
|
+
const ue = {}, Q = (a) => !g(a) && typeof a != "boolean" && typeof a != "number";
|
|
291
|
+
class Y extends G {
|
|
292
292
|
constructor(e, t = {}) {
|
|
293
293
|
super(), we(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = R.create("translator");
|
|
294
294
|
}
|
|
@@ -298,218 +298,224 @@ class W extends Y {
|
|
|
298
298
|
exists(e, t = {
|
|
299
299
|
interpolation: {}
|
|
300
300
|
}) {
|
|
301
|
-
const
|
|
301
|
+
const s = {
|
|
302
302
|
...t
|
|
303
303
|
};
|
|
304
304
|
if (e == null) return !1;
|
|
305
|
-
const
|
|
306
|
-
if ((
|
|
307
|
-
const n =
|
|
308
|
-
return !(
|
|
305
|
+
const i = this.resolve(e, s);
|
|
306
|
+
if ((i == null ? void 0 : i.res) === void 0) return !1;
|
|
307
|
+
const n = Q(i.res);
|
|
308
|
+
return !(s.returnObjects === !1 && n);
|
|
309
309
|
}
|
|
310
310
|
extractFromKey(e, t) {
|
|
311
|
-
let
|
|
312
|
-
|
|
313
|
-
const
|
|
311
|
+
let s = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
|
|
312
|
+
s === void 0 && (s = ":");
|
|
313
|
+
const i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
314
314
|
let n = t.ns || this.options.defaultNS || [];
|
|
315
|
-
const r =
|
|
315
|
+
const r = s && e.indexOf(s) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Fe(e, s, i);
|
|
316
316
|
if (r && !o) {
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
317
|
+
const l = e.match(this.interpolator.nestingRegexp);
|
|
318
|
+
if (l && l.length > 0)
|
|
319
319
|
return {
|
|
320
320
|
key: e,
|
|
321
321
|
namespaces: g(n) ? [n] : n
|
|
322
322
|
};
|
|
323
|
-
const
|
|
324
|
-
(
|
|
323
|
+
const u = e.split(s);
|
|
324
|
+
(s !== i || s === i && this.options.ns.indexOf(u[0]) > -1) && (n = u.shift()), e = u.join(i);
|
|
325
325
|
}
|
|
326
326
|
return {
|
|
327
327
|
key: e,
|
|
328
328
|
namespaces: g(n) ? [n] : n
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
|
-
translate(e, t,
|
|
332
|
-
let
|
|
331
|
+
translate(e, t, s) {
|
|
332
|
+
let i = typeof t == "object" ? {
|
|
333
333
|
...t
|
|
334
334
|
} : t;
|
|
335
|
-
if (typeof
|
|
336
|
-
...
|
|
337
|
-
}),
|
|
338
|
-
typeof e == "function" && (e =
|
|
335
|
+
if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = {
|
|
336
|
+
...i
|
|
337
|
+
}), i || (i = {}), e == null) return "";
|
|
338
|
+
typeof e == "function" && (e = U(e, {
|
|
339
339
|
...this.options,
|
|
340
|
-
...
|
|
341
|
-
})), Array.isArray(e) || (e = [String(e)])
|
|
342
|
-
|
|
340
|
+
...i
|
|
341
|
+
})), Array.isArray(e) || (e = [String(e)]), e = e.map((L) => typeof L == "function" ? U(L, {
|
|
342
|
+
...this.options,
|
|
343
|
+
...i
|
|
344
|
+
}) : String(L));
|
|
345
|
+
const n = i.returnDetails !== void 0 ? i.returnDetails : this.options.returnDetails, r = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, {
|
|
343
346
|
key: o,
|
|
344
|
-
namespaces:
|
|
345
|
-
} = this.extractFromKey(e[e.length - 1],
|
|
346
|
-
let c =
|
|
347
|
+
namespaces: l
|
|
348
|
+
} = this.extractFromKey(e[e.length - 1], i), u = l[l.length - 1];
|
|
349
|
+
let c = i.nsSeparator !== void 0 ? i.nsSeparator : this.options.nsSeparator;
|
|
347
350
|
c === void 0 && (c = ":");
|
|
348
|
-
const f =
|
|
351
|
+
const f = i.lng || this.language, p = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
349
352
|
if ((f == null ? void 0 : f.toLowerCase()) === "cimode")
|
|
350
353
|
return p ? n ? {
|
|
351
|
-
res: `${
|
|
354
|
+
res: `${u}${c}${o}`,
|
|
352
355
|
usedKey: o,
|
|
353
356
|
exactUsedKey: o,
|
|
354
357
|
usedLng: f,
|
|
355
|
-
usedNS:
|
|
356
|
-
usedParams: this.getUsedParamsDetails(
|
|
357
|
-
} : `${
|
|
358
|
+
usedNS: u,
|
|
359
|
+
usedParams: this.getUsedParamsDetails(i)
|
|
360
|
+
} : `${u}${c}${o}` : n ? {
|
|
358
361
|
res: o,
|
|
359
362
|
usedKey: o,
|
|
360
363
|
exactUsedKey: o,
|
|
361
364
|
usedLng: f,
|
|
362
|
-
usedNS:
|
|
363
|
-
usedParams: this.getUsedParamsDetails(
|
|
365
|
+
usedNS: u,
|
|
366
|
+
usedParams: this.getUsedParamsDetails(i)
|
|
364
367
|
} : o;
|
|
365
|
-
const d = this.resolve(e,
|
|
368
|
+
const d = this.resolve(e, i);
|
|
366
369
|
let h = d == null ? void 0 : d.res;
|
|
367
|
-
const m = (d == null ? void 0 : d.usedKey) || o, x = (d == null ? void 0 : d.exactUsedKey) || o, O = ["[object Number]", "[object Function]", "[object RegExp]"],
|
|
370
|
+
const m = (d == null ? void 0 : d.usedKey) || o, x = (d == null ? void 0 : d.exactUsedKey) || o, O = ["[object Number]", "[object Function]", "[object RegExp]"], v = i.joinArrays !== void 0 ? i.joinArrays : this.options.joinArrays, F = !this.i18nFormat || this.i18nFormat.handleAsObject, b = i.count !== void 0 && !g(i.count), N = Y.hasDefaultValue(i), z = b ? this.pluralResolver.getSuffix(f, i.count, i) : "", k = i.ordinal && b ? this.pluralResolver.getSuffix(f, i.count, {
|
|
368
371
|
ordinal: !1
|
|
369
|
-
}) : "", T = b && !
|
|
372
|
+
}) : "", T = b && !i.ordinal && i.count === 0, w = T && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${z}`] || i[`defaultValue${k}`] || i.defaultValue;
|
|
370
373
|
let S = h;
|
|
371
|
-
F && !h && N && (S =
|
|
372
|
-
const be =
|
|
373
|
-
if (F && S && be && O.indexOf(Le) < 0 && !(g(
|
|
374
|
-
if (!
|
|
374
|
+
F && !h && N && (S = w);
|
|
375
|
+
const be = Q(S), Le = Object.prototype.toString.apply(S);
|
|
376
|
+
if (F && S && be && O.indexOf(Le) < 0 && !(g(v) && Array.isArray(S))) {
|
|
377
|
+
if (!i.returnObjects && !this.options.returnObjects) {
|
|
375
378
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
376
|
-
const
|
|
377
|
-
...
|
|
378
|
-
ns:
|
|
379
|
+
const L = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(m, S, {
|
|
380
|
+
...i,
|
|
381
|
+
ns: l
|
|
379
382
|
}) : `key '${o} (${this.language})' returned an object instead of string.`;
|
|
380
|
-
return n ? (d.res =
|
|
383
|
+
return n ? (d.res = L, d.usedParams = this.getUsedParamsDetails(i), d) : L;
|
|
381
384
|
}
|
|
382
385
|
if (r) {
|
|
383
|
-
const
|
|
386
|
+
const L = Array.isArray(S), P = L ? [] : {}, ee = L ? x : m;
|
|
384
387
|
for (const $ in S)
|
|
385
388
|
if (Object.prototype.hasOwnProperty.call(S, $)) {
|
|
386
389
|
const j = `${ee}${r}${$}`;
|
|
387
|
-
N && !h ?
|
|
388
|
-
...
|
|
389
|
-
defaultValue:
|
|
390
|
+
N && !h ? P[$] = this.translate(j, {
|
|
391
|
+
...i,
|
|
392
|
+
defaultValue: Q(w) ? w[$] : void 0,
|
|
390
393
|
joinArrays: !1,
|
|
391
|
-
ns:
|
|
392
|
-
}) :
|
|
393
|
-
...
|
|
394
|
+
ns: l
|
|
395
|
+
}) : P[$] = this.translate(j, {
|
|
396
|
+
...i,
|
|
394
397
|
joinArrays: !1,
|
|
395
|
-
ns:
|
|
396
|
-
}),
|
|
398
|
+
ns: l
|
|
399
|
+
}), P[$] === j && (P[$] = S[$]);
|
|
397
400
|
}
|
|
398
|
-
h =
|
|
401
|
+
h = P;
|
|
399
402
|
}
|
|
400
|
-
} else if (F && g(
|
|
401
|
-
h = h.join(
|
|
403
|
+
} else if (F && g(v) && Array.isArray(h))
|
|
404
|
+
h = h.join(v), h && (h = this.extendTranslation(h, e, i, s));
|
|
402
405
|
else {
|
|
403
|
-
let
|
|
404
|
-
!this.isValidLookup(h) && N && (
|
|
405
|
-
const $ = (
|
|
406
|
-
if (
|
|
407
|
-
if (this.logger.log(j ? "updateKey" : "missingKey", f,
|
|
408
|
-
const
|
|
409
|
-
...
|
|
406
|
+
let L = !1, P = !1;
|
|
407
|
+
!this.isValidLookup(h) && N && (L = !0, h = w), this.isValidLookup(h) || (P = !0, h = o);
|
|
408
|
+
const $ = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && P ? void 0 : h, j = N && w !== h && this.options.updateMissing;
|
|
409
|
+
if (P || L || j) {
|
|
410
|
+
if (this.logger.log(j ? "updateKey" : "missingKey", f, u, o, j ? w : h), r) {
|
|
411
|
+
const C = this.resolve(o, {
|
|
412
|
+
...i,
|
|
410
413
|
keySeparator: !1
|
|
411
414
|
});
|
|
412
|
-
|
|
415
|
+
C && C.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
|
|
413
416
|
}
|
|
414
417
|
let V = [];
|
|
415
|
-
const
|
|
416
|
-
if (this.options.saveMissingTo === "fallback" &&
|
|
417
|
-
for (let
|
|
418
|
-
V.push(
|
|
419
|
-
else this.options.saveMissingTo === "all" ? V = this.languageUtils.toResolveHierarchy(
|
|
420
|
-
const te = (
|
|
421
|
-
var
|
|
422
|
-
const
|
|
423
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(
|
|
418
|
+
const B = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
|
|
419
|
+
if (this.options.saveMissingTo === "fallback" && B && B[0])
|
|
420
|
+
for (let C = 0; C < B.length; C++)
|
|
421
|
+
V.push(B[C]);
|
|
422
|
+
else this.options.saveMissingTo === "all" ? V = this.languageUtils.toResolveHierarchy(i.lng || this.language) : V.push(i.lng || this.language);
|
|
423
|
+
const te = (C, E, D) => {
|
|
424
|
+
var se;
|
|
425
|
+
const ie = N && D !== h ? D : $;
|
|
426
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(C, u, E, ie, j, i) : (se = this.backendConnector) != null && se.saveMissing && this.backendConnector.saveMissing(C, u, E, ie, j, i), this.emit("missingKey", C, u, E, h);
|
|
424
427
|
};
|
|
425
|
-
this.options.saveMissing && (this.options.saveMissingPlurals && b ? V.forEach((
|
|
426
|
-
const E = this.pluralResolver.getSuffixes(
|
|
427
|
-
T &&
|
|
428
|
-
te([
|
|
428
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && b ? V.forEach((C) => {
|
|
429
|
+
const E = this.pluralResolver.getSuffixes(C, i);
|
|
430
|
+
T && i[`defaultValue${this.options.pluralSeparator}zero`] && E.indexOf(`${this.options.pluralSeparator}zero`) < 0 && E.push(`${this.options.pluralSeparator}zero`), E.forEach((D) => {
|
|
431
|
+
te([C], o + D, i[`defaultValue${D}`] || w);
|
|
429
432
|
});
|
|
430
|
-
}) : te(V, o,
|
|
433
|
+
}) : te(V, o, w));
|
|
431
434
|
}
|
|
432
|
-
h = this.extendTranslation(h, e,
|
|
435
|
+
h = this.extendTranslation(h, e, i, d, s), P && h === o && this.options.appendNamespaceToMissingKey && (h = `${u}${c}${o}`), (P || L) && this.options.parseMissingKeyHandler && (h = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}${c}${o}` : o, L ? h : void 0, i));
|
|
433
436
|
}
|
|
434
|
-
return n ? (d.res = h, d.usedParams = this.getUsedParamsDetails(
|
|
437
|
+
return n ? (d.res = h, d.usedParams = this.getUsedParamsDetails(i), d) : h;
|
|
435
438
|
}
|
|
436
|
-
extendTranslation(e, t,
|
|
437
|
-
var
|
|
438
|
-
if ((
|
|
439
|
+
extendTranslation(e, t, s, i, n) {
|
|
440
|
+
var l, u;
|
|
441
|
+
if ((l = this.i18nFormat) != null && l.parse)
|
|
439
442
|
e = this.i18nFormat.parse(e, {
|
|
440
443
|
...this.options.interpolation.defaultVariables,
|
|
441
|
-
...
|
|
442
|
-
},
|
|
443
|
-
resolved:
|
|
444
|
+
...s
|
|
445
|
+
}, s.lng || this.language || i.usedLng, i.usedNS, i.usedKey, {
|
|
446
|
+
resolved: i
|
|
444
447
|
});
|
|
445
|
-
else if (!
|
|
446
|
-
|
|
447
|
-
...
|
|
448
|
+
else if (!s.skipInterpolation) {
|
|
449
|
+
s.interpolation && this.interpolator.init({
|
|
450
|
+
...s,
|
|
448
451
|
interpolation: {
|
|
449
452
|
...this.options.interpolation,
|
|
450
|
-
...
|
|
453
|
+
...s.interpolation
|
|
451
454
|
}
|
|
452
455
|
});
|
|
453
|
-
const c = g(e) && (((
|
|
456
|
+
const c = g(e) && (((u = s == null ? void 0 : s.interpolation) == null ? void 0 : u.skipOnVariables) !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
454
457
|
let f;
|
|
455
458
|
if (c) {
|
|
456
459
|
const d = e.match(this.interpolator.nestingRegexp);
|
|
457
460
|
f = d && d.length;
|
|
458
461
|
}
|
|
459
|
-
let p =
|
|
462
|
+
let p = s.replace && !g(s.replace) ? s.replace : s;
|
|
460
463
|
if (this.options.interpolation.defaultVariables && (p = {
|
|
461
464
|
...this.options.interpolation.defaultVariables,
|
|
462
465
|
...p
|
|
463
|
-
}), e = this.interpolator.interpolate(e, p,
|
|
466
|
+
}), e = this.interpolator.interpolate(e, p, s.lng || this.language || i.usedLng, s), c) {
|
|
464
467
|
const d = e.match(this.interpolator.nestingRegexp), h = d && d.length;
|
|
465
|
-
f < h && (
|
|
468
|
+
f < h && (s.nest = !1);
|
|
466
469
|
}
|
|
467
|
-
!
|
|
470
|
+
!s.lng && i && i.res && (s.lng = this.language || i.usedLng), s.nest !== !1 && (e = this.interpolator.nest(e, (...d) => (n == null ? void 0 : n[0]) === d[0] && !s.context ? (this.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${t[0]}`), null) : this.translate(...d, t), s)), s.interpolation && this.interpolator.reset();
|
|
468
471
|
}
|
|
469
|
-
const r =
|
|
470
|
-
return e != null && (o != null && o.length) &&
|
|
472
|
+
const r = s.postProcess || this.options.postProcess, o = g(r) ? [r] : r;
|
|
473
|
+
return e != null && (o != null && o.length) && s.applyPostProcessor !== !1 && (e = ye.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
471
474
|
i18nResolved: {
|
|
472
|
-
...
|
|
473
|
-
usedParams: this.getUsedParamsDetails(
|
|
475
|
+
...i,
|
|
476
|
+
usedParams: this.getUsedParamsDetails(s)
|
|
474
477
|
},
|
|
475
|
-
...
|
|
476
|
-
} :
|
|
478
|
+
...s
|
|
479
|
+
} : s, this)), e;
|
|
477
480
|
}
|
|
478
481
|
resolve(e, t = {}) {
|
|
479
|
-
let
|
|
480
|
-
return g(e) && (e = [e]), e.
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
482
|
+
let s, i, n, r, o;
|
|
483
|
+
return g(e) && (e = [e]), Array.isArray(e) && (e = e.map((l) => typeof l == "function" ? U(l, {
|
|
484
|
+
...this.options,
|
|
485
|
+
...t
|
|
486
|
+
}) : l)), e.forEach((l) => {
|
|
487
|
+
if (this.isValidLookup(s)) return;
|
|
488
|
+
const u = this.extractFromKey(l, t), c = u.key;
|
|
489
|
+
i = c;
|
|
490
|
+
let f = u.namespaces;
|
|
485
491
|
this.options.fallbackNS && (f = f.concat(this.options.fallbackNS));
|
|
486
492
|
const p = t.count !== void 0 && !g(t.count), d = p && !t.ordinal && t.count === 0, h = t.context !== void 0 && (g(t.context) || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
487
493
|
f.forEach((x) => {
|
|
488
|
-
var O,
|
|
489
|
-
this.isValidLookup(
|
|
490
|
-
var
|
|
491
|
-
if (this.isValidLookup(
|
|
494
|
+
var O, v;
|
|
495
|
+
this.isValidLookup(s) || (o = x, !ue[`${m[0]}-${x}`] && ((O = this.utils) != null && O.hasLoadedNamespace) && !((v = this.utils) != null && v.hasLoadedNamespace(o)) && (ue[`${m[0]}-${x}`] = !0, this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), m.forEach((F) => {
|
|
496
|
+
var z;
|
|
497
|
+
if (this.isValidLookup(s)) return;
|
|
492
498
|
r = F;
|
|
493
499
|
const b = [c];
|
|
494
|
-
if ((
|
|
500
|
+
if ((z = this.i18nFormat) != null && z.addLookupKeys)
|
|
495
501
|
this.i18nFormat.addLookupKeys(b, c, F, x, t);
|
|
496
502
|
else {
|
|
497
503
|
let k;
|
|
498
504
|
p && (k = this.pluralResolver.getSuffix(F, t.count, t));
|
|
499
|
-
const T = `${this.options.pluralSeparator}zero`,
|
|
500
|
-
if (p && (t.ordinal && k.indexOf(
|
|
505
|
+
const T = `${this.options.pluralSeparator}zero`, w = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
506
|
+
if (p && (t.ordinal && k.indexOf(w) === 0 && b.push(c + k.replace(w, this.options.pluralSeparator)), b.push(c + k), d && b.push(c + T)), h) {
|
|
501
507
|
const S = `${c}${this.options.contextSeparator || "_"}${t.context}`;
|
|
502
|
-
b.push(S), p && (t.ordinal && k.indexOf(
|
|
508
|
+
b.push(S), p && (t.ordinal && k.indexOf(w) === 0 && b.push(S + k.replace(w, this.options.pluralSeparator)), b.push(S + k), d && b.push(S + T));
|
|
503
509
|
}
|
|
504
510
|
}
|
|
505
511
|
let N;
|
|
506
512
|
for (; N = b.pop(); )
|
|
507
|
-
this.isValidLookup(
|
|
513
|
+
this.isValidLookup(s) || (n = N, s = this.getResource(F, x, N, t));
|
|
508
514
|
}));
|
|
509
515
|
});
|
|
510
516
|
}), {
|
|
511
|
-
res:
|
|
512
|
-
usedKey:
|
|
517
|
+
res: s,
|
|
518
|
+
usedKey: i,
|
|
513
519
|
exactUsedKey: n,
|
|
514
520
|
usedLng: r,
|
|
515
521
|
usedNS: o
|
|
@@ -518,29 +524,29 @@ class W extends Y {
|
|
|
518
524
|
isValidLookup(e) {
|
|
519
525
|
return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
|
|
520
526
|
}
|
|
521
|
-
getResource(e, t,
|
|
527
|
+
getResource(e, t, s, i = {}) {
|
|
522
528
|
var n;
|
|
523
|
-
return (n = this.i18nFormat) != null && n.getResource ? this.i18nFormat.getResource(e, t,
|
|
529
|
+
return (n = this.i18nFormat) != null && n.getResource ? this.i18nFormat.getResource(e, t, s, i) : this.resourceStore.getResource(e, t, s, i);
|
|
524
530
|
}
|
|
525
531
|
getUsedParamsDetails(e = {}) {
|
|
526
|
-
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"],
|
|
527
|
-
let
|
|
528
|
-
if (
|
|
532
|
+
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], s = e.replace && !g(e.replace);
|
|
533
|
+
let i = s ? e.replace : e;
|
|
534
|
+
if (s && typeof e.count < "u" && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
|
|
529
535
|
...this.options.interpolation.defaultVariables,
|
|
530
|
-
...
|
|
531
|
-
}), !
|
|
532
|
-
|
|
533
|
-
...
|
|
536
|
+
...i
|
|
537
|
+
}), !s) {
|
|
538
|
+
i = {
|
|
539
|
+
...i
|
|
534
540
|
};
|
|
535
541
|
for (const n of t)
|
|
536
|
-
delete
|
|
542
|
+
delete i[n];
|
|
537
543
|
}
|
|
538
|
-
return
|
|
544
|
+
return i;
|
|
539
545
|
}
|
|
540
546
|
static hasDefaultValue(e) {
|
|
541
547
|
const t = "defaultValue";
|
|
542
|
-
for (const
|
|
543
|
-
if (Object.prototype.hasOwnProperty.call(e,
|
|
548
|
+
for (const s in e)
|
|
549
|
+
if (Object.prototype.hasOwnProperty.call(e, s) && t === s.substring(0, t.length) && e[s] !== void 0)
|
|
544
550
|
return !0;
|
|
545
551
|
return !1;
|
|
546
552
|
}
|
|
@@ -550,12 +556,12 @@ class fe {
|
|
|
550
556
|
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = R.create("languageUtils");
|
|
551
557
|
}
|
|
552
558
|
getScriptPartFromCode(e) {
|
|
553
|
-
if (e =
|
|
559
|
+
if (e = M(e), !e || e.indexOf("-") < 0) return null;
|
|
554
560
|
const t = e.split("-");
|
|
555
561
|
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
556
562
|
}
|
|
557
563
|
getLanguagePartFromCode(e) {
|
|
558
|
-
if (e =
|
|
564
|
+
if (e = M(e), !e || e.indexOf("-") < 0) return e;
|
|
559
565
|
const t = e.split("-");
|
|
560
566
|
return this.formatLanguageCode(t[0]);
|
|
561
567
|
}
|
|
@@ -576,15 +582,15 @@ class fe {
|
|
|
576
582
|
getBestMatchFromCodes(e) {
|
|
577
583
|
if (!e) return null;
|
|
578
584
|
let t;
|
|
579
|
-
return e.forEach((
|
|
585
|
+
return e.forEach((s) => {
|
|
580
586
|
if (t) return;
|
|
581
|
-
const
|
|
582
|
-
(!this.options.supportedLngs || this.isSupportedCode(
|
|
583
|
-
}), !t && this.options.supportedLngs && e.forEach((
|
|
587
|
+
const i = this.formatLanguageCode(s);
|
|
588
|
+
(!this.options.supportedLngs || this.isSupportedCode(i)) && (t = i);
|
|
589
|
+
}), !t && this.options.supportedLngs && e.forEach((s) => {
|
|
584
590
|
if (t) return;
|
|
585
|
-
const
|
|
586
|
-
if (this.isSupportedCode(
|
|
587
|
-
const n = this.getLanguagePartFromCode(
|
|
591
|
+
const i = this.getScriptPartFromCode(s);
|
|
592
|
+
if (this.isSupportedCode(i)) return t = i;
|
|
593
|
+
const n = this.getLanguagePartFromCode(s);
|
|
588
594
|
if (this.isSupportedCode(n)) return t = n;
|
|
589
595
|
t = this.options.supportedLngs.find((r) => {
|
|
590
596
|
if (r === n) return r;
|
|
@@ -597,16 +603,16 @@ class fe {
|
|
|
597
603
|
if (!e) return [];
|
|
598
604
|
if (typeof e == "function" && (e = e(t)), g(e) && (e = [e]), Array.isArray(e)) return e;
|
|
599
605
|
if (!t) return e.default || [];
|
|
600
|
-
let
|
|
601
|
-
return
|
|
606
|
+
let s = e[t];
|
|
607
|
+
return s || (s = e[this.getScriptPartFromCode(t)]), s || (s = e[this.formatLanguageCode(t)]), s || (s = e[this.getLanguagePartFromCode(t)]), s || (s = e.default), s || [];
|
|
602
608
|
}
|
|
603
609
|
toResolveHierarchy(e, t) {
|
|
604
|
-
const
|
|
605
|
-
r && (this.isSupportedCode(r) ?
|
|
610
|
+
const s = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), i = [], n = (r) => {
|
|
611
|
+
r && (this.isSupportedCode(r) ? i.push(r) : this.logger.warn(`rejecting language code not found in supportedLngs: ${r}`));
|
|
606
612
|
};
|
|
607
|
-
return g(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && n(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && n(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && n(this.getLanguagePartFromCode(e))) : g(e) && n(this.formatLanguageCode(e)),
|
|
608
|
-
|
|
609
|
-
}),
|
|
613
|
+
return g(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && n(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && n(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && n(this.getLanguagePartFromCode(e))) : g(e) && n(this.formatLanguageCode(e)), s.forEach((r) => {
|
|
614
|
+
i.indexOf(r) < 0 && n(this.formatLanguageCode(r));
|
|
615
|
+
}), i;
|
|
610
616
|
}
|
|
611
617
|
}
|
|
612
618
|
const ce = {
|
|
@@ -630,50 +636,50 @@ class Te {
|
|
|
630
636
|
this.pluralRulesCache = {};
|
|
631
637
|
}
|
|
632
638
|
getRule(e, t = {}) {
|
|
633
|
-
const
|
|
634
|
-
cleanedCode:
|
|
635
|
-
type:
|
|
639
|
+
const s = M(e === "dev" ? "en" : e), i = t.ordinal ? "ordinal" : "cardinal", n = JSON.stringify({
|
|
640
|
+
cleanedCode: s,
|
|
641
|
+
type: i
|
|
636
642
|
});
|
|
637
643
|
if (n in this.pluralRulesCache)
|
|
638
644
|
return this.pluralRulesCache[n];
|
|
639
645
|
let r;
|
|
640
646
|
try {
|
|
641
|
-
r = new Intl.PluralRules(
|
|
642
|
-
type:
|
|
647
|
+
r = new Intl.PluralRules(s, {
|
|
648
|
+
type: i
|
|
643
649
|
});
|
|
644
650
|
} catch {
|
|
645
651
|
if (typeof Intl > "u")
|
|
646
652
|
return this.logger.error("No Intl support, please use an Intl polyfill!"), he;
|
|
647
653
|
if (!e.match(/-|_/)) return he;
|
|
648
|
-
const
|
|
649
|
-
r = this.getRule(
|
|
654
|
+
const l = this.languageUtils.getLanguagePartFromCode(e);
|
|
655
|
+
r = this.getRule(l, t);
|
|
650
656
|
}
|
|
651
657
|
return this.pluralRulesCache[n] = r, r;
|
|
652
658
|
}
|
|
653
659
|
needsPlural(e, t = {}) {
|
|
654
|
-
let
|
|
655
|
-
return
|
|
660
|
+
let s = this.getRule(e, t);
|
|
661
|
+
return s || (s = this.getRule("dev", t)), (s == null ? void 0 : s.resolvedOptions().pluralCategories.length) > 1;
|
|
656
662
|
}
|
|
657
|
-
getPluralFormsOfKey(e, t,
|
|
658
|
-
return this.getSuffixes(e,
|
|
663
|
+
getPluralFormsOfKey(e, t, s = {}) {
|
|
664
|
+
return this.getSuffixes(e, s).map((i) => `${t}${i}`);
|
|
659
665
|
}
|
|
660
666
|
getSuffixes(e, t = {}) {
|
|
661
|
-
let
|
|
662
|
-
return
|
|
667
|
+
let s = this.getRule(e, t);
|
|
668
|
+
return s || (s = this.getRule("dev", t)), s ? s.resolvedOptions().pluralCategories.sort((i, n) => ce[i] - ce[n]).map((i) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : [];
|
|
663
669
|
}
|
|
664
|
-
getSuffix(e, t,
|
|
665
|
-
const
|
|
666
|
-
return
|
|
670
|
+
getSuffix(e, t, s = {}) {
|
|
671
|
+
const i = this.getRule(e, s);
|
|
672
|
+
return i ? `${this.options.prepend}${s.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, s));
|
|
667
673
|
}
|
|
668
674
|
}
|
|
669
|
-
const de = (a, e, t,
|
|
675
|
+
const de = (a, e, t, s = ".", i = !0) => {
|
|
670
676
|
let n = Pe(a, e, t);
|
|
671
|
-
return !n &&
|
|
672
|
-
},
|
|
677
|
+
return !n && i && g(t) && (n = q(a, t, s), n === void 0 && (n = q(e, t, s))), n;
|
|
678
|
+
}, Z = (a) => a.replace(/\$/g, "$$$$");
|
|
673
679
|
class pe {
|
|
674
680
|
constructor(e = {}) {
|
|
675
681
|
var t;
|
|
676
|
-
this.logger = R.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((
|
|
682
|
+
this.logger = R.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((s) => s), this.init(e);
|
|
677
683
|
}
|
|
678
684
|
init(e = {}) {
|
|
679
685
|
e.interpolation || (e.interpolation = {
|
|
@@ -681,13 +687,13 @@ class pe {
|
|
|
681
687
|
});
|
|
682
688
|
const {
|
|
683
689
|
escape: t,
|
|
684
|
-
escapeValue:
|
|
685
|
-
useRawValueToEscape:
|
|
690
|
+
escapeValue: s,
|
|
691
|
+
useRawValueToEscape: i,
|
|
686
692
|
prefix: n,
|
|
687
693
|
prefixEscaped: r,
|
|
688
694
|
suffix: o,
|
|
689
|
-
suffixEscaped:
|
|
690
|
-
formatSeparator:
|
|
695
|
+
suffixEscaped: l,
|
|
696
|
+
formatSeparator: u,
|
|
691
697
|
unescapeSuffix: c,
|
|
692
698
|
unescapePrefix: f,
|
|
693
699
|
nestingPrefix: p,
|
|
@@ -696,52 +702,52 @@ class pe {
|
|
|
696
702
|
nestingSuffixEscaped: m,
|
|
697
703
|
nestingOptionsSeparator: x,
|
|
698
704
|
maxReplaces: O,
|
|
699
|
-
alwaysFormat:
|
|
705
|
+
alwaysFormat: v
|
|
700
706
|
} = e.interpolation;
|
|
701
|
-
this.escape = t !== void 0 ? t : Re, this.escapeValue =
|
|
707
|
+
this.escape = t !== void 0 ? t : Re, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = n ? I(n) : r || "{{", this.suffix = o ? I(o) : l || "}}", this.formatSeparator = u || ",", this.unescapePrefix = c ? "" : f || "-", this.unescapeSuffix = this.unescapePrefix ? "" : c || "", this.nestingPrefix = p ? I(p) : d || I("$t("), this.nestingSuffix = h ? I(h) : m || I(")"), this.nestingOptionsSeparator = x || ",", this.maxReplaces = O || 1e3, this.alwaysFormat = v !== void 0 ? v : !1, this.resetRegExp();
|
|
702
708
|
}
|
|
703
709
|
reset() {
|
|
704
710
|
this.options && this.init(this.options);
|
|
705
711
|
}
|
|
706
712
|
resetRegExp() {
|
|
707
|
-
const e = (t,
|
|
713
|
+
const e = (t, s) => (t == null ? void 0 : t.source) === s ? (t.lastIndex = 0, t) : new RegExp(s, "g");
|
|
708
714
|
this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
|
|
709
715
|
}
|
|
710
|
-
interpolate(e, t,
|
|
716
|
+
interpolate(e, t, s, i) {
|
|
711
717
|
var d;
|
|
712
718
|
let n, r, o;
|
|
713
|
-
const
|
|
719
|
+
const l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u = (h) => {
|
|
714
720
|
if (h.indexOf(this.formatSeparator) < 0) {
|
|
715
|
-
const
|
|
716
|
-
return this.alwaysFormat ? this.format(
|
|
717
|
-
...
|
|
721
|
+
const v = de(t, l, h, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
722
|
+
return this.alwaysFormat ? this.format(v, void 0, s, {
|
|
723
|
+
...i,
|
|
718
724
|
...t,
|
|
719
725
|
interpolationkey: h
|
|
720
|
-
}) :
|
|
726
|
+
}) : v;
|
|
721
727
|
}
|
|
722
728
|
const m = h.split(this.formatSeparator), x = m.shift().trim(), O = m.join(this.formatSeparator).trim();
|
|
723
|
-
return this.format(de(t,
|
|
724
|
-
...
|
|
729
|
+
return this.format(de(t, l, x, this.options.keySeparator, this.options.ignoreJSONStructure), O, s, {
|
|
730
|
+
...i,
|
|
725
731
|
...t,
|
|
726
732
|
interpolationkey: x
|
|
727
733
|
});
|
|
728
734
|
};
|
|
729
735
|
this.resetRegExp();
|
|
730
|
-
const c = (
|
|
736
|
+
const c = (i == null ? void 0 : i.missingInterpolationHandler) || this.options.missingInterpolationHandler, f = ((d = i == null ? void 0 : i.interpolation) == null ? void 0 : d.skipOnVariables) !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
731
737
|
return [{
|
|
732
738
|
regex: this.regexpUnescape,
|
|
733
|
-
safeValue: (h) =>
|
|
739
|
+
safeValue: (h) => Z(h)
|
|
734
740
|
}, {
|
|
735
741
|
regex: this.regexp,
|
|
736
|
-
safeValue: (h) => this.escapeValue ?
|
|
742
|
+
safeValue: (h) => this.escapeValue ? Z(this.escape(h)) : Z(h)
|
|
737
743
|
}].forEach((h) => {
|
|
738
744
|
for (o = 0; n = h.regex.exec(e); ) {
|
|
739
745
|
const m = n[1].trim();
|
|
740
|
-
if (r =
|
|
746
|
+
if (r = u(m), r === void 0)
|
|
741
747
|
if (typeof c == "function") {
|
|
742
|
-
const O = c(e, n,
|
|
748
|
+
const O = c(e, n, i);
|
|
743
749
|
r = g(O) ? O : "";
|
|
744
|
-
} else if (
|
|
750
|
+
} else if (i && Object.prototype.hasOwnProperty.call(i, m))
|
|
745
751
|
r = "";
|
|
746
752
|
else if (f) {
|
|
747
753
|
r = n[0];
|
|
@@ -755,37 +761,37 @@ class pe {
|
|
|
755
761
|
}
|
|
756
762
|
}), e;
|
|
757
763
|
}
|
|
758
|
-
nest(e, t,
|
|
759
|
-
let
|
|
760
|
-
const o = (
|
|
764
|
+
nest(e, t, s = {}) {
|
|
765
|
+
let i, n, r;
|
|
766
|
+
const o = (l, u) => {
|
|
761
767
|
const c = this.nestingOptionsSeparator;
|
|
762
|
-
if (
|
|
763
|
-
const f =
|
|
768
|
+
if (l.indexOf(c) < 0) return l;
|
|
769
|
+
const f = l.split(new RegExp(`${I(c)}[ ]*{`));
|
|
764
770
|
let p = `{${f[1]}`;
|
|
765
|
-
|
|
771
|
+
l = f[0], p = this.interpolate(p, r);
|
|
766
772
|
const d = p.match(/'/g), h = p.match(/"/g);
|
|
767
773
|
(((d == null ? void 0 : d.length) ?? 0) % 2 === 0 && !h || ((h == null ? void 0 : h.length) ?? 0) % 2 !== 0) && (p = p.replace(/'/g, '"'));
|
|
768
774
|
try {
|
|
769
|
-
r = JSON.parse(p),
|
|
770
|
-
...
|
|
775
|
+
r = JSON.parse(p), u && (r = {
|
|
776
|
+
...u,
|
|
771
777
|
...r
|
|
772
778
|
});
|
|
773
779
|
} catch (m) {
|
|
774
|
-
return this.logger.warn(`failed parsing options string in nesting for key ${
|
|
780
|
+
return this.logger.warn(`failed parsing options string in nesting for key ${l}`, m), `${l}${c}${p}`;
|
|
775
781
|
}
|
|
776
|
-
return r.defaultValue && r.defaultValue.indexOf(this.prefix) > -1 && delete r.defaultValue,
|
|
782
|
+
return r.defaultValue && r.defaultValue.indexOf(this.prefix) > -1 && delete r.defaultValue, l;
|
|
777
783
|
};
|
|
778
|
-
for (;
|
|
779
|
-
let
|
|
784
|
+
for (; i = this.nestingRegexp.exec(e); ) {
|
|
785
|
+
let l = [];
|
|
780
786
|
r = {
|
|
781
|
-
...
|
|
787
|
+
...s
|
|
782
788
|
}, r = r.replace && !g(r.replace) ? r.replace : r, r.applyPostProcessor = !1, delete r.defaultValue;
|
|
783
|
-
const
|
|
784
|
-
if (
|
|
785
|
-
g(n) || (n = ne(n)), n || (this.logger.warn(`missed to resolve ${
|
|
786
|
-
...
|
|
787
|
-
interpolationkey:
|
|
788
|
-
}), n.trim())), e = e.replace(
|
|
789
|
+
const u = /{.*}/.test(i[1]) ? i[1].lastIndexOf("}") + 1 : i[1].indexOf(this.formatSeparator);
|
|
790
|
+
if (u !== -1 && (l = i[1].slice(u).split(this.formatSeparator).map((c) => c.trim()).filter(Boolean), i[1] = i[1].slice(0, u)), n = t(o.call(this, i[1].trim(), r), r), n && i[0] === e && !g(n)) return n;
|
|
791
|
+
g(n) || (n = ne(n)), n || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), n = ""), l.length && (n = l.reduce((c, f) => this.format(c, f, s.lng, {
|
|
792
|
+
...s,
|
|
793
|
+
interpolationkey: i[1].trim()
|
|
794
|
+
}), n.trim())), e = e.replace(i[0], n), this.regexp.lastIndex = 0;
|
|
789
795
|
}
|
|
790
796
|
return e;
|
|
791
797
|
}
|
|
@@ -794,13 +800,13 @@ const Ve = (a) => {
|
|
|
794
800
|
let e = a.toLowerCase().trim();
|
|
795
801
|
const t = {};
|
|
796
802
|
if (a.indexOf("(") > -1) {
|
|
797
|
-
const
|
|
798
|
-
e =
|
|
799
|
-
const
|
|
800
|
-
e === "currency" &&
|
|
803
|
+
const s = a.split("(");
|
|
804
|
+
e = s[0].toLowerCase().trim();
|
|
805
|
+
const i = s[1].substring(0, s[1].length - 1);
|
|
806
|
+
e === "currency" && i.indexOf(":") < 0 ? t.currency || (t.currency = i.trim()) : e === "relativetime" && i.indexOf(":") < 0 ? t.range || (t.range = i.trim()) : i.split(";").forEach((r) => {
|
|
801
807
|
if (r) {
|
|
802
|
-
const [o, ...
|
|
803
|
-
t[c] || (t[c] =
|
|
808
|
+
const [o, ...l] = r.split(":"), u = l.join(":").trim().replace(/^'+|'+$/g, ""), c = o.trim();
|
|
809
|
+
t[c] || (t[c] = u), u === "false" && (t[c] = !1), u === "true" && (t[c] = !0), isNaN(u) || (t[c] = parseInt(u, 10));
|
|
804
810
|
}
|
|
805
811
|
});
|
|
806
812
|
}
|
|
@@ -810,18 +816,18 @@ const Ve = (a) => {
|
|
|
810
816
|
};
|
|
811
817
|
}, ge = (a) => {
|
|
812
818
|
const e = {};
|
|
813
|
-
return (t,
|
|
814
|
-
let n =
|
|
815
|
-
|
|
819
|
+
return (t, s, i) => {
|
|
820
|
+
let n = i;
|
|
821
|
+
i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (n = {
|
|
816
822
|
...n,
|
|
817
|
-
[
|
|
823
|
+
[i.interpolationkey]: void 0
|
|
818
824
|
});
|
|
819
|
-
const r =
|
|
825
|
+
const r = s + JSON.stringify(n);
|
|
820
826
|
let o = e[r];
|
|
821
|
-
return o || (o = a(
|
|
827
|
+
return o || (o = a(M(s), i), e[r] = o), o(t);
|
|
822
828
|
};
|
|
823
|
-
}, De = (a) => (e, t,
|
|
824
|
-
class
|
|
829
|
+
}, De = (a) => (e, t, s) => a(M(t), s)(e);
|
|
830
|
+
class Ae {
|
|
825
831
|
constructor(e = {}) {
|
|
826
832
|
this.logger = R.create("formatter"), this.options = e, this.init(e);
|
|
827
833
|
}
|
|
@@ -829,35 +835,35 @@ class Ke {
|
|
|
829
835
|
interpolation: {}
|
|
830
836
|
}) {
|
|
831
837
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
832
|
-
const
|
|
838
|
+
const s = t.cacheInBuiltFormats ? ge : De;
|
|
833
839
|
this.formats = {
|
|
834
|
-
number:
|
|
835
|
-
const r = new Intl.NumberFormat(
|
|
840
|
+
number: s((i, n) => {
|
|
841
|
+
const r = new Intl.NumberFormat(i, {
|
|
836
842
|
...n
|
|
837
843
|
});
|
|
838
844
|
return (o) => r.format(o);
|
|
839
845
|
}),
|
|
840
|
-
currency:
|
|
841
|
-
const r = new Intl.NumberFormat(
|
|
846
|
+
currency: s((i, n) => {
|
|
847
|
+
const r = new Intl.NumberFormat(i, {
|
|
842
848
|
...n,
|
|
843
849
|
style: "currency"
|
|
844
850
|
});
|
|
845
851
|
return (o) => r.format(o);
|
|
846
852
|
}),
|
|
847
|
-
datetime:
|
|
848
|
-
const r = new Intl.DateTimeFormat(
|
|
853
|
+
datetime: s((i, n) => {
|
|
854
|
+
const r = new Intl.DateTimeFormat(i, {
|
|
849
855
|
...n
|
|
850
856
|
});
|
|
851
857
|
return (o) => r.format(o);
|
|
852
858
|
}),
|
|
853
|
-
relativetime:
|
|
854
|
-
const r = new Intl.RelativeTimeFormat(
|
|
859
|
+
relativetime: s((i, n) => {
|
|
860
|
+
const r = new Intl.RelativeTimeFormat(i, {
|
|
855
861
|
...n
|
|
856
862
|
});
|
|
857
863
|
return (o) => r.format(o, n.range || "day");
|
|
858
864
|
}),
|
|
859
|
-
list:
|
|
860
|
-
const r = new Intl.ListFormat(
|
|
865
|
+
list: s((i, n) => {
|
|
866
|
+
const r = new Intl.ListFormat(i, {
|
|
861
867
|
...n
|
|
862
868
|
});
|
|
863
869
|
return (o) => r.format(o);
|
|
@@ -870,25 +876,25 @@ class Ke {
|
|
|
870
876
|
addCached(e, t) {
|
|
871
877
|
this.formats[e.toLowerCase().trim()] = ge(t);
|
|
872
878
|
}
|
|
873
|
-
format(e, t,
|
|
879
|
+
format(e, t, s, i = {}) {
|
|
874
880
|
const n = t.split(this.formatSeparator);
|
|
875
881
|
if (n.length > 1 && n[0].indexOf("(") > 1 && n[0].indexOf(")") < 0 && n.find((o) => o.indexOf(")") > -1)) {
|
|
876
|
-
const o = n.findIndex((
|
|
882
|
+
const o = n.findIndex((l) => l.indexOf(")") > -1);
|
|
877
883
|
n[0] = [n[0], ...n.splice(1, o)].join(this.formatSeparator);
|
|
878
884
|
}
|
|
879
|
-
return n.reduce((o,
|
|
885
|
+
return n.reduce((o, l) => {
|
|
880
886
|
var f;
|
|
881
887
|
const {
|
|
882
|
-
formatName:
|
|
888
|
+
formatName: u,
|
|
883
889
|
formatOptions: c
|
|
884
|
-
} = Ve(
|
|
885
|
-
if (this.formats[
|
|
890
|
+
} = Ve(l);
|
|
891
|
+
if (this.formats[u]) {
|
|
886
892
|
let p = o;
|
|
887
893
|
try {
|
|
888
|
-
const d = ((f =
|
|
889
|
-
p = this.formats[
|
|
894
|
+
const d = ((f = i == null ? void 0 : i.formatParams) == null ? void 0 : f[i.interpolationkey]) || {}, h = d.locale || d.lng || i.locale || i.lng || s;
|
|
895
|
+
p = this.formats[u](o, h, {
|
|
890
896
|
...c,
|
|
891
|
-
...
|
|
897
|
+
...i,
|
|
892
898
|
...d
|
|
893
899
|
});
|
|
894
900
|
} catch (d) {
|
|
@@ -896,127 +902,127 @@ class Ke {
|
|
|
896
902
|
}
|
|
897
903
|
return p;
|
|
898
904
|
} else
|
|
899
|
-
this.logger.warn(`there was no format function for ${
|
|
905
|
+
this.logger.warn(`there was no format function for ${u}`);
|
|
900
906
|
return o;
|
|
901
907
|
}, e);
|
|
902
908
|
}
|
|
903
909
|
}
|
|
904
|
-
const
|
|
910
|
+
const Ke = (a, e) => {
|
|
905
911
|
a.pending[e] !== void 0 && (delete a.pending[e], a.pendingCount--);
|
|
906
912
|
};
|
|
907
|
-
class Ue extends
|
|
908
|
-
constructor(e, t,
|
|
913
|
+
class Ue extends G {
|
|
914
|
+
constructor(e, t, s, i = {}) {
|
|
909
915
|
var n, r;
|
|
910
|
-
super(), this.backend = e, this.store = t, this.services =
|
|
916
|
+
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = i, this.logger = R.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], (r = (n = this.backend) == null ? void 0 : n.init) == null || r.call(n, s, i.backend, i);
|
|
911
917
|
}
|
|
912
|
-
queueLoad(e, t,
|
|
913
|
-
const n = {}, r = {}, o = {},
|
|
914
|
-
return e.forEach((
|
|
918
|
+
queueLoad(e, t, s, i) {
|
|
919
|
+
const n = {}, r = {}, o = {}, l = {};
|
|
920
|
+
return e.forEach((u) => {
|
|
915
921
|
let c = !0;
|
|
916
922
|
t.forEach((f) => {
|
|
917
|
-
const p = `${
|
|
918
|
-
!
|
|
919
|
-
}), c || (o[
|
|
923
|
+
const p = `${u}|${f}`;
|
|
924
|
+
!s.reload && this.store.hasResourceBundle(u, f) ? this.state[p] = 2 : this.state[p] < 0 || (this.state[p] === 1 ? r[p] === void 0 && (r[p] = !0) : (this.state[p] = 1, c = !1, r[p] === void 0 && (r[p] = !0), n[p] === void 0 && (n[p] = !0), l[f] === void 0 && (l[f] = !0)));
|
|
925
|
+
}), c || (o[u] = !0);
|
|
920
926
|
}), (Object.keys(n).length || Object.keys(r).length) && this.queue.push({
|
|
921
927
|
pending: r,
|
|
922
928
|
pendingCount: Object.keys(r).length,
|
|
923
929
|
loaded: {},
|
|
924
930
|
errors: [],
|
|
925
|
-
callback:
|
|
931
|
+
callback: i
|
|
926
932
|
}), {
|
|
927
933
|
toLoad: Object.keys(n),
|
|
928
934
|
pending: Object.keys(r),
|
|
929
935
|
toLoadLanguages: Object.keys(o),
|
|
930
|
-
toLoadNamespaces: Object.keys(
|
|
936
|
+
toLoadNamespaces: Object.keys(l)
|
|
931
937
|
};
|
|
932
938
|
}
|
|
933
|
-
loaded(e, t,
|
|
934
|
-
const
|
|
935
|
-
t && this.emit("failedLoading", n, r, t), !t &&
|
|
939
|
+
loaded(e, t, s) {
|
|
940
|
+
const i = e.split("|"), n = i[0], r = i[1];
|
|
941
|
+
t && this.emit("failedLoading", n, r, t), !t && s && this.store.addResourceBundle(n, r, s, void 0, void 0, {
|
|
936
942
|
skipCopy: !0
|
|
937
|
-
}), this.state[e] = t ? -1 : 2, t &&
|
|
943
|
+
}), this.state[e] = t ? -1 : 2, t && s && (this.state[e] = 0);
|
|
938
944
|
const o = {};
|
|
939
|
-
this.queue.forEach((
|
|
940
|
-
ve(
|
|
941
|
-
o[
|
|
942
|
-
const c =
|
|
945
|
+
this.queue.forEach((l) => {
|
|
946
|
+
ve(l.loaded, [n], r), Ke(l, e), t && l.errors.push(t), l.pendingCount === 0 && !l.done && (Object.keys(l.loaded).forEach((u) => {
|
|
947
|
+
o[u] || (o[u] = {});
|
|
948
|
+
const c = l.loaded[u];
|
|
943
949
|
c.length && c.forEach((f) => {
|
|
944
|
-
o[
|
|
950
|
+
o[u][f] === void 0 && (o[u][f] = !0);
|
|
945
951
|
});
|
|
946
|
-
}),
|
|
947
|
-
}), this.emit("loaded", o), this.queue = this.queue.filter((
|
|
952
|
+
}), l.done = !0, l.errors.length ? l.callback(l.errors) : l.callback());
|
|
953
|
+
}), this.emit("loaded", o), this.queue = this.queue.filter((l) => !l.done);
|
|
948
954
|
}
|
|
949
|
-
read(e, t,
|
|
955
|
+
read(e, t, s, i = 0, n = this.retryTimeout, r) {
|
|
950
956
|
if (!e.length) return r(null, {});
|
|
951
957
|
if (this.readingCalls >= this.maxParallelReads) {
|
|
952
958
|
this.waitingReads.push({
|
|
953
959
|
lng: e,
|
|
954
960
|
ns: t,
|
|
955
|
-
fcName:
|
|
956
|
-
tried:
|
|
961
|
+
fcName: s,
|
|
962
|
+
tried: i,
|
|
957
963
|
wait: n,
|
|
958
964
|
callback: r
|
|
959
965
|
});
|
|
960
966
|
return;
|
|
961
967
|
}
|
|
962
968
|
this.readingCalls++;
|
|
963
|
-
const o = (
|
|
969
|
+
const o = (u, c) => {
|
|
964
970
|
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
965
971
|
const f = this.waitingReads.shift();
|
|
966
972
|
this.read(f.lng, f.ns, f.fcName, f.tried, f.wait, f.callback);
|
|
967
973
|
}
|
|
968
|
-
if (
|
|
974
|
+
if (u && c && i < this.maxRetries) {
|
|
969
975
|
setTimeout(() => {
|
|
970
|
-
this.read.call(this, e, t,
|
|
976
|
+
this.read.call(this, e, t, s, i + 1, n * 2, r);
|
|
971
977
|
}, n);
|
|
972
978
|
return;
|
|
973
979
|
}
|
|
974
|
-
r(
|
|
975
|
-
},
|
|
976
|
-
if (
|
|
980
|
+
r(u, c);
|
|
981
|
+
}, l = this.backend[s].bind(this.backend);
|
|
982
|
+
if (l.length === 2) {
|
|
977
983
|
try {
|
|
978
|
-
const
|
|
979
|
-
|
|
980
|
-
} catch (
|
|
981
|
-
o(
|
|
984
|
+
const u = l(e, t);
|
|
985
|
+
u && typeof u.then == "function" ? u.then((c) => o(null, c)).catch(o) : o(null, u);
|
|
986
|
+
} catch (u) {
|
|
987
|
+
o(u);
|
|
982
988
|
}
|
|
983
989
|
return;
|
|
984
990
|
}
|
|
985
|
-
return
|
|
991
|
+
return l(e, t, o);
|
|
986
992
|
}
|
|
987
|
-
prepareLoading(e, t,
|
|
993
|
+
prepareLoading(e, t, s = {}, i) {
|
|
988
994
|
if (!this.backend)
|
|
989
|
-
return this.logger.warn("No backend was added via i18next.use. Will not load resources."),
|
|
995
|
+
return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
|
|
990
996
|
g(e) && (e = this.languageUtils.toResolveHierarchy(e)), g(t) && (t = [t]);
|
|
991
|
-
const n = this.queueLoad(e, t,
|
|
997
|
+
const n = this.queueLoad(e, t, s, i);
|
|
992
998
|
if (!n.toLoad.length)
|
|
993
|
-
return n.pending.length ||
|
|
999
|
+
return n.pending.length || i(), null;
|
|
994
1000
|
n.toLoad.forEach((r) => {
|
|
995
1001
|
this.loadOne(r);
|
|
996
1002
|
});
|
|
997
1003
|
}
|
|
998
|
-
load(e, t,
|
|
999
|
-
this.prepareLoading(e, t, {},
|
|
1004
|
+
load(e, t, s) {
|
|
1005
|
+
this.prepareLoading(e, t, {}, s);
|
|
1000
1006
|
}
|
|
1001
|
-
reload(e, t,
|
|
1007
|
+
reload(e, t, s) {
|
|
1002
1008
|
this.prepareLoading(e, t, {
|
|
1003
1009
|
reload: !0
|
|
1004
|
-
},
|
|
1010
|
+
}, s);
|
|
1005
1011
|
}
|
|
1006
1012
|
loadOne(e, t = "") {
|
|
1007
|
-
const
|
|
1008
|
-
this.read(
|
|
1009
|
-
r && this.logger.warn(`${t}loading namespace ${n} for language ${
|
|
1013
|
+
const s = e.split("|"), i = s[0], n = s[1];
|
|
1014
|
+
this.read(i, n, "read", void 0, void 0, (r, o) => {
|
|
1015
|
+
r && this.logger.warn(`${t}loading namespace ${n} for language ${i} failed`, r), !r && o && this.logger.log(`${t}loaded namespace ${n} for language ${i}`, o), this.loaded(e, r, o);
|
|
1010
1016
|
});
|
|
1011
1017
|
}
|
|
1012
|
-
saveMissing(e, t,
|
|
1018
|
+
saveMissing(e, t, s, i, n, r = {}, o = () => {
|
|
1013
1019
|
}) {
|
|
1014
|
-
var
|
|
1015
|
-
if ((
|
|
1016
|
-
this.logger.warn(`did not save key "${
|
|
1020
|
+
var l, u, c, f, p;
|
|
1021
|
+
if ((u = (l = this.services) == null ? void 0 : l.utils) != null && u.hasLoadedNamespace && !((f = (c = this.services) == null ? void 0 : c.utils) != null && f.hasLoadedNamespace(t))) {
|
|
1022
|
+
this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
|
|
1017
1023
|
return;
|
|
1018
1024
|
}
|
|
1019
|
-
if (!(
|
|
1025
|
+
if (!(s == null || s === "")) {
|
|
1020
1026
|
if ((p = this.backend) != null && p.create) {
|
|
1021
1027
|
const d = {
|
|
1022
1028
|
...r,
|
|
@@ -1025,18 +1031,18 @@ class Ue extends Y {
|
|
|
1025
1031
|
if (h.length < 6)
|
|
1026
1032
|
try {
|
|
1027
1033
|
let m;
|
|
1028
|
-
h.length === 5 ? m = h(e, t,
|
|
1034
|
+
h.length === 5 ? m = h(e, t, s, i, d) : m = h(e, t, s, i), m && typeof m.then == "function" ? m.then((x) => o(null, x)).catch(o) : o(null, m);
|
|
1029
1035
|
} catch (m) {
|
|
1030
1036
|
o(m);
|
|
1031
1037
|
}
|
|
1032
1038
|
else
|
|
1033
|
-
h(e, t,
|
|
1039
|
+
h(e, t, s, i, o, d);
|
|
1034
1040
|
}
|
|
1035
|
-
!e || !e[0] || this.store.addResource(e[0], t,
|
|
1041
|
+
!e || !e[0] || this.store.addResource(e[0], t, s, i);
|
|
1036
1042
|
}
|
|
1037
1043
|
}
|
|
1038
1044
|
}
|
|
1039
|
-
const
|
|
1045
|
+
const X = () => ({
|
|
1040
1046
|
debug: !1,
|
|
1041
1047
|
initAsync: !0,
|
|
1042
1048
|
ns: ["translation"],
|
|
@@ -1073,8 +1079,8 @@ const Z = () => ({
|
|
|
1073
1079
|
let e = {};
|
|
1074
1080
|
if (typeof a[1] == "object" && (e = a[1]), g(a[1]) && (e.defaultValue = a[1]), g(a[2]) && (e.tDescription = a[2]), typeof a[2] == "object" || typeof a[3] == "object") {
|
|
1075
1081
|
const t = a[3] || a[2];
|
|
1076
|
-
Object.keys(t).forEach((
|
|
1077
|
-
e[
|
|
1082
|
+
Object.keys(t).forEach((s) => {
|
|
1083
|
+
e[s] = t[s];
|
|
1078
1084
|
});
|
|
1079
1085
|
}
|
|
1080
1086
|
return e;
|
|
@@ -1096,7 +1102,7 @@ const Z = () => ({
|
|
|
1096
1102
|
}), me = (a) => {
|
|
1097
1103
|
var e, t;
|
|
1098
1104
|
return g(a.ns) && (a.ns = [a.ns]), g(a.fallbackLng) && (a.fallbackLng = [a.fallbackLng]), g(a.fallbackNS) && (a.fallbackNS = [a.fallbackNS]), ((t = (e = a.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (a.supportedLngs = a.supportedLngs.concat(["cimode"])), typeof a.initImmediate == "boolean" && (a.initAsync = a.initImmediate), a;
|
|
1099
|
-
},
|
|
1105
|
+
}, J = () => {
|
|
1100
1106
|
}, He = (a) => {
|
|
1101
1107
|
Object.getOwnPropertyNames(Object.getPrototypeOf(a)).forEach((t) => {
|
|
1102
1108
|
typeof a[t] == "function" && (a[t] = a[t].bind(a));
|
|
@@ -1104,13 +1110,13 @@ const Z = () => ({
|
|
|
1104
1110
|
}, Oe = "__i18next_supportNoticeShown", Me = () => typeof globalThis < "u" && !!globalThis[Oe], ze = () => {
|
|
1105
1111
|
typeof globalThis < "u" && (globalThis[Oe] = !0);
|
|
1106
1112
|
}, Be = (a) => {
|
|
1107
|
-
var e, t,
|
|
1108
|
-
return !!(((
|
|
1113
|
+
var e, t, s, i, n, r, o, l, u, c, f, p, d;
|
|
1114
|
+
return !!(((s = (t = (e = a == null ? void 0 : a.modules) == null ? void 0 : e.backend) == null ? void 0 : t.name) == null ? void 0 : s.indexOf("Locize")) > 0 || ((o = (r = (n = (i = a == null ? void 0 : a.modules) == null ? void 0 : i.backend) == null ? void 0 : n.constructor) == null ? void 0 : r.name) == null ? void 0 : o.indexOf("Locize")) > 0 || (u = (l = a == null ? void 0 : a.options) == null ? void 0 : l.backend) != null && u.backends && a.options.backend.backends.some((h) => {
|
|
1109
1115
|
var m, x, O;
|
|
1110
1116
|
return ((m = h == null ? void 0 : h.name) == null ? void 0 : m.indexOf("Locize")) > 0 || ((O = (x = h == null ? void 0 : h.constructor) == null ? void 0 : x.name) == null ? void 0 : O.indexOf("Locize")) > 0;
|
|
1111
1117
|
}) || (f = (c = a == null ? void 0 : a.options) == null ? void 0 : c.backend) != null && f.projectId || (d = (p = a == null ? void 0 : a.options) == null ? void 0 : p.backend) != null && d.backendOptions && a.options.backend.backendOptions.some((h) => h == null ? void 0 : h.projectId));
|
|
1112
1118
|
};
|
|
1113
|
-
class
|
|
1119
|
+
class H extends G {
|
|
1114
1120
|
constructor(e = {}, t) {
|
|
1115
1121
|
if (super(), this.options = me(e), this.services = {}, this.logger = R, this.modules = {
|
|
1116
1122
|
external: []
|
|
@@ -1124,77 +1130,77 @@ class U extends Y {
|
|
|
1124
1130
|
}
|
|
1125
1131
|
init(e = {}, t) {
|
|
1126
1132
|
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (g(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
|
|
1127
|
-
const
|
|
1133
|
+
const s = X();
|
|
1128
1134
|
this.options = {
|
|
1129
|
-
...
|
|
1135
|
+
...s,
|
|
1130
1136
|
...this.options,
|
|
1131
1137
|
...me(e)
|
|
1132
1138
|
}, this.options.interpolation = {
|
|
1133
|
-
...
|
|
1139
|
+
...s.interpolation,
|
|
1134
1140
|
...this.options.interpolation
|
|
1135
|
-
}, 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 =
|
|
1136
|
-
const
|
|
1141
|
+
}, 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 = s.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !Be(this) && !Me() && (typeof console < "u" && typeof console.info < "u" && console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"), ze());
|
|
1142
|
+
const i = (u) => u ? typeof u == "function" ? new u() : u : null;
|
|
1137
1143
|
if (!this.options.isClone) {
|
|
1138
|
-
this.modules.logger ? R.init(
|
|
1139
|
-
let
|
|
1140
|
-
this.modules.formatter ?
|
|
1144
|
+
this.modules.logger ? R.init(i(this.modules.logger), this.options) : R.init(null, this.options);
|
|
1145
|
+
let u;
|
|
1146
|
+
this.modules.formatter ? u = this.modules.formatter : u = Ae;
|
|
1141
1147
|
const c = new fe(this.options);
|
|
1142
1148
|
this.store = new le(this.options.resources, this.options);
|
|
1143
1149
|
const f = this.services;
|
|
1144
1150
|
f.logger = R, f.resourceStore = this.store, f.languageUtils = c, f.pluralResolver = new Te(c, {
|
|
1145
1151
|
prepend: this.options.pluralSeparator,
|
|
1146
1152
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1147
|
-
}), this.options.interpolation.format && this.options.interpolation.format !==
|
|
1153
|
+
}), this.options.interpolation.format && this.options.interpolation.format !== s.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"), u && (!this.options.interpolation.format || this.options.interpolation.format === s.interpolation.format) && (f.formatter = i(u), f.formatter.init && f.formatter.init(f, this.options), this.options.interpolation.format = f.formatter.format.bind(f.formatter)), f.interpolator = new pe(this.options), f.utils = {
|
|
1148
1154
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1149
|
-
}, f.backendConnector = new Ue(
|
|
1155
|
+
}, f.backendConnector = new Ue(i(this.modules.backend), f.resourceStore, f, this.options), f.backendConnector.on("*", (d, ...h) => {
|
|
1150
1156
|
this.emit(d, ...h);
|
|
1151
|
-
}), this.modules.languageDetector && (f.languageDetector =
|
|
1157
|
+
}), this.modules.languageDetector && (f.languageDetector = i(this.modules.languageDetector), f.languageDetector.init && f.languageDetector.init(f, this.options.detection, this.options)), this.modules.i18nFormat && (f.i18nFormat = i(this.modules.i18nFormat), f.i18nFormat.init && f.i18nFormat.init(this)), this.translator = new Y(this.services, this.options), this.translator.on("*", (d, ...h) => {
|
|
1152
1158
|
this.emit(d, ...h);
|
|
1153
1159
|
}), this.modules.external.forEach((d) => {
|
|
1154
1160
|
d.init && d.init(this);
|
|
1155
1161
|
});
|
|
1156
1162
|
}
|
|
1157
|
-
if (this.format = this.options.interpolation.format, t || (t =
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1163
|
+
if (this.format = this.options.interpolation.format, t || (t = J), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
1164
|
+
const u = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1165
|
+
u.length > 0 && u[0] !== "dev" && (this.options.lng = u[0]);
|
|
1160
1166
|
}
|
|
1161
|
-
!this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((
|
|
1162
|
-
this[
|
|
1163
|
-
}), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((
|
|
1164
|
-
this[
|
|
1167
|
+
!this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((u) => {
|
|
1168
|
+
this[u] = (...c) => this.store[u](...c);
|
|
1169
|
+
}), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((u) => {
|
|
1170
|
+
this[u] = (...c) => (this.store[u](...c), this);
|
|
1165
1171
|
});
|
|
1166
|
-
const o =
|
|
1167
|
-
const
|
|
1172
|
+
const o = A(), l = () => {
|
|
1173
|
+
const u = (c, f) => {
|
|
1168
1174
|
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), o.resolve(f), t(c, f);
|
|
1169
1175
|
};
|
|
1170
|
-
if (this.languages && !this.isInitialized) return
|
|
1171
|
-
this.changeLanguage(this.options.lng,
|
|
1176
|
+
if (this.languages && !this.isInitialized) return u(null, this.t.bind(this));
|
|
1177
|
+
this.changeLanguage(this.options.lng, u);
|
|
1172
1178
|
};
|
|
1173
|
-
return this.options.resources || !this.options.initAsync ?
|
|
1179
|
+
return this.options.resources || !this.options.initAsync ? l() : setTimeout(l, 0), o;
|
|
1174
1180
|
}
|
|
1175
|
-
loadResources(e, t =
|
|
1181
|
+
loadResources(e, t = J) {
|
|
1176
1182
|
var n, r;
|
|
1177
|
-
let
|
|
1178
|
-
const
|
|
1179
|
-
if (typeof e == "function" && (
|
|
1180
|
-
if ((
|
|
1181
|
-
const o = [],
|
|
1182
|
-
if (!
|
|
1183
|
-
this.services.languageUtils.toResolveHierarchy(
|
|
1183
|
+
let s = t;
|
|
1184
|
+
const i = g(e) ? e : this.language;
|
|
1185
|
+
if (typeof e == "function" && (s = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1186
|
+
if ((i == null ? void 0 : i.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return s();
|
|
1187
|
+
const o = [], l = (u) => {
|
|
1188
|
+
if (!u || u === "cimode") return;
|
|
1189
|
+
this.services.languageUtils.toResolveHierarchy(u).forEach((f) => {
|
|
1184
1190
|
f !== "cimode" && o.indexOf(f) < 0 && o.push(f);
|
|
1185
1191
|
});
|
|
1186
1192
|
};
|
|
1187
|
-
|
|
1188
|
-
!
|
|
1193
|
+
i ? l(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((c) => l(c)), (r = (n = this.options.preload) == null ? void 0 : n.forEach) == null || r.call(n, (u) => l(u)), this.services.backendConnector.load(o, this.options.ns, (u) => {
|
|
1194
|
+
!u && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), s(u);
|
|
1189
1195
|
});
|
|
1190
1196
|
} else
|
|
1191
|
-
|
|
1197
|
+
s(null);
|
|
1192
1198
|
}
|
|
1193
|
-
reloadResources(e, t,
|
|
1194
|
-
const
|
|
1195
|
-
return typeof e == "function" && (
|
|
1196
|
-
|
|
1197
|
-
}),
|
|
1199
|
+
reloadResources(e, t, s) {
|
|
1200
|
+
const i = A();
|
|
1201
|
+
return typeof e == "function" && (s = e, e = void 0), typeof t == "function" && (s = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), s || (s = J), this.services.backendConnector.reload(e, t, (n) => {
|
|
1202
|
+
i.resolve(), s(n);
|
|
1203
|
+
}), i;
|
|
1198
1204
|
}
|
|
1199
1205
|
use(e) {
|
|
1200
1206
|
if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
@@ -1204,9 +1210,9 @@ class U extends Y {
|
|
|
1204
1210
|
setResolvedLanguage(e) {
|
|
1205
1211
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
|
|
1206
1212
|
for (let t = 0; t < this.languages.length; t++) {
|
|
1207
|
-
const
|
|
1208
|
-
if (!(["cimode", "dev"].indexOf(
|
|
1209
|
-
this.resolvedLanguage =
|
|
1213
|
+
const s = this.languages[t];
|
|
1214
|
+
if (!(["cimode", "dev"].indexOf(s) > -1) && this.store.hasLanguageSomeTranslations(s)) {
|
|
1215
|
+
this.resolvedLanguage = s;
|
|
1210
1216
|
break;
|
|
1211
1217
|
}
|
|
1212
1218
|
}
|
|
@@ -1215,39 +1221,39 @@ class U extends Y {
|
|
|
1215
1221
|
}
|
|
1216
1222
|
changeLanguage(e, t) {
|
|
1217
1223
|
this.isLanguageChangingTo = e;
|
|
1218
|
-
const
|
|
1224
|
+
const s = A();
|
|
1219
1225
|
this.emit("languageChanging", e);
|
|
1220
|
-
const
|
|
1226
|
+
const i = (o) => {
|
|
1221
1227
|
this.language = o, this.languages = this.services.languageUtils.toResolveHierarchy(o), this.resolvedLanguage = void 0, this.setResolvedLanguage(o);
|
|
1222
|
-
}, n = (o,
|
|
1223
|
-
|
|
1228
|
+
}, n = (o, l) => {
|
|
1229
|
+
l ? this.isLanguageChangingTo === e && (i(l), this.translator.changeLanguage(l), this.isLanguageChangingTo = void 0, this.emit("languageChanged", l), this.logger.log("languageChanged", l)) : this.isLanguageChangingTo = void 0, s.resolve((...u) => this.t(...u)), t && t(o, (...u) => this.t(...u));
|
|
1224
1230
|
}, r = (o) => {
|
|
1225
1231
|
var c, f;
|
|
1226
1232
|
!e && !o && this.services.languageDetector && (o = []);
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1229
|
-
n(p,
|
|
1233
|
+
const l = g(o) ? o : o && o[0], u = this.store.hasLanguageSomeTranslations(l) ? l : this.services.languageUtils.getBestMatchFromCodes(g(o) ? [o] : o);
|
|
1234
|
+
u && (this.language || i(u), this.translator.language || this.translator.changeLanguage(u), (f = (c = this.services.languageDetector) == null ? void 0 : c.cacheUserLanguage) == null || f.call(c, u)), this.loadResources(u, (p) => {
|
|
1235
|
+
n(p, u);
|
|
1230
1236
|
});
|
|
1231
1237
|
};
|
|
1232
|
-
return !e && this.services.languageDetector && !this.services.languageDetector.async ? r(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(r) : this.services.languageDetector.detect(r) : r(e),
|
|
1238
|
+
return !e && this.services.languageDetector && !this.services.languageDetector.async ? r(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(r) : this.services.languageDetector.detect(r) : r(e), s;
|
|
1233
1239
|
}
|
|
1234
|
-
getFixedT(e, t,
|
|
1235
|
-
const
|
|
1236
|
-
let
|
|
1237
|
-
typeof r != "object" ?
|
|
1240
|
+
getFixedT(e, t, s) {
|
|
1241
|
+
const i = (n, r, ...o) => {
|
|
1242
|
+
let l;
|
|
1243
|
+
typeof r != "object" ? l = this.options.overloadTranslationOptionHandler([n, r].concat(o)) : l = {
|
|
1238
1244
|
...r
|
|
1239
|
-
},
|
|
1240
|
-
const
|
|
1245
|
+
}, l.lng = l.lng || i.lng, l.lngs = l.lngs || i.lngs, l.ns = l.ns || i.ns, l.keyPrefix !== "" && (l.keyPrefix = l.keyPrefix || s || i.keyPrefix);
|
|
1246
|
+
const u = this.options.keySeparator || ".";
|
|
1241
1247
|
let c;
|
|
1242
|
-
return
|
|
1248
|
+
return l.keyPrefix && Array.isArray(n) ? c = n.map((f) => (typeof f == "function" && (f = U(f, {
|
|
1243
1249
|
...this.options,
|
|
1244
1250
|
...r
|
|
1245
|
-
})), `${
|
|
1251
|
+
})), `${l.keyPrefix}${u}${f}`)) : (typeof n == "function" && (n = U(n, {
|
|
1246
1252
|
...this.options,
|
|
1247
1253
|
...r
|
|
1248
|
-
})), c =
|
|
1254
|
+
})), c = l.keyPrefix ? `${l.keyPrefix}${u}${n}` : n), this.t(c, l);
|
|
1249
1255
|
};
|
|
1250
|
-
return g(e) ?
|
|
1256
|
+
return g(e) ? i.lng = e : i.lngs = e, i.ns = t, i.keyPrefix = s, i;
|
|
1251
1257
|
}
|
|
1252
1258
|
t(...e) {
|
|
1253
1259
|
var t;
|
|
@@ -1265,37 +1271,37 @@ class U extends Y {
|
|
|
1265
1271
|
return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
|
|
1266
1272
|
if (!this.languages || !this.languages.length)
|
|
1267
1273
|
return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
|
|
1268
|
-
const
|
|
1269
|
-
if (
|
|
1270
|
-
const r = (o,
|
|
1271
|
-
const
|
|
1272
|
-
return
|
|
1274
|
+
const s = t.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, n = this.languages[this.languages.length - 1];
|
|
1275
|
+
if (s.toLowerCase() === "cimode") return !0;
|
|
1276
|
+
const r = (o, l) => {
|
|
1277
|
+
const u = this.services.backendConnector.state[`${o}|${l}`];
|
|
1278
|
+
return u === -1 || u === 0 || u === 2;
|
|
1273
1279
|
};
|
|
1274
1280
|
if (t.precheck) {
|
|
1275
1281
|
const o = t.precheck(this, r);
|
|
1276
1282
|
if (o !== void 0) return o;
|
|
1277
1283
|
}
|
|
1278
|
-
return !!(this.hasResourceBundle(
|
|
1284
|
+
return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || r(s, e) && (!i || r(n, e)));
|
|
1279
1285
|
}
|
|
1280
1286
|
loadNamespaces(e, t) {
|
|
1281
|
-
const
|
|
1282
|
-
return this.options.ns ? (g(e) && (e = [e]), e.forEach((
|
|
1283
|
-
this.options.ns.indexOf(
|
|
1284
|
-
}), this.loadResources((
|
|
1285
|
-
|
|
1286
|
-
}),
|
|
1287
|
+
const s = A();
|
|
1288
|
+
return this.options.ns ? (g(e) && (e = [e]), e.forEach((i) => {
|
|
1289
|
+
this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
|
|
1290
|
+
}), this.loadResources((i) => {
|
|
1291
|
+
s.resolve(), t && t(i);
|
|
1292
|
+
}), s) : (t && t(), Promise.resolve());
|
|
1287
1293
|
}
|
|
1288
1294
|
loadLanguages(e, t) {
|
|
1289
|
-
const
|
|
1295
|
+
const s = A();
|
|
1290
1296
|
g(e) && (e = [e]);
|
|
1291
|
-
const
|
|
1292
|
-
return n.length ? (this.options.preload =
|
|
1293
|
-
|
|
1294
|
-
}),
|
|
1297
|
+
const i = this.options.preload || [], n = e.filter((r) => i.indexOf(r) < 0 && this.services.languageUtils.isSupportedCode(r));
|
|
1298
|
+
return n.length ? (this.options.preload = i.concat(n), this.loadResources((r) => {
|
|
1299
|
+
s.resolve(), t && t(r);
|
|
1300
|
+
}), s) : (t && t(), Promise.resolve());
|
|
1295
1301
|
}
|
|
1296
1302
|
dir(e) {
|
|
1297
|
-
var
|
|
1298
|
-
if (e || (e = this.resolvedLanguage || (((
|
|
1303
|
+
var i, n;
|
|
1304
|
+
if (e || (e = this.resolvedLanguage || (((i = this.languages) == null ? void 0 : i.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
|
|
1299
1305
|
try {
|
|
1300
1306
|
const r = new Intl.Locale(e);
|
|
1301
1307
|
if (r && r.getTextInfo) {
|
|
@@ -1304,49 +1310,49 @@ class U extends Y {
|
|
|
1304
1310
|
}
|
|
1305
1311
|
} catch {
|
|
1306
1312
|
}
|
|
1307
|
-
const t = ["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"],
|
|
1308
|
-
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(
|
|
1313
|
+
const t = ["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"], s = ((n = this.services) == null ? void 0 : n.languageUtils) || new fe(X());
|
|
1314
|
+
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(s.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
1309
1315
|
}
|
|
1310
1316
|
static createInstance(e = {}, t) {
|
|
1311
|
-
const
|
|
1312
|
-
return
|
|
1317
|
+
const s = new H(e, t);
|
|
1318
|
+
return s.createInstance = H.createInstance, s;
|
|
1313
1319
|
}
|
|
1314
|
-
cloneInstance(e = {}, t =
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1317
|
-
const
|
|
1320
|
+
cloneInstance(e = {}, t = J) {
|
|
1321
|
+
const s = e.forkResourceStore;
|
|
1322
|
+
s && delete e.forkResourceStore;
|
|
1323
|
+
const i = {
|
|
1318
1324
|
...this.options,
|
|
1319
1325
|
...e,
|
|
1320
1326
|
isClone: !0
|
|
1321
|
-
}, n = new
|
|
1327
|
+
}, n = new H(i);
|
|
1322
1328
|
if ((e.debug !== void 0 || e.prefix !== void 0) && (n.logger = n.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
|
|
1323
1329
|
n[o] = this[o];
|
|
1324
1330
|
}), n.services = {
|
|
1325
1331
|
...this.services
|
|
1326
1332
|
}, n.services.utils = {
|
|
1327
1333
|
hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
|
|
1328
|
-
},
|
|
1329
|
-
const o = Object.keys(this.store.data).reduce((
|
|
1330
|
-
...this.store.data[
|
|
1331
|
-
}, u
|
|
1332
|
-
...u
|
|
1333
|
-
}, c), u
|
|
1334
|
-
n.store = new le(o,
|
|
1334
|
+
}, s) {
|
|
1335
|
+
const o = Object.keys(this.store.data).reduce((l, u) => (l[u] = {
|
|
1336
|
+
...this.store.data[u]
|
|
1337
|
+
}, l[u] = Object.keys(l[u]).reduce((c, f) => (c[f] = {
|
|
1338
|
+
...l[u][f]
|
|
1339
|
+
}, c), l[u]), l), {});
|
|
1340
|
+
n.store = new le(o, i), n.services.resourceStore = n.store;
|
|
1335
1341
|
}
|
|
1336
1342
|
if (e.interpolation) {
|
|
1337
|
-
const
|
|
1338
|
-
...
|
|
1343
|
+
const l = {
|
|
1344
|
+
...X().interpolation,
|
|
1339
1345
|
...this.options.interpolation,
|
|
1340
1346
|
...e.interpolation
|
|
1341
|
-
},
|
|
1342
|
-
...
|
|
1343
|
-
interpolation:
|
|
1347
|
+
}, u = {
|
|
1348
|
+
...i,
|
|
1349
|
+
interpolation: l
|
|
1344
1350
|
};
|
|
1345
|
-
n.services.interpolator = new pe(
|
|
1351
|
+
n.services.interpolator = new pe(u);
|
|
1346
1352
|
}
|
|
1347
|
-
return n.translator = new
|
|
1348
|
-
n.emit(o, ...
|
|
1349
|
-
}), n.init(
|
|
1353
|
+
return n.translator = new Y(n.services, i), n.translator.on("*", (o, ...l) => {
|
|
1354
|
+
n.emit(o, ...l);
|
|
1355
|
+
}), n.init(i, t), n.translator.options = i, n.translator.backendConnector.services.utils = {
|
|
1350
1356
|
hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
|
|
1351
1357
|
}, n;
|
|
1352
1358
|
}
|
|
@@ -1360,7 +1366,7 @@ class U extends Y {
|
|
|
1360
1366
|
};
|
|
1361
1367
|
}
|
|
1362
1368
|
}
|
|
1363
|
-
const y =
|
|
1369
|
+
const y = H.createInstance();
|
|
1364
1370
|
y.createInstance;
|
|
1365
1371
|
y.dir;
|
|
1366
1372
|
y.init;
|
|
@@ -1387,16 +1393,16 @@ const _e = (a) => {
|
|
|
1387
1393
|
});
|
|
1388
1394
|
}, Je = (a, e) => {
|
|
1389
1395
|
if (!a || !a.includes("|")) return y.t(a, e);
|
|
1390
|
-
const [t,
|
|
1396
|
+
const [t, s] = a.split("|", 2).map((i) => i.trim());
|
|
1391
1397
|
return y.t(
|
|
1392
|
-
[t,
|
|
1398
|
+
[t, s].filter((i) => !!i),
|
|
1393
1399
|
e
|
|
1394
1400
|
);
|
|
1395
1401
|
}, We = (a) => {
|
|
1396
1402
|
const e = {};
|
|
1397
1403
|
return Object.keys(a).forEach((t) => {
|
|
1398
|
-
const
|
|
1399
|
-
e[t] = typeof
|
|
1404
|
+
const s = a[t];
|
|
1405
|
+
e[t] = typeof s == "string" ? Je(s) : s;
|
|
1400
1406
|
}), e;
|
|
1401
1407
|
};
|
|
1402
1408
|
export {
|
|
@@ -1405,4 +1411,4 @@ export {
|
|
|
1405
1411
|
y as i,
|
|
1406
1412
|
We as r
|
|
1407
1413
|
};
|
|
1408
|
-
//# sourceMappingURL=component.utils-
|
|
1414
|
+
//# sourceMappingURL=component.utils-CbnwaSi1.js.map
|