@invoice-sdk/widget 1.115.6 → 1.115.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.
@@ -19,7 +19,7 @@ var mh = (t, n) => {
19
19
  n.indexOf(c) < 0 && oh.call(t, c) && (e[c] = t[c]);
20
20
  return e;
21
21
  };
22
- var sn = (t, n, e) => new Promise((c, h) => {
22
+ var ln = (t, n, e) => new Promise((c, h) => {
23
23
  var a = (A) => {
24
24
  try {
25
25
  o(e.next(A));
@@ -35,8 +35,8 @@ var sn = (t, n, e) => new Promise((c, h) => {
35
35
  }, o = (A) => A.done ? c(A.value) : Promise.resolve(A.value).then(a, u);
36
36
  o((e = e.apply(t, n)).next());
37
37
  });
38
- import { t as g, g as jh, a as Uh, b as Et, s as Ut, c as It, d as rc, e as Tc, f as xc, m as dc, h as wc, i as pc, v as Cc } from "./index-BInljDkt.js";
39
- import { c as yt, a as _h, g as _t, b as fc, f as Sn, d as Xc, e as Bc, h as Nc, i as Ec, j as Hc, k as yc, l as Pc, m as kc } from "./invoice-QZ5cgmMz.js";
38
+ import { t as g, g as jh, a as Uh, b as Et, s as Ut, c as It, d as rc, e as Tc, f as xc, m as dc, h as wc, i as pc, v as Cc } from "./index-DUTxhky5.js";
39
+ import { c as yt, a as _h, g as _t, b as fc, f as Sn, d as Xc, e as Bc, h as Nc, i as Ec, j as Hc, k as yc, l as Pc, m as kc } from "./invoice-DUiIiOd_.js";
40
40
  import { g as $h } from "./_commonjsHelpers-bAxELxBV.js";
41
41
  function qh({ steps: t = [], currentStep: n = 1 } = {}) {
42
42
  const e = document.createElement("div");
@@ -1381,9 +1381,9 @@ function Dc() {
1381
1381
  for (var U = m === 0 ? 11 : m - 1, cn = m === 11 ? 0 : m + 1, Y = m === 0 ? T - 1 : T, rn = m === 11 ? T + 1 : T, Z = k(Y, U), An = M + D, Tn = An; Tn > 7; )
1382
1382
  Tn -= 7;
1383
1383
  An += 7 - Tn;
1384
- for (var Mn = !1, qn = 0, mt = 0; qn < An; qn++) {
1385
- var Xn = new Date(T, m, 1 + (qn - D)), qt = x(this._d) ? w(Xn, this._d) : !1, zn = w(Xn, v), Un = E.events.indexOf(Xn.toDateString()) !== -1, nt = qn < D || qn >= M + D, Qn = 1 + (qn - D), Rn = m, _n = T, On = E.startRange && w(E.startRange, Xn), tt = E.endRange && w(E.endRange, Xn), dt = E.startRange && E.endRange && E.startRange < Xn && Xn < E.endRange, st = E.minDate && Xn < E.minDate || E.maxDate && Xn > E.maxDate || E.disableWeekends && d(Xn) || E.disableDayFn && E.disableDayFn(Xn);
1386
- nt && (qn < D ? (Qn = Z + Qn, Rn = U, _n = Y) : (Qn = Qn - M, Rn = cn, _n = rn));
1384
+ for (var Mn = !1, sn = 0, mt = 0; sn < An; sn++) {
1385
+ var Xn = new Date(T, m, 1 + (sn - D)), qt = x(this._d) ? w(Xn, this._d) : !1, zn = w(Xn, v), Un = E.events.indexOf(Xn.toDateString()) !== -1, nt = sn < D || sn >= M + D, Qn = 1 + (sn - D), Rn = m, _n = T, On = E.startRange && w(E.startRange, Xn), tt = E.endRange && w(E.endRange, Xn), dt = E.startRange && E.endRange && E.startRange < Xn && Xn < E.endRange, st = E.minDate && Xn < E.minDate || E.maxDate && Xn > E.maxDate || E.disableWeekends && d(Xn) || E.disableDayFn && E.disableDayFn(Xn);
1386
+ nt && (sn < D ? (Qn = Z + Qn, Rn = U, _n = Y) : (Qn = Qn - M, Rn = cn, _n = rn));
1387
1387
  var ht = {
1388
1388
  day: Qn,
1389
1389
  month: Rn,
@@ -1399,7 +1399,7 @@ function Dc() {
1399
1399
  showDaysInNextAndPreviousMonths: E.showDaysInNextAndPreviousMonths,
1400
1400
  enableSelectionDaysInNextAndPreviousMonths: E.enableSelectionDaysInNextAndPreviousMonths
1401
1401
  };
1402
- E.pickWholeWeek && qt && (Mn = !0), O.push(y(ht)), ++mt === 7 && (E.showWeekNumber && O.unshift(V(qn - D, m, T, E.firstWeekOfYearMinDays)), j.push(L(O, E.isRTL, E.pickWholeWeek, Mn)), O = [], mt = 0, Mn = !1);
1402
+ E.pickWholeWeek && qt && (Mn = !0), O.push(y(ht)), ++mt === 7 && (E.showWeekNumber && O.unshift(V(sn - D, m, T, E.firstWeekOfYearMinDays)), j.push(L(O, E.isRTL, E.pickWholeWeek, Mn)), O = [], mt = 0, Mn = !1);
1403
1403
  }
1404
1404
  return G(E, j, P);
1405
1405
  },
@@ -2042,7 +2042,7 @@ function xh(t) {
2042
2042
  return e > 1 ? !1 : e === 1 ? /^\d{10}-\d{3}$/.test(n) : /^(\d{10}|\d{12}|\d{13})$/.test(n);
2043
2043
  }
2044
2044
  function g1(l) {
2045
- return sn(this, arguments, function* ({
2045
+ return ln(this, arguments, function* ({
2046
2046
  onSubmit: t,
2047
2047
  registrationData: n,
2048
2048
  theme: e = "ocb",
@@ -2074,9 +2074,9 @@ function g1(l) {
2074
2074
  S.className = "wgt:text-sm wgt:leading-relaxed", S.style.color = "#FF8447", S.innerHTML = g(
2075
2075
  "register_note",
2076
2076
  "Mã số thuế này đã được đăng ký trên M-Invoice, vì vậy bạn không thể tạo mới với thông tin này."
2077
- ), x.appendChild(S), qn && qn.firstChild && (qn.insertBefore(
2077
+ ), x.appendChild(S), sn && sn.firstChild && (sn.insertBefore(
2078
2078
  x,
2079
- qn.firstChild
2079
+ sn.firstChild
2080
2080
  ), setTimeout(() => {
2081
2081
  x.style.opacity = "1";
2082
2082
  }, 50));
@@ -2118,16 +2118,16 @@ function g1(l) {
2118
2118
  onInput: (J) => {
2119
2119
  const S = J.target.value, hn = S.replace(/[^\d-]/g, "");
2120
2120
  hn !== S && (J.target.value = hn);
2121
- const on = hn.trim();
2122
- if (n._userHasEditedTaxCode = !0, I(), on.length === 0) {
2123
- p.setError(g("errorRequired", "Mã số thuế bắt buộc")), gn();
2121
+ const mn = hn.trim();
2122
+ if (n._userHasEditedTaxCode = !0, I(), mn.length === 0) {
2123
+ p.setError(g("errorRequired", "Mã số thuế bắt buộc")), on();
2124
2124
  return;
2125
2125
  }
2126
- if (!xh(on)) {
2127
- p.setError(g("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), gn();
2126
+ if (!xh(mn)) {
2127
+ p.setError(g("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), on();
2128
2128
  return;
2129
2129
  }
2130
- p.setError(null), Mn(on), gn();
2130
+ p.setError(null), Mn(mn), on();
2131
2131
  }
2132
2132
  }), H = Kn({
2133
2133
  name: "companyName",
@@ -2165,7 +2165,7 @@ function g1(l) {
2165
2165
  horizontal: !0,
2166
2166
  searchable: !0,
2167
2167
  onChange: (J) => {
2168
- J.target.id && a(J.target.id), gn();
2168
+ J.target.id && a(J.target.id), on();
2169
2169
  }
2170
2170
  }), h) {
2171
2171
  const J = rn.find(
@@ -2182,7 +2182,7 @@ function g1(l) {
2182
2182
  required: !1,
2183
2183
  file: (n == null ? void 0 : n.logo) || null,
2184
2184
  onFileChange: (J) => {
2185
- gn();
2185
+ on();
2186
2186
  },
2187
2187
  error: null
2188
2188
  }), L = Kn({
@@ -2215,14 +2215,14 @@ function g1(l) {
2215
2215
  field: f.inputEl,
2216
2216
  format: "DD/MM/YYYY",
2217
2217
  toString(J) {
2218
- const S = String(J.getMonth() + 1).padStart(2, "0"), hn = String(J.getDate()).padStart(2, "0"), on = J.getFullYear();
2219
- return `${hn}/${S}/${on}`;
2218
+ const S = String(J.getMonth() + 1).padStart(2, "0"), hn = String(J.getDate()).padStart(2, "0"), mn = J.getFullYear();
2219
+ return `${hn}/${S}/${mn}`;
2220
2220
  },
2221
2221
  onSelect: (J) => {
2222
- f.setError(null), gn();
2222
+ f.setError(null), on();
2223
2223
  },
2224
2224
  onClose: () => {
2225
- f.inputEl.value ? f.setError(null) : f.setError(g("errorRequired")), gn();
2225
+ f.inputEl.value ? f.setError(null) : f.setError(g("errorRequired")), on();
2226
2226
  },
2227
2227
  maxDate: /* @__PURE__ */ new Date(),
2228
2228
  showMonthDropdown: !0,
@@ -2280,12 +2280,12 @@ function g1(l) {
2280
2280
  value: ((J0 = (M0 = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : M0.legalRepresentative) == null ? void 0 : J0.phone) || "",
2281
2281
  onInput: (J) => {
2282
2282
  let S = J.target.value;
2283
- const hn = S.replace(/[^\d+().\-\s]/g, ""), on = hn.replace(/[\s.\-()]/g, "");
2284
- if (hn !== S && (J.target.value = hn, S = hn), on.trim() === "") {
2283
+ const hn = S.replace(/[^\d+().\-\s]/g, ""), mn = hn.replace(/[\s.\-()]/g, "");
2284
+ if (hn !== S && (J.target.value = hn, S = hn), mn.trim() === "") {
2285
2285
  z.setError(g("errorRequired", "Số điện thoại bắt buộc"));
2286
2286
  return;
2287
2287
  }
2288
- /^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(on) ? z.setError(null) : z.setError(
2288
+ /^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(mn) ? z.setError(null) : z.setError(
2289
2289
  g("errorInvalidPhone", "Số điện thoại không hợp lệ.")
2290
2290
  );
2291
2291
  }
@@ -2325,7 +2325,7 @@ function g1(l) {
2325
2325
  required: !0,
2326
2326
  file: (n == null ? void 0 : n.license) || null,
2327
2327
  onFileChange: (J) => {
2328
- gn();
2328
+ on();
2329
2329
  },
2330
2330
  error: null,
2331
2331
  accept: "image/png, image/jpeg, image/jpg, .pdf"
@@ -2388,14 +2388,14 @@ function g1(l) {
2388
2388
  value: ((Z0 = (R0 = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : R0.contactPerson) == null ? void 0 : Z0.phone) || "",
2389
2389
  onInput: (J) => {
2390
2390
  let S = J.target.value;
2391
- const hn = S.replace(/[^\d+().\-\s]/g, ""), on = hn.replace(/[\s.\-()]/g, "");
2392
- if (hn !== S && (J.target.value = hn, S = hn), on.trim() === "") {
2391
+ const hn = S.replace(/[^\d+().\-\s]/g, ""), mn = hn.replace(/[\s.\-()]/g, "");
2392
+ if (hn !== S && (J.target.value = hn, S = hn), mn.trim() === "") {
2393
2393
  Q.setError(
2394
2394
  g("errorRequired", "Số điện thoại bắt buộc")
2395
2395
  );
2396
2396
  return;
2397
2397
  }
2398
- /^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(on) ? Q.setError(null) : Q.setError(
2398
+ /^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(mn) ? Q.setError(null) : Q.setError(
2399
2399
  g("errorInvalidPhone", "Số điện thoại Việt Nam không hợp lệ.")
2400
2400
  );
2401
2401
  }
@@ -2437,10 +2437,10 @@ function g1(l) {
2437
2437
  isRenewal: i,
2438
2438
  initialValue: r || (($0 = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : $0.invoiceSymbol) || "1C26TYY",
2439
2439
  onChange: (J) => {
2440
- An.inputEl.value = J, gn();
2440
+ An.inputEl.value = J, on();
2441
2441
  }
2442
2442
  }), E = document.createElement("input"), E.type = "checkbox", E.name = "hasUsedEInvoiceCB", E.className = "wgt:cursor-pointer", E.checked = (nh = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : nh.hasUsedEInvoice, E.addEventListener("change", (J) => {
2443
- J.target.checked ? (En.appendChild(tn), En.appendChild(F)) : (v.checked = !1, D.inputEl.value = "", D.setError(null), M && (M.inputEl.value = "", M.setError(null), F.contains(M.container) && F.removeChild(M.container)), En.removeChild(tn), En.removeChild(F));
2443
+ J.target.checked ? (Nn.appendChild(tn), Nn.appendChild(F)) : (v.checked = !1, D.inputEl.value = "", D.setError(null), M && (M.inputEl.value = "", M.setError(null), F.contains(M.container) && F.removeChild(M.container)), Nn.removeChild(tn), Nn.removeChild(F));
2444
2444
  }), v = document.createElement("input"), v.type = "checkbox", v.name = "hasUsedEInvoiceBeforeCB", v.className = "wgt:cursor-pointer", v.checked = (th = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : th.isUsedEInvoiceBefore, v.addEventListener("change", (J) => {
2445
2445
  J.target.checked ? F.appendChild(M.container) : (M.inputEl.value = "", M.setError(null), F.contains(M.container) && F.removeChild(M.container));
2446
2446
  }), M = Kn({
@@ -2494,12 +2494,12 @@ function g1(l) {
2494
2494
  });
2495
2495
  let Tn = 0;
2496
2496
  function Mn(J) {
2497
- return sn(this, null, function* () {
2497
+ return ln(this, null, function* () {
2498
2498
  const S = ++Tn;
2499
2499
  p.setError(null);
2500
2500
  try {
2501
2501
  const hn = yield fc(J.trim());
2502
- let on = {
2502
+ let mn = {
2503
2503
  name: "",
2504
2504
  address: "",
2505
2505
  taxAuthority: "",
@@ -2516,10 +2516,10 @@ function g1(l) {
2516
2516
  Ln.value,
2517
2517
  Ln.label,
2518
2518
  Ln.id
2519
- ), on.taxAuthority = Ln.id || "", C.setDisabled(!1));
2519
+ ), mn.taxAuthority = Ln.id || "", C.setDisabled(!1));
2520
2520
  } else
2521
2521
  C.setValue && C.setValue("", "", ""), C.setDisabled(!1);
2522
- return on.name = hn.ten_cty || "", on.address = hn.dia_chi || "", on.taxCode = J, p.setError(null), on;
2522
+ return mn.name = hn.ten_cty || "", mn.address = hn.dia_chi || "", mn.taxCode = J, p.setError(null), mn;
2523
2523
  } catch (hn) {
2524
2524
  S === Tn && (pt.error(
2525
2525
  g("errorFetchTaxInfo", "Lỗi khi lấy thông tin mã số thuế."),
@@ -2532,18 +2532,18 @@ function g1(l) {
2532
2532
  g("errorFetchTaxInfo", "Lỗi khi lấy thông tin mã số thuế.")
2533
2533
  ));
2534
2534
  } finally {
2535
- S === Tn && gn();
2535
+ S === Tn && on();
2536
2536
  }
2537
2537
  });
2538
2538
  }
2539
- const qn = document.createElement("div");
2540
- qn.className = "wgt:space-y-3";
2539
+ const sn = document.createElement("div");
2540
+ sn.className = "wgt:space-y-3";
2541
2541
  const mt = document.createElement("h3");
2542
- mt.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", mt.innerText = g("unitInfo", "1. Thông tin đơn vị"), qn.appendChild(mt), setTimeout(() => d(), 50);
2542
+ mt.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", mt.innerText = g("unitInfo", "1. Thông tin đơn vị"), sn.appendChild(mt), setTimeout(() => d(), 50);
2543
2543
  const Xn = document.createElement("div");
2544
- Xn.className = "wgt:grid wgt:@max-2xl:grid-cols-1 wgt:@max-2xl:p-4 wgt:@max-2xl:gap-y-3 wgt:grid-cols-2 wgt:gap-y-2 wgt:gap-x-4 wgt:px-6 wgt:py-4 wgt:rounded-xl wgt:bg-weak-50", qn.appendChild(Xn), Xn.appendChild(p.container), Xn.appendChild(H.container), Xn.appendChild(N.container), Xn.appendChild(C.container);
2544
+ Xn.className = "wgt:grid wgt:@max-2xl:grid-cols-1 wgt:@max-2xl:p-4 wgt:@max-2xl:gap-y-3 wgt:grid-cols-2 wgt:gap-y-2 wgt:gap-x-4 wgt:px-6 wgt:py-4 wgt:rounded-xl wgt:bg-weak-50", sn.appendChild(Xn), Xn.appendChild(p.container), Xn.appendChild(H.container), Xn.appendChild(N.container), Xn.appendChild(C.container);
2545
2545
  const qt = document.createElement("div");
2546
- qt.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4", qn.appendChild(qt), qt.appendChild(j.container), w.appendChild(qn);
2546
+ qt.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4", sn.appendChild(qt), qt.appendChild(j.container), w.appendChild(sn);
2547
2547
  const zn = document.createElement("div");
2548
2548
  zn.className = "wgt:space-y-4";
2549
2549
  const Un = document.createElement("h3");
@@ -2569,7 +2569,7 @@ function g1(l) {
2569
2569
  Qn = !1, Rn = !1, On();
2570
2570
  const hn = () => {
2571
2571
  G.inputEl.value = "", L.inputEl.value = "", f.inputEl.value = "", m.inputEl.value = "", B.selectEl.value = "", T.selectEl.value = "", G.setError(null), L.setError(null), f.setError(null), m.setError(null), B.setError(null), T.setError(null), u && typeof u.setDate == "function" && u.setDate(null);
2572
- }, on = (xn) => {
2572
+ }, mn = (xn) => {
2573
2573
  if (!xn) return "";
2574
2574
  if (/^\d{8}$/.test(xn)) {
2575
2575
  const Nt = xn.slice(0, 2), A0 = xn.slice(2, 4), sc = xn.slice(4, 8);
@@ -2580,7 +2580,7 @@ function g1(l) {
2580
2580
  const e0 = String(Bt.getDate()).padStart(2, "0"), Kt = String(Bt.getMonth() + 1).padStart(2, "0"), Wt = Bt.getFullYear();
2581
2581
  return `${e0}/${Kt}/${Wt}`;
2582
2582
  }, vn = new Image();
2583
- vn.src = URL.createObjectURL(J), vn.onload = () => sn(null, null, function* () {
2583
+ vn.src = URL.createObjectURL(J), vn.onload = () => ln(null, null, function* () {
2584
2584
  try {
2585
2585
  const xn = yield l1(vn).then((Ln) => JSON.parse(Ln).status !== "success" ? (Qn = !0, Rn = !1, hn(), On(), null) : JSON.parse(Ln).data);
2586
2586
  if (xn || S({ success: !1, reason: "No data detected" }), xn) {
@@ -2592,7 +2592,7 @@ function g1(l) {
2592
2592
  const { address: xt, date_of_birth: Bt, full_name: e0, id_number: Kt, sex: Wt } = xn;
2593
2593
  if (!Kt || !/^\d{12}$/.test(Kt) ? (Vt(
2594
2594
  g("errorInvalidCard", "Số CCCD phải có 12 chữ số")
2595
- ), G.inputEl.value = "") : (G.inputEl.value = Kt, G.setError(null)), L.inputEl.value = e0 || "", f.inputEl.value = on(Bt), m.inputEl.value = xt || "", Wt) {
2595
+ ), G.inputEl.value = "") : (G.inputEl.value = Kt, G.setError(null)), L.inputEl.value = e0 || "", f.inputEl.value = mn(Bt), m.inputEl.value = xt || "", Wt) {
2596
2596
  const Nt = ih.find(
2597
2597
  (A0) => A0.label.toLowerCase() === Wt.toLowerCase()
2598
2598
  );
@@ -2603,15 +2603,15 @@ function g1(l) {
2603
2603
  } catch (xn) {
2604
2604
  console.error("readIdentityCard failed", xn);
2605
2605
  } finally {
2606
- gn();
2606
+ on();
2607
2607
  }
2608
2608
  });
2609
2609
  });
2610
2610
  }
2611
2611
  function dt(J, S, hn) {
2612
- const on = new Image();
2613
- on.src = URL.createObjectURL(J), on.onload = () => sn(null, null, function* () {
2614
- yield A1(on).then((vn) => {
2612
+ const mn = new Image();
2613
+ mn.src = URL.createObjectURL(J), mn.onload = () => ln(null, null, function* () {
2614
+ yield A1(mn).then((vn) => {
2615
2615
  var Ln, jn;
2616
2616
  const xn = JSON.parse(vn);
2617
2617
  S && !((Ln = xn == null ? void 0 : xn.data) != null && Ln.isFront) ? Vt(
@@ -2633,26 +2633,26 @@ function g1(l) {
2633
2633
  } = Vc({
2634
2634
  frontFile: n == null ? void 0 : n.idCard,
2635
2635
  backFile: n == null ? void 0 : n.idCardBack,
2636
- onFrontChange: (J) => sn(null, null, function* () {
2637
- var hn, on;
2636
+ onFrontChange: (J) => ln(null, null, function* () {
2637
+ var hn, mn;
2638
2638
  if (U = J, dt(J, !0, !1), ht() || lt() || !a0()) {
2639
- Qn = !1, Rn = !1, On(), gn();
2639
+ Qn = !1, Rn = !1, On(), on();
2640
2640
  return;
2641
2641
  }
2642
- if ((on = (hn = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : hn.legalRepresentative) == null ? void 0 : on.idCard) {
2643
- gn();
2642
+ if ((mn = (hn = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : hn.legalRepresentative) == null ? void 0 : mn.idCard) {
2643
+ on();
2644
2644
  return;
2645
2645
  }
2646
2646
  tt(J);
2647
2647
  }),
2648
- onBackChange: (J) => sn(null, null, function* () {
2649
- var on, vn;
2648
+ onBackChange: (J) => ln(null, null, function* () {
2649
+ var mn, vn;
2650
2650
  if (cn = J, dt(J, !1, !0), ht() || lt() || !Gt()) {
2651
- Qn = !1, Rn = !1, On(), gn();
2651
+ Qn = !1, Rn = !1, On(), on();
2652
2652
  return;
2653
2653
  }
2654
- if ((vn = (on = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : on.legalRepresentative) == null ? void 0 : vn.idCardBack) {
2655
- gn();
2654
+ if ((vn = (mn = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : mn.legalRepresentative) == null ? void 0 : vn.idCardBack) {
2655
+ on();
2656
2656
  return;
2657
2657
  }
2658
2658
  (yield tt(Gt())).success || tt(J);
@@ -2685,15 +2685,15 @@ function g1(l) {
2685
2685
  vt.className = "wgt:text-lg wgt:font-semibold wgt:mb-2", vt.innerText = g("invoiceUsageInfo", "4. THÔNG TIN SỬ DỤNG HDDT:"), at.appendChild(vt), w.appendChild(at);
2686
2686
  const Zn = document.createElement("div");
2687
2687
  Zn.className = "wgt:w-full wgt:flex wgt:gap-4 wgt:items-start wgt:flex-row wgt:@max-4xl:flex-col", Zn.appendChild(P.container), Zn.appendChild(An.container), at.appendChild(Zn);
2688
- const En = document.createElement("div");
2689
- En.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", i || w.appendChild(En);
2688
+ const Nn = document.createElement("div");
2689
+ Nn.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", i || w.appendChild(Nn);
2690
2690
  const Xt = document.createElement("div");
2691
2691
  Xt.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", Xt.appendChild(E);
2692
2692
  const W = document.createElement("h4");
2693
2693
  W.className = "wgt:font-semibold wgt:italic", W.innerText = g(
2694
2694
  "hasUsedEInvoice",
2695
2695
  "Bạn đã sử dụng hoá đơn điện tử?"
2696
- ), Xt.appendChild(W), i || En.appendChild(Xt), E.checked = i, E.disabled = i;
2696
+ ), Xt.appendChild(W), i || Nn.appendChild(Xt), E.checked = i, E.disabled = i;
2697
2697
  const tn = document.createElement("div");
2698
2698
  if (tn.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", !i) {
2699
2699
  tn.appendChild(v);
@@ -2725,13 +2725,13 @@ function g1(l) {
2725
2725
  ].join(" ");
2726
2726
  const en = "http://www.w3.org/2000/svg", _ = document.createElementNS(en, "svg");
2727
2727
  _.setAttribute("viewBox", "0 0 24 24"), _.setAttribute("class", "wgt:w-4 wgt:h-4 wgt:text-white");
2728
- const mn = document.createElementNS(en, "path");
2729
- mn.setAttribute("fill-rule", "evenodd"), mn.setAttribute("clip-rule", "evenodd"), mn.setAttribute(
2728
+ const qn = document.createElementNS(en, "path");
2729
+ qn.setAttribute("fill-rule", "evenodd"), qn.setAttribute("clip-rule", "evenodd"), qn.setAttribute(
2730
2730
  "d",
2731
2731
  "M5.23 12.03a.75.75 0 011.06.02L10 15.94l7.71-7.71a.75.75 0 111.06 1.06l-8.24 8.24a.75.75 0 01-1.06 0L5.21 13.09a.75.75 0 01.02-1.06z"
2732
- ), mn.setAttribute("fill", "white"), _.appendChild(mn), $.appendChild(_);
2733
- const ln = document.createElement("label");
2734
- ln.className = "wgt:text-sm wgt:text-strong-950 wgt:leading-tight", ln.appendChild(
2732
+ ), qn.setAttribute("fill", "white"), _.appendChild(qn), $.appendChild(_);
2733
+ const gn = document.createElement("label");
2734
+ gn.className = "wgt:text-sm wgt:text-strong-950 wgt:leading-tight", gn.appendChild(
2735
2735
  document.createTextNode(g("agreeWith", "Tôi đồng ý với ") + " ")
2736
2736
  );
2737
2737
  const Bn = (J) => {
@@ -2740,13 +2740,13 @@ function g1(l) {
2740
2740
  hn.preventDefault(), typeof c == "function" && c();
2741
2741
  }, S;
2742
2742
  }, In = Ic(e);
2743
- ln.appendChild(
2743
+ gn.appendChild(
2744
2744
  Bn(g("termsAndUsagePolicy", "Điều khoản và Chính sách sử dụng"))
2745
- ), ln.appendChild(document.createTextNode(` ${g("of", "của")} ${In}.`)), nn.appendChild($), nn.appendChild(ln), w.appendChild(nn), $.addEventListener("click", () => {
2746
- an = !an, an ? ($.classList.add("wgt:bg-primary"), _.classList.remove("wgt:hidden")) : ($.classList.remove("wgt:bg-primary"), _.classList.add("wgt:hidden")), gn();
2745
+ ), gn.appendChild(document.createTextNode(` ${g("of", "của")} ${In}.`)), nn.appendChild($), nn.appendChild(gn), w.appendChild(nn), $.addEventListener("click", () => {
2746
+ an = !an, an ? ($.classList.add("wgt:bg-primary"), _.classList.remove("wgt:hidden")) : ($.classList.remove("wgt:bg-primary"), _.classList.add("wgt:hidden")), on();
2747
2747
  });
2748
- const Nn = document.createElement("div");
2749
- Nn.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ", Y.type = "submit", Y.innerText = g("next"), Y.className = [
2748
+ const En = document.createElement("div");
2749
+ En.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ", Y.type = "submit", Y.innerText = g("next"), Y.className = [
2750
2750
  "wgt:bg-primary",
2751
2751
  "wgt:hover:bg-primary-dark",
2752
2752
  "wgt:text-text-primary",
@@ -2757,7 +2757,7 @@ function g1(l) {
2757
2757
  "wgt:disabled:cursor-not-allowed",
2758
2758
  "wgt:cursor-pointer",
2759
2759
  "wgt:hover:text-primary-hover-text"
2760
- ].join(" "), Nn.appendChild(Y), b.appendChild(Nn);
2760
+ ].join(" "), En.appendChild(Y), b.appendChild(En);
2761
2761
  function Dn() {
2762
2762
  const J = Fn(), S = J.eInvoiceRegistration, hn = (S.organization.taxCode || "").trim();
2763
2763
  if (!S.contactPerson.address || !S.organization.name || !S.organization.address || !hn || !S.organization.taxAuthority || !S.contactPerson.name || !S.contactPerson.email || !S.contactPerson.phone || !S.legalRepresentative.name || !S.legalRepresentative.dob || !S.legalRepresentative.gender || !S.legalRepresentative.phone || !S.legalRepresentative.idCard || !S.legalRepresentative.permanentAddress || !S.invoiceSymbol || !i && S.hasUsedEInvoice && !S.taxAuthorityCode || S.isUsedEInvoiceBefore && !S.previousEInvoiceProvider || !Ft(S.contactPerson.name) || !Ft(S.legalRepresentative.name) || !/^[\p{L}0-9\s,.\-/()]*$/u.test(S.contactPerson.address) || !/^[\p{L}0-9\s,.\-/()]*$/u.test(
@@ -2773,7 +2773,7 @@ function g1(l) {
2773
2773
  ), jn = S.legalRepresentative.phone.replace(/[^\d+().\-\s]/g, "").replace(/[\s.\-()]/g, ""), xt = /^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/;
2774
2774
  return !(!xt.test(xn) || !xt.test(jn) || !/^\d{12}$/.test(S.legalRepresentative.idCard) || !new RegExp("^(?!\\.)(?!.*\\.\\.)[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]{1,64}(?<!\\.)@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z0-9-]{2,63}$").test(S.contactPerson.email) || !/^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(S.invoiceSymbol) || !J.license || !J.idCard || !J.idCardBack);
2775
2775
  }
2776
- function gn() {
2776
+ function on() {
2777
2777
  const J = e === "bvb" && !i && A === !1 && !n._userHasEditedTaxCode;
2778
2778
  Y.disabled = !Dn() || !an || ht() || lt() || j.getError() || O.getError() || J;
2779
2779
  }
@@ -2831,12 +2831,12 @@ function g1(l) {
2831
2831
  D,
2832
2832
  M
2833
2833
  ].forEach((J) => {
2834
- J.inputEl.addEventListener("input", gn);
2834
+ J.inputEl.addEventListener("input", on);
2835
2835
  }), [B, C].forEach((J) => {
2836
- J.selectEl.addEventListener("change", gn);
2836
+ J.selectEl.addEventListener("change", on);
2837
2837
  }), [E, v].forEach((J) => {
2838
- J.addEventListener("change", gn);
2839
- }), Y.addEventListener("click", (J) => sn(null, null, function* () {
2838
+ J.addEventListener("change", on);
2839
+ }), Y.addEventListener("click", (J) => ln(null, null, function* () {
2840
2840
  if (J.preventDefault(), !Dn()) return;
2841
2841
  const S = p.getValue().trim();
2842
2842
  if (!xh(S)) {
@@ -2860,7 +2860,7 @@ function g1(l) {
2860
2860
  return;
2861
2861
  }
2862
2862
  Y.disabled = !0;
2863
- let hn = null, on = !1;
2863
+ let hn = null, mn = !1;
2864
2864
  try {
2865
2865
  const vn = (n == null ? void 0 : n.provider) || "m-invoice";
2866
2866
  if (console.log("Current theme:", e), console.log("Provider being used:", vn), hn = (yield _h(vn, S, "HDTT")).isNewCustomer, hn)
@@ -2882,11 +2882,11 @@ function g1(l) {
2882
2882
  });
2883
2883
  }
2884
2884
  } catch (vn) {
2885
- on = !0, console.error("Error checking customer:", vn);
2885
+ mn = !0, console.error("Error checking customer:", vn);
2886
2886
  } finally {
2887
2887
  Y.disabled = !1, Y.innerText = g("next");
2888
2888
  }
2889
- on || hn === !1 || hn === !0 && (Gn(Wn.STEP1_COMPLETED, {
2889
+ mn || hn === !1 || hn === !0 && (Gn(Wn.STEP1_COMPLETED, {
2890
2890
  theme: e,
2891
2891
  isRenewal: !1,
2892
2892
  isNewCustomer: !0,
@@ -2894,14 +2894,14 @@ function g1(l) {
2894
2894
  }), t(Fn()));
2895
2895
  }));
2896
2896
  const $n = (((eh = (ah = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : ah.organization) == null ? void 0 : eh.taxCode) || "").trim();
2897
- return $n.length >= 10 && Mn($n), cc(Uh(), jh().invoiceHubBaseUrl), n != null && n.idCard && (U = n == null ? void 0 : n.idCard), gn(), {
2897
+ return $n.length >= 10 && Mn($n), cc(Uh(), jh().invoiceHubBaseUrl), n != null && n.idCard && (U = n == null ? void 0 : n.idCard), on(), {
2898
2898
  container: b,
2899
2899
  getValues: Fn
2900
2900
  };
2901
2901
  });
2902
2902
  }
2903
2903
  function r1(h) {
2904
- return sn(this, arguments, function* ({
2904
+ return ln(this, arguments, function* ({
2905
2905
  providerProps: t,
2906
2906
  formProps: n,
2907
2907
  isRenewal: e,
@@ -3256,8 +3256,8 @@ function p1({
3256
3256
  const q = document.createElement("span");
3257
3257
  q.className = "wgt:text-sm wgt:text-red-500 wgt:ml-1", q.innerText = "*", A.appendChild(q), o.appendChild(A);
3258
3258
  function s() {
3259
- return sn(this, null, function* () {
3260
- n && clearTimeout(n), e !== "" ? n = setTimeout(() => sn(null, null, function* () {
3259
+ return ln(this, null, function* () {
3260
+ n && clearTimeout(n), e !== "" ? n = setTimeout(() => ln(null, null, function* () {
3261
3261
  try {
3262
3262
  const b = e.trim().toLowerCase().replace(/\B(?=(\d{3})+(?!\d))/g, "."), w = yield Xc({ search: b, bank: t });
3263
3263
  w && (a = w), c && c();
@@ -3405,7 +3405,7 @@ function X1() {
3405
3405
  }
3406
3406
  const B1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFmSURBVHgBjVJLUsJAEH2dTAzu4gmEG+gNYKFxGU9gbqAuLaEqVVDllhuAJyDuQBfEE1CeADiBcaESyWTsJCKfIOXbzPT3db9qAkN5VQvG3iUUVUEoYxcUJlDJC+TcIy8IReY0zA4STKHp15gnYeYTKuCGLiQXrEJnAmK/MHts1Uh5jgXxMab648EaUcv2EUduyrJ1kJb9yvGKgDmzEFMhieoDB7vxBpQsDVEphMYdm/Y402LB0Dxpr9ob7Ff8HKZ/jTw/pNtBBaSeeS93OYLmpAyF4uapw0KmgtfI60/EWjShrftu4IgTH6jxFKSGyEQ0PkdI1BTJzF9SqS4QFRtqwkciezxJCPnVJnV3VkashtTgNf6JrEaqEYt/nItIqrhry+78JSLd9Cf5bxbST/KQH74weQ8Z50Fh8iFJ99dewDAsKO2Cqyp8O04uYrx/Dv3d4wU9LiwvqfQuhL5OnyhuSAFk5KbmN7eYmgg1dFx4AAAAAElFTkSuQmCC";
3407
3407
  function N1(N) {
3408
- return sn(this, arguments, function* ({
3408
+ return ln(this, arguments, function* ({
3409
3409
  onNext: t,
3410
3410
  onPrev: n,
3411
3411
  selectedInitPackage: e,
@@ -3458,40 +3458,36 @@ function N1(N) {
3458
3458
  an.className = "wgt:text-sm wgt:font-medium wgt:text-black", an.innerHTML = `${g("businessRegistrationType") || "Hình thức đăng ký kinh doanh"} <span class="wgt:text-red-500">*</span>`, nn.appendChild(an);
3459
3459
  const $ = document.createElement("div");
3460
3460
  $.className = "wgt:inline-flex wgt:items-center wgt:rounded-xl wgt:bg-white wgt:border wgt:border-soft-200 wgt:p-1 wgt:gap-1", nn.appendChild($);
3461
- function en(Nn, Dn) {
3462
- const gn = document.createElement("button");
3463
- gn.type = "button", gn.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:px-4 wgt:py-2 wgt:rounded-lg wgt:text-sm wgt:font-medium wgt:transition wgt:hover:bg-weak-50";
3461
+ function en(En, Dn) {
3462
+ const on = document.createElement("button");
3463
+ on.type = "button", on.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:px-4 wgt:py-2 wgt:rounded-lg wgt:text-sm wgt:font-medium wgt:transition wgt:hover:bg-weak-50";
3464
3464
  const Fn = document.createElement("span");
3465
3465
  Fn.className = "wgt:h-4 wgt:w-4 wgt:rounded-full wgt:border wgt:flex wgt:items-center wgt:justify-center";
3466
3466
  const $n = document.createElement("span");
3467
3467
  $n.className = "wgt:h-2 wgt:w-2 wgt:rounded-full ", $n.style.backgroundColor = "#1e2a7b", $n.style.opacity = "0", Fn.appendChild($n);
3468
3468
  const et = document.createElement("span");
3469
- return et.className = "wgt:text-sm wgt:font-semibold", et.innerText = Nn, gn.appendChild(Fn), gn.appendChild(et), gn.addEventListener("click", () => {
3469
+ return et.className = "wgt:text-sm wgt:font-semibold", et.innerText = En, on.appendChild(Fn), on.appendChild(et), on.addEventListener("click", () => {
3470
3470
  F = Dn, Bn(), W != null && W.eInvoiceRegistration && (W.eInvoiceRegistration.businessType = F), tn == null || tn(F);
3471
- }), { btn: gn, inner: $n, textSpan: et, value: Dn };
3471
+ }), { btn: on, inner: $n, textSpan: et, value: Dn };
3472
3472
  }
3473
- const _ = en(g("company") || "Doanh nghiệp", "company"), mn = en(
3473
+ const _ = en(g("company") || "Doanh nghiệp", "company"), qn = en(
3474
3474
  g("householdBusiness") || "Hộ kinh doanh",
3475
3475
  "household"
3476
3476
  );
3477
- $.appendChild(_.btn), $.appendChild(mn.btn);
3478
- function ln(Nn, Dn) {
3479
- Nn.btn.classList.toggle("wgt:bg-weak-50", Dn), Nn.inner.style.opacity = Dn ? "1" : "0", Nn.inner.parentElement.classList.toggle(
3480
- "wgt:border-[#1e2a7b]",
3481
- Dn
3482
- ), Nn.inner.parentElement.classList.toggle(
3483
- "wgt:border-soft-300",
3484
- !Dn
3485
- ), Nn.textSpan.style.color = Dn ? "#1e2a7b" : "", Nn.textSpan.classList.toggle("wgt:text-text-sub-600", !Dn);
3477
+ $.appendChild(_.btn), $.appendChild(qn.btn);
3478
+ function gn(En, Dn) {
3479
+ En.btn.classList.toggle("wgt:bg-weak-50", Dn), En.inner.style.opacity = Dn ? "1" : "0";
3480
+ const on = En.inner.parentElement;
3481
+ on.classList.toggle("wgt:border-[#1e2a7b]", Dn), on.classList.toggle("wgt:border-[#D0D5DD]", !Dn), En.textSpan.style.color = Dn ? "#1e2a7b" : "", En.textSpan.classList.toggle("wgt:text-text-sub-600", !Dn);
3486
3482
  }
3487
3483
  function Bn() {
3488
- ln(_, F === "company"), ln(mn, F === "household");
3484
+ gn(_, F === "company"), gn(qn, F === "household");
3489
3485
  }
3490
3486
  return Bn(), {
3491
3487
  container: nn,
3492
3488
  getValue: () => F,
3493
- setValue: (Nn) => {
3494
- F = Nn, Bn();
3489
+ setValue: (En) => {
3490
+ F = En, Bn();
3495
3491
  }
3496
3492
  };
3497
3493
  }
@@ -3513,7 +3509,7 @@ function N1(N) {
3513
3509
  onChange: (tn) => {
3514
3510
  var nn;
3515
3511
  const F = Q(y, tn);
3516
- Mn(F || []), Xn(F || []), L = ((nn = F == null ? void 0 : F[0]) == null ? void 0 : nn._id) || null, at(), ct(), Tt(), Zn(), En();
3512
+ Mn(F || []), Xn(F || []), L = ((nn = F == null ? void 0 : F[0]) == null ? void 0 : nn._id) || null, at(), ct(), Tt(), Zn(), Nn();
3517
3513
  }
3518
3514
  });
3519
3515
  const W = document.createElement("div");
@@ -3525,7 +3521,7 @@ function N1(N) {
3525
3521
  container: An,
3526
3522
  invoiceSelectorWrapper: Tn,
3527
3523
  setInvoicePackages: Mn,
3528
- getInvoicePackages: qn,
3524
+ getInvoicePackages: sn,
3529
3525
  getFilteredInvoiceOptions: mt,
3530
3526
  setFilteredInvoiceOptions: Xn,
3531
3527
  findInvoiceById: qt,
@@ -3535,7 +3531,7 @@ function N1(N) {
3535
3531
  debounceTimer: m,
3536
3532
  typedUnits: V,
3537
3533
  onSearchComplete: () => {
3538
- ct(), En();
3534
+ ct(), Nn();
3539
3535
  }
3540
3536
  });
3541
3537
  Z.appendChild(An);
@@ -3561,7 +3557,7 @@ function N1(N) {
3561
3557
  ht.className = "wgt:flex wgt:justify-between wgt:gap-2", O.appendChild(ht);
3562
3558
  const lt = document.createElement("button");
3563
3559
  lt.type = "button", lt.innerText = g("back"), lt.className = "wgt:bg-transparent wgt:text-primary wgt:hover:text-primary-dark wgt:hover:bg-transparent wgt:underline", lt.addEventListener("click", n), ht.appendChild(lt);
3564
- const Vt = (W, tn, F, nn) => sn(null, null, function* () {
3560
+ const Vt = (W, tn, F, nn) => ln(null, null, function* () {
3565
3561
  cn();
3566
3562
  const _ = x.eInvoiceRegistration, { isUsedEInvoiceBefore: an } = _, $ = mh(_, ["isUsedEInvoiceBefore"]);
3567
3563
  let en = [
@@ -3579,9 +3575,9 @@ function N1(N) {
3579
3575
  code: W.code,
3580
3576
  quantity: W.quantity,
3581
3577
  isCashRegister: X
3582
- }), nn.length > 0 && nn.forEach((mn) => {
3583
- const ln = R[mn];
3584
- ln.reward.packageCodes.length > 0 && ln.reward.packageCodes.forEach((Bn) => {
3578
+ }), nn.length > 0 && nn.forEach((qn) => {
3579
+ const gn = R[qn];
3580
+ gn.reward.packageCodes.length > 0 && gn.reward.packageCodes.forEach((Bn) => {
3585
3581
  en.push({
3586
3582
  code: Bn,
3587
3583
  quantity: 1,
@@ -3590,7 +3586,7 @@ function N1(N) {
3590
3586
  });
3591
3587
  }), I(en), k(nn);
3592
3588
  try {
3593
- const mn = yield Bc({
3589
+ const qn = yield Bc({
3594
3590
  eInvoiceRegistration: yn({}, $),
3595
3591
  bank: x.bank,
3596
3592
  provider: i.route,
@@ -3604,9 +3600,9 @@ function N1(N) {
3604
3600
  promotionCodes: nn,
3605
3601
  isRenew: H,
3606
3602
  isCashRegister: X
3607
- }), ln = mn.orderId, Bn = mn.amount || 0;
3608
- A(ln), s ? s(Bn) : console.warn("setOrderAmount is not defined!"), yield new Promise((In) => setTimeout(In, 100)), Y(), t();
3609
- } catch (mn) {
3603
+ }), gn = qn.orderId, Bn = qn.amount || 0;
3604
+ A(gn), s ? s(Bn) : console.warn("setOrderAmount is not defined!"), yield new Promise((In) => setTimeout(In, 100)), Y(), t();
3605
+ } catch (qn) {
3610
3606
  Ut(g("errorCreatingOrder") || "Failed to create order"), Y();
3611
3607
  return;
3612
3608
  }
@@ -3614,8 +3610,8 @@ function N1(N) {
3614
3610
  type: "button",
3615
3611
  title: g("next"),
3616
3612
  className: "wgt:text-text-primary wgt:bg-primary",
3617
- handleClick: () => sn(null, null, function* () {
3618
- const W = qn().find(
3613
+ handleClick: () => ln(null, null, function* () {
3614
+ const W = sn().find(
3619
3615
  ($) => $._id === L
3620
3616
  ), tn = z.find(
3621
3617
  ($) => $._id === f
@@ -3643,7 +3639,7 @@ function N1(N) {
3643
3639
  });
3644
3640
  ht.appendChild(c0);
3645
3641
  function Gt() {
3646
- return sn(this, null, function* () {
3642
+ return ln(this, null, function* () {
3647
3643
  var W, tn;
3648
3644
  try {
3649
3645
  const [
@@ -3683,16 +3679,16 @@ function N1(N) {
3683
3679
  reward: en.reward
3684
3680
  });
3685
3681
  }), Object.keys(R).length > 0 && (B = l ? [...l] : [], vt())) : console.error("Failed to load promotions:", F.reason), an.status === "fulfilled") {
3686
- y = (H ? an.value.filter((mn) => mn.renewPrice !== 0) : an.value) || [];
3682
+ y = (H ? an.value.filter((qn) => qn.renewPrice !== 0) : an.value) || [];
3687
3683
  const _ = X ? Q(
3688
3684
  y,
3689
3685
  rn.getValue()
3690
3686
  ) : y;
3691
3687
  if (Mn(_ || []), Xn(_ || []), Mn(_ || []), an.value.length > 0) {
3692
- const mn = _.find(
3693
- (ln) => T.includes(ln.code)
3688
+ const qn = _.find(
3689
+ (gn) => T.includes(gn.code)
3694
3690
  );
3695
- L = c ? c._id : mn ? mn._id : _ == null ? void 0 : _[0]._id, Xn(_);
3691
+ L = c ? c._id : qn ? qn._id : _ == null ? void 0 : _[0]._id, Xn(_);
3696
3692
  }
3697
3693
  zn();
3698
3694
  } else
@@ -3731,7 +3727,7 @@ function N1(N) {
3731
3727
  });
3732
3728
  }
3733
3729
  function a0() {
3734
- at(), ct(), H || St(), Tt(), Zn(), En();
3730
+ at(), ct(), H || St(), Tt(), Zn(), Nn();
3735
3731
  }
3736
3732
  function ft(W, tn, F) {
3737
3733
  const nn = Object.values(R).find(
@@ -3740,7 +3736,7 @@ function N1(N) {
3740
3736
  (_) => _.bank === r && _.appliedPackages.includes(tn)
3741
3737
  ), en = $ && !$.isDisabled && !($.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && $.limit !== $.used;
3742
3738
  if (an && !en) {
3743
- const { container: _, open: mn } = It({
3739
+ const { container: _, open: qn } = It({
3744
3740
  message: g("errorDiscountPackage"),
3745
3741
  description: g("errorDiscountPackageDes"),
3746
3742
  okLabel: g("ok"),
@@ -3750,7 +3746,7 @@ function N1(N) {
3750
3746
  isSuccess: !1,
3751
3747
  theme: r
3752
3748
  });
3753
- O.appendChild(_), mn();
3749
+ O.appendChild(_), qn();
3754
3750
  } else
3755
3751
  F();
3756
3752
  }
@@ -3767,11 +3763,11 @@ function N1(N) {
3767
3763
  isRenew: H,
3768
3764
  handlePackageSelect: (W) => {
3769
3765
  var nn, an;
3770
- let tn = (nn = qn().find(
3766
+ let tn = (nn = sn().find(
3771
3767
  ($) => $._id === L
3772
- )) == null ? void 0 : nn.code, F = (an = qn().find(($) => $._id === W)) == null ? void 0 : an.code;
3768
+ )) == null ? void 0 : nn.code, F = (an = sn().find(($) => $._id === W)) == null ? void 0 : an.code;
3773
3769
  ft(tn, F, () => {
3774
- L = W, it.setSelectedPackageId(W), at(), Tt(), Zn(), En();
3770
+ L = W, it.setSelectedPackageId(W), at(), Tt(), Zn(), Nn();
3775
3771
  });
3776
3772
  }
3777
3773
  }), Tn.appendChild(it.container);
@@ -3798,11 +3794,11 @@ function N1(N) {
3798
3794
  ($) => $._id === f
3799
3795
  )) == null ? void 0 : nn.code, F = (an = z.find(($) => $._id === W)) == null ? void 0 : an.code;
3800
3796
  if (H && f === W) {
3801
- f = null, gt.setSelectedPackageId(null), at(), Tt(), Zn(), En();
3797
+ f = null, gt.setSelectedPackageId(null), at(), Tt(), Zn(), Nn();
3802
3798
  return;
3803
3799
  }
3804
3800
  ft(tn, F, () => {
3805
- f = W, gt.setSelectedPackageId(W), Xn(qn()), at(), Tt(), Zn(), En();
3801
+ f = W, gt.setSelectedPackageId(W), Xn(sn()), at(), Tt(), Zn(), Nn();
3806
3802
  });
3807
3803
  }
3808
3804
  }), Un.appendChild(gt.container);
@@ -3815,7 +3811,7 @@ function N1(N) {
3815
3811
  rt.className = "wgt:w-full", Z.appendChild(rt);
3816
3812
  function Tt() {
3817
3813
  Qn.remove(), rt.innerHTML = "";
3818
- const W = qn().find(
3814
+ const W = sn().find(
3819
3815
  (tn) => tn._id === L
3820
3816
  );
3821
3817
  if (G.length > 0) {
@@ -3839,7 +3835,7 @@ function N1(N) {
3839
3835
  const Jn = document.createElement("div");
3840
3836
  Jn.className = "promotion-wrapper wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
3841
3837
  function at() {
3842
- const W = qn().find(
3838
+ const W = sn().find(
3843
3839
  (an) => an._id === L
3844
3840
  ), tn = z.find(
3845
3841
  (an) => an._id === f
@@ -3849,15 +3845,15 @@ function N1(N) {
3849
3845
  const $ = R[an];
3850
3846
  if ($.bank !== r) {
3851
3847
  $.isDisabled = !0, B = B.filter(
3852
- (Nn) => Nn !== $.code
3848
+ (En) => En !== $.code
3853
3849
  );
3854
3850
  return;
3855
3851
  }
3856
- const en = $.expiredAt < (/* @__PURE__ */ new Date()).toISOString(), _ = $.limit <= $.used, mn = !$.isActive, Bn = ((In = $.appliedPackages) == null ? void 0 : In.some(
3857
- (Nn) => nn.includes(Nn)
3858
- )) && !en && !_ && !mn;
3852
+ const en = $.expiredAt < (/* @__PURE__ */ new Date()).toISOString(), _ = $.limit <= $.used, qn = !$.isActive, Bn = ((In = $.appliedPackages) == null ? void 0 : In.some(
3853
+ (En) => nn.includes(En)
3854
+ )) && !en && !_ && !qn;
3859
3855
  $.isDisabled = !Bn, Bn ? Bn && !B.includes($.code) && B.push($.code) : B = B.filter(
3860
- (Nn) => Nn !== $.code
3856
+ (En) => En !== $.code
3861
3857
  );
3862
3858
  }), vt();
3863
3859
  }
@@ -3883,28 +3879,28 @@ function N1(N) {
3883
3879
  const F = document.createElement("div");
3884
3880
  F.className = "wgt:w-full wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";
3885
3881
  const nn = document.createElement("div");
3886
- nn.className = "wgt:flex wgt:min-w-[500px] wgt:h-11 wgt:items-center wgt:gap-3 wgt:px-3 wgt:py-2 wgt:rounded-lg wgt:bg-white wgt:border wgt:border-[#E4E7EC] wgt:@max-2xl:min-w-full wgt:@max-2xl:flex-wrap wgt:@max-2xl:h-fit", F.appendChild(nn), B && B.length > 0 && B.filter((mn) => {
3887
- const ln = Object.values(R).find(
3888
- (Bn) => Bn.code === mn
3882
+ nn.className = "wgt:flex wgt:min-w-[500px] wgt:h-11 wgt:items-center wgt:gap-3 wgt:px-3 wgt:py-2 wgt:rounded-lg wgt:bg-white wgt:border wgt:border-[#E4E7EC] wgt:@max-2xl:min-w-full wgt:@max-2xl:flex-wrap wgt:@max-2xl:h-fit", F.appendChild(nn), B && B.length > 0 && B.filter((qn) => {
3883
+ const gn = Object.values(R).find(
3884
+ (Bn) => Bn.code === qn
3889
3885
  );
3890
- return ln && ln.bank === r;
3891
- }).forEach((mn) => {
3892
- const ln = document.createElement("div");
3893
- ln.className = "wgt:flex wgt:w-fit wgt:h-fit wgt:items-center wgt:gap-2 wgt:px-2 wgt:py-1.5 wgt:rounded-md wgt:bg-primary/10 wgt:border wgt:border-primary wgt:text-sm wgt:font-medium wgt:text-primary", ln.innerText = mn;
3886
+ return gn && gn.bank === r;
3887
+ }).forEach((qn) => {
3888
+ const gn = document.createElement("div");
3889
+ gn.className = "wgt:flex wgt:w-fit wgt:h-fit wgt:items-center wgt:gap-2 wgt:px-2 wgt:py-1.5 wgt:rounded-md wgt:bg-primary/10 wgt:border wgt:border-primary wgt:text-sm wgt:font-medium wgt:text-primary", gn.innerText = qn;
3894
3890
  const Bn = yt({
3895
3891
  type: "button",
3896
3892
  title: "x",
3897
3893
  handleClick: () => {
3898
3894
  B = B.filter(
3899
- (In) => In !== mn
3900
- ), Zn(), En();
3895
+ (In) => In !== qn
3896
+ ), Zn(), Nn();
3901
3897
  }
3902
3898
  });
3903
3899
  Bn.className = "wgt:w-fit wgt:h-fit wgt:p-0 wgt:bg-transparent wgt:cursor-pointer", Bn.innerHTML = `<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
3904
3900
  <path d="M1.17157 1.17163L6.82842 6.82848" stroke="#0E121B" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3905
3901
  <path d="M1.17158 6.82849L6.82843 1.17163" stroke="#0E121B" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3906
3902
  </svg>
3907
- `, ln.appendChild(Bn), nn.appendChild(ln);
3903
+ `, gn.appendChild(Bn), nn.appendChild(gn);
3908
3904
  });
3909
3905
  const an = yt({
3910
3906
  type: "button",
@@ -3922,27 +3918,27 @@ function N1(N) {
3922
3918
  );
3923
3919
  if (en.length > 0)
3924
3920
  en.forEach((_) => {
3925
- const { container: mn } = w1({
3921
+ const { container: qn } = w1({
3926
3922
  promotion: Yn(yn({}, _), {
3927
3923
  isSelected: B.includes(_.code)
3928
3924
  }),
3929
- onSelect: (ln, Bn) => {
3930
- Bn ? B.push(ln) : B = B.filter(
3931
- (In) => In !== ln
3932
- ), Zn(), En();
3925
+ onSelect: (gn, Bn) => {
3926
+ Bn ? B.push(gn) : B = B.filter(
3927
+ (In) => In !== gn
3928
+ ), Zn(), Nn();
3933
3929
  },
3934
3930
  isDisabled: _.isDisabled || _.expiredAt < (/* @__PURE__ */ new Date()).toISOString() || _.limit === _.used
3935
3931
  });
3936
- $.appendChild(mn);
3932
+ $.appendChild(qn);
3937
3933
  });
3938
3934
  else {
3939
3935
  const _ = document.createElement("span");
3940
3936
  _.className = "wgt:text-text-sub-600", _.innerText = g("noPromotionFound"), Jn.appendChild(_);
3941
3937
  }
3942
3938
  }
3943
- function En() {
3944
- var Nn, Dn, gn, Fn, $n, et, Mt, Jt, Dt;
3945
- if (M(), On.innerHTML = "", Z.appendChild(_n), Z.appendChild(tt), Z.appendChild(Rn), qn().length === 0 && z.length === 0) {
3939
+ function Nn() {
3940
+ var En, Dn, on, Fn, $n, et, Mt, Jt, Dt;
3941
+ if (M(), On.innerHTML = "", Z.appendChild(_n), Z.appendChild(tt), Z.appendChild(Rn), sn().length === 0 && z.length === 0) {
3946
3942
  const K = document.createElement("tr");
3947
3943
  K.innerHTML = `
3948
3944
  <td colspan="5" class="wgt:px-3 wgt:py-8 wgt:text-center wgt:text-text-sub-600 wgt:@max-2xl:col-span-5">
@@ -3951,7 +3947,7 @@ function N1(N) {
3951
3947
  `, On.appendChild(K), q(0);
3952
3948
  return;
3953
3949
  }
3954
- const W = qn().find(
3950
+ const W = sn().find(
3955
3951
  (K) => K._id === L
3956
3952
  );
3957
3953
  if (!H && (G == null ? void 0 : G.length) > 0 && !(W != null && W.withoutInitialFee)) {
@@ -3967,16 +3963,16 @@ function N1(N) {
3967
3963
  fn.className = "wgt:w-full wgt:justify-between wgt:inline-flex wgt:items-center wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:@max-2xl:w-full wgt:@max-2xl:max-w-[200px] wgt:@max-2xl:mx-auto";
3968
3964
  const wn = document.createElement("button");
3969
3965
  wn.type = "button", wn.ariaLabel = g("decrease"), wn.disabled = !0, wn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:cursor-not-allowed wgt:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", wn.innerText = "–", wn.addEventListener("click", () => {
3970
- P > 1 && (P -= 1, En());
3966
+ P > 1 && (P -= 1, Nn());
3971
3967
  }), fn.appendChild(wn);
3972
3968
  const pn = document.createElement("span");
3973
3969
  pn.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", pn.innerText = P, fn.appendChild(pn);
3974
3970
  const Cn = document.createElement("button");
3975
3971
  Cn.type = "button", Cn.ariaLabel = g("increase"), Cn.disabled = !0, Cn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:cursor-not-allowed wgt:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", Cn.innerText = "+", Cn.addEventListener("click", () => {
3976
- P += 1, En();
3972
+ P += 1, Nn();
3977
3973
  }), fn.appendChild(Cn), bn.appendChild(fn), K.appendChild(bn);
3978
3974
  const kn = document.createElement("td");
3979
- kn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", kn.innerText = Sn((Nn = G[0]) == null ? void 0 : Nn.price) + " VND", K.appendChild(kn);
3975
+ kn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", kn.innerText = Sn((En = G[0]) == null ? void 0 : En.price) + " VND", K.appendChild(kn);
3980
3976
  const Hn = document.createElement("td");
3981
3977
  Hn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:min-w-[16rem] wgt:@max-2xl:hidden", Hn.innerText = Sn(((Dn = G[0]) == null ? void 0 : Dn.price) * P) + " VND", K.appendChild(Hn);
3982
3978
  const Vn = document.createElement("div");
@@ -3984,7 +3980,7 @@ function N1(N) {
3984
3980
  <div class="wgt:flex wgt:justify-between wgt:text-sm wgt:text-text-sub-600">
3985
3981
  <span>${g("unitPrice")}:</span>
3986
3982
  <span class="wgt:font-medium">${Sn(
3987
- (gn = G[0]) == null ? void 0 : gn.price
3983
+ (on = G[0]) == null ? void 0 : on.price
3988
3984
  )} VND</span>
3989
3985
  </div>
3990
3986
  <div class="wgt:flex wgt:justify-between wgt:text-base wgt:font-semibold wgt:text-strong-950">
@@ -4012,13 +4008,13 @@ function N1(N) {
4012
4008
  pn.type = "button", pn.ariaLabel = g("decrease");
4013
4009
  const Cn = b ? ($n = K == null ? void 0 : K.price) != null ? $n : 0 : (et = K == null ? void 0 : K.renewPrice) != null ? et : 0;
4014
4010
  pn.disabled = E <= 1 || Cn === 0, pn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:disabled:cursor-not-allowed wgt:disabled:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", pn.innerText = "–", pn.addEventListener("click", () => {
4015
- E > 1 && (E -= 1, En());
4011
+ E > 1 && (E -= 1, Nn());
4016
4012
  }), wn.appendChild(pn);
4017
4013
  const kn = document.createElement("span");
4018
4014
  kn.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", kn.innerText = Cn === 0 ? 1 : E, wn.appendChild(kn);
4019
4015
  const Hn = document.createElement("button");
4020
4016
  Hn.type = "button", Hn.ariaLabel = g("increase"), Hn.disabled = (K == null ? void 0 : K.price) === 0, Hn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:disabled:cursor-not-allowed wgt:disabled:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", Hn.innerText = "+", Hn.addEventListener("click", () => {
4021
- Cn !== 0 && (E += 1, En());
4017
+ Cn !== 0 && (E += 1, Nn());
4022
4018
  }), wn.appendChild(Hn), fn.appendChild(wn), un.appendChild(fn);
4023
4019
  const Vn = document.createElement("td");
4024
4020
  Vn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", Vn.innerText = Sn(Cn * (K == null ? void 0 : K.limit)) + " VND", un.appendChild(Vn);
@@ -4057,13 +4053,13 @@ function N1(N) {
4057
4053
  wn.className = "wgt:w-full wgt:justify-between wgt:inline-flex wgt:items-center wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:@max-2xl:w-full wgt:@max-2xl:max-w-[200px] wgt:@max-2xl:mx-auto";
4058
4054
  const pn = document.createElement("button");
4059
4055
  pn.type = "button", pn.ariaLabel = g("decrease"), pn.disabled = v <= 1, pn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold" + (v <= 1 ? " wgt:cursor-not-allowed wgt:opacity-50" : ""), pn.innerText = "–", pn.addEventListener("click", () => {
4060
- v > 1 && (v -= 1, En());
4056
+ v > 1 && (v -= 1, Nn());
4061
4057
  }), wn.appendChild(pn);
4062
4058
  const Cn = document.createElement("span");
4063
4059
  Cn.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", Cn.innerText = v, wn.appendChild(Cn);
4064
4060
  const kn = document.createElement("button");
4065
4061
  kn.type = "button", kn.ariaLabel = g("increase"), kn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", kn.innerText = "+", kn.addEventListener("click", () => {
4066
- v += 1, En();
4062
+ v += 1, Nn();
4067
4063
  }), wn.appendChild(kn), fn.appendChild(wn), un.appendChild(fn);
4068
4064
  const Hn = document.createElement("td");
4069
4065
  Hn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", Hn.innerText = Sn((K == null ? void 0 : K.limit) * (K == null ? void 0 : K.price)) + " VND", un.appendChild(Hn);
@@ -4112,7 +4108,7 @@ function N1(N) {
4112
4108
  "package"
4113
4109
  )} ${(Vn = (Hn = K == null ? void 0 : K.reward) == null ? void 0 : Hn.packageCodes) == null ? void 0 : Vn.join(", ")}`, fn.style.color = "#12B76A") : fn.innerText = "", un.appendChild(fn), On.appendChild(un);
4114
4110
  });
4115
- const nn = !H && G.length > 0 && !(W != null && W.withoutInitialFee) ? ((Mt = G[0]) == null ? void 0 : Mt.price) * P : 0, an = qt(L), $ = an ? H ? (Dt = an.renewPrice) != null ? Dt : 0 : (Jt = an.price) != null ? Jt : 0 : 0, en = an ? $ * an.limit * E : 0, _ = j(f), mn = _ ? _.price * _.limit * v : 0, ln = nn + en + mn, Bn = Math.min(F, ln), In = Math.max(ln - Bn, 0);
4111
+ const nn = !H && G.length > 0 && !(W != null && W.withoutInitialFee) ? ((Mt = G[0]) == null ? void 0 : Mt.price) * P : 0, an = qt(L), $ = an ? H ? (Dt = an.renewPrice) != null ? Dt : 0 : (Jt = an.price) != null ? Jt : 0 : 0, en = an ? $ * an.limit * E : 0, _ = j(f), qn = _ ? _.price * _.limit * v : 0, gn = nn + en + qn, Bn = Math.min(F, gn), In = Math.max(gn - Bn, 0);
4116
4112
  q(In);
4117
4113
  {
4118
4114
  const K = document.createElement("tr");
@@ -4314,8 +4310,8 @@ function k1({
4314
4310
  An.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", An.innerText = g("promotion");
4315
4311
  const Tn = document.createElement("div");
4316
4312
  Tn.className = "wgt:flex wgt:items-center wgt:justify-end wgt:flex-wrap wgt:gap-2", a.forEach((Mn) => {
4317
- const qn = document.createElement("div");
4318
- qn.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", qn.innerText = Mn, Tn.appendChild(qn);
4313
+ const sn = document.createElement("div");
4314
+ sn.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", sn.innerText = Mn, Tn.appendChild(sn);
4319
4315
  }), Z.appendChild(An), Z.appendChild(Tn), w.appendChild(Z);
4320
4316
  }
4321
4317
  const B = document.createElement("hr");
@@ -4361,7 +4357,7 @@ function k1({
4361
4357
  const Y = yt({
4362
4358
  title: A ? g("confirmFreeOrder") || "Xác nhận đơn hàng" : g("cancelTransaction") || "Hủy giao dịch",
4363
4359
  className: A ? "wgt:flex-1 wgt:py-3 wgt:rounded-lg wgt:bg-primary wgt:text-white hover:wgt:bg-primary-dark" : "wgt:w-full wgt:py-3 wgt:rounded-lg wgt:bg-transparent wgt:border wgt:border-primary wgt:text-primary hover:wgt:bg-transparent",
4364
- handleClick: A ? () => sn(null, null, function* () {
4360
+ handleClick: A ? () => ln(null, null, function* () {
4365
4361
  Y.disabled = !0;
4366
4362
  const Z = Y.textContent;
4367
4363
  Y.textContent = g("processing") || "Đang xử lý...", U();
@@ -6195,7 +6191,7 @@ function ca({
6195
6191
  }
6196
6192
  const aa = 5;
6197
6193
  function ea(o) {
6198
- return sn(this, arguments, function* ({
6194
+ return ln(this, arguments, function* ({
6199
6195
  onNext: t,
6200
6196
  onPrev: n,
6201
6197
  step: e,
@@ -6266,7 +6262,7 @@ function ea(o) {
6266
6262
  }), n && (clearInterval(s), s = null, n());
6267
6263
  }), G.appendChild(R), N.appendChild(G);
6268
6264
  function T() {
6269
- return sn(this, null, function* () {
6265
+ return ln(this, null, function* () {
6270
6266
  const M = (h == null ? void 0 : h.totalAmountText) || 0;
6271
6267
  d = M, x = M === 0, Gn(Wn.STEP3_VIEWED, {
6272
6268
  orderId: r,
@@ -6278,7 +6274,7 @@ function ea(o) {
6278
6274
  });
6279
6275
  }
6280
6276
  function m(M) {
6281
- return sn(this, null, function* () {
6277
+ return ln(this, null, function* () {
6282
6278
  var D, j, O, U;
6283
6279
  if (!(i || x)) {
6284
6280
  i = !0, X();
@@ -6344,7 +6340,7 @@ function ea(o) {
6344
6340
  });
6345
6341
  }
6346
6342
  function P() {
6347
- x || s || (s = setInterval(() => sn(null, null, function* () {
6343
+ x || s || (s = setInterval(() => ln(null, null, function* () {
6348
6344
  var M, D, j, O, U, cn;
6349
6345
  try {
6350
6346
  const Y = yield kc(r);
@@ -6610,7 +6606,7 @@ function ga() {
6610
6606
  };
6611
6607
  }
6612
6608
  function Rh(c) {
6613
- return sn(this, arguments, function* ({
6609
+ return ln(this, arguments, function* ({
6614
6610
  orderId: t,
6615
6611
  callbackUrl: n,
6616
6612
  onCompleteSignature: e
@@ -6878,7 +6874,7 @@ function da({
6878
6874
  return { container: i, open: V, close: L };
6879
6875
  }
6880
6876
  function L0(t, n, e, c = !1, h = "ocb", a = "") {
6881
- return sn(this, null, function* () {
6877
+ return ln(this, null, function* () {
6882
6878
  var u, o;
6883
6879
  try {
6884
6880
  if (h !== "bvb") {
@@ -6899,7 +6895,7 @@ function L0(t, n, e, c = !1, h = "ocb", a = "") {
6899
6895
  // },
6900
6896
  onCancel: () => {
6901
6897
  },
6902
- onConfirm: () => sn(null, null, function* () {
6898
+ onConfirm: () => ln(null, null, function* () {
6903
6899
  const i = yield _t(t, n);
6904
6900
  e(!1, i);
6905
6901
  }),
@@ -6915,7 +6911,7 @@ function L0(t, n, e, c = !1, h = "ocb", a = "") {
6915
6911
  });
6916
6912
  }
6917
6913
  function Xa(t, n, e, c, h, a) {
6918
- return sn(this, null, function* () {
6914
+ return ln(this, null, function* () {
6919
6915
  var v, M;
6920
6916
  const o = [
6921
6917
  { name: "M-Invoice", route: "m-invoice", logoUrl: dc },
@@ -7075,7 +7071,7 @@ function Xa(t, n, e, c, h, a) {
7075
7071
  });
7076
7072
  }
7077
7073
  function G(D, j) {
7078
- return sn(this, null, function* () {
7074
+ return ln(this, null, function* () {
7079
7075
  D ? d = Yn(yn({}, d), {
7080
7076
  eInvoiceRegistration: {
7081
7077
  organization: yn({}, D.organization),
@@ -7089,7 +7085,7 @@ function Xa(t, n, e, c, h, a) {
7089
7085
  });
7090
7086
  }
7091
7087
  function R(D) {
7092
- return sn(this, null, function* () {
7088
+ return ln(this, null, function* () {
7093
7089
  if (D === 1) {
7094
7090
  const { container: j } = yield r1({
7095
7091
  isNewCustomer: k,
@@ -7097,7 +7093,7 @@ function Xa(t, n, e, c, h, a) {
7097
7093
  providerProps: {
7098
7094
  providers: o,
7099
7095
  selectedRoute: x.route,
7100
- onProviderChange: (O) => sn(null, null, function* () {
7096
+ onProviderChange: (O) => ln(null, null, function* () {
7101
7097
  var U, cn;
7102
7098
  x = O, yield L0(
7103
7099
  O.route,
@@ -7159,7 +7155,7 @@ function Xa(t, n, e, c, h, a) {
7159
7155
  isNewCustomer: k
7160
7156
  });
7161
7157
  const { container: j } = yield N1({
7162
- onNext: () => sn(null, null, function* () {
7158
+ onNext: () => ln(null, null, function* () {
7163
7159
  Gn(Wn.STEP2_COMPLETED, {
7164
7160
  theme: h,
7165
7161
  provider: x == null ? void 0 : x.route,
@@ -7273,7 +7269,7 @@ function Xa(t, n, e, c, h, a) {
7273
7269
  I && (i(T), m()), yield L0(
7274
7270
  x.route,
7275
7271
  (M = (v = d == null ? void 0 : d.eInvoiceRegistration) == null ? void 0 : v.organization) == null ? void 0 : M.taxCode,
7276
- (D, j) => sn(null, null, function* () {
7272
+ (D, j) => ln(null, null, function* () {
7277
7273
  I = !1, k = D, G(j), q.updateTitle(
7278
7274
  a ? g("eInvoiceRenewal") : g("eInvoiceRegister")
7279
7275
  );
@@ -7294,12 +7290,12 @@ function Xa(t, n, e, c, h, a) {
7294
7290
  });
7295
7291
  }
7296
7292
  function Ba(t, n, e, c) {
7297
- return sn(this, null, function* () {
7293
+ return ln(this, null, function* () {
7298
7294
  const { container: h, setContent: a } = ga(), u = e == null ? void 0 : e.orderId, o = (e == null ? void 0 : e.callbackUrl) || `${window.location.origin}/dashboard`, { container: A } = yield Rh({
7299
7295
  orderId: u,
7300
7296
  callbackUrl: o,
7301
7297
  // onCompleteSignature,
7302
- onCompleteSignature: (...i) => sn(null, null, function* () {
7298
+ onCompleteSignature: (...i) => ln(null, null, function* () {
7303
7299
  c && (yield c(...i)), r();
7304
7300
  })
7305
7301
  });