@invoice-sdk/widget 1.119.0 → 1.120.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-F-HfnKsx.js → index-CdN3aILt.js} +2 -2
- package/dist/{index-DenpejIA.js → index-DveBzjNY.js} +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +22 -22
- package/dist/{loading-CpzNkc72.js → loading-pdqPXs86.js} +44 -42
- package/dist/{widget-nsfT51qb.js → widget-DbDXoK_-.js} +472 -481
- package/package.json +1 -1
|
@@ -35,8 +35,8 @@ var sn = (t, n, e) => new Promise((c, h) => {
|
|
|
35
35
|
}, o = (u) => u.done ? c(u.value) : Promise.resolve(u.value).then(a, A);
|
|
36
36
|
o((e = e.apply(t, n)).next());
|
|
37
37
|
});
|
|
38
|
-
import { t as g, g as _h, a as $h, b as Pt, s as n0, c as Jt, d as Tc, e as xc, f as dc, m as wc, h as pc, i as Cc, v as fc } from "./index-
|
|
39
|
-
import { c as vt, a as c0, g as t0, b as Xc, f as Vn, d as Bc, e as e0, h as Nc, i as Ec, j as Hc, k as yc, l as Pc, m as kc, n as vc } from "./loading-
|
|
38
|
+
import { t as g, g as _h, a as $h, b as Pt, s as n0, c as Jt, d as Tc, e as xc, f as dc, m as wc, h as pc, i as Cc, v as fc } from "./index-DveBzjNY.js";
|
|
39
|
+
import { c as vt, a as c0, g as t0, b as Xc, f as Vn, d as Bc, e as e0, h as Nc, i as Ec, j as Hc, k as yc, l as Pc, m as kc, n as vc } from "./loading-pdqPXs86.js";
|
|
40
40
|
import { g as nc } from "./_commonjsHelpers-bAxELxBV.js";
|
|
41
41
|
function lh({ steps: t = [], currentStep: n = 1 } = {}) {
|
|
42
42
|
const e = document.createElement("div");
|
|
@@ -903,7 +903,7 @@ const Mc = ({
|
|
|
903
903
|
f.className = "wgt:text-red-500 wgt:ml-1", f.innerText = "*", V.appendChild(f), I.appendChild(V);
|
|
904
904
|
const N = document.createElement("select");
|
|
905
905
|
N.className = `${l} wgt:@max-2xl:w-full wgt:w-40`, N.title = g("invoiceTypeTooltip", "Loại hóa đơn");
|
|
906
|
-
const
|
|
906
|
+
const G = {
|
|
907
907
|
T: g("invoiceTypeT", "T (Đăng ký)"),
|
|
908
908
|
D: g("invoiceTypeD", "D (Tài sản)"),
|
|
909
909
|
L: g("invoiceTypeL", "L (CQT)"),
|
|
@@ -915,7 +915,7 @@ const Mc = ({
|
|
|
915
915
|
X: g("invoiceTypeX", "X (Thương mại)")
|
|
916
916
|
};
|
|
917
917
|
u.forEach((L) => {
|
|
918
|
-
N.append(new Option(
|
|
918
|
+
N.append(new Option(G[L], L));
|
|
919
919
|
}), I.appendChild(N), s.append(I);
|
|
920
920
|
const F = document.createElement("div");
|
|
921
921
|
F.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
@@ -939,7 +939,7 @@ const Mc = ({
|
|
|
939
939
|
}
|
|
940
940
|
return [k, B, v, N].forEach(
|
|
941
941
|
(L) => L.addEventListener("change", H)
|
|
942
|
-
), m.addEventListener("input", H), m.addEventListener("blur", H), /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(n) ? (k.value = n[0], B.value = n[1], v.value = n.slice(2, 4), N.value = n[4], m.value = n.slice(5, 7)) : (k.value = "1", B.value = "C", N.value = "
|
|
942
|
+
), m.addEventListener("input", H), m.addEventListener("blur", H), /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(n) ? (k.value = n[0], B.value = n[1], v.value = n.slice(2, 4), N.value = n[4], m.value = n.slice(5, 7)) : (k.value = "1", B.value = "C", N.value = "M", m.value = "YY"), H(), {
|
|
943
943
|
container: i,
|
|
944
944
|
getValue: P,
|
|
945
945
|
setValue: (L) => {
|
|
@@ -1112,11 +1112,11 @@ function Kc() {
|
|
|
1112
1112
|
return T.isDisabled && m.push("is-disabled"), T.isToday && m.push("is-today"), T.isSelected && (m.push("is-selected"), P = "true"), T.hasEvent && m.push("has-event"), T.isInRange && m.push("is-inrange"), T.isStartRange && m.push("is-startrange"), T.isEndRange && m.push("is-endrange"), '<td data-day="' + T.day + '" class="' + m.join(" ") + '" aria-selected="' + P + '"><button class="pika-button pika-day" type="button" data-pika-year="' + T.year + '" data-pika-month="' + T.month + '" data-pika-day="' + T.day + '">' + T.day + "</button></td>";
|
|
1113
1113
|
}, v = function(T, m) {
|
|
1114
1114
|
T.setHours(0, 0, 0, 0);
|
|
1115
|
-
var P = T.getDate(), H = T.getDay(), L = m, J = L - 1, D = 7,
|
|
1116
|
-
return (
|
|
1115
|
+
var P = T.getDate(), H = T.getDay(), L = m, J = L - 1, D = 7, _ = function(U) {
|
|
1116
|
+
return (U + D - 1) % D;
|
|
1117
1117
|
};
|
|
1118
|
-
T.setDate(P + J -
|
|
1119
|
-
var
|
|
1118
|
+
T.setDate(P + J - _(H));
|
|
1119
|
+
var nn = new Date(T.getFullYear(), 0, L), R = 1440 * 60 * 1e3, W = (T.getTime() - nn.getTime()) / R, S = 1 + Math.round((W - J + _(nn.getDay())) / D);
|
|
1120
1120
|
return S;
|
|
1121
1121
|
}, I = function(T, m, P, H) {
|
|
1122
1122
|
var L = new Date(P, m, T), J = c ? e(L).isoWeek() : v(L, H);
|
|
@@ -1130,13 +1130,13 @@ function Kc() {
|
|
|
1130
1130
|
for (T.showWeekNumber && P.push("<th></th>"), m = 0; m < 7; m++)
|
|
1131
1131
|
P.push('<th scope="col"><abbr title="' + C(T, m) + '">' + C(T, m, !0) + "</abbr></th>");
|
|
1132
1132
|
return "<thead><tr>" + (T.isRTL ? P.reverse() : P).join("") + "</tr></thead>";
|
|
1133
|
-
},
|
|
1134
|
-
var D,
|
|
1135
|
-
for (
|
|
1136
|
-
|
|
1137
|
-
for (
|
|
1138
|
-
D >= R.minYear &&
|
|
1139
|
-
return
|
|
1133
|
+
}, G = function(T, m, P, H, L, J) {
|
|
1134
|
+
var D, _, nn, R = T._o, W = P === R.minYear, S = P === R.maxYear, U = '<div id="' + J + '" class="pika-title" role="heading" aria-live="assertive">', ln, fn, mn = !0, Rn = !0;
|
|
1135
|
+
for (nn = [], D = 0; D < 12; D++)
|
|
1136
|
+
nn.push('<option value="' + (P === L ? D - m : 12 + D - m) + '"' + (D === H ? ' selected="selected"' : "") + (W && D < R.minMonth || S && D > R.maxMonth ? ' disabled="disabled"' : "") + ">" + R.i18n.months[D] + "</option>");
|
|
1137
|
+
for (ln = '<div class="pika-label">' + R.i18n.months[H] + '<select class="pika-select pika-select-month" tabindex="-1">' + nn.join("") + "</select></div>", l(R.yearRange) ? (D = R.yearRange[0], _ = R.yearRange[1] + 1) : (D = P - R.yearRange, _ = 1 + P + R.yearRange), nn = []; D < _ && D <= R.maxYear; D++)
|
|
1138
|
+
D >= R.minYear && nn.push('<option value="' + D + '"' + (D === P ? ' selected="selected"' : "") + ">" + D + "</option>");
|
|
1139
|
+
return fn = '<div class="pika-label">' + P + R.yearSuffix + '<select class="pika-select pika-select-year" tabindex="-1">' + nn.join("") + "</select></div>", R.showMonthAfterYear ? U += fn + ln : U += ln + fn, W && (H === 0 || R.minMonth >= H) && (mn = !1), S && (H === 11 || R.maxMonth <= H) && (Rn = !1), m === 0 && (U += '<button class="pika-prev' + (mn ? "" : " is-disabled") + '" type="button">' + R.i18n.previousMonth + "</button>"), m === T._o.numberOfMonths - 1 && (U += '<button class="pika-next' + (Rn ? "" : " is-disabled") + '" type="button">' + R.i18n.nextMonth + "</button>"), U += "</div>";
|
|
1140
1140
|
}, F = function(T, m, P) {
|
|
1141
1141
|
return '<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="' + P + '">' + N(T) + f(m) + "</table>";
|
|
1142
1142
|
}, z = function(T) {
|
|
@@ -1352,38 +1352,38 @@ function Kc() {
|
|
|
1352
1352
|
*/
|
|
1353
1353
|
draw: function(T) {
|
|
1354
1354
|
if (!(!this._v && !T)) {
|
|
1355
|
-
var m = this._o, P = m.minYear, H = m.maxYear, L = m.minMonth, J = m.maxMonth, D = "",
|
|
1355
|
+
var m = this._o, P = m.minYear, H = m.maxYear, L = m.minMonth, J = m.maxMonth, D = "", _;
|
|
1356
1356
|
this._y <= P && (this._y = P, !isNaN(L) && this._m < L && (this._m = L)), this._y >= H && (this._y = H, !isNaN(J) && this._m > J && (this._m = J));
|
|
1357
|
-
for (var
|
|
1358
|
-
|
|
1357
|
+
for (var nn = 0; nn < m.numberOfMonths; nn++)
|
|
1358
|
+
_ = "pika-title-" + Math.random().toString(36).replace(/[^a-z]+/g, "").substr(0, 2), D += '<div class="pika-lendar">' + G(this, nn, this.calendars[nn].year, this.calendars[nn].month, this.calendars[0].year, _) + this.render(this.calendars[nn].year, this.calendars[nn].month, _) + "</div>";
|
|
1359
1359
|
this.el.innerHTML = D, m.bound && m.field.type !== "hidden" && A(function() {
|
|
1360
1360
|
m.trigger.focus();
|
|
1361
1361
|
}, 1), typeof this._o.onDraw == "function" && this._o.onDraw(this), m.bound && m.field.setAttribute("aria-label", m.ariaLabel);
|
|
1362
1362
|
}
|
|
1363
1363
|
},
|
|
1364
1364
|
adjustPosition: function() {
|
|
1365
|
-
var T, m, P, H, L, J, D,
|
|
1365
|
+
var T, m, P, H, L, J, D, _, nn, R, W, S;
|
|
1366
1366
|
if (!this._o.container) {
|
|
1367
|
-
if (this.el.style.position = "absolute", T = this._o.trigger, m = T, P = this.el.offsetWidth, H = this.el.offsetHeight, L = window.innerWidth || a.documentElement.clientWidth, J = window.innerHeight || a.documentElement.clientHeight, D = window.pageYOffset || a.body.scrollTop || a.documentElement.scrollTop,
|
|
1368
|
-
R = T.getBoundingClientRect(),
|
|
1367
|
+
if (this.el.style.position = "absolute", T = this._o.trigger, m = T, P = this.el.offsetWidth, H = this.el.offsetHeight, L = window.innerWidth || a.documentElement.clientWidth, J = window.innerHeight || a.documentElement.clientHeight, D = window.pageYOffset || a.body.scrollTop || a.documentElement.scrollTop, W = !0, S = !0, typeof T.getBoundingClientRect == "function")
|
|
1368
|
+
R = T.getBoundingClientRect(), _ = R.left + window.pageXOffset, nn = R.bottom + window.pageYOffset;
|
|
1369
1369
|
else
|
|
1370
|
-
for (
|
|
1371
|
-
|
|
1372
|
-
(this._o.reposition &&
|
|
1370
|
+
for (_ = m.offsetLeft, nn = m.offsetTop + m.offsetHeight; m = m.offsetParent; )
|
|
1371
|
+
_ += m.offsetLeft, nn += m.offsetTop;
|
|
1372
|
+
(this._o.reposition && _ + P > L || this._o.position.indexOf("right") > -1 && _ - P + T.offsetWidth > 0) && (_ = _ - P + T.offsetWidth, W = !1), (this._o.reposition && nn + H > J + D || this._o.position.indexOf("top") > -1 && nn - H - T.offsetHeight > 0) && (nn = nn - H - T.offsetHeight, S = !1), this.el.style.left = _ + "px", this.el.style.top = nn + "px", r(this.el, W ? "left-aligned" : "right-aligned"), r(this.el, S ? "bottom-aligned" : "top-aligned"), s(this.el, W ? "right-aligned" : "left-aligned"), s(this.el, S ? "top-aligned" : "bottom-aligned");
|
|
1373
1373
|
}
|
|
1374
1374
|
},
|
|
1375
1375
|
/**
|
|
1376
1376
|
* render HTML for a particular month
|
|
1377
1377
|
*/
|
|
1378
1378
|
render: function(T, m, P) {
|
|
1379
|
-
var H = this._o, L = /* @__PURE__ */ new Date(), J = k(T, m), D = new Date(T, m, 1).getDay(),
|
|
1379
|
+
var H = this._o, L = /* @__PURE__ */ new Date(), J = k(T, m), D = new Date(T, m, 1).getDay(), _ = [], nn = [];
|
|
1380
1380
|
b(L), H.firstDay > 0 && (D -= H.firstDay, D < 0 && (D += 7));
|
|
1381
|
-
for (var R = m === 0 ? 11 : m - 1,
|
|
1381
|
+
for (var R = m === 0 ? 11 : m - 1, W = m === 11 ? 0 : m + 1, S = m === 0 ? T - 1 : T, U = m === 11 ? T + 1 : T, ln = k(S, R), fn = J + D, mn = fn; mn > 7; )
|
|
1382
1382
|
mn -= 7;
|
|
1383
|
-
|
|
1384
|
-
for (var Rn = !1, Dn = 0, Sn = 0; Dn <
|
|
1383
|
+
fn += 7 - mn;
|
|
1384
|
+
for (var Rn = !1, Dn = 0, Sn = 0; Dn < fn; Dn++) {
|
|
1385
1385
|
var pn = new Date(T, m, 1 + (Dn - D)), _n = x(this._d) ? p(pn, this._d) : !1, ct = p(pn, L), Zn = H.events.indexOf(pn.toDateString()) !== -1, ot = Dn < D || Dn >= J + D, Mn = 1 + (Dn - D), jn = m, Kn = T, mt = H.startRange && p(H.startRange, pn), qt = H.endRange && p(H.endRange, pn), Un = H.startRange && H.endRange && H.startRange < pn && pn < H.endRange, st = H.minDate && pn < H.minDate || H.maxDate && pn > H.maxDate || H.disableWeekends && d(pn) || H.disableDayFn && H.disableDayFn(pn);
|
|
1386
|
-
ot && (Dn < D ? (Mn =
|
|
1386
|
+
ot && (Dn < D ? (Mn = ln + Mn, jn = R, Kn = S) : (Mn = Mn - J, jn = W, Kn = U));
|
|
1387
1387
|
var Tt = {
|
|
1388
1388
|
day: Mn,
|
|
1389
1389
|
month: jn,
|
|
@@ -1399,9 +1399,9 @@ function Kc() {
|
|
|
1399
1399
|
showDaysInNextAndPreviousMonths: H.showDaysInNextAndPreviousMonths,
|
|
1400
1400
|
enableSelectionDaysInNextAndPreviousMonths: H.enableSelectionDaysInNextAndPreviousMonths
|
|
1401
1401
|
};
|
|
1402
|
-
H.pickWholeWeek && _n && (Rn = !0),
|
|
1402
|
+
H.pickWholeWeek && _n && (Rn = !0), nn.push(y(Tt)), ++Sn === 7 && (H.showWeekNumber && nn.unshift(I(Dn - D, m, T, H.firstWeekOfYearMinDays)), _.push(V(nn, H.isRTL, H.pickWholeWeek, Rn)), nn = [], Sn = 0, Rn = !1);
|
|
1403
1403
|
}
|
|
1404
|
-
return F(H,
|
|
1404
|
+
return F(H, _, P);
|
|
1405
1405
|
},
|
|
1406
1406
|
isVisible: function() {
|
|
1407
1407
|
return this._v;
|
|
@@ -1788,10 +1788,10 @@ function m1(t, n, e, c, h = 0.5) {
|
|
|
1788
1788
|
const i = t.data[o * 37], q = t.data[o * 37 + 1], r = t.data[o * 37 + 2], s = t.data[o * 37 + 3], l = 1, x = 1, d = [i, q, r, s], Q = t.data.slice(o * 37 + 5, o * 37 + 37), k = new Float32Array(25600);
|
|
1789
1789
|
for (let f = 0; f < 160; f++)
|
|
1790
1790
|
for (let N = 0; N < 160; N++) {
|
|
1791
|
-
let
|
|
1791
|
+
let G = 0;
|
|
1792
1792
|
for (let F = 0; F < 32; F++)
|
|
1793
|
-
|
|
1794
|
-
k[f * 160 + N] =
|
|
1793
|
+
G += Q[F] * n.data[F * 160 * 160 + f * 160 + N];
|
|
1794
|
+
k[f * 160 + N] = G > 0 ? 1 : 0;
|
|
1795
1795
|
}
|
|
1796
1796
|
const b = o1();
|
|
1797
1797
|
let p = b.length > 0 ? b[0] : [], w = p.length >= 4 ? p.slice(0, 4) : d;
|
|
@@ -2100,12 +2100,12 @@ function r1(l) {
|
|
|
2100
2100
|
p.className = "wgt:flex wgt:flex-col wgt:gap-4 wgt:w-full";
|
|
2101
2101
|
const w = document.createElement("form");
|
|
2102
2102
|
w.className = "wgt:w-full wgt:max-w-[1072px] wgt:mx-auto wgt:space-y-4", w.addEventListener("submit", (K) => {
|
|
2103
|
-
if (K.preventDefault(), !
|
|
2103
|
+
if (K.preventDefault(), !Bn()) return;
|
|
2104
2104
|
const M = Ln();
|
|
2105
2105
|
typeof t == "function" && t(M);
|
|
2106
2106
|
}), p.appendChild(w);
|
|
2107
|
-
let E, B, X, C, y, v, I, V, f, N,
|
|
2108
|
-
const
|
|
2107
|
+
let E, B, X, C, y, v, I, V, f, N, G, F, z, T, m, P, H, L, J, D, _, nn, R, W, S;
|
|
2108
|
+
const U = document.createElement("button");
|
|
2109
2109
|
E = Jn({
|
|
2110
2110
|
name: "taxCode",
|
|
2111
2111
|
label: g("taxCode"),
|
|
@@ -2119,9 +2119,9 @@ function r1(l) {
|
|
|
2119
2119
|
),
|
|
2120
2120
|
horizontal: !0,
|
|
2121
2121
|
onInput: (K) => {
|
|
2122
|
-
const M = K.target.value,
|
|
2123
|
-
|
|
2124
|
-
const on =
|
|
2122
|
+
const M = K.target.value, cn = M.replace(/[^\d-]/g, "");
|
|
2123
|
+
cn !== M && (K.target.value = cn);
|
|
2124
|
+
const on = cn.trim();
|
|
2125
2125
|
if (n._userHasEditedTaxCode = !0, k(), on.length === 0) {
|
|
2126
2126
|
E.setError(g("errorRequired", "Mã số thuế bắt buộc")), un();
|
|
2127
2127
|
return;
|
|
@@ -2153,7 +2153,7 @@ function r1(l) {
|
|
|
2153
2153
|
readOnly: !1,
|
|
2154
2154
|
horizontal: !0
|
|
2155
2155
|
});
|
|
2156
|
-
const
|
|
2156
|
+
const ln = Gc.map((K) => ({
|
|
2157
2157
|
value: K["cqt quản lý"],
|
|
2158
2158
|
label: K["tên cqt"],
|
|
2159
2159
|
id: K["ma xa"]
|
|
@@ -2162,7 +2162,7 @@ function r1(l) {
|
|
|
2162
2162
|
name: "companyTaxManagement",
|
|
2163
2163
|
label: g("taxAuthority"),
|
|
2164
2164
|
value: ((Tn = (An = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : An.organization) == null ? void 0 : Tn.taxAuthority) || "",
|
|
2165
|
-
options:
|
|
2165
|
+
options: ln,
|
|
2166
2166
|
required: !0,
|
|
2167
2167
|
error: null,
|
|
2168
2168
|
horizontal: !0,
|
|
@@ -2171,7 +2171,7 @@ function r1(l) {
|
|
|
2171
2171
|
K.target.id && a(K.target.id), un();
|
|
2172
2172
|
}
|
|
2173
2173
|
}), h) {
|
|
2174
|
-
const K =
|
|
2174
|
+
const K = ln.find(
|
|
2175
2175
|
(M) => M.id === h
|
|
2176
2176
|
);
|
|
2177
2177
|
K && C.setValue && C.setValue(
|
|
@@ -2180,7 +2180,7 @@ function r1(l) {
|
|
|
2180
2180
|
K.id
|
|
2181
2181
|
);
|
|
2182
2182
|
}
|
|
2183
|
-
|
|
2183
|
+
nn = ih({
|
|
2184
2184
|
label: g("uploadLogo", "Tải logo lên"),
|
|
2185
2185
|
required: !1,
|
|
2186
2186
|
file: (n == null ? void 0 : n.logo) || null,
|
|
@@ -2214,12 +2214,12 @@ function r1(l) {
|
|
|
2214
2214
|
readOnly: !0,
|
|
2215
2215
|
value: ((dn = (xn = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : xn.legalRepresentative) == null ? void 0 : dn.dob) || ""
|
|
2216
2216
|
});
|
|
2217
|
-
let
|
|
2217
|
+
let fn = new Yc({
|
|
2218
2218
|
field: N.inputEl,
|
|
2219
2219
|
format: "DD/MM/YYYY",
|
|
2220
2220
|
toString(K) {
|
|
2221
|
-
const M = String(K.getMonth() + 1).padStart(2, "0"),
|
|
2222
|
-
return `${
|
|
2221
|
+
const M = String(K.getMonth() + 1).padStart(2, "0"), cn = String(K.getDate()).padStart(2, "0"), on = K.getFullYear();
|
|
2222
|
+
return `${cn}/${M}/${on}`;
|
|
2223
2223
|
},
|
|
2224
2224
|
onSelect: (K) => {
|
|
2225
2225
|
N.setError(null), un();
|
|
@@ -2232,7 +2232,7 @@ function r1(l) {
|
|
|
2232
2232
|
showYearDropdown: !0,
|
|
2233
2233
|
yearRange: [1900, (/* @__PURE__ */ new Date()).getFullYear()]
|
|
2234
2234
|
});
|
|
2235
|
-
o(
|
|
2235
|
+
o(fn), G = q0({
|
|
2236
2236
|
name: "repGender",
|
|
2237
2237
|
label: g("gender"),
|
|
2238
2238
|
options: rh.map((K) => ({
|
|
@@ -2256,8 +2256,8 @@ function r1(l) {
|
|
|
2256
2256
|
value: ((In = (Nn = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : Nn.legalRepresentative) == null ? void 0 : In.idCard) || "",
|
|
2257
2257
|
onInput: (K) => {
|
|
2258
2258
|
let M = K.target.value;
|
|
2259
|
-
const
|
|
2260
|
-
if (
|
|
2259
|
+
const cn = M.replace(/[^0-9]/g, "");
|
|
2260
|
+
if (cn !== M && (K.target.value = cn, M = cn), M.trim() === "") {
|
|
2261
2261
|
z.setError(g("errorRequired"));
|
|
2262
2262
|
return;
|
|
2263
2263
|
}
|
|
@@ -2283,8 +2283,8 @@ function r1(l) {
|
|
|
2283
2283
|
value: ((K0 = (D0 = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : D0.legalRepresentative) == null ? void 0 : K0.phone) || "",
|
|
2284
2284
|
onInput: (K) => {
|
|
2285
2285
|
let M = K.target.value;
|
|
2286
|
-
const
|
|
2287
|
-
if (
|
|
2286
|
+
const cn = M.replace(/[^\d+().\-\s]/g, ""), on = cn.replace(/[\s.\-()]/g, "");
|
|
2287
|
+
if (cn !== M && (K.target.value = cn, M = cn), on.trim() === "") {
|
|
2288
2288
|
F.setError(g("errorRequired", "Số điện thoại bắt buộc"));
|
|
2289
2289
|
return;
|
|
2290
2290
|
}
|
|
@@ -2370,14 +2370,14 @@ function r1(l) {
|
|
|
2370
2370
|
);
|
|
2371
2371
|
return;
|
|
2372
2372
|
}
|
|
2373
|
-
const
|
|
2373
|
+
const cn = 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}$");
|
|
2374
2374
|
if (M.length > 254) {
|
|
2375
2375
|
v.setError(
|
|
2376
2376
|
g("errorInvalidEmailLength", "Email quá dài (tối đa 254 ký tự).")
|
|
2377
2377
|
);
|
|
2378
2378
|
return;
|
|
2379
2379
|
}
|
|
2380
|
-
|
|
2380
|
+
cn.test(M) ? v.setError(null) : v.setError(
|
|
2381
2381
|
g("errorInvalidEmail", "Email không hợp lệ")
|
|
2382
2382
|
);
|
|
2383
2383
|
}
|
|
@@ -2391,8 +2391,8 @@ function r1(l) {
|
|
|
2391
2391
|
value: ((U0 = (j0 = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : j0.contactPerson) == null ? void 0 : U0.phone) || "",
|
|
2392
2392
|
onInput: (K) => {
|
|
2393
2393
|
let M = K.target.value;
|
|
2394
|
-
const
|
|
2395
|
-
if (
|
|
2394
|
+
const cn = M.replace(/[^\d+().\-\s]/g, ""), on = cn.replace(/[\s.\-()]/g, "");
|
|
2395
|
+
if (cn !== M && (K.target.value = cn, M = cn), on.trim() === "") {
|
|
2396
2396
|
I.setError(
|
|
2397
2397
|
g("errorRequired", "Số điện thoại bắt buộc")
|
|
2398
2398
|
);
|
|
@@ -2438,14 +2438,14 @@ function r1(l) {
|
|
|
2438
2438
|
});
|
|
2439
2439
|
H = Mc({
|
|
2440
2440
|
isRenewal: s,
|
|
2441
|
-
initialValue: r || ((th = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : th.invoiceSymbol) || "
|
|
2441
|
+
initialValue: r || ((th = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : th.invoiceSymbol) || "1C26MYY",
|
|
2442
2442
|
onChange: (K) => {
|
|
2443
2443
|
mn.inputEl.value = K, un();
|
|
2444
2444
|
}
|
|
2445
2445
|
}), L = document.createElement("input"), L.type = "checkbox", L.name = "hasUsedEInvoiceCB", L.className = "wgt:cursor-pointer", L.checked = (hh = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : hh.hasUsedEInvoice, L.addEventListener("change", (K) => {
|
|
2446
|
-
K.target.checked ? (On.appendChild(
|
|
2446
|
+
K.target.checked ? (On.appendChild(Y), On.appendChild(j)) : (J.checked = !1, _.inputEl.value = "", _.setError(null), D && (D.inputEl.value = "", D.setError(null), j.contains(D.container) && j.removeChild(D.container)), On.removeChild(Y), On.removeChild(j));
|
|
2447
2447
|
}), J = document.createElement("input"), J.type = "checkbox", J.name = "hasUsedEInvoiceBeforeCB", J.className = "wgt:cursor-pointer", J.checked = (ch = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : ch.isUsedEInvoiceBefore, J.addEventListener("change", (K) => {
|
|
2448
|
-
K.target.checked ?
|
|
2448
|
+
K.target.checked ? j.appendChild(D.container) : (D.inputEl.value = "", D.setError(null), j.contains(D.container) && j.removeChild(D.container));
|
|
2449
2449
|
}), D = Jn({
|
|
2450
2450
|
name: "previousOtherProviderNameField",
|
|
2451
2451
|
label: g("providerName", "Tên NCC"),
|
|
@@ -2470,7 +2470,7 @@ function r1(l) {
|
|
|
2470
2470
|
)
|
|
2471
2471
|
);
|
|
2472
2472
|
}
|
|
2473
|
-
}),
|
|
2473
|
+
}), _ = Jn({
|
|
2474
2474
|
name: "previousIssuedByTaxCodeField",
|
|
2475
2475
|
label: g("taxAuthorityCode", "Mã CQT đã phát hành hóa đơn"),
|
|
2476
2476
|
required: !0,
|
|
@@ -2482,12 +2482,12 @@ function r1(l) {
|
|
|
2482
2482
|
onInput: (K) => {
|
|
2483
2483
|
const M = K.target.value;
|
|
2484
2484
|
if (M.trim() === "") {
|
|
2485
|
-
|
|
2485
|
+
_.setError(
|
|
2486
2486
|
g("errorRequired", "Mã CQT bắt buộc")
|
|
2487
2487
|
);
|
|
2488
2488
|
return;
|
|
2489
2489
|
}
|
|
2490
|
-
/^[A-Za-z0-9_]+$/.test(M) ?
|
|
2490
|
+
/^[A-Za-z0-9_]+$/.test(M) ? _.setError(null) : _.setError(
|
|
2491
2491
|
g(
|
|
2492
2492
|
"errorInvalidTaxAuthorityCode",
|
|
2493
2493
|
"Mã CQT không hợp lệ. Chỉ được dùng chữ cái, số và dấu gạch dưới"
|
|
@@ -2501,7 +2501,7 @@ function r1(l) {
|
|
|
2501
2501
|
const M = ++Rn;
|
|
2502
2502
|
E.setError(null);
|
|
2503
2503
|
try {
|
|
2504
|
-
const
|
|
2504
|
+
const cn = yield Xc(K.trim());
|
|
2505
2505
|
let on = {
|
|
2506
2506
|
name: "",
|
|
2507
2507
|
address: "",
|
|
@@ -2510,10 +2510,10 @@ function r1(l) {
|
|
|
2510
2510
|
};
|
|
2511
2511
|
if (M !== Rn)
|
|
2512
2512
|
return;
|
|
2513
|
-
if (E.setError(null), B.inputEl.value =
|
|
2514
|
-
const bn = (Fn) => Fn.toLowerCase().replace(/phường\s+/i, "").replace(/xã\s+/i, "").replace(/quận\s+/i, "").trim(),
|
|
2513
|
+
if (E.setError(null), B.inputEl.value = cn.ten_cty || "", X.inputEl.value = cn.dia_chi || "", cn.cqthue_ql) {
|
|
2514
|
+
const bn = (Fn) => Fn.toLowerCase().replace(/phường\s+/i, "").replace(/xã\s+/i, "").replace(/quận\s+/i, "").trim(), gn = bn(cn.cqthue_ql), En = ln.find((Fn) => {
|
|
2515
2515
|
const ht = bn(Fn.label);
|
|
2516
|
-
return ht.includes(
|
|
2516
|
+
return ht.includes(gn) || gn.includes(ht);
|
|
2517
2517
|
});
|
|
2518
2518
|
En && (C.setValue && C.setValue(
|
|
2519
2519
|
En.value,
|
|
@@ -2522,8 +2522,8 @@ function r1(l) {
|
|
|
2522
2522
|
), on.taxAuthority = En.id || "", C.setDisabled(!1));
|
|
2523
2523
|
} else
|
|
2524
2524
|
C.setValue && C.setValue("", "", ""), C.setDisabled(!1);
|
|
2525
|
-
return on.name =
|
|
2526
|
-
} catch (
|
|
2525
|
+
return on.name = cn.ten_cty || "", on.address = cn.dia_chi || "", on.taxCode = K, E.setError(null), on;
|
|
2526
|
+
} catch (cn) {
|
|
2527
2527
|
M === Rn && (Xt.error(
|
|
2528
2528
|
g("errorFetchTaxInfo", "Lỗi khi lấy thông tin mã số thuế."),
|
|
2529
2529
|
{
|
|
@@ -2546,7 +2546,7 @@ function r1(l) {
|
|
|
2546
2546
|
const _n = document.createElement("div");
|
|
2547
2547
|
_n.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(_n), _n.appendChild(E.container), _n.appendChild(B.container), _n.appendChild(X.container), _n.appendChild(C.container);
|
|
2548
2548
|
const ct = document.createElement("div");
|
|
2549
|
-
ct.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4", Sn.appendChild(ct), ct.appendChild(
|
|
2549
|
+
ct.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4", Sn.appendChild(ct), ct.appendChild(nn.container), w.appendChild(Sn);
|
|
2550
2550
|
const Zn = document.createElement("div");
|
|
2551
2551
|
Zn.className = "wgt:space-y-4";
|
|
2552
2552
|
const ot = document.createElement("h3");
|
|
@@ -2570,56 +2570,56 @@ function r1(l) {
|
|
|
2570
2570
|
function Un(K) {
|
|
2571
2571
|
return new Promise((M) => {
|
|
2572
2572
|
jn = !1, Kn = !1, qt();
|
|
2573
|
-
const
|
|
2574
|
-
z.inputEl.value = "", f.inputEl.value = "", N.inputEl.value = "", P.inputEl.value = "",
|
|
2575
|
-
}, on = (
|
|
2576
|
-
if (!
|
|
2577
|
-
if (/^\d{8}$/.test(
|
|
2578
|
-
const yt =
|
|
2573
|
+
const cn = () => {
|
|
2574
|
+
z.inputEl.value = "", f.inputEl.value = "", N.inputEl.value = "", P.inputEl.value = "", G.selectEl.value = "", m.selectEl.value = "", z.setError(null), f.setError(null), N.setError(null), P.setError(null), G.setError(null), m.setError(null), A && typeof A.setDate == "function" && A.setDate(null);
|
|
2575
|
+
}, on = (gn) => {
|
|
2576
|
+
if (!gn) return "";
|
|
2577
|
+
if (/^\d{8}$/.test(gn)) {
|
|
2578
|
+
const yt = gn.slice(0, 2), m0 = gn.slice(2, 4), lc = gn.slice(4, 8);
|
|
2579
2579
|
return `${yt}/${m0}/${lc}`;
|
|
2580
2580
|
}
|
|
2581
|
-
const [En, Fn, ht] =
|
|
2581
|
+
const [En, Fn, ht] = gn.split("/"), pt = new Date(+ht, +Fn - 1, +En);
|
|
2582
2582
|
if (isNaN(pt)) return "";
|
|
2583
2583
|
const Ct = String(pt.getDate()).padStart(2, "0"), Gt = String(pt.getMonth() + 1).padStart(2, "0"), Rt = pt.getFullYear();
|
|
2584
2584
|
return `${Ct}/${Gt}/${Rt}`;
|
|
2585
2585
|
}, bn = new Image();
|
|
2586
2586
|
bn.src = URL.createObjectURL(K), bn.onload = () => sn(null, null, function* () {
|
|
2587
2587
|
try {
|
|
2588
|
-
const
|
|
2589
|
-
if (
|
|
2588
|
+
const gn = yield i1(bn).then((En) => JSON.parse(En).status !== "success" ? (jn = !0, Kn = !1, cn(), qt(), null) : JSON.parse(En).data);
|
|
2589
|
+
if (gn || M({ success: !1, reason: "No data detected" }), gn) {
|
|
2590
2590
|
jn = !1, Kn = !0, qt();
|
|
2591
|
-
const Fn = Object.values(
|
|
2592
|
-
|
|
2591
|
+
const Fn = Object.values(gn).every((yt) => !yt);
|
|
2592
|
+
cn(), Fn && (lt(
|
|
2593
2593
|
g("errorInvalidCard", "Vui lòng tải lên ảnh CMND/CCCD hợp lệ")
|
|
2594
|
-
),
|
|
2595
|
-
const { address: ht, date_of_birth: pt, full_name: Ct, id_number: Gt, sex: Rt } =
|
|
2594
|
+
), cn(), M({ success: !1, reason: "Invalid card data" }));
|
|
2595
|
+
const { address: ht, date_of_birth: pt, full_name: Ct, id_number: Gt, sex: Rt } = gn;
|
|
2596
2596
|
if (!Gt || !/^\d{12}$/.test(Gt) ? (lt(
|
|
2597
2597
|
g("errorInvalidCard", "Số CCCD phải có 12 chữ số")
|
|
2598
2598
|
), z.inputEl.value = "") : (z.inputEl.value = Gt, z.setError(null)), f.inputEl.value = Ct || "", N.inputEl.value = on(pt), P.inputEl.value = ht || "", Rt) {
|
|
2599
2599
|
const yt = rh.find(
|
|
2600
2600
|
(m0) => m0.label.toLowerCase() === Rt.toLowerCase()
|
|
2601
2601
|
);
|
|
2602
|
-
|
|
2602
|
+
G.selectEl.value = (yt == null ? void 0 : yt.value) || "";
|
|
2603
2603
|
}
|
|
2604
2604
|
}
|
|
2605
|
-
M({ success: !0, data:
|
|
2606
|
-
} catch (
|
|
2607
|
-
console.error("readIdentityCard failed",
|
|
2605
|
+
M({ success: !0, data: gn });
|
|
2606
|
+
} catch (gn) {
|
|
2607
|
+
console.error("readIdentityCard failed", gn);
|
|
2608
2608
|
} finally {
|
|
2609
2609
|
un();
|
|
2610
2610
|
}
|
|
2611
2611
|
});
|
|
2612
2612
|
});
|
|
2613
2613
|
}
|
|
2614
|
-
function st(K, M,
|
|
2614
|
+
function st(K, M, cn) {
|
|
2615
2615
|
const on = new Image();
|
|
2616
2616
|
on.src = URL.createObjectURL(K), on.onload = () => sn(null, null, function* () {
|
|
2617
2617
|
yield u1(on).then((bn) => {
|
|
2618
2618
|
var En, Fn;
|
|
2619
|
-
const
|
|
2620
|
-
M && !((En =
|
|
2619
|
+
const gn = JSON.parse(bn);
|
|
2620
|
+
M && !((En = gn == null ? void 0 : gn.data) != null && En.isFront) ? lt(
|
|
2621
2621
|
g("errorInvalidCard", "Vui lòng tải lên ảnh CMND/CCCD hợp lệ")
|
|
2622
|
-
) :
|
|
2622
|
+
) : cn && !((Fn = gn == null ? void 0 : gn.data) != null && Fn.isBack) && u0(
|
|
2623
2623
|
g("errorInvalidCard", "Vui lòng tải lên ảnh CMND/CCCD hợp lệ")
|
|
2624
2624
|
);
|
|
2625
2625
|
});
|
|
@@ -2637,12 +2637,12 @@ function r1(l) {
|
|
|
2637
2637
|
frontFile: n == null ? void 0 : n.idCard,
|
|
2638
2638
|
backFile: n == null ? void 0 : n.idCardBack,
|
|
2639
2639
|
onFrontChange: (K) => sn(null, null, function* () {
|
|
2640
|
-
var
|
|
2641
|
-
if (
|
|
2640
|
+
var cn, on;
|
|
2641
|
+
if (W = K, st(K, !0, !1), xt() || dt() || !o0()) {
|
|
2642
2642
|
jn = !1, Kn = !1, qt(), un();
|
|
2643
2643
|
return;
|
|
2644
2644
|
}
|
|
2645
|
-
if ((on = (
|
|
2645
|
+
if ((on = (cn = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : cn.legalRepresentative) == null ? void 0 : on.idCard) {
|
|
2646
2646
|
un();
|
|
2647
2647
|
return;
|
|
2648
2648
|
}
|
|
@@ -2666,7 +2666,7 @@ function r1(l) {
|
|
|
2666
2666
|
const It = document.createElement("div");
|
|
2667
2667
|
It.className = "wgt:space-y-4", It.appendChild(f.container);
|
|
2668
2668
|
const Nt = document.createElement("div");
|
|
2669
|
-
Nt.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4", It.appendChild(Nt), Nt.appendChild(N.container), Nt.appendChild(
|
|
2669
|
+
Nt.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4", It.appendChild(Nt), Nt.appendChild(N.container), Nt.appendChild(G.container), Mn.appendChild(It);
|
|
2670
2670
|
const nt = document.createElement("div");
|
|
2671
2671
|
nt.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-4 wgt:gap-4 wgt:items-start", nt.appendChild(z.container), nt.appendChild(T.container), nt.appendChild(F.container), nt.appendChild(m.container), Zn.appendChild(Mn), Zn.appendChild(nt), Zn.appendChild(P.container), Zn.appendChild(R.container);
|
|
2672
2672
|
const Et = document.createElement("ul");
|
|
@@ -2697,20 +2697,20 @@ function r1(l) {
|
|
|
2697
2697
|
"hasUsedEInvoice",
|
|
2698
2698
|
"Bạn đã sử dụng hoá đơn điện tử?"
|
|
2699
2699
|
), kn.appendChild(Vt), s || On.appendChild(kn), L.checked = s, L.disabled = s;
|
|
2700
|
-
const
|
|
2701
|
-
if (
|
|
2702
|
-
|
|
2700
|
+
const Y = document.createElement("div");
|
|
2701
|
+
if (Y.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", !s) {
|
|
2702
|
+
Y.appendChild(J);
|
|
2703
2703
|
const K = document.createElement("h4");
|
|
2704
2704
|
K.className = "wgt:font-semibold wgt:italic", K.innerText = g(
|
|
2705
2705
|
"hasUsedEInvoiceBefore",
|
|
2706
2706
|
"Bạn đang sử dụng nhà NCC hoá đơn điện tử khác M-invoice không?"
|
|
2707
|
-
),
|
|
2707
|
+
), Y.appendChild(K);
|
|
2708
2708
|
}
|
|
2709
|
-
const U = document.createElement("div");
|
|
2710
|
-
U.className = "wgt:w-full wgt:flex wgt:flex-row-reverse wgt:space-x-4 wgt:gap-4 wgt:items-start wgt:justify-start wgt:@max-2xl:flex-col wgt:@max-2xl:flex-col-reverse", U.appendChild(Z.container);
|
|
2711
2709
|
const j = document.createElement("div");
|
|
2712
|
-
j.className = "wgt:flex wgt:
|
|
2713
|
-
|
|
2710
|
+
j.className = "wgt:w-full wgt:flex wgt:flex-row-reverse wgt:space-x-4 wgt:gap-4 wgt:items-start wgt:justify-start wgt:@max-2xl:flex-col wgt:@max-2xl:flex-col-reverse", j.appendChild(_.container);
|
|
2711
|
+
const Z = document.createElement("div");
|
|
2712
|
+
Z.className = "wgt:flex wgt:items-center wgt:space-x-2 wgt:mt-4";
|
|
2713
|
+
let tn = !0;
|
|
2714
2714
|
const an = document.createElement("div");
|
|
2715
2715
|
an.className = [
|
|
2716
2716
|
"wgt:w-4",
|
|
@@ -2728,28 +2728,28 @@ function r1(l) {
|
|
|
2728
2728
|
].join(" ");
|
|
2729
2729
|
const $ = "http://www.w3.org/2000/svg", en = document.createElementNS($, "svg");
|
|
2730
2730
|
en.setAttribute("viewBox", "0 0 24 24"), en.setAttribute("class", "wgt:w-4 wgt:h-4 wgt:text-white");
|
|
2731
|
-
const
|
|
2732
|
-
|
|
2731
|
+
const hn = document.createElementNS($, "path");
|
|
2732
|
+
hn.setAttribute("fill-rule", "evenodd"), hn.setAttribute("clip-rule", "evenodd"), hn.setAttribute(
|
|
2733
2733
|
"d",
|
|
2734
2734
|
"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"
|
|
2735
|
-
),
|
|
2735
|
+
), hn.setAttribute("fill", "white"), en.appendChild(hn), an.appendChild(en);
|
|
2736
2736
|
const qn = document.createElement("label");
|
|
2737
2737
|
qn.className = "wgt:text-sm wgt:text-strong-950 wgt:leading-tight", qn.appendChild(
|
|
2738
2738
|
document.createTextNode(g("agreeWith", "Tôi đồng ý với ") + " ")
|
|
2739
2739
|
);
|
|
2740
2740
|
const rn = (K) => {
|
|
2741
2741
|
const M = document.createElement("button");
|
|
2742
|
-
return M.className = "wgt:text-primary wgt:font-semibold wgt:hover:underline wgt:cursor-pointer", M.textContent = K, M.onclick = (
|
|
2743
|
-
|
|
2742
|
+
return M.className = "wgt:text-primary wgt:font-semibold wgt:hover:underline wgt:cursor-pointer", M.textContent = K, M.onclick = (cn) => {
|
|
2743
|
+
cn.preventDefault(), typeof c == "function" && c();
|
|
2744
2744
|
}, M;
|
|
2745
|
-
},
|
|
2745
|
+
}, Xn = bc(e);
|
|
2746
2746
|
qn.appendChild(
|
|
2747
2747
|
rn(g("termsAndUsagePolicy", "Điều khoản và Chính sách sử dụng"))
|
|
2748
|
-
), qn.appendChild(document.createTextNode(` ${g("of", "của")} ${
|
|
2749
|
-
|
|
2748
|
+
), qn.appendChild(document.createTextNode(` ${g("of", "của")} ${Xn}.`)), Z.appendChild(an), Z.appendChild(qn), w.appendChild(Z), an.addEventListener("click", () => {
|
|
2749
|
+
tn = !tn, tn ? (an.classList.add("wgt:bg-primary"), en.classList.remove("wgt:hidden")) : (an.classList.remove("wgt:bg-primary"), en.classList.add("wgt:hidden")), un();
|
|
2750
2750
|
});
|
|
2751
2751
|
const vn = document.createElement("div");
|
|
2752
|
-
vn.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ",
|
|
2752
|
+
vn.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ", U.type = "submit", U.innerText = g("next"), U.className = [
|
|
2753
2753
|
"wgt:bg-primary",
|
|
2754
2754
|
"wgt:hover:bg-primary-dark",
|
|
2755
2755
|
"wgt:text-text-primary",
|
|
@@ -2760,31 +2760,31 @@ function r1(l) {
|
|
|
2760
2760
|
"wgt:disabled:cursor-not-allowed",
|
|
2761
2761
|
"wgt:cursor-pointer",
|
|
2762
2762
|
"wgt:hover:text-primary-hover-text"
|
|
2763
|
-
].join(" "), vn.appendChild(
|
|
2764
|
-
function
|
|
2765
|
-
const K = Ln(), M = K.eInvoiceRegistration,
|
|
2766
|
-
if (!M.contactPerson.address || !M.organization.name || !M.organization.address || !
|
|
2763
|
+
].join(" "), vn.appendChild(U), p.appendChild(vn);
|
|
2764
|
+
function Bn() {
|
|
2765
|
+
const K = Ln(), M = K.eInvoiceRegistration, cn = (M.organization.taxCode || "").trim();
|
|
2766
|
+
if (!M.contactPerson.address || !M.organization.name || !M.organization.address || !cn || !M.organization.taxAuthority || !M.contactPerson.name || !M.contactPerson.email || !M.contactPerson.phone || !M.legalRepresentative.name || !M.legalRepresentative.dob || !M.legalRepresentative.gender || !M.legalRepresentative.phone || !M.legalRepresentative.idCard || !M.legalRepresentative.permanentAddress || !M.invoiceSymbol || !s && M.hasUsedEInvoice && !M.taxAuthorityCode || M.isUsedEInvoiceBefore && !M.previousEInvoiceProvider || !jt(M.contactPerson.name) || !jt(M.legalRepresentative.name) || !/^[\p{L}0-9\s,.\-/()]*$/u.test(M.contactPerson.address) || !/^[\p{L}0-9\s,.\-/()]*$/u.test(
|
|
2767
2767
|
M.legalRepresentative.permanentAddress
|
|
2768
2768
|
) || M.isUsedEInvoiceBefore && !/^[\p{L}0-9_]+(?: [\p{L}0-9_]+)*$/u.test(M.previousEInvoiceProvider) || !s && M.hasUsedEInvoice && !/^[A-Za-z0-9_]+$/.test(M.taxAuthorityCode))
|
|
2769
2769
|
return !1;
|
|
2770
|
-
const
|
|
2770
|
+
const gn = M.contactPerson.phone.replace(
|
|
2771
2771
|
/[^\d+().\-\s]/g,
|
|
2772
2772
|
""
|
|
2773
2773
|
).replace(
|
|
2774
2774
|
/[\s.\-()]/g,
|
|
2775
2775
|
""
|
|
2776
2776
|
), Fn = M.legalRepresentative.phone.replace(/[^\d+().\-\s]/g, "").replace(/[\s.\-()]/g, ""), ht = /^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/;
|
|
2777
|
-
return !(!ht.test(
|
|
2777
|
+
return !(!ht.test(gn) || !ht.test(Fn) || !/^\d{12}$/.test(M.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(M.contactPerson.email) || !/^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(M.invoiceSymbol) || !K.license || !K.idCard || !K.idCardBack);
|
|
2778
2778
|
}
|
|
2779
2779
|
function un() {
|
|
2780
2780
|
const K = e === "bvb" && !s && u === !1 && !n._userHasEditedTaxCode;
|
|
2781
|
-
|
|
2781
|
+
U.disabled = !Bn() || !tn || xt() || dt() || nn.getError() || R.getError() || K;
|
|
2782
2782
|
}
|
|
2783
2783
|
function Ln() {
|
|
2784
2784
|
var K, M;
|
|
2785
2785
|
return {
|
|
2786
2786
|
eInvoiceRegistration: {
|
|
2787
|
-
taxAuthorityCode: s ? "1" : (K =
|
|
2787
|
+
taxAuthorityCode: s ? "1" : (K = _ == null ? void 0 : _.getValue()) != null ? K : "",
|
|
2788
2788
|
previousEInvoiceProvider: (M = D == null ? void 0 : D.getValue()) != null ? M : "",
|
|
2789
2789
|
organization: {
|
|
2790
2790
|
name: B == null ? void 0 : B.getValue(),
|
|
@@ -2801,7 +2801,7 @@ function r1(l) {
|
|
|
2801
2801
|
legalRepresentative: {
|
|
2802
2802
|
name: f == null ? void 0 : f.getValue(),
|
|
2803
2803
|
dob: N == null ? void 0 : N.getValue(),
|
|
2804
|
-
gender:
|
|
2804
|
+
gender: G == null ? void 0 : G.getValue(),
|
|
2805
2805
|
phone: F == null ? void 0 : F.getValue(),
|
|
2806
2806
|
idCard: z == null ? void 0 : z.getValue(),
|
|
2807
2807
|
passportNumber: T == null ? void 0 : T.getValue(),
|
|
@@ -2813,8 +2813,8 @@ function r1(l) {
|
|
|
2813
2813
|
invoiceSymbol: H == null ? void 0 : H.getValue()
|
|
2814
2814
|
},
|
|
2815
2815
|
license: R == null ? void 0 : R.getValues(),
|
|
2816
|
-
logo:
|
|
2817
|
-
idCard:
|
|
2816
|
+
logo: nn == null ? void 0 : nn.getValues(),
|
|
2817
|
+
idCard: W,
|
|
2818
2818
|
idCardBack: S
|
|
2819
2819
|
};
|
|
2820
2820
|
}
|
|
@@ -2831,17 +2831,17 @@ function r1(l) {
|
|
|
2831
2831
|
F,
|
|
2832
2832
|
z,
|
|
2833
2833
|
P,
|
|
2834
|
-
|
|
2834
|
+
_,
|
|
2835
2835
|
D
|
|
2836
2836
|
].forEach((K) => {
|
|
2837
2837
|
K.inputEl.addEventListener("input", un);
|
|
2838
|
-
}), [
|
|
2838
|
+
}), [G, C].forEach((K) => {
|
|
2839
2839
|
K.selectEl.addEventListener("change", un);
|
|
2840
2840
|
}), [L, J].forEach((K) => {
|
|
2841
2841
|
K.addEventListener("change", un);
|
|
2842
|
-
}),
|
|
2843
|
-
var bn,
|
|
2844
|
-
if (K.preventDefault(), !
|
|
2842
|
+
}), U.addEventListener("click", (K) => sn(null, null, function* () {
|
|
2843
|
+
var bn, gn;
|
|
2844
|
+
if (K.preventDefault(), !Bn()) return;
|
|
2845
2845
|
const M = E.getValue().trim();
|
|
2846
2846
|
if (!wh(M)) {
|
|
2847
2847
|
E.setError(g("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), Xt.error(g("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), b();
|
|
@@ -2863,13 +2863,13 @@ function r1(l) {
|
|
|
2863
2863
|
}), t(Ln());
|
|
2864
2864
|
return;
|
|
2865
2865
|
}
|
|
2866
|
-
|
|
2867
|
-
let
|
|
2866
|
+
U.disabled = !0;
|
|
2867
|
+
let cn = null, on = !1;
|
|
2868
2868
|
try {
|
|
2869
2869
|
const En = (n == null ? void 0 : n.provider) || "m-invoice";
|
|
2870
2870
|
console.log("Current theme:", e), console.log("Provider being used:", En);
|
|
2871
|
-
const Fn = ((bn = H == null ? void 0 : H.getValue) == null ? void 0 : bn.call(H)) || ((
|
|
2872
|
-
if (
|
|
2871
|
+
const Fn = ((bn = H == null ? void 0 : H.getValue) == null ? void 0 : bn.call(H)) || ((gn = mn == null ? void 0 : mn.inputEl) == null ? void 0 : gn.value) || "", ht = d(Fn);
|
|
2872
|
+
if (cn = (yield c0(En, M, ht)).isNewCustomer, cn)
|
|
2873
2873
|
k();
|
|
2874
2874
|
else {
|
|
2875
2875
|
n._userHasEditedTaxCode = !1;
|
|
@@ -2890,9 +2890,9 @@ function r1(l) {
|
|
|
2890
2890
|
} catch (En) {
|
|
2891
2891
|
on = !0, console.error("Error checking customer:", En);
|
|
2892
2892
|
} finally {
|
|
2893
|
-
|
|
2893
|
+
U.disabled = !1, U.innerText = g("next");
|
|
2894
2894
|
}
|
|
2895
|
-
on ||
|
|
2895
|
+
on || cn === !1 || cn === !0 && (Gn(Wn.STEP1_COMPLETED, {
|
|
2896
2896
|
theme: e,
|
|
2897
2897
|
isRenewal: !1,
|
|
2898
2898
|
isNewCustomer: !0,
|
|
@@ -2900,7 +2900,7 @@ function r1(l) {
|
|
|
2900
2900
|
}), t(Ln()));
|
|
2901
2901
|
}));
|
|
2902
2902
|
const rt = (((uh = (Ah = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : Ah.organization) == null ? void 0 : uh.taxCode) || "").trim();
|
|
2903
|
-
return rt.length >= 10 && Dn(rt), ac($h(), _h().invoiceHubBaseUrl), n != null && n.idCard && (
|
|
2903
|
+
return rt.length >= 10 && Dn(rt), ac($h(), _h().invoiceHubBaseUrl), n != null && n.idCard && (W = n == null ? void 0 : n.idCard), un(), {
|
|
2904
2904
|
container: p,
|
|
2905
2905
|
getValues: Ln
|
|
2906
2906
|
};
|
|
@@ -3030,21 +3030,21 @@ function ph({
|
|
|
3030
3030
|
.hide-scrollbar::-webkit-scrollbar { display: none; }
|
|
3031
3031
|
`, u.appendChild(s);
|
|
3032
3032
|
function l(N) {
|
|
3033
|
-
const
|
|
3034
|
-
return
|
|
3033
|
+
const G = document.createElement("button");
|
|
3034
|
+
return G.type = "button", G.className = "wgt:flex wgt:@max-md:hidden wgt:absolute wgt:z-20 wgt:h-10 wgt:w-10 wgt:items-center wgt:justify-center wgt:rounded-full wgt:bg-white wgt:border wgt:border-soft-200 wgt:shadow wgt:hover:bg-weak-50 wgt:disabled:opacity-50 wgt:disabled:cursor-not-allowed", G.innerHTML = N === "prev" ? `<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
|
3035
3035
|
<path d="M15 18L9 12L15 6" stroke="#0E121B" stroke-width="2"
|
|
3036
3036
|
stroke-linecap="round" stroke-linejoin="round"/>
|
|
3037
3037
|
</svg>` : `<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
|
3038
3038
|
<path d="M9 6L15 12L9 18" stroke="#0E121B" stroke-width="2"
|
|
3039
3039
|
stroke-linecap="round" stroke-linejoin="round"/>
|
|
3040
|
-
</svg>`,
|
|
3040
|
+
</svg>`, G;
|
|
3041
3041
|
}
|
|
3042
3042
|
const x = l("prev"), d = l("next");
|
|
3043
3043
|
x.style.left = "8px", d.style.right = "8px", i.appendChild(x), i.appendChild(d);
|
|
3044
3044
|
let Q = n, k = e, b = h;
|
|
3045
3045
|
const p = () => window.matchMedia("(max-width: 414px)").matches;
|
|
3046
3046
|
function w() {
|
|
3047
|
-
const N = r.getBoundingClientRect(),
|
|
3047
|
+
const N = r.getBoundingClientRect(), G = i.getBoundingClientRect(), F = N.top - G.top + N.height / 2;
|
|
3048
3048
|
x.style.top = `${F}px`, d.style.top = `${F}px`, x.style.transform = "translateY(-50%)", d.style.transform = "translateY(-50%)";
|
|
3049
3049
|
}
|
|
3050
3050
|
function E() {
|
|
@@ -3067,15 +3067,15 @@ function ph({
|
|
|
3067
3067
|
return;
|
|
3068
3068
|
}
|
|
3069
3069
|
Q.forEach((N) => {
|
|
3070
|
-
const
|
|
3070
|
+
const G = N._id === b, F = k.includes(N.code), { container: z } = x1({
|
|
3071
3071
|
pkg: N,
|
|
3072
3072
|
type: t,
|
|
3073
3073
|
isDiscounted: F,
|
|
3074
3074
|
promotion: c,
|
|
3075
|
-
isSelected:
|
|
3075
|
+
isSelected: G,
|
|
3076
3076
|
isRenew: o,
|
|
3077
3077
|
onSelect: () => {
|
|
3078
|
-
A((a || o) &&
|
|
3078
|
+
A((a || o) && G ? "" : N._id);
|
|
3079
3079
|
}
|
|
3080
3080
|
});
|
|
3081
3081
|
z.classList.add("wgt:snap-start"), r.appendChild(z);
|
|
@@ -3107,8 +3107,8 @@ function ph({
|
|
|
3107
3107
|
setSelectedPackageId(N) {
|
|
3108
3108
|
b = N, C();
|
|
3109
3109
|
},
|
|
3110
|
-
updateData(N,
|
|
3111
|
-
Q = N || Q,
|
|
3110
|
+
updateData(N, G = null, F = null) {
|
|
3111
|
+
Q = N || Q, G !== null && (k = G), F !== null && (b = F), C();
|
|
3112
3112
|
},
|
|
3113
3113
|
updateDiscountedOnly(N) {
|
|
3114
3114
|
k = N, C();
|
|
@@ -3425,21 +3425,23 @@ function E1(B) {
|
|
|
3425
3425
|
isRenewal: E
|
|
3426
3426
|
}) {
|
|
3427
3427
|
var Vt;
|
|
3428
|
-
const X = ((Vt = x == null ? void 0 : x.eInvoiceRegistration) == null ? void 0 : Vt.invoiceSymbol) || ""
|
|
3428
|
+
const X = ((Vt = x == null ? void 0 : x.eInvoiceRegistration) == null ? void 0 : Vt.invoiceSymbol) || "";
|
|
3429
|
+
console.log("Invoice Symbol", X);
|
|
3430
|
+
const C = (X == null ? void 0 : X[4]) === "M";
|
|
3429
3431
|
let y = [];
|
|
3430
|
-
function v(
|
|
3431
|
-
return Array.isArray(
|
|
3432
|
-
var
|
|
3433
|
-
return (
|
|
3434
|
-
}) :
|
|
3435
|
-
var
|
|
3436
|
-
return !((
|
|
3432
|
+
function v(Y, j) {
|
|
3433
|
+
return Array.isArray(Y) ? j === "household" ? Y.filter((Z) => {
|
|
3434
|
+
var tn;
|
|
3435
|
+
return (tn = Z == null ? void 0 : Z.code) == null ? void 0 : tn.includes("HKD");
|
|
3436
|
+
}) : Y.filter((Z) => {
|
|
3437
|
+
var tn;
|
|
3438
|
+
return !((tn = Z == null ? void 0 : Z.code) != null && tn.includes("HKD"));
|
|
3437
3439
|
}) : [];
|
|
3438
3440
|
}
|
|
3439
3441
|
let I = "", V = {
|
|
3440
3442
|
company: c ? c._id : null,
|
|
3441
3443
|
household: null
|
|
3442
|
-
}, f = c ? c._id : null, N = h ? h._id : null,
|
|
3444
|
+
}, f = c ? c._id : null, N = h ? h._id : null, G = l ? l.map((Y) => Y) : [], F = [], z = [], T = [], m = [], P = null, H = (p == null ? void 0 : p.qtyRegFee) || 1, L = (p == null ? void 0 : p.qtyInvoicePkg) || 1, J = (p == null ? void 0 : p.qtySignaturePkg) || 1;
|
|
3443
3445
|
function D() {
|
|
3444
3446
|
w && w({
|
|
3445
3447
|
qtyRegFee: H,
|
|
@@ -3447,19 +3449,19 @@ function E1(B) {
|
|
|
3447
3449
|
qtySignaturePkg: J
|
|
3448
3450
|
});
|
|
3449
3451
|
}
|
|
3450
|
-
function
|
|
3451
|
-
return
|
|
3452
|
+
function _(Y) {
|
|
3453
|
+
return Y.find((j) => m.includes(j.code));
|
|
3452
3454
|
}
|
|
3453
|
-
function
|
|
3455
|
+
function nn({ registrationData: Y, onChange: j }) {
|
|
3454
3456
|
var vn;
|
|
3455
|
-
let
|
|
3456
|
-
const
|
|
3457
|
-
|
|
3457
|
+
let Z = ((vn = Y == null ? void 0 : Y.eInvoiceRegistration) == null ? void 0 : vn.businessType) || "company";
|
|
3458
|
+
const tn = document.createElement("div");
|
|
3459
|
+
tn.className = "wgt:flex wgt:items-center wgt:gap-4 wgt:flex-wrap";
|
|
3458
3460
|
const an = document.createElement("div");
|
|
3459
|
-
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>`,
|
|
3461
|
+
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>`, tn.appendChild(an);
|
|
3460
3462
|
const $ = document.createElement("div");
|
|
3461
|
-
$.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",
|
|
3462
|
-
function en(
|
|
3463
|
+
$.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", tn.appendChild($);
|
|
3464
|
+
function en(Bn, un) {
|
|
3463
3465
|
const Ln = document.createElement("button");
|
|
3464
3466
|
Ln.type = "button", Ln.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";
|
|
3465
3467
|
const rt = document.createElement("span");
|
|
@@ -3467,65 +3469,65 @@ function E1(B) {
|
|
|
3467
3469
|
const tt = document.createElement("span");
|
|
3468
3470
|
tt.className = "wgt:h-2 wgt:w-2 wgt:rounded-full ", tt.style.backgroundColor = "#1e2a7b", tt.style.opacity = "0", rt.appendChild(tt);
|
|
3469
3471
|
const at = document.createElement("span");
|
|
3470
|
-
return at.className = "wgt:text-sm wgt:font-semibold", at.innerText =
|
|
3471
|
-
|
|
3472
|
+
return at.className = "wgt:text-sm wgt:font-semibold", at.innerText = Bn, Ln.appendChild(rt), Ln.appendChild(at), Ln.addEventListener("click", () => {
|
|
3473
|
+
Z = un, Xn(), Y != null && Y.eInvoiceRegistration && (Y.eInvoiceRegistration.businessType = Z), j == null || j(Z);
|
|
3472
3474
|
}), { btn: Ln, inner: tt, textSpan: at, value: un };
|
|
3473
3475
|
}
|
|
3474
|
-
const
|
|
3476
|
+
const hn = en(g("company") || "Doanh nghiệp", "company"), qn = en(
|
|
3475
3477
|
g("householdBusiness") || "Hộ kinh doanh",
|
|
3476
3478
|
"household"
|
|
3477
3479
|
);
|
|
3478
|
-
$.appendChild(
|
|
3479
|
-
function rn(
|
|
3480
|
-
|
|
3481
|
-
const Ln =
|
|
3482
|
-
Ln.classList.toggle("wgt:border-[#1e2a7b]", un), Ln.classList.toggle("wgt:border-[#D0D5DD]", !un),
|
|
3480
|
+
$.appendChild(hn.btn), $.appendChild(qn.btn);
|
|
3481
|
+
function rn(Bn, un) {
|
|
3482
|
+
Bn.btn.classList.toggle("wgt:bg-weak-50", un), Bn.inner.style.opacity = un ? "1" : "0";
|
|
3483
|
+
const Ln = Bn.inner.parentElement;
|
|
3484
|
+
Ln.classList.toggle("wgt:border-[#1e2a7b]", un), Ln.classList.toggle("wgt:border-[#D0D5DD]", !un), Bn.textSpan.style.color = un ? "#1e2a7b" : "", Bn.textSpan.classList.toggle("wgt:text-text-sub-600", !un);
|
|
3483
3485
|
}
|
|
3484
|
-
function
|
|
3485
|
-
rn(
|
|
3486
|
+
function Xn() {
|
|
3487
|
+
rn(hn, Z === "company"), rn(qn, Z === "household");
|
|
3486
3488
|
}
|
|
3487
|
-
return
|
|
3488
|
-
container:
|
|
3489
|
-
getValue: () =>
|
|
3490
|
-
setValue: (
|
|
3491
|
-
|
|
3489
|
+
return Xn(), {
|
|
3490
|
+
container: tn,
|
|
3491
|
+
getValue: () => Z,
|
|
3492
|
+
setValue: (Bn) => {
|
|
3493
|
+
Z = Bn, Xn();
|
|
3492
3494
|
}
|
|
3493
3495
|
};
|
|
3494
3496
|
}
|
|
3495
|
-
function R(
|
|
3496
|
-
return F.find((
|
|
3497
|
+
function R(Y) {
|
|
3498
|
+
return F.find((j) => j._id === Y) || null;
|
|
3497
3499
|
}
|
|
3498
|
-
const
|
|
3499
|
-
|
|
3500
|
+
const W = document.createElement("div");
|
|
3501
|
+
W.className = "wgt:relative wgt:flex wgt:w-full wgt:h-full wgt:flex-col wgt:gap-4 wgt:py-6";
|
|
3500
3502
|
const {
|
|
3501
3503
|
container: S,
|
|
3502
|
-
open:
|
|
3503
|
-
close:
|
|
3504
|
+
open: U,
|
|
3505
|
+
close: ln
|
|
3504
3506
|
} = e0();
|
|
3505
|
-
|
|
3506
|
-
let
|
|
3507
|
+
W.appendChild(S);
|
|
3508
|
+
let fn = null;
|
|
3507
3509
|
if (C) {
|
|
3508
|
-
|
|
3510
|
+
fn = nn({
|
|
3509
3511
|
registrationData: x,
|
|
3510
|
-
onChange: (
|
|
3512
|
+
onChange: (j) => {
|
|
3511
3513
|
var an;
|
|
3512
|
-
const
|
|
3513
|
-
Sn(
|
|
3514
|
-
const
|
|
3515
|
-
if (V[
|
|
3516
|
-
f = V[
|
|
3514
|
+
const Z = v(y, j);
|
|
3515
|
+
Sn(Z || []), ct(Z || []);
|
|
3516
|
+
const tn = j === "company" ? "household" : "company";
|
|
3517
|
+
if (V[tn] = f, V[j])
|
|
3518
|
+
f = V[j];
|
|
3517
3519
|
else {
|
|
3518
|
-
const $ = Z
|
|
3519
|
-
f = $ ? $._id : ((an =
|
|
3520
|
+
const $ = _(Z);
|
|
3521
|
+
f = $ ? $._id : ((an = Z == null ? void 0 : Z[0]) == null ? void 0 : an._id) || null, V[j] = f;
|
|
3520
3522
|
}
|
|
3521
|
-
|
|
3523
|
+
G = [], gt(), Et(), $n(), On(), kn();
|
|
3522
3524
|
}
|
|
3523
3525
|
});
|
|
3524
|
-
const
|
|
3525
|
-
|
|
3526
|
+
const Y = document.createElement("div");
|
|
3527
|
+
Y.className = "wgt:mx-auto wgt:w-full wgt:max-w-[1072px] wgt:px-6 wgt:@max-2xl:px-3", Y.appendChild(fn.container), W.appendChild(Y);
|
|
3526
3528
|
}
|
|
3527
3529
|
const mn = document.createElement("div");
|
|
3528
|
-
mn.className = "wgt:mx-auto wgt:w-full wgt:max-w-[1072px] wgt:flex wgt:flex-col wgt:gap-8 wgt:rounded-3xl wgt:bg-weak-50 wgt:px-6 wgt:py-4 wgt:@max-2xl:px-3 wgt:@max-2xl:py-3 wgt:@max-2xl:gap-6 wgt:@max-2xl:rounded-none",
|
|
3530
|
+
mn.className = "wgt:mx-auto wgt:w-full wgt:max-w-[1072px] wgt:flex wgt:flex-col wgt:gap-8 wgt:rounded-3xl wgt:bg-weak-50 wgt:px-6 wgt:py-4 wgt:@max-2xl:px-3 wgt:@max-2xl:py-3 wgt:@max-2xl:gap-6 wgt:@max-2xl:rounded-none", W.appendChild(mn);
|
|
3529
3531
|
const {
|
|
3530
3532
|
container: Rn,
|
|
3531
3533
|
invoiceSelectorWrapper: Dn,
|
|
@@ -3546,8 +3548,8 @@ function E1(B) {
|
|
|
3546
3548
|
mn.appendChild(Rn);
|
|
3547
3549
|
let Mn = null, jn = null;
|
|
3548
3550
|
if (!E) {
|
|
3549
|
-
const
|
|
3550
|
-
jn =
|
|
3551
|
+
const Y = f1(E);
|
|
3552
|
+
jn = Y.container, Mn = Y.signatureSelectorWrapper, mn.appendChild(jn);
|
|
3551
3553
|
}
|
|
3552
3554
|
const Kn = document.createElement("div");
|
|
3553
3555
|
Kn.className = "wgt:flex wgt:items-center wgt:justify-center wgt:py-4", Kn.innerHTML = `
|
|
@@ -3563,37 +3565,37 @@ function E1(B) {
|
|
|
3563
3565
|
const xt = document.createElement("span");
|
|
3564
3566
|
xt.className = "wgt:text-xl wgt:font-bold wgt:text-primary", xt.innerText = "0 VND", st.appendChild(xt);
|
|
3565
3567
|
const dt = document.createElement("div");
|
|
3566
|
-
dt.className = "wgt:flex wgt:justify-between wgt:gap-2",
|
|
3568
|
+
dt.className = "wgt:flex wgt:justify-between wgt:gap-2", W.appendChild(dt);
|
|
3567
3569
|
const lt = document.createElement("button");
|
|
3568
3570
|
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), dt.appendChild(lt);
|
|
3569
|
-
const u0 = (
|
|
3570
|
-
|
|
3571
|
-
const
|
|
3571
|
+
const u0 = (Y, j, Z, tn) => sn(null, null, function* () {
|
|
3572
|
+
U();
|
|
3573
|
+
const hn = x.eInvoiceRegistration, { isUsedEInvoiceBefore: an } = hn, $ = sh(hn, ["isUsedEInvoiceBefore"]);
|
|
3572
3574
|
let en = [
|
|
3573
3575
|
{
|
|
3574
|
-
code:
|
|
3575
|
-
quantity:
|
|
3576
|
+
code: j.code,
|
|
3577
|
+
quantity: j.quantity,
|
|
3576
3578
|
isCashRegister: C
|
|
3577
3579
|
}
|
|
3578
3580
|
];
|
|
3579
|
-
|
|
3580
|
-
code:
|
|
3581
|
-
quantity:
|
|
3581
|
+
Z && en.push({
|
|
3582
|
+
code: Z.code,
|
|
3583
|
+
quantity: Z.quantity,
|
|
3582
3584
|
isCashRegister: C
|
|
3583
|
-
}),
|
|
3584
|
-
code:
|
|
3585
|
-
quantity:
|
|
3585
|
+
}), Y && en.push({
|
|
3586
|
+
code: Y.code,
|
|
3587
|
+
quantity: Y.quantity,
|
|
3586
3588
|
isCashRegister: C
|
|
3587
|
-
}),
|
|
3589
|
+
}), tn.length > 0 && tn.forEach((qn) => {
|
|
3588
3590
|
const rn = T[qn];
|
|
3589
|
-
rn.reward.packageCodes.length > 0 && rn.reward.packageCodes.forEach((
|
|
3591
|
+
rn.reward.packageCodes.length > 0 && rn.reward.packageCodes.forEach((Xn) => {
|
|
3590
3592
|
en.push({
|
|
3591
|
-
code:
|
|
3593
|
+
code: Xn,
|
|
3592
3594
|
quantity: 1,
|
|
3593
3595
|
isCashRegister: C
|
|
3594
3596
|
});
|
|
3595
3597
|
});
|
|
3596
|
-
}), Q(en), k(
|
|
3598
|
+
}), Q(en), k(tn);
|
|
3597
3599
|
try {
|
|
3598
3600
|
const qn = yield Nc({
|
|
3599
3601
|
eInvoiceRegistration: Hn({}, $),
|
|
@@ -3606,13 +3608,13 @@ function E1(B) {
|
|
|
3606
3608
|
x.idCardBack
|
|
3607
3609
|
],
|
|
3608
3610
|
packages: en,
|
|
3609
|
-
promotionCodes:
|
|
3611
|
+
promotionCodes: tn,
|
|
3610
3612
|
isRenew: E,
|
|
3611
3613
|
isCashRegister: C
|
|
3612
|
-
}), rn = qn.orderId,
|
|
3613
|
-
u(rn), q ? q(
|
|
3614
|
+
}), rn = qn.orderId, Xn = qn.amount || 0;
|
|
3615
|
+
u(rn), q ? q(Xn) : console.warn("setOrderAmount is not defined!"), yield new Promise((vn) => setTimeout(vn, 100)), ln(), t();
|
|
3614
3616
|
} catch (qn) {
|
|
3615
|
-
n0(g("errorCreatingOrder") || "Failed to create order"),
|
|
3617
|
+
n0(g("errorCreatingOrder") || "Failed to create order"), ln();
|
|
3616
3618
|
return;
|
|
3617
3619
|
}
|
|
3618
3620
|
}), Ft = vt({
|
|
@@ -3620,44 +3622,47 @@ function E1(B) {
|
|
|
3620
3622
|
title: g("next"),
|
|
3621
3623
|
className: "wgt:text-text-primary wgt:bg-primary",
|
|
3622
3624
|
handleClick: () => sn(null, null, function* () {
|
|
3623
|
-
const
|
|
3625
|
+
const Y = pn().find(
|
|
3624
3626
|
($) => $._id === f
|
|
3625
|
-
),
|
|
3627
|
+
), j = F.find(
|
|
3626
3628
|
($) => $._id === N
|
|
3627
3629
|
);
|
|
3628
|
-
if (!E && !
|
|
3630
|
+
if (!E && !j) {
|
|
3629
3631
|
Xt.error(g("errorSelectSignature") || "Vui lòng chọn gói chữ ký số");
|
|
3630
3632
|
return;
|
|
3631
3633
|
}
|
|
3632
|
-
let
|
|
3633
|
-
!E && !(
|
|
3634
|
+
let Z = null;
|
|
3635
|
+
!E && !(Y != null && Y.withoutInitialFee) ? (Z = Yn(Hn({}, z[0]), {
|
|
3634
3636
|
quantity: H
|
|
3635
|
-
}), a(
|
|
3636
|
-
let
|
|
3637
|
-
A(
|
|
3637
|
+
}), a(Z)) : a(null);
|
|
3638
|
+
let tn = Yn(Hn({}, Y), { quantity: L }), an = j ? Yn(Hn({}, j), { quantity: J }) : null;
|
|
3639
|
+
A(tn), o(an), d(G), D(), w && w({
|
|
3638
3640
|
qtyRegFee: H,
|
|
3639
3641
|
qtyInvoicePkg: L,
|
|
3640
3642
|
qtySignaturePkg: J
|
|
3641
3643
|
}), yield u0(
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
+
Z,
|
|
3645
|
+
tn,
|
|
3644
3646
|
an,
|
|
3645
|
-
|
|
3647
|
+
G
|
|
3646
3648
|
);
|
|
3647
3649
|
})
|
|
3648
3650
|
});
|
|
3649
3651
|
dt.appendChild(Ft);
|
|
3650
3652
|
function o0() {
|
|
3651
3653
|
return sn(this, null, function* () {
|
|
3652
|
-
var
|
|
3654
|
+
var Y, j;
|
|
3653
3655
|
try {
|
|
3654
3656
|
const [
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
+
Z,
|
|
3658
|
+
tn,
|
|
3657
3659
|
an,
|
|
3658
3660
|
$
|
|
3659
3661
|
] = yield Promise.allSettled([
|
|
3660
|
-
Ec({
|
|
3662
|
+
Ec({
|
|
3663
|
+
isRenewable: E === !0,
|
|
3664
|
+
serialNumber: X
|
|
3665
|
+
}),
|
|
3661
3666
|
Hc({ bank: r }),
|
|
3662
3667
|
yc({
|
|
3663
3668
|
bank: r,
|
|
@@ -3666,12 +3671,12 @@ function E1(B) {
|
|
|
3666
3671
|
}),
|
|
3667
3672
|
E ? Promise.resolve([]) : Pc({ bank: r })
|
|
3668
3673
|
]);
|
|
3669
|
-
if (
|
|
3674
|
+
if (tn.status === "fulfilled" ? z = tn.value || [] : (console.error(
|
|
3670
3675
|
"Failed to load init packages:",
|
|
3671
|
-
|
|
3676
|
+
tn.reason
|
|
3672
3677
|
), Xt.error(
|
|
3673
3678
|
g("errorLoadingInitPackages") || "Failed to load registration packages"
|
|
3674
|
-
), z = []),
|
|
3679
|
+
), z = []), Z.status === "fulfilled" ? (((Y = Z == null ? void 0 : Z.value) == null ? void 0 : Y.length) > 0 && Z.value.forEach((en) => {
|
|
3675
3680
|
en.codes.length > 0 && (T[en.codes[0].code] = {
|
|
3676
3681
|
id: en.id,
|
|
3677
3682
|
name: en.name,
|
|
@@ -3688,19 +3693,19 @@ function E1(B) {
|
|
|
3688
3693
|
isHidden: !1,
|
|
3689
3694
|
reward: en.reward
|
|
3690
3695
|
});
|
|
3691
|
-
}), Object.keys(T).length > 0 && (
|
|
3696
|
+
}), Object.keys(T).length > 0 && (G = l ? [...l] : [], Ht())) : console.error("Failed to load promotions:", Z.reason), an.status === "fulfilled") {
|
|
3692
3697
|
y = (E ? an.value.filter((qn) => qn.renewPrice !== 0) : an.value) || [];
|
|
3693
|
-
const
|
|
3698
|
+
const hn = C ? v(
|
|
3694
3699
|
y,
|
|
3695
|
-
|
|
3700
|
+
fn.getValue()
|
|
3696
3701
|
) : y;
|
|
3697
|
-
if (Sn(
|
|
3698
|
-
const qn =
|
|
3699
|
-
if (c ? f = c._id : qn ? f = qn._id : f =
|
|
3700
|
-
const rn =
|
|
3702
|
+
if (Sn(hn || []), ct(hn || []), an.value.length > 0) {
|
|
3703
|
+
const qn = _(hn);
|
|
3704
|
+
if (c ? f = c._id : qn ? f = qn._id : f = hn == null ? void 0 : hn[0]._id, C) {
|
|
3705
|
+
const rn = fn.getValue();
|
|
3701
3706
|
V[rn] = f;
|
|
3702
3707
|
}
|
|
3703
|
-
ct(
|
|
3708
|
+
ct(hn);
|
|
3704
3709
|
}
|
|
3705
3710
|
ot();
|
|
3706
3711
|
} else
|
|
@@ -3713,9 +3718,9 @@ function E1(B) {
|
|
|
3713
3718
|
if ($.status === "fulfilled")
|
|
3714
3719
|
if (F = $.value || [], F.length > 0) {
|
|
3715
3720
|
const en = F.find(
|
|
3716
|
-
(
|
|
3721
|
+
(hn) => m.includes(hn.code)
|
|
3717
3722
|
);
|
|
3718
|
-
E ? N = h ? h._id : null : N = h ? h._id : en ? en._id : E ? null : (
|
|
3723
|
+
E ? N = h ? h._id : null : N = h ? h._id : en ? en._id : E ? null : (j = F == null ? void 0 : F.filter((hn) => !hn.isBonusPackage)[0]) == null ? void 0 : j._id;
|
|
3719
3724
|
} else {
|
|
3720
3725
|
if (console.error(
|
|
3721
3726
|
"Failed to load signature packages:",
|
|
@@ -3729,8 +3734,8 @@ function E1(B) {
|
|
|
3729
3734
|
F = [];
|
|
3730
3735
|
}
|
|
3731
3736
|
It();
|
|
3732
|
-
} catch (
|
|
3733
|
-
console.error("Unexpected error during data loading:",
|
|
3737
|
+
} catch (Z) {
|
|
3738
|
+
console.error("Unexpected error during data loading:", Z), Xt.error(g("errorLoadingData") || "Failed to load data", {
|
|
3734
3739
|
autoClose: 5e3,
|
|
3735
3740
|
closeButton: !0,
|
|
3736
3741
|
icon: !0
|
|
@@ -3741,28 +3746,28 @@ function E1(B) {
|
|
|
3741
3746
|
function It() {
|
|
3742
3747
|
gt(), Et(), E || bt(), $n(), On(), kn();
|
|
3743
3748
|
}
|
|
3744
|
-
function Nt(
|
|
3745
|
-
const
|
|
3746
|
-
(
|
|
3747
|
-
), an = m.includes(
|
|
3748
|
-
!
|
|
3749
|
-
(
|
|
3750
|
-
), en = m.includes(
|
|
3749
|
+
function Nt(Y, j, Z) {
|
|
3750
|
+
const tn = Object.values(T).find(
|
|
3751
|
+
(hn) => hn.bank === r && hn.appliedPackages.includes(Y)
|
|
3752
|
+
), an = m.includes(Y) || tn && // !currentPackagePromotion.isDisabled &&
|
|
3753
|
+
!tn.isHidden && !(tn.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && tn.limit !== tn.used, $ = Object.values(T).find(
|
|
3754
|
+
(hn) => hn.bank === r && hn.appliedPackages.includes(j)
|
|
3755
|
+
), en = m.includes(j) || $ && // !newPackagePromotion.isDisabled &&
|
|
3751
3756
|
!$.isHidden && !($.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && $.limit !== $.used && $.isActive;
|
|
3752
3757
|
if (an && !en) {
|
|
3753
|
-
const { container:
|
|
3758
|
+
const { container: hn, open: qn } = Jt({
|
|
3754
3759
|
message: g("errorDiscountPackage"),
|
|
3755
3760
|
description: g("errorDiscountPackageDes"),
|
|
3756
3761
|
okLabel: g("ok"),
|
|
3757
3762
|
cancelLabel: g("cancel"),
|
|
3758
|
-
onClose:
|
|
3763
|
+
onClose: Z,
|
|
3759
3764
|
isWarning: !0,
|
|
3760
3765
|
isSuccess: !1,
|
|
3761
3766
|
theme: r
|
|
3762
3767
|
});
|
|
3763
|
-
|
|
3768
|
+
W.appendChild(hn), qn();
|
|
3764
3769
|
} else
|
|
3765
|
-
|
|
3770
|
+
Z();
|
|
3766
3771
|
}
|
|
3767
3772
|
let nt = null;
|
|
3768
3773
|
function Et() {
|
|
@@ -3774,23 +3779,23 @@ function E1(B) {
|
|
|
3774
3779
|
promotion: g("discount"),
|
|
3775
3780
|
selectedPackageId: f,
|
|
3776
3781
|
isRenew: E,
|
|
3777
|
-
handlePackageSelect: (
|
|
3778
|
-
var
|
|
3779
|
-
let
|
|
3782
|
+
handlePackageSelect: (Y) => {
|
|
3783
|
+
var tn, an;
|
|
3784
|
+
let j = (tn = pn().find(
|
|
3780
3785
|
($) => $._id === f
|
|
3781
|
-
)) == null ? void 0 :
|
|
3782
|
-
Nt(
|
|
3783
|
-
if (f =
|
|
3784
|
-
const $ =
|
|
3785
|
-
V[$] =
|
|
3786
|
+
)) == null ? void 0 : tn.code, Z = (an = pn().find(($) => $._id === Y)) == null ? void 0 : an.code;
|
|
3787
|
+
Nt(j, Z, () => {
|
|
3788
|
+
if (f = Y, C && fn) {
|
|
3789
|
+
const $ = fn.getValue();
|
|
3790
|
+
V[$] = Y;
|
|
3786
3791
|
}
|
|
3787
|
-
nt.setSelectedPackageId(
|
|
3792
|
+
nt.setSelectedPackageId(Y), gt(), $n(), On(), kn();
|
|
3788
3793
|
});
|
|
3789
3794
|
}
|
|
3790
3795
|
}), Dn.appendChild(nt.container);
|
|
3791
3796
|
else {
|
|
3792
|
-
const
|
|
3793
|
-
|
|
3797
|
+
const Y = document.createElement("span");
|
|
3798
|
+
Y.className = "wgt:text-text-sub-600", Y.innerText = g("noPackageFound"), Dn.appendChild(Y), nt = null;
|
|
3794
3799
|
}
|
|
3795
3800
|
}
|
|
3796
3801
|
let it = null;
|
|
@@ -3799,39 +3804,39 @@ function E1(B) {
|
|
|
3799
3804
|
if (Mn.innerHTML = "", F.length > 0)
|
|
3800
3805
|
it = ph({
|
|
3801
3806
|
type: "signature",
|
|
3802
|
-
packageOptions: F.filter((
|
|
3807
|
+
packageOptions: F.filter((Y) => !Y.isBonusPackage),
|
|
3803
3808
|
disCountedPackages: m,
|
|
3804
3809
|
promotion: g("gift"),
|
|
3805
3810
|
selectedPackageId: N,
|
|
3806
3811
|
allowDeselect: E,
|
|
3807
|
-
handlePackageSelect: (
|
|
3808
|
-
var
|
|
3809
|
-
let
|
|
3812
|
+
handlePackageSelect: (Y) => {
|
|
3813
|
+
var tn, an;
|
|
3814
|
+
let j = (tn = F.find(
|
|
3810
3815
|
($) => $._id === N
|
|
3811
|
-
)) == null ? void 0 :
|
|
3812
|
-
if (E && N ===
|
|
3816
|
+
)) == null ? void 0 : tn.code, Z = (an = F.find(($) => $._id === Y)) == null ? void 0 : an.code;
|
|
3817
|
+
if (E && N === Y) {
|
|
3813
3818
|
N = null, it.setSelectedPackageId(null), gt(), $n(), On(), kn();
|
|
3814
3819
|
return;
|
|
3815
3820
|
}
|
|
3816
|
-
Nt(
|
|
3817
|
-
N =
|
|
3821
|
+
Nt(j, Z, () => {
|
|
3822
|
+
N = Y, it.setSelectedPackageId(Y), ct(pn()), gt(), $n(), On(), kn();
|
|
3818
3823
|
});
|
|
3819
3824
|
}
|
|
3820
3825
|
}), Mn.appendChild(it.container);
|
|
3821
3826
|
else {
|
|
3822
|
-
const
|
|
3823
|
-
|
|
3827
|
+
const Y = document.createElement("span");
|
|
3828
|
+
Y.className = "wgt:text-text-sub-600", Y.innerText = g("noPackageFound"), Mn.appendChild(Y), it = null;
|
|
3824
3829
|
}
|
|
3825
3830
|
}
|
|
3826
3831
|
const wt = document.createElement("div");
|
|
3827
3832
|
wt.className = "wgt:w-full", mn.appendChild(wt);
|
|
3828
3833
|
function $n() {
|
|
3829
3834
|
Kn.remove(), wt.innerHTML = "";
|
|
3830
|
-
const
|
|
3831
|
-
(
|
|
3835
|
+
const Y = pn().find(
|
|
3836
|
+
(j) => j._id === f
|
|
3832
3837
|
);
|
|
3833
3838
|
if (z.length > 0) {
|
|
3834
|
-
const { container:
|
|
3839
|
+
const { container: j } = d1({
|
|
3835
3840
|
name: "registrationFee",
|
|
3836
3841
|
value: "standard",
|
|
3837
3842
|
feeLabel: `${g("registrationFee")}: ${Vn(
|
|
@@ -3839,80 +3844,80 @@ function E1(B) {
|
|
|
3839
3844
|
)} VND`,
|
|
3840
3845
|
required: !0,
|
|
3841
3846
|
description: z[0][zt(Pt())],
|
|
3842
|
-
isChecked: !E && !(
|
|
3847
|
+
isChecked: !E && !(Y != null && Y.withoutInitialFee)
|
|
3843
3848
|
});
|
|
3844
|
-
wt.appendChild(
|
|
3849
|
+
wt.appendChild(j);
|
|
3845
3850
|
}
|
|
3846
3851
|
}
|
|
3847
3852
|
const zn = document.createElement("div");
|
|
3848
3853
|
zn.className = "promotion-wrapper wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
|
|
3849
3854
|
function gt() {
|
|
3850
|
-
const
|
|
3855
|
+
const Y = pn().find(
|
|
3851
3856
|
(an) => an._id === f
|
|
3852
|
-
),
|
|
3857
|
+
), j = F.find(
|
|
3853
3858
|
(an) => an._id === N
|
|
3854
|
-
),
|
|
3855
|
-
|
|
3859
|
+
), Z = !E && (z == null ? void 0 : z.length) > 0 && !(Y != null && Y.withoutInitialFee), tn = [];
|
|
3860
|
+
Y != null && Y.code && tn.push(Y.code), j != null && j.code && tn.push(j.code), Z && tn.push("INITIAL_FEE"), Object.keys(T).forEach((an) => {
|
|
3856
3861
|
var vn;
|
|
3857
3862
|
const $ = T[an];
|
|
3858
3863
|
if ($.bank !== r) {
|
|
3859
|
-
$.isHidden = !0,
|
|
3860
|
-
(
|
|
3864
|
+
$.isHidden = !0, G = G.filter(
|
|
3865
|
+
(Bn) => Bn !== $.code
|
|
3861
3866
|
);
|
|
3862
3867
|
return;
|
|
3863
3868
|
}
|
|
3864
|
-
const en = $.expiredAt < (/* @__PURE__ */ new Date()).toISOString(),
|
|
3865
|
-
(
|
|
3866
|
-
)) && !en && !
|
|
3867
|
-
$.isHidden = !
|
|
3868
|
-
(
|
|
3869
|
+
const en = $.expiredAt < (/* @__PURE__ */ new Date()).toISOString(), hn = $.limit <= $.used, qn = !$.isActive, Xn = ((vn = $.appliedPackages) == null ? void 0 : vn.some(
|
|
3870
|
+
(Bn) => tn.includes(Bn)
|
|
3871
|
+
)) && !en && !hn && !qn;
|
|
3872
|
+
$.isHidden = !Xn, Xn ? G.includes($.code) || G.push($.code) : G = G.filter(
|
|
3873
|
+
(Bn) => Bn !== $.code
|
|
3869
3874
|
);
|
|
3870
3875
|
}), Ht();
|
|
3871
3876
|
}
|
|
3872
3877
|
function Ht() {
|
|
3873
3878
|
m = [
|
|
3874
3879
|
...new Set(
|
|
3875
|
-
Object.values(T).filter((
|
|
3876
|
-
(
|
|
3880
|
+
Object.values(T).filter((Y) => Y.bank === r).flatMap(
|
|
3881
|
+
(Y) => Y.appliedPackages.filter((j) => j !== "INITIAL_FEE")
|
|
3877
3882
|
)
|
|
3878
3883
|
)
|
|
3879
3884
|
];
|
|
3880
3885
|
}
|
|
3881
3886
|
function On() {
|
|
3882
3887
|
if (Object.values(T).filter(
|
|
3883
|
-
(
|
|
3888
|
+
(hn) => hn.bank === r
|
|
3884
3889
|
).length === 0) {
|
|
3885
3890
|
mn.contains(zn) && mn.removeChild(zn);
|
|
3886
3891
|
return;
|
|
3887
3892
|
}
|
|
3888
3893
|
zn.innerHTML = "";
|
|
3889
|
-
const
|
|
3890
|
-
|
|
3891
|
-
const
|
|
3892
|
-
|
|
3893
|
-
const
|
|
3894
|
-
|
|
3894
|
+
const j = document.createElement("h3");
|
|
3895
|
+
j.className = "wgt:text-xl wgt:font-bold wgt:text-strong-950", j.innerText = g("applyPromotion"), zn.appendChild(j), mn.appendChild(zn);
|
|
3896
|
+
const Z = document.createElement("div");
|
|
3897
|
+
Z.className = "wgt:w-full wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";
|
|
3898
|
+
const tn = document.createElement("div");
|
|
3899
|
+
tn.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", Z.appendChild(tn), G && G.length > 0 && G.filter((qn) => {
|
|
3895
3900
|
const rn = Object.values(T).find(
|
|
3896
|
-
(
|
|
3901
|
+
(Xn) => Xn.code === qn
|
|
3897
3902
|
);
|
|
3898
3903
|
return rn && rn.bank === r;
|
|
3899
3904
|
}).forEach((qn) => {
|
|
3900
3905
|
const rn = document.createElement("div");
|
|
3901
3906
|
rn.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", rn.innerText = qn;
|
|
3902
|
-
const
|
|
3907
|
+
const Xn = vt({
|
|
3903
3908
|
type: "button",
|
|
3904
3909
|
title: "x",
|
|
3905
3910
|
handleClick: () => {
|
|
3906
|
-
|
|
3911
|
+
G = G.filter(
|
|
3907
3912
|
(vn) => vn !== qn
|
|
3908
3913
|
), On(), kn();
|
|
3909
3914
|
}
|
|
3910
3915
|
});
|
|
3911
|
-
|
|
3916
|
+
Xn.className = "wgt:w-fit wgt:h-fit wgt:p-0 wgt:bg-transparent wgt:cursor-pointer", Xn.innerHTML = `<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3912
3917
|
<path d="M1.17157 1.17163L6.82842 6.82848" stroke="#0E121B" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3913
3918
|
<path d="M1.17158 6.82849L6.82843 1.17163" stroke="#0E121B" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3914
3919
|
</svg>
|
|
3915
|
-
`, rn.appendChild(
|
|
3920
|
+
`, rn.appendChild(Xn), tn.appendChild(rn);
|
|
3916
3921
|
});
|
|
3917
3922
|
const an = vt({
|
|
3918
3923
|
type: "button",
|
|
@@ -3922,20 +3927,20 @@ function E1(B) {
|
|
|
3922
3927
|
console.log("Apply promotion");
|
|
3923
3928
|
}
|
|
3924
3929
|
});
|
|
3925
|
-
|
|
3930
|
+
Z.appendChild(an), zn.appendChild(Z);
|
|
3926
3931
|
const $ = document.createElement("div");
|
|
3927
3932
|
$.className = "wgt:w-full wgt:grid wgt:grid-cols-3 wgt:gap-4 wgt:@max-2xl:flex wgt:@max-2xl:flex-col", zn.appendChild($);
|
|
3928
|
-
const en = Object.values(T).filter((
|
|
3933
|
+
const en = Object.values(T).filter((hn) => hn.bank === r).filter((hn) => !hn.isHidden);
|
|
3929
3934
|
if (en.length > 0)
|
|
3930
|
-
en.forEach((
|
|
3931
|
-
|
|
3935
|
+
en.forEach((hn) => {
|
|
3936
|
+
G.includes(hn.code);
|
|
3932
3937
|
const { container: qn } = w1({
|
|
3933
|
-
promotion: Yn(Hn({},
|
|
3934
|
-
isSelected:
|
|
3938
|
+
promotion: Yn(Hn({}, hn), {
|
|
3939
|
+
isSelected: G.includes(hn.code)
|
|
3935
3940
|
}),
|
|
3936
3941
|
// onSelect: (promotionCode, isSelected) => {
|
|
3937
|
-
onSelect: (rn,
|
|
3938
|
-
|
|
3942
|
+
onSelect: (rn, Xn) => {
|
|
3943
|
+
Xn ? G.includes(rn) || G.push(rn) : G = G.filter(
|
|
3939
3944
|
(vn) => vn !== rn
|
|
3940
3945
|
), On(), kn();
|
|
3941
3946
|
},
|
|
@@ -3945,12 +3950,12 @@ function E1(B) {
|
|
|
3945
3950
|
$.appendChild(qn);
|
|
3946
3951
|
});
|
|
3947
3952
|
else {
|
|
3948
|
-
const
|
|
3949
|
-
|
|
3953
|
+
const hn = document.createElement("span");
|
|
3954
|
+
hn.className = "wgt:text-text-sub-600", hn.innerText = g("noPromotionFound"), zn.appendChild(hn);
|
|
3950
3955
|
}
|
|
3951
3956
|
}
|
|
3952
3957
|
function kn() {
|
|
3953
|
-
var
|
|
3958
|
+
var Bn, un, Ln, rt, tt, at, Kt, Ot, Yt;
|
|
3954
3959
|
if (D(), Un.innerHTML = "", mn.appendChild(qt), mn.appendChild(st), mn.appendChild(mt), pn().length === 0 && F.length === 0) {
|
|
3955
3960
|
const O = document.createElement("tr");
|
|
3956
3961
|
O.innerHTML = `
|
|
@@ -3960,10 +3965,10 @@ function E1(B) {
|
|
|
3960
3965
|
`, Un.appendChild(O), i(0);
|
|
3961
3966
|
return;
|
|
3962
3967
|
}
|
|
3963
|
-
const
|
|
3968
|
+
const Y = pn().find(
|
|
3964
3969
|
(O) => O._id === f
|
|
3965
3970
|
);
|
|
3966
|
-
if (!E && (z == null ? void 0 : z.length) > 0 && !(
|
|
3971
|
+
if (!E && (z == null ? void 0 : z.length) > 0 && !(Y != null && Y.withoutInitialFee)) {
|
|
3967
3972
|
const O = document.createElement("tr");
|
|
3968
3973
|
O.className = "wgt:@max-2xl:block wgt:@max-2xl:mb-4 wgt:@max-2xl:p-4 wgt:@max-2xl:bg-white wgt:@max-2xl:rounded-lg wgt:@max-2xl:border wgt:@max-2xl:border-soft-200 wgt:@max-2xl:shadow-sm";
|
|
3969
3974
|
const An = document.createElement("td");
|
|
@@ -3985,7 +3990,7 @@ function E1(B) {
|
|
|
3985
3990
|
H += 1, kn();
|
|
3986
3991
|
}), Cn.appendChild(wn), Qn.appendChild(Cn), O.appendChild(Qn);
|
|
3987
3992
|
const Pn = document.createElement("td");
|
|
3988
|
-
Pn.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", Pn.innerText = Vn((
|
|
3993
|
+
Pn.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", Pn.innerText = Vn((Bn = z[0]) == null ? void 0 : Bn.price) + " VND", O.appendChild(Pn);
|
|
3989
3994
|
const Nn = document.createElement("td");
|
|
3990
3995
|
Nn.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", Nn.innerText = Vn(((un = z[0]) == null ? void 0 : un.price) * H) + " VND", O.appendChild(Nn);
|
|
3991
3996
|
const In = document.createElement("div");
|
|
@@ -4095,13 +4100,13 @@ function E1(B) {
|
|
|
4095
4100
|
`, Tn.appendChild(et), Un.appendChild(An);
|
|
4096
4101
|
}
|
|
4097
4102
|
}
|
|
4098
|
-
const
|
|
4103
|
+
const j = G.map(
|
|
4099
4104
|
(O) => Object.values(T).find(
|
|
4100
4105
|
(An) => An.code === O && An.bank === r
|
|
4101
4106
|
)
|
|
4102
4107
|
).filter((O) => O !== void 0);
|
|
4103
|
-
let
|
|
4104
|
-
|
|
4108
|
+
let Z = 0;
|
|
4109
|
+
j.length > 0 && j.forEach((O) => {
|
|
4105
4110
|
var xn, dn, wn, Pn, Nn, In;
|
|
4106
4111
|
const An = document.createElement("tr");
|
|
4107
4112
|
An.className = "wgt:@max-2xl:block wgt:@max-2xl:mb-3 wgt:@max-2xl:p-3 wgt:@max-2xl:bg-weak-50 wgt:@max-2xl:rounded-lg wgt:@max-2xl:border wgt:@max-2xl:border-soft-200";
|
|
@@ -4117,11 +4122,11 @@ function E1(B) {
|
|
|
4117
4122
|
const Cn = document.createElement("td");
|
|
4118
4123
|
Cn.className = "wgt:px-3 wgt:py-2 wgt:text-sm wgt:font-semibold wgt:@max-2xl:text-base wgt:@max-2xl:font-bold wgt:@max-2xl:p-0", O.type === "discount" ? (Cn.innerText = `-${Vn(
|
|
4119
4124
|
(xn = O == null ? void 0 : O.reward) == null ? void 0 : xn.discountAmount
|
|
4120
|
-
)} VND`, Cn.style.color = "#F04438",
|
|
4125
|
+
)} VND`, Cn.style.color = "#F04438", Z += (dn = O == null ? void 0 : O.reward) == null ? void 0 : dn.discountAmount) : (O == null ? void 0 : O.type) === "free_item" ? (Cn.innerText = `+${(Pn = (wn = O == null ? void 0 : O.reward) == null ? void 0 : wn.packageCodes) == null ? void 0 : Pn.length} ${g(
|
|
4121
4126
|
"package"
|
|
4122
4127
|
)} ${(In = (Nn = O == null ? void 0 : O.reward) == null ? void 0 : Nn.packageCodes) == null ? void 0 : In.join(", ")}`, Cn.style.color = "#12B76A") : Cn.innerText = "", An.appendChild(Cn), Un.appendChild(An);
|
|
4123
4128
|
});
|
|
4124
|
-
const
|
|
4129
|
+
const tn = !E && z.length > 0 && !(Y != null && Y.withoutInitialFee) ? ((Kt = z[0]) == null ? void 0 : Kt.price) * H : 0, an = Zn(f), $ = an ? E ? (Yt = an.renewPrice) != null ? Yt : 0 : (Ot = an.price) != null ? Ot : 0 : 0, en = an ? $ * an.limit * L : 0, hn = R(N), qn = hn ? hn.price * hn.limit * J : 0, rn = tn + en + qn, Xn = Math.min(Z, rn), vn = Math.max(rn - Xn, 0);
|
|
4125
4130
|
i(vn);
|
|
4126
4131
|
{
|
|
4127
4132
|
const O = document.createElement("tr");
|
|
@@ -4133,7 +4138,7 @@ function E1(B) {
|
|
|
4133
4138
|
}
|
|
4134
4139
|
xt.innerText = Vn(vn) + " VND";
|
|
4135
4140
|
}
|
|
4136
|
-
return o0(), { container:
|
|
4141
|
+
return o0(), { container: W };
|
|
4137
4142
|
});
|
|
4138
4143
|
}
|
|
4139
4144
|
function H1({
|
|
@@ -4189,10 +4194,10 @@ function H1({
|
|
|
4189
4194
|
f.className = "wgt:flex wgt:items-start";
|
|
4190
4195
|
const N = document.createElement("div");
|
|
4191
4196
|
N.className = "wgt:flex-shrink-0 wgt:mt-0.5";
|
|
4192
|
-
const
|
|
4193
|
-
|
|
4197
|
+
const G = document.createElement("div");
|
|
4198
|
+
G.className = "wgt:w-6 wgt:h-6 wgt:rounded-full wgt:bg-primary wgt:flex wgt:items-center wgt:justify-center";
|
|
4194
4199
|
const F = document.createElement("span");
|
|
4195
|
-
F.className = "wgt:text-white wgt:text-sm wgt:font-semibold", F.innerText = String(V + 1),
|
|
4200
|
+
F.className = "wgt:text-white wgt:text-sm wgt:font-semibold", F.innerText = String(V + 1), G.appendChild(F), N.appendChild(G);
|
|
4196
4201
|
const z = document.createElement("p");
|
|
4197
4202
|
z.className = "wgt:ml-3 wgt:text-text-sub-600", z.innerText = I, f.appendChild(N), f.appendChild(z), C.appendChild(f);
|
|
4198
4203
|
}), B.appendChild(C), E.appendChild(B);
|
|
@@ -4212,14 +4217,14 @@ function H1({
|
|
|
4212
4217
|
)}: <span class="wgt:font-medium">${I.bankName}</span>`), I.instructions && (C.innerHTML = "", I.instructions.forEach((V, f) => {
|
|
4213
4218
|
const N = document.createElement("li");
|
|
4214
4219
|
N.className = "wgt:flex wgt:items-start";
|
|
4215
|
-
const
|
|
4216
|
-
|
|
4220
|
+
const G = document.createElement("div");
|
|
4221
|
+
G.className = "wgt:flex-shrink-0 wgt:mt-0.5";
|
|
4217
4222
|
const F = document.createElement("div");
|
|
4218
4223
|
F.className = "wgt:w-6 wgt:h-6 wgt:rounded-full wgt:bg-primary wgt:flex wgt:items-center wgt:justify-center";
|
|
4219
4224
|
const z = document.createElement("span");
|
|
4220
|
-
z.className = "wgt:text-white wgt:text-sm wgt:font-semibold", z.innerText = String(f + 1), F.appendChild(z),
|
|
4225
|
+
z.className = "wgt:text-white wgt:text-sm wgt:font-semibold", z.innerText = String(f + 1), F.appendChild(z), G.appendChild(F);
|
|
4221
4226
|
const T = document.createElement("p");
|
|
4222
|
-
T.className = "wgt:ml-3 wgt:text-text-sub-600", T.innerText = V, N.appendChild(
|
|
4227
|
+
T.className = "wgt:ml-3 wgt:text-text-sub-600", T.innerText = V, N.appendChild(G), N.appendChild(T), C.appendChild(N);
|
|
4223
4228
|
})), I.illustrationSrc != null && (v.src = I.illustrationSrc);
|
|
4224
4229
|
}
|
|
4225
4230
|
};
|
|
@@ -4278,8 +4283,8 @@ function v1({
|
|
|
4278
4283
|
const x = document.createElement("p");
|
|
4279
4284
|
x.className = "wgt:text-base wgt:font-medium wgt:leading-6 wgt:text-primary";
|
|
4280
4285
|
const d = (S) => {
|
|
4281
|
-
const
|
|
4282
|
-
return `${
|
|
4286
|
+
const U = Math.floor(S / 60).toString().padStart(2, "0"), ln = (S % 60).toString().padStart(2, "0");
|
|
4287
|
+
return `${U}:${ln}`;
|
|
4283
4288
|
}, Q = () => {
|
|
4284
4289
|
x.innerHTML = `${g(
|
|
4285
4290
|
"completePaymentIn"
|
|
@@ -4314,21 +4319,21 @@ function v1({
|
|
|
4314
4319
|
if (I.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", I.innerText = n ? String(n.code) : "", y.appendChild(v), y.appendChild(I), w.appendChild(y), !u) {
|
|
4315
4320
|
const S = document.createElement("div");
|
|
4316
4321
|
S.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
4317
|
-
const
|
|
4318
|
-
|
|
4319
|
-
const
|
|
4320
|
-
|
|
4322
|
+
const U = document.createElement("h4");
|
|
4323
|
+
U.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", U.innerText = g("digitalSignaturePackage");
|
|
4324
|
+
const ln = document.createElement("span");
|
|
4325
|
+
ln.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", ln.innerText = e ? String(e.code) : "", S.appendChild(U), S.appendChild(ln), w.appendChild(S);
|
|
4321
4326
|
}
|
|
4322
4327
|
if (a && a.length > 0) {
|
|
4323
4328
|
const S = document.createElement("div");
|
|
4324
4329
|
S.className = "wgt:w-full wgt:flex wgt:items-start wgt:justify-between wgt:gap-[0.5rem]";
|
|
4325
|
-
const
|
|
4326
|
-
|
|
4327
|
-
const
|
|
4328
|
-
|
|
4330
|
+
const U = document.createElement("h4");
|
|
4331
|
+
U.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", U.innerText = g("promotion");
|
|
4332
|
+
const ln = document.createElement("div");
|
|
4333
|
+
ln.className = "wgt:flex wgt:items-center wgt:justify-end wgt:flex-wrap wgt:gap-2", a.forEach((fn) => {
|
|
4329
4334
|
const mn = document.createElement("div");
|
|
4330
|
-
mn.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", mn.innerText =
|
|
4331
|
-
}), S.appendChild(
|
|
4335
|
+
mn.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", mn.innerText = fn, ln.appendChild(mn);
|
|
4336
|
+
}), S.appendChild(U), S.appendChild(ln), w.appendChild(S);
|
|
4332
4337
|
}
|
|
4333
4338
|
const V = document.createElement("hr");
|
|
4334
4339
|
w.appendChild(V);
|
|
@@ -4336,8 +4341,8 @@ function v1({
|
|
|
4336
4341
|
f.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
4337
4342
|
const N = document.createElement("h4");
|
|
4338
4343
|
N.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", N.innerText = g("paymentAmount");
|
|
4339
|
-
const
|
|
4340
|
-
|
|
4344
|
+
const G = document.createElement("span");
|
|
4345
|
+
G.className = "wgt:text-2xl wgt:font-bold wgt:leading-6 wgt:text-[#ED1C24]", G.innerText = typeof h == "number" ? h.toLocaleString("vi-VN") + " VND" : h, f.appendChild(N), f.appendChild(G), w.appendChild(f);
|
|
4341
4346
|
const F = document.createElement("div");
|
|
4342
4347
|
F.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-2 wgt:p-4 wgt:rounded-lg wgt:mt-8", F.style.backgroundColor = "#47c2ff29";
|
|
4343
4348
|
const z = document.createElement("div");
|
|
@@ -4366,8 +4371,8 @@ function v1({
|
|
|
4366
4371
|
J.className = "wgt:flex wgt:gap-4 wgt:mt-6";
|
|
4367
4372
|
const {
|
|
4368
4373
|
container: D,
|
|
4369
|
-
open:
|
|
4370
|
-
close:
|
|
4374
|
+
open: _,
|
|
4375
|
+
close: nn
|
|
4371
4376
|
} = e0();
|
|
4372
4377
|
document.body.appendChild(D);
|
|
4373
4378
|
const R = vt({
|
|
@@ -4376,31 +4381,31 @@ function v1({
|
|
|
4376
4381
|
handleClick: i ? () => sn(null, null, function* () {
|
|
4377
4382
|
R.disabled = !0;
|
|
4378
4383
|
const S = R.textContent;
|
|
4379
|
-
R.textContent = g("processing") || "Đang xử lý...",
|
|
4384
|
+
R.textContent = g("processing") || "Đang xử lý...", _();
|
|
4380
4385
|
try {
|
|
4381
4386
|
yield kc(c), R.className = R.className.replace(
|
|
4382
4387
|
/bg-primary|bg-\[\#0066cc\]/g,
|
|
4383
4388
|
"bg-green-500"
|
|
4384
4389
|
), R.textContent = g("confirmed") || "Đã xác nhận";
|
|
4385
|
-
const
|
|
4390
|
+
const U = Jt({
|
|
4386
4391
|
message: g("freeOrderSuccess") || "Thông tin đăng ký đã được ghi nhận thành công!",
|
|
4387
4392
|
okLabel: g("next") || "Tiếp tục",
|
|
4388
4393
|
theme: "bvb",
|
|
4389
4394
|
isSuccess: !0,
|
|
4390
4395
|
preventClose: !0,
|
|
4391
4396
|
onClose: () => {
|
|
4392
|
-
clearInterval(s), o(),
|
|
4397
|
+
clearInterval(s), o(), nn();
|
|
4393
4398
|
}
|
|
4394
4399
|
});
|
|
4395
|
-
q.appendChild(
|
|
4396
|
-
} catch (
|
|
4400
|
+
q.appendChild(U.container), U.open();
|
|
4401
|
+
} catch (U) {
|
|
4397
4402
|
R.disabled = !1, R.textContent = S;
|
|
4398
|
-
const
|
|
4403
|
+
const ln = Jt({
|
|
4399
4404
|
message: "Xác nhận đơn hàng thất bại. Vui lòng thử lại.",
|
|
4400
4405
|
okLabel: "OK",
|
|
4401
4406
|
isSuccess: !1
|
|
4402
4407
|
});
|
|
4403
|
-
q.appendChild(
|
|
4408
|
+
q.appendChild(ln.container), ln.open(), nn();
|
|
4404
4409
|
}
|
|
4405
4410
|
}) : () => {
|
|
4406
4411
|
s && clearInterval(s);
|
|
@@ -4414,7 +4419,7 @@ function v1({
|
|
|
4414
4419
|
});
|
|
4415
4420
|
q.appendChild(S.container), S.open();
|
|
4416
4421
|
}
|
|
4417
|
-
}),
|
|
4422
|
+
}), W = vt({
|
|
4418
4423
|
title: g("cancelTransaction") || "Hủy giao dịch",
|
|
4419
4424
|
className: "wgt:flex-1 wgt:py-4 wgt:rounded-lg wgt:bg-transparent wgt:border wgt:border-primary wgt:text-primary hover:wgt:bg-transparent",
|
|
4420
4425
|
handleClick: () => {
|
|
@@ -4431,7 +4436,7 @@ function v1({
|
|
|
4431
4436
|
q.appendChild(S.container), S.open();
|
|
4432
4437
|
}
|
|
4433
4438
|
});
|
|
4434
|
-
return J.appendChild(R), i && J.appendChild(
|
|
4439
|
+
return J.appendChild(R), i && J.appendChild(W), p.appendChild(J), q.appendChild(p), {
|
|
4435
4440
|
container: q,
|
|
4436
4441
|
resetCountdown() {
|
|
4437
4442
|
clearInterval(s), s = null, r = 3600, Q(), k();
|
|
@@ -4441,28 +4446,28 @@ function v1({
|
|
|
4441
4446
|
},
|
|
4442
4447
|
setTotalAmountText(S) {
|
|
4443
4448
|
h = S;
|
|
4444
|
-
const
|
|
4445
|
-
|
|
4449
|
+
const U = q.querySelector(".wgt:text-2xl.wgt:font-bold");
|
|
4450
|
+
U && (U.innerText = typeof S == "number" ? S.toLocaleString("vi-VN") + " VND" : S);
|
|
4446
4451
|
},
|
|
4447
4452
|
setSelectedProvider(S) {
|
|
4448
4453
|
t = S;
|
|
4449
|
-
const
|
|
4450
|
-
|
|
4454
|
+
const U = q.querySelector("img");
|
|
4455
|
+
U && (S != null && S.logoUrl) && (U.src = S.logoUrl, U.alt = S.name || "");
|
|
4451
4456
|
},
|
|
4452
4457
|
setSelectedInvoicePackage(S) {
|
|
4453
4458
|
n = S;
|
|
4454
|
-
const
|
|
4459
|
+
const U = q.querySelectorAll(
|
|
4455
4460
|
".wgt:text-base.wgt:font-semibold.wgt:leading-6.wgt:text-text-black"
|
|
4456
4461
|
)[0];
|
|
4457
|
-
|
|
4462
|
+
U && (U.innerText = S ? String(S.code || "") : "");
|
|
4458
4463
|
},
|
|
4459
4464
|
setSelectedSignaturePackage(S) {
|
|
4460
4465
|
if (u) return;
|
|
4461
4466
|
e = S;
|
|
4462
|
-
const
|
|
4467
|
+
const U = q.querySelectorAll(
|
|
4463
4468
|
".wgt:text-base.wgt:font-semibold.wgt:leading-6.wgt:text-text-black"
|
|
4464
4469
|
);
|
|
4465
|
-
|
|
4470
|
+
U[1] && (U[1].innerText = S ? String(S.code || "") : "");
|
|
4466
4471
|
}
|
|
4467
4472
|
};
|
|
4468
4473
|
}
|
|
@@ -5749,8 +5754,8 @@ function Z1() {
|
|
|
5749
5754
|
for (f === 6 && f--; ; ) {
|
|
5750
5755
|
for (let N = 0; N < 2; N++)
|
|
5751
5756
|
if (!B.isReserved(v, f - N)) {
|
|
5752
|
-
let
|
|
5753
|
-
V < X.length && (
|
|
5757
|
+
let G = !1;
|
|
5758
|
+
V < X.length && (G = (X[V] >>> I & 1) === 1), B.set(v, f - N, G), I--, I === -1 && (V++, I = 7);
|
|
5754
5759
|
}
|
|
5755
5760
|
if (v += y, v < 0 || C <= v) {
|
|
5756
5761
|
v -= y, y = -y;
|
|
@@ -5772,36 +5777,36 @@ function Z1() {
|
|
|
5772
5777
|
return w(y, B, X);
|
|
5773
5778
|
}
|
|
5774
5779
|
function w(B, X, C) {
|
|
5775
|
-
const y = t.getSymbolTotalCodewords(X), v = o.getTotalCodewordsCount(X, C), I = y - v, V = o.getBlocksCount(X, C), f = y % V, N = V - f,
|
|
5780
|
+
const y = t.getSymbolTotalCodewords(X), v = o.getTotalCodewordsCount(X, C), I = y - v, V = o.getBlocksCount(X, C), f = y % V, N = V - f, G = Math.floor(y / V), F = Math.floor(I / V), z = F + 1, T = G - F, m = new u(T);
|
|
5776
5781
|
let P = 0;
|
|
5777
5782
|
const H = new Array(V), L = new Array(V);
|
|
5778
5783
|
let J = 0;
|
|
5779
5784
|
const D = new Uint8Array(B.buffer);
|
|
5780
5785
|
for (let S = 0; S < V; S++) {
|
|
5781
|
-
const
|
|
5782
|
-
H[S] = D.slice(P, P +
|
|
5786
|
+
const U = S < N ? F : z;
|
|
5787
|
+
H[S] = D.slice(P, P + U), L[S] = m.encode(H[S]), P += U, J = Math.max(J, U);
|
|
5783
5788
|
}
|
|
5784
|
-
const
|
|
5785
|
-
let
|
|
5789
|
+
const _ = new Uint8Array(y);
|
|
5790
|
+
let nn = 0, R, W;
|
|
5786
5791
|
for (R = 0; R < J; R++)
|
|
5787
|
-
for (
|
|
5788
|
-
R < H[
|
|
5792
|
+
for (W = 0; W < V; W++)
|
|
5793
|
+
R < H[W].length && (_[nn++] = H[W][R]);
|
|
5789
5794
|
for (R = 0; R < T; R++)
|
|
5790
|
-
for (
|
|
5791
|
-
|
|
5792
|
-
return
|
|
5795
|
+
for (W = 0; W < V; W++)
|
|
5796
|
+
_[nn++] = L[W][R];
|
|
5797
|
+
return _;
|
|
5793
5798
|
}
|
|
5794
5799
|
function E(B, X, C, y) {
|
|
5795
5800
|
let v;
|
|
5796
5801
|
if (Array.isArray(B))
|
|
5797
5802
|
v = s.fromArray(B);
|
|
5798
5803
|
else if (typeof B == "string") {
|
|
5799
|
-
let
|
|
5800
|
-
if (!
|
|
5804
|
+
let G = X;
|
|
5805
|
+
if (!G) {
|
|
5801
5806
|
const F = s.rawSplit(B);
|
|
5802
|
-
|
|
5807
|
+
G = i.getBestVersionForData(F, C);
|
|
5803
5808
|
}
|
|
5804
|
-
v = s.fromString(B,
|
|
5809
|
+
v = s.fromString(B, G || 40);
|
|
5805
5810
|
} else
|
|
5806
5811
|
throw new Error("Invalid data");
|
|
5807
5812
|
const I = i.getBestVersionForData(v, C);
|
|
@@ -6250,7 +6255,7 @@ function Aa(o) {
|
|
|
6250
6255
|
}), t();
|
|
6251
6256
|
}
|
|
6252
6257
|
}));
|
|
6253
|
-
function
|
|
6258
|
+
function G() {
|
|
6254
6259
|
if (v.innerHTML = "", I.innerHTML = "", x)
|
|
6255
6260
|
v.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-center wgt:min-h-[400px]", v.appendChild(N);
|
|
6256
6261
|
else {
|
|
@@ -6288,12 +6293,12 @@ function Aa(o) {
|
|
|
6288
6293
|
provider: Q,
|
|
6289
6294
|
theme: A,
|
|
6290
6295
|
isFreeOrder: x
|
|
6291
|
-
}),
|
|
6296
|
+
}), G(), !x && r && (yield m(r));
|
|
6292
6297
|
});
|
|
6293
6298
|
}
|
|
6294
6299
|
function m(J) {
|
|
6295
6300
|
return sn(this, null, function* () {
|
|
6296
|
-
var D,
|
|
6301
|
+
var D, _, nn, R;
|
|
6297
6302
|
if (!(s || x)) {
|
|
6298
6303
|
s = !0, C();
|
|
6299
6304
|
try {
|
|
@@ -6322,13 +6327,13 @@ function Aa(o) {
|
|
|
6322
6327
|
accountNumber: (u == null ? void 0 : u.va_account_no) || "",
|
|
6323
6328
|
bankName: (u == null ? void 0 : u.bank_code) || ""
|
|
6324
6329
|
}), P();
|
|
6325
|
-
} catch (
|
|
6326
|
-
if (((
|
|
6330
|
+
} catch (W) {
|
|
6331
|
+
if (((_ = (D = W.response) == null ? void 0 : D.data) == null ? void 0 : _.error_code) === "BILL_ID_EXISTED") {
|
|
6327
6332
|
if (l++, xh.failed({
|
|
6328
6333
|
orderId: J != null ? J : h == null ? void 0 : h.orderId,
|
|
6329
6334
|
amount: d,
|
|
6330
6335
|
errorCode: "BILL_ID_EXISTED",
|
|
6331
|
-
errorMessage:
|
|
6336
|
+
errorMessage: W == null ? void 0 : W.message,
|
|
6332
6337
|
provider: Q,
|
|
6333
6338
|
theme: A,
|
|
6334
6339
|
retryCount: l
|
|
@@ -6339,7 +6344,7 @@ function Aa(o) {
|
|
|
6339
6344
|
s = !1;
|
|
6340
6345
|
return;
|
|
6341
6346
|
} else {
|
|
6342
|
-
if (((
|
|
6347
|
+
if (((nn = W.response) == null ? void 0 : nn.status) === 401 || ((R = W.response) == null ? void 0 : R.status) === 403)
|
|
6343
6348
|
return;
|
|
6344
6349
|
n0(
|
|
6345
6350
|
g(
|
|
@@ -6359,7 +6364,7 @@ function Aa(o) {
|
|
|
6359
6364
|
}
|
|
6360
6365
|
function P() {
|
|
6361
6366
|
x || q || (q = setInterval(() => sn(null, null, function* () {
|
|
6362
|
-
var J, D,
|
|
6367
|
+
var J, D, _, nn, R, W;
|
|
6363
6368
|
try {
|
|
6364
6369
|
const S = yield vc(r);
|
|
6365
6370
|
if (S.paymentStatus === "pending") return;
|
|
@@ -6368,7 +6373,7 @@ function Aa(o) {
|
|
|
6368
6373
|
orderId: r,
|
|
6369
6374
|
expectedAmount: d,
|
|
6370
6375
|
receivedAmount: (D = (J = S == null ? void 0 : S.receivedAmount) != null ? J : S == null ? void 0 : S.amount) != null ? D : null,
|
|
6371
|
-
difference: ((
|
|
6376
|
+
difference: ((nn = (_ = S == null ? void 0 : S.receivedAmount) != null ? _ : S == null ? void 0 : S.amount) != null ? nn : 0) - (d != null ? d : 0),
|
|
6372
6377
|
paymentMethod: k,
|
|
6373
6378
|
provider: Q,
|
|
6374
6379
|
theme: A
|
|
@@ -6380,17 +6385,17 @@ function Aa(o) {
|
|
|
6380
6385
|
provider: Q,
|
|
6381
6386
|
theme: A
|
|
6382
6387
|
});
|
|
6383
|
-
const
|
|
6388
|
+
const fn = aa({
|
|
6384
6389
|
onClose: () => {
|
|
6385
6390
|
var mn;
|
|
6386
6391
|
return (mn = h == null ? void 0 : h.onResetToStep1) == null ? void 0 : mn.call(h);
|
|
6387
6392
|
}
|
|
6388
6393
|
});
|
|
6389
|
-
B.appendChild(
|
|
6394
|
+
B.appendChild(fn.container), fn.open();
|
|
6390
6395
|
return;
|
|
6391
6396
|
}
|
|
6392
6397
|
clearInterval(q), q = null;
|
|
6393
|
-
const
|
|
6398
|
+
const U = p ? Math.round((Date.now() - p) / 1e3) : null;
|
|
6394
6399
|
S.paymentStatus === "paid" ? _t.success({
|
|
6395
6400
|
orderId: r,
|
|
6396
6401
|
amount: d,
|
|
@@ -6398,7 +6403,7 @@ function Aa(o) {
|
|
|
6398
6403
|
paymentMethod: k,
|
|
6399
6404
|
provider: Q,
|
|
6400
6405
|
theme: A,
|
|
6401
|
-
duration:
|
|
6406
|
+
duration: U
|
|
6402
6407
|
}) : _t.failed({
|
|
6403
6408
|
orderId: r,
|
|
6404
6409
|
amount: d,
|
|
@@ -6416,7 +6421,7 @@ function Aa(o) {
|
|
|
6416
6421
|
provider: Q,
|
|
6417
6422
|
theme: A
|
|
6418
6423
|
});
|
|
6419
|
-
const
|
|
6424
|
+
const ln = Jt({
|
|
6420
6425
|
message: S.paymentStatus === "paid" ? g("paymentSuccess") : g("paymentFailed"),
|
|
6421
6426
|
okLabel: "OK",
|
|
6422
6427
|
theme: A,
|
|
@@ -6424,9 +6429,9 @@ function Aa(o) {
|
|
|
6424
6429
|
onClose: () => t(),
|
|
6425
6430
|
preventClose: !0
|
|
6426
6431
|
});
|
|
6427
|
-
B.appendChild(
|
|
6432
|
+
B.appendChild(ln.container), ln.open();
|
|
6428
6433
|
} catch (S) {
|
|
6429
|
-
!navigator.onLine || !S.response ? n0(g("errorNetwork"), { isOffline: !0 }) : (((R = S.response) == null ? void 0 : R.status) === 404 || ((
|
|
6434
|
+
!navigator.onLine || !S.response ? n0(g("errorNetwork"), { isOffline: !0 }) : (((R = S.response) == null ? void 0 : R.status) === 404 || ((W = S.response) == null ? void 0 : W.status) === 410) && (clearInterval(q), q = null);
|
|
6430
6435
|
}
|
|
6431
6436
|
}), 5e3));
|
|
6432
6437
|
}
|
|
@@ -6540,8 +6545,8 @@ function ua({
|
|
|
6540
6545
|
f.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", f.appendChild(document.createTextNode(g("notice3.1") + " "));
|
|
6541
6546
|
const N = document.createElement("a");
|
|
6542
6547
|
N.className = "wgt:text-primary wgt:font-semibold wgt:hover:underline wgt:cursor-pointer", N.textContent = g("settings") + " ", N.href = h, N.target = "_blank", f.appendChild(N), f.appendChild(document.createTextNode(g("notice3.2") + " ")), I.appendChild(f);
|
|
6543
|
-
const
|
|
6544
|
-
|
|
6548
|
+
const G = document.createElement("div");
|
|
6549
|
+
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", o.appendChild(G);
|
|
6545
6550
|
const F = document.createElement("div");
|
|
6546
6551
|
F.className = "wgt:w-5 wgt:h-5 wgt:flex wgt:items-center wgt:justify-center", F.innerHTML = `
|
|
6547
6552
|
<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -6549,7 +6554,7 @@ function ua({
|
|
|
6549
6554
|
</svg>
|
|
6550
6555
|
`;
|
|
6551
6556
|
const z = document.createElement("label");
|
|
6552
|
-
z.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950 wgt:leading-tight", z.appendChild(document.createTextNode(g("informationSent"))),
|
|
6557
|
+
z.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950 wgt:leading-tight", z.appendChild(document.createTextNode(g("informationSent"))), G.appendChild(F), G.appendChild(z);
|
|
6553
6558
|
const T = document.createElement("div");
|
|
6554
6559
|
T.className = "wgt:w-full wgt:flex wgt:justify-center", o.appendChild(T);
|
|
6555
6560
|
const m = vt({
|
|
@@ -7106,13 +7111,13 @@ function Na(t, n, e, c, h, a) {
|
|
|
7106
7111
|
function N() {
|
|
7107
7112
|
V(), l = 1, r(l, u()), z(l);
|
|
7108
7113
|
}
|
|
7109
|
-
function
|
|
7114
|
+
function G() {
|
|
7110
7115
|
typeof window != "undefined" && window.scrollTo({
|
|
7111
7116
|
top: 0,
|
|
7112
7117
|
behavior: "smooth"
|
|
7113
7118
|
});
|
|
7114
7119
|
}
|
|
7115
|
-
function F(D,
|
|
7120
|
+
function F(D, _) {
|
|
7116
7121
|
return sn(this, null, function* () {
|
|
7117
7122
|
D ? d = Yn(Hn({}, d), {
|
|
7118
7123
|
eInvoiceRegistration: {
|
|
@@ -7123,25 +7128,26 @@ function Na(t, n, e, c, h, a) {
|
|
|
7123
7128
|
invoiceSymbol: D.invoiceSymbol,
|
|
7124
7129
|
previousEInvoiceProvider: D.previousEInvoiceProvider
|
|
7125
7130
|
}
|
|
7126
|
-
}) :
|
|
7131
|
+
}) : _ && f(_), yield z(l);
|
|
7127
7132
|
});
|
|
7128
7133
|
}
|
|
7129
7134
|
function z(D) {
|
|
7130
7135
|
return sn(this, null, function* () {
|
|
7136
|
+
const _ = "1C26MYY", nn = /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/;
|
|
7131
7137
|
if (D === 1) {
|
|
7132
|
-
const { container:
|
|
7138
|
+
const { container: R } = yield T1({
|
|
7133
7139
|
isNewCustomer: k,
|
|
7134
7140
|
isRenewal: a,
|
|
7135
7141
|
providerProps: {
|
|
7136
7142
|
providers: o,
|
|
7137
7143
|
selectedRoute: x.route,
|
|
7138
|
-
onProviderChange: (
|
|
7139
|
-
var
|
|
7140
|
-
x =
|
|
7141
|
-
|
|
7142
|
-
(
|
|
7143
|
-
(
|
|
7144
|
-
k =
|
|
7144
|
+
onProviderChange: (W) => sn(null, null, function* () {
|
|
7145
|
+
var S, U;
|
|
7146
|
+
x = W, yield b0(
|
|
7147
|
+
W.route,
|
|
7148
|
+
(U = (S = d == null ? void 0 : d.eInvoiceRegistration) == null ? void 0 : S.organization) == null ? void 0 : U.taxCode,
|
|
7149
|
+
(ln, fn) => {
|
|
7150
|
+
k = ln, F(fn);
|
|
7145
7151
|
},
|
|
7146
7152
|
a,
|
|
7147
7153
|
h,
|
|
@@ -7149,46 +7155,31 @@ function Na(t, n, e, c, h, a) {
|
|
|
7149
7155
|
);
|
|
7150
7156
|
})
|
|
7151
7157
|
},
|
|
7152
|
-
// formProps: {
|
|
7153
|
-
// isNewCustomer,
|
|
7154
|
-
// handleCheckNewCustomer: (provider, taxCode, callback) => {
|
|
7155
|
-
// return handleCheckNewCustomer(
|
|
7156
|
-
// provider,
|
|
7157
|
-
// taxCode,
|
|
7158
|
-
// callback,
|
|
7159
|
-
// isRenewal,
|
|
7160
|
-
// );
|
|
7161
|
-
// },
|
|
7162
|
-
// updateRegistrationData,
|
|
7163
|
-
// onSubmit: (data) => {
|
|
7164
|
-
// registrationData.eInvoiceRegistration = {
|
|
7165
|
-
// ...registrationData.eInvoiceRegistration,
|
|
7166
|
-
// ...data.eInvoiceRegistration,
|
|
7167
|
-
// };
|
|
7168
7158
|
formProps: {
|
|
7169
7159
|
isNewCustomer: k,
|
|
7170
7160
|
isRenewal: a,
|
|
7171
7161
|
handleCheckNewCustomer: b0,
|
|
7172
7162
|
updateRegistrationData: F,
|
|
7173
|
-
serial:
|
|
7174
|
-
|
|
7175
|
-
|
|
7163
|
+
// serial: data?.serial || '',
|
|
7164
|
+
serial: nn.test((c == null ? void 0 : c.serial) || "") ? c.serial : _,
|
|
7165
|
+
onSubmit: (W) => {
|
|
7166
|
+
d.eInvoiceRegistration = Hn(Hn({}, d.eInvoiceRegistration), W.eInvoiceRegistration), d.logo = W.logo || null, d.license = W.license || null, d.idCard = W.idCard || null, d.idCardBack = W.idCardBack || null, d.provider = x.route, l = 2, r(l, u()), z(l), G();
|
|
7176
7167
|
},
|
|
7177
7168
|
registrationData: d,
|
|
7178
7169
|
theme: h || "default",
|
|
7179
7170
|
onShowPolicy: e || (() => {
|
|
7180
7171
|
}),
|
|
7181
7172
|
selectedTaxAuthority: C,
|
|
7182
|
-
setSelectedTaxAuthority: (
|
|
7183
|
-
C =
|
|
7173
|
+
setSelectedTaxAuthority: (W) => {
|
|
7174
|
+
C = W;
|
|
7184
7175
|
},
|
|
7185
7176
|
dobPicker: v,
|
|
7186
|
-
setDobPicker: (
|
|
7187
|
-
v =
|
|
7177
|
+
setDobPicker: (W) => {
|
|
7178
|
+
v = W;
|
|
7188
7179
|
}
|
|
7189
7180
|
}
|
|
7190
7181
|
});
|
|
7191
|
-
s(
|
|
7182
|
+
s(R);
|
|
7192
7183
|
} else if (D === 2) {
|
|
7193
7184
|
Gn(Wn.STEP2_VIEWED, {
|
|
7194
7185
|
theme: h,
|
|
@@ -7196,7 +7187,7 @@ function Na(t, n, e, c, h, a) {
|
|
|
7196
7187
|
provider: x == null ? void 0 : x.route,
|
|
7197
7188
|
isNewCustomer: k
|
|
7198
7189
|
});
|
|
7199
|
-
const { container:
|
|
7190
|
+
const { container: R } = yield E1({
|
|
7200
7191
|
onNext: () => sn(null, null, function* () {
|
|
7201
7192
|
Gn(Wn.STEP2_COMPLETED, {
|
|
7202
7193
|
theme: h,
|
|
@@ -7204,40 +7195,40 @@ function Na(t, n, e, c, h, a) {
|
|
|
7204
7195
|
totalAmount: B,
|
|
7205
7196
|
orderAmount: X,
|
|
7206
7197
|
isFreeOrder: B === 0
|
|
7207
|
-
}), l = 3, r(l, u()), z(l),
|
|
7198
|
+
}), l = 3, r(l, u()), z(l), G();
|
|
7208
7199
|
}),
|
|
7209
7200
|
onPrev: () => {
|
|
7210
|
-
l = 1, r(l, u()), z(l),
|
|
7201
|
+
l = 1, r(l, u()), z(l), G();
|
|
7211
7202
|
},
|
|
7212
|
-
setOrderAmount: (
|
|
7213
|
-
X =
|
|
7203
|
+
setOrderAmount: (W) => {
|
|
7204
|
+
X = W;
|
|
7214
7205
|
},
|
|
7215
|
-
setSelectedInitPackage: (
|
|
7216
|
-
p =
|
|
7206
|
+
setSelectedInitPackage: (W) => {
|
|
7207
|
+
p = W;
|
|
7217
7208
|
},
|
|
7218
|
-
setSelectedInvoiceOtp: (
|
|
7219
|
-
w =
|
|
7209
|
+
setSelectedInvoiceOtp: (W) => {
|
|
7210
|
+
w = W;
|
|
7220
7211
|
},
|
|
7221
|
-
setSelectedSignatureOtp: (
|
|
7222
|
-
E =
|
|
7212
|
+
setSelectedSignatureOtp: (W) => {
|
|
7213
|
+
E = W;
|
|
7223
7214
|
},
|
|
7224
|
-
setOrderId: (
|
|
7225
|
-
b =
|
|
7215
|
+
setOrderId: (W) => {
|
|
7216
|
+
b = W;
|
|
7226
7217
|
},
|
|
7227
|
-
setTotalAmount: (
|
|
7228
|
-
B =
|
|
7218
|
+
setTotalAmount: (W) => {
|
|
7219
|
+
B = W;
|
|
7229
7220
|
},
|
|
7230
|
-
setOrderAmount: (
|
|
7231
|
-
X =
|
|
7221
|
+
setOrderAmount: (W) => {
|
|
7222
|
+
X = W;
|
|
7232
7223
|
},
|
|
7233
|
-
setSelectedPromotions: (
|
|
7234
|
-
y =
|
|
7224
|
+
setSelectedPromotions: (W) => {
|
|
7225
|
+
y = W;
|
|
7235
7226
|
},
|
|
7236
|
-
setPackages: (
|
|
7237
|
-
d.packages =
|
|
7227
|
+
setPackages: (W) => {
|
|
7228
|
+
d.packages = W;
|
|
7238
7229
|
},
|
|
7239
|
-
setPromotionCodes: (
|
|
7240
|
-
d.promotionCodes =
|
|
7230
|
+
setPromotionCodes: (W) => {
|
|
7231
|
+
d.promotionCodes = W;
|
|
7241
7232
|
},
|
|
7242
7233
|
selectedInitPackage: p,
|
|
7243
7234
|
selectedInvoiceOtp: w,
|
|
@@ -7249,18 +7240,18 @@ function Na(t, n, e, c, h, a) {
|
|
|
7249
7240
|
isNewCustomer: k,
|
|
7250
7241
|
savedQuantities: I,
|
|
7251
7242
|
isRenewal: a,
|
|
7252
|
-
setSavedQuantities: (
|
|
7253
|
-
I =
|
|
7243
|
+
setSavedQuantities: (W) => {
|
|
7244
|
+
I = W;
|
|
7254
7245
|
}
|
|
7255
7246
|
});
|
|
7256
|
-
s(
|
|
7247
|
+
s(R);
|
|
7257
7248
|
} else if (D === 3) {
|
|
7258
|
-
const { container:
|
|
7249
|
+
const { container: R } = yield Aa({
|
|
7259
7250
|
onNext: () => {
|
|
7260
|
-
l = 4, r(l, u()), z(l),
|
|
7251
|
+
l = 4, r(l, u()), z(l), G();
|
|
7261
7252
|
},
|
|
7262
7253
|
onPrev: () => {
|
|
7263
|
-
l = 2, r(l, u()), z(l),
|
|
7254
|
+
l = 2, r(l, u()), z(l), G();
|
|
7264
7255
|
},
|
|
7265
7256
|
step: 3,
|
|
7266
7257
|
checkoutProps: {
|
|
@@ -7281,20 +7272,20 @@ function Na(t, n, e, c, h, a) {
|
|
|
7281
7272
|
isRenewal: a,
|
|
7282
7273
|
isNewCustomer: k,
|
|
7283
7274
|
onCancel: () => {
|
|
7284
|
-
l = 2, r(l, u()), z(l),
|
|
7275
|
+
l = 2, r(l, u()), z(l), G();
|
|
7285
7276
|
},
|
|
7286
7277
|
onResetToStep1: N
|
|
7287
7278
|
},
|
|
7288
|
-
setOrderId: (
|
|
7289
|
-
b =
|
|
7279
|
+
setOrderId: (W) => {
|
|
7280
|
+
b = W;
|
|
7290
7281
|
}
|
|
7291
7282
|
});
|
|
7292
|
-
s(
|
|
7283
|
+
s(R);
|
|
7293
7284
|
} else if (D === 4) {
|
|
7294
|
-
const { container:
|
|
7285
|
+
const { container: R } = ua({
|
|
7295
7286
|
orderId: b || "",
|
|
7296
7287
|
onPrev: () => {
|
|
7297
|
-
l = 3, r(l, u()), z(l),
|
|
7288
|
+
l = 3, r(l, u()), z(l), G();
|
|
7298
7289
|
},
|
|
7299
7290
|
// onReturnHome: close ? close : () => {},
|
|
7300
7291
|
onReturnHome: () => {
|
|
@@ -7302,10 +7293,10 @@ function Na(t, n, e, c, h, a) {
|
|
|
7302
7293
|
},
|
|
7303
7294
|
theme: h || "ocb",
|
|
7304
7295
|
settingUrl: (c == null ? void 0 : c.settingUrl) || "",
|
|
7305
|
-
serial: (c == null ? void 0 : c.serial) || "
|
|
7296
|
+
serial: (c == null ? void 0 : c.serial) || "1C26MYY",
|
|
7306
7297
|
provider: x.route
|
|
7307
7298
|
});
|
|
7308
|
-
s(
|
|
7299
|
+
s(R);
|
|
7309
7300
|
}
|
|
7310
7301
|
});
|
|
7311
7302
|
}
|
|
@@ -7313,8 +7304,8 @@ function Na(t, n, e, c, h, a) {
|
|
|
7313
7304
|
Q && (s(T), m()), yield b0(
|
|
7314
7305
|
x.route,
|
|
7315
7306
|
(J = (L = d == null ? void 0 : d.eInvoiceRegistration) == null ? void 0 : L.organization) == null ? void 0 : J.taxCode,
|
|
7316
|
-
(D,
|
|
7317
|
-
Q = !1, k = D, F(
|
|
7307
|
+
(D, _) => sn(null, null, function* () {
|
|
7308
|
+
Q = !1, k = D, F(_), i.updateTitle(
|
|
7318
7309
|
a ? g("eInvoiceRenewal") : g("eInvoiceRegister")
|
|
7319
7310
|
);
|
|
7320
7311
|
}),
|