@invoice-sdk/widget 1.44.0 → 1.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2419 @@
1
+ var it = Object.defineProperty, ot = Object.defineProperties;
2
+ var st = Object.getOwnPropertyDescriptors;
3
+ var be = Object.getOwnPropertySymbols;
4
+ var rt = Object.prototype.hasOwnProperty, at = Object.prototype.propertyIsEnumerable;
5
+ var Se = (o, e, t) => e in o ? it(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, g = (o, e) => {
6
+ for (var t in e || (e = {}))
7
+ rt.call(e, t) && Se(o, t, e[t]);
8
+ if (be)
9
+ for (var t of be(e))
10
+ at.call(e, t) && Se(o, t, e[t]);
11
+ return o;
12
+ }, $ = (o, e) => ot(o, st(e));
13
+ var se = (o, e, t) => new Promise((n, i) => {
14
+ var s = (c) => {
15
+ try {
16
+ a(t.next(c));
17
+ } catch (l) {
18
+ i(l);
19
+ }
20
+ }, r = (c) => {
21
+ try {
22
+ a(t.throw(c));
23
+ } catch (l) {
24
+ i(l);
25
+ }
26
+ }, a = (c) => c.done ? n(c.value) : Promise.resolve(c.value).then(s, r);
27
+ a((t = t.apply(o, e)).next());
28
+ });
29
+ const m = (o) => typeof o == "string", z = () => {
30
+ let o, e;
31
+ const t = new Promise((n, i) => {
32
+ o = n, e = i;
33
+ });
34
+ return t.resolve = o, t.reject = e, t;
35
+ }, xe = (o) => o == null ? "" : "" + o, ct = (o, e, t) => {
36
+ o.forEach((n) => {
37
+ e[n] && (t[n] = e[n]);
38
+ });
39
+ }, lt = /###/g, $e = (o) => o && o.indexOf("###") > -1 ? o.replace(lt, ".") : o, Pe = (o) => !o || m(o), Q = (o, e, t) => {
40
+ const n = m(e) ? e.split(".") : e;
41
+ let i = 0;
42
+ for (; i < n.length - 1; ) {
43
+ if (Pe(o)) return {};
44
+ const s = $e(n[i]);
45
+ !o[s] && t && (o[s] = new t()), Object.prototype.hasOwnProperty.call(o, s) ? o = o[s] : o = {}, ++i;
46
+ }
47
+ return Pe(o) ? {} : {
48
+ obj: o,
49
+ k: $e(n[i])
50
+ };
51
+ }, Ce = (o, e, t) => {
52
+ const {
53
+ obj: n,
54
+ k: i
55
+ } = Q(o, e, Object);
56
+ if (n !== void 0 || e.length === 1) {
57
+ n[i] = t;
58
+ return;
59
+ }
60
+ let s = e[e.length - 1], r = e.slice(0, e.length - 1), a = Q(o, r, Object);
61
+ for (; a.obj === void 0 && r.length; )
62
+ s = `${r[r.length - 1]}.${s}`, r = r.slice(0, r.length - 1), a = Q(o, r, Object), a != null && a.obj && typeof a.obj[`${a.k}.${s}`] != "undefined" && (a.obj = void 0);
63
+ a.obj[`${a.k}.${s}`] = t;
64
+ }, ut = (o, e, t, n) => {
65
+ const {
66
+ obj: i,
67
+ k: s
68
+ } = Q(o, e, Object);
69
+ i[s] = i[s] || [], i[s].push(t);
70
+ }, ee = (o, e) => {
71
+ const {
72
+ obj: t,
73
+ k: n
74
+ } = Q(o, e);
75
+ if (t && Object.prototype.hasOwnProperty.call(t, n))
76
+ return t[n];
77
+ }, dt = (o, e, t) => {
78
+ const n = ee(o, t);
79
+ return n !== void 0 ? n : ee(e, t);
80
+ }, qe = (o, e, t) => {
81
+ for (const n in e)
82
+ n !== "__proto__" && n !== "constructor" && (n in o ? m(o[n]) || o[n] instanceof String || m(e[n]) || e[n] instanceof String ? t && (o[n] = e[n]) : qe(o[n], e[n], t) : o[n] = e[n]);
83
+ return o;
84
+ }, U = (o) => o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
85
+ var ht = {
86
+ "&": "&amp;",
87
+ "<": "&lt;",
88
+ ">": "&gt;",
89
+ '"': "&quot;",
90
+ "'": "&#39;",
91
+ "/": "&#x2F;"
92
+ };
93
+ const ft = (o) => m(o) ? o.replace(/[&<>"'\/]/g, (e) => ht[e]) : o;
94
+ class pt {
95
+ constructor(e) {
96
+ this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
97
+ }
98
+ getRegExp(e) {
99
+ const t = this.regExpMap.get(e);
100
+ if (t !== void 0)
101
+ return t;
102
+ const n = new RegExp(e);
103
+ return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
104
+ }
105
+ }
106
+ const gt = [" ", ",", "?", "!", ";"], mt = new pt(20), yt = (o, e, t) => {
107
+ e = e || "", t = t || "";
108
+ const n = gt.filter((r) => e.indexOf(r) < 0 && t.indexOf(r) < 0);
109
+ if (n.length === 0) return !0;
110
+ const i = mt.getRegExp(`(${n.map((r) => r === "?" ? "\\?" : r).join("|")})`);
111
+ let s = !i.test(o);
112
+ if (!s) {
113
+ const r = o.indexOf(t);
114
+ r > 0 && !i.test(o.substring(0, r)) && (s = !0);
115
+ }
116
+ return s;
117
+ }, ue = (o, e, t = ".") => {
118
+ if (!o) return;
119
+ if (o[e])
120
+ return Object.prototype.hasOwnProperty.call(o, e) ? o[e] : void 0;
121
+ const n = e.split(t);
122
+ let i = o;
123
+ for (let s = 0; s < n.length; ) {
124
+ if (!i || typeof i != "object")
125
+ return;
126
+ let r, a = "";
127
+ for (let c = s; c < n.length; ++c)
128
+ if (c !== s && (a += t), a += n[c], r = i[a], r !== void 0) {
129
+ if (["string", "number", "boolean"].indexOf(typeof r) > -1 && c < n.length - 1)
130
+ continue;
131
+ s += c - s + 1;
132
+ break;
133
+ }
134
+ i = r;
135
+ }
136
+ return i;
137
+ }, W = (o) => o == null ? void 0 : o.replace("_", "-"), vt = {
138
+ type: "logger",
139
+ log(o) {
140
+ this.output("log", o);
141
+ },
142
+ warn(o) {
143
+ this.output("warn", o);
144
+ },
145
+ error(o) {
146
+ this.output("error", o);
147
+ },
148
+ output(o, e) {
149
+ var t, n;
150
+ (n = (t = console == null ? void 0 : console[o]) == null ? void 0 : t.apply) == null || n.call(t, console, e);
151
+ }
152
+ };
153
+ class te {
154
+ constructor(e, t = {}) {
155
+ this.init(e, t);
156
+ }
157
+ init(e, t = {}) {
158
+ this.prefix = t.prefix || "i18next:", this.logger = e || vt, this.options = t, this.debug = t.debug;
159
+ }
160
+ log(...e) {
161
+ return this.forward(e, "log", "", !0);
162
+ }
163
+ warn(...e) {
164
+ return this.forward(e, "warn", "", !0);
165
+ }
166
+ error(...e) {
167
+ return this.forward(e, "error", "");
168
+ }
169
+ deprecate(...e) {
170
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
171
+ }
172
+ forward(e, t, n, i) {
173
+ return i && !this.debug ? null : (m(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
174
+ }
175
+ create(e) {
176
+ return new te(this.logger, g({
177
+ prefix: `${this.prefix}:${e}:`
178
+ }, this.options));
179
+ }
180
+ clone(e) {
181
+ return e = e || this.options, e.prefix = e.prefix || this.prefix, new te(this.logger, e);
182
+ }
183
+ }
184
+ var I = new te();
185
+ class oe {
186
+ constructor() {
187
+ this.observers = {};
188
+ }
189
+ on(e, t) {
190
+ return e.split(" ").forEach((n) => {
191
+ this.observers[n] || (this.observers[n] = /* @__PURE__ */ new Map());
192
+ const i = this.observers[n].get(t) || 0;
193
+ this.observers[n].set(t, i + 1);
194
+ }), this;
195
+ }
196
+ off(e, t) {
197
+ if (this.observers[e]) {
198
+ if (!t) {
199
+ delete this.observers[e];
200
+ return;
201
+ }
202
+ this.observers[e].delete(t);
203
+ }
204
+ }
205
+ emit(e, ...t) {
206
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach(([i, s]) => {
207
+ for (let r = 0; r < s; r++)
208
+ i(...t);
209
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([i, s]) => {
210
+ for (let r = 0; r < s; r++)
211
+ i.apply(i, [e, ...t]);
212
+ });
213
+ }
214
+ }
215
+ class we extends oe {
216
+ constructor(e, t = {
217
+ ns: ["translation"],
218
+ defaultNS: "translation"
219
+ }) {
220
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
221
+ }
222
+ addNamespaces(e) {
223
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
224
+ }
225
+ removeNamespaces(e) {
226
+ const t = this.options.ns.indexOf(e);
227
+ t > -1 && this.options.ns.splice(t, 1);
228
+ }
229
+ getResource(e, t, n, i = {}) {
230
+ var l, d;
231
+ const s = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, r = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
232
+ let a;
233
+ e.indexOf(".") > -1 ? a = e.split(".") : (a = [e, t], n && (Array.isArray(n) ? a.push(...n) : m(n) && s ? a.push(...n.split(s)) : a.push(n)));
234
+ const c = ee(this.data, a);
235
+ return !c && !t && !n && e.indexOf(".") > -1 && (e = a[0], t = a[1], n = a.slice(2).join(".")), c || !r || !m(n) ? c : ue((d = (l = this.data) == null ? void 0 : l[e]) == null ? void 0 : d[t], n, s);
236
+ }
237
+ addResource(e, t, n, i, s = {
238
+ silent: !1
239
+ }) {
240
+ const r = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator;
241
+ let a = [e, t];
242
+ n && (a = a.concat(r ? n.split(r) : n)), e.indexOf(".") > -1 && (a = e.split("."), i = t, t = a[1]), this.addNamespaces(t), Ce(this.data, a, i), s.silent || this.emit("added", e, t, n, i);
243
+ }
244
+ addResources(e, t, n, i = {
245
+ silent: !1
246
+ }) {
247
+ for (const s in n)
248
+ (m(n[s]) || Array.isArray(n[s])) && this.addResource(e, t, s, n[s], {
249
+ silent: !0
250
+ });
251
+ i.silent || this.emit("added", e, t, n);
252
+ }
253
+ addResourceBundle(e, t, n, i, s, r = {
254
+ silent: !1,
255
+ skipCopy: !1
256
+ }) {
257
+ let a = [e, t];
258
+ e.indexOf(".") > -1 && (a = e.split("."), i = n, n = t, t = a[1]), this.addNamespaces(t);
259
+ let c = ee(this.data, a) || {};
260
+ r.skipCopy || (n = JSON.parse(JSON.stringify(n))), i ? qe(c, n, s) : c = g(g({}, c), n), Ce(this.data, a, c), r.silent || this.emit("added", e, t, n);
261
+ }
262
+ removeResourceBundle(e, t) {
263
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
264
+ }
265
+ hasResourceBundle(e, t) {
266
+ return this.getResource(e, t) !== void 0;
267
+ }
268
+ getResourceBundle(e, t) {
269
+ return t || (t = this.options.defaultNS), this.getResource(e, t);
270
+ }
271
+ getDataByLanguage(e) {
272
+ return this.data[e];
273
+ }
274
+ hasLanguageSomeTranslations(e) {
275
+ const t = this.getDataByLanguage(e);
276
+ return !!(t && Object.keys(t) || []).find((i) => t[i] && Object.keys(t[i]).length > 0);
277
+ }
278
+ toJSON() {
279
+ return this.data;
280
+ }
281
+ }
282
+ var ze = {
283
+ processors: {},
284
+ addPostProcessor(o) {
285
+ this.processors[o.name] = o;
286
+ },
287
+ handle(o, e, t, n, i) {
288
+ return o.forEach((s) => {
289
+ var r, a;
290
+ e = (a = (r = this.processors[s]) == null ? void 0 : r.process(e, t, n, i)) != null ? a : e;
291
+ }), e;
292
+ }
293
+ };
294
+ const Te = {}, ke = (o) => !m(o) && typeof o != "boolean" && typeof o != "number";
295
+ class ne extends oe {
296
+ constructor(e, t = {}) {
297
+ super(), ct(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = I.create("translator");
298
+ }
299
+ changeLanguage(e) {
300
+ e && (this.language = e);
301
+ }
302
+ exists(e, t = {
303
+ interpolation: {}
304
+ }) {
305
+ const n = g({}, t);
306
+ if (e == null) return !1;
307
+ const i = this.resolve(e, n);
308
+ return (i == null ? void 0 : i.res) !== void 0;
309
+ }
310
+ extractFromKey(e, t) {
311
+ let n = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
312
+ n === void 0 && (n = ":");
313
+ const i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
314
+ let s = t.ns || this.options.defaultNS || [];
315
+ const r = n && e.indexOf(n) > -1, a = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !yt(e, n, i);
316
+ if (r && !a) {
317
+ const c = e.match(this.interpolator.nestingRegexp);
318
+ if (c && c.length > 0)
319
+ return {
320
+ key: e,
321
+ namespaces: m(s) ? [s] : s
322
+ };
323
+ const l = e.split(n);
324
+ (n !== i || n === i && this.options.ns.indexOf(l[0]) > -1) && (s = l.shift()), e = l.join(i);
325
+ }
326
+ return {
327
+ key: e,
328
+ namespaces: m(s) ? [s] : s
329
+ };
330
+ }
331
+ translate(e, t, n) {
332
+ let i = typeof t == "object" ? g({}, t) : t;
333
+ if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof options == "object" && (i = g({}, i)), i || (i = {}), e == null) return "";
334
+ Array.isArray(e) || (e = [String(e)]);
335
+ const s = i.returnDetails !== void 0 ? i.returnDetails : this.options.returnDetails, r = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, {
336
+ key: a,
337
+ namespaces: c
338
+ } = this.extractFromKey(e[e.length - 1], i), l = c[c.length - 1];
339
+ let d = i.nsSeparator !== void 0 ? i.nsSeparator : this.options.nsSeparator;
340
+ d === void 0 && (d = ":");
341
+ const u = i.lng || this.language, p = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
342
+ if ((u == null ? void 0 : u.toLowerCase()) === "cimode")
343
+ return p ? s ? {
344
+ res: `${l}${d}${a}`,
345
+ usedKey: a,
346
+ exactUsedKey: a,
347
+ usedLng: u,
348
+ usedNS: l,
349
+ usedParams: this.getUsedParamsDetails(i)
350
+ } : `${l}${d}${a}` : s ? {
351
+ res: a,
352
+ usedKey: a,
353
+ exactUsedKey: a,
354
+ usedLng: u,
355
+ usedNS: l,
356
+ usedParams: this.getUsedParamsDetails(i)
357
+ } : a;
358
+ const f = this.resolve(e, i);
359
+ let h = f == null ? void 0 : f.res;
360
+ const y = (f == null ? void 0 : f.usedKey) || a, v = (f == null ? void 0 : f.exactUsedKey) || a, T = ["[object Number]", "[object Function]", "[object RegExp]"], w = i.joinArrays !== void 0 ? i.joinArrays : this.options.joinArrays, E = !this.i18nFormat || this.i18nFormat.handleAsObject, x = i.count !== void 0 && !m(i.count), N = ne.hasDefaultValue(i), _ = x ? this.pluralResolver.getSuffix(u, i.count, i) : "", R = i.ordinal && x ? this.pluralResolver.getSuffix(u, i.count, {
361
+ ordinal: !1
362
+ }) : "", K = x && !i.ordinal && i.count === 0, P = K && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${_}`] || i[`defaultValue${R}`] || i.defaultValue;
363
+ let S = h;
364
+ E && !h && N && (S = P);
365
+ const tt = ke(S), nt = Object.prototype.toString.apply(S);
366
+ if (E && S && tt && T.indexOf(nt) < 0 && !(m(w) && Array.isArray(S))) {
367
+ if (!i.returnObjects && !this.options.returnObjects) {
368
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
369
+ const O = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(y, S, $(g({}, i), {
370
+ ns: c
371
+ })) : `key '${a} (${this.language})' returned an object instead of string.`;
372
+ return s ? (f.res = O, f.usedParams = this.getUsedParamsDetails(i), f) : O;
373
+ }
374
+ if (r) {
375
+ const O = Array.isArray(S), k = O ? [] : {}, ge = O ? v : y;
376
+ for (const L in S)
377
+ if (Object.prototype.hasOwnProperty.call(S, L)) {
378
+ const F = `${ge}${r}${L}`;
379
+ N && !h ? k[L] = this.translate(F, $(g({}, i), {
380
+ defaultValue: ke(P) ? P[L] : void 0,
381
+ joinArrays: !1,
382
+ ns: c
383
+ })) : k[L] = this.translate(F, $(g({}, i), {
384
+ joinArrays: !1,
385
+ ns: c
386
+ })), k[L] === F && (k[L] = S[L]);
387
+ }
388
+ h = k;
389
+ }
390
+ } else if (E && m(w) && Array.isArray(h))
391
+ h = h.join(w), h && (h = this.extendTranslation(h, e, i, n));
392
+ else {
393
+ let O = !1, k = !1;
394
+ !this.isValidLookup(h) && N && (O = !0, h = P), this.isValidLookup(h) || (k = !0, h = a);
395
+ const L = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && k ? void 0 : h, F = N && P !== h && this.options.updateMissing;
396
+ if (k || O || F) {
397
+ if (this.logger.log(F ? "updateKey" : "missingKey", u, l, a, F ? P : h), r) {
398
+ const C = this.resolve(a, $(g({}, i), {
399
+ keySeparator: !1
400
+ }));
401
+ C && C.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
402
+ }
403
+ let V = [];
404
+ const J = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
405
+ if (this.options.saveMissingTo === "fallback" && J && J[0])
406
+ for (let C = 0; C < J.length; C++)
407
+ V.push(J[C]);
408
+ else this.options.saveMissingTo === "all" ? V = this.languageUtils.toResolveHierarchy(i.lng || this.language) : V.push(i.lng || this.language);
409
+ const me = (C, D, q) => {
410
+ var ve;
411
+ const ye = N && q !== h ? q : L;
412
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(C, l, D, ye, F, i) : (ve = this.backendConnector) != null && ve.saveMissing && this.backendConnector.saveMissing(C, l, D, ye, F, i), this.emit("missingKey", C, l, D, h);
413
+ };
414
+ this.options.saveMissing && (this.options.saveMissingPlurals && x ? V.forEach((C) => {
415
+ const D = this.pluralResolver.getSuffixes(C, i);
416
+ K && i[`defaultValue${this.options.pluralSeparator}zero`] && D.indexOf(`${this.options.pluralSeparator}zero`) < 0 && D.push(`${this.options.pluralSeparator}zero`), D.forEach((q) => {
417
+ me([C], a + q, i[`defaultValue${q}`] || P);
418
+ });
419
+ }) : me(V, a, P));
420
+ }
421
+ h = this.extendTranslation(h, e, i, f, n), k && h === a && this.options.appendNamespaceToMissingKey && (h = `${l}${d}${a}`), (k || O) && this.options.parseMissingKeyHandler && (h = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}${d}${a}` : a, O ? h : void 0, i));
422
+ }
423
+ return s ? (f.res = h, f.usedParams = this.getUsedParamsDetails(i), f) : h;
424
+ }
425
+ extendTranslation(e, t, n, i, s) {
426
+ var c, l;
427
+ if ((c = this.i18nFormat) != null && c.parse)
428
+ e = this.i18nFormat.parse(e, g(g({}, this.options.interpolation.defaultVariables), n), n.lng || this.language || i.usedLng, i.usedNS, i.usedKey, {
429
+ resolved: i
430
+ });
431
+ else if (!n.skipInterpolation) {
432
+ n.interpolation && this.interpolator.init($(g({}, n), {
433
+ interpolation: g(g({}, this.options.interpolation), n.interpolation)
434
+ }));
435
+ const d = m(e) && (((l = n == null ? void 0 : n.interpolation) == null ? void 0 : l.skipOnVariables) !== void 0 ? n.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
436
+ let u;
437
+ if (d) {
438
+ const f = e.match(this.interpolator.nestingRegexp);
439
+ u = f && f.length;
440
+ }
441
+ let p = n.replace && !m(n.replace) ? n.replace : n;
442
+ if (this.options.interpolation.defaultVariables && (p = g(g({}, this.options.interpolation.defaultVariables), p)), e = this.interpolator.interpolate(e, p, n.lng || this.language || i.usedLng, n), d) {
443
+ const f = e.match(this.interpolator.nestingRegexp), h = f && f.length;
444
+ u < h && (n.nest = !1);
445
+ }
446
+ !n.lng && i && i.res && (n.lng = this.language || i.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, (...f) => (s == null ? void 0 : s[0]) === f[0] && !n.context ? (this.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${t[0]}`), null) : this.translate(...f, t), n)), n.interpolation && this.interpolator.reset();
447
+ }
448
+ const r = n.postProcess || this.options.postProcess, a = m(r) ? [r] : r;
449
+ return e != null && (a != null && a.length) && n.applyPostProcessor !== !1 && (e = ze.handle(a, e, t, this.options && this.options.postProcessPassResolved ? g({
450
+ i18nResolved: $(g({}, i), {
451
+ usedParams: this.getUsedParamsDetails(n)
452
+ })
453
+ }, n) : n, this)), e;
454
+ }
455
+ resolve(e, t = {}) {
456
+ let n, i, s, r, a;
457
+ return m(e) && (e = [e]), e.forEach((c) => {
458
+ if (this.isValidLookup(n)) return;
459
+ const l = this.extractFromKey(c, t), d = l.key;
460
+ i = d;
461
+ let u = l.namespaces;
462
+ this.options.fallbackNS && (u = u.concat(this.options.fallbackNS));
463
+ const p = t.count !== void 0 && !m(t.count), f = p && !t.ordinal && t.count === 0, h = t.context !== void 0 && (m(t.context) || typeof t.context == "number") && t.context !== "", y = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
464
+ u.forEach((v) => {
465
+ var T, w;
466
+ this.isValidLookup(n) || (a = v, !Te[`${y[0]}-${v}`] && ((T = this.utils) != null && T.hasLoadedNamespace) && !((w = this.utils) != null && w.hasLoadedNamespace(a)) && (Te[`${y[0]}-${v}`] = !0, this.logger.warn(`key "${i}" for languages "${y.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!!!")), y.forEach((E) => {
467
+ var _;
468
+ if (this.isValidLookup(n)) return;
469
+ r = E;
470
+ const x = [d];
471
+ if ((_ = this.i18nFormat) != null && _.addLookupKeys)
472
+ this.i18nFormat.addLookupKeys(x, d, E, v, t);
473
+ else {
474
+ let R;
475
+ p && (R = this.pluralResolver.getSuffix(E, t.count, t));
476
+ const K = `${this.options.pluralSeparator}zero`, P = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
477
+ if (p && (x.push(d + R), t.ordinal && R.indexOf(P) === 0 && x.push(d + R.replace(P, this.options.pluralSeparator)), f && x.push(d + K)), h) {
478
+ const S = `${d}${this.options.contextSeparator}${t.context}`;
479
+ x.push(S), p && (x.push(S + R), t.ordinal && R.indexOf(P) === 0 && x.push(S + R.replace(P, this.options.pluralSeparator)), f && x.push(S + K));
480
+ }
481
+ }
482
+ let N;
483
+ for (; N = x.pop(); )
484
+ this.isValidLookup(n) || (s = N, n = this.getResource(E, v, N, t));
485
+ }));
486
+ });
487
+ }), {
488
+ res: n,
489
+ usedKey: i,
490
+ exactUsedKey: s,
491
+ usedLng: r,
492
+ usedNS: a
493
+ };
494
+ }
495
+ isValidLookup(e) {
496
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
497
+ }
498
+ getResource(e, t, n, i = {}) {
499
+ var s;
500
+ return (s = this.i18nFormat) != null && s.getResource ? this.i18nFormat.getResource(e, t, n, i) : this.resourceStore.getResource(e, t, n, i);
501
+ }
502
+ getUsedParamsDetails(e = {}) {
503
+ const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], n = e.replace && !m(e.replace);
504
+ let i = n ? e.replace : e;
505
+ if (n && typeof e.count != "undefined" && (i.count = e.count), this.options.interpolation.defaultVariables && (i = g(g({}, this.options.interpolation.defaultVariables), i)), !n) {
506
+ i = g({}, i);
507
+ for (const s of t)
508
+ delete i[s];
509
+ }
510
+ return i;
511
+ }
512
+ static hasDefaultValue(e) {
513
+ const t = "defaultValue";
514
+ for (const n in e)
515
+ if (Object.prototype.hasOwnProperty.call(e, n) && t === n.substring(0, t.length) && e[n] !== void 0)
516
+ return !0;
517
+ return !1;
518
+ }
519
+ }
520
+ class Oe {
521
+ constructor(e) {
522
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = I.create("languageUtils");
523
+ }
524
+ getScriptPartFromCode(e) {
525
+ if (e = W(e), !e || e.indexOf("-") < 0) return null;
526
+ const t = e.split("-");
527
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
528
+ }
529
+ getLanguagePartFromCode(e) {
530
+ if (e = W(e), !e || e.indexOf("-") < 0) return e;
531
+ const t = e.split("-");
532
+ return this.formatLanguageCode(t[0]);
533
+ }
534
+ formatLanguageCode(e) {
535
+ if (m(e) && e.indexOf("-") > -1) {
536
+ let t;
537
+ try {
538
+ t = Intl.getCanonicalLocales(e)[0];
539
+ } catch (n) {
540
+ }
541
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
542
+ }
543
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
544
+ }
545
+ isSupportedCode(e) {
546
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
547
+ }
548
+ getBestMatchFromCodes(e) {
549
+ if (!e) return null;
550
+ let t;
551
+ return e.forEach((n) => {
552
+ if (t) return;
553
+ const i = this.formatLanguageCode(n);
554
+ (!this.options.supportedLngs || this.isSupportedCode(i)) && (t = i);
555
+ }), !t && this.options.supportedLngs && e.forEach((n) => {
556
+ if (t) return;
557
+ const i = this.getScriptPartFromCode(n);
558
+ if (this.isSupportedCode(i)) return t = i;
559
+ const s = this.getLanguagePartFromCode(n);
560
+ if (this.isSupportedCode(s)) return t = s;
561
+ t = this.options.supportedLngs.find((r) => {
562
+ if (r === s) return r;
563
+ if (!(r.indexOf("-") < 0 && s.indexOf("-") < 0) && (r.indexOf("-") > 0 && s.indexOf("-") < 0 && r.substring(0, r.indexOf("-")) === s || r.indexOf(s) === 0 && s.length > 1))
564
+ return r;
565
+ });
566
+ }), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
567
+ }
568
+ getFallbackCodes(e, t) {
569
+ if (!e) return [];
570
+ if (typeof e == "function" && (e = e(t)), m(e) && (e = [e]), Array.isArray(e)) return e;
571
+ if (!t) return e.default || [];
572
+ let n = e[t];
573
+ return n || (n = e[this.getScriptPartFromCode(t)]), n || (n = e[this.formatLanguageCode(t)]), n || (n = e[this.getLanguagePartFromCode(t)]), n || (n = e.default), n || [];
574
+ }
575
+ toResolveHierarchy(e, t) {
576
+ const n = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), i = [], s = (r) => {
577
+ r && (this.isSupportedCode(r) ? i.push(r) : this.logger.warn(`rejecting language code not found in supportedLngs: ${r}`));
578
+ };
579
+ return m(e) && (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))) : m(e) && s(this.formatLanguageCode(e)), n.forEach((r) => {
580
+ i.indexOf(r) < 0 && s(this.formatLanguageCode(r));
581
+ }), i;
582
+ }
583
+ }
584
+ const Le = {
585
+ zero: 0,
586
+ one: 1,
587
+ two: 2,
588
+ few: 3,
589
+ many: 4,
590
+ other: 5
591
+ }, Ie = {
592
+ select: (o) => o === 1 ? "one" : "other",
593
+ resolvedOptions: () => ({
594
+ pluralCategories: ["one", "other"]
595
+ })
596
+ };
597
+ class bt {
598
+ constructor(e, t = {}) {
599
+ this.languageUtils = e, this.options = t, this.logger = I.create("pluralResolver"), this.pluralRulesCache = {};
600
+ }
601
+ addRule(e, t) {
602
+ this.rules[e] = t;
603
+ }
604
+ clearCache() {
605
+ this.pluralRulesCache = {};
606
+ }
607
+ getRule(e, t = {}) {
608
+ const n = W(e === "dev" ? "en" : e), i = t.ordinal ? "ordinal" : "cardinal", s = JSON.stringify({
609
+ cleanedCode: n,
610
+ type: i
611
+ });
612
+ if (s in this.pluralRulesCache)
613
+ return this.pluralRulesCache[s];
614
+ let r;
615
+ try {
616
+ r = new Intl.PluralRules(n, {
617
+ type: i
618
+ });
619
+ } catch (a) {
620
+ if (!Intl)
621
+ return this.logger.error("No Intl support, please use an Intl polyfill!"), Ie;
622
+ if (!e.match(/-|_/)) return Ie;
623
+ const c = this.languageUtils.getLanguagePartFromCode(e);
624
+ r = this.getRule(c, t);
625
+ }
626
+ return this.pluralRulesCache[s] = r, r;
627
+ }
628
+ needsPlural(e, t = {}) {
629
+ let n = this.getRule(e, t);
630
+ return n || (n = this.getRule("dev", t)), (n == null ? void 0 : n.resolvedOptions().pluralCategories.length) > 1;
631
+ }
632
+ getPluralFormsOfKey(e, t, n = {}) {
633
+ return this.getSuffixes(e, n).map((i) => `${t}${i}`);
634
+ }
635
+ getSuffixes(e, t = {}) {
636
+ let n = this.getRule(e, t);
637
+ return n || (n = this.getRule("dev", t)), n ? n.resolvedOptions().pluralCategories.sort((i, s) => Le[i] - Le[s]).map((i) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : [];
638
+ }
639
+ getSuffix(e, t, n = {}) {
640
+ const i = this.getRule(e, n);
641
+ return i ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
642
+ }
643
+ }
644
+ const Ne = (o, e, t, n = ".", i = !0) => {
645
+ let s = dt(o, e, t);
646
+ return !s && i && m(t) && (s = ue(o, t, n), s === void 0 && (s = ue(e, t, n))), s;
647
+ }, re = (o) => o.replace(/\$/g, "$$$$");
648
+ class St {
649
+ constructor(e = {}) {
650
+ var t;
651
+ this.logger = I.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((n) => n), this.init(e);
652
+ }
653
+ init(e = {}) {
654
+ e.interpolation || (e.interpolation = {
655
+ escapeValue: !0
656
+ });
657
+ const {
658
+ escape: t,
659
+ escapeValue: n,
660
+ useRawValueToEscape: i,
661
+ prefix: s,
662
+ prefixEscaped: r,
663
+ suffix: a,
664
+ suffixEscaped: c,
665
+ formatSeparator: l,
666
+ unescapeSuffix: d,
667
+ unescapePrefix: u,
668
+ nestingPrefix: p,
669
+ nestingPrefixEscaped: f,
670
+ nestingSuffix: h,
671
+ nestingSuffixEscaped: y,
672
+ nestingOptionsSeparator: v,
673
+ maxReplaces: T,
674
+ alwaysFormat: w
675
+ } = e.interpolation;
676
+ this.escape = t !== void 0 ? t : ft, this.escapeValue = n !== void 0 ? n : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = s ? U(s) : r || "{{", this.suffix = a ? U(a) : c || "}}", this.formatSeparator = l || ",", this.unescapePrefix = d ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : d || "", this.nestingPrefix = p ? U(p) : f || U("$t("), this.nestingSuffix = h ? U(h) : y || U(")"), this.nestingOptionsSeparator = v || ",", this.maxReplaces = T || 1e3, this.alwaysFormat = w !== void 0 ? w : !1, this.resetRegExp();
677
+ }
678
+ reset() {
679
+ this.options && this.init(this.options);
680
+ }
681
+ resetRegExp() {
682
+ const e = (t, n) => (t == null ? void 0 : t.source) === n ? (t.lastIndex = 0, t) : new RegExp(n, "g");
683
+ 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}`);
684
+ }
685
+ interpolate(e, t, n, i) {
686
+ var f;
687
+ let s, r, a;
688
+ const c = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, l = (h) => {
689
+ if (h.indexOf(this.formatSeparator) < 0) {
690
+ const w = Ne(t, c, h, this.options.keySeparator, this.options.ignoreJSONStructure);
691
+ return this.alwaysFormat ? this.format(w, void 0, n, $(g(g({}, i), t), {
692
+ interpolationkey: h
693
+ })) : w;
694
+ }
695
+ const y = h.split(this.formatSeparator), v = y.shift().trim(), T = y.join(this.formatSeparator).trim();
696
+ return this.format(Ne(t, c, v, this.options.keySeparator, this.options.ignoreJSONStructure), T, n, $(g(g({}, i), t), {
697
+ interpolationkey: v
698
+ }));
699
+ };
700
+ this.resetRegExp();
701
+ const d = (i == null ? void 0 : i.missingInterpolationHandler) || this.options.missingInterpolationHandler, u = ((f = i == null ? void 0 : i.interpolation) == null ? void 0 : f.skipOnVariables) !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
702
+ return [{
703
+ regex: this.regexpUnescape,
704
+ safeValue: (h) => re(h)
705
+ }, {
706
+ regex: this.regexp,
707
+ safeValue: (h) => this.escapeValue ? re(this.escape(h)) : re(h)
708
+ }].forEach((h) => {
709
+ for (a = 0; s = h.regex.exec(e); ) {
710
+ const y = s[1].trim();
711
+ if (r = l(y), r === void 0)
712
+ if (typeof d == "function") {
713
+ const T = d(e, s, i);
714
+ r = m(T) ? T : "";
715
+ } else if (i && Object.prototype.hasOwnProperty.call(i, y))
716
+ r = "";
717
+ else if (u) {
718
+ r = s[0];
719
+ continue;
720
+ } else
721
+ this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`), r = "";
722
+ else !m(r) && !this.useRawValueToEscape && (r = xe(r));
723
+ const v = h.safeValue(r);
724
+ if (e = e.replace(s[0], v), u ? (h.regex.lastIndex += r.length, h.regex.lastIndex -= s[0].length) : h.regex.lastIndex = 0, a++, a >= this.maxReplaces)
725
+ break;
726
+ }
727
+ }), e;
728
+ }
729
+ nest(e, t, n = {}) {
730
+ let i, s, r;
731
+ const a = (c, l) => {
732
+ var y;
733
+ const d = this.nestingOptionsSeparator;
734
+ if (c.indexOf(d) < 0) return c;
735
+ const u = c.split(new RegExp(`${d}[ ]*{`));
736
+ let p = `{${u[1]}`;
737
+ c = u[0], p = this.interpolate(p, r);
738
+ const f = p.match(/'/g), h = p.match(/"/g);
739
+ (((y = f == null ? void 0 : f.length) != null ? y : 0) % 2 === 0 && !h || h.length % 2 !== 0) && (p = p.replace(/'/g, '"'));
740
+ try {
741
+ r = JSON.parse(p), l && (r = g(g({}, l), r));
742
+ } catch (v) {
743
+ return this.logger.warn(`failed parsing options string in nesting for key ${c}`, v), `${c}${d}${p}`;
744
+ }
745
+ return r.defaultValue && r.defaultValue.indexOf(this.prefix) > -1 && delete r.defaultValue, c;
746
+ };
747
+ for (; i = this.nestingRegexp.exec(e); ) {
748
+ let c = [];
749
+ r = g({}, n), r = r.replace && !m(r.replace) ? r.replace : r, r.applyPostProcessor = !1, delete r.defaultValue;
750
+ const l = /{.*}/.test(i[1]) ? i[1].lastIndexOf("}") + 1 : i[1].indexOf(this.formatSeparator);
751
+ if (l !== -1 && (c = i[1].slice(l).split(this.formatSeparator).map((d) => d.trim()).filter(Boolean), i[1] = i[1].slice(0, l)), s = t(a.call(this, i[1].trim(), r), r), s && i[0] === e && !m(s)) return s;
752
+ m(s) || (s = xe(s)), s || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), s = ""), c.length && (s = c.reduce((d, u) => this.format(d, u, n.lng, $(g({}, n), {
753
+ interpolationkey: i[1].trim()
754
+ })), s.trim())), e = e.replace(i[0], s), this.regexp.lastIndex = 0;
755
+ }
756
+ return e;
757
+ }
758
+ }
759
+ const xt = (o) => {
760
+ let e = o.toLowerCase().trim();
761
+ const t = {};
762
+ if (o.indexOf("(") > -1) {
763
+ const n = o.split("(");
764
+ e = n[0].toLowerCase().trim();
765
+ const i = n[1].substring(0, n[1].length - 1);
766
+ e === "currency" && i.indexOf(":") < 0 ? t.currency || (t.currency = i.trim()) : e === "relativetime" && i.indexOf(":") < 0 ? t.range || (t.range = i.trim()) : i.split(";").forEach((r) => {
767
+ if (r) {
768
+ const [a, ...c] = r.split(":"), l = c.join(":").trim().replace(/^'+|'+$/g, ""), d = a.trim();
769
+ t[d] || (t[d] = l), l === "false" && (t[d] = !1), l === "true" && (t[d] = !0), isNaN(l) || (t[d] = parseInt(l, 10));
770
+ }
771
+ });
772
+ }
773
+ return {
774
+ formatName: e,
775
+ formatOptions: t
776
+ };
777
+ }, Re = (o) => {
778
+ const e = {};
779
+ return (t, n, i) => {
780
+ let s = i;
781
+ i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (s = $(g({}, s), {
782
+ [i.interpolationkey]: void 0
783
+ }));
784
+ const r = n + JSON.stringify(s);
785
+ let a = e[r];
786
+ return a || (a = o(W(n), i), e[r] = a), a(t);
787
+ };
788
+ }, $t = (o) => (e, t, n) => o(W(t), n)(e);
789
+ class Pt {
790
+ constructor(e = {}) {
791
+ this.logger = I.create("formatter"), this.options = e, this.init(e);
792
+ }
793
+ init(e, t = {
794
+ interpolation: {}
795
+ }) {
796
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
797
+ const n = t.cacheInBuiltFormats ? Re : $t;
798
+ this.formats = {
799
+ number: n((i, s) => {
800
+ const r = new Intl.NumberFormat(i, g({}, s));
801
+ return (a) => r.format(a);
802
+ }),
803
+ currency: n((i, s) => {
804
+ const r = new Intl.NumberFormat(i, $(g({}, s), {
805
+ style: "currency"
806
+ }));
807
+ return (a) => r.format(a);
808
+ }),
809
+ datetime: n((i, s) => {
810
+ const r = new Intl.DateTimeFormat(i, g({}, s));
811
+ return (a) => r.format(a);
812
+ }),
813
+ relativetime: n((i, s) => {
814
+ const r = new Intl.RelativeTimeFormat(i, g({}, s));
815
+ return (a) => r.format(a, s.range || "day");
816
+ }),
817
+ list: n((i, s) => {
818
+ const r = new Intl.ListFormat(i, g({}, s));
819
+ return (a) => r.format(a);
820
+ })
821
+ };
822
+ }
823
+ add(e, t) {
824
+ this.formats[e.toLowerCase().trim()] = t;
825
+ }
826
+ addCached(e, t) {
827
+ this.formats[e.toLowerCase().trim()] = Re(t);
828
+ }
829
+ format(e, t, n, i = {}) {
830
+ const s = t.split(this.formatSeparator);
831
+ if (s.length > 1 && s[0].indexOf("(") > 1 && s[0].indexOf(")") < 0 && s.find((a) => a.indexOf(")") > -1)) {
832
+ const a = s.findIndex((c) => c.indexOf(")") > -1);
833
+ s[0] = [s[0], ...s.splice(1, a)].join(this.formatSeparator);
834
+ }
835
+ return s.reduce((a, c) => {
836
+ var u;
837
+ const {
838
+ formatName: l,
839
+ formatOptions: d
840
+ } = xt(c);
841
+ if (this.formats[l]) {
842
+ let p = a;
843
+ try {
844
+ const f = ((u = i == null ? void 0 : i.formatParams) == null ? void 0 : u[i.interpolationkey]) || {}, h = f.locale || f.lng || i.locale || i.lng || n;
845
+ p = this.formats[l](a, h, g(g(g({}, d), i), f));
846
+ } catch (f) {
847
+ this.logger.warn(f);
848
+ }
849
+ return p;
850
+ } else
851
+ this.logger.warn(`there was no format function for ${l}`);
852
+ return a;
853
+ }, e);
854
+ }
855
+ }
856
+ const Ct = (o, e) => {
857
+ o.pending[e] !== void 0 && (delete o.pending[e], o.pendingCount--);
858
+ };
859
+ class wt extends oe {
860
+ constructor(e, t, n, i = {}) {
861
+ var s, r;
862
+ super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = i, this.logger = I.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], (r = (s = this.backend) == null ? void 0 : s.init) == null || r.call(s, n, i.backend, i);
863
+ }
864
+ queueLoad(e, t, n, i) {
865
+ const s = {}, r = {}, a = {}, c = {};
866
+ return e.forEach((l) => {
867
+ let d = !0;
868
+ t.forEach((u) => {
869
+ const p = `${l}|${u}`;
870
+ !n.reload && this.store.hasResourceBundle(l, u) ? this.state[p] = 2 : this.state[p] < 0 || (this.state[p] === 1 ? r[p] === void 0 && (r[p] = !0) : (this.state[p] = 1, d = !1, r[p] === void 0 && (r[p] = !0), s[p] === void 0 && (s[p] = !0), c[u] === void 0 && (c[u] = !0)));
871
+ }), d || (a[l] = !0);
872
+ }), (Object.keys(s).length || Object.keys(r).length) && this.queue.push({
873
+ pending: r,
874
+ pendingCount: Object.keys(r).length,
875
+ loaded: {},
876
+ errors: [],
877
+ callback: i
878
+ }), {
879
+ toLoad: Object.keys(s),
880
+ pending: Object.keys(r),
881
+ toLoadLanguages: Object.keys(a),
882
+ toLoadNamespaces: Object.keys(c)
883
+ };
884
+ }
885
+ loaded(e, t, n) {
886
+ const i = e.split("|"), s = i[0], r = i[1];
887
+ t && this.emit("failedLoading", s, r, t), !t && n && this.store.addResourceBundle(s, r, n, void 0, void 0, {
888
+ skipCopy: !0
889
+ }), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
890
+ const a = {};
891
+ this.queue.forEach((c) => {
892
+ ut(c.loaded, [s], r), Ct(c, e), t && c.errors.push(t), c.pendingCount === 0 && !c.done && (Object.keys(c.loaded).forEach((l) => {
893
+ a[l] || (a[l] = {});
894
+ const d = c.loaded[l];
895
+ d.length && d.forEach((u) => {
896
+ a[l][u] === void 0 && (a[l][u] = !0);
897
+ });
898
+ }), c.done = !0, c.errors.length ? c.callback(c.errors) : c.callback());
899
+ }), this.emit("loaded", a), this.queue = this.queue.filter((c) => !c.done);
900
+ }
901
+ read(e, t, n, i = 0, s = this.retryTimeout, r) {
902
+ if (!e.length) return r(null, {});
903
+ if (this.readingCalls >= this.maxParallelReads) {
904
+ this.waitingReads.push({
905
+ lng: e,
906
+ ns: t,
907
+ fcName: n,
908
+ tried: i,
909
+ wait: s,
910
+ callback: r
911
+ });
912
+ return;
913
+ }
914
+ this.readingCalls++;
915
+ const a = (l, d) => {
916
+ if (this.readingCalls--, this.waitingReads.length > 0) {
917
+ const u = this.waitingReads.shift();
918
+ this.read(u.lng, u.ns, u.fcName, u.tried, u.wait, u.callback);
919
+ }
920
+ if (l && d && i < this.maxRetries) {
921
+ setTimeout(() => {
922
+ this.read.call(this, e, t, n, i + 1, s * 2, r);
923
+ }, s);
924
+ return;
925
+ }
926
+ r(l, d);
927
+ }, c = this.backend[n].bind(this.backend);
928
+ if (c.length === 2) {
929
+ try {
930
+ const l = c(e, t);
931
+ l && typeof l.then == "function" ? l.then((d) => a(null, d)).catch(a) : a(null, l);
932
+ } catch (l) {
933
+ a(l);
934
+ }
935
+ return;
936
+ }
937
+ return c(e, t, a);
938
+ }
939
+ prepareLoading(e, t, n = {}, i) {
940
+ if (!this.backend)
941
+ return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
942
+ m(e) && (e = this.languageUtils.toResolveHierarchy(e)), m(t) && (t = [t]);
943
+ const s = this.queueLoad(e, t, n, i);
944
+ if (!s.toLoad.length)
945
+ return s.pending.length || i(), null;
946
+ s.toLoad.forEach((r) => {
947
+ this.loadOne(r);
948
+ });
949
+ }
950
+ load(e, t, n) {
951
+ this.prepareLoading(e, t, {}, n);
952
+ }
953
+ reload(e, t, n) {
954
+ this.prepareLoading(e, t, {
955
+ reload: !0
956
+ }, n);
957
+ }
958
+ loadOne(e, t = "") {
959
+ const n = e.split("|"), i = n[0], s = n[1];
960
+ this.read(i, s, "read", void 0, void 0, (r, a) => {
961
+ r && this.logger.warn(`${t}loading namespace ${s} for language ${i} failed`, r), !r && a && this.logger.log(`${t}loaded namespace ${s} for language ${i}`, a), this.loaded(e, r, a);
962
+ });
963
+ }
964
+ saveMissing(e, t, n, i, s, r = {}, a = () => {
965
+ }) {
966
+ var c, l, d, u, p;
967
+ if ((l = (c = this.services) == null ? void 0 : c.utils) != null && l.hasLoadedNamespace && !((u = (d = this.services) == null ? void 0 : d.utils) != null && u.hasLoadedNamespace(t))) {
968
+ 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!!!");
969
+ return;
970
+ }
971
+ if (!(n == null || n === "")) {
972
+ if ((p = this.backend) != null && p.create) {
973
+ const f = $(g({}, r), {
974
+ isUpdate: s
975
+ }), h = this.backend.create.bind(this.backend);
976
+ if (h.length < 6)
977
+ try {
978
+ let y;
979
+ h.length === 5 ? y = h(e, t, n, i, f) : y = h(e, t, n, i), y && typeof y.then == "function" ? y.then((v) => a(null, v)).catch(a) : a(null, y);
980
+ } catch (y) {
981
+ a(y);
982
+ }
983
+ else
984
+ h(e, t, n, i, a, f);
985
+ }
986
+ !e || !e[0] || this.store.addResource(e[0], t, n, i);
987
+ }
988
+ }
989
+ }
990
+ const Fe = () => ({
991
+ debug: !1,
992
+ initAsync: !0,
993
+ ns: ["translation"],
994
+ defaultNS: ["translation"],
995
+ fallbackLng: ["dev"],
996
+ fallbackNS: !1,
997
+ supportedLngs: !1,
998
+ nonExplicitSupportedLngs: !1,
999
+ load: "all",
1000
+ preload: !1,
1001
+ simplifyPluralSuffix: !0,
1002
+ keySeparator: ".",
1003
+ nsSeparator: ":",
1004
+ pluralSeparator: "_",
1005
+ contextSeparator: "_",
1006
+ partialBundledLanguages: !1,
1007
+ saveMissing: !1,
1008
+ updateMissing: !1,
1009
+ saveMissingTo: "fallback",
1010
+ saveMissingPlurals: !0,
1011
+ missingKeyHandler: !1,
1012
+ missingInterpolationHandler: !1,
1013
+ postProcess: !1,
1014
+ postProcessPassResolved: !1,
1015
+ returnNull: !1,
1016
+ returnEmptyString: !0,
1017
+ returnObjects: !1,
1018
+ joinArrays: !1,
1019
+ returnedObjectHandler: !1,
1020
+ parseMissingKeyHandler: !1,
1021
+ appendNamespaceToMissingKey: !1,
1022
+ appendNamespaceToCIMode: !1,
1023
+ overloadTranslationOptionHandler: (o) => {
1024
+ let e = {};
1025
+ if (typeof o[1] == "object" && (e = o[1]), m(o[1]) && (e.defaultValue = o[1]), m(o[2]) && (e.tDescription = o[2]), typeof o[2] == "object" || typeof o[3] == "object") {
1026
+ const t = o[3] || o[2];
1027
+ Object.keys(t).forEach((n) => {
1028
+ e[n] = t[n];
1029
+ });
1030
+ }
1031
+ return e;
1032
+ },
1033
+ interpolation: {
1034
+ escapeValue: !0,
1035
+ format: (o) => o,
1036
+ prefix: "{{",
1037
+ suffix: "}}",
1038
+ formatSeparator: ",",
1039
+ unescapePrefix: "-",
1040
+ nestingPrefix: "$t(",
1041
+ nestingSuffix: ")",
1042
+ nestingOptionsSeparator: ",",
1043
+ maxReplaces: 1e3,
1044
+ skipOnVariables: !0
1045
+ },
1046
+ cacheInBuiltFormats: !0
1047
+ }), Ee = (o) => {
1048
+ var e, t;
1049
+ return m(o.ns) && (o.ns = [o.ns]), m(o.fallbackLng) && (o.fallbackLng = [o.fallbackLng]), m(o.fallbackNS) && (o.fallbackNS = [o.fallbackNS]), ((t = (e = o.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (o.supportedLngs = o.supportedLngs.concat(["cimode"])), typeof o.initImmediate == "boolean" && (o.initAsync = o.initImmediate), o;
1050
+ }, Y = () => {
1051
+ }, Tt = (o) => {
1052
+ Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach((t) => {
1053
+ typeof o[t] == "function" && (o[t] = o[t].bind(o));
1054
+ });
1055
+ };
1056
+ class G extends oe {
1057
+ constructor(e = {}, t) {
1058
+ if (super(), this.options = Ee(e), this.services = {}, this.logger = I, this.modules = {
1059
+ external: []
1060
+ }, Tt(this), t && !this.isInitialized && !e.isClone) {
1061
+ if (!this.options.initAsync)
1062
+ return this.init(e, t), this;
1063
+ setTimeout(() => {
1064
+ this.init(e, t);
1065
+ }, 0);
1066
+ }
1067
+ }
1068
+ init(e = {}, t) {
1069
+ this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (m(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
1070
+ const n = Fe();
1071
+ this.options = g(g(g({}, n), this.options), Ee(e)), this.options.interpolation = g(g({}, n.interpolation), this.options.interpolation), e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator);
1072
+ const i = (l) => l ? typeof l == "function" ? new l() : l : null;
1073
+ if (!this.options.isClone) {
1074
+ this.modules.logger ? I.init(i(this.modules.logger), this.options) : I.init(null, this.options);
1075
+ let l;
1076
+ this.modules.formatter ? l = this.modules.formatter : l = Pt;
1077
+ const d = new Oe(this.options);
1078
+ this.store = new we(this.options.resources, this.options);
1079
+ const u = this.services;
1080
+ u.logger = I, u.resourceStore = this.store, u.languageUtils = d, u.pluralResolver = new bt(d, {
1081
+ prepend: this.options.pluralSeparator,
1082
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
1083
+ }), this.options.interpolation.format && this.options.interpolation.format !== n.interpolation.format && this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), l && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (u.formatter = i(l), u.formatter.init && u.formatter.init(u, this.options), this.options.interpolation.format = u.formatter.format.bind(u.formatter)), u.interpolator = new St(this.options), u.utils = {
1084
+ hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
1085
+ }, u.backendConnector = new wt(i(this.modules.backend), u.resourceStore, u, this.options), u.backendConnector.on("*", (f, ...h) => {
1086
+ this.emit(f, ...h);
1087
+ }), this.modules.languageDetector && (u.languageDetector = i(this.modules.languageDetector), u.languageDetector.init && u.languageDetector.init(u, this.options.detection, this.options)), this.modules.i18nFormat && (u.i18nFormat = i(this.modules.i18nFormat), u.i18nFormat.init && u.i18nFormat.init(this)), this.translator = new ne(this.services, this.options), this.translator.on("*", (f, ...h) => {
1088
+ this.emit(f, ...h);
1089
+ }), this.modules.external.forEach((f) => {
1090
+ f.init && f.init(this);
1091
+ });
1092
+ }
1093
+ if (this.format = this.options.interpolation.format, t || (t = Y), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1094
+ const l = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1095
+ l.length > 0 && l[0] !== "dev" && (this.options.lng = l[0]);
1096
+ }
1097
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((l) => {
1098
+ this[l] = (...d) => this.store[l](...d);
1099
+ }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((l) => {
1100
+ this[l] = (...d) => (this.store[l](...d), this);
1101
+ });
1102
+ const a = z(), c = () => {
1103
+ const l = (d, u) => {
1104
+ 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), a.resolve(u), t(d, u);
1105
+ };
1106
+ if (this.languages && !this.isInitialized) return l(null, this.t.bind(this));
1107
+ this.changeLanguage(this.options.lng, l);
1108
+ };
1109
+ return this.options.resources || !this.options.initAsync ? c() : setTimeout(c, 0), a;
1110
+ }
1111
+ loadResources(e, t = Y) {
1112
+ var s, r;
1113
+ let n = t;
1114
+ const i = m(e) ? e : this.language;
1115
+ if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
1116
+ if ((i == null ? void 0 : i.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
1117
+ const a = [], c = (l) => {
1118
+ if (!l || l === "cimode") return;
1119
+ this.services.languageUtils.toResolveHierarchy(l).forEach((u) => {
1120
+ u !== "cimode" && a.indexOf(u) < 0 && a.push(u);
1121
+ });
1122
+ };
1123
+ i ? c(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((d) => c(d)), (r = (s = this.options.preload) == null ? void 0 : s.forEach) == null || r.call(s, (l) => c(l)), this.services.backendConnector.load(a, this.options.ns, (l) => {
1124
+ !l && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(l);
1125
+ });
1126
+ } else
1127
+ n(null);
1128
+ }
1129
+ reloadResources(e, t, n) {
1130
+ const i = z();
1131
+ return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), n || (n = Y), this.services.backendConnector.reload(e, t, (s) => {
1132
+ i.resolve(), n(s);
1133
+ }), i;
1134
+ }
1135
+ use(e) {
1136
+ if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1137
+ if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1138
+ return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && ze.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1139
+ }
1140
+ setResolvedLanguage(e) {
1141
+ if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
1142
+ for (let t = 0; t < this.languages.length; t++) {
1143
+ const n = this.languages[t];
1144
+ if (!(["cimode", "dev"].indexOf(n) > -1) && this.store.hasLanguageSomeTranslations(n)) {
1145
+ this.resolvedLanguage = n;
1146
+ break;
1147
+ }
1148
+ }
1149
+ !this.resolvedLanguage && this.languages.indexOf(e) < 0 && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
1150
+ }
1151
+ }
1152
+ changeLanguage(e, t) {
1153
+ this.isLanguageChangingTo = e;
1154
+ const n = z();
1155
+ this.emit("languageChanging", e);
1156
+ const i = (a) => {
1157
+ this.language = a, this.languages = this.services.languageUtils.toResolveHierarchy(a), this.resolvedLanguage = void 0, this.setResolvedLanguage(a);
1158
+ }, s = (a, c) => {
1159
+ c ? this.isLanguageChangingTo === e && (i(c), this.translator.changeLanguage(c), this.isLanguageChangingTo = void 0, this.emit("languageChanged", c), this.logger.log("languageChanged", c)) : this.isLanguageChangingTo = void 0, n.resolve((...l) => this.t(...l)), t && t(a, (...l) => this.t(...l));
1160
+ }, r = (a) => {
1161
+ var d, u;
1162
+ !e && !a && this.services.languageDetector && (a = []);
1163
+ const c = m(a) ? a : a && a[0], l = this.store.hasLanguageSomeTranslations(c) ? c : this.services.languageUtils.getBestMatchFromCodes(m(a) ? [a] : a);
1164
+ l && (this.language || i(l), this.translator.language || this.translator.changeLanguage(l), (u = (d = this.services.languageDetector) == null ? void 0 : d.cacheUserLanguage) == null || u.call(d, l)), this.loadResources(l, (p) => {
1165
+ s(p, l);
1166
+ });
1167
+ };
1168
+ return !e && this.services.languageDetector && !this.services.languageDetector.async ? r(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(r) : this.services.languageDetector.detect(r) : r(e), n;
1169
+ }
1170
+ getFixedT(e, t, n) {
1171
+ const i = (s, r, ...a) => {
1172
+ let c;
1173
+ typeof r != "object" ? c = this.options.overloadTranslationOptionHandler([s, r].concat(a)) : c = g({}, r), c.lng = c.lng || i.lng, c.lngs = c.lngs || i.lngs, c.ns = c.ns || i.ns, c.keyPrefix !== "" && (c.keyPrefix = c.keyPrefix || n || i.keyPrefix);
1174
+ const l = this.options.keySeparator || ".";
1175
+ let d;
1176
+ return c.keyPrefix && Array.isArray(s) ? d = s.map((u) => `${c.keyPrefix}${l}${u}`) : d = c.keyPrefix ? `${c.keyPrefix}${l}${s}` : s, this.t(d, c);
1177
+ };
1178
+ return m(e) ? i.lng = e : i.lngs = e, i.ns = t, i.keyPrefix = n, i;
1179
+ }
1180
+ t(...e) {
1181
+ var t;
1182
+ return (t = this.translator) == null ? void 0 : t.translate(...e);
1183
+ }
1184
+ exists(...e) {
1185
+ var t;
1186
+ return (t = this.translator) == null ? void 0 : t.exists(...e);
1187
+ }
1188
+ setDefaultNamespace(e) {
1189
+ this.options.defaultNS = e;
1190
+ }
1191
+ hasLoadedNamespace(e, t = {}) {
1192
+ if (!this.isInitialized)
1193
+ return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1194
+ if (!this.languages || !this.languages.length)
1195
+ return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1196
+ const n = t.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, s = this.languages[this.languages.length - 1];
1197
+ if (n.toLowerCase() === "cimode") return !0;
1198
+ const r = (a, c) => {
1199
+ const l = this.services.backendConnector.state[`${a}|${c}`];
1200
+ return l === -1 || l === 0 || l === 2;
1201
+ };
1202
+ if (t.precheck) {
1203
+ const a = t.precheck(this, r);
1204
+ if (a !== void 0) return a;
1205
+ }
1206
+ return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || r(n, e) && (!i || r(s, e)));
1207
+ }
1208
+ loadNamespaces(e, t) {
1209
+ const n = z();
1210
+ return this.options.ns ? (m(e) && (e = [e]), e.forEach((i) => {
1211
+ this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
1212
+ }), this.loadResources((i) => {
1213
+ n.resolve(), t && t(i);
1214
+ }), n) : (t && t(), Promise.resolve());
1215
+ }
1216
+ loadLanguages(e, t) {
1217
+ const n = z();
1218
+ m(e) && (e = [e]);
1219
+ const i = this.options.preload || [], s = e.filter((r) => i.indexOf(r) < 0 && this.services.languageUtils.isSupportedCode(r));
1220
+ return s.length ? (this.options.preload = i.concat(s), this.loadResources((r) => {
1221
+ n.resolve(), t && t(r);
1222
+ }), n) : (t && t(), Promise.resolve());
1223
+ }
1224
+ dir(e) {
1225
+ var i, s;
1226
+ if (e || (e = this.resolvedLanguage || (((i = this.languages) == null ? void 0 : i.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
1227
+ if (Intl.Locale) {
1228
+ const r = new Intl.Locale(e);
1229
+ if (r && r.getTextInfo) {
1230
+ const a = r.getTextInfo();
1231
+ if (a && a.direction) return a.direction;
1232
+ }
1233
+ }
1234
+ 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 = ((s = this.services) == null ? void 0 : s.languageUtils) || new Oe(Fe());
1235
+ return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1236
+ }
1237
+ static createInstance(e = {}, t) {
1238
+ return new G(e, t);
1239
+ }
1240
+ cloneInstance(e = {}, t = Y) {
1241
+ const n = e.forkResourceStore;
1242
+ n && delete e.forkResourceStore;
1243
+ const i = $(g(g({}, this.options), e), {
1244
+ isClone: !0
1245
+ }), s = new G(i);
1246
+ if ((e.debug !== void 0 || e.prefix !== void 0) && (s.logger = s.logger.clone(e)), ["store", "services", "language"].forEach((a) => {
1247
+ s[a] = this[a];
1248
+ }), s.services = g({}, this.services), s.services.utils = {
1249
+ hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
1250
+ }, n) {
1251
+ const a = Object.keys(this.store.data).reduce((c, l) => (c[l] = g({}, this.store.data[l]), c[l] = Object.keys(c[l]).reduce((d, u) => (d[u] = g({}, c[l][u]), d), c[l]), c), {});
1252
+ s.store = new we(a, i), s.services.resourceStore = s.store;
1253
+ }
1254
+ return s.translator = new ne(s.services, i), s.translator.on("*", (a, ...c) => {
1255
+ s.emit(a, ...c);
1256
+ }), s.init(i, t), s.translator.options = i, s.translator.backendConnector.services.utils = {
1257
+ hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
1258
+ }, s;
1259
+ }
1260
+ toJSON() {
1261
+ return {
1262
+ options: this.options,
1263
+ store: this.store,
1264
+ language: this.language,
1265
+ languages: this.languages,
1266
+ resolvedLanguage: this.resolvedLanguage
1267
+ };
1268
+ }
1269
+ }
1270
+ const b = G.createInstance();
1271
+ b.createInstance = G.createInstance;
1272
+ b.createInstance;
1273
+ b.dir;
1274
+ b.init;
1275
+ b.loadResources;
1276
+ b.reloadResources;
1277
+ b.use;
1278
+ b.changeLanguage;
1279
+ b.getFixedT;
1280
+ b.t;
1281
+ b.exists;
1282
+ b.setDefaultNamespace;
1283
+ b.hasLoadedNamespace;
1284
+ b.loadNamespaces;
1285
+ b.loadLanguages;
1286
+ const kt = "Account Name", Ot = "Account Number", Lt = "Unit Address", It = "I agree with", Nt = "and", Rt = "Back", Ft = "Back ID Card", Et = "Bank Name", At = "Beneficiary Bank", Dt = "Business Registration License", jt = "Cancel", Ut = "Cancel Transaction", Mt = "Close", Ht = "C (With tax authority code)", Bt = "K (Without code)", Kt = "C: With tax authority code, K: Without code", Vt = "Coming Soon", qt = "Unit Name", zt = "Complete your payment within", Qt = "Confirm", Wt = "Important Notice:", Gt = "3. Contact Person Information:", Xt = "Copy", _t = "Country", Jt = "2 custom characters (default: YY)", Yt = "Custom quantity", Zt = "Date of Birth", en = "Decrease", tn = "Digital Signature Package", nn = "District", on = "Duration", sn = "E-Contract", rn = "Edit", an = "e-invoices", cn = "Email", ln = "Enter ID Card Number", un = "Enter Invoice Symbol", dn = "Enter Passport Number", hn = "Enter Provider Name", fn = "Enter Tax Authority Code", pn = "Error fetching tax information.", gn = "File format not supported", mn = "File size is too large", yn = "Address cannot contain special characters", vn = "Invalid date of birth", bn = "Invalid email address", Sn = "Invalid ID card number", xn = "Invalid ID card", $n = "Only letters, numbers and underscores allowed", Pn = "Invalid phone number", Cn = "Invalid provider name", wn = "Invalid tax authority code", Tn = "Invalid tax code", kn = "Network connection error", On = "This field is required", Ln = "An error occurred", In = "Female", Nn = "Format", Rn = "Front ID Card", Fn = "Full Name", En = "Gender", An = "Have you used e-invoices?", Dn = "Are you using another e-invoice provider other than M-invoice?", jn = "(Free Consulting and Support Hotline)", Un = "Hotline:", Mn = "ID Card Number", Hn = "Increase", Bn = "Information Sent", Kn = "Invoice Package", Vn = "Invoice Symbol", qn = "Invoice Template", zn = { 1: "1 (VAT Invoice)", 2: "2 (Sales Invoice)", 3: "3 (Public Asset Sales)", 4: "4 (National Reserve Sales)", 5: "5 (Stamps, Tickets, Other Cards)", 6: "6 (Internal Documents)", 7: "7 (Commercial Invoice)", 8: "8 (VAT with Integrated Tax)", 9: "9 (Sales with Integrated Tax)" }, Qn = "B (Agent)", Wn = "D (Asset)", Gn = "G (VAT Stamp)", Xn = "H (Sales Stamp)", _n = "L (Tax Authority)", Jn = "M (Cash Register)", Yn = "N (Internal)", Zn = "T (Registration)", ei = "Invoice type", ti = "X (Commercial)", ni = "4. E-INVOICE USAGE INFORMATION:", ii = "invoices/month", oi = "2. Legal Representative Information:", si = "Please check and enter the correct legal representative name according to the uploaded business license.", ri = "Male", ai = "Max 500KB", ci = "Month", li = "Most Suitable Package", ui = "Continue", di = "No package found.", hi = "Please check your email regularly for notifications/account information from the provider.", fi = "Please wait 1-2 business days for the registration process to complete.", pi = "After being granted an account, please go to the settings section in the menu bar to connect and use the service.", gi = "of", mi = "OK", yi = "Optional", vi = "or", bi = "Order created successfully", Si = "Order has expired", xi = "Order Information", $i = "Order Summary", Pi = "Organization Registration Certificate", Ci = "Passport", wi = "Payment Amount", Ti = "Payment Failed", ki = ["Open your banking app or digital wallet on your phone", "Select the QR Code scan feature in the app", "Scan the QR code on this page and make payment"], Oi = "QR Payment Instructions", Li = "Payment Method:", Ii = "Payment Successful!", Ni = "Payment timeout", Ri = "Payment timeout! Please try again.", Fi = "Payment", Ei = "Permanent address", Ai = "Phone Number", Di = "Product", ji = "Provider", Ui = "Provider Name", Mi = "Province/City", Hi = "QR Code Payment", Bi = "Scan QR Code to Pay", Ki = "Quantity", Vi = "Registration complete", qi = "Registration Fee", zi = "Required", Qi = "Return Home", Wi = "Return to step 1", Gi = "Invoice template number (1-9)", Xi = "Save", _i = "Units per month", Ji = "Select File", Yi = "Select E-Invoice Package", Zi = "Select Provider", eo = "Select Digital Signature Package", to = "Select Subscription Package", no = "Selected Products", io = "Digital Signature Package", oo = "E-invoice software license", so = "Information", ro = "Confirmation & Payment", ao = "Invoice Package", co = "Subscription Package", lo = "Tax Authority", uo = "5 characters issued by the Authority for cash register bills", ho = "Unit Tax Code", fo = "Terms and Usage Policy", po = "Time Left", go = "Total", mo = "Total Amount", yo = "Total Price", vo = "Transaction has been canceled. Returning to registration page.", bo = "Unit", So = "1. Unit Information", xo = "units/month", $o = "Unit Price", Po = "units/ month", Co = "Upload Back ID Card", wo = "Upload File", To = "Upload Front ID Card", ko = "Upload Logo", Oo = "Usage Policy", Lo = "Ward", Io = "E-Invoice Registration", No = "Release year (last 2 digits)", Ro = {
1287
+ accountName: kt,
1288
+ accountNumber: Ot,
1289
+ address: Lt,
1290
+ agreeWith: It,
1291
+ and: Nt,
1292
+ back: Rt,
1293
+ backIdCard: Ft,
1294
+ bankName: Et,
1295
+ beneficiaryBank: At,
1296
+ businessLicense: Dt,
1297
+ cancel: jt,
1298
+ cancelTransaction: Ut,
1299
+ close: Mt,
1300
+ codeTypeC: Ht,
1301
+ codeTypeK: Bt,
1302
+ codeTypeTooltip: Kt,
1303
+ comingSoon: Vt,
1304
+ companyName: qt,
1305
+ completePaymentIn: zt,
1306
+ confirm: Qt,
1307
+ confirmationTitle: Wt,
1308
+ contactInfo: Gt,
1309
+ copy: Xt,
1310
+ country: _t,
1311
+ customLettersTooltip: Jt,
1312
+ customUnits: Yt,
1313
+ dateOfBirth: Zt,
1314
+ decrease: en,
1315
+ delete: "Delete",
1316
+ digitalSignaturePackage: tn,
1317
+ district: nn,
1318
+ duration: on,
1319
+ eContractTitle: sn,
1320
+ edit: rn,
1321
+ electronicInvoices: an,
1322
+ email: cn,
1323
+ enterIdCard: ln,
1324
+ enterInvoiceSymbol: un,
1325
+ enterPassport: dn,
1326
+ enterProviderName: hn,
1327
+ enterTaxAuthorityCode: fn,
1328
+ errorFetchTaxInfo: pn,
1329
+ errorFileFormat: gn,
1330
+ errorFileSize: mn,
1331
+ errorInvalidAddress: yn,
1332
+ errorInvalidDate: vn,
1333
+ errorInvalidEmail: bn,
1334
+ errorInvalidIdCard: Sn,
1335
+ errorInvalidCard: xn,
1336
+ errorInvalidName: $n,
1337
+ errorInvalidPhone: Pn,
1338
+ errorInvalidProviderName: Cn,
1339
+ errorInvalidTaxAuthorityCode: wn,
1340
+ errorInvalidTaxCode: Tn,
1341
+ errorNetwork: kn,
1342
+ errorRequired: On,
1343
+ errorUnknown: Ln,
1344
+ female: In,
1345
+ fileFormat: Nn,
1346
+ frontIdCard: Rn,
1347
+ fullName: Fn,
1348
+ gender: En,
1349
+ hasUsedEInvoice: An,
1350
+ hasUsedEInvoiceBefore: Dn,
1351
+ hotlineDesc: jn,
1352
+ hotlineDomestic: Un,
1353
+ idNumber: Mn,
1354
+ increase: Hn,
1355
+ informationSent: Bn,
1356
+ invoicePackage: Kn,
1357
+ invoiceSymbol: Vn,
1358
+ invoiceTemplate: qn,
1359
+ invoiceTemplateTypes: zn,
1360
+ invoiceTypeB: Qn,
1361
+ invoiceTypeD: Wn,
1362
+ invoiceTypeG: Gn,
1363
+ invoiceTypeH: Xn,
1364
+ invoiceTypeL: _n,
1365
+ invoiceTypeM: Jn,
1366
+ invoiceTypeN: Yn,
1367
+ invoiceTypeT: Zn,
1368
+ invoiceTypeTooltip: ei,
1369
+ invoiceTypeX: ti,
1370
+ invoiceUsageInfo: ni,
1371
+ invoicesPerMonth: ii,
1372
+ legalRepInfo: oi,
1373
+ legalRepNote: si,
1374
+ male: ri,
1375
+ maxFileSize: ai,
1376
+ month: ci,
1377
+ mostSuitablePackage: li,
1378
+ next: ui,
1379
+ noPackageFound: di,
1380
+ notice1: hi,
1381
+ notice2: fi,
1382
+ notice3: pi,
1383
+ of: gi,
1384
+ ok: mi,
1385
+ optional: yi,
1386
+ or: vi,
1387
+ orderCreated: bi,
1388
+ orderExpired: Si,
1389
+ orderInfo: xi,
1390
+ orderSummary: $i,
1391
+ organizationCert: Pi,
1392
+ package: "Package",
1393
+ passport: Ci,
1394
+ paymentAmount: wi,
1395
+ paymentFailed: Ti,
1396
+ paymentInstructions: ki,
1397
+ paymentInstructionsTitle: Oi,
1398
+ paymentMethod: Li,
1399
+ paymentSuccess: Ii,
1400
+ paymentTimeout: Ni,
1401
+ paymentTimeoutMessage: Ri,
1402
+ paymentTitle: Fi,
1403
+ permanentAddress: Ei,
1404
+ phone: Ai,
1405
+ product: Di,
1406
+ provider: ji,
1407
+ providerName: Ui,
1408
+ province: Mi,
1409
+ qrPayment: Hi,
1410
+ qrPaymentTitle: Bi,
1411
+ quantity: Ki,
1412
+ registrationComplete: Vi,
1413
+ registrationFee: qi,
1414
+ required: zi,
1415
+ returnHome: Qi,
1416
+ returnToStep1: Wi,
1417
+ sampleNumberTooltip: Gi,
1418
+ save: Xi,
1419
+ searchUnits: _i,
1420
+ selectFile: Ji,
1421
+ selectInvoicePackage: Yi,
1422
+ selectProvider: Zi,
1423
+ selectSignaturePackage: eo,
1424
+ selectSubscriptionPackage: to,
1425
+ selectedProducts: no,
1426
+ signaturePackage: io,
1427
+ softwareLicense: oo,
1428
+ stepInfo: so,
1429
+ stepPayment: ro,
1430
+ stepPlan: ao,
1431
+ subscriptionPackage: co,
1432
+ taxAuthority: lo,
1433
+ taxAuthorityCode: uo,
1434
+ taxCode: ho,
1435
+ termsAndUsagePolicy: fo,
1436
+ timeLeft: po,
1437
+ total: go,
1438
+ totalAmount: mo,
1439
+ totalPrice: yo,
1440
+ transactionCanceled: vo,
1441
+ unit: bo,
1442
+ unitInfo: So,
1443
+ unitPerMonth: xo,
1444
+ unitPrice: $o,
1445
+ unitsPerMonth: Po,
1446
+ uploadBackId: Co,
1447
+ uploadFile: wo,
1448
+ uploadFrontId: To,
1449
+ uploadLogo: ko,
1450
+ usagePolicy: Oo,
1451
+ ward: Lo,
1452
+ widgetTitle: Io,
1453
+ yearTooltip: No
1454
+ }, Fo = "Tên tài khoản", Eo = "Số tài khoản", Ao = "Địa chỉ đơn vị", Do = "Tôi đồng ý với", jo = "và", Uo = "Quay lại", Mo = "Mặt sau CCCD", Ho = "Ngân hàng", Bo = "Ngân hàng thụ hưởng", Ko = "Giấy phép đăng ký kinh doanh", Vo = "Hủy", qo = "Hủy giao dịch", zo = "Đóng", Qo = "C (Có mã CQT)", Wo = "K (Không mã)", Go = "C: Có mã CQT, K: Không mã", Xo = "Sắp ra mắt", _o = "Tên đơn vị", Jo = "Hoàn tất thanh toán của bạn trong", Yo = "Xác nhận", Zo = "Thông tin lưu ý:", es = "3. Thông tin người liên hệ:", ts = "Bản", ns = "Quốc gia", is = "2 ký tự tùy chọn (mặc định: YY)", os = "Số lượng tùy chỉnh", ss = "Ngày sinh", rs = "Giảm", as = "Gói chữ ký số", cs = "Quận/Huyện", ls = "Thời hạn", us = "E-Contract", ds = "Chỉnh sửa", hs = "hóa đơn điện tử", fs = "Email", ps = "Nhập số CMND/CCCD", gs = "Nhập ký hiệu hóa đơn", ms = "Nhập số hộ chiếu", ys = "Nhập tên nhà cung cấp", vs = "Nhập mã CQT cấp", bs = "Lỗi khi lấy thông tin mã số thuế.", Ss = "Định dạng tệp không được hỗ trợ", xs = "Kích thước tệp quá lớn", $s = "Địa chỉ không được chứa ký tự đặc biệt", Ps = "CCCD không hợp lệ", Cs = "Ngày sinh không hợp lệ", ws = "Email không hợp lệ", Ts = "Số CCCD không hợp lệ", ks = "Chỉ được dùng chữ cái, số và dấu gạch dưới", Os = "Số điện thoại không hợp lệ", Ls = "Tên nhà cung cấp không hợp lệ", Is = "Mã CQT cấp không hợp lệ", Ns = "Mã số thuế không hợp lệ", Rs = "Lỗi kết nối mạng", Fs = "Trường này là bắt buộc", Es = "Đã xảy ra lỗi", As = "Nữ", Ds = "Định dạng", js = "Mặt trước CCCD", Us = "Họ và tên", Ms = "Giới tính", Hs = "Bạn đã sử dụng hoá đơn điện tử?", Bs = "Bạn đang sử dụng nhà NCC hoá đơn điện tử khác M-invoice không?", Ks = "(Tổng đài Tư vấn, Hỗ trợ miễn phí)", Vs = "Hotline:", qs = "CCCD", zs = "Tăng", Qs = "Đã gửi thông tin", Ws = "Gói hóa đơn", Gs = "Ký hiệu hóa đơn", Xs = "Mẫu số", _s = { 1: "1 (Hóa đơn GTGT)", 2: "2 (Hóa đơn bán hàng)", 3: "3 (Bán tài sản công)", 4: "4 (Bán dự trữ quốc gia)", 5: "5 (Tem, vé, thẻ khác)", 6: "6 (Chứng từ nội bộ)", 7: "7 (Hóa đơn thương mại)", 8: "8 (GTGT tích hợp thuế)", 9: "9 (Bán hàng tích hợp thuế)" }, Js = "B (Đại lý)", Ys = "D (Tài sản)", Zs = "G (Tem GTGT)", er = "H (Tem bán hàng)", tr = "L (CQT)", nr = "M (Máy tính tiền)", ir = "N (Nội bộ)", or = "T (Đăng ký)", sr = "Loại hóa đơn", rr = "X (Thương mại)", ar = "4. THÔNG TIN SỬ DỤNG HDDT:", cr = "hóa đơn/tháng", lr = "2. Thông tin người đại diện pháp luật:", ur = "Vui lòng kiểm tra và nhập đúng tên người đại diện theo Giấy phép kinh doanh đã tải lên.", dr = "Nam", hr = "Tối đa 500Kb", fr = "Tháng", pr = "Gói phù hợp nhất", gr = "Tiếp tục", mr = "Không tìm thấy gói nào.", yr = "Vui lòng thường xuyên kiểm tra hộp thư Email nhận thông báo/ thông tin tài khoản từ nhà cung cấp.", vr = "Quý khách vui lòng chờ đợi trong vòng 1-2 ngày làm việc để hoàn tất quá trình đăng ký.", br = "Sau khi được cấp tài khoản, vui lòng vào phần thiết lập ở thanh menu để kết nối và sử dụng dịch vụ", Sr = "của", xr = "OK", $r = "Tùy chọn", Pr = "hoặc", Cr = "Đơn hàng đã được tạo thành công", wr = "Đơn hàng đã hết hạn", Tr = "Thông tin đơn hàng", kr = "Tóm tắt đơn hàng", Or = "Giấy chứng nhận đăng ký doanh nghiệp", Lr = "Hộ chiếu", Ir = "Số tiền thanh toán", Nr = "Thanh toán thất bại", Rr = ["Mở ứng dụng Ngân hàng hoặc Ví điện tử trên điện thoại", "Trên ứng dụng chọn tính năng Quét mã QR", "Quét mã QR ở trang này và thanh toán"], Fr = "Hướng dẫn thanh toán QR", Er = "Hình thức thanh toán:", Ar = "Thanh toán thành công!", Dr = "Hết thời gian thanh toán", jr = "Hết thời gian thanh toán! Vui lòng thử lại.", Ur = "Thanh toán", Mr = "Địa chỉ thường trú", Hr = "Số điện thoại", Br = "Sản phẩm", Kr = "Nhà cung cấp", Vr = "Tên NCC", qr = "Tỉnh/Thành phố", zr = "Thanh toán qua mã QR", Qr = "Quét mã QR để thanh toán", Wr = "Số lượng", Gr = "Đăng ký hoàn tất", Xr = "Phí đăng ký", _r = "Bắt buộc", Jr = "Trở về trang chủ", Yr = "Quay lại bước 1", Zr = "Mẫu số hóa đơn (1-9)", ea = "Lưu", ta = "Số đơn/tháng", na = "Chọn tệp", ia = "Chọn gói hóa đơn điện tử", oa = "Chọn nhà cung cấp", sa = "Chọn gói chữ ký số", ra = "Chọn gói đăng ký", aa = "Sản phẩm đã chọn", ca = "Gói chữ ký số", la = "Bản quyền phần mềm hóa đơn điện tử", ua = "Thông Tin", da = "Xác Nhận Và Thanh Toán", ha = "Gói Hóa Đơn", fa = "Gói đăng ký", pa = "CQT quản lý", ga = "5 ký tự do CQT cấp cho loại hóa đơn máy tính tiền", ma = "Mã số thuế đơn vị", ya = "Điều khoản và Chính sách sử dụng", va = "Thời gian còn lại", ba = "Tổng cộng", Sa = "Tổng tiền", xa = "Thành tiền", $a = "Giao dịch đã được hủy. Quay về trang đăng ký.", Pa = "Đơn vị tính", Ca = "1. Thông tin đơn vị", wa = "đơn/tháng", Ta = "Đơn giá", ka = "đơn/ tháng", Oa = "Tải lên mặt sau CCCD", La = "Tải lên tệp", Ia = "Tải lên mặt trước CCCD", Na = "Tải logo lên", Ra = "Chính sách sử dụng", Fa = "Phường/Xã", Ea = "Đăng ký hóa đơn điện tử", Aa = "Năm phát hành (2 chữ số cuối)", Da = {
1455
+ accountName: Fo,
1456
+ accountNumber: Eo,
1457
+ address: Ao,
1458
+ agreeWith: Do,
1459
+ and: jo,
1460
+ back: Uo,
1461
+ backIdCard: Mo,
1462
+ bankName: Ho,
1463
+ beneficiaryBank: Bo,
1464
+ businessLicense: Ko,
1465
+ cancel: Vo,
1466
+ cancelTransaction: qo,
1467
+ close: zo,
1468
+ codeTypeC: Qo,
1469
+ codeTypeK: Wo,
1470
+ codeTypeTooltip: Go,
1471
+ comingSoon: Xo,
1472
+ companyName: _o,
1473
+ completePaymentIn: Jo,
1474
+ confirm: Yo,
1475
+ confirmationTitle: Zo,
1476
+ contactInfo: es,
1477
+ copy: ts,
1478
+ country: ns,
1479
+ customLettersTooltip: is,
1480
+ customUnits: os,
1481
+ dateOfBirth: ss,
1482
+ decrease: rs,
1483
+ delete: "Xóa",
1484
+ digitalSignaturePackage: as,
1485
+ district: cs,
1486
+ duration: ls,
1487
+ eContractTitle: us,
1488
+ edit: ds,
1489
+ electronicInvoices: hs,
1490
+ email: fs,
1491
+ enterIdCard: ps,
1492
+ enterInvoiceSymbol: gs,
1493
+ enterPassport: ms,
1494
+ enterProviderName: ys,
1495
+ enterTaxAuthorityCode: vs,
1496
+ errorFetchTaxInfo: bs,
1497
+ errorFileFormat: Ss,
1498
+ errorFileSize: xs,
1499
+ errorInvalidAddress: $s,
1500
+ errorInvalidCard: Ps,
1501
+ errorInvalidDate: Cs,
1502
+ errorInvalidEmail: ws,
1503
+ errorInvalidIdCard: Ts,
1504
+ errorInvalidName: ks,
1505
+ errorInvalidPhone: Os,
1506
+ errorInvalidProviderName: Ls,
1507
+ errorInvalidTaxAuthorityCode: Is,
1508
+ errorInvalidTaxCode: Ns,
1509
+ errorNetwork: Rs,
1510
+ errorRequired: Fs,
1511
+ errorUnknown: Es,
1512
+ female: As,
1513
+ fileFormat: Ds,
1514
+ frontIdCard: js,
1515
+ fullName: Us,
1516
+ gender: Ms,
1517
+ hasUsedEInvoice: Hs,
1518
+ hasUsedEInvoiceBefore: Bs,
1519
+ hotlineDesc: Ks,
1520
+ hotlineDomestic: Vs,
1521
+ idNumber: qs,
1522
+ increase: zs,
1523
+ informationSent: Qs,
1524
+ invoicePackage: Ws,
1525
+ invoiceSymbol: Gs,
1526
+ invoiceTemplate: Xs,
1527
+ invoiceTemplateTypes: _s,
1528
+ invoiceTypeB: Js,
1529
+ invoiceTypeD: Ys,
1530
+ invoiceTypeG: Zs,
1531
+ invoiceTypeH: er,
1532
+ invoiceTypeL: tr,
1533
+ invoiceTypeM: nr,
1534
+ invoiceTypeN: ir,
1535
+ invoiceTypeT: or,
1536
+ invoiceTypeTooltip: sr,
1537
+ invoiceTypeX: rr,
1538
+ invoiceUsageInfo: ar,
1539
+ invoicesPerMonth: cr,
1540
+ legalRepInfo: lr,
1541
+ legalRepNote: ur,
1542
+ male: dr,
1543
+ maxFileSize: hr,
1544
+ month: fr,
1545
+ mostSuitablePackage: pr,
1546
+ next: gr,
1547
+ noPackageFound: mr,
1548
+ notice1: yr,
1549
+ notice2: vr,
1550
+ notice3: br,
1551
+ of: Sr,
1552
+ ok: xr,
1553
+ optional: $r,
1554
+ or: Pr,
1555
+ orderCreated: Cr,
1556
+ orderExpired: wr,
1557
+ orderInfo: Tr,
1558
+ orderSummary: kr,
1559
+ organizationCert: Or,
1560
+ package: "Gói",
1561
+ passport: Lr,
1562
+ paymentAmount: Ir,
1563
+ paymentFailed: Nr,
1564
+ paymentInstructions: Rr,
1565
+ paymentInstructionsTitle: Fr,
1566
+ paymentMethod: Er,
1567
+ paymentSuccess: Ar,
1568
+ paymentTimeout: Dr,
1569
+ paymentTimeoutMessage: jr,
1570
+ paymentTitle: Ur,
1571
+ permanentAddress: Mr,
1572
+ phone: Hr,
1573
+ product: Br,
1574
+ provider: Kr,
1575
+ providerName: Vr,
1576
+ province: qr,
1577
+ qrPayment: zr,
1578
+ qrPaymentTitle: Qr,
1579
+ quantity: Wr,
1580
+ registrationComplete: Gr,
1581
+ registrationFee: Xr,
1582
+ required: _r,
1583
+ returnHome: Jr,
1584
+ returnToStep1: Yr,
1585
+ sampleNumberTooltip: Zr,
1586
+ save: ea,
1587
+ searchUnits: ta,
1588
+ selectFile: na,
1589
+ selectInvoicePackage: ia,
1590
+ selectProvider: oa,
1591
+ selectSignaturePackage: sa,
1592
+ selectSubscriptionPackage: ra,
1593
+ selectedProducts: aa,
1594
+ signaturePackage: ca,
1595
+ softwareLicense: la,
1596
+ stepInfo: ua,
1597
+ stepPayment: da,
1598
+ stepPlan: ha,
1599
+ subscriptionPackage: fa,
1600
+ taxAuthority: pa,
1601
+ taxAuthorityCode: ga,
1602
+ taxCode: ma,
1603
+ termsAndUsagePolicy: ya,
1604
+ timeLeft: va,
1605
+ total: ba,
1606
+ totalAmount: Sa,
1607
+ totalPrice: xa,
1608
+ transactionCanceled: $a,
1609
+ unit: Pa,
1610
+ unitInfo: Ca,
1611
+ unitPerMonth: wa,
1612
+ unitPrice: Ta,
1613
+ unitsPerMonth: ka,
1614
+ uploadBackId: Oa,
1615
+ uploadFile: La,
1616
+ uploadFrontId: Ia,
1617
+ uploadLogo: Na,
1618
+ usagePolicy: Ra,
1619
+ ward: Fa,
1620
+ widgetTitle: Ea,
1621
+ yearTooltip: Aa
1622
+ }, {
1623
+ slice: ja,
1624
+ forEach: Ua
1625
+ } = [];
1626
+ function Ma(o) {
1627
+ return Ua.call(ja.call(arguments, 1), (e) => {
1628
+ if (e)
1629
+ for (const t in e)
1630
+ o[t] === void 0 && (o[t] = e[t]);
1631
+ }), o;
1632
+ }
1633
+ function Ha(o) {
1634
+ return typeof o != "string" ? !1 : [/<\s*script.*?>/i, /<\s*\/\s*script\s*>/i, /<\s*img.*?on\w+\s*=/i, /<\s*\w+\s*on\w+\s*=.*?>/i, /javascript\s*:/i, /vbscript\s*:/i, /expression\s*\(/i, /eval\s*\(/i, /alert\s*\(/i, /document\.cookie/i, /document\.write\s*\(/i, /window\.location/i, /innerHTML/i].some((t) => t.test(o));
1635
+ }
1636
+ const Ae = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, Ba = function(o, e) {
1637
+ const n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
1638
+ path: "/"
1639
+ }, i = encodeURIComponent(e);
1640
+ let s = `${o}=${i}`;
1641
+ if (n.maxAge > 0) {
1642
+ const r = n.maxAge - 0;
1643
+ if (Number.isNaN(r)) throw new Error("maxAge should be a Number");
1644
+ s += `; Max-Age=${Math.floor(r)}`;
1645
+ }
1646
+ if (n.domain) {
1647
+ if (!Ae.test(n.domain))
1648
+ throw new TypeError("option domain is invalid");
1649
+ s += `; Domain=${n.domain}`;
1650
+ }
1651
+ if (n.path) {
1652
+ if (!Ae.test(n.path))
1653
+ throw new TypeError("option path is invalid");
1654
+ s += `; Path=${n.path}`;
1655
+ }
1656
+ if (n.expires) {
1657
+ if (typeof n.expires.toUTCString != "function")
1658
+ throw new TypeError("option expires is invalid");
1659
+ s += `; Expires=${n.expires.toUTCString()}`;
1660
+ }
1661
+ if (n.httpOnly && (s += "; HttpOnly"), n.secure && (s += "; Secure"), n.sameSite)
1662
+ switch (typeof n.sameSite == "string" ? n.sameSite.toLowerCase() : n.sameSite) {
1663
+ case !0:
1664
+ s += "; SameSite=Strict";
1665
+ break;
1666
+ case "lax":
1667
+ s += "; SameSite=Lax";
1668
+ break;
1669
+ case "strict":
1670
+ s += "; SameSite=Strict";
1671
+ break;
1672
+ case "none":
1673
+ s += "; SameSite=None";
1674
+ break;
1675
+ default:
1676
+ throw new TypeError("option sameSite is invalid");
1677
+ }
1678
+ return n.partitioned && (s += "; Partitioned"), s;
1679
+ }, De = {
1680
+ create(o, e, t, n) {
1681
+ let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
1682
+ path: "/",
1683
+ sameSite: "strict"
1684
+ };
1685
+ t && (i.expires = /* @__PURE__ */ new Date(), i.expires.setTime(i.expires.getTime() + t * 60 * 1e3)), n && (i.domain = n), document.cookie = Ba(o, e, i);
1686
+ },
1687
+ read(o) {
1688
+ const e = `${o}=`, t = document.cookie.split(";");
1689
+ for (let n = 0; n < t.length; n++) {
1690
+ let i = t[n];
1691
+ for (; i.charAt(0) === " "; ) i = i.substring(1, i.length);
1692
+ if (i.indexOf(e) === 0) return i.substring(e.length, i.length);
1693
+ }
1694
+ return null;
1695
+ },
1696
+ remove(o, e) {
1697
+ this.create(o, "", -1, e);
1698
+ }
1699
+ };
1700
+ var Ka = {
1701
+ name: "cookie",
1702
+ // Deconstruct the options object and extract the lookupCookie property
1703
+ lookup(o) {
1704
+ let {
1705
+ lookupCookie: e
1706
+ } = o;
1707
+ if (e && typeof document != "undefined")
1708
+ return De.read(e) || void 0;
1709
+ },
1710
+ // Deconstruct the options object and extract the lookupCookie, cookieMinutes, cookieDomain, and cookieOptions properties
1711
+ cacheUserLanguage(o, e) {
1712
+ let {
1713
+ lookupCookie: t,
1714
+ cookieMinutes: n,
1715
+ cookieDomain: i,
1716
+ cookieOptions: s
1717
+ } = e;
1718
+ t && typeof document != "undefined" && De.create(t, o, n, i, s);
1719
+ }
1720
+ }, Va = {
1721
+ name: "querystring",
1722
+ // Deconstruct the options object and extract the lookupQuerystring property
1723
+ lookup(o) {
1724
+ var n;
1725
+ let {
1726
+ lookupQuerystring: e
1727
+ } = o, t;
1728
+ if (typeof window != "undefined") {
1729
+ let {
1730
+ search: i
1731
+ } = window.location;
1732
+ !window.location.search && ((n = window.location.hash) == null ? void 0 : n.indexOf("?")) > -1 && (i = window.location.hash.substring(window.location.hash.indexOf("?")));
1733
+ const r = i.substring(1).split("&");
1734
+ for (let a = 0; a < r.length; a++) {
1735
+ const c = r[a].indexOf("=");
1736
+ c > 0 && r[a].substring(0, c) === e && (t = r[a].substring(c + 1));
1737
+ }
1738
+ }
1739
+ return t;
1740
+ }
1741
+ }, qa = {
1742
+ name: "hash",
1743
+ // Deconstruct the options object and extract the lookupHash property and the lookupFromHashIndex property
1744
+ lookup(o) {
1745
+ var i;
1746
+ let {
1747
+ lookupHash: e,
1748
+ lookupFromHashIndex: t
1749
+ } = o, n;
1750
+ if (typeof window != "undefined") {
1751
+ const {
1752
+ hash: s
1753
+ } = window.location;
1754
+ if (s && s.length > 2) {
1755
+ const r = s.substring(1);
1756
+ if (e) {
1757
+ const a = r.split("&");
1758
+ for (let c = 0; c < a.length; c++) {
1759
+ const l = a[c].indexOf("=");
1760
+ l > 0 && a[c].substring(0, l) === e && (n = a[c].substring(l + 1));
1761
+ }
1762
+ }
1763
+ if (n) return n;
1764
+ if (!n && t > -1) {
1765
+ const a = s.match(/\/([a-zA-Z-]*)/g);
1766
+ return Array.isArray(a) ? (i = a[typeof t == "number" ? t : 0]) == null ? void 0 : i.replace("/", "") : void 0;
1767
+ }
1768
+ }
1769
+ }
1770
+ return n;
1771
+ }
1772
+ };
1773
+ let M = null;
1774
+ const je = () => {
1775
+ if (M !== null) return M;
1776
+ try {
1777
+ if (M = typeof window != "undefined" && window.localStorage !== null, !M)
1778
+ return !1;
1779
+ const o = "i18next.translate.boo";
1780
+ window.localStorage.setItem(o, "foo"), window.localStorage.removeItem(o);
1781
+ } catch (o) {
1782
+ M = !1;
1783
+ }
1784
+ return M;
1785
+ };
1786
+ var za = {
1787
+ name: "localStorage",
1788
+ // Deconstruct the options object and extract the lookupLocalStorage property
1789
+ lookup(o) {
1790
+ let {
1791
+ lookupLocalStorage: e
1792
+ } = o;
1793
+ if (e && je())
1794
+ return window.localStorage.getItem(e) || void 0;
1795
+ },
1796
+ // Deconstruct the options object and extract the lookupLocalStorage property
1797
+ cacheUserLanguage(o, e) {
1798
+ let {
1799
+ lookupLocalStorage: t
1800
+ } = e;
1801
+ t && je() && window.localStorage.setItem(t, o);
1802
+ }
1803
+ };
1804
+ let H = null;
1805
+ const Ue = () => {
1806
+ if (H !== null) return H;
1807
+ try {
1808
+ if (H = typeof window != "undefined" && window.sessionStorage !== null, !H)
1809
+ return !1;
1810
+ const o = "i18next.translate.boo";
1811
+ window.sessionStorage.setItem(o, "foo"), window.sessionStorage.removeItem(o);
1812
+ } catch (o) {
1813
+ H = !1;
1814
+ }
1815
+ return H;
1816
+ };
1817
+ var Qa = {
1818
+ name: "sessionStorage",
1819
+ lookup(o) {
1820
+ let {
1821
+ lookupSessionStorage: e
1822
+ } = o;
1823
+ if (e && Ue())
1824
+ return window.sessionStorage.getItem(e) || void 0;
1825
+ },
1826
+ cacheUserLanguage(o, e) {
1827
+ let {
1828
+ lookupSessionStorage: t
1829
+ } = e;
1830
+ t && Ue() && window.sessionStorage.setItem(t, o);
1831
+ }
1832
+ }, Wa = {
1833
+ name: "navigator",
1834
+ lookup(o) {
1835
+ const e = [];
1836
+ if (typeof navigator != "undefined") {
1837
+ const {
1838
+ languages: t,
1839
+ userLanguage: n,
1840
+ language: i
1841
+ } = navigator;
1842
+ if (t)
1843
+ for (let s = 0; s < t.length; s++)
1844
+ e.push(t[s]);
1845
+ n && e.push(n), i && e.push(i);
1846
+ }
1847
+ return e.length > 0 ? e : void 0;
1848
+ }
1849
+ }, Ga = {
1850
+ name: "htmlTag",
1851
+ // Deconstruct the options object and extract the htmlTag property
1852
+ lookup(o) {
1853
+ let {
1854
+ htmlTag: e
1855
+ } = o, t;
1856
+ const n = e || (typeof document != "undefined" ? document.documentElement : null);
1857
+ return n && typeof n.getAttribute == "function" && (t = n.getAttribute("lang")), t;
1858
+ }
1859
+ }, Xa = {
1860
+ name: "path",
1861
+ // Deconstruct the options object and extract the lookupFromPathIndex property
1862
+ lookup(o) {
1863
+ var i;
1864
+ let {
1865
+ lookupFromPathIndex: e
1866
+ } = o;
1867
+ if (typeof window == "undefined") return;
1868
+ const t = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
1869
+ return Array.isArray(t) ? (i = t[typeof e == "number" ? e : 0]) == null ? void 0 : i.replace("/", "") : void 0;
1870
+ }
1871
+ }, _a = {
1872
+ name: "subdomain",
1873
+ lookup(o) {
1874
+ var i, s;
1875
+ let {
1876
+ lookupFromSubdomainIndex: e
1877
+ } = o;
1878
+ const t = typeof e == "number" ? e + 1 : 1, n = typeof window != "undefined" && ((s = (i = window.location) == null ? void 0 : i.hostname) == null ? void 0 : s.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));
1879
+ if (n)
1880
+ return n[t];
1881
+ }
1882
+ };
1883
+ let Qe = !1;
1884
+ try {
1885
+ document.cookie, Qe = !0;
1886
+ } catch (o) {
1887
+ }
1888
+ const We = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
1889
+ Qe || We.splice(1, 1);
1890
+ const Ja = () => ({
1891
+ order: We,
1892
+ lookupQuerystring: "lng",
1893
+ lookupCookie: "i18next",
1894
+ lookupLocalStorage: "i18nextLng",
1895
+ lookupSessionStorage: "i18nextLng",
1896
+ // cache user language
1897
+ caches: ["localStorage"],
1898
+ excludeCacheFor: ["cimode"],
1899
+ // cookieMinutes: 10,
1900
+ // cookieDomain: 'myDomain'
1901
+ convertDetectedLanguage: (o) => o
1902
+ });
1903
+ class Ge {
1904
+ constructor(e) {
1905
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1906
+ this.type = "languageDetector", this.detectors = {}, this.init(e, t);
1907
+ }
1908
+ init() {
1909
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
1910
+ languageUtils: {}
1911
+ }, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1912
+ this.services = e, this.options = Ma(t, this.options || {}, Ja()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (i) => i.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector(Ka), this.addDetector(Va), this.addDetector(za), this.addDetector(Qa), this.addDetector(Wa), this.addDetector(Ga), this.addDetector(Xa), this.addDetector(_a), this.addDetector(qa);
1913
+ }
1914
+ addDetector(e) {
1915
+ return this.detectors[e.name] = e, this;
1916
+ }
1917
+ detect() {
1918
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.order, t = [];
1919
+ return e.forEach((n) => {
1920
+ if (this.detectors[n]) {
1921
+ let i = this.detectors[n].lookup(this.options);
1922
+ i && typeof i == "string" && (i = [i]), i && (t = t.concat(i));
1923
+ }
1924
+ }), t = t.filter((n) => n != null && !Ha(n)).map((n) => this.options.convertDetectedLanguage(n)), this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes ? t : t.length > 0 ? t[0] : null;
1925
+ }
1926
+ cacheUserLanguage(e) {
1927
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.caches;
1928
+ t && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(e) > -1 || t.forEach((n) => {
1929
+ this.detectors[n] && this.detectors[n].cacheUserLanguage(e, this.options);
1930
+ }));
1931
+ }
1932
+ }
1933
+ Ge.type = "languageDetector";
1934
+ function de(o) {
1935
+ "@babel/helpers - typeof";
1936
+ return de = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
1937
+ return typeof e;
1938
+ } : function(e) {
1939
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1940
+ }, de(o);
1941
+ }
1942
+ function Xe() {
1943
+ return typeof XMLHttpRequest == "function" || (typeof XMLHttpRequest == "undefined" ? "undefined" : de(XMLHttpRequest)) === "object";
1944
+ }
1945
+ function Ya(o) {
1946
+ return !!o && typeof o.then == "function";
1947
+ }
1948
+ function Za(o) {
1949
+ return Ya(o) ? o : Promise.resolve(o);
1950
+ }
1951
+ function Me(o, e) {
1952
+ var t = Object.keys(o);
1953
+ if (Object.getOwnPropertySymbols) {
1954
+ var n = Object.getOwnPropertySymbols(o);
1955
+ e && (n = n.filter(function(i) {
1956
+ return Object.getOwnPropertyDescriptor(o, i).enumerable;
1957
+ })), t.push.apply(t, n);
1958
+ }
1959
+ return t;
1960
+ }
1961
+ function He(o) {
1962
+ for (var e = 1; e < arguments.length; e++) {
1963
+ var t = arguments[e] != null ? arguments[e] : {};
1964
+ e % 2 ? Me(Object(t), !0).forEach(function(n) {
1965
+ ec(o, n, t[n]);
1966
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(t)) : Me(Object(t)).forEach(function(n) {
1967
+ Object.defineProperty(o, n, Object.getOwnPropertyDescriptor(t, n));
1968
+ });
1969
+ }
1970
+ return o;
1971
+ }
1972
+ function ec(o, e, t) {
1973
+ return (e = tc(e)) in o ? Object.defineProperty(o, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : o[e] = t, o;
1974
+ }
1975
+ function tc(o) {
1976
+ var e = nc(o, "string");
1977
+ return j(e) == "symbol" ? e : e + "";
1978
+ }
1979
+ function nc(o, e) {
1980
+ if (j(o) != "object" || !o) return o;
1981
+ var t = o[Symbol.toPrimitive];
1982
+ if (t !== void 0) {
1983
+ var n = t.call(o, e);
1984
+ if (j(n) != "object") return n;
1985
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1986
+ }
1987
+ return (e === "string" ? String : Number)(o);
1988
+ }
1989
+ function j(o) {
1990
+ "@babel/helpers - typeof";
1991
+ return j = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
1992
+ return typeof e;
1993
+ } : function(e) {
1994
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1995
+ }, j(o);
1996
+ }
1997
+ var A = typeof fetch == "function" ? fetch : void 0;
1998
+ typeof global != "undefined" && global.fetch ? A = global.fetch : typeof window != "undefined" && window.fetch && (A = window.fetch);
1999
+ var X;
2000
+ Xe() && (typeof global != "undefined" && global.XMLHttpRequest ? X = global.XMLHttpRequest : typeof window != "undefined" && window.XMLHttpRequest && (X = window.XMLHttpRequest));
2001
+ var ie;
2002
+ typeof ActiveXObject == "function" && (typeof global != "undefined" && global.ActiveXObject ? ie = global.ActiveXObject : typeof window != "undefined" && window.ActiveXObject && (ie = window.ActiveXObject));
2003
+ typeof A != "function" && (A = void 0);
2004
+ if (!A && !X && !ie)
2005
+ try {
2006
+ import("./browser-ponyfill-BxQPfTD2.js").then((o) => o.b).then(function(o) {
2007
+ A = o.default;
2008
+ }).catch(function() {
2009
+ });
2010
+ } catch (o) {
2011
+ }
2012
+ var he = function(e, t) {
2013
+ if (t && j(t) === "object") {
2014
+ var n = "";
2015
+ for (var i in t)
2016
+ n += "&" + encodeURIComponent(i) + "=" + encodeURIComponent(t[i]);
2017
+ if (!n) return e;
2018
+ e = e + (e.indexOf("?") !== -1 ? "&" : "?") + n.slice(1);
2019
+ }
2020
+ return e;
2021
+ }, Be = function(e, t, n, i) {
2022
+ var s = function(c) {
2023
+ if (!c.ok) return n(c.statusText || "Error", {
2024
+ status: c.status
2025
+ });
2026
+ c.text().then(function(l) {
2027
+ n(null, {
2028
+ status: c.status,
2029
+ data: l
2030
+ });
2031
+ }).catch(n);
2032
+ };
2033
+ if (i) {
2034
+ var r = i(e, t);
2035
+ if (r instanceof Promise) {
2036
+ r.then(s).catch(n);
2037
+ return;
2038
+ }
2039
+ }
2040
+ typeof fetch == "function" ? fetch(e, t).then(s).catch(n) : A(e, t).then(s).catch(n);
2041
+ }, Ke = !1, ic = function(e, t, n, i) {
2042
+ e.queryStringParams && (t = he(t, e.queryStringParams));
2043
+ var s = He({}, typeof e.customHeaders == "function" ? e.customHeaders() : e.customHeaders);
2044
+ typeof window == "undefined" && typeof global != "undefined" && typeof global.process != "undefined" && 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");
2045
+ var r = typeof e.requestOptions == "function" ? e.requestOptions(n) : e.requestOptions, a = He({
2046
+ method: n ? "POST" : "GET",
2047
+ body: n ? e.stringify(n) : void 0,
2048
+ headers: s
2049
+ }, Ke ? {} : r), c = typeof e.alternateFetch == "function" && e.alternateFetch.length >= 1 ? e.alternateFetch : void 0;
2050
+ try {
2051
+ Be(t, a, i, c);
2052
+ } catch (l) {
2053
+ if (!r || Object.keys(r).length === 0 || !l.message || l.message.indexOf("not implemented") < 0)
2054
+ return i(l);
2055
+ try {
2056
+ Object.keys(r).forEach(function(d) {
2057
+ delete a[d];
2058
+ }), Be(t, a, i, c), Ke = !0;
2059
+ } catch (d) {
2060
+ i(d);
2061
+ }
2062
+ }
2063
+ }, oc = function(e, t, n, i) {
2064
+ n && j(n) === "object" && (n = he("", n).slice(1)), e.queryStringParams && (t = he(t, e.queryStringParams));
2065
+ try {
2066
+ var s = X ? new X() : new ie("MSXML2.XMLHTTP.3.0");
2067
+ 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");
2068
+ var r = e.customHeaders;
2069
+ if (r = typeof r == "function" ? r() : r, r)
2070
+ for (var a in r)
2071
+ s.setRequestHeader(a, r[a]);
2072
+ s.onreadystatechange = function() {
2073
+ s.readyState > 3 && i(s.status >= 400 ? s.statusText : null, {
2074
+ status: s.status,
2075
+ data: s.responseText
2076
+ });
2077
+ }, s.send(n);
2078
+ } catch (c) {
2079
+ console && console.log(c);
2080
+ }
2081
+ }, sc = function(e, t, n, i) {
2082
+ if (typeof n == "function" && (i = n, n = void 0), i = i || function() {
2083
+ }, A && t.indexOf("file:") !== 0)
2084
+ return ic(e, t, n, i);
2085
+ if (Xe() || typeof ActiveXObject == "function")
2086
+ return oc(e, t, n, i);
2087
+ i(new Error("No fetch and no xhr implementation found!"));
2088
+ };
2089
+ function B(o) {
2090
+ "@babel/helpers - typeof";
2091
+ return B = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
2092
+ return typeof e;
2093
+ } : function(e) {
2094
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2095
+ }, B(o);
2096
+ }
2097
+ function Ve(o, e) {
2098
+ var t = Object.keys(o);
2099
+ if (Object.getOwnPropertySymbols) {
2100
+ var n = Object.getOwnPropertySymbols(o);
2101
+ e && (n = n.filter(function(i) {
2102
+ return Object.getOwnPropertyDescriptor(o, i).enumerable;
2103
+ })), t.push.apply(t, n);
2104
+ }
2105
+ return t;
2106
+ }
2107
+ function ae(o) {
2108
+ for (var e = 1; e < arguments.length; e++) {
2109
+ var t = arguments[e] != null ? arguments[e] : {};
2110
+ e % 2 ? Ve(Object(t), !0).forEach(function(n) {
2111
+ _e(o, n, t[n]);
2112
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(t)) : Ve(Object(t)).forEach(function(n) {
2113
+ Object.defineProperty(o, n, Object.getOwnPropertyDescriptor(t, n));
2114
+ });
2115
+ }
2116
+ return o;
2117
+ }
2118
+ function rc(o, e) {
2119
+ if (!(o instanceof e)) throw new TypeError("Cannot call a class as a function");
2120
+ }
2121
+ function ac(o, e) {
2122
+ for (var t = 0; t < e.length; t++) {
2123
+ var n = e[t];
2124
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(o, Je(n.key), n);
2125
+ }
2126
+ }
2127
+ function cc(o, e, t) {
2128
+ return e && ac(o.prototype, e), Object.defineProperty(o, "prototype", { writable: !1 }), o;
2129
+ }
2130
+ function _e(o, e, t) {
2131
+ return (e = Je(e)) in o ? Object.defineProperty(o, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : o[e] = t, o;
2132
+ }
2133
+ function Je(o) {
2134
+ var e = lc(o, "string");
2135
+ return B(e) == "symbol" ? e : e + "";
2136
+ }
2137
+ function lc(o, e) {
2138
+ if (B(o) != "object" || !o) return o;
2139
+ var t = o[Symbol.toPrimitive];
2140
+ if (t !== void 0) {
2141
+ var n = t.call(o, e);
2142
+ if (B(n) != "object") return n;
2143
+ throw new TypeError("@@toPrimitive must return a primitive value.");
2144
+ }
2145
+ return String(o);
2146
+ }
2147
+ var uc = function() {
2148
+ return {
2149
+ loadPath: "/locales/{{lng}}/{{ns}}.json",
2150
+ addPath: "/locales/add/{{lng}}/{{ns}}",
2151
+ parse: function(t) {
2152
+ return JSON.parse(t);
2153
+ },
2154
+ stringify: JSON.stringify,
2155
+ parsePayload: function(t, n, i) {
2156
+ return _e({}, n, i || "");
2157
+ },
2158
+ parseLoadPayload: function(t, n) {
2159
+ },
2160
+ request: sc,
2161
+ reloadInterval: typeof window != "undefined" ? !1 : 60 * 60 * 1e3,
2162
+ customHeaders: {},
2163
+ queryStringParams: {},
2164
+ crossDomain: !1,
2165
+ withCredentials: !1,
2166
+ overrideMimeType: !1,
2167
+ requestOptions: {
2168
+ mode: "cors",
2169
+ credentials: "same-origin",
2170
+ cache: "default"
2171
+ }
2172
+ };
2173
+ }, Ye = function() {
2174
+ function o(e) {
2175
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2176
+ rc(this, o), this.services = e, this.options = t, this.allOptions = n, this.type = "backend", this.init(e, t, n);
2177
+ }
2178
+ return cc(o, [{
2179
+ key: "init",
2180
+ value: function(t) {
2181
+ var n = this, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2182
+ if (this.services = t, this.options = ae(ae(ae({}, uc()), this.options || {}), i), this.allOptions = s, this.services && this.options.reloadInterval) {
2183
+ var r = setInterval(function() {
2184
+ return n.reload();
2185
+ }, this.options.reloadInterval);
2186
+ B(r) === "object" && typeof r.unref == "function" && r.unref();
2187
+ }
2188
+ }
2189
+ }, {
2190
+ key: "readMulti",
2191
+ value: function(t, n, i) {
2192
+ this._readAny(t, t, n, n, i);
2193
+ }
2194
+ }, {
2195
+ key: "read",
2196
+ value: function(t, n, i) {
2197
+ this._readAny([t], t, [n], n, i);
2198
+ }
2199
+ }, {
2200
+ key: "_readAny",
2201
+ value: function(t, n, i, s, r) {
2202
+ var a = this, c = this.options.loadPath;
2203
+ typeof this.options.loadPath == "function" && (c = this.options.loadPath(t, i)), c = Za(c), c.then(function(l) {
2204
+ if (!l) return r(null, {});
2205
+ var d = a.services.interpolator.interpolate(l, {
2206
+ lng: t.join("+"),
2207
+ ns: i.join("+")
2208
+ });
2209
+ a.loadUrl(d, r, n, s);
2210
+ });
2211
+ }
2212
+ }, {
2213
+ key: "loadUrl",
2214
+ value: function(t, n, i, s) {
2215
+ var r = this, a = typeof i == "string" ? [i] : i, c = typeof s == "string" ? [s] : s, l = this.options.parseLoadPayload(a, c);
2216
+ this.options.request(this.options, t, l, function(d, u) {
2217
+ if (u && (u.status >= 500 && u.status < 600 || !u.status)) return n("failed loading " + t + "; status code: " + u.status, !0);
2218
+ if (u && u.status >= 400 && u.status < 500) return n("failed loading " + t + "; status code: " + u.status, !1);
2219
+ if (!u && d && d.message) {
2220
+ var p = d.message.toLowerCase(), f = ["failed", "fetch", "network", "load"].find(function(v) {
2221
+ return p.indexOf(v) > -1;
2222
+ });
2223
+ if (f)
2224
+ return n("failed loading " + t + ": " + d.message, !0);
2225
+ }
2226
+ if (d) return n(d, !1);
2227
+ var h, y;
2228
+ try {
2229
+ typeof u.data == "string" ? h = r.options.parse(u.data, i, s) : h = u.data;
2230
+ } catch (v) {
2231
+ y = "failed parsing " + t + " to json";
2232
+ }
2233
+ if (y) return n(y, !1);
2234
+ n(null, h);
2235
+ });
2236
+ }
2237
+ }, {
2238
+ key: "create",
2239
+ value: function(t, n, i, s, r) {
2240
+ var a = this;
2241
+ if (this.options.addPath) {
2242
+ typeof t == "string" && (t = [t]);
2243
+ var c = this.options.parsePayload(n, i, s), l = 0, d = [], u = [];
2244
+ t.forEach(function(p) {
2245
+ var f = a.options.addPath;
2246
+ typeof a.options.addPath == "function" && (f = a.options.addPath(p, n));
2247
+ var h = a.services.interpolator.interpolate(f, {
2248
+ lng: p,
2249
+ ns: n
2250
+ });
2251
+ a.options.request(a.options, h, c, function(y, v) {
2252
+ l += 1, d.push(y), u.push(v), l === t.length && typeof r == "function" && r(d, u);
2253
+ });
2254
+ });
2255
+ }
2256
+ }
2257
+ }, {
2258
+ key: "reload",
2259
+ value: function() {
2260
+ var t = this, n = this.services, i = n.backendConnector, s = n.languageUtils, r = n.logger, a = i.language;
2261
+ if (!(a && a.toLowerCase() === "cimode")) {
2262
+ var c = [], l = function(u) {
2263
+ var p = s.toResolveHierarchy(u);
2264
+ p.forEach(function(f) {
2265
+ c.indexOf(f) < 0 && c.push(f);
2266
+ });
2267
+ };
2268
+ l(a), this.allOptions.preload && this.allOptions.preload.forEach(function(d) {
2269
+ return l(d);
2270
+ }), c.forEach(function(d) {
2271
+ t.allOptions.ns.forEach(function(u) {
2272
+ i.read(d, u, "read", null, null, function(p, f) {
2273
+ p && r.warn("loading namespace ".concat(u, " for language ").concat(d, " failed"), p), !p && f && r.log("loaded namespace ".concat(u, " for language ").concat(d), f), i.loaded("".concat(d, "|").concat(u), p, f);
2274
+ });
2275
+ });
2276
+ });
2277
+ }
2278
+ }
2279
+ }]);
2280
+ }();
2281
+ Ye.type = "backend";
2282
+ b.use(Ye).use(Ge).init({
2283
+ lng: "vi",
2284
+ fallbackLng: "vi",
2285
+ debug: !1,
2286
+ resources: {
2287
+ en: { translation: Ro },
2288
+ vi: { translation: Da }
2289
+ },
2290
+ interpolation: {
2291
+ escapeValue: !1
2292
+ },
2293
+ // Allow returning objects/arrays from translations
2294
+ returnObjects: !0
2295
+ });
2296
+ function dc(o) {
2297
+ b.changeLanguage(o);
2298
+ }
2299
+ function gc(o, e) {
2300
+ return b.t(o, g({ returnObjects: !0 }, e));
2301
+ }
2302
+ function hc(o = "dev") {
2303
+ const e = {
2304
+ dev: {
2305
+ invoiceHubBaseUrl: "https://stag-invoice-hub.atomsolution.vn",
2306
+ posOcbApiUrl: "https://ocb-uat-api-outscope-pos.atomsolution.vn/v1/portal",
2307
+ posBvbApiUrl: "https://bvbank-stag.atomsolution.vn/v1/portal"
2308
+ },
2309
+ stag: {
2310
+ invoiceHubBaseUrl: "https://stag-invoice-hub.atomsolution.vn",
2311
+ posOcbApiUrl: "https://ocb-uat-api-outscope-pos.atomsolution.vn/v1/portal",
2312
+ posBvbApiUrl: "https://bvbank-stag.atomsolution.vn/v1/portal"
2313
+ },
2314
+ uat: {
2315
+ invoiceHubBaseUrl: "https://stag-invoice-hub.atomsolution.vn",
2316
+ posOcbApiUrl: "https://ocb-uat-api-outscope-pos.atomsolution.vn/v1/portal",
2317
+ posBvbApiUrl: "https://bvbank-api-outscope.atomsolution.vn/v1/portal"
2318
+ },
2319
+ pilot: {
2320
+ invoiceHubBaseUrl: "https://invoice-hub.atomsolution.vn",
2321
+ posOcbApiUrl: "https://ocb-smartmerchant-pl-api.ocb.com.vn/v1/portal",
2322
+ posBvbApiUrl: "https://api-outscope-pos.bvbank.net.vn/v1/portal"
2323
+ },
2324
+ prod: {
2325
+ invoiceHubBaseUrl: "https://invoice-hub.atomsolution.vn",
2326
+ posOcbApiUrl: "https://ocb-smartmerchant-api.ocb.com.vn/v1/portal",
2327
+ posBvbApiUrl: "https://api-outscope-pos.bvbank.net.vn/v1/portal"
2328
+ }
2329
+ };
2330
+ return e[o] || e.dev;
2331
+ }
2332
+ let Z = null, fe = !1;
2333
+ function Ze(o) {
2334
+ if (!["dev", "uat", "prod", "stag", "pilot"].includes(o))
2335
+ throw new Error(
2336
+ `Invalid mode: ${o}. Valid modes are 'dev', 'uat', 'prod', 'stag', 'pilot'.`
2337
+ );
2338
+ Z = o, fe = !0;
2339
+ try {
2340
+ localStorage.setItem("currentMode", o);
2341
+ } catch (e) {
2342
+ console.warn("Could not save to localStorage:", e);
2343
+ }
2344
+ }
2345
+ function fc() {
2346
+ if (fe && Z)
2347
+ return Z;
2348
+ try {
2349
+ const o = localStorage.getItem("currentMode");
2350
+ if (o)
2351
+ return Z = o, fe = !0, o;
2352
+ } catch (o) {
2353
+ console.warn("Could not read from localStorage:", o);
2354
+ }
2355
+ return "dev";
2356
+ }
2357
+ function mc() {
2358
+ const o = fc();
2359
+ return hc(o);
2360
+ }
2361
+ let ce = null, le = null;
2362
+ function yc(o) {
2363
+ return se(this, null, function* () {
2364
+ if (o.mode && Ze(o.mode), o.language && et(o.language), !le) {
2365
+ const { InvoiceRegisterWidget: n } = yield import("./widget-C6l0mR-x.js");
2366
+ le = n;
2367
+ }
2368
+ const e = typeof o.selector == "string" ? document.querySelector(o.selector) : o.selector;
2369
+ if (!e)
2370
+ throw new Error(`[WidgetSDK] Mount element not found: ${o.selector}`);
2371
+ function t() {
2372
+ e.innerHTML = "", o.onClose && o.onClose();
2373
+ }
2374
+ return le(
2375
+ e,
2376
+ t,
2377
+ o.data || {},
2378
+ o.theme
2379
+ ), { destroy: t };
2380
+ });
2381
+ }
2382
+ function vc(o) {
2383
+ return se(this, null, function* () {
2384
+ if (o.mode && Ze(o.mode), o.language && et(o.language), !ce) {
2385
+ const { EContractWidget: n } = yield import("./widget-C6l0mR-x.js");
2386
+ ce = n;
2387
+ }
2388
+ const e = typeof o.selector == "string" ? document.querySelector(o.selector) : o.selector;
2389
+ if (!e)
2390
+ throw new Error(`[WidgetSDK] Mount element not found: ${o.selector}`);
2391
+ function t() {
2392
+ e.innerHTML = "", o.onClose && o.onClose();
2393
+ }
2394
+ return ce(e, t, o.data || {}, o.theme), { destroy: t };
2395
+ });
2396
+ }
2397
+ let pe = /* @__PURE__ */ new Set();
2398
+ function et(o) {
2399
+ if (o !== "vi" && o !== "en")
2400
+ throw new Error(`[WidgetSDK] Unsupported language: ${o}`);
2401
+ dc(o), pe.forEach((e) => {
2402
+ e.rerender && e.rerender();
2403
+ });
2404
+ }
2405
+ function bc(o) {
2406
+ pe.add(o);
2407
+ }
2408
+ function Sc(o) {
2409
+ pe.delete(o);
2410
+ }
2411
+ export {
2412
+ vc as a,
2413
+ mc as g,
2414
+ yc as i,
2415
+ bc as r,
2416
+ et as s,
2417
+ gc as t,
2418
+ Sc as u
2419
+ };