@invoice-sdk/widget 1.38.1 → 1.38.2

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.
@@ -131,7 +131,7 @@ function QQ({ steps: g = [], currentStep: A = 1 } = {}) {
131
131
  }
132
132
  };
133
133
  }
134
- const S = (g) => typeof g == "string", Mg = () => {
134
+ const p = (g) => typeof g == "string", Mg = () => {
135
135
  let g, A;
136
136
  const C = new Promise((B, Q) => {
137
137
  g = B, A = Q;
@@ -141,8 +141,8 @@ const S = (g) => typeof g == "string", Mg = () => {
141
141
  g.forEach((B) => {
142
142
  A[B] && (C[B] = A[B]);
143
143
  });
144
- }, pE = /###/g, EQ = (g) => g && g.indexOf("###") > -1 ? g.replace(pE, ".") : g, nQ = (g) => !g || S(g), dg = (g, A, C) => {
145
- const B = S(A) ? A.split(".") : A;
144
+ }, pE = /###/g, EQ = (g) => g && g.indexOf("###") > -1 ? g.replace(pE, ".") : g, nQ = (g) => !g || p(g), dg = (g, A, C) => {
145
+ const B = p(A) ? A.split(".") : A;
146
146
  let Q = 0;
147
147
  for (; Q < B.length - 1; ) {
148
148
  if (nQ(g)) return {};
@@ -184,7 +184,7 @@ const S = (g) => typeof g == "string", Mg = () => {
184
184
  return B !== void 0 ? B : qg(A, C);
185
185
  }, XI = (g, A, C) => {
186
186
  for (const B in A)
187
- B !== "__proto__" && B !== "constructor" && (B in g ? S(g[B]) || g[B] instanceof String || S(A[B]) || A[B] instanceof String ? C && (g[B] = A[B]) : XI(g[B], A[B], C) : g[B] = A[B]);
187
+ B !== "__proto__" && B !== "constructor" && (B in g ? p(g[B]) || g[B] instanceof String || p(A[B]) || A[B] instanceof String ? C && (g[B] = A[B]) : XI(g[B], A[B], C) : g[B] = A[B]);
188
188
  return g;
189
189
  }, tg = (g) => g.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
190
190
  var WE = {
@@ -195,7 +195,7 @@ var WE = {
195
195
  "'": "&#39;",
196
196
  "/": "&#x2F;"
197
197
  };
198
- const VE = (g) => S(g) ? g.replace(/[&<>"'\/]/g, (A) => WE[A]) : g;
198
+ const VE = (g) => p(g) ? g.replace(/[&<>"'\/]/g, (A) => WE[A]) : g;
199
199
  class $E {
200
200
  constructor(A) {
201
201
  this.capacity = A, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
@@ -275,7 +275,7 @@ class Lg {
275
275
  return this.forward(A, "warn", "WARNING DEPRECATED: ", !0);
276
276
  }
277
277
  forward(A, C, B, Q) {
278
- return Q && !this.debug ? null : (S(A[0]) && (A[0] = `${B}${this.prefix} ${A[0]}`), this.logger[C](A));
278
+ return Q && !this.debug ? null : (p(A[0]) && (A[0] = `${B}${this.prefix} ${A[0]}`), this.logger[C](A));
279
279
  }
280
280
  create(A) {
281
281
  return new Lg(this.logger, j({
@@ -335,9 +335,9 @@ class eQ extends xg {
335
335
  var e, i;
336
336
  const I = Q.keySeparator !== void 0 ? Q.keySeparator : this.options.keySeparator, E = Q.ignoreJSONStructure !== void 0 ? Q.ignoreJSONStructure : this.options.ignoreJSONStructure;
337
337
  let n;
338
- A.indexOf(".") > -1 ? n = A.split(".") : (n = [A, C], B && (Array.isArray(B) ? n.push(...B) : S(B) && I ? n.push(...B.split(I)) : n.push(B)));
338
+ A.indexOf(".") > -1 ? n = A.split(".") : (n = [A, C], B && (Array.isArray(B) ? n.push(...B) : p(B) && I ? n.push(...B.split(I)) : n.push(B)));
339
339
  const t = qg(this.data, n);
340
- return !t && !C && !B && A.indexOf(".") > -1 && (A = n[0], C = n[1], B = n.slice(2).join(".")), t || !E || !S(B) ? t : AB((i = (e = this.data) == null ? void 0 : e[A]) == null ? void 0 : i[C], B, I);
340
+ return !t && !C && !B && A.indexOf(".") > -1 && (A = n[0], C = n[1], B = n.slice(2).join(".")), t || !E || !p(B) ? t : AB((i = (e = this.data) == null ? void 0 : e[A]) == null ? void 0 : i[C], B, I);
341
341
  }
342
342
  addResource(A, C, B, Q, I = {
343
343
  silent: !1
@@ -350,7 +350,7 @@ class eQ extends xg {
350
350
  silent: !1
351
351
  }) {
352
352
  for (const I in B)
353
- (S(B[I]) || Array.isArray(B[I])) && this.addResource(A, C, I, B[I], {
353
+ (p(B[I]) || Array.isArray(B[I])) && this.addResource(A, C, I, B[I], {
354
354
  silent: !0
355
355
  });
356
356
  Q.silent || this.emit("added", A, C, B);
@@ -396,7 +396,7 @@ var TI = {
396
396
  }), A;
397
397
  }
398
398
  };
399
- const iQ = {}, wQ = (g) => !S(g) && typeof g != "boolean" && typeof g != "number";
399
+ const iQ = {}, wQ = (g) => !p(g) && typeof g != "boolean" && typeof g != "number";
400
400
  class jg extends xg {
401
401
  constructor(A, C = {}) {
402
402
  super(), SE(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], A, this), this.options = C, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = LA.create("translator");
@@ -423,14 +423,14 @@ class jg extends xg {
423
423
  if (t && t.length > 0)
424
424
  return {
425
425
  key: A,
426
- namespaces: S(I) ? [I] : I
426
+ namespaces: p(I) ? [I] : I
427
427
  };
428
428
  const e = A.split(B);
429
429
  (B !== Q || B === Q && this.options.ns.indexOf(e[0]) > -1) && (I = e.shift()), A = e.join(Q);
430
430
  }
431
431
  return {
432
432
  key: A,
433
- namespaces: S(I) ? [I] : I
433
+ namespaces: p(I) ? [I] : I
434
434
  };
435
435
  }
436
436
  translate(A, C, B) {
@@ -462,13 +462,13 @@ class jg extends xg {
462
462
  } : n;
463
463
  const D = this.resolve(A, Q);
464
464
  let r = D == null ? void 0 : D.res;
465
- const c = (D == null ? void 0 : D.usedKey) || n, f = (D == null ? void 0 : D.exactUsedKey) || n, v = ["[object Number]", "[object Function]", "[object RegExp]"], M = Q.joinArrays !== void 0 ? Q.joinArrays : this.options.joinArrays, s = !this.i18nFormat || this.i18nFormat.handleAsObject, a = Q.count !== void 0 && !S(Q.count), h = jg.hasDefaultValue(Q), d = a ? this.pluralResolver.getSuffix(w, Q.count, Q) : "", J = Q.ordinal && a ? this.pluralResolver.getSuffix(w, Q.count, {
465
+ const c = (D == null ? void 0 : D.usedKey) || n, f = (D == null ? void 0 : D.exactUsedKey) || n, v = ["[object Number]", "[object Function]", "[object RegExp]"], M = Q.joinArrays !== void 0 ? Q.joinArrays : this.options.joinArrays, s = !this.i18nFormat || this.i18nFormat.handleAsObject, a = Q.count !== void 0 && !p(Q.count), h = jg.hasDefaultValue(Q), d = a ? this.pluralResolver.getSuffix(w, Q.count, Q) : "", J = Q.ordinal && a ? this.pluralResolver.getSuffix(w, Q.count, {
466
466
  ordinal: !1
467
467
  }) : "", k = a && !Q.ordinal && Q.count === 0, R = k && Q[`defaultValue${this.options.pluralSeparator}zero`] || Q[`defaultValue${d}`] || Q[`defaultValue${J}`] || Q.defaultValue;
468
468
  let Y = r;
469
469
  s && !r && h && (Y = R);
470
470
  const G = wQ(Y), y = Object.prototype.toString.apply(Y);
471
- if (s && Y && G && v.indexOf(y) < 0 && !(S(M) && Array.isArray(Y))) {
471
+ if (s && Y && G && v.indexOf(y) < 0 && !(p(M) && Array.isArray(Y))) {
472
472
  if (!Q.returnObjects && !this.options.returnObjects) {
473
473
  this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
474
474
  const O = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(c, Y, oA(j({}, Q), {
@@ -492,7 +492,7 @@ class jg extends xg {
492
492
  }
493
493
  r = m;
494
494
  }
495
- } else if (s && S(M) && Array.isArray(r))
495
+ } else if (s && p(M) && Array.isArray(r))
496
496
  r = r.join(M), r && (r = this.extendTranslation(r, A, Q, B));
497
497
  else {
498
498
  let O = !1, m = !1;
@@ -513,8 +513,8 @@ class jg extends xg {
513
513
  else this.options.saveMissingTo === "all" ? DA = this.languageUtils.toResolveHierarchy(Q.lng || this.language) : DA.push(Q.lng || this.language);
514
514
  const H = (l, K, L) => {
515
515
  var _;
516
- const T = h && L !== r ? L : Z;
517
- this.options.missingKeyHandler ? this.options.missingKeyHandler(l, e, K, T, CA, Q) : (_ = this.backendConnector) != null && _.saveMissing && this.backendConnector.saveMissing(l, e, K, T, CA, Q), this.emit("missingKey", l, e, K, r);
516
+ const x = h && L !== r ? L : Z;
517
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(l, e, K, x, CA, Q) : (_ = this.backendConnector) != null && _.saveMissing && this.backendConnector.saveMissing(l, e, K, x, CA, Q), this.emit("missingKey", l, e, K, r);
518
518
  };
519
519
  this.options.saveMissing && (this.options.saveMissingPlurals && a ? DA.forEach((l) => {
520
520
  const K = this.pluralResolver.getSuffixes(l, Q);
@@ -537,20 +537,20 @@ class jg extends xg {
537
537
  B.interpolation && this.interpolator.init(oA(j({}, B), {
538
538
  interpolation: j(j({}, this.options.interpolation), B.interpolation)
539
539
  }));
540
- const i = S(A) && (((e = B == null ? void 0 : B.interpolation) == null ? void 0 : e.skipOnVariables) !== void 0 ? B.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
540
+ const i = p(A) && (((e = B == null ? void 0 : B.interpolation) == null ? void 0 : e.skipOnVariables) !== void 0 ? B.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
541
541
  let w;
542
542
  if (i) {
543
543
  const D = A.match(this.interpolator.nestingRegexp);
544
544
  w = D && D.length;
545
545
  }
546
- let o = B.replace && !S(B.replace) ? B.replace : B;
546
+ let o = B.replace && !p(B.replace) ? B.replace : B;
547
547
  if (this.options.interpolation.defaultVariables && (o = j(j({}, this.options.interpolation.defaultVariables), o)), A = this.interpolator.interpolate(A, o, B.lng || this.language || Q.usedLng, B), i) {
548
548
  const D = A.match(this.interpolator.nestingRegexp), r = D && D.length;
549
549
  w < r && (B.nest = !1);
550
550
  }
551
551
  !B.lng && Q && Q.res && (B.lng = this.language || Q.usedLng), B.nest !== !1 && (A = this.interpolator.nest(A, (...D) => (I == null ? void 0 : I[0]) === D[0] && !B.context ? (this.logger.warn(`It seems you are nesting recursively key: ${D[0]} in key: ${C[0]}`), null) : this.translate(...D, C), B)), B.interpolation && this.interpolator.reset();
552
552
  }
553
- const E = B.postProcess || this.options.postProcess, n = S(E) ? [E] : E;
553
+ const E = B.postProcess || this.options.postProcess, n = p(E) ? [E] : E;
554
554
  return A != null && (n != null && n.length) && B.applyPostProcessor !== !1 && (A = TI.handle(n, A, C, this.options && this.options.postProcessPassResolved ? j({
555
555
  i18nResolved: oA(j({}, Q), {
556
556
  usedParams: this.getUsedParamsDetails(B)
@@ -559,13 +559,13 @@ class jg extends xg {
559
559
  }
560
560
  resolve(A, C = {}) {
561
561
  let B, Q, I, E, n;
562
- return S(A) && (A = [A]), A.forEach((t) => {
562
+ return p(A) && (A = [A]), A.forEach((t) => {
563
563
  if (this.isValidLookup(B)) return;
564
564
  const e = this.extractFromKey(t, C), i = e.key;
565
565
  Q = i;
566
566
  let w = e.namespaces;
567
567
  this.options.fallbackNS && (w = w.concat(this.options.fallbackNS));
568
- const o = C.count !== void 0 && !S(C.count), D = o && !C.ordinal && C.count === 0, r = C.context !== void 0 && (S(C.context) || typeof C.context == "number") && C.context !== "", c = C.lngs ? C.lngs : this.languageUtils.toResolveHierarchy(C.lng || this.language, C.fallbackLng);
568
+ const o = C.count !== void 0 && !p(C.count), D = o && !C.ordinal && C.count === 0, r = C.context !== void 0 && (p(C.context) || typeof C.context == "number") && C.context !== "", c = C.lngs ? C.lngs : this.languageUtils.toResolveHierarchy(C.lng || this.language, C.fallbackLng);
569
569
  w.forEach((f) => {
570
570
  var v, M;
571
571
  this.isValidLookup(B) || (n = f, !iQ[`${c[0]}-${f}`] && ((v = this.utils) != null && v.hasLoadedNamespace) && !((M = this.utils) != null && M.hasLoadedNamespace(n)) && (iQ[`${c[0]}-${f}`] = !0, this.logger.warn(`key "${Q}" for languages "${c.join(", ")}" won't get resolved as namespace "${n}" 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!!!")), c.forEach((s) => {
@@ -605,7 +605,7 @@ class jg extends xg {
605
605
  return (I = this.i18nFormat) != null && I.getResource ? this.i18nFormat.getResource(A, C, B, Q) : this.resourceStore.getResource(A, C, B, Q);
606
606
  }
607
607
  getUsedParamsDetails(A = {}) {
608
- const C = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], B = A.replace && !S(A.replace);
608
+ const C = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], B = A.replace && !p(A.replace);
609
609
  let Q = B ? A.replace : A;
610
610
  if (B && typeof A.count != "undefined" && (Q.count = A.count), this.options.interpolation.defaultVariables && (Q = j(j({}, this.options.interpolation.defaultVariables), Q)), !B) {
611
611
  Q = j({}, Q);
@@ -637,7 +637,7 @@ class oQ {
637
637
  return this.formatLanguageCode(C[0]);
638
638
  }
639
639
  formatLanguageCode(A) {
640
- if (S(A) && A.indexOf("-") > -1) {
640
+ if (p(A) && A.indexOf("-") > -1) {
641
641
  let C;
642
642
  try {
643
643
  C = Intl.getCanonicalLocales(A)[0];
@@ -672,7 +672,7 @@ class oQ {
672
672
  }
673
673
  getFallbackCodes(A, C) {
674
674
  if (!A) return [];
675
- if (typeof A == "function" && (A = A(C)), S(A) && (A = [A]), Array.isArray(A)) return A;
675
+ if (typeof A == "function" && (A = A(C)), p(A) && (A = [A]), Array.isArray(A)) return A;
676
676
  if (!C) return A.default || [];
677
677
  let B = A[C];
678
678
  return B || (B = A[this.getScriptPartFromCode(C)]), B || (B = A[this.formatLanguageCode(C)]), B || (B = A[this.getLanguagePartFromCode(C)]), B || (B = A.default), B || [];
@@ -681,7 +681,7 @@ class oQ {
681
681
  const B = this.getFallbackCodes((C === !1 ? [] : C) || this.options.fallbackLng || [], A), Q = [], I = (E) => {
682
682
  E && (this.isSupportedCode(E) ? Q.push(E) : this.logger.warn(`rejecting language code not found in supportedLngs: ${E}`));
683
683
  };
684
- return S(A) && (A.indexOf("-") > -1 || A.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && I(this.formatLanguageCode(A)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && I(this.getScriptPartFromCode(A)), this.options.load !== "currentOnly" && I(this.getLanguagePartFromCode(A))) : S(A) && I(this.formatLanguageCode(A)), B.forEach((E) => {
684
+ return p(A) && (A.indexOf("-") > -1 || A.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && I(this.formatLanguageCode(A)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && I(this.getScriptPartFromCode(A)), this.options.load !== "currentOnly" && I(this.getLanguagePartFromCode(A))) : p(A) && I(this.formatLanguageCode(A)), B.forEach((E) => {
685
685
  Q.indexOf(E) < 0 && I(this.formatLanguageCode(E));
686
686
  }), Q;
687
687
  }
@@ -748,7 +748,7 @@ class Bn {
748
748
  }
749
749
  const cQ = (g, A, C, B = ".", Q = !0) => {
750
750
  let I = ZE(g, A, C);
751
- return !I && Q && S(C) && (I = AB(g, C, B), I === void 0 && (I = AB(A, C, B))), I;
751
+ return !I && Q && p(C) && (I = AB(g, C, B), I === void 0 && (I = AB(A, C, B))), I;
752
752
  }, QC = (g) => g.replace(/\$/g, "$$$$");
753
753
  class Qn {
754
754
  constructor(A = {}) {
@@ -816,7 +816,7 @@ class Qn {
816
816
  if (E = e(c), E === void 0)
817
817
  if (typeof i == "function") {
818
818
  const v = i(A, I, Q);
819
- E = S(v) ? v : "";
819
+ E = p(v) ? v : "";
820
820
  } else if (Q && Object.prototype.hasOwnProperty.call(Q, c))
821
821
  E = "";
822
822
  else if (w) {
@@ -824,7 +824,7 @@ class Qn {
824
824
  continue;
825
825
  } else
826
826
  this.logger.warn(`missed to pass in variable ${c} for interpolating ${A}`), E = "";
827
- else !S(E) && !this.useRawValueToEscape && (E = IQ(E));
827
+ else !p(E) && !this.useRawValueToEscape && (E = IQ(E));
828
828
  const f = r.safeValue(E);
829
829
  if (A = A.replace(I[0], f), w ? (r.regex.lastIndex += E.length, r.regex.lastIndex -= I[0].length) : r.regex.lastIndex = 0, n++, n >= this.maxReplaces)
830
830
  break;
@@ -851,10 +851,10 @@ class Qn {
851
851
  };
852
852
  for (; Q = this.nestingRegexp.exec(A); ) {
853
853
  let t = [];
854
- E = j({}, B), E = E.replace && !S(E.replace) ? E.replace : E, E.applyPostProcessor = !1, delete E.defaultValue;
854
+ E = j({}, B), E = E.replace && !p(E.replace) ? E.replace : E, E.applyPostProcessor = !1, delete E.defaultValue;
855
855
  const e = /{.*}/.test(Q[1]) ? Q[1].lastIndexOf("}") + 1 : Q[1].indexOf(this.formatSeparator);
856
- if (e !== -1 && (t = Q[1].slice(e).split(this.formatSeparator).map((i) => i.trim()).filter(Boolean), Q[1] = Q[1].slice(0, e)), I = C(n.call(this, Q[1].trim(), E), E), I && Q[0] === A && !S(I)) return I;
857
- S(I) || (I = IQ(I)), I || (this.logger.warn(`missed to resolve ${Q[1]} for nesting ${A}`), I = ""), t.length && (I = t.reduce((i, w) => this.format(i, w, B.lng, oA(j({}, B), {
856
+ if (e !== -1 && (t = Q[1].slice(e).split(this.formatSeparator).map((i) => i.trim()).filter(Boolean), Q[1] = Q[1].slice(0, e)), I = C(n.call(this, Q[1].trim(), E), E), I && Q[0] === A && !p(I)) return I;
857
+ p(I) || (I = IQ(I)), I || (this.logger.warn(`missed to resolve ${Q[1]} for nesting ${A}`), I = ""), t.length && (I = t.reduce((i, w) => this.format(i, w, B.lng, oA(j({}, B), {
858
858
  interpolationkey: Q[1].trim()
859
859
  })), I.trim())), A = A.replace(Q[0], I), this.regexp.lastIndex = 0;
860
860
  }
@@ -1044,7 +1044,7 @@ class en extends xg {
1044
1044
  prepareLoading(A, C, B = {}, Q) {
1045
1045
  if (!this.backend)
1046
1046
  return this.logger.warn("No backend was added via i18next.use. Will not load resources."), Q && Q();
1047
- S(A) && (A = this.languageUtils.toResolveHierarchy(A)), S(C) && (C = [C]);
1047
+ p(A) && (A = this.languageUtils.toResolveHierarchy(A)), p(C) && (C = [C]);
1048
1048
  const I = this.queueLoad(A, C, B, Q);
1049
1049
  if (!I.toLoad.length)
1050
1050
  return I.pending.length || Q(), null;
@@ -1127,7 +1127,7 @@ const fQ = () => ({
1127
1127
  appendNamespaceToCIMode: !1,
1128
1128
  overloadTranslationOptionHandler: (g) => {
1129
1129
  let A = {};
1130
- if (typeof g[1] == "object" && (A = g[1]), S(g[1]) && (A.defaultValue = g[1]), S(g[2]) && (A.tDescription = g[2]), typeof g[2] == "object" || typeof g[3] == "object") {
1130
+ if (typeof g[1] == "object" && (A = g[1]), p(g[1]) && (A.defaultValue = g[1]), p(g[2]) && (A.tDescription = g[2]), typeof g[2] == "object" || typeof g[3] == "object") {
1131
1131
  const C = g[3] || g[2];
1132
1132
  Object.keys(C).forEach((B) => {
1133
1133
  A[B] = C[B];
@@ -1151,7 +1151,7 @@ const fQ = () => ({
1151
1151
  cacheInBuiltFormats: !0
1152
1152
  }), uQ = (g) => {
1153
1153
  var A, C;
1154
- return S(g.ns) && (g.ns = [g.ns]), S(g.fallbackLng) && (g.fallbackLng = [g.fallbackLng]), S(g.fallbackNS) && (g.fallbackNS = [g.fallbackNS]), ((C = (A = g.supportedLngs) == null ? void 0 : A.indexOf) == null ? void 0 : C.call(A, "cimode")) < 0 && (g.supportedLngs = g.supportedLngs.concat(["cimode"])), typeof g.initImmediate == "boolean" && (g.initAsync = g.initImmediate), g;
1154
+ return p(g.ns) && (g.ns = [g.ns]), p(g.fallbackLng) && (g.fallbackLng = [g.fallbackLng]), p(g.fallbackNS) && (g.fallbackNS = [g.fallbackNS]), ((C = (A = g.supportedLngs) == null ? void 0 : A.indexOf) == null ? void 0 : C.call(A, "cimode")) < 0 && (g.supportedLngs = g.supportedLngs.concat(["cimode"])), typeof g.initImmediate == "boolean" && (g.initAsync = g.initImmediate), g;
1155
1155
  }, zg = () => {
1156
1156
  }, wn = (g) => {
1157
1157
  Object.getOwnPropertyNames(Object.getPrototypeOf(g)).forEach((C) => {
@@ -1171,7 +1171,7 @@ class Jg extends xg {
1171
1171
  }
1172
1172
  }
1173
1173
  init(A = {}, C) {
1174
- this.isInitializing = !0, typeof A == "function" && (C = A, A = {}), A.defaultNS == null && A.ns && (S(A.ns) ? A.defaultNS = A.ns : A.ns.indexOf("translation") < 0 && (A.defaultNS = A.ns[0]));
1174
+ this.isInitializing = !0, typeof A == "function" && (C = A, A = {}), A.defaultNS == null && A.ns && (p(A.ns) ? A.defaultNS = A.ns : A.ns.indexOf("translation") < 0 && (A.defaultNS = A.ns[0]));
1175
1175
  const B = fQ();
1176
1176
  this.options = j(j(j({}, B), this.options), uQ(A)), this.options.interpolation = j(j({}, B.interpolation), this.options.interpolation), A.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = A.keySeparator), A.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = A.nsSeparator);
1177
1177
  const Q = (e) => e ? typeof e == "function" ? new e() : e : null;
@@ -1216,7 +1216,7 @@ class Jg extends xg {
1216
1216
  loadResources(A, C = zg) {
1217
1217
  var I, E;
1218
1218
  let B = C;
1219
- const Q = S(A) ? A : this.language;
1219
+ const Q = p(A) ? A : this.language;
1220
1220
  if (typeof A == "function" && (B = A), !this.options.resources || this.options.partialBundledLanguages) {
1221
1221
  if ((Q == null ? void 0 : Q.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return B();
1222
1222
  const n = [], t = (e) => {
@@ -1265,7 +1265,7 @@ class Jg extends xg {
1265
1265
  }, E = (n) => {
1266
1266
  var i, w;
1267
1267
  !A && !n && this.services.languageDetector && (n = []);
1268
- const t = S(n) ? n : n && n[0], e = this.store.hasLanguageSomeTranslations(t) ? t : this.services.languageUtils.getBestMatchFromCodes(S(n) ? [n] : n);
1268
+ const t = p(n) ? n : n && n[0], e = this.store.hasLanguageSomeTranslations(t) ? t : this.services.languageUtils.getBestMatchFromCodes(p(n) ? [n] : n);
1269
1269
  e && (this.language || Q(e), this.translator.language || this.translator.changeLanguage(e), (w = (i = this.services.languageDetector) == null ? void 0 : i.cacheUserLanguage) == null || w.call(i, e)), this.loadResources(e, (o) => {
1270
1270
  I(o, e);
1271
1271
  });
@@ -1280,7 +1280,7 @@ class Jg extends xg {
1280
1280
  let i;
1281
1281
  return t.keyPrefix && Array.isArray(I) ? i = I.map((w) => `${t.keyPrefix}${e}${w}`) : i = t.keyPrefix ? `${t.keyPrefix}${e}${I}` : I, this.t(i, t);
1282
1282
  };
1283
- return S(A) ? Q.lng = A : Q.lngs = A, Q.ns = C, Q.keyPrefix = B, Q;
1283
+ return p(A) ? Q.lng = A : Q.lngs = A, Q.ns = C, Q.keyPrefix = B, Q;
1284
1284
  }
1285
1285
  t(...A) {
1286
1286
  var C;
@@ -1312,7 +1312,7 @@ class Jg extends xg {
1312
1312
  }
1313
1313
  loadNamespaces(A, C) {
1314
1314
  const B = Mg();
1315
- return this.options.ns ? (S(A) && (A = [A]), A.forEach((Q) => {
1315
+ return this.options.ns ? (p(A) && (A = [A]), A.forEach((Q) => {
1316
1316
  this.options.ns.indexOf(Q) < 0 && this.options.ns.push(Q);
1317
1317
  }), this.loadResources((Q) => {
1318
1318
  B.resolve(), C && C(Q);
@@ -1320,7 +1320,7 @@ class Jg extends xg {
1320
1320
  }
1321
1321
  loadLanguages(A, C) {
1322
1322
  const B = Mg();
1323
- S(A) && (A = [A]);
1323
+ p(A) && (A = [A]);
1324
1324
  const Q = this.options.preload || [], I = A.filter((E) => Q.indexOf(E) < 0 && this.services.languageUtils.isSupportedCode(E));
1325
1325
  return I.length ? (this.options.preload = Q.concat(I), this.loadResources((E) => {
1326
1326
  B.resolve(), C && C(E);
@@ -2102,7 +2102,7 @@ typeof ActiveXObject == "function" && (typeof global != "undefined" && global.Ac
2102
2102
  typeof ZA != "function" && (ZA = void 0);
2103
2103
  if (!ZA && !Rg && !bg)
2104
2104
  try {
2105
- import("./browser-ponyfill-DBA5G3sc.js").then((g) => g.b).then(function(g) {
2105
+ import("./browser-ponyfill-CzXX6vrC.js").then((g) => g.b).then(function(g) {
2106
2106
  ZA = g.default;
2107
2107
  }).catch(function() {
2108
2108
  });
@@ -4774,8 +4774,8 @@ function Oc() {
4774
4774
  };
4775
4775
  }
4776
4776
  function o(z, H, l, K) {
4777
- var L = H && H.prototype instanceof s ? H : s, T = Object.create(L.prototype), _ = new Z(K || []);
4778
- return I(T, "_invoke", { value: y(z, l, _) }), T;
4777
+ var L = H && H.prototype instanceof s ? H : s, x = Object.create(L.prototype), _ = new Z(K || []);
4778
+ return I(x, "_invoke", { value: y(z, l, _) }), x;
4779
4779
  }
4780
4780
  C.wrap = o;
4781
4781
  function D(z, H, l) {
@@ -4826,8 +4826,8 @@ function Oc() {
4826
4826
  return { __await: z };
4827
4827
  };
4828
4828
  function G(z, H) {
4829
- function l(T, _, AA, $) {
4830
- var V = D(z[T], z, _);
4829
+ function l(x, _, AA, $) {
4830
+ var V = D(z[x], z, _);
4831
4831
  if (V.type === "throw")
4832
4832
  $(V.arg);
4833
4833
  else {
@@ -4844,10 +4844,10 @@ function Oc() {
4844
4844
  }
4845
4845
  }
4846
4846
  var K;
4847
- function L(T, _) {
4847
+ function L(x, _) {
4848
4848
  function AA() {
4849
4849
  return new H(function($, V) {
4850
- l(T, _, $, V);
4850
+ l(x, _, $, V);
4851
4851
  });
4852
4852
  }
4853
4853
  return K = // If enqueue has been called before, then we want to wait until
@@ -4875,25 +4875,25 @@ function Oc() {
4875
4875
  return this;
4876
4876
  }), C.AsyncIterator = G, C.async = function(z, H, l, K, L) {
4877
4877
  L === void 0 && (L = Promise);
4878
- var T = new G(
4878
+ var x = new G(
4879
4879
  o(z, H, l, K),
4880
4880
  L
4881
4881
  );
4882
- return C.isGeneratorFunction(H) ? T : T.next().then(function(_) {
4883
- return _.done ? _.value : T.next();
4882
+ return C.isGeneratorFunction(H) ? x : x.next().then(function(_) {
4883
+ return _.done ? _.value : x.next();
4884
4884
  });
4885
4885
  };
4886
4886
  function y(z, H, l) {
4887
4887
  var K = r;
4888
- return function(T, _) {
4888
+ return function(x, _) {
4889
4889
  if (K === f)
4890
4890
  throw new Error("Generator is already running");
4891
4891
  if (K === v) {
4892
- if (T === "throw")
4892
+ if (x === "throw")
4893
4893
  throw _;
4894
4894
  return DA();
4895
4895
  }
4896
- for (l.method = T, l.arg = _; ; ) {
4896
+ for (l.method = x, l.arg = _; ; ) {
4897
4897
  var AA = l.delegate;
4898
4898
  if (AA) {
4899
4899
  var $ = O(AA, l);
@@ -4931,13 +4931,13 @@ function Oc() {
4931
4931
  var L = D(K, z.iterator, H.arg);
4932
4932
  if (L.type === "throw")
4933
4933
  return H.method = "throw", H.arg = L.arg, H.delegate = null, M;
4934
- var T = L.arg;
4935
- if (!T)
4934
+ var x = L.arg;
4935
+ if (!x)
4936
4936
  return H.method = "throw", H.arg = new TypeError("iterator result is not an object"), H.delegate = null, M;
4937
- if (T.done)
4938
- H[z.resultName] = T.value, H.next = z.nextLoc, H.method !== "return" && (H.method = "next", H.arg = E);
4937
+ if (x.done)
4938
+ H[z.resultName] = x.value, H.next = z.nextLoc, H.method !== "return" && (H.method = "next", H.arg = E);
4939
4939
  else
4940
- return T;
4940
+ return x;
4941
4941
  return H.delegate = null, M;
4942
4942
  }
4943
4943
  Y(R), w(R, i, "Generator"), w(R, t, function() {
@@ -4962,9 +4962,9 @@ function Oc() {
4962
4962
  l.push(K);
4963
4963
  return l.reverse(), function L() {
4964
4964
  for (; l.length; ) {
4965
- var T = l.pop();
4966
- if (T in H)
4967
- return L.value = T, L.done = !1, L;
4965
+ var x = l.pop();
4966
+ if (x in H)
4967
+ return L.value = x, L.done = !1, L;
4968
4968
  }
4969
4969
  return L.done = !0, L;
4970
4970
  };
@@ -5011,10 +5011,10 @@ function Oc() {
5011
5011
  throw z;
5012
5012
  var H = this;
5013
5013
  function l($, V) {
5014
- return T.type = "throw", T.arg = z, H.next = $, V && (H.method = "next", H.arg = E), !!V;
5014
+ return x.type = "throw", x.arg = z, H.next = $, V && (H.method = "next", H.arg = E), !!V;
5015
5015
  }
5016
5016
  for (var K = this.tryEntries.length - 1; K >= 0; --K) {
5017
- var L = this.tryEntries[K], T = L.completion;
5017
+ var L = this.tryEntries[K], x = L.completion;
5018
5018
  if (L.tryLoc === "root")
5019
5019
  return l("end");
5020
5020
  if (L.tryLoc <= this.prev) {
@@ -5044,8 +5044,8 @@ function Oc() {
5044
5044
  }
5045
5045
  }
5046
5046
  L && (z === "break" || z === "continue") && L.tryLoc <= H && H <= L.finallyLoc && (L = null);
5047
- var T = L ? L.completion : {};
5048
- return T.type = z, T.arg = H, L ? (this.method = "next", this.next = L.finallyLoc, M) : this.complete(T);
5047
+ var x = L ? L.completion : {};
5048
+ return x.type = z, x.arg = H, L ? (this.method = "next", this.next = L.finallyLoc, M) : this.complete(x);
5049
5049
  },
5050
5050
  complete: function(z, H) {
5051
5051
  if (z.type === "throw")
@@ -5335,44 +5335,44 @@ function kE() {
5335
5335
  let J = D, k = c;
5336
5336
  const R = [Q.DEFAULT, Q.LSTM_ONLY].includes(D) && !a.legacyCore;
5337
5337
  let Y, G;
5338
- const y = new Promise((X, x) => {
5339
- G = X, Y = x;
5338
+ const y = new Promise((X, S) => {
5339
+ G = X, Y = S;
5340
5340
  }), O = (X) => {
5341
5341
  Y(X.message);
5342
5342
  };
5343
5343
  let m = E(a);
5344
5344
  m.onerror = O, w += 1;
5345
- const b = ({ id: X, action: x, payload: eA }) => new Promise((cA, gA) => {
5346
- C(`[${v}]: Start ${X}, action=${x}`);
5347
- const fA = `${x}-${X}`;
5345
+ const b = ({ id: X, action: S, payload: eA }) => new Promise((cA, gA) => {
5346
+ C(`[${v}]: Start ${X}, action=${S}`);
5347
+ const fA = `${S}-${X}`;
5348
5348
  h[fA] = { resolve: cA, reject: gA }, i(m, {
5349
5349
  workerId: v,
5350
5350
  jobId: X,
5351
- action: x,
5351
+ action: S,
5352
5352
  payload: eA
5353
5353
  });
5354
5354
  }), Z = () => console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)"), CA = (X) => b(A({
5355
5355
  id: X,
5356
5356
  action: "load",
5357
5357
  payload: { options: { lstmOnly: R, corePath: a.corePath, logging: a.logging } }
5358
- })), DA = (X, x, eA) => b(A({
5358
+ })), DA = (X, S, eA) => b(A({
5359
5359
  id: eA,
5360
5360
  action: "FS",
5361
- payload: { method: "writeFile", args: [X, x] }
5362
- })), z = (X, x) => b(A({
5363
- id: x,
5361
+ payload: { method: "writeFile", args: [X, S] }
5362
+ })), z = (X, S) => b(A({
5363
+ id: S,
5364
5364
  action: "FS",
5365
5365
  payload: { method: "readFile", args: [X, { encoding: "utf8" }] }
5366
- })), H = (X, x) => b(A({
5367
- id: x,
5366
+ })), H = (X, S) => b(A({
5367
+ id: S,
5368
5368
  action: "FS",
5369
5369
  payload: { method: "unlink", args: [X] }
5370
- })), l = (X, x, eA) => b(A({
5370
+ })), l = (X, S, eA) => b(A({
5371
5371
  id: eA,
5372
5372
  action: "FS",
5373
- payload: { method: X, args: x }
5374
- })), K = (X, x) => b(A({
5375
- id: x,
5373
+ payload: { method: X, args: S }
5374
+ })), K = (X, S) => b(A({
5375
+ id: S,
5376
5376
  action: "loadLanguage",
5377
5377
  payload: {
5378
5378
  langs: X,
@@ -5385,34 +5385,34 @@ function kE() {
5385
5385
  lstmOnly: [Q.DEFAULT, Q.LSTM_ONLY].includes(J) && !a.legacyLang
5386
5386
  }
5387
5387
  }
5388
- })), L = (X, x, eA, cA) => b(A({
5388
+ })), L = (X, S, eA, cA) => b(A({
5389
5389
  id: cA,
5390
5390
  action: "initialize",
5391
- payload: { langs: X, oem: x, config: eA }
5392
- })), T = (X = "eng", x, eA, cA) => {
5393
- if (R && [Q.TESSERACT_ONLY, Q.TESSERACT_LSTM_COMBINED].includes(x)) throw Error("Legacy model requested but code missing.");
5394
- const gA = x || J;
5391
+ payload: { langs: X, oem: S, config: eA }
5392
+ })), x = (X = "eng", S, eA, cA) => {
5393
+ if (R && [Q.TESSERACT_ONLY, Q.TESSERACT_LSTM_COMBINED].includes(S)) throw Error("Legacy model requested but code missing.");
5394
+ const gA = S || J;
5395
5395
  J = gA;
5396
5396
  const fA = eA || k;
5397
5397
  k = fA;
5398
5398
  const HA = (typeof X == "string" ? X.split("+") : X).filter((NA) => !d.includes(NA));
5399
5399
  return d.push(...HA), HA.length > 0 ? K(HA, cA).then(() => L(X, gA, fA, cA)) : L(X, gA, fA, cA);
5400
- }, _ = (X = {}, x) => b(A({
5401
- id: x,
5400
+ }, _ = (X = {}, S) => b(A({
5401
+ id: S,
5402
5402
  action: "setParameters",
5403
5403
  payload: { params: X }
5404
- })), AA = (gA, ...fA) => N(null, [gA, ...fA], function* (X, x = {}, eA = {
5404
+ })), AA = (gA, ...fA) => N(null, [gA, ...fA], function* (X, S = {}, eA = {
5405
5405
  text: !0
5406
5406
  }, cA) {
5407
5407
  return b(A({
5408
5408
  id: cA,
5409
5409
  action: "recognize",
5410
- payload: { image: yield e(X), options: x, output: eA }
5410
+ payload: { image: yield e(X), options: S, output: eA }
5411
5411
  }));
5412
- }), $ = (X, x) => N(null, null, function* () {
5412
+ }), $ = (X, S) => N(null, null, function* () {
5413
5413
  if (R) throw Error("`worker.detect` requires Legacy model, which was not loaded.");
5414
5414
  return b(A({
5415
- id: x,
5415
+ id: S,
5416
5416
  action: "detect",
5417
5417
  payload: { image: yield e(X) }
5418
5418
  }));
@@ -5421,20 +5421,20 @@ function kE() {
5421
5421
  });
5422
5422
  t(m, ({
5423
5423
  workerId: X,
5424
- jobId: x,
5424
+ jobId: S,
5425
5425
  status: eA,
5426
5426
  action: cA,
5427
5427
  data: gA
5428
5428
  }) => {
5429
- const fA = `${cA}-${x}`;
5429
+ const fA = `${cA}-${S}`;
5430
5430
  if (eA === "resolve")
5431
- C(`[${X}]: Complete ${x}`), h[fA].resolve({ jobId: x, data: gA }), delete h[fA];
5431
+ C(`[${X}]: Complete ${S}`), h[fA].resolve({ jobId: S, data: gA }), delete h[fA];
5432
5432
  else if (eA === "reject")
5433
5433
  if (h[fA].reject(gA), delete h[fA], cA === "load" && Y(gA), s)
5434
5434
  s(gA);
5435
5435
  else
5436
5436
  throw Error(gA);
5437
- else eA === "progress" && M(oA(j({}, gA), { userJobId: x }));
5437
+ else eA === "progress" && M(oA(j({}, gA), { userJobId: S }));
5438
5438
  });
5439
5439
  const sA = {
5440
5440
  id: v,
@@ -5444,7 +5444,7 @@ function kE() {
5444
5444
  readText: z,
5445
5445
  removeFile: H,
5446
5446
  FS: l,
5447
- reinitialize: T,
5447
+ reinitialize: x,
5448
5448
  setParameters: _,
5449
5449
  recognize: AA,
5450
5450
  detect: $,
@@ -5883,14 +5883,14 @@ function fs(B) {
5883
5883
  error: null,
5884
5884
  horizontal: !0,
5885
5885
  onChange: (q) => {
5886
- p();
5886
+ T();
5887
5887
  }
5888
5888
  }), G = YQ({
5889
5889
  label: u("uploadLogo", "Tải logo lên"),
5890
5890
  required: !0,
5891
5891
  file: (A == null ? void 0 : A.logo) || null,
5892
5892
  onFileChange: (q) => {
5893
- p();
5893
+ T();
5894
5894
  },
5895
5895
  error: null
5896
5896
  }), r = vA({
@@ -6015,7 +6015,7 @@ function fs(B) {
6015
6015
  required: !0,
6016
6016
  file: (A == null ? void 0 : A.license) || null,
6017
6017
  onFileChange: (q) => {
6018
- p();
6018
+ T();
6019
6019
  },
6020
6020
  error: null,
6021
6021
  accept: "image/png, image/jpeg, image/jpg, .pdf"
@@ -6112,7 +6112,7 @@ function fs(B) {
6112
6112
  d = pr({
6113
6113
  initialValue: ((XB = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : XB.invoiceSymbol) || "1C25TYY",
6114
6114
  onChange: (q) => {
6115
- DA.inputEl.value = q, p();
6115
+ DA.inputEl.value = q, T();
6116
6116
  }
6117
6117
  }), J = document.createElement("input"), J.type = "checkbox", J.name = "hasUsedEInvoiceCB", J.className = "wgt:cursor-pointer", J.checked = (TB = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : TB.hasUsedEInvoice, J.addEventListener("change", (q) => {
6118
6118
  q.target.checked ? (JA.appendChild(TA), JA.appendChild(GA)) : (Y.inputEl.value = "", Y.setError(null), JA.removeChild(TA), JA.removeChild(GA));
@@ -6191,7 +6191,7 @@ function fs(B) {
6191
6191
  u("errorFetchTaxInfo", "Lỗi khi lấy thông tin mã số thuế.")
6192
6192
  );
6193
6193
  } finally {
6194
- p();
6194
+ T();
6195
6195
  }
6196
6196
  });
6197
6197
  }
@@ -6203,13 +6203,13 @@ function fs(B) {
6203
6203
  K.className = "wgt:grid wgt:grid-cols-1 wgt:md:grid-cols-2 wgt:gap-y-2 wgt:gap-x-4 wgt:space-y-2 wgt:px-6 wgt:py-4 wgt:rounded-xl wgt:bg-weak-50", H.appendChild(K), K.appendChild(E.container), K.appendChild(n.container), K.appendChild(t.container), K.appendChild(e.container);
6204
6204
  const L = document.createElement("div");
6205
6205
  L.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:md:grid-cols-2 wgt:space-x-4", H.appendChild(L), L.appendChild(G.container), I.appendChild(H);
6206
- const T = document.createElement("div");
6207
- T.className = "wgt:space-y-4";
6206
+ const x = document.createElement("div");
6207
+ x.className = "wgt:space-y-4";
6208
6208
  const _ = document.createElement("h3");
6209
6209
  _.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", _.innerText = u(
6210
6210
  "legalRepInfo",
6211
6211
  "2. Thông tin người đại diện pháp luật:"
6212
- ), T.appendChild(_);
6212
+ ), x.appendChild(_);
6213
6213
  const AA = document.createElement("div");
6214
6214
  AA.className = "wgt:grid wgt:grid-cols-1 wgt:md:grid-cols-2 wgt:gap-4 wgt:space-y-2";
6215
6215
  const {
@@ -6236,10 +6236,10 @@ function fs(B) {
6236
6236
  } catch (tA) {
6237
6237
  console.log("🚀 ~ err:", tA);
6238
6238
  }
6239
- p();
6239
+ T();
6240
6240
  }),
6241
6241
  onBackChange: (q) => N(null, null, function* () {
6242
- m = q, p();
6242
+ m = q, T();
6243
6243
  })
6244
6244
  });
6245
6245
  AA.appendChild($);
@@ -6247,15 +6247,15 @@ function fs(B) {
6247
6247
  rA.className = "wgt:space-y-4", rA.appendChild(r.container);
6248
6248
  const X = document.createElement("div");
6249
6249
  X.className = "wgt:grid wgt:grid-cols-1 wgt:md:grid-cols-2 wgt:gap-4", rA.appendChild(X), X.appendChild(c.container), X.appendChild(f.container), AA.appendChild(rA);
6250
- const x = document.createElement("div");
6251
- x.className = "wgt:grid wgt:grid-cols-1 wgt:md:grid-cols-4 wgt:gap-4 wgt:items-start", x.appendChild(M.container), x.appendChild(s.container), x.appendChild(v.container), x.appendChild(a.container), T.appendChild(AA), T.appendChild(x), T.appendChild(h.container), T.appendChild(y.container);
6250
+ const S = document.createElement("div");
6251
+ S.className = "wgt:grid wgt:grid-cols-1 wgt:md:grid-cols-4 wgt:gap-4 wgt:items-start", S.appendChild(M.container), S.appendChild(s.container), S.appendChild(v.container), S.appendChild(a.container), x.appendChild(AA), x.appendChild(S), x.appendChild(h.container), x.appendChild(y.container);
6252
6252
  const eA = document.createElement("ul");
6253
6253
  eA.className = "wgt:list-inside wgt:list-disc wgt:-mt-2";
6254
6254
  const cA = document.createElement("li");
6255
6255
  cA.className = "wgt:text-sm wgt:text-[#8C8C8C] wgt:italic", cA.innerText = u(
6256
6256
  "legalRepNote",
6257
6257
  "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."
6258
- ), eA.appendChild(cA), T.appendChild(eA), I.appendChild(T);
6258
+ ), eA.appendChild(cA), x.appendChild(eA), I.appendChild(x);
6259
6259
  const gA = document.createElement("div");
6260
6260
  gA.className = "wgt:space-y-4";
6261
6261
  const fA = document.createElement("h3");
@@ -6329,7 +6329,7 @@ function fs(B) {
6329
6329
  FA.appendChild(W(u("terms", "Điều khoản"), "#")), FA.appendChild(document.createTextNode(" " + u("and", "và") + " ")), FA.appendChild(W(u("usagePolicy", "Chính sách sử dụng"), "#")), FA.appendChild(
6330
6330
  document.createTextNode(` ${u("of", "của")} ${iA()}.`)
6331
6331
  ), xA.appendChild(SA), xA.appendChild(FA), I.appendChild(xA), SA.addEventListener("click", () => {
6332
- Ig = !Ig, Ig ? (SA.classList.add("wgt:bg-primary"), bA.classList.remove("wgt:hidden")) : (SA.classList.remove("wgt:bg-primary"), bA.classList.add("wgt:hidden")), p();
6332
+ Ig = !Ig, Ig ? (SA.classList.add("wgt:bg-primary"), bA.classList.remove("wgt:hidden")) : (SA.classList.remove("wgt:bg-primary"), bA.classList.add("wgt:hidden")), T();
6333
6333
  });
6334
6334
  const lA = document.createElement("div");
6335
6335
  lA.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ", b.type = "submit", b.innerText = u("next"), b.className = [
@@ -6349,7 +6349,7 @@ function fs(B) {
6349
6349
  F.contactPerson.email
6350
6350
  ) || F.legalRepresentative.dob > CA || !/^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(F.invoiceSymbol) || !q.license || !q.logo || !q.idCard || !q.idCardBack);
6351
6351
  }
6352
- function p() {
6352
+ function T() {
6353
6353
  b.disabled = !Eg() || !Ig || V() || sA() || G.getError() || y.getError();
6354
6354
  }
6355
6355
  function IA() {
@@ -6409,18 +6409,18 @@ function fs(B) {
6409
6409
  Y,
6410
6410
  R
6411
6411
  ].forEach((q) => {
6412
- q.inputEl.addEventListener("input", p);
6412
+ q.inputEl.addEventListener("input", T);
6413
6413
  }), [f, e].forEach((q) => {
6414
- q.selectEl.addEventListener("change", p);
6414
+ q.selectEl.addEventListener("change", T);
6415
6415
  }), [J, k].forEach((q) => {
6416
- q.addEventListener("change", p);
6416
+ q.addEventListener("change", T);
6417
6417
  }), b.addEventListener("click", (q) => {
6418
6418
  if (q.preventDefault(), !Eg()) return;
6419
6419
  const F = IA();
6420
6420
  typeof g == "function" && g(F);
6421
6421
  });
6422
6422
  const hA = (((ZB = (UB = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : UB.organization) == null ? void 0 : ZB.taxCode) || "").trim();
6423
- return hA.length >= 10 && z(hA), A != null && A.idCard && (O = A == null ? void 0 : A.idCard), (WB = A == null ? void 0 : A.eInvoiceRegistration) != null && WB.hasUsedEInvoice && (JA.appendChild(TA), JA.appendChild(GA), (VB = A == null ? void 0 : A.eInvoiceRegistration) != null && VB.isUsedEInvoiceBefore ? (k.checked = !0, GA.appendChild(R.container), R.inputEl.value = ($B = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : $B.previousEInvoiceProvider) : R.inputEl.value = "", Y.inputEl.value = (_B = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : _B.taxAuthorityCode), p(), {
6423
+ return hA.length >= 10 && z(hA), A != null && A.idCard && (O = A == null ? void 0 : A.idCard), (WB = A == null ? void 0 : A.eInvoiceRegistration) != null && WB.hasUsedEInvoice && (JA.appendChild(TA), JA.appendChild(GA), (VB = A == null ? void 0 : A.eInvoiceRegistration) != null && VB.isUsedEInvoiceBefore ? (k.checked = !0, GA.appendChild(R.container), R.inputEl.value = ($B = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : $B.previousEInvoiceProvider) : R.inputEl.value = "", Y.inputEl.value = (_B = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : _B.taxAuthorityCode), T(), {
6424
6424
  container: Q,
6425
6425
  getValues: IA
6426
6426
  };
@@ -6776,19 +6776,21 @@ function ks(w) {
6776
6776
  K.className = "wgt:text-xl wgt:font-bold wgt:text-text-black", K.innerText = u("selectSignaturePackage"), l.appendChild(K);
6777
6777
  const L = document.createElement("div");
6778
6778
  l.appendChild(L);
6779
- let T = rI({
6779
+ let x = rI({
6780
6780
  type: "signature",
6781
6781
  packageOptions: c,
6782
6782
  selectedPackageId: a,
6783
6783
  handlePackageSelect: (W) => {
6784
- a = W, T.setSelectedPackageId(W), gA();
6784
+ a = W, x.setSelectedPackageId(W), gA();
6785
6785
  }
6786
6786
  });
6787
- L.appendChild(T.container);
6787
+ L.appendChild(x.container);
6788
6788
  const { container: _ } = Rs({
6789
6789
  name: "registrationFee",
6790
6790
  value: "standard",
6791
- feeLabel: `${u("registrationFee")}: ${KA(D[0].price)} VND`,
6791
+ feeLabel: `${u("registrationFee")}: ${KA(
6792
+ D[0].price
6793
+ )} VND`,
6792
6794
  required: !0,
6793
6795
  description: u("softwareLicense"),
6794
6796
  isChecked: o
@@ -6805,14 +6807,18 @@ function ks(w) {
6805
6807
  const rA = document.createElement("thead");
6806
6808
  rA.className = "wgt:bg-soft-150";
6807
6809
  const X = document.createElement("tr");
6808
- [u("product"), u("unit"), u("quantity"), u("unitPrice"), u("totalPrice")].forEach(
6809
- (W) => {
6810
- const iA = document.createElement("th");
6811
- iA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-sm wgt:font-semibold wgt:text-text-sub-600", iA.innerText = W, X.appendChild(iA);
6812
- }
6813
- ), rA.appendChild(X), sA.appendChild(rA);
6814
- const x = document.createElement("tbody");
6815
- x.className = "wgt:divide-y wgt:divide-gray-200 wgt:bg-white", sA.appendChild(x);
6810
+ [
6811
+ u("product"),
6812
+ u("unit"),
6813
+ u("quantity"),
6814
+ u("unitPrice"),
6815
+ u("totalPrice")
6816
+ ].forEach((W) => {
6817
+ const iA = document.createElement("th");
6818
+ iA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-sm wgt:font-semibold wgt:text-text-sub-600", iA.innerText = W, X.appendChild(iA);
6819
+ }), rA.appendChild(X), sA.appendChild(rA);
6820
+ const S = document.createElement("tbody");
6821
+ S.className = "wgt:divide-y wgt:divide-gray-200 wgt:bg-white", sA.appendChild(S);
6816
6822
  function eA(W) {
6817
6823
  return r.find((iA) => iA._id === W) || null;
6818
6824
  }
@@ -6821,11 +6827,11 @@ function ks(w) {
6821
6827
  }
6822
6828
  function gA() {
6823
6829
  var W, iA, lA, Eg;
6824
- if (x.innerHTML = "", o) {
6825
- const p = document.createElement("tr"), IA = document.createElement("td");
6826
- IA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-sm wgt:text-strong-950 wgt:font-medium", IA.innerText = `${(W = D[0]) == null ? void 0 : W.name}`, p.appendChild(IA);
6830
+ if (S.innerHTML = "", o) {
6831
+ const T = document.createElement("tr"), IA = document.createElement("td");
6832
+ IA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-sm wgt:text-strong-950 wgt:font-medium", IA.innerText = `${(W = D[0]) == null ? void 0 : W.name}`, T.appendChild(IA);
6827
6833
  const hA = document.createElement("td");
6828
- hA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-sm wgt:text-strong-950 wgt:font-medium", hA.innerText = u("copy"), p.appendChild(hA);
6834
+ hA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-sm wgt:text-strong-950 wgt:font-medium", hA.innerText = u("copy"), T.appendChild(hA);
6829
6835
  const uA = document.createElement("td");
6830
6836
  uA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-2.5 wgt:text-center";
6831
6837
  const MA = document.createElement("div");
@@ -6839,17 +6845,17 @@ function ks(w) {
6839
6845
  const QA = document.createElement("button");
6840
6846
  QA.type = "button", QA.ariaLabel = u("increase"), QA.disabled = !0, QA.className = "wgt:flex wgt:h-6 wgt:w-6 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:cursor-not-allowed wgt:opacity-50", QA.innerText = "+", QA.addEventListener("click", () => {
6841
6847
  d += 1, gA();
6842
- }), MA.appendChild(QA), uA.appendChild(MA), p.appendChild(uA);
6848
+ }), MA.appendChild(QA), uA.appendChild(MA), T.appendChild(uA);
6843
6849
  const nA = document.createElement("td");
6844
- nA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", nA.innerText = KA((iA = D[0]) == null ? void 0 : iA.price), p.appendChild(nA);
6850
+ nA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", nA.innerText = KA((iA = D[0]) == null ? void 0 : iA.price), T.appendChild(nA);
6845
6851
  const RA = document.createElement("td");
6846
- RA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", RA.innerText = KA(((lA = D[0]) == null ? void 0 : lA.price) * d), p.appendChild(RA), x.appendChild(p);
6852
+ RA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", RA.innerText = KA(((lA = D[0]) == null ? void 0 : lA.price) * d), T.appendChild(RA), S.appendChild(T);
6847
6853
  }
6848
6854
  {
6849
- const p = eA(v);
6850
- if (p) {
6855
+ const T = eA(v);
6856
+ if (T) {
6851
6857
  const IA = document.createElement("tr"), hA = document.createElement("td");
6852
- hA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", hA.innerText = p.name, IA.appendChild(hA);
6858
+ hA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", hA.innerText = T.name, IA.appendChild(hA);
6853
6859
  const uA = document.createElement("td");
6854
6860
  uA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", uA.innerText = u("package"), IA.appendChild(uA);
6855
6861
  const MA = document.createElement("td");
@@ -6857,28 +6863,28 @@ function ks(w) {
6857
6863
  const EA = document.createElement("div");
6858
6864
  EA.className = "wgt:w-full wgt:justify-between wgt:inline-flex wgt:items-center wgt:border wgt:border-soft-200 wgt:p-1.5 wgt:rounded-lg";
6859
6865
  const BA = document.createElement("button");
6860
- BA.type = "button", BA.ariaLabel = u("decrease"), BA.disabled = J <= 1, BA.className = "wgt:flex wgt:h-6 wgt:w-6 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950" + (J <= 1 ? " wgt:cursor-not-allowed wgt:opacity-50" : ""), BA.innerText = "–", BA.addEventListener("click", () => {
6866
+ BA.type = "button", BA.ariaLabel = u("decrease"), BA.disabled = J <= 1 || (T == null ? void 0 : T.price) === 0, BA.className = "wgt:flex wgt:h-6 wgt:w-6 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:disabled:cursor-not-allowed wgt:disabled:opacity-50", BA.innerText = "–", BA.addEventListener("click", () => {
6861
6867
  J > 1 && (J -= 1, gA());
6862
6868
  }), EA.appendChild(BA);
6863
6869
  const QA = document.createElement("input");
6864
6870
  QA.type = "text", QA.readOnly = !0, QA.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none", QA.value = J, EA.appendChild(QA);
6865
6871
  const nA = document.createElement("button");
6866
- nA.type = "button", nA.ariaLabel = u("increase"), nA.className = "wgt:flex wgt:h-6 wgt:w-6 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950", nA.innerText = "+", nA.addEventListener("click", () => {
6872
+ nA.type = "button", nA.ariaLabel = u("increase"), nA.disabled = (T == null ? void 0 : T.price) === 0, nA.className = "wgt:flex wgt:h-6 wgt:w-6 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:disabled:cursor-not-allowed wgt:disabled:opacity-50", nA.innerText = "+", nA.addEventListener("click", () => {
6867
6873
  J += 1, gA();
6868
6874
  }), EA.appendChild(nA), MA.appendChild(EA), IA.appendChild(MA);
6869
6875
  const RA = document.createElement("td");
6870
- RA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", RA.innerText = KA((p == null ? void 0 : p.price) * (p == null ? void 0 : p.limit)), IA.appendChild(RA);
6876
+ RA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", RA.innerText = KA((T == null ? void 0 : T.price) * (T == null ? void 0 : T.limit)), IA.appendChild(RA);
6871
6877
  const yA = document.createElement("td");
6872
6878
  yA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", yA.innerText = KA(
6873
- (p == null ? void 0 : p.price) * (p == null ? void 0 : p.limit) * J
6874
- ), IA.appendChild(yA), x.appendChild(IA);
6879
+ (T == null ? void 0 : T.price) * (T == null ? void 0 : T.limit) * J
6880
+ ), IA.appendChild(yA), S.appendChild(IA);
6875
6881
  }
6876
6882
  }
6877
6883
  {
6878
- const p = cA(a);
6879
- if (p) {
6884
+ const T = cA(a);
6885
+ if (T) {
6880
6886
  const IA = document.createElement("tr"), hA = document.createElement("td");
6881
- hA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", hA.innerText = p.name, IA.appendChild(hA);
6887
+ hA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", hA.innerText = T.name, IA.appendChild(hA);
6882
6888
  const uA = document.createElement("td");
6883
6889
  uA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", uA.innerText = u("package"), IA.appendChild(uA);
6884
6890
  const MA = document.createElement("td");
@@ -6896,20 +6902,20 @@ function ks(w) {
6896
6902
  k += 1, gA();
6897
6903
  }), EA.appendChild(nA), MA.appendChild(EA), IA.appendChild(MA);
6898
6904
  const RA = document.createElement("td");
6899
- RA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", RA.innerText = KA(p.limit * p.price), IA.appendChild(RA);
6905
+ RA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", RA.innerText = KA(T.limit * T.price), IA.appendChild(RA);
6900
6906
  const yA = document.createElement("td");
6901
6907
  yA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium", yA.innerText = KA(
6902
- p.limit * p.price * k
6903
- ), IA.appendChild(yA), x.appendChild(IA);
6908
+ T.limit * T.price * k
6909
+ ), IA.appendChild(yA), S.appendChild(IA);
6904
6910
  }
6905
6911
  }
6906
6912
  {
6907
- const p = o ? ((Eg = D[0]) == null ? void 0 : Eg.price) * d : 0, IA = eA(v), hA = IA ? IA.price * IA.limit * J : 0, uA = cA(a), MA = uA ? uA.price * uA.limit * k : 0, EA = p + hA + MA;
6913
+ const T = o ? ((Eg = D[0]) == null ? void 0 : Eg.price) * d : 0, IA = eA(v), hA = IA ? IA.price * IA.limit * J : 0, uA = cA(a), MA = uA ? uA.price * uA.limit * k : 0, EA = T + hA + MA;
6908
6914
  n(EA);
6909
6915
  const BA = document.createElement("tr"), QA = document.createElement("td");
6910
6916
  QA.colSpan = 4, QA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-base wgt:font-semibold wgt:text-strong-950", QA.innerText = u("total"), BA.appendChild(QA);
6911
6917
  const nA = document.createElement("td");
6912
- nA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-base wgt:font-semibold wgt:text-strong-950", nA.innerText = KA(EA), BA.appendChild(nA), x.appendChild(BA);
6918
+ nA.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-base wgt:font-semibold wgt:text-strong-950", nA.innerText = KA(EA), BA.appendChild(nA), S.appendChild(BA);
6913
6919
  }
6914
6920
  }
6915
6921
  gA();
@@ -8581,10 +8587,10 @@ function Ws() {
8581
8587
  let H = 0;
8582
8588
  const l = new Array(y), K = new Array(y);
8583
8589
  let L = 0;
8584
- const T = new Uint8Array(d.buffer);
8590
+ const x = new Uint8Array(d.buffer);
8585
8591
  for (let sA = 0; sA < y; sA++) {
8586
8592
  const rA = sA < m ? Z : CA;
8587
- l[sA] = T.slice(H, H + rA), K[sA] = z.encode(l[sA]), H += rA, L = Math.max(L, rA);
8593
+ l[sA] = x.slice(H, H + rA), K[sA] = z.encode(l[sA]), H += rA, L = Math.max(L, rA);
8588
8594
  }
8589
8595
  const _ = new Uint8Array(R);
8590
8596
  let AA = 0, $, V;