@1024pix/epreuves-components 0.9.6 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ImageQuiz.ce-CAWRCnWK.js → ImageQuiz.ce-BbfMcldf.js} +14 -14
- package/dist/LLMMessage.ce-DBgXmxn9.js +89 -0
- package/dist/Loading.ce-BRzyhDRe.js +14 -0
- package/dist/NavigationButton.ce-RaQYJjPs.js +98 -0
- package/dist/{_plugin-vue_export-helper-DLH45Sxm.js → _plugin-vue_export-helper-CGpZIhKK.js} +23 -23
- package/dist/components/complete-phrase.ce.js.js +100 -0
- package/dist/components/image-quiz.ce.js.js +2 -2
- package/dist/components/image-quizzes.ce.js.js +2 -2
- package/dist/components/llm-compare-messages.ce.js.js +38 -33
- package/dist/components/llm-messages.ce.js.js +5 -4
- package/dist/components/llm-prompt-select.ce.js.js +5 -5
- package/dist/components/message-conversation.ce.js.js +52 -55
- package/dist/components/pix-carousel.ce.js.js +40 -39
- package/dist/components/pix-cursor.ce.js.js +17 -16
- package/dist/i18n-DZYcdfDF.js +1407 -0
- package/dist/index.js +1 -0
- package/dist/metadata.js +11 -8
- package/dist/shadow-dom-BdDj1I6f.js +9 -0
- package/package.json +1 -1
- package/dist/NavigationButton.ce-DrjZmR37.js +0 -1502
- package/dist/shadow-dom-BtcBGuOh.js +0 -89
|
@@ -1,1502 +0,0 @@
|
|
|
1
|
-
import { G as Re, H as Pe, a as ee, I as ke, r as Ne, k as Ee, c as te, o as D, f as _, q as Fe, p as ae, t as je, m as Ie, n as Te, J as De, _ as Q, e as Z, E as Ve } from "./_plugin-vue_export-helper-DLH45Sxm.js";
|
|
2
|
-
const c = (o) => typeof o == "string", A = () => {
|
|
3
|
-
let o, e;
|
|
4
|
-
const t = new Promise((s, i) => {
|
|
5
|
-
o = s, e = i;
|
|
6
|
-
});
|
|
7
|
-
return t.resolve = o, t.reject = e, t;
|
|
8
|
-
}, oe = (o) => o == null ? "" : "" + o, Ke = (o, e, t) => {
|
|
9
|
-
o.forEach((s) => {
|
|
10
|
-
e[s] && (t[s] = e[s]);
|
|
11
|
-
});
|
|
12
|
-
}, Ae = /###/g, le = (o) => o && o.indexOf("###") > -1 ? o.replace(Ae, ".") : o, ue = (o) => !o || c(o), M = (o, e, t) => {
|
|
13
|
-
const s = c(e) ? e.split(".") : e;
|
|
14
|
-
let i = 0;
|
|
15
|
-
for (; i < s.length - 1; ) {
|
|
16
|
-
if (ue(o)) return {};
|
|
17
|
-
const n = le(s[i]);
|
|
18
|
-
!o[n] && t && (o[n] = new t()), Object.prototype.hasOwnProperty.call(o, n) ? o = o[n] : o = {}, ++i;
|
|
19
|
-
}
|
|
20
|
-
return ue(o) ? {} : {
|
|
21
|
-
obj: o,
|
|
22
|
-
k: le(s[i])
|
|
23
|
-
};
|
|
24
|
-
}, fe = (o, e, t) => {
|
|
25
|
-
const {
|
|
26
|
-
obj: s,
|
|
27
|
-
k: i
|
|
28
|
-
} = M(o, e, Object);
|
|
29
|
-
if (s !== void 0 || e.length === 1) {
|
|
30
|
-
s[i] = t;
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
let n = e[e.length - 1], a = e.slice(0, e.length - 1), r = M(o, a, Object);
|
|
34
|
-
for (; r.obj === void 0 && a.length; )
|
|
35
|
-
n = `${a[a.length - 1]}.${n}`, a = a.slice(0, a.length - 1), r = M(o, a, Object), r?.obj && typeof r.obj[`${r.k}.${n}`] < "u" && (r.obj = void 0);
|
|
36
|
-
r.obj[`${r.k}.${n}`] = t;
|
|
37
|
-
}, Me = (o, e, t, s) => {
|
|
38
|
-
const {
|
|
39
|
-
obj: i,
|
|
40
|
-
k: n
|
|
41
|
-
} = M(o, e, Object);
|
|
42
|
-
i[n] = i[n] || [], i[n].push(t);
|
|
43
|
-
}, J = (o, e) => {
|
|
44
|
-
const {
|
|
45
|
-
obj: t,
|
|
46
|
-
k: s
|
|
47
|
-
} = M(o, e);
|
|
48
|
-
if (t && Object.prototype.hasOwnProperty.call(t, s))
|
|
49
|
-
return t[s];
|
|
50
|
-
}, Be = (o, e, t) => {
|
|
51
|
-
const s = J(o, t);
|
|
52
|
-
return s !== void 0 ? s : J(e, t);
|
|
53
|
-
}, ve = (o, e, t) => {
|
|
54
|
-
for (const s in e)
|
|
55
|
-
s !== "__proto__" && s !== "constructor" && (s in o ? c(o[s]) || o[s] instanceof String || c(e[s]) || e[s] instanceof String ? t && (o[s] = e[s]) : ve(o[s], e[s], t) : o[s] = e[s]);
|
|
56
|
-
return o;
|
|
57
|
-
}, T = (o) => o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
58
|
-
var Ue = {
|
|
59
|
-
"&": "&",
|
|
60
|
-
"<": "<",
|
|
61
|
-
">": ">",
|
|
62
|
-
'"': """,
|
|
63
|
-
"'": "'",
|
|
64
|
-
"/": "/"
|
|
65
|
-
};
|
|
66
|
-
const He = (o) => c(o) ? o.replace(/[&<>"'\/]/g, (e) => Ue[e]) : o;
|
|
67
|
-
class ze {
|
|
68
|
-
constructor(e) {
|
|
69
|
-
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
70
|
-
}
|
|
71
|
-
getRegExp(e) {
|
|
72
|
-
const t = this.regExpMap.get(e);
|
|
73
|
-
if (t !== void 0)
|
|
74
|
-
return t;
|
|
75
|
-
const s = new RegExp(e);
|
|
76
|
-
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, s), this.regExpQueue.push(e), s;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const _e = [" ", ",", "?", "!", ";"], Je = new ze(20), Ye = (o, e, t) => {
|
|
80
|
-
e = e || "", t = t || "";
|
|
81
|
-
const s = _e.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
|
|
82
|
-
if (s.length === 0) return !0;
|
|
83
|
-
const i = Je.getRegExp(`(${s.map((a) => a === "?" ? "\\?" : a).join("|")})`);
|
|
84
|
-
let n = !i.test(o);
|
|
85
|
-
if (!n) {
|
|
86
|
-
const a = o.indexOf(t);
|
|
87
|
-
a > 0 && !i.test(o.substring(0, a)) && (n = !0);
|
|
88
|
-
}
|
|
89
|
-
return n;
|
|
90
|
-
}, X = (o, e, t = ".") => {
|
|
91
|
-
if (!o) return;
|
|
92
|
-
if (o[e])
|
|
93
|
-
return Object.prototype.hasOwnProperty.call(o, e) ? o[e] : void 0;
|
|
94
|
-
const s = e.split(t);
|
|
95
|
-
let i = o;
|
|
96
|
-
for (let n = 0; n < s.length; ) {
|
|
97
|
-
if (!i || typeof i != "object")
|
|
98
|
-
return;
|
|
99
|
-
let a, r = "";
|
|
100
|
-
for (let l = n; l < s.length; ++l)
|
|
101
|
-
if (l !== n && (r += t), r += s[l], a = i[r], a !== void 0) {
|
|
102
|
-
if (["string", "number", "boolean"].indexOf(typeof a) > -1 && l < s.length - 1)
|
|
103
|
-
continue;
|
|
104
|
-
n += l - n + 1;
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
i = a;
|
|
108
|
-
}
|
|
109
|
-
return i;
|
|
110
|
-
}, B = (o) => o?.replace("_", "-"), We = {
|
|
111
|
-
type: "logger",
|
|
112
|
-
log(o) {
|
|
113
|
-
this.output("log", o);
|
|
114
|
-
},
|
|
115
|
-
warn(o) {
|
|
116
|
-
this.output("warn", o);
|
|
117
|
-
},
|
|
118
|
-
error(o) {
|
|
119
|
-
this.output("error", o);
|
|
120
|
-
},
|
|
121
|
-
output(o, e) {
|
|
122
|
-
console?.[o]?.apply?.(console, e);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
class Y {
|
|
126
|
-
constructor(e, t = {}) {
|
|
127
|
-
this.init(e, t);
|
|
128
|
-
}
|
|
129
|
-
init(e, t = {}) {
|
|
130
|
-
this.prefix = t.prefix || "i18next:", this.logger = e || We, this.options = t, this.debug = t.debug;
|
|
131
|
-
}
|
|
132
|
-
log(...e) {
|
|
133
|
-
return this.forward(e, "log", "", !0);
|
|
134
|
-
}
|
|
135
|
-
warn(...e) {
|
|
136
|
-
return this.forward(e, "warn", "", !0);
|
|
137
|
-
}
|
|
138
|
-
error(...e) {
|
|
139
|
-
return this.forward(e, "error", "");
|
|
140
|
-
}
|
|
141
|
-
deprecate(...e) {
|
|
142
|
-
return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
|
|
143
|
-
}
|
|
144
|
-
forward(e, t, s, i) {
|
|
145
|
-
return i && !this.debug ? null : (c(e[0]) && (e[0] = `${s}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
146
|
-
}
|
|
147
|
-
create(e) {
|
|
148
|
-
return new Y(this.logger, {
|
|
149
|
-
prefix: `${this.prefix}:${e}:`,
|
|
150
|
-
...this.options
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
clone(e) {
|
|
154
|
-
return e = e || this.options, e.prefix = e.prefix || this.prefix, new Y(this.logger, e);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
var R = new Y();
|
|
158
|
-
class G {
|
|
159
|
-
constructor() {
|
|
160
|
-
this.observers = {};
|
|
161
|
-
}
|
|
162
|
-
on(e, t) {
|
|
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
|
-
}), this;
|
|
168
|
-
}
|
|
169
|
-
off(e, t) {
|
|
170
|
-
if (this.observers[e]) {
|
|
171
|
-
if (!t) {
|
|
172
|
-
delete this.observers[e];
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
this.observers[e].delete(t);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
emit(e, ...t) {
|
|
179
|
-
this.observers[e] && Array.from(this.observers[e].entries()).forEach(([i, n]) => {
|
|
180
|
-
for (let a = 0; a < n; a++)
|
|
181
|
-
i(...t);
|
|
182
|
-
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([i, n]) => {
|
|
183
|
-
for (let a = 0; a < n; a++)
|
|
184
|
-
i.apply(i, [e, ...t]);
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
class he extends G {
|
|
189
|
-
constructor(e, t = {
|
|
190
|
-
ns: ["translation"],
|
|
191
|
-
defaultNS: "translation"
|
|
192
|
-
}) {
|
|
193
|
-
super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
|
|
194
|
-
}
|
|
195
|
-
addNamespaces(e) {
|
|
196
|
-
this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
|
|
197
|
-
}
|
|
198
|
-
removeNamespaces(e) {
|
|
199
|
-
const t = this.options.ns.indexOf(e);
|
|
200
|
-
t > -1 && this.options.ns.splice(t, 1);
|
|
201
|
-
}
|
|
202
|
-
getResource(e, t, s, i = {}) {
|
|
203
|
-
const n = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, a = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
204
|
-
let r;
|
|
205
|
-
e.indexOf(".") > -1 ? r = e.split(".") : (r = [e, t], s && (Array.isArray(s) ? r.push(...s) : c(s) && n ? r.push(...s.split(n)) : r.push(s)));
|
|
206
|
-
const l = J(this.data, r);
|
|
207
|
-
return !l && !t && !s && e.indexOf(".") > -1 && (e = r[0], t = r[1], s = r.slice(2).join(".")), l || !a || !c(s) ? l : X(this.data?.[e]?.[t], s, n);
|
|
208
|
-
}
|
|
209
|
-
addResource(e, t, s, i, n = {
|
|
210
|
-
silent: !1
|
|
211
|
-
}) {
|
|
212
|
-
const a = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator;
|
|
213
|
-
let r = [e, t];
|
|
214
|
-
s && (r = r.concat(a ? s.split(a) : s)), e.indexOf(".") > -1 && (r = e.split("."), i = t, t = r[1]), this.addNamespaces(t), fe(this.data, r, i), n.silent || this.emit("added", e, t, s, i);
|
|
215
|
-
}
|
|
216
|
-
addResources(e, t, s, i = {
|
|
217
|
-
silent: !1
|
|
218
|
-
}) {
|
|
219
|
-
for (const n in s)
|
|
220
|
-
(c(s[n]) || Array.isArray(s[n])) && this.addResource(e, t, n, s[n], {
|
|
221
|
-
silent: !0
|
|
222
|
-
});
|
|
223
|
-
i.silent || this.emit("added", e, t, s);
|
|
224
|
-
}
|
|
225
|
-
addResourceBundle(e, t, s, i, n, a = {
|
|
226
|
-
silent: !1,
|
|
227
|
-
skipCopy: !1
|
|
228
|
-
}) {
|
|
229
|
-
let r = [e, t];
|
|
230
|
-
e.indexOf(".") > -1 && (r = e.split("."), i = s, s = t, t = r[1]), this.addNamespaces(t);
|
|
231
|
-
let l = J(this.data, r) || {};
|
|
232
|
-
a.skipCopy || (s = JSON.parse(JSON.stringify(s))), i ? ve(l, s, n) : l = {
|
|
233
|
-
...l,
|
|
234
|
-
...s
|
|
235
|
-
}, fe(this.data, r, l), a.silent || this.emit("added", e, t, s);
|
|
236
|
-
}
|
|
237
|
-
removeResourceBundle(e, t) {
|
|
238
|
-
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
239
|
-
}
|
|
240
|
-
hasResourceBundle(e, t) {
|
|
241
|
-
return this.getResource(e, t) !== void 0;
|
|
242
|
-
}
|
|
243
|
-
getResourceBundle(e, t) {
|
|
244
|
-
return t || (t = this.options.defaultNS), this.getResource(e, t);
|
|
245
|
-
}
|
|
246
|
-
getDataByLanguage(e) {
|
|
247
|
-
return this.data[e];
|
|
248
|
-
}
|
|
249
|
-
hasLanguageSomeTranslations(e) {
|
|
250
|
-
const t = this.getDataByLanguage(e);
|
|
251
|
-
return !!(t && Object.keys(t) || []).find((i) => t[i] && Object.keys(t[i]).length > 0);
|
|
252
|
-
}
|
|
253
|
-
toJSON() {
|
|
254
|
-
return this.data;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
var Le = {
|
|
258
|
-
processors: {},
|
|
259
|
-
addPostProcessor(o) {
|
|
260
|
-
this.processors[o.name] = o;
|
|
261
|
-
},
|
|
262
|
-
handle(o, e, t, s, i) {
|
|
263
|
-
return o.forEach((n) => {
|
|
264
|
-
e = this.processors[n]?.process(e, t, s, i) ?? e;
|
|
265
|
-
}), e;
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
const de = {}, ce = (o) => !c(o) && typeof o != "boolean" && typeof o != "number";
|
|
269
|
-
class W extends G {
|
|
270
|
-
constructor(e, t = {}) {
|
|
271
|
-
super(), Ke(["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");
|
|
272
|
-
}
|
|
273
|
-
changeLanguage(e) {
|
|
274
|
-
e && (this.language = e);
|
|
275
|
-
}
|
|
276
|
-
exists(e, t = {
|
|
277
|
-
interpolation: {}
|
|
278
|
-
}) {
|
|
279
|
-
const s = {
|
|
280
|
-
...t
|
|
281
|
-
};
|
|
282
|
-
return e == null ? !1 : this.resolve(e, s)?.res !== void 0;
|
|
283
|
-
}
|
|
284
|
-
extractFromKey(e, t) {
|
|
285
|
-
let s = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
|
|
286
|
-
s === void 0 && (s = ":");
|
|
287
|
-
const i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
288
|
-
let n = t.ns || this.options.defaultNS || [];
|
|
289
|
-
const a = s && e.indexOf(s) > -1, r = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Ye(e, s, i);
|
|
290
|
-
if (a && !r) {
|
|
291
|
-
const l = e.match(this.interpolator.nestingRegexp);
|
|
292
|
-
if (l && l.length > 0)
|
|
293
|
-
return {
|
|
294
|
-
key: e,
|
|
295
|
-
namespaces: c(n) ? [n] : n
|
|
296
|
-
};
|
|
297
|
-
const u = e.split(s);
|
|
298
|
-
(s !== i || s === i && this.options.ns.indexOf(u[0]) > -1) && (n = u.shift()), e = u.join(i);
|
|
299
|
-
}
|
|
300
|
-
return {
|
|
301
|
-
key: e,
|
|
302
|
-
namespaces: c(n) ? [n] : n
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
translate(e, t, s) {
|
|
306
|
-
let i = typeof t == "object" ? {
|
|
307
|
-
...t
|
|
308
|
-
} : t;
|
|
309
|
-
if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof options == "object" && (i = {
|
|
310
|
-
...i
|
|
311
|
-
}), i || (i = {}), e == null) return "";
|
|
312
|
-
Array.isArray(e) || (e = [String(e)]);
|
|
313
|
-
const n = i.returnDetails !== void 0 ? i.returnDetails : this.options.returnDetails, a = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, {
|
|
314
|
-
key: r,
|
|
315
|
-
namespaces: l
|
|
316
|
-
} = this.extractFromKey(e[e.length - 1], i), u = l[l.length - 1];
|
|
317
|
-
let h = i.nsSeparator !== void 0 ? i.nsSeparator : this.options.nsSeparator;
|
|
318
|
-
h === void 0 && (h = ":");
|
|
319
|
-
const f = i.lng || this.language, g = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
320
|
-
if (f?.toLowerCase() === "cimode")
|
|
321
|
-
return g ? n ? {
|
|
322
|
-
res: `${u}${h}${r}`,
|
|
323
|
-
usedKey: r,
|
|
324
|
-
exactUsedKey: r,
|
|
325
|
-
usedLng: f,
|
|
326
|
-
usedNS: u,
|
|
327
|
-
usedParams: this.getUsedParamsDetails(i)
|
|
328
|
-
} : `${u}${h}${r}` : n ? {
|
|
329
|
-
res: r,
|
|
330
|
-
usedKey: r,
|
|
331
|
-
exactUsedKey: r,
|
|
332
|
-
usedLng: f,
|
|
333
|
-
usedNS: u,
|
|
334
|
-
usedParams: this.getUsedParamsDetails(i)
|
|
335
|
-
} : r;
|
|
336
|
-
const p = this.resolve(e, i);
|
|
337
|
-
let d = p?.res;
|
|
338
|
-
const x = p?.usedKey || r, b = p?.exactUsedKey || r, v = ["[object Number]", "[object Function]", "[object RegExp]"], y = i.joinArrays !== void 0 ? i.joinArrays : this.options.joinArrays, E = !this.i18nFormat || this.i18nFormat.handleAsObject, S = i.count !== void 0 && !c(i.count), k = W.hasDefaultValue(i), j = S ? this.pluralResolver.getSuffix(f, i.count, i) : "", I = i.ordinal && S ? this.pluralResolver.getSuffix(f, i.count, {
|
|
339
|
-
ordinal: !1
|
|
340
|
-
}) : "", ie = S && !i.ordinal && i.count === 0, N = ie && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${j}`] || i[`defaultValue${I}`] || i.defaultValue;
|
|
341
|
-
let O = d;
|
|
342
|
-
E && !d && k && (O = N);
|
|
343
|
-
const Ce = ce(O), $e = Object.prototype.toString.apply(O);
|
|
344
|
-
if (E && O && Ce && v.indexOf($e) < 0 && !(c(y) && Array.isArray(O))) {
|
|
345
|
-
if (!i.returnObjects && !this.options.returnObjects) {
|
|
346
|
-
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
347
|
-
const C = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(x, O, {
|
|
348
|
-
...i,
|
|
349
|
-
ns: l
|
|
350
|
-
}) : `key '${r} (${this.language})' returned an object instead of string.`;
|
|
351
|
-
return n ? (p.res = C, p.usedParams = this.getUsedParamsDetails(i), p) : C;
|
|
352
|
-
}
|
|
353
|
-
if (a) {
|
|
354
|
-
const C = Array.isArray(O), L = C ? [] : {}, se = C ? b : x;
|
|
355
|
-
for (const $ in O)
|
|
356
|
-
if (Object.prototype.hasOwnProperty.call(O, $)) {
|
|
357
|
-
const P = `${se}${a}${$}`;
|
|
358
|
-
k && !d ? L[$] = this.translate(P, {
|
|
359
|
-
...i,
|
|
360
|
-
defaultValue: ce(N) ? N[$] : void 0,
|
|
361
|
-
joinArrays: !1,
|
|
362
|
-
ns: l
|
|
363
|
-
}) : L[$] = this.translate(P, {
|
|
364
|
-
...i,
|
|
365
|
-
joinArrays: !1,
|
|
366
|
-
ns: l
|
|
367
|
-
}), L[$] === P && (L[$] = O[$]);
|
|
368
|
-
}
|
|
369
|
-
d = L;
|
|
370
|
-
}
|
|
371
|
-
} else if (E && c(y) && Array.isArray(d))
|
|
372
|
-
d = d.join(y), d && (d = this.extendTranslation(d, e, i, s));
|
|
373
|
-
else {
|
|
374
|
-
let C = !1, L = !1;
|
|
375
|
-
!this.isValidLookup(d) && k && (C = !0, d = N), this.isValidLookup(d) || (L = !0, d = r);
|
|
376
|
-
const $ = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && L ? void 0 : d, P = k && N !== d && this.options.updateMissing;
|
|
377
|
-
if (L || C || P) {
|
|
378
|
-
if (this.logger.log(P ? "updateKey" : "missingKey", f, u, r, P ? N : d), a) {
|
|
379
|
-
const w = this.resolve(r, {
|
|
380
|
-
...i,
|
|
381
|
-
keySeparator: !1
|
|
382
|
-
});
|
|
383
|
-
w && w.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.");
|
|
384
|
-
}
|
|
385
|
-
let V = [];
|
|
386
|
-
const H = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
|
|
387
|
-
if (this.options.saveMissingTo === "fallback" && H && H[0])
|
|
388
|
-
for (let w = 0; w < H.length; w++)
|
|
389
|
-
V.push(H[w]);
|
|
390
|
-
else this.options.saveMissingTo === "all" ? V = this.languageUtils.toResolveHierarchy(i.lng || this.language) : V.push(i.lng || this.language);
|
|
391
|
-
const ne = (w, F, K) => {
|
|
392
|
-
const re = k && K !== d ? K : $;
|
|
393
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(w, u, F, re, P, i) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(w, u, F, re, P, i), this.emit("missingKey", w, u, F, d);
|
|
394
|
-
};
|
|
395
|
-
this.options.saveMissing && (this.options.saveMissingPlurals && S ? V.forEach((w) => {
|
|
396
|
-
const F = this.pluralResolver.getSuffixes(w, i);
|
|
397
|
-
ie && i[`defaultValue${this.options.pluralSeparator}zero`] && F.indexOf(`${this.options.pluralSeparator}zero`) < 0 && F.push(`${this.options.pluralSeparator}zero`), F.forEach((K) => {
|
|
398
|
-
ne([w], r + K, i[`defaultValue${K}`] || N);
|
|
399
|
-
});
|
|
400
|
-
}) : ne(V, r, N));
|
|
401
|
-
}
|
|
402
|
-
d = this.extendTranslation(d, e, i, p, s), L && d === r && this.options.appendNamespaceToMissingKey && (d = `${u}${h}${r}`), (L || C) && this.options.parseMissingKeyHandler && (d = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}${h}${r}` : r, C ? d : void 0, i));
|
|
403
|
-
}
|
|
404
|
-
return n ? (p.res = d, p.usedParams = this.getUsedParamsDetails(i), p) : d;
|
|
405
|
-
}
|
|
406
|
-
extendTranslation(e, t, s, i, n) {
|
|
407
|
-
if (this.i18nFormat?.parse)
|
|
408
|
-
e = this.i18nFormat.parse(e, {
|
|
409
|
-
...this.options.interpolation.defaultVariables,
|
|
410
|
-
...s
|
|
411
|
-
}, s.lng || this.language || i.usedLng, i.usedNS, i.usedKey, {
|
|
412
|
-
resolved: i
|
|
413
|
-
});
|
|
414
|
-
else if (!s.skipInterpolation) {
|
|
415
|
-
s.interpolation && this.interpolator.init({
|
|
416
|
-
...s,
|
|
417
|
-
interpolation: {
|
|
418
|
-
...this.options.interpolation,
|
|
419
|
-
...s.interpolation
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
const l = c(e) && (s?.interpolation?.skipOnVariables !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
423
|
-
let u;
|
|
424
|
-
if (l) {
|
|
425
|
-
const f = e.match(this.interpolator.nestingRegexp);
|
|
426
|
-
u = f && f.length;
|
|
427
|
-
}
|
|
428
|
-
let h = s.replace && !c(s.replace) ? s.replace : s;
|
|
429
|
-
if (this.options.interpolation.defaultVariables && (h = {
|
|
430
|
-
...this.options.interpolation.defaultVariables,
|
|
431
|
-
...h
|
|
432
|
-
}), e = this.interpolator.interpolate(e, h, s.lng || this.language || i.usedLng, s), l) {
|
|
433
|
-
const f = e.match(this.interpolator.nestingRegexp), g = f && f.length;
|
|
434
|
-
u < g && (s.nest = !1);
|
|
435
|
-
}
|
|
436
|
-
!s.lng && i && i.res && (s.lng = this.language || i.usedLng), s.nest !== !1 && (e = this.interpolator.nest(e, (...f) => n?.[0] === f[0] && !s.context ? (this.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${t[0]}`), null) : this.translate(...f, t), s)), s.interpolation && this.interpolator.reset();
|
|
437
|
-
}
|
|
438
|
-
const a = s.postProcess || this.options.postProcess, r = c(a) ? [a] : a;
|
|
439
|
-
return e != null && r?.length && s.applyPostProcessor !== !1 && (e = Le.handle(r, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
440
|
-
i18nResolved: {
|
|
441
|
-
...i,
|
|
442
|
-
usedParams: this.getUsedParamsDetails(s)
|
|
443
|
-
},
|
|
444
|
-
...s
|
|
445
|
-
} : s, this)), e;
|
|
446
|
-
}
|
|
447
|
-
resolve(e, t = {}) {
|
|
448
|
-
let s, i, n, a, r;
|
|
449
|
-
return c(e) && (e = [e]), e.forEach((l) => {
|
|
450
|
-
if (this.isValidLookup(s)) return;
|
|
451
|
-
const u = this.extractFromKey(l, t), h = u.key;
|
|
452
|
-
i = h;
|
|
453
|
-
let f = u.namespaces;
|
|
454
|
-
this.options.fallbackNS && (f = f.concat(this.options.fallbackNS));
|
|
455
|
-
const g = t.count !== void 0 && !c(t.count), p = g && !t.ordinal && t.count === 0, d = t.context !== void 0 && (c(t.context) || typeof t.context == "number") && t.context !== "", x = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
456
|
-
f.forEach((b) => {
|
|
457
|
-
this.isValidLookup(s) || (r = b, !de[`${x[0]}-${b}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(r) && (de[`${x[0]}-${b}`] = !0, this.logger.warn(`key "${i}" for languages "${x.join(", ")}" won't get resolved as namespace "${r}" 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!!!")), x.forEach((v) => {
|
|
458
|
-
if (this.isValidLookup(s)) return;
|
|
459
|
-
a = v;
|
|
460
|
-
const y = [h];
|
|
461
|
-
if (this.i18nFormat?.addLookupKeys)
|
|
462
|
-
this.i18nFormat.addLookupKeys(y, h, v, b, t);
|
|
463
|
-
else {
|
|
464
|
-
let S;
|
|
465
|
-
g && (S = this.pluralResolver.getSuffix(v, t.count, t));
|
|
466
|
-
const k = `${this.options.pluralSeparator}zero`, j = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
467
|
-
if (g && (y.push(h + S), t.ordinal && S.indexOf(j) === 0 && y.push(h + S.replace(j, this.options.pluralSeparator)), p && y.push(h + k)), d) {
|
|
468
|
-
const I = `${h}${this.options.contextSeparator}${t.context}`;
|
|
469
|
-
y.push(I), g && (y.push(I + S), t.ordinal && S.indexOf(j) === 0 && y.push(I + S.replace(j, this.options.pluralSeparator)), p && y.push(I + k));
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
let E;
|
|
473
|
-
for (; E = y.pop(); )
|
|
474
|
-
this.isValidLookup(s) || (n = E, s = this.getResource(v, b, E, t));
|
|
475
|
-
}));
|
|
476
|
-
});
|
|
477
|
-
}), {
|
|
478
|
-
res: s,
|
|
479
|
-
usedKey: i,
|
|
480
|
-
exactUsedKey: n,
|
|
481
|
-
usedLng: a,
|
|
482
|
-
usedNS: r
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
isValidLookup(e) {
|
|
486
|
-
return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
|
|
487
|
-
}
|
|
488
|
-
getResource(e, t, s, i = {}) {
|
|
489
|
-
return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, s, i) : this.resourceStore.getResource(e, t, s, i);
|
|
490
|
-
}
|
|
491
|
-
getUsedParamsDetails(e = {}) {
|
|
492
|
-
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], s = e.replace && !c(e.replace);
|
|
493
|
-
let i = s ? e.replace : e;
|
|
494
|
-
if (s && typeof e.count < "u" && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
|
|
495
|
-
...this.options.interpolation.defaultVariables,
|
|
496
|
-
...i
|
|
497
|
-
}), !s) {
|
|
498
|
-
i = {
|
|
499
|
-
...i
|
|
500
|
-
};
|
|
501
|
-
for (const n of t)
|
|
502
|
-
delete i[n];
|
|
503
|
-
}
|
|
504
|
-
return i;
|
|
505
|
-
}
|
|
506
|
-
static hasDefaultValue(e) {
|
|
507
|
-
const t = "defaultValue";
|
|
508
|
-
for (const s in e)
|
|
509
|
-
if (Object.prototype.hasOwnProperty.call(e, s) && t === s.substring(0, t.length) && e[s] !== void 0)
|
|
510
|
-
return !0;
|
|
511
|
-
return !1;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
class pe {
|
|
515
|
-
constructor(e) {
|
|
516
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = R.create("languageUtils");
|
|
517
|
-
}
|
|
518
|
-
getScriptPartFromCode(e) {
|
|
519
|
-
if (e = B(e), !e || e.indexOf("-") < 0) return null;
|
|
520
|
-
const t = e.split("-");
|
|
521
|
-
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
522
|
-
}
|
|
523
|
-
getLanguagePartFromCode(e) {
|
|
524
|
-
if (e = B(e), !e || e.indexOf("-") < 0) return e;
|
|
525
|
-
const t = e.split("-");
|
|
526
|
-
return this.formatLanguageCode(t[0]);
|
|
527
|
-
}
|
|
528
|
-
formatLanguageCode(e) {
|
|
529
|
-
if (c(e) && e.indexOf("-") > -1) {
|
|
530
|
-
let t;
|
|
531
|
-
try {
|
|
532
|
-
t = Intl.getCanonicalLocales(e)[0];
|
|
533
|
-
} catch {
|
|
534
|
-
}
|
|
535
|
-
return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
|
|
536
|
-
}
|
|
537
|
-
return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
|
|
538
|
-
}
|
|
539
|
-
isSupportedCode(e) {
|
|
540
|
-
return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
|
|
541
|
-
}
|
|
542
|
-
getBestMatchFromCodes(e) {
|
|
543
|
-
if (!e) return null;
|
|
544
|
-
let t;
|
|
545
|
-
return e.forEach((s) => {
|
|
546
|
-
if (t) return;
|
|
547
|
-
const i = this.formatLanguageCode(s);
|
|
548
|
-
(!this.options.supportedLngs || this.isSupportedCode(i)) && (t = i);
|
|
549
|
-
}), !t && this.options.supportedLngs && e.forEach((s) => {
|
|
550
|
-
if (t) return;
|
|
551
|
-
const i = this.getScriptPartFromCode(s);
|
|
552
|
-
if (this.isSupportedCode(i)) return t = i;
|
|
553
|
-
const n = this.getLanguagePartFromCode(s);
|
|
554
|
-
if (this.isSupportedCode(n)) return t = n;
|
|
555
|
-
t = this.options.supportedLngs.find((a) => {
|
|
556
|
-
if (a === n) return a;
|
|
557
|
-
if (!(a.indexOf("-") < 0 && n.indexOf("-") < 0) && (a.indexOf("-") > 0 && n.indexOf("-") < 0 && a.substring(0, a.indexOf("-")) === n || a.indexOf(n) === 0 && n.length > 1))
|
|
558
|
-
return a;
|
|
559
|
-
});
|
|
560
|
-
}), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
|
|
561
|
-
}
|
|
562
|
-
getFallbackCodes(e, t) {
|
|
563
|
-
if (!e) return [];
|
|
564
|
-
if (typeof e == "function" && (e = e(t)), c(e) && (e = [e]), Array.isArray(e)) return e;
|
|
565
|
-
if (!t) return e.default || [];
|
|
566
|
-
let s = e[t];
|
|
567
|
-
return s || (s = e[this.getScriptPartFromCode(t)]), s || (s = e[this.formatLanguageCode(t)]), s || (s = e[this.getLanguagePartFromCode(t)]), s || (s = e.default), s || [];
|
|
568
|
-
}
|
|
569
|
-
toResolveHierarchy(e, t) {
|
|
570
|
-
const s = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), i = [], n = (a) => {
|
|
571
|
-
a && (this.isSupportedCode(a) ? i.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
|
|
572
|
-
};
|
|
573
|
-
return c(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))) : c(e) && n(this.formatLanguageCode(e)), s.forEach((a) => {
|
|
574
|
-
i.indexOf(a) < 0 && n(this.formatLanguageCode(a));
|
|
575
|
-
}), i;
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
const ge = {
|
|
579
|
-
zero: 0,
|
|
580
|
-
one: 1,
|
|
581
|
-
two: 2,
|
|
582
|
-
few: 3,
|
|
583
|
-
many: 4,
|
|
584
|
-
other: 5
|
|
585
|
-
}, me = {
|
|
586
|
-
select: (o) => o === 1 ? "one" : "other",
|
|
587
|
-
resolvedOptions: () => ({
|
|
588
|
-
pluralCategories: ["one", "other"]
|
|
589
|
-
})
|
|
590
|
-
};
|
|
591
|
-
class Qe {
|
|
592
|
-
constructor(e, t = {}) {
|
|
593
|
-
this.languageUtils = e, this.options = t, this.logger = R.create("pluralResolver"), this.pluralRulesCache = {};
|
|
594
|
-
}
|
|
595
|
-
addRule(e, t) {
|
|
596
|
-
this.rules[e] = t;
|
|
597
|
-
}
|
|
598
|
-
clearCache() {
|
|
599
|
-
this.pluralRulesCache = {};
|
|
600
|
-
}
|
|
601
|
-
getRule(e, t = {}) {
|
|
602
|
-
const s = B(e === "dev" ? "en" : e), i = t.ordinal ? "ordinal" : "cardinal", n = JSON.stringify({
|
|
603
|
-
cleanedCode: s,
|
|
604
|
-
type: i
|
|
605
|
-
});
|
|
606
|
-
if (n in this.pluralRulesCache)
|
|
607
|
-
return this.pluralRulesCache[n];
|
|
608
|
-
let a;
|
|
609
|
-
try {
|
|
610
|
-
a = new Intl.PluralRules(s, {
|
|
611
|
-
type: i
|
|
612
|
-
});
|
|
613
|
-
} catch {
|
|
614
|
-
if (!Intl)
|
|
615
|
-
return this.logger.error("No Intl support, please use an Intl polyfill!"), me;
|
|
616
|
-
if (!e.match(/-|_/)) return me;
|
|
617
|
-
const l = this.languageUtils.getLanguagePartFromCode(e);
|
|
618
|
-
a = this.getRule(l, t);
|
|
619
|
-
}
|
|
620
|
-
return this.pluralRulesCache[n] = a, a;
|
|
621
|
-
}
|
|
622
|
-
needsPlural(e, t = {}) {
|
|
623
|
-
let s = this.getRule(e, t);
|
|
624
|
-
return s || (s = this.getRule("dev", t)), s?.resolvedOptions().pluralCategories.length > 1;
|
|
625
|
-
}
|
|
626
|
-
getPluralFormsOfKey(e, t, s = {}) {
|
|
627
|
-
return this.getSuffixes(e, s).map((i) => `${t}${i}`);
|
|
628
|
-
}
|
|
629
|
-
getSuffixes(e, t = {}) {
|
|
630
|
-
let s = this.getRule(e, t);
|
|
631
|
-
return s || (s = this.getRule("dev", t)), s ? s.resolvedOptions().pluralCategories.sort((i, n) => ge[i] - ge[n]).map((i) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : [];
|
|
632
|
-
}
|
|
633
|
-
getSuffix(e, t, s = {}) {
|
|
634
|
-
const i = this.getRule(e, s);
|
|
635
|
-
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));
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
const xe = (o, e, t, s = ".", i = !0) => {
|
|
639
|
-
let n = Be(o, e, t);
|
|
640
|
-
return !n && i && c(t) && (n = X(o, t, s), n === void 0 && (n = X(e, t, s))), n;
|
|
641
|
-
}, q = (o) => o.replace(/\$/g, "$$$$");
|
|
642
|
-
class Ge {
|
|
643
|
-
constructor(e = {}) {
|
|
644
|
-
this.logger = R.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((t) => t), this.init(e);
|
|
645
|
-
}
|
|
646
|
-
init(e = {}) {
|
|
647
|
-
e.interpolation || (e.interpolation = {
|
|
648
|
-
escapeValue: !0
|
|
649
|
-
});
|
|
650
|
-
const {
|
|
651
|
-
escape: t,
|
|
652
|
-
escapeValue: s,
|
|
653
|
-
useRawValueToEscape: i,
|
|
654
|
-
prefix: n,
|
|
655
|
-
prefixEscaped: a,
|
|
656
|
-
suffix: r,
|
|
657
|
-
suffixEscaped: l,
|
|
658
|
-
formatSeparator: u,
|
|
659
|
-
unescapeSuffix: h,
|
|
660
|
-
unescapePrefix: f,
|
|
661
|
-
nestingPrefix: g,
|
|
662
|
-
nestingPrefixEscaped: p,
|
|
663
|
-
nestingSuffix: d,
|
|
664
|
-
nestingSuffixEscaped: x,
|
|
665
|
-
nestingOptionsSeparator: b,
|
|
666
|
-
maxReplaces: v,
|
|
667
|
-
alwaysFormat: y
|
|
668
|
-
} = e.interpolation;
|
|
669
|
-
this.escape = t !== void 0 ? t : He, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = n ? T(n) : a || "{{", this.suffix = r ? T(r) : l || "}}", this.formatSeparator = u || ",", this.unescapePrefix = h ? "" : f || "-", this.unescapeSuffix = this.unescapePrefix ? "" : h || "", this.nestingPrefix = g ? T(g) : p || T("$t("), this.nestingSuffix = d ? T(d) : x || T(")"), this.nestingOptionsSeparator = b || ",", this.maxReplaces = v || 1e3, this.alwaysFormat = y !== void 0 ? y : !1, this.resetRegExp();
|
|
670
|
-
}
|
|
671
|
-
reset() {
|
|
672
|
-
this.options && this.init(this.options);
|
|
673
|
-
}
|
|
674
|
-
resetRegExp() {
|
|
675
|
-
const e = (t, s) => t?.source === s ? (t.lastIndex = 0, t) : new RegExp(s, "g");
|
|
676
|
-
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}`);
|
|
677
|
-
}
|
|
678
|
-
interpolate(e, t, s, i) {
|
|
679
|
-
let n, a, r;
|
|
680
|
-
const l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u = (p) => {
|
|
681
|
-
if (p.indexOf(this.formatSeparator) < 0) {
|
|
682
|
-
const v = xe(t, l, p, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
683
|
-
return this.alwaysFormat ? this.format(v, void 0, s, {
|
|
684
|
-
...i,
|
|
685
|
-
...t,
|
|
686
|
-
interpolationkey: p
|
|
687
|
-
}) : v;
|
|
688
|
-
}
|
|
689
|
-
const d = p.split(this.formatSeparator), x = d.shift().trim(), b = d.join(this.formatSeparator).trim();
|
|
690
|
-
return this.format(xe(t, l, x, this.options.keySeparator, this.options.ignoreJSONStructure), b, s, {
|
|
691
|
-
...i,
|
|
692
|
-
...t,
|
|
693
|
-
interpolationkey: x
|
|
694
|
-
});
|
|
695
|
-
};
|
|
696
|
-
this.resetRegExp();
|
|
697
|
-
const h = i?.missingInterpolationHandler || this.options.missingInterpolationHandler, f = i?.interpolation?.skipOnVariables !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
698
|
-
return [{
|
|
699
|
-
regex: this.regexpUnescape,
|
|
700
|
-
safeValue: (p) => q(p)
|
|
701
|
-
}, {
|
|
702
|
-
regex: this.regexp,
|
|
703
|
-
safeValue: (p) => this.escapeValue ? q(this.escape(p)) : q(p)
|
|
704
|
-
}].forEach((p) => {
|
|
705
|
-
for (r = 0; n = p.regex.exec(e); ) {
|
|
706
|
-
const d = n[1].trim();
|
|
707
|
-
if (a = u(d), a === void 0)
|
|
708
|
-
if (typeof h == "function") {
|
|
709
|
-
const b = h(e, n, i);
|
|
710
|
-
a = c(b) ? b : "";
|
|
711
|
-
} else if (i && Object.prototype.hasOwnProperty.call(i, d))
|
|
712
|
-
a = "";
|
|
713
|
-
else if (f) {
|
|
714
|
-
a = n[0];
|
|
715
|
-
continue;
|
|
716
|
-
} else
|
|
717
|
-
this.logger.warn(`missed to pass in variable ${d} for interpolating ${e}`), a = "";
|
|
718
|
-
else !c(a) && !this.useRawValueToEscape && (a = oe(a));
|
|
719
|
-
const x = p.safeValue(a);
|
|
720
|
-
if (e = e.replace(n[0], x), f ? (p.regex.lastIndex += a.length, p.regex.lastIndex -= n[0].length) : p.regex.lastIndex = 0, r++, r >= this.maxReplaces)
|
|
721
|
-
break;
|
|
722
|
-
}
|
|
723
|
-
}), e;
|
|
724
|
-
}
|
|
725
|
-
nest(e, t, s = {}) {
|
|
726
|
-
let i, n, a;
|
|
727
|
-
const r = (l, u) => {
|
|
728
|
-
const h = this.nestingOptionsSeparator;
|
|
729
|
-
if (l.indexOf(h) < 0) return l;
|
|
730
|
-
const f = l.split(new RegExp(`${h}[ ]*{`));
|
|
731
|
-
let g = `{${f[1]}`;
|
|
732
|
-
l = f[0], g = this.interpolate(g, a);
|
|
733
|
-
const p = g.match(/'/g), d = g.match(/"/g);
|
|
734
|
-
((p?.length ?? 0) % 2 === 0 && !d || d.length % 2 !== 0) && (g = g.replace(/'/g, '"'));
|
|
735
|
-
try {
|
|
736
|
-
a = JSON.parse(g), u && (a = {
|
|
737
|
-
...u,
|
|
738
|
-
...a
|
|
739
|
-
});
|
|
740
|
-
} catch (x) {
|
|
741
|
-
return this.logger.warn(`failed parsing options string in nesting for key ${l}`, x), `${l}${h}${g}`;
|
|
742
|
-
}
|
|
743
|
-
return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, l;
|
|
744
|
-
};
|
|
745
|
-
for (; i = this.nestingRegexp.exec(e); ) {
|
|
746
|
-
let l = [];
|
|
747
|
-
a = {
|
|
748
|
-
...s
|
|
749
|
-
}, a = a.replace && !c(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
750
|
-
const u = /{.*}/.test(i[1]) ? i[1].lastIndexOf("}") + 1 : i[1].indexOf(this.formatSeparator);
|
|
751
|
-
if (u !== -1 && (l = i[1].slice(u).split(this.formatSeparator).map((h) => h.trim()).filter(Boolean), i[1] = i[1].slice(0, u)), n = t(r.call(this, i[1].trim(), a), a), n && i[0] === e && !c(n)) return n;
|
|
752
|
-
c(n) || (n = oe(n)), n || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), n = ""), l.length && (n = l.reduce((h, f) => this.format(h, f, s.lng, {
|
|
753
|
-
...s,
|
|
754
|
-
interpolationkey: i[1].trim()
|
|
755
|
-
}), n.trim())), e = e.replace(i[0], n), this.regexp.lastIndex = 0;
|
|
756
|
-
}
|
|
757
|
-
return e;
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
const Ze = (o) => {
|
|
761
|
-
let e = o.toLowerCase().trim();
|
|
762
|
-
const t = {};
|
|
763
|
-
if (o.indexOf("(") > -1) {
|
|
764
|
-
const s = o.split("(");
|
|
765
|
-
e = s[0].toLowerCase().trim();
|
|
766
|
-
const i = s[1].substring(0, s[1].length - 1);
|
|
767
|
-
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((a) => {
|
|
768
|
-
if (a) {
|
|
769
|
-
const [r, ...l] = a.split(":"), u = l.join(":").trim().replace(/^'+|'+$/g, ""), h = r.trim();
|
|
770
|
-
t[h] || (t[h] = u), u === "false" && (t[h] = !1), u === "true" && (t[h] = !0), isNaN(u) || (t[h] = parseInt(u, 10));
|
|
771
|
-
}
|
|
772
|
-
});
|
|
773
|
-
}
|
|
774
|
-
return {
|
|
775
|
-
formatName: e,
|
|
776
|
-
formatOptions: t
|
|
777
|
-
};
|
|
778
|
-
}, ye = (o) => {
|
|
779
|
-
const e = {};
|
|
780
|
-
return (t, s, i) => {
|
|
781
|
-
let n = i;
|
|
782
|
-
i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (n = {
|
|
783
|
-
...n,
|
|
784
|
-
[i.interpolationkey]: void 0
|
|
785
|
-
});
|
|
786
|
-
const a = s + JSON.stringify(n);
|
|
787
|
-
let r = e[a];
|
|
788
|
-
return r || (r = o(B(s), i), e[a] = r), r(t);
|
|
789
|
-
};
|
|
790
|
-
}, qe = (o) => (e, t, s) => o(B(t), s)(e);
|
|
791
|
-
class Xe {
|
|
792
|
-
constructor(e = {}) {
|
|
793
|
-
this.logger = R.create("formatter"), this.options = e, this.init(e);
|
|
794
|
-
}
|
|
795
|
-
init(e, t = {
|
|
796
|
-
interpolation: {}
|
|
797
|
-
}) {
|
|
798
|
-
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
799
|
-
const s = t.cacheInBuiltFormats ? ye : qe;
|
|
800
|
-
this.formats = {
|
|
801
|
-
number: s((i, n) => {
|
|
802
|
-
const a = new Intl.NumberFormat(i, {
|
|
803
|
-
...n
|
|
804
|
-
});
|
|
805
|
-
return (r) => a.format(r);
|
|
806
|
-
}),
|
|
807
|
-
currency: s((i, n) => {
|
|
808
|
-
const a = new Intl.NumberFormat(i, {
|
|
809
|
-
...n,
|
|
810
|
-
style: "currency"
|
|
811
|
-
});
|
|
812
|
-
return (r) => a.format(r);
|
|
813
|
-
}),
|
|
814
|
-
datetime: s((i, n) => {
|
|
815
|
-
const a = new Intl.DateTimeFormat(i, {
|
|
816
|
-
...n
|
|
817
|
-
});
|
|
818
|
-
return (r) => a.format(r);
|
|
819
|
-
}),
|
|
820
|
-
relativetime: s((i, n) => {
|
|
821
|
-
const a = new Intl.RelativeTimeFormat(i, {
|
|
822
|
-
...n
|
|
823
|
-
});
|
|
824
|
-
return (r) => a.format(r, n.range || "day");
|
|
825
|
-
}),
|
|
826
|
-
list: s((i, n) => {
|
|
827
|
-
const a = new Intl.ListFormat(i, {
|
|
828
|
-
...n
|
|
829
|
-
});
|
|
830
|
-
return (r) => a.format(r);
|
|
831
|
-
})
|
|
832
|
-
};
|
|
833
|
-
}
|
|
834
|
-
add(e, t) {
|
|
835
|
-
this.formats[e.toLowerCase().trim()] = t;
|
|
836
|
-
}
|
|
837
|
-
addCached(e, t) {
|
|
838
|
-
this.formats[e.toLowerCase().trim()] = ye(t);
|
|
839
|
-
}
|
|
840
|
-
format(e, t, s, i = {}) {
|
|
841
|
-
const n = t.split(this.formatSeparator);
|
|
842
|
-
if (n.length > 1 && n[0].indexOf("(") > 1 && n[0].indexOf(")") < 0 && n.find((r) => r.indexOf(")") > -1)) {
|
|
843
|
-
const r = n.findIndex((l) => l.indexOf(")") > -1);
|
|
844
|
-
n[0] = [n[0], ...n.splice(1, r)].join(this.formatSeparator);
|
|
845
|
-
}
|
|
846
|
-
return n.reduce((r, l) => {
|
|
847
|
-
const {
|
|
848
|
-
formatName: u,
|
|
849
|
-
formatOptions: h
|
|
850
|
-
} = Ze(l);
|
|
851
|
-
if (this.formats[u]) {
|
|
852
|
-
let f = r;
|
|
853
|
-
try {
|
|
854
|
-
const g = i?.formatParams?.[i.interpolationkey] || {}, p = g.locale || g.lng || i.locale || i.lng || s;
|
|
855
|
-
f = this.formats[u](r, p, {
|
|
856
|
-
...h,
|
|
857
|
-
...i,
|
|
858
|
-
...g
|
|
859
|
-
});
|
|
860
|
-
} catch (g) {
|
|
861
|
-
this.logger.warn(g);
|
|
862
|
-
}
|
|
863
|
-
return f;
|
|
864
|
-
} else
|
|
865
|
-
this.logger.warn(`there was no format function for ${u}`);
|
|
866
|
-
return r;
|
|
867
|
-
}, e);
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
const et = (o, e) => {
|
|
871
|
-
o.pending[e] !== void 0 && (delete o.pending[e], o.pendingCount--);
|
|
872
|
-
};
|
|
873
|
-
class tt extends G {
|
|
874
|
-
constructor(e, t, s, i = {}) {
|
|
875
|
-
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 = [], this.backend?.init?.(s, i.backend, i);
|
|
876
|
-
}
|
|
877
|
-
queueLoad(e, t, s, i) {
|
|
878
|
-
const n = {}, a = {}, r = {}, l = {};
|
|
879
|
-
return e.forEach((u) => {
|
|
880
|
-
let h = !0;
|
|
881
|
-
t.forEach((f) => {
|
|
882
|
-
const g = `${u}|${f}`;
|
|
883
|
-
!s.reload && this.store.hasResourceBundle(u, f) ? this.state[g] = 2 : this.state[g] < 0 || (this.state[g] === 1 ? a[g] === void 0 && (a[g] = !0) : (this.state[g] = 1, h = !1, a[g] === void 0 && (a[g] = !0), n[g] === void 0 && (n[g] = !0), l[f] === void 0 && (l[f] = !0)));
|
|
884
|
-
}), h || (r[u] = !0);
|
|
885
|
-
}), (Object.keys(n).length || Object.keys(a).length) && this.queue.push({
|
|
886
|
-
pending: a,
|
|
887
|
-
pendingCount: Object.keys(a).length,
|
|
888
|
-
loaded: {},
|
|
889
|
-
errors: [],
|
|
890
|
-
callback: i
|
|
891
|
-
}), {
|
|
892
|
-
toLoad: Object.keys(n),
|
|
893
|
-
pending: Object.keys(a),
|
|
894
|
-
toLoadLanguages: Object.keys(r),
|
|
895
|
-
toLoadNamespaces: Object.keys(l)
|
|
896
|
-
};
|
|
897
|
-
}
|
|
898
|
-
loaded(e, t, s) {
|
|
899
|
-
const i = e.split("|"), n = i[0], a = i[1];
|
|
900
|
-
t && this.emit("failedLoading", n, a, t), !t && s && this.store.addResourceBundle(n, a, s, void 0, void 0, {
|
|
901
|
-
skipCopy: !0
|
|
902
|
-
}), this.state[e] = t ? -1 : 2, t && s && (this.state[e] = 0);
|
|
903
|
-
const r = {};
|
|
904
|
-
this.queue.forEach((l) => {
|
|
905
|
-
Me(l.loaded, [n], a), et(l, e), t && l.errors.push(t), l.pendingCount === 0 && !l.done && (Object.keys(l.loaded).forEach((u) => {
|
|
906
|
-
r[u] || (r[u] = {});
|
|
907
|
-
const h = l.loaded[u];
|
|
908
|
-
h.length && h.forEach((f) => {
|
|
909
|
-
r[u][f] === void 0 && (r[u][f] = !0);
|
|
910
|
-
});
|
|
911
|
-
}), l.done = !0, l.errors.length ? l.callback(l.errors) : l.callback());
|
|
912
|
-
}), this.emit("loaded", r), this.queue = this.queue.filter((l) => !l.done);
|
|
913
|
-
}
|
|
914
|
-
read(e, t, s, i = 0, n = this.retryTimeout, a) {
|
|
915
|
-
if (!e.length) return a(null, {});
|
|
916
|
-
if (this.readingCalls >= this.maxParallelReads) {
|
|
917
|
-
this.waitingReads.push({
|
|
918
|
-
lng: e,
|
|
919
|
-
ns: t,
|
|
920
|
-
fcName: s,
|
|
921
|
-
tried: i,
|
|
922
|
-
wait: n,
|
|
923
|
-
callback: a
|
|
924
|
-
});
|
|
925
|
-
return;
|
|
926
|
-
}
|
|
927
|
-
this.readingCalls++;
|
|
928
|
-
const r = (u, h) => {
|
|
929
|
-
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
930
|
-
const f = this.waitingReads.shift();
|
|
931
|
-
this.read(f.lng, f.ns, f.fcName, f.tried, f.wait, f.callback);
|
|
932
|
-
}
|
|
933
|
-
if (u && h && i < this.maxRetries) {
|
|
934
|
-
setTimeout(() => {
|
|
935
|
-
this.read.call(this, e, t, s, i + 1, n * 2, a);
|
|
936
|
-
}, n);
|
|
937
|
-
return;
|
|
938
|
-
}
|
|
939
|
-
a(u, h);
|
|
940
|
-
}, l = this.backend[s].bind(this.backend);
|
|
941
|
-
if (l.length === 2) {
|
|
942
|
-
try {
|
|
943
|
-
const u = l(e, t);
|
|
944
|
-
u && typeof u.then == "function" ? u.then((h) => r(null, h)).catch(r) : r(null, u);
|
|
945
|
-
} catch (u) {
|
|
946
|
-
r(u);
|
|
947
|
-
}
|
|
948
|
-
return;
|
|
949
|
-
}
|
|
950
|
-
return l(e, t, r);
|
|
951
|
-
}
|
|
952
|
-
prepareLoading(e, t, s = {}, i) {
|
|
953
|
-
if (!this.backend)
|
|
954
|
-
return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
|
|
955
|
-
c(e) && (e = this.languageUtils.toResolveHierarchy(e)), c(t) && (t = [t]);
|
|
956
|
-
const n = this.queueLoad(e, t, s, i);
|
|
957
|
-
if (!n.toLoad.length)
|
|
958
|
-
return n.pending.length || i(), null;
|
|
959
|
-
n.toLoad.forEach((a) => {
|
|
960
|
-
this.loadOne(a);
|
|
961
|
-
});
|
|
962
|
-
}
|
|
963
|
-
load(e, t, s) {
|
|
964
|
-
this.prepareLoading(e, t, {}, s);
|
|
965
|
-
}
|
|
966
|
-
reload(e, t, s) {
|
|
967
|
-
this.prepareLoading(e, t, {
|
|
968
|
-
reload: !0
|
|
969
|
-
}, s);
|
|
970
|
-
}
|
|
971
|
-
loadOne(e, t = "") {
|
|
972
|
-
const s = e.split("|"), i = s[0], n = s[1];
|
|
973
|
-
this.read(i, n, "read", void 0, void 0, (a, r) => {
|
|
974
|
-
a && this.logger.warn(`${t}loading namespace ${n} for language ${i} failed`, a), !a && r && this.logger.log(`${t}loaded namespace ${n} for language ${i}`, r), this.loaded(e, a, r);
|
|
975
|
-
});
|
|
976
|
-
}
|
|
977
|
-
saveMissing(e, t, s, i, n, a = {}, r = () => {
|
|
978
|
-
}) {
|
|
979
|
-
if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
|
|
980
|
-
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!!!");
|
|
981
|
-
return;
|
|
982
|
-
}
|
|
983
|
-
if (!(s == null || s === "")) {
|
|
984
|
-
if (this.backend?.create) {
|
|
985
|
-
const l = {
|
|
986
|
-
...a,
|
|
987
|
-
isUpdate: n
|
|
988
|
-
}, u = this.backend.create.bind(this.backend);
|
|
989
|
-
if (u.length < 6)
|
|
990
|
-
try {
|
|
991
|
-
let h;
|
|
992
|
-
u.length === 5 ? h = u(e, t, s, i, l) : h = u(e, t, s, i), h && typeof h.then == "function" ? h.then((f) => r(null, f)).catch(r) : r(null, h);
|
|
993
|
-
} catch (h) {
|
|
994
|
-
r(h);
|
|
995
|
-
}
|
|
996
|
-
else
|
|
997
|
-
u(e, t, s, i, r, l);
|
|
998
|
-
}
|
|
999
|
-
!e || !e[0] || this.store.addResource(e[0], t, s, i);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
const be = () => ({
|
|
1004
|
-
debug: !1,
|
|
1005
|
-
initAsync: !0,
|
|
1006
|
-
ns: ["translation"],
|
|
1007
|
-
defaultNS: ["translation"],
|
|
1008
|
-
fallbackLng: ["dev"],
|
|
1009
|
-
fallbackNS: !1,
|
|
1010
|
-
supportedLngs: !1,
|
|
1011
|
-
nonExplicitSupportedLngs: !1,
|
|
1012
|
-
load: "all",
|
|
1013
|
-
preload: !1,
|
|
1014
|
-
simplifyPluralSuffix: !0,
|
|
1015
|
-
keySeparator: ".",
|
|
1016
|
-
nsSeparator: ":",
|
|
1017
|
-
pluralSeparator: "_",
|
|
1018
|
-
contextSeparator: "_",
|
|
1019
|
-
partialBundledLanguages: !1,
|
|
1020
|
-
saveMissing: !1,
|
|
1021
|
-
updateMissing: !1,
|
|
1022
|
-
saveMissingTo: "fallback",
|
|
1023
|
-
saveMissingPlurals: !0,
|
|
1024
|
-
missingKeyHandler: !1,
|
|
1025
|
-
missingInterpolationHandler: !1,
|
|
1026
|
-
postProcess: !1,
|
|
1027
|
-
postProcessPassResolved: !1,
|
|
1028
|
-
returnNull: !1,
|
|
1029
|
-
returnEmptyString: !0,
|
|
1030
|
-
returnObjects: !1,
|
|
1031
|
-
joinArrays: !1,
|
|
1032
|
-
returnedObjectHandler: !1,
|
|
1033
|
-
parseMissingKeyHandler: !1,
|
|
1034
|
-
appendNamespaceToMissingKey: !1,
|
|
1035
|
-
appendNamespaceToCIMode: !1,
|
|
1036
|
-
overloadTranslationOptionHandler: (o) => {
|
|
1037
|
-
let e = {};
|
|
1038
|
-
if (typeof o[1] == "object" && (e = o[1]), c(o[1]) && (e.defaultValue = o[1]), c(o[2]) && (e.tDescription = o[2]), typeof o[2] == "object" || typeof o[3] == "object") {
|
|
1039
|
-
const t = o[3] || o[2];
|
|
1040
|
-
Object.keys(t).forEach((s) => {
|
|
1041
|
-
e[s] = t[s];
|
|
1042
|
-
});
|
|
1043
|
-
}
|
|
1044
|
-
return e;
|
|
1045
|
-
},
|
|
1046
|
-
interpolation: {
|
|
1047
|
-
escapeValue: !0,
|
|
1048
|
-
format: (o) => o,
|
|
1049
|
-
prefix: "{{",
|
|
1050
|
-
suffix: "}}",
|
|
1051
|
-
formatSeparator: ",",
|
|
1052
|
-
unescapePrefix: "-",
|
|
1053
|
-
nestingPrefix: "$t(",
|
|
1054
|
-
nestingSuffix: ")",
|
|
1055
|
-
nestingOptionsSeparator: ",",
|
|
1056
|
-
maxReplaces: 1e3,
|
|
1057
|
-
skipOnVariables: !0
|
|
1058
|
-
},
|
|
1059
|
-
cacheInBuiltFormats: !0
|
|
1060
|
-
}), we = (o) => (c(o.ns) && (o.ns = [o.ns]), c(o.fallbackLng) && (o.fallbackLng = [o.fallbackLng]), c(o.fallbackNS) && (o.fallbackNS = [o.fallbackNS]), o.supportedLngs?.indexOf?.("cimode") < 0 && (o.supportedLngs = o.supportedLngs.concat(["cimode"])), typeof o.initImmediate == "boolean" && (o.initAsync = o.initImmediate), o), z = () => {
|
|
1061
|
-
}, it = (o) => {
|
|
1062
|
-
Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach((t) => {
|
|
1063
|
-
typeof o[t] == "function" && (o[t] = o[t].bind(o));
|
|
1064
|
-
});
|
|
1065
|
-
};
|
|
1066
|
-
class U extends G {
|
|
1067
|
-
constructor(e = {}, t) {
|
|
1068
|
-
if (super(), this.options = we(e), this.services = {}, this.logger = R, this.modules = {
|
|
1069
|
-
external: []
|
|
1070
|
-
}, it(this), t && !this.isInitialized && !e.isClone) {
|
|
1071
|
-
if (!this.options.initAsync)
|
|
1072
|
-
return this.init(e, t), this;
|
|
1073
|
-
setTimeout(() => {
|
|
1074
|
-
this.init(e, t);
|
|
1075
|
-
}, 0);
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
init(e = {}, t) {
|
|
1079
|
-
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (c(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
|
|
1080
|
-
const s = be();
|
|
1081
|
-
this.options = {
|
|
1082
|
-
...s,
|
|
1083
|
-
...this.options,
|
|
1084
|
-
...we(e)
|
|
1085
|
-
}, this.options.interpolation = {
|
|
1086
|
-
...s.interpolation,
|
|
1087
|
-
...this.options.interpolation
|
|
1088
|
-
}, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator);
|
|
1089
|
-
const i = (u) => u ? typeof u == "function" ? new u() : u : null;
|
|
1090
|
-
if (!this.options.isClone) {
|
|
1091
|
-
this.modules.logger ? R.init(i(this.modules.logger), this.options) : R.init(null, this.options);
|
|
1092
|
-
let u;
|
|
1093
|
-
this.modules.formatter ? u = this.modules.formatter : u = Xe;
|
|
1094
|
-
const h = new pe(this.options);
|
|
1095
|
-
this.store = new he(this.options.resources, this.options);
|
|
1096
|
-
const f = this.services;
|
|
1097
|
-
f.logger = R, f.resourceStore = this.store, f.languageUtils = h, f.pluralResolver = new Qe(h, {
|
|
1098
|
-
prepend: this.options.pluralSeparator,
|
|
1099
|
-
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1100
|
-
}), this.options.interpolation.format && this.options.interpolation.format !== s.interpolation.format && this.logger.warn("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 Ge(this.options), f.utils = {
|
|
1101
|
-
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1102
|
-
}, f.backendConnector = new tt(i(this.modules.backend), f.resourceStore, f, this.options), f.backendConnector.on("*", (p, ...d) => {
|
|
1103
|
-
this.emit(p, ...d);
|
|
1104
|
-
}), 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 W(this.services, this.options), this.translator.on("*", (p, ...d) => {
|
|
1105
|
-
this.emit(p, ...d);
|
|
1106
|
-
}), this.modules.external.forEach((p) => {
|
|
1107
|
-
p.init && p.init(this);
|
|
1108
|
-
});
|
|
1109
|
-
}
|
|
1110
|
-
if (this.format = this.options.interpolation.format, t || (t = z), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
1111
|
-
const u = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1112
|
-
u.length > 0 && u[0] !== "dev" && (this.options.lng = u[0]);
|
|
1113
|
-
}
|
|
1114
|
-
!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) => {
|
|
1115
|
-
this[u] = (...h) => this.store[u](...h);
|
|
1116
|
-
}), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((u) => {
|
|
1117
|
-
this[u] = (...h) => (this.store[u](...h), this);
|
|
1118
|
-
});
|
|
1119
|
-
const r = A(), l = () => {
|
|
1120
|
-
const u = (h, f) => {
|
|
1121
|
-
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), r.resolve(f), t(h, f);
|
|
1122
|
-
};
|
|
1123
|
-
if (this.languages && !this.isInitialized) return u(null, this.t.bind(this));
|
|
1124
|
-
this.changeLanguage(this.options.lng, u);
|
|
1125
|
-
};
|
|
1126
|
-
return this.options.resources || !this.options.initAsync ? l() : setTimeout(l, 0), r;
|
|
1127
|
-
}
|
|
1128
|
-
loadResources(e, t = z) {
|
|
1129
|
-
let s = t;
|
|
1130
|
-
const i = c(e) ? e : this.language;
|
|
1131
|
-
if (typeof e == "function" && (s = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1132
|
-
if (i?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return s();
|
|
1133
|
-
const n = [], a = (r) => {
|
|
1134
|
-
if (!r || r === "cimode") return;
|
|
1135
|
-
this.services.languageUtils.toResolveHierarchy(r).forEach((u) => {
|
|
1136
|
-
u !== "cimode" && n.indexOf(u) < 0 && n.push(u);
|
|
1137
|
-
});
|
|
1138
|
-
};
|
|
1139
|
-
i ? a(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((l) => a(l)), this.options.preload?.forEach?.((r) => a(r)), this.services.backendConnector.load(n, this.options.ns, (r) => {
|
|
1140
|
-
!r && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), s(r);
|
|
1141
|
-
});
|
|
1142
|
-
} else
|
|
1143
|
-
s(null);
|
|
1144
|
-
}
|
|
1145
|
-
reloadResources(e, t, s) {
|
|
1146
|
-
const i = A();
|
|
1147
|
-
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 = z), this.services.backendConnector.reload(e, t, (n) => {
|
|
1148
|
-
i.resolve(), s(n);
|
|
1149
|
-
}), i;
|
|
1150
|
-
}
|
|
1151
|
-
use(e) {
|
|
1152
|
-
if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
1153
|
-
if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
1154
|
-
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" && Le.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
1155
|
-
}
|
|
1156
|
-
setResolvedLanguage(e) {
|
|
1157
|
-
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
|
|
1158
|
-
for (let t = 0; t < this.languages.length; t++) {
|
|
1159
|
-
const s = this.languages[t];
|
|
1160
|
-
if (!(["cimode", "dev"].indexOf(s) > -1) && this.store.hasLanguageSomeTranslations(s)) {
|
|
1161
|
-
this.resolvedLanguage = s;
|
|
1162
|
-
break;
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
!this.resolvedLanguage && this.languages.indexOf(e) < 0 && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
changeLanguage(e, t) {
|
|
1169
|
-
this.isLanguageChangingTo = e;
|
|
1170
|
-
const s = A();
|
|
1171
|
-
this.emit("languageChanging", e);
|
|
1172
|
-
const i = (r) => {
|
|
1173
|
-
this.language = r, this.languages = this.services.languageUtils.toResolveHierarchy(r), this.resolvedLanguage = void 0, this.setResolvedLanguage(r);
|
|
1174
|
-
}, n = (r, l) => {
|
|
1175
|
-
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(r, (...u) => this.t(...u));
|
|
1176
|
-
}, a = (r) => {
|
|
1177
|
-
!e && !r && this.services.languageDetector && (r = []);
|
|
1178
|
-
const l = c(r) ? r : r && r[0], u = this.store.hasLanguageSomeTranslations(l) ? l : this.services.languageUtils.getBestMatchFromCodes(c(r) ? [r] : r);
|
|
1179
|
-
u && (this.language || i(u), this.translator.language || this.translator.changeLanguage(u), this.services.languageDetector?.cacheUserLanguage?.(u)), this.loadResources(u, (h) => {
|
|
1180
|
-
n(h, u);
|
|
1181
|
-
});
|
|
1182
|
-
};
|
|
1183
|
-
return !e && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a) : this.services.languageDetector.detect(a) : a(e), s;
|
|
1184
|
-
}
|
|
1185
|
-
getFixedT(e, t, s) {
|
|
1186
|
-
const i = (n, a, ...r) => {
|
|
1187
|
-
let l;
|
|
1188
|
-
typeof a != "object" ? l = this.options.overloadTranslationOptionHandler([n, a].concat(r)) : l = {
|
|
1189
|
-
...a
|
|
1190
|
-
}, 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);
|
|
1191
|
-
const u = this.options.keySeparator || ".";
|
|
1192
|
-
let h;
|
|
1193
|
-
return l.keyPrefix && Array.isArray(n) ? h = n.map((f) => `${l.keyPrefix}${u}${f}`) : h = l.keyPrefix ? `${l.keyPrefix}${u}${n}` : n, this.t(h, l);
|
|
1194
|
-
};
|
|
1195
|
-
return c(e) ? i.lng = e : i.lngs = e, i.ns = t, i.keyPrefix = s, i;
|
|
1196
|
-
}
|
|
1197
|
-
t(...e) {
|
|
1198
|
-
return this.translator?.translate(...e);
|
|
1199
|
-
}
|
|
1200
|
-
exists(...e) {
|
|
1201
|
-
return this.translator?.exists(...e);
|
|
1202
|
-
}
|
|
1203
|
-
setDefaultNamespace(e) {
|
|
1204
|
-
this.options.defaultNS = e;
|
|
1205
|
-
}
|
|
1206
|
-
hasLoadedNamespace(e, t = {}) {
|
|
1207
|
-
if (!this.isInitialized)
|
|
1208
|
-
return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
|
|
1209
|
-
if (!this.languages || !this.languages.length)
|
|
1210
|
-
return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
|
|
1211
|
-
const s = t.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, n = this.languages[this.languages.length - 1];
|
|
1212
|
-
if (s.toLowerCase() === "cimode") return !0;
|
|
1213
|
-
const a = (r, l) => {
|
|
1214
|
-
const u = this.services.backendConnector.state[`${r}|${l}`];
|
|
1215
|
-
return u === -1 || u === 0 || u === 2;
|
|
1216
|
-
};
|
|
1217
|
-
if (t.precheck) {
|
|
1218
|
-
const r = t.precheck(this, a);
|
|
1219
|
-
if (r !== void 0) return r;
|
|
1220
|
-
}
|
|
1221
|
-
return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(s, e) && (!i || a(n, e)));
|
|
1222
|
-
}
|
|
1223
|
-
loadNamespaces(e, t) {
|
|
1224
|
-
const s = A();
|
|
1225
|
-
return this.options.ns ? (c(e) && (e = [e]), e.forEach((i) => {
|
|
1226
|
-
this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
|
|
1227
|
-
}), this.loadResources((i) => {
|
|
1228
|
-
s.resolve(), t && t(i);
|
|
1229
|
-
}), s) : (t && t(), Promise.resolve());
|
|
1230
|
-
}
|
|
1231
|
-
loadLanguages(e, t) {
|
|
1232
|
-
const s = A();
|
|
1233
|
-
c(e) && (e = [e]);
|
|
1234
|
-
const i = this.options.preload || [], n = e.filter((a) => i.indexOf(a) < 0 && this.services.languageUtils.isSupportedCode(a));
|
|
1235
|
-
return n.length ? (this.options.preload = i.concat(n), this.loadResources((a) => {
|
|
1236
|
-
s.resolve(), t && t(a);
|
|
1237
|
-
}), s) : (t && t(), Promise.resolve());
|
|
1238
|
-
}
|
|
1239
|
-
dir(e) {
|
|
1240
|
-
if (e || (e = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language)), !e) return "rtl";
|
|
1241
|
-
try {
|
|
1242
|
-
const i = new Intl.Locale(e);
|
|
1243
|
-
if (i && i.getTextInfo) {
|
|
1244
|
-
const n = i.getTextInfo();
|
|
1245
|
-
if (n && n.direction) return n.direction;
|
|
1246
|
-
}
|
|
1247
|
-
} catch {
|
|
1248
|
-
}
|
|
1249
|
-
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 = this.services?.languageUtils || new pe(be());
|
|
1250
|
-
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(s.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
1251
|
-
}
|
|
1252
|
-
static createInstance(e = {}, t) {
|
|
1253
|
-
return new U(e, t);
|
|
1254
|
-
}
|
|
1255
|
-
cloneInstance(e = {}, t = z) {
|
|
1256
|
-
const s = e.forkResourceStore;
|
|
1257
|
-
s && delete e.forkResourceStore;
|
|
1258
|
-
const i = {
|
|
1259
|
-
...this.options,
|
|
1260
|
-
...e,
|
|
1261
|
-
isClone: !0
|
|
1262
|
-
}, n = new U(i);
|
|
1263
|
-
if ((e.debug !== void 0 || e.prefix !== void 0) && (n.logger = n.logger.clone(e)), ["store", "services", "language"].forEach((r) => {
|
|
1264
|
-
n[r] = this[r];
|
|
1265
|
-
}), n.services = {
|
|
1266
|
-
...this.services
|
|
1267
|
-
}, n.services.utils = {
|
|
1268
|
-
hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
|
|
1269
|
-
}, s) {
|
|
1270
|
-
const r = Object.keys(this.store.data).reduce((l, u) => (l[u] = {
|
|
1271
|
-
...this.store.data[u]
|
|
1272
|
-
}, l[u] = Object.keys(l[u]).reduce((h, f) => (h[f] = {
|
|
1273
|
-
...l[u][f]
|
|
1274
|
-
}, h), l[u]), l), {});
|
|
1275
|
-
n.store = new he(r, i), n.services.resourceStore = n.store;
|
|
1276
|
-
}
|
|
1277
|
-
return n.translator = new W(n.services, i), n.translator.on("*", (r, ...l) => {
|
|
1278
|
-
n.emit(r, ...l);
|
|
1279
|
-
}), n.init(i, t), n.translator.options = i, n.translator.backendConnector.services.utils = {
|
|
1280
|
-
hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
|
|
1281
|
-
}, n;
|
|
1282
|
-
}
|
|
1283
|
-
toJSON() {
|
|
1284
|
-
return {
|
|
1285
|
-
options: this.options,
|
|
1286
|
-
store: this.store,
|
|
1287
|
-
language: this.language,
|
|
1288
|
-
languages: this.languages,
|
|
1289
|
-
resolvedLanguage: this.resolvedLanguage
|
|
1290
|
-
};
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
const m = U.createInstance();
|
|
1294
|
-
m.createInstance = U.createInstance;
|
|
1295
|
-
m.createInstance;
|
|
1296
|
-
m.dir;
|
|
1297
|
-
m.init;
|
|
1298
|
-
m.loadResources;
|
|
1299
|
-
m.reloadResources;
|
|
1300
|
-
m.use;
|
|
1301
|
-
m.changeLanguage;
|
|
1302
|
-
m.getFixedT;
|
|
1303
|
-
m.t;
|
|
1304
|
-
m.exists;
|
|
1305
|
-
m.setDefaultNamespace;
|
|
1306
|
-
m.hasLoadedNamespace;
|
|
1307
|
-
m.loadNamespaces;
|
|
1308
|
-
m.loadLanguages;
|
|
1309
|
-
var Oe = Symbol();
|
|
1310
|
-
function $t(o, {
|
|
1311
|
-
i18next: e,
|
|
1312
|
-
rerenderOn: t = ["languageChanged", "loaded", "added", "removed"],
|
|
1313
|
-
slotStart: s = "{",
|
|
1314
|
-
slotEnd: i = "}"
|
|
1315
|
-
}) {
|
|
1316
|
-
const n = Re(/* @__PURE__ */ new Date()), a = () => Pe(() => {
|
|
1317
|
-
n.value = /* @__PURE__ */ new Date();
|
|
1318
|
-
}), r = () => n.value;
|
|
1319
|
-
t.forEach((h) => {
|
|
1320
|
-
var f;
|
|
1321
|
-
switch (h) {
|
|
1322
|
-
case "added":
|
|
1323
|
-
case "removed":
|
|
1324
|
-
(f = e.store) == null || f.on(h, a);
|
|
1325
|
-
break;
|
|
1326
|
-
default:
|
|
1327
|
-
e.on(h, a);
|
|
1328
|
-
break;
|
|
1329
|
-
}
|
|
1330
|
-
}), o.component("i18next", rt);
|
|
1331
|
-
const l = () => e.isInitialized;
|
|
1332
|
-
o.config.globalProperties.$t = Se(
|
|
1333
|
-
e.t.bind(e),
|
|
1334
|
-
r,
|
|
1335
|
-
l
|
|
1336
|
-
);
|
|
1337
|
-
const u = new Proxy(e, {
|
|
1338
|
-
get(h, f) {
|
|
1339
|
-
return r(), Reflect.get(h, f);
|
|
1340
|
-
}
|
|
1341
|
-
});
|
|
1342
|
-
o.config.globalProperties.$i18next = u, o.provide(Oe, {
|
|
1343
|
-
i18next: u,
|
|
1344
|
-
slotPattern: nt(s, i),
|
|
1345
|
-
withAccessRecording(h, f) {
|
|
1346
|
-
return Se(h, r, f);
|
|
1347
|
-
}
|
|
1348
|
-
});
|
|
1349
|
-
}
|
|
1350
|
-
function Se(o, e, t) {
|
|
1351
|
-
return new Proxy(o, {
|
|
1352
|
-
apply: function(s, i, n) {
|
|
1353
|
-
return e(), t() ? Reflect.apply(s, i, n) : "";
|
|
1354
|
-
}
|
|
1355
|
-
});
|
|
1356
|
-
}
|
|
1357
|
-
function st() {
|
|
1358
|
-
const o = ke(Oe);
|
|
1359
|
-
if (!o)
|
|
1360
|
-
throw new Error(
|
|
1361
|
-
"i18next-vue: Make sure to register the i18next-vue plugin using app.use(...)."
|
|
1362
|
-
);
|
|
1363
|
-
return o;
|
|
1364
|
-
}
|
|
1365
|
-
function nt(o, e) {
|
|
1366
|
-
const t = `${o}\\s*([a-z0-9\\-]+)\\s*${e}`;
|
|
1367
|
-
return new RegExp(t, "gi");
|
|
1368
|
-
}
|
|
1369
|
-
var rt = ee({
|
|
1370
|
-
props: {
|
|
1371
|
-
translation: {
|
|
1372
|
-
type: String,
|
|
1373
|
-
required: !0
|
|
1374
|
-
}
|
|
1375
|
-
},
|
|
1376
|
-
setup(o, { slots: e }) {
|
|
1377
|
-
const { slotPattern: t } = st();
|
|
1378
|
-
return () => {
|
|
1379
|
-
const s = o.translation, i = [];
|
|
1380
|
-
let n, a = 0;
|
|
1381
|
-
for (; (n = t.exec(s)) !== null; ) {
|
|
1382
|
-
i.push(s.substring(a, n.index));
|
|
1383
|
-
const r = e[n[1]];
|
|
1384
|
-
r ? i.push(...r()) : i.push(n[0]), a = t.lastIndex;
|
|
1385
|
-
}
|
|
1386
|
-
return i.push(s.substring(a)), i;
|
|
1387
|
-
};
|
|
1388
|
-
}
|
|
1389
|
-
});
|
|
1390
|
-
const at = "translation";
|
|
1391
|
-
async function Rt(o) {
|
|
1392
|
-
for (const [e, t] of Object.entries(o)) {
|
|
1393
|
-
const s = e.match(/\/(\w+)\.json$/)[1];
|
|
1394
|
-
await ot(s, t);
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
async function ot(o, e) {
|
|
1398
|
-
await lt(), m.addResourceBundle(o, at, e, !0, !0);
|
|
1399
|
-
}
|
|
1400
|
-
async function lt() {
|
|
1401
|
-
m.isInitialized || await m.init();
|
|
1402
|
-
}
|
|
1403
|
-
const ut = { class: "tooltip-container" }, ft = ["id"], ht = ["aria-labelledby", "aria-disabled"], dt = /* @__PURE__ */ ee({
|
|
1404
|
-
inheritAttrs: !1,
|
|
1405
|
-
__name: "ButtonTooltip.ce",
|
|
1406
|
-
props: {
|
|
1407
|
-
disabled: { type: Boolean, default: !1 },
|
|
1408
|
-
label: { type: String },
|
|
1409
|
-
tooltipPosition: { default: "top", type: String }
|
|
1410
|
-
},
|
|
1411
|
-
emits: ["click"],
|
|
1412
|
-
setup(o, { emit: e }) {
|
|
1413
|
-
const t = Ne(!0), s = Ee(), i = e;
|
|
1414
|
-
function n(r) {
|
|
1415
|
-
t.value = r;
|
|
1416
|
-
}
|
|
1417
|
-
function a() {
|
|
1418
|
-
o.disabled || i("click");
|
|
1419
|
-
}
|
|
1420
|
-
return (r, l) => (D(), te("div", ut, [
|
|
1421
|
-
_("p", {
|
|
1422
|
-
id: ae(s),
|
|
1423
|
-
class: Fe(["tooltip", {
|
|
1424
|
-
"sr-only": t.value || r.disabled,
|
|
1425
|
-
[`${r.tooltipPosition}`]: !0
|
|
1426
|
-
}])
|
|
1427
|
-
}, je(r.label), 11, ft),
|
|
1428
|
-
_("button", Ie(r.$attrs, {
|
|
1429
|
-
onMouseenter: l[0] || (l[0] = (u) => n(!1)),
|
|
1430
|
-
onMouseleave: l[1] || (l[1] = (u) => n(!0)),
|
|
1431
|
-
onFocusin: l[2] || (l[2] = (u) => n(!1)),
|
|
1432
|
-
onFocusout: l[3] || (l[3] = (u) => n(!0)),
|
|
1433
|
-
onClick: Te(a, ["stop"]),
|
|
1434
|
-
"aria-labelledby": ae(s),
|
|
1435
|
-
"aria-disabled": r.disabled,
|
|
1436
|
-
class: { disabled: r.disabled }
|
|
1437
|
-
}), [
|
|
1438
|
-
De(r.$slots, "default")
|
|
1439
|
-
], 16, ht)
|
|
1440
|
-
]));
|
|
1441
|
-
}
|
|
1442
|
-
}), ct = '*{--pix-neutral-800: #253858}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.tooltip-container{position:relative;display:grid}.tooltip-container .tooltip{position:absolute;padding:5px 7px;background:var(--pix-neutral-800);color:#fff;border-radius:4px;z-index:400;margin:0;--horizontal-shift: 12px;--tooltip-gap: 1px;--arrow-height: 6px;--arrow-width: 5px}.tooltip-container .tooltip:before{content:"";position:absolute}.tooltip-container .tooltip.top{bottom:calc(100% + var(--tooltip-gap) + var(--arrow-height));left:50%;transform:translate(calc(var(--horizontal-shift) * -1))}.tooltip-container .tooltip.top:before{top:100%;left:calc(var(--horizontal-shift) - var(--arrow-width));border-right:var(--arrow-width) solid transparent;border-left:var(--arrow-width) solid transparent;border-top:var(--arrow-height) solid var(--pix-neutral-800)}.tooltip-container .tooltip.bottom{top:calc(100% + var(--tooltip-gap) + var(--arrow-height));left:50%;transform:translate(calc(var(--horizontal-shift) * -1))}.tooltip-container .tooltip.bottom:before{bottom:100%;left:calc(var(--horizontal-shift) - var(--arrow-width));border-right:var(--arrow-width) solid transparent;border-left:var(--arrow-width) solid transparent;border-bottom:var(--arrow-height) solid var(--pix-neutral-800)}.tooltip-container .tooltip.left{right:calc(100% + var(--tooltip-gap) + var(--arrow-height));top:50%;transform:translateY(-50%)}.tooltip-container .tooltip.left:before{left:100%;top:50%;transform:translateY(-50%);border-top:var(--arrow-width) solid transparent;border-bottom:var(--arrow-width) solid transparent;border-left:var(--arrow-height) solid var(--pix-neutral-800)}.tooltip-container .tooltip.right{left:calc(100% + var(--tooltip-gap) + var(--arrow-height));top:50%;transform:translateY(-50%)}.tooltip-container .tooltip.right:before{right:100%;top:50%;transform:translateY(-50%);border-top:var(--arrow-width) solid transparent;border-bottom:var(--arrow-width) solid transparent;border-right:var(--arrow-height) solid var(--pix-neutral-800)}.tooltip-container button:hover{cursor:pointer}.tooltip-container button.disabled{color:#797e89;cursor:not-allowed;border-color:transparent;background:transparent}', pt = /* @__PURE__ */ Q(dt, [["styles", [ct]]]), gt = {}, mt = {
|
|
1443
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1444
|
-
width: "16",
|
|
1445
|
-
height: "16",
|
|
1446
|
-
viewBox: "0 0 16 16",
|
|
1447
|
-
fill: "inherit"
|
|
1448
|
-
};
|
|
1449
|
-
function xt(o, e) {
|
|
1450
|
-
return D(), te("svg", mt, e[0] || (e[0] = [
|
|
1451
|
-
_("path", {
|
|
1452
|
-
d: "M10.5642 8.75826H3.28958C3.07681 8.75826 2.89719 8.68509 2.75075 8.53875C2.60442 8.39231 2.53125 8.2127 2.53125 7.99992C2.53125 7.78714 2.60442 7.60753 2.75075 7.46109C2.89719 7.31475 3.07681 7.24159 3.28958 7.24159H10.5642L7.45292 4.13042C7.30103 3.97842 7.22719 3.80025 7.23142 3.59592C7.23564 3.39159 7.31369 3.21348 7.46558 3.06159C7.61758 2.9207 7.79575 2.84814 8.00008 2.84392C8.20442 2.8397 8.38258 2.91353 8.53458 3.06542L12.9346 7.46542C13.0091 7.54009 13.0636 7.62298 13.0981 7.71409C13.1325 7.80509 13.1498 7.90037 13.1498 7.99992C13.1498 8.09948 13.1325 8.19475 13.0981 8.28575C13.0636 8.37687 13.0091 8.45975 12.9346 8.53442L8.53058 12.9383C8.38703 13.0818 8.21164 13.1536 8.00442 13.1536C7.79719 13.1536 7.61758 13.0818 7.46558 12.9383C7.31369 12.7864 7.23775 12.6061 7.23775 12.3976C7.23775 12.189 7.31369 12.0088 7.46558 11.8568L10.5642 8.75826Z",
|
|
1453
|
-
fill: "inherit"
|
|
1454
|
-
}, null, -1)
|
|
1455
|
-
]));
|
|
1456
|
-
}
|
|
1457
|
-
const yt = /* @__PURE__ */ Q(gt, [["render", xt]]), bt = {}, wt = {
|
|
1458
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1459
|
-
width: "16",
|
|
1460
|
-
height: "16",
|
|
1461
|
-
viewBox: "0 0 16 16",
|
|
1462
|
-
fill: "inherit"
|
|
1463
|
-
};
|
|
1464
|
-
function St(o, e) {
|
|
1465
|
-
return D(), te("svg", wt, e[0] || (e[0] = [
|
|
1466
|
-
_("path", {
|
|
1467
|
-
d: "M5.4356 8.75868L8.54693 11.8698C8.69882 12.0218 8.77265 12.2 8.76843 12.4043C8.76421 12.6087 8.68615 12.7868 8.53426 12.9387C8.38226 13.0796 8.2041 13.1521 7.99976 13.1563C7.79543 13.1606 7.61726 13.0867 7.46526 12.9348L3.06526 8.53485C2.99071 8.46018 2.93621 8.37729 2.90176 8.28618C2.86732 8.19518 2.8501 8.0999 2.8501 8.00035C2.8501 7.90079 2.86732 7.80551 2.90176 7.71451C2.93621 7.6234 2.99071 7.54051 3.06526 7.46585L7.46926 3.06201C7.61282 2.91846 7.78821 2.84668 7.99543 2.84668C8.20265 2.84668 8.38226 2.91846 8.53426 3.06201C8.68615 3.2139 8.7621 3.39412 8.7621 3.60268C8.7621 3.81124 8.68615 3.99151 8.53426 4.14351L5.4356 7.24201H12.7103C12.923 7.24201 13.1027 7.31518 13.2491 7.46151C13.3954 7.60796 13.4686 7.78757 13.4686 8.00035C13.4686 8.21312 13.3954 8.39274 13.2491 8.53918C13.1027 8.68551 12.923 8.75868 12.7103 8.75868H5.4356Z",
|
|
1468
|
-
fill: "inherit"
|
|
1469
|
-
}, null, -1)
|
|
1470
|
-
]));
|
|
1471
|
-
}
|
|
1472
|
-
const vt = /* @__PURE__ */ Q(bt, [["render", St]]), Lt = /* @__PURE__ */ ee({
|
|
1473
|
-
__name: "NavigationButton.ce",
|
|
1474
|
-
props: {
|
|
1475
|
-
disabled: { type: Boolean },
|
|
1476
|
-
label: { type: String },
|
|
1477
|
-
tooltipPosition: { type: String },
|
|
1478
|
-
direction: { type: String }
|
|
1479
|
-
},
|
|
1480
|
-
emits: ["click"],
|
|
1481
|
-
setup(o) {
|
|
1482
|
-
return (e, t) => (D(), Z(pt, {
|
|
1483
|
-
class: "button",
|
|
1484
|
-
onClick: t[0] || (t[0] = (s) => e.$emit("click")),
|
|
1485
|
-
"tooltip-position": e.tooltipPosition,
|
|
1486
|
-
label: e.label,
|
|
1487
|
-
disabled: e.disabled
|
|
1488
|
-
}, {
|
|
1489
|
-
default: Ve(() => [
|
|
1490
|
-
e.direction === "next" ? (D(), Z(yt, { key: 0 })) : (D(), Z(vt, { key: 1 }))
|
|
1491
|
-
]),
|
|
1492
|
-
_: 1
|
|
1493
|
-
}, 8, ["tooltip-position", "label", "disabled"]));
|
|
1494
|
-
}
|
|
1495
|
-
}), Ot = "*{--pix-neutral-800: #253858;color:var(--pix-neutral-800)}.button{border-radius:100%;padding:4px;width:32px;height:32px;background:transparent;border:1px var(--pix-neutral-800) solid;aspect-ratio:1/1;fill:var(--pix-neutral-800);display:flex;align-items:center;justify-content:center}.button:hover{background:#c3d0ff}.button:active{background:#cdd1d9}", Pt = /* @__PURE__ */ Q(Lt, [["styles", [Ot]]]);
|
|
1496
|
-
export {
|
|
1497
|
-
pt as B,
|
|
1498
|
-
Pt as N,
|
|
1499
|
-
Rt as a,
|
|
1500
|
-
$t as b,
|
|
1501
|
-
m as i
|
|
1502
|
-
};
|