@invoice-sdk/widget 1.50.6 → 1.50.7

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.
@@ -67,7 +67,7 @@ var L = (g, A, B) => new Promise((C, Q) => {
67
67
  throw I;
68
68
  }, "return" in A && C("return"), Q;
69
69
  }, rQ = (g, A, B) => (A = g[sg("asyncIterator")]) ? A.call(g) : (g = g[sg("iterator")](), A = {}, B = (C, Q) => (Q = g[C]) && (A[C] = (I) => new Promise((E, n, t) => (I = Q.call(g, I), t = I.done, Promise.resolve(I.value).then((c) => E({ value: c, done: t }), n)))), B("next"), B("return"), A);
70
- import { t as a, g as _g, r as NI, u as yI } from "./index-n1yJKag1.js";
70
+ import { t as a, g as _g, r as NI, u as yI } from "./index-CYkUPESa.js";
71
71
  import { g as jI } from "./_commonjsHelpers-bAxELxBV.js";
72
72
  function qQ({ steps: g = [], currentStep: A = 1 } = {}) {
73
73
  const B = document.createElement("div");
@@ -531,79 +531,79 @@ function oC({
531
531
  i.className = "wgt:absolute wgt:top-full wgt:left-0 wgt:right-0 wgt:bg-white wgt:border wgt:border-gray-300 wgt:rounded wgt:shadow-lg wgt:z-50 wgt:hidden wgt:max-h-[500px] wgt:overflow-y-auto";
532
532
  const u = document.createElement("div");
533
533
  u.className = "wgt:divide-y wgt:divide-gray-200";
534
- let q = A, J = null, s = [...B];
534
+ let f = A, v = null, s = [...B];
535
535
  const D = () => {
536
- const f = B.find((r) => r.id ? r.id === J : r.value === q);
537
- return f ? f.label : "";
536
+ const q = B.find((r) => r.id ? r.id === v : r.value === f);
537
+ return q ? q.label : "";
538
538
  };
539
539
  o.value = D();
540
- const m = (f = s) => {
541
- if (u.innerHTML = "", f.length === 0) {
540
+ const m = (q = s) => {
541
+ if (u.innerHTML = "", q.length === 0) {
542
542
  const r = document.createElement("div");
543
543
  r.className = "wgt:px-3 wgt:py-2 wgt:text-gray-500 wgt:text-sm", r.innerText = "Không tìm thấy kết quả", u.appendChild(r);
544
544
  return;
545
545
  }
546
- f.forEach((r) => {
547
- const v = document.createElement("div");
548
- v.className = [
546
+ q.forEach((r) => {
547
+ const J = document.createElement("div");
548
+ J.className = [
549
549
  "wgt:px-3",
550
550
  "wgt:py-2",
551
551
  "wgt:cursor-pointer",
552
552
  "wgt:hover:bg-gray-100",
553
553
  "wgt:text-sm",
554
- r.id ? J === r.id ? "wgt:bg-blue-50 wgt:text-blue-700" : "" : q === r.value ? "wgt:bg-blue-50 wgt:text-blue-700" : ""
555
- ].filter(Boolean).join(" "), v.innerText = r.label, v.dataset.value = r.value, v.addEventListener("click", () => {
556
- if (r.id && (J = r.id), q = r.value, o.value = r.label, i.classList.add("wgt:hidden"), typeof E == "function") {
557
- const R = { target: { value: r.value } };
558
- r.id && (R.target.id = r.id), E(R);
554
+ r.id ? v === r.id ? "wgt:bg-blue-50 wgt:text-blue-700" : "" : f === r.value ? "wgt:bg-blue-50 wgt:text-blue-700" : ""
555
+ ].filter(Boolean).join(" "), J.innerText = r.label, J.dataset.value = r.value, J.addEventListener("click", () => {
556
+ if (r.id && (v = r.id), f = r.value, o.value = r.label, i.classList.add("wgt:hidden"), typeof E == "function") {
557
+ const k = { target: { value: r.value } };
558
+ r.id && (k.target.id = r.id), E(k);
559
559
  }
560
- }), u.appendChild(v);
560
+ }), u.appendChild(J);
561
561
  });
562
562
  };
563
- o.addEventListener("input", (f) => {
564
- const r = f.target.value.toLowerCase();
563
+ o.addEventListener("input", (q) => {
564
+ const r = q.target.value.toLowerCase();
565
565
  s = B.filter(
566
- (v) => v.label.toLowerCase().includes(r)
566
+ (J) => J.label.toLowerCase().includes(r)
567
567
  ), m(s), i.classList.contains("wgt:hidden") || i.classList.remove("wgt:hidden");
568
568
  }), o.addEventListener("focus", () => {
569
569
  i.classList.remove("wgt:hidden"), m();
570
- }), document.addEventListener("click", (f) => {
571
- w.contains(f.target) || i.classList.add("wgt:hidden");
572
- }), o.addEventListener("keydown", (f) => {
573
- f.key === "Escape" && i.classList.add("wgt:hidden");
570
+ }), document.addEventListener("click", (q) => {
571
+ w.contains(q.target) || i.classList.add("wgt:hidden");
572
+ }), o.addEventListener("keydown", (q) => {
573
+ q.key === "Escape" && i.classList.add("wgt:hidden");
574
574
  }), i.appendChild(u), w.appendChild(o), w.appendChild(i), m();
575
575
  const M = document.createElement("select");
576
- M.style.display = "none", M.name = g, M.id = g, B.forEach((f) => {
576
+ M.style.display = "none", M.name = g, M.id = g, B.forEach((q) => {
577
577
  const r = document.createElement("option");
578
- r.value = f.value, r.innerText = f.label, f.value === A && (r.selected = !0), M.appendChild(r);
578
+ r.value = q.value, r.innerText = q.label, q.value === A && (r.selected = !0), M.appendChild(r);
579
579
  }), h.appendChild(w), h.appendChild(M);
580
580
  const P = document.createElement("span");
581
581
  return P.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", P.innerText = I || "", I || (P.style.display = "none"), h.appendChild(P), {
582
582
  container: h,
583
583
  selectEl: M,
584
- setError(f) {
585
- f ? (P.innerText = f, P.style.display = "block", o.classList.remove("wgt:border-gray-300"), o.classList.add("wgt:border-red-500")) : (P.innerText = "", P.style.display = "none", o.classList.remove("wgt:border-red-500"), o.classList.add("wgt:border-gray-300"));
584
+ setError(q) {
585
+ q ? (P.innerText = q, P.style.display = "block", o.classList.remove("wgt:border-gray-300"), o.classList.add("wgt:border-red-500")) : (P.innerText = "", P.style.display = "none", o.classList.remove("wgt:border-red-500"), o.classList.add("wgt:border-gray-300"));
586
586
  },
587
587
  getValue() {
588
- return q;
588
+ return f;
589
589
  },
590
- setValue(f, r, v) {
591
- J = v || null, q = f || "";
592
- const R = B.find(
593
- (l) => l.id ? l.id === v : l.value === f
590
+ setValue(q, r, J) {
591
+ v = J || null, f = q || "";
592
+ const k = B.find(
593
+ (l) => l.id ? l.id === J : l.value === q
594
594
  );
595
- R ? (o.value = R.label, M.value = f, m()) : (o.value = r || "", M.value = f || "", m());
595
+ k ? (o.value = k.label, M.value = q, m()) : (o.value = r || "", M.value = q || "", m());
596
596
  },
597
- setOptions(f) {
598
- for (B.splice(0, B.length, ...f), s = [...f]; M.options.length > 0; )
597
+ setOptions(q) {
598
+ for (B.splice(0, B.length, ...q), s = [...q]; M.options.length > 0; )
599
599
  M.remove(0);
600
- f.forEach((r) => {
601
- const v = document.createElement("option");
602
- v.value = r.value, v.innerText = r.label, M.appendChild(v);
600
+ q.forEach((r) => {
601
+ const J = document.createElement("option");
602
+ J.value = r.value, J.innerText = r.label, M.appendChild(J);
603
603
  }), m();
604
604
  },
605
- setDisabled(f) {
606
- o.disabled = !!f, M.disabled = !!f, f ? (w.classList.add("wgt:opacity-75"), i.classList.add("wgt:hidden")) : w.classList.remove("wgt:opacity-75");
605
+ setDisabled(q) {
606
+ o.disabled = !!q, M.disabled = !!q, q ? (w.classList.add("wgt:opacity-75"), i.classList.add("wgt:hidden")) : w.classList.remove("wgt:opacity-75");
607
607
  }
608
608
  };
609
609
  } else {
@@ -622,8 +622,8 @@ function oC({
622
622
  ].join(" ");
623
623
  const o = document.createElement("option");
624
624
  o.value = "", o.disabled = !0, o.selected = A === "" || A == null, o.innerText = `-- Chọn ${C.toLowerCase()} --`, w.appendChild(o), B.forEach((u) => {
625
- const q = document.createElement("option");
626
- q.value = u.value, q.innerText = u.label, u.value === A && (q.selected = !0), w.appendChild(q);
625
+ const f = document.createElement("option");
626
+ f.value = u.value, f.innerText = u.label, u.value === A && (f.selected = !0), w.appendChild(f);
627
627
  }), typeof E == "function" && w.addEventListener("change", E), h.appendChild(w);
628
628
  const i = document.createElement("span");
629
629
  return i.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", i.innerText = I || "", I || (i.style.display = "none"), h.appendChild(i), {
@@ -638,9 +638,9 @@ function oC({
638
638
  setOptions(u) {
639
639
  for (; w.options.length > 1; )
640
640
  w.remove(1);
641
- u.forEach((q) => {
642
- const J = document.createElement("option");
643
- J.value = q.value, J.innerText = q.label, w.appendChild(J);
641
+ u.forEach((f) => {
642
+ const v = document.createElement("option");
643
+ v.value = f.value, v.innerText = f.label, w.appendChild(v);
644
644
  });
645
645
  },
646
646
  setDisabled(u) {
@@ -717,31 +717,31 @@ function fQ({
717
717
  D.stopPropagation(), h.click();
718
718
  }
719
719
  });
720
- function q(D, m = 2) {
720
+ function f(D, m = 2) {
721
721
  if (D === 0) return "0 Bytes";
722
- const M = 1024, P = Math.max(0, m), f = ["Bytes", "KB", "MB", "GB", "TB"], r = Math.floor(Math.log(D) / Math.log(M));
723
- return parseFloat((D / Math.pow(M, r)).toFixed(P)) + " " + f[r];
722
+ const M = 1024, P = Math.max(0, m), q = ["Bytes", "KB", "MB", "GB", "TB"], r = Math.floor(Math.log(D) / Math.log(M));
723
+ return parseFloat((D / Math.pow(M, r)).toFixed(P)) + " " + q[r];
724
724
  }
725
- function J(D) {
725
+ function v(D) {
726
726
  const m = D.type.toLowerCase(), M = "." + D.name.split(".").pop().toLowerCase();
727
- return h.accept.split(",").map((f) => f.trim().toLowerCase()).filter(Boolean).some((f) => f.startsWith(".") ? f === M : f.endsWith("/*") ? m.startsWith(f.replace("/*", "")) : m === f);
727
+ return h.accept.split(",").map((q) => q.trim().toLowerCase()).filter(Boolean).some((q) => q.startsWith(".") ? q === M : q.endsWith("/*") ? m.startsWith(q.replace("/*", "")) : m === q);
728
728
  }
729
729
  function s(D) {
730
730
  if (e.innerHTML = "", i(null), D) {
731
- J(D) || i(`File không hợp lệ. Chỉ chấp nhận: ${h.accept}`), D.size <= 500 * 1024 || i("Dung lượng file vượt quá 500KB.");
731
+ v(D) || i(`File không hợp lệ. Chỉ chấp nhận: ${h.accept}`), D.size <= 500 * 1024 || i("Dung lượng file vượt quá 500KB.");
732
732
  const M = document.createElement("div");
733
733
  if (M.className = "wgt:flex wgt:items-center wgt:gap-4", M.addEventListener("click", () => {
734
734
  h.click();
735
735
  }), D.type.startsWith("image/")) {
736
- const v = document.createElement("img");
737
- v.src = URL.createObjectURL(D), v.alt = "Preview", v.className = "wgt:h-20 wgt:w-20 wgt:rounded wgt:object-contain wgt:rounded", M.appendChild(v);
736
+ const J = document.createElement("img");
737
+ J.src = URL.createObjectURL(D), J.alt = "Preview", J.className = "wgt:h-20 wgt:w-20 wgt:rounded wgt:object-contain wgt:rounded", M.appendChild(J);
738
738
  }
739
739
  const P = document.createElement("div");
740
740
  P.className = "wgt:flex wgt:flex-col";
741
- const f = document.createElement("p");
742
- f.className = "wgt:text-sm wgt:font-medium wgt:text-gray-800", f.innerText = D.name;
741
+ const q = document.createElement("p");
742
+ q.className = "wgt:text-sm wgt:font-medium wgt:text-gray-800", q.innerText = D.name;
743
743
  const r = document.createElement("p");
744
- r.className = "wgt:text-sm wgt:text-gray-500", r.innerText = q(D.size), P.appendChild(f), P.appendChild(r), M.appendChild(P), e.appendChild(M), B = D, typeof C == "function" && C(D);
744
+ r.className = "wgt:text-sm wgt:text-gray-500", r.innerText = f(D.size), P.appendChild(q), P.appendChild(r), M.appendChild(P), e.appendChild(M), B = D, typeof C == "function" && C(D);
745
745
  } else {
746
746
  const m = document.createElement("div");
747
747
  m.className = "wgt:flex wgt:items-center", m.appendChild(u), e.appendChild(m);
@@ -813,13 +813,13 @@ function mQ({
813
813
  let i = g || null;
814
814
  function u(s, D = 2) {
815
815
  if (s === 0) return "0 Bytes";
816
- const m = 1024, M = Math.max(0, D), P = ["Bytes", "KB", "MB", "GB", "TB"], f = Math.floor(Math.log(s) / Math.log(m));
817
- return parseFloat((s / Math.pow(m, f)).toFixed(M)) + " " + P[f];
816
+ const m = 1024, M = Math.max(0, D), P = ["Bytes", "KB", "MB", "GB", "TB"], q = Math.floor(Math.log(s) / Math.log(m));
817
+ return parseFloat((s / Math.pow(m, q)).toFixed(M)) + " " + P[q];
818
818
  }
819
- function q(s) {
819
+ function f(s) {
820
820
  E.innerHTML = "", o(null);
821
821
  const D = document.createElement("img");
822
- if (D.alt = A, D.className = "wgt:max-w-full wgt:max-h-full wgt:object-contain", J(s) || o(`File không hợp lệ. Chỉ chấp nhận: ${n.accept}`), s.size <= 500 * 1024 || o("Dung lượng file vượt quá 500KB."), s.type.startsWith("image/")) {
822
+ if (D.alt = A, D.className = "wgt:max-w-full wgt:max-h-full wgt:object-contain", v(s) || o(`File không hợp lệ. Chỉ chấp nhận: ${n.accept}`), s.size <= 500 * 1024 || o("Dung lượng file vượt quá 500KB."), s.type.startsWith("image/")) {
823
823
  const M = new FileReader();
824
824
  M.onload = () => {
825
825
  D.src = M.result, typeof C == "function" && C(s);
@@ -829,21 +829,21 @@ function mQ({
829
829
  M.className = "wgt:flex wgt:items-center wgt:gap-4";
830
830
  const P = document.createElement("div");
831
831
  P.className = "wgt:flex wgt:flex-col";
832
- const f = document.createElement("p");
833
- f.className = "wgt:text-sm wgt:font-medium wgt:text-gray-800", f.innerText = s.name;
832
+ const q = document.createElement("p");
833
+ q.className = "wgt:text-sm wgt:font-medium wgt:text-gray-800", q.innerText = s.name;
834
834
  const r = document.createElement("p");
835
- r.className = "wgt:text-sm wgt:text-gray-500", r.innerText = u(s.size), P.appendChild(f), P.appendChild(r), M.appendChild(P), E.appendChild(M), typeof C == "function" && C(null, s);
835
+ r.className = "wgt:text-sm wgt:text-gray-500", r.innerText = u(s.size), P.appendChild(q), P.appendChild(r), M.appendChild(P), E.appendChild(M), typeof C == "function" && C(null, s);
836
836
  }
837
837
  }
838
- function J(s) {
838
+ function v(s) {
839
839
  const D = s.type.toLowerCase(), m = "." + s.name.split(".").pop().toLowerCase();
840
840
  return n.accept.split(",").map((P) => P.trim().toLowerCase()).filter(Boolean).some((P) => P.startsWith(".") ? P === m : P.endsWith("/*") ? D.startsWith(P.replace("/*", "")) : D === P);
841
841
  }
842
842
  return n.addEventListener("change", () => {
843
843
  var D;
844
844
  const s = (D = n.files) == null ? void 0 : D[0];
845
- s && (i = s, q(s));
846
- }), E.addEventListener("click", () => n.click()), g && q(g), {
845
+ s && (i = s, f(s));
846
+ }), E.addEventListener("click", () => n.click()), g && f(g), {
847
847
  container: I,
848
848
  getFile: () => i,
849
849
  getError: () => w,
@@ -922,9 +922,9 @@ const _E = ({
922
922
  }), h.append(i);
923
923
  const u = document.createElement("select");
924
924
  u.className = `${e} wgt:w-16`, u.title = a("yearTooltip", "Năm phát hành (2 chữ số cuối)"), C.forEach((M) => u.append(new Option(M, M))), u.value = String(B).slice(-2), h.append(u);
925
- const q = document.createElement("select");
926
- q.className = `${e} wgt:w-40`, q.title = a("invoiceTypeTooltip", "Loại hóa đơn");
927
- const J = {
925
+ const f = document.createElement("select");
926
+ f.className = `${e} wgt:w-40`, f.title = a("invoiceTypeTooltip", "Loại hóa đơn");
927
+ const v = {
928
928
  T: a("invoiceTypeT", "T (Đăng ký)"),
929
929
  D: a("invoiceTypeD", "D (Tài sản)"),
930
930
  L: a("invoiceTypeL", "L (CQT)"),
@@ -936,23 +936,23 @@ const _E = ({
936
936
  X: a("invoiceTypeX", "X (Thương mại)")
937
937
  };
938
938
  E.forEach((M) => {
939
- q.append(new Option(J[M], M));
940
- }), h.append(q);
939
+ f.append(new Option(v[M], M));
940
+ }), h.append(f);
941
941
  const s = document.createElement("input");
942
942
  s.type = "text", s.maxLength = 2, s.placeholder = "AB", s.defaultValue = "YY", s.className = `${e} wgt:w-16`, s.title = a("customLettersTooltip"), h.append(s);
943
943
  function D() {
944
- return w.value + i.value + u.value + q.value + s.value.toUpperCase();
944
+ return w.value + i.value + u.value + f.value + s.value.toUpperCase();
945
945
  }
946
946
  function m() {
947
947
  s.value = s.value.toUpperCase().replace(/[^A-Z]/g, "").slice(0, 2), typeof g == "function" && g(D());
948
948
  }
949
- return [w, i, u, q].forEach(
949
+ return [w, i, u, f].forEach(
950
950
  (M) => M.addEventListener("change", m)
951
- ), s.addEventListener("input", m), s.addEventListener("blur", m), /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(A) ? (w.value = A[0], i.value = A[1], u.value = A.slice(2, 4), q.value = A[4], s.value = A.slice(5, 7)) : (w.value = "1", i.value = "C", q.value = "T", s.value = "YY"), m(), {
951
+ ), s.addEventListener("input", m), s.addEventListener("blur", m), /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(A) ? (w.value = A[0], i.value = A[1], u.value = A.slice(2, 4), f.value = A[4], s.value = A.slice(5, 7)) : (w.value = "1", i.value = "C", f.value = "T", s.value = "YY"), m(), {
952
952
  container: n,
953
953
  getValue: D,
954
954
  setValue: (M) => {
955
- typeof M != "string" || M.length !== 7 || /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(M) && (w.value = M[0], i.value = M[1], u.value = M.slice(2, 4), q.value = M[4], s.value = M.slice(5, 7), m());
955
+ typeof M != "string" || M.length !== 7 || /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(M) && (w.value = M[0], i.value = M[1], u.value = M.slice(2, 4), f.value = M[4], s.value = M.slice(5, 7), m());
956
956
  }
957
957
  };
958
958
  }, $g = "/core-api/packages", $E = "/core-api/orders", An = "/core-api/orders/create", gn = "/core-api/customers/is-new", Cn = "core-api/convert/iframe-signature", Bn = "/tax-code", Qn = "/invoice/gen-qr";
@@ -1254,8 +1254,8 @@ function QC(g, A, B) {
1254
1254
  metaTokens: !0,
1255
1255
  dots: !1,
1256
1256
  indexes: !1
1257
- }, !1, function(u, q) {
1258
- return !d.isUndefined(q[u]);
1257
+ }, !1, function(u, f) {
1258
+ return !d.isUndefined(f[u]);
1259
1259
  });
1260
1260
  const C = B.metaTokens, Q = B.visitor || h, I = B.dots, E = B.indexes, t = (B.Blob || typeof Blob != "undefined" && Blob) && d.isSpecCompliantForm(A);
1261
1261
  if (!d.isFunction(Q))
@@ -1270,13 +1270,13 @@ function QC(g, A, B) {
1270
1270
  throw new U("Blob is not supported. Use a Buffer instead.");
1271
1271
  return d.isArrayBuffer(i) || d.isTypedArray(i) ? t && typeof Blob == "function" ? new Blob([i]) : Buffer.from(i) : i;
1272
1272
  }
1273
- function h(i, u, q) {
1274
- let J = i;
1275
- if (i && !q && typeof i == "object") {
1273
+ function h(i, u, f) {
1274
+ let v = i;
1275
+ if (i && !f && typeof i == "object") {
1276
1276
  if (d.endsWith(u, "{}"))
1277
1277
  u = C ? u : u.slice(0, -2), i = JSON.stringify(i);
1278
- else if (d.isArray(i) && Sn(i) || (d.isFileList(i) || d.endsWith(u, "[]")) && (J = d.toArray(i)))
1279
- return u = BE(u), J.forEach(function(D, m) {
1278
+ else if (d.isArray(i) && Sn(i) || (d.isFileList(i) || d.endsWith(u, "[]")) && (v = d.toArray(i)))
1279
+ return u = BE(u), v.forEach(function(D, m) {
1280
1280
  !(d.isUndefined(D) || D === null) && A.append(
1281
1281
  // eslint-disable-next-line no-nested-ternary
1282
1282
  E === !0 ? PQ([u], m, I) : E === null ? u : u + "[]",
@@ -1284,7 +1284,7 @@ function QC(g, A, B) {
1284
1284
  );
1285
1285
  }), !1;
1286
1286
  }
1287
- return hB(i) ? !0 : (A.append(PQ(q, u, I), c(i)), !1);
1287
+ return hB(i) ? !0 : (A.append(PQ(f, u, I), c(i)), !1);
1288
1288
  }
1289
1289
  const e = [], w = Object.assign(Un, {
1290
1290
  defaultVisitor: h,
@@ -1295,14 +1295,14 @@ function QC(g, A, B) {
1295
1295
  if (!d.isUndefined(i)) {
1296
1296
  if (e.indexOf(i) !== -1)
1297
1297
  throw Error("Circular reference detected in " + u.join("."));
1298
- e.push(i), d.forEach(i, function(J, s) {
1299
- (!(d.isUndefined(J) || J === null) && Q.call(
1298
+ e.push(i), d.forEach(i, function(v, s) {
1299
+ (!(d.isUndefined(v) || v === null) && Q.call(
1300
1300
  A,
1301
- J,
1301
+ v,
1302
1302
  d.isString(s) ? s.trim() : s,
1303
1303
  u,
1304
1304
  w
1305
- )) === !0 && o(J, u ? u.concat(s) : [s]);
1305
+ )) === !0 && o(v, u ? u.concat(s) : [s]);
1306
1306
  }), e.pop();
1307
1307
  }
1308
1308
  }
@@ -1965,53 +1965,53 @@ const wE = (g) => {
1965
1965
  function u() {
1966
1966
  o && o(), i && i(), Q.cancelToken && Q.cancelToken.unsubscribe(h), Q.signal && Q.signal.removeEventListener("abort", h);
1967
1967
  }
1968
- let q = new XMLHttpRequest();
1969
- q.open(Q.method.toUpperCase(), Q.url, !0), q.timeout = Q.timeout;
1970
- function J() {
1971
- if (!q)
1968
+ let f = new XMLHttpRequest();
1969
+ f.open(Q.method.toUpperCase(), Q.url, !0), f.timeout = Q.timeout;
1970
+ function v() {
1971
+ if (!f)
1972
1972
  return;
1973
1973
  const D = kA.from(
1974
- "getAllResponseHeaders" in q && q.getAllResponseHeaders()
1974
+ "getAllResponseHeaders" in f && f.getAllResponseHeaders()
1975
1975
  ), M = {
1976
- data: !n || n === "text" || n === "json" ? q.responseText : q.response,
1977
- status: q.status,
1978
- statusText: q.statusText,
1976
+ data: !n || n === "text" || n === "json" ? f.responseText : f.response,
1977
+ status: f.status,
1978
+ statusText: f.statusText,
1979
1979
  headers: D,
1980
1980
  config: g,
1981
- request: q
1981
+ request: f
1982
1982
  };
1983
- hE(function(f) {
1984
- B(f), u();
1985
- }, function(f) {
1986
- C(f), u();
1987
- }, M), q = null;
1988
- }
1989
- "onloadend" in q ? q.onloadend = J : q.onreadystatechange = function() {
1990
- !q || q.readyState !== 4 || q.status === 0 && !(q.responseURL && q.responseURL.indexOf("file:") === 0) || setTimeout(J);
1991
- }, q.onabort = function() {
1992
- q && (C(new U("Request aborted", U.ECONNABORTED, g, q)), q = null);
1993
- }, q.onerror = function() {
1994
- C(new U("Network Error", U.ERR_NETWORK, g, q)), q = null;
1995
- }, q.ontimeout = function() {
1983
+ hE(function(q) {
1984
+ B(q), u();
1985
+ }, function(q) {
1986
+ C(q), u();
1987
+ }, M), f = null;
1988
+ }
1989
+ "onloadend" in f ? f.onloadend = v : f.onreadystatechange = function() {
1990
+ !f || f.readyState !== 4 || f.status === 0 && !(f.responseURL && f.responseURL.indexOf("file:") === 0) || setTimeout(v);
1991
+ }, f.onabort = function() {
1992
+ f && (C(new U("Request aborted", U.ECONNABORTED, g, f)), f = null);
1993
+ }, f.onerror = function() {
1994
+ C(new U("Network Error", U.ERR_NETWORK, g, f)), f = null;
1995
+ }, f.ontimeout = function() {
1996
1996
  let m = Q.timeout ? "timeout of " + Q.timeout + "ms exceeded" : "timeout exceeded";
1997
1997
  const M = Q.transitional || EE;
1998
1998
  Q.timeoutErrorMessage && (m = Q.timeoutErrorMessage), C(new U(
1999
1999
  m,
2000
2000
  M.clarifyTimeoutError ? U.ETIMEDOUT : U.ECONNABORTED,
2001
2001
  g,
2002
- q
2003
- )), q = null;
2004
- }, I === void 0 && E.setContentType(null), "setRequestHeader" in q && d.forEach(E.toJSON(), function(m, M) {
2005
- q.setRequestHeader(M, m);
2006
- }), d.isUndefined(Q.withCredentials) || (q.withCredentials = !!Q.withCredentials), n && n !== "json" && (q.responseType = Q.responseType), c && ([w, i] = Ug(c, !0), q.addEventListener("progress", w)), t && q.upload && ([e, o] = Ug(t), q.upload.addEventListener("progress", e), q.upload.addEventListener("loadend", o)), (Q.cancelToken || Q.signal) && (h = (D) => {
2007
- q && (C(!D || D.type ? new fg(null, g, q) : D), q.abort(), q = null);
2002
+ f
2003
+ )), f = null;
2004
+ }, I === void 0 && E.setContentType(null), "setRequestHeader" in f && d.forEach(E.toJSON(), function(m, M) {
2005
+ f.setRequestHeader(M, m);
2006
+ }), d.isUndefined(Q.withCredentials) || (f.withCredentials = !!Q.withCredentials), n && n !== "json" && (f.responseType = Q.responseType), c && ([w, i] = Ug(c, !0), f.addEventListener("progress", w)), t && f.upload && ([e, o] = Ug(t), f.upload.addEventListener("progress", e), f.upload.addEventListener("loadend", o)), (Q.cancelToken || Q.signal) && (h = (D) => {
2007
+ f && (C(!D || D.type ? new fg(null, g, f) : D), f.abort(), f = null);
2008
2008
  }, Q.cancelToken && Q.cancelToken.subscribe(h), Q.signal && (Q.signal.aborted ? h() : Q.signal.addEventListener("abort", h)));
2009
2009
  const s = ot(Q.url);
2010
2010
  if (s && JA.protocols.indexOf(s) === -1) {
2011
2011
  C(new U("Unsupported protocol " + s + ":", U.ERR_BAD_REQUEST, g));
2012
2012
  return;
2013
2013
  }
2014
- q.send(I || null);
2014
+ f.send(I || null);
2015
2015
  });
2016
2016
  }, mt = (g, A) => {
2017
2017
  const { length: B } = g = g ? g.filter(Boolean) : [];
@@ -2177,45 +2177,45 @@ const Tt = (g) => L(null, null, function* () {
2177
2177
  const u = o && o.unsubscribe && (() => {
2178
2178
  o.unsubscribe();
2179
2179
  });
2180
- let q;
2180
+ let f;
2181
2181
  try {
2182
- if (t && dt && B !== "get" && B !== "head" && (q = yield Ht(h, C)) !== 0) {
2182
+ if (t && dt && B !== "get" && B !== "head" && (f = yield Ht(h, C)) !== 0) {
2183
2183
  let M = new Request(A, {
2184
2184
  method: "POST",
2185
2185
  body: C,
2186
2186
  duplex: "half"
2187
2187
  }), P;
2188
2188
  if (d.isFormData(C) && (P = M.headers.get("content-type")) && h.setContentType(P), M.body) {
2189
- const [f, r] = TQ(
2190
- q,
2189
+ const [q, r] = TQ(
2190
+ f,
2191
2191
  Ug(HQ(t))
2192
2192
  );
2193
- C = kQ(M.body, RQ, f, r);
2193
+ C = kQ(M.body, RQ, q, r);
2194
2194
  }
2195
2195
  }
2196
2196
  d.isString(e) || (e = e ? "include" : "omit");
2197
- const J = "credentials" in Request.prototype;
2197
+ const v = "credentials" in Request.prototype;
2198
2198
  i = new Request(A, zA(BA({}, w), {
2199
2199
  signal: o,
2200
2200
  method: B.toUpperCase(),
2201
2201
  headers: h.normalize().toJSON(),
2202
2202
  body: C,
2203
2203
  duplex: "half",
2204
- credentials: J ? e : void 0
2204
+ credentials: v ? e : void 0
2205
2205
  }));
2206
2206
  let s = yield fetch(i, w);
2207
2207
  const D = wB && (c === "stream" || c === "response");
2208
2208
  if (wB && (n || D && u)) {
2209
2209
  const M = {};
2210
- ["status", "statusText", "headers"].forEach((v) => {
2211
- M[v] = s[v];
2210
+ ["status", "statusText", "headers"].forEach((J) => {
2211
+ M[J] = s[J];
2212
2212
  });
2213
- const P = d.toFiniteNumber(s.headers.get("content-length")), [f, r] = n && TQ(
2213
+ const P = d.toFiniteNumber(s.headers.get("content-length")), [q, r] = n && TQ(
2214
2214
  P,
2215
2215
  Ug(HQ(n), !0)
2216
2216
  ) || [];
2217
2217
  s = new Response(
2218
- kQ(s.body, RQ, f, () => {
2218
+ kQ(s.body, RQ, q, () => {
2219
2219
  r && r(), u && u();
2220
2220
  }),
2221
2221
  M
@@ -2233,13 +2233,13 @@ const Tt = (g) => L(null, null, function* () {
2233
2233
  request: i
2234
2234
  });
2235
2235
  });
2236
- } catch (J) {
2237
- throw u && u(), J && J.name === "TypeError" && /Load failed|fetch/i.test(J.message) ? Object.assign(
2236
+ } catch (v) {
2237
+ throw u && u(), v && v.name === "TypeError" && /Load failed|fetch/i.test(v.message) ? Object.assign(
2238
2238
  new U("Network Error", U.ERR_NETWORK, g, i),
2239
2239
  {
2240
- cause: J.cause || J
2240
+ cause: v.cause || v
2241
2241
  }
2242
- ) : U.from(J, J && J.code, g, i);
2242
+ ) : U.from(v, v && v.code, g, i);
2243
2243
  }
2244
2244
  })), eB = {
2245
2245
  http: bn,
@@ -2439,8 +2439,8 @@ let cg = class {
2439
2439
  const i = n[e++], u = n[e++];
2440
2440
  try {
2441
2441
  o = i(o);
2442
- } catch (q) {
2443
- u.call(this, q);
2442
+ } catch (f) {
2443
+ u.call(this, f);
2444
2444
  break;
2445
2445
  }
2446
2446
  }
@@ -2864,7 +2864,7 @@ function Nt() {
2864
2864
  }
2865
2865
  function w(Y, T, z, O) {
2866
2866
  var F = T && T.prototype instanceof D ? T : D, S = Object.create(F.prototype), QA = new $(O || []);
2867
- return I(S, "_invoke", { value: k(Y, z, QA) }), S;
2867
+ return I(S, "_invoke", { value: R(Y, z, QA) }), S;
2868
2868
  }
2869
2869
  B.wrap = w;
2870
2870
  function o(Y, T, z) {
@@ -2874,7 +2874,7 @@ function Nt() {
2874
2874
  return { type: "throw", arg: O };
2875
2875
  }
2876
2876
  }
2877
- var i = "suspendedStart", u = "suspendedYield", q = "executing", J = "completed", s = {};
2877
+ var i = "suspendedStart", u = "suspendedYield", f = "executing", v = "completed", s = {};
2878
2878
  function D() {
2879
2879
  }
2880
2880
  function m() {
@@ -2885,10 +2885,10 @@ function Nt() {
2885
2885
  e(P, t, function() {
2886
2886
  return this;
2887
2887
  });
2888
- var f = Object.getPrototypeOf, r = f && f(f(aA([])));
2888
+ var q = Object.getPrototypeOf, r = q && q(q(aA([])));
2889
2889
  r && r !== C && Q.call(r, t) && (P = r);
2890
- var v = M.prototype = D.prototype = Object.create(P);
2891
- m.prototype = M, I(v, "constructor", { value: M, configurable: !0 }), I(
2890
+ var J = M.prototype = D.prototype = Object.create(P);
2891
+ m.prototype = M, I(J, "constructor", { value: M, configurable: !0 }), I(
2892
2892
  M,
2893
2893
  "constructor",
2894
2894
  { value: m, configurable: !0 }
@@ -2897,7 +2897,7 @@ function Nt() {
2897
2897
  h,
2898
2898
  "GeneratorFunction"
2899
2899
  );
2900
- function R(Y) {
2900
+ function k(Y) {
2901
2901
  ["next", "throw", "return"].forEach(function(T) {
2902
2902
  e(Y, T, function(z) {
2903
2903
  return this._invoke(T, z);
@@ -2910,7 +2910,7 @@ function Nt() {
2910
2910
  // do is to check its .name property.
2911
2911
  (T.displayName || T.name) === "GeneratorFunction" : !1;
2912
2912
  }, B.mark = function(Y) {
2913
- return Object.setPrototypeOf ? Object.setPrototypeOf(Y, M) : (Y.__proto__ = M, e(Y, h, "GeneratorFunction")), Y.prototype = Object.create(v), Y;
2913
+ return Object.setPrototypeOf ? Object.setPrototypeOf(Y, M) : (Y.__proto__ = M, e(Y, h, "GeneratorFunction")), Y.prototype = Object.create(J), Y;
2914
2914
  }, B.awrap = function(Y) {
2915
2915
  return { __await: Y };
2916
2916
  };
@@ -2960,7 +2960,7 @@ function Nt() {
2960
2960
  }
2961
2961
  I(this, "_invoke", { value: F });
2962
2962
  }
2963
- R(l.prototype), e(l.prototype, c, function() {
2963
+ k(l.prototype), e(l.prototype, c, function() {
2964
2964
  return this;
2965
2965
  }), B.AsyncIterator = l, B.async = function(Y, T, z, O, F) {
2966
2966
  F === void 0 && (F = Promise);
@@ -2972,12 +2972,12 @@ function Nt() {
2972
2972
  return QA.done ? QA.value : S.next();
2973
2973
  });
2974
2974
  };
2975
- function k(Y, T, z) {
2975
+ function R(Y, T, z) {
2976
2976
  var O = i;
2977
2977
  return function(S, QA) {
2978
- if (O === q)
2978
+ if (O === f)
2979
2979
  throw new Error("Generator is already running");
2980
- if (O === J) {
2980
+ if (O === v) {
2981
2981
  if (S === "throw")
2982
2982
  throw QA;
2983
2983
  return hA();
@@ -2995,19 +2995,19 @@ function Nt() {
2995
2995
  z.sent = z._sent = z.arg;
2996
2996
  else if (z.method === "throw") {
2997
2997
  if (O === i)
2998
- throw O = J, z.arg;
2998
+ throw O = v, z.arg;
2999
2999
  z.dispatchException(z.arg);
3000
3000
  } else z.method === "return" && z.abrupt("return", z.arg);
3001
- O = q;
3001
+ O = f;
3002
3002
  var p = o(Y, T, z);
3003
3003
  if (p.type === "normal") {
3004
- if (O = z.done ? J : u, p.arg === s)
3004
+ if (O = z.done ? v : u, p.arg === s)
3005
3005
  continue;
3006
3006
  return {
3007
3007
  value: p.arg,
3008
3008
  done: z.done
3009
3009
  };
3010
- } else p.type === "throw" && (O = J, z.method = "throw", z.arg = p.arg);
3010
+ } else p.type === "throw" && (O = v, z.method = "throw", z.arg = p.arg);
3011
3011
  }
3012
3012
  };
3013
3013
  }
@@ -3029,9 +3029,9 @@ function Nt() {
3029
3029
  return S;
3030
3030
  return T.delegate = null, s;
3031
3031
  }
3032
- R(v), e(v, h, "Generator"), e(v, t, function() {
3032
+ k(J), e(J, h, "Generator"), e(J, t, function() {
3033
3033
  return this;
3034
- }), e(v, "toString", function() {
3034
+ }), e(J, "toString", function() {
3035
3035
  return "[object Generator]";
3036
3036
  });
3037
3037
  function G(Y) {
@@ -3229,18 +3229,18 @@ function yt() {
3229
3229
  const t = () => n.length, c = () => Object.keys(I).length, h = () => {
3230
3230
  if (n.length !== 0) {
3231
3231
  const u = Object.keys(I);
3232
- for (let q = 0; q < u.length; q += 1)
3233
- if (typeof E[u[q]] == "undefined") {
3234
- n[0](I[u[q]]);
3232
+ for (let f = 0; f < u.length; f += 1)
3233
+ if (typeof E[u[f]] == "undefined") {
3234
+ n[0](I[u[f]]);
3235
3235
  break;
3236
3236
  }
3237
3237
  }
3238
- }, e = (u, q) => new Promise((J, s) => {
3239
- const D = g({ action: u, payload: q });
3238
+ }, e = (u, f) => new Promise((v, s) => {
3239
+ const D = g({ action: u, payload: f });
3240
3240
  n.push((m) => L(this, null, function* () {
3241
3241
  n.shift(), E[m.id] = D;
3242
3242
  try {
3243
- J(yield m[u].apply(this, [...q, D.id]));
3243
+ v(yield m[u].apply(this, [...f, D.id]));
3244
3244
  } catch (M) {
3245
3245
  s(M);
3246
3246
  } finally {
@@ -3250,10 +3250,10 @@ function yt() {
3250
3250
  });
3251
3251
  return {
3252
3252
  addWorker: (u) => (I[u.id] = u, A(`[${Q}]: Add ${u.id}`), A(`[${Q}]: Number of workers=${c()}`), h(), u.id),
3253
- addJob: (u, ...q) => L(this, null, function* () {
3253
+ addJob: (u, ...f) => L(this, null, function* () {
3254
3254
  if (c() === 0)
3255
3255
  throw Error(`[${Q}]: You need to have at least one worker before adding jobs`);
3256
- return e(u, q);
3256
+ return e(u, f);
3257
3257
  }),
3258
3258
  terminate: () => L(this, null, function* () {
3259
3259
  Object.keys(I).forEach((u) => L(this, null, function* () {
@@ -3413,29 +3413,29 @@ function qE() {
3413
3413
  send: h
3414
3414
  } = g0();
3415
3415
  let e = 0;
3416
- return RC = (...q) => L(null, [...q], function* (w = "eng", o = Q.LSTM_ONLY, i = {}, u = {}) {
3417
- const J = C("Worker", e), fA = g(BA(BA({}, I), i)), {
3416
+ return RC = (...f) => L(null, [...f], function* (w = "eng", o = Q.LSTM_ONLY, i = {}, u = {}) {
3417
+ const v = C("Worker", e), fA = g(BA(BA({}, I), i)), {
3418
3418
  logger: s,
3419
3419
  errorHandler: D
3420
3420
  } = fA, m = cC(fA, [
3421
3421
  "logger",
3422
3422
  "errorHandler"
3423
3423
  ]), M = {}, P = typeof w == "string" ? w.split("+") : w;
3424
- let f = o, r = u;
3425
- const v = [Q.DEFAULT, Q.LSTM_ONLY].includes(o) && !m.legacyCore;
3426
- let R, l;
3427
- const k = new Promise((b, W) => {
3428
- l = b, R = W;
3424
+ let q = o, r = u;
3425
+ const J = [Q.DEFAULT, Q.LSTM_ONLY].includes(o) && !m.legacyCore;
3426
+ let k, l;
3427
+ const R = new Promise((b, W) => {
3428
+ l = b, k = W;
3429
3429
  }), H = (b) => {
3430
- R(b.message);
3430
+ k(b.message);
3431
3431
  };
3432
3432
  let G = E(m);
3433
3433
  G.onerror = H, e += 1;
3434
3434
  const y = ({ id: b, action: W, payload: DA }) => new Promise((CA, wA) => {
3435
- B(`[${J}]: Start ${b}, action=${W}`);
3435
+ B(`[${v}]: Start ${b}, action=${W}`);
3436
3436
  const tA = `${W}-${b}`;
3437
3437
  M[tA] = { resolve: CA, reject: wA }, h(G, {
3438
- workerId: J,
3438
+ workerId: v,
3439
3439
  jobId: b,
3440
3440
  action: W,
3441
3441
  payload: DA
@@ -3443,7 +3443,7 @@ function qE() {
3443
3443
  }), $ = () => console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)"), aA = (b) => y(A({
3444
3444
  id: b,
3445
3445
  action: "load",
3446
- payload: { options: { lstmOnly: v, corePath: m.corePath, logging: m.logging } }
3446
+ payload: { options: { lstmOnly: J, corePath: m.corePath, logging: m.logging } }
3447
3447
  })), hA = (b, W, DA) => y(A({
3448
3448
  id: DA,
3449
3449
  action: "FS",
@@ -3471,7 +3471,7 @@ function qE() {
3471
3471
  cachePath: m.cachePath,
3472
3472
  cacheMethod: m.cacheMethod,
3473
3473
  gzip: m.gzip,
3474
- lstmOnly: [Q.DEFAULT, Q.LSTM_ONLY].includes(f) && !m.legacyLang
3474
+ lstmOnly: [Q.DEFAULT, Q.LSTM_ONLY].includes(q) && !m.legacyLang
3475
3475
  }
3476
3476
  }
3477
3477
  })), F = (b, W, DA, CA) => y(A({
@@ -3479,9 +3479,9 @@ function qE() {
3479
3479
  action: "initialize",
3480
3480
  payload: { langs: b, oem: W, config: DA }
3481
3481
  })), S = (b = "eng", W, DA, CA) => {
3482
- if (v && [Q.TESSERACT_ONLY, Q.TESSERACT_LSTM_COMBINED].includes(W)) throw Error("Legacy model requested but code missing.");
3483
- const wA = W || f;
3484
- f = wA;
3482
+ if (J && [Q.TESSERACT_ONLY, Q.TESSERACT_LSTM_COMBINED].includes(W)) throw Error("Legacy model requested but code missing.");
3483
+ const wA = W || q;
3484
+ q = wA;
3485
3485
  const tA = DA || r;
3486
3486
  r = tA;
3487
3487
  const MA = (typeof b == "string" ? b.split("+") : b).filter((PA) => !P.includes(PA));
@@ -3499,7 +3499,7 @@ function qE() {
3499
3499
  payload: { image: yield c(b), options: W, output: DA }
3500
3500
  }));
3501
3501
  }), gA = (b, W) => L(null, null, function* () {
3502
- if (v) throw Error("`worker.detect` requires Legacy model, which was not loaded.");
3502
+ if (J) throw Error("`worker.detect` requires Legacy model, which was not loaded.");
3503
3503
  return y(A({
3504
3504
  id: W,
3505
3505
  action: "detect",
@@ -3519,14 +3519,14 @@ function qE() {
3519
3519
  if (DA === "resolve")
3520
3520
  B(`[${b}]: Complete ${W}`), M[tA].resolve({ jobId: W, data: wA }), delete M[tA];
3521
3521
  else if (DA === "reject")
3522
- if (M[tA].reject(wA), delete M[tA], CA === "load" && R(wA), D)
3522
+ if (M[tA].reject(wA), delete M[tA], CA === "load" && k(wA), D)
3523
3523
  D(wA);
3524
3524
  else
3525
3525
  throw Error(wA);
3526
3526
  else DA === "progress" && s(zA(BA({}, wA), { userJobId: W }));
3527
3527
  });
3528
3528
  const sA = {
3529
- id: J,
3529
+ id: v,
3530
3530
  worker: G,
3531
3531
  load: $,
3532
3532
  writeText: hA,
@@ -3540,7 +3540,7 @@ function qE() {
3540
3540
  terminate: p
3541
3541
  };
3542
3542
  return aA().then(() => O(w)).then(() => F(w, o, u)).then(() => l(sA)).catch(() => {
3543
- }), k;
3543
+ }), R;
3544
3544
  }), RC;
3545
3545
  }
3546
3546
  var YC, gI;
@@ -4039,41 +4039,41 @@ function T0(g, A, B, {
4039
4039
  throw new Error(a0(ng));
4040
4040
  const h = A.length, e = g.length, w = Math.max(0, Math.min(C, e));
4041
4041
  let o = I, i = w;
4042
- const u = n > 1 || t, q = u ? Array(e) : [];
4043
- let J;
4044
- for (; (J = g.indexOf(A, i)) > -1; ) {
4045
- let f = Fg(A, {
4046
- currentLocation: J,
4042
+ const u = n > 1 || t, f = u ? Array(e) : [];
4043
+ let v;
4044
+ for (; (v = g.indexOf(A, i)) > -1; ) {
4045
+ let q = Fg(A, {
4046
+ currentLocation: v,
4047
4047
  expectedLocation: w,
4048
4048
  distance: Q,
4049
4049
  ignoreLocation: c
4050
4050
  });
4051
- if (o = Math.min(f, o), i = J + h, u) {
4051
+ if (o = Math.min(q, o), i = v + h, u) {
4052
4052
  let r = 0;
4053
4053
  for (; r < h; )
4054
- q[J + r] = 1, r += 1;
4054
+ f[v + r] = 1, r += 1;
4055
4055
  }
4056
4056
  }
4057
4057
  i = -1;
4058
4058
  let s = [], D = 1, m = h + e;
4059
4059
  const M = 1 << h - 1;
4060
- for (let f = 0; f < h; f += 1) {
4061
- let r = 0, v = m;
4062
- for (; r < v; )
4060
+ for (let q = 0; q < h; q += 1) {
4061
+ let r = 0, J = m;
4062
+ for (; r < J; )
4063
4063
  Fg(A, {
4064
- errors: f,
4065
- currentLocation: w + v,
4064
+ errors: q,
4065
+ currentLocation: w + J,
4066
4066
  expectedLocation: w,
4067
4067
  distance: Q,
4068
4068
  ignoreLocation: c
4069
- }) <= o ? r = v : m = v, v = Math.floor((m - r) / 2 + r);
4070
- m = v;
4071
- let R = Math.max(1, w - v + 1), l = E ? e : Math.min(w + v, e) + h, k = Array(l + 2);
4072
- k[l + 1] = (1 << f) - 1;
4073
- for (let G = l; G >= R; G -= 1) {
4069
+ }) <= o ? r = J : m = J, J = Math.floor((m - r) / 2 + r);
4070
+ m = J;
4071
+ let k = Math.max(1, w - J + 1), l = E ? e : Math.min(w + J, e) + h, R = Array(l + 2);
4072
+ R[l + 1] = (1 << q) - 1;
4073
+ for (let G = l; G >= k; G -= 1) {
4074
4074
  let y = G - 1, $ = B[g.charAt(y)];
4075
- if (u && (q[y] = +!!$), k[G] = (k[G + 1] << 1 | 1) & $, f && (k[G] |= (s[G + 1] | s[G]) << 1 | 1 | s[G + 1]), k[G] & M && (D = Fg(A, {
4076
- errors: f,
4075
+ if (u && (f[y] = +!!$), R[G] = (R[G + 1] << 1 | 1) & $, q && (R[G] |= (s[G + 1] | s[G]) << 1 | 1 | s[G + 1]), R[G] & M && (D = Fg(A, {
4076
+ errors: q,
4077
4077
  currentLocation: y,
4078
4078
  expectedLocation: w,
4079
4079
  distance: Q,
@@ -4081,18 +4081,18 @@ function T0(g, A, B, {
4081
4081
  }), D <= o)) {
4082
4082
  if (o = D, i = y, i <= w)
4083
4083
  break;
4084
- R = Math.max(1, 2 * w - i);
4084
+ k = Math.max(1, 2 * w - i);
4085
4085
  }
4086
4086
  }
4087
4087
  if (Fg(A, {
4088
- errors: f + 1,
4088
+ errors: q + 1,
4089
4089
  currentLocation: w,
4090
4090
  expectedLocation: w,
4091
4091
  distance: Q,
4092
4092
  ignoreLocation: c
4093
4093
  }) > o)
4094
4094
  break;
4095
- s = k;
4095
+ s = R;
4096
4096
  }
4097
4097
  const P = {
4098
4098
  isMatch: i >= 0,
@@ -4100,8 +4100,8 @@ function T0(g, A, B, {
4100
4100
  score: Math.max(1e-3, D)
4101
4101
  };
4102
4102
  if (u) {
4103
- const f = d0(q, n);
4104
- f.length ? t && (P.indices = f) : P.isMatch = !1;
4103
+ const q = d0(f, n);
4104
+ q.length ? t && (P.indices = q) : P.isMatch = !1;
4105
4105
  }
4106
4106
  return P;
4107
4107
  }
@@ -4151,8 +4151,8 @@ class JE {
4151
4151
  for (; o < u; )
4152
4152
  e(this.pattern.substr(o, ng), o), o += ng;
4153
4153
  if (i) {
4154
- const q = w - ng;
4155
- e(this.pattern.substr(q), q);
4154
+ const f = w - ng;
4155
+ e(this.pattern.substr(f), f);
4156
4156
  }
4157
4157
  } else
4158
4158
  e(this.pattern, 0);
@@ -4175,9 +4175,9 @@ class JE {
4175
4175
  ignoreLocation: h
4176
4176
  } = this.options;
4177
4177
  let e = [], w = 0, o = !1;
4178
- this.chunks.forEach(({ pattern: u, alphabet: q, startIndex: J }) => {
4179
- const { isMatch: s, score: D, indices: m } = T0(A, u, q, {
4180
- location: I + J,
4178
+ this.chunks.forEach(({ pattern: u, alphabet: f, startIndex: v }) => {
4179
+ const { isMatch: s, score: D, indices: m } = T0(A, u, f, {
4180
+ location: I + v,
4181
4181
  distance: E,
4182
4182
  threshold: n,
4183
4183
  findAllMatches: t,
@@ -4482,11 +4482,11 @@ class L0 {
4482
4482
  const e = B[c];
4483
4483
  n.length = 0, E = 0;
4484
4484
  for (let w = 0, o = e.length; w < o; w += 1) {
4485
- const i = e[w], { isMatch: u, indices: q, score: J } = i.search(A);
4485
+ const i = e[w], { isMatch: u, indices: f, score: v } = i.search(A);
4486
4486
  if (u) {
4487
- if (E += 1, t += J, C) {
4487
+ if (E += 1, t += v, C) {
4488
4488
  const s = i.constructor.type;
4489
- F0.has(s) ? n = [...n, ...q] : n.push(q);
4489
+ F0.has(s) ? n = [...n, ...f] : n.push(f);
4490
4490
  }
4491
4491
  } else {
4492
4492
  t = 0, E = 0, n.length = 0;
@@ -4994,7 +4994,7 @@ function rh(E) {
4994
4994
  const x = oA();
4995
4995
  typeof g == "function" && g(x);
4996
4996
  }), n.appendChild(t);
4997
- let c, h, e, w, o, i, u, q, J, s, D, m, M, P, f, r, v, R, l, k, H, G, y, $, aA;
4997
+ let c, h, e, w, o, i, u, f, v, s, D, m, M, P, q, r, J, k, l, R, H, G, y, $, aA;
4998
4998
  const hA = document.createElement("button");
4999
4999
  c = vA({
5000
5000
  name: "taxCode",
@@ -5066,7 +5066,7 @@ function rh(E) {
5066
5066
  Z();
5067
5067
  },
5068
5068
  error: null
5069
- }), J = vA({
5069
+ }), v = vA({
5070
5070
  name: "repName",
5071
5071
  label: a("fullName"),
5072
5072
  required: !0,
@@ -5077,10 +5077,10 @@ function rh(E) {
5077
5077
  onInput: (X) => {
5078
5078
  const x = X.target.value;
5079
5079
  if (x.trim() === "") {
5080
- J.setError(a("errorRequired"));
5080
+ v.setError(a("errorRequired"));
5081
5081
  return;
5082
5082
  }
5083
- /^[\p{L}0-9_]+(?: [\p{L}0-9_]+)*$/u.test(x) ? J.setError(null) : J.setError(
5083
+ /^[\p{L}0-9_]+(?: [\p{L}0-9_]+)*$/u.test(x) ? v.setError(null) : v.setError(
5084
5084
  a("errorInvalidName", "Chỉ được dùng chữ cái, số và dấu gạch dưới")
5085
5085
  );
5086
5086
  }
@@ -5160,7 +5160,7 @@ function rh(E) {
5160
5160
  }
5161
5161
  /(84|0[3|5|7|8|9])+([0-9]{8})\b/g.test(x) ? m.setError(null) : m.setError(a("errorInvalidPhone"));
5162
5162
  }
5163
- }), f = oC({
5163
+ }), q = oC({
5164
5164
  name: "repNationality",
5165
5165
  label: a("country"),
5166
5166
  options: GQ,
@@ -5264,7 +5264,7 @@ function rh(E) {
5264
5264
  a("errorInvalidPhone", "Số điện thoại không hợp lệ")
5265
5265
  );
5266
5266
  }
5267
- }), q = vA({
5267
+ }), f = vA({
5268
5268
  name: "contactAddressDetail",
5269
5269
  label: a("permanentAddress"),
5270
5270
  required: !0,
@@ -5276,14 +5276,14 @@ function rh(E) {
5276
5276
  onInput: (X) => {
5277
5277
  const x = X.target.value;
5278
5278
  if (!/^[\p{L}0-9\s,.\-/()]*$/u.test(x)) {
5279
- q.setError(
5279
+ f.setError(
5280
5280
  a("errorInvalidAddress", "Địa chỉ không được chứa ký tự đặc biệt")
5281
5281
  );
5282
5282
  return;
5283
5283
  }
5284
- x.trim() === "" ? q.setError(
5284
+ x.trim() === "" ? f.setError(
5285
5285
  a("errorRequired", "Địa chỉ liên hệ bắt buộc")
5286
- ) : q.setError(null);
5286
+ ) : f.setError(null);
5287
5287
  }
5288
5288
  });
5289
5289
  const z = vA({
@@ -5298,16 +5298,16 @@ function rh(E) {
5298
5298
  onInput: (X) => {
5299
5299
  }
5300
5300
  });
5301
- v = _E({
5301
+ J = _E({
5302
5302
  initialValue: ((BQ = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : BQ.invoiceSymbol) || "1C25TYY",
5303
5303
  onChange: (X) => {
5304
5304
  z.inputEl.value = X, Z();
5305
5305
  }
5306
- }), R = document.createElement("input"), R.type = "checkbox", R.name = "hasUsedEInvoiceCB", R.className = "wgt:cursor-pointer", R.checked = (QQ = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : QQ.hasUsedEInvoice, R.addEventListener("change", (X) => {
5306
+ }), k = document.createElement("input"), k.type = "checkbox", k.name = "hasUsedEInvoiceCB", k.className = "wgt:cursor-pointer", k.checked = (QQ = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : QQ.hasUsedEInvoice, k.addEventListener("change", (X) => {
5307
5307
  X.target.checked ? (XA.appendChild(yA), XA.appendChild(xA)) : (H.inputEl.value = "", H.setError(null), XA.removeChild(yA), XA.removeChild(xA));
5308
5308
  }), l = document.createElement("input"), l.type = "checkbox", l.name = "hasUsedEInvoiceBeforeCB", l.className = "wgt:cursor-pointer", l.checked = (IQ = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : IQ.isUsedEInvoiceBefore, l.addEventListener("change", (X) => {
5309
- X.target.checked ? xA.appendChild(k.container) : (k.inputEl.value = "", k.setError(null), xA.removeChild(k.container));
5310
- }), k = vA({
5309
+ X.target.checked ? xA.appendChild(R.container) : (R.inputEl.value = "", R.setError(null), xA.removeChild(R.container));
5310
+ }), R = vA({
5311
5311
  name: "previousOtherProviderNameField",
5312
5312
  label: a("providerName", "Tên NCC"),
5313
5313
  required: !0,
@@ -5319,12 +5319,12 @@ function rh(E) {
5319
5319
  onInput: (X) => {
5320
5320
  const x = X.target.value;
5321
5321
  if (x.trim() === "") {
5322
- k.setError(
5322
+ R.setError(
5323
5323
  a("errorRequired", "Tên nhà cung cấp bắt buộc")
5324
5324
  );
5325
5325
  return;
5326
5326
  }
5327
- /^[\p{L}0-9_]+(?: [\p{L}0-9_]+)*$/u.test(x) ? k.setError(null) : k.setError(
5327
+ /^[\p{L}0-9_]+(?: [\p{L}0-9_]+)*$/u.test(x) ? R.setError(null) : R.setError(
5328
5328
  a(
5329
5329
  "errorInvalidProviderName",
5330
5330
  "Tên nhà cung cấp không hợp lệ. Chỉ được dùng chữ cái, số và dấu gạch dưới"
@@ -5424,7 +5424,7 @@ function rh(E) {
5424
5424
  return;
5425
5425
  }
5426
5426
  const mA = () => {
5427
- M.inputEl.value = "", J.inputEl.value = "", s.inputEl.value = "", r.inputEl.value = "", D.selectEl.value = "", f.selectEl.value = "";
5427
+ M.inputEl.value = "", v.inputEl.value = "", s.inputEl.value = "", r.inputEl.value = "", D.selectEl.value = "", q.selectEl.value = "";
5428
5428
  }, zg = (LA) => {
5429
5429
  if (!LA) return "";
5430
5430
  const [vg, iQ, Jg] = LA.split("/"), dg = new Date(+Jg, +iQ - 1, +vg), nC = dg.getFullYear(), tC = String(dg.getMonth() + 1).padStart(2, "0"), Gg = String(dg.getDate()).padStart(2, "0");
@@ -5446,7 +5446,7 @@ function rh(E) {
5446
5446
  sex: Gg,
5447
5447
  nationality: aQ
5448
5448
  } = LA;
5449
- if (!Jg || !/^\d{12}$/.test(Jg) ? (CA(a("errorInvalidCard", "Số CCCD phải có 12 chữ số")), M.inputEl.value = "") : (M.inputEl.value = Jg, M.setError(null)), J.inputEl.value = dg || "", s.inputEl.value = zg(nC), r.inputEl.value = tC || "", Gg) {
5449
+ if (!Jg || !/^\d{12}$/.test(Jg) ? (CA(a("errorInvalidCard", "Số CCCD phải có 12 chữ số")), M.inputEl.value = "") : (M.inputEl.value = Jg, M.setError(null)), v.inputEl.value = dg || "", s.inputEl.value = zg(nC), r.inputEl.value = tC || "", Gg) {
5450
5450
  const pA = XQ.find(
5451
5451
  (hC) => hC.label.toLowerCase() === Gg.toLowerCase()
5452
5452
  );
@@ -5454,7 +5454,7 @@ function rh(E) {
5454
5454
  }
5455
5455
  if (aQ) {
5456
5456
  const pA = GQ.find((hC) => hC.label === aQ);
5457
- f.selectEl.value = (pA == null ? void 0 : pA.value) || "";
5457
+ q.selectEl.value = (pA == null ? void 0 : pA.value) || "";
5458
5458
  }
5459
5459
  } catch (LA) {
5460
5460
  console.error("readIdentityCard failed", LA);
@@ -5468,11 +5468,11 @@ function rh(E) {
5468
5468
  });
5469
5469
  fA.appendChild(b);
5470
5470
  const wA = document.createElement("div");
5471
- wA.className = "wgt:space-y-4", wA.appendChild(J.container);
5471
+ wA.className = "wgt:space-y-4", wA.appendChild(v.container);
5472
5472
  const tA = document.createElement("div");
5473
5473
  tA.className = "wgt:grid wgt:grid-cols-1 wgt:md:grid-cols-2 wgt:gap-4", wA.appendChild(tA), tA.appendChild(s.container), tA.appendChild(D.container), fA.appendChild(wA);
5474
5474
  const uA = document.createElement("div");
5475
- uA.className = "wgt:grid wgt:grid-cols-1 wgt:md:grid-cols-4 wgt:gap-4 wgt:items-start", uA.appendChild(M.container), uA.appendChild(P.container), uA.appendChild(m.container), uA.appendChild(f.container), p.appendChild(fA), p.appendChild(uA), p.appendChild(r.container), p.appendChild(y.container);
5475
+ uA.className = "wgt:grid wgt:grid-cols-1 wgt:md:grid-cols-4 wgt:gap-4 wgt:items-start", uA.appendChild(M.container), uA.appendChild(P.container), uA.appendChild(m.container), uA.appendChild(q.container), p.appendChild(fA), p.appendChild(uA), p.appendChild(r.container), p.appendChild(y.container);
5476
5476
  const MA = document.createElement("ul");
5477
5477
  MA.className = "wgt:list-inside wgt:list-disc wgt:-mt-2";
5478
5478
  const PA = document.createElement("li");
@@ -5485,17 +5485,17 @@ function rh(E) {
5485
5485
  const Bg = document.createElement("h3");
5486
5486
  Bg.className = "wgt:text-lg wgt:font-semibold wgt:mb-2", Bg.innerText = a("contactInfo", "3. Thông tin người liên hệ:"), OA.appendChild(Bg);
5487
5487
  const dA = document.createElement("div");
5488
- dA.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:md:grid-cols-2 wgt:gap-4 wgt:items-start", dA.appendChild(o.container), dA.appendChild(i.container), dA.appendChild(u.container), dA.appendChild(q.container), OA.appendChild(dA), t.appendChild(OA);
5488
+ dA.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:md:grid-cols-2 wgt:gap-4 wgt:items-start", dA.appendChild(o.container), dA.appendChild(i.container), dA.appendChild(u.container), dA.appendChild(f.container), OA.appendChild(dA), t.appendChild(OA);
5489
5489
  const RA = document.createElement("div");
5490
5490
  RA.className = "wgt:space-y-4";
5491
5491
  const YA = document.createElement("h3");
5492
5492
  YA.className = "wgt:text-lg wgt:font-semibold wgt:mb-2", YA.innerText = a("invoiceUsageInfo", "4. THÔNG TIN SỬ DỤNG HDDT:"), RA.appendChild(YA), t.appendChild(RA);
5493
5493
  const Qg = document.createElement("div");
5494
- Qg.className = "wgt:w-full wgt:flex wgt:gap-4 wgt:items-start wgt:flex-col wgt:md:flex-row", Qg.appendChild(v.container), Qg.appendChild(z.container), RA.appendChild(Qg);
5494
+ Qg.className = "wgt:w-full wgt:flex wgt:gap-4 wgt:items-start wgt:flex-col wgt:md:flex-row", Qg.appendChild(J.container), Qg.appendChild(z.container), RA.appendChild(Qg);
5495
5495
  const XA = document.createElement("div");
5496
5496
  XA.className = "wgt:flex wgt:flex-col wgt:space-y-4 wgt:border wgt:border-soft-200 wgt:px-6 wgt:py-4 wgt:rounded-xl", t.appendChild(XA);
5497
5497
  const ig = document.createElement("div");
5498
- ig.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", ig.appendChild(R);
5498
+ ig.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", ig.appendChild(k);
5499
5499
  const Mg = document.createElement("h4");
5500
5500
  Mg.className = "wgt:font-semibold wgt:italic", Mg.innerText = a(
5501
5501
  "hasUsedEInvoice",
@@ -5587,7 +5587,7 @@ function rh(E) {
5587
5587
  return {
5588
5588
  eInvoiceRegistration: {
5589
5589
  taxAuthorityCode: (X = H == null ? void 0 : H.getValue()) != null ? X : "",
5590
- previousEInvoiceProvider: (x = k == null ? void 0 : k.getValue()) != null ? x : "",
5590
+ previousEInvoiceProvider: (x = R == null ? void 0 : R.getValue()) != null ? x : "",
5591
5591
  organization: {
5592
5592
  name: h == null ? void 0 : h.getValue(),
5593
5593
  address: e == null ? void 0 : e.getValue(),
@@ -5596,23 +5596,23 @@ function rh(E) {
5596
5596
  },
5597
5597
  contactPerson: {
5598
5598
  name: o == null ? void 0 : o.getValue(),
5599
- address: q == null ? void 0 : q.getValue(),
5599
+ address: f == null ? void 0 : f.getValue(),
5600
5600
  email: i == null ? void 0 : i.getValue(),
5601
5601
  phone: u == null ? void 0 : u.getValue()
5602
5602
  },
5603
5603
  legalRepresentative: {
5604
- name: J == null ? void 0 : J.getValue(),
5604
+ name: v == null ? void 0 : v.getValue(),
5605
5605
  dob: s == null ? void 0 : s.getValue(),
5606
5606
  gender: D == null ? void 0 : D.getValue(),
5607
5607
  phone: m == null ? void 0 : m.getValue(),
5608
5608
  idCard: M == null ? void 0 : M.getValue(),
5609
5609
  passportNumber: P == null ? void 0 : P.getValue(),
5610
- nationality: f == null ? void 0 : f.getValue(),
5610
+ nationality: q == null ? void 0 : q.getValue(),
5611
5611
  permanentAddress: r == null ? void 0 : r.getValue()
5612
5612
  },
5613
- hasUsedEInvoice: R == null ? void 0 : R.checked,
5613
+ hasUsedEInvoice: k == null ? void 0 : k.checked,
5614
5614
  isUsedEInvoiceBefore: l == null ? void 0 : l.checked,
5615
- invoiceSymbol: v == null ? void 0 : v.getValue()
5615
+ invoiceSymbol: J == null ? void 0 : J.getValue()
5616
5616
  },
5617
5617
  license: y == null ? void 0 : y.getValues(),
5618
5618
  logo: G == null ? void 0 : G.getValues(),
@@ -5628,20 +5628,20 @@ function rh(E) {
5628
5628
  o,
5629
5629
  i,
5630
5630
  u,
5631
- q,
5632
- J,
5631
+ f,
5632
+ v,
5633
5633
  s,
5634
5634
  m,
5635
5635
  M,
5636
5636
  r,
5637
5637
  // invoiceSymbolField,
5638
5638
  H,
5639
- k
5639
+ R
5640
5640
  ].forEach((X) => {
5641
5641
  X.inputEl.addEventListener("input", Z);
5642
5642
  }), [D, w].forEach((X) => {
5643
5643
  X.selectEl.addEventListener("change", Z);
5644
- }), [R, l].forEach((X) => {
5644
+ }), [k, l].forEach((X) => {
5645
5645
  X.addEventListener("change", Z);
5646
5646
  }), hA.addEventListener("click", (X) => {
5647
5647
  if (X.preventDefault(), !eA()) return;
@@ -5649,7 +5649,7 @@ function rh(E) {
5649
5649
  typeof g == "function" && g(x);
5650
5650
  });
5651
5651
  const EA = (((hQ = (tQ = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : tQ.organization) == null ? void 0 : hQ.taxCode) || "").trim();
5652
- return EA.length >= 10 && F(EA), A != null && A.idCard && ($ = A == null ? void 0 : A.idCard), (cQ = A == null ? void 0 : A.eInvoiceRegistration) != null && cQ.hasUsedEInvoice && (XA.appendChild(yA), XA.appendChild(xA), (wQ = A == null ? void 0 : A.eInvoiceRegistration) != null && wQ.isUsedEInvoiceBefore ? (l.checked = !0, xA.appendChild(k.container), k.inputEl.value = (eQ = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : eQ.previousEInvoiceProvider) : k.inputEl.value = "", H.inputEl.value = (oQ = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : oQ.taxAuthorityCode), Z(), {
5652
+ return EA.length >= 10 && F(EA), A != null && A.idCard && ($ = A == null ? void 0 : A.idCard), (cQ = A == null ? void 0 : A.eInvoiceRegistration) != null && cQ.hasUsedEInvoice && (XA.appendChild(yA), XA.appendChild(xA), (wQ = A == null ? void 0 : A.eInvoiceRegistration) != null && wQ.isUsedEInvoiceBefore ? (l.checked = !0, xA.appendChild(R.container), R.inputEl.value = (eQ = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : eQ.previousEInvoiceProvider) : R.inputEl.value = "", H.inputEl.value = (oQ = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : oQ.taxAuthorityCode), Z(), {
5653
5653
  container: n,
5654
5654
  getValues: oA
5655
5655
  };
@@ -5731,23 +5731,23 @@ function wI({
5731
5731
  "wgt:font-semibold",
5732
5732
  e ? "wgt:text-primary" : "wgt:text-"
5733
5733
  ].join(" "), u.innerText = h.name.split("-")[0], i.appendChild(u);
5734
- const { container: q } = KI({
5734
+ const { container: f } = KI({
5735
5735
  checked: e,
5736
- onChange: (f) => {
5736
+ onChange: (q) => {
5737
5737
  }
5738
5738
  });
5739
- i.appendChild(q), o.appendChild(i);
5740
- const J = document.createElement("div");
5741
- J.className = "wgt:flex wgt:items-center wgt:text-gray-600 wgt:mt-2";
5739
+ i.appendChild(f), o.appendChild(i);
5740
+ const v = document.createElement("div");
5741
+ v.className = "wgt:flex wgt:items-center wgt:text-gray-600 wgt:mt-2";
5742
5742
  const s = document.createElement("div");
5743
5743
  s.innerHTML = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
5744
5744
  <path d="M15.384 5.76968L6.95352 13.5705C6.6518 13.8497 6.26133 13.9811 5.85312 13.9811C5.46265 13.9811 5.07219 13.8497 4.77047 13.5705L0.546335 9.67832C-0.0571118 9.10352 -0.0571118 8.20026 0.546335 7.64188C1.14978 7.08351 2.1437 7.08351 2.74714 7.64188L5.85312 10.5159L13.1832 3.73324C13.7867 3.17486 14.7806 3.17486 15.384 3.73324C15.9875 4.30804 15.9875 5.2113 15.384 5.76968Z" fill="#008C4F"/>
5745
5745
  </svg>
5746
- `, J.appendChild(s);
5746
+ `, v.appendChild(s);
5747
5747
  const D = document.createElement("span");
5748
5748
  D.className = "wgt:ml-2 wgt:text-sm", g === "signature" ? D.innerText = `${a("duration")}: ${h.name.split("-")[1]}` : typeof (h == null ? void 0 : h.limit) == "number" ? D.innerText = `${h == null ? void 0 : h.limit.toLocaleString(
5749
5749
  "vi-VN"
5750
- )} ${a("electronicInvoices")} / ${a("month")}` : D.innerText = "", J.appendChild(D), o.appendChild(J);
5750
+ )} ${a("electronicInvoices")} / ${a("month")}` : D.innerText = "", v.appendChild(D), o.appendChild(v);
5751
5751
  const m = document.createElement("div");
5752
5752
  m.className = "wgt:mt-4";
5753
5753
  const M = document.createElement("span");
@@ -5936,8 +5936,8 @@ function Hh(o) {
5936
5936
  i.className = "wgt:relative wgt:flex wgt:w-full wgt:h-full wgt:flex-col wgt:gap-8 wgt:py-8";
5937
5937
  const {
5938
5938
  container: u,
5939
- open: q,
5940
- close: J
5939
+ open: f,
5940
+ close: v
5941
5941
  } = YE();
5942
5942
  i.appendChild(u);
5943
5943
  const s = document.createElement("div");
@@ -5956,23 +5956,23 @@ function Hh(o) {
5956
5956
  }
5957
5957
  });
5958
5958
  m.appendChild(P.container);
5959
- const f = document.createElement("div");
5960
- f.className = "wgt:flex wgt:flex-col wgt:gap-2", D.appendChild(f);
5959
+ const q = document.createElement("div");
5960
+ q.className = "wgt:flex wgt:flex-col wgt:gap-2", D.appendChild(q);
5961
5961
  const r = document.createElement("h3");
5962
- r.className = "wgt:text-sm wgt:font-semibold wgt:text-[#525866]", r.innerText = a("mostSuitablePackage"), f.appendChild(r);
5963
- const v = document.createElement("div");
5964
- f.appendChild(v);
5965
- const R = document.createElement("div");
5966
- R.className = "wgt:flex wgt:items-center wgt:justify-center wgt:py-8", R.innerHTML = `
5962
+ r.className = "wgt:text-sm wgt:font-semibold wgt:text-[#525866]", r.innerText = a("mostSuitablePackage"), q.appendChild(r);
5963
+ const J = document.createElement("div");
5964
+ q.appendChild(J);
5965
+ const k = document.createElement("div");
5966
+ k.className = "wgt:flex wgt:items-center wgt:justify-center wgt:py-8", k.innerHTML = `
5967
5967
  <div class="wgt:flex wgt:flex-col wgt:items-center wgt:gap-2">
5968
5968
  <div class="wgt:h-8 wgt:w-8 wgt:animate-spin wgt:rounded-full wgt:border-2 wgt:border-solid wgt:border-primary wgt:border-t-transparent"></div>
5969
5969
  <span class="wgt:text-sm wgt:text-text-sub-600">${a("loading")}...</span>
5970
5970
  </div>
5971
- `, v.appendChild(R);
5971
+ `, J.appendChild(k);
5972
5972
  const l = document.createElement("div");
5973
5973
  l.className = "wgt:flex wgt:flex-col wgt:gap-4", s.appendChild(l);
5974
- const k = document.createElement("h2");
5975
- k.className = "wgt:text-xl wgt:font-bold wgt:text-text-black", k.innerText = a("selectSignaturePackage"), l.appendChild(k);
5974
+ const R = document.createElement("h2");
5975
+ R.className = "wgt:text-xl wgt:font-bold wgt:text-text-black", R.innerText = a("selectSignaturePackage"), l.appendChild(R);
5976
5976
  const H = document.createElement("div");
5977
5977
  l.appendChild(H);
5978
5978
  const G = document.createElement("div");
@@ -6068,7 +6068,7 @@ function Hh(o) {
6068
6068
  });
6069
6069
  sA.appendChild(fA);
6070
6070
  const b = (j, _, qA) => L(null, null, function* () {
6071
- q();
6071
+ f();
6072
6072
  const eA = w.eInvoiceRegistration, { isUsedEInvoiceBefore: FA } = eA, N = cC(eA, ["isUsedEInvoiceBefore"]);
6073
6073
  let V = [
6074
6074
  {
@@ -6102,7 +6102,7 @@ function Hh(o) {
6102
6102
  console.error("Error creating order:", Z), iB(a("errorCreatingOrder") || "Failed to create order");
6103
6103
  return;
6104
6104
  } finally {
6105
- J();
6105
+ v();
6106
6106
  }
6107
6107
  }), W = rg({
6108
6108
  type: "button",
@@ -6191,7 +6191,7 @@ function Hh(o) {
6191
6191
  }
6192
6192
  let yA = null;
6193
6193
  function _A() {
6194
- if (v.innerHTML = "", tA.length > 0)
6194
+ if (J.innerHTML = "", tA.length > 0)
6195
6195
  yA = wI({
6196
6196
  type: "service",
6197
6197
  packageOptions: tA,
@@ -6204,10 +6204,10 @@ function Hh(o) {
6204
6204
  CA
6205
6205
  ), _A(), TA();
6206
6206
  }
6207
- }), v.appendChild(yA.container);
6207
+ }), J.appendChild(yA.container);
6208
6208
  else {
6209
6209
  const j = document.createElement("span");
6210
- j.className = "wgt:text-text-sub-600", j.innerText = a("noPackageFound"), v.appendChild(j), yA = null;
6210
+ j.className = "wgt:text-text-sub-600", j.innerText = a("noPackageFound"), J.appendChild(j), yA = null;
6211
6211
  }
6212
6212
  }
6213
6213
  let xA = null;
@@ -6394,55 +6394,55 @@ function lh({
6394
6394
  w.src = g, w.alt = "QR code", w.className = "wgt:w-full wgt:max-w-[200px] wgt:aspect-square wgt:object-contain", e.appendChild(w), h.appendChild(e);
6395
6395
  const o = document.createElement("div");
6396
6396
  o.className = "wgt:flex wgt:justify-center wgt:items-center wgt:gap-4 wgt:flex-wrap", A.forEach((r) => {
6397
- const v = document.createElement("img");
6398
- v.src = r, v.alt = "Logo", v.className = "wgt:w-8 wgt:object-contain", o.appendChild(v);
6397
+ const J = document.createElement("img");
6398
+ J.src = r, J.alt = "Logo", J.className = "wgt:w-8 wgt:object-contain", o.appendChild(J);
6399
6399
  }), h.appendChild(o);
6400
6400
  const i = document.createElement("div");
6401
6401
  i.className = "wgt:text-center wgt:flex wgt:flex-col wgt:gap-1";
6402
6402
  const u = document.createElement("h3");
6403
6403
  u.className = "wgt:text-lg wgt:font-bold wgt:text-text-black", u.innerText = B, i.appendChild(u);
6404
- const q = document.createElement("p");
6405
- q.className = "wgt:text-sm wgt:text-grey-8", q.innerHTML = `${a("accountNumber")}: <span class="wgt:font-medium">${C}</span>`, i.appendChild(q);
6406
- const J = document.createElement("p");
6407
- J.className = "wgt:text-sm wgt:text-grey-8", J.innerHTML = `${a("beneficiaryBank")}: <span class="wgt:font-medium">${Q}</span>`, i.appendChild(J), h.appendChild(i), t.appendChild(h), n.appendChild(t);
6404
+ const f = document.createElement("p");
6405
+ f.className = "wgt:text-sm wgt:text-grey-8", f.innerHTML = `${a("accountNumber")}: <span class="wgt:font-medium">${C}</span>`, i.appendChild(f);
6406
+ const v = document.createElement("p");
6407
+ v.className = "wgt:text-sm wgt:text-grey-8", v.innerHTML = `${a("beneficiaryBank")}: <span class="wgt:font-medium">${Q}</span>`, i.appendChild(v), h.appendChild(i), t.appendChild(h), n.appendChild(t);
6408
6408
  const s = document.createElement("div");
6409
6409
  s.className = "wgt:flex wgt:flex-col wgt:justify-between wgt:md:w-1/2";
6410
6410
  const D = document.createElement("div"), m = document.createElement("h3");
6411
6411
  m.className = "wgt:text-lg wgt:font-semibold wgt:text-gray-800 mb-4", m.innerText = a("paymentInstructionsTitle"), D.appendChild(m);
6412
6412
  const M = document.createElement("ol");
6413
- M.className = "wgt:space-y-4", I.forEach((r, v) => {
6414
- const R = document.createElement("li");
6415
- R.className = "wgt:flex wgt:items-start";
6413
+ M.className = "wgt:space-y-4", I.forEach((r, J) => {
6414
+ const k = document.createElement("li");
6415
+ k.className = "wgt:flex wgt:items-start";
6416
6416
  const l = document.createElement("div");
6417
6417
  l.className = "wgt:flex-shrink-0 wgt:mt-0.5";
6418
- const k = document.createElement("div");
6419
- k.className = "wgt:w-6 wgt:h-6 wgt:rounded-full wgt:bg-primary wgt:flex wgt:items-center wgt:justify-center";
6418
+ const R = document.createElement("div");
6419
+ R.className = "wgt:w-6 wgt:h-6 wgt:rounded-full wgt:bg-primary wgt:flex wgt:items-center wgt:justify-center";
6420
6420
  const H = document.createElement("span");
6421
- H.className = "wgt:text-white wgt:text-sm wgt:font-semibold", H.innerText = String(v + 1), k.appendChild(H), l.appendChild(k);
6421
+ H.className = "wgt:text-white wgt:text-sm wgt:font-semibold", H.innerText = String(J + 1), R.appendChild(H), l.appendChild(R);
6422
6422
  const G = document.createElement("p");
6423
- G.className = "wgt:ml-3 wgt:text-text-sub-600", G.innerText = r, R.appendChild(l), R.appendChild(G), M.appendChild(R);
6423
+ G.className = "wgt:ml-3 wgt:text-text-sub-600", G.innerText = r, k.appendChild(l), k.appendChild(G), M.appendChild(k);
6424
6424
  }), D.appendChild(M), s.appendChild(D);
6425
6425
  const P = document.createElement("div");
6426
6426
  P.className = "wgt:h-[300px] wgt:flex wgt:justify-center";
6427
- const f = document.createElement("img");
6428
- return f.src = E, f.alt = "QR payment illustration", f.className = "wgt:h-full wgt:object-contain", P.appendChild(f), s.appendChild(P), n.appendChild(s), {
6427
+ const q = document.createElement("img");
6428
+ return q.src = E, q.alt = "QR payment illustration", q.className = "wgt:h-full wgt:object-contain", P.appendChild(q), s.appendChild(P), n.appendChild(s), {
6429
6429
  container: n,
6430
6430
  update(r = {}) {
6431
- r.qrSrc != null && (w.src = r.qrSrc), r.logos && (o.innerHTML = "", r.logos.forEach((v) => {
6432
- const R = document.createElement("img");
6433
- R.src = v, R.alt = "Logo", R.className = "wgt:w-8 wgt:object-contain", o.appendChild(R);
6434
- })), r.accountName != null && (u.innerText = r.accountName), r.accountNumber != null && (q.innerHTML = `${a("accountNumber")}: <span class="wgt:font-medium">${r.accountNumber}</span>`), r.bankName != null && (J.innerHTML = `${a("beneficiaryBank")}: <span class="wgt:font-medium">${r.bankName}</span>`), r.instructions && (M.innerHTML = "", r.instructions.forEach((v, R) => {
6431
+ r.qrSrc != null && (w.src = r.qrSrc), r.logos && (o.innerHTML = "", r.logos.forEach((J) => {
6432
+ const k = document.createElement("img");
6433
+ k.src = J, k.alt = "Logo", k.className = "wgt:w-8 wgt:object-contain", o.appendChild(k);
6434
+ })), r.accountName != null && (u.innerText = r.accountName), r.accountNumber != null && (f.innerHTML = `${a("accountNumber")}: <span class="wgt:font-medium">${r.accountNumber}</span>`), r.bankName != null && (v.innerHTML = `${a("beneficiaryBank")}: <span class="wgt:font-medium">${r.bankName}</span>`), r.instructions && (M.innerHTML = "", r.instructions.forEach((J, k) => {
6435
6435
  const l = document.createElement("li");
6436
6436
  l.className = "wgt:flex wgt:items-start";
6437
- const k = document.createElement("div");
6438
- k.className = "wgt:flex-shrink-0 wgt:mt-0.5";
6437
+ const R = document.createElement("div");
6438
+ R.className = "wgt:flex-shrink-0 wgt:mt-0.5";
6439
6439
  const H = document.createElement("div");
6440
6440
  H.className = "wgt:w-6 wgt:h-6 wgt:rounded-full wgt:bg-primary wgt:flex wgt:items-center wgt:justify-center";
6441
6441
  const G = document.createElement("span");
6442
- G.className = "wgt:text-white wgt:text-sm wgt:font-semibold", G.innerText = String(R + 1), H.appendChild(G), k.appendChild(H);
6442
+ G.className = "wgt:text-white wgt:text-sm wgt:font-semibold", G.innerText = String(k + 1), H.appendChild(G), R.appendChild(H);
6443
6443
  const y = document.createElement("p");
6444
- y.className = "wgt:ml-3 wgt:text-text-sub-600", y.innerText = v, l.appendChild(k), l.appendChild(y), M.appendChild(l);
6445
- })), r.illustrationSrc != null && (f.src = r.illustrationSrc);
6444
+ y.className = "wgt:ml-3 wgt:text-text-sub-600", y.innerText = J, l.appendChild(R), l.appendChild(y), M.appendChild(l);
6445
+ })), r.illustrationSrc != null && (q.src = r.illustrationSrc);
6446
6446
  }
6447
6447
  };
6448
6448
  }
@@ -7323,8 +7323,8 @@ function Nh() {
7323
7323
  function h(w, o) {
7324
7324
  let i = 0;
7325
7325
  return w.forEach(function(u) {
7326
- const q = c(u.mode, o);
7327
- i += q + u.getBitsLength();
7326
+ const f = c(u.mode, o);
7327
+ i += f + u.getBitsLength();
7328
7328
  }), i;
7329
7329
  }
7330
7330
  function e(w, o) {
@@ -7338,7 +7338,7 @@ function Nh() {
7338
7338
  if (!I.isValid(o))
7339
7339
  throw new Error("Invalid QR Code version");
7340
7340
  typeof u == "undefined" && (u = Q.BYTE);
7341
- const q = A.getSymbolTotalCodewords(o), J = B.getTotalCodewordsCount(o, i), s = (q - J) * 8;
7341
+ const f = A.getSymbolTotalCodewords(o), v = B.getTotalCodewordsCount(o, i), s = (f - v) * 8;
7342
7342
  if (u === Q.MIXED) return s;
7343
7343
  const D = s - c(u, o);
7344
7344
  switch (u) {
@@ -7354,16 +7354,16 @@ function Nh() {
7354
7354
  }
7355
7355
  }, g.getBestVersionForData = function(o, i) {
7356
7356
  let u;
7357
- const q = C.from(i, C.M);
7357
+ const f = C.from(i, C.M);
7358
7358
  if (Array.isArray(o)) {
7359
7359
  if (o.length > 1)
7360
- return e(o, q);
7360
+ return e(o, f);
7361
7361
  if (o.length === 0)
7362
7362
  return 1;
7363
7363
  u = o[0];
7364
7364
  } else
7365
7365
  u = o;
7366
- return t(u.mode, u.getLength(), q);
7366
+ return t(u.mode, u.getLength(), f);
7367
7367
  }, g.getEncodedBits = function(o) {
7368
7368
  if (!I.isValid(o) || o < 7)
7369
7369
  throw new Error("Invalid QR Code version");
@@ -7537,14 +7537,14 @@ function Uh() {
7537
7537
  E[C] = 0;
7538
7538
  var n = A.PriorityQueue.make();
7539
7539
  n.push(C, 0);
7540
- for (var t, c, h, e, w, o, i, u, q; !n.empty(); ) {
7540
+ for (var t, c, h, e, w, o, i, u, f; !n.empty(); ) {
7541
7541
  t = n.pop(), c = t.value, e = t.cost, w = B[c] || {};
7542
7542
  for (h in w)
7543
- w.hasOwnProperty(h) && (o = w[h], i = e + o, u = E[h], q = typeof E[h] == "undefined", (q || u > i) && (E[h] = i, n.push(h, i), I[h] = c));
7543
+ w.hasOwnProperty(h) && (o = w[h], i = e + o, u = E[h], f = typeof E[h] == "undefined", (f || u > i) && (E[h] = i, n.push(h, i), I[h] = c));
7544
7544
  }
7545
7545
  if (typeof Q != "undefined" && typeof E[Q] == "undefined") {
7546
- var J = ["Could not find a path from ", C, " to ", Q, "."].join("");
7547
- throw new Error(J);
7546
+ var v = ["Could not find a path from ", C, " to ", Q, "."].join("");
7547
+ throw new Error(v);
7548
7548
  }
7549
7549
  return I;
7550
7550
  },
@@ -7600,13 +7600,13 @@ var xI;
7600
7600
  function ph() {
7601
7601
  return xI || (xI = 1, function(g) {
7602
7602
  const A = og(), B = jh(), C = Kh(), Q = bh(), I = Sh(), E = XE(), n = eg(), t = Uh();
7603
- function c(J) {
7604
- return unescape(encodeURIComponent(J)).length;
7603
+ function c(v) {
7604
+ return unescape(encodeURIComponent(v)).length;
7605
7605
  }
7606
- function h(J, s, D) {
7606
+ function h(v, s, D) {
7607
7607
  const m = [];
7608
7608
  let M;
7609
- for (; (M = J.exec(D)) !== null; )
7609
+ for (; (M = v.exec(D)) !== null; )
7610
7610
  m.push({
7611
7611
  data: M[0],
7612
7612
  index: M.index,
@@ -7615,41 +7615,41 @@ function ph() {
7615
7615
  });
7616
7616
  return m;
7617
7617
  }
7618
- function e(J) {
7619
- const s = h(E.NUMERIC, A.NUMERIC, J), D = h(E.ALPHANUMERIC, A.ALPHANUMERIC, J);
7618
+ function e(v) {
7619
+ const s = h(E.NUMERIC, A.NUMERIC, v), D = h(E.ALPHANUMERIC, A.ALPHANUMERIC, v);
7620
7620
  let m, M;
7621
- return n.isKanjiModeEnabled() ? (m = h(E.BYTE, A.BYTE, J), M = h(E.KANJI, A.KANJI, J)) : (m = h(E.BYTE_KANJI, A.BYTE, J), M = []), s.concat(D, m, M).sort(function(f, r) {
7622
- return f.index - r.index;
7623
- }).map(function(f) {
7621
+ return n.isKanjiModeEnabled() ? (m = h(E.BYTE, A.BYTE, v), M = h(E.KANJI, A.KANJI, v)) : (m = h(E.BYTE_KANJI, A.BYTE, v), M = []), s.concat(D, m, M).sort(function(q, r) {
7622
+ return q.index - r.index;
7623
+ }).map(function(q) {
7624
7624
  return {
7625
- data: f.data,
7626
- mode: f.mode,
7627
- length: f.length
7625
+ data: q.data,
7626
+ mode: q.mode,
7627
+ length: q.length
7628
7628
  };
7629
7629
  });
7630
7630
  }
7631
- function w(J, s) {
7631
+ function w(v, s) {
7632
7632
  switch (s) {
7633
7633
  case A.NUMERIC:
7634
- return B.getBitsLength(J);
7634
+ return B.getBitsLength(v);
7635
7635
  case A.ALPHANUMERIC:
7636
- return C.getBitsLength(J);
7636
+ return C.getBitsLength(v);
7637
7637
  case A.KANJI:
7638
- return I.getBitsLength(J);
7638
+ return I.getBitsLength(v);
7639
7639
  case A.BYTE:
7640
- return Q.getBitsLength(J);
7640
+ return Q.getBitsLength(v);
7641
7641
  }
7642
7642
  }
7643
- function o(J) {
7644
- return J.reduce(function(s, D) {
7643
+ function o(v) {
7644
+ return v.reduce(function(s, D) {
7645
7645
  const m = s.length - 1 >= 0 ? s[s.length - 1] : null;
7646
7646
  return m && m.mode === D.mode ? (s[s.length - 1].data += D.data, s) : (s.push(D), s);
7647
7647
  }, []);
7648
7648
  }
7649
- function i(J) {
7649
+ function i(v) {
7650
7650
  const s = [];
7651
- for (let D = 0; D < J.length; D++) {
7652
- const m = J[D];
7651
+ for (let D = 0; D < v.length; D++) {
7652
+ const m = v[D];
7653
7653
  switch (m.mode) {
7654
7654
  case A.NUMERIC:
7655
7655
  s.push([
@@ -7678,17 +7678,17 @@ function ph() {
7678
7678
  }
7679
7679
  return s;
7680
7680
  }
7681
- function u(J, s) {
7681
+ function u(v, s) {
7682
7682
  const D = {}, m = { start: {} };
7683
7683
  let M = ["start"];
7684
- for (let P = 0; P < J.length; P++) {
7685
- const f = J[P], r = [];
7686
- for (let v = 0; v < f.length; v++) {
7687
- const R = f[v], l = "" + P + v;
7688
- r.push(l), D[l] = { node: R, lastCount: 0 }, m[l] = {};
7689
- for (let k = 0; k < M.length; k++) {
7690
- const H = M[k];
7691
- D[H] && D[H].node.mode === R.mode ? (m[H][l] = w(D[H].lastCount + R.length, R.mode) - w(D[H].lastCount, R.mode), D[H].lastCount += R.length) : (D[H] && (D[H].lastCount = R.length), m[H][l] = w(R.length, R.mode) + 4 + A.getCharCountIndicator(R.mode, s));
7684
+ for (let P = 0; P < v.length; P++) {
7685
+ const q = v[P], r = [];
7686
+ for (let J = 0; J < q.length; J++) {
7687
+ const k = q[J], l = "" + P + J;
7688
+ r.push(l), D[l] = { node: k, lastCount: 0 }, m[l] = {};
7689
+ for (let R = 0; R < M.length; R++) {
7690
+ const H = M[R];
7691
+ D[H] && D[H].node.mode === k.mode ? (m[H][l] = w(D[H].lastCount + k.length, k.mode) - w(D[H].lastCount, k.mode), D[H].lastCount += k.length) : (D[H] && (D[H].lastCount = k.length), m[H][l] = w(k.length, k.mode) + 4 + A.getCharCountIndicator(k.mode, s));
7692
7692
  }
7693
7693
  }
7694
7694
  M = r;
@@ -7697,31 +7697,31 @@ function ph() {
7697
7697
  m[M[P]].end = 0;
7698
7698
  return { map: m, table: D };
7699
7699
  }
7700
- function q(J, s) {
7700
+ function f(v, s) {
7701
7701
  let D;
7702
- const m = A.getBestModeForData(J);
7702
+ const m = A.getBestModeForData(v);
7703
7703
  if (D = A.from(s, m), D !== A.BYTE && D.bit < m.bit)
7704
- throw new Error('"' + J + '" cannot be encoded with mode ' + A.toString(D) + `.
7704
+ throw new Error('"' + v + '" cannot be encoded with mode ' + A.toString(D) + `.
7705
7705
  Suggested mode is: ` + A.toString(m));
7706
7706
  switch (D === A.KANJI && !n.isKanjiModeEnabled() && (D = A.BYTE), D) {
7707
7707
  case A.NUMERIC:
7708
- return new B(J);
7708
+ return new B(v);
7709
7709
  case A.ALPHANUMERIC:
7710
- return new C(J);
7710
+ return new C(v);
7711
7711
  case A.KANJI:
7712
- return new I(J);
7712
+ return new I(v);
7713
7713
  case A.BYTE:
7714
- return new Q(J);
7714
+ return new Q(v);
7715
7715
  }
7716
7716
  }
7717
7717
  g.fromArray = function(s) {
7718
7718
  return s.reduce(function(D, m) {
7719
- return typeof m == "string" ? D.push(q(m, null)) : m.data && D.push(q(m.data, m.mode)), D;
7719
+ return typeof m == "string" ? D.push(f(m, null)) : m.data && D.push(f(m.data, m.mode)), D;
7720
7720
  }, []);
7721
7721
  }, g.fromString = function(s, D) {
7722
- const m = e(s, n.isKanjiModeEnabled()), M = i(m), P = u(M, D), f = t.find_path(P.map, "start", "end"), r = [];
7723
- for (let v = 1; v < f.length - 1; v++)
7724
- r.push(P.table[f[v]].node);
7722
+ const m = e(s, n.isKanjiModeEnabled()), M = i(m), P = u(M, D), q = t.find_path(P.map, "start", "end"), r = [];
7723
+ for (let J = 1; J < q.length - 1; J++)
7724
+ r.push(P.table[q[J]].node);
7725
7725
  return g.fromArray(o(r));
7726
7726
  }, g.rawSplit = function(s) {
7727
7727
  return g.fromArray(
@@ -7735,136 +7735,136 @@ function Zh() {
7735
7735
  if (zI) return LC;
7736
7736
  zI = 1;
7737
7737
  const g = eg(), A = HB(), B = Yh(), C = xh(), Q = zh(), I = Gh(), E = Xh(), n = zE(), t = Lh(), c = Nh(), h = yh(), e = og(), w = ph();
7738
- function o(P, f) {
7739
- const r = P.size, v = I.getPositions(f);
7740
- for (let R = 0; R < v.length; R++) {
7741
- const l = v[R][0], k = v[R][1];
7738
+ function o(P, q) {
7739
+ const r = P.size, J = I.getPositions(q);
7740
+ for (let k = 0; k < J.length; k++) {
7741
+ const l = J[k][0], R = J[k][1];
7742
7742
  for (let H = -1; H <= 7; H++)
7743
7743
  if (!(l + H <= -1 || r <= l + H))
7744
7744
  for (let G = -1; G <= 7; G++)
7745
- k + G <= -1 || r <= k + G || (H >= 0 && H <= 6 && (G === 0 || G === 6) || G >= 0 && G <= 6 && (H === 0 || H === 6) || H >= 2 && H <= 4 && G >= 2 && G <= 4 ? P.set(l + H, k + G, !0, !0) : P.set(l + H, k + G, !1, !0));
7745
+ R + G <= -1 || r <= R + G || (H >= 0 && H <= 6 && (G === 0 || G === 6) || G >= 0 && G <= 6 && (H === 0 || H === 6) || H >= 2 && H <= 4 && G >= 2 && G <= 4 ? P.set(l + H, R + G, !0, !0) : P.set(l + H, R + G, !1, !0));
7746
7746
  }
7747
7747
  }
7748
7748
  function i(P) {
7749
- const f = P.size;
7750
- for (let r = 8; r < f - 8; r++) {
7751
- const v = r % 2 === 0;
7752
- P.set(r, 6, v, !0), P.set(6, r, v, !0);
7749
+ const q = P.size;
7750
+ for (let r = 8; r < q - 8; r++) {
7751
+ const J = r % 2 === 0;
7752
+ P.set(r, 6, J, !0), P.set(6, r, J, !0);
7753
7753
  }
7754
7754
  }
7755
- function u(P, f) {
7756
- const r = Q.getPositions(f);
7757
- for (let v = 0; v < r.length; v++) {
7758
- const R = r[v][0], l = r[v][1];
7759
- for (let k = -2; k <= 2; k++)
7755
+ function u(P, q) {
7756
+ const r = Q.getPositions(q);
7757
+ for (let J = 0; J < r.length; J++) {
7758
+ const k = r[J][0], l = r[J][1];
7759
+ for (let R = -2; R <= 2; R++)
7760
7760
  for (let H = -2; H <= 2; H++)
7761
- k === -2 || k === 2 || H === -2 || H === 2 || k === 0 && H === 0 ? P.set(R + k, l + H, !0, !0) : P.set(R + k, l + H, !1, !0);
7761
+ R === -2 || R === 2 || H === -2 || H === 2 || R === 0 && H === 0 ? P.set(k + R, l + H, !0, !0) : P.set(k + R, l + H, !1, !0);
7762
7762
  }
7763
7763
  }
7764
- function q(P, f) {
7765
- const r = P.size, v = c.getEncodedBits(f);
7766
- let R, l, k;
7764
+ function f(P, q) {
7765
+ const r = P.size, J = c.getEncodedBits(q);
7766
+ let k, l, R;
7767
7767
  for (let H = 0; H < 18; H++)
7768
- R = Math.floor(H / 3), l = H % 3 + r - 8 - 3, k = (v >> H & 1) === 1, P.set(R, l, k, !0), P.set(l, R, k, !0);
7768
+ k = Math.floor(H / 3), l = H % 3 + r - 8 - 3, R = (J >> H & 1) === 1, P.set(k, l, R, !0), P.set(l, k, R, !0);
7769
7769
  }
7770
- function J(P, f, r) {
7771
- const v = P.size, R = h.getEncodedBits(f, r);
7772
- let l, k;
7770
+ function v(P, q, r) {
7771
+ const J = P.size, k = h.getEncodedBits(q, r);
7772
+ let l, R;
7773
7773
  for (l = 0; l < 15; l++)
7774
- k = (R >> l & 1) === 1, l < 6 ? P.set(l, 8, k, !0) : l < 8 ? P.set(l + 1, 8, k, !0) : P.set(v - 15 + l, 8, k, !0), l < 8 ? P.set(8, v - l - 1, k, !0) : l < 9 ? P.set(8, 15 - l - 1 + 1, k, !0) : P.set(8, 15 - l - 1, k, !0);
7775
- P.set(v - 8, 8, 1, !0);
7774
+ R = (k >> l & 1) === 1, l < 6 ? P.set(l, 8, R, !0) : l < 8 ? P.set(l + 1, 8, R, !0) : P.set(J - 15 + l, 8, R, !0), l < 8 ? P.set(8, J - l - 1, R, !0) : l < 9 ? P.set(8, 15 - l - 1 + 1, R, !0) : P.set(8, 15 - l - 1, R, !0);
7775
+ P.set(J - 8, 8, 1, !0);
7776
7776
  }
7777
- function s(P, f) {
7777
+ function s(P, q) {
7778
7778
  const r = P.size;
7779
- let v = -1, R = r - 1, l = 7, k = 0;
7779
+ let J = -1, k = r - 1, l = 7, R = 0;
7780
7780
  for (let H = r - 1; H > 0; H -= 2)
7781
7781
  for (H === 6 && H--; ; ) {
7782
7782
  for (let G = 0; G < 2; G++)
7783
- if (!P.isReserved(R, H - G)) {
7783
+ if (!P.isReserved(k, H - G)) {
7784
7784
  let y = !1;
7785
- k < f.length && (y = (f[k] >>> l & 1) === 1), P.set(R, H - G, y), l--, l === -1 && (k++, l = 7);
7785
+ R < q.length && (y = (q[R] >>> l & 1) === 1), P.set(k, H - G, y), l--, l === -1 && (R++, l = 7);
7786
7786
  }
7787
- if (R += v, R < 0 || r <= R) {
7788
- R -= v, v = -v;
7787
+ if (k += J, k < 0 || r <= k) {
7788
+ k -= J, J = -J;
7789
7789
  break;
7790
7790
  }
7791
7791
  }
7792
7792
  }
7793
- function D(P, f, r) {
7794
- const v = new B();
7793
+ function D(P, q, r) {
7794
+ const J = new B();
7795
7795
  r.forEach(function(G) {
7796
- v.put(G.mode.bit, 4), v.put(G.getLength(), e.getCharCountIndicator(G.mode, P)), G.write(v);
7796
+ J.put(G.mode.bit, 4), J.put(G.getLength(), e.getCharCountIndicator(G.mode, P)), G.write(J);
7797
7797
  });
7798
- const R = g.getSymbolTotalCodewords(P), l = n.getTotalCodewordsCount(P, f), k = (R - l) * 8;
7799
- for (v.getLengthInBits() + 4 <= k && v.put(0, 4); v.getLengthInBits() % 8 !== 0; )
7800
- v.putBit(0);
7801
- const H = (k - v.getLengthInBits()) / 8;
7798
+ const k = g.getSymbolTotalCodewords(P), l = n.getTotalCodewordsCount(P, q), R = (k - l) * 8;
7799
+ for (J.getLengthInBits() + 4 <= R && J.put(0, 4); J.getLengthInBits() % 8 !== 0; )
7800
+ J.putBit(0);
7801
+ const H = (R - J.getLengthInBits()) / 8;
7802
7802
  for (let G = 0; G < H; G++)
7803
- v.put(G % 2 ? 17 : 236, 8);
7804
- return m(v, P, f);
7803
+ J.put(G % 2 ? 17 : 236, 8);
7804
+ return m(J, P, q);
7805
7805
  }
7806
- function m(P, f, r) {
7807
- const v = g.getSymbolTotalCodewords(f), R = n.getTotalCodewordsCount(f, r), l = v - R, k = n.getBlocksCount(f, r), H = v % k, G = k - H, y = Math.floor(v / k), $ = Math.floor(l / k), aA = $ + 1, hA = y - $, Y = new t(hA);
7806
+ function m(P, q, r) {
7807
+ const J = g.getSymbolTotalCodewords(q), k = n.getTotalCodewordsCount(q, r), l = J - k, R = n.getBlocksCount(q, r), H = J % R, G = R - H, y = Math.floor(J / R), $ = Math.floor(l / R), aA = $ + 1, hA = y - $, Y = new t(hA);
7808
7808
  let T = 0;
7809
- const z = new Array(k), O = new Array(k);
7809
+ const z = new Array(R), O = new Array(R);
7810
7810
  let F = 0;
7811
7811
  const S = new Uint8Array(P.buffer);
7812
- for (let sA = 0; sA < k; sA++) {
7812
+ for (let sA = 0; sA < R; sA++) {
7813
7813
  const fA = sA < G ? $ : aA;
7814
7814
  z[sA] = S.slice(T, T + fA), O[sA] = Y.encode(z[sA]), T += fA, F = Math.max(F, fA);
7815
7815
  }
7816
- const QA = new Uint8Array(v);
7816
+ const QA = new Uint8Array(J);
7817
7817
  let AA = 0, gA, p;
7818
7818
  for (gA = 0; gA < F; gA++)
7819
- for (p = 0; p < k; p++)
7819
+ for (p = 0; p < R; p++)
7820
7820
  gA < z[p].length && (QA[AA++] = z[p][gA]);
7821
7821
  for (gA = 0; gA < hA; gA++)
7822
- for (p = 0; p < k; p++)
7822
+ for (p = 0; p < R; p++)
7823
7823
  QA[AA++] = O[p][gA];
7824
7824
  return QA;
7825
7825
  }
7826
- function M(P, f, r, v) {
7827
- let R;
7826
+ function M(P, q, r, J) {
7827
+ let k;
7828
7828
  if (Array.isArray(P))
7829
- R = w.fromArray(P);
7829
+ k = w.fromArray(P);
7830
7830
  else if (typeof P == "string") {
7831
- let y = f;
7831
+ let y = q;
7832
7832
  if (!y) {
7833
7833
  const $ = w.rawSplit(P);
7834
7834
  y = c.getBestVersionForData($, r);
7835
7835
  }
7836
- R = w.fromString(P, y || 40);
7836
+ k = w.fromString(P, y || 40);
7837
7837
  } else
7838
7838
  throw new Error("Invalid data");
7839
- const l = c.getBestVersionForData(R, r);
7839
+ const l = c.getBestVersionForData(k, r);
7840
7840
  if (!l)
7841
7841
  throw new Error("The amount of data is too big to be stored in a QR Code");
7842
- if (!f)
7843
- f = l;
7844
- else if (f < l)
7842
+ if (!q)
7843
+ q = l;
7844
+ else if (q < l)
7845
7845
  throw new Error(
7846
7846
  `
7847
7847
  The chosen QR Code version cannot contain this amount of data.
7848
7848
  Minimum version required to store current data is: ` + l + `.
7849
7849
  `
7850
7850
  );
7851
- const k = D(f, r, R), H = g.getSymbolSize(f), G = new C(H);
7852
- return o(G, f), i(G), u(G, f), J(G, r, 0), f >= 7 && q(G, f), s(G, k), isNaN(v) && (v = E.getBestMask(
7851
+ const R = D(q, r, k), H = g.getSymbolSize(q), G = new C(H);
7852
+ return o(G, q), i(G), u(G, q), v(G, r, 0), q >= 7 && f(G, q), s(G, R), isNaN(J) && (J = E.getBestMask(
7853
7853
  G,
7854
- J.bind(null, G, r)
7855
- )), E.applyMask(v, G), J(G, r, v), {
7854
+ v.bind(null, G, r)
7855
+ )), E.applyMask(J, G), v(G, r, J), {
7856
7856
  modules: G,
7857
- version: f,
7857
+ version: q,
7858
7858
  errorCorrectionLevel: r,
7859
- maskPattern: v,
7860
- segments: R
7859
+ maskPattern: J,
7860
+ segments: k
7861
7861
  };
7862
7862
  }
7863
- return LC.create = function(f, r) {
7864
- if (typeof f == "undefined" || f === "")
7863
+ return LC.create = function(q, r) {
7864
+ if (typeof q == "undefined" || q === "")
7865
7865
  throw new Error("No input text");
7866
- let v = A.M, R, l;
7867
- return typeof r != "undefined" && (v = A.from(r.errorCorrectionLevel, A.M), R = c.from(r.version), l = E.from(r.maskPattern), r.toSJISFunc && g.setToSJISFunction(r.toSJISFunc)), M(f, R, v, l);
7866
+ let J = A.M, k, l;
7867
+ return typeof r != "undefined" && (J = A.from(r.errorCorrectionLevel, A.M), k = c.from(r.version), l = E.from(r.maskPattern), r.toSJISFunc && g.setToSJISFunction(r.toSJISFunc)), M(q, k, J, l);
7868
7868
  }, LC;
7869
7869
  }
7870
7870
  var IB = {}, EB = {}, GI;
@@ -7913,8 +7913,8 @@ function OE() {
7913
7913
  for (let o = 0; o < c; o++) {
7914
7914
  let i = (w * c + o) * 4, u = I.color.light;
7915
7915
  if (w >= h && o >= h && w < c - h && o < c - h) {
7916
- const q = Math.floor((w - h) / t), J = Math.floor((o - h) / t);
7917
- u = e[n[q * E + J] ? 1 : 0];
7916
+ const f = Math.floor((w - h) / t), v = Math.floor((o - h) / t);
7917
+ u = e[n[f * E + v] ? 1 : 0];
7918
7918
  }
7919
7919
  C[i++] = u.r, C[i++] = u.g, C[i++] = u.b, C[i] = u.a;
7920
7920
  }
@@ -7970,9 +7970,9 @@ function Wh() {
7970
7970
  return n;
7971
7971
  }
7972
7972
  return nB.render = function(I, E, n) {
7973
- const t = g.getOptions(E), c = I.modules.size, h = I.modules.data, e = c + t.margin * 2, w = t.color.light.a ? "<path " + A(t.color.light, "fill") + ' d="M0 0h' + e + "v" + e + 'H0z"/>' : "", o = "<path " + A(t.color.dark, "stroke") + ' d="' + C(h, c, t.margin) + '"/>', i = 'viewBox="0 0 ' + e + " " + e + '"', q = '<svg xmlns="http://www.w3.org/2000/svg" ' + (t.width ? 'width="' + t.width + '" height="' + t.width + '" ' : "") + i + ' shape-rendering="crispEdges">' + w + o + `</svg>
7973
+ const t = g.getOptions(E), c = I.modules.size, h = I.modules.data, e = c + t.margin * 2, w = t.color.light.a ? "<path " + A(t.color.light, "fill") + ' d="M0 0h' + e + "v" + e + 'H0z"/>' : "", o = "<path " + A(t.color.dark, "stroke") + ' d="' + C(h, c, t.margin) + '"/>', i = 'viewBox="0 0 ' + e + " " + e + '"', f = '<svg xmlns="http://www.w3.org/2000/svg" ' + (t.width ? 'width="' + t.width + '" height="' + t.width + '" ' : "") + i + ' shape-rendering="crispEdges">' + w + o + `</svg>
7974
7974
  `;
7975
- return typeof n == "function" && n(null, q), q;
7975
+ return typeof n == "function" && n(null, f), f;
7976
7976
  }, nB;
7977
7977
  }
7978
7978
  var FI;
@@ -8043,15 +8043,15 @@ function Ac({
8043
8043
  const u = (T) => {
8044
8044
  const z = Math.floor(T / 60), O = T % 60;
8045
8045
  return `${z.toString().padStart(2, "0")}:${O.toString().padStart(2, "0")}`;
8046
- }, q = () => {
8046
+ }, f = () => {
8047
8047
  i.innerHTML = `${a(
8048
8048
  "completePaymentIn"
8049
8049
  )} <span class="font-bold">${u(e)}</span>`;
8050
8050
  };
8051
- q();
8052
- const J = () => {
8051
+ f();
8052
+ const v = () => {
8053
8053
  w = setInterval(() => {
8054
- if (e--, q(), e <= 0) {
8054
+ if (e--, f(), e <= 0) {
8055
8055
  clearInterval(w);
8056
8056
  const { container: T, open: z } = Rg({
8057
8057
  message: a("paymentTimeoutMessage"),
@@ -8078,14 +8078,14 @@ function Ac({
8078
8078
  light: "#ffffff"
8079
8079
  // Background color
8080
8080
  }
8081
- }), e = 3600, q(), J();
8081
+ }), e = 3600, f(), v();
8082
8082
  })
8083
8083
  });
8084
8084
  h.appendChild(T), z();
8085
8085
  }
8086
8086
  }, 1e3);
8087
8087
  };
8088
- J(), o.appendChild(i);
8088
+ v(), o.appendChild(i);
8089
8089
  const s = document.createElement("svg");
8090
8090
  s.setAttribute("width", "24"), s.setAttribute("height", "24"), s.setAttribute("viewBox", "0 0 24 24"), s.setAttribute("fill", "none"), s.setAttribute("xmlns", "http://www.w3.org/2000/svg"), s.innerHTML = `
8091
8091
  <path
@@ -8114,22 +8114,22 @@ function Ac({
8114
8114
  M.className = "wgt:text-xl wgt:font-semibold wgt:leading-6 wgt:text-black", M.innerText = a("orderInfo"), m.appendChild(M);
8115
8115
  const P = document.createElement("div");
8116
8116
  P.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
8117
- const f = document.createElement("h4");
8118
- f.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", f.innerText = a("provider");
8117
+ const q = document.createElement("h4");
8118
+ q.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", q.innerText = a("provider");
8119
8119
  const r = document.createElement("img");
8120
- g && g.logoUrl && (r.src = g.logoUrl, r.alt = g.name, r.className = "wgt:h-6 wgt:object-contain"), P.appendChild(f), P.appendChild(r), m.appendChild(P);
8121
- const v = document.createElement("div");
8122
- v.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
8123
- const R = document.createElement("h4");
8124
- R.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", R.innerText = a("subscriptionPackage");
8120
+ g && g.logoUrl && (r.src = g.logoUrl, r.alt = g.name, r.className = "wgt:h-6 wgt:object-contain"), P.appendChild(q), P.appendChild(r), m.appendChild(P);
8121
+ const J = document.createElement("div");
8122
+ J.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
8123
+ const k = document.createElement("h4");
8124
+ k.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", k.innerText = a("subscriptionPackage");
8125
8125
  const l = document.createElement("span");
8126
- l.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", l.innerText = A ? `${String(A == null ? void 0 : A.limit)} ${a("unitsPerMonth")}` : "", v.appendChild(R), v.appendChild(l), m.appendChild(v);
8127
- const k = document.createElement("div");
8128
- k.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
8126
+ l.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", l.innerText = A ? `${String(A == null ? void 0 : A.limit)} ${a("unitsPerMonth")}` : "", J.appendChild(k), J.appendChild(l), m.appendChild(J);
8127
+ const R = document.createElement("div");
8128
+ R.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
8129
8129
  const H = document.createElement("h4");
8130
8130
  H.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", H.innerText = a("digitalSignaturePackage");
8131
8131
  const G = document.createElement("span");
8132
- G.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", G.innerText = B ? `${String(B == null ? void 0 : B.name.split("-")[1])}` : "", k.appendChild(H), k.appendChild(G), m.appendChild(k);
8132
+ G.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", G.innerText = B ? `${String(B == null ? void 0 : B.name.split("-")[1])}` : "", R.appendChild(H), R.appendChild(G), m.appendChild(R);
8133
8133
  const y = document.createElement("hr");
8134
8134
  m.appendChild(y);
8135
8135
  const $ = document.createElement("div");
@@ -8183,52 +8183,52 @@ function gc(E) {
8183
8183
  orderInfoProps: Q,
8184
8184
  theme: I
8185
8185
  }) {
8186
- let n = null, t = "";
8187
- const c = document.createElement("div");
8188
- c.className = "wgt:flex wgt:flex-col wgt:gap-6 wgt:relative";
8189
- const { container: h, open: e, close: w } = YE();
8190
- c.appendChild(h);
8191
- const o = _g(), i = document.createElement("div");
8192
- i.className = "wgt:w-full wgt:flex wgt:items-start wgt:gap-6";
8193
- const u = document.createElement("div");
8194
- u.className = "wgt:flex-1";
8195
- const q = a("paymentInstructions"), J = Array.isArray(q) ? q : [q], { container: s, update: D } = kh(zA(BA({
8186
+ let n = null, t = "", c = null;
8187
+ const h = document.createElement("div");
8188
+ h.className = "wgt:flex wgt:flex-col wgt:gap-6 wgt:relative";
8189
+ const { container: e, open: w, close: o } = YE();
8190
+ h.appendChild(e);
8191
+ const i = _g(), u = document.createElement("div");
8192
+ u.className = "wgt:w-full wgt:flex wgt:items-start wgt:gap-6";
8193
+ const f = document.createElement("div");
8194
+ f.className = "wgt:flex-1";
8195
+ const v = a("paymentInstructions"), s = Array.isArray(v) ? v : [v], { container: D, update: m } = kh(zA(BA({
8196
8196
  qrSrc: "",
8197
8197
  // Empty initially
8198
8198
  accountName: "",
8199
8199
  accountNumber: "",
8200
8200
  bankName: ""
8201
8201
  }, C), {
8202
- instructions: J
8202
+ instructions: s
8203
8203
  }));
8204
- u.appendChild(s), i.appendChild(u);
8205
- const { container: m, cleanup: M } = Ac(zA(BA({}, Q), {
8204
+ f.appendChild(D), u.appendChild(f);
8205
+ const { container: M, cleanup: P } = Ac(zA(BA({}, Q), {
8206
8206
  qrData: null,
8207
8207
  qrSrc: "",
8208
8208
  theme: I,
8209
8209
  onResetToStep1: () => {
8210
- M && M(), Q != null && Q.onResetToStep1 && Q.onResetToStep1();
8210
+ P && P(), Q != null && Q.onResetToStep1 && Q.onResetToStep1(), clearInterval(c);
8211
8211
  }
8212
8212
  }));
8213
- i.appendChild(m), c.appendChild(i);
8214
- const P = document.createElement("div");
8215
- P.className = "wgt:flex wgt:items-center wgt:justify-between wgt:gap-2";
8216
- const f = rg({
8213
+ u.appendChild(M), h.appendChild(u);
8214
+ const q = document.createElement("div");
8215
+ q.className = "wgt:flex wgt:items-center wgt:justify-between wgt:gap-2";
8216
+ const r = rg({
8217
8217
  type: "button",
8218
8218
  title: a("back"),
8219
8219
  className: "wgt:bg-transparent wgt:!text-primary wgt:hover:bg-transparent wgt:underline",
8220
8220
  handleClick: A
8221
8221
  });
8222
- P.appendChild(f), c.appendChild(P);
8223
- function r() {
8222
+ q.appendChild(r), h.appendChild(q);
8223
+ function J() {
8224
8224
  return L(this, null, function* () {
8225
- e();
8225
+ w();
8226
8226
  try {
8227
8227
  n = yield xE({
8228
8228
  token: Q == null ? void 0 : Q.token,
8229
8229
  orderId: Q == null ? void 0 : Q.orderId,
8230
8230
  amount: Q == null ? void 0 : Q.totalAmountText,
8231
- baseURL: I === "ocb" ? o.posOcbApiUrl : I === "bvb" ? o.posBvbApiUrl : ""
8231
+ baseURL: I === "ocb" ? i.posOcbApiUrl : I === "bvb" ? i.posBvbApiUrl : ""
8232
8232
  }), t = yield FE.toDataURL(n.qr_string, {
8233
8233
  errorCorrectionLevel: "H",
8234
8234
  margin: 1,
@@ -8239,49 +8239,45 @@ function gc(E) {
8239
8239
  light: "#ffffff"
8240
8240
  // Background color
8241
8241
  }
8242
- }), D && D({
8242
+ }), m && m({
8243
8243
  qrSrc: t,
8244
8244
  accountName: (n == null ? void 0 : n.merchant_name) || "",
8245
8245
  accountNumber: (n == null ? void 0 : n.va_account_no) || "",
8246
8246
  bankName: (n == null ? void 0 : n.bank_code) || ""
8247
8247
  });
8248
- } catch (v) {
8249
- console.error("Error fetching QR payment data:", v), iB(a("errorQRGeneration", "Không thể tạo mã QR thanh toán. Vui lòng thử lại."), {
8248
+ } catch (k) {
8249
+ console.error("Error fetching QR payment data:", k), iB(a("errorQRGeneration", "Không thể tạo mã QR thanh toán. Vui lòng thử lại."), {
8250
8250
  onClose: () => {
8251
8251
  A();
8252
8252
  }
8253
8253
  });
8254
8254
  } finally {
8255
- w();
8255
+ o();
8256
8256
  }
8257
8257
  });
8258
8258
  }
8259
- if (yield r(), n) {
8260
- const v = setInterval(() => L(null, null, function* () {
8261
- try {
8262
- const R = yield dh(Q == null ? void 0 : Q.orderId);
8263
- if (R.paymentStatus === "pending") return;
8264
- clearInterval(v), M && M();
8265
- const l = R.paymentStatus === "paid" ? a("paymentSuccess") : a("paymentFailed"), { container: k, open: H } = Rg({
8266
- message: l,
8267
- okLabel: "OK",
8268
- onClose: () => {
8269
- g();
8270
- },
8271
- isSuccess: R.paymentStatus === "paid"
8272
- });
8273
- c.appendChild(k), H();
8274
- } catch (R) {
8275
- clearInterval(v), w(), M && M(), console.error("Error fetching order status:", R), iB(a("errorOrderStatus", "Không thể kiểm tra trạng thái đơn hàng. Vui lòng thử lại."), {
8276
- onClose: () => {
8277
- A();
8278
- }
8279
- });
8280
- }
8281
- }), 1e4);
8282
- return { container: c, cleanup: M };
8283
- }
8284
- return { container: c };
8259
+ return yield J(), n && (c = setInterval(() => L(null, null, function* () {
8260
+ try {
8261
+ const k = yield dh(Q == null ? void 0 : Q.orderId);
8262
+ if (k.paymentStatus === "pending") return;
8263
+ clearInterval(c), P && P();
8264
+ const l = k.paymentStatus === "paid" ? a("paymentSuccess") : a("paymentFailed"), { container: R, open: H } = Rg({
8265
+ message: l,
8266
+ okLabel: "OK",
8267
+ onClose: () => {
8268
+ g();
8269
+ },
8270
+ isSuccess: k.paymentStatus === "paid"
8271
+ });
8272
+ h.appendChild(R), H();
8273
+ } catch (k) {
8274
+ clearInterval(c), o(), P && P(), console.error("Error fetching order status:", k), iB(a("errorOrderStatus", "Không thể kiểm tra trạng thái đơn hàng. Vui lòng thử lại."), {
8275
+ onClose: () => {
8276
+ A();
8277
+ }
8278
+ });
8279
+ }
8280
+ }), 1e4)), { container: h };
8285
8281
  });
8286
8282
  }
8287
8283
  const Cc = { email: "info@minvoice.vn", hotline: "0901 80 16 18", link: "https://minvoice.vn", name: "fpt", onboarding: !0, sso: !0 }, yg = {
@@ -8320,10 +8316,10 @@ function Bc({
8320
8316
  i.className = "wgt:flex wgt:flex-col wgt:gap-2", w.appendChild(i);
8321
8317
  const u = document.createElement("p");
8322
8318
  u.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", u.innerText = a("notice2"), i.appendChild(u);
8323
- const q = document.createElement("div");
8324
- q.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-2 wgt:rounded-lg wgt:bg-weak-50 wgt:px-4 wgt:py-3", i.appendChild(q);
8325
- const J = document.createElement("div");
8326
- J.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", q.appendChild(J);
8319
+ const f = document.createElement("div");
8320
+ f.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-2 wgt:rounded-lg wgt:bg-weak-50 wgt:px-4 wgt:py-3", i.appendChild(f);
8321
+ const v = document.createElement("div");
8322
+ v.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", f.appendChild(v);
8327
8323
  const s = document.createElement("div");
8328
8324
  s.innerHTML = `
8329
8325
  <svg
@@ -8343,11 +8339,11 @@ function Bc({
8343
8339
  stroke-linejoin="round"
8344
8340
  />
8345
8341
  </svg>
8346
- `, J.appendChild(s);
8342
+ `, v.appendChild(s);
8347
8343
  const D = document.createElement("span");
8348
- D.innerHTML = `${a("hotlineDomestic")} <b>${yg[I].hotline}</b> ${a("hotlineDesc")} `, J.appendChild(D);
8344
+ D.innerHTML = `${a("hotlineDomestic")} <b>${yg[I].hotline}</b> ${a("hotlineDesc")} `, v.appendChild(D);
8349
8345
  const m = document.createElement("div");
8350
- m.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", q.appendChild(m);
8346
+ m.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", f.appendChild(m);
8351
8347
  const M = document.createElement("div");
8352
8348
  M.innerHTML = `
8353
8349
  <svg
@@ -8368,8 +8364,8 @@ function Bc({
8368
8364
  `, m.appendChild(M);
8369
8365
  const P = document.createElement("span");
8370
8366
  P.innerHTML = `${a("email")}: <b>${yg[I].email}</b>`, m.appendChild(P);
8371
- const f = document.createElement("div");
8372
- f.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", q.appendChild(f);
8367
+ const q = document.createElement("div");
8368
+ q.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", f.appendChild(q);
8373
8369
  const r = document.createElement("div");
8374
8370
  r.innerHTML = `
8375
8371
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -8382,17 +8378,17 @@ function Bc({
8382
8378
  </clipPath>
8383
8379
  </defs>
8384
8380
  </svg>
8385
- `, f.appendChild(r), f.appendChild(document.createTextNode(a("website") + ": "));
8386
- const v = document.createElement("a");
8387
- v.className = "wgt:text-strong-950 wgt:hover:underline wgt:cursor-pointer", v.innerHTML = `<b>${yg[I].link}</b>`, v.href = yg[I].link, v.target = "_blank", f.appendChild(v);
8388
- const R = document.createElement("div");
8389
- R.className = "wgt:flex wgt:items-center wgt:gap-4", n.appendChild(R);
8381
+ `, q.appendChild(r), q.appendChild(document.createTextNode(a("website") + ": "));
8382
+ const J = document.createElement("a");
8383
+ J.className = "wgt:text-strong-950 wgt:hover:underline wgt:cursor-pointer", J.innerHTML = `<b>${yg[I].link}</b>`, J.href = yg[I].link, J.target = "_blank", q.appendChild(J);
8384
+ const k = document.createElement("div");
8385
+ k.className = "wgt:flex wgt:items-center wgt:gap-4", n.appendChild(k);
8390
8386
  const l = document.createElement("div");
8391
- l.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:shrink-0 wgt:items-center wgt:justify-center wgt:rounded-full wgt:bg-primary wgt:text-xs wgt:font-semibold wgt:text-white", l.innerText = "3", R.appendChild(l);
8392
- const k = document.createElement("p");
8393
- k.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", k.appendChild(document.createTextNode(a("notice3.1") + " "));
8387
+ l.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:shrink-0 wgt:items-center wgt:justify-center wgt:rounded-full wgt:bg-primary wgt:text-xs wgt:font-semibold wgt:text-white", l.innerText = "3", k.appendChild(l);
8388
+ const R = document.createElement("p");
8389
+ R.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", R.appendChild(document.createTextNode(a("notice3.1") + " "));
8394
8390
  const H = document.createElement("a");
8395
- H.className = "wgt:text-primary wgt:font-semibold wgt:hover:underline wgt:cursor-pointer", H.textContent = a("settings") + " ", H.href = Q, H.target = "_blank", k.appendChild(H), k.appendChild(document.createTextNode(a("notice3.2") + " ")), R.appendChild(k);
8391
+ H.className = "wgt:text-primary wgt:font-semibold wgt:hover:underline wgt:cursor-pointer", H.textContent = a("settings") + " ", H.href = Q, H.target = "_blank", R.appendChild(H), R.appendChild(document.createTextNode(a("notice3.2") + " ")), k.appendChild(R);
8396
8392
  const G = document.createElement("div");
8397
8393
  G.className = "wgt:flex wgt:items-center wgt:justify-center wgt:gap-2 wgt:py-3 wgt:px-5 wgt:bg-primary/15 wgt:rounded-[10px] wgt:w-fit wgt:mx-auto", n.appendChild(G);
8398
8394
  const y = document.createElement("div");
@@ -8561,7 +8557,7 @@ function xc(g, A, B, C, Q) {
8561
8557
  idCard: null,
8562
8558
  idCardBack: null,
8563
8559
  packages: []
8564
- }, u = null, q = null, J = null, s = null, D = 0, m = null;
8560
+ }, u = null, f = null, v = null, s = null, D = 0, m = null;
8565
8561
  function M() {
8566
8562
  o = E[0], i = {
8567
8563
  eInvoiceRegistration: {
@@ -8600,12 +8596,12 @@ function xc(g, A, B, C, Q) {
8600
8596
  idCard: null,
8601
8597
  idCardBack: null,
8602
8598
  packages: []
8603
- }, u = null, q = null, J = null, s = null, D = 0;
8599
+ }, u = null, f = null, v = null, s = null, D = 0;
8604
8600
  }
8605
8601
  function P() {
8606
8602
  M(), w = 1, h(w), r(w);
8607
8603
  }
8608
- function f() {
8604
+ function q() {
8609
8605
  return L(this, null, function* () {
8610
8606
  t.updateTitle && t.updateTitle(), t.updateSteps && t.updateSteps(n()), yield r(w);
8611
8607
  });
@@ -8613,7 +8609,7 @@ function xc(g, A, B, C, Q) {
8613
8609
  function r(l) {
8614
8610
  return L(this, null, function* () {
8615
8611
  if (l === 1) {
8616
- const { container: k } = yield qh({
8612
+ const { container: R } = yield qh({
8617
8613
  providerProps: {
8618
8614
  providers: E,
8619
8615
  selectedRoute: o.route,
@@ -8635,9 +8631,9 @@ function xc(g, A, B, C, Q) {
8635
8631
  }
8636
8632
  }
8637
8633
  });
8638
- e(k);
8634
+ e(R);
8639
8635
  } else if (l === 2) {
8640
- const { container: k } = yield Hh({
8636
+ const { container: R } = yield Hh({
8641
8637
  onNext: () => L(null, null, function* () {
8642
8638
  w = 3, h(w), r(w);
8643
8639
  }),
@@ -8645,10 +8641,10 @@ function xc(g, A, B, C, Q) {
8645
8641
  w = 1, h(w), r(w);
8646
8642
  },
8647
8643
  setSelectedInitPackage: (H) => {
8648
- q = H;
8644
+ f = H;
8649
8645
  },
8650
8646
  setSelectedInvoiceOtp: (H) => {
8651
- J = H;
8647
+ v = H;
8652
8648
  },
8653
8649
  setSelectedSignatureOtp: (H) => {
8654
8650
  s = H;
@@ -8659,16 +8655,16 @@ function xc(g, A, B, C, Q) {
8659
8655
  setTotalAmount: (H) => {
8660
8656
  D = H;
8661
8657
  },
8662
- selectedInitPackage: q,
8663
- selectedInvoiceOtp: J,
8658
+ selectedInitPackage: f,
8659
+ selectedInvoiceOtp: v,
8664
8660
  selectedSignatureOtp: s,
8665
8661
  theme: Q,
8666
8662
  selectedProvider: o,
8667
8663
  registrationData: i
8668
8664
  });
8669
- e(k);
8665
+ e(R);
8670
8666
  } else if (l === 3) {
8671
- const { container: k } = yield gc({
8667
+ const { container: R } = yield gc({
8672
8668
  onNext: () => {
8673
8669
  w = 4, h(w), r(w);
8674
8670
  },
@@ -8686,7 +8682,7 @@ function xc(g, A, B, C, Q) {
8686
8682
  registrationData: i,
8687
8683
  orderId: u || "",
8688
8684
  selectedProvider: o || { name: "", logo: "" },
8689
- selectedInvoiceOtp: J || { unitsPerMonth: 0 },
8685
+ selectedInvoiceOtp: v || { unitsPerMonth: 0 },
8690
8686
  selectedSignatureOtp: s || { durationYears: 0 },
8691
8687
  totalAmountText: D,
8692
8688
  onCancel: () => {
@@ -8695,9 +8691,9 @@ function xc(g, A, B, C, Q) {
8695
8691
  onResetToStep1: P
8696
8692
  }
8697
8693
  });
8698
- e(k);
8694
+ e(R);
8699
8695
  } else if (l === 4) {
8700
- const { container: k } = Bc({
8696
+ const { container: R } = Bc({
8701
8697
  orderId: u || "",
8702
8698
  onPrev: () => {
8703
8699
  w = 3, h(w), r(w);
@@ -8708,20 +8704,20 @@ function xc(g, A, B, C, Q) {
8708
8704
  settingUrl: (C == null ? void 0 : C.settingUrl) || "",
8709
8705
  provider: o.route
8710
8706
  });
8711
- e(k);
8707
+ e(R);
8712
8708
  }
8713
8709
  });
8714
8710
  }
8715
8711
  yield r(w);
8716
- const v = {
8717
- rerender: f
8712
+ const J = {
8713
+ rerender: q
8718
8714
  // Use the new function that updates both layout and content
8719
8715
  };
8720
- NI(v);
8721
- function R() {
8722
- yI(v), I(), A && A();
8716
+ NI(J);
8717
+ function k() {
8718
+ yI(J), I(), A && A();
8723
8719
  }
8724
- return { destroy: R };
8720
+ return { destroy: k };
8725
8721
  });
8726
8722
  }
8727
8723
  function zc(g, A, B) {