@ukpc-lib/react 0.2.28 → 0.2.30
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/components/MultiProvider.d.ts +1 -2
- package/dist/components/index.cjs +30 -30
- package/dist/components/index.js +2818 -2691
- package/dist/index.css +1 -1
- package/dist/{index.module-4e7900e2.js → index.module-10fe74a9.js} +1227 -1196
- package/dist/{index.module-160774a9.cjs → index.module-5858fff5.cjs} +75 -75
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +16 -16
- package/package.json +1 -1
- package/web-components-bundle/access-denied/index.cjs +2 -0
- package/web-components-bundle/access-denied/index.js +6 -0
- package/web-components-bundle/global-menu/index.cjs +1 -2
- package/web-components-bundle/global-menu/index.js +2 -2
- package/web-components-bundle/global-topbar/index.cjs +1 -1
- package/web-components-bundle/global-topbar/index.js +5 -3
- package/web-components-bundle/has-permission/index.cjs +1 -1
- package/web-components-bundle/has-permission/index.js +6 -4
- package/web-components-bundle/index-1db32fa4.cjs +1066 -0
- package/web-components-bundle/index-433c2a88.cjs +2 -0
- package/web-components-bundle/index-aa69d7f8.js +18718 -0
- package/web-components-bundle/index-d3cefb44.cjs +67 -0
- package/web-components-bundle/index-e20e66c0.js +10699 -0
- package/web-components-bundle/index-f9eb06fc.js +3000 -0
- package/web-components-bundle/react-to-web-component-cf652ce8.js +6370 -0
- package/web-components-bundle/react-to-web-component-fde3f1ba.cjs +40 -0
- package/web-components-bundle/index-a16031d2.js +0 -17066
- package/web-components-bundle/index-ea3fddce.cjs +0 -106
- package/web-components-bundle/index-ed2b29bc.js +0 -21453
- package/web-components-bundle/index-f93fc96f.cjs +0 -1067
|
@@ -0,0 +1,3000 @@
|
|
|
1
|
+
import { r as $, c as X, b as ct, s as dt, j as R } from "./react-to-web-component-cf652ce8.js";
|
|
2
|
+
function ht(r, e) {
|
|
3
|
+
for (var t = 0; t < e.length; t++) {
|
|
4
|
+
const n = e[t];
|
|
5
|
+
if (typeof n != "string" && !Array.isArray(n)) {
|
|
6
|
+
for (const i in n)
|
|
7
|
+
if (i !== "default" && !(i in r)) {
|
|
8
|
+
const s = Object.getOwnPropertyDescriptor(n, i);
|
|
9
|
+
s && Object.defineProperty(r, i, s.get ? s : {
|
|
10
|
+
enumerable: !0,
|
|
11
|
+
get: () => n[i]
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
+
}
|
|
18
|
+
function G(r) {
|
|
19
|
+
"@babel/helpers - typeof";
|
|
20
|
+
return G = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
21
|
+
return typeof e;
|
|
22
|
+
} : function(e) {
|
|
23
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
24
|
+
}, G(r);
|
|
25
|
+
}
|
|
26
|
+
function gt(r, e) {
|
|
27
|
+
if (G(r) != "object" || !r)
|
|
28
|
+
return r;
|
|
29
|
+
var t = r[Symbol.toPrimitive];
|
|
30
|
+
if (t !== void 0) {
|
|
31
|
+
var n = t.call(r, e || "default");
|
|
32
|
+
if (G(n) != "object")
|
|
33
|
+
return n;
|
|
34
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
35
|
+
}
|
|
36
|
+
return (e === "string" ? String : Number)(r);
|
|
37
|
+
}
|
|
38
|
+
function pt(r) {
|
|
39
|
+
var e = gt(r, "string");
|
|
40
|
+
return G(e) == "symbol" ? e : String(e);
|
|
41
|
+
}
|
|
42
|
+
function mt() {
|
|
43
|
+
if (console && console.warn) {
|
|
44
|
+
for (var r = arguments.length, e = new Array(r), t = 0; t < r; t++)
|
|
45
|
+
e[t] = arguments[t];
|
|
46
|
+
typeof e[0] == "string" && (e[0] = `react-i18next:: ${e[0]}`), console.warn(...e);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const we = {};
|
|
50
|
+
function ge() {
|
|
51
|
+
for (var r = arguments.length, e = new Array(r), t = 0; t < r; t++)
|
|
52
|
+
e[t] = arguments[t];
|
|
53
|
+
typeof e[0] == "string" && we[e[0]] || (typeof e[0] == "string" && (we[e[0]] = /* @__PURE__ */ new Date()), mt(...e));
|
|
54
|
+
}
|
|
55
|
+
const ze = (r, e) => () => {
|
|
56
|
+
if (r.isInitialized)
|
|
57
|
+
e();
|
|
58
|
+
else {
|
|
59
|
+
const t = () => {
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
r.off("initialized", t);
|
|
62
|
+
}, 0), e();
|
|
63
|
+
};
|
|
64
|
+
r.on("initialized", t);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
function xe(r, e, t) {
|
|
68
|
+
r.loadNamespaces(e, ze(r, t));
|
|
69
|
+
}
|
|
70
|
+
function Se(r, e, t, n) {
|
|
71
|
+
typeof t == "string" && (t = [t]), t.forEach((i) => {
|
|
72
|
+
r.options.ns.indexOf(i) < 0 && r.options.ns.push(i);
|
|
73
|
+
}), r.loadLanguages(e, ze(r, n));
|
|
74
|
+
}
|
|
75
|
+
function yt(r, e) {
|
|
76
|
+
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
77
|
+
const n = e.languages[0], i = e.options ? e.options.fallbackLng : !1, s = e.languages[e.languages.length - 1];
|
|
78
|
+
if (n.toLowerCase() === "cimode")
|
|
79
|
+
return !0;
|
|
80
|
+
const o = (a, u) => {
|
|
81
|
+
const l = e.services.backendConnector.state[`${a}|${u}`];
|
|
82
|
+
return l === -1 || l === 2;
|
|
83
|
+
};
|
|
84
|
+
return t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !o(e.isLanguageChangingTo, r) ? !1 : !!(e.hasResourceBundle(n, r) || !e.services.backendConnector.backend || e.options.resources && !e.options.partialBundledLanguages || o(n, r) && (!i || o(s, r)));
|
|
85
|
+
}
|
|
86
|
+
function bt(r, e) {
|
|
87
|
+
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
88
|
+
return !e.languages || !e.languages.length ? (ge("i18n.languages were undefined or empty", e.languages), !0) : e.options.ignoreJSONStructure !== void 0 ? e.hasLoadedNamespace(r, {
|
|
89
|
+
lng: t.lng,
|
|
90
|
+
precheck: (i, s) => {
|
|
91
|
+
if (t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && i.services.backendConnector.backend && i.isLanguageChangingTo && !s(i.isLanguageChangingTo, r))
|
|
92
|
+
return !1;
|
|
93
|
+
}
|
|
94
|
+
}) : yt(r, e, t);
|
|
95
|
+
}
|
|
96
|
+
const vt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, wt = {
|
|
97
|
+
"&": "&",
|
|
98
|
+
"&": "&",
|
|
99
|
+
"<": "<",
|
|
100
|
+
"<": "<",
|
|
101
|
+
">": ">",
|
|
102
|
+
">": ">",
|
|
103
|
+
"'": "'",
|
|
104
|
+
"'": "'",
|
|
105
|
+
""": '"',
|
|
106
|
+
""": '"',
|
|
107
|
+
" ": " ",
|
|
108
|
+
" ": " ",
|
|
109
|
+
"©": "©",
|
|
110
|
+
"©": "©",
|
|
111
|
+
"®": "®",
|
|
112
|
+
"®": "®",
|
|
113
|
+
"…": "…",
|
|
114
|
+
"…": "…",
|
|
115
|
+
"/": "/",
|
|
116
|
+
"/": "/"
|
|
117
|
+
}, xt = (r) => wt[r], St = (r) => r.replace(vt, xt);
|
|
118
|
+
let pe = {
|
|
119
|
+
bindI18n: "languageChanged",
|
|
120
|
+
bindI18nStore: "",
|
|
121
|
+
transEmptyNodeValue: "",
|
|
122
|
+
transSupportBasicHtmlNodes: !0,
|
|
123
|
+
transWrapTextNodes: "",
|
|
124
|
+
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
125
|
+
useSuspense: !0,
|
|
126
|
+
unescape: St
|
|
127
|
+
};
|
|
128
|
+
function Ot() {
|
|
129
|
+
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
130
|
+
pe = {
|
|
131
|
+
...pe,
|
|
132
|
+
...r
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function Pt() {
|
|
136
|
+
return pe;
|
|
137
|
+
}
|
|
138
|
+
let Je;
|
|
139
|
+
function Lt(r) {
|
|
140
|
+
Je = r;
|
|
141
|
+
}
|
|
142
|
+
function kt() {
|
|
143
|
+
return Je;
|
|
144
|
+
}
|
|
145
|
+
const Ct = {
|
|
146
|
+
type: "3rdParty",
|
|
147
|
+
init(r) {
|
|
148
|
+
Ot(r.options.react), Lt(r);
|
|
149
|
+
}
|
|
150
|
+
}, Xe = $.createContext();
|
|
151
|
+
class Et {
|
|
152
|
+
constructor() {
|
|
153
|
+
this.usedNamespaces = {};
|
|
154
|
+
}
|
|
155
|
+
addUsedNamespaces(e) {
|
|
156
|
+
e.forEach((t) => {
|
|
157
|
+
this.usedNamespaces[t] || (this.usedNamespaces[t] = !0);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
getUsedNamespaces() {
|
|
161
|
+
return Object.keys(this.usedNamespaces);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const Rt = (r, e) => {
|
|
165
|
+
const t = $.useRef();
|
|
166
|
+
return $.useEffect(() => {
|
|
167
|
+
t.current = e ? t.current : r;
|
|
168
|
+
}, [r, e]), t.current;
|
|
169
|
+
};
|
|
170
|
+
function We(r, e, t, n) {
|
|
171
|
+
return r.getFixedT(e, t, n);
|
|
172
|
+
}
|
|
173
|
+
function Nt(r, e, t, n) {
|
|
174
|
+
return $.useCallback(We(r, e, t, n), [r, e, t, n]);
|
|
175
|
+
}
|
|
176
|
+
function jt(r) {
|
|
177
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
178
|
+
const {
|
|
179
|
+
i18n: t
|
|
180
|
+
} = e, {
|
|
181
|
+
i18n: n,
|
|
182
|
+
defaultNS: i
|
|
183
|
+
} = $.useContext(Xe) || {}, s = t || n || kt();
|
|
184
|
+
if (s && !s.reportNamespaces && (s.reportNamespaces = new Et()), !s) {
|
|
185
|
+
ge("You will need to pass in an i18next instance by using initReactI18next");
|
|
186
|
+
const x = (C, P) => typeof P == "string" ? P : P && typeof P == "object" && typeof P.defaultValue == "string" ? P.defaultValue : Array.isArray(C) ? C[C.length - 1] : C, k = [x, {}, !1];
|
|
187
|
+
return k.t = x, k.i18n = {}, k.ready = !1, k;
|
|
188
|
+
}
|
|
189
|
+
s.options.react && s.options.react.wait !== void 0 && ge("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
190
|
+
const o = {
|
|
191
|
+
...Pt(),
|
|
192
|
+
...s.options.react,
|
|
193
|
+
...e
|
|
194
|
+
}, {
|
|
195
|
+
useSuspense: a,
|
|
196
|
+
keyPrefix: u
|
|
197
|
+
} = o;
|
|
198
|
+
let l = r || i || s.options && s.options.defaultNS;
|
|
199
|
+
l = typeof l == "string" ? [l] : l || ["translation"], s.reportNamespaces.addUsedNamespaces && s.reportNamespaces.addUsedNamespaces(l);
|
|
200
|
+
const f = (s.isInitialized || s.initializedStoreOnce) && l.every((x) => bt(x, s, o)), h = Nt(s, e.lng || null, o.nsMode === "fallback" ? l : l[0], u), c = () => h, p = () => We(s, e.lng || null, o.nsMode === "fallback" ? l : l[0], u), [y, m] = $.useState(c);
|
|
201
|
+
let w = l.join();
|
|
202
|
+
e.lng && (w = `${e.lng}${w}`);
|
|
203
|
+
const E = Rt(w), L = $.useRef(!0);
|
|
204
|
+
$.useEffect(() => {
|
|
205
|
+
const {
|
|
206
|
+
bindI18n: x,
|
|
207
|
+
bindI18nStore: k
|
|
208
|
+
} = o;
|
|
209
|
+
L.current = !0, !f && !a && (e.lng ? Se(s, e.lng, l, () => {
|
|
210
|
+
L.current && m(p);
|
|
211
|
+
}) : xe(s, l, () => {
|
|
212
|
+
L.current && m(p);
|
|
213
|
+
})), f && E && E !== w && L.current && m(p);
|
|
214
|
+
function C() {
|
|
215
|
+
L.current && m(p);
|
|
216
|
+
}
|
|
217
|
+
return x && s && s.on(x, C), k && s && s.store.on(k, C), () => {
|
|
218
|
+
L.current = !1, x && s && x.split(" ").forEach((P) => s.off(P, C)), k && s && k.split(" ").forEach((P) => s.store.off(P, C));
|
|
219
|
+
};
|
|
220
|
+
}, [s, w]), $.useEffect(() => {
|
|
221
|
+
L.current && f && m(c);
|
|
222
|
+
}, [s, u, f]);
|
|
223
|
+
const N = [y, s, f];
|
|
224
|
+
if (N.t = y, N.i18n = s, N.ready = f, f || !f && !a)
|
|
225
|
+
return N;
|
|
226
|
+
throw new Promise((x) => {
|
|
227
|
+
e.lng ? Se(s, e.lng, l, () => x()) : xe(s, l, () => x());
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
function Tt(r) {
|
|
231
|
+
let {
|
|
232
|
+
i18n: e,
|
|
233
|
+
defaultNS: t,
|
|
234
|
+
children: n
|
|
235
|
+
} = r;
|
|
236
|
+
const i = $.useMemo(() => ({
|
|
237
|
+
i18n: e,
|
|
238
|
+
defaultNS: t
|
|
239
|
+
}), [e, t]);
|
|
240
|
+
return $.createElement(Xe.Provider, {
|
|
241
|
+
value: i
|
|
242
|
+
}, n);
|
|
243
|
+
}
|
|
244
|
+
const At = {
|
|
245
|
+
type: "logger",
|
|
246
|
+
log(r) {
|
|
247
|
+
this.output("log", r);
|
|
248
|
+
},
|
|
249
|
+
warn(r) {
|
|
250
|
+
this.output("warn", r);
|
|
251
|
+
},
|
|
252
|
+
error(r) {
|
|
253
|
+
this.output("error", r);
|
|
254
|
+
},
|
|
255
|
+
output(r, e) {
|
|
256
|
+
console && console[r] && console[r].apply(console, e);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
class se {
|
|
260
|
+
constructor(e) {
|
|
261
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
262
|
+
this.init(e, t);
|
|
263
|
+
}
|
|
264
|
+
init(e) {
|
|
265
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
266
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || At, this.options = t, this.debug = t.debug;
|
|
267
|
+
}
|
|
268
|
+
log() {
|
|
269
|
+
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
270
|
+
t[n] = arguments[n];
|
|
271
|
+
return this.forward(t, "log", "", !0);
|
|
272
|
+
}
|
|
273
|
+
warn() {
|
|
274
|
+
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
275
|
+
t[n] = arguments[n];
|
|
276
|
+
return this.forward(t, "warn", "", !0);
|
|
277
|
+
}
|
|
278
|
+
error() {
|
|
279
|
+
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
280
|
+
t[n] = arguments[n];
|
|
281
|
+
return this.forward(t, "error", "");
|
|
282
|
+
}
|
|
283
|
+
deprecate() {
|
|
284
|
+
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
285
|
+
t[n] = arguments[n];
|
|
286
|
+
return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
|
|
287
|
+
}
|
|
288
|
+
forward(e, t, n, i) {
|
|
289
|
+
return i && !this.debug ? null : (typeof e[0] == "string" && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
290
|
+
}
|
|
291
|
+
create(e) {
|
|
292
|
+
return new se(this.logger, {
|
|
293
|
+
prefix: `${this.prefix}:${e}:`,
|
|
294
|
+
...this.options
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
clone(e) {
|
|
298
|
+
return e = e || this.options, e.prefix = e.prefix || this.prefix, new se(this.logger, e);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
var D = new se();
|
|
302
|
+
class fe {
|
|
303
|
+
constructor() {
|
|
304
|
+
this.observers = {};
|
|
305
|
+
}
|
|
306
|
+
on(e, t) {
|
|
307
|
+
return e.split(" ").forEach((n) => {
|
|
308
|
+
this.observers[n] || (this.observers[n] = /* @__PURE__ */ new Map());
|
|
309
|
+
const i = this.observers[n].get(t) || 0;
|
|
310
|
+
this.observers[n].set(t, i + 1);
|
|
311
|
+
}), this;
|
|
312
|
+
}
|
|
313
|
+
off(e, t) {
|
|
314
|
+
if (this.observers[e]) {
|
|
315
|
+
if (!t) {
|
|
316
|
+
delete this.observers[e];
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
this.observers[e].delete(t);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
emit(e) {
|
|
323
|
+
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
|
|
324
|
+
n[i - 1] = arguments[i];
|
|
325
|
+
this.observers[e] && Array.from(this.observers[e].entries()).forEach((o) => {
|
|
326
|
+
let [a, u] = o;
|
|
327
|
+
for (let l = 0; l < u; l++)
|
|
328
|
+
a(...n);
|
|
329
|
+
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((o) => {
|
|
330
|
+
let [a, u] = o;
|
|
331
|
+
for (let l = 0; l < u; l++)
|
|
332
|
+
a.apply(a, [e, ...n]);
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
function K() {
|
|
337
|
+
let r, e;
|
|
338
|
+
const t = new Promise((n, i) => {
|
|
339
|
+
r = n, e = i;
|
|
340
|
+
});
|
|
341
|
+
return t.resolve = r, t.reject = e, t;
|
|
342
|
+
}
|
|
343
|
+
function Oe(r) {
|
|
344
|
+
return r == null ? "" : "" + r;
|
|
345
|
+
}
|
|
346
|
+
function $t(r, e, t) {
|
|
347
|
+
r.forEach((n) => {
|
|
348
|
+
e[n] && (t[n] = e[n]);
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
const It = /###/g;
|
|
352
|
+
function W(r, e, t) {
|
|
353
|
+
function n(a) {
|
|
354
|
+
return a && a.indexOf("###") > -1 ? a.replace(It, ".") : a;
|
|
355
|
+
}
|
|
356
|
+
function i() {
|
|
357
|
+
return !r || typeof r == "string";
|
|
358
|
+
}
|
|
359
|
+
const s = typeof e != "string" ? e : e.split(".");
|
|
360
|
+
let o = 0;
|
|
361
|
+
for (; o < s.length - 1; ) {
|
|
362
|
+
if (i())
|
|
363
|
+
return {};
|
|
364
|
+
const a = n(s[o]);
|
|
365
|
+
!r[a] && t && (r[a] = new t()), Object.prototype.hasOwnProperty.call(r, a) ? r = r[a] : r = {}, ++o;
|
|
366
|
+
}
|
|
367
|
+
return i() ? {} : {
|
|
368
|
+
obj: r,
|
|
369
|
+
k: n(s[o])
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
function Pe(r, e, t) {
|
|
373
|
+
const {
|
|
374
|
+
obj: n,
|
|
375
|
+
k: i
|
|
376
|
+
} = W(r, e, Object);
|
|
377
|
+
if (n !== void 0 || e.length === 1) {
|
|
378
|
+
n[i] = t;
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
let s = e[e.length - 1], o = e.slice(0, e.length - 1), a = W(r, o, Object);
|
|
382
|
+
for (; a.obj === void 0 && o.length; )
|
|
383
|
+
s = `${o[o.length - 1]}.${s}`, o = o.slice(0, o.length - 1), a = W(r, o, Object), a && a.obj && typeof a.obj[`${a.k}.${s}`] < "u" && (a.obj = void 0);
|
|
384
|
+
a.obj[`${a.k}.${s}`] = t;
|
|
385
|
+
}
|
|
386
|
+
function Dt(r, e, t, n) {
|
|
387
|
+
const {
|
|
388
|
+
obj: i,
|
|
389
|
+
k: s
|
|
390
|
+
} = W(r, e, Object);
|
|
391
|
+
i[s] = i[s] || [], n && (i[s] = i[s].concat(t)), n || i[s].push(t);
|
|
392
|
+
}
|
|
393
|
+
function oe(r, e) {
|
|
394
|
+
const {
|
|
395
|
+
obj: t,
|
|
396
|
+
k: n
|
|
397
|
+
} = W(r, e);
|
|
398
|
+
if (t)
|
|
399
|
+
return t[n];
|
|
400
|
+
}
|
|
401
|
+
function Ft(r, e, t) {
|
|
402
|
+
const n = oe(r, t);
|
|
403
|
+
return n !== void 0 ? n : oe(e, t);
|
|
404
|
+
}
|
|
405
|
+
function Ge(r, e, t) {
|
|
406
|
+
for (const n in e)
|
|
407
|
+
n !== "__proto__" && n !== "constructor" && (n in r ? typeof r[n] == "string" || r[n] instanceof String || typeof e[n] == "string" || e[n] instanceof String ? t && (r[n] = e[n]) : Ge(r[n], e[n], t) : r[n] = e[n]);
|
|
408
|
+
return r;
|
|
409
|
+
}
|
|
410
|
+
function q(r) {
|
|
411
|
+
return r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
412
|
+
}
|
|
413
|
+
var Ut = {
|
|
414
|
+
"&": "&",
|
|
415
|
+
"<": "<",
|
|
416
|
+
">": ">",
|
|
417
|
+
'"': """,
|
|
418
|
+
"'": "'",
|
|
419
|
+
"/": "/"
|
|
420
|
+
};
|
|
421
|
+
function _t(r) {
|
|
422
|
+
return typeof r == "string" ? r.replace(/[&<>"'\/]/g, (e) => Ut[e]) : r;
|
|
423
|
+
}
|
|
424
|
+
class Bt {
|
|
425
|
+
constructor(e) {
|
|
426
|
+
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
427
|
+
}
|
|
428
|
+
getRegExp(e) {
|
|
429
|
+
const t = this.regExpMap.get(e);
|
|
430
|
+
if (t !== void 0)
|
|
431
|
+
return t;
|
|
432
|
+
const n = new RegExp(e);
|
|
433
|
+
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
const Mt = [" ", ",", "?", "!", ";"], Ht = new Bt(20);
|
|
437
|
+
function qt(r, e, t) {
|
|
438
|
+
e = e || "", t = t || "";
|
|
439
|
+
const n = Mt.filter((o) => e.indexOf(o) < 0 && t.indexOf(o) < 0);
|
|
440
|
+
if (n.length === 0)
|
|
441
|
+
return !0;
|
|
442
|
+
const i = Ht.getRegExp(`(${n.map((o) => o === "?" ? "\\?" : o).join("|")})`);
|
|
443
|
+
let s = !i.test(r);
|
|
444
|
+
if (!s) {
|
|
445
|
+
const o = r.indexOf(t);
|
|
446
|
+
o > 0 && !i.test(r.substring(0, o)) && (s = !0);
|
|
447
|
+
}
|
|
448
|
+
return s;
|
|
449
|
+
}
|
|
450
|
+
function me(r, e) {
|
|
451
|
+
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
|
|
452
|
+
if (!r)
|
|
453
|
+
return;
|
|
454
|
+
if (r[e])
|
|
455
|
+
return r[e];
|
|
456
|
+
const n = e.split(t);
|
|
457
|
+
let i = r;
|
|
458
|
+
for (let s = 0; s < n.length; ) {
|
|
459
|
+
if (!i || typeof i != "object")
|
|
460
|
+
return;
|
|
461
|
+
let o, a = "";
|
|
462
|
+
for (let u = s; u < n.length; ++u)
|
|
463
|
+
if (u !== s && (a += t), a += n[u], o = i[a], o !== void 0) {
|
|
464
|
+
if (["string", "number", "boolean"].indexOf(typeof o) > -1 && u < n.length - 1)
|
|
465
|
+
continue;
|
|
466
|
+
s += u - s + 1;
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
i = o;
|
|
470
|
+
}
|
|
471
|
+
return i;
|
|
472
|
+
}
|
|
473
|
+
function ae(r) {
|
|
474
|
+
return r && r.indexOf("_") > 0 ? r.replace("_", "-") : r;
|
|
475
|
+
}
|
|
476
|
+
class Le extends fe {
|
|
477
|
+
constructor(e) {
|
|
478
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
479
|
+
ns: ["translation"],
|
|
480
|
+
defaultNS: "translation"
|
|
481
|
+
};
|
|
482
|
+
super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
|
|
483
|
+
}
|
|
484
|
+
addNamespaces(e) {
|
|
485
|
+
this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
|
|
486
|
+
}
|
|
487
|
+
removeNamespaces(e) {
|
|
488
|
+
const t = this.options.ns.indexOf(e);
|
|
489
|
+
t > -1 && this.options.ns.splice(t, 1);
|
|
490
|
+
}
|
|
491
|
+
getResource(e, t, n) {
|
|
492
|
+
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
493
|
+
const s = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, o = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
494
|
+
let a;
|
|
495
|
+
e.indexOf(".") > -1 ? a = e.split(".") : (a = [e, t], n && (Array.isArray(n) ? a.push(...n) : typeof n == "string" && s ? a.push(...n.split(s)) : a.push(n)));
|
|
496
|
+
const u = oe(this.data, a);
|
|
497
|
+
return !u && !t && !n && e.indexOf(".") > -1 && (e = a[0], t = a[1], n = a.slice(2).join(".")), u || !o || typeof n != "string" ? u : me(this.data && this.data[e] && this.data[e][t], n, s);
|
|
498
|
+
}
|
|
499
|
+
addResource(e, t, n, i) {
|
|
500
|
+
let s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
501
|
+
silent: !1
|
|
502
|
+
};
|
|
503
|
+
const o = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator;
|
|
504
|
+
let a = [e, t];
|
|
505
|
+
n && (a = a.concat(o ? n.split(o) : n)), e.indexOf(".") > -1 && (a = e.split("."), i = t, t = a[1]), this.addNamespaces(t), Pe(this.data, a, i), s.silent || this.emit("added", e, t, n, i);
|
|
506
|
+
}
|
|
507
|
+
addResources(e, t, n) {
|
|
508
|
+
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
|
|
509
|
+
silent: !1
|
|
510
|
+
};
|
|
511
|
+
for (const s in n)
|
|
512
|
+
(typeof n[s] == "string" || Object.prototype.toString.apply(n[s]) === "[object Array]") && this.addResource(e, t, s, n[s], {
|
|
513
|
+
silent: !0
|
|
514
|
+
});
|
|
515
|
+
i.silent || this.emit("added", e, t, n);
|
|
516
|
+
}
|
|
517
|
+
addResourceBundle(e, t, n, i, s) {
|
|
518
|
+
let o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
|
|
519
|
+
silent: !1,
|
|
520
|
+
skipCopy: !1
|
|
521
|
+
}, a = [e, t];
|
|
522
|
+
e.indexOf(".") > -1 && (a = e.split("."), i = n, n = t, t = a[1]), this.addNamespaces(t);
|
|
523
|
+
let u = oe(this.data, a) || {};
|
|
524
|
+
o.skipCopy || (n = JSON.parse(JSON.stringify(n))), i ? Ge(u, n, s) : u = {
|
|
525
|
+
...u,
|
|
526
|
+
...n
|
|
527
|
+
}, Pe(this.data, a, u), o.silent || this.emit("added", e, t, n);
|
|
528
|
+
}
|
|
529
|
+
removeResourceBundle(e, t) {
|
|
530
|
+
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
531
|
+
}
|
|
532
|
+
hasResourceBundle(e, t) {
|
|
533
|
+
return this.getResource(e, t) !== void 0;
|
|
534
|
+
}
|
|
535
|
+
getResourceBundle(e, t) {
|
|
536
|
+
return t || (t = this.options.defaultNS), this.options.compatibilityAPI === "v1" ? {
|
|
537
|
+
...this.getResource(e, t)
|
|
538
|
+
} : this.getResource(e, t);
|
|
539
|
+
}
|
|
540
|
+
getDataByLanguage(e) {
|
|
541
|
+
return this.data[e];
|
|
542
|
+
}
|
|
543
|
+
hasLanguageSomeTranslations(e) {
|
|
544
|
+
const t = this.getDataByLanguage(e);
|
|
545
|
+
return !!(t && Object.keys(t) || []).find((i) => t[i] && Object.keys(t[i]).length > 0);
|
|
546
|
+
}
|
|
547
|
+
toJSON() {
|
|
548
|
+
return this.data;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
var Qe = {
|
|
552
|
+
processors: {},
|
|
553
|
+
addPostProcessor(r) {
|
|
554
|
+
this.processors[r.name] = r;
|
|
555
|
+
},
|
|
556
|
+
handle(r, e, t, n, i) {
|
|
557
|
+
return r.forEach((s) => {
|
|
558
|
+
this.processors[s] && (e = this.processors[s].process(e, t, n, i));
|
|
559
|
+
}), e;
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
const ke = {};
|
|
563
|
+
class ue extends fe {
|
|
564
|
+
constructor(e) {
|
|
565
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
566
|
+
super(), $t(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = D.create("translator");
|
|
567
|
+
}
|
|
568
|
+
changeLanguage(e) {
|
|
569
|
+
e && (this.language = e);
|
|
570
|
+
}
|
|
571
|
+
exists(e) {
|
|
572
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
573
|
+
interpolation: {}
|
|
574
|
+
};
|
|
575
|
+
if (e == null)
|
|
576
|
+
return !1;
|
|
577
|
+
const n = this.resolve(e, t);
|
|
578
|
+
return n && n.res !== void 0;
|
|
579
|
+
}
|
|
580
|
+
extractFromKey(e, t) {
|
|
581
|
+
let n = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
|
|
582
|
+
n === void 0 && (n = ":");
|
|
583
|
+
const i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
584
|
+
let s = t.ns || this.options.defaultNS || [];
|
|
585
|
+
const o = n && e.indexOf(n) > -1, a = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !qt(e, n, i);
|
|
586
|
+
if (o && !a) {
|
|
587
|
+
const u = e.match(this.interpolator.nestingRegexp);
|
|
588
|
+
if (u && u.length > 0)
|
|
589
|
+
return {
|
|
590
|
+
key: e,
|
|
591
|
+
namespaces: s
|
|
592
|
+
};
|
|
593
|
+
const l = e.split(n);
|
|
594
|
+
(n !== i || n === i && this.options.ns.indexOf(l[0]) > -1) && (s = l.shift()), e = l.join(i);
|
|
595
|
+
}
|
|
596
|
+
return typeof s == "string" && (s = [s]), {
|
|
597
|
+
key: e,
|
|
598
|
+
namespaces: s
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
translate(e, t, n) {
|
|
602
|
+
if (typeof t != "object" && this.options.overloadTranslationOptionHandler && (t = this.options.overloadTranslationOptionHandler(arguments)), typeof t == "object" && (t = {
|
|
603
|
+
...t
|
|
604
|
+
}), t || (t = {}), e == null)
|
|
605
|
+
return "";
|
|
606
|
+
Array.isArray(e) || (e = [String(e)]);
|
|
607
|
+
const i = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, s = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
|
|
608
|
+
key: o,
|
|
609
|
+
namespaces: a
|
|
610
|
+
} = this.extractFromKey(e[e.length - 1], t), u = a[a.length - 1], l = t.lng || this.language, f = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
611
|
+
if (l && l.toLowerCase() === "cimode") {
|
|
612
|
+
if (f) {
|
|
613
|
+
const x = t.nsSeparator || this.options.nsSeparator;
|
|
614
|
+
return i ? {
|
|
615
|
+
res: `${u}${x}${o}`,
|
|
616
|
+
usedKey: o,
|
|
617
|
+
exactUsedKey: o,
|
|
618
|
+
usedLng: l,
|
|
619
|
+
usedNS: u,
|
|
620
|
+
usedParams: this.getUsedParamsDetails(t)
|
|
621
|
+
} : `${u}${x}${o}`;
|
|
622
|
+
}
|
|
623
|
+
return i ? {
|
|
624
|
+
res: o,
|
|
625
|
+
usedKey: o,
|
|
626
|
+
exactUsedKey: o,
|
|
627
|
+
usedLng: l,
|
|
628
|
+
usedNS: u,
|
|
629
|
+
usedParams: this.getUsedParamsDetails(t)
|
|
630
|
+
} : o;
|
|
631
|
+
}
|
|
632
|
+
const h = this.resolve(e, t);
|
|
633
|
+
let c = h && h.res;
|
|
634
|
+
const p = h && h.usedKey || o, y = h && h.exactUsedKey || o, m = Object.prototype.toString.apply(c), w = ["[object Number]", "[object Function]", "[object RegExp]"], E = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, L = !this.i18nFormat || this.i18nFormat.handleAsObject;
|
|
635
|
+
if (L && c && (typeof c != "string" && typeof c != "boolean" && typeof c != "number") && w.indexOf(m) < 0 && !(typeof E == "string" && m === "[object Array]")) {
|
|
636
|
+
if (!t.returnObjects && !this.options.returnObjects) {
|
|
637
|
+
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
638
|
+
const x = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, c, {
|
|
639
|
+
...t,
|
|
640
|
+
ns: a
|
|
641
|
+
}) : `key '${o} (${this.language})' returned an object instead of string.`;
|
|
642
|
+
return i ? (h.res = x, h.usedParams = this.getUsedParamsDetails(t), h) : x;
|
|
643
|
+
}
|
|
644
|
+
if (s) {
|
|
645
|
+
const x = m === "[object Array]", k = x ? [] : {}, C = x ? y : p;
|
|
646
|
+
for (const P in c)
|
|
647
|
+
if (Object.prototype.hasOwnProperty.call(c, P)) {
|
|
648
|
+
const H = `${C}${s}${P}`;
|
|
649
|
+
k[P] = this.translate(H, {
|
|
650
|
+
...t,
|
|
651
|
+
joinArrays: !1,
|
|
652
|
+
ns: a
|
|
653
|
+
}), k[P] === H && (k[P] = c[P]);
|
|
654
|
+
}
|
|
655
|
+
c = k;
|
|
656
|
+
}
|
|
657
|
+
} else if (L && typeof E == "string" && m === "[object Array]")
|
|
658
|
+
c = c.join(E), c && (c = this.extendTranslation(c, e, t, n));
|
|
659
|
+
else {
|
|
660
|
+
let x = !1, k = !1;
|
|
661
|
+
const C = t.count !== void 0 && typeof t.count != "string", P = ue.hasDefaultValue(t), H = C ? this.pluralResolver.getSuffix(l, t.count, t) : "", I = t.ordinal && C ? this.pluralResolver.getSuffix(l, t.count, {
|
|
662
|
+
ordinal: !1
|
|
663
|
+
}) : "", ee = C && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), _ = ee && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${H}`] || t[`defaultValue${I}`] || t.defaultValue;
|
|
664
|
+
!this.isValidLookup(c) && P && (x = !0, c = _), this.isValidLookup(c) || (k = !0, c = o);
|
|
665
|
+
const ce = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && k ? void 0 : c, F = P && _ !== c && this.options.updateMissing;
|
|
666
|
+
if (k || x || F) {
|
|
667
|
+
if (this.logger.log(F ? "updateKey" : "missingKey", l, u, o, F ? _ : c), s) {
|
|
668
|
+
const v = this.resolve(o, {
|
|
669
|
+
...t,
|
|
670
|
+
keySeparator: !1
|
|
671
|
+
});
|
|
672
|
+
v && v.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.");
|
|
673
|
+
}
|
|
674
|
+
let d = [];
|
|
675
|
+
const g = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
|
|
676
|
+
if (this.options.saveMissingTo === "fallback" && g && g[0])
|
|
677
|
+
for (let v = 0; v < g.length; v++)
|
|
678
|
+
d.push(g[v]);
|
|
679
|
+
else
|
|
680
|
+
this.options.saveMissingTo === "all" ? d = this.languageUtils.toResolveHierarchy(t.lng || this.language) : d.push(t.lng || this.language);
|
|
681
|
+
const b = (v, O, S) => {
|
|
682
|
+
const B = P && S !== c ? S : ce;
|
|
683
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(v, u, O, B, F, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(v, u, O, B, F, t), this.emit("missingKey", v, u, O, c);
|
|
684
|
+
};
|
|
685
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && C ? d.forEach((v) => {
|
|
686
|
+
const O = this.pluralResolver.getSuffixes(v, t);
|
|
687
|
+
ee && t[`defaultValue${this.options.pluralSeparator}zero`] && O.indexOf(`${this.options.pluralSeparator}zero`) < 0 && O.push(`${this.options.pluralSeparator}zero`), O.forEach((S) => {
|
|
688
|
+
b([v], o + S, t[`defaultValue${S}`] || _);
|
|
689
|
+
});
|
|
690
|
+
}) : b(d, o, _));
|
|
691
|
+
}
|
|
692
|
+
c = this.extendTranslation(c, e, t, h, n), k && c === o && this.options.appendNamespaceToMissingKey && (c = `${u}:${o}`), (k || x) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? c = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}:${o}` : o, x ? c : void 0) : c = this.options.parseMissingKeyHandler(c));
|
|
693
|
+
}
|
|
694
|
+
return i ? (h.res = c, h.usedParams = this.getUsedParamsDetails(t), h) : c;
|
|
695
|
+
}
|
|
696
|
+
extendTranslation(e, t, n, i, s) {
|
|
697
|
+
var o = this;
|
|
698
|
+
if (this.i18nFormat && this.i18nFormat.parse)
|
|
699
|
+
e = this.i18nFormat.parse(e, {
|
|
700
|
+
...this.options.interpolation.defaultVariables,
|
|
701
|
+
...n
|
|
702
|
+
}, n.lng || this.language || i.usedLng, i.usedNS, i.usedKey, {
|
|
703
|
+
resolved: i
|
|
704
|
+
});
|
|
705
|
+
else if (!n.skipInterpolation) {
|
|
706
|
+
n.interpolation && this.interpolator.init({
|
|
707
|
+
...n,
|
|
708
|
+
interpolation: {
|
|
709
|
+
...this.options.interpolation,
|
|
710
|
+
...n.interpolation
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
const l = typeof e == "string" && (n && n.interpolation && n.interpolation.skipOnVariables !== void 0 ? n.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
714
|
+
let f;
|
|
715
|
+
if (l) {
|
|
716
|
+
const c = e.match(this.interpolator.nestingRegexp);
|
|
717
|
+
f = c && c.length;
|
|
718
|
+
}
|
|
719
|
+
let h = n.replace && typeof n.replace != "string" ? n.replace : n;
|
|
720
|
+
if (this.options.interpolation.defaultVariables && (h = {
|
|
721
|
+
...this.options.interpolation.defaultVariables,
|
|
722
|
+
...h
|
|
723
|
+
}), e = this.interpolator.interpolate(e, h, n.lng || this.language, n), l) {
|
|
724
|
+
const c = e.match(this.interpolator.nestingRegexp), p = c && c.length;
|
|
725
|
+
f < p && (n.nest = !1);
|
|
726
|
+
}
|
|
727
|
+
!n.lng && this.options.compatibilityAPI !== "v1" && i && i.res && (n.lng = i.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, function() {
|
|
728
|
+
for (var c = arguments.length, p = new Array(c), y = 0; y < c; y++)
|
|
729
|
+
p[y] = arguments[y];
|
|
730
|
+
return s && s[0] === p[0] && !n.context ? (o.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`), null) : o.translate(...p, t);
|
|
731
|
+
}, n)), n.interpolation && this.interpolator.reset();
|
|
732
|
+
}
|
|
733
|
+
const a = n.postProcess || this.options.postProcess, u = typeof a == "string" ? [a] : a;
|
|
734
|
+
return e != null && u && u.length && n.applyPostProcessor !== !1 && (e = Qe.handle(u, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
735
|
+
i18nResolved: {
|
|
736
|
+
...i,
|
|
737
|
+
usedParams: this.getUsedParamsDetails(n)
|
|
738
|
+
},
|
|
739
|
+
...n
|
|
740
|
+
} : n, this)), e;
|
|
741
|
+
}
|
|
742
|
+
resolve(e) {
|
|
743
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n, i, s, o, a;
|
|
744
|
+
return typeof e == "string" && (e = [e]), e.forEach((u) => {
|
|
745
|
+
if (this.isValidLookup(n))
|
|
746
|
+
return;
|
|
747
|
+
const l = this.extractFromKey(u, t), f = l.key;
|
|
748
|
+
i = f;
|
|
749
|
+
let h = l.namespaces;
|
|
750
|
+
this.options.fallbackNS && (h = h.concat(this.options.fallbackNS));
|
|
751
|
+
const c = t.count !== void 0 && typeof t.count != "string", p = c && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), y = t.context !== void 0 && (typeof t.context == "string" || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
752
|
+
h.forEach((w) => {
|
|
753
|
+
this.isValidLookup(n) || (a = w, !ke[`${m[0]}-${w}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(a) && (ke[`${m[0]}-${w}`] = !0, this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${a}" 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((E) => {
|
|
754
|
+
if (this.isValidLookup(n))
|
|
755
|
+
return;
|
|
756
|
+
o = E;
|
|
757
|
+
const L = [f];
|
|
758
|
+
if (this.i18nFormat && this.i18nFormat.addLookupKeys)
|
|
759
|
+
this.i18nFormat.addLookupKeys(L, f, E, w, t);
|
|
760
|
+
else {
|
|
761
|
+
let x;
|
|
762
|
+
c && (x = this.pluralResolver.getSuffix(E, t.count, t));
|
|
763
|
+
const k = `${this.options.pluralSeparator}zero`, C = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
764
|
+
if (c && (L.push(f + x), t.ordinal && x.indexOf(C) === 0 && L.push(f + x.replace(C, this.options.pluralSeparator)), p && L.push(f + k)), y) {
|
|
765
|
+
const P = `${f}${this.options.contextSeparator}${t.context}`;
|
|
766
|
+
L.push(P), c && (L.push(P + x), t.ordinal && x.indexOf(C) === 0 && L.push(P + x.replace(C, this.options.pluralSeparator)), p && L.push(P + k));
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
let N;
|
|
770
|
+
for (; N = L.pop(); )
|
|
771
|
+
this.isValidLookup(n) || (s = N, n = this.getResource(E, w, N, t));
|
|
772
|
+
}));
|
|
773
|
+
});
|
|
774
|
+
}), {
|
|
775
|
+
res: n,
|
|
776
|
+
usedKey: i,
|
|
777
|
+
exactUsedKey: s,
|
|
778
|
+
usedLng: o,
|
|
779
|
+
usedNS: a
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
isValidLookup(e) {
|
|
783
|
+
return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
|
|
784
|
+
}
|
|
785
|
+
getResource(e, t, n) {
|
|
786
|
+
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
787
|
+
return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(e, t, n, i) : this.resourceStore.getResource(e, t, n, i);
|
|
788
|
+
}
|
|
789
|
+
getUsedParamsDetails() {
|
|
790
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
791
|
+
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], n = e.replace && typeof e.replace != "string";
|
|
792
|
+
let i = n ? e.replace : e;
|
|
793
|
+
if (n && typeof e.count < "u" && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
|
|
794
|
+
...this.options.interpolation.defaultVariables,
|
|
795
|
+
...i
|
|
796
|
+
}), !n) {
|
|
797
|
+
i = {
|
|
798
|
+
...i
|
|
799
|
+
};
|
|
800
|
+
for (const s of t)
|
|
801
|
+
delete i[s];
|
|
802
|
+
}
|
|
803
|
+
return i;
|
|
804
|
+
}
|
|
805
|
+
static hasDefaultValue(e) {
|
|
806
|
+
const t = "defaultValue";
|
|
807
|
+
for (const n in e)
|
|
808
|
+
if (Object.prototype.hasOwnProperty.call(e, n) && t === n.substring(0, t.length) && e[n] !== void 0)
|
|
809
|
+
return !0;
|
|
810
|
+
return !1;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
function de(r) {
|
|
814
|
+
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
815
|
+
}
|
|
816
|
+
class Ce {
|
|
817
|
+
constructor(e) {
|
|
818
|
+
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = D.create("languageUtils");
|
|
819
|
+
}
|
|
820
|
+
getScriptPartFromCode(e) {
|
|
821
|
+
if (e = ae(e), !e || e.indexOf("-") < 0)
|
|
822
|
+
return null;
|
|
823
|
+
const t = e.split("-");
|
|
824
|
+
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
825
|
+
}
|
|
826
|
+
getLanguagePartFromCode(e) {
|
|
827
|
+
if (e = ae(e), !e || e.indexOf("-") < 0)
|
|
828
|
+
return e;
|
|
829
|
+
const t = e.split("-");
|
|
830
|
+
return this.formatLanguageCode(t[0]);
|
|
831
|
+
}
|
|
832
|
+
formatLanguageCode(e) {
|
|
833
|
+
if (typeof e == "string" && e.indexOf("-") > -1) {
|
|
834
|
+
const t = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"];
|
|
835
|
+
let n = e.split("-");
|
|
836
|
+
return this.options.lowerCaseLng ? n = n.map((i) => i.toLowerCase()) : n.length === 2 ? (n[0] = n[0].toLowerCase(), n[1] = n[1].toUpperCase(), t.indexOf(n[1].toLowerCase()) > -1 && (n[1] = de(n[1].toLowerCase()))) : n.length === 3 && (n[0] = n[0].toLowerCase(), n[1].length === 2 && (n[1] = n[1].toUpperCase()), n[0] !== "sgn" && n[2].length === 2 && (n[2] = n[2].toUpperCase()), t.indexOf(n[1].toLowerCase()) > -1 && (n[1] = de(n[1].toLowerCase())), t.indexOf(n[2].toLowerCase()) > -1 && (n[2] = de(n[2].toLowerCase()))), n.join("-");
|
|
837
|
+
}
|
|
838
|
+
return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
|
|
839
|
+
}
|
|
840
|
+
isSupportedCode(e) {
|
|
841
|
+
return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
|
|
842
|
+
}
|
|
843
|
+
getBestMatchFromCodes(e) {
|
|
844
|
+
if (!e)
|
|
845
|
+
return null;
|
|
846
|
+
let t;
|
|
847
|
+
return e.forEach((n) => {
|
|
848
|
+
if (t)
|
|
849
|
+
return;
|
|
850
|
+
const i = this.formatLanguageCode(n);
|
|
851
|
+
(!this.options.supportedLngs || this.isSupportedCode(i)) && (t = i);
|
|
852
|
+
}), !t && this.options.supportedLngs && e.forEach((n) => {
|
|
853
|
+
if (t)
|
|
854
|
+
return;
|
|
855
|
+
const i = this.getLanguagePartFromCode(n);
|
|
856
|
+
if (this.isSupportedCode(i))
|
|
857
|
+
return t = i;
|
|
858
|
+
t = this.options.supportedLngs.find((s) => {
|
|
859
|
+
if (s === i)
|
|
860
|
+
return s;
|
|
861
|
+
if (!(s.indexOf("-") < 0 && i.indexOf("-") < 0) && (s.indexOf("-") > 0 && i.indexOf("-") < 0 && s.substring(0, s.indexOf("-")) === i || s.indexOf(i) === 0 && i.length > 1))
|
|
862
|
+
return s;
|
|
863
|
+
});
|
|
864
|
+
}), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
|
|
865
|
+
}
|
|
866
|
+
getFallbackCodes(e, t) {
|
|
867
|
+
if (!e)
|
|
868
|
+
return [];
|
|
869
|
+
if (typeof e == "function" && (e = e(t)), typeof e == "string" && (e = [e]), Object.prototype.toString.apply(e) === "[object Array]")
|
|
870
|
+
return e;
|
|
871
|
+
if (!t)
|
|
872
|
+
return e.default || [];
|
|
873
|
+
let n = e[t];
|
|
874
|
+
return n || (n = e[this.getScriptPartFromCode(t)]), n || (n = e[this.formatLanguageCode(t)]), n || (n = e[this.getLanguagePartFromCode(t)]), n || (n = e.default), n || [];
|
|
875
|
+
}
|
|
876
|
+
toResolveHierarchy(e, t) {
|
|
877
|
+
const n = this.getFallbackCodes(t || this.options.fallbackLng || [], e), i = [], s = (o) => {
|
|
878
|
+
o && (this.isSupportedCode(o) ? i.push(o) : this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`));
|
|
879
|
+
};
|
|
880
|
+
return typeof e == "string" && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && s(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && s(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && s(this.getLanguagePartFromCode(e))) : typeof e == "string" && s(this.formatLanguageCode(e)), n.forEach((o) => {
|
|
881
|
+
i.indexOf(o) < 0 && s(this.formatLanguageCode(o));
|
|
882
|
+
}), i;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
let Vt = [{
|
|
886
|
+
lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
|
|
887
|
+
nr: [1, 2],
|
|
888
|
+
fc: 1
|
|
889
|
+
}, {
|
|
890
|
+
lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"],
|
|
891
|
+
nr: [1, 2],
|
|
892
|
+
fc: 2
|
|
893
|
+
}, {
|
|
894
|
+
lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"],
|
|
895
|
+
nr: [1],
|
|
896
|
+
fc: 3
|
|
897
|
+
}, {
|
|
898
|
+
lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
|
|
899
|
+
nr: [1, 2, 5],
|
|
900
|
+
fc: 4
|
|
901
|
+
}, {
|
|
902
|
+
lngs: ["ar"],
|
|
903
|
+
nr: [0, 1, 2, 3, 11, 100],
|
|
904
|
+
fc: 5
|
|
905
|
+
}, {
|
|
906
|
+
lngs: ["cs", "sk"],
|
|
907
|
+
nr: [1, 2, 5],
|
|
908
|
+
fc: 6
|
|
909
|
+
}, {
|
|
910
|
+
lngs: ["csb", "pl"],
|
|
911
|
+
nr: [1, 2, 5],
|
|
912
|
+
fc: 7
|
|
913
|
+
}, {
|
|
914
|
+
lngs: ["cy"],
|
|
915
|
+
nr: [1, 2, 3, 8],
|
|
916
|
+
fc: 8
|
|
917
|
+
}, {
|
|
918
|
+
lngs: ["fr"],
|
|
919
|
+
nr: [1, 2],
|
|
920
|
+
fc: 9
|
|
921
|
+
}, {
|
|
922
|
+
lngs: ["ga"],
|
|
923
|
+
nr: [1, 2, 3, 7, 11],
|
|
924
|
+
fc: 10
|
|
925
|
+
}, {
|
|
926
|
+
lngs: ["gd"],
|
|
927
|
+
nr: [1, 2, 3, 20],
|
|
928
|
+
fc: 11
|
|
929
|
+
}, {
|
|
930
|
+
lngs: ["is"],
|
|
931
|
+
nr: [1, 2],
|
|
932
|
+
fc: 12
|
|
933
|
+
}, {
|
|
934
|
+
lngs: ["jv"],
|
|
935
|
+
nr: [0, 1],
|
|
936
|
+
fc: 13
|
|
937
|
+
}, {
|
|
938
|
+
lngs: ["kw"],
|
|
939
|
+
nr: [1, 2, 3, 4],
|
|
940
|
+
fc: 14
|
|
941
|
+
}, {
|
|
942
|
+
lngs: ["lt"],
|
|
943
|
+
nr: [1, 2, 10],
|
|
944
|
+
fc: 15
|
|
945
|
+
}, {
|
|
946
|
+
lngs: ["lv"],
|
|
947
|
+
nr: [1, 2, 0],
|
|
948
|
+
fc: 16
|
|
949
|
+
}, {
|
|
950
|
+
lngs: ["mk"],
|
|
951
|
+
nr: [1, 2],
|
|
952
|
+
fc: 17
|
|
953
|
+
}, {
|
|
954
|
+
lngs: ["mnk"],
|
|
955
|
+
nr: [0, 1, 2],
|
|
956
|
+
fc: 18
|
|
957
|
+
}, {
|
|
958
|
+
lngs: ["mt"],
|
|
959
|
+
nr: [1, 2, 11, 20],
|
|
960
|
+
fc: 19
|
|
961
|
+
}, {
|
|
962
|
+
lngs: ["or"],
|
|
963
|
+
nr: [2, 1],
|
|
964
|
+
fc: 2
|
|
965
|
+
}, {
|
|
966
|
+
lngs: ["ro"],
|
|
967
|
+
nr: [1, 2, 20],
|
|
968
|
+
fc: 20
|
|
969
|
+
}, {
|
|
970
|
+
lngs: ["sl"],
|
|
971
|
+
nr: [5, 1, 2, 3],
|
|
972
|
+
fc: 21
|
|
973
|
+
}, {
|
|
974
|
+
lngs: ["he", "iw"],
|
|
975
|
+
nr: [1, 2, 20, 21],
|
|
976
|
+
fc: 22
|
|
977
|
+
}], Kt = {
|
|
978
|
+
1: function(r) {
|
|
979
|
+
return +(r > 1);
|
|
980
|
+
},
|
|
981
|
+
2: function(r) {
|
|
982
|
+
return +(r != 1);
|
|
983
|
+
},
|
|
984
|
+
3: function(r) {
|
|
985
|
+
return 0;
|
|
986
|
+
},
|
|
987
|
+
4: function(r) {
|
|
988
|
+
return r % 10 == 1 && r % 100 != 11 ? 0 : r % 10 >= 2 && r % 10 <= 4 && (r % 100 < 10 || r % 100 >= 20) ? 1 : 2;
|
|
989
|
+
},
|
|
990
|
+
5: function(r) {
|
|
991
|
+
return r == 0 ? 0 : r == 1 ? 1 : r == 2 ? 2 : r % 100 >= 3 && r % 100 <= 10 ? 3 : r % 100 >= 11 ? 4 : 5;
|
|
992
|
+
},
|
|
993
|
+
6: function(r) {
|
|
994
|
+
return r == 1 ? 0 : r >= 2 && r <= 4 ? 1 : 2;
|
|
995
|
+
},
|
|
996
|
+
7: function(r) {
|
|
997
|
+
return r == 1 ? 0 : r % 10 >= 2 && r % 10 <= 4 && (r % 100 < 10 || r % 100 >= 20) ? 1 : 2;
|
|
998
|
+
},
|
|
999
|
+
8: function(r) {
|
|
1000
|
+
return r == 1 ? 0 : r == 2 ? 1 : r != 8 && r != 11 ? 2 : 3;
|
|
1001
|
+
},
|
|
1002
|
+
9: function(r) {
|
|
1003
|
+
return +(r >= 2);
|
|
1004
|
+
},
|
|
1005
|
+
10: function(r) {
|
|
1006
|
+
return r == 1 ? 0 : r == 2 ? 1 : r < 7 ? 2 : r < 11 ? 3 : 4;
|
|
1007
|
+
},
|
|
1008
|
+
11: function(r) {
|
|
1009
|
+
return r == 1 || r == 11 ? 0 : r == 2 || r == 12 ? 1 : r > 2 && r < 20 ? 2 : 3;
|
|
1010
|
+
},
|
|
1011
|
+
12: function(r) {
|
|
1012
|
+
return +(r % 10 != 1 || r % 100 == 11);
|
|
1013
|
+
},
|
|
1014
|
+
13: function(r) {
|
|
1015
|
+
return +(r !== 0);
|
|
1016
|
+
},
|
|
1017
|
+
14: function(r) {
|
|
1018
|
+
return r == 1 ? 0 : r == 2 ? 1 : r == 3 ? 2 : 3;
|
|
1019
|
+
},
|
|
1020
|
+
15: function(r) {
|
|
1021
|
+
return r % 10 == 1 && r % 100 != 11 ? 0 : r % 10 >= 2 && (r % 100 < 10 || r % 100 >= 20) ? 1 : 2;
|
|
1022
|
+
},
|
|
1023
|
+
16: function(r) {
|
|
1024
|
+
return r % 10 == 1 && r % 100 != 11 ? 0 : r !== 0 ? 1 : 2;
|
|
1025
|
+
},
|
|
1026
|
+
17: function(r) {
|
|
1027
|
+
return r == 1 || r % 10 == 1 && r % 100 != 11 ? 0 : 1;
|
|
1028
|
+
},
|
|
1029
|
+
18: function(r) {
|
|
1030
|
+
return r == 0 ? 0 : r == 1 ? 1 : 2;
|
|
1031
|
+
},
|
|
1032
|
+
19: function(r) {
|
|
1033
|
+
return r == 1 ? 0 : r == 0 || r % 100 > 1 && r % 100 < 11 ? 1 : r % 100 > 10 && r % 100 < 20 ? 2 : 3;
|
|
1034
|
+
},
|
|
1035
|
+
20: function(r) {
|
|
1036
|
+
return r == 1 ? 0 : r == 0 || r % 100 > 0 && r % 100 < 20 ? 1 : 2;
|
|
1037
|
+
},
|
|
1038
|
+
21: function(r) {
|
|
1039
|
+
return r % 100 == 1 ? 1 : r % 100 == 2 ? 2 : r % 100 == 3 || r % 100 == 4 ? 3 : 0;
|
|
1040
|
+
},
|
|
1041
|
+
22: function(r) {
|
|
1042
|
+
return r == 1 ? 0 : r == 2 ? 1 : (r < 0 || r > 10) && r % 10 == 0 ? 2 : 3;
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
const zt = ["v1", "v2", "v3"], Jt = ["v4"], Ee = {
|
|
1046
|
+
zero: 0,
|
|
1047
|
+
one: 1,
|
|
1048
|
+
two: 2,
|
|
1049
|
+
few: 3,
|
|
1050
|
+
many: 4,
|
|
1051
|
+
other: 5
|
|
1052
|
+
};
|
|
1053
|
+
function Xt() {
|
|
1054
|
+
const r = {};
|
|
1055
|
+
return Vt.forEach((e) => {
|
|
1056
|
+
e.lngs.forEach((t) => {
|
|
1057
|
+
r[t] = {
|
|
1058
|
+
numbers: e.nr,
|
|
1059
|
+
plurals: Kt[e.fc]
|
|
1060
|
+
};
|
|
1061
|
+
});
|
|
1062
|
+
}), r;
|
|
1063
|
+
}
|
|
1064
|
+
class Wt {
|
|
1065
|
+
constructor(e) {
|
|
1066
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1067
|
+
this.languageUtils = e, this.options = t, this.logger = D.create("pluralResolver"), (!this.options.compatibilityJSON || Jt.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = Xt();
|
|
1068
|
+
}
|
|
1069
|
+
addRule(e, t) {
|
|
1070
|
+
this.rules[e] = t;
|
|
1071
|
+
}
|
|
1072
|
+
getRule(e) {
|
|
1073
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1074
|
+
if (this.shouldUseIntlApi())
|
|
1075
|
+
try {
|
|
1076
|
+
return new Intl.PluralRules(ae(e === "dev" ? "en" : e), {
|
|
1077
|
+
type: t.ordinal ? "ordinal" : "cardinal"
|
|
1078
|
+
});
|
|
1079
|
+
} catch {
|
|
1080
|
+
return;
|
|
1081
|
+
}
|
|
1082
|
+
return this.rules[e] || this.rules[this.languageUtils.getLanguagePartFromCode(e)];
|
|
1083
|
+
}
|
|
1084
|
+
needsPlural(e) {
|
|
1085
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1086
|
+
const n = this.getRule(e, t);
|
|
1087
|
+
return this.shouldUseIntlApi() ? n && n.resolvedOptions().pluralCategories.length > 1 : n && n.numbers.length > 1;
|
|
1088
|
+
}
|
|
1089
|
+
getPluralFormsOfKey(e, t) {
|
|
1090
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
1091
|
+
return this.getSuffixes(e, n).map((i) => `${t}${i}`);
|
|
1092
|
+
}
|
|
1093
|
+
getSuffixes(e) {
|
|
1094
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1095
|
+
const n = this.getRule(e, t);
|
|
1096
|
+
return n ? this.shouldUseIntlApi() ? n.resolvedOptions().pluralCategories.sort((i, s) => Ee[i] - Ee[s]).map((i) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : n.numbers.map((i) => this.getSuffix(e, i, t)) : [];
|
|
1097
|
+
}
|
|
1098
|
+
getSuffix(e, t) {
|
|
1099
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
1100
|
+
const i = this.getRule(e, n);
|
|
1101
|
+
return i ? this.shouldUseIntlApi() ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(t)}` : this.getSuffixRetroCompatible(i, t) : (this.logger.warn(`no plural rule found for: ${e}`), "");
|
|
1102
|
+
}
|
|
1103
|
+
getSuffixRetroCompatible(e, t) {
|
|
1104
|
+
const n = e.noAbs ? e.plurals(t) : e.plurals(Math.abs(t));
|
|
1105
|
+
let i = e.numbers[n];
|
|
1106
|
+
this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 && (i === 2 ? i = "plural" : i === 1 && (i = ""));
|
|
1107
|
+
const s = () => this.options.prepend && i.toString() ? this.options.prepend + i.toString() : i.toString();
|
|
1108
|
+
return this.options.compatibilityJSON === "v1" ? i === 1 ? "" : typeof i == "number" ? `_plural_${i.toString()}` : s() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 ? s() : this.options.prepend && n.toString() ? this.options.prepend + n.toString() : n.toString();
|
|
1109
|
+
}
|
|
1110
|
+
shouldUseIntlApi() {
|
|
1111
|
+
return !zt.includes(this.options.compatibilityJSON);
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
function Re(r, e, t) {
|
|
1115
|
+
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, s = Ft(r, e, t);
|
|
1116
|
+
return !s && i && typeof t == "string" && (s = me(r, t, n), s === void 0 && (s = me(e, t, n))), s;
|
|
1117
|
+
}
|
|
1118
|
+
class Gt {
|
|
1119
|
+
constructor() {
|
|
1120
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1121
|
+
this.logger = D.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
|
|
1122
|
+
}
|
|
1123
|
+
init() {
|
|
1124
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1125
|
+
e.interpolation || (e.interpolation = {
|
|
1126
|
+
escapeValue: !0
|
|
1127
|
+
});
|
|
1128
|
+
const t = e.interpolation;
|
|
1129
|
+
this.escape = t.escape !== void 0 ? t.escape : _t, this.escapeValue = t.escapeValue !== void 0 ? t.escapeValue : !0, this.useRawValueToEscape = t.useRawValueToEscape !== void 0 ? t.useRawValueToEscape : !1, this.prefix = t.prefix ? q(t.prefix) : t.prefixEscaped || "{{", this.suffix = t.suffix ? q(t.suffix) : t.suffixEscaped || "}}", this.formatSeparator = t.formatSeparator ? t.formatSeparator : t.formatSeparator || ",", this.unescapePrefix = t.unescapeSuffix ? "" : t.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : t.unescapeSuffix || "", this.nestingPrefix = t.nestingPrefix ? q(t.nestingPrefix) : t.nestingPrefixEscaped || q("$t("), this.nestingSuffix = t.nestingSuffix ? q(t.nestingSuffix) : t.nestingSuffixEscaped || q(")"), this.nestingOptionsSeparator = t.nestingOptionsSeparator ? t.nestingOptionsSeparator : t.nestingOptionsSeparator || ",", this.maxReplaces = t.maxReplaces ? t.maxReplaces : 1e3, this.alwaysFormat = t.alwaysFormat !== void 0 ? t.alwaysFormat : !1, this.resetRegExp();
|
|
1130
|
+
}
|
|
1131
|
+
reset() {
|
|
1132
|
+
this.options && this.init(this.options);
|
|
1133
|
+
}
|
|
1134
|
+
resetRegExp() {
|
|
1135
|
+
const e = (t, n) => t && t.source === n ? (t.lastIndex = 0, t) : new RegExp(n, "g");
|
|
1136
|
+
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}`);
|
|
1137
|
+
}
|
|
1138
|
+
interpolate(e, t, n, i) {
|
|
1139
|
+
let s, o, a;
|
|
1140
|
+
const u = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
|
|
1141
|
+
function l(y) {
|
|
1142
|
+
return y.replace(/\$/g, "$$$$");
|
|
1143
|
+
}
|
|
1144
|
+
const f = (y) => {
|
|
1145
|
+
if (y.indexOf(this.formatSeparator) < 0) {
|
|
1146
|
+
const L = Re(t, u, y, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
1147
|
+
return this.alwaysFormat ? this.format(L, void 0, n, {
|
|
1148
|
+
...i,
|
|
1149
|
+
...t,
|
|
1150
|
+
interpolationkey: y
|
|
1151
|
+
}) : L;
|
|
1152
|
+
}
|
|
1153
|
+
const m = y.split(this.formatSeparator), w = m.shift().trim(), E = m.join(this.formatSeparator).trim();
|
|
1154
|
+
return this.format(Re(t, u, w, this.options.keySeparator, this.options.ignoreJSONStructure), E, n, {
|
|
1155
|
+
...i,
|
|
1156
|
+
...t,
|
|
1157
|
+
interpolationkey: w
|
|
1158
|
+
});
|
|
1159
|
+
};
|
|
1160
|
+
this.resetRegExp();
|
|
1161
|
+
const h = i && i.missingInterpolationHandler || this.options.missingInterpolationHandler, c = i && i.interpolation && i.interpolation.skipOnVariables !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
1162
|
+
return [{
|
|
1163
|
+
regex: this.regexpUnescape,
|
|
1164
|
+
safeValue: (y) => l(y)
|
|
1165
|
+
}, {
|
|
1166
|
+
regex: this.regexp,
|
|
1167
|
+
safeValue: (y) => this.escapeValue ? l(this.escape(y)) : l(y)
|
|
1168
|
+
}].forEach((y) => {
|
|
1169
|
+
for (a = 0; s = y.regex.exec(e); ) {
|
|
1170
|
+
const m = s[1].trim();
|
|
1171
|
+
if (o = f(m), o === void 0)
|
|
1172
|
+
if (typeof h == "function") {
|
|
1173
|
+
const E = h(e, s, i);
|
|
1174
|
+
o = typeof E == "string" ? E : "";
|
|
1175
|
+
} else if (i && Object.prototype.hasOwnProperty.call(i, m))
|
|
1176
|
+
o = "";
|
|
1177
|
+
else if (c) {
|
|
1178
|
+
o = s[0];
|
|
1179
|
+
continue;
|
|
1180
|
+
} else
|
|
1181
|
+
this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`), o = "";
|
|
1182
|
+
else
|
|
1183
|
+
typeof o != "string" && !this.useRawValueToEscape && (o = Oe(o));
|
|
1184
|
+
const w = y.safeValue(o);
|
|
1185
|
+
if (e = e.replace(s[0], w), c ? (y.regex.lastIndex += o.length, y.regex.lastIndex -= s[0].length) : y.regex.lastIndex = 0, a++, a >= this.maxReplaces)
|
|
1186
|
+
break;
|
|
1187
|
+
}
|
|
1188
|
+
}), e;
|
|
1189
|
+
}
|
|
1190
|
+
nest(e, t) {
|
|
1191
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i, s, o;
|
|
1192
|
+
function a(u, l) {
|
|
1193
|
+
const f = this.nestingOptionsSeparator;
|
|
1194
|
+
if (u.indexOf(f) < 0)
|
|
1195
|
+
return u;
|
|
1196
|
+
const h = u.split(new RegExp(`${f}[ ]*{`));
|
|
1197
|
+
let c = `{${h[1]}`;
|
|
1198
|
+
u = h[0], c = this.interpolate(c, o);
|
|
1199
|
+
const p = c.match(/'/g), y = c.match(/"/g);
|
|
1200
|
+
(p && p.length % 2 === 0 && !y || y.length % 2 !== 0) && (c = c.replace(/'/g, '"'));
|
|
1201
|
+
try {
|
|
1202
|
+
o = JSON.parse(c), l && (o = {
|
|
1203
|
+
...l,
|
|
1204
|
+
...o
|
|
1205
|
+
});
|
|
1206
|
+
} catch (m) {
|
|
1207
|
+
return this.logger.warn(`failed parsing options string in nesting for key ${u}`, m), `${u}${f}${c}`;
|
|
1208
|
+
}
|
|
1209
|
+
return delete o.defaultValue, u;
|
|
1210
|
+
}
|
|
1211
|
+
for (; i = this.nestingRegexp.exec(e); ) {
|
|
1212
|
+
let u = [];
|
|
1213
|
+
o = {
|
|
1214
|
+
...n
|
|
1215
|
+
}, o = o.replace && typeof o.replace != "string" ? o.replace : o, o.applyPostProcessor = !1, delete o.defaultValue;
|
|
1216
|
+
let l = !1;
|
|
1217
|
+
if (i[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(i[1])) {
|
|
1218
|
+
const f = i[1].split(this.formatSeparator).map((h) => h.trim());
|
|
1219
|
+
i[1] = f.shift(), u = f, l = !0;
|
|
1220
|
+
}
|
|
1221
|
+
if (s = t(a.call(this, i[1].trim(), o), o), s && i[0] === e && typeof s != "string")
|
|
1222
|
+
return s;
|
|
1223
|
+
typeof s != "string" && (s = Oe(s)), s || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), s = ""), l && (s = u.reduce((f, h) => this.format(f, h, n.lng, {
|
|
1224
|
+
...n,
|
|
1225
|
+
interpolationkey: i[1].trim()
|
|
1226
|
+
}), s.trim())), e = e.replace(i[0], s), this.regexp.lastIndex = 0;
|
|
1227
|
+
}
|
|
1228
|
+
return e;
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
function Qt(r) {
|
|
1232
|
+
let e = r.toLowerCase().trim();
|
|
1233
|
+
const t = {};
|
|
1234
|
+
if (r.indexOf("(") > -1) {
|
|
1235
|
+
const n = r.split("(");
|
|
1236
|
+
e = n[0].toLowerCase().trim();
|
|
1237
|
+
const i = n[1].substring(0, n[1].length - 1);
|
|
1238
|
+
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((o) => {
|
|
1239
|
+
if (!o)
|
|
1240
|
+
return;
|
|
1241
|
+
const [a, ...u] = o.split(":"), l = u.join(":").trim().replace(/^'+|'+$/g, "");
|
|
1242
|
+
t[a.trim()] || (t[a.trim()] = l), l === "false" && (t[a.trim()] = !1), l === "true" && (t[a.trim()] = !0), isNaN(l) || (t[a.trim()] = parseInt(l, 10));
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
return {
|
|
1246
|
+
formatName: e,
|
|
1247
|
+
formatOptions: t
|
|
1248
|
+
};
|
|
1249
|
+
}
|
|
1250
|
+
function V(r) {
|
|
1251
|
+
const e = {};
|
|
1252
|
+
return function(n, i, s) {
|
|
1253
|
+
const o = i + JSON.stringify(s);
|
|
1254
|
+
let a = e[o];
|
|
1255
|
+
return a || (a = r(ae(i), s), e[o] = a), a(n);
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
class Yt {
|
|
1259
|
+
constructor() {
|
|
1260
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1261
|
+
this.logger = D.create("formatter"), this.options = e, this.formats = {
|
|
1262
|
+
number: V((t, n) => {
|
|
1263
|
+
const i = new Intl.NumberFormat(t, {
|
|
1264
|
+
...n
|
|
1265
|
+
});
|
|
1266
|
+
return (s) => i.format(s);
|
|
1267
|
+
}),
|
|
1268
|
+
currency: V((t, n) => {
|
|
1269
|
+
const i = new Intl.NumberFormat(t, {
|
|
1270
|
+
...n,
|
|
1271
|
+
style: "currency"
|
|
1272
|
+
});
|
|
1273
|
+
return (s) => i.format(s);
|
|
1274
|
+
}),
|
|
1275
|
+
datetime: V((t, n) => {
|
|
1276
|
+
const i = new Intl.DateTimeFormat(t, {
|
|
1277
|
+
...n
|
|
1278
|
+
});
|
|
1279
|
+
return (s) => i.format(s);
|
|
1280
|
+
}),
|
|
1281
|
+
relativetime: V((t, n) => {
|
|
1282
|
+
const i = new Intl.RelativeTimeFormat(t, {
|
|
1283
|
+
...n
|
|
1284
|
+
});
|
|
1285
|
+
return (s) => i.format(s, n.range || "day");
|
|
1286
|
+
}),
|
|
1287
|
+
list: V((t, n) => {
|
|
1288
|
+
const i = new Intl.ListFormat(t, {
|
|
1289
|
+
...n
|
|
1290
|
+
});
|
|
1291
|
+
return (s) => i.format(s);
|
|
1292
|
+
})
|
|
1293
|
+
}, this.init(e);
|
|
1294
|
+
}
|
|
1295
|
+
init(e) {
|
|
1296
|
+
const n = (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
1297
|
+
interpolation: {}
|
|
1298
|
+
}).interpolation;
|
|
1299
|
+
this.formatSeparator = n.formatSeparator ? n.formatSeparator : n.formatSeparator || ",";
|
|
1300
|
+
}
|
|
1301
|
+
add(e, t) {
|
|
1302
|
+
this.formats[e.toLowerCase().trim()] = t;
|
|
1303
|
+
}
|
|
1304
|
+
addCached(e, t) {
|
|
1305
|
+
this.formats[e.toLowerCase().trim()] = V(t);
|
|
1306
|
+
}
|
|
1307
|
+
format(e, t, n) {
|
|
1308
|
+
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
1309
|
+
return t.split(this.formatSeparator).reduce((a, u) => {
|
|
1310
|
+
const {
|
|
1311
|
+
formatName: l,
|
|
1312
|
+
formatOptions: f
|
|
1313
|
+
} = Qt(u);
|
|
1314
|
+
if (this.formats[l]) {
|
|
1315
|
+
let h = a;
|
|
1316
|
+
try {
|
|
1317
|
+
const c = i && i.formatParams && i.formatParams[i.interpolationkey] || {}, p = c.locale || c.lng || i.locale || i.lng || n;
|
|
1318
|
+
h = this.formats[l](a, p, {
|
|
1319
|
+
...f,
|
|
1320
|
+
...i,
|
|
1321
|
+
...c
|
|
1322
|
+
});
|
|
1323
|
+
} catch (c) {
|
|
1324
|
+
this.logger.warn(c);
|
|
1325
|
+
}
|
|
1326
|
+
return h;
|
|
1327
|
+
} else
|
|
1328
|
+
this.logger.warn(`there was no format function for ${l}`);
|
|
1329
|
+
return a;
|
|
1330
|
+
}, e);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
function Zt(r, e) {
|
|
1334
|
+
r.pending[e] !== void 0 && (delete r.pending[e], r.pendingCount--);
|
|
1335
|
+
}
|
|
1336
|
+
class en extends fe {
|
|
1337
|
+
constructor(e, t, n) {
|
|
1338
|
+
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
1339
|
+
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = i, this.logger = D.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 && this.backend.init && this.backend.init(n, i.backend, i);
|
|
1340
|
+
}
|
|
1341
|
+
queueLoad(e, t, n, i) {
|
|
1342
|
+
const s = {}, o = {}, a = {}, u = {};
|
|
1343
|
+
return e.forEach((l) => {
|
|
1344
|
+
let f = !0;
|
|
1345
|
+
t.forEach((h) => {
|
|
1346
|
+
const c = `${l}|${h}`;
|
|
1347
|
+
!n.reload && this.store.hasResourceBundle(l, h) ? this.state[c] = 2 : this.state[c] < 0 || (this.state[c] === 1 ? o[c] === void 0 && (o[c] = !0) : (this.state[c] = 1, f = !1, o[c] === void 0 && (o[c] = !0), s[c] === void 0 && (s[c] = !0), u[h] === void 0 && (u[h] = !0)));
|
|
1348
|
+
}), f || (a[l] = !0);
|
|
1349
|
+
}), (Object.keys(s).length || Object.keys(o).length) && this.queue.push({
|
|
1350
|
+
pending: o,
|
|
1351
|
+
pendingCount: Object.keys(o).length,
|
|
1352
|
+
loaded: {},
|
|
1353
|
+
errors: [],
|
|
1354
|
+
callback: i
|
|
1355
|
+
}), {
|
|
1356
|
+
toLoad: Object.keys(s),
|
|
1357
|
+
pending: Object.keys(o),
|
|
1358
|
+
toLoadLanguages: Object.keys(a),
|
|
1359
|
+
toLoadNamespaces: Object.keys(u)
|
|
1360
|
+
};
|
|
1361
|
+
}
|
|
1362
|
+
loaded(e, t, n) {
|
|
1363
|
+
const i = e.split("|"), s = i[0], o = i[1];
|
|
1364
|
+
t && this.emit("failedLoading", s, o, t), n && this.store.addResourceBundle(s, o, n, void 0, void 0, {
|
|
1365
|
+
skipCopy: !0
|
|
1366
|
+
}), this.state[e] = t ? -1 : 2;
|
|
1367
|
+
const a = {};
|
|
1368
|
+
this.queue.forEach((u) => {
|
|
1369
|
+
Dt(u.loaded, [s], o), Zt(u, e), t && u.errors.push(t), u.pendingCount === 0 && !u.done && (Object.keys(u.loaded).forEach((l) => {
|
|
1370
|
+
a[l] || (a[l] = {});
|
|
1371
|
+
const f = u.loaded[l];
|
|
1372
|
+
f.length && f.forEach((h) => {
|
|
1373
|
+
a[l][h] === void 0 && (a[l][h] = !0);
|
|
1374
|
+
});
|
|
1375
|
+
}), u.done = !0, u.errors.length ? u.callback(u.errors) : u.callback());
|
|
1376
|
+
}), this.emit("loaded", a), this.queue = this.queue.filter((u) => !u.done);
|
|
1377
|
+
}
|
|
1378
|
+
read(e, t, n) {
|
|
1379
|
+
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, o = arguments.length > 5 ? arguments[5] : void 0;
|
|
1380
|
+
if (!e.length)
|
|
1381
|
+
return o(null, {});
|
|
1382
|
+
if (this.readingCalls >= this.maxParallelReads) {
|
|
1383
|
+
this.waitingReads.push({
|
|
1384
|
+
lng: e,
|
|
1385
|
+
ns: t,
|
|
1386
|
+
fcName: n,
|
|
1387
|
+
tried: i,
|
|
1388
|
+
wait: s,
|
|
1389
|
+
callback: o
|
|
1390
|
+
});
|
|
1391
|
+
return;
|
|
1392
|
+
}
|
|
1393
|
+
this.readingCalls++;
|
|
1394
|
+
const a = (l, f) => {
|
|
1395
|
+
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
1396
|
+
const h = this.waitingReads.shift();
|
|
1397
|
+
this.read(h.lng, h.ns, h.fcName, h.tried, h.wait, h.callback);
|
|
1398
|
+
}
|
|
1399
|
+
if (l && f && i < this.maxRetries) {
|
|
1400
|
+
setTimeout(() => {
|
|
1401
|
+
this.read.call(this, e, t, n, i + 1, s * 2, o);
|
|
1402
|
+
}, s);
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
o(l, f);
|
|
1406
|
+
}, u = this.backend[n].bind(this.backend);
|
|
1407
|
+
if (u.length === 2) {
|
|
1408
|
+
try {
|
|
1409
|
+
const l = u(e, t);
|
|
1410
|
+
l && typeof l.then == "function" ? l.then((f) => a(null, f)).catch(a) : a(null, l);
|
|
1411
|
+
} catch (l) {
|
|
1412
|
+
a(l);
|
|
1413
|
+
}
|
|
1414
|
+
return;
|
|
1415
|
+
}
|
|
1416
|
+
return u(e, t, a);
|
|
1417
|
+
}
|
|
1418
|
+
prepareLoading(e, t) {
|
|
1419
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = arguments.length > 3 ? arguments[3] : void 0;
|
|
1420
|
+
if (!this.backend)
|
|
1421
|
+
return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
|
|
1422
|
+
typeof e == "string" && (e = this.languageUtils.toResolveHierarchy(e)), typeof t == "string" && (t = [t]);
|
|
1423
|
+
const s = this.queueLoad(e, t, n, i);
|
|
1424
|
+
if (!s.toLoad.length)
|
|
1425
|
+
return s.pending.length || i(), null;
|
|
1426
|
+
s.toLoad.forEach((o) => {
|
|
1427
|
+
this.loadOne(o);
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
load(e, t, n) {
|
|
1431
|
+
this.prepareLoading(e, t, {}, n);
|
|
1432
|
+
}
|
|
1433
|
+
reload(e, t, n) {
|
|
1434
|
+
this.prepareLoading(e, t, {
|
|
1435
|
+
reload: !0
|
|
1436
|
+
}, n);
|
|
1437
|
+
}
|
|
1438
|
+
loadOne(e) {
|
|
1439
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
1440
|
+
const n = e.split("|"), i = n[0], s = n[1];
|
|
1441
|
+
this.read(i, s, "read", void 0, void 0, (o, a) => {
|
|
1442
|
+
o && this.logger.warn(`${t}loading namespace ${s} for language ${i} failed`, o), !o && a && this.logger.log(`${t}loaded namespace ${s} for language ${i}`, a), this.loaded(e, o, a);
|
|
1443
|
+
});
|
|
1444
|
+
}
|
|
1445
|
+
saveMissing(e, t, n, i, s) {
|
|
1446
|
+
let o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, a = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
|
|
1447
|
+
};
|
|
1448
|
+
if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(t)) {
|
|
1449
|
+
this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
|
|
1450
|
+
return;
|
|
1451
|
+
}
|
|
1452
|
+
if (!(n == null || n === "")) {
|
|
1453
|
+
if (this.backend && this.backend.create) {
|
|
1454
|
+
const u = {
|
|
1455
|
+
...o,
|
|
1456
|
+
isUpdate: s
|
|
1457
|
+
}, l = this.backend.create.bind(this.backend);
|
|
1458
|
+
if (l.length < 6)
|
|
1459
|
+
try {
|
|
1460
|
+
let f;
|
|
1461
|
+
l.length === 5 ? f = l(e, t, n, i, u) : f = l(e, t, n, i), f && typeof f.then == "function" ? f.then((h) => a(null, h)).catch(a) : a(null, f);
|
|
1462
|
+
} catch (f) {
|
|
1463
|
+
a(f);
|
|
1464
|
+
}
|
|
1465
|
+
else
|
|
1466
|
+
l(e, t, n, i, a, u);
|
|
1467
|
+
}
|
|
1468
|
+
!e || !e[0] || this.store.addResource(e[0], t, n, i);
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
function Ne() {
|
|
1473
|
+
return {
|
|
1474
|
+
debug: !1,
|
|
1475
|
+
initImmediate: !0,
|
|
1476
|
+
ns: ["translation"],
|
|
1477
|
+
defaultNS: ["translation"],
|
|
1478
|
+
fallbackLng: ["dev"],
|
|
1479
|
+
fallbackNS: !1,
|
|
1480
|
+
supportedLngs: !1,
|
|
1481
|
+
nonExplicitSupportedLngs: !1,
|
|
1482
|
+
load: "all",
|
|
1483
|
+
preload: !1,
|
|
1484
|
+
simplifyPluralSuffix: !0,
|
|
1485
|
+
keySeparator: ".",
|
|
1486
|
+
nsSeparator: ":",
|
|
1487
|
+
pluralSeparator: "_",
|
|
1488
|
+
contextSeparator: "_",
|
|
1489
|
+
partialBundledLanguages: !1,
|
|
1490
|
+
saveMissing: !1,
|
|
1491
|
+
updateMissing: !1,
|
|
1492
|
+
saveMissingTo: "fallback",
|
|
1493
|
+
saveMissingPlurals: !0,
|
|
1494
|
+
missingKeyHandler: !1,
|
|
1495
|
+
missingInterpolationHandler: !1,
|
|
1496
|
+
postProcess: !1,
|
|
1497
|
+
postProcessPassResolved: !1,
|
|
1498
|
+
returnNull: !1,
|
|
1499
|
+
returnEmptyString: !0,
|
|
1500
|
+
returnObjects: !1,
|
|
1501
|
+
joinArrays: !1,
|
|
1502
|
+
returnedObjectHandler: !1,
|
|
1503
|
+
parseMissingKeyHandler: !1,
|
|
1504
|
+
appendNamespaceToMissingKey: !1,
|
|
1505
|
+
appendNamespaceToCIMode: !1,
|
|
1506
|
+
overloadTranslationOptionHandler: function(e) {
|
|
1507
|
+
let t = {};
|
|
1508
|
+
if (typeof e[1] == "object" && (t = e[1]), typeof e[1] == "string" && (t.defaultValue = e[1]), typeof e[2] == "string" && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
|
|
1509
|
+
const n = e[3] || e[2];
|
|
1510
|
+
Object.keys(n).forEach((i) => {
|
|
1511
|
+
t[i] = n[i];
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1514
|
+
return t;
|
|
1515
|
+
},
|
|
1516
|
+
interpolation: {
|
|
1517
|
+
escapeValue: !0,
|
|
1518
|
+
format: (r) => r,
|
|
1519
|
+
prefix: "{{",
|
|
1520
|
+
suffix: "}}",
|
|
1521
|
+
formatSeparator: ",",
|
|
1522
|
+
unescapePrefix: "-",
|
|
1523
|
+
nestingPrefix: "$t(",
|
|
1524
|
+
nestingSuffix: ")",
|
|
1525
|
+
nestingOptionsSeparator: ",",
|
|
1526
|
+
maxReplaces: 1e3,
|
|
1527
|
+
skipOnVariables: !0
|
|
1528
|
+
}
|
|
1529
|
+
};
|
|
1530
|
+
}
|
|
1531
|
+
function je(r) {
|
|
1532
|
+
return typeof r.ns == "string" && (r.ns = [r.ns]), typeof r.fallbackLng == "string" && (r.fallbackLng = [r.fallbackLng]), typeof r.fallbackNS == "string" && (r.fallbackNS = [r.fallbackNS]), r.supportedLngs && r.supportedLngs.indexOf("cimode") < 0 && (r.supportedLngs = r.supportedLngs.concat(["cimode"])), r;
|
|
1533
|
+
}
|
|
1534
|
+
function ne() {
|
|
1535
|
+
}
|
|
1536
|
+
function tn(r) {
|
|
1537
|
+
Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((t) => {
|
|
1538
|
+
typeof r[t] == "function" && (r[t] = r[t].bind(r));
|
|
1539
|
+
});
|
|
1540
|
+
}
|
|
1541
|
+
class Q extends fe {
|
|
1542
|
+
constructor() {
|
|
1543
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
1544
|
+
if (super(), this.options = je(e), this.services = {}, this.logger = D, this.modules = {
|
|
1545
|
+
external: []
|
|
1546
|
+
}, tn(this), t && !this.isInitialized && !e.isClone) {
|
|
1547
|
+
if (!this.options.initImmediate)
|
|
1548
|
+
return this.init(e, t), this;
|
|
1549
|
+
setTimeout(() => {
|
|
1550
|
+
this.init(e, t);
|
|
1551
|
+
}, 0);
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
init() {
|
|
1555
|
+
var e = this;
|
|
1556
|
+
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0;
|
|
1557
|
+
this.isInitializing = !0, typeof t == "function" && (n = t, t = {}), !t.defaultNS && t.defaultNS !== !1 && t.ns && (typeof t.ns == "string" ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
|
|
1558
|
+
const i = Ne();
|
|
1559
|
+
this.options = {
|
|
1560
|
+
...i,
|
|
1561
|
+
...this.options,
|
|
1562
|
+
...je(t)
|
|
1563
|
+
}, this.options.compatibilityAPI !== "v1" && (this.options.interpolation = {
|
|
1564
|
+
...i.interpolation,
|
|
1565
|
+
...this.options.interpolation
|
|
1566
|
+
}), t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
|
|
1567
|
+
function s(f) {
|
|
1568
|
+
return f ? typeof f == "function" ? new f() : f : null;
|
|
1569
|
+
}
|
|
1570
|
+
if (!this.options.isClone) {
|
|
1571
|
+
this.modules.logger ? D.init(s(this.modules.logger), this.options) : D.init(null, this.options);
|
|
1572
|
+
let f;
|
|
1573
|
+
this.modules.formatter ? f = this.modules.formatter : typeof Intl < "u" && (f = Yt);
|
|
1574
|
+
const h = new Ce(this.options);
|
|
1575
|
+
this.store = new Le(this.options.resources, this.options);
|
|
1576
|
+
const c = this.services;
|
|
1577
|
+
c.logger = D, c.resourceStore = this.store, c.languageUtils = h, c.pluralResolver = new Wt(h, {
|
|
1578
|
+
prepend: this.options.pluralSeparator,
|
|
1579
|
+
compatibilityJSON: this.options.compatibilityJSON,
|
|
1580
|
+
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1581
|
+
}), f && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (c.formatter = s(f), c.formatter.init(c, this.options), this.options.interpolation.format = c.formatter.format.bind(c.formatter)), c.interpolator = new Gt(this.options), c.utils = {
|
|
1582
|
+
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1583
|
+
}, c.backendConnector = new en(s(this.modules.backend), c.resourceStore, c, this.options), c.backendConnector.on("*", function(p) {
|
|
1584
|
+
for (var y = arguments.length, m = new Array(y > 1 ? y - 1 : 0), w = 1; w < y; w++)
|
|
1585
|
+
m[w - 1] = arguments[w];
|
|
1586
|
+
e.emit(p, ...m);
|
|
1587
|
+
}), this.modules.languageDetector && (c.languageDetector = s(this.modules.languageDetector), c.languageDetector.init && c.languageDetector.init(c, this.options.detection, this.options)), this.modules.i18nFormat && (c.i18nFormat = s(this.modules.i18nFormat), c.i18nFormat.init && c.i18nFormat.init(this)), this.translator = new ue(this.services, this.options), this.translator.on("*", function(p) {
|
|
1588
|
+
for (var y = arguments.length, m = new Array(y > 1 ? y - 1 : 0), w = 1; w < y; w++)
|
|
1589
|
+
m[w - 1] = arguments[w];
|
|
1590
|
+
e.emit(p, ...m);
|
|
1591
|
+
}), this.modules.external.forEach((p) => {
|
|
1592
|
+
p.init && p.init(this);
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
if (this.format = this.options.interpolation.format, n || (n = ne), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
1596
|
+
const f = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1597
|
+
f.length > 0 && f[0] !== "dev" && (this.options.lng = f[0]);
|
|
1598
|
+
}
|
|
1599
|
+
!this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((f) => {
|
|
1600
|
+
this[f] = function() {
|
|
1601
|
+
return e.store[f](...arguments);
|
|
1602
|
+
};
|
|
1603
|
+
}), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((f) => {
|
|
1604
|
+
this[f] = function() {
|
|
1605
|
+
return e.store[f](...arguments), e;
|
|
1606
|
+
};
|
|
1607
|
+
});
|
|
1608
|
+
const u = K(), l = () => {
|
|
1609
|
+
const f = (h, c) => {
|
|
1610
|
+
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), u.resolve(c), n(h, c);
|
|
1611
|
+
};
|
|
1612
|
+
if (this.languages && this.options.compatibilityAPI !== "v1" && !this.isInitialized)
|
|
1613
|
+
return f(null, this.t.bind(this));
|
|
1614
|
+
this.changeLanguage(this.options.lng, f);
|
|
1615
|
+
};
|
|
1616
|
+
return this.options.resources || !this.options.initImmediate ? l() : setTimeout(l, 0), u;
|
|
1617
|
+
}
|
|
1618
|
+
loadResources(e) {
|
|
1619
|
+
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ne;
|
|
1620
|
+
const i = typeof e == "string" ? e : this.language;
|
|
1621
|
+
if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1622
|
+
if (i && i.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0))
|
|
1623
|
+
return n();
|
|
1624
|
+
const s = [], o = (a) => {
|
|
1625
|
+
if (!a || a === "cimode")
|
|
1626
|
+
return;
|
|
1627
|
+
this.services.languageUtils.toResolveHierarchy(a).forEach((l) => {
|
|
1628
|
+
l !== "cimode" && s.indexOf(l) < 0 && s.push(l);
|
|
1629
|
+
});
|
|
1630
|
+
};
|
|
1631
|
+
i ? o(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((u) => o(u)), this.options.preload && this.options.preload.forEach((a) => o(a)), this.services.backendConnector.load(s, this.options.ns, (a) => {
|
|
1632
|
+
!a && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(a);
|
|
1633
|
+
});
|
|
1634
|
+
} else
|
|
1635
|
+
n(null);
|
|
1636
|
+
}
|
|
1637
|
+
reloadResources(e, t, n) {
|
|
1638
|
+
const i = K();
|
|
1639
|
+
return e || (e = this.languages), t || (t = this.options.ns), n || (n = ne), this.services.backendConnector.reload(e, t, (s) => {
|
|
1640
|
+
i.resolve(), n(s);
|
|
1641
|
+
}), i;
|
|
1642
|
+
}
|
|
1643
|
+
use(e) {
|
|
1644
|
+
if (!e)
|
|
1645
|
+
throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
1646
|
+
if (!e.type)
|
|
1647
|
+
throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
1648
|
+
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" && Qe.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
1649
|
+
}
|
|
1650
|
+
setResolvedLanguage(e) {
|
|
1651
|
+
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
|
|
1652
|
+
for (let t = 0; t < this.languages.length; t++) {
|
|
1653
|
+
const n = this.languages[t];
|
|
1654
|
+
if (!(["cimode", "dev"].indexOf(n) > -1) && this.store.hasLanguageSomeTranslations(n)) {
|
|
1655
|
+
this.resolvedLanguage = n;
|
|
1656
|
+
break;
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
changeLanguage(e, t) {
|
|
1661
|
+
var n = this;
|
|
1662
|
+
this.isLanguageChangingTo = e;
|
|
1663
|
+
const i = K();
|
|
1664
|
+
this.emit("languageChanging", e);
|
|
1665
|
+
const s = (u) => {
|
|
1666
|
+
this.language = u, this.languages = this.services.languageUtils.toResolveHierarchy(u), this.resolvedLanguage = void 0, this.setResolvedLanguage(u);
|
|
1667
|
+
}, o = (u, l) => {
|
|
1668
|
+
l ? (s(l), this.translator.changeLanguage(l), this.isLanguageChangingTo = void 0, this.emit("languageChanged", l), this.logger.log("languageChanged", l)) : this.isLanguageChangingTo = void 0, i.resolve(function() {
|
|
1669
|
+
return n.t(...arguments);
|
|
1670
|
+
}), t && t(u, function() {
|
|
1671
|
+
return n.t(...arguments);
|
|
1672
|
+
});
|
|
1673
|
+
}, a = (u) => {
|
|
1674
|
+
!e && !u && this.services.languageDetector && (u = []);
|
|
1675
|
+
const l = typeof u == "string" ? u : this.services.languageUtils.getBestMatchFromCodes(u);
|
|
1676
|
+
l && (this.language || s(l), this.translator.language || this.translator.changeLanguage(l), this.services.languageDetector && this.services.languageDetector.cacheUserLanguage && this.services.languageDetector.cacheUserLanguage(l)), this.loadResources(l, (f) => {
|
|
1677
|
+
o(f, l);
|
|
1678
|
+
});
|
|
1679
|
+
};
|
|
1680
|
+
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), i;
|
|
1681
|
+
}
|
|
1682
|
+
getFixedT(e, t, n) {
|
|
1683
|
+
var i = this;
|
|
1684
|
+
const s = function(o, a) {
|
|
1685
|
+
let u;
|
|
1686
|
+
if (typeof a != "object") {
|
|
1687
|
+
for (var l = arguments.length, f = new Array(l > 2 ? l - 2 : 0), h = 2; h < l; h++)
|
|
1688
|
+
f[h - 2] = arguments[h];
|
|
1689
|
+
u = i.options.overloadTranslationOptionHandler([o, a].concat(f));
|
|
1690
|
+
} else
|
|
1691
|
+
u = {
|
|
1692
|
+
...a
|
|
1693
|
+
};
|
|
1694
|
+
u.lng = u.lng || s.lng, u.lngs = u.lngs || s.lngs, u.ns = u.ns || s.ns, u.keyPrefix = u.keyPrefix || n || s.keyPrefix;
|
|
1695
|
+
const c = i.options.keySeparator || ".";
|
|
1696
|
+
let p;
|
|
1697
|
+
return u.keyPrefix && Array.isArray(o) ? p = o.map((y) => `${u.keyPrefix}${c}${y}`) : p = u.keyPrefix ? `${u.keyPrefix}${c}${o}` : o, i.t(p, u);
|
|
1698
|
+
};
|
|
1699
|
+
return typeof e == "string" ? s.lng = e : s.lngs = e, s.ns = t, s.keyPrefix = n, s;
|
|
1700
|
+
}
|
|
1701
|
+
t() {
|
|
1702
|
+
return this.translator && this.translator.translate(...arguments);
|
|
1703
|
+
}
|
|
1704
|
+
exists() {
|
|
1705
|
+
return this.translator && this.translator.exists(...arguments);
|
|
1706
|
+
}
|
|
1707
|
+
setDefaultNamespace(e) {
|
|
1708
|
+
this.options.defaultNS = e;
|
|
1709
|
+
}
|
|
1710
|
+
hasLoadedNamespace(e) {
|
|
1711
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1712
|
+
if (!this.isInitialized)
|
|
1713
|
+
return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
|
|
1714
|
+
if (!this.languages || !this.languages.length)
|
|
1715
|
+
return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
|
|
1716
|
+
const n = t.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, s = this.languages[this.languages.length - 1];
|
|
1717
|
+
if (n.toLowerCase() === "cimode")
|
|
1718
|
+
return !0;
|
|
1719
|
+
const o = (a, u) => {
|
|
1720
|
+
const l = this.services.backendConnector.state[`${a}|${u}`];
|
|
1721
|
+
return l === -1 || l === 2;
|
|
1722
|
+
};
|
|
1723
|
+
if (t.precheck) {
|
|
1724
|
+
const a = t.precheck(this, o);
|
|
1725
|
+
if (a !== void 0)
|
|
1726
|
+
return a;
|
|
1727
|
+
}
|
|
1728
|
+
return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || o(n, e) && (!i || o(s, e)));
|
|
1729
|
+
}
|
|
1730
|
+
loadNamespaces(e, t) {
|
|
1731
|
+
const n = K();
|
|
1732
|
+
return this.options.ns ? (typeof e == "string" && (e = [e]), e.forEach((i) => {
|
|
1733
|
+
this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
|
|
1734
|
+
}), this.loadResources((i) => {
|
|
1735
|
+
n.resolve(), t && t(i);
|
|
1736
|
+
}), n) : (t && t(), Promise.resolve());
|
|
1737
|
+
}
|
|
1738
|
+
loadLanguages(e, t) {
|
|
1739
|
+
const n = K();
|
|
1740
|
+
typeof e == "string" && (e = [e]);
|
|
1741
|
+
const i = this.options.preload || [], s = e.filter((o) => i.indexOf(o) < 0);
|
|
1742
|
+
return s.length ? (this.options.preload = i.concat(s), this.loadResources((o) => {
|
|
1743
|
+
n.resolve(), t && t(o);
|
|
1744
|
+
}), n) : (t && t(), Promise.resolve());
|
|
1745
|
+
}
|
|
1746
|
+
dir(e) {
|
|
1747
|
+
if (e || (e = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e)
|
|
1748
|
+
return "rtl";
|
|
1749
|
+
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"], n = this.services && this.services.languageUtils || new Ce(Ne());
|
|
1750
|
+
return t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
1751
|
+
}
|
|
1752
|
+
static createInstance() {
|
|
1753
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
1754
|
+
return new Q(e, t);
|
|
1755
|
+
}
|
|
1756
|
+
cloneInstance() {
|
|
1757
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ne;
|
|
1758
|
+
const n = e.forkResourceStore;
|
|
1759
|
+
n && delete e.forkResourceStore;
|
|
1760
|
+
const i = {
|
|
1761
|
+
...this.options,
|
|
1762
|
+
...e,
|
|
1763
|
+
isClone: !0
|
|
1764
|
+
}, s = new Q(i);
|
|
1765
|
+
return (e.debug !== void 0 || e.prefix !== void 0) && (s.logger = s.logger.clone(e)), ["store", "services", "language"].forEach((a) => {
|
|
1766
|
+
s[a] = this[a];
|
|
1767
|
+
}), s.services = {
|
|
1768
|
+
...this.services
|
|
1769
|
+
}, s.services.utils = {
|
|
1770
|
+
hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
|
|
1771
|
+
}, n && (s.store = new Le(this.store.data, i), s.services.resourceStore = s.store), s.translator = new ue(s.services, i), s.translator.on("*", function(a) {
|
|
1772
|
+
for (var u = arguments.length, l = new Array(u > 1 ? u - 1 : 0), f = 1; f < u; f++)
|
|
1773
|
+
l[f - 1] = arguments[f];
|
|
1774
|
+
s.emit(a, ...l);
|
|
1775
|
+
}), s.init(i, t), s.translator.options = i, s.translator.backendConnector.services.utils = {
|
|
1776
|
+
hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
|
|
1777
|
+
}, s;
|
|
1778
|
+
}
|
|
1779
|
+
toJSON() {
|
|
1780
|
+
return {
|
|
1781
|
+
options: this.options,
|
|
1782
|
+
store: this.store,
|
|
1783
|
+
language: this.language,
|
|
1784
|
+
languages: this.languages,
|
|
1785
|
+
resolvedLanguage: this.resolvedLanguage
|
|
1786
|
+
};
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
const j = Q.createInstance();
|
|
1790
|
+
j.createInstance = Q.createInstance;
|
|
1791
|
+
j.createInstance;
|
|
1792
|
+
j.dir;
|
|
1793
|
+
j.init;
|
|
1794
|
+
j.loadResources;
|
|
1795
|
+
j.reloadResources;
|
|
1796
|
+
j.use;
|
|
1797
|
+
j.changeLanguage;
|
|
1798
|
+
j.getFixedT;
|
|
1799
|
+
j.t;
|
|
1800
|
+
j.exists;
|
|
1801
|
+
j.setDefaultNamespace;
|
|
1802
|
+
j.hasLoadedNamespace;
|
|
1803
|
+
j.loadNamespaces;
|
|
1804
|
+
j.loadLanguages;
|
|
1805
|
+
function Ye(r, e) {
|
|
1806
|
+
if (!(r instanceof e))
|
|
1807
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1808
|
+
}
|
|
1809
|
+
function Te(r, e) {
|
|
1810
|
+
for (var t = 0; t < e.length; t++) {
|
|
1811
|
+
var n = e[t];
|
|
1812
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(r, pt(n.key), n);
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
function Ze(r, e, t) {
|
|
1816
|
+
return e && Te(r.prototype, e), t && Te(r, t), Object.defineProperty(r, "prototype", {
|
|
1817
|
+
writable: !1
|
|
1818
|
+
}), r;
|
|
1819
|
+
}
|
|
1820
|
+
var et = [], nn = et.forEach, rn = et.slice;
|
|
1821
|
+
function sn(r) {
|
|
1822
|
+
return nn.call(rn.call(arguments, 1), function(e) {
|
|
1823
|
+
if (e)
|
|
1824
|
+
for (var t in e)
|
|
1825
|
+
r[t] === void 0 && (r[t] = e[t]);
|
|
1826
|
+
}), r;
|
|
1827
|
+
}
|
|
1828
|
+
var Ae = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, on = function(e, t, n) {
|
|
1829
|
+
var i = n || {};
|
|
1830
|
+
i.path = i.path || "/";
|
|
1831
|
+
var s = encodeURIComponent(t), o = "".concat(e, "=").concat(s);
|
|
1832
|
+
if (i.maxAge > 0) {
|
|
1833
|
+
var a = i.maxAge - 0;
|
|
1834
|
+
if (Number.isNaN(a))
|
|
1835
|
+
throw new Error("maxAge should be a Number");
|
|
1836
|
+
o += "; Max-Age=".concat(Math.floor(a));
|
|
1837
|
+
}
|
|
1838
|
+
if (i.domain) {
|
|
1839
|
+
if (!Ae.test(i.domain))
|
|
1840
|
+
throw new TypeError("option domain is invalid");
|
|
1841
|
+
o += "; Domain=".concat(i.domain);
|
|
1842
|
+
}
|
|
1843
|
+
if (i.path) {
|
|
1844
|
+
if (!Ae.test(i.path))
|
|
1845
|
+
throw new TypeError("option path is invalid");
|
|
1846
|
+
o += "; Path=".concat(i.path);
|
|
1847
|
+
}
|
|
1848
|
+
if (i.expires) {
|
|
1849
|
+
if (typeof i.expires.toUTCString != "function")
|
|
1850
|
+
throw new TypeError("option expires is invalid");
|
|
1851
|
+
o += "; Expires=".concat(i.expires.toUTCString());
|
|
1852
|
+
}
|
|
1853
|
+
if (i.httpOnly && (o += "; HttpOnly"), i.secure && (o += "; Secure"), i.sameSite) {
|
|
1854
|
+
var u = typeof i.sameSite == "string" ? i.sameSite.toLowerCase() : i.sameSite;
|
|
1855
|
+
switch (u) {
|
|
1856
|
+
case !0:
|
|
1857
|
+
o += "; SameSite=Strict";
|
|
1858
|
+
break;
|
|
1859
|
+
case "lax":
|
|
1860
|
+
o += "; SameSite=Lax";
|
|
1861
|
+
break;
|
|
1862
|
+
case "strict":
|
|
1863
|
+
o += "; SameSite=Strict";
|
|
1864
|
+
break;
|
|
1865
|
+
case "none":
|
|
1866
|
+
o += "; SameSite=None";
|
|
1867
|
+
break;
|
|
1868
|
+
default:
|
|
1869
|
+
throw new TypeError("option sameSite is invalid");
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
return o;
|
|
1873
|
+
}, $e = {
|
|
1874
|
+
create: function(e, t, n, i) {
|
|
1875
|
+
var s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
1876
|
+
path: "/",
|
|
1877
|
+
sameSite: "strict"
|
|
1878
|
+
};
|
|
1879
|
+
n && (s.expires = /* @__PURE__ */ new Date(), s.expires.setTime(s.expires.getTime() + n * 60 * 1e3)), i && (s.domain = i), document.cookie = on(e, encodeURIComponent(t), s);
|
|
1880
|
+
},
|
|
1881
|
+
read: function(e) {
|
|
1882
|
+
for (var t = "".concat(e, "="), n = document.cookie.split(";"), i = 0; i < n.length; i++) {
|
|
1883
|
+
for (var s = n[i]; s.charAt(0) === " "; )
|
|
1884
|
+
s = s.substring(1, s.length);
|
|
1885
|
+
if (s.indexOf(t) === 0)
|
|
1886
|
+
return s.substring(t.length, s.length);
|
|
1887
|
+
}
|
|
1888
|
+
return null;
|
|
1889
|
+
},
|
|
1890
|
+
remove: function(e) {
|
|
1891
|
+
this.create(e, "", -1);
|
|
1892
|
+
}
|
|
1893
|
+
}, an = {
|
|
1894
|
+
name: "cookie",
|
|
1895
|
+
lookup: function(e) {
|
|
1896
|
+
var t;
|
|
1897
|
+
if (e.lookupCookie && typeof document < "u") {
|
|
1898
|
+
var n = $e.read(e.lookupCookie);
|
|
1899
|
+
n && (t = n);
|
|
1900
|
+
}
|
|
1901
|
+
return t;
|
|
1902
|
+
},
|
|
1903
|
+
cacheUserLanguage: function(e, t) {
|
|
1904
|
+
t.lookupCookie && typeof document < "u" && $e.create(t.lookupCookie, e, t.cookieMinutes, t.cookieDomain, t.cookieOptions);
|
|
1905
|
+
}
|
|
1906
|
+
}, un = {
|
|
1907
|
+
name: "querystring",
|
|
1908
|
+
lookup: function(e) {
|
|
1909
|
+
var t;
|
|
1910
|
+
if (typeof window < "u") {
|
|
1911
|
+
var n = window.location.search;
|
|
1912
|
+
!window.location.search && window.location.hash && window.location.hash.indexOf("?") > -1 && (n = window.location.hash.substring(window.location.hash.indexOf("?")));
|
|
1913
|
+
for (var i = n.substring(1), s = i.split("&"), o = 0; o < s.length; o++) {
|
|
1914
|
+
var a = s[o].indexOf("=");
|
|
1915
|
+
if (a > 0) {
|
|
1916
|
+
var u = s[o].substring(0, a);
|
|
1917
|
+
u === e.lookupQuerystring && (t = s[o].substring(a + 1));
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
return t;
|
|
1922
|
+
}
|
|
1923
|
+
}, z = null, Ie = function() {
|
|
1924
|
+
if (z !== null)
|
|
1925
|
+
return z;
|
|
1926
|
+
try {
|
|
1927
|
+
z = window !== "undefined" && window.localStorage !== null;
|
|
1928
|
+
var e = "i18next.translate.boo";
|
|
1929
|
+
window.localStorage.setItem(e, "foo"), window.localStorage.removeItem(e);
|
|
1930
|
+
} catch {
|
|
1931
|
+
z = !1;
|
|
1932
|
+
}
|
|
1933
|
+
return z;
|
|
1934
|
+
}, ln = {
|
|
1935
|
+
name: "localStorage",
|
|
1936
|
+
lookup: function(e) {
|
|
1937
|
+
var t;
|
|
1938
|
+
if (e.lookupLocalStorage && Ie()) {
|
|
1939
|
+
var n = window.localStorage.getItem(e.lookupLocalStorage);
|
|
1940
|
+
n && (t = n);
|
|
1941
|
+
}
|
|
1942
|
+
return t;
|
|
1943
|
+
},
|
|
1944
|
+
cacheUserLanguage: function(e, t) {
|
|
1945
|
+
t.lookupLocalStorage && Ie() && window.localStorage.setItem(t.lookupLocalStorage, e);
|
|
1946
|
+
}
|
|
1947
|
+
}, J = null, De = function() {
|
|
1948
|
+
if (J !== null)
|
|
1949
|
+
return J;
|
|
1950
|
+
try {
|
|
1951
|
+
J = window !== "undefined" && window.sessionStorage !== null;
|
|
1952
|
+
var e = "i18next.translate.boo";
|
|
1953
|
+
window.sessionStorage.setItem(e, "foo"), window.sessionStorage.removeItem(e);
|
|
1954
|
+
} catch {
|
|
1955
|
+
J = !1;
|
|
1956
|
+
}
|
|
1957
|
+
return J;
|
|
1958
|
+
}, fn = {
|
|
1959
|
+
name: "sessionStorage",
|
|
1960
|
+
lookup: function(e) {
|
|
1961
|
+
var t;
|
|
1962
|
+
if (e.lookupSessionStorage && De()) {
|
|
1963
|
+
var n = window.sessionStorage.getItem(e.lookupSessionStorage);
|
|
1964
|
+
n && (t = n);
|
|
1965
|
+
}
|
|
1966
|
+
return t;
|
|
1967
|
+
},
|
|
1968
|
+
cacheUserLanguage: function(e, t) {
|
|
1969
|
+
t.lookupSessionStorage && De() && window.sessionStorage.setItem(t.lookupSessionStorage, e);
|
|
1970
|
+
}
|
|
1971
|
+
}, cn = {
|
|
1972
|
+
name: "navigator",
|
|
1973
|
+
lookup: function(e) {
|
|
1974
|
+
var t = [];
|
|
1975
|
+
if (typeof navigator < "u") {
|
|
1976
|
+
if (navigator.languages)
|
|
1977
|
+
for (var n = 0; n < navigator.languages.length; n++)
|
|
1978
|
+
t.push(navigator.languages[n]);
|
|
1979
|
+
navigator.userLanguage && t.push(navigator.userLanguage), navigator.language && t.push(navigator.language);
|
|
1980
|
+
}
|
|
1981
|
+
return t.length > 0 ? t : void 0;
|
|
1982
|
+
}
|
|
1983
|
+
}, dn = {
|
|
1984
|
+
name: "htmlTag",
|
|
1985
|
+
lookup: function(e) {
|
|
1986
|
+
var t, n = e.htmlTag || (typeof document < "u" ? document.documentElement : null);
|
|
1987
|
+
return n && typeof n.getAttribute == "function" && (t = n.getAttribute("lang")), t;
|
|
1988
|
+
}
|
|
1989
|
+
}, hn = {
|
|
1990
|
+
name: "path",
|
|
1991
|
+
lookup: function(e) {
|
|
1992
|
+
var t;
|
|
1993
|
+
if (typeof window < "u") {
|
|
1994
|
+
var n = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
|
|
1995
|
+
if (n instanceof Array)
|
|
1996
|
+
if (typeof e.lookupFromPathIndex == "number") {
|
|
1997
|
+
if (typeof n[e.lookupFromPathIndex] != "string")
|
|
1998
|
+
return;
|
|
1999
|
+
t = n[e.lookupFromPathIndex].replace("/", "");
|
|
2000
|
+
} else
|
|
2001
|
+
t = n[0].replace("/", "");
|
|
2002
|
+
}
|
|
2003
|
+
return t;
|
|
2004
|
+
}
|
|
2005
|
+
}, gn = {
|
|
2006
|
+
name: "subdomain",
|
|
2007
|
+
lookup: function(e) {
|
|
2008
|
+
var t = typeof e.lookupFromSubdomainIndex == "number" ? e.lookupFromSubdomainIndex + 1 : 1, n = typeof window < "u" && window.location && window.location.hostname && window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
|
|
2009
|
+
if (n)
|
|
2010
|
+
return n[t];
|
|
2011
|
+
}
|
|
2012
|
+
};
|
|
2013
|
+
function pn() {
|
|
2014
|
+
return {
|
|
2015
|
+
order: ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"],
|
|
2016
|
+
lookupQuerystring: "lng",
|
|
2017
|
+
lookupCookie: "i18next",
|
|
2018
|
+
lookupLocalStorage: "i18nextLng",
|
|
2019
|
+
lookupSessionStorage: "i18nextLng",
|
|
2020
|
+
// cache user language
|
|
2021
|
+
caches: ["localStorage"],
|
|
2022
|
+
excludeCacheFor: ["cimode"],
|
|
2023
|
+
// cookieMinutes: 10,
|
|
2024
|
+
// cookieDomain: 'myDomain'
|
|
2025
|
+
convertDetectedLanguage: function(e) {
|
|
2026
|
+
return e;
|
|
2027
|
+
}
|
|
2028
|
+
};
|
|
2029
|
+
}
|
|
2030
|
+
var tt = /* @__PURE__ */ function() {
|
|
2031
|
+
function r(e) {
|
|
2032
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2033
|
+
Ye(this, r), this.type = "languageDetector", this.detectors = {}, this.init(e, t);
|
|
2034
|
+
}
|
|
2035
|
+
return Ze(r, [{
|
|
2036
|
+
key: "init",
|
|
2037
|
+
value: function(t) {
|
|
2038
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2039
|
+
this.services = t || {
|
|
2040
|
+
languageUtils: {}
|
|
2041
|
+
}, this.options = sn(n, this.options || {}, pn()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = function(s) {
|
|
2042
|
+
return s.replace("-", "_");
|
|
2043
|
+
}), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = i, this.addDetector(an), this.addDetector(un), this.addDetector(ln), this.addDetector(fn), this.addDetector(cn), this.addDetector(dn), this.addDetector(hn), this.addDetector(gn);
|
|
2044
|
+
}
|
|
2045
|
+
}, {
|
|
2046
|
+
key: "addDetector",
|
|
2047
|
+
value: function(t) {
|
|
2048
|
+
this.detectors[t.name] = t;
|
|
2049
|
+
}
|
|
2050
|
+
}, {
|
|
2051
|
+
key: "detect",
|
|
2052
|
+
value: function(t) {
|
|
2053
|
+
var n = this;
|
|
2054
|
+
t || (t = this.options.order);
|
|
2055
|
+
var i = [];
|
|
2056
|
+
return t.forEach(function(s) {
|
|
2057
|
+
if (n.detectors[s]) {
|
|
2058
|
+
var o = n.detectors[s].lookup(n.options);
|
|
2059
|
+
o && typeof o == "string" && (o = [o]), o && (i = i.concat(o));
|
|
2060
|
+
}
|
|
2061
|
+
}), i = i.map(function(s) {
|
|
2062
|
+
return n.options.convertDetectedLanguage(s);
|
|
2063
|
+
}), this.services.languageUtils.getBestMatchFromCodes ? i : i.length > 0 ? i[0] : null;
|
|
2064
|
+
}
|
|
2065
|
+
}, {
|
|
2066
|
+
key: "cacheUserLanguage",
|
|
2067
|
+
value: function(t, n) {
|
|
2068
|
+
var i = this;
|
|
2069
|
+
n || (n = this.options.caches), n && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(t) > -1 || n.forEach(function(s) {
|
|
2070
|
+
i.detectors[s] && i.detectors[s].cacheUserLanguage(t, i.options);
|
|
2071
|
+
}));
|
|
2072
|
+
}
|
|
2073
|
+
}]), r;
|
|
2074
|
+
}();
|
|
2075
|
+
tt.type = "languageDetector";
|
|
2076
|
+
var nt = [], mn = nt.forEach, yn = nt.slice;
|
|
2077
|
+
function bn(r) {
|
|
2078
|
+
return mn.call(yn.call(arguments, 1), function(e) {
|
|
2079
|
+
if (e)
|
|
2080
|
+
for (var t in e)
|
|
2081
|
+
r[t] === void 0 && (r[t] = e[t]);
|
|
2082
|
+
}), r;
|
|
2083
|
+
}
|
|
2084
|
+
function vn(r) {
|
|
2085
|
+
return r ? typeof r == "function" ? new r() : r : null;
|
|
2086
|
+
}
|
|
2087
|
+
function wn() {
|
|
2088
|
+
return {
|
|
2089
|
+
handleEmptyResourcesAsFailed: !0,
|
|
2090
|
+
cacheHitMode: "none"
|
|
2091
|
+
// reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000
|
|
2092
|
+
// refreshExpirationTime: 60 * 60 * 1000
|
|
2093
|
+
};
|
|
2094
|
+
}
|
|
2095
|
+
function Fe(r, e, t, n) {
|
|
2096
|
+
var i = r.read.bind(r);
|
|
2097
|
+
if (i.length === 2) {
|
|
2098
|
+
try {
|
|
2099
|
+
var s = i(e, t);
|
|
2100
|
+
s && typeof s.then == "function" ? s.then(function(o) {
|
|
2101
|
+
return n(null, o);
|
|
2102
|
+
}).catch(n) : n(null, s);
|
|
2103
|
+
} catch (o) {
|
|
2104
|
+
n(o);
|
|
2105
|
+
}
|
|
2106
|
+
return;
|
|
2107
|
+
}
|
|
2108
|
+
i(e, t, n);
|
|
2109
|
+
}
|
|
2110
|
+
var rt = /* @__PURE__ */ function() {
|
|
2111
|
+
function r(e) {
|
|
2112
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2113
|
+
Ye(this, r), this.backends = [], this.type = "backend", this.allOptions = n, this.init(e, t);
|
|
2114
|
+
}
|
|
2115
|
+
return Ze(r, [{
|
|
2116
|
+
key: "init",
|
|
2117
|
+
value: function(t) {
|
|
2118
|
+
var n = this, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2119
|
+
this.services = t, this.options = bn(i, this.options || {}, wn()), this.allOptions = s, this.options.backends && this.options.backends.forEach(function(o, a) {
|
|
2120
|
+
n.backends[a] = n.backends[a] || vn(o), n.backends[a].init(t, n.options.backendOptions && n.options.backendOptions[a] || {}, s);
|
|
2121
|
+
}), this.services && this.options.reloadInterval && setInterval(function() {
|
|
2122
|
+
return n.reload();
|
|
2123
|
+
}, this.options.reloadInterval);
|
|
2124
|
+
}
|
|
2125
|
+
}, {
|
|
2126
|
+
key: "read",
|
|
2127
|
+
value: function(t, n, i) {
|
|
2128
|
+
var s = this, o = this.backends.length, a = function l(f) {
|
|
2129
|
+
if (f >= o)
|
|
2130
|
+
return i(new Error("non of the backend loaded data", !0));
|
|
2131
|
+
var h = f === o - 1, c = s.options.handleEmptyResourcesAsFailed && !h ? 0 : -1, p = s.backends[f];
|
|
2132
|
+
p.read ? Fe(p, t, n, function(y, m, w) {
|
|
2133
|
+
if (!y && m && Object.keys(m).length > c) {
|
|
2134
|
+
if (i(null, m, f), u(f - 1, m), p.save && s.options.cacheHitMode && ["refresh", "refreshAndUpdateStore"].indexOf(s.options.cacheHitMode) > -1) {
|
|
2135
|
+
if (w && s.options.refreshExpirationTime && w + s.options.refreshExpirationTime > Date.now())
|
|
2136
|
+
return;
|
|
2137
|
+
var E = s.backends[f + 1];
|
|
2138
|
+
E && E.read && Fe(E, t, n, function(L, N) {
|
|
2139
|
+
L || N && (Object.keys(N).length <= c || (u(f, N), s.options.cacheHitMode === "refreshAndUpdateStore" && s.services && s.services.resourceStore && s.services.resourceStore.addResourceBundle(t, n, N)));
|
|
2140
|
+
});
|
|
2141
|
+
}
|
|
2142
|
+
} else
|
|
2143
|
+
l(f + 1);
|
|
2144
|
+
}) : l(f + 1);
|
|
2145
|
+
}, u = function l(f, h) {
|
|
2146
|
+
if (!(f < 0)) {
|
|
2147
|
+
var c = s.backends[f];
|
|
2148
|
+
c.save && c.save(t, n, h), l(f - 1, h);
|
|
2149
|
+
}
|
|
2150
|
+
};
|
|
2151
|
+
a(0);
|
|
2152
|
+
}
|
|
2153
|
+
}, {
|
|
2154
|
+
key: "create",
|
|
2155
|
+
value: function(t, n, i, s) {
|
|
2156
|
+
var o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : function() {
|
|
2157
|
+
}, a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
|
|
2158
|
+
this.backends.forEach(function(u) {
|
|
2159
|
+
if (u.create) {
|
|
2160
|
+
var l = u.create.bind(u);
|
|
2161
|
+
if (l.length < 6) {
|
|
2162
|
+
try {
|
|
2163
|
+
var f;
|
|
2164
|
+
l.length === 5 ? f = l(t, n, i, s, a) : f = l(t, n, i, s), f && typeof f.then == "function" ? f.then(function(h) {
|
|
2165
|
+
return o(null, h);
|
|
2166
|
+
}).catch(o) : o(null, f);
|
|
2167
|
+
} catch (h) {
|
|
2168
|
+
o(h);
|
|
2169
|
+
}
|
|
2170
|
+
return;
|
|
2171
|
+
}
|
|
2172
|
+
l(t, n, i, s, o, a);
|
|
2173
|
+
}
|
|
2174
|
+
});
|
|
2175
|
+
}
|
|
2176
|
+
}, {
|
|
2177
|
+
key: "reload",
|
|
2178
|
+
value: function() {
|
|
2179
|
+
var t = this, n = this.services, i = n.backendConnector, s = n.languageUtils, o = n.logger, a = i.language;
|
|
2180
|
+
if (!(a && a.toLowerCase() === "cimode")) {
|
|
2181
|
+
var u = [], l = function(h) {
|
|
2182
|
+
var c = s.toResolveHierarchy(h);
|
|
2183
|
+
c.forEach(function(p) {
|
|
2184
|
+
u.indexOf(p) < 0 && u.push(p);
|
|
2185
|
+
});
|
|
2186
|
+
};
|
|
2187
|
+
l(a), this.allOptions.preload && this.allOptions.preload.forEach(function(f) {
|
|
2188
|
+
return l(f);
|
|
2189
|
+
}), u.forEach(function(f) {
|
|
2190
|
+
t.allOptions.ns.forEach(function(h) {
|
|
2191
|
+
i.read(f, h, "read", null, null, function(c, p) {
|
|
2192
|
+
c && o.warn("loading namespace ".concat(h, " for language ").concat(f, " failed"), c), !c && p && o.log("loaded namespace ".concat(h, " for language ").concat(f), p), i.loaded("".concat(f, "|").concat(h), c, p);
|
|
2193
|
+
});
|
|
2194
|
+
});
|
|
2195
|
+
});
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
}]), r;
|
|
2199
|
+
}();
|
|
2200
|
+
rt.type = "backend";
|
|
2201
|
+
function ye(r) {
|
|
2202
|
+
"@babel/helpers - typeof";
|
|
2203
|
+
return ye = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2204
|
+
return typeof e;
|
|
2205
|
+
} : function(e) {
|
|
2206
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2207
|
+
}, ye(r);
|
|
2208
|
+
}
|
|
2209
|
+
function it() {
|
|
2210
|
+
return typeof XMLHttpRequest == "function" || (typeof XMLHttpRequest > "u" ? "undefined" : ye(XMLHttpRequest)) === "object";
|
|
2211
|
+
}
|
|
2212
|
+
function xn(r) {
|
|
2213
|
+
return !!r && typeof r.then == "function";
|
|
2214
|
+
}
|
|
2215
|
+
function Sn(r) {
|
|
2216
|
+
return xn(r) ? r : Promise.resolve(r);
|
|
2217
|
+
}
|
|
2218
|
+
function On(r) {
|
|
2219
|
+
throw new Error('Could not dynamically require "' + r + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
2220
|
+
}
|
|
2221
|
+
var be = { exports: {} }, re = { exports: {} }, Ue;
|
|
2222
|
+
function Pn() {
|
|
2223
|
+
return Ue || (Ue = 1, function(r, e) {
|
|
2224
|
+
var t = typeof globalThis < "u" && globalThis || typeof self < "u" && self || typeof X < "u" && X, n = function() {
|
|
2225
|
+
function s() {
|
|
2226
|
+
this.fetch = !1, this.DOMException = t.DOMException;
|
|
2227
|
+
}
|
|
2228
|
+
return s.prototype = t, new s();
|
|
2229
|
+
}();
|
|
2230
|
+
(function(s) {
|
|
2231
|
+
(function(o) {
|
|
2232
|
+
var a = typeof s < "u" && s || typeof self < "u" && self || typeof a < "u" && a, u = {
|
|
2233
|
+
searchParams: "URLSearchParams" in a,
|
|
2234
|
+
iterable: "Symbol" in a && "iterator" in Symbol,
|
|
2235
|
+
blob: "FileReader" in a && "Blob" in a && function() {
|
|
2236
|
+
try {
|
|
2237
|
+
return new Blob(), !0;
|
|
2238
|
+
} catch {
|
|
2239
|
+
return !1;
|
|
2240
|
+
}
|
|
2241
|
+
}(),
|
|
2242
|
+
formData: "FormData" in a,
|
|
2243
|
+
arrayBuffer: "ArrayBuffer" in a
|
|
2244
|
+
};
|
|
2245
|
+
function l(d) {
|
|
2246
|
+
return d && DataView.prototype.isPrototypeOf(d);
|
|
2247
|
+
}
|
|
2248
|
+
if (u.arrayBuffer)
|
|
2249
|
+
var f = [
|
|
2250
|
+
"[object Int8Array]",
|
|
2251
|
+
"[object Uint8Array]",
|
|
2252
|
+
"[object Uint8ClampedArray]",
|
|
2253
|
+
"[object Int16Array]",
|
|
2254
|
+
"[object Uint16Array]",
|
|
2255
|
+
"[object Int32Array]",
|
|
2256
|
+
"[object Uint32Array]",
|
|
2257
|
+
"[object Float32Array]",
|
|
2258
|
+
"[object Float64Array]"
|
|
2259
|
+
], h = ArrayBuffer.isView || function(d) {
|
|
2260
|
+
return d && f.indexOf(Object.prototype.toString.call(d)) > -1;
|
|
2261
|
+
};
|
|
2262
|
+
function c(d) {
|
|
2263
|
+
if (typeof d != "string" && (d = String(d)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(d) || d === "")
|
|
2264
|
+
throw new TypeError('Invalid character in header field name: "' + d + '"');
|
|
2265
|
+
return d.toLowerCase();
|
|
2266
|
+
}
|
|
2267
|
+
function p(d) {
|
|
2268
|
+
return typeof d != "string" && (d = String(d)), d;
|
|
2269
|
+
}
|
|
2270
|
+
function y(d) {
|
|
2271
|
+
var g = {
|
|
2272
|
+
next: function() {
|
|
2273
|
+
var b = d.shift();
|
|
2274
|
+
return { done: b === void 0, value: b };
|
|
2275
|
+
}
|
|
2276
|
+
};
|
|
2277
|
+
return u.iterable && (g[Symbol.iterator] = function() {
|
|
2278
|
+
return g;
|
|
2279
|
+
}), g;
|
|
2280
|
+
}
|
|
2281
|
+
function m(d) {
|
|
2282
|
+
this.map = {}, d instanceof m ? d.forEach(function(g, b) {
|
|
2283
|
+
this.append(b, g);
|
|
2284
|
+
}, this) : Array.isArray(d) ? d.forEach(function(g) {
|
|
2285
|
+
this.append(g[0], g[1]);
|
|
2286
|
+
}, this) : d && Object.getOwnPropertyNames(d).forEach(function(g) {
|
|
2287
|
+
this.append(g, d[g]);
|
|
2288
|
+
}, this);
|
|
2289
|
+
}
|
|
2290
|
+
m.prototype.append = function(d, g) {
|
|
2291
|
+
d = c(d), g = p(g);
|
|
2292
|
+
var b = this.map[d];
|
|
2293
|
+
this.map[d] = b ? b + ", " + g : g;
|
|
2294
|
+
}, m.prototype.delete = function(d) {
|
|
2295
|
+
delete this.map[c(d)];
|
|
2296
|
+
}, m.prototype.get = function(d) {
|
|
2297
|
+
return d = c(d), this.has(d) ? this.map[d] : null;
|
|
2298
|
+
}, m.prototype.has = function(d) {
|
|
2299
|
+
return this.map.hasOwnProperty(c(d));
|
|
2300
|
+
}, m.prototype.set = function(d, g) {
|
|
2301
|
+
this.map[c(d)] = p(g);
|
|
2302
|
+
}, m.prototype.forEach = function(d, g) {
|
|
2303
|
+
for (var b in this.map)
|
|
2304
|
+
this.map.hasOwnProperty(b) && d.call(g, this.map[b], b, this);
|
|
2305
|
+
}, m.prototype.keys = function() {
|
|
2306
|
+
var d = [];
|
|
2307
|
+
return this.forEach(function(g, b) {
|
|
2308
|
+
d.push(b);
|
|
2309
|
+
}), y(d);
|
|
2310
|
+
}, m.prototype.values = function() {
|
|
2311
|
+
var d = [];
|
|
2312
|
+
return this.forEach(function(g) {
|
|
2313
|
+
d.push(g);
|
|
2314
|
+
}), y(d);
|
|
2315
|
+
}, m.prototype.entries = function() {
|
|
2316
|
+
var d = [];
|
|
2317
|
+
return this.forEach(function(g, b) {
|
|
2318
|
+
d.push([b, g]);
|
|
2319
|
+
}), y(d);
|
|
2320
|
+
}, u.iterable && (m.prototype[Symbol.iterator] = m.prototype.entries);
|
|
2321
|
+
function w(d) {
|
|
2322
|
+
if (d.bodyUsed)
|
|
2323
|
+
return Promise.reject(new TypeError("Already read"));
|
|
2324
|
+
d.bodyUsed = !0;
|
|
2325
|
+
}
|
|
2326
|
+
function E(d) {
|
|
2327
|
+
return new Promise(function(g, b) {
|
|
2328
|
+
d.onload = function() {
|
|
2329
|
+
g(d.result);
|
|
2330
|
+
}, d.onerror = function() {
|
|
2331
|
+
b(d.error);
|
|
2332
|
+
};
|
|
2333
|
+
});
|
|
2334
|
+
}
|
|
2335
|
+
function L(d) {
|
|
2336
|
+
var g = new FileReader(), b = E(g);
|
|
2337
|
+
return g.readAsArrayBuffer(d), b;
|
|
2338
|
+
}
|
|
2339
|
+
function N(d) {
|
|
2340
|
+
var g = new FileReader(), b = E(g);
|
|
2341
|
+
return g.readAsText(d), b;
|
|
2342
|
+
}
|
|
2343
|
+
function x(d) {
|
|
2344
|
+
for (var g = new Uint8Array(d), b = new Array(g.length), v = 0; v < g.length; v++)
|
|
2345
|
+
b[v] = String.fromCharCode(g[v]);
|
|
2346
|
+
return b.join("");
|
|
2347
|
+
}
|
|
2348
|
+
function k(d) {
|
|
2349
|
+
if (d.slice)
|
|
2350
|
+
return d.slice(0);
|
|
2351
|
+
var g = new Uint8Array(d.byteLength);
|
|
2352
|
+
return g.set(new Uint8Array(d)), g.buffer;
|
|
2353
|
+
}
|
|
2354
|
+
function C() {
|
|
2355
|
+
return this.bodyUsed = !1, this._initBody = function(d) {
|
|
2356
|
+
this.bodyUsed = this.bodyUsed, this._bodyInit = d, d ? typeof d == "string" ? this._bodyText = d : u.blob && Blob.prototype.isPrototypeOf(d) ? this._bodyBlob = d : u.formData && FormData.prototype.isPrototypeOf(d) ? this._bodyFormData = d : u.searchParams && URLSearchParams.prototype.isPrototypeOf(d) ? this._bodyText = d.toString() : u.arrayBuffer && u.blob && l(d) ? (this._bodyArrayBuffer = k(d.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : u.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(d) || h(d)) ? this._bodyArrayBuffer = k(d) : this._bodyText = d = Object.prototype.toString.call(d) : this._bodyText = "", this.headers.get("content-type") || (typeof d == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : u.searchParams && URLSearchParams.prototype.isPrototypeOf(d) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
|
2357
|
+
}, u.blob && (this.blob = function() {
|
|
2358
|
+
var d = w(this);
|
|
2359
|
+
if (d)
|
|
2360
|
+
return d;
|
|
2361
|
+
if (this._bodyBlob)
|
|
2362
|
+
return Promise.resolve(this._bodyBlob);
|
|
2363
|
+
if (this._bodyArrayBuffer)
|
|
2364
|
+
return Promise.resolve(new Blob([this._bodyArrayBuffer]));
|
|
2365
|
+
if (this._bodyFormData)
|
|
2366
|
+
throw new Error("could not read FormData body as blob");
|
|
2367
|
+
return Promise.resolve(new Blob([this._bodyText]));
|
|
2368
|
+
}, this.arrayBuffer = function() {
|
|
2369
|
+
if (this._bodyArrayBuffer) {
|
|
2370
|
+
var d = w(this);
|
|
2371
|
+
return d || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(
|
|
2372
|
+
this._bodyArrayBuffer.buffer.slice(
|
|
2373
|
+
this._bodyArrayBuffer.byteOffset,
|
|
2374
|
+
this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
|
|
2375
|
+
)
|
|
2376
|
+
) : Promise.resolve(this._bodyArrayBuffer));
|
|
2377
|
+
} else
|
|
2378
|
+
return this.blob().then(L);
|
|
2379
|
+
}), this.text = function() {
|
|
2380
|
+
var d = w(this);
|
|
2381
|
+
if (d)
|
|
2382
|
+
return d;
|
|
2383
|
+
if (this._bodyBlob)
|
|
2384
|
+
return N(this._bodyBlob);
|
|
2385
|
+
if (this._bodyArrayBuffer)
|
|
2386
|
+
return Promise.resolve(x(this._bodyArrayBuffer));
|
|
2387
|
+
if (this._bodyFormData)
|
|
2388
|
+
throw new Error("could not read FormData body as text");
|
|
2389
|
+
return Promise.resolve(this._bodyText);
|
|
2390
|
+
}, u.formData && (this.formData = function() {
|
|
2391
|
+
return this.text().then(ee);
|
|
2392
|
+
}), this.json = function() {
|
|
2393
|
+
return this.text().then(JSON.parse);
|
|
2394
|
+
}, this;
|
|
2395
|
+
}
|
|
2396
|
+
var P = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
|
|
2397
|
+
function H(d) {
|
|
2398
|
+
var g = d.toUpperCase();
|
|
2399
|
+
return P.indexOf(g) > -1 ? g : d;
|
|
2400
|
+
}
|
|
2401
|
+
function I(d, g) {
|
|
2402
|
+
if (!(this instanceof I))
|
|
2403
|
+
throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
|
|
2404
|
+
g = g || {};
|
|
2405
|
+
var b = g.body;
|
|
2406
|
+
if (d instanceof I) {
|
|
2407
|
+
if (d.bodyUsed)
|
|
2408
|
+
throw new TypeError("Already read");
|
|
2409
|
+
this.url = d.url, this.credentials = d.credentials, g.headers || (this.headers = new m(d.headers)), this.method = d.method, this.mode = d.mode, this.signal = d.signal, !b && d._bodyInit != null && (b = d._bodyInit, d.bodyUsed = !0);
|
|
2410
|
+
} else
|
|
2411
|
+
this.url = String(d);
|
|
2412
|
+
if (this.credentials = g.credentials || this.credentials || "same-origin", (g.headers || !this.headers) && (this.headers = new m(g.headers)), this.method = H(g.method || this.method || "GET"), this.mode = g.mode || this.mode || null, this.signal = g.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && b)
|
|
2413
|
+
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
2414
|
+
if (this._initBody(b), (this.method === "GET" || this.method === "HEAD") && (g.cache === "no-store" || g.cache === "no-cache")) {
|
|
2415
|
+
var v = /([?&])_=[^&]*/;
|
|
2416
|
+
if (v.test(this.url))
|
|
2417
|
+
this.url = this.url.replace(v, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
|
|
2418
|
+
else {
|
|
2419
|
+
var O = /\?/;
|
|
2420
|
+
this.url += (O.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
I.prototype.clone = function() {
|
|
2425
|
+
return new I(this, { body: this._bodyInit });
|
|
2426
|
+
};
|
|
2427
|
+
function ee(d) {
|
|
2428
|
+
var g = new FormData();
|
|
2429
|
+
return d.trim().split("&").forEach(function(b) {
|
|
2430
|
+
if (b) {
|
|
2431
|
+
var v = b.split("="), O = v.shift().replace(/\+/g, " "), S = v.join("=").replace(/\+/g, " ");
|
|
2432
|
+
g.append(decodeURIComponent(O), decodeURIComponent(S));
|
|
2433
|
+
}
|
|
2434
|
+
}), g;
|
|
2435
|
+
}
|
|
2436
|
+
function _(d) {
|
|
2437
|
+
var g = new m(), b = d.replace(/\r?\n[\t ]+/g, " ");
|
|
2438
|
+
return b.split("\r").map(function(v) {
|
|
2439
|
+
return v.indexOf(`
|
|
2440
|
+
`) === 0 ? v.substr(1, v.length) : v;
|
|
2441
|
+
}).forEach(function(v) {
|
|
2442
|
+
var O = v.split(":"), S = O.shift().trim();
|
|
2443
|
+
if (S) {
|
|
2444
|
+
var B = O.join(":").trim();
|
|
2445
|
+
g.append(S, B);
|
|
2446
|
+
}
|
|
2447
|
+
}), g;
|
|
2448
|
+
}
|
|
2449
|
+
C.call(I.prototype);
|
|
2450
|
+
function T(d, g) {
|
|
2451
|
+
if (!(this instanceof T))
|
|
2452
|
+
throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
|
|
2453
|
+
g || (g = {}), this.type = "default", this.status = g.status === void 0 ? 200 : g.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = g.statusText === void 0 ? "" : "" + g.statusText, this.headers = new m(g.headers), this.url = g.url || "", this._initBody(d);
|
|
2454
|
+
}
|
|
2455
|
+
C.call(T.prototype), T.prototype.clone = function() {
|
|
2456
|
+
return new T(this._bodyInit, {
|
|
2457
|
+
status: this.status,
|
|
2458
|
+
statusText: this.statusText,
|
|
2459
|
+
headers: new m(this.headers),
|
|
2460
|
+
url: this.url
|
|
2461
|
+
});
|
|
2462
|
+
}, T.error = function() {
|
|
2463
|
+
var d = new T(null, { status: 0, statusText: "" });
|
|
2464
|
+
return d.type = "error", d;
|
|
2465
|
+
};
|
|
2466
|
+
var ce = [301, 302, 303, 307, 308];
|
|
2467
|
+
T.redirect = function(d, g) {
|
|
2468
|
+
if (ce.indexOf(g) === -1)
|
|
2469
|
+
throw new RangeError("Invalid status code");
|
|
2470
|
+
return new T(null, { status: g, headers: { location: d } });
|
|
2471
|
+
}, o.DOMException = a.DOMException;
|
|
2472
|
+
try {
|
|
2473
|
+
new o.DOMException();
|
|
2474
|
+
} catch {
|
|
2475
|
+
o.DOMException = function(g, b) {
|
|
2476
|
+
this.message = g, this.name = b;
|
|
2477
|
+
var v = Error(g);
|
|
2478
|
+
this.stack = v.stack;
|
|
2479
|
+
}, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
|
|
2480
|
+
}
|
|
2481
|
+
function F(d, g) {
|
|
2482
|
+
return new Promise(function(b, v) {
|
|
2483
|
+
var O = new I(d, g);
|
|
2484
|
+
if (O.signal && O.signal.aborted)
|
|
2485
|
+
return v(new o.DOMException("Aborted", "AbortError"));
|
|
2486
|
+
var S = new XMLHttpRequest();
|
|
2487
|
+
function B() {
|
|
2488
|
+
S.abort();
|
|
2489
|
+
}
|
|
2490
|
+
S.onload = function() {
|
|
2491
|
+
var A = {
|
|
2492
|
+
status: S.status,
|
|
2493
|
+
statusText: S.statusText,
|
|
2494
|
+
headers: _(S.getAllResponseHeaders() || "")
|
|
2495
|
+
};
|
|
2496
|
+
A.url = "responseURL" in S ? S.responseURL : A.headers.get("X-Request-URL");
|
|
2497
|
+
var te = "response" in S ? S.response : S.responseText;
|
|
2498
|
+
setTimeout(function() {
|
|
2499
|
+
b(new T(te, A));
|
|
2500
|
+
}, 0);
|
|
2501
|
+
}, S.onerror = function() {
|
|
2502
|
+
setTimeout(function() {
|
|
2503
|
+
v(new TypeError("Network request failed"));
|
|
2504
|
+
}, 0);
|
|
2505
|
+
}, S.ontimeout = function() {
|
|
2506
|
+
setTimeout(function() {
|
|
2507
|
+
v(new TypeError("Network request failed"));
|
|
2508
|
+
}, 0);
|
|
2509
|
+
}, S.onabort = function() {
|
|
2510
|
+
setTimeout(function() {
|
|
2511
|
+
v(new o.DOMException("Aborted", "AbortError"));
|
|
2512
|
+
}, 0);
|
|
2513
|
+
};
|
|
2514
|
+
function ft(A) {
|
|
2515
|
+
try {
|
|
2516
|
+
return A === "" && a.location.href ? a.location.href : A;
|
|
2517
|
+
} catch {
|
|
2518
|
+
return A;
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
S.open(O.method, ft(O.url), !0), O.credentials === "include" ? S.withCredentials = !0 : O.credentials === "omit" && (S.withCredentials = !1), "responseType" in S && (u.blob ? S.responseType = "blob" : u.arrayBuffer && O.headers.get("Content-Type") && O.headers.get("Content-Type").indexOf("application/octet-stream") !== -1 && (S.responseType = "arraybuffer")), g && typeof g.headers == "object" && !(g.headers instanceof m) ? Object.getOwnPropertyNames(g.headers).forEach(function(A) {
|
|
2522
|
+
S.setRequestHeader(A, p(g.headers[A]));
|
|
2523
|
+
}) : O.headers.forEach(function(A, te) {
|
|
2524
|
+
S.setRequestHeader(te, A);
|
|
2525
|
+
}), O.signal && (O.signal.addEventListener("abort", B), S.onreadystatechange = function() {
|
|
2526
|
+
S.readyState === 4 && O.signal.removeEventListener("abort", B);
|
|
2527
|
+
}), S.send(typeof O._bodyInit > "u" ? null : O._bodyInit);
|
|
2528
|
+
});
|
|
2529
|
+
}
|
|
2530
|
+
return F.polyfill = !0, a.fetch || (a.fetch = F, a.Headers = m, a.Request = I, a.Response = T), o.Headers = m, o.Request = I, o.Response = T, o.fetch = F, o;
|
|
2531
|
+
})({});
|
|
2532
|
+
})(n), n.fetch.ponyfill = !0, delete n.fetch.polyfill;
|
|
2533
|
+
var i = t.fetch ? t : n;
|
|
2534
|
+
e = i.fetch, e.default = i.fetch, e.fetch = i.fetch, e.Headers = i.Headers, e.Request = i.Request, e.Response = i.Response, r.exports = e;
|
|
2535
|
+
}(re, re.exports)), re.exports;
|
|
2536
|
+
}
|
|
2537
|
+
(function(r, e) {
|
|
2538
|
+
var t;
|
|
2539
|
+
if (typeof fetch == "function" && (typeof X < "u" && X.fetch ? t = X.fetch : typeof window < "u" && window.fetch ? t = window.fetch : t = fetch), typeof On < "u" && (typeof window > "u" || typeof window.document > "u")) {
|
|
2540
|
+
var n = t || Pn();
|
|
2541
|
+
n.default && (n = n.default), e.default = n, r.exports = e.default;
|
|
2542
|
+
}
|
|
2543
|
+
})(be, be.exports);
|
|
2544
|
+
var st = be.exports;
|
|
2545
|
+
const ot = /* @__PURE__ */ ct(st), _e = /* @__PURE__ */ ht({
|
|
2546
|
+
__proto__: null,
|
|
2547
|
+
default: ot
|
|
2548
|
+
}, [st]);
|
|
2549
|
+
function Be(r, e) {
|
|
2550
|
+
var t = Object.keys(r);
|
|
2551
|
+
if (Object.getOwnPropertySymbols) {
|
|
2552
|
+
var n = Object.getOwnPropertySymbols(r);
|
|
2553
|
+
e && (n = n.filter(function(i) {
|
|
2554
|
+
return Object.getOwnPropertyDescriptor(r, i).enumerable;
|
|
2555
|
+
})), t.push.apply(t, n);
|
|
2556
|
+
}
|
|
2557
|
+
return t;
|
|
2558
|
+
}
|
|
2559
|
+
function Me(r) {
|
|
2560
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
2561
|
+
var t = arguments[e] != null ? arguments[e] : {};
|
|
2562
|
+
e % 2 ? Be(Object(t), !0).forEach(function(n) {
|
|
2563
|
+
Ln(r, n, t[n]);
|
|
2564
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : Be(Object(t)).forEach(function(n) {
|
|
2565
|
+
Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(t, n));
|
|
2566
|
+
});
|
|
2567
|
+
}
|
|
2568
|
+
return r;
|
|
2569
|
+
}
|
|
2570
|
+
function Ln(r, e, t) {
|
|
2571
|
+
return e = kn(e), e in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
|
|
2572
|
+
}
|
|
2573
|
+
function kn(r) {
|
|
2574
|
+
var e = Cn(r, "string");
|
|
2575
|
+
return M(e) == "symbol" ? e : String(e);
|
|
2576
|
+
}
|
|
2577
|
+
function Cn(r, e) {
|
|
2578
|
+
if (M(r) != "object" || !r)
|
|
2579
|
+
return r;
|
|
2580
|
+
var t = r[Symbol.toPrimitive];
|
|
2581
|
+
if (t !== void 0) {
|
|
2582
|
+
var n = t.call(r, e || "default");
|
|
2583
|
+
if (M(n) != "object")
|
|
2584
|
+
return n;
|
|
2585
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2586
|
+
}
|
|
2587
|
+
return (e === "string" ? String : Number)(r);
|
|
2588
|
+
}
|
|
2589
|
+
function M(r) {
|
|
2590
|
+
"@babel/helpers - typeof";
|
|
2591
|
+
return M = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2592
|
+
return typeof e;
|
|
2593
|
+
} : function(e) {
|
|
2594
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2595
|
+
}, M(r);
|
|
2596
|
+
}
|
|
2597
|
+
var U;
|
|
2598
|
+
typeof fetch == "function" && (typeof global < "u" && global.fetch ? U = global.fetch : typeof window < "u" && window.fetch ? U = window.fetch : U = fetch);
|
|
2599
|
+
var Y;
|
|
2600
|
+
it() && (typeof global < "u" && global.XMLHttpRequest ? Y = global.XMLHttpRequest : typeof window < "u" && window.XMLHttpRequest && (Y = window.XMLHttpRequest));
|
|
2601
|
+
var le;
|
|
2602
|
+
typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObject ? le = global.ActiveXObject : typeof window < "u" && window.ActiveXObject && (le = window.ActiveXObject));
|
|
2603
|
+
!U && _e && !Y && !le && (U = ot || _e);
|
|
2604
|
+
typeof U != "function" && (U = void 0);
|
|
2605
|
+
var ve = function(e, t) {
|
|
2606
|
+
if (t && M(t) === "object") {
|
|
2607
|
+
var n = "";
|
|
2608
|
+
for (var i in t)
|
|
2609
|
+
n += "&" + encodeURIComponent(i) + "=" + encodeURIComponent(t[i]);
|
|
2610
|
+
if (!n)
|
|
2611
|
+
return e;
|
|
2612
|
+
e = e + (e.indexOf("?") !== -1 ? "&" : "?") + n.slice(1);
|
|
2613
|
+
}
|
|
2614
|
+
return e;
|
|
2615
|
+
}, He = function(e, t, n, i) {
|
|
2616
|
+
var s = function(u) {
|
|
2617
|
+
if (!u.ok)
|
|
2618
|
+
return n(u.statusText || "Error", {
|
|
2619
|
+
status: u.status
|
|
2620
|
+
});
|
|
2621
|
+
u.text().then(function(l) {
|
|
2622
|
+
n(null, {
|
|
2623
|
+
status: u.status,
|
|
2624
|
+
data: l
|
|
2625
|
+
});
|
|
2626
|
+
}).catch(n);
|
|
2627
|
+
};
|
|
2628
|
+
if (i) {
|
|
2629
|
+
var o = i(e, t);
|
|
2630
|
+
if (o instanceof Promise) {
|
|
2631
|
+
o.then(s).catch(n);
|
|
2632
|
+
return;
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
typeof fetch == "function" ? fetch(e, t).then(s).catch(n) : U(e, t).then(s).catch(n);
|
|
2636
|
+
}, qe = !1, En = function(e, t, n, i) {
|
|
2637
|
+
e.queryStringParams && (t = ve(t, e.queryStringParams));
|
|
2638
|
+
var s = Me({}, typeof e.customHeaders == "function" ? e.customHeaders() : e.customHeaders);
|
|
2639
|
+
typeof window > "u" && typeof global < "u" && typeof global.process < "u" && global.process.versions && global.process.versions.node && (s["User-Agent"] = "i18next-http-backend (node/".concat(global.process.version, "; ").concat(global.process.platform, " ").concat(global.process.arch, ")")), n && (s["Content-Type"] = "application/json");
|
|
2640
|
+
var o = typeof e.requestOptions == "function" ? e.requestOptions(n) : e.requestOptions, a = Me({
|
|
2641
|
+
method: n ? "POST" : "GET",
|
|
2642
|
+
body: n ? e.stringify(n) : void 0,
|
|
2643
|
+
headers: s
|
|
2644
|
+
}, qe ? {} : o), u = typeof e.alternateFetch == "function" && e.alternateFetch.length >= 1 ? e.alternateFetch : void 0;
|
|
2645
|
+
try {
|
|
2646
|
+
He(t, a, i, u);
|
|
2647
|
+
} catch (l) {
|
|
2648
|
+
if (!o || Object.keys(o).length === 0 || !l.message || l.message.indexOf("not implemented") < 0)
|
|
2649
|
+
return i(l);
|
|
2650
|
+
try {
|
|
2651
|
+
Object.keys(o).forEach(function(f) {
|
|
2652
|
+
delete a[f];
|
|
2653
|
+
}), He(t, a, i, u), qe = !0;
|
|
2654
|
+
} catch (f) {
|
|
2655
|
+
i(f);
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
}, Rn = function(e, t, n, i) {
|
|
2659
|
+
n && M(n) === "object" && (n = ve("", n).slice(1)), e.queryStringParams && (t = ve(t, e.queryStringParams));
|
|
2660
|
+
try {
|
|
2661
|
+
var s;
|
|
2662
|
+
Y ? s = new Y() : s = new le("MSXML2.XMLHTTP.3.0"), s.open(n ? "POST" : "GET", t, 1), e.crossDomain || s.setRequestHeader("X-Requested-With", "XMLHttpRequest"), s.withCredentials = !!e.withCredentials, n && s.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), s.overrideMimeType && s.overrideMimeType("application/json");
|
|
2663
|
+
var o = e.customHeaders;
|
|
2664
|
+
if (o = typeof o == "function" ? o() : o, o)
|
|
2665
|
+
for (var a in o)
|
|
2666
|
+
s.setRequestHeader(a, o[a]);
|
|
2667
|
+
s.onreadystatechange = function() {
|
|
2668
|
+
s.readyState > 3 && i(s.status >= 400 ? s.statusText : null, {
|
|
2669
|
+
status: s.status,
|
|
2670
|
+
data: s.responseText
|
|
2671
|
+
});
|
|
2672
|
+
}, s.send(n);
|
|
2673
|
+
} catch (u) {
|
|
2674
|
+
console && console.log(u);
|
|
2675
|
+
}
|
|
2676
|
+
}, Nn = function(e, t, n, i) {
|
|
2677
|
+
if (typeof n == "function" && (i = n, n = void 0), i = i || function() {
|
|
2678
|
+
}, U && t.indexOf("file:") !== 0)
|
|
2679
|
+
return En(e, t, n, i);
|
|
2680
|
+
if (it() || typeof ActiveXObject == "function")
|
|
2681
|
+
return Rn(e, t, n, i);
|
|
2682
|
+
i(new Error("No fetch and no xhr implementation found!"));
|
|
2683
|
+
};
|
|
2684
|
+
function Z(r) {
|
|
2685
|
+
"@babel/helpers - typeof";
|
|
2686
|
+
return Z = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2687
|
+
return typeof e;
|
|
2688
|
+
} : function(e) {
|
|
2689
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2690
|
+
}, Z(r);
|
|
2691
|
+
}
|
|
2692
|
+
function Ve(r, e) {
|
|
2693
|
+
var t = Object.keys(r);
|
|
2694
|
+
if (Object.getOwnPropertySymbols) {
|
|
2695
|
+
var n = Object.getOwnPropertySymbols(r);
|
|
2696
|
+
e && (n = n.filter(function(i) {
|
|
2697
|
+
return Object.getOwnPropertyDescriptor(r, i).enumerable;
|
|
2698
|
+
})), t.push.apply(t, n);
|
|
2699
|
+
}
|
|
2700
|
+
return t;
|
|
2701
|
+
}
|
|
2702
|
+
function he(r) {
|
|
2703
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
2704
|
+
var t = arguments[e] != null ? arguments[e] : {};
|
|
2705
|
+
e % 2 ? Ve(Object(t), !0).forEach(function(n) {
|
|
2706
|
+
at(r, n, t[n]);
|
|
2707
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : Ve(Object(t)).forEach(function(n) {
|
|
2708
|
+
Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(t, n));
|
|
2709
|
+
});
|
|
2710
|
+
}
|
|
2711
|
+
return r;
|
|
2712
|
+
}
|
|
2713
|
+
function jn(r, e) {
|
|
2714
|
+
if (!(r instanceof e))
|
|
2715
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2716
|
+
}
|
|
2717
|
+
function Ke(r, e) {
|
|
2718
|
+
for (var t = 0; t < e.length; t++) {
|
|
2719
|
+
var n = e[t];
|
|
2720
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(r, ut(n.key), n);
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
function Tn(r, e, t) {
|
|
2724
|
+
return e && Ke(r.prototype, e), t && Ke(r, t), Object.defineProperty(r, "prototype", { writable: !1 }), r;
|
|
2725
|
+
}
|
|
2726
|
+
function at(r, e, t) {
|
|
2727
|
+
return e = ut(e), e in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
|
|
2728
|
+
}
|
|
2729
|
+
function ut(r) {
|
|
2730
|
+
var e = An(r, "string");
|
|
2731
|
+
return Z(e) == "symbol" ? e : String(e);
|
|
2732
|
+
}
|
|
2733
|
+
function An(r, e) {
|
|
2734
|
+
if (Z(r) != "object" || !r)
|
|
2735
|
+
return r;
|
|
2736
|
+
var t = r[Symbol.toPrimitive];
|
|
2737
|
+
if (t !== void 0) {
|
|
2738
|
+
var n = t.call(r, e || "default");
|
|
2739
|
+
if (Z(n) != "object")
|
|
2740
|
+
return n;
|
|
2741
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2742
|
+
}
|
|
2743
|
+
return (e === "string" ? String : Number)(r);
|
|
2744
|
+
}
|
|
2745
|
+
var $n = function() {
|
|
2746
|
+
return {
|
|
2747
|
+
loadPath: "/locales/{{lng}}/{{ns}}.json",
|
|
2748
|
+
addPath: "/locales/add/{{lng}}/{{ns}}",
|
|
2749
|
+
parse: function(t) {
|
|
2750
|
+
return JSON.parse(t);
|
|
2751
|
+
},
|
|
2752
|
+
stringify: JSON.stringify,
|
|
2753
|
+
parsePayload: function(t, n, i) {
|
|
2754
|
+
return at({}, n, i || "");
|
|
2755
|
+
},
|
|
2756
|
+
parseLoadPayload: function(t, n) {
|
|
2757
|
+
},
|
|
2758
|
+
request: Nn,
|
|
2759
|
+
reloadInterval: typeof window < "u" ? !1 : 60 * 60 * 1e3,
|
|
2760
|
+
customHeaders: {},
|
|
2761
|
+
queryStringParams: {},
|
|
2762
|
+
crossDomain: !1,
|
|
2763
|
+
withCredentials: !1,
|
|
2764
|
+
overrideMimeType: !1,
|
|
2765
|
+
requestOptions: {
|
|
2766
|
+
mode: "cors",
|
|
2767
|
+
credentials: "same-origin",
|
|
2768
|
+
cache: "default"
|
|
2769
|
+
}
|
|
2770
|
+
};
|
|
2771
|
+
}, lt = function() {
|
|
2772
|
+
function r(e) {
|
|
2773
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2774
|
+
jn(this, r), this.services = e, this.options = t, this.allOptions = n, this.type = "backend", this.init(e, t, n);
|
|
2775
|
+
}
|
|
2776
|
+
return Tn(r, [{
|
|
2777
|
+
key: "init",
|
|
2778
|
+
value: function(t) {
|
|
2779
|
+
var n = this, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2780
|
+
this.services = t, this.options = he(he(he({}, $n()), this.options || {}), i), this.allOptions = s, this.services && this.options.reloadInterval && setInterval(function() {
|
|
2781
|
+
return n.reload();
|
|
2782
|
+
}, this.options.reloadInterval);
|
|
2783
|
+
}
|
|
2784
|
+
}, {
|
|
2785
|
+
key: "readMulti",
|
|
2786
|
+
value: function(t, n, i) {
|
|
2787
|
+
this._readAny(t, t, n, n, i);
|
|
2788
|
+
}
|
|
2789
|
+
}, {
|
|
2790
|
+
key: "read",
|
|
2791
|
+
value: function(t, n, i) {
|
|
2792
|
+
this._readAny([t], t, [n], n, i);
|
|
2793
|
+
}
|
|
2794
|
+
}, {
|
|
2795
|
+
key: "_readAny",
|
|
2796
|
+
value: function(t, n, i, s, o) {
|
|
2797
|
+
var a = this, u = this.options.loadPath;
|
|
2798
|
+
typeof this.options.loadPath == "function" && (u = this.options.loadPath(t, i)), u = Sn(u), u.then(function(l) {
|
|
2799
|
+
if (!l)
|
|
2800
|
+
return o(null, {});
|
|
2801
|
+
var f = a.services.interpolator.interpolate(l, {
|
|
2802
|
+
lng: t.join("+"),
|
|
2803
|
+
ns: i.join("+")
|
|
2804
|
+
});
|
|
2805
|
+
a.loadUrl(f, o, n, s);
|
|
2806
|
+
});
|
|
2807
|
+
}
|
|
2808
|
+
}, {
|
|
2809
|
+
key: "loadUrl",
|
|
2810
|
+
value: function(t, n, i, s) {
|
|
2811
|
+
var o = this, a = typeof i == "string" ? [i] : i, u = typeof s == "string" ? [s] : s, l = this.options.parseLoadPayload(a, u);
|
|
2812
|
+
this.options.request(this.options, t, l, function(f, h) {
|
|
2813
|
+
if (h && (h.status >= 500 && h.status < 600 || !h.status))
|
|
2814
|
+
return n("failed loading " + t + "; status code: " + h.status, !0);
|
|
2815
|
+
if (h && h.status >= 400 && h.status < 500)
|
|
2816
|
+
return n("failed loading " + t + "; status code: " + h.status, !1);
|
|
2817
|
+
if (!h && f && f.message && f.message.indexOf("Failed to fetch") > -1)
|
|
2818
|
+
return n("failed loading " + t + ": " + f.message, !0);
|
|
2819
|
+
if (f)
|
|
2820
|
+
return n(f, !1);
|
|
2821
|
+
var c, p;
|
|
2822
|
+
try {
|
|
2823
|
+
typeof h.data == "string" ? c = o.options.parse(h.data, i, s) : c = h.data;
|
|
2824
|
+
} catch {
|
|
2825
|
+
p = "failed parsing " + t + " to json";
|
|
2826
|
+
}
|
|
2827
|
+
if (p)
|
|
2828
|
+
return n(p, !1);
|
|
2829
|
+
n(null, c);
|
|
2830
|
+
});
|
|
2831
|
+
}
|
|
2832
|
+
}, {
|
|
2833
|
+
key: "create",
|
|
2834
|
+
value: function(t, n, i, s, o) {
|
|
2835
|
+
var a = this;
|
|
2836
|
+
if (this.options.addPath) {
|
|
2837
|
+
typeof t == "string" && (t = [t]);
|
|
2838
|
+
var u = this.options.parsePayload(n, i, s), l = 0, f = [], h = [];
|
|
2839
|
+
t.forEach(function(c) {
|
|
2840
|
+
var p = a.options.addPath;
|
|
2841
|
+
typeof a.options.addPath == "function" && (p = a.options.addPath(c, n));
|
|
2842
|
+
var y = a.services.interpolator.interpolate(p, {
|
|
2843
|
+
lng: c,
|
|
2844
|
+
ns: n
|
|
2845
|
+
});
|
|
2846
|
+
a.options.request(a.options, y, u, function(m, w) {
|
|
2847
|
+
l += 1, f.push(m), h.push(w), l === t.length && typeof o == "function" && o(f, h);
|
|
2848
|
+
});
|
|
2849
|
+
});
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
}, {
|
|
2853
|
+
key: "reload",
|
|
2854
|
+
value: function() {
|
|
2855
|
+
var t = this, n = this.services, i = n.backendConnector, s = n.languageUtils, o = n.logger, a = i.language;
|
|
2856
|
+
if (!(a && a.toLowerCase() === "cimode")) {
|
|
2857
|
+
var u = [], l = function(h) {
|
|
2858
|
+
var c = s.toResolveHierarchy(h);
|
|
2859
|
+
c.forEach(function(p) {
|
|
2860
|
+
u.indexOf(p) < 0 && u.push(p);
|
|
2861
|
+
});
|
|
2862
|
+
};
|
|
2863
|
+
l(a), this.allOptions.preload && this.allOptions.preload.forEach(function(f) {
|
|
2864
|
+
return l(f);
|
|
2865
|
+
}), u.forEach(function(f) {
|
|
2866
|
+
t.allOptions.ns.forEach(function(h) {
|
|
2867
|
+
i.read(f, h, "read", null, null, function(c, p) {
|
|
2868
|
+
c && o.warn("loading namespace ".concat(h, " for language ").concat(f, " failed"), c), !c && p && o.log("loaded namespace ".concat(h, " for language ").concat(f), p), i.loaded("".concat(f, "|").concat(h), c, p);
|
|
2869
|
+
});
|
|
2870
|
+
});
|
|
2871
|
+
});
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
}]), r;
|
|
2875
|
+
}();
|
|
2876
|
+
lt.type = "backend";
|
|
2877
|
+
var In = /* @__PURE__ */ ((r) => (r.en = "en", r.de = "de", r))(In || {});
|
|
2878
|
+
j.use(rt).use(Ct).use(tt).init({
|
|
2879
|
+
// defaultNS: "translation",
|
|
2880
|
+
// resources,
|
|
2881
|
+
initImmediate: !0,
|
|
2882
|
+
fallbackLng: "en",
|
|
2883
|
+
backend: {
|
|
2884
|
+
backends: [lt],
|
|
2885
|
+
backendOptions: [
|
|
2886
|
+
{
|
|
2887
|
+
loadPath: "https://ukpcsaprod.blob.core.windows.net/lib/translations/{{lng}}/{{ns}}.json",
|
|
2888
|
+
crossDomain: !0
|
|
2889
|
+
}
|
|
2890
|
+
]
|
|
2891
|
+
}
|
|
2892
|
+
});
|
|
2893
|
+
const ie = {
|
|
2894
|
+
"page-container": "_page-container_6iqty_1",
|
|
2895
|
+
"page-main-content": "_page-main-content_6iqty_8",
|
|
2896
|
+
"page-title": "_page-title_6iqty_19",
|
|
2897
|
+
"text-base": "_text-base_6iqty_25",
|
|
2898
|
+
"mt-4": "_mt-4_6iqty_32"
|
|
2899
|
+
}, Dn = () => {
|
|
2900
|
+
const { t: r } = jt();
|
|
2901
|
+
return /* @__PURE__ */ R.jsx("div", { className: "unauth__container " + ie["page-container"], children: /* @__PURE__ */ R.jsxs("div", { className: "unauth__main-content " + ie["page-main-content"], children: [
|
|
2902
|
+
/* @__PURE__ */ R.jsx(Fn, {}),
|
|
2903
|
+
/* @__PURE__ */ R.jsxs("div", { className: "unauth__main-text flex flex-col gap-[8px] items-center justify-center text-center", children: [
|
|
2904
|
+
/* @__PURE__ */ R.jsx("h2", { className: "unauth__main-text__title " + ie["page-title"], children: r("components.unauthorizedPage.title") }),
|
|
2905
|
+
/* @__PURE__ */ R.jsxs("p", { className: "unauth__main-text__desc " + ie["text-base"], children: [
|
|
2906
|
+
r("components.unauthorizedPage.description1"),
|
|
2907
|
+
" ",
|
|
2908
|
+
/* @__PURE__ */ R.jsx("br", {}),
|
|
2909
|
+
" ",
|
|
2910
|
+
r("components.unauthorizedPage.description2")
|
|
2911
|
+
] })
|
|
2912
|
+
] })
|
|
2913
|
+
] }) });
|
|
2914
|
+
}, Fn = () => /* @__PURE__ */ R.jsxs(
|
|
2915
|
+
"svg",
|
|
2916
|
+
{
|
|
2917
|
+
width: "61",
|
|
2918
|
+
height: "60",
|
|
2919
|
+
viewBox: "0 0 61 60",
|
|
2920
|
+
fill: "none",
|
|
2921
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2922
|
+
children: [
|
|
2923
|
+
/* @__PURE__ */ R.jsxs("g", { filter: "url(#filter0_d_10800_50471)", children: [
|
|
2924
|
+
/* @__PURE__ */ R.jsx("rect", { x: "2.5", y: "1", width: "56", height: "56", rx: "28", fill: "white" }),
|
|
2925
|
+
/* @__PURE__ */ R.jsx(
|
|
2926
|
+
"path",
|
|
2927
|
+
{
|
|
2928
|
+
d: "M24.6667 27.833V23.1663C24.6667 21.6192 25.2812 20.1355 26.3752 19.0416C27.4692 17.9476 28.9529 17.333 30.5 17.333C32.0471 17.333 33.5308 17.9476 34.6248 19.0416C35.7188 20.1355 36.3333 21.6192 36.3333 23.1663V27.833M22.3333 27.833H38.6667C39.9553 27.833 41 28.8777 41 30.1663V38.333C41 39.6217 39.9553 40.6663 38.6667 40.6663H22.3333C21.0447 40.6663 20 39.6217 20 38.333V30.1663C20 28.8777 21.0447 27.833 22.3333 27.833Z",
|
|
2929
|
+
stroke: "#292929",
|
|
2930
|
+
"stroke-width": "2.33333",
|
|
2931
|
+
"stroke-linecap": "round",
|
|
2932
|
+
"stroke-linejoin": "round"
|
|
2933
|
+
}
|
|
2934
|
+
)
|
|
2935
|
+
] }),
|
|
2936
|
+
/* @__PURE__ */ R.jsx("defs", { children: /* @__PURE__ */ R.jsxs(
|
|
2937
|
+
"filter",
|
|
2938
|
+
{
|
|
2939
|
+
id: "filter0_d_10800_50471",
|
|
2940
|
+
x: "0.5",
|
|
2941
|
+
y: "0",
|
|
2942
|
+
width: "60",
|
|
2943
|
+
height: "60",
|
|
2944
|
+
filterUnits: "userSpaceOnUse",
|
|
2945
|
+
"color-interpolation-filters": "sRGB",
|
|
2946
|
+
children: [
|
|
2947
|
+
/* @__PURE__ */ R.jsx("feFlood", { "flood-opacity": "0", result: "BackgroundImageFix" }),
|
|
2948
|
+
/* @__PURE__ */ R.jsx(
|
|
2949
|
+
"feColorMatrix",
|
|
2950
|
+
{
|
|
2951
|
+
in: "SourceAlpha",
|
|
2952
|
+
type: "matrix",
|
|
2953
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
|
|
2954
|
+
result: "hardAlpha"
|
|
2955
|
+
}
|
|
2956
|
+
),
|
|
2957
|
+
/* @__PURE__ */ R.jsx("feOffset", { dy: "1" }),
|
|
2958
|
+
/* @__PURE__ */ R.jsx("feGaussianBlur", { stdDeviation: "1" }),
|
|
2959
|
+
/* @__PURE__ */ R.jsx(
|
|
2960
|
+
"feColorMatrix",
|
|
2961
|
+
{
|
|
2962
|
+
type: "matrix",
|
|
2963
|
+
values: "0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.05 0"
|
|
2964
|
+
}
|
|
2965
|
+
),
|
|
2966
|
+
/* @__PURE__ */ R.jsx(
|
|
2967
|
+
"feBlend",
|
|
2968
|
+
{
|
|
2969
|
+
mode: "normal",
|
|
2970
|
+
in2: "BackgroundImageFix",
|
|
2971
|
+
result: "effect1_dropShadow_10800_50471"
|
|
2972
|
+
}
|
|
2973
|
+
),
|
|
2974
|
+
/* @__PURE__ */ R.jsx(
|
|
2975
|
+
"feBlend",
|
|
2976
|
+
{
|
|
2977
|
+
mode: "normal",
|
|
2978
|
+
in: "SourceGraphic",
|
|
2979
|
+
in2: "effect1_dropShadow_10800_50471",
|
|
2980
|
+
result: "shape"
|
|
2981
|
+
}
|
|
2982
|
+
)
|
|
2983
|
+
]
|
|
2984
|
+
}
|
|
2985
|
+
) })
|
|
2986
|
+
]
|
|
2987
|
+
}
|
|
2988
|
+
);
|
|
2989
|
+
function Un() {
|
|
2990
|
+
return /* @__PURE__ */ R.jsx(Tt, { i18n: j, children: /* @__PURE__ */ R.jsx(Dn, {}) });
|
|
2991
|
+
}
|
|
2992
|
+
{
|
|
2993
|
+
const r = dt(Un);
|
|
2994
|
+
customElements.define("access-denied", r);
|
|
2995
|
+
}
|
|
2996
|
+
export {
|
|
2997
|
+
In as L,
|
|
2998
|
+
Dn as U,
|
|
2999
|
+
j as i
|
|
3000
|
+
};
|