@invoice-sdk/widget 1.125.8 → 1.125.9
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-CVprXlPJ.js → index-1Bl0t_9P.js} +2 -2
- package/dist/{index-D-OFIrDL.js → index-CGNOB4Tu.js} +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +23 -23
- package/dist/{loading-CgLvT3kF.js → loading-w2MeQDf5.js} +2 -2
- package/dist/{widget-BZMTG6B7.js → widget-yXvUvL7E.js} +644 -652
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { c as
|
|
1
|
+
import { t as i, g as uh, a as st, s as Mt, c as Bt, b as Ch, d as fh, e as oh, f as Xh, o as Bh, m as Nh, h as Eh, i as Hh, v as Ph } from "./index-CGNOB4Tu.js";
|
|
2
|
+
import { c as lt, a as Kt, g as Jt, b as kh, f as kn, d as yh, e as Yt, h as vh, i as Qh, j as Lh, k as Ih, l as bh, m as Vh, n as Sh, o as Mh } from "./loading-w2MeQDf5.js";
|
|
3
3
|
import { g as mh } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
4
4
|
function C0({ steps: n = [], currentStep: t = 1 } = {}) {
|
|
5
5
|
const e = document.createElement("div");
|
|
@@ -25,11 +25,11 @@ function C0({ steps: n = [], currentStep: t = 1 } = {}) {
|
|
|
25
25
|
h.className = "wgt:relative wgt:flex wgt:w-full wgt:z-10 wgt:@max-2xl:grid wgt:@max-2xl:grid-cols-1 wgt:@max-2xl:overflow-hidden";
|
|
26
26
|
const c = [];
|
|
27
27
|
function A(o) {
|
|
28
|
-
n.forEach((
|
|
28
|
+
n.forEach((s, l) => {
|
|
29
29
|
const T = l + 1, r = o === n.length + 1 ? T < n.length : o !== T, q = document.createElement("div");
|
|
30
30
|
q.setAttribute("role", "listitem"), q.setAttribute(
|
|
31
31
|
"aria-label",
|
|
32
|
-
`Step ${T} of ${n.length}: ${
|
|
32
|
+
`Step ${T} of ${n.length}: ${s.label}`
|
|
33
33
|
), q.className = [
|
|
34
34
|
"wgt:flex-1",
|
|
35
35
|
"wgt:flex",
|
|
@@ -53,13 +53,13 @@ function C0({ steps: n = [], currentStep: t = 1 } = {}) {
|
|
|
53
53
|
const w = document.createElement("span");
|
|
54
54
|
w.innerText = String(T), w.className = "wgt:text-white wgt:font-medium", x.appendChild(w);
|
|
55
55
|
const b = document.createElement("span");
|
|
56
|
-
b.innerText =
|
|
56
|
+
b.innerText = s.label, b.className = "wgt:font-medium wgt:whitespace-nowrap", q.append(x, b), h.append(q), c.push({ wrap: q, circle: x, label: b });
|
|
57
57
|
}), e.append(a, h);
|
|
58
58
|
}
|
|
59
59
|
A(t);
|
|
60
60
|
function u(o) {
|
|
61
|
-
const
|
|
62
|
-
a.style.width = `${T}%`, l ===
|
|
61
|
+
const s = n.length, l = Math.max(0, Math.min(o, s)), T = l / s * 100;
|
|
62
|
+
a.style.width = `${T}%`, l === s ? (a.style.clipPath = "none", a.style.borderTopRightRadius = "10px", a.style.borderBottomRightRadius = "10px") : (a.style.clipPath = "polygon(0 0, calc(100% - 36px) 0, 100% 50%, calc(100% - 36px) 100%, 0 100%)", a.style.borderTopRightRadius = "0", a.style.borderBottomRightRadius = "0"), c.forEach(({ circle: r, label: q }, x) => {
|
|
63
63
|
x + 1 <= l ? (r.classList.add("wgt:bg-icon-primary"), r.classList.remove("wgt:bg-icon-soft-400"), q.classList.add("wgt:text-primary-dark"), q.classList.remove("wgt:text-soft-400")) : (r.classList.add("wgt:bg-icon-soft-400"), r.classList.remove("wgt:bg-icon-primary"), q.classList.add("wgt:text-soft-400"), q.classList.remove("wgt:text-primary-dark"));
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -112,18 +112,18 @@ function Jh({ steps: n = [], currentStep: t = 1 } = {}) {
|
|
|
112
112
|
"wgt:@max-2xl:shadow-none"
|
|
113
113
|
].join(" ");
|
|
114
114
|
let c = C0({
|
|
115
|
-
steps: n.map((
|
|
115
|
+
steps: n.map((s) => ({ label: s })),
|
|
116
116
|
currentStep: t
|
|
117
117
|
});
|
|
118
118
|
h.appendChild(c.container);
|
|
119
119
|
const A = document.createElement("div");
|
|
120
120
|
A.className = "wgt:flex-1", h.appendChild(A), e.appendChild(a), e.appendChild(h);
|
|
121
|
-
function u(
|
|
122
|
-
a.innerText =
|
|
121
|
+
function u(s) {
|
|
122
|
+
a.innerText = s;
|
|
123
123
|
}
|
|
124
|
-
function o(
|
|
124
|
+
function o(s) {
|
|
125
125
|
c.container.remove(), c = C0({
|
|
126
|
-
steps:
|
|
126
|
+
steps: s.map((l) => ({ label: l })),
|
|
127
127
|
currentStep: t
|
|
128
128
|
}), h.insertBefore(c.container, A);
|
|
129
129
|
}
|
|
@@ -132,15 +132,15 @@ function Jh({ steps: n = [], currentStep: t = 1 } = {}) {
|
|
|
132
132
|
/**
|
|
133
133
|
* change which step is active (1‐based index):
|
|
134
134
|
*/
|
|
135
|
-
setStep(
|
|
136
|
-
t =
|
|
135
|
+
setStep(s, l) {
|
|
136
|
+
t = s, o(l), c.update(s);
|
|
137
137
|
},
|
|
138
138
|
/**
|
|
139
139
|
* replace whatever content is inside the "children" area:
|
|
140
140
|
* @param {HTMLElement} domNode
|
|
141
141
|
*/
|
|
142
|
-
setContent(
|
|
143
|
-
A.replaceChildren(
|
|
142
|
+
setContent(s) {
|
|
143
|
+
A.replaceChildren(s);
|
|
144
144
|
},
|
|
145
145
|
updateSteps: o,
|
|
146
146
|
updateTitle: u
|
|
@@ -158,7 +158,7 @@ function Gt({
|
|
|
158
158
|
const u = document.createElement("div");
|
|
159
159
|
if (u.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:cursor-pointer", A) {
|
|
160
160
|
let T = function(r) {
|
|
161
|
-
r ? (
|
|
161
|
+
r ? (s.classList.add("wgt:bg-primary", "wgt:border-primary"), s.classList.remove("wgt:border-weak-50")) : (s.classList.remove("wgt:bg-primary", "wgt:border-primary"), s.classList.add("wgt:border-weak-50")), l.innerHTML = r ? `<svg width="10" height="8" viewBox="0 0 10 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
162
162
|
<mask id="path-1-inside-1_14170_92697" fill="white">
|
|
163
163
|
<path d="M3.58055 7.58156C3.38055 7.58156 3.19055 7.50156 3.05055 7.36156L0.220552 4.53156C-0.0694482 4.24156 -0.0694482 3.76156 0.220552 3.47156C0.510552 3.18156 0.990552 3.18156 1.28055 3.47156L3.58055 5.77156L8.72055 0.631563C9.01055 0.341563 9.49055 0.341563 9.78055 0.631563C10.0706 0.921563 10.0706 1.40156 9.78055 1.69156L4.11055 7.36156C3.97055 7.50156 3.78055 7.58156 3.58055 7.58156Z"/>
|
|
164
164
|
</mask>
|
|
@@ -179,8 +179,8 @@ function Gt({
|
|
|
179
179
|
</svg>
|
|
180
180
|
`;
|
|
181
181
|
}, o = a;
|
|
182
|
-
const
|
|
183
|
-
|
|
182
|
+
const s = document.createElement("div");
|
|
183
|
+
s.className = [
|
|
184
184
|
"wgt:w-7",
|
|
185
185
|
"wgt:h-7",
|
|
186
186
|
"wgt:border-2",
|
|
@@ -192,23 +192,23 @@ function Gt({
|
|
|
192
192
|
c ? "wgt:cursor-not-allowed" : "wgt:cursor-pointer"
|
|
193
193
|
].join(" ");
|
|
194
194
|
const l = document.createElement("div");
|
|
195
|
-
T(a),
|
|
195
|
+
T(a), s.appendChild(l), s.addEventListener("click", (r) => {
|
|
196
196
|
r.stopPropagation(), !c && (o = !o, T(o), h(o));
|
|
197
|
-
}), u.append(
|
|
197
|
+
}), u.append(s);
|
|
198
198
|
} else {
|
|
199
199
|
const o = document.createElement("div");
|
|
200
200
|
o.className = "wgt:relative wgt:flex wgt:items-center wgt:justify-center wgt:h-6 wgt:w-6 wgt:cursor-pointer wgt:rounded-full wgt:transition-colors wgt:duration-200";
|
|
201
|
-
const
|
|
202
|
-
|
|
201
|
+
const s = document.createElement("input");
|
|
202
|
+
s.type = "radio", n && (s.name = n), t && (s.value = t), s.checked = a, s.disabled = c, s.className = "wgt:invisible wgt:h-6 wgt:w-6";
|
|
203
203
|
const l = document.createElement("div");
|
|
204
204
|
l.className = `wgt:absolute wgt:w-5 wgt:h-5 wgt:rounded-full wgt:border wgt:border-white wgt:border-3 wgt:transition-all wgt:duration-200 wgt:ring-2
|
|
205
205
|
|
|
206
206
|
${a ? "wgt:ring-primary wgt:bg-primary" : "wgt:ring-grey-6 wgt:bg-grey-6"}`;
|
|
207
207
|
const T = document.createElement("span");
|
|
208
|
-
T.innerText = e,
|
|
208
|
+
T.innerText = e, s.addEventListener("change", (r) => {
|
|
209
209
|
const q = r.target.checked;
|
|
210
|
-
typeof h == "function" && h(q),
|
|
211
|
-
}), o.append(
|
|
210
|
+
typeof h == "function" && h(q), s.checked = !1;
|
|
211
|
+
}), o.append(s, T), o.append(l), u.append(o);
|
|
212
212
|
}
|
|
213
213
|
return {
|
|
214
214
|
container: u
|
|
@@ -222,7 +222,7 @@ function Dh({
|
|
|
222
222
|
const a = document.createElement("div");
|
|
223
223
|
a.className = "wgt:max-w-[1072px] wgt:mx-auto wgt:w-full wgt:flex wgt:flex-col wgt:gap-2";
|
|
224
224
|
const h = document.createElement("h2");
|
|
225
|
-
h.className = "wgt:text-sm wgt:font-semibold wgt:text-black", h.innerText =
|
|
225
|
+
h.className = "wgt:text-sm wgt:font-semibold wgt:text-black", h.innerText = i("selectProvider"), a.appendChild(h);
|
|
226
226
|
const c = document.createElement("div");
|
|
227
227
|
c.className = [
|
|
228
228
|
"wgt:w-full",
|
|
@@ -234,8 +234,8 @@ function Dh({
|
|
|
234
234
|
].join(" "), a.appendChild(c);
|
|
235
235
|
function A() {
|
|
236
236
|
c.innerHTML = "", n.forEach((u) => {
|
|
237
|
-
const o = u.route === t,
|
|
238
|
-
|
|
237
|
+
const o = u.route === t, s = document.createElement("div");
|
|
238
|
+
s.dataset.checked = o ? "true" : "false", s.className = [
|
|
239
239
|
"wgt:flex",
|
|
240
240
|
"wgt:items-center",
|
|
241
241
|
"wgt:justify-between",
|
|
@@ -250,7 +250,7 @@ function Dh({
|
|
|
250
250
|
"wgt:transition-colors",
|
|
251
251
|
"wgt:duration-200",
|
|
252
252
|
o ? "wgt:border-primary wgt:bg-primary-light" : ""
|
|
253
|
-
].filter(Boolean).join(" "),
|
|
253
|
+
].filter(Boolean).join(" "), s.addEventListener("click", () => {
|
|
254
254
|
t = u.route, typeof e == "function" && e(u), A();
|
|
255
255
|
});
|
|
256
256
|
const l = document.createElement("div");
|
|
@@ -268,7 +268,7 @@ function Dh({
|
|
|
268
268
|
},
|
|
269
269
|
disabled: !1
|
|
270
270
|
});
|
|
271
|
-
|
|
271
|
+
s.appendChild(l), s.appendChild(x), c.appendChild(s);
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
274
|
return A(), {
|
|
@@ -288,11 +288,11 @@ function In({
|
|
|
288
288
|
error: A = null,
|
|
289
289
|
onInput: u = null,
|
|
290
290
|
readOnly: o = !1,
|
|
291
|
-
horizontal:
|
|
291
|
+
horizontal: s = !1,
|
|
292
292
|
note: l = null
|
|
293
293
|
}) {
|
|
294
294
|
const T = document.createElement("div");
|
|
295
|
-
if (T.className = "wgt:w-full " + (
|
|
295
|
+
if (T.className = "wgt:w-full " + (s ? "wgt:@max-5xl:flex wgt:@max-5xl:flex-col wgt:@max-5xl:items-start wgt:@max-5xl:gap-1 wgt:grid wgt:grid-cols-6 wgt:items-start wgt:gap-2" : "wgt:flex wgt:flex-col wgt:gap-2"), h) {
|
|
296
296
|
const w = document.createElement("label");
|
|
297
297
|
if (w.htmlFor = n, w.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal", w.innerText = h, c) {
|
|
298
298
|
const b = document.createElement("span");
|
|
@@ -344,7 +344,7 @@ function Wt({
|
|
|
344
344
|
onChange: A = null,
|
|
345
345
|
required: u = !1,
|
|
346
346
|
horizontal: o = !1,
|
|
347
|
-
searchable:
|
|
347
|
+
searchable: s = !1
|
|
348
348
|
}) {
|
|
349
349
|
const l = document.createElement("div");
|
|
350
350
|
l.className = "wgt:w-full " + (o ? "wgt:@max-5xl:flex wgt:@max-5xl:flex-col wgt:@max-5xl:items-start wgt:@max-5xl:gap-2 wgt:grid wgt:grid-cols-6 wgt:items-start wgt:gap-2" : "wgt:flex wgt:flex-col wgt:gap-2");
|
|
@@ -353,11 +353,11 @@ function Wt({
|
|
|
353
353
|
const r = document.createElement("span");
|
|
354
354
|
r.className = "wgt:text-red-500 wgt:ml-1", r.innerText = "*", T.appendChild(r);
|
|
355
355
|
}
|
|
356
|
-
if (
|
|
356
|
+
if (s) {
|
|
357
357
|
const r = document.createElement("div");
|
|
358
358
|
r.className = "wgt:col-span-4 wgt:relative wgt:w-full";
|
|
359
359
|
const q = document.createElement("input");
|
|
360
|
-
q.type = "text", q.placeholder = `${
|
|
360
|
+
q.type = "text", q.placeholder = `${i(
|
|
361
361
|
"search",
|
|
362
362
|
"Tìm kiếm"
|
|
363
363
|
)} ${a.toLowerCase()}...`, q.disabled = h, q.className = [
|
|
@@ -385,7 +385,7 @@ function Wt({
|
|
|
385
385
|
const d = (B = I) => {
|
|
386
386
|
if (w.innerHTML = "", B.length === 0) {
|
|
387
387
|
const f = document.createElement("div");
|
|
388
|
-
f.className = "wgt:px-3 wgt:py-2 wgt:text-gray-500 wgt:text-sm", f.innerText = `${
|
|
388
|
+
f.className = "wgt:px-3 wgt:py-2 wgt:text-gray-500 wgt:text-sm", f.innerText = `${i("noResults", "Không tìm thấy kết quả")}`, w.appendChild(f);
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
B.forEach((f) => {
|
|
@@ -465,7 +465,7 @@ function Wt({
|
|
|
465
465
|
c ? "wgt:border-red-500" : "wgt:border-gray-300"
|
|
466
466
|
].join(" ");
|
|
467
467
|
const q = document.createElement("option");
|
|
468
|
-
q.value = "", q.disabled = !0, q.selected = t === "" || t == null, q.innerText = `-- ${
|
|
468
|
+
q.value = "", q.disabled = !0, q.selected = t === "" || t == null, q.innerText = `-- ${i(
|
|
469
469
|
"select",
|
|
470
470
|
"Chọn"
|
|
471
471
|
)} ${a.toLowerCase()} --`, r.appendChild(q), e.forEach((w) => {
|
|
@@ -511,12 +511,12 @@ function f0({
|
|
|
511
511
|
const C = document.createElement("span");
|
|
512
512
|
C.className = "wgt:text-red-500 wgt:ml-1", C.innerText = "*", u.appendChild(C);
|
|
513
513
|
}
|
|
514
|
-
const o = c ? c.split(",").map((C) => C.trim().startsWith("image/") ? C.replace("image/", "").toUpperCase() : C.trim().startsWith(".") ? C.replace(".", "").toUpperCase() : C.toUpperCase().replace("/*", "")).filter(Boolean).join(", ") : `JPG, PNG ${
|
|
515
|
-
u.innerHTML += ` <span class="wgt:text-xs wgt:font-normal wgt:leading-4 wgt:text-soft-400">(${
|
|
514
|
+
const o = c ? c.split(",").map((C) => C.trim().startsWith("image/") ? C.replace("image/", "").toUpperCase() : C.trim().startsWith(".") ? C.replace(".", "").toUpperCase() : C.toUpperCase().replace("/*", "")).filter(Boolean).join(", ") : `JPG, PNG ${i("or")} JPEG`;
|
|
515
|
+
u.innerHTML += ` <span class="wgt:text-xs wgt:font-normal wgt:leading-4 wgt:text-soft-400">(${i(
|
|
516
516
|
"fileFormat"
|
|
517
|
-
)} ${o}. ${
|
|
518
|
-
const
|
|
519
|
-
|
|
517
|
+
)} ${o}. ${i("maxFileSize")})</span>`, A.appendChild(u);
|
|
518
|
+
const s = document.createElement("div");
|
|
519
|
+
s.className = [
|
|
520
520
|
"wgt:h-fit",
|
|
521
521
|
"wgt:w-full",
|
|
522
522
|
"wgt:rounded",
|
|
@@ -537,8 +537,8 @@ function f0({
|
|
|
537
537
|
function x(C) {
|
|
538
538
|
q = C, C ? (r.innerText = C, r.style.display = "block") : (r.innerText = "", r.style.display = "none");
|
|
539
539
|
}
|
|
540
|
-
const w =
|
|
541
|
-
title:
|
|
540
|
+
const w = lt({
|
|
541
|
+
title: i("uploadFile"),
|
|
542
542
|
className: "wgt:bg-primary wgt:hover:bg-primary-dark wgt:text-text-primary wgt:px-6 wgt:py-1 wgt:rounded-md wgt:cursor-pointer wgt:hover:text-primary-hover-text",
|
|
543
543
|
handleClick: (C) => {
|
|
544
544
|
C.stopPropagation(), l.click();
|
|
@@ -577,7 +577,7 @@ function f0({
|
|
|
577
577
|
return l.addEventListener("change", (C) => {
|
|
578
578
|
const d = C.target.files && C.target.files[0] ? C.target.files[0] : null;
|
|
579
579
|
d && (I(d), typeof a == "function" && a(d));
|
|
580
|
-
}), I(e),
|
|
580
|
+
}), I(e), s.appendChild(T), s.appendChild(l), A.appendChild(s), A.appendChild(r), {
|
|
581
581
|
container: A,
|
|
582
582
|
getValues() {
|
|
583
583
|
return e;
|
|
@@ -669,17 +669,17 @@ function X0({
|
|
|
669
669
|
].join(" "), A.append(u);
|
|
670
670
|
const o = document.createElement("input");
|
|
671
671
|
o.type = "file", o.accept = "image/png, image/jpeg, image/jpg", o.className = "wgt:hidden", u.append(o);
|
|
672
|
-
const
|
|
673
|
-
|
|
672
|
+
const s = document.createElement("div");
|
|
673
|
+
s.className = "wgt:w-10 wgt:h-10 wgt:rounded-full wgt:bg-primary/16 wgt:flex wgt:items-center wgt:justify-center";
|
|
674
674
|
const l = Yh(c);
|
|
675
|
-
|
|
675
|
+
s.innerHTML = `
|
|
676
676
|
<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
677
677
|
<path d="M8.83184 0.96875H10.3485C10.4833 0.96875 10.5507 1.03316 10.5507 1.16199V18.1668C10.5507 18.2956 10.4833 18.3601 10.3485 18.3601H8.83184C8.69702 18.3601 8.62962 18.2956 8.62962 18.1668V1.16199C8.62962 1.03316 8.69702 0.96875 8.83184 0.96875Z" fill="${l}"/>
|
|
678
678
|
<path d="M1.09676 8.74653H18.0836C18.2184 8.74653 18.2858 8.81094 18.2858 8.93976V10.389C18.2858 10.5179 18.2184 10.5823 18.0836 10.5823H1.09676C0.961939 10.5823 0.894531 10.5179 0.894531 10.389V8.93976C0.894531 8.81094 0.961939 8.74653 1.09676 8.74653Z" fill="${l}"/>
|
|
679
679
|
</svg>
|
|
680
680
|
`;
|
|
681
681
|
const T = document.createElement("div");
|
|
682
|
-
T.className = "wgt:text-sm wgt:font-semibold wgt:text-text-sub-600", T.innerText = t, u.append(
|
|
682
|
+
T.className = "wgt:text-sm wgt:font-semibold wgt:text-text-sub-600", T.innerText = t, u.append(s, T);
|
|
683
683
|
const r = document.createElement("div");
|
|
684
684
|
r.className = "wgt:text-sm wgt:font-medium wgt:text-soft-400", r.innerText = e, A.append(r);
|
|
685
685
|
const q = document.createElement("span");
|
|
@@ -731,31 +731,31 @@ function Gh({ frontFile: n, backFile: t, onFrontChange: e, onBackChange: a, them
|
|
|
731
731
|
const c = document.createElement("div");
|
|
732
732
|
c.className = "wgt:flex wgt:flex-col wgt:gap-4 wgt:w-full";
|
|
733
733
|
const A = document.createElement("label");
|
|
734
|
-
A.className = "wgt:font-medium", A.innerText =
|
|
734
|
+
A.className = "wgt:font-medium", A.innerText = i("uploadIdentity");
|
|
735
735
|
const u = document.createElement("span");
|
|
736
736
|
u.className = "wgt:text-red-500 wgt:ml-1", u.innerText = "*", A.appendChild(u), c.append(A);
|
|
737
737
|
const o = document.createElement("div");
|
|
738
738
|
o.className = "wgt:w-full wgt:grid wgt:grid-cols-2 wgt:gap-4", c.append(o);
|
|
739
|
-
const
|
|
739
|
+
const s = X0({
|
|
740
740
|
file: n,
|
|
741
|
-
placeholder:
|
|
742
|
-
caption:
|
|
741
|
+
placeholder: i("uploadFrontId"),
|
|
742
|
+
caption: i("frontIdCard"),
|
|
743
743
|
onFileSelected: e,
|
|
744
744
|
theme: h
|
|
745
745
|
}), l = X0({
|
|
746
746
|
file: t,
|
|
747
|
-
placeholder:
|
|
748
|
-
caption:
|
|
747
|
+
placeholder: i("uploadBackId"),
|
|
748
|
+
caption: i("backIdCard"),
|
|
749
749
|
onFileSelected: a,
|
|
750
750
|
theme: h
|
|
751
751
|
});
|
|
752
|
-
return o.append(
|
|
752
|
+
return o.append(s.container, l.container), {
|
|
753
753
|
container: c,
|
|
754
|
-
getFrontFile: () =>
|
|
754
|
+
getFrontFile: () => s.getFile(),
|
|
755
755
|
getBackFile: () => l.getFile(),
|
|
756
|
-
getFrontFileError: () =>
|
|
756
|
+
getFrontFileError: () => s.getError(),
|
|
757
757
|
getBackFileError: () => l.getError(),
|
|
758
|
-
setFrontFileError:
|
|
758
|
+
setFrontFileError: s.setError,
|
|
759
759
|
setBackFileError: l.setError
|
|
760
760
|
};
|
|
761
761
|
}
|
|
@@ -776,12 +776,12 @@ const Wh = ({
|
|
|
776
776
|
(M, D) => String(a + D).slice(-2)
|
|
777
777
|
);
|
|
778
778
|
e && h && /^\d{2}$/.test(h) && (c.includes(h) || (c = [h, ...c]));
|
|
779
|
-
const A = ["1", "2", "3", "4", "5", "6", "7", "8", "9"], u = ["C", "K"], o = ["T", "D", "L", "M", "N", "B", "G", "H", "X"],
|
|
780
|
-
|
|
779
|
+
const A = ["1", "2", "3", "4", "5", "6", "7", "8", "9"], u = ["C", "K"], o = ["T", "D", "L", "M", "N", "B", "G", "H", "X"], s = document.createElement("div");
|
|
780
|
+
s.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
781
781
|
const l = document.createElement("span");
|
|
782
|
-
l.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal", l.textContent =
|
|
782
|
+
l.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal", l.textContent = i("invoiceTemplate");
|
|
783
783
|
const T = document.createElement("span");
|
|
784
|
-
T.className = "wgt:text-red-500 wgt:ml-1", T.innerText = "*", l.appendChild(T),
|
|
784
|
+
T.className = "wgt:text-red-500 wgt:ml-1", T.innerText = "*", l.appendChild(T), s.append(l);
|
|
785
785
|
const r = document.createElement("div");
|
|
786
786
|
r.className = [
|
|
787
787
|
"wgt:w-full",
|
|
@@ -795,25 +795,25 @@ const Wh = ({
|
|
|
795
795
|
"wgt:select-none",
|
|
796
796
|
"wgt:@max-2xl:p-2",
|
|
797
797
|
"wgt:@max-2xl:grid wgt:@max-2xl:grid-cols-1 wgt:@max-2xl:p-4 wgt:@max-2xl:gap-3 wgt:@max-2xl:space-y-2 wgt:@max-2xl:rounded-xl wgt:@max-2xl:bg-weak-50"
|
|
798
|
-
].join(" "), r.style.scrollSnapType = "x mandatory", r.style.overflowX = "auto", r.style.scrollBehavior = "smooth", r.style.scrollbarWidth = "none", r.style.msOverflowStyle = "none", r.style.WebkitOverflowScrolling = "touch", r.style.overflowY = "hidden",
|
|
798
|
+
].join(" "), r.style.scrollSnapType = "x mandatory", r.style.overflowX = "auto", r.style.scrollBehavior = "smooth", r.style.scrollbarWidth = "none", r.style.msOverflowStyle = "none", r.style.WebkitOverflowScrolling = "touch", r.style.overflowY = "hidden", s.append(r);
|
|
799
799
|
const q = "wgt:border wgt:border-gray-300 wgt:bg-white wgt:rounded-lg wgt:px-3 wgt:py-2 wgt:text-start wgt:cursor-pointer wgt:outline-none", x = document.createElement("div");
|
|
800
800
|
x.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
801
801
|
const w = document.createElement("span");
|
|
802
|
-
w.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal wgt:@max-2xl:block wgt:hidden", w.textContent =
|
|
802
|
+
w.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal wgt:@max-2xl:block wgt:hidden", w.textContent = i("sampleNumber");
|
|
803
803
|
const b = document.createElement("span");
|
|
804
804
|
b.className = "wgt:text-red-500 wgt:ml-1", b.innerText = "*", w.appendChild(b), x.appendChild(w);
|
|
805
805
|
const y = document.createElement("select");
|
|
806
|
-
y.className = `${q} wgt:@max-2xl:w-full wgt:w-48`, y.title =
|
|
806
|
+
y.className = `${q} wgt:@max-2xl:w-full wgt:w-48`, y.title = i("sampleNumberTooltip", "Mẫu số hóa đơn (1-9)");
|
|
807
807
|
const I = {
|
|
808
|
-
1:
|
|
809
|
-
2:
|
|
810
|
-
3:
|
|
811
|
-
4:
|
|
812
|
-
5:
|
|
813
|
-
6:
|
|
814
|
-
7:
|
|
815
|
-
8:
|
|
816
|
-
9:
|
|
808
|
+
1: i("invoiceTemplateTypes.1"),
|
|
809
|
+
2: i("invoiceTemplateTypes.2"),
|
|
810
|
+
3: i("invoiceTemplateTypes.3"),
|
|
811
|
+
4: i("invoiceTemplateTypes.4"),
|
|
812
|
+
5: i("invoiceTemplateTypes.5"),
|
|
813
|
+
6: i("invoiceTemplateTypes.6"),
|
|
814
|
+
7: i("invoiceTemplateTypes.7"),
|
|
815
|
+
8: i("invoiceTemplateTypes.8"),
|
|
816
|
+
9: i("invoiceTemplateTypes.9")
|
|
817
817
|
};
|
|
818
818
|
A.forEach((M) => {
|
|
819
819
|
y.append(new Option(I[M], M));
|
|
@@ -821,40 +821,40 @@ const Wh = ({
|
|
|
821
821
|
const C = document.createElement("div");
|
|
822
822
|
C.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
823
823
|
const d = document.createElement("span");
|
|
824
|
-
d.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal wgt:@max-2xl:block wgt:hidden", d.textContent =
|
|
824
|
+
d.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal wgt:@max-2xl:block wgt:hidden", d.textContent = i("codeType");
|
|
825
825
|
const E = document.createElement("span");
|
|
826
826
|
E.className = "wgt:text-red-500 wgt:ml-1", E.innerText = "*", d.appendChild(E), C.appendChild(d);
|
|
827
827
|
const P = document.createElement("select");
|
|
828
|
-
P.className = `${q} wgt:@max-2xl:w-full wgt:w-40`, P.title =
|
|
829
|
-
const D = M === "C" ?
|
|
828
|
+
P.className = `${q} wgt:@max-2xl:w-full wgt:w-40`, P.title = i("codeTypeTooltip", "C: Có mã CQT, K: Không mã"), u.forEach((M) => {
|
|
829
|
+
const D = M === "C" ? i("codeTypeC", "C (Có mã CQT)") : i("codeTypeK", "K (Không mã)");
|
|
830
830
|
P.append(new Option(D, M));
|
|
831
831
|
}), C.appendChild(P), r.append(C);
|
|
832
832
|
const B = document.createElement("div");
|
|
833
833
|
B.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
834
834
|
const f = document.createElement("span");
|
|
835
|
-
f.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal wgt:@max-2xl:block wgt:hidden", f.textContent =
|
|
835
|
+
f.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal wgt:@max-2xl:block wgt:hidden", f.textContent = i("invoiceIssuanceYear");
|
|
836
836
|
const H = document.createElement("span");
|
|
837
837
|
H.className = "wgt:text-red-500 wgt:ml-1", H.innerText = "*", f.appendChild(H), B.appendChild(f);
|
|
838
838
|
const k = document.createElement("select");
|
|
839
|
-
k.className = `${q} wgt:@max-2xl:w-full wgt:w-16`, k.title =
|
|
839
|
+
k.className = `${q} wgt:@max-2xl:w-full wgt:w-16`, k.title = i("yearTooltip", "Năm phát hành (2 chữ số cuối)"), c.forEach((M) => k.append(new Option(M, M))), k.value = String(a).slice(-2), B.appendChild(k), r.append(B);
|
|
840
840
|
const L = document.createElement("div");
|
|
841
841
|
L.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
842
842
|
const Q = document.createElement("span");
|
|
843
|
-
Q.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal wgt:@max-2xl:block wgt:hidden", Q.textContent =
|
|
843
|
+
Q.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal wgt:@max-2xl:block wgt:hidden", Q.textContent = i("typeOfEInvoice");
|
|
844
844
|
const N = document.createElement("span");
|
|
845
845
|
N.className = "wgt:text-red-500 wgt:ml-1", N.innerText = "*", Q.appendChild(N), L.appendChild(Q);
|
|
846
846
|
const X = document.createElement("select");
|
|
847
|
-
X.className = `${q} wgt:@max-2xl:w-full wgt:w-40`, X.title =
|
|
847
|
+
X.className = `${q} wgt:@max-2xl:w-full wgt:w-40`, X.title = i("invoiceTypeTooltip", "Loại hóa đơn");
|
|
848
848
|
const G = {
|
|
849
|
-
T:
|
|
850
|
-
D:
|
|
851
|
-
L:
|
|
852
|
-
M:
|
|
853
|
-
N:
|
|
854
|
-
B:
|
|
855
|
-
G:
|
|
856
|
-
H:
|
|
857
|
-
X:
|
|
849
|
+
T: i("invoiceTypeT", "T (Đăng ký)"),
|
|
850
|
+
D: i("invoiceTypeD", "D (Tài sản)"),
|
|
851
|
+
L: i("invoiceTypeL", "L (CQT)"),
|
|
852
|
+
M: i("invoiceTypeM", "M (Máy tính tiền)"),
|
|
853
|
+
N: i("invoiceTypeN", "N (Nội bộ)"),
|
|
854
|
+
B: i("invoiceTypeB", "B (Đại lý)"),
|
|
855
|
+
G: i("invoiceTypeG", "G (Tem GTGT)"),
|
|
856
|
+
H: i("invoiceTypeH", "H (Tem bán hàng)"),
|
|
857
|
+
X: i("invoiceTypeX", "X (Thương mại)")
|
|
858
858
|
};
|
|
859
859
|
o.forEach((M) => {
|
|
860
860
|
X.append(new Option(G[M], M));
|
|
@@ -862,11 +862,11 @@ const Wh = ({
|
|
|
862
862
|
const W = document.createElement("div");
|
|
863
863
|
W.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
864
864
|
const $ = document.createElement("span");
|
|
865
|
-
$.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal wgt:@max-2xl:block wgt:hidden", $.textContent =
|
|
865
|
+
$.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal wgt:@max-2xl:block wgt:hidden", $.textContent = i("formDifferentiationCode");
|
|
866
866
|
const g = document.createElement("span");
|
|
867
867
|
g.className = "wgt:text-red-500 wgt:ml-1", g.innerText = "*", $.appendChild(g), W.appendChild($);
|
|
868
868
|
const m = document.createElement("input");
|
|
869
|
-
m.type = "text", m.maxLength = 2, m.placeholder = "AB", m.defaultValue = "YY", m.className = `${q} wgt:@max-2xl:w-full wgt:w-16`, m.title =
|
|
869
|
+
m.type = "text", m.maxLength = 2, m.placeholder = "AB", m.defaultValue = "YY", m.className = `${q} wgt:@max-2xl:w-full wgt:w-16`, m.title = i("customLettersTooltip"), W.appendChild(m), r.append(W), e && [
|
|
870
870
|
y,
|
|
871
871
|
P,
|
|
872
872
|
k,
|
|
@@ -898,7 +898,7 @@ const Wh = ({
|
|
|
898
898
|
}
|
|
899
899
|
}
|
|
900
900
|
return J(), {
|
|
901
|
-
container:
|
|
901
|
+
container: s,
|
|
902
902
|
getValue: v,
|
|
903
903
|
setValue: (M) => {
|
|
904
904
|
typeof M != "string" || M.length !== 7 || /^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(M) && (y.value = M[0], P.value = M[1], k.value = M.slice(2, 4), X.value = M[4], m.value = M.slice(5, 7), J());
|
|
@@ -939,14 +939,14 @@ function Rh() {
|
|
|
939
939
|
h ? g.addEventListener(m, p, !!v) : g.attachEvent("on" + m, p);
|
|
940
940
|
}, o = function(g, m, p, v) {
|
|
941
941
|
h ? g.removeEventListener(m, p, !!v) : g.detachEvent("on" + m, p);
|
|
942
|
-
},
|
|
942
|
+
}, s = function(g) {
|
|
943
943
|
return g.trim ? g.trim() : g.replace(/^\s+|\s+$/g, "");
|
|
944
944
|
}, l = function(g, m) {
|
|
945
945
|
return (" " + g.className + " ").indexOf(" " + m + " ") !== -1;
|
|
946
946
|
}, T = function(g, m) {
|
|
947
947
|
l(g, m) || (g.className = g.className === "" ? m : g.className + " " + m);
|
|
948
948
|
}, r = function(g, m) {
|
|
949
|
-
g.className =
|
|
949
|
+
g.className = s((" " + g.className + " ").replace(" " + m + " ", " "));
|
|
950
950
|
}, q = function(g) {
|
|
951
951
|
return /Array/.test(Object.prototype.toString.call(g));
|
|
952
952
|
}, x = function(g) {
|
|
@@ -1089,12 +1089,12 @@ function Rh() {
|
|
|
1089
1089
|
p.push('<th scope="col"><abbr title="' + f(g, m) + '">' + f(g, m, !0) + "</abbr></th>");
|
|
1090
1090
|
return "<thead><tr>" + (g.isRTL ? p.reverse() : p).join("") + "</tr></thead>";
|
|
1091
1091
|
}, G = function(g, m, p, v, J, M) {
|
|
1092
|
-
var D, Y, j, F = g._o, U = p === F.minYear, qn = p === F.maxYear, K = '<div id="' + M + '" class="pika-title" role="heading" aria-live="assertive">', O,
|
|
1092
|
+
var D, Y, j, F = g._o, U = p === F.minYear, qn = p === F.maxYear, K = '<div id="' + M + '" class="pika-title" role="heading" aria-live="assertive">', O, un, Pn = !0, Nn = !0;
|
|
1093
1093
|
for (j = [], D = 0; D < 12; D++)
|
|
1094
1094
|
j.push('<option value="' + (p === J ? D - m : 12 + D - m) + '"' + (D === v ? ' selected="selected"' : "") + (U && D < F.minMonth || qn && D > F.maxMonth ? ' disabled="disabled"' : "") + ">" + F.i18n.months[D] + "</option>");
|
|
1095
1095
|
for (O = '<div class="pika-label">' + F.i18n.months[v] + '<select class="pika-select pika-select-month" tabindex="-1">' + j.join("") + "</select></div>", q(F.yearRange) ? (D = F.yearRange[0], Y = F.yearRange[1] + 1) : (D = p - F.yearRange, Y = 1 + p + F.yearRange), j = []; D < Y && D <= F.maxYear; D++)
|
|
1096
1096
|
D >= F.minYear && j.push('<option value="' + D + '"' + (D === p ? ' selected="selected"' : "") + ">" + D + "</option>");
|
|
1097
|
-
return
|
|
1097
|
+
return un = '<div class="pika-label">' + p + F.yearSuffix + '<select class="pika-select pika-select-year" tabindex="-1">' + j.join("") + "</select></div>", F.showMonthAfterYear ? K += un + O : K += O + un, U && (v === 0 || F.minMonth >= v) && (Pn = !1), qn && (v === 11 || F.maxMonth <= v) && (Nn = !1), m === 0 && (K += '<button class="pika-prev' + (Pn ? "" : " is-disabled") + '" type="button">' + F.i18n.previousMonth + "</button>"), m === g._o.numberOfMonths - 1 && (K += '<button class="pika-next' + (Nn ? "" : " is-disabled") + '" type="button">' + F.i18n.nextMonth + "</button>"), K += "</div>";
|
|
1098
1098
|
}, W = function(g, m, p) {
|
|
1099
1099
|
return '<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="' + p + '">' + X(g) + N(m) + "</table>";
|
|
1100
1100
|
}, $ = function(g) {
|
|
@@ -1336,20 +1336,20 @@ function Rh() {
|
|
|
1336
1336
|
render: function(g, m, p) {
|
|
1337
1337
|
var v = this._o, J = /* @__PURE__ */ new Date(), M = y(g, m), D = new Date(g, m, 1).getDay(), Y = [], j = [];
|
|
1338
1338
|
I(J), v.firstDay > 0 && (D -= v.firstDay, D < 0 && (D += 7));
|
|
1339
|
-
for (var F = m === 0 ? 11 : m - 1, U = m === 11 ? 0 : m + 1, qn = m === 0 ? g - 1 : g, K = m === 11 ? g + 1 : g, O = y(qn, F),
|
|
1339
|
+
for (var F = m === 0 ? 11 : m - 1, U = m === 11 ? 0 : m + 1, qn = m === 0 ? g - 1 : g, K = m === 11 ? g + 1 : g, O = y(qn, F), un = M + D, Pn = un; Pn > 7; )
|
|
1340
1340
|
Pn -= 7;
|
|
1341
|
-
|
|
1342
|
-
for (var Nn = !1, Sn = 0, bn = 0; Sn <
|
|
1343
|
-
var fn = new Date(g, m, 1 + (Sn - D)), Mn = x(this._d) ? C(fn, this._d) : !1, jn = C(fn, J), Gn = v.events.indexOf(fn.toDateString()) !== -1, at = Sn < D || Sn >= M + D, En = 1 + (Sn - D), Vn = m, Jn = g, Wn = v.startRange && C(v.startRange, fn), zn = v.endRange && C(v.endRange, fn), Rn = v.startRange && v.endRange && v.startRange < fn && fn < v.endRange,
|
|
1341
|
+
un += 7 - Pn;
|
|
1342
|
+
for (var Nn = !1, Sn = 0, bn = 0; Sn < un; Sn++) {
|
|
1343
|
+
var fn = new Date(g, m, 1 + (Sn - D)), Mn = x(this._d) ? C(fn, this._d) : !1, jn = C(fn, J), Gn = v.events.indexOf(fn.toDateString()) !== -1, at = Sn < D || Sn >= M + D, En = 1 + (Sn - D), Vn = m, Jn = g, Wn = v.startRange && C(v.startRange, fn), zn = v.endRange && C(v.endRange, fn), Rn = v.startRange && v.endRange && v.startRange < fn && fn < v.endRange, Tt = v.minDate && fn < v.minDate || v.maxDate && fn > v.maxDate || v.disableWeekends && w(fn) || v.disableDayFn && v.disableDayFn(fn);
|
|
1344
1344
|
at && (Sn < D ? (En = O + En, Vn = F, Jn = qn) : (En = En - M, Vn = U, Jn = K));
|
|
1345
|
-
var
|
|
1345
|
+
var xt = {
|
|
1346
1346
|
day: En,
|
|
1347
1347
|
month: Vn,
|
|
1348
1348
|
year: Jn,
|
|
1349
1349
|
hasEvent: Gn,
|
|
1350
1350
|
isSelected: Mn,
|
|
1351
1351
|
isToday: jn,
|
|
1352
|
-
isDisabled:
|
|
1352
|
+
isDisabled: Tt,
|
|
1353
1353
|
isEmpty: at,
|
|
1354
1354
|
isStartRange: Wn,
|
|
1355
1355
|
isEndRange: zn,
|
|
@@ -1357,7 +1357,7 @@ function Rh() {
|
|
|
1357
1357
|
showDaysInNextAndPreviousMonths: v.showDaysInNextAndPreviousMonths,
|
|
1358
1358
|
enableSelectionDaysInNextAndPreviousMonths: v.enableSelectionDaysInNextAndPreviousMonths
|
|
1359
1359
|
};
|
|
1360
|
-
v.pickWholeWeek && Mn && (Nn = !0), j.push(H(
|
|
1360
|
+
v.pickWholeWeek && Mn && (Nn = !0), j.push(H(xt)), ++bn === 7 && (v.showWeekNumber && j.unshift(L(Sn - D, m, g, v.firstWeekOfYearMinDays)), Y.push(Q(j, v.isRTL, v.pickWholeWeek, Nn)), j = [], bn = 0, Nn = !1);
|
|
1361
1361
|
}
|
|
1362
1362
|
return W(v, Y, p);
|
|
1363
1363
|
},
|
|
@@ -1449,7 +1449,7 @@ function na(n, t, e) {
|
|
|
1449
1449
|
"wgt:relative",
|
|
1450
1450
|
"wgt:overflow-hidden"
|
|
1451
1451
|
].join(" ");
|
|
1452
|
-
const
|
|
1452
|
+
const s = {
|
|
1453
1453
|
info: "#40A9FF",
|
|
1454
1454
|
// Blue
|
|
1455
1455
|
success: "#52C41A",
|
|
@@ -1459,7 +1459,7 @@ function na(n, t, e) {
|
|
|
1459
1459
|
error: "#FF4D4F"
|
|
1460
1460
|
// Red
|
|
1461
1461
|
};
|
|
1462
|
-
o.style.borderLeft = `4px solid ${
|
|
1462
|
+
o.style.borderLeft = `4px solid ${s[A] || s.info}`, o.style.zIndex = "99999";
|
|
1463
1463
|
const l = document.createElement("div");
|
|
1464
1464
|
if (l.className = "wgt:flex wgt:items-start wgt:gap-3", c) {
|
|
1465
1465
|
const r = document.createElement("div"), q = {
|
|
@@ -1504,7 +1504,7 @@ function sh() {
|
|
|
1504
1504
|
function ta() {
|
|
1505
1505
|
sh(), Cn && Cn.parentNode && Cn.parentNode.removeChild(Cn), it && window.removeEventListener("resize", it), Cn = null, it = null, At = [];
|
|
1506
1506
|
}
|
|
1507
|
-
const
|
|
1507
|
+
const Nt = {
|
|
1508
1508
|
info: (n, t = {}) => Vt(n, { ...t, type: "info" }),
|
|
1509
1509
|
success: (n, t = {}) => Vt(n, { ...t, type: "success" }),
|
|
1510
1510
|
warning: (n, t = {}) => Vt(n, { ...t, type: "warning" }),
|
|
@@ -1516,14 +1516,14 @@ var Et = (n, t, e) => new Promise((a, h) => {
|
|
|
1516
1516
|
var c = (o) => {
|
|
1517
1517
|
try {
|
|
1518
1518
|
u(e.next(o));
|
|
1519
|
-
} catch (
|
|
1520
|
-
h(
|
|
1519
|
+
} catch (s) {
|
|
1520
|
+
h(s);
|
|
1521
1521
|
}
|
|
1522
1522
|
}, A = (o) => {
|
|
1523
1523
|
try {
|
|
1524
1524
|
u(e.throw(o));
|
|
1525
|
-
} catch (
|
|
1526
|
-
h(
|
|
1525
|
+
} catch (s) {
|
|
1526
|
+
h(s);
|
|
1527
1527
|
}
|
|
1528
1528
|
}, u = (o) => o.done ? a(o.value) : Promise.resolve(o.value).then(c, A);
|
|
1529
1529
|
u((e = e.apply(n, t)).next());
|
|
@@ -1620,12 +1620,12 @@ function ma(n, t = 640) {
|
|
|
1620
1620
|
return a.imageSmoothingEnabled = !1, a.drawImage(n, u, o, c, A), a.getImageData(0, 0, t, t);
|
|
1621
1621
|
}
|
|
1622
1622
|
function qa(n, t, e) {
|
|
1623
|
-
const [a, h] = t, [c, A] = e, u = Math.min(A / h, c / a), o = (A - h * u) / 2,
|
|
1623
|
+
const [a, h] = t, [c, A] = e, u = Math.min(A / h, c / a), o = (A - h * u) / 2, s = (c - a * u) / 2, l = JSON.parse(JSON.stringify(n));
|
|
1624
1624
|
if (Array.isArray(n[0]))
|
|
1625
1625
|
for (let T = 0; T < n.length; T++)
|
|
1626
|
-
l[T][0] = (n[T][0] - o) / u, l[T][1] = (n[T][1] -
|
|
1626
|
+
l[T][0] = (n[T][0] - o) / u, l[T][1] = (n[T][1] - s) / u;
|
|
1627
1627
|
else if (n.length === 4)
|
|
1628
|
-
l[0] = (n[0] - o) / u, l[1] = (n[1] -
|
|
1628
|
+
l[0] = (n[0] - o) / u, l[1] = (n[1] - s) / u, l[2] = (n[2] - o) / u, l[3] = (n[3] - s) / u;
|
|
1629
1629
|
else
|
|
1630
1630
|
throw new Error("Invalid region format");
|
|
1631
1631
|
return l;
|
|
@@ -1678,9 +1678,9 @@ function sa(n, t, e = 200) {
|
|
|
1678
1678
|
0,
|
|
1679
1679
|
e,
|
|
1680
1680
|
e
|
|
1681
|
-
), o = new ImageData(e, e),
|
|
1682
|
-
for (let q = 0; q <
|
|
1683
|
-
const x =
|
|
1681
|
+
), o = new ImageData(e, e), s = u.data, l = o.data;
|
|
1682
|
+
for (let q = 0; q < s.length; q += 4) {
|
|
1683
|
+
const x = s[q], w = s[q + 1], b = s[q + 2], y = 0.2989 * x + 0.587 * w + 0.114 * b;
|
|
1684
1684
|
l[q] = l[q + 1] = l[q + 2] = y, l[q + 3] = 255;
|
|
1685
1685
|
}
|
|
1686
1686
|
const T = new ImageData(e, e), r = la(l, e, e, 10);
|
|
@@ -1697,14 +1697,14 @@ function la(n, t, e, a) {
|
|
|
1697
1697
|
const h = new Uint8ClampedArray(n.length), c = new Uint32Array(t * e);
|
|
1698
1698
|
for (let u = 0; u < e; u++)
|
|
1699
1699
|
for (let o = 0; o < t; o++) {
|
|
1700
|
-
const
|
|
1700
|
+
const s = (u * t + o) * 4, l = n[s], T = u * t + o;
|
|
1701
1701
|
c[T] = l + (o > 0 ? c[T - 1] : 0) + (u > 0 ? c[T - t] : 0) - (o > 0 && u > 0 ? c[T - t - 1] : 0);
|
|
1702
1702
|
}
|
|
1703
1703
|
const A = Math.floor(a / 2);
|
|
1704
1704
|
for (let u = 0; u < e; u++)
|
|
1705
1705
|
for (let o = 0; o < t; o++) {
|
|
1706
|
-
const
|
|
1707
|
-
h[
|
|
1706
|
+
const s = (u * t + o) * 4, l = Math.max(o - A, 0), T = Math.max(u - A, 0), r = Math.min(o + A, t - 1), q = Math.min(u + A, e - 1), x = (r - l + 1) * (q - T + 1), w = (c[q * t + r] - (l > 0 ? c[q * t + l - 1] : 0) - (T > 0 ? c[(T - 1) * t + r] : 0) + (l > 0 && T > 0 ? c[(T - 1) * t + l - 1] : 0)) / x * 0.9, b = n[s] > w ? 255 : 0;
|
|
1707
|
+
h[s] = h[s + 1] = h[s + 2] = b, h[s + 3] = 255;
|
|
1708
1708
|
}
|
|
1709
1709
|
return h;
|
|
1710
1710
|
}
|
|
@@ -1717,8 +1717,8 @@ function ga(n) {
|
|
|
1717
1717
|
e.width = n.width, e.height = n.height, e.getContext("2d").drawImage(n, 0, 0);
|
|
1718
1718
|
const a = gh(n, 224), h = yield t.run({ images: a }), c = h[Object.keys(h)[0]].data;
|
|
1719
1719
|
let A = 0, u = -1 / 0;
|
|
1720
|
-
return c.forEach((o,
|
|
1721
|
-
o > u && (u = o, A =
|
|
1720
|
+
return c.forEach((o, s) => {
|
|
1721
|
+
o > u && (u = o, A = s);
|
|
1722
1722
|
}), JSON.stringify({
|
|
1723
1723
|
status: "success",
|
|
1724
1724
|
data: {
|
|
@@ -1743,7 +1743,7 @@ function Ta(n, t, e, a, h = 0.5) {
|
|
|
1743
1743
|
for (let u = 0; u < A; u++) {
|
|
1744
1744
|
const o = n.data[u * 37 + 4];
|
|
1745
1745
|
if (o < h) continue;
|
|
1746
|
-
const
|
|
1746
|
+
const s = n.data[u * 37], l = n.data[u * 37 + 1], T = n.data[u * 37 + 2], r = n.data[u * 37 + 3], q = 1, x = 1, w = [s, l, T, r], b = n.data.slice(u * 37 + 5, u * 37 + 37), y = new Float32Array(25600);
|
|
1747
1747
|
for (let N = 0; N < 160; N++)
|
|
1748
1748
|
for (let X = 0; X < 160; X++) {
|
|
1749
1749
|
let G = 0;
|
|
@@ -1832,8 +1832,8 @@ function pa(n, t = "sourceCanvas") {
|
|
|
1832
1832
|
n.width,
|
|
1833
1833
|
n.height
|
|
1834
1834
|
);
|
|
1835
|
-
for (const
|
|
1836
|
-
const { _: l, bbox_xyxy: T } =
|
|
1835
|
+
for (const s of o) {
|
|
1836
|
+
const { _: l, bbox_xyxy: T } = s, r = qa(
|
|
1837
1837
|
T,
|
|
1838
1838
|
[n.height, n.width],
|
|
1839
1839
|
[640, 640]
|
|
@@ -2012,7 +2012,7 @@ async function fa({
|
|
|
2012
2012
|
dobPicker: A,
|
|
2013
2013
|
setDobPicker: u,
|
|
2014
2014
|
isNewCustomer: o,
|
|
2015
|
-
handleCheckNewCustomer:
|
|
2015
|
+
handleCheckNewCustomer: s,
|
|
2016
2016
|
updateRegistrationData: l,
|
|
2017
2017
|
serial: T,
|
|
2018
2018
|
isRenewal: r = !1,
|
|
@@ -2030,7 +2030,7 @@ async function fa({
|
|
|
2030
2030
|
const V = document.createElement("div");
|
|
2031
2031
|
V.className = "wgt:w-1 wgt:rounded", V.style.backgroundColor = "#FFF1EB", x.appendChild(V);
|
|
2032
2032
|
const S = document.createElement("div");
|
|
2033
|
-
S.className = "wgt:text-sm wgt:leading-relaxed", S.style.color = "#FF8447", S.innerHTML =
|
|
2033
|
+
S.className = "wgt:text-sm wgt:leading-relaxed", S.style.color = "#FF8447", S.innerHTML = i("register_note", {
|
|
2034
2034
|
defaultValue: "Mã số thuế này đã được đăng ký trên M-Invoice, vì vậy bạn không thể tạo mới với thông tin này.",
|
|
2035
2035
|
provider: q
|
|
2036
2036
|
}), x.appendChild(S), bn && bn.firstChild && (bn.insertBefore(
|
|
@@ -2064,12 +2064,12 @@ async function fa({
|
|
|
2064
2064
|
const K = document.createElement("button");
|
|
2065
2065
|
E = In({
|
|
2066
2066
|
name: "taxCode",
|
|
2067
|
-
label:
|
|
2067
|
+
label: i("taxCode"),
|
|
2068
2068
|
required: !0,
|
|
2069
2069
|
type: "text",
|
|
2070
2070
|
value: t?.eInvoiceRegistration?.organization?.taxCode || "",
|
|
2071
2071
|
readOnly: r,
|
|
2072
|
-
note:
|
|
2072
|
+
note: i(
|
|
2073
2073
|
"taxNote",
|
|
2074
2074
|
"Với khách hàng là hộ kinh doanh, hiển thị theo số CCCD"
|
|
2075
2075
|
),
|
|
@@ -2080,18 +2080,18 @@ async function fa({
|
|
|
2080
2080
|
_ !== S && (V.target.value = _);
|
|
2081
2081
|
const wn = _.trim();
|
|
2082
2082
|
if (t._userHasEditedTaxCode = !0, y(), wn.length === 0) {
|
|
2083
|
-
E.setError(
|
|
2083
|
+
E.setError(i("errorRequired", "Mã số thuế bắt buộc")), hn();
|
|
2084
2084
|
return;
|
|
2085
2085
|
}
|
|
2086
2086
|
if (!P0(wn)) {
|
|
2087
|
-
E.setError(
|
|
2087
|
+
E.setError(i("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), hn();
|
|
2088
2088
|
return;
|
|
2089
2089
|
}
|
|
2090
|
-
E.setError(null), Sn(wn),
|
|
2090
|
+
E.setError(null), Sn(wn), hn();
|
|
2091
2091
|
}
|
|
2092
2092
|
}), P = In({
|
|
2093
2093
|
name: "companyName",
|
|
2094
|
-
label:
|
|
2094
|
+
label: i("companyName"),
|
|
2095
2095
|
required: !0,
|
|
2096
2096
|
error: null,
|
|
2097
2097
|
placeholder: "",
|
|
@@ -2101,7 +2101,7 @@ async function fa({
|
|
|
2101
2101
|
horizontal: !0
|
|
2102
2102
|
}), B = In({
|
|
2103
2103
|
name: "companyAddressDetail",
|
|
2104
|
-
label:
|
|
2104
|
+
label: i("address"),
|
|
2105
2105
|
required: !0,
|
|
2106
2106
|
error: null,
|
|
2107
2107
|
placeholder: "",
|
|
@@ -2117,7 +2117,7 @@ async function fa({
|
|
|
2117
2117
|
}));
|
|
2118
2118
|
if (f = Wt({
|
|
2119
2119
|
name: "companyTaxManagement",
|
|
2120
|
-
label:
|
|
2120
|
+
label: i("taxAuthority"),
|
|
2121
2121
|
value: t?.eInvoiceRegistration?.organization?.taxAuthority || "",
|
|
2122
2122
|
options: O,
|
|
2123
2123
|
required: !0,
|
|
@@ -2125,7 +2125,7 @@ async function fa({
|
|
|
2125
2125
|
horizontal: !0,
|
|
2126
2126
|
searchable: !0,
|
|
2127
2127
|
onChange: (V) => {
|
|
2128
|
-
V.target.id && c(V.target.id),
|
|
2128
|
+
V.target.id && c(V.target.id), hn();
|
|
2129
2129
|
}
|
|
2130
2130
|
}), h) {
|
|
2131
2131
|
const V = O.find(
|
|
@@ -2138,16 +2138,16 @@ async function fa({
|
|
|
2138
2138
|
);
|
|
2139
2139
|
}
|
|
2140
2140
|
j = f0({
|
|
2141
|
-
label:
|
|
2141
|
+
label: i("uploadLogo", "Tải logo lên"),
|
|
2142
2142
|
required: !1,
|
|
2143
2143
|
file: t?.logo || null,
|
|
2144
2144
|
onFileChange: (V) => {
|
|
2145
|
-
|
|
2145
|
+
hn();
|
|
2146
2146
|
},
|
|
2147
2147
|
error: null
|
|
2148
2148
|
}), N = In({
|
|
2149
2149
|
name: "repName",
|
|
2150
|
-
label:
|
|
2150
|
+
label: i("fullName"),
|
|
2151
2151
|
required: !0,
|
|
2152
2152
|
error: null,
|
|
2153
2153
|
placeholder: "",
|
|
@@ -2156,14 +2156,14 @@ async function fa({
|
|
|
2156
2156
|
onInput: (V) => {
|
|
2157
2157
|
const S = V.target.value;
|
|
2158
2158
|
if (S.trim() === "") {
|
|
2159
|
-
N.setError(
|
|
2159
|
+
N.setError(i("errorRequired"));
|
|
2160
2160
|
return;
|
|
2161
2161
|
}
|
|
2162
|
-
bt(S) ? N.setError(null) : N.setError(
|
|
2162
|
+
bt(S) ? N.setError(null) : N.setError(i("errorInvalidName"));
|
|
2163
2163
|
}
|
|
2164
2164
|
}), X = In({
|
|
2165
2165
|
name: "repDob",
|
|
2166
|
-
label:
|
|
2166
|
+
label: i("dateOfBirth"),
|
|
2167
2167
|
required: !0,
|
|
2168
2168
|
error: null,
|
|
2169
2169
|
placeholder: "DD/MM/YYYY",
|
|
@@ -2171,7 +2171,7 @@ async function fa({
|
|
|
2171
2171
|
readOnly: !0,
|
|
2172
2172
|
value: t?.eInvoiceRegistration?.legalRepresentative?.dob || ""
|
|
2173
2173
|
});
|
|
2174
|
-
let
|
|
2174
|
+
let un = new jh({
|
|
2175
2175
|
field: X.inputEl,
|
|
2176
2176
|
format: "DD/MM/YYYY",
|
|
2177
2177
|
toString(V) {
|
|
@@ -2179,22 +2179,22 @@ async function fa({
|
|
|
2179
2179
|
return `${_}/${S}/${wn}`;
|
|
2180
2180
|
},
|
|
2181
2181
|
onSelect: (V) => {
|
|
2182
|
-
X.setError(null),
|
|
2182
|
+
X.setError(null), hn();
|
|
2183
2183
|
},
|
|
2184
2184
|
onClose: () => {
|
|
2185
|
-
X.inputEl.value ? X.setError(null) : X.setError(
|
|
2185
|
+
X.inputEl.value ? X.setError(null) : X.setError(i("errorRequired")), hn();
|
|
2186
2186
|
},
|
|
2187
2187
|
maxDate: /* @__PURE__ */ new Date(),
|
|
2188
2188
|
showMonthDropdown: !0,
|
|
2189
2189
|
showYearDropdown: !0,
|
|
2190
2190
|
yearRange: [1900, (/* @__PURE__ */ new Date()).getFullYear()]
|
|
2191
2191
|
});
|
|
2192
|
-
u(
|
|
2192
|
+
u(un), G = Wt({
|
|
2193
2193
|
name: "repGender",
|
|
2194
|
-
label:
|
|
2194
|
+
label: i("gender"),
|
|
2195
2195
|
options: B0.map((V) => ({
|
|
2196
2196
|
value: V.value,
|
|
2197
|
-
label:
|
|
2197
|
+
label: i(V.value)
|
|
2198
2198
|
})),
|
|
2199
2199
|
required: !0,
|
|
2200
2200
|
value: t?.eInvoiceRegistration?.legalRepresentative?.gender || "",
|
|
@@ -2205,34 +2205,34 @@ async function fa({
|
|
|
2205
2205
|
}
|
|
2206
2206
|
}), $ = In({
|
|
2207
2207
|
name: "repIdCardField",
|
|
2208
|
-
label:
|
|
2208
|
+
label: i("idNumber"),
|
|
2209
2209
|
required: !0,
|
|
2210
2210
|
error: null,
|
|
2211
|
-
placeholder:
|
|
2211
|
+
placeholder: i("enterIdCard", "Nhập số CMND/CCCD"),
|
|
2212
2212
|
type: "text",
|
|
2213
2213
|
value: t?.eInvoiceRegistration?.legalRepresentative?.idCard || "",
|
|
2214
2214
|
onInput: (V) => {
|
|
2215
2215
|
let S = V.target.value;
|
|
2216
2216
|
const _ = S.replace(/[^0-9]/g, "");
|
|
2217
2217
|
if (_ !== S && (V.target.value = _, S = _), S.trim() === "") {
|
|
2218
|
-
$.setError(
|
|
2218
|
+
$.setError(i("errorRequired"));
|
|
2219
2219
|
return;
|
|
2220
2220
|
}
|
|
2221
2221
|
/^\d{12}$/.test(S) ? $.setError(null) : $.setError(
|
|
2222
|
-
|
|
2222
|
+
i("errorInvalidIdCard", "Số CCCD phải có 12 chữ số")
|
|
2223
2223
|
);
|
|
2224
2224
|
}
|
|
2225
2225
|
}), g = In({
|
|
2226
2226
|
name: "repPassportNumberField",
|
|
2227
|
-
label:
|
|
2227
|
+
label: i("passport", "Hộ chiếu"),
|
|
2228
2228
|
required: !1,
|
|
2229
2229
|
error: null,
|
|
2230
|
-
placeholder:
|
|
2230
|
+
placeholder: i("enterPassport", "Nhập số hộ chiếu"),
|
|
2231
2231
|
type: "text",
|
|
2232
2232
|
value: t?.eInvoiceRegistration?.legalRepresentative?.passportNumber || ""
|
|
2233
2233
|
}), W = In({
|
|
2234
2234
|
name: "repPhone",
|
|
2235
|
-
label:
|
|
2235
|
+
label: i("phone"),
|
|
2236
2236
|
required: !0,
|
|
2237
2237
|
error: null,
|
|
2238
2238
|
placeholder: "",
|
|
@@ -2242,16 +2242,16 @@ async function fa({
|
|
|
2242
2242
|
let S = V.target.value;
|
|
2243
2243
|
const _ = S.replace(/[^\d+().\-\s]/g, ""), wn = _.replace(/[\s.\-()]/g, "");
|
|
2244
2244
|
if (_ !== S && (V.target.value = _, S = _), wn.trim() === "") {
|
|
2245
|
-
W.setError(
|
|
2245
|
+
W.setError(i("errorRequired", "Số điện thoại bắt buộc"));
|
|
2246
2246
|
return;
|
|
2247
2247
|
}
|
|
2248
2248
|
/^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(wn) ? W.setError(null) : W.setError(
|
|
2249
|
-
|
|
2249
|
+
i("errorInvalidPhone", "Số điện thoại không hợp lệ.")
|
|
2250
2250
|
);
|
|
2251
2251
|
}
|
|
2252
2252
|
}), m = Wt({
|
|
2253
2253
|
name: "repNationality",
|
|
2254
|
-
label:
|
|
2254
|
+
label: i("country"),
|
|
2255
2255
|
options: zh,
|
|
2256
2256
|
value: t?.eInvoiceRegistration?.legalRepresentative?.nationality || "",
|
|
2257
2257
|
disabled: !1,
|
|
@@ -2261,7 +2261,7 @@ async function fa({
|
|
|
2261
2261
|
}
|
|
2262
2262
|
}), p = In({
|
|
2263
2263
|
name: "contactAddressDetail",
|
|
2264
|
-
label:
|
|
2264
|
+
label: i("permanentAddress"),
|
|
2265
2265
|
required: !0,
|
|
2266
2266
|
error: null,
|
|
2267
2267
|
placeholder: "",
|
|
@@ -2272,26 +2272,26 @@ async function fa({
|
|
|
2272
2272
|
const S = V.target.value;
|
|
2273
2273
|
if (!/^[\p{L}0-9\s,.\-/()]*$/u.test(S)) {
|
|
2274
2274
|
p.setError(
|
|
2275
|
-
|
|
2275
|
+
i("errorInvalidAddress", "Địa chỉ không được chứa ký tự đặc biệt")
|
|
2276
2276
|
);
|
|
2277
2277
|
return;
|
|
2278
2278
|
}
|
|
2279
2279
|
S.trim() === "" ? p.setError(
|
|
2280
|
-
|
|
2280
|
+
i("errorRequired", "Địa chỉ thường trú bắt buộc")
|
|
2281
2281
|
) : p.setError(null);
|
|
2282
2282
|
}
|
|
2283
2283
|
}), F = f0({
|
|
2284
|
-
label:
|
|
2284
|
+
label: i("businessLicense", "Giấy phép đăng ký kinh doanh"),
|
|
2285
2285
|
required: !0,
|
|
2286
2286
|
file: t?.license || null,
|
|
2287
2287
|
onFileChange: (V) => {
|
|
2288
|
-
|
|
2288
|
+
hn();
|
|
2289
2289
|
},
|
|
2290
2290
|
error: null,
|
|
2291
2291
|
accept: "image/png, image/jpeg, image/jpg, .pdf"
|
|
2292
2292
|
}), H = In({
|
|
2293
2293
|
name: "name",
|
|
2294
|
-
label:
|
|
2294
|
+
label: i("fullName"),
|
|
2295
2295
|
required: !0,
|
|
2296
2296
|
error: null,
|
|
2297
2297
|
placeholder: "",
|
|
@@ -2300,16 +2300,16 @@ async function fa({
|
|
|
2300
2300
|
onInput: (V) => {
|
|
2301
2301
|
const S = V.target.value;
|
|
2302
2302
|
if (S.trim() === "") {
|
|
2303
|
-
H.setError(
|
|
2303
|
+
H.setError(i("errorRequired", "Họ và tên bắt buộc"));
|
|
2304
2304
|
return;
|
|
2305
2305
|
}
|
|
2306
2306
|
bt(S) ? H.setError(null) : H.setError(
|
|
2307
|
-
|
|
2307
|
+
i("errorInvalidName", "Họ và tên không hợp lệ.")
|
|
2308
2308
|
);
|
|
2309
2309
|
}
|
|
2310
2310
|
}), k = In({
|
|
2311
2311
|
name: "email",
|
|
2312
|
-
label:
|
|
2312
|
+
label: i("email"),
|
|
2313
2313
|
required: !0,
|
|
2314
2314
|
error: null,
|
|
2315
2315
|
placeholder: "",
|
|
@@ -2318,29 +2318,29 @@ async function fa({
|
|
|
2318
2318
|
onInput: (V) => {
|
|
2319
2319
|
let S = V.target.value;
|
|
2320
2320
|
if (S.trim() === "") {
|
|
2321
|
-
k.setError(
|
|
2321
|
+
k.setError(i("errorRequired", "Email bắt buộc"));
|
|
2322
2322
|
return;
|
|
2323
2323
|
}
|
|
2324
2324
|
if (/[^\x00-\x7F]/.test(S) || /\s/.test(S)) {
|
|
2325
2325
|
k.setError(
|
|
2326
|
-
|
|
2326
|
+
i("errorInvalidEmail", "Email không hợp lệ.")
|
|
2327
2327
|
);
|
|
2328
2328
|
return;
|
|
2329
2329
|
}
|
|
2330
2330
|
const _ = /^(?!\.)(?!.*\.\.)[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}$/;
|
|
2331
2331
|
if (S.length > 254) {
|
|
2332
2332
|
k.setError(
|
|
2333
|
-
|
|
2333
|
+
i("errorInvalidEmailLength", "Email quá dài (tối đa 254 ký tự).")
|
|
2334
2334
|
);
|
|
2335
2335
|
return;
|
|
2336
2336
|
}
|
|
2337
2337
|
_.test(S) ? k.setError(null) : k.setError(
|
|
2338
|
-
|
|
2338
|
+
i("errorInvalidEmail", "Email không hợp lệ")
|
|
2339
2339
|
);
|
|
2340
2340
|
}
|
|
2341
2341
|
}), L = In({
|
|
2342
2342
|
name: "phone",
|
|
2343
|
-
label:
|
|
2343
|
+
label: i("phone"),
|
|
2344
2344
|
required: !0,
|
|
2345
2345
|
error: null,
|
|
2346
2346
|
placeholder: "",
|
|
@@ -2351,17 +2351,17 @@ async function fa({
|
|
|
2351
2351
|
const _ = S.replace(/[^\d+().\-\s]/g, ""), wn = _.replace(/[\s.\-()]/g, "");
|
|
2352
2352
|
if (_ !== S && (V.target.value = _, S = _), wn.trim() === "") {
|
|
2353
2353
|
L.setError(
|
|
2354
|
-
|
|
2354
|
+
i("errorRequired", "Số điện thoại bắt buộc")
|
|
2355
2355
|
);
|
|
2356
2356
|
return;
|
|
2357
2357
|
}
|
|
2358
2358
|
/^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(wn) ? L.setError(null) : L.setError(
|
|
2359
|
-
|
|
2359
|
+
i("errorInvalidPhone", "Số điện thoại Việt Nam không hợp lệ.")
|
|
2360
2360
|
);
|
|
2361
2361
|
}
|
|
2362
2362
|
}), Q = In({
|
|
2363
2363
|
name: "contactAddressDetail",
|
|
2364
|
-
label:
|
|
2364
|
+
label: i("permanentAddress"),
|
|
2365
2365
|
required: !0,
|
|
2366
2366
|
error: null,
|
|
2367
2367
|
placeholder: "",
|
|
@@ -2372,21 +2372,21 @@ async function fa({
|
|
|
2372
2372
|
const S = V.target.value;
|
|
2373
2373
|
if (!/^[\p{L}0-9\s,.\-/()]*$/u.test(S)) {
|
|
2374
2374
|
Q.setError(
|
|
2375
|
-
|
|
2375
|
+
i("errorInvalidAddress", "Địa chỉ không được chứa ký tự đặc biệt")
|
|
2376
2376
|
);
|
|
2377
2377
|
return;
|
|
2378
2378
|
}
|
|
2379
2379
|
S.trim() === "" ? Q.setError(
|
|
2380
|
-
|
|
2380
|
+
i("errorRequired", "Địa chỉ liên hệ bắt buộc")
|
|
2381
2381
|
) : Q.setError(null);
|
|
2382
2382
|
}
|
|
2383
2383
|
});
|
|
2384
2384
|
const Pn = In({
|
|
2385
2385
|
name: "invoiceSymbol",
|
|
2386
|
-
label:
|
|
2386
|
+
label: i("invoiceSymbol", "Ký hiệu hóa đơn"),
|
|
2387
2387
|
required: !0,
|
|
2388
2388
|
error: null,
|
|
2389
|
-
placeholder:
|
|
2389
|
+
placeholder: i("enterInvoiceSymbol", "Nhập ký hiệu hóa đơn"),
|
|
2390
2390
|
type: "text",
|
|
2391
2391
|
value: t?.eInvoiceRegistration?.invoiceSymbol || "1C26MYY",
|
|
2392
2392
|
readOnly: !0,
|
|
@@ -2397,18 +2397,18 @@ async function fa({
|
|
|
2397
2397
|
isRenewal: r,
|
|
2398
2398
|
initialValue: T || t?.eInvoiceRegistration?.invoiceSymbol || "1C26MYY",
|
|
2399
2399
|
onChange: (V) => {
|
|
2400
|
-
Pn.inputEl.value = V,
|
|
2400
|
+
Pn.inputEl.value = V, hn();
|
|
2401
2401
|
}
|
|
2402
2402
|
}), J = document.createElement("input"), J.type = "checkbox", J.name = "hasUsedEInvoiceCB", J.className = "wgt:cursor-pointer", J.checked = t?.eInvoiceRegistration?.hasUsedEInvoice, J.addEventListener("change", (V) => {
|
|
2403
|
-
V.target.checked ? (nn.appendChild(
|
|
2403
|
+
V.target.checked ? (nn.appendChild(cn), nn.appendChild(Z)) : (M.checked = !1, Y.inputEl.value = "", Y.setError(null), D && (D.inputEl.value = "", D.setError(null), Z.contains(D.container) && Z.removeChild(D.container)), nn.removeChild(cn), nn.removeChild(Z));
|
|
2404
2404
|
}), M = document.createElement("input"), M.type = "checkbox", M.name = "hasUsedEInvoiceBeforeCB", M.className = "wgt:cursor-pointer", M.checked = t?.eInvoiceRegistration?.isUsedEInvoiceBefore, M.addEventListener("change", (V) => {
|
|
2405
2405
|
V.target.checked ? Z.appendChild(D.container) : (D.inputEl.value = "", D.setError(null), Z.contains(D.container) && Z.removeChild(D.container));
|
|
2406
2406
|
}), D = In({
|
|
2407
2407
|
name: "previousOtherProviderNameField",
|
|
2408
|
-
label:
|
|
2408
|
+
label: i("providerName", "Tên NCC"),
|
|
2409
2409
|
required: !0,
|
|
2410
2410
|
error: null,
|
|
2411
|
-
placeholder:
|
|
2411
|
+
placeholder: i("enterProviderName", "Nhập tên nhà cung cấp"),
|
|
2412
2412
|
type: "text",
|
|
2413
2413
|
value: t?.eInvoiceRegistration?.previousEInvoiceProvider || "",
|
|
2414
2414
|
readOnly: !1,
|
|
@@ -2416,12 +2416,12 @@ async function fa({
|
|
|
2416
2416
|
const S = V.target.value;
|
|
2417
2417
|
if (S.trim() === "") {
|
|
2418
2418
|
D.setError(
|
|
2419
|
-
|
|
2419
|
+
i("errorRequired", "Tên nhà cung cấp bắt buộc")
|
|
2420
2420
|
);
|
|
2421
2421
|
return;
|
|
2422
2422
|
}
|
|
2423
2423
|
/^[\p{L}0-9_]+(?: [\p{L}0-9_]+)*$/u.test(S) ? D.setError(null) : D.setError(
|
|
2424
|
-
|
|
2424
|
+
i(
|
|
2425
2425
|
"errorInvalidProviderName",
|
|
2426
2426
|
"Tên nhà cung cấp không hợp lệ. Chỉ được dùng chữ cái, số và dấu gạch dưới"
|
|
2427
2427
|
)
|
|
@@ -2429,10 +2429,10 @@ async function fa({
|
|
|
2429
2429
|
}
|
|
2430
2430
|
}), Y = In({
|
|
2431
2431
|
name: "previousIssuedByTaxCodeField",
|
|
2432
|
-
label:
|
|
2432
|
+
label: i("taxAuthorityCode", "Mã CQT đã phát hành hóa đơn"),
|
|
2433
2433
|
required: !0,
|
|
2434
2434
|
error: null,
|
|
2435
|
-
placeholder:
|
|
2435
|
+
placeholder: i("enterTaxAuthorityCode", "Nhập mã CQT cấp"),
|
|
2436
2436
|
type: "text",
|
|
2437
2437
|
value: t?.eInvoiceRegistration?.taxAuthorityCode || "",
|
|
2438
2438
|
readOnly: !1,
|
|
@@ -2440,12 +2440,12 @@ async function fa({
|
|
|
2440
2440
|
const S = V.target.value;
|
|
2441
2441
|
if (S.trim() === "") {
|
|
2442
2442
|
Y.setError(
|
|
2443
|
-
|
|
2443
|
+
i("errorRequired", "Mã CQT bắt buộc")
|
|
2444
2444
|
);
|
|
2445
2445
|
return;
|
|
2446
2446
|
}
|
|
2447
2447
|
/^[A-Za-z0-9_]+$/.test(S) ? Y.setError(null) : Y.setError(
|
|
2448
|
-
|
|
2448
|
+
i(
|
|
2449
2449
|
"errorInvalidTaxAuthorityCode",
|
|
2450
2450
|
"Mã CQT không hợp lệ. Chỉ được dùng chữ cái, số và dấu gạch dưới"
|
|
2451
2451
|
)
|
|
@@ -2489,9 +2489,9 @@ async function fa({
|
|
|
2489
2489
|
const qt = On(Fn.label);
|
|
2490
2490
|
let $n = 0;
|
|
2491
2491
|
_n && (qt.includes(_n) || _n.includes(qt)) && ($n += 10);
|
|
2492
|
-
const
|
|
2493
|
-
if (
|
|
2494
|
-
const It = On(
|
|
2492
|
+
const Ct = Fn.label.split("-");
|
|
2493
|
+
if (Ct.length > 0) {
|
|
2494
|
+
const It = On(Ct[0]);
|
|
2495
2495
|
It && Yn.includes(It) && ($n += 5);
|
|
2496
2496
|
}
|
|
2497
2497
|
$n > mt && (mt = $n, Dn = Fn);
|
|
@@ -2505,24 +2505,24 @@ async function fa({
|
|
|
2505
2505
|
return Bn.name = _.ten_cty || "", Bn.address = _.dia_chi || "", Bn.taxCode = V, E.setError(null), Bn;
|
|
2506
2506
|
}
|
|
2507
2507
|
} catch {
|
|
2508
|
-
S === Nn && (
|
|
2509
|
-
|
|
2508
|
+
S === Nn && (Nt.error(
|
|
2509
|
+
i("errorFetchTaxInfo", "Lỗi khi lấy thông tin mã số thuế."),
|
|
2510
2510
|
{
|
|
2511
2511
|
autoClose: 5e3,
|
|
2512
2512
|
closeButton: !0,
|
|
2513
2513
|
icon: !0
|
|
2514
2514
|
}
|
|
2515
2515
|
), E.setError(
|
|
2516
|
-
|
|
2516
|
+
i("errorFetchTaxInfo", "Lỗi khi lấy thông tin mã số thuế.")
|
|
2517
2517
|
));
|
|
2518
2518
|
} finally {
|
|
2519
|
-
S === Nn &&
|
|
2519
|
+
S === Nn && hn();
|
|
2520
2520
|
}
|
|
2521
2521
|
}
|
|
2522
2522
|
const bn = document.createElement("div");
|
|
2523
2523
|
bn.className = "wgt:space-y-3";
|
|
2524
2524
|
const fn = document.createElement("h3");
|
|
2525
|
-
fn.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", fn.innerText =
|
|
2525
|
+
fn.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", fn.innerText = i("unitInfo", "1. Thông tin đơn vị"), bn.appendChild(fn), setTimeout(() => b(), 50);
|
|
2526
2526
|
const Mn = document.createElement("div");
|
|
2527
2527
|
Mn.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", bn.appendChild(Mn), Mn.appendChild(E.container), Mn.appendChild(P.container), Mn.appendChild(B.container), Mn.appendChild(f.container);
|
|
2528
2528
|
const jn = document.createElement("div");
|
|
@@ -2530,7 +2530,7 @@ async function fa({
|
|
|
2530
2530
|
const Gn = document.createElement("div");
|
|
2531
2531
|
Gn.className = "wgt:space-y-4";
|
|
2532
2532
|
const at = document.createElement("h3");
|
|
2533
|
-
at.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", at.innerText =
|
|
2533
|
+
at.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", at.innerText = i(
|
|
2534
2534
|
"legalRepInfo",
|
|
2535
2535
|
"2. Thông tin người đại diện pháp luật:"
|
|
2536
2536
|
), Gn.appendChild(at);
|
|
@@ -2539,13 +2539,13 @@ async function fa({
|
|
|
2539
2539
|
let Vn = !1, Jn = !1;
|
|
2540
2540
|
const Wn = document.createElement("div");
|
|
2541
2541
|
function zn() {
|
|
2542
|
-
Wn.className = "wgt:text-yellow-500 wgt:text-sm wgt:font-medium wgt:text-center", Vn ? Wn.innerText =
|
|
2542
|
+
Wn.className = "wgt:text-yellow-500 wgt:text-sm wgt:font-medium wgt:text-center", Vn ? Wn.innerText = i(
|
|
2543
2543
|
"warningIdCard",
|
|
2544
2544
|
"Vui lòng tải lên ảnh CMND/CCCD hợp lệ"
|
|
2545
|
-
) : Jn ? Wn.innerText =
|
|
2545
|
+
) : Jn ? Wn.innerText = i(
|
|
2546
2546
|
"warningIdCardSuccess",
|
|
2547
2547
|
"Vui lòng kiểm tra thông tin trước khi chuyển sang bước tiếp theo"
|
|
2548
|
-
) : Wn.innerText = "",
|
|
2548
|
+
) : Wn.innerText = "", xt.appendChild(Wn);
|
|
2549
2549
|
}
|
|
2550
2550
|
function Rn(V) {
|
|
2551
2551
|
return new Promise((S) => {
|
|
@@ -2555,8 +2555,8 @@ async function fa({
|
|
|
2555
2555
|
}, wn = (ln) => {
|
|
2556
2556
|
if (!ln) return "";
|
|
2557
2557
|
if (/^\d{8}$/.test(ln)) {
|
|
2558
|
-
const $n = ln.slice(0, 2),
|
|
2559
|
-
return `${$n}/${
|
|
2558
|
+
const $n = ln.slice(0, 2), Ct = ln.slice(2, 4), It = ln.slice(4, 8);
|
|
2559
|
+
return `${$n}/${Ct}/${It}`;
|
|
2560
2560
|
}
|
|
2561
2561
|
const [On, _n, Yn] = ln.split("/"), Dn = new Date(+Yn, +_n - 1, +On);
|
|
2562
2562
|
if (isNaN(Dn)) return "";
|
|
@@ -2570,15 +2570,15 @@ async function fa({
|
|
|
2570
2570
|
if (ln || S({ success: !1, reason: "No data detected" }), ln) {
|
|
2571
2571
|
Vn = !1, Jn = !0, zn();
|
|
2572
2572
|
const _n = Object.values(ln).every(($n) => !$n);
|
|
2573
|
-
_(), _n && (
|
|
2574
|
-
|
|
2573
|
+
_(), _n && (dt(
|
|
2574
|
+
i("errorInvalidCard", "Vui lòng tải lên ảnh CMND/CCCD hợp lệ")
|
|
2575
2575
|
), _(), S({ success: !1, reason: "Invalid card data" }));
|
|
2576
2576
|
const { address: Yn, date_of_birth: Dn, full_name: mt, id_number: Fn, sex: qt } = ln;
|
|
2577
|
-
if (!Fn || !/^\d{12}$/.test(Fn) ? (
|
|
2578
|
-
|
|
2577
|
+
if (!Fn || !/^\d{12}$/.test(Fn) ? (dt(
|
|
2578
|
+
i("errorInvalidCard", "Số CCCD phải có 12 chữ số")
|
|
2579
2579
|
), $.inputEl.value = "") : ($.inputEl.value = Fn, $.setError(null)), N.inputEl.value = mt || "", X.inputEl.value = wn(Dn), p.inputEl.value = Yn || "", qt) {
|
|
2580
2580
|
const $n = B0.find(
|
|
2581
|
-
(
|
|
2581
|
+
(Ct) => Ct.label.toLowerCase() === qt.toLowerCase()
|
|
2582
2582
|
);
|
|
2583
2583
|
G.selectEl.value = $n?.value || "";
|
|
2584
2584
|
}
|
|
@@ -2587,102 +2587,102 @@ async function fa({
|
|
|
2587
2587
|
} catch (ln) {
|
|
2588
2588
|
console.error("readIdentityCard failed", ln);
|
|
2589
2589
|
} finally {
|
|
2590
|
-
|
|
2590
|
+
hn();
|
|
2591
2591
|
}
|
|
2592
2592
|
};
|
|
2593
2593
|
});
|
|
2594
2594
|
}
|
|
2595
|
-
function
|
|
2595
|
+
function Tt(V, S, _) {
|
|
2596
2596
|
const wn = new Image();
|
|
2597
2597
|
wn.src = URL.createObjectURL(V), wn.onload = async () => {
|
|
2598
2598
|
await window.__sdkInitPromise, await ga(wn).then((Bn) => {
|
|
2599
2599
|
const ln = JSON.parse(Bn);
|
|
2600
|
-
S && !ln?.data?.isFront ?
|
|
2601
|
-
|
|
2602
|
-
) : _ && !ln?.data?.isBack &&
|
|
2603
|
-
|
|
2600
|
+
S && !ln?.data?.isFront ? dt(
|
|
2601
|
+
i("errorInvalidCard", "Vui lòng tải lên ảnh CMND/CCCD hợp lệ")
|
|
2602
|
+
) : _ && !ln?.data?.isBack && wt(
|
|
2603
|
+
i("errorInvalidCard", "Vui lòng tải lên ảnh CMND/CCCD hợp lệ")
|
|
2604
2604
|
);
|
|
2605
2605
|
});
|
|
2606
2606
|
};
|
|
2607
2607
|
}
|
|
2608
2608
|
const {
|
|
2609
|
-
container:
|
|
2609
|
+
container: xt,
|
|
2610
2610
|
getFrontFileError: Ht,
|
|
2611
2611
|
getBackFileError: Pt,
|
|
2612
|
-
setFrontFileError:
|
|
2613
|
-
setBackFileError:
|
|
2612
|
+
setFrontFileError: dt,
|
|
2613
|
+
setBackFileError: wt,
|
|
2614
2614
|
getFrontFile: kt,
|
|
2615
2615
|
getBackFile: ut
|
|
2616
2616
|
} = Gh({
|
|
2617
2617
|
frontFile: t?.idCard,
|
|
2618
2618
|
backFile: t?.idCardBack,
|
|
2619
2619
|
onFrontChange: async (V) => {
|
|
2620
|
-
if (U = V,
|
|
2621
|
-
Vn = !1, Jn = !1, zn(),
|
|
2620
|
+
if (U = V, Tt(V, !0, !1), Ht() || Pt() || !ut()) {
|
|
2621
|
+
Vn = !1, Jn = !1, zn(), hn();
|
|
2622
2622
|
return;
|
|
2623
2623
|
}
|
|
2624
2624
|
if (t?.eInvoiceRegistration?.legalRepresentative?.idCard) {
|
|
2625
|
-
|
|
2625
|
+
hn();
|
|
2626
2626
|
return;
|
|
2627
2627
|
}
|
|
2628
2628
|
Rn(V);
|
|
2629
2629
|
},
|
|
2630
2630
|
onBackChange: async (V) => {
|
|
2631
|
-
if (qn = V,
|
|
2632
|
-
Vn = !1, Jn = !1, zn(),
|
|
2631
|
+
if (qn = V, Tt(V, !1, !0), Ht() || Pt() || !kt()) {
|
|
2632
|
+
Vn = !1, Jn = !1, zn(), hn();
|
|
2633
2633
|
return;
|
|
2634
2634
|
}
|
|
2635
2635
|
if (t?.eInvoiceRegistration?.legalRepresentative?.idCardBack) {
|
|
2636
|
-
|
|
2636
|
+
hn();
|
|
2637
2637
|
return;
|
|
2638
2638
|
}
|
|
2639
2639
|
(await Rn(kt())).success || Rn(V);
|
|
2640
2640
|
},
|
|
2641
2641
|
theme: e
|
|
2642
2642
|
});
|
|
2643
|
-
En.appendChild(
|
|
2644
|
-
const
|
|
2645
|
-
|
|
2643
|
+
En.appendChild(xt);
|
|
2644
|
+
const pt = document.createElement("div");
|
|
2645
|
+
pt.className = "wgt:space-y-4", pt.appendChild(N.container);
|
|
2646
2646
|
const ht = document.createElement("div");
|
|
2647
|
-
ht.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4",
|
|
2647
|
+
ht.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4", pt.appendChild(ht), ht.appendChild(X.container), ht.appendChild(G.container), En.appendChild(pt);
|
|
2648
2648
|
const Zn = document.createElement("div");
|
|
2649
2649
|
Zn.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-4 wgt:gap-4 wgt:items-start", Zn.appendChild($.container), Zn.appendChild(g.container), Zn.appendChild(W.container), Zn.appendChild(m.container), Gn.appendChild(En), Gn.appendChild(Zn), Gn.appendChild(p.container), Gn.appendChild(F.container);
|
|
2650
2650
|
const Kn = document.createElement("ul");
|
|
2651
2651
|
Kn.className = "wgt:list-inside wgt:list-disc wgt:-mt-2";
|
|
2652
2652
|
const ct = document.createElement("li");
|
|
2653
|
-
ct.className = "wgt:text-sm wgt:text-[#8C8C8C] wgt:italic", ct.innerText =
|
|
2653
|
+
ct.className = "wgt:text-sm wgt:text-[#8C8C8C] wgt:italic", ct.innerText = i(
|
|
2654
2654
|
"legalRepNote",
|
|
2655
2655
|
"Vui lòng kiểm tra và nhập đúng tên người đại diện theo Giấy phép kinh doanh đã tải lên."
|
|
2656
2656
|
), Kn.appendChild(ct), Gn.appendChild(Kn), d.appendChild(Gn);
|
|
2657
2657
|
const ot = document.createElement("div");
|
|
2658
2658
|
ot.className = "wgt:space-y-4";
|
|
2659
2659
|
const Un = document.createElement("h3");
|
|
2660
|
-
Un.className = "wgt:text-lg wgt:font-semibold wgt:mb-2", Un.innerText =
|
|
2660
|
+
Un.className = "wgt:text-lg wgt:font-semibold wgt:mb-2", Un.innerText = i("contactInfo", "3. Thông tin người liên hệ:"), ot.appendChild(Un);
|
|
2661
2661
|
const Xn = document.createElement("div");
|
|
2662
2662
|
Xn.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4 wgt:items-start", Xn.appendChild(H.container), Xn.appendChild(k.container), Xn.appendChild(L.container), Xn.appendChild(Q.container), ot.appendChild(Xn), d.appendChild(ot);
|
|
2663
2663
|
const R = document.createElement("div");
|
|
2664
2664
|
R.className = "wgt:space-y-4";
|
|
2665
|
-
const
|
|
2666
|
-
|
|
2667
|
-
const
|
|
2668
|
-
|
|
2665
|
+
const an = document.createElement("h3");
|
|
2666
|
+
an.className = "wgt:text-lg wgt:font-semibold wgt:mb-2", an.innerText = i("invoiceUsageInfo", "4. THÔNG TIN SỬ DỤNG HDDT:"), R.appendChild(an), d.appendChild(R);
|
|
2667
|
+
const An = document.createElement("div");
|
|
2668
|
+
An.className = "wgt:w-full wgt:flex wgt:gap-4 wgt:items-start wgt:flex-row wgt:@max-4xl:flex-col", An.appendChild(v.container), An.appendChild(Pn.container), R.appendChild(An);
|
|
2669
2669
|
const nn = document.createElement("div");
|
|
2670
2670
|
nn.className = "wgt:flex wgt:flex-col wgt:space-y-4 wgt:border wgt:border-soft-200 wgt:px-6 wgt:py-4 wgt:rounded-xl", r || d.appendChild(nn);
|
|
2671
2671
|
const mn = document.createElement("div");
|
|
2672
2672
|
mn.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", mn.appendChild(J);
|
|
2673
2673
|
const en = document.createElement("h4");
|
|
2674
|
-
en.className = "wgt:font-semibold wgt:italic", en.innerText =
|
|
2674
|
+
en.className = "wgt:font-semibold wgt:italic", en.innerText = i(
|
|
2675
2675
|
"hasUsedEInvoice",
|
|
2676
2676
|
"Bạn đã sử dụng hoá đơn điện tử?"
|
|
2677
2677
|
), mn.appendChild(en), r || nn.appendChild(mn), J.checked = r, J.disabled = r;
|
|
2678
|
-
const
|
|
2679
|
-
if (
|
|
2680
|
-
|
|
2678
|
+
const cn = document.createElement("div");
|
|
2679
|
+
if (cn.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", !r) {
|
|
2680
|
+
cn.appendChild(M);
|
|
2681
2681
|
const V = document.createElement("h4");
|
|
2682
|
-
V.className = "wgt:font-semibold wgt:italic", V.innerText =
|
|
2682
|
+
V.className = "wgt:font-semibold wgt:italic", V.innerText = i("hasUsedEInvoiceBefore", {
|
|
2683
2683
|
defaultValue: "Bạn đang sử dụng nhà NCC hoá đơn điện tử khác M-invoice không?",
|
|
2684
2684
|
provider: q
|
|
2685
|
-
}),
|
|
2685
|
+
}), cn.appendChild(V);
|
|
2686
2686
|
}
|
|
2687
2687
|
const Z = document.createElement("div");
|
|
2688
2688
|
Z.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", Z.appendChild(Y.container);
|
|
@@ -2706,14 +2706,14 @@ async function fa({
|
|
|
2706
2706
|
].join(" ");
|
|
2707
2707
|
const Qn = "http://www.w3.org/2000/svg", z = document.createElementNS(Qn, "svg");
|
|
2708
2708
|
z.setAttribute("viewBox", "0 0 24 24"), z.setAttribute("class", "wgt:w-4 wgt:h-4 wgt:text-white");
|
|
2709
|
-
const
|
|
2710
|
-
|
|
2709
|
+
const tn = document.createElementNS(Qn, "path");
|
|
2710
|
+
tn.setAttribute("fill-rule", "evenodd"), tn.setAttribute("clip-rule", "evenodd"), tn.setAttribute(
|
|
2711
2711
|
"d",
|
|
2712
2712
|
"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"
|
|
2713
|
-
),
|
|
2713
|
+
), tn.setAttribute("fill", "white"), z.appendChild(tn), rn.appendChild(z);
|
|
2714
2714
|
const sn = document.createElement("label");
|
|
2715
2715
|
sn.className = "wgt:text-sm wgt:text-strong-950 wgt:leading-tight", sn.appendChild(
|
|
2716
|
-
document.createTextNode(
|
|
2716
|
+
document.createTextNode(i("agreeWith", "Tôi đồng ý với ") + " ")
|
|
2717
2717
|
);
|
|
2718
2718
|
const Ln = (V) => {
|
|
2719
2719
|
const S = document.createElement("button");
|
|
@@ -2722,12 +2722,12 @@ async function fa({
|
|
|
2722
2722
|
}, S;
|
|
2723
2723
|
}, Tn = Oh(e);
|
|
2724
2724
|
sn.appendChild(
|
|
2725
|
-
Ln(
|
|
2726
|
-
), sn.appendChild(document.createTextNode(` ${
|
|
2727
|
-
gn = !gn, gn ? (rn.classList.add("wgt:bg-primary"), z.classList.remove("wgt:hidden")) : (rn.classList.remove("wgt:bg-primary"), z.classList.add("wgt:hidden")),
|
|
2725
|
+
Ln(i("termsAndUsagePolicy", "Điều khoản và Chính sách sử dụng"))
|
|
2726
|
+
), sn.appendChild(document.createTextNode(` ${i("of", "của")} ${Tn}.`)), on.appendChild(rn), on.appendChild(sn), d.appendChild(on), rn.addEventListener("click", () => {
|
|
2727
|
+
gn = !gn, gn ? (rn.classList.add("wgt:bg-primary"), z.classList.remove("wgt:hidden")) : (rn.classList.remove("wgt:bg-primary"), z.classList.add("wgt:hidden")), hn();
|
|
2728
2728
|
});
|
|
2729
2729
|
const xn = document.createElement("div");
|
|
2730
|
-
xn.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ", K.type = "submit", K.innerText =
|
|
2730
|
+
xn.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ", K.type = "submit", K.innerText = i("next"), K.className = [
|
|
2731
2731
|
"wgt:bg-primary",
|
|
2732
2732
|
"wgt:hover:bg-primary-dark",
|
|
2733
2733
|
"wgt:text-text-primary",
|
|
@@ -2754,7 +2754,7 @@ async function fa({
|
|
|
2754
2754
|
), _n = S.legalRepresentative.phone.replace(/[^\d+().\-\s]/g, "").replace(/[\s.\-()]/g, ""), Yn = /^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/;
|
|
2755
2755
|
return !(!Yn.test(ln) || !Yn.test(_n) || !/^\d{12}$/.test(S.legalRepresentative.idCard) || !/^(?!\.)(?!.*\.\.)[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]{1,64}(?<!\.)@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z0-9-]{2,63}$/.test(S.contactPerson.email) || !/^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(S.invoiceSymbol) || !V.license || !V.idCard || !V.idCardBack);
|
|
2756
2756
|
}
|
|
2757
|
-
function
|
|
2757
|
+
function hn() {
|
|
2758
2758
|
const V = e === "bvb" && !r && o === !1 && !t._userHasEditedTaxCode;
|
|
2759
2759
|
K.disabled = !dn() || !gn || Ht() || Pt() || j.getError() || F.getError() || V;
|
|
2760
2760
|
}
|
|
@@ -2811,16 +2811,16 @@ async function fa({
|
|
|
2811
2811
|
Y,
|
|
2812
2812
|
D
|
|
2813
2813
|
].forEach((V) => {
|
|
2814
|
-
V.inputEl.addEventListener("input",
|
|
2814
|
+
V.inputEl.addEventListener("input", hn);
|
|
2815
2815
|
}), [G, f].forEach((V) => {
|
|
2816
|
-
V.selectEl.addEventListener("change",
|
|
2816
|
+
V.selectEl.addEventListener("change", hn);
|
|
2817
2817
|
}), [J, M].forEach((V) => {
|
|
2818
|
-
V.addEventListener("change",
|
|
2818
|
+
V.addEventListener("change", hn);
|
|
2819
2819
|
}), K.addEventListener("click", async (V) => {
|
|
2820
2820
|
if (V.preventDefault(), !dn()) return;
|
|
2821
2821
|
const S = E.getValue().trim();
|
|
2822
2822
|
if (!P0(S)) {
|
|
2823
|
-
E.setError(
|
|
2823
|
+
E.setError(i("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), Nt.error(i("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), I();
|
|
2824
2824
|
return;
|
|
2825
2825
|
}
|
|
2826
2826
|
if (r) {
|
|
@@ -2866,7 +2866,7 @@ async function fa({
|
|
|
2866
2866
|
} catch (Bn) {
|
|
2867
2867
|
wn = !0, console.error("Error checking customer:", Bn);
|
|
2868
2868
|
} finally {
|
|
2869
|
-
K.disabled = !1, K.innerText =
|
|
2869
|
+
K.disabled = !1, K.innerText = i("next");
|
|
2870
2870
|
}
|
|
2871
2871
|
wn || _ === !1 || _ === !0 && (yn(vn.STEP1_COMPLETED, {
|
|
2872
2872
|
theme: e,
|
|
@@ -2876,7 +2876,7 @@ async function fa({
|
|
|
2876
2876
|
}), n(pn()));
|
|
2877
2877
|
});
|
|
2878
2878
|
const Hn = (t?.eInvoiceRegistration?.organization?.taxCode || "").trim();
|
|
2879
|
-
return Hn.length >= 10 && Sn(Hn), t?.idCard && (U = t?.idCard),
|
|
2879
|
+
return Hn.length >= 10 && Sn(Hn), t?.idCard && (U = t?.idCard), hn(), {
|
|
2880
2880
|
container: C,
|
|
2881
2881
|
getValues: pn
|
|
2882
2882
|
};
|
|
@@ -2893,11 +2893,11 @@ async function Xa({
|
|
|
2893
2893
|
u.className = "wgt:flex wgt:items-start wgt:gap-2 wgt:p-4 wgt:border-l-4", u.style.borderLeft = "4px solid #e39717", u.style.backgroundColor = "#e397171a";
|
|
2894
2894
|
const o = document.createElement("div");
|
|
2895
2895
|
o.className = "wgt:w-1 wgt:rounded ", o.style.backgroundColor = "#e397171a", u.appendChild(o);
|
|
2896
|
-
const
|
|
2897
|
-
|
|
2896
|
+
const s = document.createElement("div");
|
|
2897
|
+
s.className = " wgt:text-sm wgt:leading-relaxed", s.style.color = "#e39717", s.innerHTML = i(
|
|
2898
2898
|
"noteReload",
|
|
2899
2899
|
"<strong>Lưu ý:</strong> Để đảm bảo thông tin gia hạn được chính xác, vui lòng kiểm tra và tải lại các thông tin với dữ liệu mới nhất."
|
|
2900
|
-
), u.appendChild(
|
|
2900
|
+
), u.appendChild(s), h.appendChild(u);
|
|
2901
2901
|
}
|
|
2902
2902
|
const c = Dh(n);
|
|
2903
2903
|
h.appendChild(c.container);
|
|
@@ -2929,8 +2929,8 @@ function Ba({
|
|
|
2929
2929
|
].filter(Boolean).join(" "), u.onclick = c;
|
|
2930
2930
|
const o = document.createElement("div");
|
|
2931
2931
|
o.className = "wgt:w-full", u.appendChild(o);
|
|
2932
|
-
const
|
|
2933
|
-
|
|
2932
|
+
const s = document.createElement("div");
|
|
2933
|
+
s.className = "wgt:w-full wgt:flex wgt:justify-between wgt:items-center";
|
|
2934
2934
|
const l = document.createElement("div");
|
|
2935
2935
|
l.className = "wgt:flex wgt:items-center wgt:gap-2";
|
|
2936
2936
|
const T = document.createElement("span");
|
|
@@ -2942,13 +2942,13 @@ function Ba({
|
|
|
2942
2942
|
const d = document.createElement("div");
|
|
2943
2943
|
d.className = "wgt:w-fit wgt:px-2 wgt:py-0.5 wgt:rounded wgt:bg-primary wgt:text-white wgt:bg-gradient-to-r wgt:from-[#FF8447] wgt:to-[#F6B51E] wgt:text-sm wgt:font-semibold", d.innerText = a, l.appendChild(d);
|
|
2944
2944
|
}
|
|
2945
|
-
|
|
2945
|
+
s.appendChild(l);
|
|
2946
2946
|
const { container: r } = Gt({
|
|
2947
2947
|
checked: h,
|
|
2948
2948
|
onChange: (d) => {
|
|
2949
2949
|
}
|
|
2950
2950
|
});
|
|
2951
|
-
|
|
2951
|
+
s.appendChild(r), o.appendChild(s);
|
|
2952
2952
|
const q = document.createElement("div");
|
|
2953
2953
|
q.className = "wgt:flex wgt:items-center wgt:text-gray-600 wgt:mt-2";
|
|
2954
2954
|
const x = document.createElement("div");
|
|
@@ -2958,9 +2958,9 @@ function Ba({
|
|
|
2958
2958
|
`, q.appendChild(x);
|
|
2959
2959
|
const w = document.createElement("span");
|
|
2960
2960
|
if (w.className = "wgt:ml-2 wgt:text-sm", t === "signature") {
|
|
2961
|
-
const d = st(), E =
|
|
2962
|
-
w.innerText = `${
|
|
2963
|
-
} else typeof n?.limit == "number" ? w.innerText = `${n?.limit.toLocaleString("vi-VN")} ${
|
|
2961
|
+
const d = st(), E = i(n.duration.unit), P = d === "en" && n.duration.value > 1 ? E + "s" : E;
|
|
2962
|
+
w.innerText = `${i("duration")}: ${n.duration.value} ${P} `;
|
|
2963
|
+
} else typeof n?.limit == "number" ? w.innerText = `${n?.limit.toLocaleString("vi-VN")} ${i(
|
|
2964
2964
|
"searchUnits"
|
|
2965
2965
|
)}` : w.innerText = "";
|
|
2966
2966
|
q.appendChild(w), o.appendChild(q);
|
|
@@ -2976,7 +2976,7 @@ function Ba({
|
|
|
2976
2976
|
let I = A ? n?.renewPrice ?? 0 : n?.price ?? 0;
|
|
2977
2977
|
y.innerText = kn(n?.limit * I), b.appendChild(y);
|
|
2978
2978
|
const C = document.createElement("span");
|
|
2979
|
-
return C.className = "wgt:text-sm wgt:text-text-sub-600", C.innerText = `VND/${
|
|
2979
|
+
return C.className = "wgt:text-sm wgt:text-text-sub-600", C.innerText = `VND/${i("package")}`, b.appendChild(C), u.appendChild(b), { container: u };
|
|
2980
2980
|
}
|
|
2981
2981
|
function k0({
|
|
2982
2982
|
type: n = "service",
|
|
@@ -2990,12 +2990,12 @@ function k0({
|
|
|
2990
2990
|
} = {}) {
|
|
2991
2991
|
const o = document.createElement("div");
|
|
2992
2992
|
o.className = "wgt:space-y-6";
|
|
2993
|
-
const
|
|
2994
|
-
|
|
2993
|
+
const s = document.createElement("div");
|
|
2994
|
+
s.className = "wgt:relative wgt:w-full", o.appendChild(s);
|
|
2995
2995
|
const l = document.createElement("h3");
|
|
2996
|
-
l.className = "wgt:text-lg wgt:font-semibold wgt:text-text-primary", l.innerText = n === "service" ? "Service Packages" : "Invoice Packages",
|
|
2996
|
+
l.className = "wgt:text-lg wgt:font-semibold wgt:text-text-primary", l.innerText = n === "service" ? "Service Packages" : "Invoice Packages", s.appendChild(l);
|
|
2997
2997
|
const T = document.createElement("div");
|
|
2998
|
-
T.className = "wgt:w-full wgt:grid wgt:grid-flow-col wgt:auto-cols-[minmax(30%,1fr)] wgt:@max-2xl:auto-cols-[minmax(80%,1fr)] wgt:gap-6 wgt:overflow-x-auto wgt:snap-x wgt:snap-mandatory wgt:cursor-grab wgt:select-none hide-scrollbar", T.style.cssText = "scroll-snap-type:x mandatory;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;",
|
|
2998
|
+
T.className = "wgt:w-full wgt:grid wgt:grid-flow-col wgt:auto-cols-[minmax(30%,1fr)] wgt:@max-2xl:auto-cols-[minmax(80%,1fr)] wgt:gap-6 wgt:overflow-x-auto wgt:snap-x wgt:snap-mandatory wgt:cursor-grab wgt:select-none hide-scrollbar", T.style.cssText = "scroll-snap-type:x mandatory;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;", s.appendChild(T);
|
|
2999
2999
|
const r = document.createElement("style");
|
|
3000
3000
|
r.textContent = `
|
|
3001
3001
|
.hide-scrollbar { scrollbar-width: none; }
|
|
@@ -3012,11 +3012,11 @@ function k0({
|
|
|
3012
3012
|
</svg>`, G;
|
|
3013
3013
|
}
|
|
3014
3014
|
const x = q("prev"), w = q("next");
|
|
3015
|
-
x.style.left = "8px", w.style.right = "8px",
|
|
3015
|
+
x.style.left = "8px", w.style.right = "8px", s.appendChild(x), s.appendChild(w);
|
|
3016
3016
|
let b = t, y = e, I = h;
|
|
3017
3017
|
const C = () => window.matchMedia("(max-width: 414px)").matches;
|
|
3018
3018
|
function d() {
|
|
3019
|
-
const X = T.getBoundingClientRect(), G =
|
|
3019
|
+
const X = T.getBoundingClientRect(), G = s.getBoundingClientRect(), W = X.top - G.top + X.height / 2;
|
|
3020
3020
|
x.style.top = `${W}px`, w.style.top = `${W}px`, x.style.transform = "translateY(-50%)", w.style.transform = "translateY(-50%)";
|
|
3021
3021
|
}
|
|
3022
3022
|
function E() {
|
|
@@ -3035,7 +3035,7 @@ function k0({
|
|
|
3035
3035
|
function f() {
|
|
3036
3036
|
if (T.innerHTML = "", !b || b.length === 0) {
|
|
3037
3037
|
const X = document.createElement("div");
|
|
3038
|
-
X.className = "wgt:col-span-full wgt:text-center wgt:py-8 wgt:text-text-sub-600", X.innerText =
|
|
3038
|
+
X.className = "wgt:col-span-full wgt:text-center wgt:py-8 wgt:text-text-sub-600", X.innerText = i("noPackageFound") || "Không tìm thấy gói phù hợp", T.appendChild(X);
|
|
3039
3039
|
return;
|
|
3040
3040
|
}
|
|
3041
3041
|
b.forEach((X) => {
|
|
@@ -3073,7 +3073,7 @@ function k0({
|
|
|
3073
3073
|
{ passive: !1 }
|
|
3074
3074
|
);
|
|
3075
3075
|
const N = new ResizeObserver(() => d());
|
|
3076
|
-
return N.observe(T), N.observe(
|
|
3076
|
+
return N.observe(T), N.observe(s), {
|
|
3077
3077
|
container: o,
|
|
3078
3078
|
render: f,
|
|
3079
3079
|
setSelectedPackageId(X) {
|
|
@@ -3117,8 +3117,8 @@ function Na({
|
|
|
3117
3117
|
}
|
|
3118
3118
|
});
|
|
3119
3119
|
u.appendChild(o.container);
|
|
3120
|
-
const
|
|
3121
|
-
|
|
3120
|
+
const s = document.createElement("div");
|
|
3121
|
+
s.className = "wgt:flex wgt:flex-col wgt:gap-1";
|
|
3122
3122
|
const l = document.createElement("div");
|
|
3123
3123
|
l.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";
|
|
3124
3124
|
const T = document.createElement("span");
|
|
@@ -3133,11 +3133,11 @@ function Na({
|
|
|
3133
3133
|
"wgt:px-1.5",
|
|
3134
3134
|
"wgt:py-1",
|
|
3135
3135
|
"wgt:rounded-sm"
|
|
3136
|
-
].join(" "), q.textContent =
|
|
3136
|
+
].join(" "), q.textContent = i("required"), l.appendChild(q);
|
|
3137
3137
|
}
|
|
3138
|
-
|
|
3138
|
+
s.appendChild(l);
|
|
3139
3139
|
const r = document.createElement("p");
|
|
3140
|
-
return r.className = "wgt:text-text-soft-400 wgt:text-sm", r.textContent = h,
|
|
3140
|
+
return r.className = "wgt:text-text-soft-400 wgt:text-sm", r.textContent = h, s.appendChild(r), u.appendChild(s), { container: u };
|
|
3141
3141
|
}
|
|
3142
3142
|
function Ea({
|
|
3143
3143
|
promotion: n,
|
|
@@ -3167,14 +3167,14 @@ function Ea({
|
|
|
3167
3167
|
"wgt:mb-1",
|
|
3168
3168
|
"wgt:text-primary"
|
|
3169
3169
|
].join(" "), o.textContent = n.code, u.appendChild(o);
|
|
3170
|
-
const
|
|
3171
|
-
|
|
3170
|
+
const s = document.createElement("p");
|
|
3171
|
+
s.className = [
|
|
3172
3172
|
"wgt:text-sm",
|
|
3173
3173
|
"wgt:text-text-sub-600",
|
|
3174
3174
|
"wgt:mb-2"
|
|
3175
3175
|
].join(" ");
|
|
3176
3176
|
const l = Qt(st());
|
|
3177
|
-
|
|
3177
|
+
s.textContent = n[l], u.appendChild(s);
|
|
3178
3178
|
const { container: T } = Gt({
|
|
3179
3179
|
checked: n.isSelected,
|
|
3180
3180
|
onChange: () => {
|
|
@@ -3191,7 +3191,7 @@ function Ea({
|
|
|
3191
3191
|
"wgt:text-right",
|
|
3192
3192
|
"wgt:text-[#335CFF]",
|
|
3193
3193
|
"wgt:italic"
|
|
3194
|
-
].join(" "), r.textContent = `${
|
|
3194
|
+
].join(" "), r.textContent = `${i("validityPeriod")}: ${i(
|
|
3195
3195
|
"expiredDate"
|
|
3196
3196
|
)} ${n.expiredAt.split("T")[0]}`, A.appendChild(r), h.appendChild(c), h.appendChild(A), { container: h };
|
|
3197
3197
|
}
|
|
@@ -3200,7 +3200,7 @@ function Ha({
|
|
|
3200
3200
|
placeholder: t = "",
|
|
3201
3201
|
onInputChange: e = void 0
|
|
3202
3202
|
}) {
|
|
3203
|
-
const a = t ||
|
|
3203
|
+
const a = t || i("searchUnits"), h = document.createElement("div");
|
|
3204
3204
|
h.className = "wgt:flex wgt:flex-col";
|
|
3205
3205
|
const c = document.createElement("div");
|
|
3206
3206
|
c.className = "wgt:flex wgt:rounded-lg wgt:border wgt:border-gray-300 wgt:overflow-hidden", h.appendChild(c);
|
|
@@ -3219,10 +3219,10 @@ function Pa({
|
|
|
3219
3219
|
u.className = "wgt:flex wgt:flex-col wgt:gap-3";
|
|
3220
3220
|
const o = document.createElement("div");
|
|
3221
3221
|
o.className = "wgt:flex wgt:flex-col wgt:gap-4", u.appendChild(o);
|
|
3222
|
-
const
|
|
3223
|
-
|
|
3222
|
+
const s = document.createElement("h2");
|
|
3223
|
+
s.className = "wgt:text-xl wgt:font-bold wgt:text-text-black", s.innerText = i("selectInvoicePackage");
|
|
3224
3224
|
const l = document.createElement("span");
|
|
3225
|
-
l.className = "wgt:text-sm wgt:text-red-500 wgt:ml-1", l.innerText = "*",
|
|
3225
|
+
l.className = "wgt:text-sm wgt:text-red-500 wgt:ml-1", l.innerText = "*", s.appendChild(l), o.appendChild(s);
|
|
3226
3226
|
async function T() {
|
|
3227
3227
|
t && clearTimeout(t), e !== "" ? t = setTimeout(async () => {
|
|
3228
3228
|
try {
|
|
@@ -3233,7 +3233,7 @@ function Pa({
|
|
|
3233
3233
|
});
|
|
3234
3234
|
d && (A = d), a && a();
|
|
3235
3235
|
} catch (C) {
|
|
3236
|
-
console.error("Error searching packages:", C),
|
|
3236
|
+
console.error("Error searching packages:", C), Nt.error(i("errorSearchingPackages"), {
|
|
3237
3237
|
autoClose: 5e3,
|
|
3238
3238
|
closeButton: !0,
|
|
3239
3239
|
icon: !0
|
|
@@ -3243,7 +3243,7 @@ function Pa({
|
|
|
3243
3243
|
}
|
|
3244
3244
|
const r = Ha({
|
|
3245
3245
|
value: "",
|
|
3246
|
-
placeholder:
|
|
3246
|
+
placeholder: i("searchUnits"),
|
|
3247
3247
|
onInputChange: (C) => {
|
|
3248
3248
|
e = C.target.value.replace(/\D/g, ""), T();
|
|
3249
3249
|
}
|
|
@@ -3252,14 +3252,14 @@ function Pa({
|
|
|
3252
3252
|
const q = document.createElement("div");
|
|
3253
3253
|
q.className = "wgt:flex wgt:flex-col wgt:gap-2", u.appendChild(q);
|
|
3254
3254
|
const x = document.createElement("h3");
|
|
3255
|
-
x.className = "wgt:text-sm wgt:font-semibold wgt:text-[#525866]", x.innerText =
|
|
3255
|
+
x.className = "wgt:text-sm wgt:font-semibold wgt:text-[#525866]", x.innerText = i("mostSuitablePackage"), q.appendChild(x);
|
|
3256
3256
|
const w = document.createElement("div");
|
|
3257
3257
|
q.appendChild(w);
|
|
3258
3258
|
const b = document.createElement("div");
|
|
3259
3259
|
b.className = "wgt:flex wgt:items-center wgt:justify-center wgt:py-8", b.innerHTML = `
|
|
3260
3260
|
<div class="wgt:flex wgt:flex-col wgt:items-center wgt:gap-2">
|
|
3261
3261
|
<div class="wgt:h-8 wgt:w-8 wgt:animate-spin wgt:rounded-full wgt:border-2 wgt:border-solid wgt:border-primary wgt:border-t-transparent"></div>
|
|
3262
|
-
<span class="wgt:text-sm wgt:text-text-sub-600">${
|
|
3262
|
+
<span class="wgt:text-sm wgt:text-text-sub-600">${i("loading")}...</span>
|
|
3263
3263
|
</div>
|
|
3264
3264
|
`, w.appendChild(b);
|
|
3265
3265
|
function y(C) {
|
|
@@ -3287,19 +3287,15 @@ function ka(n = !1) {
|
|
|
3287
3287
|
const t = document.createElement("div");
|
|
3288
3288
|
t.className = "wgt:flex wgt:flex-col wgt:gap-4";
|
|
3289
3289
|
const e = document.createElement("h2");
|
|
3290
|
-
|
|
3291
|
-
const c = document.createElement("span");
|
|
3292
|
-
c.className = "wgt:text-sm wgt:text-red-500 wgt:ml-1", c.innerText = "*", e.appendChild(c);
|
|
3293
|
-
}
|
|
3294
|
-
t.appendChild(e);
|
|
3290
|
+
e.className = "wgt:text-xl wgt:font-bold wgt:text-text-black", e.innerText = i("selectSignaturePackage"), t.appendChild(e);
|
|
3295
3291
|
const a = document.createElement("div");
|
|
3296
3292
|
t.appendChild(a);
|
|
3297
3293
|
const h = document.createElement("div");
|
|
3298
3294
|
return h.className = "wgt:flex wgt:items-center wgt:justify-center wgt:py-8", h.innerHTML = `
|
|
3299
3295
|
<div class="wgt:flex wgt:flex-col wgt:items-center wgt:gap-2">
|
|
3300
3296
|
<div class="wgt:h-8 wgt:w-8 wgt:animate-spin wgt:rounded-full wgt:border-2 wgt:border-solid wgt:border-primary wgt:border-t-transparent"></div>
|
|
3301
|
-
<span class="wgt:text-sm wgt:text-text-sub-600">${
|
|
3302
|
-
<span class="wgt:text-sm wgt:text-text-sub-600">${
|
|
3297
|
+
<span class="wgt:text-sm wgt:text-text-sub-600">${i("loading")}...</span>
|
|
3298
|
+
<span class="wgt:text-sm wgt:text-text-sub-600">${i("loading")}...</span>
|
|
3303
3299
|
</div>
|
|
3304
3300
|
`, a.appendChild(h), a.appendChild(h), {
|
|
3305
3301
|
container: t,
|
|
@@ -3310,7 +3306,7 @@ function ya() {
|
|
|
3310
3306
|
const n = document.createElement("div");
|
|
3311
3307
|
n.className = "wgt:flex wgt:items-center wgt:gap-4 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";
|
|
3312
3308
|
const t = document.createElement("span");
|
|
3313
|
-
t.className = "wgt:text-sm wgt:font-semibold wgt:leading-[18px] wgt:text-text-black", t.innerText =
|
|
3309
|
+
t.className = "wgt:text-sm wgt:font-semibold wgt:leading-[18px] wgt:text-text-black", t.innerText = i("paymentMethod"), n.appendChild(t);
|
|
3314
3310
|
const e = document.createElement("div");
|
|
3315
3311
|
e.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:rounded-[10px] wgt:border wgt:border-soft-200 wgt:bg-transparent wgt:p-2", n.appendChild(e);
|
|
3316
3312
|
const a = document.createElement("div");
|
|
@@ -3341,7 +3337,7 @@ function ya() {
|
|
|
3341
3337
|
</svg>
|
|
3342
3338
|
`, e.appendChild(a);
|
|
3343
3339
|
const h = document.createElement("span");
|
|
3344
|
-
return h.className = "wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-strong-950", h.innerText =
|
|
3340
|
+
return h.className = "wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-strong-950", h.innerText = i("qrPayment"), e.appendChild(h), {
|
|
3345
3341
|
container: n
|
|
3346
3342
|
};
|
|
3347
3343
|
}
|
|
@@ -3349,7 +3345,7 @@ function va() {
|
|
|
3349
3345
|
const n = document.createElement("div");
|
|
3350
3346
|
n.className = "wgt:flex wgt:flex-col wgt:gap-2 wgt:-mt-4";
|
|
3351
3347
|
const t = document.createElement("h3");
|
|
3352
|
-
t.className = "wgt:text-lg wgt:font-bold wgt:text-text-black wgt:@max-2xl:text-xl wgt:@max-2xl:mb-3", t.innerText =
|
|
3348
|
+
t.className = "wgt:text-lg wgt:font-bold wgt:text-text-black wgt:@max-2xl:text-xl wgt:@max-2xl:mb-3", t.innerText = i("selectedProducts"), n.appendChild(t);
|
|
3353
3349
|
const e = document.createElement("div");
|
|
3354
3350
|
e.className = "wgt:overflow-x-auto wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:@max-2xl:overflow-x-visible wgt:@max-2xl:border-0 wgt:@max-2xl:bg-transparent", n.appendChild(e);
|
|
3355
3351
|
const a = document.createElement("table");
|
|
@@ -3358,11 +3354,11 @@ function va() {
|
|
|
3358
3354
|
h.className = "wgt:bg-soft-150 wgt:@max-2xl:hidden";
|
|
3359
3355
|
const c = document.createElement("tr");
|
|
3360
3356
|
[
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3357
|
+
i("product"),
|
|
3358
|
+
i("unit"),
|
|
3359
|
+
i("quantity"),
|
|
3360
|
+
i("unitPrice"),
|
|
3361
|
+
i("totalPrice")
|
|
3366
3362
|
].forEach((u) => {
|
|
3367
3363
|
const o = document.createElement("th");
|
|
3368
3364
|
o.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-sm wgt:font-semibold wgt:text-text-sub-600", o.innerText = u, c.appendChild(o);
|
|
@@ -3384,7 +3380,7 @@ async function La({
|
|
|
3384
3380
|
setSelectedInvoiceOtp: A,
|
|
3385
3381
|
setSelectedSignatureOtp: u,
|
|
3386
3382
|
setOrderId: o,
|
|
3387
|
-
setTotalAmount:
|
|
3383
|
+
setTotalAmount: s,
|
|
3388
3384
|
setOrderAmount: l,
|
|
3389
3385
|
theme: T,
|
|
3390
3386
|
selectedProvider: r,
|
|
@@ -3408,10 +3404,10 @@ async function La({
|
|
|
3408
3404
|
});
|
|
3409
3405
|
}
|
|
3410
3406
|
function J(R) {
|
|
3411
|
-
return R.find((
|
|
3407
|
+
return R.find((an) => W.includes(an.code));
|
|
3412
3408
|
}
|
|
3413
3409
|
function M(R) {
|
|
3414
|
-
return N.find((
|
|
3410
|
+
return N.find((an) => an._id === R) || null;
|
|
3415
3411
|
}
|
|
3416
3412
|
const D = document.createElement("div");
|
|
3417
3413
|
D.className = "wgt:relative wgt:flex wgt:w-full wgt:h-full wgt:flex-col wgt:gap-4 wgt:py-6";
|
|
@@ -3427,7 +3423,7 @@ async function La({
|
|
|
3427
3423
|
container: qn,
|
|
3428
3424
|
invoiceSelectorWrapper: K,
|
|
3429
3425
|
setInvoicePackages: O,
|
|
3430
|
-
getInvoicePackages:
|
|
3426
|
+
getInvoicePackages: un,
|
|
3431
3427
|
getFilteredInvoiceOptions: Pn,
|
|
3432
3428
|
setFilteredInvoiceOptions: Nn,
|
|
3433
3429
|
findInvoiceById: Sn,
|
|
@@ -3451,47 +3447,47 @@ async function La({
|
|
|
3451
3447
|
jn.className = "wgt:flex wgt:items-center wgt:justify-center wgt:py-4", jn.innerHTML = `
|
|
3452
3448
|
<div class="wgt:flex wgt:flex-col wgt:items-center wgt:gap-2">
|
|
3453
3449
|
<div class="wgt:h-6 wgt:w-6 wgt:animate-spin wgt:rounded-full wgt:border-2 wgt:border-solid wgt:border-primary wgt:border-t-transparent"></div>
|
|
3454
|
-
<span class="wgt:text-sm wgt:text-text-sub-600">${
|
|
3450
|
+
<span class="wgt:text-sm wgt:text-text-sub-600">${i("loading")}...</span>
|
|
3455
3451
|
</div>
|
|
3456
3452
|
`, U.appendChild(jn);
|
|
3457
3453
|
const { container: Gn } = ya(), { container: at, tbody: En } = va(), Vn = document.createElement("div");
|
|
3458
3454
|
Vn.className = "wgt:hidden wgt:@max-2xl:flex wgt:items-center wgt:justify-between wgt:w-full wgt:bg-white wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:px-6 wgt:py-5 wgt:shadow-lg";
|
|
3459
3455
|
const Jn = document.createElement("span");
|
|
3460
|
-
Jn.className = "wgt:text-lg wgt:font-bold wgt:text-strong-950", Jn.innerText =
|
|
3456
|
+
Jn.className = "wgt:text-lg wgt:font-bold wgt:text-strong-950", Jn.innerText = i("total"), Vn.appendChild(Jn);
|
|
3461
3457
|
const Wn = document.createElement("span");
|
|
3462
3458
|
Wn.className = "wgt:text-xl wgt:font-bold wgt:text-primary", Wn.innerText = "0 VND", Vn.appendChild(Wn);
|
|
3463
3459
|
const zn = document.createElement("div");
|
|
3464
3460
|
zn.className = "wgt:flex wgt:justify-between wgt:gap-2", D.appendChild(zn);
|
|
3465
3461
|
const Rn = document.createElement("button");
|
|
3466
|
-
Rn.type = "button", Rn.innerText =
|
|
3467
|
-
const
|
|
3462
|
+
Rn.type = "button", Rn.innerText = i("back"), Rn.className = "wgt:bg-transparent wgt:text-primary wgt:hover:text-primary-dark wgt:hover:bg-transparent wgt:underline", Rn.addEventListener("click", t), zn.appendChild(Rn);
|
|
3463
|
+
const Tt = async (R, an, An, nn) => {
|
|
3468
3464
|
j();
|
|
3469
3465
|
const { isUsedEInvoiceBefore: mn, ...en } = x.eInvoiceRegistration;
|
|
3470
|
-
let
|
|
3466
|
+
let cn = [
|
|
3471
3467
|
{
|
|
3472
|
-
code:
|
|
3473
|
-
quantity:
|
|
3468
|
+
code: an.code,
|
|
3469
|
+
quantity: an.quantity,
|
|
3474
3470
|
isCashRegister: B
|
|
3475
3471
|
}
|
|
3476
3472
|
];
|
|
3477
|
-
|
|
3478
|
-
code:
|
|
3479
|
-
quantity:
|
|
3473
|
+
An && cn.push({
|
|
3474
|
+
code: An.code,
|
|
3475
|
+
quantity: An.quantity,
|
|
3480
3476
|
isCashRegister: B
|
|
3481
|
-
}), R &&
|
|
3477
|
+
}), R && cn.push({
|
|
3482
3478
|
code: R.code,
|
|
3483
3479
|
quantity: R.quantity,
|
|
3484
3480
|
isCashRegister: B
|
|
3485
3481
|
}), nn.length > 0 && nn.forEach((Z) => {
|
|
3486
3482
|
const on = G[Z];
|
|
3487
3483
|
on.reward.packageCodes.length > 0 && on.reward.packageCodes.forEach((gn) => {
|
|
3488
|
-
|
|
3484
|
+
cn.push({
|
|
3489
3485
|
code: gn,
|
|
3490
3486
|
quantity: 1,
|
|
3491
3487
|
isCashRegister: B
|
|
3492
3488
|
});
|
|
3493
3489
|
});
|
|
3494
|
-
}), b(
|
|
3490
|
+
}), b(cn), y(nn);
|
|
3495
3491
|
try {
|
|
3496
3492
|
const Z = await vh({
|
|
3497
3493
|
eInvoiceRegistration: {
|
|
@@ -3505,52 +3501,48 @@ async function La({
|
|
|
3505
3501
|
x.idCard,
|
|
3506
3502
|
x.idCardBack
|
|
3507
3503
|
],
|
|
3508
|
-
packages:
|
|
3504
|
+
packages: cn,
|
|
3509
3505
|
promotionCodes: nn,
|
|
3510
3506
|
isRenew: E,
|
|
3511
3507
|
isCashRegister: B
|
|
3512
3508
|
}), on = Z.orderId, gn = Z.amount || 0;
|
|
3513
3509
|
o(on), l ? l(gn) : console.warn("setOrderAmount is not defined!"), await new Promise((rn) => setTimeout(rn, 100)), F(), n();
|
|
3514
3510
|
} catch {
|
|
3515
|
-
Mt(
|
|
3511
|
+
Mt(i("errorCreatingOrder") || "Failed to create order"), F();
|
|
3516
3512
|
return;
|
|
3517
3513
|
}
|
|
3518
|
-
},
|
|
3514
|
+
}, xt = lt({
|
|
3519
3515
|
type: "button",
|
|
3520
|
-
title:
|
|
3516
|
+
title: i("next"),
|
|
3521
3517
|
className: "wgt:text-text-primary wgt:bg-primary",
|
|
3522
3518
|
handleClick: async () => {
|
|
3523
|
-
const R =
|
|
3524
|
-
(
|
|
3525
|
-
),
|
|
3526
|
-
(
|
|
3519
|
+
const R = un().find(
|
|
3520
|
+
(en) => en._id === k
|
|
3521
|
+
), an = N.find(
|
|
3522
|
+
(en) => en._id === L
|
|
3527
3523
|
);
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
return;
|
|
3531
|
-
}
|
|
3532
|
-
let nn = null;
|
|
3533
|
-
!E && !R?.withoutInitialFee ? (nn = {
|
|
3524
|
+
let An = null;
|
|
3525
|
+
!E && !R?.withoutInitialFee ? (An = {
|
|
3534
3526
|
...X[0],
|
|
3535
3527
|
quantity: g
|
|
3536
|
-
}, c(
|
|
3537
|
-
let
|
|
3538
|
-
A(
|
|
3528
|
+
}, c(An)) : c(null);
|
|
3529
|
+
let nn = { ...R, quantity: m }, mn = an ? { ...an, quantity: p } : null;
|
|
3530
|
+
A(nn), u(mn), w(Q), v(), d && d({
|
|
3539
3531
|
qtyRegFee: g,
|
|
3540
3532
|
qtyInvoicePkg: m,
|
|
3541
3533
|
qtySignaturePkg: p
|
|
3542
|
-
}), await
|
|
3534
|
+
}), await Tt(
|
|
3535
|
+
An,
|
|
3543
3536
|
nn,
|
|
3544
3537
|
mn,
|
|
3545
|
-
en,
|
|
3546
3538
|
Q
|
|
3547
3539
|
);
|
|
3548
3540
|
}
|
|
3549
3541
|
});
|
|
3550
|
-
zn.appendChild(
|
|
3542
|
+
zn.appendChild(xt);
|
|
3551
3543
|
async function Ht() {
|
|
3552
3544
|
x?.eInvoiceRegistration?.businessType;
|
|
3553
|
-
const R = "ENTERPRISE",
|
|
3545
|
+
const R = "ENTERPRISE", an = {
|
|
3554
3546
|
bank: T,
|
|
3555
3547
|
hasRenew: E === !0,
|
|
3556
3548
|
isCashRegister: B,
|
|
@@ -3559,7 +3551,7 @@ async function La({
|
|
|
3559
3551
|
};
|
|
3560
3552
|
try {
|
|
3561
3553
|
const [
|
|
3562
|
-
|
|
3554
|
+
An,
|
|
3563
3555
|
nn,
|
|
3564
3556
|
mn,
|
|
3565
3557
|
en
|
|
@@ -3570,7 +3562,7 @@ async function La({
|
|
|
3570
3562
|
provider: r?.route
|
|
3571
3563
|
}),
|
|
3572
3564
|
Lh({ bank: T, provider: r?.route }),
|
|
3573
|
-
Ih(
|
|
3565
|
+
Ih(an),
|
|
3574
3566
|
E ? Promise.resolve([]) : bh({
|
|
3575
3567
|
bank: T,
|
|
3576
3568
|
provider: r?.route
|
|
@@ -3579,26 +3571,26 @@ async function La({
|
|
|
3579
3571
|
if (nn.status === "fulfilled" ? X = nn.value || [] : (console.error(
|
|
3580
3572
|
"Failed to load init packages:",
|
|
3581
3573
|
nn.reason
|
|
3582
|
-
),
|
|
3583
|
-
|
|
3584
|
-
), X = []),
|
|
3585
|
-
|
|
3586
|
-
id:
|
|
3587
|
-
name:
|
|
3588
|
-
nameEn:
|
|
3589
|
-
appliedPackages:
|
|
3590
|
-
code:
|
|
3591
|
-
limit:
|
|
3592
|
-
used:
|
|
3593
|
-
bank:
|
|
3594
|
-
isActive:
|
|
3595
|
-
type:
|
|
3596
|
-
expiredAt:
|
|
3574
|
+
), Nt.error(
|
|
3575
|
+
i("errorLoadingInitPackages") || "Failed to load registration packages"
|
|
3576
|
+
), X = []), An.status === "fulfilled" ? (An?.value?.length > 0 && An.value.forEach((cn) => {
|
|
3577
|
+
cn.codes.length > 0 && (G[cn.codes[0].code] = {
|
|
3578
|
+
id: cn.id,
|
|
3579
|
+
name: cn.name,
|
|
3580
|
+
nameEn: cn.nameEn,
|
|
3581
|
+
appliedPackages: cn.condition.packageCodes,
|
|
3582
|
+
code: cn.codes[0].code,
|
|
3583
|
+
limit: cn.codes[0].limit,
|
|
3584
|
+
used: cn.codes[0].used,
|
|
3585
|
+
bank: cn.campaign.bank,
|
|
3586
|
+
isActive: cn.isActive,
|
|
3587
|
+
type: cn.type,
|
|
3588
|
+
expiredAt: cn.toDate,
|
|
3597
3589
|
// isDisabled: false,
|
|
3598
3590
|
isHidden: !1,
|
|
3599
|
-
reward:
|
|
3591
|
+
reward: cn.reward
|
|
3600
3592
|
});
|
|
3601
|
-
}), Object.keys(G).length > 0 && (Q = q ? [...q] : [], ot())) : console.error("Failed to load promotions:",
|
|
3593
|
+
}), Object.keys(G).length > 0 && (Q = q ? [...q] : [], ot())) : console.error("Failed to load promotions:", An.reason), mn.status === "fulfilled") {
|
|
3602
3594
|
f = (E ? mn.value.filter((on) => on.renewPrice !== 0) : mn.value) || [];
|
|
3603
3595
|
const Z = f || [];
|
|
3604
3596
|
if (O(Z), Nn(Z), mn.value.length > 0) {
|
|
@@ -3610,20 +3602,20 @@ async function La({
|
|
|
3610
3602
|
console.error(
|
|
3611
3603
|
"Failed to load invoice packages:",
|
|
3612
3604
|
mn.reason
|
|
3613
|
-
),
|
|
3614
|
-
|
|
3605
|
+
), Nt.error(
|
|
3606
|
+
i("errorLoadingInvoicePackages") || "Failed to load invoice packages"
|
|
3615
3607
|
), O([]), f = [], bn();
|
|
3616
3608
|
if (en.status === "fulfilled")
|
|
3617
3609
|
if (N = en.value || [], N.length > 0) {
|
|
3618
|
-
const
|
|
3610
|
+
const cn = N.find(
|
|
3619
3611
|
(Z) => W.includes(Z.code)
|
|
3620
3612
|
);
|
|
3621
|
-
E ? L = h && N.find((on) => on._id === h._id) ? h._id : null : L = h && N.find((on) => on._id === h._id) ? h._id :
|
|
3613
|
+
E ? L = h && N.find((on) => on._id === h._id) ? h._id : null : L = h && N.find((on) => on._id === h._id) ? h._id : cn ? cn._id : null;
|
|
3622
3614
|
} else
|
|
3623
3615
|
N = [];
|
|
3624
3616
|
Pt();
|
|
3625
|
-
} catch (
|
|
3626
|
-
console.error("Unexpected error during data loading:",
|
|
3617
|
+
} catch (An) {
|
|
3618
|
+
console.error("Unexpected error during data loading:", An), Nt.error(i("errorLoadingData") || "Failed to load data", {
|
|
3627
3619
|
autoClose: 5e3,
|
|
3628
3620
|
closeButton: !0,
|
|
3629
3621
|
icon: !0
|
|
@@ -3631,72 +3623,72 @@ async function La({
|
|
|
3631
3623
|
}
|
|
3632
3624
|
}
|
|
3633
3625
|
function Pt() {
|
|
3634
|
-
ct(), kt(), E ||
|
|
3626
|
+
ct(), kt(), E || pt(), Zn(), Un(), Xn();
|
|
3635
3627
|
}
|
|
3636
|
-
function
|
|
3628
|
+
function dt(R, an, An) {
|
|
3637
3629
|
const nn = Object.values(G).find(
|
|
3638
3630
|
(Z) => Z.bank === T && Z.appliedPackages.includes(R)
|
|
3639
3631
|
), mn = W.includes(R) || nn && !nn.isHidden && !(nn.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && nn.limit !== nn.used, en = Object.values(G).find(
|
|
3640
|
-
(Z) => Z.bank === T && Z.appliedPackages.includes(
|
|
3641
|
-
),
|
|
3642
|
-
if (mn && !
|
|
3643
|
-
const { container: Z, open: on } =
|
|
3644
|
-
message:
|
|
3645
|
-
description:
|
|
3646
|
-
okLabel:
|
|
3647
|
-
cancelLabel:
|
|
3648
|
-
onClose:
|
|
3632
|
+
(Z) => Z.bank === T && Z.appliedPackages.includes(an)
|
|
3633
|
+
), cn = W.includes(an) || en && !en.isHidden && !(en.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && en.limit !== en.used && en.isActive;
|
|
3634
|
+
if (mn && !cn) {
|
|
3635
|
+
const { container: Z, open: on } = Bt({
|
|
3636
|
+
message: i("errorDiscountPackage"),
|
|
3637
|
+
description: i("errorDiscountPackageDes"),
|
|
3638
|
+
okLabel: i("ok"),
|
|
3639
|
+
cancelLabel: i("cancel"),
|
|
3640
|
+
onClose: An,
|
|
3649
3641
|
isWarning: !0,
|
|
3650
3642
|
isSuccess: !1,
|
|
3651
3643
|
theme: T
|
|
3652
3644
|
});
|
|
3653
3645
|
D.appendChild(Z), on();
|
|
3654
3646
|
} else
|
|
3655
|
-
|
|
3647
|
+
An();
|
|
3656
3648
|
}
|
|
3657
|
-
let
|
|
3649
|
+
let wt = null;
|
|
3658
3650
|
function kt() {
|
|
3659
3651
|
if (K.innerHTML = "", Pn().length > 0)
|
|
3660
|
-
|
|
3652
|
+
wt = k0({
|
|
3661
3653
|
type: "service",
|
|
3662
3654
|
packageOptions: Pn(),
|
|
3663
3655
|
disCountedPackages: W,
|
|
3664
|
-
promotion:
|
|
3656
|
+
promotion: i("discount"),
|
|
3665
3657
|
selectedPackageId: k,
|
|
3666
3658
|
isRenew: E,
|
|
3667
3659
|
handlePackageSelect: (R) => {
|
|
3668
|
-
let
|
|
3660
|
+
let an = un().find(
|
|
3669
3661
|
(nn) => nn._id === k
|
|
3670
|
-
)?.code,
|
|
3671
|
-
|
|
3672
|
-
k = R,
|
|
3662
|
+
)?.code, An = un().find((nn) => nn._id === R)?.code;
|
|
3663
|
+
dt(an, An, () => {
|
|
3664
|
+
k = R, wt.setSelectedPackageId(R), ct(), Zn(), Un(), Xn();
|
|
3673
3665
|
});
|
|
3674
3666
|
}
|
|
3675
|
-
}), K.appendChild(
|
|
3667
|
+
}), K.appendChild(wt.container);
|
|
3676
3668
|
else {
|
|
3677
3669
|
const R = document.createElement("span");
|
|
3678
|
-
R.className = "wgt:text-text-sub-600", R.innerText =
|
|
3670
|
+
R.className = "wgt:text-text-sub-600", R.innerText = i("noPackageFound"), K.appendChild(R), wt = null;
|
|
3679
3671
|
}
|
|
3680
3672
|
}
|
|
3681
3673
|
let ut = null;
|
|
3682
|
-
function
|
|
3674
|
+
function pt() {
|
|
3683
3675
|
E || fn && (fn.innerHTML = "", N.length > 0 ? (ut = k0({
|
|
3684
3676
|
type: "signature",
|
|
3685
3677
|
packageOptions: N.filter((R) => !R.isBonusPackage),
|
|
3686
3678
|
disCountedPackages: W,
|
|
3687
|
-
promotion:
|
|
3679
|
+
promotion: i("gift"),
|
|
3688
3680
|
selectedPackageId: L,
|
|
3689
|
-
allowDeselect:
|
|
3681
|
+
allowDeselect: !0,
|
|
3690
3682
|
handlePackageSelect: (R) => {
|
|
3691
|
-
let
|
|
3683
|
+
let an = N.find(
|
|
3692
3684
|
(nn) => nn._id === L
|
|
3693
|
-
)?.code,
|
|
3685
|
+
)?.code, An = N.find((nn) => nn._id === R)?.code;
|
|
3694
3686
|
if (E && L === R) {
|
|
3695
3687
|
L = null, ut.setSelectedPackageId(null), ct(), Zn(), Un(), Xn();
|
|
3696
3688
|
return;
|
|
3697
3689
|
}
|
|
3698
|
-
|
|
3699
|
-
L = R, ut.setSelectedPackageId(R), Nn(
|
|
3690
|
+
dt(an, An, () => {
|
|
3691
|
+
L = R, ut.setSelectedPackageId(R), Nn(un()), ct(), Zn(), Un(), Xn();
|
|
3700
3692
|
});
|
|
3701
3693
|
}
|
|
3702
3694
|
}), fn.appendChild(ut.container)) : (ut = null, Mn && (Mn.style.display = "none")));
|
|
@@ -3705,32 +3697,32 @@ async function La({
|
|
|
3705
3697
|
ht.className = "wgt:w-full", U.appendChild(ht);
|
|
3706
3698
|
function Zn() {
|
|
3707
3699
|
if (jn.remove(), ht.innerHTML = "", E) return;
|
|
3708
|
-
const R =
|
|
3709
|
-
(
|
|
3700
|
+
const R = un().find(
|
|
3701
|
+
(an) => an._id === k
|
|
3710
3702
|
);
|
|
3711
3703
|
if (X.length > 0) {
|
|
3712
|
-
const { container:
|
|
3704
|
+
const { container: an } = Na({
|
|
3713
3705
|
name: "registrationFee",
|
|
3714
3706
|
value: "standard",
|
|
3715
|
-
feeLabel: `${
|
|
3707
|
+
feeLabel: `${i("registrationFee")}: ${kn(
|
|
3716
3708
|
X[0].price
|
|
3717
3709
|
)} VND`,
|
|
3718
3710
|
required: !0,
|
|
3719
3711
|
description: X[0][Qt(st())],
|
|
3720
3712
|
isChecked: !E && !R?.withoutInitialFee
|
|
3721
3713
|
});
|
|
3722
|
-
ht.appendChild(
|
|
3714
|
+
ht.appendChild(an);
|
|
3723
3715
|
}
|
|
3724
3716
|
}
|
|
3725
3717
|
const Kn = document.createElement("div");
|
|
3726
3718
|
Kn.className = "promotion-wrapper wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
|
|
3727
3719
|
function ct() {
|
|
3728
|
-
const R =
|
|
3720
|
+
const R = un().find(
|
|
3729
3721
|
(mn) => mn._id === k
|
|
3730
|
-
),
|
|
3722
|
+
), an = N.find(
|
|
3731
3723
|
(mn) => mn._id === L
|
|
3732
|
-
),
|
|
3733
|
-
R?.code && nn.push(R.code),
|
|
3724
|
+
), An = !E && X?.length > 0 && !R?.withoutInitialFee, nn = [];
|
|
3725
|
+
R?.code && nn.push(R.code), an?.code && nn.push(an.code), An && nn.push("INITIAL_FEE"), Object.keys(G).forEach((mn) => {
|
|
3734
3726
|
const en = G[mn];
|
|
3735
3727
|
if (en.bank !== T) {
|
|
3736
3728
|
en.isHidden = !0, Q = Q.filter(
|
|
@@ -3738,9 +3730,9 @@ async function La({
|
|
|
3738
3730
|
);
|
|
3739
3731
|
return;
|
|
3740
3732
|
}
|
|
3741
|
-
const
|
|
3733
|
+
const cn = en.expiredAt < (/* @__PURE__ */ new Date()).toISOString(), Z = en.limit <= en.used, on = !en.isActive, rn = en.appliedPackages?.some(
|
|
3742
3734
|
(Qn) => nn.includes(Qn)
|
|
3743
|
-
) && !
|
|
3735
|
+
) && !cn && !Z && !on;
|
|
3744
3736
|
en.isHidden = !rn, rn ? Q.includes(en.code) || Q.push(en.code) : Q = Q.filter(
|
|
3745
3737
|
(Qn) => Qn !== en.code
|
|
3746
3738
|
);
|
|
@@ -3750,7 +3742,7 @@ async function La({
|
|
|
3750
3742
|
W = [
|
|
3751
3743
|
...new Set(
|
|
3752
3744
|
Object.values(G).filter((R) => (R.bank || "").toLowerCase() === (T || "").toLowerCase()).flatMap(
|
|
3753
|
-
(R) => (R.appliedPackages || []).filter((
|
|
3745
|
+
(R) => (R.appliedPackages || []).filter((an) => an !== "INITIAL_FEE")
|
|
3754
3746
|
)
|
|
3755
3747
|
)
|
|
3756
3748
|
];
|
|
@@ -3763,12 +3755,12 @@ async function La({
|
|
|
3763
3755
|
return;
|
|
3764
3756
|
}
|
|
3765
3757
|
Kn.innerHTML = "";
|
|
3766
|
-
const
|
|
3767
|
-
|
|
3768
|
-
const
|
|
3769
|
-
|
|
3758
|
+
const an = document.createElement("h3");
|
|
3759
|
+
an.className = "wgt:text-xl wgt:font-bold wgt:text-strong-950", an.innerText = i("applyPromotion"), Kn.appendChild(an), U.appendChild(Kn);
|
|
3760
|
+
const An = document.createElement("div");
|
|
3761
|
+
An.className = "wgt:w-full wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";
|
|
3770
3762
|
const nn = document.createElement("div");
|
|
3771
|
-
nn.className = "wgt:flex wgt:min-w-[500px] wgt:h-11 wgt:items-center wgt:gap-3 wgt:px-3 wgt:py-2 wgt:rounded-lg wgt:bg-white wgt:border wgt:border-[#E4E7EC] wgt:@max-2xl:min-w-full wgt:@max-2xl:flex-wrap wgt:@max-2xl:h-fit",
|
|
3763
|
+
nn.className = "wgt:flex wgt:min-w-[500px] wgt:h-11 wgt:items-center wgt:gap-3 wgt:px-3 wgt:py-2 wgt:rounded-lg wgt:bg-white wgt:border wgt:border-[#E4E7EC] wgt:@max-2xl:min-w-full wgt:@max-2xl:flex-wrap wgt:@max-2xl:h-fit", An.appendChild(nn), Q && Q.length > 0 && Q.filter((on) => {
|
|
3772
3764
|
const gn = Object.values(G).find(
|
|
3773
3765
|
(rn) => rn.code === on
|
|
3774
3766
|
);
|
|
@@ -3776,7 +3768,7 @@ async function La({
|
|
|
3776
3768
|
}).forEach((on) => {
|
|
3777
3769
|
const gn = document.createElement("div");
|
|
3778
3770
|
gn.className = "wgt:flex wgt:w-fit wgt:h-fit wgt:items-center wgt:gap-2 wgt:px-2 wgt:py-1.5 wgt:rounded-md wgt:bg-primary/10 wgt:border wgt:border-primary wgt:text-sm wgt:font-medium wgt:text-primary", gn.innerText = on;
|
|
3779
|
-
const rn =
|
|
3771
|
+
const rn = lt({
|
|
3780
3772
|
type: "button",
|
|
3781
3773
|
title: "x",
|
|
3782
3774
|
handleClick: () => {
|
|
@@ -3791,19 +3783,19 @@ async function La({
|
|
|
3791
3783
|
</svg>
|
|
3792
3784
|
`, gn.appendChild(rn), nn.appendChild(gn);
|
|
3793
3785
|
});
|
|
3794
|
-
const mn =
|
|
3786
|
+
const mn = lt({
|
|
3795
3787
|
type: "button",
|
|
3796
|
-
title:
|
|
3788
|
+
title: i("apply"),
|
|
3797
3789
|
className: "wgt:text-white wgt:bg-primary",
|
|
3798
3790
|
handleClick: () => {
|
|
3799
3791
|
}
|
|
3800
3792
|
});
|
|
3801
|
-
|
|
3793
|
+
An.appendChild(mn), Kn.appendChild(An);
|
|
3802
3794
|
const en = document.createElement("div");
|
|
3803
3795
|
en.className = "wgt:w-full wgt:grid wgt:grid-cols-3 wgt:gap-4 wgt:@max-2xl:flex wgt:@max-2xl:flex-col", Kn.appendChild(en);
|
|
3804
|
-
const
|
|
3805
|
-
if (
|
|
3806
|
-
|
|
3796
|
+
const cn = Object.values(G).filter((Z) => Z.bank === T).filter((Z) => !Z.isHidden);
|
|
3797
|
+
if (cn.length > 0)
|
|
3798
|
+
cn.forEach((Z) => {
|
|
3807
3799
|
Q.includes(Z.code);
|
|
3808
3800
|
const { container: on } = Ea({
|
|
3809
3801
|
promotion: {
|
|
@@ -3823,43 +3815,43 @@ async function La({
|
|
|
3823
3815
|
});
|
|
3824
3816
|
else {
|
|
3825
3817
|
const Z = document.createElement("span");
|
|
3826
|
-
Z.className = "wgt:text-text-sub-600", Z.innerText =
|
|
3818
|
+
Z.className = "wgt:text-text-sub-600", Z.innerText = i("noPromotionFound"), Kn.appendChild(Z);
|
|
3827
3819
|
}
|
|
3828
3820
|
}
|
|
3829
3821
|
function Xn() {
|
|
3830
|
-
if (v(), En.innerHTML = "", U.appendChild(at), U.appendChild(Vn), U.appendChild(Gn),
|
|
3822
|
+
if (v(), En.innerHTML = "", U.appendChild(at), U.appendChild(Vn), U.appendChild(Gn), un().length === 0 && N.length === 0) {
|
|
3831
3823
|
const z = document.createElement("tr");
|
|
3832
3824
|
z.innerHTML = `
|
|
3833
3825
|
<td colspan="5" class="wgt:px-3 wgt:py-8 wgt:text-center wgt:text-text-sub-600 wgt:@max-2xl:col-span-5">
|
|
3834
|
-
${
|
|
3826
|
+
${i("noDataAvailable") || "No data available"}
|
|
3835
3827
|
</td>
|
|
3836
|
-
`, En.appendChild(z),
|
|
3828
|
+
`, En.appendChild(z), s(0);
|
|
3837
3829
|
return;
|
|
3838
3830
|
}
|
|
3839
|
-
const R =
|
|
3831
|
+
const R = un().find(
|
|
3840
3832
|
(z) => z._id === k
|
|
3841
3833
|
);
|
|
3842
3834
|
if (!E && X?.length > 0 && !R?.withoutInitialFee) {
|
|
3843
3835
|
const z = document.createElement("tr");
|
|
3844
3836
|
z.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";
|
|
3845
|
-
const
|
|
3846
|
-
|
|
3837
|
+
const tn = document.createElement("td");
|
|
3838
|
+
tn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:col-span-2 wgt:@max-2xl:block wgt:@max-2xl:px-0 wgt:@max-2xl:py-2 wgt:@max-2xl:text-base wgt:@max-2xl:font-semibold", tn.innerText = st() === "vi" ? X[0].name : X[0].nameEn, z.appendChild(tn);
|
|
3847
3839
|
const sn = document.createElement("td");
|
|
3848
|
-
sn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", sn.innerText =
|
|
3840
|
+
sn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", sn.innerText = i("package"), z.appendChild(sn);
|
|
3849
3841
|
const Ln = document.createElement("td");
|
|
3850
3842
|
Ln.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-2.5 wgt:text-center wgt:@max-2xl:col-span-2 wgt:@max-2xl:block wgt:@max-2xl:px-0 wgt:@max-2xl:py-2";
|
|
3851
3843
|
const Tn = document.createElement("div");
|
|
3852
3844
|
Tn.className = "wgt:w-full wgt:justify-between wgt:inline-flex wgt:items-center wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:@max-2xl:w-full wgt:@max-2xl:max-w-[200px] wgt:@max-2xl:mx-auto";
|
|
3853
3845
|
const xn = document.createElement("button");
|
|
3854
|
-
xn.type = "button", xn.ariaLabel =
|
|
3846
|
+
xn.type = "button", xn.ariaLabel = i("decrease"), xn.disabled = !0, xn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:cursor-not-allowed wgt:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", xn.innerText = "–", xn.addEventListener("click", () => {
|
|
3855
3847
|
g > 1 && (g -= 1, Xn());
|
|
3856
3848
|
}), Tn.appendChild(xn);
|
|
3857
3849
|
const dn = document.createElement("span");
|
|
3858
3850
|
dn.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", dn.innerText = g, Tn.appendChild(dn);
|
|
3859
|
-
const
|
|
3860
|
-
|
|
3851
|
+
const hn = document.createElement("button");
|
|
3852
|
+
hn.type = "button", hn.ariaLabel = i("increase"), hn.disabled = !0, hn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:cursor-not-allowed wgt:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", hn.innerText = "+", hn.addEventListener("click", () => {
|
|
3861
3853
|
g += 1, Xn();
|
|
3862
|
-
}), Tn.appendChild(
|
|
3854
|
+
}), Tn.appendChild(hn), Ln.appendChild(Tn), z.appendChild(Ln);
|
|
3863
3855
|
const pn = document.createElement("td");
|
|
3864
3856
|
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 = kn(X[0]?.price) + " VND", z.appendChild(pn);
|
|
3865
3857
|
const Hn = document.createElement("td");
|
|
@@ -3867,142 +3859,142 @@ async function La({
|
|
|
3867
3859
|
const V = document.createElement("div");
|
|
3868
3860
|
V.className = "wgt:hidden wgt:@max-2xl:flex wgt:flex-col wgt:gap-1 wgt:mt-2 wgt:pt-2 wgt:border-t wgt:border-soft-200", V.innerHTML = `
|
|
3869
3861
|
<div class="wgt:flex wgt:justify-between wgt:text-sm wgt:text-text-sub-600">
|
|
3870
|
-
<span>${
|
|
3862
|
+
<span>${i("unitPrice")}:</span>
|
|
3871
3863
|
<span class="wgt:font-medium">${kn(
|
|
3872
3864
|
X[0]?.price
|
|
3873
3865
|
)} VND</span>
|
|
3874
3866
|
</div>
|
|
3875
3867
|
<div class="wgt:flex wgt:justify-between wgt:text-base wgt:font-semibold wgt:text-strong-950">
|
|
3876
|
-
<span>${
|
|
3868
|
+
<span>${i("total")}:</span>
|
|
3877
3869
|
<span class="wgt:text-primary">${kn(
|
|
3878
3870
|
X[0]?.price * g
|
|
3879
3871
|
)} VND</span>
|
|
3880
3872
|
</div>
|
|
3881
|
-
`,
|
|
3873
|
+
`, tn.appendChild(V), En.appendChild(z);
|
|
3882
3874
|
}
|
|
3883
3875
|
{
|
|
3884
3876
|
const z = Sn(k);
|
|
3885
3877
|
if (z) {
|
|
3886
|
-
const
|
|
3887
|
-
|
|
3878
|
+
const tn = document.createElement("tr");
|
|
3879
|
+
tn.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";
|
|
3888
3880
|
const sn = document.createElement("td");
|
|
3889
|
-
sn.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:col-span-2 wgt:@max-2xl:block wgt:@max-2xl:px-0 wgt:@max-2xl:py-2 wgt:@max-2xl:text-base wgt:@max-2xl:font-semibold", sn.innerText = z[Qt(st())],
|
|
3881
|
+
sn.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:col-span-2 wgt:@max-2xl:block wgt:@max-2xl:px-0 wgt:@max-2xl:py-2 wgt:@max-2xl:text-base wgt:@max-2xl:font-semibold", sn.innerText = z[Qt(st())], tn.appendChild(sn);
|
|
3890
3882
|
const Ln = document.createElement("td");
|
|
3891
|
-
Ln.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", Ln.innerText =
|
|
3883
|
+
Ln.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", Ln.innerText = i("package"), tn.appendChild(Ln);
|
|
3892
3884
|
const Tn = document.createElement("td");
|
|
3893
3885
|
Tn.className = "wgt:whitespace-nowrap wgt:px-4 wgt:py-3 wgt:text-center wgt:@max-2xl:col-span-2 wgt:@max-2xl:block wgt:@max-2xl:px-0 wgt:@max-2xl:py-2";
|
|
3894
3886
|
const xn = document.createElement("div");
|
|
3895
3887
|
xn.className = "wgt:w-full wgt:justify-between wgt:inline-flex wgt:items-center wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:@max-2xl:w-full wgt:@max-2xl:max-w-[200px] wgt:@max-2xl:mx-auto";
|
|
3896
3888
|
const dn = document.createElement("button");
|
|
3897
|
-
dn.type = "button", dn.ariaLabel =
|
|
3898
|
-
const
|
|
3899
|
-
dn.disabled = m <= 1 ||
|
|
3889
|
+
dn.type = "button", dn.ariaLabel = i("decrease");
|
|
3890
|
+
const hn = I ? z?.price ?? 0 : z?.renewPrice ?? 0;
|
|
3891
|
+
dn.disabled = m <= 1 || hn === 0, dn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:disabled:cursor-not-allowed wgt:disabled:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", dn.innerText = "–", dn.addEventListener("click", () => {
|
|
3900
3892
|
m > 1 && (m -= 1, Xn());
|
|
3901
3893
|
}), xn.appendChild(dn);
|
|
3902
3894
|
const pn = document.createElement("span");
|
|
3903
|
-
pn.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", pn.innerText =
|
|
3895
|
+
pn.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", pn.innerText = hn === 0 ? 1 : m, xn.appendChild(pn);
|
|
3904
3896
|
const Hn = document.createElement("button");
|
|
3905
|
-
Hn.type = "button", Hn.ariaLabel =
|
|
3906
|
-
|
|
3907
|
-
}), xn.appendChild(Hn), Tn.appendChild(xn),
|
|
3897
|
+
Hn.type = "button", Hn.ariaLabel = i("increase"), Hn.disabled = z?.price === 0, Hn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:disabled:cursor-not-allowed wgt:disabled:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", Hn.innerText = "+", Hn.addEventListener("click", () => {
|
|
3898
|
+
hn !== 0 && (m += 1, Xn());
|
|
3899
|
+
}), xn.appendChild(Hn), Tn.appendChild(xn), tn.appendChild(Tn);
|
|
3908
3900
|
const V = document.createElement("td");
|
|
3909
|
-
V.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", V.innerText = kn(
|
|
3901
|
+
V.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", V.innerText = kn(hn * z?.limit) + " VND", tn.appendChild(V);
|
|
3910
3902
|
const S = document.createElement("td");
|
|
3911
|
-
S.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", S.innerText = kn(
|
|
3903
|
+
S.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", S.innerText = kn(hn * z?.limit * m) + " VND", tn.appendChild(S);
|
|
3912
3904
|
const _ = document.createElement("div");
|
|
3913
3905
|
_.className = "wgt:hidden wgt:@max-2xl:flex wgt:flex-col wgt:gap-1 wgt:mt-2 wgt:pt-2 wgt:border-t wgt:border-soft-200", _.innerHTML = `
|
|
3914
3906
|
<div class="wgt:flex wgt:justify-between wgt:text-sm wgt:text-text-sub-600">
|
|
3915
|
-
<span>${
|
|
3907
|
+
<span>${i("unitPrice")}:</span>
|
|
3916
3908
|
<span class="wgt:font-medium">${kn(
|
|
3917
|
-
|
|
3909
|
+
hn * z?.limit
|
|
3918
3910
|
)} VND</span>
|
|
3919
3911
|
</div>
|
|
3920
3912
|
<div class="wgt:flex wgt:justify-between wgt:text-base wgt:font-semibold wgt:text-strong-950">
|
|
3921
|
-
<span>${
|
|
3913
|
+
<span>${i("total")}:</span>
|
|
3922
3914
|
<span class="wgt:text-primary">${kn(
|
|
3923
|
-
|
|
3915
|
+
hn * z?.limit * m
|
|
3924
3916
|
)} VND</span>
|
|
3925
3917
|
</div>
|
|
3926
|
-
`, sn.appendChild(_), En.appendChild(
|
|
3918
|
+
`, sn.appendChild(_), En.appendChild(tn);
|
|
3927
3919
|
}
|
|
3928
3920
|
}
|
|
3929
3921
|
{
|
|
3930
3922
|
const z = M(L);
|
|
3931
3923
|
if (z) {
|
|
3932
|
-
const
|
|
3933
|
-
|
|
3924
|
+
const tn = document.createElement("tr");
|
|
3925
|
+
tn.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";
|
|
3934
3926
|
const sn = document.createElement("td");
|
|
3935
3927
|
sn.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:col-span-2 wgt:@max-2xl:block wgt:@max-2xl:px-0 wgt:@max-2xl:py-2 wgt:@max-2xl:text-base wgt:@max-2xl:font-semibold", sn.innerText = z[Qt(st())], // getCurrentLanguage() === "vi" ? sigPkg?.name : sigPkg?.nameEn;
|
|
3936
|
-
|
|
3928
|
+
tn.appendChild(sn);
|
|
3937
3929
|
const Ln = document.createElement("td");
|
|
3938
|
-
Ln.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", Ln.innerText =
|
|
3930
|
+
Ln.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", Ln.innerText = i("package"), tn.appendChild(Ln);
|
|
3939
3931
|
const Tn = document.createElement("td");
|
|
3940
3932
|
Tn.className = "wgt:whitespace-nowrap wgt:px-4 wgt:py-3 wgt:text-center wgt:@max-2xl:col-span-2 wgt:@max-2xl:block wgt:@max-2xl:px-0 wgt:@max-2xl:py-2";
|
|
3941
3933
|
const xn = document.createElement("div");
|
|
3942
3934
|
xn.className = "wgt:w-full wgt:justify-between wgt:inline-flex wgt:items-center wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:@max-2xl:w-full wgt:@max-2xl:max-w-[200px] wgt:@max-2xl:mx-auto";
|
|
3943
3935
|
const dn = document.createElement("button");
|
|
3944
|
-
dn.type = "button", dn.ariaLabel =
|
|
3936
|
+
dn.type = "button", dn.ariaLabel = i("decrease"), dn.disabled = p <= 1, dn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold" + (p <= 1 ? " wgt:cursor-not-allowed wgt:opacity-50" : ""), dn.innerText = "–", dn.addEventListener("click", () => {
|
|
3945
3937
|
p > 1 && (p -= 1, Xn());
|
|
3946
3938
|
}), xn.appendChild(dn);
|
|
3947
|
-
const
|
|
3948
|
-
|
|
3939
|
+
const hn = document.createElement("span");
|
|
3940
|
+
hn.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", hn.innerText = p, xn.appendChild(hn);
|
|
3949
3941
|
const pn = document.createElement("button");
|
|
3950
|
-
pn.type = "button", pn.ariaLabel =
|
|
3942
|
+
pn.type = "button", pn.ariaLabel = i("increase"), pn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", pn.innerText = "+", pn.addEventListener("click", () => {
|
|
3951
3943
|
p += 1, Xn();
|
|
3952
|
-
}), xn.appendChild(pn), Tn.appendChild(xn),
|
|
3944
|
+
}), xn.appendChild(pn), Tn.appendChild(xn), tn.appendChild(Tn);
|
|
3953
3945
|
const Hn = document.createElement("td");
|
|
3954
|
-
Hn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", Hn.innerText = kn(z?.limit * z?.price) + " VND",
|
|
3946
|
+
Hn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", Hn.innerText = kn(z?.limit * z?.price) + " VND", tn.appendChild(Hn);
|
|
3955
3947
|
const V = document.createElement("td");
|
|
3956
|
-
V.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", V.innerText = kn(z?.limit * z?.price * p) + " VND",
|
|
3948
|
+
V.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", V.innerText = kn(z?.limit * z?.price * p) + " VND", tn.appendChild(V);
|
|
3957
3949
|
const S = document.createElement("div");
|
|
3958
3950
|
S.className = "wgt:hidden wgt:@max-2xl:flex wgt:flex-col wgt:gap-1 wgt:mt-2 wgt:pt-2 wgt:border-t wgt:border-soft-200", S.innerHTML = `
|
|
3959
3951
|
<div class="wgt:flex wgt:justify-between wgt:text-sm wgt:text-text-sub-600">
|
|
3960
|
-
<span>${
|
|
3952
|
+
<span>${i("unitPrice")}:</span>
|
|
3961
3953
|
<span class="wgt:font-medium">${kn(
|
|
3962
3954
|
z?.limit * z?.price
|
|
3963
3955
|
)} VND</span>
|
|
3964
3956
|
</div>
|
|
3965
3957
|
<div class="wgt:flex wgt:justify-between wgt:text-base wgt:font-semibold wgt:text-strong-950">
|
|
3966
|
-
<span>${
|
|
3958
|
+
<span>${i("total")}:</span>
|
|
3967
3959
|
<span class="wgt:text-primary">${kn(
|
|
3968
3960
|
z?.limit * z?.price * p
|
|
3969
3961
|
)} VND</span>
|
|
3970
3962
|
</div>
|
|
3971
|
-
`, sn.appendChild(S), En.appendChild(
|
|
3963
|
+
`, sn.appendChild(S), En.appendChild(tn);
|
|
3972
3964
|
}
|
|
3973
3965
|
}
|
|
3974
|
-
const
|
|
3966
|
+
const an = Q.map(
|
|
3975
3967
|
(z) => Object.values(G).find(
|
|
3976
|
-
(
|
|
3968
|
+
(tn) => tn.code === z && tn.bank === T
|
|
3977
3969
|
)
|
|
3978
3970
|
).filter((z) => z !== void 0);
|
|
3979
|
-
let
|
|
3980
|
-
|
|
3981
|
-
const
|
|
3982
|
-
|
|
3971
|
+
let An = 0;
|
|
3972
|
+
an.length > 0 && an.forEach((z) => {
|
|
3973
|
+
const tn = document.createElement("tr");
|
|
3974
|
+
tn.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";
|
|
3983
3975
|
const sn = document.createElement("td");
|
|
3984
3976
|
sn.colSpan = 3, sn.className = "wgt:px-3 wgt:py-2 wgt:text-sm wgt:col-span-3 wgt:@max-2xl:col-span-5 wgt:@max-2xl:block wgt:@max-2xl:px-0 wgt:@max-2xl:py-1", sn.innerHTML = `
|
|
3985
3977
|
<div class="wgt:flex wgt:flex-row wgt:items-center wgt:gap-2 wgt:@max-2xl:justify-start">
|
|
3986
3978
|
<img src="${Qa}" alt="ticket" class="wgt:w-4 wgt:@max-2xl:w-5">
|
|
3987
3979
|
<span class="wgt:text-text-sub-600 wgt:@max-2xl:text-sm wgt:@max-2xl:font-medium">${z[Qt(st())] || z?.code}</span>
|
|
3988
3980
|
</div>
|
|
3989
|
-
`,
|
|
3981
|
+
`, tn.appendChild(sn);
|
|
3990
3982
|
const Ln = document.createElement("td");
|
|
3991
|
-
Ln.className = "wgt:@max-2xl:hidden",
|
|
3983
|
+
Ln.className = "wgt:@max-2xl:hidden", tn.appendChild(Ln);
|
|
3992
3984
|
const Tn = document.createElement("td");
|
|
3993
3985
|
Tn.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", z.type === "discount" ? (Tn.innerText = `-${kn(
|
|
3994
3986
|
z?.reward?.discountAmount
|
|
3995
|
-
)} VND`, Tn.style.color = "#F04438",
|
|
3987
|
+
)} VND`, Tn.style.color = "#F04438", An += z?.reward?.discountAmount) : z?.type === "free_item" ? (Tn.innerText = `+${z?.reward?.packageCodes?.length} ${i(
|
|
3996
3988
|
"package"
|
|
3997
|
-
)} ${z?.reward?.packageCodes?.join(", ")}`, Tn.style.color = "#12B76A") : Tn.innerText = "",
|
|
3989
|
+
)} ${z?.reward?.packageCodes?.join(", ")}`, Tn.style.color = "#12B76A") : Tn.innerText = "", tn.appendChild(Tn), En.appendChild(tn);
|
|
3998
3990
|
});
|
|
3999
|
-
const nn = !E && X.length > 0 && !R?.withoutInitialFee ? X[0]?.price * g : 0, mn = Sn(k), en = mn ? E ? mn.renewPrice ?? 0 : mn.price ?? 0 : 0,
|
|
4000
|
-
|
|
3991
|
+
const nn = !E && X.length > 0 && !R?.withoutInitialFee ? X[0]?.price * g : 0, mn = Sn(k), en = mn ? E ? mn.renewPrice ?? 0 : mn.price ?? 0 : 0, cn = mn ? en * mn.limit * m : 0, Z = M(L), on = Z ? Z.price * Z.limit * p : 0, gn = nn + cn + on, rn = Math.min(An, gn), Qn = Math.max(gn - rn, 0);
|
|
3992
|
+
s(Qn);
|
|
4001
3993
|
{
|
|
4002
3994
|
const z = document.createElement("tr");
|
|
4003
3995
|
z.className = "wgt:@max-2xl:hidden";
|
|
4004
|
-
const
|
|
4005
|
-
|
|
3996
|
+
const tn = document.createElement("td");
|
|
3997
|
+
tn.colSpan = 4, tn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-base wgt:font-semibold wgt:text-strong-950 wgt:col-span-4", tn.innerText = i("total"), z.appendChild(tn);
|
|
4006
3998
|
const sn = document.createElement("td");
|
|
4007
3999
|
sn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-base wgt:font-semibold wgt:text-strong-950", sn.innerText = kn(Qn) + " VND", z.appendChild(sn), En.appendChild(z);
|
|
4008
4000
|
}
|
|
@@ -4021,10 +4013,10 @@ function Ia({
|
|
|
4021
4013
|
illustrationSrc: u = "",
|
|
4022
4014
|
theme: o = "ocb"
|
|
4023
4015
|
} = {}) {
|
|
4024
|
-
const
|
|
4025
|
-
|
|
4016
|
+
const s = document.createElement("div");
|
|
4017
|
+
s.className = "wgt:flex wgt:flex-col wgt:@min-2xl:flex-row wgt:gap-6 wgt:p-6 wgt:bg-gray-50 wgt:rounded-xl";
|
|
4026
4018
|
const l = document.createElement("div"), T = document.createElement("h3");
|
|
4027
|
-
T.className = "wgt:text-sm wgt:font-bold wgt:text-text-black wgt:mb-4 wgt:text-center", T.innerText =
|
|
4019
|
+
T.className = "wgt:text-sm wgt:font-bold wgt:text-text-black wgt:mb-4 wgt:text-center", T.innerText = i("qrPaymentTitle"), l.appendChild(T);
|
|
4028
4020
|
const r = document.createElement("div");
|
|
4029
4021
|
r.className = "wgt:bg-white wgt:rounded-md wgt:p-6 wgt:flex wgt:flex-col wgt:gap-3 wgt:border wgt:border-[#E4E7EC]";
|
|
4030
4022
|
const q = document.createElement("div");
|
|
@@ -4046,17 +4038,17 @@ function Ia({
|
|
|
4046
4038
|
const I = document.createElement("h3");
|
|
4047
4039
|
I.className = "wgt:text-lg wgt:font-bold wgt:text-text-black", I.innerText = a, y.appendChild(I);
|
|
4048
4040
|
const C = document.createElement("p");
|
|
4049
|
-
C.className = "wgt:text-sm wgt:text-grey-8", C.innerHTML = `${
|
|
4041
|
+
C.className = "wgt:text-sm wgt:text-grey-8", C.innerHTML = `${i(
|
|
4050
4042
|
"accountNumber"
|
|
4051
4043
|
)}: <span class="wgt:font-medium">${h}</span>`, y.appendChild(C);
|
|
4052
4044
|
const d = document.createElement("p");
|
|
4053
|
-
d.className = "wgt:text-sm wgt:text-grey-8", d.innerHTML = `${
|
|
4045
|
+
d.className = "wgt:text-sm wgt:text-grey-8", d.innerHTML = `${i(
|
|
4054
4046
|
"beneficiaryBank"
|
|
4055
|
-
)}: <span class="wgt:font-medium">${c}</span>`, y.appendChild(d), r.appendChild(y), l.appendChild(r),
|
|
4047
|
+
)}: <span class="wgt:font-medium">${c}</span>`, y.appendChild(d), r.appendChild(y), l.appendChild(r), s.appendChild(l);
|
|
4056
4048
|
const E = document.createElement("div");
|
|
4057
4049
|
E.className = "wgt:flex wgt:flex-col wgt:justify-between wgt:@min-2xl:w-1/2";
|
|
4058
4050
|
const P = document.createElement("div"), B = document.createElement("h3");
|
|
4059
|
-
B.className = "wgt:text-lg wgt:font-semibold wgt:text-gray-800 wgt:mb-4", B.innerText =
|
|
4051
|
+
B.className = "wgt:text-lg wgt:font-semibold wgt:text-gray-800 wgt:mb-4", B.innerText = i("paymentInstructionsTitle"), P.appendChild(B);
|
|
4060
4052
|
const f = document.createElement("ol");
|
|
4061
4053
|
f.className = "wgt:space-y-4", A.forEach((L, Q) => {
|
|
4062
4054
|
const N = document.createElement("li");
|
|
@@ -4073,15 +4065,15 @@ function Ia({
|
|
|
4073
4065
|
const H = document.createElement("div");
|
|
4074
4066
|
H.className = "wgt:h-[300px] wgt:flex wgt:justify-center";
|
|
4075
4067
|
const k = document.createElement("img");
|
|
4076
|
-
return k.src = u, k.alt = "QR payment illustration", k.className = "wgt:h-full wgt:object-contain", H.appendChild(k), E.appendChild(H),
|
|
4077
|
-
container:
|
|
4068
|
+
return k.src = u, k.alt = "QR payment illustration", k.className = "wgt:h-full wgt:object-contain", H.appendChild(k), E.appendChild(H), s.appendChild(E), {
|
|
4069
|
+
container: s,
|
|
4078
4070
|
update(L = {}) {
|
|
4079
4071
|
L.qrSrc != null && (w.src = L.qrSrc), L.logos && (b.innerHTML = "", L.logos.forEach((Q) => {
|
|
4080
4072
|
const N = document.createElement("img");
|
|
4081
4073
|
N.src = Q, N.alt = "Logo", N.className = "wgt:w-8 wgt:object-contain", b.appendChild(N);
|
|
4082
|
-
})), L.accountName != null && (I.innerText = L.accountName), L.accountNumber != null && (C.innerHTML = `${
|
|
4074
|
+
})), L.accountName != null && (I.innerText = L.accountName), L.accountNumber != null && (C.innerHTML = `${i(
|
|
4083
4075
|
"accountNumber"
|
|
4084
|
-
)}: <span class="wgt:font-medium">${L.accountNumber}</span>`), L.bankName != null && (d.innerHTML = `${
|
|
4076
|
+
)}: <span class="wgt:font-medium">${L.accountNumber}</span>`), L.bankName != null && (d.innerHTML = `${i(
|
|
4085
4077
|
"beneficiaryBank"
|
|
4086
4078
|
)}: <span class="wgt:font-medium">${L.bankName}</span>`), L.instructions && (f.innerHTML = "", L.instructions.forEach((Q, N) => {
|
|
4087
4079
|
const X = document.createElement("li");
|
|
@@ -4109,7 +4101,7 @@ function ba({
|
|
|
4109
4101
|
illustrationSrc: u,
|
|
4110
4102
|
theme: o
|
|
4111
4103
|
} = {}) {
|
|
4112
|
-
const { container:
|
|
4104
|
+
const { container: s, update: l } = Ia({
|
|
4113
4105
|
qrSrc: n,
|
|
4114
4106
|
logos: t,
|
|
4115
4107
|
logosAbove: e,
|
|
@@ -4120,7 +4112,7 @@ function ba({
|
|
|
4120
4112
|
illustrationSrc: u,
|
|
4121
4113
|
theme: o
|
|
4122
4114
|
});
|
|
4123
|
-
return { container:
|
|
4115
|
+
return { container: s, update: l };
|
|
4124
4116
|
}
|
|
4125
4117
|
const Va = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.55'%20y='0.55'%20width='14.9'%20height='14.9'%20rx='3.45'%20stroke='%2300BAEE'%20stroke-width='1.1'/%3e%3cpath%20d='M12.4268%205.23633L6.80078%2010.8623L3.71973%207.78125L3.83008%207.6709L6.80078%2010.6416L7.16992%2010.2725L12.3154%205.125L12.4268%205.23633Z'%20fill='%2300BAEE'%20stroke='%2300BAEE'%20stroke-width='1.04348'/%3e%3c/svg%3e", Sa = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.57087%2010.1746C4.57087%2010.8058%204.05918%2011.3175%203.42801%2011.3175C2.79684%2011.3175%202.28516%2010.8058%202.28516%2010.1746V8.11747C2.28516%207.4863%202.79684%206.97461%203.42801%206.97461C4.05918%206.97461%204.57087%207.4863%204.57087%208.11747V10.1746Z'%20stroke='%2300BAEE'%20stroke-width='1.14286'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.7134%2010.1746C13.7134%2010.8058%2013.2018%2011.3175%2012.5706%2011.3175C11.9394%2011.3175%2011.4277%2010.8058%2011.4277%2010.1746V8.11747C11.4277%207.4863%2011.9394%206.97461%2012.5706%206.97461C13.2018%206.97461%2013.7134%207.4863%2013.7134%208.11747V10.1746Z'%20stroke='%2300BAEE'%20stroke-width='1.14286'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.28516%208.11691V6.97405C2.28516%203.81814%204.84353%201.25977%207.99944%201.25977C11.1554%201.25977%2013.7137%203.81814%2013.7137%206.97405V8.11691'%20stroke='%2300BAEE'%20stroke-width='1.14286'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.714%2010.1709V11.3138C13.714%2012.5761%2012.7018%2013.224%2011.4283%2013.5995H9.14258'%20stroke='%2300BAEE'%20stroke-width='1.14286'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.00028%2014.7418C8.63146%2014.7418%209.14314%2014.2301%209.14314%2013.5989C9.14314%2012.9677%208.63146%2012.4561%208.00028%2012.4561C7.3691%2012.4561%206.85742%2012.9677%206.85742%2013.5989C6.85742%2014.2301%207.3691%2014.7418%208.00028%2014.7418Z'%20stroke='%2300BAEE'%20stroke-width='1.14286'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
|
|
4126
4118
|
function Ma({
|
|
@@ -4157,10 +4149,10 @@ function Ma({
|
|
|
4157
4149
|
const w = document.createElement("p");
|
|
4158
4150
|
w.className = "wgt:text-base wgt:font-medium wgt:leading-6 wgt:text-primary";
|
|
4159
4151
|
const b = (K) => {
|
|
4160
|
-
const O = Math.floor(K / 60).toString().padStart(2, "0"),
|
|
4161
|
-
return `${O}:${
|
|
4152
|
+
const O = Math.floor(K / 60).toString().padStart(2, "0"), un = (K % 60).toString().padStart(2, "0");
|
|
4153
|
+
return `${O}:${un}`;
|
|
4162
4154
|
}, y = () => {
|
|
4163
|
-
w.innerHTML = `${
|
|
4155
|
+
w.innerHTML = `${i(
|
|
4164
4156
|
"completePaymentIn"
|
|
4165
4157
|
)} <span class="wgt:font-bold">${b(r)}</span>`;
|
|
4166
4158
|
};
|
|
@@ -4178,43 +4170,43 @@ function Ma({
|
|
|
4178
4170
|
const E = document.createElement("div");
|
|
4179
4171
|
E.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
|
|
4180
4172
|
const P = document.createElement("h2");
|
|
4181
|
-
P.className = "wgt:text-xl wgt:font-semibold wgt:leading-6 wgt:text-black", P.innerText =
|
|
4173
|
+
P.className = "wgt:text-xl wgt:font-semibold wgt:leading-6 wgt:text-black", P.innerText = i("orderInfo"), E.appendChild(P);
|
|
4182
4174
|
const B = document.createElement("div");
|
|
4183
4175
|
B.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
4184
4176
|
const f = document.createElement("h4");
|
|
4185
|
-
f.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", f.innerText =
|
|
4177
|
+
f.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", f.innerText = i("provider");
|
|
4186
4178
|
const H = document.createElement("img");
|
|
4187
4179
|
n?.logoUrl && (H.src = n.logoUrl, H.alt = n.name, H.className = "wgt:h-6 wgt:object-contain"), B.appendChild(f), B.appendChild(H), E.appendChild(B);
|
|
4188
4180
|
const k = document.createElement("div");
|
|
4189
4181
|
k.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
4190
4182
|
const L = document.createElement("h4");
|
|
4191
|
-
L.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", L.innerText =
|
|
4183
|
+
L.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", L.innerText = i("subscriptionPackage");
|
|
4192
4184
|
const Q = document.createElement("span");
|
|
4193
4185
|
if (Q.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", Q.innerText = t ? String(t.code) : "", k.appendChild(L), k.appendChild(Q), E.appendChild(k), !o) {
|
|
4194
4186
|
const K = document.createElement("div");
|
|
4195
4187
|
K.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
4196
4188
|
const O = document.createElement("h4");
|
|
4197
|
-
O.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", O.innerText =
|
|
4198
|
-
const
|
|
4199
|
-
|
|
4189
|
+
O.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", O.innerText = i("digitalSignaturePackage");
|
|
4190
|
+
const un = document.createElement("span");
|
|
4191
|
+
un.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", un.innerText = e ? String(e.code) : "", K.appendChild(O), K.appendChild(un), E.appendChild(K);
|
|
4200
4192
|
}
|
|
4201
4193
|
if (c && c.length > 0) {
|
|
4202
4194
|
const K = document.createElement("div");
|
|
4203
4195
|
K.className = "wgt:w-full wgt:flex wgt:items-start wgt:justify-between wgt:gap-[0.5rem]";
|
|
4204
4196
|
const O = document.createElement("h4");
|
|
4205
|
-
O.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", O.innerText =
|
|
4206
|
-
const
|
|
4207
|
-
|
|
4197
|
+
O.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", O.innerText = i("promotion");
|
|
4198
|
+
const un = document.createElement("div");
|
|
4199
|
+
un.className = "wgt:flex wgt:items-center wgt:justify-end wgt:flex-wrap wgt:gap-2", c.forEach((Pn) => {
|
|
4208
4200
|
const Nn = document.createElement("div");
|
|
4209
|
-
Nn.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", Nn.innerText = Pn,
|
|
4210
|
-
}), K.appendChild(O), K.appendChild(
|
|
4201
|
+
Nn.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", Nn.innerText = Pn, un.appendChild(Nn);
|
|
4202
|
+
}), K.appendChild(O), K.appendChild(un), E.appendChild(K);
|
|
4211
4203
|
}
|
|
4212
4204
|
const N = document.createElement("hr");
|
|
4213
4205
|
E.appendChild(N);
|
|
4214
4206
|
const X = document.createElement("div");
|
|
4215
4207
|
X.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
4216
4208
|
const G = document.createElement("h4");
|
|
4217
|
-
G.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", G.innerText =
|
|
4209
|
+
G.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", G.innerText = i("paymentAmount");
|
|
4218
4210
|
const W = document.createElement("span");
|
|
4219
4211
|
W.className = "wgt:text-2xl wgt:font-bold wgt:leading-6 wgt:text-[#ED1C24]", W.innerText = typeof h == "number" ? h.toLocaleString("vi-VN") + " VND" : h, X.appendChild(G), X.appendChild(W), E.appendChild(X);
|
|
4220
4212
|
const $ = document.createElement("div");
|
|
@@ -4224,7 +4216,7 @@ function Ma({
|
|
|
4224
4216
|
const m = document.createElement("img");
|
|
4225
4217
|
m.src = Va, m.className = "wgt:w-4 wgt:h-4";
|
|
4226
4218
|
const p = document.createElement("p");
|
|
4227
|
-
p.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#344054]", p.innerText =
|
|
4219
|
+
p.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#344054]", p.innerText = i(
|
|
4228
4220
|
"check_transaction",
|
|
4229
4221
|
"Vui lòng kiểm tra giao dịch trước khi thanh toán để đảm bảo giao dịch được thực hiện chính xác"
|
|
4230
4222
|
), g.appendChild(m), g.appendChild(p), $.appendChild(g);
|
|
@@ -4233,12 +4225,12 @@ function Ma({
|
|
|
4233
4225
|
const J = document.createElement("img");
|
|
4234
4226
|
J.src = Sa, J.className = "wgt:w-4 wgt:h-4";
|
|
4235
4227
|
const M = document.createElement("p");
|
|
4236
|
-
if (M.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#344054]", M.innerHTML =
|
|
4228
|
+
if (M.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#344054]", M.innerHTML = i(
|
|
4237
4229
|
"contact_info",
|
|
4238
4230
|
'Thông tin liên hệ: <a href="mailto:hotro247@atomsolution.vn" class="wgt:font-semibold wgt:underline">hotro247@atomsolution.vn</a>'
|
|
4239
4231
|
), v.appendChild(J), v.appendChild(M), $.appendChild(v), E.appendChild($), l) {
|
|
4240
4232
|
const K = document.createElement("p");
|
|
4241
|
-
K.className = "wgt:text-sm wgt:italic wgt:text-[#335CFF] wgt:mt-6 wgt:text-center", K.textContent =
|
|
4233
|
+
K.className = "wgt:text-sm wgt:italic wgt:text-[#335CFF] wgt:mt-6 wgt:text-center", K.textContent = i("freeOrderDescription") || "Bạn không cần thanh toán cho đơn hàng này", E.appendChild(K);
|
|
4242
4234
|
}
|
|
4243
4235
|
d.appendChild(E);
|
|
4244
4236
|
const D = document.createElement("div");
|
|
@@ -4249,21 +4241,21 @@ function Ma({
|
|
|
4249
4241
|
close: F
|
|
4250
4242
|
} = Yt();
|
|
4251
4243
|
document.body.appendChild(Y);
|
|
4252
|
-
const U =
|
|
4253
|
-
title: l ?
|
|
4244
|
+
const U = lt({
|
|
4245
|
+
title: l ? i("confirmFreeOrder") || "Xác nhận đơn hàng" : i("cancelTransaction") || "Hủy giao dịch",
|
|
4254
4246
|
className: l ? "wgt:flex-1 wgt:py-3 wgt:rounded-lg wgt:bg-primary wgt:text-white hover:wgt:bg-primary-dark" : "wgt:w-full wgt:py-3 wgt:rounded-lg wgt:bg-transparent wgt:border wgt:border-primary wgt:text-primary hover:wgt:bg-transparent",
|
|
4255
4247
|
handleClick: l ? async () => {
|
|
4256
4248
|
U.disabled = !0;
|
|
4257
4249
|
const K = U.textContent;
|
|
4258
|
-
U.textContent =
|
|
4250
|
+
U.textContent = i("processing") || "Đang xử lý...", j();
|
|
4259
4251
|
try {
|
|
4260
4252
|
await Vh(a), U.className = U.className.replace(
|
|
4261
4253
|
/bg-primary|bg-\[\#0066cc\]/g,
|
|
4262
4254
|
"bg-green-500"
|
|
4263
|
-
), U.textContent =
|
|
4264
|
-
const O =
|
|
4265
|
-
message:
|
|
4266
|
-
okLabel:
|
|
4255
|
+
), U.textContent = i("confirmed") || "Đã xác nhận";
|
|
4256
|
+
const O = Bt({
|
|
4257
|
+
message: i("freeOrderSuccess") || "Thông tin đăng ký đã được ghi nhận thành công!",
|
|
4258
|
+
okLabel: i("next") || "Tiếp tục",
|
|
4267
4259
|
theme: "bvb",
|
|
4268
4260
|
isSuccess: !0,
|
|
4269
4261
|
preventClose: !0,
|
|
@@ -4274,18 +4266,18 @@ function Ma({
|
|
|
4274
4266
|
T.appendChild(O.container), O.open();
|
|
4275
4267
|
} catch {
|
|
4276
4268
|
U.disabled = !1, U.textContent = K;
|
|
4277
|
-
const
|
|
4269
|
+
const un = Bt({
|
|
4278
4270
|
message: "Xác nhận đơn hàng thất bại. Vui lòng thử lại.",
|
|
4279
4271
|
okLabel: "OK",
|
|
4280
4272
|
isSuccess: !1
|
|
4281
4273
|
});
|
|
4282
|
-
T.appendChild(
|
|
4274
|
+
T.appendChild(un.container), un.open(), F();
|
|
4283
4275
|
}
|
|
4284
4276
|
} : () => {
|
|
4285
4277
|
q && clearInterval(q);
|
|
4286
|
-
const K =
|
|
4287
|
-
message:
|
|
4288
|
-
okLabel:
|
|
4278
|
+
const K = Bt({
|
|
4279
|
+
message: i("transactionCanceled"),
|
|
4280
|
+
okLabel: i("ok"),
|
|
4289
4281
|
onClose: () => {
|
|
4290
4282
|
r = 3600, typeof A == "function" && A();
|
|
4291
4283
|
},
|
|
@@ -4293,15 +4285,15 @@ function Ma({
|
|
|
4293
4285
|
});
|
|
4294
4286
|
T.appendChild(K.container), K.open();
|
|
4295
4287
|
}
|
|
4296
|
-
}), qn =
|
|
4297
|
-
title:
|
|
4288
|
+
}), qn = lt({
|
|
4289
|
+
title: i("cancelTransaction") || "Hủy giao dịch",
|
|
4298
4290
|
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",
|
|
4299
4291
|
handleClick: () => {
|
|
4300
4292
|
q && clearInterval(q);
|
|
4301
|
-
const K =
|
|
4302
|
-
message:
|
|
4293
|
+
const K = Bt({
|
|
4294
|
+
message: i("transactionCanceled"),
|
|
4303
4295
|
isSuccess: !1,
|
|
4304
|
-
okLabel:
|
|
4296
|
+
okLabel: i("ok"),
|
|
4305
4297
|
onClose: () => {
|
|
4306
4298
|
r = 3600, typeof A == "function" && A();
|
|
4307
4299
|
},
|
|
@@ -4345,14 +4337,14 @@ function Ma({
|
|
|
4345
4337
|
}
|
|
4346
4338
|
};
|
|
4347
4339
|
}
|
|
4348
|
-
var
|
|
4340
|
+
var ft = {}, Ft, y0;
|
|
4349
4341
|
function Ja() {
|
|
4350
4342
|
return y0 || (y0 = 1, Ft = function() {
|
|
4351
4343
|
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
4352
4344
|
}), Ft;
|
|
4353
4345
|
}
|
|
4354
4346
|
var Rt = {}, et = {}, v0;
|
|
4355
|
-
function
|
|
4347
|
+
function gt() {
|
|
4356
4348
|
if (v0) return et;
|
|
4357
4349
|
v0 = 1;
|
|
4358
4350
|
let n;
|
|
@@ -4506,7 +4498,7 @@ function Ka() {
|
|
|
4506
4498
|
var _t = {}, b0;
|
|
4507
4499
|
function Oa() {
|
|
4508
4500
|
return b0 || (b0 = 1, function(n) {
|
|
4509
|
-
const t =
|
|
4501
|
+
const t = gt().getSymbolSize;
|
|
4510
4502
|
n.getRowColCoords = function(a) {
|
|
4511
4503
|
if (a === 1) return [];
|
|
4512
4504
|
const h = Math.floor(a / 7) + 2, c = t(a), A = c === 145 ? 26 : Math.ceil((c - 13) / (2 * h - 2)) * 2, u = [c - 7];
|
|
@@ -4528,7 +4520,7 @@ var $t = {}, V0;
|
|
|
4528
4520
|
function Ya() {
|
|
4529
4521
|
if (V0) return $t;
|
|
4530
4522
|
V0 = 1;
|
|
4531
|
-
const n =
|
|
4523
|
+
const n = gt().getSymbolSize, t = 7;
|
|
4532
4524
|
return $t.getPositions = function(a) {
|
|
4533
4525
|
const h = n(a);
|
|
4534
4526
|
return [
|
|
@@ -4566,12 +4558,12 @@ function Ga() {
|
|
|
4566
4558
|
return n.isValid(h) ? parseInt(h, 10) : void 0;
|
|
4567
4559
|
}, n.getPenaltyN1 = function(h) {
|
|
4568
4560
|
const c = h.size;
|
|
4569
|
-
let A = 0, u = 0, o = 0,
|
|
4561
|
+
let A = 0, u = 0, o = 0, s = null, l = null;
|
|
4570
4562
|
for (let T = 0; T < c; T++) {
|
|
4571
|
-
u = o = 0,
|
|
4563
|
+
u = o = 0, s = l = null;
|
|
4572
4564
|
for (let r = 0; r < c; r++) {
|
|
4573
4565
|
let q = h.get(T, r);
|
|
4574
|
-
q ===
|
|
4566
|
+
q === s ? u++ : (u >= 5 && (A += t.N1 + (u - 5)), s = q, u = 1), q = h.get(r, T), q === l ? o++ : (o >= 5 && (A += t.N1 + (o - 5)), l = q, o = 1);
|
|
4575
4567
|
}
|
|
4576
4568
|
u >= 5 && (A += t.N1 + (u - 5)), o >= 5 && (A += t.N1 + (o - 5));
|
|
4577
4569
|
}
|
|
@@ -4581,17 +4573,17 @@ function Ga() {
|
|
|
4581
4573
|
let A = 0;
|
|
4582
4574
|
for (let u = 0; u < c - 1; u++)
|
|
4583
4575
|
for (let o = 0; o < c - 1; o++) {
|
|
4584
|
-
const
|
|
4585
|
-
(
|
|
4576
|
+
const s = h.get(u, o) + h.get(u, o + 1) + h.get(u + 1, o) + h.get(u + 1, o + 1);
|
|
4577
|
+
(s === 4 || s === 0) && A++;
|
|
4586
4578
|
}
|
|
4587
4579
|
return A * t.N2;
|
|
4588
4580
|
}, n.getPenaltyN3 = function(h) {
|
|
4589
4581
|
const c = h.size;
|
|
4590
4582
|
let A = 0, u = 0, o = 0;
|
|
4591
|
-
for (let
|
|
4583
|
+
for (let s = 0; s < c; s++) {
|
|
4592
4584
|
u = o = 0;
|
|
4593
4585
|
for (let l = 0; l < c; l++)
|
|
4594
|
-
u = u << 1 & 2047 | h.get(
|
|
4586
|
+
u = u << 1 & 2047 | h.get(s, l), l >= 10 && (u === 1488 || u === 93) && A++, o = o << 1 & 2047 | h.get(l, s), l >= 10 && (o === 1488 || o === 93) && A++;
|
|
4595
4587
|
}
|
|
4596
4588
|
return A * t.N3;
|
|
4597
4589
|
}, n.getPenaltyN4 = function(h) {
|
|
@@ -4630,10 +4622,10 @@ function Ga() {
|
|
|
4630
4622
|
}, n.getBestMask = function(h, c) {
|
|
4631
4623
|
const A = Object.keys(n.Patterns).length;
|
|
4632
4624
|
let u = 0, o = 1 / 0;
|
|
4633
|
-
for (let
|
|
4634
|
-
c(
|
|
4625
|
+
for (let s = 0; s < A; s++) {
|
|
4626
|
+
c(s), n.applyMask(s, h);
|
|
4635
4627
|
const l = n.getPenaltyN1(h) + n.getPenaltyN2(h) + n.getPenaltyN3(h) + n.getPenaltyN4(h);
|
|
4636
|
-
n.applyMask(
|
|
4628
|
+
n.applyMask(s, h), l < o && (o = l, u = s);
|
|
4637
4629
|
}
|
|
4638
4630
|
return u;
|
|
4639
4631
|
};
|
|
@@ -5094,7 +5086,7 @@ function xh() {
|
|
|
5094
5086
|
}, nt;
|
|
5095
5087
|
}
|
|
5096
5088
|
var G0;
|
|
5097
|
-
function
|
|
5089
|
+
function rt() {
|
|
5098
5090
|
return G0 || (G0 = 1, function(n) {
|
|
5099
5091
|
const t = Th(), e = xh();
|
|
5100
5092
|
n.NUMERIC = {
|
|
@@ -5158,19 +5150,19 @@ function Tt() {
|
|
|
5158
5150
|
var W0;
|
|
5159
5151
|
function Ra() {
|
|
5160
5152
|
return W0 || (W0 = 1, function(n) {
|
|
5161
|
-
const t =
|
|
5153
|
+
const t = gt(), e = rh(), a = p0(), h = rt(), c = Th(), A = 7973, u = t.getBCHDigit(A);
|
|
5162
5154
|
function o(r, q, x) {
|
|
5163
5155
|
for (let w = 1; w <= 40; w++)
|
|
5164
5156
|
if (q <= n.getCapacity(w, x, r))
|
|
5165
5157
|
return w;
|
|
5166
5158
|
}
|
|
5167
|
-
function
|
|
5159
|
+
function s(r, q) {
|
|
5168
5160
|
return h.getCharCountIndicator(r, q) + 4;
|
|
5169
5161
|
}
|
|
5170
5162
|
function l(r, q) {
|
|
5171
5163
|
let x = 0;
|
|
5172
5164
|
return r.forEach(function(w) {
|
|
5173
|
-
const b =
|
|
5165
|
+
const b = s(w.mode, q);
|
|
5174
5166
|
x += b + w.getBitsLength();
|
|
5175
5167
|
}), x;
|
|
5176
5168
|
}
|
|
@@ -5187,7 +5179,7 @@ function Ra() {
|
|
|
5187
5179
|
typeof w > "u" && (w = h.BYTE);
|
|
5188
5180
|
const b = t.getSymbolTotalCodewords(q), y = e.getTotalCodewordsCount(q, x), I = (b - y) * 8;
|
|
5189
5181
|
if (w === h.MIXED) return I;
|
|
5190
|
-
const C = I -
|
|
5182
|
+
const C = I - s(w, q);
|
|
5191
5183
|
switch (w) {
|
|
5192
5184
|
case h.NUMERIC:
|
|
5193
5185
|
return Math.floor(C / 10 * 3);
|
|
@@ -5225,7 +5217,7 @@ var A0 = {}, z0;
|
|
|
5225
5217
|
function Za() {
|
|
5226
5218
|
if (z0) return A0;
|
|
5227
5219
|
z0 = 1;
|
|
5228
|
-
const n =
|
|
5220
|
+
const n = gt(), t = 1335, e = 21522, a = n.getBCHDigit(t);
|
|
5229
5221
|
return A0.getEncodedBits = function(c, A) {
|
|
5230
5222
|
const u = c.bit << 3 | A;
|
|
5231
5223
|
let o = u << 10;
|
|
@@ -5238,7 +5230,7 @@ var u0 = {}, o0, F0;
|
|
|
5238
5230
|
function ja() {
|
|
5239
5231
|
if (F0) return o0;
|
|
5240
5232
|
F0 = 1;
|
|
5241
|
-
const n =
|
|
5233
|
+
const n = rt();
|
|
5242
5234
|
function t(e) {
|
|
5243
5235
|
this.mode = n.NUMERIC, this.data = e.toString();
|
|
5244
5236
|
}
|
|
@@ -5260,7 +5252,7 @@ var m0, R0;
|
|
|
5260
5252
|
function Ua() {
|
|
5261
5253
|
if (R0) return m0;
|
|
5262
5254
|
R0 = 1;
|
|
5263
|
-
const n =
|
|
5255
|
+
const n = rt(), t = [
|
|
5264
5256
|
"0",
|
|
5265
5257
|
"1",
|
|
5266
5258
|
"2",
|
|
@@ -5329,7 +5321,7 @@ var q0, Z0;
|
|
|
5329
5321
|
function _a() {
|
|
5330
5322
|
if (Z0) return q0;
|
|
5331
5323
|
Z0 = 1;
|
|
5332
|
-
const n =
|
|
5324
|
+
const n = rt();
|
|
5333
5325
|
function t(e) {
|
|
5334
5326
|
this.mode = n.BYTE, typeof e == "string" ? this.data = new TextEncoder().encode(e) : this.data = new Uint8Array(e);
|
|
5335
5327
|
}
|
|
@@ -5348,7 +5340,7 @@ var s0, j0;
|
|
|
5348
5340
|
function $a() {
|
|
5349
5341
|
if (j0) return s0;
|
|
5350
5342
|
j0 = 1;
|
|
5351
|
-
const n =
|
|
5343
|
+
const n = rt(), t = gt();
|
|
5352
5344
|
function e(a) {
|
|
5353
5345
|
this.mode = n.KANJI, this.data = a;
|
|
5354
5346
|
}
|
|
@@ -5384,10 +5376,10 @@ function nc() {
|
|
|
5384
5376
|
A[a] = 0;
|
|
5385
5377
|
var u = t.PriorityQueue.make();
|
|
5386
5378
|
u.push(a, 0);
|
|
5387
|
-
for (var o,
|
|
5388
|
-
o = u.pop(),
|
|
5379
|
+
for (var o, s, l, T, r, q, x, w, b; !u.empty(); ) {
|
|
5380
|
+
o = u.pop(), s = o.value, T = o.cost, r = e[s] || {};
|
|
5389
5381
|
for (l in r)
|
|
5390
|
-
r.hasOwnProperty(l) && (q = r[l], x = T + q, w = A[l], b = typeof A[l] > "u", (b || w > x) && (A[l] = x, u.push(l, x), c[l] =
|
|
5382
|
+
r.hasOwnProperty(l) && (q = r[l], x = T + q, w = A[l], b = typeof A[l] > "u", (b || w > x) && (A[l] = x, u.push(l, x), c[l] = s));
|
|
5391
5383
|
}
|
|
5392
5384
|
if (typeof h < "u" && typeof A[h] > "u") {
|
|
5393
5385
|
var y = ["Could not find a path from ", a, " to ", h, "."].join("");
|
|
@@ -5446,8 +5438,8 @@ function nc() {
|
|
|
5446
5438
|
var _0;
|
|
5447
5439
|
function tc() {
|
|
5448
5440
|
return _0 || (_0 = 1, function(n) {
|
|
5449
|
-
const t =
|
|
5450
|
-
function
|
|
5441
|
+
const t = rt(), e = ja(), a = Ua(), h = _a(), c = $a(), A = xh(), u = gt(), o = nc();
|
|
5442
|
+
function s(y) {
|
|
5451
5443
|
return unescape(encodeURIComponent(y)).length;
|
|
5452
5444
|
}
|
|
5453
5445
|
function l(y, I, C) {
|
|
@@ -5514,12 +5506,12 @@ function tc() {
|
|
|
5514
5506
|
case t.KANJI:
|
|
5515
5507
|
I.push([
|
|
5516
5508
|
d,
|
|
5517
|
-
{ data: d.data, mode: t.BYTE, length:
|
|
5509
|
+
{ data: d.data, mode: t.BYTE, length: s(d.data) }
|
|
5518
5510
|
]);
|
|
5519
5511
|
break;
|
|
5520
5512
|
case t.BYTE:
|
|
5521
5513
|
I.push([
|
|
5522
|
-
{ data: d.data, mode: t.BYTE, length:
|
|
5514
|
+
{ data: d.data, mode: t.BYTE, length: s(d.data) }
|
|
5523
5515
|
]);
|
|
5524
5516
|
}
|
|
5525
5517
|
}
|
|
@@ -5581,7 +5573,7 @@ var $0;
|
|
|
5581
5573
|
function hc() {
|
|
5582
5574
|
if ($0) return Rt;
|
|
5583
5575
|
$0 = 1;
|
|
5584
|
-
const n =
|
|
5576
|
+
const n = gt(), t = p0(), e = Da(), a = Ka(), h = Oa(), c = Ya(), A = Ga(), u = rh(), o = Fa(), s = Ra(), l = Za(), T = rt(), r = tc();
|
|
5585
5577
|
function q(P, B) {
|
|
5586
5578
|
const f = P.size, H = c.getPositions(B);
|
|
5587
5579
|
for (let k = 0; k < H.length; k++) {
|
|
@@ -5609,7 +5601,7 @@ function hc() {
|
|
|
5609
5601
|
}
|
|
5610
5602
|
}
|
|
5611
5603
|
function b(P, B) {
|
|
5612
|
-
const f = P.size, H =
|
|
5604
|
+
const f = P.size, H = s.getEncodedBits(B);
|
|
5613
5605
|
let k, L, Q;
|
|
5614
5606
|
for (let N = 0; N < 18; N++)
|
|
5615
5607
|
k = Math.floor(N / 3), L = N % 3 + f - 8 - 3, Q = (H >> N & 1) === 1, P.set(k, L, Q, !0), P.set(L, k, Q, !0);
|
|
@@ -5678,12 +5670,12 @@ function hc() {
|
|
|
5678
5670
|
let G = B;
|
|
5679
5671
|
if (!G) {
|
|
5680
5672
|
const W = r.rawSplit(P);
|
|
5681
|
-
G =
|
|
5673
|
+
G = s.getBestVersionForData(W, f);
|
|
5682
5674
|
}
|
|
5683
5675
|
k = r.fromString(P, G || 40);
|
|
5684
5676
|
} else
|
|
5685
5677
|
throw new Error("Invalid data");
|
|
5686
|
-
const L =
|
|
5678
|
+
const L = s.getBestVersionForData(k, f);
|
|
5687
5679
|
if (!L)
|
|
5688
5680
|
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
5689
5681
|
if (!B)
|
|
@@ -5711,7 +5703,7 @@ Minimum version required to store current data is: ` + L + `.
|
|
|
5711
5703
|
if (typeof B > "u" || B === "")
|
|
5712
5704
|
throw new Error("No input text");
|
|
5713
5705
|
let H = t.M, k, L;
|
|
5714
|
-
return typeof f < "u" && (H = t.from(f.errorCorrectionLevel, t.M), k =
|
|
5706
|
+
return typeof f < "u" && (H = t.from(f.errorCorrectionLevel, t.M), k = s.from(f.version), L = A.from(f.maskPattern), f.toSJISFunc && n.setToSJISFunction(f.toSJISFunc)), E(B, k, H, L);
|
|
5715
5707
|
}, Rt;
|
|
5716
5708
|
}
|
|
5717
5709
|
var l0 = {}, g0 = {}, nh;
|
|
@@ -5755,11 +5747,11 @@ function dh() {
|
|
|
5755
5747
|
const c = n.getScale(a, h);
|
|
5756
5748
|
return Math.floor((a + h.margin * 2) * c);
|
|
5757
5749
|
}, n.qrToImageData = function(a, h, c) {
|
|
5758
|
-
const A = h.modules.size, u = h.modules.data, o = n.getScale(A, c),
|
|
5759
|
-
for (let r = 0; r <
|
|
5760
|
-
for (let q = 0; q <
|
|
5761
|
-
let x = (r *
|
|
5762
|
-
if (r >= l && q >= l && r <
|
|
5750
|
+
const A = h.modules.size, u = h.modules.data, o = n.getScale(A, c), s = Math.floor((A + c.margin * 2) * o), l = c.margin * o, T = [c.color.light, c.color.dark];
|
|
5751
|
+
for (let r = 0; r < s; r++)
|
|
5752
|
+
for (let q = 0; q < s; q++) {
|
|
5753
|
+
let x = (r * s + q) * 4, w = c.color.light;
|
|
5754
|
+
if (r >= l && q >= l && r < s - l && q < s - l) {
|
|
5763
5755
|
const b = Math.floor((r - l) / o), y = Math.floor((q - l) / o);
|
|
5764
5756
|
w = T[u[b * A + y] ? 1 : 0];
|
|
5765
5757
|
}
|
|
@@ -5783,15 +5775,15 @@ function ac() {
|
|
|
5783
5775
|
}
|
|
5784
5776
|
}
|
|
5785
5777
|
n.render = function(c, A, u) {
|
|
5786
|
-
let o = u,
|
|
5787
|
-
typeof o > "u" && (!A || !A.getContext) && (o = A, A = void 0), A || (
|
|
5788
|
-
const l = t.getImageWidth(c.modules.size, o), T =
|
|
5789
|
-
return t.qrToImageData(r.data, c, o), e(T,
|
|
5778
|
+
let o = u, s = A;
|
|
5779
|
+
typeof o > "u" && (!A || !A.getContext) && (o = A, A = void 0), A || (s = a()), o = t.getOptions(o);
|
|
5780
|
+
const l = t.getImageWidth(c.modules.size, o), T = s.getContext("2d"), r = T.createImageData(l, l);
|
|
5781
|
+
return t.qrToImageData(r.data, c, o), e(T, s, l), T.putImageData(r, 0, 0), s;
|
|
5790
5782
|
}, n.renderToDataURL = function(c, A, u) {
|
|
5791
5783
|
let o = u;
|
|
5792
5784
|
typeof o > "u" && (!A || !A.getContext) && (o = A, A = void 0), o || (o = {});
|
|
5793
|
-
const
|
|
5794
|
-
return
|
|
5785
|
+
const s = n.render(c, A, o), l = o.type || "image/png", T = o.rendererOpts || {};
|
|
5786
|
+
return s.toDataURL(l, T.quality);
|
|
5795
5787
|
};
|
|
5796
5788
|
}(l0)), l0;
|
|
5797
5789
|
}
|
|
@@ -5809,32 +5801,32 @@ function cc() {
|
|
|
5809
5801
|
return typeof A < "u" && (u += " " + A), u;
|
|
5810
5802
|
}
|
|
5811
5803
|
function a(h, c, A) {
|
|
5812
|
-
let u = "", o = 0,
|
|
5804
|
+
let u = "", o = 0, s = !1, l = 0;
|
|
5813
5805
|
for (let T = 0; T < h.length; T++) {
|
|
5814
5806
|
const r = Math.floor(T % c), q = Math.floor(T / c);
|
|
5815
|
-
!r && !
|
|
5807
|
+
!r && !s && (s = !0), h[T] ? (l++, T > 0 && r > 0 && h[T - 1] || (u += s ? e("M", r + A, 0.5 + q + A) : e("m", o, 0), o = 0, s = !1), r + 1 < c && h[T + 1] || (u += e("h", l), l = 0)) : o++;
|
|
5816
5808
|
}
|
|
5817
5809
|
return u;
|
|
5818
5810
|
}
|
|
5819
5811
|
return r0.render = function(c, A, u) {
|
|
5820
|
-
const o = n.getOptions(A),
|
|
5812
|
+
const o = n.getOptions(A), s = c.modules.size, l = c.modules.data, T = s + o.margin * 2, r = o.color.light.a ? "<path " + t(o.color.light, "fill") + ' d="M0 0h' + T + "v" + T + 'H0z"/>' : "", q = "<path " + t(o.color.dark, "stroke") + ' d="' + a(l, s, o.margin) + '"/>', x = 'viewBox="0 0 ' + T + " " + T + '"', b = '<svg xmlns="http://www.w3.org/2000/svg" ' + (o.width ? 'width="' + o.width + '" height="' + o.width + '" ' : "") + x + ' shape-rendering="crispEdges">' + r + q + `</svg>
|
|
5821
5813
|
`;
|
|
5822
5814
|
return typeof u == "function" && u(null, b), b;
|
|
5823
5815
|
}, r0;
|
|
5824
5816
|
}
|
|
5825
5817
|
var ah;
|
|
5826
5818
|
function ec() {
|
|
5827
|
-
if (ah) return
|
|
5819
|
+
if (ah) return ft;
|
|
5828
5820
|
ah = 1;
|
|
5829
5821
|
const n = Ja(), t = hc(), e = ac(), a = cc();
|
|
5830
|
-
function h(c, A, u, o,
|
|
5822
|
+
function h(c, A, u, o, s) {
|
|
5831
5823
|
const l = [].slice.call(arguments, 1), T = l.length, r = typeof l[T - 1] == "function";
|
|
5832
5824
|
if (!r && !n())
|
|
5833
5825
|
throw new Error("Callback required as last argument");
|
|
5834
5826
|
if (r) {
|
|
5835
5827
|
if (T < 2)
|
|
5836
5828
|
throw new Error("Too few arguments provided");
|
|
5837
|
-
T === 2 ? (
|
|
5829
|
+
T === 2 ? (s = u, u = A, A = o = void 0) : T === 3 && (A.getContext && typeof s > "u" ? (s = o, o = void 0) : (s = o, o = u, u = A, A = void 0));
|
|
5838
5830
|
} else {
|
|
5839
5831
|
if (T < 1)
|
|
5840
5832
|
throw new Error("Too few arguments provided");
|
|
@@ -5849,14 +5841,14 @@ function ec() {
|
|
|
5849
5841
|
}
|
|
5850
5842
|
try {
|
|
5851
5843
|
const q = t.create(u, o);
|
|
5852
|
-
|
|
5844
|
+
s(null, c(q, A, o));
|
|
5853
5845
|
} catch (q) {
|
|
5854
|
-
|
|
5846
|
+
s(q);
|
|
5855
5847
|
}
|
|
5856
5848
|
}
|
|
5857
|
-
return
|
|
5849
|
+
return ft.create = t.create, ft.toCanvas = h.bind(null, e.render), ft.toDataURL = h.bind(null, e.renderToDataURL), ft.toString = h.bind(null, function(c, A, u) {
|
|
5858
5850
|
return a.render(c, u);
|
|
5859
|
-
}),
|
|
5851
|
+
}), ft;
|
|
5860
5852
|
}
|
|
5861
5853
|
var Ac = ec();
|
|
5862
5854
|
const uc = /* @__PURE__ */ mh(Ac), wh = "data:image/svg+xml,%3csvg%20width='30'%20height='30'%20viewBox='0%200%2030%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%2030C6.7155%2030%200%2023.2845%200%2015C0%206.7155%206.7155%200%2015%200C23.2845%200%2030%206.7155%2030%2015C30%2023.2845%2023.2845%2030%2015%2030ZM13.5%2013.5V22.5H16.5V13.5H13.5ZM13.5%207.5V10.5H16.5V7.5H13.5Z'%20fill='%23335CFF'/%3e%3c/svg%3e", oc = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.25%2010.375C4.25%2011.0653%203.69034%2011.625%203%2011.625C2.30966%2011.625%201.75%2011.0653%201.75%2010.375V8.125C1.75%207.43466%202.30966%206.875%203%206.875C3.69034%206.875%204.25%207.43466%204.25%208.125V10.375Z'%20fill='%23525866'%20stroke='%23525866'%20stroke-width='1.25'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M14.25%2010.375C14.25%2011.0653%2013.6903%2011.625%2013%2011.625C12.3097%2011.625%2011.75%2011.0653%2011.75%2010.375V8.125C11.75%207.43466%2012.3097%206.875%2013%206.875C13.6903%206.875%2014.25%207.43466%2014.25%208.125V10.375Z'%20fill='%23525866'%20stroke='%23525866'%20stroke-width='1.25'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M1.75%208.125V6.875C1.75%203.42322%204.54822%200.625%208%200.625C11.4518%200.625%2014.25%203.42322%2014.25%206.875V8.125'%20stroke='%23525866'%20stroke-width='1.25'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M14.25%2010.375V11.625C14.25%2013.0057%2013.1429%2013.7143%2011.75%2014.125H9.25'%20stroke='%23525866'%20stroke-width='1.25'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8%2015.375C8.69036%2015.375%209.25%2014.8154%209.25%2014.125C9.25%2013.4346%208.69036%2012.875%208%2012.875C7.30964%2012.875%206.75%2013.4346%206.75%2014.125C6.75%2014.8154%207.30964%2015.375%208%2015.375Z'%20fill='%23525866'%20stroke='%23525866'%20stroke-width='1.25'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
|
|
@@ -5941,11 +5933,11 @@ function sc({
|
|
|
5941
5933
|
justify-content: center;
|
|
5942
5934
|
margin-bottom: 1.25rem;
|
|
5943
5935
|
`, u.appendChild(o);
|
|
5944
|
-
const
|
|
5945
|
-
|
|
5936
|
+
const s = document.createElement("img");
|
|
5937
|
+
s.src = wh, s.alt = "Cảnh báo", s.style.cssText = `
|
|
5946
5938
|
width: 32px;
|
|
5947
5939
|
height: 32px;
|
|
5948
|
-
`, o.appendChild(
|
|
5940
|
+
`, o.appendChild(s);
|
|
5949
5941
|
const l = document.createElement("h2");
|
|
5950
5942
|
l.style.cssText = `
|
|
5951
5943
|
margin: 0 0 1.5rem 0;
|
|
@@ -5954,7 +5946,7 @@ function sc({
|
|
|
5954
5946
|
font-weight: 700;
|
|
5955
5947
|
color: #111827;
|
|
5956
5948
|
line-height: 1.4;
|
|
5957
|
-
`, l.innerText =
|
|
5949
|
+
`, l.innerText = i(
|
|
5958
5950
|
"transactionMismatch",
|
|
5959
5951
|
"Giao dịch không khớp với thông tin đơn hàng"
|
|
5960
5952
|
), u.appendChild(l);
|
|
@@ -5983,7 +5975,7 @@ function sc({
|
|
|
5983
5975
|
flex-shrink: 0;
|
|
5984
5976
|
`;
|
|
5985
5977
|
const x = document.createElement("span");
|
|
5986
|
-
x.innerText =
|
|
5978
|
+
x.innerText = i("handlingInstructions", "Hướng dẫn xử lý"), r.appendChild(q), r.appendChild(x), T.appendChild(r);
|
|
5987
5979
|
const w = document.createElement("p");
|
|
5988
5980
|
w.style.cssText = `
|
|
5989
5981
|
font-size: 0.875rem;
|
|
@@ -5995,7 +5987,7 @@ function sc({
|
|
|
5995
5987
|
|
|
5996
5988
|
`;
|
|
5997
5989
|
const b = "hotro247@atomsolution.vn";
|
|
5998
|
-
w.innerHTML =
|
|
5990
|
+
w.innerHTML = i("email_support_info", "").replace(
|
|
5999
5991
|
/{email}/g,
|
|
6000
5992
|
b
|
|
6001
5993
|
), T.appendChild(w);
|
|
@@ -6017,9 +6009,9 @@ function sc({
|
|
|
6017
6009
|
font-size: 0.875rem;
|
|
6018
6010
|
|
|
6019
6011
|
`, I.style.listStyleType = "disc", I.innerHTML = `
|
|
6020
|
-
<li style="color: #1e3a8a;">${
|
|
6021
|
-
<li style="color: #1e3a8a;">${
|
|
6022
|
-
<li style="color: #1e3a8a;">${
|
|
6012
|
+
<li style="color: #1e3a8a;">${i("taxOrCompany")}</li>
|
|
6013
|
+
<li style="color: #1e3a8a;">${i("transactionAmountTime")}</li>
|
|
6014
|
+
<li style="color: #1e3a8a;">${i("transactionIdReceipt")}</li>
|
|
6023
6015
|
`, y.appendChild(I);
|
|
6024
6016
|
const C = document.createElement("div");
|
|
6025
6017
|
C.style.cssText = `
|
|
@@ -6029,12 +6021,12 @@ function sc({
|
|
|
6029
6021
|
font-style: italic;
|
|
6030
6022
|
line-height: 1.6;
|
|
6031
6023
|
margin-top: 0.75rem;
|
|
6032
|
-
`, C.innerText =
|
|
6024
|
+
`, C.innerText = i(
|
|
6033
6025
|
"completeInfoHelp",
|
|
6034
6026
|
"Cung cấp đủ thông tin sẽ giúp chúng tôi xử lý yêu cầu của bạn nhanh chóng và chính xác hơn."
|
|
6035
6027
|
), T.appendChild(C);
|
|
6036
6028
|
const d = document.createElement("button");
|
|
6037
|
-
d.type = "button", d.innerText =
|
|
6029
|
+
d.type = "button", d.innerText = i("close", "Đóng"), d.style.cssText = `
|
|
6038
6030
|
width: 100%;
|
|
6039
6031
|
max-width: none;
|
|
6040
6032
|
margin: 0 auto;
|
|
@@ -6101,7 +6093,7 @@ async function lc({
|
|
|
6101
6093
|
setOrderId: c,
|
|
6102
6094
|
theme: A = "ocb"
|
|
6103
6095
|
}) {
|
|
6104
|
-
let u = null, o = "",
|
|
6096
|
+
let u = null, o = "", s = null, l = h?.orderId || null, T = !1, r = 0, q = !1, x = 0;
|
|
6105
6097
|
const w = h?.selectedProvider?.route || h?.selectedProvider?.name || h?.provider || "", b = "QR";
|
|
6106
6098
|
let y = null, I = null, C = null, d = 0;
|
|
6107
6099
|
const E = document.createElement("div");
|
|
@@ -6122,7 +6114,7 @@ async function lc({
|
|
|
6122
6114
|
isRenewal: !!h?.isRenewal,
|
|
6123
6115
|
selectedPromotions: h?.selectedPromotions || [],
|
|
6124
6116
|
onResetToStep1: () => {
|
|
6125
|
-
|
|
6117
|
+
s && (clearInterval(s), s = null), h?.onResetToStep1 && h.onResetToStep1();
|
|
6126
6118
|
},
|
|
6127
6119
|
onFreeOrderConfirmed: () => {
|
|
6128
6120
|
try {
|
|
@@ -6150,7 +6142,7 @@ async function lc({
|
|
|
6150
6142
|
accountNumber: "",
|
|
6151
6143
|
bankName: "",
|
|
6152
6144
|
...a,
|
|
6153
|
-
instructions:
|
|
6145
|
+
instructions: i("paymentInstructions"),
|
|
6154
6146
|
theme: A
|
|
6155
6147
|
});
|
|
6156
6148
|
L = p.container, Q = p.update, k.appendChild(L), H.appendChild(k), H.appendChild(N);
|
|
@@ -6160,13 +6152,13 @@ async function lc({
|
|
|
6160
6152
|
const G = document.createElement("div");
|
|
6161
6153
|
G.className = "wgt:flex wgt:items-center wgt:justify-between wgt:gap-2";
|
|
6162
6154
|
const W = document.createElement("button");
|
|
6163
|
-
W.type = "button", W.className = "wgt:bg-transparent wgt:!text-primary wgt:hover:bg-transparent wgt:underline", W.textContent =
|
|
6155
|
+
W.type = "button", W.className = "wgt:bg-transparent wgt:!text-primary wgt:hover:bg-transparent wgt:underline", W.textContent = i("back"), W.addEventListener("click", () => {
|
|
6164
6156
|
yn(vn.STEP3_BACK_CLICKED, {
|
|
6165
6157
|
orderId: l,
|
|
6166
6158
|
provider: w,
|
|
6167
6159
|
theme: A,
|
|
6168
6160
|
isFreeOrder: q
|
|
6169
|
-
}), t && (clearInterval(
|
|
6161
|
+
}), t && (clearInterval(s), s = null, t());
|
|
6170
6162
|
}), G.appendChild(W), E.appendChild(G);
|
|
6171
6163
|
async function $() {
|
|
6172
6164
|
const p = h?.totalAmountText || 0;
|
|
@@ -6232,7 +6224,7 @@ async function lc({
|
|
|
6232
6224
|
theme: A,
|
|
6233
6225
|
retryCount: r
|
|
6234
6226
|
}), r >= ic) {
|
|
6235
|
-
Mt(
|
|
6227
|
+
Mt(i("errorQRGeneration"), { onClose: () => t() });
|
|
6236
6228
|
return;
|
|
6237
6229
|
}
|
|
6238
6230
|
T = !1;
|
|
@@ -6241,7 +6233,7 @@ async function lc({
|
|
|
6241
6233
|
if (v.response?.status === 401 || v.response?.status === 403)
|
|
6242
6234
|
return;
|
|
6243
6235
|
Mt(
|
|
6244
|
-
|
|
6236
|
+
i(
|
|
6245
6237
|
"errorQRGeneration",
|
|
6246
6238
|
"Không thể tạo mã QR thanh toán. Vui lòng thử lại."
|
|
6247
6239
|
),
|
|
@@ -6256,12 +6248,12 @@ async function lc({
|
|
|
6256
6248
|
}
|
|
6257
6249
|
}
|
|
6258
6250
|
function m() {
|
|
6259
|
-
q ||
|
|
6251
|
+
q || s || (s = setInterval(async () => {
|
|
6260
6252
|
try {
|
|
6261
6253
|
const p = await Sh(l);
|
|
6262
6254
|
if (p.paymentStatus === "pending") return;
|
|
6263
6255
|
if (p.paymentStatus === "wrong_amount") {
|
|
6264
|
-
clearInterval(
|
|
6256
|
+
clearInterval(s), s = null, yt.wrongAmount({
|
|
6265
6257
|
orderId: l,
|
|
6266
6258
|
expectedAmount: x,
|
|
6267
6259
|
receivedAmount: p?.receivedAmount ?? p?.amount ?? null,
|
|
@@ -6283,7 +6275,7 @@ async function lc({
|
|
|
6283
6275
|
E.appendChild(M.container), M.open();
|
|
6284
6276
|
return;
|
|
6285
6277
|
}
|
|
6286
|
-
clearInterval(
|
|
6278
|
+
clearInterval(s), s = null;
|
|
6287
6279
|
const v = I ? Math.round((Date.now() - I) / 1e3) : null;
|
|
6288
6280
|
p.paymentStatus === "paid" ? yt.success({
|
|
6289
6281
|
orderId: l,
|
|
@@ -6310,8 +6302,8 @@ async function lc({
|
|
|
6310
6302
|
provider: w,
|
|
6311
6303
|
theme: A
|
|
6312
6304
|
});
|
|
6313
|
-
const J =
|
|
6314
|
-
message: p.paymentStatus === "paid" ?
|
|
6305
|
+
const J = Bt({
|
|
6306
|
+
message: p.paymentStatus === "paid" ? i("paymentSuccess") : i("paymentFailed"),
|
|
6315
6307
|
okLabel: "OK",
|
|
6316
6308
|
theme: A,
|
|
6317
6309
|
isSuccess: p.paymentStatus === "paid",
|
|
@@ -6320,12 +6312,12 @@ async function lc({
|
|
|
6320
6312
|
});
|
|
6321
6313
|
E.appendChild(J.container), J.open();
|
|
6322
6314
|
} catch (p) {
|
|
6323
|
-
!navigator.onLine || !p.response ? Mt(
|
|
6315
|
+
!navigator.onLine || !p.response ? Mt(i("errorNetwork"), { isOffline: !0 }) : (p.response?.status === 404 || p.response?.status === 410) && (clearInterval(s), s = null);
|
|
6324
6316
|
}
|
|
6325
6317
|
}, 5e3));
|
|
6326
6318
|
}
|
|
6327
6319
|
return await $(), window.addEventListener("beforeunload", () => {
|
|
6328
|
-
|
|
6320
|
+
s && clearInterval(s);
|
|
6329
6321
|
}), { container: E };
|
|
6330
6322
|
}
|
|
6331
6323
|
function gc({
|
|
@@ -6345,13 +6337,13 @@ function gc({
|
|
|
6345
6337
|
const u = document.createElement("div");
|
|
6346
6338
|
u.className = "wgt:w-full wgt:max-w-3xl wgt:space-y-4 wgt:rounded-xl wgt:bg-white", A.appendChild(u);
|
|
6347
6339
|
const o = document.createElement("h3");
|
|
6348
|
-
o.className = "wgt:text-sm wgt:font-semibold wgt:text-text-black", o.innerText =
|
|
6349
|
-
const
|
|
6350
|
-
|
|
6340
|
+
o.className = "wgt:text-sm wgt:font-semibold wgt:text-text-black", o.innerText = i("confirmationTitle"), u.appendChild(o);
|
|
6341
|
+
const s = document.createElement("div");
|
|
6342
|
+
s.className = "wgt:flex wgt:items-center wgt:gap-4", u.appendChild(s);
|
|
6351
6343
|
const l = document.createElement("div");
|
|
6352
|
-
l.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:shrink-0 wgt:items-center wgt:justify-center wgt:rounded-full wgt:bg-primary wgt:text-xs wgt:font-semibold wgt:text-white", l.innerText = "1",
|
|
6344
|
+
l.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:shrink-0 wgt:items-center wgt:justify-center wgt:rounded-full wgt:bg-primary wgt:text-xs wgt:font-semibold wgt:text-white", l.innerText = "1", s.appendChild(l);
|
|
6353
6345
|
const T = document.createElement("p");
|
|
6354
|
-
T.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", T.innerText =
|
|
6346
|
+
T.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", T.innerText = i("notice1"), s.appendChild(T);
|
|
6355
6347
|
const r = document.createElement("div");
|
|
6356
6348
|
r.className = "wgt:flex wgt:items-start wgt:gap-4", u.appendChild(r);
|
|
6357
6349
|
const q = document.createElement("div");
|
|
@@ -6359,7 +6351,7 @@ function gc({
|
|
|
6359
6351
|
const x = document.createElement("div");
|
|
6360
6352
|
x.className = "wgt:flex wgt:flex-col wgt:gap-2", r.appendChild(x);
|
|
6361
6353
|
const w = document.createElement("p");
|
|
6362
|
-
w.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", w.innerText =
|
|
6354
|
+
w.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", w.innerText = i("notice2"), x.appendChild(w);
|
|
6363
6355
|
const b = document.createElement("div");
|
|
6364
6356
|
b.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-2 wgt:rounded-lg wgt:bg-weak-50 wgt:px-4 wgt:py-3", x.appendChild(b);
|
|
6365
6357
|
const y = document.createElement("div");
|
|
@@ -6385,7 +6377,7 @@ function gc({
|
|
|
6385
6377
|
</svg>
|
|
6386
6378
|
`, y.appendChild(I);
|
|
6387
6379
|
const C = fh(oh(), a, c), d = document.createElement("span");
|
|
6388
|
-
d.innerHTML = `${
|
|
6380
|
+
d.innerHTML = `${i("hotlineDomestic")} <b>${C?.hotline || ""}</b> ${i("hotlineDesc")} `, y.appendChild(d);
|
|
6389
6381
|
const E = document.createElement("div");
|
|
6390
6382
|
E.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", b.appendChild(E);
|
|
6391
6383
|
const P = document.createElement("div");
|
|
@@ -6407,7 +6399,7 @@ function gc({
|
|
|
6407
6399
|
</svg>
|
|
6408
6400
|
`, E.appendChild(P);
|
|
6409
6401
|
const B = document.createElement("span");
|
|
6410
|
-
B.innerHTML = `${
|
|
6402
|
+
B.innerHTML = `${i("email")}: <b>${C?.email || ""}</b>`, E.appendChild(B);
|
|
6411
6403
|
const f = document.createElement("div");
|
|
6412
6404
|
f.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", b.appendChild(f);
|
|
6413
6405
|
const H = document.createElement("div");
|
|
@@ -6422,7 +6414,7 @@ function gc({
|
|
|
6422
6414
|
</clipPath>
|
|
6423
6415
|
</defs>
|
|
6424
6416
|
</svg>
|
|
6425
|
-
`, f.appendChild(H), f.appendChild(document.createTextNode(
|
|
6417
|
+
`, f.appendChild(H), f.appendChild(document.createTextNode(i("website") + ": "));
|
|
6426
6418
|
const k = document.createElement("a");
|
|
6427
6419
|
k.className = "wgt:text-strong-950 wgt:hover:underline wgt:cursor-pointer", k.innerHTML = `<b>${C?.link || ""}</b>`, k.href = C?.link || "#", k.target = "_blank", f.appendChild(k);
|
|
6428
6420
|
const L = document.createElement("div");
|
|
@@ -6430,9 +6422,9 @@ function gc({
|
|
|
6430
6422
|
const Q = document.createElement("div");
|
|
6431
6423
|
Q.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:shrink-0 wgt:items-center wgt:justify-center wgt:rounded-full wgt:bg-primary wgt:text-xs wgt:font-semibold wgt:text-white", Q.innerText = "3", L.appendChild(Q);
|
|
6432
6424
|
const N = document.createElement("p");
|
|
6433
|
-
N.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", N.appendChild(document.createTextNode(
|
|
6425
|
+
N.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", N.appendChild(document.createTextNode(i("notice3.1") + " "));
|
|
6434
6426
|
const X = document.createElement("a");
|
|
6435
|
-
X.className = "wgt:text-primary wgt:font-semibold wgt:hover:underline wgt:cursor-pointer", X.textContent =
|
|
6427
|
+
X.className = "wgt:text-primary wgt:font-semibold wgt:hover:underline wgt:cursor-pointer", X.textContent = i("settings") + " ", X.href = h, X.target = "_blank", N.appendChild(X), N.appendChild(document.createTextNode(i("notice3.2") + " ")), L.appendChild(N);
|
|
6436
6428
|
const G = document.createElement("div");
|
|
6437
6429
|
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", u.appendChild(G);
|
|
6438
6430
|
const W = document.createElement("div");
|
|
@@ -6442,12 +6434,12 @@ function gc({
|
|
|
6442
6434
|
</svg>
|
|
6443
6435
|
`;
|
|
6444
6436
|
const $ = document.createElement("label");
|
|
6445
|
-
$.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950 wgt:leading-tight", $.appendChild(document.createTextNode(
|
|
6437
|
+
$.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950 wgt:leading-tight", $.appendChild(document.createTextNode(i("informationSent"))), G.appendChild(W), G.appendChild($);
|
|
6446
6438
|
const g = document.createElement("div");
|
|
6447
6439
|
g.className = "wgt:w-full wgt:flex wgt:justify-center", u.appendChild(g);
|
|
6448
|
-
const m =
|
|
6440
|
+
const m = lt({
|
|
6449
6441
|
type: "button",
|
|
6450
|
-
title:
|
|
6442
|
+
title: i("completeRegistration"),
|
|
6451
6443
|
className: "wgt:text-white",
|
|
6452
6444
|
handleClick: typeof e == "function" && e
|
|
6453
6445
|
});
|
|
@@ -6551,8 +6543,8 @@ function ph(n, t) {
|
|
|
6551
6543
|
function c() {
|
|
6552
6544
|
const o = eh(e);
|
|
6553
6545
|
if (o !== h) {
|
|
6554
|
-
const
|
|
6555
|
-
h = o, n(o,
|
|
6546
|
+
const s = h;
|
|
6547
|
+
h = o, n(o, s);
|
|
6556
6548
|
}
|
|
6557
6549
|
}
|
|
6558
6550
|
window.addEventListener("popstate", c), e && window.addEventListener("hashchange", c);
|
|
@@ -6617,7 +6609,7 @@ function Hc({
|
|
|
6617
6609
|
settingUrl: h = "",
|
|
6618
6610
|
providerName: c = "M-Invoice"
|
|
6619
6611
|
} = {}) {
|
|
6620
|
-
const A =
|
|
6612
|
+
const A = i("notification", { provider: c }), u = i("settings"), o = i("next");
|
|
6621
6613
|
document.querySelectorAll('[data-wgt-warning-popup="true"]').forEach((X) => {
|
|
6622
6614
|
try {
|
|
6623
6615
|
X.remove();
|
|
@@ -6782,14 +6774,14 @@ function Hc({
|
|
|
6782
6774
|
}
|
|
6783
6775
|
return { container: q, open: Q, close: N };
|
|
6784
6776
|
}
|
|
6785
|
-
let
|
|
6777
|
+
let Xt = null, Ah = !1;
|
|
6786
6778
|
function Pc() {
|
|
6787
|
-
return Ah ? Promise.resolve(null) : (window.__sdkInitPromise && (
|
|
6779
|
+
return Ah ? Promise.resolve(null) : (window.__sdkInitPromise && (Xt = window.__sdkInitPromise), Xt || (Xt = lh(
|
|
6788
6780
|
oh(),
|
|
6789
6781
|
uh().invoiceHubBaseUrl
|
|
6790
6782
|
).catch((n) => {
|
|
6791
|
-
console.error("Model init failed:", n), Ah = !0,
|
|
6792
|
-
}), window.__sdkInitPromise =
|
|
6783
|
+
console.error("Model init failed:", n), Ah = !0, Xt = null, window.__sdkInitPromise = null;
|
|
6784
|
+
}), window.__sdkInitPromise = Xt), Xt);
|
|
6793
6785
|
}
|
|
6794
6786
|
async function kc(n, t) {
|
|
6795
6787
|
const [e, a] = await Promise.all([
|
|
@@ -6820,13 +6812,13 @@ async function T0(n, t, e, a = !1, h = "ocb", c = "", A = null, u = "M-Invoice")
|
|
|
6820
6812
|
details: { [A]: !!l?.isNewCustomer }
|
|
6821
6813
|
};
|
|
6822
6814
|
}
|
|
6823
|
-
let
|
|
6815
|
+
let s = null;
|
|
6824
6816
|
if (a) {
|
|
6825
|
-
|
|
6817
|
+
s = await Jt(n, t), e(o.isNewCustomer, s);
|
|
6826
6818
|
return;
|
|
6827
6819
|
}
|
|
6828
6820
|
if (!o.isNewCustomer) {
|
|
6829
|
-
|
|
6821
|
+
s = await Jt(n, t), await e(o.isNewCustomer, s), await new Promise((T) => setTimeout(T, 1e3)), (s?.organization?.name || s?.organization?.taxCode) && Hc({
|
|
6830
6822
|
settingUrl: c,
|
|
6831
6823
|
onCancel: () => {
|
|
6832
6824
|
},
|
|
@@ -6859,14 +6851,14 @@ async function Lc(n, t, e, a, h, c) {
|
|
|
6859
6851
|
} catch (Y) {
|
|
6860
6852
|
console.warn("Failed to fetch tax code whitelist", Y);
|
|
6861
6853
|
}
|
|
6862
|
-
const o = (a?.taxCode || "").replace(/[-\s]/g, ""),
|
|
6854
|
+
const o = (a?.taxCode || "").replace(/[-\s]/g, ""), s = A.filter((Y) => Y.route === "m-invoice" ? !0 : Y.route === "one-invoice" ? (u || []).some(
|
|
6863
6855
|
(j) => (j || "").replace(/[-\s]/g, "") === o
|
|
6864
6856
|
) : !1);
|
|
6865
6857
|
function l(Y = !1) {
|
|
6866
6858
|
return [
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
Y ?
|
|
6859
|
+
i("stepInfo"),
|
|
6860
|
+
i("stepPlan"),
|
|
6861
|
+
Y ? i("stepConfirm", "Xác nhận") : i("stepPayment")
|
|
6870
6862
|
];
|
|
6871
6863
|
}
|
|
6872
6864
|
let T = Jh({
|
|
@@ -6874,7 +6866,7 @@ async function Lc(n, t, e, a, h, c) {
|
|
|
6874
6866
|
currentStep: 1
|
|
6875
6867
|
}), { container: r, setStep: q, setContent: x } = T;
|
|
6876
6868
|
n.dataset.theme = h || "default", n.classList.add("wgt:mx-auto", "wgt:@container"), n.appendChild(r);
|
|
6877
|
-
let w = 1, b = /* @__PURE__ */ new Set(), y =
|
|
6869
|
+
let w = 1, b = /* @__PURE__ */ new Set(), y = s[0], I = {
|
|
6878
6870
|
_userHasEditedTaxCode: !1,
|
|
6879
6871
|
eInvoiceRegistration: {
|
|
6880
6872
|
taxAuthorityCode: "",
|
|
@@ -6920,7 +6912,7 @@ async function Lc(n, t, e, a, h, c) {
|
|
|
6920
6912
|
qtySignaturePkg: 1
|
|
6921
6913
|
};
|
|
6922
6914
|
function G() {
|
|
6923
|
-
y =
|
|
6915
|
+
y = s[0], I = {
|
|
6924
6916
|
eInvoiceRegistration: {
|
|
6925
6917
|
taxAuthorityCode: "",
|
|
6926
6918
|
invoiceSymbol: "",
|
|
@@ -7059,14 +7051,14 @@ async function Lc(n, t, e, a, h, c) {
|
|
|
7059
7051
|
isNewCustomer: d,
|
|
7060
7052
|
isRenewal: c,
|
|
7061
7053
|
providerProps: {
|
|
7062
|
-
providers:
|
|
7054
|
+
providers: s,
|
|
7063
7055
|
selectedRoute: y.route,
|
|
7064
7056
|
onProviderChange: async (O) => {
|
|
7065
7057
|
y = O, await T0(
|
|
7066
7058
|
O.route,
|
|
7067
7059
|
I?.eInvoiceRegistration?.organization?.taxCode,
|
|
7068
|
-
(
|
|
7069
|
-
d =
|
|
7060
|
+
(un, Pn) => {
|
|
7061
|
+
d = un, m(Pn);
|
|
7070
7062
|
},
|
|
7071
7063
|
c,
|
|
7072
7064
|
h,
|
|
@@ -7166,7 +7158,7 @@ async function Lc(n, t, e, a, h, c) {
|
|
|
7166
7158
|
} else if (Y === 3) {
|
|
7167
7159
|
const K = Lt(k) === 0;
|
|
7168
7160
|
T.updateTitle(
|
|
7169
|
-
K ?
|
|
7161
|
+
K ? i("orderConfirmation", "Xác nhận đơn hàng") : i("stepPayment")
|
|
7170
7162
|
);
|
|
7171
7163
|
const { container: O } = await lc({
|
|
7172
7164
|
onNext: () => {
|
|
@@ -7198,8 +7190,8 @@ async function Lc(n, t, e, a, h, c) {
|
|
|
7198
7190
|
},
|
|
7199
7191
|
onResetToStep1: $
|
|
7200
7192
|
},
|
|
7201
|
-
setOrderId: (
|
|
7202
|
-
E =
|
|
7193
|
+
setOrderId: (un) => {
|
|
7194
|
+
E = un;
|
|
7203
7195
|
}
|
|
7204
7196
|
});
|
|
7205
7197
|
x(O);
|
|
@@ -7226,7 +7218,7 @@ async function Lc(n, t, e, a, h, c) {
|
|
|
7226
7218
|
I?.eInvoiceRegistration?.organization?.taxCode,
|
|
7227
7219
|
async (Y, j) => {
|
|
7228
7220
|
C = !1, d = Y, m(j), T.updateTitle(
|
|
7229
|
-
c ?
|
|
7221
|
+
c ? i("eInvoiceRenewal") : i("eInvoiceRegister")
|
|
7230
7222
|
);
|
|
7231
7223
|
},
|
|
7232
7224
|
c,
|
|
@@ -7254,14 +7246,14 @@ async function Ic(n, t, e, a) {
|
|
|
7254
7246
|
}
|
|
7255
7247
|
});
|
|
7256
7248
|
c(o), n.appendChild(h);
|
|
7257
|
-
const
|
|
7249
|
+
const s = ph(
|
|
7258
7250
|
() => {
|
|
7259
7251
|
l();
|
|
7260
7252
|
},
|
|
7261
7253
|
{ includeHash: !1 }
|
|
7262
7254
|
);
|
|
7263
7255
|
function l() {
|
|
7264
|
-
|
|
7256
|
+
s(), n && n.parentNode && (n.innerHTML = "");
|
|
7265
7257
|
}
|
|
7266
7258
|
return { destroy: l };
|
|
7267
7259
|
}
|