@invoice-sdk/widget 1.83.0 → 1.84.0
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-iItXF0yB.js → index-Cq9L8YYf.js} +1574 -1552
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +36 -36
- package/dist/{widget-DfCPgbie.js → widget-nZAe6yLG.js} +994 -997
- package/package.json +1 -1
|
@@ -12,15 +12,15 @@ var $B = (g, A, E) => A in g ? BQ(g, A, { enumerable: !0, configurable: !0, writ
|
|
|
12
12
|
}, bA = (g, A) => CQ(g, QQ(A));
|
|
13
13
|
var Og = (g, A) => {
|
|
14
14
|
var E = {};
|
|
15
|
-
for (var
|
|
16
|
-
AC.call(g,
|
|
15
|
+
for (var Q in g)
|
|
16
|
+
AC.call(g, Q) && A.indexOf(Q) < 0 && (E[Q] = g[Q]);
|
|
17
17
|
if (g != null && Tg)
|
|
18
|
-
for (var
|
|
19
|
-
A.indexOf(
|
|
18
|
+
for (var Q of Tg(g))
|
|
19
|
+
A.indexOf(Q) < 0 && gC.call(g, Q) && (E[Q] = g[Q]);
|
|
20
20
|
return E;
|
|
21
21
|
};
|
|
22
|
-
var V = (g, A, E) => new Promise((
|
|
23
|
-
var
|
|
22
|
+
var V = (g, A, E) => new Promise((Q, B) => {
|
|
23
|
+
var C = (n) => {
|
|
24
24
|
try {
|
|
25
25
|
I(E.next(n));
|
|
26
26
|
} catch (o) {
|
|
@@ -32,10 +32,10 @@ var V = (g, A, E) => new Promise((C, B) => {
|
|
|
32
32
|
} catch (o) {
|
|
33
33
|
B(o);
|
|
34
34
|
}
|
|
35
|
-
}, I = (n) => n.done ?
|
|
35
|
+
}, I = (n) => n.done ? Q(n.value) : Promise.resolve(n.value).then(C, t);
|
|
36
36
|
I((E = E.apply(g, A)).next());
|
|
37
37
|
});
|
|
38
|
-
import { t as a, g as wB, a as EQ, b as IQ, G as nQ, C as tQ, c as eB, d as ag, e as hQ, f as cQ, h as Yg, O as zC, s as Qg, i as aB, j as wQ, k as eQ, l as aQ, m as oQ, n as DQ, o as uQ, v as iQ, r as NC, u as bC } from "./index-
|
|
38
|
+
import { t as a, g as wB, a as EQ, b as IQ, G as nQ, C as tQ, c as eB, d as ag, e as hQ, f as cQ, h as Yg, O as zC, s as Qg, i as aB, j as wQ, k as eQ, l as aQ, m as oQ, n as DQ, o as uQ, v as iQ, r as NC, u as bC } from "./index-Cq9L8YYf.js";
|
|
39
39
|
import { g as jC } from "./_commonjsHelpers-bAxELxBV.js";
|
|
40
40
|
function BC({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
41
41
|
const E = document.createElement("div");
|
|
@@ -47,8 +47,8 @@ function BC({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
|
47
47
|
"wgt:overflow-hidden",
|
|
48
48
|
"wgt:shadow-sm"
|
|
49
49
|
].join(" ");
|
|
50
|
-
const
|
|
51
|
-
|
|
50
|
+
const Q = document.createElement("div");
|
|
51
|
+
Q.className = [
|
|
52
52
|
"wgt:absolute",
|
|
53
53
|
"wgt:inset-0",
|
|
54
54
|
"wgt:transition-all",
|
|
@@ -56,13 +56,13 @@ function BC({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
|
56
56
|
"wgt:rounded-r-md",
|
|
57
57
|
"wgt:@max-2xl:hidden",
|
|
58
58
|
"wgt:bg-primary/15"
|
|
59
|
-
].join(" "),
|
|
59
|
+
].join(" "), Q.style.clipPath = "polygon(0 0, calc(100% - 36px) 0, 100% 50%, calc(100% - 36px) 100%, 0 100%)";
|
|
60
60
|
const B = document.createElement("div");
|
|
61
61
|
B.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";
|
|
62
|
-
const
|
|
62
|
+
const C = [];
|
|
63
63
|
function t(n) {
|
|
64
|
-
g.forEach((o,
|
|
65
|
-
const i =
|
|
64
|
+
g.forEach((o, h) => {
|
|
65
|
+
const i = h + 1, c = n === g.length + 1 ? i < g.length : n !== i, D = document.createElement("div");
|
|
66
66
|
D.setAttribute("role", "listitem"), D.setAttribute(
|
|
67
67
|
"aria-label",
|
|
68
68
|
`Step ${i} of ${g.length}: ${o.label}`
|
|
@@ -73,8 +73,8 @@ function BC({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
|
73
73
|
"wgt:justify-center",
|
|
74
74
|
"wgt:py-5",
|
|
75
75
|
"wgt:px-4",
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
h < g.length - 1 ? "wgt:pr-9 wgt:@max-2xl:pr-0" : "",
|
|
77
|
+
c ? "wgt:@max-2xl:hidden" : "wgt:@max-2xl:bg-primary/15"
|
|
78
78
|
].filter(Boolean).join(" ");
|
|
79
79
|
const s = document.createElement("div");
|
|
80
80
|
s.className = [
|
|
@@ -89,14 +89,14 @@ function BC({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
|
89
89
|
const q = document.createElement("span");
|
|
90
90
|
q.innerText = String(i), q.className = "wgt:text-white wgt:font-medium", s.appendChild(q);
|
|
91
91
|
const F = document.createElement("span");
|
|
92
|
-
F.innerText = o.label, F.className = "wgt:font-medium wgt:whitespace-nowrap", D.append(s, F), B.append(D),
|
|
93
|
-
}), E.append(
|
|
92
|
+
F.innerText = o.label, F.className = "wgt:font-medium wgt:whitespace-nowrap", D.append(s, F), B.append(D), C.push({ wrap: D, circle: s, label: F });
|
|
93
|
+
}), E.append(Q, B);
|
|
94
94
|
}
|
|
95
95
|
t(A);
|
|
96
96
|
function I(n) {
|
|
97
|
-
const o = g.length,
|
|
98
|
-
|
|
99
|
-
s + 1 <=
|
|
97
|
+
const o = g.length, h = Math.max(0, Math.min(n, o)), i = h / o * 100;
|
|
98
|
+
Q.style.width = `${i}%`, h === o ? (Q.style.clipPath = "none", Q.style.borderTopRightRadius = "10px", Q.style.borderBottomRightRadius = "10px") : (Q.style.clipPath = "polygon(0 0, calc(100% - 36px) 0, 100% 50%, calc(100% - 36px) 100%, 0 100%)", Q.style.borderTopRightRadius = "0", Q.style.borderBottomRightRadius = "0"), C.forEach(({ circle: c, label: D }, s) => {
|
|
99
|
+
s + 1 <= h ? (c.classList.add("wgt:bg-icon-primary"), c.classList.remove("wgt:bg-icon-soft-400"), D.classList.add("wgt:text-primary-dark"), D.classList.remove("wgt:text-soft-400")) : (c.classList.add("wgt:bg-icon-soft-400"), c.classList.remove("wgt:bg-icon-primary"), D.classList.add("wgt:text-soft-400"), D.classList.remove("wgt:text-primary-dark"));
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
return I(A), {
|
|
@@ -121,13 +121,13 @@ function sQ({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
|
121
121
|
"wgt:py-8",
|
|
122
122
|
"wgt:overflow-auto"
|
|
123
123
|
].join(" ");
|
|
124
|
-
const
|
|
125
|
-
|
|
124
|
+
const Q = document.createElement("h1");
|
|
125
|
+
Q.className = [
|
|
126
126
|
"wgt:text-[28px]",
|
|
127
127
|
"wgt:font-bold",
|
|
128
128
|
"wgt:leading-[30px]",
|
|
129
129
|
"wgt:text-strong-950"
|
|
130
|
-
].join(" "),
|
|
130
|
+
].join(" "), Q.innerText = a("widgetTitle");
|
|
131
131
|
const B = document.createElement("div");
|
|
132
132
|
B.className = [
|
|
133
133
|
"wgt:w-full",
|
|
@@ -147,29 +147,29 @@ function sQ({ steps: g = [], currentStep: A = 1 } = {}) {
|
|
|
147
147
|
"wgt:@max-2xl:border-none",
|
|
148
148
|
"wgt:@max-2xl:shadow-none"
|
|
149
149
|
].join(" ");
|
|
150
|
-
let
|
|
150
|
+
let C = BC({
|
|
151
151
|
steps: g.map((o) => ({ label: o })),
|
|
152
152
|
currentStep: A
|
|
153
153
|
});
|
|
154
|
-
B.appendChild(
|
|
154
|
+
B.appendChild(C.container);
|
|
155
155
|
const t = document.createElement("div");
|
|
156
|
-
t.className = "wgt:flex-1", B.appendChild(t), E.appendChild(
|
|
156
|
+
t.className = "wgt:flex-1", B.appendChild(t), E.appendChild(Q), E.appendChild(B);
|
|
157
157
|
function I() {
|
|
158
|
-
|
|
158
|
+
Q.innerText = a("widgetTitle");
|
|
159
159
|
}
|
|
160
160
|
function n(o) {
|
|
161
|
-
|
|
162
|
-
steps: o.map((
|
|
161
|
+
C.container.remove(), C = BC({
|
|
162
|
+
steps: o.map((h) => ({ label: h })),
|
|
163
163
|
currentStep: A
|
|
164
|
-
}), B.insertBefore(
|
|
164
|
+
}), B.insertBefore(C.container, t);
|
|
165
165
|
}
|
|
166
166
|
return {
|
|
167
167
|
container: E,
|
|
168
168
|
/**
|
|
169
169
|
* Change which step is active (1‐based index):
|
|
170
170
|
*/
|
|
171
|
-
setStep(o,
|
|
172
|
-
A = o, n(
|
|
171
|
+
setStep(o, h) {
|
|
172
|
+
A = o, n(h), C.update(o);
|
|
173
173
|
},
|
|
174
174
|
/**
|
|
175
175
|
* Replace whatever content is inside the "children" area:
|
|
@@ -186,15 +186,15 @@ function Jg({
|
|
|
186
186
|
name: g,
|
|
187
187
|
value: A = "",
|
|
188
188
|
label: E = "",
|
|
189
|
-
checked:
|
|
189
|
+
checked: Q = !1,
|
|
190
190
|
onChange: B,
|
|
191
|
-
disabled:
|
|
191
|
+
disabled: C = !1,
|
|
192
192
|
isIconCheckbox: t = !1
|
|
193
193
|
}) {
|
|
194
194
|
const I = document.createElement("div");
|
|
195
195
|
if (I.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:cursor-pointer", t) {
|
|
196
|
-
let i = function(
|
|
197
|
-
|
|
196
|
+
let i = function(c) {
|
|
197
|
+
c ? (o.classList.add("wgt:bg-primary", "wgt:border-primary"), o.classList.remove("wgt:border-weak-50")) : (o.classList.remove("wgt:bg-primary", "wgt:border-primary"), o.classList.add("wgt:border-weak-50")), h.innerHTML = c ? `<svg width="10" height="8" viewBox="0 0 10 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
198
198
|
<mask id="path-1-inside-1_14170_92697" fill="white">
|
|
199
199
|
<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"/>
|
|
200
200
|
</mask>
|
|
@@ -214,7 +214,7 @@ function Jg({
|
|
|
214
214
|
<path d="M7 13.75V12.25C7.41843 12.25 7.75 12.5816 7.75 13H6.25H4.75C4.75 14.2384 5.76157 15.25 7 15.25V13.75ZM6.25 13H7.75V1H6.25H4.75V13H6.25ZM6.25 1H7.75C7.75 1.41843 7.41843 1.75 7 1.75V0.25V-1.25C5.76157 -1.25 4.75 -0.238427 4.75 1H6.25ZM7 0.25V1.75C6.58157 1.75 6.25 1.41843 6.25 1H7.75H9.25C9.25 -0.238427 8.23843 -1.25 7 -1.25V0.25ZM7.75 1H6.25V13H7.75H9.25V1H7.75ZM7.75 13H6.25C6.25 12.5816 6.58157 12.25 7 12.25V13.75V15.25C8.23843 15.25 9.25 14.2384 9.25 13H7.75Z" fill="#0E121B" mask="url(#path-3-inside-2_10693_173154)"/>
|
|
215
215
|
</svg>
|
|
216
216
|
`;
|
|
217
|
-
}, n =
|
|
217
|
+
}, n = Q;
|
|
218
218
|
const o = document.createElement("div");
|
|
219
219
|
o.className = [
|
|
220
220
|
"wgt:w-7",
|
|
@@ -225,26 +225,26 @@ function Jg({
|
|
|
225
225
|
"wgt:items-center",
|
|
226
226
|
"wgt:justify-center",
|
|
227
227
|
"wgt:transition-colors",
|
|
228
|
-
|
|
228
|
+
C ? "wgt:cursor-not-allowed" : "wgt:cursor-pointer"
|
|
229
229
|
].join(" ");
|
|
230
|
-
const
|
|
231
|
-
i(
|
|
232
|
-
|
|
230
|
+
const h = document.createElement("div");
|
|
231
|
+
i(Q), o.appendChild(h), o.addEventListener("click", (c) => {
|
|
232
|
+
c.stopPropagation(), !C && (n = !n, i(n), B(n));
|
|
233
233
|
}), I.append(o);
|
|
234
234
|
} else {
|
|
235
235
|
const n = document.createElement("div");
|
|
236
236
|
n.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";
|
|
237
237
|
const o = document.createElement("input");
|
|
238
|
-
o.type = "radio", g && (o.name = g), A && (o.value = A), o.checked =
|
|
239
|
-
const
|
|
240
|
-
|
|
238
|
+
o.type = "radio", g && (o.name = g), A && (o.value = A), o.checked = Q, o.disabled = C, o.className = "wgt:invisible wgt:h-6 wgt:w-6";
|
|
239
|
+
const h = document.createElement("div");
|
|
240
|
+
h.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
|
|
241
241
|
|
|
242
|
-
${
|
|
242
|
+
${Q ? "wgt:ring-primary wgt:bg-primary" : "wgt:ring-grey-6 wgt:bg-grey-6"}`;
|
|
243
243
|
const i = document.createElement("span");
|
|
244
|
-
i.innerText = E, o.addEventListener("change", (
|
|
245
|
-
const D =
|
|
244
|
+
i.innerText = E, o.addEventListener("change", (c) => {
|
|
245
|
+
const D = c.target.checked;
|
|
246
246
|
typeof B == "function" && B(D), o.checked = !1;
|
|
247
|
-
}), n.append(o, i), n.append(
|
|
247
|
+
}), n.append(o, i), n.append(h), I.append(n);
|
|
248
248
|
}
|
|
249
249
|
return {
|
|
250
250
|
container: I
|
|
@@ -255,12 +255,12 @@ function fQ({
|
|
|
255
255
|
selectedRoute: A = null,
|
|
256
256
|
onProviderChange: E
|
|
257
257
|
}) {
|
|
258
|
-
const C = document.createElement("div");
|
|
259
|
-
C.className = "wgt:max-w-[1072px] wgt:mx-auto wgt:w-full wgt:flex wgt:flex-col wgt:gap-2";
|
|
260
|
-
const B = document.createElement("h2");
|
|
261
|
-
B.className = "wgt:text-sm wgt:font-semibold wgt:text-black", B.innerText = a("selectProvider"), C.appendChild(B);
|
|
262
258
|
const Q = document.createElement("div");
|
|
263
|
-
Q.className = [
|
|
259
|
+
Q.className = "wgt:max-w-[1072px] wgt:mx-auto wgt:w-full wgt:flex wgt:flex-col wgt:gap-2";
|
|
260
|
+
const B = document.createElement("h2");
|
|
261
|
+
B.className = "wgt:text-sm wgt:font-semibold wgt:text-black", B.innerText = a("selectProvider"), Q.appendChild(B);
|
|
262
|
+
const C = document.createElement("div");
|
|
263
|
+
C.className = [
|
|
264
264
|
"wgt:w-full",
|
|
265
265
|
"wgt:grid",
|
|
266
266
|
"wgt:grid-flow-col",
|
|
@@ -273,11 +273,11 @@ function fQ({
|
|
|
273
273
|
"wgt:snap-mandatory",
|
|
274
274
|
"wgt:cursor-grab",
|
|
275
275
|
"wgt:select-none"
|
|
276
|
-
].join(" "),
|
|
276
|
+
].join(" "), C.style.scrollSnapType = "x mandatory", C.style.overflowX = "auto", C.style.scrollBehavior = "smooth", C.style.scrollbarWidth = "none", C.style.msOverflowStyle = "none", C.style.WebkitOverflowScrolling = "touch", C.style.overflowY = "hidden", Q.appendChild(C);
|
|
277
277
|
function t() {
|
|
278
|
-
|
|
279
|
-
const i =
|
|
280
|
-
|
|
278
|
+
C.innerHTML = "", g.forEach((h) => {
|
|
279
|
+
const i = h.route === A, c = document.createElement("div");
|
|
280
|
+
c.dataset.checked = i ? "true" : "false", c.className = [
|
|
281
281
|
"wgt:flex",
|
|
282
282
|
"wgt:items-center",
|
|
283
283
|
"wgt:justify-between",
|
|
@@ -291,47 +291,47 @@ function fQ({
|
|
|
291
291
|
"wgt:transition-colors",
|
|
292
292
|
"wgt:duration-200",
|
|
293
293
|
i ? "wgt:border-primary" : ""
|
|
294
|
-
].filter(Boolean).join(" "),
|
|
295
|
-
A =
|
|
294
|
+
].filter(Boolean).join(" "), c.addEventListener("click", () => {
|
|
295
|
+
A = h.route, typeof E == "function" && E(h), t();
|
|
296
296
|
});
|
|
297
297
|
const D = document.createElement("div");
|
|
298
298
|
D.className = "wgt:flex wgt:items-center wgt:gap-3";
|
|
299
299
|
const s = document.createElement("img");
|
|
300
|
-
s.src =
|
|
300
|
+
s.src = h.logoUrl, s.alt = h.name, s.className = "wgt:h-8 wgt:object-contain";
|
|
301
301
|
const q = document.createElement("div");
|
|
302
302
|
q.className = "wgt:w-[1px] wgt:h-8 wgt:bg-border-light";
|
|
303
303
|
const F = document.createElement("label");
|
|
304
|
-
F.className = "wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-black wgt:uppercase", F.innerText =
|
|
304
|
+
F.className = "wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-black wgt:uppercase", F.innerText = h.name, D.appendChild(s), D.appendChild(q), D.appendChild(F);
|
|
305
305
|
const { container: J } = Jg({
|
|
306
306
|
checked: i,
|
|
307
307
|
onChange: (H) => {
|
|
308
|
-
H && (A =
|
|
308
|
+
H && (A = h.route, typeof E == "function" && E(h), t());
|
|
309
309
|
},
|
|
310
310
|
disabled: !1
|
|
311
311
|
// Disable checkbox for FPT
|
|
312
312
|
});
|
|
313
|
-
|
|
313
|
+
c.appendChild(D), c.appendChild(J), C.appendChild(c);
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
316
|
t();
|
|
317
317
|
let I = !1, n, o;
|
|
318
|
-
return
|
|
319
|
-
I = !0,
|
|
318
|
+
return C.addEventListener("mousedown", (h) => {
|
|
319
|
+
I = !0, C.classList.replace("wgt:cursor-grab", "wgt:cursor-grabbing"), n = h.pageX - C.offsetLeft, o = C.scrollLeft;
|
|
320
320
|
}), document.addEventListener("mouseup", () => {
|
|
321
|
-
I = !1,
|
|
322
|
-
}),
|
|
323
|
-
I = !1,
|
|
324
|
-
}),
|
|
321
|
+
I = !1, C.classList.replace("wgt:cursor-grabbing", "wgt:cursor-grab");
|
|
322
|
+
}), C.addEventListener("mouseleave", () => {
|
|
323
|
+
I = !1, C.classList.replace("wgt:cursor-grabbing", "wgt:cursor-grab");
|
|
324
|
+
}), C.addEventListener("mousemove", (h) => {
|
|
325
325
|
if (!I) return;
|
|
326
|
-
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
}),
|
|
330
|
-
|
|
326
|
+
h.preventDefault();
|
|
327
|
+
const c = (h.pageX - C.offsetLeft - n) * 1.5;
|
|
328
|
+
C.scrollLeft = o - c;
|
|
329
|
+
}), C.addEventListener("wheel", (h) => {
|
|
330
|
+
h.preventDefault(), C.scrollLeft += h.deltaY;
|
|
331
331
|
}), {
|
|
332
|
-
container:
|
|
333
|
-
setSelectedRoute(
|
|
334
|
-
A =
|
|
332
|
+
container: Q,
|
|
333
|
+
setSelectedRoute(h) {
|
|
334
|
+
A = h, t();
|
|
335
335
|
}
|
|
336
336
|
};
|
|
337
337
|
}
|
|
@@ -339,25 +339,25 @@ function dA({
|
|
|
339
339
|
name: g,
|
|
340
340
|
value: A = "",
|
|
341
341
|
type: E = "text",
|
|
342
|
-
placeholder:
|
|
342
|
+
placeholder: Q = "",
|
|
343
343
|
label: B,
|
|
344
|
-
required:
|
|
344
|
+
required: C = !1,
|
|
345
345
|
error: t = null,
|
|
346
346
|
onInput: I = null,
|
|
347
347
|
readOnly: n = !1,
|
|
348
348
|
horizontal: o = !1
|
|
349
349
|
}) {
|
|
350
|
-
const
|
|
351
|
-
if (
|
|
350
|
+
const h = document.createElement("div");
|
|
351
|
+
if (h.className = "wgt:w-full " + (o ? "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-center wgt:gap-2" : "wgt:flex wgt:flex-col wgt:gap-2"), B) {
|
|
352
352
|
const D = document.createElement("label");
|
|
353
|
-
if (D.htmlFor = g, D.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal", D.innerText = B,
|
|
353
|
+
if (D.htmlFor = g, D.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal", D.innerText = B, C) {
|
|
354
354
|
const s = document.createElement("span");
|
|
355
355
|
s.className = "wgt:text-red-500 wgt:ml-1", s.innerText = "*", D.appendChild(s);
|
|
356
356
|
}
|
|
357
|
-
|
|
357
|
+
h.appendChild(D);
|
|
358
358
|
}
|
|
359
359
|
const i = document.createElement("input");
|
|
360
|
-
i.type = E, i.name = g, i.id = g, i.value = A, i.placeholder =
|
|
360
|
+
i.type = E, i.name = g, i.id = g, i.value = A, i.placeholder = Q, i.readOnly = n, i.autocomplete = "off", i.autocapitalize = "off", i.spellcheck = !1, i.className = [
|
|
361
361
|
"wgt:col-span-4",
|
|
362
362
|
"wgt:w-full",
|
|
363
363
|
"wgt:border",
|
|
@@ -367,15 +367,15 @@ function dA({
|
|
|
367
367
|
"wgt:focus:outline-none",
|
|
368
368
|
t ? "wgt:border-red-500 wgt:focus:border-red-500" : "wgt:border-gray-300 wgt:focus:border-primary",
|
|
369
369
|
"wgt:bg-white"
|
|
370
|
-
].join(" "),
|
|
370
|
+
].join(" "), C && i.setAttribute("required", "true"), typeof I == "function" && i.addEventListener("input", I), E === "number" && i.addEventListener("wheel", (D) => {
|
|
371
371
|
D.preventDefault();
|
|
372
372
|
}, { passive: !1 });
|
|
373
|
-
const
|
|
374
|
-
return
|
|
375
|
-
container:
|
|
373
|
+
const c = document.createElement("span");
|
|
374
|
+
return c.className = "wgt:text-red-500 wgt:text-sm wgt:whitespace-nowrap", c.innerText = t || "", t || (c.style.display = "none"), h.appendChild(i), h.appendChild(c), {
|
|
375
|
+
container: h,
|
|
376
376
|
inputEl: i,
|
|
377
377
|
setError(D) {
|
|
378
|
-
D ? (
|
|
378
|
+
D ? (c.innerText = D, c.style.display = "block", i.classList.remove("wgt:border-gray-300", "wgt:focus:border-primary"), i.classList.add("wgt:border-red-500", "wgt:focus:border-red-500")) : (c.innerText = "", c.style.display = "none", i.classList.remove("wgt:border-red-500", "wgt:focus:border-red-500"), i.classList.add("wgt:border-gray-300", "wgt:focus:border-primary"));
|
|
379
379
|
},
|
|
380
380
|
getValue() {
|
|
381
381
|
return i.value;
|
|
@@ -386,26 +386,26 @@ function Gg({
|
|
|
386
386
|
name: g,
|
|
387
387
|
value: A = "",
|
|
388
388
|
options: E = [],
|
|
389
|
-
label:
|
|
389
|
+
label: Q,
|
|
390
390
|
disabled: B = !1,
|
|
391
|
-
error:
|
|
391
|
+
error: C = null,
|
|
392
392
|
onChange: t = null,
|
|
393
393
|
required: I = !1,
|
|
394
394
|
horizontal: n = !1,
|
|
395
395
|
searchable: o = !1
|
|
396
396
|
}) {
|
|
397
|
-
const
|
|
398
|
-
|
|
397
|
+
const h = document.createElement("div");
|
|
398
|
+
h.className = "wgt:w-full " + (n ? "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-center wgt:gap-2" : "wgt:flex wgt:flex-col wgt:gap-2");
|
|
399
399
|
const i = document.createElement("label");
|
|
400
|
-
if (i.htmlFor = g, i.className = "wgt:font-medium wgt:text-text-sub-600 wgt:whitespace-nowrap wgt:col-span-2", i.innerText =
|
|
401
|
-
const
|
|
402
|
-
|
|
400
|
+
if (i.htmlFor = g, i.className = "wgt:font-medium wgt:text-text-sub-600 wgt:whitespace-nowrap wgt:col-span-2", i.innerText = Q, h.appendChild(i), I) {
|
|
401
|
+
const c = document.createElement("span");
|
|
402
|
+
c.className = "wgt:text-red-500 wgt:ml-1", c.innerText = "*", i.appendChild(c);
|
|
403
403
|
}
|
|
404
404
|
if (o) {
|
|
405
|
-
const
|
|
406
|
-
|
|
405
|
+
const c = document.createElement("div");
|
|
406
|
+
c.className = "wgt:col-span-4 wgt:relative wgt:w-full";
|
|
407
407
|
const D = document.createElement("input");
|
|
408
|
-
D.type = "text", D.placeholder = `${a("search", "Tìm kiếm")} ${
|
|
408
|
+
D.type = "text", D.placeholder = `${a("search", "Tìm kiếm")} ${Q.toLowerCase()}...`, D.disabled = B, D.className = [
|
|
409
409
|
"wgt:border",
|
|
410
410
|
"wgt:rounded",
|
|
411
411
|
"wgt:px-3",
|
|
@@ -415,7 +415,7 @@ function Gg({
|
|
|
415
415
|
"wgt:focus:ring-2",
|
|
416
416
|
"wgt:focus:ring-blue-500",
|
|
417
417
|
"wgt:bg-white",
|
|
418
|
-
|
|
418
|
+
C ? "wgt:border-red-500" : "wgt:border-gray-300"
|
|
419
419
|
].join(" ");
|
|
420
420
|
const s = document.createElement("div");
|
|
421
421
|
s.className = "wgt:absolute wgt:top-full wgt:left-0 wgt:right-0 wgt:bg-white wgt:border wgt:border-gray-300 wgt:rounded wgt:shadow-lg wgt:z-50 wgt:hidden wgt:max-h-[500px] wgt:overflow-y-auto";
|
|
@@ -458,18 +458,18 @@ function Gg({
|
|
|
458
458
|
}), D.addEventListener("focus", () => {
|
|
459
459
|
s.classList.remove("wgt:hidden"), m();
|
|
460
460
|
}), document.addEventListener("click", (f) => {
|
|
461
|
-
|
|
461
|
+
c.contains(f.target) || s.classList.add("wgt:hidden");
|
|
462
462
|
}), D.addEventListener("keydown", (f) => {
|
|
463
463
|
f.key === "Escape" && s.classList.add("wgt:hidden");
|
|
464
|
-
}), s.appendChild(q),
|
|
464
|
+
}), s.appendChild(q), c.appendChild(D), c.appendChild(s), m();
|
|
465
465
|
const d = document.createElement("select");
|
|
466
466
|
d.style.display = "none", d.name = g, d.id = g, E.forEach((f) => {
|
|
467
467
|
const r = document.createElement("option");
|
|
468
468
|
r.value = f.value, r.innerText = f.label, f.value === A && (r.selected = !0), d.appendChild(r);
|
|
469
|
-
}),
|
|
469
|
+
}), h.appendChild(c), h.appendChild(d);
|
|
470
470
|
const v = document.createElement("span");
|
|
471
|
-
return v.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", v.innerText =
|
|
472
|
-
container:
|
|
471
|
+
return v.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", v.innerText = C || "", C || (v.style.display = "none"), h.appendChild(v), {
|
|
472
|
+
container: h,
|
|
473
473
|
selectEl: d,
|
|
474
474
|
setError(f) {
|
|
475
475
|
f ? (v.innerText = f, v.style.display = "block", D.classList.remove("wgt:border-gray-300"), D.classList.add("wgt:border-red-500")) : (v.innerText = "", v.style.display = "none", D.classList.remove("wgt:border-red-500"), D.classList.add("wgt:border-gray-300"));
|
|
@@ -493,12 +493,12 @@ function Gg({
|
|
|
493
493
|
}), m();
|
|
494
494
|
},
|
|
495
495
|
setDisabled(f) {
|
|
496
|
-
D.disabled = !!f, d.disabled = !!f, f ? (
|
|
496
|
+
D.disabled = !!f, d.disabled = !!f, f ? (c.classList.add("wgt:opacity-75"), s.classList.add("wgt:hidden")) : c.classList.remove("wgt:opacity-75");
|
|
497
497
|
}
|
|
498
498
|
};
|
|
499
499
|
} else {
|
|
500
|
-
const
|
|
501
|
-
|
|
500
|
+
const c = document.createElement("select");
|
|
501
|
+
c.id = g, c.name = g, c.disabled = B, c.className = [
|
|
502
502
|
"wgt:col-span-4",
|
|
503
503
|
"wgt:w-full",
|
|
504
504
|
"wgt:border",
|
|
@@ -509,33 +509,33 @@ function Gg({
|
|
|
509
509
|
"wgt:focus:ring-2",
|
|
510
510
|
"wgt:focus:ring-blue-500",
|
|
511
511
|
"wgt:bg-white",
|
|
512
|
-
|
|
512
|
+
C ? "wgt:border-red-500" : "wgt:border-gray-300"
|
|
513
513
|
].join(" ");
|
|
514
514
|
const D = document.createElement("option");
|
|
515
|
-
D.value = "", D.disabled = !0, D.selected = A === "" || A == null, D.innerText = `-- ${a("select", "Chọn")} ${
|
|
515
|
+
D.value = "", D.disabled = !0, D.selected = A === "" || A == null, D.innerText = `-- ${a("select", "Chọn")} ${Q.toLowerCase()} --`, c.appendChild(D), E.forEach((q) => {
|
|
516
516
|
const F = document.createElement("option");
|
|
517
|
-
F.value = q.value, F.innerText = q.label, q.value === A && (F.selected = !0),
|
|
518
|
-
}), typeof t == "function" &&
|
|
517
|
+
F.value = q.value, F.innerText = q.label, q.value === A && (F.selected = !0), c.appendChild(F);
|
|
518
|
+
}), typeof t == "function" && c.addEventListener("change", t), h.appendChild(c);
|
|
519
519
|
const s = document.createElement("span");
|
|
520
|
-
return s.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", s.innerText =
|
|
521
|
-
container:
|
|
522
|
-
selectEl:
|
|
520
|
+
return s.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", s.innerText = C || "", C || (s.style.display = "none"), h.appendChild(s), {
|
|
521
|
+
container: h,
|
|
522
|
+
selectEl: c,
|
|
523
523
|
setError(q) {
|
|
524
|
-
q ? (s.innerText = q, s.style.display = "block",
|
|
524
|
+
q ? (s.innerText = q, s.style.display = "block", c.classList.remove("wgt:border-gray-300"), c.classList.add("wgt:border-red-500")) : (s.innerText = "", s.style.display = "none", c.classList.remove("wgt:border-red-500"), c.classList.add("wgt:border-gray-300"));
|
|
525
525
|
},
|
|
526
526
|
getValue() {
|
|
527
|
-
return
|
|
527
|
+
return c.value;
|
|
528
528
|
},
|
|
529
529
|
setOptions(q) {
|
|
530
|
-
for (;
|
|
531
|
-
|
|
530
|
+
for (; c.options.length > 1; )
|
|
531
|
+
c.remove(1);
|
|
532
532
|
q.forEach((F) => {
|
|
533
533
|
const J = document.createElement("option");
|
|
534
|
-
J.value = F.value, J.innerText = F.label,
|
|
534
|
+
J.value = F.value, J.innerText = F.label, c.appendChild(J);
|
|
535
535
|
});
|
|
536
536
|
},
|
|
537
537
|
setDisabled(q) {
|
|
538
|
-
|
|
538
|
+
c.disabled = !!q;
|
|
539
539
|
}
|
|
540
540
|
};
|
|
541
541
|
}
|
|
@@ -544,11 +544,11 @@ function Ig({
|
|
|
544
544
|
title: g,
|
|
545
545
|
isDisabled: A = !1,
|
|
546
546
|
handleClick: E = null,
|
|
547
|
-
type:
|
|
547
|
+
type: Q = "button",
|
|
548
548
|
className: B = ""
|
|
549
549
|
} = {}) {
|
|
550
|
-
const
|
|
551
|
-
return
|
|
550
|
+
const C = document.createElement("button");
|
|
551
|
+
return C.type = Q, C.disabled = A, C.className = [
|
|
552
552
|
"wgt:bg-primary",
|
|
553
553
|
"wgt:hover:bg-primary-dark",
|
|
554
554
|
"wgt:px-6",
|
|
@@ -558,26 +558,26 @@ function Ig({
|
|
|
558
558
|
"wgt:disabled:cursor-not-allowed",
|
|
559
559
|
"wgt:cursor-pointer",
|
|
560
560
|
B
|
|
561
|
-
].filter(Boolean).join(" "),
|
|
562
|
-
if (!
|
|
563
|
-
|
|
561
|
+
].filter(Boolean).join(" "), C.innerText = g, typeof E == "function" && C.addEventListener("click", (t) => V(null, null, function* () {
|
|
562
|
+
if (!C.disabled) {
|
|
563
|
+
C.disabled = !0;
|
|
564
564
|
try {
|
|
565
565
|
yield E(t);
|
|
566
566
|
} catch (I) {
|
|
567
567
|
console.error("Button click handler error:", I);
|
|
568
568
|
} finally {
|
|
569
|
-
|
|
569
|
+
C.disabled = !1;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
})),
|
|
572
|
+
})), C;
|
|
573
573
|
}
|
|
574
574
|
function CC({
|
|
575
575
|
label: g,
|
|
576
576
|
required: A = !1,
|
|
577
577
|
file: E = null,
|
|
578
|
-
onFileChange:
|
|
578
|
+
onFileChange: Q,
|
|
579
579
|
error: B = null,
|
|
580
|
-
accept:
|
|
580
|
+
accept: C = ""
|
|
581
581
|
}) {
|
|
582
582
|
const t = document.createElement("form");
|
|
583
583
|
t.className = "wgt:flex wgt:flex-col";
|
|
@@ -586,7 +586,7 @@ function CC({
|
|
|
586
586
|
const P = document.createElement("span");
|
|
587
587
|
P.className = "wgt:text-red-500 wgt:ml-1", P.innerText = "*", I.appendChild(P);
|
|
588
588
|
}
|
|
589
|
-
const n =
|
|
589
|
+
const n = C ? C.split(",").map((P) => P.trim().startsWith("image/") ? P.replace("image/", "").toUpperCase() : P.trim().startsWith(".") ? P.replace(".", "").toUpperCase() : P.toUpperCase().replace("/*", "")).filter(Boolean).join(", ") : `JPG, PNG ${a("or")} JPEG`;
|
|
590
590
|
I.innerHTML += ` <span class="wgt:text-xs wgt:font-normal wgt:leading-4 wgt:text-soft-400">(${a("fileFormat")} ${n}. ${a("maxFileSize")})</span>`, t.appendChild(I);
|
|
591
591
|
const o = document.createElement("div");
|
|
592
592
|
o.className = [
|
|
@@ -600,21 +600,21 @@ function CC({
|
|
|
600
600
|
"wgt:justify-start",
|
|
601
601
|
"wgt:gap-2"
|
|
602
602
|
].join(" ");
|
|
603
|
-
const
|
|
604
|
-
|
|
603
|
+
const h = document.createElement("input");
|
|
604
|
+
h.accept = C || "image/png, image/jpeg, .jpg, .jpeg, .png", h.id = "upload", h.type = "file", h.className = "wgt:hidden";
|
|
605
605
|
const i = document.createElement("div");
|
|
606
606
|
i.className = "wgt:w-full wgt:flex wgt:gap-1 wgt:items-start wgt:justify-start";
|
|
607
|
-
const
|
|
608
|
-
|
|
607
|
+
const c = document.createElement("span");
|
|
608
|
+
c.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", c.innerText = B || "", B || (c.style.display = "none");
|
|
609
609
|
let D = null;
|
|
610
610
|
function s(P) {
|
|
611
|
-
D = P, P ? (
|
|
611
|
+
D = P, P ? (c.innerText = P, c.style.display = "block") : (c.innerText = "", c.style.display = "none");
|
|
612
612
|
}
|
|
613
613
|
const q = Ig({
|
|
614
614
|
title: "Upload file",
|
|
615
615
|
className: "wgt:bg-primary wgt:hover:bg-primary-dark wgt:text-white wgt:px-6 wgt:py-1 wgt:rounded-md wgt:cursor-pointer",
|
|
616
616
|
handleClick: (P) => {
|
|
617
|
-
P.stopPropagation(),
|
|
617
|
+
P.stopPropagation(), h.click();
|
|
618
618
|
}
|
|
619
619
|
});
|
|
620
620
|
function F(P, m = 2) {
|
|
@@ -624,14 +624,14 @@ function CC({
|
|
|
624
624
|
}
|
|
625
625
|
function J(P) {
|
|
626
626
|
const m = P.type.toLowerCase(), d = "." + P.name.split(".").pop().toLowerCase();
|
|
627
|
-
return
|
|
627
|
+
return h.accept.split(",").map((f) => f.trim().toLowerCase()).filter(Boolean).some((f) => f.startsWith(".") ? f === d : f.endsWith("/*") ? m.startsWith(f.replace("/*", "")) : m === f);
|
|
628
628
|
}
|
|
629
629
|
function H(P) {
|
|
630
630
|
if (i.innerHTML = "", s(null), P) {
|
|
631
|
-
J(P) || s(`File không hợp lệ. Chỉ chấp nhận: ${
|
|
631
|
+
J(P) || s(`File không hợp lệ. Chỉ chấp nhận: ${h.accept}`), P.size <= 500 * 1024 || s("Dung lượng file vượt quá 500KB.");
|
|
632
632
|
const d = document.createElement("div");
|
|
633
633
|
if (d.className = "wgt:flex wgt:items-center wgt:gap-4", d.addEventListener("click", () => {
|
|
634
|
-
|
|
634
|
+
h.click();
|
|
635
635
|
}), P.type.startsWith("image/")) {
|
|
636
636
|
const M = document.createElement("img");
|
|
637
637
|
M.src = URL.createObjectURL(P), M.alt = "Preview", M.className = "wgt:h-20 wgt:w-20 wgt:rounded wgt:object-contain wgt:rounded", d.appendChild(M);
|
|
@@ -641,25 +641,25 @@ function CC({
|
|
|
641
641
|
const f = document.createElement("p");
|
|
642
642
|
f.className = "wgt:text-sm wgt:font-medium wgt:text-gray-800", f.innerText = P.name;
|
|
643
643
|
const r = document.createElement("p");
|
|
644
|
-
r.className = "wgt:text-sm wgt:text-gray-500", r.innerText = F(P.size), v.appendChild(f), v.appendChild(r), d.appendChild(v), i.appendChild(d), E = P, typeof
|
|
644
|
+
r.className = "wgt:text-sm wgt:text-gray-500", r.innerText = F(P.size), v.appendChild(f), v.appendChild(r), d.appendChild(v), i.appendChild(d), E = P, typeof Q == "function" && Q(P);
|
|
645
645
|
} else {
|
|
646
646
|
const m = document.createElement("div");
|
|
647
647
|
m.className = "wgt:flex wgt:items-center", m.appendChild(q), i.appendChild(m);
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
return
|
|
650
|
+
return h.addEventListener("change", (P) => {
|
|
651
651
|
const m = P.target.files && P.target.files[0] ? P.target.files[0] : null;
|
|
652
|
-
m && (H(m), typeof
|
|
653
|
-
}), H(E), o.appendChild(i), o.appendChild(
|
|
652
|
+
m && (H(m), typeof Q == "function" && Q(m));
|
|
653
|
+
}), H(E), o.appendChild(i), o.appendChild(h), t.appendChild(o), t.appendChild(c), {
|
|
654
654
|
container: t,
|
|
655
655
|
getValues() {
|
|
656
656
|
return E;
|
|
657
657
|
},
|
|
658
658
|
setFile(P) {
|
|
659
|
-
E = P, H(P), typeof
|
|
659
|
+
E = P, H(P), typeof Q == "function" && Q(P);
|
|
660
660
|
},
|
|
661
661
|
clearFile() {
|
|
662
|
-
E = null, H(null), typeof
|
|
662
|
+
E = null, H(null), typeof Q == "function" && Q(null);
|
|
663
663
|
},
|
|
664
664
|
getError: () => D
|
|
665
665
|
};
|
|
@@ -684,24 +684,24 @@ function lg(g) {
|
|
|
684
684
|
return !1;
|
|
685
685
|
}
|
|
686
686
|
})();
|
|
687
|
-
let
|
|
687
|
+
let Q = null;
|
|
688
688
|
if (E) {
|
|
689
|
-
const B = String.raw`\p{Lu}(?:\p{Ll}+|[’']\p{Lu}\p{Ll}+)(?:[’'-]\p{Lu}\p{Ll}+)*`,
|
|
690
|
-
|
|
689
|
+
const B = String.raw`\p{Lu}(?:\p{Ll}+|[’']\p{Lu}\p{Ll}+)(?:[’'-]\p{Lu}\p{Ll}+)*`, C = String.raw`\p{Lu}`, t = String.raw`(?:${C}|${B})`;
|
|
690
|
+
Q = new RegExp(`^${t}(?: ${t})+$`, "u");
|
|
691
691
|
} else {
|
|
692
|
-
const B = "AĂÂBCDĐEÊGHIKLMNOÔƠPQRSTUƯVXYÀÁẢÃẠẰẮẲẴẶẦẤẨẪẬÈÉẺẼẸỀẾỂỄỆÌÍỈĨỊÒÓỎÕỌỒỐỔỖỘỜỚỞỠỢÙÚỦŨỤỪỨỬỮỰỲÝỶỸỴ",
|
|
693
|
-
|
|
692
|
+
const B = "AĂÂBCDĐEÊGHIKLMNOÔƠPQRSTUƯVXYÀÁẢÃẠẰẮẲẴẶẦẤẨẪẬÈÉẺẼẸỀẾỂỄỆÌÍỈĨỊÒÓỎÕỌỒỐỔỖỘỜỚỞỠỢÙÚỦŨỤỪỨỬỮỰỲÝỶỸỴ", C = "aăâbcdđeêghiklmnxoôơpqrstưuvxyàáảãạằắẳẵặầấẩẫậèéẻẽẹềếểễệìíỉĩịòóỏõọồốổỗộờớởỡợùúủũụừứửữựỳýỷỹỵ", t = `[${B}]`, I = `[${C}]`, n = `${t}(?:${I}+|[’']${t}${I}+)(?:[’'-]${t}${I}+)*`, h = `(?:${`${t}`}|${n})`;
|
|
693
|
+
Q = new RegExp(`^${h}(?: ${h})+$`);
|
|
694
694
|
}
|
|
695
|
-
return
|
|
695
|
+
return Q.test(A);
|
|
696
696
|
}
|
|
697
697
|
function QC({
|
|
698
698
|
file: g,
|
|
699
699
|
placeholder: A,
|
|
700
700
|
caption: E,
|
|
701
|
-
onFileSelected:
|
|
701
|
+
onFileSelected: Q,
|
|
702
702
|
onError: B,
|
|
703
703
|
// new callback for errors
|
|
704
|
-
theme:
|
|
704
|
+
theme: C
|
|
705
705
|
}) {
|
|
706
706
|
const t = document.createElement("div");
|
|
707
707
|
t.className = "wgt:flex wgt:flex-col wgt:items-center wgt:gap-2";
|
|
@@ -726,17 +726,17 @@ function QC({
|
|
|
726
726
|
n.type = "file", n.accept = "image/png, image/jpeg, image/jpg", n.className = "wgt:hidden", I.append(n);
|
|
727
727
|
const o = document.createElement("div");
|
|
728
728
|
o.className = "wgt:w-10 wgt:h-10 wgt:rounded-full wgt:bg-primary/16 wgt:flex wgt:items-center wgt:justify-center";
|
|
729
|
-
const
|
|
729
|
+
const h = PQ(C);
|
|
730
730
|
o.innerHTML = `
|
|
731
731
|
<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
732
|
-
<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="${
|
|
733
|
-
<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="${
|
|
732
|
+
<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="${h}"/>
|
|
733
|
+
<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="${h}"/>
|
|
734
734
|
</svg>
|
|
735
735
|
`;
|
|
736
736
|
const i = document.createElement("div");
|
|
737
737
|
i.className = "wgt:text-sm wgt:font-semibold wgt:text-text-sub-600", i.innerText = A, I.append(o, i);
|
|
738
|
-
const
|
|
739
|
-
|
|
738
|
+
const c = document.createElement("div");
|
|
739
|
+
c.className = "wgt:text-sm wgt:font-medium wgt:text-soft-400", c.innerText = E, t.append(c);
|
|
740
740
|
const D = document.createElement("span");
|
|
741
741
|
D.className = "wgt:text-red-500 wgt:text-sm wgt:mt-1", D.style.display = "none", t.append(D);
|
|
742
742
|
let s = null;
|
|
@@ -755,7 +755,7 @@ function QC({
|
|
|
755
755
|
if (d.alt = A, d.className = "wgt:max-w-full wgt:max-h-full wgt:object-contain", P(m) || q(`File không hợp lệ. Chỉ chấp nhận: ${n.accept}`), m.size <= 500 * 1024 || q("Dung lượng file vượt quá 500KB."), m.type.startsWith("image/")) {
|
|
756
756
|
const f = new FileReader();
|
|
757
757
|
f.onload = () => {
|
|
758
|
-
d.src = f.result, typeof
|
|
758
|
+
d.src = f.result, typeof Q == "function" && Q(m);
|
|
759
759
|
}, f.readAsDataURL(m), I.appendChild(d);
|
|
760
760
|
} else {
|
|
761
761
|
const f = document.createElement("div");
|
|
@@ -765,7 +765,7 @@ function QC({
|
|
|
765
765
|
const M = document.createElement("p");
|
|
766
766
|
M.className = "wgt:text-sm wgt:font-medium wgt:text-gray-800", M.innerText = m.name;
|
|
767
767
|
const X = document.createElement("p");
|
|
768
|
-
X.className = "wgt:text-sm wgt:text-gray-500", X.innerText = J(m.size), r.appendChild(M), r.appendChild(X), f.appendChild(r), I.appendChild(f), typeof
|
|
768
|
+
X.className = "wgt:text-sm wgt:text-gray-500", X.innerText = J(m.size), r.appendChild(M), r.appendChild(X), f.appendChild(r), I.appendChild(f), typeof Q == "function" && Q(null, m);
|
|
769
769
|
}
|
|
770
770
|
}
|
|
771
771
|
function P(m) {
|
|
@@ -783,36 +783,36 @@ function QC({
|
|
|
783
783
|
setError: q
|
|
784
784
|
};
|
|
785
785
|
}
|
|
786
|
-
function qQ({ frontFile: g, backFile: A, onFrontChange: E, onBackChange:
|
|
787
|
-
const
|
|
788
|
-
|
|
786
|
+
function qQ({ frontFile: g, backFile: A, onFrontChange: E, onBackChange: Q, theme: B }) {
|
|
787
|
+
const C = document.createElement("div");
|
|
788
|
+
C.className = "wgt:flex wgt:flex-col wgt:gap-4 wgt:w-full";
|
|
789
789
|
const t = document.createElement("label");
|
|
790
790
|
t.className = "wgt:font-medium", t.innerText = a("uploadIdentity");
|
|
791
791
|
const I = document.createElement("span");
|
|
792
|
-
I.className = "wgt:text-red-500 wgt:ml-1", I.innerText = "*", t.appendChild(I),
|
|
792
|
+
I.className = "wgt:text-red-500 wgt:ml-1", I.innerText = "*", t.appendChild(I), C.append(t);
|
|
793
793
|
const n = document.createElement("div");
|
|
794
|
-
n.className = "wgt:w-full wgt:grid wgt:grid-cols-2 wgt:gap-4",
|
|
794
|
+
n.className = "wgt:w-full wgt:grid wgt:grid-cols-2 wgt:gap-4", C.append(n);
|
|
795
795
|
const o = QC({
|
|
796
796
|
file: g,
|
|
797
797
|
placeholder: a("uploadFrontId"),
|
|
798
798
|
caption: a("frontIdCard"),
|
|
799
799
|
onFileSelected: E,
|
|
800
800
|
theme: B
|
|
801
|
-
}),
|
|
801
|
+
}), h = QC({
|
|
802
802
|
file: A,
|
|
803
803
|
placeholder: a("uploadBackId"),
|
|
804
804
|
caption: a("backIdCard"),
|
|
805
|
-
onFileSelected:
|
|
805
|
+
onFileSelected: Q,
|
|
806
806
|
theme: B
|
|
807
807
|
});
|
|
808
|
-
return n.append(o.container,
|
|
809
|
-
container:
|
|
808
|
+
return n.append(o.container, h.container), {
|
|
809
|
+
container: C,
|
|
810
810
|
getFrontFile: () => o.getFile(),
|
|
811
|
-
getBackFile: () =>
|
|
811
|
+
getBackFile: () => h.getFile(),
|
|
812
812
|
getFrontFileError: () => o.getError(),
|
|
813
|
-
getBackFileError: () =>
|
|
813
|
+
getBackFileError: () => h.getError(),
|
|
814
814
|
setFrontFileError: o.setError,
|
|
815
|
-
setBackFileError:
|
|
815
|
+
setBackFileError: h.setError
|
|
816
816
|
};
|
|
817
817
|
}
|
|
818
818
|
const vQ = ({
|
|
@@ -823,17 +823,17 @@ const vQ = ({
|
|
|
823
823
|
{ length: 26 },
|
|
824
824
|
(u, l) => String.fromCharCode(65 + l)
|
|
825
825
|
);
|
|
826
|
-
const E = (/* @__PURE__ */ new Date()).getFullYear(),
|
|
826
|
+
const E = (/* @__PURE__ */ new Date()).getFullYear(), Q = Array.from(
|
|
827
827
|
{ length: 2 },
|
|
828
828
|
(u, l) => String(E + l).slice(-2)
|
|
829
|
-
), B = ["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
829
|
+
), B = ["1", "2", "3", "4", "5", "6", "7", "8", "9"], C = ["C", "K"], t = ["T", "D", "L", "M", "N", "B", "G", "H", "X"], I = document.createElement("div");
|
|
830
830
|
I.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
831
831
|
const n = document.createElement("span");
|
|
832
832
|
n.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal", n.textContent = a("invoiceTemplate");
|
|
833
833
|
const o = document.createElement("span");
|
|
834
834
|
o.className = "wgt:text-red-500 wgt:ml-1", o.innerText = "*", n.appendChild(o), I.append(n);
|
|
835
|
-
const
|
|
836
|
-
|
|
835
|
+
const h = document.createElement("div");
|
|
836
|
+
h.className = [
|
|
837
837
|
"wgt:w-full",
|
|
838
838
|
"wgt:flex",
|
|
839
839
|
"wgt:@max-2xl:flex-col",
|
|
@@ -845,13 +845,13 @@ const vQ = ({
|
|
|
845
845
|
"wgt:select-none",
|
|
846
846
|
"wgt:@max-2xl:p-2",
|
|
847
847
|
"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"
|
|
848
|
-
].join(" "),
|
|
849
|
-
const i = "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",
|
|
850
|
-
|
|
848
|
+
].join(" "), h.style.scrollSnapType = "x mandatory", h.style.overflowX = "auto", h.style.scrollBehavior = "smooth", h.style.scrollbarWidth = "none", h.style.msOverflowStyle = "none", h.style.WebkitOverflowScrolling = "touch", h.style.overflowY = "hidden", I.append(h);
|
|
849
|
+
const i = "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", c = document.createElement("div");
|
|
850
|
+
c.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
851
851
|
const D = document.createElement("span");
|
|
852
852
|
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 = a("sampleNumber");
|
|
853
853
|
const s = document.createElement("span");
|
|
854
|
-
s.className = "wgt:text-red-500 wgt:ml-1", s.innerText = "*", D.appendChild(s),
|
|
854
|
+
s.className = "wgt:text-red-500 wgt:ml-1", s.innerText = "*", D.appendChild(s), c.appendChild(D);
|
|
855
855
|
const q = document.createElement("select");
|
|
856
856
|
q.className = `${i} wgt:@max-2xl:w-full wgt:w-48`, q.title = a("sampleNumberTooltip", "Mẫu số hóa đơn (1-9)");
|
|
857
857
|
const F = {
|
|
@@ -867,7 +867,7 @@ const vQ = ({
|
|
|
867
867
|
};
|
|
868
868
|
B.forEach((u) => {
|
|
869
869
|
q.append(new Option(F[u], u));
|
|
870
|
-
}),
|
|
870
|
+
}), c.appendChild(q), h.append(c);
|
|
871
871
|
const J = document.createElement("div");
|
|
872
872
|
J.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
873
873
|
const H = document.createElement("span");
|
|
@@ -875,10 +875,10 @@ const vQ = ({
|
|
|
875
875
|
const P = document.createElement("span");
|
|
876
876
|
P.className = "wgt:text-red-500 wgt:ml-1", P.innerText = "*", H.appendChild(P), J.appendChild(H);
|
|
877
877
|
const m = document.createElement("select");
|
|
878
|
-
m.className = `${i} wgt:@max-2xl:w-full wgt:w-40`, m.title = a("codeTypeTooltip", "C: Có mã CQT, K: Không mã"),
|
|
878
|
+
m.className = `${i} wgt:@max-2xl:w-full wgt:w-40`, m.title = a("codeTypeTooltip", "C: Có mã CQT, K: Không mã"), C.forEach((u) => {
|
|
879
879
|
const l = u === "C" ? a("codeTypeC", "C (Có mã CQT)") : a("codeTypeK", "K (Không mã)");
|
|
880
880
|
m.append(new Option(l, u));
|
|
881
|
-
}), J.appendChild(m),
|
|
881
|
+
}), J.appendChild(m), h.append(J);
|
|
882
882
|
const d = document.createElement("div");
|
|
883
883
|
d.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
884
884
|
const v = document.createElement("span");
|
|
@@ -886,7 +886,7 @@ const vQ = ({
|
|
|
886
886
|
const f = document.createElement("span");
|
|
887
887
|
f.className = "wgt:text-red-500 wgt:ml-1", f.innerText = "*", v.appendChild(f), d.appendChild(v);
|
|
888
888
|
const r = document.createElement("select");
|
|
889
|
-
r.className = `${i} wgt:@max-2xl:w-full wgt:w-16`, r.title = a("yearTooltip", "Năm phát hành (2 chữ số cuối)"),
|
|
889
|
+
r.className = `${i} wgt:@max-2xl:w-full wgt:w-16`, r.title = a("yearTooltip", "Năm phát hành (2 chữ số cuối)"), Q.forEach((u) => r.append(new Option(u, u))), r.value = String(E).slice(-2), d.appendChild(r), h.append(d);
|
|
890
890
|
const M = document.createElement("div");
|
|
891
891
|
M.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
892
892
|
const X = document.createElement("span");
|
|
@@ -908,7 +908,7 @@ const vQ = ({
|
|
|
908
908
|
};
|
|
909
909
|
t.forEach((u) => {
|
|
910
910
|
R.append(new Option(T[u], u));
|
|
911
|
-
}), M.appendChild(R),
|
|
911
|
+
}), M.appendChild(R), h.append(M);
|
|
912
912
|
const Y = document.createElement("div");
|
|
913
913
|
Y.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
|
|
914
914
|
const y = document.createElement("span");
|
|
@@ -916,7 +916,7 @@ const vQ = ({
|
|
|
916
916
|
const K = document.createElement("span");
|
|
917
917
|
K.className = "wgt:text-red-500 wgt:ml-1", K.innerText = "*", y.appendChild(K), Y.appendChild(y);
|
|
918
918
|
const z = document.createElement("input");
|
|
919
|
-
z.type = "text", z.maxLength = 2, z.placeholder = "AB", z.defaultValue = "YY", z.className = `${i} wgt:@max-2xl:w-full wgt:w-16`, z.title = a("customLettersTooltip"), Y.appendChild(z),
|
|
919
|
+
z.type = "text", z.maxLength = 2, z.placeholder = "AB", z.defaultValue = "YY", z.className = `${i} wgt:@max-2xl:w-full wgt:w-16`, z.title = a("customLettersTooltip"), Y.appendChild(z), h.append(Y);
|
|
920
920
|
function e() {
|
|
921
921
|
return q.value + m.value + r.value + R.value + z.value.toUpperCase();
|
|
922
922
|
}
|
|
@@ -991,27 +991,27 @@ var dg = { exports: {} };
|
|
|
991
991
|
var HQ = dg.exports, IC;
|
|
992
992
|
function xQ() {
|
|
993
993
|
return IC || (IC = 1, function(g, A) {
|
|
994
|
-
(function(E,
|
|
994
|
+
(function(E, Q) {
|
|
995
995
|
var B;
|
|
996
996
|
{
|
|
997
997
|
try {
|
|
998
998
|
B = require("moment");
|
|
999
|
-
} catch (
|
|
999
|
+
} catch (C) {
|
|
1000
1000
|
}
|
|
1001
|
-
g.exports =
|
|
1001
|
+
g.exports = Q(B);
|
|
1002
1002
|
}
|
|
1003
1003
|
})(HQ, function(E) {
|
|
1004
|
-
var
|
|
1004
|
+
var Q = typeof E == "function", B = !!window.addEventListener, C = window.document, t = window.setTimeout, I = function(e, w, u, l) {
|
|
1005
1005
|
B ? e.addEventListener(w, u, !!l) : e.attachEvent("on" + w, u);
|
|
1006
1006
|
}, n = function(e, w, u, l) {
|
|
1007
1007
|
B ? e.removeEventListener(w, u, !!l) : e.detachEvent("on" + w, u);
|
|
1008
1008
|
}, o = function(e) {
|
|
1009
1009
|
return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "");
|
|
1010
|
-
},
|
|
1010
|
+
}, h = function(e, w) {
|
|
1011
1011
|
return (" " + e.className + " ").indexOf(" " + w + " ") !== -1;
|
|
1012
1012
|
}, i = function(e, w) {
|
|
1013
|
-
|
|
1014
|
-
},
|
|
1013
|
+
h(e, w) || (e.className = e.className === "" ? w : e.className + " " + w);
|
|
1014
|
+
}, c = function(e, w) {
|
|
1015
1015
|
e.className = o((" " + e.className + " ").replace(" " + w + " ", " "));
|
|
1016
1016
|
}, D = function(e) {
|
|
1017
1017
|
return /Array/.test(Object.prototype.toString.call(e));
|
|
@@ -1035,7 +1035,7 @@ function xQ() {
|
|
|
1035
1035
|
return e;
|
|
1036
1036
|
}, d = function(e, w, u) {
|
|
1037
1037
|
var l;
|
|
1038
|
-
|
|
1038
|
+
C.createEvent ? (l = C.createEvent("HTMLEvents"), l.initEvent(w, !0, !1), l = m(l, u), e.dispatchEvent(l)) : C.createEventObject && (l = C.createEventObject(), l = m(l, u), e.fireEvent("on" + w, l));
|
|
1039
1039
|
}, v = function(e) {
|
|
1040
1040
|
return e.month < 0 && (e.year -= Math.ceil(Math.abs(e.month) / 12), e.month += 12), e.month > 11 && (e.year += Math.floor(Math.abs(e.month) / 12), e.month -= 12), e;
|
|
1041
1041
|
}, f = {
|
|
@@ -1143,7 +1143,7 @@ function xQ() {
|
|
|
1143
1143
|
var S = new Date(e.getFullYear(), 0, L), U = 1440 * 60 * 1e3, nA = (e.getTime() - S.getTime()) / U, aA = 1 + Math.round((nA - N + IA(S.getDay())) / b);
|
|
1144
1144
|
return aA;
|
|
1145
1145
|
}, k = function(e, w, u, l) {
|
|
1146
|
-
var L = new Date(u, w, e), N =
|
|
1146
|
+
var L = new Date(u, w, e), N = Q ? E(L).isoWeek() : X(L, l);
|
|
1147
1147
|
return '<td class="pika-week">' + N + "</td>";
|
|
1148
1148
|
}, R = function(e, w, u, l) {
|
|
1149
1149
|
return '<tr class="pika-row' + (u ? " pick-whole-week" : "") + (l ? " is-selected" : "") + '">' + (w ? e.reverse() : e).join("") + "</tr>";
|
|
@@ -1170,9 +1170,9 @@ function xQ() {
|
|
|
1170
1170
|
L = L || window.event;
|
|
1171
1171
|
var N = L.target || L.srcElement;
|
|
1172
1172
|
if (N)
|
|
1173
|
-
if (
|
|
1173
|
+
if (h(N, "is-disabled") || (h(N, "pika-button") && !h(N, "is-empty") && !h(N.parentNode, "is-disabled") ? (w.setDate(new Date(N.getAttribute("data-pika-year"), N.getAttribute("data-pika-month"), N.getAttribute("data-pika-day"))), u.bound && t(function() {
|
|
1174
1174
|
w.hide(), u.blurFieldOnSelect && u.field && u.field.blur();
|
|
1175
|
-
}, 100)) :
|
|
1175
|
+
}, 100)) : h(N, "pika-prev") ? w.prevMonth() : h(N, "pika-next") && w.nextMonth()), h(N, "pika-select"))
|
|
1176
1176
|
w._c = !0;
|
|
1177
1177
|
else if (L.preventDefault)
|
|
1178
1178
|
L.preventDefault();
|
|
@@ -1182,7 +1182,7 @@ function xQ() {
|
|
|
1182
1182
|
}, w._onChange = function(L) {
|
|
1183
1183
|
L = L || window.event;
|
|
1184
1184
|
var N = L.target || L.srcElement;
|
|
1185
|
-
N && (
|
|
1185
|
+
N && (h(N, "pika-select-month") ? w.gotoMonth(N.value) : h(N, "pika-select-year") && w.gotoYear(N.value));
|
|
1186
1186
|
}, w._onKeyChange = function(L) {
|
|
1187
1187
|
if (L = L || window.event, w.isVisible())
|
|
1188
1188
|
switch (L.keyCode) {
|
|
@@ -1210,7 +1210,7 @@ function xQ() {
|
|
|
1210
1210
|
}, w._parseFieldValue = function() {
|
|
1211
1211
|
if (u.parse)
|
|
1212
1212
|
return u.parse(u.field.value, u.format);
|
|
1213
|
-
if (
|
|
1213
|
+
if (Q) {
|
|
1214
1214
|
var L = E(u.field.value, u.format, u.formatStrict);
|
|
1215
1215
|
return L && L.isValid() ? L.toDate() : null;
|
|
1216
1216
|
} else
|
|
@@ -1223,9 +1223,9 @@ function xQ() {
|
|
|
1223
1223
|
}, w._onInputClick = function() {
|
|
1224
1224
|
w.show();
|
|
1225
1225
|
}, w._onInputBlur = function() {
|
|
1226
|
-
var L =
|
|
1226
|
+
var L = C.activeElement;
|
|
1227
1227
|
do
|
|
1228
|
-
if (
|
|
1228
|
+
if (h(L, "pika-single"))
|
|
1229
1229
|
return;
|
|
1230
1230
|
while (L = L.parentNode);
|
|
1231
1231
|
w._c || (w._b = t(function() {
|
|
@@ -1235,14 +1235,14 @@ function xQ() {
|
|
|
1235
1235
|
L = L || window.event;
|
|
1236
1236
|
var N = L.target || L.srcElement, b = N;
|
|
1237
1237
|
if (N) {
|
|
1238
|
-
!B &&
|
|
1238
|
+
!B && h(N, "pika-select") && (N.onchange || (N.setAttribute("onchange", "return;"), I(N, "change", w._onChange)));
|
|
1239
1239
|
do
|
|
1240
|
-
if (
|
|
1240
|
+
if (h(b, "pika-single") || b === u.trigger)
|
|
1241
1241
|
return;
|
|
1242
1242
|
while (b = b.parentNode);
|
|
1243
1243
|
w._v && N !== u.trigger && b !== u.trigger && w.hide();
|
|
1244
1244
|
}
|
|
1245
|
-
}, w.el =
|
|
1245
|
+
}, w.el = C.createElement("div"), w.el.className = "pika-single" + (u.isRTL ? " is-rtl" : "") + (u.theme ? " " + u.theme : ""), I(w.el, "mousedown", w._onMouseDown, !0), I(w.el, "touchend", w._onMouseDown, !0), I(w.el, "change", w._onChange), u.keyboardInput && I(C, "keydown", w._onKeyChange), u.field && (u.container ? u.container.appendChild(w.el) : u.bound ? C.body.appendChild(w.el) : u.field.parentNode.insertBefore(w.el, u.field.nextSibling), I(u.field, "change", w._onInputChange), u.defaultDate || (u.defaultDate = w._parseFieldValue(), u.setDefaultDate = !0));
|
|
1246
1246
|
var l = u.defaultDate;
|
|
1247
1247
|
s(l) ? u.setDefaultDate ? w.setDate(l, !0) : w.gotoDate(l) : w.gotoDate(/* @__PURE__ */ new Date()), u.bound ? (this.hide(), w.el.className += " is-bound", I(u.trigger, "click", w._onInputClick), I(u.trigger, "focus", w._onInputFocus), I(u.trigger, "blur", w._onInputBlur)) : this.show();
|
|
1248
1248
|
};
|
|
@@ -1266,19 +1266,19 @@ function xQ() {
|
|
|
1266
1266
|
* return a formatted string of the current selection (using Moment.js if available)
|
|
1267
1267
|
*/
|
|
1268
1268
|
toString: function(e) {
|
|
1269
|
-
return e = e || this._o.format, s(this._d) ? this._o.toString ? this._o.toString(this._d, e) :
|
|
1269
|
+
return e = e || this._o.format, s(this._d) ? this._o.toString ? this._o.toString(this._d, e) : Q ? E(this._d).format(e) : this._d.toDateString() : "";
|
|
1270
1270
|
},
|
|
1271
1271
|
/**
|
|
1272
1272
|
* return a Moment.js object of the current selection (if available)
|
|
1273
1273
|
*/
|
|
1274
1274
|
getMoment: function() {
|
|
1275
|
-
return
|
|
1275
|
+
return Q ? E(this._d) : null;
|
|
1276
1276
|
},
|
|
1277
1277
|
/**
|
|
1278
1278
|
* set the current selection from a Moment.js object (if available)
|
|
1279
1279
|
*/
|
|
1280
1280
|
setMoment: function(e, w) {
|
|
1281
|
-
|
|
1281
|
+
Q && E.isMoment(e) && this.setDate(e.toDate(), w);
|
|
1282
1282
|
},
|
|
1283
1283
|
/**
|
|
1284
1284
|
* return a Date object of the current selection
|
|
@@ -1388,12 +1388,12 @@ function xQ() {
|
|
|
1388
1388
|
adjustPosition: function() {
|
|
1389
1389
|
var e, w, u, l, L, N, b, IA, S, U, nA, aA;
|
|
1390
1390
|
if (!this._o.container) {
|
|
1391
|
-
if (this.el.style.position = "absolute", e = this._o.trigger, w = e, u = this.el.offsetWidth, l = this.el.offsetHeight, L = window.innerWidth ||
|
|
1391
|
+
if (this.el.style.position = "absolute", e = this._o.trigger, w = e, u = this.el.offsetWidth, l = this.el.offsetHeight, L = window.innerWidth || C.documentElement.clientWidth, N = window.innerHeight || C.documentElement.clientHeight, b = window.pageYOffset || C.body.scrollTop || C.documentElement.scrollTop, nA = !0, aA = !0, typeof e.getBoundingClientRect == "function")
|
|
1392
1392
|
U = e.getBoundingClientRect(), IA = U.left + window.pageXOffset, S = U.bottom + window.pageYOffset;
|
|
1393
1393
|
else
|
|
1394
1394
|
for (IA = w.offsetLeft, S = w.offsetTop + w.offsetHeight; w = w.offsetParent; )
|
|
1395
1395
|
IA += w.offsetLeft, S += w.offsetTop;
|
|
1396
|
-
(this._o.reposition && IA + u > L || this._o.position.indexOf("right") > -1 && IA - u + e.offsetWidth > 0) && (IA = IA - u + e.offsetWidth, nA = !1), (this._o.reposition && S + l > N + b || this._o.position.indexOf("top") > -1 && S - l - e.offsetHeight > 0) && (S = S - l - e.offsetHeight, aA = !1), this.el.style.left = IA + "px", this.el.style.top = S + "px", i(this.el, nA ? "left-aligned" : "right-aligned"), i(this.el, aA ? "bottom-aligned" : "top-aligned"),
|
|
1396
|
+
(this._o.reposition && IA + u > L || this._o.position.indexOf("right") > -1 && IA - u + e.offsetWidth > 0) && (IA = IA - u + e.offsetWidth, nA = !1), (this._o.reposition && S + l > N + b || this._o.position.indexOf("top") > -1 && S - l - e.offsetHeight > 0) && (S = S - l - e.offsetHeight, aA = !1), this.el.style.left = IA + "px", this.el.style.top = S + "px", i(this.el, nA ? "left-aligned" : "right-aligned"), i(this.el, aA ? "bottom-aligned" : "top-aligned"), c(this.el, nA ? "right-aligned" : "left-aligned"), c(this.el, aA ? "top-aligned" : "bottom-aligned");
|
|
1397
1397
|
}
|
|
1398
1398
|
},
|
|
1399
1399
|
/**
|
|
@@ -1406,24 +1406,24 @@ function xQ() {
|
|
|
1406
1406
|
kA -= 7;
|
|
1407
1407
|
JA += 7 - kA;
|
|
1408
1408
|
for (var iA = !1, rA = 0, FA = 0; rA < JA; rA++) {
|
|
1409
|
-
var PA = new Date(e, w, 1 + (rA - b)),
|
|
1410
|
-
$A && (rA < b ? (zA = YA + zA, hg = U,
|
|
1411
|
-
var
|
|
1409
|
+
var PA = new Date(e, w, 1 + (rA - b)), yA = s(this._d) ? P(PA, this._d) : !1, sg = P(PA, L), tg = l.events.indexOf(PA.toDateString()) !== -1, $A = rA < b || rA >= N + b, zA = 1 + (rA - b), hg = w, VA = e, Ag = l.startRange && P(l.startRange, PA), WA = l.endRange && P(l.endRange, PA), NA = l.startRange && l.endRange && l.startRange < PA && PA < l.endRange, KA = l.minDate && PA < l.minDate || l.maxDate && PA > l.maxDate || l.disableWeekends && q(PA) || l.disableDayFn && l.disableDayFn(PA);
|
|
1410
|
+
$A && (rA < b ? (zA = YA + zA, hg = U, VA = aA) : (zA = zA - N, hg = nA, VA = cA));
|
|
1411
|
+
var UA = {
|
|
1412
1412
|
day: zA,
|
|
1413
1413
|
month: hg,
|
|
1414
|
-
year:
|
|
1414
|
+
year: VA,
|
|
1415
1415
|
hasEvent: tg,
|
|
1416
|
-
isSelected:
|
|
1416
|
+
isSelected: yA,
|
|
1417
1417
|
isToday: sg,
|
|
1418
|
-
isDisabled:
|
|
1418
|
+
isDisabled: KA,
|
|
1419
1419
|
isEmpty: $A,
|
|
1420
1420
|
isStartRange: Ag,
|
|
1421
|
-
isEndRange:
|
|
1421
|
+
isEndRange: WA,
|
|
1422
1422
|
isInRange: NA,
|
|
1423
1423
|
showDaysInNextAndPreviousMonths: l.showDaysInNextAndPreviousMonths,
|
|
1424
1424
|
enableSelectionDaysInNextAndPreviousMonths: l.enableSelectionDaysInNextAndPreviousMonths
|
|
1425
1425
|
};
|
|
1426
|
-
l.pickWholeWeek &&
|
|
1426
|
+
l.pickWholeWeek && yA && (iA = !0), S.push(M(UA)), ++FA === 7 && (l.showWeekNumber && S.unshift(k(rA - b, w, e, l.firstWeekOfYearMinDays)), IA.push(R(S, l.isRTL, l.pickWholeWeek, iA)), S = [], FA = 0, iA = !1);
|
|
1427
1427
|
}
|
|
1428
1428
|
return K(l, IA, u);
|
|
1429
1429
|
},
|
|
@@ -1431,18 +1431,18 @@ function xQ() {
|
|
|
1431
1431
|
return this._v;
|
|
1432
1432
|
},
|
|
1433
1433
|
show: function() {
|
|
1434
|
-
this.isVisible() || (this._v = !0, this.draw(),
|
|
1434
|
+
this.isVisible() || (this._v = !0, this.draw(), c(this.el, "is-hidden"), this._o.bound && (I(C, "click", this._onClick), this.adjustPosition()), typeof this._o.onOpen == "function" && this._o.onOpen.call(this));
|
|
1435
1435
|
},
|
|
1436
1436
|
hide: function() {
|
|
1437
1437
|
var e = this._v;
|
|
1438
|
-
e !== !1 && (this._o.bound && n(
|
|
1438
|
+
e !== !1 && (this._o.bound && n(C, "click", this._onClick), this._o.container || (this.el.style.position = "static", this.el.style.left = "auto", this.el.style.top = "auto"), i(this.el, "is-hidden"), this._v = !1, e !== void 0 && typeof this._o.onClose == "function" && this._o.onClose.call(this));
|
|
1439
1439
|
},
|
|
1440
1440
|
/**
|
|
1441
1441
|
* GAME OVER
|
|
1442
1442
|
*/
|
|
1443
1443
|
destroy: function() {
|
|
1444
1444
|
var e = this._o;
|
|
1445
|
-
this.hide(), n(this.el, "mousedown", this._onMouseDown, !0), n(this.el, "touchend", this._onMouseDown, !0), n(this.el, "change", this._onChange), e.keyboardInput && n(
|
|
1445
|
+
this.hide(), n(this.el, "mousedown", this._onMouseDown, !0), n(this.el, "touchend", this._onMouseDown, !0), n(this.el, "change", this._onChange), e.keyboardInput && n(C, "keydown", this._onKeyChange), e.field && (n(e.field, "change", this._onInputChange), e.bound && (n(e.trigger, "click", this._onInputClick), n(e.trigger, "focus", this._onInputFocus), n(e.trigger, "blur", this._onInputBlur))), this.el.parentNode && this.el.parentNode.removeChild(this.el);
|
|
1446
1446
|
}
|
|
1447
1447
|
}, z;
|
|
1448
1448
|
});
|
|
@@ -1475,17 +1475,17 @@ function Hg(g, A = {}) {
|
|
|
1475
1475
|
return console.warn("Notification container not available"), null;
|
|
1476
1476
|
const {
|
|
1477
1477
|
autoClose: E = 5e3,
|
|
1478
|
-
hideProgressBar:
|
|
1478
|
+
hideProgressBar: Q = !0,
|
|
1479
1479
|
closeButton: B = !1,
|
|
1480
|
-
icon:
|
|
1480
|
+
icon: C = !1,
|
|
1481
1481
|
type: t = "info"
|
|
1482
1482
|
} = A;
|
|
1483
1483
|
ng.length >= YQ && kg(ng[0].id);
|
|
1484
1484
|
const I = Date.now() + Math.random(), n = XQ(I, g, {
|
|
1485
1485
|
autoClose: E,
|
|
1486
|
-
hideProgressBar:
|
|
1486
|
+
hideProgressBar: Q,
|
|
1487
1487
|
closeButton: B,
|
|
1488
|
-
icon:
|
|
1488
|
+
icon: C,
|
|
1489
1489
|
type: t
|
|
1490
1490
|
});
|
|
1491
1491
|
return ng.push({ id: I, element: n }), mA.appendChild(n), requestAnimationFrame(() => {
|
|
@@ -1495,7 +1495,7 @@ function Hg(g, A = {}) {
|
|
|
1495
1495
|
}, E), I;
|
|
1496
1496
|
}
|
|
1497
1497
|
function XQ(g, A, E) {
|
|
1498
|
-
const { hideProgressBar:
|
|
1498
|
+
const { hideProgressBar: Q, closeButton: B, icon: C, type: t, autoClose: I } = E, n = document.createElement("div");
|
|
1499
1499
|
n.className = [
|
|
1500
1500
|
"wgt:bg-white",
|
|
1501
1501
|
"wgt:px-5",
|
|
@@ -1526,38 +1526,38 @@ function XQ(g, A, E) {
|
|
|
1526
1526
|
// Red
|
|
1527
1527
|
};
|
|
1528
1528
|
n.style.borderLeft = `4px solid ${o[t] || o.info}`, n.style.zIndex = "99999";
|
|
1529
|
-
const
|
|
1530
|
-
if (
|
|
1531
|
-
const
|
|
1529
|
+
const h = document.createElement("div");
|
|
1530
|
+
if (h.className = "wgt:flex wgt:items-start wgt:gap-3", C) {
|
|
1531
|
+
const c = document.createElement("div"), D = {
|
|
1532
1532
|
info: "wgt:bg-blue-500",
|
|
1533
1533
|
success: "wgt:bg-green-500",
|
|
1534
1534
|
warning: "wgt:bg-orange-500",
|
|
1535
1535
|
error: "wgt:bg-red-500"
|
|
1536
1536
|
};
|
|
1537
|
-
|
|
1537
|
+
c.className = `wgt:flex-shrink-0 wgt:w-5 wgt:h-5 wgt:rounded-full wgt:flex wgt:items-center wgt:justify-center wgt:mt-0.5 ${D[t] || D.info}`, c.innerHTML = '<span class="wgt:text-white wgt:text-xs wgt:font-bold">!</span>', h.appendChild(c);
|
|
1538
1538
|
}
|
|
1539
1539
|
const i = document.createElement("div");
|
|
1540
|
-
if (i.className = "wgt:text-sm wgt:font-medium wgt:text-gray-700 wgt:leading-5 wgt:flex-1", i.innerText = A,
|
|
1541
|
-
const
|
|
1542
|
-
|
|
1540
|
+
if (i.className = "wgt:text-sm wgt:font-medium wgt:text-gray-700 wgt:leading-5 wgt:flex-1", i.innerText = A, h.appendChild(i), B) {
|
|
1541
|
+
const c = document.createElement("button");
|
|
1542
|
+
c.className = "wgt:flex-shrink-0 wgt:ml-2 wgt:text-gray-400 wgt:hover:text-gray-600 wgt:text-lg wgt:leading-none", c.innerHTML = "×", c.addEventListener("click", () => {
|
|
1543
1543
|
kg(g);
|
|
1544
|
-
}),
|
|
1544
|
+
}), h.appendChild(c);
|
|
1545
1545
|
}
|
|
1546
|
-
if (n.appendChild(
|
|
1547
|
-
const
|
|
1546
|
+
if (n.appendChild(h), !Q && I > 0) {
|
|
1547
|
+
const c = document.createElement("div"), D = {
|
|
1548
1548
|
info: "wgt:bg-blue-500",
|
|
1549
1549
|
success: "wgt:bg-green-500",
|
|
1550
1550
|
warning: "wgt:bg-orange-500",
|
|
1551
1551
|
error: "wgt:bg-red-500"
|
|
1552
1552
|
};
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
}), n.appendChild(
|
|
1553
|
+
c.className = `wgt:absolute wgt:bottom-0 wgt:left-0 wgt:h-1 wgt:transition-all wgt:duration-300 ${D[t] || D.info}`, c.style.width = "100%", requestAnimationFrame(() => {
|
|
1554
|
+
c.style.transition = `width ${I}ms linear`, c.style.width = "0%";
|
|
1555
|
+
}), n.appendChild(c);
|
|
1556
1556
|
}
|
|
1557
1557
|
return n;
|
|
1558
1558
|
}
|
|
1559
1559
|
function kg(g) {
|
|
1560
|
-
const A = ng.findIndex((
|
|
1560
|
+
const A = ng.findIndex((Q) => Q.id === g);
|
|
1561
1561
|
if (A === -1) return;
|
|
1562
1562
|
const { element: E } = ng[A];
|
|
1563
1563
|
E.classList.remove("wgt:translate-x-0", "wgt:opacity-100"), E.classList.add("wgt:translate-x-full", "wgt:opacity-0"), setTimeout(() => {
|
|
@@ -1578,8 +1578,8 @@ const og = {
|
|
|
1578
1578
|
clear: KC,
|
|
1579
1579
|
destroy: FQ
|
|
1580
1580
|
};
|
|
1581
|
-
var vg = (g, A, E) => new Promise((
|
|
1582
|
-
var
|
|
1581
|
+
var vg = (g, A, E) => new Promise((Q, B) => {
|
|
1582
|
+
var C = (n) => {
|
|
1583
1583
|
try {
|
|
1584
1584
|
I(E.next(n));
|
|
1585
1585
|
} catch (o) {
|
|
@@ -1591,7 +1591,7 @@ var vg = (g, A, E) => new Promise((C, B) => {
|
|
|
1591
1591
|
} catch (o) {
|
|
1592
1592
|
B(o);
|
|
1593
1593
|
}
|
|
1594
|
-
}, I = (n) => n.done ?
|
|
1594
|
+
}, I = (n) => n.done ? Q(n.value) : Promise.resolve(n.value).then(C, t);
|
|
1595
1595
|
I((E = E.apply(g, A)).next());
|
|
1596
1596
|
});
|
|
1597
1597
|
function Lg(g = "dev") {
|
|
@@ -1641,36 +1641,36 @@ function oB(g, A) {
|
|
|
1641
1641
|
throw new Error(
|
|
1642
1642
|
"ONNX Runtime is not properly loaded. Please check your internet connection and try again."
|
|
1643
1643
|
);
|
|
1644
|
-
const E = A || Lg(g).baseURL,
|
|
1644
|
+
const E = A || Lg(g).baseURL, Q = `${E}/${Lg(g).modelEndpoint}`, B = `${E}/${Lg(g).modeClassifyEndpoint}`;
|
|
1645
1645
|
if (typeof Eg.InferenceSession.create != "function")
|
|
1646
1646
|
throw new Error(
|
|
1647
1647
|
"InferenceSession.create is not available. ONNX Runtime may not be properly initialized."
|
|
1648
1648
|
);
|
|
1649
|
-
return qg = yield Eg.InferenceSession.create(
|
|
1649
|
+
return qg = yield Eg.InferenceSession.create(Q), cB = yield Eg.InferenceSession.create(B), qg;
|
|
1650
1650
|
} catch (E) {
|
|
1651
1651
|
throw new Error(`Failed to initialize ONNX model: ${E.message}`);
|
|
1652
1652
|
}
|
|
1653
1653
|
});
|
|
1654
1654
|
}
|
|
1655
1655
|
function GQ(g, A, E = 200) {
|
|
1656
|
-
const
|
|
1656
|
+
const Q = document.createElement("canvas"), B = Q.getContext("2d");
|
|
1657
1657
|
if (g instanceof ImageData)
|
|
1658
|
-
|
|
1658
|
+
Q.width = g.width, Q.height = g.height, B.putImageData(g, 0, 0);
|
|
1659
1659
|
else if (g instanceof HTMLCanvasElement)
|
|
1660
|
-
|
|
1660
|
+
Q.width = g.width, Q.height = g.height, B.drawImage(g, 0, 0), B.getImageData(0, 0, g.width, g.height);
|
|
1661
1661
|
else
|
|
1662
1662
|
throw new Error("Input must be ImageData or HTMLCanvasElement");
|
|
1663
|
-
const
|
|
1664
|
-
|
|
1665
|
-
const t =
|
|
1663
|
+
const C = document.createElement("canvas");
|
|
1664
|
+
C.width = E, C.height = E;
|
|
1665
|
+
const t = C.getContext("2d");
|
|
1666
1666
|
if (Array.isArray(A[0]) && A.length === 4) {
|
|
1667
1667
|
A.flat();
|
|
1668
1668
|
const D = LQ();
|
|
1669
|
-
t.setTransform(...D), t.drawImage(
|
|
1669
|
+
t.setTransform(...D), t.drawImage(Q, 0, 0), t.setTransform(1, 0, 0, 1, 0, 0);
|
|
1670
1670
|
} else if (A.length === 4) {
|
|
1671
|
-
const [D, s, q, F] = A, J = q - D, H = F - s, P = J * 0.05, m = H * 0.05, d = Math.max(0, D - P), v = Math.max(0, s - m), f = Math.min(
|
|
1671
|
+
const [D, s, q, F] = A, J = q - D, H = F - s, P = J * 0.05, m = H * 0.05, d = Math.max(0, D - P), v = Math.max(0, s - m), f = Math.min(Q.width, q + P), r = Math.min(Q.height, F + m), M = f - d, X = r - v;
|
|
1672
1672
|
t.drawImage(
|
|
1673
|
-
|
|
1673
|
+
Q,
|
|
1674
1674
|
d,
|
|
1675
1675
|
v,
|
|
1676
1676
|
M,
|
|
@@ -1687,13 +1687,13 @@ function GQ(g, A, E = 200) {
|
|
|
1687
1687
|
0,
|
|
1688
1688
|
E,
|
|
1689
1689
|
E
|
|
1690
|
-
), n = new ImageData(E, E), o = I.data,
|
|
1690
|
+
), n = new ImageData(E, E), o = I.data, h = n.data;
|
|
1691
1691
|
for (let D = 0; D < o.length; D += 4) {
|
|
1692
1692
|
const s = o[D], q = o[D + 1], F = o[D + 2], J = 0.2989 * s + 0.587 * q + 0.114 * F;
|
|
1693
|
-
|
|
1693
|
+
h[D] = h[D + 1] = h[D + 2] = J, h[D + 3] = 255;
|
|
1694
1694
|
}
|
|
1695
|
-
const i = new ImageData(E, E),
|
|
1696
|
-
return i.data.set(
|
|
1695
|
+
const i = new ImageData(E, E), c = zQ(h, E, E, 10);
|
|
1696
|
+
return i.data.set(c), {
|
|
1697
1697
|
original: I,
|
|
1698
1698
|
grayscale: n,
|
|
1699
1699
|
threshold: i
|
|
@@ -1702,17 +1702,17 @@ function GQ(g, A, E = 200) {
|
|
|
1702
1702
|
function LQ(g, A) {
|
|
1703
1703
|
return [1, 0, 0, 0, 1, 0];
|
|
1704
1704
|
}
|
|
1705
|
-
function zQ(g, A, E,
|
|
1706
|
-
const B = new Uint8ClampedArray(g.length),
|
|
1705
|
+
function zQ(g, A, E, Q) {
|
|
1706
|
+
const B = new Uint8ClampedArray(g.length), C = new Uint32Array(A * E);
|
|
1707
1707
|
for (let I = 0; I < E; I++)
|
|
1708
1708
|
for (let n = 0; n < A; n++) {
|
|
1709
|
-
const o = (I * A + n) * 4,
|
|
1710
|
-
|
|
1709
|
+
const o = (I * A + n) * 4, h = g[o], i = I * A + n;
|
|
1710
|
+
C[i] = h + (n > 0 ? C[i - 1] : 0) + (I > 0 ? C[i - A] : 0) - (n > 0 && I > 0 ? C[i - A - 1] : 0);
|
|
1711
1711
|
}
|
|
1712
|
-
const t = Math.floor(
|
|
1712
|
+
const t = Math.floor(Q / 2);
|
|
1713
1713
|
for (let I = 0; I < E; I++)
|
|
1714
1714
|
for (let n = 0; n < A; n++) {
|
|
1715
|
-
const o = (I * A + n) * 4,
|
|
1715
|
+
const o = (I * A + n) * 4, h = Math.max(n - t, 0), i = Math.max(I - t, 0), c = Math.min(n + t, A - 1), D = Math.min(I + t, E - 1), s = (c - h + 1) * (D - i + 1), q = (C[D * A + c] - (h > 0 ? C[D * A + h - 1] : 0) - (i > 0 ? C[(i - 1) * A + c] : 0) + (h > 0 && i > 0 ? C[(i - 1) * A + h - 1] : 0)) / s * 0.9, F = g[o] > q ? 255 : 0;
|
|
1716
1716
|
B[o] = B[o + 1] = B[o + 2] = F, B[o + 3] = 255;
|
|
1717
1717
|
}
|
|
1718
1718
|
return B;
|
|
@@ -1720,25 +1720,25 @@ function zQ(g, A, E, C) {
|
|
|
1720
1720
|
function UC(g, A = 640) {
|
|
1721
1721
|
const E = document.createElement("canvas");
|
|
1722
1722
|
E.width = A, E.height = A;
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
const B =
|
|
1723
|
+
const Q = E.getContext("2d");
|
|
1724
|
+
Q.drawImage(g, 0, 0, A, A);
|
|
1725
|
+
const B = Q.getImageData(0, 0, A, A).data, C = new Float32Array(A * A * 3);
|
|
1726
1726
|
for (let I = 0, n = 0; I < B.length; I += 4, n += 3)
|
|
1727
|
-
|
|
1727
|
+
C[n] = B[I] / 255, C[n + 1] = B[I + 1] / 255, C[n + 2] = B[I + 2] / 255;
|
|
1728
1728
|
const t = new Float32Array(3 * A * A);
|
|
1729
1729
|
for (let I = 0; I < A; I++)
|
|
1730
1730
|
for (let n = 0; n < A; n++) {
|
|
1731
1731
|
const o = I * A + n;
|
|
1732
|
-
t[o] =
|
|
1732
|
+
t[o] = C[o * 3], t[o + A * A] = C[o * 3 + 1], t[o + 2 * A * A] = C[o * 3 + 2];
|
|
1733
1733
|
}
|
|
1734
1734
|
return new Eg.Tensor("float32", t, [1, 3, A, A]);
|
|
1735
1735
|
}
|
|
1736
|
-
function NQ(g, A, E,
|
|
1737
|
-
const
|
|
1736
|
+
function NQ(g, A, E, Q, B = 0.5) {
|
|
1737
|
+
const C = [], t = g.dims[1];
|
|
1738
1738
|
for (let I = 0; I < t; I++) {
|
|
1739
1739
|
const n = g.data[I * 37 + 4];
|
|
1740
1740
|
if (n < B) continue;
|
|
1741
|
-
const o = g.data[I * 37],
|
|
1741
|
+
const o = g.data[I * 37], h = g.data[I * 37 + 1], i = g.data[I * 37 + 2], c = g.data[I * 37 + 3], D = E / 640, s = Q / 640, q = [o * D, h * s, i * D, c * s], F = g.data.slice(I * 37 + 5, I * 37 + 37), J = new Float32Array(25600);
|
|
1742
1742
|
for (let T = 0; T < 160; T++)
|
|
1743
1743
|
for (let Y = 0; Y < 160; Y++) {
|
|
1744
1744
|
let y = 0;
|
|
@@ -1753,7 +1753,7 @@ function NQ(g, A, E, C, B = 0.5) {
|
|
|
1753
1753
|
T[0] + (T[0] < (v + f) / 2 ? -d * X : d * X),
|
|
1754
1754
|
T[1] + (T[1] < (r + M) / 2 ? -d * k : d * k)
|
|
1755
1755
|
]);
|
|
1756
|
-
|
|
1756
|
+
C.push({
|
|
1757
1757
|
bbox_xyxy: q,
|
|
1758
1758
|
confidence: n,
|
|
1759
1759
|
cxcy: [
|
|
@@ -1764,10 +1764,10 @@ function NQ(g, A, E, C, B = 0.5) {
|
|
|
1764
1764
|
polygon_xy: P.map((T) => [T[0] * D, T[1] * s]),
|
|
1765
1765
|
quad_xy: m,
|
|
1766
1766
|
padded_quad_xy: R,
|
|
1767
|
-
image_shape: [
|
|
1767
|
+
image_shape: [Q, E]
|
|
1768
1768
|
});
|
|
1769
1769
|
}
|
|
1770
|
-
return
|
|
1770
|
+
return C;
|
|
1771
1771
|
}
|
|
1772
1772
|
function bQ(g, A, E) {
|
|
1773
1773
|
return [];
|
|
@@ -1789,8 +1789,8 @@ function yQ(g) {
|
|
|
1789
1789
|
return vg(this, null, function* () {
|
|
1790
1790
|
let A = null;
|
|
1791
1791
|
const E = ["original", "grayscale", "threshold"];
|
|
1792
|
-
for (const
|
|
1793
|
-
if (A = yield hB(g[
|
|
1792
|
+
for (const Q of E)
|
|
1793
|
+
if (A = yield hB(g[Q]), A && A.length > 0)
|
|
1794
1794
|
break;
|
|
1795
1795
|
return A;
|
|
1796
1796
|
});
|
|
@@ -1801,14 +1801,14 @@ function KQ(g, A = "sourceCanvas") {
|
|
|
1801
1801
|
qg || (yield oB());
|
|
1802
1802
|
const E = document.createElement("canvas");
|
|
1803
1803
|
E.width = g.width, E.height = g.height, E.getContext("2d").drawImage(g, 0, 0);
|
|
1804
|
-
const
|
|
1805
|
-
|
|
1804
|
+
const Q = UC(g), B = yield qg.run({ [qg.inputNames[0]]: Q }), C = B[Object.keys(B)[0]], t = B[Object.keys(B)[1]], I = NQ(
|
|
1805
|
+
C,
|
|
1806
1806
|
t,
|
|
1807
1807
|
g.width,
|
|
1808
1808
|
g.height
|
|
1809
1809
|
);
|
|
1810
1810
|
for (const n of I) {
|
|
1811
|
-
const { _: o, bbox_xyxy:
|
|
1811
|
+
const { _: o, bbox_xyxy: h } = n, i = GQ(E, h), c = yield yQ(i), D = c.length > 0 ? c[0].decode() : null;
|
|
1812
1812
|
if (D)
|
|
1813
1813
|
return JSON.stringify({
|
|
1814
1814
|
status: "success",
|
|
@@ -1833,16 +1833,16 @@ function UQ(g) {
|
|
|
1833
1833
|
cB || (yield oB());
|
|
1834
1834
|
const A = document.createElement("canvas");
|
|
1835
1835
|
A.width = g.width, A.height = g.height, A.getContext("2d").drawImage(g, 0, 0);
|
|
1836
|
-
const E = UC(g, 224),
|
|
1837
|
-
let
|
|
1836
|
+
const E = UC(g, 224), Q = yield cB.run({ images: E }), B = Q[Object.keys(Q)[0]].data;
|
|
1837
|
+
let C = 0, t = -1 / 0;
|
|
1838
1838
|
return B.forEach((I, n) => {
|
|
1839
|
-
I > t && (t = I,
|
|
1839
|
+
I > t && (t = I, C = n);
|
|
1840
1840
|
}), JSON.stringify({
|
|
1841
1841
|
status: "success",
|
|
1842
1842
|
data: {
|
|
1843
|
-
isBack:
|
|
1844
|
-
isFront:
|
|
1845
|
-
other:
|
|
1843
|
+
isBack: C == 0,
|
|
1844
|
+
isFront: C == 1,
|
|
1845
|
+
other: C == 2
|
|
1846
1846
|
}
|
|
1847
1847
|
});
|
|
1848
1848
|
} catch (A) {
|
|
@@ -1855,8 +1855,8 @@ function UQ(g) {
|
|
|
1855
1855
|
}
|
|
1856
1856
|
function SQ(g, A) {
|
|
1857
1857
|
let E;
|
|
1858
|
-
return function(...
|
|
1859
|
-
clearTimeout(E), E = setTimeout(() => g.apply(this,
|
|
1858
|
+
return function(...Q) {
|
|
1859
|
+
clearTimeout(E), E = setTimeout(() => g.apply(this, Q), A);
|
|
1860
1860
|
};
|
|
1861
1861
|
}
|
|
1862
1862
|
function pQ(n) {
|
|
@@ -1864,23 +1864,23 @@ function pQ(n) {
|
|
|
1864
1864
|
onSubmit: g,
|
|
1865
1865
|
registrationData: A,
|
|
1866
1866
|
theme: E = "ocb",
|
|
1867
|
-
onShowPolicy:
|
|
1867
|
+
onShowPolicy: Q = () => {
|
|
1868
1868
|
},
|
|
1869
1869
|
selectedTaxAuthority: B,
|
|
1870
|
-
setSelectedTaxAuthority:
|
|
1870
|
+
setSelectedTaxAuthority: C,
|
|
1871
1871
|
dobPicker: t,
|
|
1872
1872
|
setDobPicker: I
|
|
1873
1873
|
}) {
|
|
1874
|
-
var sA, uA, TA, lA,
|
|
1874
|
+
var sA, uA, TA, lA, pA, uB, iB, sB, fB, mB, rB, PB, qB, vB, MB, TB, lB, HB, xB, dB, kB, RB, YB, JB, XB, FB, OB, GB, LB, zB, NB, bB, jB, yB, KB, UB, SB, pB, ZB, VB, WB, _B;
|
|
1875
1875
|
const o = document.createElement("div");
|
|
1876
1876
|
o.className = "wgt:flex wgt:flex-col wgt:gap-4 wgt:w-full";
|
|
1877
|
-
const
|
|
1878
|
-
|
|
1877
|
+
const h = document.createElement("form");
|
|
1878
|
+
h.className = "wgt:w-full wgt:max-w-[1072px] wgt:mx-auto wgt:space-y-4", h.addEventListener("submit", (G) => {
|
|
1879
1879
|
if (G.preventDefault(), !vA()) return;
|
|
1880
1880
|
const O = hA();
|
|
1881
1881
|
typeof g == "function" && g(O);
|
|
1882
|
-
}), o.appendChild(
|
|
1883
|
-
let i,
|
|
1882
|
+
}), o.appendChild(h);
|
|
1883
|
+
let i, c, D, s, q, F, J, H, P, m, d, v, f, r, M, X, k, R, T, Y, y, K, z, e, w;
|
|
1884
1884
|
const u = document.createElement("button");
|
|
1885
1885
|
i = dA({
|
|
1886
1886
|
name: "taxCode",
|
|
@@ -1896,7 +1896,7 @@ function pQ(n) {
|
|
|
1896
1896
|
O.length >= 10 ? IA(O) : i.setError(a("errorInvalidTaxCode", "Mã số thuế không hợp lệ"));
|
|
1897
1897
|
}, 1e3),
|
|
1898
1898
|
horizontal: !0
|
|
1899
|
-
}),
|
|
1899
|
+
}), c = dA({
|
|
1900
1900
|
name: "companyName",
|
|
1901
1901
|
label: a("companyName"),
|
|
1902
1902
|
required: !0,
|
|
@@ -1913,7 +1913,7 @@ function pQ(n) {
|
|
|
1913
1913
|
error: null,
|
|
1914
1914
|
placeholder: "",
|
|
1915
1915
|
type: "text",
|
|
1916
|
-
value: ((uB = (
|
|
1916
|
+
value: ((uB = (pA = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : pA.organization) == null ? void 0 : uB.address) || "",
|
|
1917
1917
|
readOnly: !1,
|
|
1918
1918
|
horizontal: !0
|
|
1919
1919
|
});
|
|
@@ -1931,7 +1931,7 @@ function pQ(n) {
|
|
|
1931
1931
|
horizontal: !0,
|
|
1932
1932
|
searchable: !0,
|
|
1933
1933
|
onChange: (G) => {
|
|
1934
|
-
G.target.id &&
|
|
1934
|
+
G.target.id && C(G.target.id), $();
|
|
1935
1935
|
}
|
|
1936
1936
|
}), B) {
|
|
1937
1937
|
const G = l.find(
|
|
@@ -2267,9 +2267,9 @@ function pQ(n) {
|
|
|
2267
2267
|
if (O !== b)
|
|
2268
2268
|
return;
|
|
2269
2269
|
if (gA.error)
|
|
2270
|
-
|
|
2270
|
+
c.inputEl.value = "", D.inputEl.value = "", s.setValue && s.setValue("", "", ""), s.setDisabled(!1);
|
|
2271
2271
|
else {
|
|
2272
|
-
if (
|
|
2272
|
+
if (c.inputEl.value = gA.ten_cty || "", D.inputEl.value = gA.dia_chi || "", gA.cqthue_ql) {
|
|
2273
2273
|
const DA = (OA) => OA.toLowerCase().replace(/phường\s+/i, "").replace(/xã\s+/i, "").replace(/quận\s+/i, "").trim(), fA = DA(gA.cqthue_ql), qA = l.find((OA) => {
|
|
2274
2274
|
const GA = DA(OA.label);
|
|
2275
2275
|
return GA.includes(fA) || fA.includes(GA);
|
|
@@ -2303,9 +2303,9 @@ function pQ(n) {
|
|
|
2303
2303
|
const U = document.createElement("h3");
|
|
2304
2304
|
U.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", U.innerText = a("unitInfo", "1. Thông tin đơn vị"), S.appendChild(U);
|
|
2305
2305
|
const nA = document.createElement("div");
|
|
2306
|
-
nA.className = "wgt:grid wgt:@max-2xl:grid-cols-1 wgt:@max-2xl:p-4 wgt:@max-2xl:gap-3 wgt:grid-cols-2 wgt:gap-y-2 wgt:gap-x-4 wgt:space-y-2 wgt:px-6 wgt:py-4 wgt:rounded-xl wgt:bg-weak-50", S.appendChild(nA), nA.appendChild(i.container), nA.appendChild(
|
|
2306
|
+
nA.className = "wgt:grid wgt:@max-2xl:grid-cols-1 wgt:@max-2xl:p-4 wgt:@max-2xl:gap-3 wgt:grid-cols-2 wgt:gap-y-2 wgt:gap-x-4 wgt:space-y-2 wgt:px-6 wgt:py-4 wgt:rounded-xl wgt:bg-weak-50", S.appendChild(nA), nA.appendChild(i.container), nA.appendChild(c.container), nA.appendChild(D.container), nA.appendChild(s.container);
|
|
2307
2307
|
const aA = document.createElement("div");
|
|
2308
|
-
aA.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4", S.appendChild(aA), aA.appendChild(K.container),
|
|
2308
|
+
aA.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4", S.appendChild(aA), aA.appendChild(K.container), h.appendChild(S);
|
|
2309
2309
|
const cA = document.createElement("div");
|
|
2310
2310
|
cA.className = "wgt:space-y-4";
|
|
2311
2311
|
const YA = document.createElement("h3");
|
|
@@ -2370,7 +2370,7 @@ function pQ(n) {
|
|
|
2370
2370
|
}
|
|
2371
2371
|
});
|
|
2372
2372
|
}
|
|
2373
|
-
function
|
|
2373
|
+
function yA(G, O, gA) {
|
|
2374
2374
|
const DA = new Image();
|
|
2375
2375
|
DA.src = URL.createObjectURL(G), DA.onload = () => V(null, null, function* () {
|
|
2376
2376
|
yield UQ(DA).then((fA) => {
|
|
@@ -2390,14 +2390,14 @@ function pQ(n) {
|
|
|
2390
2390
|
getBackFileError: $A,
|
|
2391
2391
|
setFrontFileError: zA,
|
|
2392
2392
|
setBackFileError: hg,
|
|
2393
|
-
getFrontFile:
|
|
2393
|
+
getFrontFile: VA,
|
|
2394
2394
|
getBackFile: Ag
|
|
2395
2395
|
} = qQ({
|
|
2396
2396
|
frontFile: A == null ? void 0 : A.idCard,
|
|
2397
2397
|
backFile: A == null ? void 0 : A.idCardBack,
|
|
2398
2398
|
onFrontChange: (G) => V(null, null, function* () {
|
|
2399
2399
|
var gA, DA;
|
|
2400
|
-
if (e = G,
|
|
2400
|
+
if (e = G, yA(G, !0, !1), tg() || $A() || !Ag()) {
|
|
2401
2401
|
kA = !1, iA = !1, FA(), $();
|
|
2402
2402
|
return;
|
|
2403
2403
|
}
|
|
@@ -2409,7 +2409,7 @@ function pQ(n) {
|
|
|
2409
2409
|
}),
|
|
2410
2410
|
onBackChange: (G) => V(null, null, function* () {
|
|
2411
2411
|
var gA, DA;
|
|
2412
|
-
if (w = G,
|
|
2412
|
+
if (w = G, yA(G, !1, !0), tg() || $A() || !VA()) {
|
|
2413
2413
|
kA = !1, iA = !1, FA(), $();
|
|
2414
2414
|
return;
|
|
2415
2415
|
}
|
|
@@ -2417,38 +2417,38 @@ function pQ(n) {
|
|
|
2417
2417
|
$();
|
|
2418
2418
|
return;
|
|
2419
2419
|
}
|
|
2420
|
-
PA(
|
|
2420
|
+
PA(VA());
|
|
2421
2421
|
}),
|
|
2422
2422
|
theme: E
|
|
2423
2423
|
});
|
|
2424
2424
|
JA.appendChild(sg);
|
|
2425
|
-
const
|
|
2426
|
-
|
|
2425
|
+
const WA = document.createElement("div");
|
|
2426
|
+
WA.className = "wgt:space-y-4", WA.appendChild(P.container);
|
|
2427
2427
|
const NA = document.createElement("div");
|
|
2428
|
-
NA.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4",
|
|
2429
|
-
const
|
|
2430
|
-
|
|
2431
|
-
const
|
|
2432
|
-
|
|
2428
|
+
NA.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4", WA.appendChild(NA), NA.appendChild(m.container), NA.appendChild(d.container), JA.appendChild(WA);
|
|
2429
|
+
const KA = document.createElement("div");
|
|
2430
|
+
KA.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-4 wgt:gap-4 wgt:items-start", KA.appendChild(f.container), KA.appendChild(r.container), KA.appendChild(v.container), KA.appendChild(M.container), cA.appendChild(JA), cA.appendChild(KA), cA.appendChild(X.container), cA.appendChild(z.container);
|
|
2431
|
+
const UA = document.createElement("ul");
|
|
2432
|
+
UA.className = "wgt:list-inside wgt:list-disc wgt:-mt-2";
|
|
2433
2433
|
const cg = document.createElement("li");
|
|
2434
2434
|
cg.className = "wgt:text-sm wgt:text-[#8C8C8C] wgt:italic", cg.innerText = a(
|
|
2435
2435
|
"legalRepNote",
|
|
2436
2436
|
"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."
|
|
2437
|
-
),
|
|
2437
|
+
), UA.appendChild(cg), cA.appendChild(UA), h.appendChild(cA);
|
|
2438
2438
|
const XA = document.createElement("div");
|
|
2439
2439
|
XA.className = "wgt:space-y-4";
|
|
2440
2440
|
const fg = document.createElement("h3");
|
|
2441
2441
|
fg.className = "wgt:text-lg wgt:font-semibold wgt:mb-2", fg.innerText = a("contactInfo", "3. Thông tin người liên hệ:"), XA.appendChild(fg);
|
|
2442
|
-
const
|
|
2443
|
-
|
|
2444
|
-
const
|
|
2445
|
-
|
|
2442
|
+
const _A = document.createElement("div");
|
|
2443
|
+
_A.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4 wgt:items-start", _A.appendChild(q.container), _A.appendChild(F.container), _A.appendChild(J.container), _A.appendChild(H.container), XA.appendChild(_A), h.appendChild(XA);
|
|
2444
|
+
const SA = document.createElement("div");
|
|
2445
|
+
SA.className = "wgt:space-y-4";
|
|
2446
2446
|
const xA = document.createElement("h3");
|
|
2447
|
-
xA.className = "wgt:text-lg wgt:font-semibold wgt:mb-2", xA.innerText = a("invoiceUsageInfo", "4. THÔNG TIN SỬ DỤNG HDDT:"),
|
|
2447
|
+
xA.className = "wgt:text-lg wgt:font-semibold wgt:mb-2", xA.innerText = a("invoiceUsageInfo", "4. THÔNG TIN SỬ DỤNG HDDT:"), SA.appendChild(xA), h.appendChild(SA);
|
|
2448
2448
|
const j = document.createElement("div");
|
|
2449
|
-
j.className = "wgt:w-full wgt:flex wgt:gap-4 wgt:items-start wgt:flex-row wgt:@max-4xl:flex-col", j.appendChild(k.container), j.appendChild(N.container),
|
|
2449
|
+
j.className = "wgt:w-full wgt:flex wgt:gap-4 wgt:items-start wgt:flex-row wgt:@max-4xl:flex-col", j.appendChild(k.container), j.appendChild(N.container), SA.appendChild(j);
|
|
2450
2450
|
const W = document.createElement("div");
|
|
2451
|
-
W.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",
|
|
2451
|
+
W.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", h.appendChild(W);
|
|
2452
2452
|
const CA = document.createElement("div");
|
|
2453
2453
|
CA.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", CA.appendChild(R);
|
|
2454
2454
|
const p = document.createElement("h4");
|
|
@@ -2497,12 +2497,12 @@ function pQ(n) {
|
|
|
2497
2497
|
const x = (G) => {
|
|
2498
2498
|
const O = document.createElement("button");
|
|
2499
2499
|
return O.className = "wgt:text-primary wgt:font-semibold wgt:hover:underline wgt:cursor-pointer", O.textContent = G, O.onclick = (gA) => {
|
|
2500
|
-
gA.preventDefault(), typeof
|
|
2500
|
+
gA.preventDefault(), typeof Q == "function" && Q();
|
|
2501
2501
|
}, O;
|
|
2502
2502
|
}, BA = rQ(E);
|
|
2503
2503
|
Bg.appendChild(
|
|
2504
2504
|
x(a("termsAndUsagePolicy", "Điều khoản và Chính sách sử dụng"))
|
|
2505
|
-
), Bg.appendChild(document.createTextNode(` ${a("of", "của")} ${BA}.`)), AA.appendChild(wA), AA.appendChild(Bg),
|
|
2505
|
+
), Bg.appendChild(document.createTextNode(` ${a("of", "của")} ${BA}.`)), AA.appendChild(wA), AA.appendChild(Bg), h.appendChild(AA), wA.addEventListener("click", () => {
|
|
2506
2506
|
tA = !tA, tA ? (wA.classList.add("wgt:bg-primary"), MA.classList.remove("wgt:hidden")) : (wA.classList.remove("wgt:bg-primary"), MA.classList.add("wgt:hidden")), $();
|
|
2507
2507
|
});
|
|
2508
2508
|
const eA = document.createElement("div");
|
|
@@ -2536,7 +2536,7 @@ function pQ(n) {
|
|
|
2536
2536
|
taxAuthorityCode: (G = y == null ? void 0 : y.getValue()) != null ? G : "",
|
|
2537
2537
|
previousEInvoiceProvider: (O = Y == null ? void 0 : Y.getValue()) != null ? O : "",
|
|
2538
2538
|
organization: {
|
|
2539
|
-
name:
|
|
2539
|
+
name: c == null ? void 0 : c.getValue(),
|
|
2540
2540
|
address: D == null ? void 0 : D.getValue(),
|
|
2541
2541
|
taxCode: i == null ? void 0 : i.getValue(),
|
|
2542
2542
|
taxAuthority: s == null ? void 0 : s.getValue()
|
|
@@ -2568,7 +2568,7 @@ function pQ(n) {
|
|
|
2568
2568
|
};
|
|
2569
2569
|
}
|
|
2570
2570
|
[
|
|
2571
|
-
|
|
2571
|
+
c,
|
|
2572
2572
|
i,
|
|
2573
2573
|
D,
|
|
2574
2574
|
q,
|
|
@@ -2602,12 +2602,12 @@ function pQ(n) {
|
|
|
2602
2602
|
}
|
|
2603
2603
|
function ZQ(E) {
|
|
2604
2604
|
return V(this, arguments, function* ({ providerProps: g, formProps: A }) {
|
|
2605
|
-
const
|
|
2606
|
-
|
|
2605
|
+
const Q = document.createElement("div");
|
|
2606
|
+
Q.className = "wgt:flex wgt:flex-col wgt:gap-4 wgt:w-full";
|
|
2607
2607
|
const B = fQ(g);
|
|
2608
|
-
|
|
2609
|
-
const { container:
|
|
2610
|
-
return
|
|
2608
|
+
Q.appendChild(B.container);
|
|
2609
|
+
const { container: C } = yield pQ(A);
|
|
2610
|
+
return Q.appendChild(C), { container: Q };
|
|
2611
2611
|
});
|
|
2612
2612
|
}
|
|
2613
2613
|
function VQ({
|
|
@@ -2615,21 +2615,21 @@ function VQ({
|
|
|
2615
2615
|
placeholder: A = "",
|
|
2616
2616
|
onInputChange: E = void 0
|
|
2617
2617
|
}) {
|
|
2618
|
-
const
|
|
2618
|
+
const Q = A || a("searchUnits"), B = document.createElement("div");
|
|
2619
2619
|
B.className = "wgt:flex wgt:flex-col";
|
|
2620
|
-
const
|
|
2621
|
-
|
|
2620
|
+
const C = document.createElement("div");
|
|
2621
|
+
C.className = "wgt:flex wgt:rounded-lg wgt:border wgt:border-gray-300 wgt:overflow-hidden", B.appendChild(C);
|
|
2622
2622
|
const t = document.createElement("input");
|
|
2623
|
-
return t.type = "text", t.inputMode = "numeric", t.value = g, t.placeholder =
|
|
2623
|
+
return t.type = "text", t.inputMode = "numeric", t.value = g, t.placeholder = Q, t.className = "wgt:flex-1 wgt:px-4 wgt:py-2 wgt:text-text-sub-600 wgt:placeholder-gray-400 wgt:bg-white wgt:focus:outline-none", typeof E == "function" && t.addEventListener("input", E), C.appendChild(t), { container: B };
|
|
2624
2624
|
}
|
|
2625
2625
|
const HA = (g) => new Intl.NumberFormat("vi-VN").format(g);
|
|
2626
2626
|
function WQ({
|
|
2627
2627
|
pkg: g,
|
|
2628
2628
|
type: A,
|
|
2629
2629
|
isDiscounted: E,
|
|
2630
|
-
promotion:
|
|
2630
|
+
promotion: Q,
|
|
2631
2631
|
isSelected: B,
|
|
2632
|
-
onSelect:
|
|
2632
|
+
onSelect: C
|
|
2633
2633
|
}) {
|
|
2634
2634
|
const t = document.createElement("div");
|
|
2635
2635
|
t.className = [
|
|
@@ -2644,21 +2644,21 @@ function WQ({
|
|
|
2644
2644
|
"wgt:bg-white",
|
|
2645
2645
|
"wgt:justify-between",
|
|
2646
2646
|
B ? "wgt:border-primary" : "wgt:border-grey-6 wgt:hover:border-gray-300"
|
|
2647
|
-
].filter(Boolean).join(" "), t.onclick =
|
|
2647
|
+
].filter(Boolean).join(" "), t.onclick = C;
|
|
2648
2648
|
const I = document.createElement("div");
|
|
2649
2649
|
I.className = "wgt:w-full", t.appendChild(I);
|
|
2650
2650
|
const n = document.createElement("div");
|
|
2651
2651
|
n.className = "wgt:w-full wgt:flex wgt:justify-between wgt:items-center";
|
|
2652
2652
|
const o = document.createElement("div");
|
|
2653
2653
|
o.className = "wgt:flex wgt:items-center wgt:gap-2";
|
|
2654
|
-
const
|
|
2655
|
-
if (
|
|
2654
|
+
const h = document.createElement("span");
|
|
2655
|
+
if (h.className = [
|
|
2656
2656
|
"wgt:text-base",
|
|
2657
2657
|
"wgt:font-semibold",
|
|
2658
2658
|
B ? "wgt:text-primary" : "wgt:text-text-sub-600"
|
|
2659
|
-
].join(" "),
|
|
2659
|
+
].join(" "), h.innerText = g.code, o.appendChild(h), E) {
|
|
2660
2660
|
const H = document.createElement("div");
|
|
2661
|
-
H.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", H.innerText =
|
|
2661
|
+
H.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", H.innerText = Q, o.appendChild(H);
|
|
2662
2662
|
}
|
|
2663
2663
|
n.appendChild(o);
|
|
2664
2664
|
const { container: i } = Jg({
|
|
@@ -2667,13 +2667,13 @@ function WQ({
|
|
|
2667
2667
|
}
|
|
2668
2668
|
});
|
|
2669
2669
|
n.appendChild(i), I.appendChild(n);
|
|
2670
|
-
const
|
|
2671
|
-
|
|
2670
|
+
const c = document.createElement("div");
|
|
2671
|
+
c.className = "wgt:flex wgt:items-center wgt:text-gray-600 wgt:mt-2";
|
|
2672
2672
|
const D = document.createElement("div");
|
|
2673
2673
|
D.innerHTML = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2674
2674
|
<path d="M15.384 5.76968L6.95352 13.5705C6.6518 13.8497 6.26133 13.9811 5.85312 13.9811C5.46265 13.9811 5.07219 13.8497 4.77047 13.5705L0.546335 9.67832C-0.0571118 9.10352 -0.0571118 8.20026 0.546335 7.64188C1.14978 7.08351 2.1437 7.08351 2.74714 7.64188L5.85312 10.5159L13.1832 3.73324C13.7867 3.17486 14.7806 3.17486 15.384 3.73324C15.9875 4.30804 15.9875 5.2113 15.384 5.76968Z" fill="#008C4F"/>
|
|
2675
2675
|
</svg>
|
|
2676
|
-
`,
|
|
2676
|
+
`, c.appendChild(D);
|
|
2677
2677
|
const s = document.createElement("span");
|
|
2678
2678
|
if (s.className = "wgt:ml-2 wgt:text-sm", A === "signature") {
|
|
2679
2679
|
const H = ag(), P = a(g.duration.unit), m = H === "en" && g.duration.value > 1 ? P + "s" : P;
|
|
@@ -2681,7 +2681,7 @@ function WQ({
|
|
|
2681
2681
|
} else typeof (g == null ? void 0 : g.limit) == "number" ? s.innerText = `${g == null ? void 0 : g.limit.toLocaleString(
|
|
2682
2682
|
"vi-VN"
|
|
2683
2683
|
)} ${a("searchUnits")}` : s.innerText = "";
|
|
2684
|
-
|
|
2684
|
+
c.appendChild(s), I.appendChild(c);
|
|
2685
2685
|
const q = document.createElement("div");
|
|
2686
2686
|
q.className = "wgt:mt-4";
|
|
2687
2687
|
const F = document.createElement("span");
|
|
@@ -2699,9 +2699,9 @@ function nC({
|
|
|
2699
2699
|
// or "signature"
|
|
2700
2700
|
packageOptions: A = [],
|
|
2701
2701
|
disCountedPackages: E = [],
|
|
2702
|
-
promotion:
|
|
2702
|
+
promotion: Q,
|
|
2703
2703
|
selectedPackageId: B = "",
|
|
2704
|
-
handlePackageSelect:
|
|
2704
|
+
handlePackageSelect: C
|
|
2705
2705
|
} = {}) {
|
|
2706
2706
|
const t = document.createElement("div");
|
|
2707
2707
|
t.className = "wgt:space-y-6";
|
|
@@ -2722,43 +2722,43 @@ function nC({
|
|
|
2722
2722
|
// prevent text selection while dragging
|
|
2723
2723
|
].join(" "), I.style.scrollSnapType = "x mandatory", I.style.overflowX = "auto", I.style.scrollBehavior = "smooth", I.style.scrollbarWidth = "none", I.style.msOverflowStyle = "none", I.style.WebkitOverflowScrolling = "touch", I.style.scrollbarWidth = "none", I.style.overflowY = "hidden", t.appendChild(I);
|
|
2724
2724
|
function n() {
|
|
2725
|
-
I.innerHTML = "", A.forEach((
|
|
2726
|
-
const D =
|
|
2727
|
-
pkg:
|
|
2725
|
+
I.innerHTML = "", A.forEach((c) => {
|
|
2726
|
+
const D = c._id === B, s = E.includes(c.code), { container: q } = WQ({
|
|
2727
|
+
pkg: c,
|
|
2728
2728
|
type: g,
|
|
2729
2729
|
isDiscounted: s,
|
|
2730
|
-
promotion:
|
|
2730
|
+
promotion: Q,
|
|
2731
2731
|
isSelected: D,
|
|
2732
2732
|
onSelect: () => {
|
|
2733
|
-
typeof
|
|
2733
|
+
typeof C == "function" && C(c._id);
|
|
2734
2734
|
}
|
|
2735
2735
|
});
|
|
2736
2736
|
I.appendChild(q);
|
|
2737
2737
|
});
|
|
2738
2738
|
}
|
|
2739
2739
|
n();
|
|
2740
|
-
let o = !1,
|
|
2741
|
-
return I.addEventListener("mousedown", (
|
|
2742
|
-
o = !0, I.classList.replace("wgt:cursor-grab", "wgt:cursor-grabbing"),
|
|
2740
|
+
let o = !1, h, i;
|
|
2741
|
+
return I.addEventListener("mousedown", (c) => {
|
|
2742
|
+
o = !0, I.classList.replace("wgt:cursor-grab", "wgt:cursor-grabbing"), h = c.pageX - I.offsetLeft, i = I.scrollLeft;
|
|
2743
2743
|
}), document.addEventListener("mouseup", () => {
|
|
2744
2744
|
o = !1, I.classList.replace("wgt:cursor-grabbing", "wgt:cursor-grab");
|
|
2745
2745
|
}), I.addEventListener("mouseleave", () => {
|
|
2746
2746
|
o = !1, I.classList.replace("wgt:cursor-grabbing", "wgt:cursor-grab");
|
|
2747
|
-
}), I.addEventListener("mousemove", (
|
|
2747
|
+
}), I.addEventListener("mousemove", (c) => {
|
|
2748
2748
|
if (!o) return;
|
|
2749
|
-
|
|
2750
|
-
const s = (
|
|
2749
|
+
c.preventDefault();
|
|
2750
|
+
const s = (c.pageX - I.offsetLeft - h) * 1.5;
|
|
2751
2751
|
I.scrollLeft = i - s;
|
|
2752
|
-
}), I.addEventListener("wheel", (
|
|
2753
|
-
|
|
2752
|
+
}), I.addEventListener("wheel", (c) => {
|
|
2753
|
+
c.preventDefault(), I.scrollLeft += c.deltaY;
|
|
2754
2754
|
}), {
|
|
2755
2755
|
container: t,
|
|
2756
|
-
setSelectedPackageId(
|
|
2757
|
-
B =
|
|
2756
|
+
setSelectedPackageId(c) {
|
|
2757
|
+
B = c, n();
|
|
2758
2758
|
}
|
|
2759
2759
|
};
|
|
2760
2760
|
}
|
|
2761
|
-
const _Q = "1.
|
|
2761
|
+
const _Q = "1.84.0";
|
|
2762
2762
|
function $Q(E) {
|
|
2763
2763
|
return V(this, arguments, function* ({ search: g, bank: A }) {
|
|
2764
2764
|
return (yield LA.get(`${Yg}`, {
|
|
@@ -2815,8 +2815,8 @@ function SC(g) {
|
|
|
2815
2815
|
), A.append("provider", g.provider), A.append("bank", g.bank), A.append("packages", JSON.stringify(g.packages)), A.append("promotionCodes", JSON.stringify(g.promotionCodes)), A.append("logo", g.logo), A.append(
|
|
2816
2816
|
"organizationRegistrationCert",
|
|
2817
2817
|
g.organizationRegistrationCert
|
|
2818
|
-
), g.legalRepresentativeIdCard.forEach((
|
|
2819
|
-
A.append("legalRepresentativeIdCard",
|
|
2818
|
+
), g.legalRepresentativeIdCard.forEach((Q) => {
|
|
2819
|
+
A.append("legalRepresentativeIdCard", Q);
|
|
2820
2820
|
}), yield LA.post(hQ, A, {
|
|
2821
2821
|
headers: {
|
|
2822
2822
|
"Content-Type": "multipart/form-data",
|
|
@@ -2841,7 +2841,7 @@ function QE() {
|
|
|
2841
2841
|
return (yield LA.get(`${cQ}`)).data;
|
|
2842
2842
|
});
|
|
2843
2843
|
}
|
|
2844
|
-
function EE({ name: g, value: A, feeLabel: E, required:
|
|
2844
|
+
function EE({ name: g, value: A, feeLabel: E, required: Q, description: B, isChecked: C = !0 }) {
|
|
2845
2845
|
const t = document.createElement("label");
|
|
2846
2846
|
t.className = [
|
|
2847
2847
|
"wgt:relative",
|
|
@@ -2856,7 +2856,7 @@ function EE({ name: g, value: A, feeLabel: E, required: C, description: B, isChe
|
|
|
2856
2856
|
const I = Jg({
|
|
2857
2857
|
name: g,
|
|
2858
2858
|
value: A,
|
|
2859
|
-
checked:
|
|
2859
|
+
checked: C,
|
|
2860
2860
|
onChange: () => {
|
|
2861
2861
|
}
|
|
2862
2862
|
});
|
|
@@ -2865,11 +2865,11 @@ function EE({ name: g, value: A, feeLabel: E, required: C, description: B, isChe
|
|
|
2865
2865
|
n.className = "wgt:flex wgt:flex-col wgt:gap-1";
|
|
2866
2866
|
const o = document.createElement("div");
|
|
2867
2867
|
o.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";
|
|
2868
|
-
const
|
|
2869
|
-
|
|
2868
|
+
const h = document.createElement("span");
|
|
2869
|
+
h.className = "wgt:text-base wgt:font-semibold wgt:text-text-sub-600", h.textContent = E, o.appendChild(h);
|
|
2870
2870
|
{
|
|
2871
|
-
const
|
|
2872
|
-
|
|
2871
|
+
const c = document.createElement("span");
|
|
2872
|
+
c.className = [
|
|
2873
2873
|
"wgt:bg-soft-200",
|
|
2874
2874
|
"wgt:text-text-sub-600",
|
|
2875
2875
|
"wgt:text-xs",
|
|
@@ -2877,7 +2877,7 @@ function EE({ name: g, value: A, feeLabel: E, required: C, description: B, isChe
|
|
|
2877
2877
|
"wgt:px-1.5",
|
|
2878
2878
|
"wgt:py-1",
|
|
2879
2879
|
"wgt:rounded-sm"
|
|
2880
|
-
].join(" "),
|
|
2880
|
+
].join(" "), c.textContent = a("required"), o.appendChild(c);
|
|
2881
2881
|
}
|
|
2882
2882
|
n.appendChild(o);
|
|
2883
2883
|
const i = document.createElement("p");
|
|
@@ -2904,15 +2904,15 @@ function IE({
|
|
|
2904
2904
|
onSelect: A,
|
|
2905
2905
|
isDisabled: E = !1
|
|
2906
2906
|
}) {
|
|
2907
|
-
const
|
|
2908
|
-
|
|
2907
|
+
const Q = document.createElement("div");
|
|
2908
|
+
Q.className = "wgt:w-full wgt:flex wgt:items-center wgt:relative wgt:h-[6.75rem]" + (E ? " wgt:opacity-50" : "");
|
|
2909
2909
|
const B = document.createElement("div");
|
|
2910
2910
|
B.className = "wgt:absolute wgt:top-0 wgt:left-0 wgt:z-0", B.innerHTML = `<svg width="177" height="108" viewBox="0 0 177 108" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2911
2911
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M35.0743 3.375H37.1375V0H166.603C172.3 0 176.919 5.65535 176.919 12.6316V95.3684C176.919 102.345 172.3 108 166.603 108H37.1375V104.625H35.0743V108H10.316C4.61862 108 4.15411e-08 102.345 0 95.3684V93.4737C3.41841 93.4737 6.18958 90.0805 6.18958 85.8947C6.18958 81.709 3.41841 78.3158 0 78.3158V72C3.41841 72 6.18958 68.6068 6.18958 64.4211C6.18958 60.2353 3.41841 56.8421 0 56.8421V50.5263C3.41841 50.5263 6.18958 47.1331 6.18958 42.9474C6.18958 38.7616 3.41841 35.3684 0 35.3684V29.0526C3.41841 29.0526 6.18958 25.6594 6.18958 21.4737C6.18958 17.2879 3.41841 13.8947 0 13.8947V12.6316C0 5.65535 4.61862 0 10.316 0H35.0743V3.375ZM35.0743 97.875H37.1375V91.125H35.0743V97.875ZM35.0743 84.375H37.1375V77.625H35.0743V84.375ZM35.0743 70.875H37.1375V64.125H35.0743V70.875ZM35.0743 57.375H37.1375V50.625H35.0743V57.375ZM35.0743 43.875H37.1375V37.125H35.0743V43.875ZM35.0743 30.375H37.1375V23.625H35.0743V30.375ZM35.0743 16.875H37.1375V10.125H35.0743V16.875Z" fill="#C0D5FF"/>
|
|
2912
2912
|
</svg>
|
|
2913
2913
|
`;
|
|
2914
|
-
const
|
|
2915
|
-
|
|
2914
|
+
const C = document.createElement("div");
|
|
2915
|
+
C.className = "wgt:w-full wgt:relative wgt:z-10 wgt:h-full wgt:bg-white wgt:rounded-tr wgt:rounded-br wgt:px-4 wgt:py-3 wgt:ml-9 wgt:flex wgt:flex-col wgt:justify-between";
|
|
2916
2916
|
const t = document.createElement("div");
|
|
2917
2917
|
t.className = "wgt:flex wgt:items-start wgt:flex-col wgt:relative";
|
|
2918
2918
|
const I = document.createElement("h3");
|
|
@@ -2938,23 +2938,23 @@ function IE({
|
|
|
2938
2938
|
isIconCheckbox: !0,
|
|
2939
2939
|
disabled: E || g.isSelected
|
|
2940
2940
|
});
|
|
2941
|
-
o.className = "wgt:absolute wgt:top-0 wgt:right-0", t.appendChild(o),
|
|
2942
|
-
const
|
|
2943
|
-
return
|
|
2941
|
+
o.className = "wgt:absolute wgt:top-0 wgt:right-0", t.appendChild(o), C.appendChild(t);
|
|
2942
|
+
const h = document.createElement("p");
|
|
2943
|
+
return h.className = [
|
|
2944
2944
|
"wgt:text-xs",
|
|
2945
2945
|
"wgt:font-normal",
|
|
2946
2946
|
"wgt:text-right",
|
|
2947
2947
|
"wgt:text-[#335CFF]",
|
|
2948
2948
|
"wgt:italic"
|
|
2949
|
-
].join(" "),
|
|
2949
|
+
].join(" "), h.textContent = `${a("validityPeriod")}: ${a("expiredDate")} ${g.expiredAt.split("T")[0]}`, C.appendChild(h), Q.appendChild(B), Q.appendChild(C), { container: Q };
|
|
2950
2950
|
}
|
|
2951
2951
|
function nE({
|
|
2952
2952
|
theme: g,
|
|
2953
2953
|
debounceTimer: A,
|
|
2954
2954
|
typedUnits: E,
|
|
2955
|
-
onSearchComplete:
|
|
2955
|
+
onSearchComplete: Q
|
|
2956
2956
|
}) {
|
|
2957
|
-
let B = [],
|
|
2957
|
+
let B = [], C = [];
|
|
2958
2958
|
const t = document.createElement("div");
|
|
2959
2959
|
t.className = "wgt:flex wgt:flex-col wgt:gap-3";
|
|
2960
2960
|
const I = document.createElement("div");
|
|
@@ -2963,12 +2963,12 @@ function nE({
|
|
|
2963
2963
|
n.className = "wgt:text-xl wgt:font-bold wgt:text-text-black", n.innerText = a("selectInvoicePackage");
|
|
2964
2964
|
const o = document.createElement("span");
|
|
2965
2965
|
o.className = "wgt:text-sm wgt:text-red-500 wgt:ml-1", o.innerText = "*", n.appendChild(o), I.appendChild(n);
|
|
2966
|
-
function
|
|
2966
|
+
function h() {
|
|
2967
2967
|
return V(this, null, function* () {
|
|
2968
2968
|
A && clearTimeout(A), E !== "" ? A = setTimeout(() => V(null, null, function* () {
|
|
2969
2969
|
try {
|
|
2970
2970
|
const H = E.trim().toLowerCase().replace(/\B(?=(\d{3})+(?!\d))/g, "."), P = yield $Q({ search: H, bank: g });
|
|
2971
|
-
P && (
|
|
2971
|
+
P && (C = P), Q && Q();
|
|
2972
2972
|
} catch (H) {
|
|
2973
2973
|
console.error("Error searching packages:", H), og.error(a("errorSearchingPackages"), {
|
|
2974
2974
|
autoClose: 5e3,
|
|
@@ -2976,23 +2976,23 @@ function nE({
|
|
|
2976
2976
|
icon: !0
|
|
2977
2977
|
});
|
|
2978
2978
|
}
|
|
2979
|
-
}), 500) : (
|
|
2979
|
+
}), 500) : (C = B, Q && Q());
|
|
2980
2980
|
});
|
|
2981
2981
|
}
|
|
2982
2982
|
const i = VQ({
|
|
2983
2983
|
value: "",
|
|
2984
2984
|
placeholder: a("searchUnits"),
|
|
2985
2985
|
onInputChange: (H) => {
|
|
2986
|
-
E = H.target.value.replace(/\D/g, ""),
|
|
2986
|
+
E = H.target.value.replace(/\D/g, ""), h();
|
|
2987
2987
|
}
|
|
2988
2988
|
});
|
|
2989
2989
|
I.appendChild(i.container);
|
|
2990
|
-
const
|
|
2991
|
-
|
|
2990
|
+
const c = document.createElement("div");
|
|
2991
|
+
c.className = "wgt:flex wgt:flex-col wgt:gap-2", t.appendChild(c);
|
|
2992
2992
|
const D = document.createElement("h3");
|
|
2993
|
-
D.className = "wgt:text-sm wgt:font-semibold wgt:text-[#525866]", D.innerText = a("mostSuitablePackage"),
|
|
2993
|
+
D.className = "wgt:text-sm wgt:font-semibold wgt:text-[#525866]", D.innerText = a("mostSuitablePackage"), c.appendChild(D);
|
|
2994
2994
|
const s = document.createElement("div");
|
|
2995
|
-
|
|
2995
|
+
c.appendChild(s);
|
|
2996
2996
|
const q = document.createElement("div");
|
|
2997
2997
|
q.className = "wgt:flex wgt:items-center wgt:justify-center wgt:py-8", q.innerHTML = `
|
|
2998
2998
|
<div class="wgt:flex wgt:flex-col wgt:items-center wgt:gap-2">
|
|
@@ -3013,10 +3013,10 @@ function nE({
|
|
|
3013
3013
|
B = H;
|
|
3014
3014
|
},
|
|
3015
3015
|
setFilteredInvoiceOptions: (H) => {
|
|
3016
|
-
|
|
3016
|
+
C = H;
|
|
3017
3017
|
},
|
|
3018
3018
|
getInvoicePackages: () => B,
|
|
3019
|
-
getFilteredInvoiceOptions: () =>
|
|
3019
|
+
getFilteredInvoiceOptions: () => C,
|
|
3020
3020
|
findInvoiceById: F,
|
|
3021
3021
|
removeLoading: J
|
|
3022
3022
|
};
|
|
@@ -3028,17 +3028,17 @@ function tE() {
|
|
|
3028
3028
|
A.className = "wgt:text-xl wgt:font-bold wgt:text-text-black", A.innerText = a("selectSignaturePackage");
|
|
3029
3029
|
const E = document.createElement("span");
|
|
3030
3030
|
E.className = "wgt:text-sm wgt:text-red-500 wgt:ml-1", E.innerText = "*", A.appendChild(E), g.appendChild(A);
|
|
3031
|
-
const
|
|
3032
|
-
g.appendChild(
|
|
3031
|
+
const Q = document.createElement("div");
|
|
3032
|
+
g.appendChild(Q);
|
|
3033
3033
|
const B = document.createElement("div");
|
|
3034
3034
|
return B.className = "wgt:flex wgt:items-center wgt:justify-center wgt:py-8", B.innerHTML = `
|
|
3035
3035
|
<div class="wgt:flex wgt:flex-col wgt:items-center wgt:gap-2">
|
|
3036
3036
|
<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>
|
|
3037
3037
|
<span class="wgt:text-sm wgt:text-text-sub-600">${a("loading")}...</span>
|
|
3038
3038
|
</div>
|
|
3039
|
-
`,
|
|
3039
|
+
`, Q.appendChild(B), {
|
|
3040
3040
|
container: g,
|
|
3041
|
-
signatureSelectorWrapper:
|
|
3041
|
+
signatureSelectorWrapper: Q
|
|
3042
3042
|
};
|
|
3043
3043
|
}
|
|
3044
3044
|
function hE() {
|
|
@@ -3048,8 +3048,8 @@ function hE() {
|
|
|
3048
3048
|
A.className = "wgt:text-sm wgt:font-semibold wgt:leading-[18px] wgt:text-text-black", A.innerText = a("paymentMethod"), g.appendChild(A);
|
|
3049
3049
|
const E = document.createElement("div");
|
|
3050
3050
|
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", g.appendChild(E);
|
|
3051
|
-
const
|
|
3052
|
-
|
|
3051
|
+
const Q = document.createElement("div");
|
|
3052
|
+
Q.innerHTML = `
|
|
3053
3053
|
<svg
|
|
3054
3054
|
width="24"
|
|
3055
3055
|
height="24"
|
|
@@ -3074,7 +3074,7 @@ function hE() {
|
|
|
3074
3074
|
</clipPath>
|
|
3075
3075
|
</defs>
|
|
3076
3076
|
</svg>
|
|
3077
|
-
`, E.appendChild(
|
|
3077
|
+
`, E.appendChild(Q);
|
|
3078
3078
|
const B = document.createElement("span");
|
|
3079
3079
|
return B.className = "wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-strong-950", B.innerText = a("qrPayment"), E.appendChild(B), {
|
|
3080
3080
|
container: g
|
|
@@ -3087,11 +3087,11 @@ function cE() {
|
|
|
3087
3087
|
A.className = "wgt:text-lg wgt:font-bold wgt:text-text-black wgt:@max-2xl:text-xl wgt:@max-2xl:mb-3", A.innerText = a("selectedProducts"), g.appendChild(A);
|
|
3088
3088
|
const E = document.createElement("div");
|
|
3089
3089
|
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", g.appendChild(E);
|
|
3090
|
-
const
|
|
3091
|
-
|
|
3090
|
+
const Q = document.createElement("table");
|
|
3091
|
+
Q.className = "wgt:min-w-full wgt:table-auto wgt:border-separate wgt:@max-2xl:border-collapse wgt:@max-2xl:w-full", E.appendChild(Q);
|
|
3092
3092
|
const B = document.createElement("thead");
|
|
3093
3093
|
B.className = "wgt:bg-soft-150 wgt:@max-2xl:hidden";
|
|
3094
|
-
const
|
|
3094
|
+
const C = document.createElement("tr");
|
|
3095
3095
|
[
|
|
3096
3096
|
a("product"),
|
|
3097
3097
|
a("unit"),
|
|
@@ -3100,10 +3100,10 @@ function cE() {
|
|
|
3100
3100
|
a("totalPrice")
|
|
3101
3101
|
].forEach((I) => {
|
|
3102
3102
|
const n = document.createElement("th");
|
|
3103
|
-
n.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-sm wgt:font-semibold wgt:text-text-sub-600", n.innerText = I,
|
|
3104
|
-
}), B.appendChild(
|
|
3103
|
+
n.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-sm wgt:font-semibold wgt:text-text-sub-600", n.innerText = I, C.appendChild(n);
|
|
3104
|
+
}), B.appendChild(C), Q.appendChild(B);
|
|
3105
3105
|
const t = document.createElement("tbody");
|
|
3106
|
-
return t.className = "wgt:divide-y wgt:divide-gray-200 wgt:bg-white wgt:@max-2xl:divide-y-0 wgt:@max-2xl:bg-transparent",
|
|
3106
|
+
return t.className = "wgt:divide-y wgt:divide-gray-200 wgt:bg-white wgt:@max-2xl:divide-y-0 wgt:@max-2xl:bg-transparent", Q.appendChild(t), {
|
|
3107
3107
|
container: g,
|
|
3108
3108
|
tbody: t
|
|
3109
3109
|
};
|
|
@@ -3114,22 +3114,22 @@ function eE(J) {
|
|
|
3114
3114
|
onNext: g,
|
|
3115
3115
|
onPrev: A,
|
|
3116
3116
|
selectedInitPackage: E,
|
|
3117
|
-
selectedInvoiceOtp:
|
|
3117
|
+
selectedInvoiceOtp: Q,
|
|
3118
3118
|
selectedSignatureOtp: B,
|
|
3119
|
-
setSelectedInitPackage:
|
|
3119
|
+
setSelectedInitPackage: C,
|
|
3120
3120
|
setSelectedInvoiceOtp: t,
|
|
3121
3121
|
setSelectedSignatureOtp: I,
|
|
3122
3122
|
setOrderId: n,
|
|
3123
3123
|
setTotalAmount: o,
|
|
3124
|
-
theme:
|
|
3124
|
+
theme: h,
|
|
3125
3125
|
selectedProvider: i,
|
|
3126
|
-
selectedPromotions:
|
|
3126
|
+
selectedPromotions: c,
|
|
3127
3127
|
registrationData: D,
|
|
3128
3128
|
setSelectedPromotions: s,
|
|
3129
3129
|
setPackages: q,
|
|
3130
3130
|
setPromotionCodes: F
|
|
3131
3131
|
}) {
|
|
3132
|
-
let H = "", P =
|
|
3132
|
+
let H = "", P = Q ? Q._id : null, m = B ? B._id : null, d = c ? c.map((j) => j) : [], v = [], f = [], r = [], M = [], X = !1, k = null, R = 1, T = 1, Y = 1;
|
|
3133
3133
|
function y(j) {
|
|
3134
3134
|
return v.find((W) => W._id === j) || null;
|
|
3135
3135
|
}
|
|
@@ -3153,11 +3153,11 @@ function eE(J) {
|
|
|
3153
3153
|
findInvoiceById: U,
|
|
3154
3154
|
removeLoading: nA
|
|
3155
3155
|
} = nE({
|
|
3156
|
-
theme:
|
|
3156
|
+
theme: h,
|
|
3157
3157
|
debounceTimer: k,
|
|
3158
3158
|
typedUnits: H,
|
|
3159
3159
|
onSearchComplete: () => {
|
|
3160
|
-
|
|
3160
|
+
WA(), xA();
|
|
3161
3161
|
}
|
|
3162
3162
|
});
|
|
3163
3163
|
u.appendChild(l);
|
|
@@ -3176,15 +3176,15 @@ function eE(J) {
|
|
|
3176
3176
|
FA.className = "wgt:text-lg wgt:font-bold wgt:text-strong-950", FA.innerText = a("total"), rA.appendChild(FA);
|
|
3177
3177
|
const PA = document.createElement("span");
|
|
3178
3178
|
PA.className = "wgt:text-xl wgt:font-bold wgt:text-primary", PA.innerText = "0 VND", rA.appendChild(PA);
|
|
3179
|
-
const
|
|
3180
|
-
|
|
3179
|
+
const yA = document.createElement("div");
|
|
3180
|
+
yA.className = "wgt:flex wgt:justify-between wgt:gap-2", K.appendChild(yA);
|
|
3181
3181
|
const sg = Ig({
|
|
3182
3182
|
type: "button",
|
|
3183
3183
|
title: a("back"),
|
|
3184
3184
|
className: "wgt:bg-transparent wgt:!text-primary wgt:hover:bg-transparent wgt:underline",
|
|
3185
3185
|
handleClick: A
|
|
3186
3186
|
});
|
|
3187
|
-
|
|
3187
|
+
yA.appendChild(sg);
|
|
3188
3188
|
const tg = (j, W, CA, p) => V(null, null, function* () {
|
|
3189
3189
|
e();
|
|
3190
3190
|
const AA = D.eInvoiceRegistration, { isUsedEInvoiceBefore: EA } = AA, _ = Og(AA, ["isUsedEInvoiceBefore"]);
|
|
@@ -3242,7 +3242,7 @@ function eE(J) {
|
|
|
3242
3242
|
let CA = null;
|
|
3243
3243
|
X && !(j != null && j.withoutInitialFee) ? (CA = bA(RA({}, f[0]), {
|
|
3244
3244
|
quantity: R
|
|
3245
|
-
}),
|
|
3245
|
+
}), C(CA)) : C(null);
|
|
3246
3246
|
let p = bA(RA({}, j), { quantity: T }), EA = bA(RA({}, W), { quantity: Y });
|
|
3247
3247
|
t(p), I(EA), s(d), yield tg(
|
|
3248
3248
|
CA,
|
|
@@ -3252,7 +3252,7 @@ function eE(J) {
|
|
|
3252
3252
|
);
|
|
3253
3253
|
})
|
|
3254
3254
|
});
|
|
3255
|
-
|
|
3255
|
+
yA.appendChild($A);
|
|
3256
3256
|
function zA() {
|
|
3257
3257
|
return V(this, null, function* () {
|
|
3258
3258
|
var j, W, CA, p, EA;
|
|
@@ -3269,9 +3269,9 @@ function eE(J) {
|
|
|
3269
3269
|
(W = (j = D == null ? void 0 : D.eInvoiceRegistration) == null ? void 0 : j.organization) == null ? void 0 : W.taxCode
|
|
3270
3270
|
),
|
|
3271
3271
|
QE(),
|
|
3272
|
-
AE({ bank:
|
|
3273
|
-
gE({ bank:
|
|
3274
|
-
BE({ bank:
|
|
3272
|
+
AE({ bank: h }),
|
|
3273
|
+
gE({ bank: h }),
|
|
3274
|
+
BE({ bank: h })
|
|
3275
3275
|
]);
|
|
3276
3276
|
if (_.status === "fulfilled" ? X = ((CA = _.value) == null ? void 0 : CA.isNewCustomer) || !1 : (console.error(
|
|
3277
3277
|
"Failed to check new customer:",
|
|
@@ -3299,14 +3299,14 @@ function eE(J) {
|
|
|
3299
3299
|
isDisabled: !1,
|
|
3300
3300
|
reward: Z.reward
|
|
3301
3301
|
});
|
|
3302
|
-
}), Object.keys(r).length > 0 && (d =
|
|
3303
|
-
(Z) => r[Z].bank ===
|
|
3304
|
-
),
|
|
3302
|
+
}), Object.keys(r).length > 0 && (d = c || Object.keys(r).filter(
|
|
3303
|
+
(Z) => r[Z].bank === h && r[Z].expiredAt >= (/* @__PURE__ */ new Date()).toISOString() && r[Z].limit > r[Z].used
|
|
3304
|
+
), _A())) : console.error("Failed to load promotions:", QA.reason), tA.status === "fulfilled") {
|
|
3305
3305
|
if (N(tA.value || []), tA.value.length > 0) {
|
|
3306
3306
|
const Z = tA.value.find(
|
|
3307
3307
|
(MA) => M.includes(MA.code)
|
|
3308
3308
|
);
|
|
3309
|
-
P =
|
|
3309
|
+
P = Q ? Q._id : Z ? Z._id : tA.value[0]._id, S(tA.value);
|
|
3310
3310
|
}
|
|
3311
3311
|
nA();
|
|
3312
3312
|
} else
|
|
@@ -3341,13 +3341,13 @@ function eE(J) {
|
|
|
3341
3341
|
});
|
|
3342
3342
|
}
|
|
3343
3343
|
function hg() {
|
|
3344
|
-
|
|
3344
|
+
WA(), KA(), cg(), SA(), xA();
|
|
3345
3345
|
}
|
|
3346
|
-
function
|
|
3346
|
+
function VA(j, W, CA) {
|
|
3347
3347
|
const p = Object.values(r).find(
|
|
3348
|
-
(AA) => AA.bank ===
|
|
3348
|
+
(AA) => AA.bank === h && AA.appliedPackages.includes(j)
|
|
3349
3349
|
), EA = p && !p.isDisabled && !(p.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && p.limit !== p.used, _ = Object.values(r).find(
|
|
3350
|
-
(AA) => AA.bank ===
|
|
3350
|
+
(AA) => AA.bank === h && AA.appliedPackages.includes(W)
|
|
3351
3351
|
), QA = _ && !_.isDisabled && !(_.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && _.limit !== _.used;
|
|
3352
3352
|
if (EA && !QA) {
|
|
3353
3353
|
const { container: AA, open: tA } = aB({
|
|
@@ -3362,7 +3362,7 @@ function eE(J) {
|
|
|
3362
3362
|
CA();
|
|
3363
3363
|
}
|
|
3364
3364
|
let Ag = null;
|
|
3365
|
-
function
|
|
3365
|
+
function WA() {
|
|
3366
3366
|
if (L.innerHTML = "", IA().length > 0)
|
|
3367
3367
|
Ag = nC({
|
|
3368
3368
|
type: "service",
|
|
@@ -3375,8 +3375,8 @@ function eE(J) {
|
|
|
3375
3375
|
let W = (p = b().find(
|
|
3376
3376
|
(_) => _._id === P
|
|
3377
3377
|
)) == null ? void 0 : p.code, CA = (EA = b().find((_) => _._id === j)) == null ? void 0 : EA.code;
|
|
3378
|
-
|
|
3379
|
-
P = j, Ag.setSelectedPackageId(j), S(b()), fg(), cg(),
|
|
3378
|
+
VA(W, CA, () => {
|
|
3379
|
+
P = j, Ag.setSelectedPackageId(j), S(b()), fg(), cg(), SA(), T = 1, xA();
|
|
3380
3380
|
});
|
|
3381
3381
|
}
|
|
3382
3382
|
}), L.appendChild(Ag.container);
|
|
@@ -3386,7 +3386,7 @@ function eE(J) {
|
|
|
3386
3386
|
}
|
|
3387
3387
|
}
|
|
3388
3388
|
let NA = null;
|
|
3389
|
-
function
|
|
3389
|
+
function KA() {
|
|
3390
3390
|
if (cA.innerHTML = "", v.length > 0)
|
|
3391
3391
|
NA = nC({
|
|
3392
3392
|
type: "signature",
|
|
@@ -3399,8 +3399,8 @@ function eE(J) {
|
|
|
3399
3399
|
let W = (p = v.find(
|
|
3400
3400
|
(_) => _._id === m
|
|
3401
3401
|
)) == null ? void 0 : p.code, CA = (EA = v.find((_) => _._id === j)) == null ? void 0 : EA.code;
|
|
3402
|
-
|
|
3403
|
-
m = j, NA.setSelectedPackageId(j), fg(), cg(),
|
|
3402
|
+
VA(W, CA, () => {
|
|
3403
|
+
m = j, NA.setSelectedPackageId(j), fg(), cg(), SA(), Y = 1, xA();
|
|
3404
3404
|
});
|
|
3405
3405
|
}
|
|
3406
3406
|
}), cA.appendChild(NA.container);
|
|
@@ -3409,10 +3409,10 @@ function eE(J) {
|
|
|
3409
3409
|
j.className = "wgt:text-text-sub-600", j.innerText = a("noPackageFound"), cA.appendChild(j), NA = null;
|
|
3410
3410
|
}
|
|
3411
3411
|
}
|
|
3412
|
-
const
|
|
3413
|
-
|
|
3412
|
+
const UA = document.createElement("div");
|
|
3413
|
+
UA.className = "wgt:w-full", u.appendChild(UA);
|
|
3414
3414
|
function cg() {
|
|
3415
|
-
YA.remove(),
|
|
3415
|
+
YA.remove(), UA.innerHTML = "";
|
|
3416
3416
|
const j = b().find(
|
|
3417
3417
|
(W) => W._id === P
|
|
3418
3418
|
);
|
|
@@ -3427,7 +3427,7 @@ function eE(J) {
|
|
|
3427
3427
|
description: ag() === "vi" ? f[0].name : f[0].nameEn,
|
|
3428
3428
|
isChecked: X && !(j != null && j.withoutInitialFee)
|
|
3429
3429
|
});
|
|
3430
|
-
|
|
3430
|
+
UA.appendChild(W);
|
|
3431
3431
|
}
|
|
3432
3432
|
}
|
|
3433
3433
|
const XA = document.createElement("div");
|
|
@@ -3440,7 +3440,7 @@ function eE(J) {
|
|
|
3440
3440
|
);
|
|
3441
3441
|
Object.keys(r).forEach((CA) => {
|
|
3442
3442
|
const p = r[CA];
|
|
3443
|
-
if (p.bank !==
|
|
3443
|
+
if (p.bank !== h)
|
|
3444
3444
|
return;
|
|
3445
3445
|
let EA = !1;
|
|
3446
3446
|
if (p.code === "INITFEE-KM-500")
|
|
@@ -3452,14 +3452,14 @@ function eE(J) {
|
|
|
3452
3452
|
p.isDisabled = !EA, !EA && d.includes(p.code) ? d = d.filter(
|
|
3453
3453
|
(_) => _ !== p.code
|
|
3454
3454
|
) : EA && !d.includes(p.code) && d.push(p.code);
|
|
3455
|
-
}),
|
|
3455
|
+
}), _A();
|
|
3456
3456
|
}
|
|
3457
|
-
function
|
|
3458
|
-
M = Object.values(r).filter((j) => j.bank ===
|
|
3457
|
+
function _A() {
|
|
3458
|
+
M = Object.values(r).filter((j) => j.bank === h).map((j) => j.appliedPackages[0]);
|
|
3459
3459
|
}
|
|
3460
|
-
function
|
|
3460
|
+
function SA() {
|
|
3461
3461
|
if (Object.values(r).filter(
|
|
3462
|
-
(AA) => AA.bank ===
|
|
3462
|
+
(AA) => AA.bank === h
|
|
3463
3463
|
).length === 0) {
|
|
3464
3464
|
u.contains(XA) && u.removeChild(XA);
|
|
3465
3465
|
return;
|
|
@@ -3474,7 +3474,7 @@ function eE(J) {
|
|
|
3474
3474
|
const wA = Object.values(r).find(
|
|
3475
3475
|
(Z) => Z.code === tA
|
|
3476
3476
|
);
|
|
3477
|
-
return wA && wA.bank ===
|
|
3477
|
+
return wA && wA.bank === h;
|
|
3478
3478
|
}).forEach((tA) => {
|
|
3479
3479
|
const wA = document.createElement("div");
|
|
3480
3480
|
wA.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", wA.innerText = tA;
|
|
@@ -3484,7 +3484,7 @@ function eE(J) {
|
|
|
3484
3484
|
handleClick: () => {
|
|
3485
3485
|
d = d.filter(
|
|
3486
3486
|
(MA) => MA !== tA
|
|
3487
|
-
),
|
|
3487
|
+
), SA(), xA();
|
|
3488
3488
|
}
|
|
3489
3489
|
});
|
|
3490
3490
|
Z.className = "wgt:w-fit wgt:h-fit wgt:p-0 wgt:bg-transparent wgt:cursor-pointer", Z.innerHTML = `<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -3505,7 +3505,7 @@ function eE(J) {
|
|
|
3505
3505
|
const _ = document.createElement("div");
|
|
3506
3506
|
_.className = "wgt:w-full wgt:grid wgt:grid-cols-3 wgt:gap-4 wgt:@max-2xl:flex wgt:@max-2xl:flex-col", XA.appendChild(_);
|
|
3507
3507
|
const QA = Object.values(r).filter(
|
|
3508
|
-
(AA) => AA.bank ===
|
|
3508
|
+
(AA) => AA.bank === h
|
|
3509
3509
|
);
|
|
3510
3510
|
if (QA.length > 0)
|
|
3511
3511
|
QA.forEach((AA) => {
|
|
@@ -3514,7 +3514,7 @@ function eE(J) {
|
|
|
3514
3514
|
isSelected: d.includes(AA.code)
|
|
3515
3515
|
}),
|
|
3516
3516
|
onSelect: (wA, Z) => {
|
|
3517
|
-
Z && d.push(wA),
|
|
3517
|
+
Z && d.push(wA), SA(), xA();
|
|
3518
3518
|
},
|
|
3519
3519
|
isDisabled: AA.isDisabled || AA.expiredAt < (/* @__PURE__ */ new Date()).toISOString() || AA.limit === AA.used
|
|
3520
3520
|
});
|
|
@@ -3607,8 +3607,8 @@ function eE(J) {
|
|
|
3607
3607
|
TA.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", TA.innerText = HA((x == null ? void 0 : x.price) * (x == null ? void 0 : x.limit)) + " VND", BA.appendChild(TA);
|
|
3608
3608
|
const lA = document.createElement("td");
|
|
3609
3609
|
lA.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", lA.innerText = HA((x == null ? void 0 : x.price) * (x == null ? void 0 : x.limit) * T) + " VND", BA.appendChild(lA);
|
|
3610
|
-
const
|
|
3611
|
-
|
|
3610
|
+
const pA = document.createElement("div");
|
|
3611
|
+
pA.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", pA.innerHTML = `
|
|
3612
3612
|
<div class="wgt:flex wgt:justify-between wgt:text-sm wgt:text-text-sub-600">
|
|
3613
3613
|
<span>${a("unitPrice")}:</span>
|
|
3614
3614
|
<span class="wgt:font-medium">${HA(
|
|
@@ -3621,7 +3621,7 @@ function eE(J) {
|
|
|
3621
3621
|
(x == null ? void 0 : x.price) * (x == null ? void 0 : x.limit) * T
|
|
3622
3622
|
)} VND</span>
|
|
3623
3623
|
</div>
|
|
3624
|
-
`, eA.appendChild(
|
|
3624
|
+
`, eA.appendChild(pA), iA.appendChild(BA);
|
|
3625
3625
|
}
|
|
3626
3626
|
}
|
|
3627
3627
|
{
|
|
@@ -3651,8 +3651,8 @@ function eE(J) {
|
|
|
3651
3651
|
TA.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", TA.innerText = HA((x == null ? void 0 : x.limit) * (x == null ? void 0 : x.price)), BA.appendChild(TA);
|
|
3652
3652
|
const lA = document.createElement("td");
|
|
3653
3653
|
lA.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", lA.innerText = HA((x == null ? void 0 : x.limit) * (x == null ? void 0 : x.price) * Y) + " VND", BA.appendChild(lA);
|
|
3654
|
-
const
|
|
3655
|
-
|
|
3654
|
+
const pA = document.createElement("div");
|
|
3655
|
+
pA.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", pA.innerHTML = `
|
|
3656
3656
|
<div class="wgt:flex wgt:justify-between wgt:text-sm wgt:text-text-sub-600">
|
|
3657
3657
|
<span>${a("unitPrice")}:</span>
|
|
3658
3658
|
<span class="wgt:font-medium">${HA(
|
|
@@ -3665,12 +3665,12 @@ function eE(J) {
|
|
|
3665
3665
|
(x == null ? void 0 : x.limit) * (x == null ? void 0 : x.price) * Y
|
|
3666
3666
|
)} VND</span>
|
|
3667
3667
|
</div>
|
|
3668
|
-
`, eA.appendChild(
|
|
3668
|
+
`, eA.appendChild(pA), iA.appendChild(BA);
|
|
3669
3669
|
}
|
|
3670
3670
|
}
|
|
3671
3671
|
const W = d.map(
|
|
3672
3672
|
(x) => Object.values(r).find(
|
|
3673
|
-
(BA) => BA.code === x && BA.bank ===
|
|
3673
|
+
(BA) => BA.code === x && BA.bank === h
|
|
3674
3674
|
)
|
|
3675
3675
|
).filter((x) => x !== void 0);
|
|
3676
3676
|
let CA = 0;
|
|
@@ -3713,37 +3713,37 @@ function aE({
|
|
|
3713
3713
|
qrSrc: g = "",
|
|
3714
3714
|
logos: A = [],
|
|
3715
3715
|
logosAbove: E = [],
|
|
3716
|
-
accountName:
|
|
3716
|
+
accountName: Q = "",
|
|
3717
3717
|
accountNumber: B = "",
|
|
3718
|
-
bankName:
|
|
3718
|
+
bankName: C = "",
|
|
3719
3719
|
instructions: t = [],
|
|
3720
3720
|
illustrationSrc: I = "",
|
|
3721
3721
|
theme: n = "ocb"
|
|
3722
3722
|
} = {}) {
|
|
3723
3723
|
const o = document.createElement("div");
|
|
3724
3724
|
o.className = "wgt:flex wgt:flex-col wgt:@min-2xl:flex-row wgt:gap-6 wgt:p-6 wgt:bg-gray-50 wgt:rounded-xl";
|
|
3725
|
-
const
|
|
3726
|
-
i.className = "wgt:text-sm wgt:font-bold wgt:text-text-black wgt:mb-4 wgt:text-center", i.innerText = a("qrPaymentTitle"),
|
|
3727
|
-
const
|
|
3728
|
-
|
|
3725
|
+
const h = document.createElement("div"), i = document.createElement("h3");
|
|
3726
|
+
i.className = "wgt:text-sm wgt:font-bold wgt:text-text-black wgt:mb-4 wgt:text-center", i.innerText = a("qrPaymentTitle"), h.appendChild(i);
|
|
3727
|
+
const c = document.createElement("div");
|
|
3728
|
+
c.className = "wgt:bg-white wgt:rounded-md wgt:p-6 wgt:flex wgt:flex-col wgt:gap-3 wgt:border wgt:border-[#E4E7EC]";
|
|
3729
3729
|
const D = document.createElement("div");
|
|
3730
3730
|
D.className = "wgt:flex wgt:justify-between wgt:items-center wgt:gap-4 wgt:flex-wrap", (E == null ? void 0 : E.length) > 0 && (E.forEach((k) => {
|
|
3731
3731
|
const R = document.createElement("img");
|
|
3732
3732
|
R.src = k, R.alt = "Logo", R.className = "wgt:w-14 wgt:object-contain", D.appendChild(R);
|
|
3733
|
-
}),
|
|
3733
|
+
}), c.appendChild(D));
|
|
3734
3734
|
const s = document.createElement("div");
|
|
3735
3735
|
s.className = "wgt:flex wgt:justify-center wgt:w-[17.5rem] wgt:@max-2xl:w-[12.5rem] wgt:mx-auto";
|
|
3736
3736
|
const q = document.createElement("img");
|
|
3737
|
-
q.src = g, q.alt = "QR code", q.className = "wgt:w-full wgt:w-full wgt:aspect-square wgt:object-contain", s.appendChild(q),
|
|
3737
|
+
q.src = g, q.alt = "QR code", q.className = "wgt:w-full wgt:w-full wgt:aspect-square wgt:object-contain", s.appendChild(q), c.appendChild(s);
|
|
3738
3738
|
const F = document.createElement("div");
|
|
3739
3739
|
F.className = "wgt:flex wgt:justify-center wgt:items-center wgt:gap-4 wgt:flex-wrap", A.forEach((k) => {
|
|
3740
3740
|
const R = document.createElement("img");
|
|
3741
3741
|
R.src = k, R.alt = "Logo", R.className = `wgt:w-${n === "ocb" ? "28" : "8"} wgt:object-contain`, F.appendChild(R);
|
|
3742
|
-
}),
|
|
3742
|
+
}), c.appendChild(F);
|
|
3743
3743
|
const J = document.createElement("div");
|
|
3744
3744
|
J.className = "wgt:text-center wgt:flex wgt:flex-col wgt:gap-1";
|
|
3745
3745
|
const H = document.createElement("h3");
|
|
3746
|
-
H.className = "wgt:text-lg wgt:font-bold wgt:text-text-black", H.innerText =
|
|
3746
|
+
H.className = "wgt:text-lg wgt:font-bold wgt:text-text-black", H.innerText = Q, J.appendChild(H);
|
|
3747
3747
|
const P = document.createElement("p");
|
|
3748
3748
|
P.className = "wgt:text-sm wgt:text-grey-8", P.innerHTML = `${a(
|
|
3749
3749
|
"accountNumber"
|
|
@@ -3751,7 +3751,7 @@ function aE({
|
|
|
3751
3751
|
const m = document.createElement("p");
|
|
3752
3752
|
m.className = "wgt:text-sm wgt:text-grey-8", m.innerHTML = `${a(
|
|
3753
3753
|
"beneficiaryBank"
|
|
3754
|
-
)}: <span class="wgt:font-medium">${
|
|
3754
|
+
)}: <span class="wgt:font-medium">${C}</span>`, J.appendChild(m), c.appendChild(J), h.appendChild(c), o.appendChild(h);
|
|
3755
3755
|
const d = document.createElement("div");
|
|
3756
3756
|
d.className = "wgt:flex wgt:flex-col wgt:justify-between wgt:@min-2xl:w-1/2";
|
|
3757
3757
|
const v = document.createElement("div"), f = document.createElement("h3");
|
|
@@ -3801,28 +3801,170 @@ function oE({
|
|
|
3801
3801
|
qrSrc: g,
|
|
3802
3802
|
logos: A = [],
|
|
3803
3803
|
logosAbove: E = [],
|
|
3804
|
-
accountName:
|
|
3804
|
+
accountName: Q = "",
|
|
3805
3805
|
accountNumber: B = "",
|
|
3806
|
-
bankName:
|
|
3806
|
+
bankName: C = "",
|
|
3807
3807
|
instructions: t = [],
|
|
3808
3808
|
illustrationSrc: I,
|
|
3809
3809
|
theme: n
|
|
3810
3810
|
} = {}) {
|
|
3811
|
-
const { container: o, update:
|
|
3811
|
+
const { container: o, update: h } = aE({
|
|
3812
3812
|
qrSrc: g,
|
|
3813
3813
|
logos: A,
|
|
3814
3814
|
logosAbove: E,
|
|
3815
|
-
accountName:
|
|
3815
|
+
accountName: Q,
|
|
3816
3816
|
accountNumber: B,
|
|
3817
|
-
bankName:
|
|
3817
|
+
bankName: C,
|
|
3818
3818
|
instructions: t,
|
|
3819
3819
|
illustrationSrc: I,
|
|
3820
3820
|
theme: n
|
|
3821
3821
|
});
|
|
3822
|
-
return { container: o, update:
|
|
3822
|
+
return { container: o, update: h };
|
|
3823
|
+
}
|
|
3824
|
+
function DE({
|
|
3825
|
+
selectedProvider: g = null,
|
|
3826
|
+
selectedInvoiceOtp: A = null,
|
|
3827
|
+
selectedSignatureOtp: E = null,
|
|
3828
|
+
token: Q = "",
|
|
3829
|
+
orderId: B = "",
|
|
3830
|
+
totalAmountText: C = "",
|
|
3831
|
+
qrData: t,
|
|
3832
|
+
qrSrc: I,
|
|
3833
|
+
selectedPromotions: n,
|
|
3834
|
+
onResetToStep1: o
|
|
3835
|
+
} = {}) {
|
|
3836
|
+
const h = document.createElement("div");
|
|
3837
|
+
h.className = [
|
|
3838
|
+
"wgt:w-[440px]",
|
|
3839
|
+
"wgt:@max-2xl:w-full",
|
|
3840
|
+
"wgt:flex",
|
|
3841
|
+
"wgt:flex-col",
|
|
3842
|
+
"wgt:rounded-2xl",
|
|
3843
|
+
"wgt:border",
|
|
3844
|
+
"wgt:border-soft-200",
|
|
3845
|
+
"wgt:overflow-hidden"
|
|
3846
|
+
].join(" ");
|
|
3847
|
+
let i = 3600, c = null;
|
|
3848
|
+
const D = document.createElement("div");
|
|
3849
|
+
D.className = "wgt:p-4 wgt:w-full wgt:flex wgt:items-center wgt:justify-center wgt:gap-2 wgt:bg-primary/10";
|
|
3850
|
+
const s = document.createElement("p");
|
|
3851
|
+
s.className = "wgt:text-base wgt:font-medium wgt:leading-6 wgt:text-primary";
|
|
3852
|
+
const q = (u) => {
|
|
3853
|
+
const l = Math.floor(u / 60), L = u % 60;
|
|
3854
|
+
return `${l.toString().padStart(2, "0")}:${L.toString().padStart(2, "0")}`;
|
|
3855
|
+
}, F = () => {
|
|
3856
|
+
s.innerHTML = `${a(
|
|
3857
|
+
"completePaymentIn"
|
|
3858
|
+
)} <span class="wgt:font-bold">${q(i)}</span>`;
|
|
3859
|
+
};
|
|
3860
|
+
F();
|
|
3861
|
+
const J = () => {
|
|
3862
|
+
c = setInterval(() => {
|
|
3863
|
+
i--, F(), i <= 0 && jA(c);
|
|
3864
|
+
}, 1e3), AQ(c);
|
|
3865
|
+
};
|
|
3866
|
+
J(), D.appendChild(s);
|
|
3867
|
+
const H = document.createElement("svg");
|
|
3868
|
+
H.setAttribute("width", "24"), H.setAttribute("height", "24"), H.setAttribute("viewBox", "0 0 24 24"), H.setAttribute("fill", "none"), H.setAttribute("xmlns", "http://www.w3.org/2000/svg"), H.innerHTML = `
|
|
3869
|
+
<path
|
|
3870
|
+
d="M12 1.40039C17.8537 1.40039 22.5996 6.14633 22.5996 12C22.5996 17.8537 17.8537 22.5996 12 22.5996C6.14633 22.5996 1.40039 17.8537 1.40039 12C1.40039 6.14633 6.14633 1.40039 12 1.40039ZM12 3.38086C7.24117 3.38086 3.38086 7.24117 3.38086 12C3.38086 16.7588 7.24117 20.6191 12 20.6191C16.7588 20.6191 20.6191 16.7588 20.6191 12C20.6191 7.24117 16.7588 3.38086 12 3.38086Z"
|
|
3871
|
+
fill="#1D963E"
|
|
3872
|
+
stroke="#1D963E"
|
|
3873
|
+
stroke-width="0.2"
|
|
3874
|
+
/>
|
|
3875
|
+
<path
|
|
3876
|
+
d="M16.0945 14.9672L12.7523 12.5508V6.75C12.7523 6.64687 12.668 6.5625 12.5648 6.5625H11.4375C11.3344 6.5625 11.25 6.64687 11.25 6.75V13.2047C11.25 13.2656 11.2781 13.3219 11.3273 13.357L15.2039 16.1836C15.2883 16.2445 15.4055 16.2258 15.4664 16.1437L16.1367 15.2297C16.1976 15.1429 16.1789 15.0258 16.0945 14.9672Z"
|
|
3877
|
+
fill="#1D963E"
|
|
3878
|
+
/>
|
|
3879
|
+
`, D.appendChild(H), h.appendChild(D);
|
|
3880
|
+
const P = document.createElement("div");
|
|
3881
|
+
P.className = [
|
|
3882
|
+
"wgt:p-6",
|
|
3883
|
+
"wgt:w-full",
|
|
3884
|
+
"wgt:flex",
|
|
3885
|
+
"wgt:flex-col",
|
|
3886
|
+
"wgt:gap-10",
|
|
3887
|
+
"wgt:shadow-[0px_2px_6px_0px_rgba(31,34,41,0.04)]"
|
|
3888
|
+
].join(" ");
|
|
3889
|
+
const m = document.createElement("div");
|
|
3890
|
+
m.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
|
|
3891
|
+
const d = document.createElement("h2");
|
|
3892
|
+
d.className = "wgt:text-xl wgt:font-semibold wgt:leading-6 wgt:text-black", d.innerText = a("orderInfo"), m.appendChild(d);
|
|
3893
|
+
const v = document.createElement("div");
|
|
3894
|
+
v.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
3895
|
+
const f = document.createElement("h4");
|
|
3896
|
+
f.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", f.innerText = a("provider");
|
|
3897
|
+
const r = document.createElement("img");
|
|
3898
|
+
g && g.logoUrl && (r.src = g.logoUrl, r.alt = g.name, r.className = "wgt:h-6 wgt:object-contain"), v.appendChild(f), v.appendChild(r), m.appendChild(v);
|
|
3899
|
+
const M = document.createElement("div");
|
|
3900
|
+
M.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
3901
|
+
const X = document.createElement("h4");
|
|
3902
|
+
X.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", X.innerText = a("subscriptionPackage");
|
|
3903
|
+
const k = document.createElement("span");
|
|
3904
|
+
k.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", k.innerText = A ? `${String(A == null ? void 0 : A.code)}` : "", M.appendChild(X), M.appendChild(k), m.appendChild(M);
|
|
3905
|
+
const R = document.createElement("div");
|
|
3906
|
+
R.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
3907
|
+
const T = document.createElement("h4");
|
|
3908
|
+
T.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", T.innerText = a("digitalSignaturePackage");
|
|
3909
|
+
const Y = document.createElement("span");
|
|
3910
|
+
if (Y.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", Y.innerText = E ? `${String(E == null ? void 0 : E.code)}` : "", R.appendChild(T), R.appendChild(Y), m.appendChild(R), n && n.length > 0) {
|
|
3911
|
+
const u = document.createElement("div");
|
|
3912
|
+
u.className = "wgt:w-full wgt:flex wgt:items-start wgt:justify-between wgt:gap-[0.5rem]";
|
|
3913
|
+
const l = document.createElement("h4");
|
|
3914
|
+
l.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", l.innerText = a("promotion");
|
|
3915
|
+
const L = document.createElement("div");
|
|
3916
|
+
L.className = "wgt:flex wgt:items-center wgt:justify-end wgt:flex-wrap wgt:gap-2", n.forEach((N) => {
|
|
3917
|
+
const b = document.createElement("div");
|
|
3918
|
+
b.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", b.innerText = N, L.appendChild(b);
|
|
3919
|
+
}), u.appendChild(l), u.appendChild(L), m.appendChild(u);
|
|
3920
|
+
}
|
|
3921
|
+
const y = document.createElement("hr");
|
|
3922
|
+
m.appendChild(y);
|
|
3923
|
+
const K = document.createElement("div");
|
|
3924
|
+
K.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
3925
|
+
const z = document.createElement("h4");
|
|
3926
|
+
z.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", z.innerText = a("paymentAmount");
|
|
3927
|
+
const e = document.createElement("span");
|
|
3928
|
+
e.className = "wgt:text-2xl wgt:font-bold wgt:leading-6 wgt:text-[#ED1C24]", e.innerText = C.toLocaleString("vi-VN") + " VND", K.appendChild(z), K.appendChild(e), m.appendChild(K), P.appendChild(m);
|
|
3929
|
+
const w = Ig({
|
|
3930
|
+
title: a("cancelTransaction"),
|
|
3931
|
+
className: "wgt:bg-transparent wgt:border wgt:border-primary wgt:text-primary wgt:hover:bg-transparent",
|
|
3932
|
+
handleClick: () => {
|
|
3933
|
+
c && jA(c);
|
|
3934
|
+
const { container: u, open: l } = aB({
|
|
3935
|
+
message: a("transactionCanceled"),
|
|
3936
|
+
okLabel: a("ok"),
|
|
3937
|
+
onClose: () => V(null, null, function* () {
|
|
3938
|
+
i = 3600, jA(c), yield tC(B), typeof o == "function" && (yield o());
|
|
3939
|
+
}),
|
|
3940
|
+
preventClose: !0
|
|
3941
|
+
});
|
|
3942
|
+
h.appendChild(u), l();
|
|
3943
|
+
}
|
|
3944
|
+
});
|
|
3945
|
+
return P.appendChild(w), h.appendChild(P), window.addEventListener("beforeunload", () => V(null, null, function* () {
|
|
3946
|
+
c && jA(c), yield tC(B);
|
|
3947
|
+
})), {
|
|
3948
|
+
container: h,
|
|
3949
|
+
setSelectedProvider(u) {
|
|
3950
|
+
g = u, r.src = (u == null ? void 0 : u.logo) || "", r.alt = (u == null ? void 0 : u.name) || "";
|
|
3951
|
+
},
|
|
3952
|
+
setSelectedInvoicePackage(u) {
|
|
3953
|
+
A = u, k.innerText = u ? String(u.limit) : "";
|
|
3954
|
+
},
|
|
3955
|
+
setSelectedSignaturePackage(u) {
|
|
3956
|
+
E = u, Y.innerText = u ? String(E == null ? void 0 : E.name.split("-")[1]) : "";
|
|
3957
|
+
},
|
|
3958
|
+
setTotalAmountText(u) {
|
|
3959
|
+
C = u, e.innerText = u;
|
|
3960
|
+
},
|
|
3961
|
+
resetCountdown() {
|
|
3962
|
+
i = 3600, F(), J();
|
|
3963
|
+
}
|
|
3964
|
+
};
|
|
3823
3965
|
}
|
|
3824
3966
|
var mg = {}, zg, hC;
|
|
3825
|
-
function
|
|
3967
|
+
function uE() {
|
|
3826
3968
|
return hC || (hC = 1, zg = function() {
|
|
3827
3969
|
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
3828
3970
|
}), zg;
|
|
@@ -3876,25 +4018,25 @@ function ug() {
|
|
|
3876
4018
|
3532,
|
|
3877
4019
|
3706
|
|
3878
4020
|
];
|
|
3879
|
-
return Cg.getSymbolSize = function(
|
|
3880
|
-
if (!
|
|
3881
|
-
if (
|
|
3882
|
-
return
|
|
3883
|
-
}, Cg.getSymbolTotalCodewords = function(
|
|
3884
|
-
return A[
|
|
4021
|
+
return Cg.getSymbolSize = function(Q) {
|
|
4022
|
+
if (!Q) throw new Error('"version" cannot be null or undefined');
|
|
4023
|
+
if (Q < 1 || Q > 40) throw new Error('"version" should be in range from 1 to 40');
|
|
4024
|
+
return Q * 4 + 17;
|
|
4025
|
+
}, Cg.getSymbolTotalCodewords = function(Q) {
|
|
4026
|
+
return A[Q];
|
|
3885
4027
|
}, Cg.getBCHDigit = function(E) {
|
|
3886
|
-
let
|
|
4028
|
+
let Q = 0;
|
|
3887
4029
|
for (; E !== 0; )
|
|
3888
|
-
|
|
3889
|
-
return
|
|
3890
|
-
}, Cg.setToSJISFunction = function(
|
|
3891
|
-
if (typeof
|
|
4030
|
+
Q++, E >>>= 1;
|
|
4031
|
+
return Q;
|
|
4032
|
+
}, Cg.setToSJISFunction = function(Q) {
|
|
4033
|
+
if (typeof Q != "function")
|
|
3892
4034
|
throw new Error('"toSJISFunc" is not a valid function.');
|
|
3893
|
-
g =
|
|
4035
|
+
g = Q;
|
|
3894
4036
|
}, Cg.isKanjiModeEnabled = function() {
|
|
3895
4037
|
return typeof g != "undefined";
|
|
3896
|
-
}, Cg.toSJIS = function(
|
|
3897
|
-
return g(
|
|
4038
|
+
}, Cg.toSJIS = function(Q) {
|
|
4039
|
+
return g(Q);
|
|
3898
4040
|
}, Cg;
|
|
3899
4041
|
}
|
|
3900
4042
|
var bg = {}, wC;
|
|
@@ -3921,21 +4063,21 @@ function DB() {
|
|
|
3921
4063
|
throw new Error("Unknown EC Level: " + E);
|
|
3922
4064
|
}
|
|
3923
4065
|
}
|
|
3924
|
-
g.isValid = function(
|
|
3925
|
-
return
|
|
3926
|
-
}, g.from = function(
|
|
3927
|
-
if (g.isValid(
|
|
3928
|
-
return
|
|
4066
|
+
g.isValid = function(Q) {
|
|
4067
|
+
return Q && typeof Q.bit != "undefined" && Q.bit >= 0 && Q.bit < 4;
|
|
4068
|
+
}, g.from = function(Q, B) {
|
|
4069
|
+
if (g.isValid(Q))
|
|
4070
|
+
return Q;
|
|
3929
4071
|
try {
|
|
3930
|
-
return A(
|
|
3931
|
-
} catch (
|
|
4072
|
+
return A(Q);
|
|
4073
|
+
} catch (C) {
|
|
3932
4074
|
return B;
|
|
3933
4075
|
}
|
|
3934
4076
|
};
|
|
3935
4077
|
}(bg)), bg;
|
|
3936
4078
|
}
|
|
3937
4079
|
var jg, eC;
|
|
3938
|
-
function
|
|
4080
|
+
function iE() {
|
|
3939
4081
|
if (eC) return jg;
|
|
3940
4082
|
eC = 1;
|
|
3941
4083
|
function g() {
|
|
@@ -3947,8 +4089,8 @@ function uE() {
|
|
|
3947
4089
|
return (this.buffer[E] >>> 7 - A % 8 & 1) === 1;
|
|
3948
4090
|
},
|
|
3949
4091
|
put: function(A, E) {
|
|
3950
|
-
for (let
|
|
3951
|
-
this.putBit((A >>> E -
|
|
4092
|
+
for (let Q = 0; Q < E; Q++)
|
|
4093
|
+
this.putBit((A >>> E - Q - 1 & 1) === 1);
|
|
3952
4094
|
},
|
|
3953
4095
|
getLengthInBits: function() {
|
|
3954
4096
|
return this.length;
|
|
@@ -3960,7 +4102,7 @@ function uE() {
|
|
|
3960
4102
|
}, jg = g, jg;
|
|
3961
4103
|
}
|
|
3962
4104
|
var yg, aC;
|
|
3963
|
-
function
|
|
4105
|
+
function sE() {
|
|
3964
4106
|
if (aC) return yg;
|
|
3965
4107
|
aC = 1;
|
|
3966
4108
|
function g(A) {
|
|
@@ -3968,45 +4110,45 @@ function iE() {
|
|
|
3968
4110
|
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
3969
4111
|
this.size = A, this.data = new Uint8Array(A * A), this.reservedBit = new Uint8Array(A * A);
|
|
3970
4112
|
}
|
|
3971
|
-
return g.prototype.set = function(A, E,
|
|
3972
|
-
const
|
|
3973
|
-
this.data[
|
|
4113
|
+
return g.prototype.set = function(A, E, Q, B) {
|
|
4114
|
+
const C = A * this.size + E;
|
|
4115
|
+
this.data[C] = Q, B && (this.reservedBit[C] = !0);
|
|
3974
4116
|
}, g.prototype.get = function(A, E) {
|
|
3975
4117
|
return this.data[A * this.size + E];
|
|
3976
|
-
}, g.prototype.xor = function(A, E,
|
|
3977
|
-
this.data[A * this.size + E] ^=
|
|
4118
|
+
}, g.prototype.xor = function(A, E, Q) {
|
|
4119
|
+
this.data[A * this.size + E] ^= Q;
|
|
3978
4120
|
}, g.prototype.isReserved = function(A, E) {
|
|
3979
4121
|
return this.reservedBit[A * this.size + E];
|
|
3980
4122
|
}, yg = g, yg;
|
|
3981
4123
|
}
|
|
3982
4124
|
var Kg = {}, oC;
|
|
3983
|
-
function
|
|
4125
|
+
function fE() {
|
|
3984
4126
|
return oC || (oC = 1, function(g) {
|
|
3985
4127
|
const A = ug().getSymbolSize;
|
|
3986
|
-
g.getRowColCoords = function(
|
|
3987
|
-
if (
|
|
3988
|
-
const B = Math.floor(
|
|
4128
|
+
g.getRowColCoords = function(Q) {
|
|
4129
|
+
if (Q === 1) return [];
|
|
4130
|
+
const B = Math.floor(Q / 7) + 2, C = A(Q), t = C === 145 ? 26 : Math.ceil((C - 13) / (2 * B - 2)) * 2, I = [C - 7];
|
|
3989
4131
|
for (let n = 1; n < B - 1; n++)
|
|
3990
4132
|
I[n] = I[n - 1] - t;
|
|
3991
4133
|
return I.push(6), I.reverse();
|
|
3992
|
-
}, g.getPositions = function(
|
|
3993
|
-
const B = [],
|
|
4134
|
+
}, g.getPositions = function(Q) {
|
|
4135
|
+
const B = [], C = g.getRowColCoords(Q), t = C.length;
|
|
3994
4136
|
for (let I = 0; I < t; I++)
|
|
3995
4137
|
for (let n = 0; n < t; n++)
|
|
3996
4138
|
I === 0 && n === 0 || // top-left
|
|
3997
4139
|
I === 0 && n === t - 1 || // bottom-left
|
|
3998
|
-
I === t - 1 && n === 0 || B.push([
|
|
4140
|
+
I === t - 1 && n === 0 || B.push([C[I], C[n]]);
|
|
3999
4141
|
return B;
|
|
4000
4142
|
};
|
|
4001
4143
|
}(Kg)), Kg;
|
|
4002
4144
|
}
|
|
4003
4145
|
var Ug = {}, DC;
|
|
4004
|
-
function
|
|
4146
|
+
function mE() {
|
|
4005
4147
|
if (DC) return Ug;
|
|
4006
4148
|
DC = 1;
|
|
4007
4149
|
const g = ug().getSymbolSize, A = 7;
|
|
4008
|
-
return Ug.getPositions = function(
|
|
4009
|
-
const B = g(
|
|
4150
|
+
return Ug.getPositions = function(Q) {
|
|
4151
|
+
const B = g(Q);
|
|
4010
4152
|
return [
|
|
4011
4153
|
// top-left
|
|
4012
4154
|
[0, 0],
|
|
@@ -4018,7 +4160,7 @@ function fE() {
|
|
|
4018
4160
|
}, Ug;
|
|
4019
4161
|
}
|
|
4020
4162
|
var Sg = {}, uC;
|
|
4021
|
-
function
|
|
4163
|
+
function rE() {
|
|
4022
4164
|
return uC || (uC = 1, function(g) {
|
|
4023
4165
|
g.Patterns = {
|
|
4024
4166
|
PATTERN000: 0,
|
|
@@ -4041,75 +4183,75 @@ function mE() {
|
|
|
4041
4183
|
}, g.from = function(B) {
|
|
4042
4184
|
return g.isValid(B) ? parseInt(B, 10) : void 0;
|
|
4043
4185
|
}, g.getPenaltyN1 = function(B) {
|
|
4044
|
-
const
|
|
4045
|
-
let t = 0, I = 0, n = 0, o = null,
|
|
4046
|
-
for (let i = 0; i <
|
|
4047
|
-
I = n = 0, o =
|
|
4048
|
-
for (let
|
|
4049
|
-
let D = B.get(i,
|
|
4050
|
-
D === o ? I++ : (I >= 5 && (t += A.N1 + (I - 5)), o = D, I = 1), D = B.get(
|
|
4186
|
+
const C = B.size;
|
|
4187
|
+
let t = 0, I = 0, n = 0, o = null, h = null;
|
|
4188
|
+
for (let i = 0; i < C; i++) {
|
|
4189
|
+
I = n = 0, o = h = null;
|
|
4190
|
+
for (let c = 0; c < C; c++) {
|
|
4191
|
+
let D = B.get(i, c);
|
|
4192
|
+
D === o ? I++ : (I >= 5 && (t += A.N1 + (I - 5)), o = D, I = 1), D = B.get(c, i), D === h ? n++ : (n >= 5 && (t += A.N1 + (n - 5)), h = D, n = 1);
|
|
4051
4193
|
}
|
|
4052
4194
|
I >= 5 && (t += A.N1 + (I - 5)), n >= 5 && (t += A.N1 + (n - 5));
|
|
4053
4195
|
}
|
|
4054
4196
|
return t;
|
|
4055
4197
|
}, g.getPenaltyN2 = function(B) {
|
|
4056
|
-
const
|
|
4198
|
+
const C = B.size;
|
|
4057
4199
|
let t = 0;
|
|
4058
|
-
for (let I = 0; I <
|
|
4059
|
-
for (let n = 0; n <
|
|
4200
|
+
for (let I = 0; I < C - 1; I++)
|
|
4201
|
+
for (let n = 0; n < C - 1; n++) {
|
|
4060
4202
|
const o = B.get(I, n) + B.get(I, n + 1) + B.get(I + 1, n) + B.get(I + 1, n + 1);
|
|
4061
4203
|
(o === 4 || o === 0) && t++;
|
|
4062
4204
|
}
|
|
4063
4205
|
return t * A.N2;
|
|
4064
4206
|
}, g.getPenaltyN3 = function(B) {
|
|
4065
|
-
const
|
|
4207
|
+
const C = B.size;
|
|
4066
4208
|
let t = 0, I = 0, n = 0;
|
|
4067
|
-
for (let o = 0; o <
|
|
4209
|
+
for (let o = 0; o < C; o++) {
|
|
4068
4210
|
I = n = 0;
|
|
4069
|
-
for (let
|
|
4070
|
-
I = I << 1 & 2047 | B.get(o,
|
|
4211
|
+
for (let h = 0; h < C; h++)
|
|
4212
|
+
I = I << 1 & 2047 | B.get(o, h), h >= 10 && (I === 1488 || I === 93) && t++, n = n << 1 & 2047 | B.get(h, o), h >= 10 && (n === 1488 || n === 93) && t++;
|
|
4071
4213
|
}
|
|
4072
4214
|
return t * A.N3;
|
|
4073
4215
|
}, g.getPenaltyN4 = function(B) {
|
|
4074
|
-
let
|
|
4216
|
+
let C = 0;
|
|
4075
4217
|
const t = B.data.length;
|
|
4076
|
-
for (let n = 0; n < t; n++)
|
|
4077
|
-
return Math.abs(Math.ceil(
|
|
4218
|
+
for (let n = 0; n < t; n++) C += B.data[n];
|
|
4219
|
+
return Math.abs(Math.ceil(C * 100 / t / 5) - 10) * A.N4;
|
|
4078
4220
|
};
|
|
4079
|
-
function E(
|
|
4080
|
-
switch (
|
|
4221
|
+
function E(Q, B, C) {
|
|
4222
|
+
switch (Q) {
|
|
4081
4223
|
case g.Patterns.PATTERN000:
|
|
4082
|
-
return (B +
|
|
4224
|
+
return (B + C) % 2 === 0;
|
|
4083
4225
|
case g.Patterns.PATTERN001:
|
|
4084
4226
|
return B % 2 === 0;
|
|
4085
4227
|
case g.Patterns.PATTERN010:
|
|
4086
|
-
return
|
|
4228
|
+
return C % 3 === 0;
|
|
4087
4229
|
case g.Patterns.PATTERN011:
|
|
4088
|
-
return (B +
|
|
4230
|
+
return (B + C) % 3 === 0;
|
|
4089
4231
|
case g.Patterns.PATTERN100:
|
|
4090
|
-
return (Math.floor(B / 2) + Math.floor(
|
|
4232
|
+
return (Math.floor(B / 2) + Math.floor(C / 3)) % 2 === 0;
|
|
4091
4233
|
case g.Patterns.PATTERN101:
|
|
4092
|
-
return B *
|
|
4234
|
+
return B * C % 2 + B * C % 3 === 0;
|
|
4093
4235
|
case g.Patterns.PATTERN110:
|
|
4094
|
-
return (B *
|
|
4236
|
+
return (B * C % 2 + B * C % 3) % 2 === 0;
|
|
4095
4237
|
case g.Patterns.PATTERN111:
|
|
4096
|
-
return (B *
|
|
4238
|
+
return (B * C % 3 + (B + C) % 2) % 2 === 0;
|
|
4097
4239
|
default:
|
|
4098
|
-
throw new Error("bad maskPattern:" +
|
|
4240
|
+
throw new Error("bad maskPattern:" + Q);
|
|
4099
4241
|
}
|
|
4100
4242
|
}
|
|
4101
|
-
g.applyMask = function(B,
|
|
4102
|
-
const t =
|
|
4243
|
+
g.applyMask = function(B, C) {
|
|
4244
|
+
const t = C.size;
|
|
4103
4245
|
for (let I = 0; I < t; I++)
|
|
4104
4246
|
for (let n = 0; n < t; n++)
|
|
4105
|
-
|
|
4106
|
-
}, g.getBestMask = function(B,
|
|
4247
|
+
C.isReserved(n, I) || C.xor(n, I, E(B, n, I));
|
|
4248
|
+
}, g.getBestMask = function(B, C) {
|
|
4107
4249
|
const t = Object.keys(g.Patterns).length;
|
|
4108
4250
|
let I = 0, n = 1 / 0;
|
|
4109
4251
|
for (let o = 0; o < t; o++) {
|
|
4110
|
-
|
|
4111
|
-
const
|
|
4112
|
-
g.applyMask(o, B),
|
|
4252
|
+
C(o), g.applyMask(o, B);
|
|
4253
|
+
const h = g.getPenaltyN1(B) + g.getPenaltyN2(B) + g.getPenaltyN3(B) + g.getPenaltyN4(B);
|
|
4254
|
+
g.applyMask(o, B), h < n && (n = h, I = o);
|
|
4113
4255
|
}
|
|
4114
4256
|
return I;
|
|
4115
4257
|
};
|
|
@@ -4444,8 +4586,8 @@ function ZC() {
|
|
|
4444
4586
|
2040,
|
|
4445
4587
|
2430
|
|
4446
4588
|
];
|
|
4447
|
-
return xg.getBlocksCount = function(B,
|
|
4448
|
-
switch (
|
|
4589
|
+
return xg.getBlocksCount = function(B, C) {
|
|
4590
|
+
switch (C) {
|
|
4449
4591
|
case g.L:
|
|
4450
4592
|
return A[(B - 1) * 4 + 0];
|
|
4451
4593
|
case g.M:
|
|
@@ -4457,8 +4599,8 @@ function ZC() {
|
|
|
4457
4599
|
default:
|
|
4458
4600
|
return;
|
|
4459
4601
|
}
|
|
4460
|
-
}, xg.getTotalCodewordsCount = function(B,
|
|
4461
|
-
switch (
|
|
4602
|
+
}, xg.getTotalCodewordsCount = function(B, C) {
|
|
4603
|
+
switch (C) {
|
|
4462
4604
|
case g.L:
|
|
4463
4605
|
return E[(B - 1) * 4 + 0];
|
|
4464
4606
|
case g.M:
|
|
@@ -4473,75 +4615,75 @@ function ZC() {
|
|
|
4473
4615
|
}, xg;
|
|
4474
4616
|
}
|
|
4475
4617
|
var pg = {}, Pg = {}, sC;
|
|
4476
|
-
function
|
|
4618
|
+
function PE() {
|
|
4477
4619
|
if (sC) return Pg;
|
|
4478
4620
|
sC = 1;
|
|
4479
4621
|
const g = new Uint8Array(512), A = new Uint8Array(256);
|
|
4480
4622
|
return function() {
|
|
4481
|
-
let
|
|
4623
|
+
let Q = 1;
|
|
4482
4624
|
for (let B = 0; B < 255; B++)
|
|
4483
|
-
g[B] =
|
|
4625
|
+
g[B] = Q, A[Q] = B, Q <<= 1, Q & 256 && (Q ^= 285);
|
|
4484
4626
|
for (let B = 255; B < 512; B++)
|
|
4485
4627
|
g[B] = g[B - 255];
|
|
4486
|
-
}(), Pg.log = function(
|
|
4487
|
-
if (
|
|
4488
|
-
return A[
|
|
4489
|
-
}, Pg.exp = function(
|
|
4490
|
-
return g[
|
|
4491
|
-
}, Pg.mul = function(
|
|
4492
|
-
return
|
|
4628
|
+
}(), Pg.log = function(Q) {
|
|
4629
|
+
if (Q < 1) throw new Error("log(" + Q + ")");
|
|
4630
|
+
return A[Q];
|
|
4631
|
+
}, Pg.exp = function(Q) {
|
|
4632
|
+
return g[Q];
|
|
4633
|
+
}, Pg.mul = function(Q, B) {
|
|
4634
|
+
return Q === 0 || B === 0 ? 0 : g[A[Q] + A[B]];
|
|
4493
4635
|
}, Pg;
|
|
4494
4636
|
}
|
|
4495
4637
|
var fC;
|
|
4496
|
-
function
|
|
4638
|
+
function qE() {
|
|
4497
4639
|
return fC || (fC = 1, function(g) {
|
|
4498
|
-
const A =
|
|
4499
|
-
g.mul = function(
|
|
4500
|
-
const
|
|
4501
|
-
for (let t = 0; t <
|
|
4640
|
+
const A = PE();
|
|
4641
|
+
g.mul = function(Q, B) {
|
|
4642
|
+
const C = new Uint8Array(Q.length + B.length - 1);
|
|
4643
|
+
for (let t = 0; t < Q.length; t++)
|
|
4502
4644
|
for (let I = 0; I < B.length; I++)
|
|
4503
|
-
|
|
4504
|
-
return
|
|
4505
|
-
}, g.mod = function(
|
|
4506
|
-
let
|
|
4507
|
-
for (;
|
|
4508
|
-
const t =
|
|
4645
|
+
C[t + I] ^= A.mul(Q[t], B[I]);
|
|
4646
|
+
return C;
|
|
4647
|
+
}, g.mod = function(Q, B) {
|
|
4648
|
+
let C = new Uint8Array(Q);
|
|
4649
|
+
for (; C.length - B.length >= 0; ) {
|
|
4650
|
+
const t = C[0];
|
|
4509
4651
|
for (let n = 0; n < B.length; n++)
|
|
4510
|
-
|
|
4652
|
+
C[n] ^= A.mul(B[n], t);
|
|
4511
4653
|
let I = 0;
|
|
4512
|
-
for (; I <
|
|
4513
|
-
|
|
4654
|
+
for (; I < C.length && C[I] === 0; ) I++;
|
|
4655
|
+
C = C.slice(I);
|
|
4514
4656
|
}
|
|
4515
|
-
return
|
|
4516
|
-
}, g.generateECPolynomial = function(
|
|
4657
|
+
return C;
|
|
4658
|
+
}, g.generateECPolynomial = function(Q) {
|
|
4517
4659
|
let B = new Uint8Array([1]);
|
|
4518
|
-
for (let
|
|
4519
|
-
B = g.mul(B, new Uint8Array([1, A.exp(
|
|
4660
|
+
for (let C = 0; C < Q; C++)
|
|
4661
|
+
B = g.mul(B, new Uint8Array([1, A.exp(C)]));
|
|
4520
4662
|
return B;
|
|
4521
4663
|
};
|
|
4522
4664
|
}(pg)), pg;
|
|
4523
4665
|
}
|
|
4524
4666
|
var Zg, mC;
|
|
4525
|
-
function
|
|
4667
|
+
function vE() {
|
|
4526
4668
|
if (mC) return Zg;
|
|
4527
4669
|
mC = 1;
|
|
4528
|
-
const g =
|
|
4670
|
+
const g = qE();
|
|
4529
4671
|
function A(E) {
|
|
4530
4672
|
this.genPoly = void 0, this.degree = E, this.degree && this.initialize(this.degree);
|
|
4531
4673
|
}
|
|
4532
|
-
return A.prototype.initialize = function(
|
|
4533
|
-
this.degree =
|
|
4534
|
-
}, A.prototype.encode = function(
|
|
4674
|
+
return A.prototype.initialize = function(Q) {
|
|
4675
|
+
this.degree = Q, this.genPoly = g.generateECPolynomial(this.degree);
|
|
4676
|
+
}, A.prototype.encode = function(Q) {
|
|
4535
4677
|
if (!this.genPoly)
|
|
4536
4678
|
throw new Error("Encoder not initialized");
|
|
4537
|
-
const B = new Uint8Array(
|
|
4538
|
-
B.set(
|
|
4539
|
-
const
|
|
4679
|
+
const B = new Uint8Array(Q.length + this.degree);
|
|
4680
|
+
B.set(Q);
|
|
4681
|
+
const C = g.mod(B, this.genPoly), t = this.degree - C.length;
|
|
4540
4682
|
if (t > 0) {
|
|
4541
4683
|
const I = new Uint8Array(this.degree);
|
|
4542
|
-
return I.set(
|
|
4684
|
+
return I.set(C, t), I;
|
|
4543
4685
|
}
|
|
4544
|
-
return
|
|
4686
|
+
return C;
|
|
4545
4687
|
}, Zg = A, Zg;
|
|
4546
4688
|
}
|
|
4547
4689
|
var Vg = {}, Wg = {}, _g = {}, rC;
|
|
@@ -4550,24 +4692,24 @@ function VC() {
|
|
|
4550
4692
|
return !isNaN(A) && A >= 1 && A <= 40;
|
|
4551
4693
|
}), _g;
|
|
4552
4694
|
}
|
|
4553
|
-
var
|
|
4695
|
+
var ZA = {}, PC;
|
|
4554
4696
|
function WC() {
|
|
4555
|
-
if (PC) return
|
|
4697
|
+
if (PC) return ZA;
|
|
4556
4698
|
PC = 1;
|
|
4557
4699
|
const g = "[0-9]+", A = "[A-Z $%*+\\-./:]+";
|
|
4558
4700
|
let E = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
4559
4701
|
E = E.replace(/u/g, "\\u");
|
|
4560
|
-
const
|
|
4702
|
+
const Q = "(?:(?![A-Z0-9 $%*+\\-./:]|" + E + `)(?:.|[\r
|
|
4561
4703
|
]))+`;
|
|
4562
|
-
|
|
4563
|
-
const B = new RegExp("^" + E + "$"),
|
|
4564
|
-
return
|
|
4704
|
+
ZA.KANJI = new RegExp(E, "g"), ZA.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), ZA.BYTE = new RegExp(Q, "g"), ZA.NUMERIC = new RegExp(g, "g"), ZA.ALPHANUMERIC = new RegExp(A, "g");
|
|
4705
|
+
const B = new RegExp("^" + E + "$"), C = new RegExp("^" + g + "$"), t = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
4706
|
+
return ZA.testKanji = function(n) {
|
|
4565
4707
|
return B.test(n);
|
|
4566
|
-
},
|
|
4567
|
-
return
|
|
4568
|
-
},
|
|
4708
|
+
}, ZA.testNumeric = function(n) {
|
|
4709
|
+
return C.test(n);
|
|
4710
|
+
}, ZA.testAlphanumeric = function(n) {
|
|
4569
4711
|
return t.test(n);
|
|
4570
|
-
},
|
|
4712
|
+
}, ZA;
|
|
4571
4713
|
}
|
|
4572
4714
|
var qC;
|
|
4573
4715
|
function ig() {
|
|
@@ -4591,20 +4733,20 @@ function ig() {
|
|
|
4591
4733
|
ccBits: [8, 10, 12]
|
|
4592
4734
|
}, g.MIXED = {
|
|
4593
4735
|
bit: -1
|
|
4594
|
-
}, g.getCharCountIndicator = function(
|
|
4595
|
-
if (!
|
|
4736
|
+
}, g.getCharCountIndicator = function(C, t) {
|
|
4737
|
+
if (!C.ccBits) throw new Error("Invalid mode: " + C);
|
|
4596
4738
|
if (!A.isValid(t))
|
|
4597
4739
|
throw new Error("Invalid version: " + t);
|
|
4598
|
-
return t >= 1 && t < 10 ?
|
|
4599
|
-
}, g.getBestModeForData = function(
|
|
4600
|
-
return E.testNumeric(
|
|
4601
|
-
}, g.toString = function(
|
|
4602
|
-
if (
|
|
4740
|
+
return t >= 1 && t < 10 ? C.ccBits[0] : t < 27 ? C.ccBits[1] : C.ccBits[2];
|
|
4741
|
+
}, g.getBestModeForData = function(C) {
|
|
4742
|
+
return E.testNumeric(C) ? g.NUMERIC : E.testAlphanumeric(C) ? g.ALPHANUMERIC : E.testKanji(C) ? g.KANJI : g.BYTE;
|
|
4743
|
+
}, g.toString = function(C) {
|
|
4744
|
+
if (C && C.id) return C.id;
|
|
4603
4745
|
throw new Error("Invalid mode");
|
|
4604
|
-
}, g.isValid = function(
|
|
4605
|
-
return
|
|
4746
|
+
}, g.isValid = function(C) {
|
|
4747
|
+
return C && C.bit && C.ccBits;
|
|
4606
4748
|
};
|
|
4607
|
-
function
|
|
4749
|
+
function Q(B) {
|
|
4608
4750
|
if (typeof B != "string")
|
|
4609
4751
|
throw new Error("Param is not a string");
|
|
4610
4752
|
switch (B.toLowerCase()) {
|
|
@@ -4620,11 +4762,11 @@ function ig() {
|
|
|
4620
4762
|
throw new Error("Unknown mode: " + B);
|
|
4621
4763
|
}
|
|
4622
4764
|
}
|
|
4623
|
-
g.from = function(
|
|
4624
|
-
if (g.isValid(
|
|
4625
|
-
return
|
|
4765
|
+
g.from = function(C, t) {
|
|
4766
|
+
if (g.isValid(C))
|
|
4767
|
+
return C;
|
|
4626
4768
|
try {
|
|
4627
|
-
return C
|
|
4769
|
+
return Q(C);
|
|
4628
4770
|
} catch (I) {
|
|
4629
4771
|
return t;
|
|
4630
4772
|
}
|
|
@@ -4632,33 +4774,33 @@ function ig() {
|
|
|
4632
4774
|
}(Wg)), Wg;
|
|
4633
4775
|
}
|
|
4634
4776
|
var vC;
|
|
4635
|
-
function
|
|
4777
|
+
function ME() {
|
|
4636
4778
|
return vC || (vC = 1, function(g) {
|
|
4637
|
-
const A = ug(), E = ZC(),
|
|
4638
|
-
function n(
|
|
4779
|
+
const A = ug(), E = ZC(), Q = DB(), B = ig(), C = VC(), t = 7973, I = A.getBCHDigit(t);
|
|
4780
|
+
function n(c, D, s) {
|
|
4639
4781
|
for (let q = 1; q <= 40; q++)
|
|
4640
|
-
if (D <= g.getCapacity(q, s,
|
|
4782
|
+
if (D <= g.getCapacity(q, s, c))
|
|
4641
4783
|
return q;
|
|
4642
4784
|
}
|
|
4643
|
-
function o(
|
|
4644
|
-
return B.getCharCountIndicator(
|
|
4785
|
+
function o(c, D) {
|
|
4786
|
+
return B.getCharCountIndicator(c, D) + 4;
|
|
4645
4787
|
}
|
|
4646
|
-
function c
|
|
4788
|
+
function h(c, D) {
|
|
4647
4789
|
let s = 0;
|
|
4648
|
-
return
|
|
4790
|
+
return c.forEach(function(q) {
|
|
4649
4791
|
const F = o(q.mode, D);
|
|
4650
4792
|
s += F + q.getBitsLength();
|
|
4651
4793
|
}), s;
|
|
4652
4794
|
}
|
|
4653
|
-
function i(
|
|
4795
|
+
function i(c, D) {
|
|
4654
4796
|
for (let s = 1; s <= 40; s++)
|
|
4655
|
-
if (c
|
|
4797
|
+
if (h(c, s) <= g.getCapacity(s, D, B.MIXED))
|
|
4656
4798
|
return s;
|
|
4657
4799
|
}
|
|
4658
4800
|
g.from = function(D, s) {
|
|
4659
|
-
return
|
|
4801
|
+
return C.isValid(D) ? parseInt(D, 10) : s;
|
|
4660
4802
|
}, g.getCapacity = function(D, s, q) {
|
|
4661
|
-
if (!
|
|
4803
|
+
if (!C.isValid(D))
|
|
4662
4804
|
throw new Error("Invalid QR Code version");
|
|
4663
4805
|
typeof q == "undefined" && (q = B.BYTE);
|
|
4664
4806
|
const F = A.getSymbolTotalCodewords(D), J = E.getTotalCodewordsCount(D, s), H = (F - J) * 8;
|
|
@@ -4677,7 +4819,7 @@ function vE() {
|
|
|
4677
4819
|
}
|
|
4678
4820
|
}, g.getBestVersionForData = function(D, s) {
|
|
4679
4821
|
let q;
|
|
4680
|
-
const F =
|
|
4822
|
+
const F = Q.from(s, Q.M);
|
|
4681
4823
|
if (Array.isArray(D)) {
|
|
4682
4824
|
if (D.length > 1)
|
|
4683
4825
|
return i(D, F);
|
|
@@ -4688,7 +4830,7 @@ function vE() {
|
|
|
4688
4830
|
q = D;
|
|
4689
4831
|
return n(q.mode, q.getLength(), F);
|
|
4690
4832
|
}, g.getEncodedBits = function(D) {
|
|
4691
|
-
if (!
|
|
4833
|
+
if (!C.isValid(D) || D < 7)
|
|
4692
4834
|
throw new Error("Invalid QR Code version");
|
|
4693
4835
|
let s = D << 12;
|
|
4694
4836
|
for (; A.getBCHDigit(s) - I >= 0; )
|
|
@@ -4698,42 +4840,42 @@ function vE() {
|
|
|
4698
4840
|
}(Vg)), Vg;
|
|
4699
4841
|
}
|
|
4700
4842
|
var $g = {}, MC;
|
|
4701
|
-
function
|
|
4843
|
+
function TE() {
|
|
4702
4844
|
if (MC) return $g;
|
|
4703
4845
|
MC = 1;
|
|
4704
|
-
const g = ug(), A = 1335, E = 21522,
|
|
4705
|
-
return $g.getEncodedBits = function(
|
|
4706
|
-
const I =
|
|
4846
|
+
const g = ug(), A = 1335, E = 21522, Q = g.getBCHDigit(A);
|
|
4847
|
+
return $g.getEncodedBits = function(C, t) {
|
|
4848
|
+
const I = C.bit << 3 | t;
|
|
4707
4849
|
let n = I << 10;
|
|
4708
|
-
for (; g.getBCHDigit(n) -
|
|
4709
|
-
n ^= A << g.getBCHDigit(n) -
|
|
4850
|
+
for (; g.getBCHDigit(n) - Q >= 0; )
|
|
4851
|
+
n ^= A << g.getBCHDigit(n) - Q;
|
|
4710
4852
|
return (I << 10 | n) ^ E;
|
|
4711
4853
|
}, $g;
|
|
4712
4854
|
}
|
|
4713
4855
|
var AB = {}, gB, TC;
|
|
4714
|
-
function
|
|
4856
|
+
function lE() {
|
|
4715
4857
|
if (TC) return gB;
|
|
4716
4858
|
TC = 1;
|
|
4717
4859
|
const g = ig();
|
|
4718
4860
|
function A(E) {
|
|
4719
4861
|
this.mode = g.NUMERIC, this.data = E.toString();
|
|
4720
4862
|
}
|
|
4721
|
-
return A.getBitsLength = function(
|
|
4722
|
-
return 10 * Math.floor(
|
|
4863
|
+
return A.getBitsLength = function(Q) {
|
|
4864
|
+
return 10 * Math.floor(Q / 3) + (Q % 3 ? Q % 3 * 3 + 1 : 0);
|
|
4723
4865
|
}, A.prototype.getLength = function() {
|
|
4724
4866
|
return this.data.length;
|
|
4725
4867
|
}, A.prototype.getBitsLength = function() {
|
|
4726
4868
|
return A.getBitsLength(this.data.length);
|
|
4727
|
-
}, A.prototype.write = function(
|
|
4728
|
-
let B,
|
|
4869
|
+
}, A.prototype.write = function(Q) {
|
|
4870
|
+
let B, C, t;
|
|
4729
4871
|
for (B = 0; B + 3 <= this.data.length; B += 3)
|
|
4730
|
-
|
|
4872
|
+
C = this.data.substr(B, 3), t = parseInt(C, 10), Q.put(t, 10);
|
|
4731
4873
|
const I = this.data.length - B;
|
|
4732
|
-
I > 0 && (
|
|
4874
|
+
I > 0 && (C = this.data.substr(B), t = parseInt(C, 10), Q.put(t, I * 3 + 1));
|
|
4733
4875
|
}, gB = A, gB;
|
|
4734
4876
|
}
|
|
4735
4877
|
var BB, lC;
|
|
4736
|
-
function
|
|
4878
|
+
function HE() {
|
|
4737
4879
|
if (lC) return BB;
|
|
4738
4880
|
lC = 1;
|
|
4739
4881
|
const g = ig(), A = [
|
|
@@ -4783,8 +4925,8 @@ function lE() {
|
|
|
4783
4925
|
"/",
|
|
4784
4926
|
":"
|
|
4785
4927
|
];
|
|
4786
|
-
function E(
|
|
4787
|
-
this.mode = g.ALPHANUMERIC, this.data =
|
|
4928
|
+
function E(Q) {
|
|
4929
|
+
this.mode = g.ALPHANUMERIC, this.data = Q;
|
|
4788
4930
|
}
|
|
4789
4931
|
return E.getBitsLength = function(B) {
|
|
4790
4932
|
return 11 * Math.floor(B / 2) + 6 * (B % 2);
|
|
@@ -4793,40 +4935,40 @@ function lE() {
|
|
|
4793
4935
|
}, E.prototype.getBitsLength = function() {
|
|
4794
4936
|
return E.getBitsLength(this.data.length);
|
|
4795
4937
|
}, E.prototype.write = function(B) {
|
|
4796
|
-
let
|
|
4797
|
-
for (
|
|
4798
|
-
let t = A.indexOf(this.data[
|
|
4799
|
-
t += A.indexOf(this.data[
|
|
4938
|
+
let C;
|
|
4939
|
+
for (C = 0; C + 2 <= this.data.length; C += 2) {
|
|
4940
|
+
let t = A.indexOf(this.data[C]) * 45;
|
|
4941
|
+
t += A.indexOf(this.data[C + 1]), B.put(t, 11);
|
|
4800
4942
|
}
|
|
4801
|
-
this.data.length % 2 && B.put(A.indexOf(this.data[
|
|
4943
|
+
this.data.length % 2 && B.put(A.indexOf(this.data[C]), 6);
|
|
4802
4944
|
}, BB = E, BB;
|
|
4803
4945
|
}
|
|
4804
4946
|
var CB, HC;
|
|
4805
|
-
function
|
|
4947
|
+
function xE() {
|
|
4806
4948
|
if (HC) return CB;
|
|
4807
4949
|
HC = 1;
|
|
4808
4950
|
const g = ig();
|
|
4809
4951
|
function A(E) {
|
|
4810
4952
|
this.mode = g.BYTE, typeof E == "string" ? this.data = new TextEncoder().encode(E) : this.data = new Uint8Array(E);
|
|
4811
4953
|
}
|
|
4812
|
-
return A.getBitsLength = function(
|
|
4813
|
-
return
|
|
4954
|
+
return A.getBitsLength = function(Q) {
|
|
4955
|
+
return Q * 8;
|
|
4814
4956
|
}, A.prototype.getLength = function() {
|
|
4815
4957
|
return this.data.length;
|
|
4816
4958
|
}, A.prototype.getBitsLength = function() {
|
|
4817
4959
|
return A.getBitsLength(this.data.length);
|
|
4818
4960
|
}, A.prototype.write = function(E) {
|
|
4819
|
-
for (let
|
|
4820
|
-
E.put(this.data[
|
|
4961
|
+
for (let Q = 0, B = this.data.length; Q < B; Q++)
|
|
4962
|
+
E.put(this.data[Q], 8);
|
|
4821
4963
|
}, CB = A, CB;
|
|
4822
4964
|
}
|
|
4823
4965
|
var QB, xC;
|
|
4824
|
-
function
|
|
4966
|
+
function dE() {
|
|
4825
4967
|
if (xC) return QB;
|
|
4826
4968
|
xC = 1;
|
|
4827
4969
|
const g = ig(), A = ug();
|
|
4828
|
-
function E(
|
|
4829
|
-
this.mode = g.KANJI, this.data =
|
|
4970
|
+
function E(Q) {
|
|
4971
|
+
this.mode = g.KANJI, this.data = Q;
|
|
4830
4972
|
}
|
|
4831
4973
|
return E.getBitsLength = function(B) {
|
|
4832
4974
|
return B * 13;
|
|
@@ -4834,52 +4976,52 @@ function xE() {
|
|
|
4834
4976
|
return this.data.length;
|
|
4835
4977
|
}, E.prototype.getBitsLength = function() {
|
|
4836
4978
|
return E.getBitsLength(this.data.length);
|
|
4837
|
-
}, E.prototype.write = function(
|
|
4979
|
+
}, E.prototype.write = function(Q) {
|
|
4838
4980
|
let B;
|
|
4839
4981
|
for (B = 0; B < this.data.length; B++) {
|
|
4840
|
-
let
|
|
4841
|
-
if (
|
|
4842
|
-
|
|
4843
|
-
else if (
|
|
4844
|
-
|
|
4982
|
+
let C = A.toSJIS(this.data[B]);
|
|
4983
|
+
if (C >= 33088 && C <= 40956)
|
|
4984
|
+
C -= 33088;
|
|
4985
|
+
else if (C >= 57408 && C <= 60351)
|
|
4986
|
+
C -= 49472;
|
|
4845
4987
|
else
|
|
4846
4988
|
throw new Error(
|
|
4847
4989
|
"Invalid SJIS character: " + this.data[B] + `
|
|
4848
4990
|
Make sure your charset is UTF-8`
|
|
4849
4991
|
);
|
|
4850
|
-
|
|
4992
|
+
C = (C >>> 8 & 255) * 192 + (C & 255), Q.put(C, 13);
|
|
4851
4993
|
}
|
|
4852
4994
|
}, QB = E, QB;
|
|
4853
4995
|
}
|
|
4854
4996
|
var EB = { exports: {} }, dC;
|
|
4855
|
-
function
|
|
4997
|
+
function kE() {
|
|
4856
4998
|
return dC || (dC = 1, function(g) {
|
|
4857
4999
|
var A = {
|
|
4858
|
-
single_source_shortest_paths: function(E,
|
|
4859
|
-
var
|
|
4860
|
-
t[
|
|
5000
|
+
single_source_shortest_paths: function(E, Q, B) {
|
|
5001
|
+
var C = {}, t = {};
|
|
5002
|
+
t[Q] = 0;
|
|
4861
5003
|
var I = A.PriorityQueue.make();
|
|
4862
|
-
I.push(
|
|
4863
|
-
for (var n, o,
|
|
4864
|
-
n = I.pop(), o = n.value, i = n.cost,
|
|
4865
|
-
for (
|
|
4866
|
-
|
|
5004
|
+
I.push(Q, 0);
|
|
5005
|
+
for (var n, o, h, i, c, D, s, q, F; !I.empty(); ) {
|
|
5006
|
+
n = I.pop(), o = n.value, i = n.cost, c = E[o] || {};
|
|
5007
|
+
for (h in c)
|
|
5008
|
+
c.hasOwnProperty(h) && (D = c[h], s = i + D, q = t[h], F = typeof t[h] == "undefined", (F || q > s) && (t[h] = s, I.push(h, s), C[h] = o));
|
|
4867
5009
|
}
|
|
4868
5010
|
if (typeof B != "undefined" && typeof t[B] == "undefined") {
|
|
4869
|
-
var J = ["Could not find a path from ",
|
|
5011
|
+
var J = ["Could not find a path from ", Q, " to ", B, "."].join("");
|
|
4870
5012
|
throw new Error(J);
|
|
4871
5013
|
}
|
|
4872
|
-
return
|
|
5014
|
+
return C;
|
|
4873
5015
|
},
|
|
4874
|
-
extract_shortest_path_from_predecessor_list: function(E,
|
|
4875
|
-
for (var B = [],
|
|
4876
|
-
B.push(
|
|
5016
|
+
extract_shortest_path_from_predecessor_list: function(E, Q) {
|
|
5017
|
+
for (var B = [], C = Q; C; )
|
|
5018
|
+
B.push(C), E[C], C = E[C];
|
|
4877
5019
|
return B.reverse(), B;
|
|
4878
5020
|
},
|
|
4879
|
-
find_path: function(E,
|
|
4880
|
-
var
|
|
5021
|
+
find_path: function(E, Q, B) {
|
|
5022
|
+
var C = A.single_source_shortest_paths(E, Q, B);
|
|
4881
5023
|
return A.extract_shortest_path_from_predecessor_list(
|
|
4882
|
-
|
|
5024
|
+
C,
|
|
4883
5025
|
B
|
|
4884
5026
|
);
|
|
4885
5027
|
},
|
|
@@ -4888,21 +5030,21 @@ function dE() {
|
|
|
4888
5030
|
*/
|
|
4889
5031
|
PriorityQueue: {
|
|
4890
5032
|
make: function(E) {
|
|
4891
|
-
var
|
|
5033
|
+
var Q = A.PriorityQueue, B = {}, C;
|
|
4892
5034
|
E = E || {};
|
|
4893
|
-
for (
|
|
4894
|
-
|
|
4895
|
-
return B.queue = [], B.sorter = E.sorter ||
|
|
5035
|
+
for (C in Q)
|
|
5036
|
+
Q.hasOwnProperty(C) && (B[C] = Q[C]);
|
|
5037
|
+
return B.queue = [], B.sorter = E.sorter || Q.default_sorter, B;
|
|
4896
5038
|
},
|
|
4897
|
-
default_sorter: function(E,
|
|
4898
|
-
return E.cost -
|
|
5039
|
+
default_sorter: function(E, Q) {
|
|
5040
|
+
return E.cost - Q.cost;
|
|
4899
5041
|
},
|
|
4900
5042
|
/**
|
|
4901
5043
|
* Add a new item to the queue and ensure the highest priority element
|
|
4902
5044
|
* is at the front of the queue.
|
|
4903
5045
|
*/
|
|
4904
|
-
push: function(E,
|
|
4905
|
-
var B = { value: E, cost:
|
|
5046
|
+
push: function(E, Q) {
|
|
5047
|
+
var B = { value: E, cost: Q };
|
|
4906
5048
|
this.queue.push(B), this.queue.sort(this.sorter);
|
|
4907
5049
|
},
|
|
4908
5050
|
/**
|
|
@@ -4920,13 +5062,13 @@ function dE() {
|
|
|
4920
5062
|
}(EB)), EB.exports;
|
|
4921
5063
|
}
|
|
4922
5064
|
var kC;
|
|
4923
|
-
function
|
|
5065
|
+
function RE() {
|
|
4924
5066
|
return kC || (kC = 1, function(g) {
|
|
4925
|
-
const A = ig(), E =
|
|
5067
|
+
const A = ig(), E = lE(), Q = HE(), B = xE(), C = dE(), t = WC(), I = ug(), n = kE();
|
|
4926
5068
|
function o(J) {
|
|
4927
5069
|
return unescape(encodeURIComponent(J)).length;
|
|
4928
5070
|
}
|
|
4929
|
-
function
|
|
5071
|
+
function h(J, H, P) {
|
|
4930
5072
|
const m = [];
|
|
4931
5073
|
let d;
|
|
4932
5074
|
for (; (d = J.exec(P)) !== null; )
|
|
@@ -4939,9 +5081,9 @@ function kE() {
|
|
|
4939
5081
|
return m;
|
|
4940
5082
|
}
|
|
4941
5083
|
function i(J) {
|
|
4942
|
-
const H =
|
|
5084
|
+
const H = h(t.NUMERIC, A.NUMERIC, J), P = h(t.ALPHANUMERIC, A.ALPHANUMERIC, J);
|
|
4943
5085
|
let m, d;
|
|
4944
|
-
return I.isKanjiModeEnabled() ? (m =
|
|
5086
|
+
return I.isKanjiModeEnabled() ? (m = h(t.BYTE, A.BYTE, J), d = h(t.KANJI, A.KANJI, J)) : (m = h(t.BYTE_KANJI, A.BYTE, J), d = []), H.concat(P, m, d).sort(function(f, r) {
|
|
4945
5087
|
return f.index - r.index;
|
|
4946
5088
|
}).map(function(f) {
|
|
4947
5089
|
return {
|
|
@@ -4951,14 +5093,14 @@ function kE() {
|
|
|
4951
5093
|
};
|
|
4952
5094
|
});
|
|
4953
5095
|
}
|
|
4954
|
-
function
|
|
5096
|
+
function c(J, H) {
|
|
4955
5097
|
switch (H) {
|
|
4956
5098
|
case A.NUMERIC:
|
|
4957
5099
|
return E.getBitsLength(J);
|
|
4958
5100
|
case A.ALPHANUMERIC:
|
|
4959
|
-
return C.getBitsLength(J);
|
|
4960
|
-
case A.KANJI:
|
|
4961
5101
|
return Q.getBitsLength(J);
|
|
5102
|
+
case A.KANJI:
|
|
5103
|
+
return C.getBitsLength(J);
|
|
4962
5104
|
case A.BYTE:
|
|
4963
5105
|
return B.getBitsLength(J);
|
|
4964
5106
|
}
|
|
@@ -5011,7 +5153,7 @@ function kE() {
|
|
|
5011
5153
|
r.push(k), P[k] = { node: X, lastCount: 0 }, m[k] = {};
|
|
5012
5154
|
for (let R = 0; R < d.length; R++) {
|
|
5013
5155
|
const T = d[R];
|
|
5014
|
-
P[T] && P[T].node.mode === X.mode ? (m[T][k] =
|
|
5156
|
+
P[T] && P[T].node.mode === X.mode ? (m[T][k] = c(P[T].lastCount + X.length, X.mode) - c(P[T].lastCount, X.mode), P[T].lastCount += X.length) : (P[T] && (P[T].lastCount = X.length), m[T][k] = c(X.length, X.mode) + 4 + A.getCharCountIndicator(X.mode, H));
|
|
5015
5157
|
}
|
|
5016
5158
|
}
|
|
5017
5159
|
d = r;
|
|
@@ -5030,9 +5172,9 @@ function kE() {
|
|
|
5030
5172
|
case A.NUMERIC:
|
|
5031
5173
|
return new E(J);
|
|
5032
5174
|
case A.ALPHANUMERIC:
|
|
5033
|
-
return new C(J);
|
|
5034
|
-
case A.KANJI:
|
|
5035
5175
|
return new Q(J);
|
|
5176
|
+
case A.KANJI:
|
|
5177
|
+
return new C(J);
|
|
5036
5178
|
case A.BYTE:
|
|
5037
5179
|
return new B(J);
|
|
5038
5180
|
}
|
|
@@ -5054,12 +5196,12 @@ function kE() {
|
|
|
5054
5196
|
}(AB)), AB;
|
|
5055
5197
|
}
|
|
5056
5198
|
var RC;
|
|
5057
|
-
function
|
|
5199
|
+
function YE() {
|
|
5058
5200
|
if (RC) return Ng;
|
|
5059
5201
|
RC = 1;
|
|
5060
|
-
const g = ug(), A = DB(), E =
|
|
5202
|
+
const g = ug(), A = DB(), E = iE(), Q = sE(), B = fE(), C = mE(), t = rE(), I = ZC(), n = vE(), o = ME(), h = TE(), i = ig(), c = RE();
|
|
5061
5203
|
function D(v, f) {
|
|
5062
|
-
const r = v.size, M =
|
|
5204
|
+
const r = v.size, M = C.getPositions(f);
|
|
5063
5205
|
for (let X = 0; X < M.length; X++) {
|
|
5064
5206
|
const k = M[X][0], R = M[X][1];
|
|
5065
5207
|
for (let T = -1; T <= 7; T++)
|
|
@@ -5091,7 +5233,7 @@ function RE() {
|
|
|
5091
5233
|
X = Math.floor(T / 3), k = T % 3 + r - 8 - 3, R = (M >> T & 1) === 1, v.set(X, k, R, !0), v.set(k, X, R, !0);
|
|
5092
5234
|
}
|
|
5093
5235
|
function J(v, f, r) {
|
|
5094
|
-
const M = v.size, X =
|
|
5236
|
+
const M = v.size, X = h.getEncodedBits(f, r);
|
|
5095
5237
|
let k, R;
|
|
5096
5238
|
for (k = 0; k < 15; k++)
|
|
5097
5239
|
R = (X >> k & 1) === 1, k < 6 ? v.set(k, 8, R, !0) : k < 8 ? v.set(k + 1, 8, R, !0) : v.set(M - 15 + k, 8, R, !0), k < 8 ? v.set(8, M - k - 1, R, !0) : k < 9 ? v.set(8, 15 - k - 1 + 1, R, !0) : v.set(8, 15 - k - 1, R, !0);
|
|
@@ -5149,14 +5291,14 @@ function RE() {
|
|
|
5149
5291
|
function d(v, f, r, M) {
|
|
5150
5292
|
let X;
|
|
5151
5293
|
if (Array.isArray(v))
|
|
5152
|
-
X =
|
|
5294
|
+
X = c.fromArray(v);
|
|
5153
5295
|
else if (typeof v == "string") {
|
|
5154
5296
|
let y = f;
|
|
5155
5297
|
if (!y) {
|
|
5156
|
-
const K =
|
|
5298
|
+
const K = c.rawSplit(v);
|
|
5157
5299
|
y = o.getBestVersionForData(K, r);
|
|
5158
5300
|
}
|
|
5159
|
-
X =
|
|
5301
|
+
X = c.fromString(v, y || 40);
|
|
5160
5302
|
} else
|
|
5161
5303
|
throw new Error("Invalid data");
|
|
5162
5304
|
const k = o.getBestVersionForData(X, r);
|
|
@@ -5171,7 +5313,7 @@ The chosen QR Code version cannot contain this amount of data.
|
|
|
5171
5313
|
Minimum version required to store current data is: ` + k + `.
|
|
5172
5314
|
`
|
|
5173
5315
|
);
|
|
5174
|
-
const R = P(f, r, X), T = g.getSymbolSize(f), Y = new
|
|
5316
|
+
const R = P(f, r, X), T = g.getSymbolSize(f), Y = new Q(T);
|
|
5175
5317
|
return D(Y, f), s(Y), q(Y, f), J(Y, r, 0), f >= 7 && F(Y, f), H(Y, R), isNaN(M) && (M = t.getBestMask(
|
|
5176
5318
|
Y,
|
|
5177
5319
|
J.bind(null, Y, r)
|
|
@@ -5196,118 +5338,118 @@ function _C() {
|
|
|
5196
5338
|
function A(E) {
|
|
5197
5339
|
if (typeof E == "number" && (E = E.toString()), typeof E != "string")
|
|
5198
5340
|
throw new Error("Color should be defined as hex string");
|
|
5199
|
-
let
|
|
5200
|
-
if (
|
|
5341
|
+
let Q = E.slice().replace("#", "").split("");
|
|
5342
|
+
if (Q.length < 3 || Q.length === 5 || Q.length > 8)
|
|
5201
5343
|
throw new Error("Invalid hex color: " + E);
|
|
5202
|
-
(
|
|
5203
|
-
return [
|
|
5204
|
-
}))),
|
|
5205
|
-
const B = parseInt(
|
|
5344
|
+
(Q.length === 3 || Q.length === 4) && (Q = Array.prototype.concat.apply([], Q.map(function(C) {
|
|
5345
|
+
return [C, C];
|
|
5346
|
+
}))), Q.length === 6 && Q.push("F", "F");
|
|
5347
|
+
const B = parseInt(Q.join(""), 16);
|
|
5206
5348
|
return {
|
|
5207
5349
|
r: B >> 24 & 255,
|
|
5208
5350
|
g: B >> 16 & 255,
|
|
5209
5351
|
b: B >> 8 & 255,
|
|
5210
5352
|
a: B & 255,
|
|
5211
|
-
hex: "#" +
|
|
5353
|
+
hex: "#" + Q.slice(0, 6).join("")
|
|
5212
5354
|
};
|
|
5213
5355
|
}
|
|
5214
|
-
g.getOptions = function(
|
|
5215
|
-
|
|
5216
|
-
const B = typeof
|
|
5356
|
+
g.getOptions = function(Q) {
|
|
5357
|
+
Q || (Q = {}), Q.color || (Q.color = {});
|
|
5358
|
+
const B = typeof Q.margin == "undefined" || Q.margin === null || Q.margin < 0 ? 4 : Q.margin, C = Q.width && Q.width >= 21 ? Q.width : void 0, t = Q.scale || 4;
|
|
5217
5359
|
return {
|
|
5218
|
-
width:
|
|
5219
|
-
scale:
|
|
5360
|
+
width: C,
|
|
5361
|
+
scale: C ? 4 : t,
|
|
5220
5362
|
margin: B,
|
|
5221
5363
|
color: {
|
|
5222
|
-
dark: A(
|
|
5223
|
-
light: A(
|
|
5364
|
+
dark: A(Q.color.dark || "#000000ff"),
|
|
5365
|
+
light: A(Q.color.light || "#ffffffff")
|
|
5224
5366
|
},
|
|
5225
|
-
type:
|
|
5226
|
-
rendererOpts:
|
|
5367
|
+
type: Q.type,
|
|
5368
|
+
rendererOpts: Q.rendererOpts || {}
|
|
5227
5369
|
};
|
|
5228
|
-
}, g.getScale = function(
|
|
5229
|
-
return B.width && B.width >=
|
|
5230
|
-
}, g.getImageWidth = function(
|
|
5231
|
-
const
|
|
5232
|
-
return Math.floor((
|
|
5233
|
-
}, g.qrToImageData = function(
|
|
5234
|
-
const t = B.modules.size, I = B.modules.data, n = g.getScale(t,
|
|
5235
|
-
for (let
|
|
5370
|
+
}, g.getScale = function(Q, B) {
|
|
5371
|
+
return B.width && B.width >= Q + B.margin * 2 ? B.width / (Q + B.margin * 2) : B.scale;
|
|
5372
|
+
}, g.getImageWidth = function(Q, B) {
|
|
5373
|
+
const C = g.getScale(Q, B);
|
|
5374
|
+
return Math.floor((Q + B.margin * 2) * C);
|
|
5375
|
+
}, g.qrToImageData = function(Q, B, C) {
|
|
5376
|
+
const t = B.modules.size, I = B.modules.data, n = g.getScale(t, C), o = Math.floor((t + C.margin * 2) * n), h = C.margin * n, i = [C.color.light, C.color.dark];
|
|
5377
|
+
for (let c = 0; c < o; c++)
|
|
5236
5378
|
for (let D = 0; D < o; D++) {
|
|
5237
|
-
let s = (
|
|
5238
|
-
if (
|
|
5239
|
-
const F = Math.floor((
|
|
5379
|
+
let s = (c * o + D) * 4, q = C.color.light;
|
|
5380
|
+
if (c >= h && D >= h && c < o - h && D < o - h) {
|
|
5381
|
+
const F = Math.floor((c - h) / n), J = Math.floor((D - h) / n);
|
|
5240
5382
|
q = i[I[F * t + J] ? 1 : 0];
|
|
5241
5383
|
}
|
|
5242
|
-
|
|
5384
|
+
Q[s++] = q.r, Q[s++] = q.g, Q[s++] = q.b, Q[s] = q.a;
|
|
5243
5385
|
}
|
|
5244
5386
|
};
|
|
5245
5387
|
}(nB)), nB;
|
|
5246
5388
|
}
|
|
5247
5389
|
var JC;
|
|
5248
|
-
function
|
|
5390
|
+
function JE() {
|
|
5249
5391
|
return JC || (JC = 1, function(g) {
|
|
5250
5392
|
const A = _C();
|
|
5251
|
-
function E(B,
|
|
5252
|
-
B.clearRect(0, 0,
|
|
5393
|
+
function E(B, C, t) {
|
|
5394
|
+
B.clearRect(0, 0, C.width, C.height), C.style || (C.style = {}), C.height = t, C.width = t, C.style.height = t + "px", C.style.width = t + "px";
|
|
5253
5395
|
}
|
|
5254
|
-
function
|
|
5396
|
+
function Q() {
|
|
5255
5397
|
try {
|
|
5256
5398
|
return document.createElement("canvas");
|
|
5257
5399
|
} catch (B) {
|
|
5258
5400
|
throw new Error("You need to specify a canvas element");
|
|
5259
5401
|
}
|
|
5260
5402
|
}
|
|
5261
|
-
g.render = function(
|
|
5403
|
+
g.render = function(C, t, I) {
|
|
5262
5404
|
let n = I, o = t;
|
|
5263
|
-
typeof n == "undefined" && (!t || !t.getContext) && (n = t, t = void 0), t || (o =
|
|
5264
|
-
const
|
|
5265
|
-
return A.qrToImageData(
|
|
5266
|
-
}, g.renderToDataURL = function(
|
|
5405
|
+
typeof n == "undefined" && (!t || !t.getContext) && (n = t, t = void 0), t || (o = Q()), n = A.getOptions(n);
|
|
5406
|
+
const h = A.getImageWidth(C.modules.size, n), i = o.getContext("2d"), c = i.createImageData(h, h);
|
|
5407
|
+
return A.qrToImageData(c.data, C, n), E(i, o, h), i.putImageData(c, 0, 0), o;
|
|
5408
|
+
}, g.renderToDataURL = function(C, t, I) {
|
|
5267
5409
|
let n = I;
|
|
5268
5410
|
typeof n == "undefined" && (!t || !t.getContext) && (n = t, t = void 0), n || (n = {});
|
|
5269
|
-
const o = g.render(
|
|
5270
|
-
return o.toDataURL(
|
|
5411
|
+
const o = g.render(C, t, n), h = n.type || "image/png", i = n.rendererOpts || {};
|
|
5412
|
+
return o.toDataURL(h, i.quality);
|
|
5271
5413
|
};
|
|
5272
5414
|
}(IB)), IB;
|
|
5273
5415
|
}
|
|
5274
5416
|
var tB = {}, XC;
|
|
5275
|
-
function
|
|
5417
|
+
function XE() {
|
|
5276
5418
|
if (XC) return tB;
|
|
5277
5419
|
XC = 1;
|
|
5278
5420
|
const g = _C();
|
|
5279
|
-
function A(B,
|
|
5280
|
-
const t = B.a / 255, I =
|
|
5281
|
-
return t < 1 ? I + " " +
|
|
5421
|
+
function A(B, C) {
|
|
5422
|
+
const t = B.a / 255, I = C + '="' + B.hex + '"';
|
|
5423
|
+
return t < 1 ? I + " " + C + '-opacity="' + t.toFixed(2).slice(1) + '"' : I;
|
|
5282
5424
|
}
|
|
5283
|
-
function E(B,
|
|
5284
|
-
let I = B +
|
|
5425
|
+
function E(B, C, t) {
|
|
5426
|
+
let I = B + C;
|
|
5285
5427
|
return typeof t != "undefined" && (I += " " + t), I;
|
|
5286
5428
|
}
|
|
5287
|
-
function
|
|
5288
|
-
let I = "", n = 0, o = !1,
|
|
5429
|
+
function Q(B, C, t) {
|
|
5430
|
+
let I = "", n = 0, o = !1, h = 0;
|
|
5289
5431
|
for (let i = 0; i < B.length; i++) {
|
|
5290
|
-
const
|
|
5291
|
-
!
|
|
5432
|
+
const c = Math.floor(i % C), D = Math.floor(i / C);
|
|
5433
|
+
!c && !o && (o = !0), B[i] ? (h++, i > 0 && c > 0 && B[i - 1] || (I += o ? E("M", c + t, 0.5 + D + t) : E("m", n, 0), n = 0, o = !1), c + 1 < C && B[i + 1] || (I += E("h", h), h = 0)) : n++;
|
|
5292
5434
|
}
|
|
5293
5435
|
return I;
|
|
5294
5436
|
}
|
|
5295
|
-
return tB.render = function(
|
|
5296
|
-
const n = g.getOptions(t), o =
|
|
5437
|
+
return tB.render = function(C, t, I) {
|
|
5438
|
+
const n = g.getOptions(t), o = C.modules.size, h = C.modules.data, i = o + n.margin * 2, c = n.color.light.a ? "<path " + A(n.color.light, "fill") + ' d="M0 0h' + i + "v" + i + 'H0z"/>' : "", D = "<path " + A(n.color.dark, "stroke") + ' d="' + Q(h, o, n.margin) + '"/>', s = 'viewBox="0 0 ' + i + " " + i + '"', F = '<svg xmlns="http://www.w3.org/2000/svg" ' + (n.width ? 'width="' + n.width + '" height="' + n.width + '" ' : "") + s + ' shape-rendering="crispEdges">' + c + D + `</svg>
|
|
5297
5439
|
`;
|
|
5298
5440
|
return typeof I == "function" && I(null, F), F;
|
|
5299
5441
|
}, tB;
|
|
5300
5442
|
}
|
|
5301
5443
|
var FC;
|
|
5302
|
-
function
|
|
5444
|
+
function FE() {
|
|
5303
5445
|
if (FC) return mg;
|
|
5304
5446
|
FC = 1;
|
|
5305
|
-
const g =
|
|
5306
|
-
function B(
|
|
5307
|
-
const
|
|
5308
|
-
if (!
|
|
5447
|
+
const g = uE(), A = YE(), E = JE(), Q = XE();
|
|
5448
|
+
function B(C, t, I, n, o) {
|
|
5449
|
+
const h = [].slice.call(arguments, 1), i = h.length, c = typeof h[i - 1] == "function";
|
|
5450
|
+
if (!c && !g())
|
|
5309
5451
|
throw new Error("Callback required as last argument");
|
|
5310
|
-
if (
|
|
5452
|
+
if (c) {
|
|
5311
5453
|
if (i < 2)
|
|
5312
5454
|
throw new Error("Too few arguments provided");
|
|
5313
5455
|
i === 2 ? (o = I, I = t, t = n = void 0) : i === 3 && (t.getContext && typeof o == "undefined" ? (o = n, n = void 0) : (o = n, n = I, I = t, t = void 0));
|
|
@@ -5317,7 +5459,7 @@ function XE() {
|
|
|
5317
5459
|
return i === 1 ? (I = t, t = n = void 0) : i === 2 && !t.getContext && (n = I, I = t, t = void 0), new Promise(function(D, s) {
|
|
5318
5460
|
try {
|
|
5319
5461
|
const q = A.create(I, n);
|
|
5320
|
-
D(
|
|
5462
|
+
D(C(q, t, n));
|
|
5321
5463
|
} catch (q) {
|
|
5322
5464
|
s(q);
|
|
5323
5465
|
}
|
|
@@ -5325,171 +5467,28 @@ function XE() {
|
|
|
5325
5467
|
}
|
|
5326
5468
|
try {
|
|
5327
5469
|
const D = A.create(I, n);
|
|
5328
|
-
o(null,
|
|
5470
|
+
o(null, C(D, t, n));
|
|
5329
5471
|
} catch (D) {
|
|
5330
5472
|
o(D);
|
|
5331
5473
|
}
|
|
5332
5474
|
}
|
|
5333
|
-
return mg.create = A.create, mg.toCanvas = B.bind(null, E.render), mg.toDataURL = B.bind(null, E.renderToDataURL), mg.toString = B.bind(null, function(
|
|
5334
|
-
return
|
|
5475
|
+
return mg.create = A.create, mg.toCanvas = B.bind(null, E.render), mg.toDataURL = B.bind(null, E.renderToDataURL), mg.toString = B.bind(null, function(C, t, I) {
|
|
5476
|
+
return Q.render(C, I);
|
|
5335
5477
|
}), mg;
|
|
5336
5478
|
}
|
|
5337
|
-
var
|
|
5338
|
-
const
|
|
5339
|
-
function GE({
|
|
5340
|
-
selectedProvider: g = null,
|
|
5341
|
-
selectedInvoiceOtp: A = null,
|
|
5342
|
-
selectedSignatureOtp: E = null,
|
|
5343
|
-
token: C = "",
|
|
5344
|
-
orderId: B = "",
|
|
5345
|
-
totalAmountText: Q = "",
|
|
5346
|
-
qrData: t,
|
|
5347
|
-
qrSrc: I,
|
|
5348
|
-
selectedPromotions: n,
|
|
5349
|
-
onResetToStep1: o
|
|
5350
|
-
} = {}) {
|
|
5351
|
-
const c = document.createElement("div");
|
|
5352
|
-
c.className = [
|
|
5353
|
-
"wgt:w-[440px]",
|
|
5354
|
-
"wgt:@max-2xl:w-full",
|
|
5355
|
-
"wgt:flex",
|
|
5356
|
-
"wgt:flex-col",
|
|
5357
|
-
"wgt:rounded-2xl",
|
|
5358
|
-
"wgt:border",
|
|
5359
|
-
"wgt:border-soft-200",
|
|
5360
|
-
"wgt:overflow-hidden"
|
|
5361
|
-
].join(" ");
|
|
5362
|
-
let i = 3600, h = null;
|
|
5363
|
-
const D = document.createElement("div");
|
|
5364
|
-
D.className = "wgt:p-4 wgt:w-full wgt:flex wgt:items-center wgt:justify-center wgt:gap-2 wgt:bg-primary/10";
|
|
5365
|
-
const s = document.createElement("p");
|
|
5366
|
-
s.className = "wgt:text-base wgt:font-medium wgt:leading-6 wgt:text-primary";
|
|
5367
|
-
const q = (u) => {
|
|
5368
|
-
const l = Math.floor(u / 60), L = u % 60;
|
|
5369
|
-
return `${l.toString().padStart(2, "0")}:${L.toString().padStart(2, "0")}`;
|
|
5370
|
-
}, F = () => {
|
|
5371
|
-
s.innerHTML = `${a(
|
|
5372
|
-
"completePaymentIn"
|
|
5373
|
-
)} <span class="wgt:font-bold">${q(i)}</span>`;
|
|
5374
|
-
};
|
|
5375
|
-
F();
|
|
5376
|
-
const J = () => {
|
|
5377
|
-
h = setInterval(() => {
|
|
5378
|
-
i--, F(), i <= 0 && _A(h);
|
|
5379
|
-
}, 1e3), AQ(h);
|
|
5380
|
-
};
|
|
5381
|
-
J(), D.appendChild(s);
|
|
5382
|
-
const H = document.createElement("svg");
|
|
5383
|
-
H.setAttribute("width", "24"), H.setAttribute("height", "24"), H.setAttribute("viewBox", "0 0 24 24"), H.setAttribute("fill", "none"), H.setAttribute("xmlns", "http://www.w3.org/2000/svg"), H.innerHTML = `
|
|
5384
|
-
<path
|
|
5385
|
-
d="M12 1.40039C17.8537 1.40039 22.5996 6.14633 22.5996 12C22.5996 17.8537 17.8537 22.5996 12 22.5996C6.14633 22.5996 1.40039 17.8537 1.40039 12C1.40039 6.14633 6.14633 1.40039 12 1.40039ZM12 3.38086C7.24117 3.38086 3.38086 7.24117 3.38086 12C3.38086 16.7588 7.24117 20.6191 12 20.6191C16.7588 20.6191 20.6191 16.7588 20.6191 12C20.6191 7.24117 16.7588 3.38086 12 3.38086Z"
|
|
5386
|
-
fill="#1D963E"
|
|
5387
|
-
stroke="#1D963E"
|
|
5388
|
-
stroke-width="0.2"
|
|
5389
|
-
/>
|
|
5390
|
-
<path
|
|
5391
|
-
d="M16.0945 14.9672L12.7523 12.5508V6.75C12.7523 6.64687 12.668 6.5625 12.5648 6.5625H11.4375C11.3344 6.5625 11.25 6.64687 11.25 6.75V13.2047C11.25 13.2656 11.2781 13.3219 11.3273 13.357L15.2039 16.1836C15.2883 16.2445 15.4055 16.2258 15.4664 16.1437L16.1367 15.2297C16.1976 15.1429 16.1789 15.0258 16.0945 14.9672Z"
|
|
5392
|
-
fill="#1D963E"
|
|
5393
|
-
/>
|
|
5394
|
-
`, D.appendChild(H), c.appendChild(D);
|
|
5395
|
-
const P = document.createElement("div");
|
|
5396
|
-
P.className = [
|
|
5397
|
-
"wgt:p-6",
|
|
5398
|
-
"wgt:w-full",
|
|
5399
|
-
"wgt:flex",
|
|
5400
|
-
"wgt:flex-col",
|
|
5401
|
-
"wgt:gap-10",
|
|
5402
|
-
"wgt:shadow-[0px_2px_6px_0px_rgba(31,34,41,0.04)]"
|
|
5403
|
-
].join(" ");
|
|
5404
|
-
const m = document.createElement("div");
|
|
5405
|
-
m.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
|
|
5406
|
-
const d = document.createElement("h2");
|
|
5407
|
-
d.className = "wgt:text-xl wgt:font-semibold wgt:leading-6 wgt:text-black", d.innerText = a("orderInfo"), m.appendChild(d);
|
|
5408
|
-
const v = document.createElement("div");
|
|
5409
|
-
v.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
5410
|
-
const f = document.createElement("h4");
|
|
5411
|
-
f.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", f.innerText = a("provider");
|
|
5412
|
-
const r = document.createElement("img");
|
|
5413
|
-
g && g.logoUrl && (r.src = g.logoUrl, r.alt = g.name, r.className = "wgt:h-6 wgt:object-contain"), v.appendChild(f), v.appendChild(r), m.appendChild(v);
|
|
5414
|
-
const M = document.createElement("div");
|
|
5415
|
-
M.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
5416
|
-
const X = document.createElement("h4");
|
|
5417
|
-
X.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", X.innerText = a("subscriptionPackage");
|
|
5418
|
-
const k = document.createElement("span");
|
|
5419
|
-
k.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", k.innerText = A ? `${String(A == null ? void 0 : A.code)}` : "", M.appendChild(X), M.appendChild(k), m.appendChild(M);
|
|
5420
|
-
const R = document.createElement("div");
|
|
5421
|
-
R.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
5422
|
-
const T = document.createElement("h4");
|
|
5423
|
-
T.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", T.innerText = a("digitalSignaturePackage");
|
|
5424
|
-
const Y = document.createElement("span");
|
|
5425
|
-
if (Y.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", Y.innerText = E ? `${String(E == null ? void 0 : E.code)}` : "", R.appendChild(T), R.appendChild(Y), m.appendChild(R), n && n.length > 0) {
|
|
5426
|
-
const u = document.createElement("div");
|
|
5427
|
-
u.className = "wgt:w-full wgt:flex wgt:items-start wgt:justify-between wgt:gap-[0.5rem]";
|
|
5428
|
-
const l = document.createElement("h4");
|
|
5429
|
-
l.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", l.innerText = a("promotion");
|
|
5430
|
-
const L = document.createElement("div");
|
|
5431
|
-
L.className = "wgt:flex wgt:items-center wgt:justify-end wgt:flex-wrap wgt:gap-2", n.forEach((N) => {
|
|
5432
|
-
const b = document.createElement("div");
|
|
5433
|
-
b.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", b.innerText = N, L.appendChild(b);
|
|
5434
|
-
}), u.appendChild(l), u.appendChild(L), m.appendChild(u);
|
|
5435
|
-
}
|
|
5436
|
-
const y = document.createElement("hr");
|
|
5437
|
-
m.appendChild(y);
|
|
5438
|
-
const K = document.createElement("div");
|
|
5439
|
-
K.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
|
|
5440
|
-
const z = document.createElement("h4");
|
|
5441
|
-
z.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", z.innerText = a("paymentAmount");
|
|
5442
|
-
const e = document.createElement("span");
|
|
5443
|
-
e.className = "wgt:text-2xl wgt:font-bold wgt:leading-6 wgt:text-[#ED1C24]", e.innerText = Q.toLocaleString("vi-VN") + " VND", K.appendChild(z), K.appendChild(e), m.appendChild(K), P.appendChild(m);
|
|
5444
|
-
const w = Ig({
|
|
5445
|
-
title: a("cancelTransaction"),
|
|
5446
|
-
className: "wgt:bg-transparent wgt:border wgt:border-primary wgt:text-primary wgt:hover:bg-transparent",
|
|
5447
|
-
handleClick: () => {
|
|
5448
|
-
h && _A(h);
|
|
5449
|
-
const { container: u, open: l } = aB({
|
|
5450
|
-
message: a("transactionCanceled"),
|
|
5451
|
-
okLabel: a("ok"),
|
|
5452
|
-
onClose: () => V(null, null, function* () {
|
|
5453
|
-
i = 3600, _A(h), yield tC(B), typeof o == "function" && (yield o());
|
|
5454
|
-
}),
|
|
5455
|
-
preventClose: !0
|
|
5456
|
-
});
|
|
5457
|
-
c.appendChild(u), l();
|
|
5458
|
-
}
|
|
5459
|
-
});
|
|
5460
|
-
return P.appendChild(w), c.appendChild(P), window.addEventListener("beforeunload", () => V(null, null, function* () {
|
|
5461
|
-
h && _A(h), yield tC(B);
|
|
5462
|
-
})), {
|
|
5463
|
-
container: c,
|
|
5464
|
-
setSelectedProvider(u) {
|
|
5465
|
-
g = u, r.src = (u == null ? void 0 : u.logo) || "", r.alt = (u == null ? void 0 : u.name) || "";
|
|
5466
|
-
},
|
|
5467
|
-
setSelectedInvoicePackage(u) {
|
|
5468
|
-
A = u, k.innerText = u ? String(u.limit) : "";
|
|
5469
|
-
},
|
|
5470
|
-
setSelectedSignaturePackage(u) {
|
|
5471
|
-
E = u, Y.innerText = u ? String(E == null ? void 0 : E.name.split("-")[1]) : "";
|
|
5472
|
-
},
|
|
5473
|
-
setTotalAmountText(u) {
|
|
5474
|
-
Q = u, e.innerText = u;
|
|
5475
|
-
},
|
|
5476
|
-
resetCountdown() {
|
|
5477
|
-
i = 3600, F(), J();
|
|
5478
|
-
}
|
|
5479
|
-
};
|
|
5480
|
-
}
|
|
5481
|
-
const LE = 5;
|
|
5479
|
+
var OE = FE();
|
|
5480
|
+
const GE = /* @__PURE__ */ jC(OE), LE = 5;
|
|
5482
5481
|
function zE(I) {
|
|
5483
5482
|
return V(this, arguments, function* ({
|
|
5484
5483
|
onNext: g,
|
|
5485
5484
|
onPrev: A,
|
|
5486
5485
|
step: E,
|
|
5487
|
-
checkoutProps:
|
|
5486
|
+
checkoutProps: Q,
|
|
5488
5487
|
orderInfoProps: B,
|
|
5489
|
-
setOrderId:
|
|
5488
|
+
setOrderId: C,
|
|
5490
5489
|
theme: t = "ocb"
|
|
5491
5490
|
}) {
|
|
5492
|
-
let n = null, o = "",
|
|
5491
|
+
let n = null, o = "", h = null, i = (B == null ? void 0 : B.orderId) || null, c = !1, D = 0;
|
|
5493
5492
|
const s = document.createElement("div");
|
|
5494
5493
|
s.className = "wgt:flex wgt:flex-col wgt:gap-6 wgt:relative";
|
|
5495
5494
|
const {
|
|
@@ -5507,17 +5506,17 @@ function zE(I) {
|
|
|
5507
5506
|
accountName: "",
|
|
5508
5507
|
accountNumber: "",
|
|
5509
5508
|
bankName: ""
|
|
5510
|
-
},
|
|
5509
|
+
}, Q), {
|
|
5511
5510
|
instructions: d,
|
|
5512
5511
|
theme: t
|
|
5513
5512
|
}));
|
|
5514
5513
|
P.appendChild(v), H.appendChild(P);
|
|
5515
|
-
const { container: r, resetCountdown: M } =
|
|
5514
|
+
const { container: r, resetCountdown: M } = DE(bA(RA({}, B), {
|
|
5516
5515
|
qrData: null,
|
|
5517
5516
|
qrSrc: "",
|
|
5518
5517
|
selectedPromotions: (B == null ? void 0 : B.selectedPromotions) || [],
|
|
5519
5518
|
onResetToStep1: () => {
|
|
5520
|
-
B != null && B.onResetToStep1 && B.onResetToStep1(),
|
|
5519
|
+
B != null && B.onResetToStep1 && B.onResetToStep1(), jA(h);
|
|
5521
5520
|
}
|
|
5522
5521
|
}));
|
|
5523
5522
|
H.appendChild(r), s.appendChild(H);
|
|
@@ -5528,12 +5527,12 @@ function zE(I) {
|
|
|
5528
5527
|
title: a("back"),
|
|
5529
5528
|
className: "wgt:bg-transparent wgt:!text-primary wgt:hover:bg-transparent wgt:underline",
|
|
5530
5529
|
handleClick: () => {
|
|
5531
|
-
A && (A(),
|
|
5530
|
+
A && (A(), jA(h));
|
|
5532
5531
|
}
|
|
5533
5532
|
});
|
|
5534
5533
|
X.appendChild(k), s.appendChild(X);
|
|
5535
5534
|
function R() {
|
|
5536
|
-
n = null, o = "", i = null,
|
|
5535
|
+
n = null, o = "", i = null, c = !1, D = 0, B != null && B.onResetToStep1 && B.onResetToStep1();
|
|
5537
5536
|
}
|
|
5538
5537
|
function T() {
|
|
5539
5538
|
return V(this, null, function* () {
|
|
@@ -5552,7 +5551,7 @@ function zE(I) {
|
|
|
5552
5551
|
packages: e.packages,
|
|
5553
5552
|
promotionCodes: e.promotionCodes
|
|
5554
5553
|
})).orderId;
|
|
5555
|
-
N !== i && (i = N,
|
|
5554
|
+
N !== i && (i = N, C(N), yield Y(N), M());
|
|
5556
5555
|
} catch (L) {
|
|
5557
5556
|
console.error("Error creating order:", L), Qg(a("errorCreatingOrder") || "Failed to create order");
|
|
5558
5557
|
return;
|
|
@@ -5564,18 +5563,17 @@ function zE(I) {
|
|
|
5564
5563
|
function Y(e) {
|
|
5565
5564
|
return V(this, null, function* () {
|
|
5566
5565
|
var w, u, l, L;
|
|
5567
|
-
if (
|
|
5566
|
+
if (c) {
|
|
5568
5567
|
console.log("Already fetching QR data, skipping...");
|
|
5569
5568
|
return;
|
|
5570
5569
|
}
|
|
5571
|
-
|
|
5570
|
+
c = !0, F();
|
|
5572
5571
|
try {
|
|
5573
5572
|
n = yield wQ({
|
|
5574
|
-
token: B == null ? void 0 : B.token,
|
|
5575
5573
|
orderId: e != null ? e : B == null ? void 0 : B.orderId,
|
|
5576
5574
|
amount: B == null ? void 0 : B.totalAmountText,
|
|
5577
5575
|
baseURL: mQ(t)
|
|
5578
|
-
}), o = yield
|
|
5576
|
+
}), o = yield GE.toDataURL(n.qr_string, {
|
|
5579
5577
|
errorCorrectionLevel: "H",
|
|
5580
5578
|
margin: 1,
|
|
5581
5579
|
width: 200,
|
|
@@ -5592,8 +5590,8 @@ function zE(I) {
|
|
|
5592
5590
|
bankName: (n == null ? void 0 : n.bank_code) || ""
|
|
5593
5591
|
}), z();
|
|
5594
5592
|
} catch (N) {
|
|
5595
|
-
if (((u = (w = N.response) == null ? void 0 : w.data) == null ? void 0 : u.error_code) === "BILL_ID_EXISTED") {
|
|
5596
|
-
if (console.log("Bill ID existed, recalling createOrder..."),
|
|
5593
|
+
if (console.log("🚀 ~ error:", N), ((u = (w = N.response) == null ? void 0 : w.data) == null ? void 0 : u.error_code) === "BILL_ID_EXISTED") {
|
|
5594
|
+
if (console.log("Bill ID existed, recalling createOrder..."), c = !1, D++, D >= LE) {
|
|
5597
5595
|
Qg(a("errorQRGeneration"), {
|
|
5598
5596
|
okLabel: a("ok"),
|
|
5599
5597
|
onClose: () => {
|
|
@@ -5626,7 +5624,7 @@ function zE(I) {
|
|
|
5626
5624
|
}
|
|
5627
5625
|
);
|
|
5628
5626
|
} finally {
|
|
5629
|
-
J(),
|
|
5627
|
+
J(), c = !1;
|
|
5630
5628
|
}
|
|
5631
5629
|
});
|
|
5632
5630
|
}
|
|
@@ -5636,14 +5634,14 @@ function zE(I) {
|
|
|
5636
5634
|
y = !navigator.onLine;
|
|
5637
5635
|
}
|
|
5638
5636
|
function z() {
|
|
5639
|
-
|
|
5637
|
+
h && jA(h), h = setInterval(() => V(null, null, function* () {
|
|
5640
5638
|
var e, w;
|
|
5641
5639
|
try {
|
|
5642
5640
|
const u = yield CE(i);
|
|
5643
5641
|
if (u.paymentStatus === "pending")
|
|
5644
5642
|
return;
|
|
5645
5643
|
const l = u.paymentStatus === "paid" ? a("paymentSuccess") : a("paymentFailed");
|
|
5646
|
-
|
|
5644
|
+
jA(h);
|
|
5647
5645
|
const L = aB({
|
|
5648
5646
|
message: l,
|
|
5649
5647
|
okLabel: "OK",
|
|
@@ -5663,26 +5661,26 @@ function zE(I) {
|
|
|
5663
5661
|
});
|
|
5664
5662
|
},
|
|
5665
5663
|
isOffline: y
|
|
5666
|
-
}) : ((e = u.response) == null ? void 0 : e.status) === 404 ? Qg(a("errorOrderNotFound"), {
|
|
5664
|
+
}) : ((e = u.response) == null ? void 0 : e.status) === 404 ? (Qg(a("errorOrderNotFound"), {
|
|
5667
5665
|
okLabel: a("tryAgain"),
|
|
5668
5666
|
onClose: function() {
|
|
5669
5667
|
return V(this, null, function* () {
|
|
5670
5668
|
yield T();
|
|
5671
5669
|
});
|
|
5672
5670
|
}
|
|
5673
|
-
}) : ((w = u.response) == null ? void 0 : w.status) === 410 ? Qg(a("paymentTimeoutMessage"), {
|
|
5671
|
+
}), jA(h)) : ((w = u.response) == null ? void 0 : w.status) === 410 ? (Qg(a("paymentTimeoutMessage"), {
|
|
5674
5672
|
okLabel: a("tryAgain"),
|
|
5675
5673
|
onClose: function() {
|
|
5676
5674
|
return V(this, null, function* () {
|
|
5677
5675
|
yield T();
|
|
5678
5676
|
});
|
|
5679
5677
|
}
|
|
5680
|
-
}) : z();
|
|
5678
|
+
}), jA(h)) : z();
|
|
5681
5679
|
}
|
|
5682
|
-
}), 5e3), AQ(
|
|
5680
|
+
}), 5e3), AQ(h);
|
|
5683
5681
|
}
|
|
5684
5682
|
return window.addEventListener("online", K), window.addEventListener("offline", K), window.addEventListener("beforeunload", function() {
|
|
5685
|
-
|
|
5683
|
+
h && jA(h);
|
|
5686
5684
|
}), { container: s };
|
|
5687
5685
|
});
|
|
5688
5686
|
}
|
|
@@ -5690,9 +5688,9 @@ function NE({
|
|
|
5690
5688
|
orderId: g,
|
|
5691
5689
|
onPrev: A,
|
|
5692
5690
|
onReturnHome: E,
|
|
5693
|
-
theme:
|
|
5691
|
+
theme: Q,
|
|
5694
5692
|
settingUrl: B,
|
|
5695
|
-
provider:
|
|
5693
|
+
provider: C
|
|
5696
5694
|
}) {
|
|
5697
5695
|
if (g) {
|
|
5698
5696
|
const u = new URL(window.location);
|
|
@@ -5706,16 +5704,16 @@ function NE({
|
|
|
5706
5704
|
n.className = "wgt:text-sm wgt:font-semibold wgt:text-text-black", n.innerText = a("confirmationTitle"), I.appendChild(n);
|
|
5707
5705
|
const o = document.createElement("div");
|
|
5708
5706
|
o.className = "wgt:flex wgt:items-center wgt:gap-4", I.appendChild(o);
|
|
5709
|
-
const
|
|
5710
|
-
|
|
5707
|
+
const h = document.createElement("div");
|
|
5708
|
+
h.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", h.innerText = "1", o.appendChild(h);
|
|
5711
5709
|
const i = document.createElement("p");
|
|
5712
5710
|
i.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", i.innerText = a("notice1"), o.appendChild(i);
|
|
5713
|
-
const
|
|
5714
|
-
|
|
5711
|
+
const c = document.createElement("div");
|
|
5712
|
+
c.className = "wgt:flex wgt:items-start wgt:gap-4", I.appendChild(c);
|
|
5715
5713
|
const D = document.createElement("div");
|
|
5716
|
-
D.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", D.innerText = "2",
|
|
5714
|
+
D.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", D.innerText = "2", c.appendChild(D);
|
|
5717
5715
|
const s = document.createElement("div");
|
|
5718
|
-
s.className = "wgt:flex wgt:flex-col wgt:gap-2",
|
|
5716
|
+
s.className = "wgt:flex wgt:flex-col wgt:gap-2", c.appendChild(s);
|
|
5719
5717
|
const q = document.createElement("p");
|
|
5720
5718
|
q.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", q.innerText = a("notice2"), s.appendChild(q);
|
|
5721
5719
|
const F = document.createElement("div");
|
|
@@ -5742,7 +5740,7 @@ function NE({
|
|
|
5742
5740
|
/>
|
|
5743
5741
|
</svg>
|
|
5744
5742
|
`, J.appendChild(H);
|
|
5745
|
-
const P = eQ(eB(),
|
|
5743
|
+
const P = eQ(eB(), Q, C), m = document.createElement("span");
|
|
5746
5744
|
m.innerHTML = `${a("hotlineDomestic")} <b>${(P == null ? void 0 : P.hotline) || ""}</b> ${a("hotlineDesc")} `, J.appendChild(m);
|
|
5747
5745
|
const d = document.createElement("div");
|
|
5748
5746
|
d.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", F.appendChild(d);
|
|
@@ -5796,7 +5794,7 @@ function NE({
|
|
|
5796
5794
|
const K = document.createElement("div");
|
|
5797
5795
|
K.className = "wgt:w-5 wgt:h-5 wgt:flex wgt:items-center wgt:justify-center", K.innerHTML = `
|
|
5798
5796
|
<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5799
|
-
<path d="M3.55534 9.25979C3.21016 9.26076 2.87232 9.35944 2.58089 9.5444C2.28945 9.72937 2.05634 9.99306 1.90853 10.305C1.76071 10.6169 1.70422 10.9643 1.74561 11.307C1.78699 11.6497 1.92455 11.9736 2.14238 12.2414L6.78584 17.9296C6.9514 18.1352 7.16362 18.2983 7.40488 18.4054C7.64614 18.5125 7.90947 18.5605 8.17299 18.5454C8.73661 18.5151 9.24545 18.2136 9.56988 17.7179L19.2155 2.18356C19.2171 2.18099 19.2188 2.17841 19.2205 2.17587C19.311 2.03691 19.2816 1.76152 19.0948 1.58852C19.0435 1.54102 18.983 1.50452 18.917 1.48127C18.8511 1.45803 18.7811 1.44854 18.7113 1.45338C18.6415 1.45822 18.5735 1.47729 18.5114 1.50941C18.4493 1.54154 18.3944 1.58604 18.3501 1.64018C18.3466 1.64444 18.3431 1.64863 18.3394 1.65276L8.61164 12.6437C8.57463 12.6855 8.52967 12.7196 8.47939 12.7439C8.4291 12.7682 8.37448 12.7822 8.31871 12.7852C8.26294 12.7883 8.20713 12.7802 8.15451 12.7614C8.1019 12.7427 8.05353 12.7137 8.01222 12.6761L4.78376 9.73818C4.44846 9.43081 4.01021 9.26014 3.55534 9.25979Z" fill="${
|
|
5797
|
+
<path d="M3.55534 9.25979C3.21016 9.26076 2.87232 9.35944 2.58089 9.5444C2.28945 9.72937 2.05634 9.99306 1.90853 10.305C1.76071 10.6169 1.70422 10.9643 1.74561 11.307C1.78699 11.6497 1.92455 11.9736 2.14238 12.2414L6.78584 17.9296C6.9514 18.1352 7.16362 18.2983 7.40488 18.4054C7.64614 18.5125 7.90947 18.5605 8.17299 18.5454C8.73661 18.5151 9.24545 18.2136 9.56988 17.7179L19.2155 2.18356C19.2171 2.18099 19.2188 2.17841 19.2205 2.17587C19.311 2.03691 19.2816 1.76152 19.0948 1.58852C19.0435 1.54102 18.983 1.50452 18.917 1.48127C18.8511 1.45803 18.7811 1.44854 18.7113 1.45338C18.6415 1.45822 18.5735 1.47729 18.5114 1.50941C18.4493 1.54154 18.3944 1.58604 18.3501 1.64018C18.3466 1.64444 18.3431 1.64863 18.3394 1.65276L8.61164 12.6437C8.57463 12.6855 8.52967 12.7196 8.47939 12.7439C8.4291 12.7682 8.37448 12.7822 8.31871 12.7852C8.26294 12.7883 8.20713 12.7802 8.15451 12.7614C8.1019 12.7427 8.05353 12.7137 8.01222 12.6761L4.78376 9.73818C4.44846 9.43081 4.01021 9.26014 3.55534 9.25979Z" fill="${Q === "ocb" ? "#008c44" : "#1e2a7b"}"
|
|
5800
5798
|
</svg>
|
|
5801
5799
|
|
|
5802
5800
|
`;
|
|
@@ -5870,12 +5868,12 @@ function ZE() {
|
|
|
5870
5868
|
const E = document.createElement("div");
|
|
5871
5869
|
return E.className = "wgt:flex-1 wgt:min-h-0", A.appendChild(E), g.appendChild(A), {
|
|
5872
5870
|
container: g,
|
|
5873
|
-
setContent(
|
|
5874
|
-
E.replaceChildren(
|
|
5871
|
+
setContent(Q) {
|
|
5872
|
+
E.replaceChildren(Q);
|
|
5875
5873
|
}
|
|
5876
5874
|
};
|
|
5877
5875
|
}
|
|
5878
|
-
function GC(
|
|
5876
|
+
function GC(Q) {
|
|
5879
5877
|
return V(this, arguments, function* ({
|
|
5880
5878
|
orderId: g,
|
|
5881
5879
|
callbackUrl: A,
|
|
@@ -5883,10 +5881,10 @@ function GC(C) {
|
|
|
5883
5881
|
}) {
|
|
5884
5882
|
const B = document.createElement("div");
|
|
5885
5883
|
B.style.display = "flex", B.style.flexDirection = "column", B.style.gap = "0", B.style.width = "100%", B.style.height = "100%", B.style.minHeight = "0", window.matchMedia("(min-width: 640px)").matches && (B.style.gap = "1rem");
|
|
5886
|
-
let
|
|
5884
|
+
let C = "";
|
|
5887
5885
|
try {
|
|
5888
5886
|
const o = yield aQ({ orderId: g });
|
|
5889
|
-
|
|
5887
|
+
C = o && o.url ? o.url : "";
|
|
5890
5888
|
} catch (o) {
|
|
5891
5889
|
return console.error("Failed to fetch wireframe URL:", o), B.innerHTML = `
|
|
5892
5890
|
<div style="display: flex; align-items: center; justify-content: center; height: 100%; padding: 1rem;">
|
|
@@ -5899,7 +5897,7 @@ function GC(C) {
|
|
|
5899
5897
|
const t = document.createElement("div");
|
|
5900
5898
|
t.style.flex = "1", t.style.minHeight = "0", t.style.position = "relative", t.style.width = "100%";
|
|
5901
5899
|
const I = document.createElement("iframe");
|
|
5902
|
-
return I.src =
|
|
5900
|
+
return I.src = C, I.style.position = "absolute", I.style.top = "0", I.style.left = "0", I.style.width = "100%", I.style.height = "100%", I.style.borderRadius = "0", I.style.border = "0", window.matchMedia("(min-width: 640px)").matches && (I.style.borderRadius = "0.375rem"), I.loading = "lazy", I.allowFullscreen = !0, I.setAttribute("scrolling", "auto"), I.setAttribute("frameBorder", "0"), t.appendChild(I), B.appendChild(t), { container: B, cleanup: () => {
|
|
5903
5901
|
document.body.classList.remove("no-scroll"), I.classList.remove("block-interaction");
|
|
5904
5902
|
const o = document.getElementById("signature-popup-backdrop");
|
|
5905
5903
|
o && o.remove();
|
|
@@ -5907,19 +5905,19 @@ function GC(C) {
|
|
|
5907
5905
|
});
|
|
5908
5906
|
}
|
|
5909
5907
|
function $C(g, A) {
|
|
5910
|
-
const E = (A && A.includeHash) != null ? A.includeHash : !0,
|
|
5908
|
+
const E = (A && A.includeHash) != null ? A.includeHash : !0, Q = A && A.pollMs || 1e3;
|
|
5911
5909
|
let B = LC(E);
|
|
5912
|
-
function
|
|
5910
|
+
function C() {
|
|
5913
5911
|
const n = LC(E);
|
|
5914
5912
|
if (n !== B) {
|
|
5915
5913
|
const o = B;
|
|
5916
5914
|
B = n, g(n, o);
|
|
5917
5915
|
}
|
|
5918
5916
|
}
|
|
5919
|
-
window.addEventListener("popstate",
|
|
5920
|
-
const t = VE(
|
|
5921
|
-
return Promise.resolve().then(
|
|
5922
|
-
window.removeEventListener("popstate",
|
|
5917
|
+
window.addEventListener("popstate", C), E && window.addEventListener("hashchange", C);
|
|
5918
|
+
const t = VE(C), I = window.setInterval(C, Q);
|
|
5919
|
+
return Promise.resolve().then(C), function() {
|
|
5920
|
+
window.removeEventListener("popstate", C), E && window.removeEventListener("hashchange", C), t(), clearInterval(I);
|
|
5923
5921
|
};
|
|
5924
5922
|
}
|
|
5925
5923
|
function LC(g) {
|
|
@@ -5936,18 +5934,18 @@ function VE(g) {
|
|
|
5936
5934
|
};
|
|
5937
5935
|
}
|
|
5938
5936
|
history[A] = !0;
|
|
5939
|
-
function
|
|
5937
|
+
function Q() {
|
|
5940
5938
|
window.dispatchEvent(new Event("url-watcher:navigate")), g();
|
|
5941
5939
|
}
|
|
5942
|
-
var B = history.pushState,
|
|
5940
|
+
var B = history.pushState, C = history.replaceState;
|
|
5943
5941
|
return history.pushState = function() {
|
|
5944
5942
|
var t = B.apply(this, arguments);
|
|
5945
|
-
return
|
|
5943
|
+
return Q(), t;
|
|
5946
5944
|
}, history.replaceState = function() {
|
|
5947
|
-
var t =
|
|
5948
|
-
return
|
|
5945
|
+
var t = C.apply(this, arguments);
|
|
5946
|
+
return Q(), t;
|
|
5949
5947
|
}, function() {
|
|
5950
|
-
history.pushState = B, history.replaceState =
|
|
5948
|
+
history.pushState = B, history.replaceState = C;
|
|
5951
5949
|
try {
|
|
5952
5950
|
delete history[A];
|
|
5953
5951
|
} catch (I) {
|
|
@@ -5959,7 +5957,7 @@ let Rg = /* @__PURE__ */ new Set();
|
|
|
5959
5957
|
function AQ(g) {
|
|
5960
5958
|
g && Rg.add(g);
|
|
5961
5959
|
}
|
|
5962
|
-
function
|
|
5960
|
+
function jA(g) {
|
|
5963
5961
|
g && (Rg.delete(g), window.clearInterval(g));
|
|
5964
5962
|
}
|
|
5965
5963
|
function WE() {
|
|
@@ -5967,7 +5965,7 @@ function WE() {
|
|
|
5967
5965
|
g && window.clearInterval(g);
|
|
5968
5966
|
}), Rg.clear();
|
|
5969
5967
|
}
|
|
5970
|
-
function gI(g, A, E,
|
|
5968
|
+
function gI(g, A, E, Q, B) {
|
|
5971
5969
|
return V(this, null, function* () {
|
|
5972
5970
|
const t = [
|
|
5973
5971
|
{ name: "M-Invoice", route: "m-invoice", logoUrl: oQ },
|
|
@@ -5983,9 +5981,9 @@ function gI(g, A, E, C, B) {
|
|
|
5983
5981
|
let n = sQ({
|
|
5984
5982
|
steps: I(),
|
|
5985
5983
|
currentStep: 1
|
|
5986
|
-
}), { container: o, setStep:
|
|
5984
|
+
}), { container: o, setStep: h, setContent: i } = n;
|
|
5987
5985
|
g.dataset.theme = B || "default", g.classList.add("wgt:mx-auto", "wgt:@container"), g.appendChild(o);
|
|
5988
|
-
let
|
|
5986
|
+
let c = 1, D = t[0], s = {
|
|
5989
5987
|
eInvoiceRegistration: {
|
|
5990
5988
|
taxAuthorityCode: "",
|
|
5991
5989
|
invoiceSymbol: "",
|
|
@@ -5994,7 +5992,7 @@ function gI(g, A, E, C, B) {
|
|
|
5994
5992
|
organization: {
|
|
5995
5993
|
name: "",
|
|
5996
5994
|
address: "",
|
|
5997
|
-
taxCode: (
|
|
5995
|
+
taxCode: (Q == null ? void 0 : Q.taxCode) || "",
|
|
5998
5996
|
taxAuthority: ""
|
|
5999
5997
|
},
|
|
6000
5998
|
// digitalSignaturePackageCode: "",
|
|
@@ -6035,7 +6033,7 @@ function gI(g, A, E, C, B) {
|
|
|
6035
6033
|
organization: {
|
|
6036
6034
|
name: "",
|
|
6037
6035
|
address: "",
|
|
6038
|
-
taxCode: (
|
|
6036
|
+
taxCode: (Q == null ? void 0 : Q.taxCode) || "",
|
|
6039
6037
|
taxAuthority: ""
|
|
6040
6038
|
},
|
|
6041
6039
|
contactPerson: {
|
|
@@ -6068,7 +6066,7 @@ function gI(g, A, E, C, B) {
|
|
|
6068
6066
|
}, q = null, F = null, J = null, H = null, P = 0, v = null;
|
|
6069
6067
|
}
|
|
6070
6068
|
function r() {
|
|
6071
|
-
f(),
|
|
6069
|
+
f(), c = 1, h(c, I()), k(c);
|
|
6072
6070
|
}
|
|
6073
6071
|
function M() {
|
|
6074
6072
|
typeof window != "undefined" && window.scrollTo({
|
|
@@ -6079,7 +6077,7 @@ function gI(g, A, E, C, B) {
|
|
|
6079
6077
|
}
|
|
6080
6078
|
function X() {
|
|
6081
6079
|
return V(this, null, function* () {
|
|
6082
|
-
n.updateTitle && n.updateTitle(), n.updateSteps && n.updateSteps(I()), yield k(
|
|
6080
|
+
n.updateTitle && n.updateTitle(), n.updateSteps && n.updateSteps(I()), yield k(c);
|
|
6083
6081
|
});
|
|
6084
6082
|
}
|
|
6085
6083
|
function k(y) {
|
|
@@ -6095,7 +6093,7 @@ function gI(g, A, E, C, B) {
|
|
|
6095
6093
|
},
|
|
6096
6094
|
formProps: {
|
|
6097
6095
|
onSubmit: (z) => {
|
|
6098
|
-
s.eInvoiceRegistration = RA(RA({}, s.eInvoiceRegistration), z.eInvoiceRegistration), s.logo = z.logo || null, s.license = z.license || null, s.idCard = z.idCard || null, s.idCardBack = z.idCardBack || null, s.provider = D.route,
|
|
6096
|
+
s.eInvoiceRegistration = RA(RA({}, s.eInvoiceRegistration), z.eInvoiceRegistration), s.logo = z.logo || null, s.license = z.license || null, s.idCard = z.idCard || null, s.idCardBack = z.idCardBack || null, s.provider = D.route, c = 2, h(c, I()), k(c), M();
|
|
6099
6097
|
},
|
|
6100
6098
|
registrationData: s,
|
|
6101
6099
|
theme: B || "default",
|
|
@@ -6115,10 +6113,10 @@ function gI(g, A, E, C, B) {
|
|
|
6115
6113
|
} else if (y === 2) {
|
|
6116
6114
|
const { container: K } = yield eE({
|
|
6117
6115
|
onNext: () => V(null, null, function* () {
|
|
6118
|
-
|
|
6116
|
+
c = 3, h(c, I()), k(c), M();
|
|
6119
6117
|
}),
|
|
6120
6118
|
onPrev: () => {
|
|
6121
|
-
|
|
6119
|
+
c = 1, h(c, I()), k(c), M();
|
|
6122
6120
|
},
|
|
6123
6121
|
setSelectedInitPackage: (z) => {
|
|
6124
6122
|
F = z;
|
|
@@ -6156,10 +6154,10 @@ function gI(g, A, E, C, B) {
|
|
|
6156
6154
|
} else if (y === 3) {
|
|
6157
6155
|
const { container: K } = yield zE({
|
|
6158
6156
|
onNext: () => {
|
|
6159
|
-
|
|
6157
|
+
c = 4, h(c, I()), k(c), M();
|
|
6160
6158
|
},
|
|
6161
6159
|
onPrev: () => {
|
|
6162
|
-
|
|
6160
|
+
c = 2, h(c, I()), k(c), M();
|
|
6163
6161
|
},
|
|
6164
6162
|
step: 3,
|
|
6165
6163
|
checkoutProps: {
|
|
@@ -6169,7 +6167,6 @@ function gI(g, A, E, C, B) {
|
|
|
6169
6167
|
},
|
|
6170
6168
|
theme: B || "ocb",
|
|
6171
6169
|
orderInfoProps: {
|
|
6172
|
-
token: (C == null ? void 0 : C.accessToken) || "",
|
|
6173
6170
|
registrationData: s,
|
|
6174
6171
|
orderId: q || "",
|
|
6175
6172
|
selectedProvider: D || { name: "", logo: "" },
|
|
@@ -6178,7 +6175,7 @@ function gI(g, A, E, C, B) {
|
|
|
6178
6175
|
selectedPromotions: d,
|
|
6179
6176
|
totalAmountText: P,
|
|
6180
6177
|
onCancel: () => {
|
|
6181
|
-
|
|
6178
|
+
c = 2, h(c, I()), k(c), M();
|
|
6182
6179
|
},
|
|
6183
6180
|
onResetToStep1: r
|
|
6184
6181
|
},
|
|
@@ -6191,19 +6188,19 @@ function gI(g, A, E, C, B) {
|
|
|
6191
6188
|
const { container: K } = NE({
|
|
6192
6189
|
orderId: q || "",
|
|
6193
6190
|
onPrev: () => {
|
|
6194
|
-
|
|
6191
|
+
c = 3, h(c, I()), k(c), M();
|
|
6195
6192
|
},
|
|
6196
6193
|
onReturnHome: A || (() => {
|
|
6197
6194
|
}),
|
|
6198
6195
|
theme: B || "ocb",
|
|
6199
|
-
settingUrl: (
|
|
6196
|
+
settingUrl: (Q == null ? void 0 : Q.settingUrl) || "",
|
|
6200
6197
|
provider: D.route
|
|
6201
6198
|
});
|
|
6202
6199
|
i(K);
|
|
6203
6200
|
}
|
|
6204
6201
|
});
|
|
6205
6202
|
}
|
|
6206
|
-
yield k(
|
|
6203
|
+
yield k(c);
|
|
6207
6204
|
const R = {
|
|
6208
6205
|
rerender: X
|
|
6209
6206
|
};
|
|
@@ -6220,33 +6217,33 @@ function gI(g, A, E, C, B) {
|
|
|
6220
6217
|
return { destroy: Y };
|
|
6221
6218
|
});
|
|
6222
6219
|
}
|
|
6223
|
-
function BI(g, A, E,
|
|
6220
|
+
function BI(g, A, E, Q) {
|
|
6224
6221
|
return V(this, null, function* () {
|
|
6225
|
-
const { container: B, setContent:
|
|
6222
|
+
const { container: B, setContent: C } = ZE(), t = E == null ? void 0 : E.orderId, I = (E == null ? void 0 : E.callbackUrl) || `${window.location.origin}/dashboard`, { container: n } = yield GC({
|
|
6226
6223
|
orderId: t,
|
|
6227
6224
|
callbackUrl: I,
|
|
6228
|
-
onCompleteSignature:
|
|
6225
|
+
onCompleteSignature: Q
|
|
6229
6226
|
});
|
|
6230
|
-
|
|
6227
|
+
C(n), g.appendChild(B);
|
|
6231
6228
|
const o = {
|
|
6232
6229
|
rerender: () => V(null, null, function* () {
|
|
6233
|
-
const { container:
|
|
6230
|
+
const { container: c } = yield GC({
|
|
6234
6231
|
orderId: t,
|
|
6235
6232
|
callbackUrl: I,
|
|
6236
|
-
onCompleteSignature:
|
|
6233
|
+
onCompleteSignature: Q
|
|
6237
6234
|
});
|
|
6238
|
-
|
|
6235
|
+
C(c);
|
|
6239
6236
|
})
|
|
6240
6237
|
};
|
|
6241
6238
|
NC(o);
|
|
6242
|
-
const
|
|
6243
|
-
(
|
|
6239
|
+
const h = $C(
|
|
6240
|
+
(c, D) => {
|
|
6244
6241
|
i();
|
|
6245
6242
|
},
|
|
6246
6243
|
{ includeHash: !1 }
|
|
6247
6244
|
);
|
|
6248
6245
|
function i() {
|
|
6249
|
-
bC(o),
|
|
6246
|
+
bC(o), h(), g && g.parentNode && (g.innerHTML = "");
|
|
6250
6247
|
}
|
|
6251
6248
|
return { destroy: i };
|
|
6252
6249
|
});
|
|
@@ -6256,5 +6253,5 @@ export {
|
|
|
6256
6253
|
gI as InvoiceRegisterWidget,
|
|
6257
6254
|
AQ as registerWidgetInterval,
|
|
6258
6255
|
WE as stopAllIntervals,
|
|
6259
|
-
|
|
6256
|
+
jA as unregisterWidgetInterval
|
|
6260
6257
|
};
|