@invoice-sdk/widget 1.122.0 → 1.123.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-C33oyF2G.js → index-BfJuM4Fb.js} +3 -3
- package/dist/index-DaudD8xC.js +874 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +94 -94
- package/dist/{loading-DsaqDRpJ.js → loading-COG4W_q5.js} +2 -2
- package/dist/{widget-CFs31gd0.js → widget-DHOVLCTa.js} +2 -2
- package/dist/widget.css +1 -1
- package/package.json +1 -1
- package/dist/index-Ccj7rr4H.js +0 -852
|
@@ -0,0 +1,874 @@
|
|
|
1
|
+
var re = Object.defineProperty;
|
|
2
|
+
var _ = Object.getOwnPropertySymbols;
|
|
3
|
+
var ae = Object.prototype.hasOwnProperty, se = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var $ = (r, e, t) => e in r ? re(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, O = (r, e) => {
|
|
5
|
+
for (var t in e || (e = {}))
|
|
6
|
+
ae.call(e, t) && $(r, t, e[t]);
|
|
7
|
+
if (_)
|
|
8
|
+
for (var t of _(e))
|
|
9
|
+
se.call(e, t) && $(r, t, e[t]);
|
|
10
|
+
return r;
|
|
11
|
+
};
|
|
12
|
+
var W = (r, e, t) => new Promise((n, l) => {
|
|
13
|
+
var d = (c) => {
|
|
14
|
+
try {
|
|
15
|
+
g(t.next(c));
|
|
16
|
+
} catch (v) {
|
|
17
|
+
l(v);
|
|
18
|
+
}
|
|
19
|
+
}, s = (c) => {
|
|
20
|
+
try {
|
|
21
|
+
g(t.throw(c));
|
|
22
|
+
} catch (v) {
|
|
23
|
+
l(v);
|
|
24
|
+
}
|
|
25
|
+
}, g = (c) => c.done ? n(c.value) : Promise.resolve(c.value).then(d, s);
|
|
26
|
+
g((t = t.apply(r, e)).next());
|
|
27
|
+
});
|
|
28
|
+
import { c as I, f as te, e as oe, b as le, o as ne, s as de } from "./loading-COG4W_q5.js";
|
|
29
|
+
import { t as i, c as J, j as ce } from "./index-BfJuM4Fb.js";
|
|
30
|
+
function D(r) {
|
|
31
|
+
const e = r.trim();
|
|
32
|
+
return e ? e.length < 2 || e.length > 250 ? { valid: !1, error: i("length_2_250") } : /[<>:"\/\\|?*@#$%!^]/.test(e) ? { valid: !1, error: i("invalid_characters") } : { valid: !0 } : { valid: !1, error: i("required_name") };
|
|
33
|
+
}
|
|
34
|
+
function Q(r, e = !1) {
|
|
35
|
+
const t = String(r != null ? r : "").trim();
|
|
36
|
+
return t ? t.length < 2 || t.length > 250 ? { valid: !1, error: i("length_2_250") } : /[<>:"\\|?*@#$%!^]/.test(t) ? { valid: !1, error: i("invalid_characters") } : { valid: !0 } : e ? { valid: !1, error: i("required_address") } : { valid: !0 };
|
|
37
|
+
}
|
|
38
|
+
function z(r) {
|
|
39
|
+
const e = r.trim();
|
|
40
|
+
return e ? e.length < 6 || e.length > 254 ? { valid: !1, error: i("email_length") } : /[<>:"\/\\|?*#$%!\s]/.test(e) ? { valid: !1, error: i("email_invalid_format") } : /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e) ? e.includes("@@") ? { valid: !1, error: i("email_invalid_format") } : { valid: !0 } : { valid: !1, error: i("email_invalid_format") } : { valid: !1, error: i("required_email") };
|
|
41
|
+
}
|
|
42
|
+
function ee(r, e = !1) {
|
|
43
|
+
const t = r.trim();
|
|
44
|
+
if (!t)
|
|
45
|
+
return e ? { valid: !1, error: i("required_phone") } : { valid: !0 };
|
|
46
|
+
const n = t.replace(/\s/g, "");
|
|
47
|
+
if (/[<>:"\/\\|?*@#$%!A-Za-z]/.test(n))
|
|
48
|
+
return { valid: !1, error: i("phone_invalid") };
|
|
49
|
+
const d = /^0\d{9}$/, s = /^\+84\d{9}$/;
|
|
50
|
+
return !d.test(n) && !s.test(n) ? { valid: !1, error: i("phone_invalid_format") } : { valid: !0 };
|
|
51
|
+
}
|
|
52
|
+
function G(r) {
|
|
53
|
+
const e = r.trim();
|
|
54
|
+
if (!e) return { valid: !1, error: i("required_tax_code") };
|
|
55
|
+
const t = e.replace(/\s/g, "");
|
|
56
|
+
if (/[<>:"\/\\|?*@#$%!A-Za-z\s]/.test(t))
|
|
57
|
+
return { valid: !1, error: i("tax_code_invalid") };
|
|
58
|
+
if ((t.match(/-/g) || []).length > 1)
|
|
59
|
+
return { valid: !1, error: i("tax_code_invalid_format") };
|
|
60
|
+
const d = /^\d{10}$/, s = /^\d{10}-\d{3}$/;
|
|
61
|
+
return !d.test(t) && !s.test(t) ? { valid: !1, error: i("tax_code_invalid_format") } : { valid: !0 };
|
|
62
|
+
}
|
|
63
|
+
function ge({ defaultValues: r = {}, onChange: e } = {}) {
|
|
64
|
+
const t = {
|
|
65
|
+
representativeName: r.representativeName || "",
|
|
66
|
+
buyerAddress: r.buyerAddress || "",
|
|
67
|
+
email: r.email || ""
|
|
68
|
+
// phone: defaultValues.phone || '',
|
|
69
|
+
}, n = document.createElement("div");
|
|
70
|
+
n.className = "wgt:space-y-2";
|
|
71
|
+
function l() {
|
|
72
|
+
typeof e == "function" && e(O({}, t));
|
|
73
|
+
}
|
|
74
|
+
function d({ label: P, required: o, name: a, type: m = "text", placeholder: C }) {
|
|
75
|
+
const V = document.createElement("div");
|
|
76
|
+
V.className = "";
|
|
77
|
+
const H = document.createElement("label");
|
|
78
|
+
H.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950", H.htmlFor = a, H.innerHTML = o ? `${P} <span class="wgt:text-semantic-error wgt:text-[#ED1C24]">*</span>` : P;
|
|
79
|
+
const u = document.createElement("input");
|
|
80
|
+
u.id = a, u.name = a, u.type = m, u.placeholder = C || "", u.className = "wgt:w-full wgt:rounded-lg wgt:border wgt:border-[#E4E7EC] wgt:mt-2 wgt:bg-white wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:text-strong-950 focus:wgt:outline-none focus:wgt:border-primary focus:wgt:ring-1 focus:wgt:ring-primary", u.value = t[a] || "";
|
|
81
|
+
const T = document.createElement("div");
|
|
82
|
+
return T.className = "wgt:text-xs wgt:text-[#ED1C24] wgt:mt-1 wgt:hidden", T.setAttribute("data-error-for", a), u.addEventListener("input", () => {
|
|
83
|
+
t[a] = u.value, u.classList.remove(
|
|
84
|
+
"wgt:border-semantic-error",
|
|
85
|
+
"wgt:bg-semantic-error-50"
|
|
86
|
+
), T.classList.add("wgt:hidden"), l();
|
|
87
|
+
}), u.addEventListener("blur", () => {
|
|
88
|
+
let A;
|
|
89
|
+
switch (a) {
|
|
90
|
+
case "representativeName":
|
|
91
|
+
A = D(u.value);
|
|
92
|
+
break;
|
|
93
|
+
case "buyerAddress":
|
|
94
|
+
A = Q(u.value);
|
|
95
|
+
break;
|
|
96
|
+
case "email":
|
|
97
|
+
A = z(u.value);
|
|
98
|
+
break;
|
|
99
|
+
default:
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
!A.valid && A.error && (u.classList.add(
|
|
103
|
+
"wgt:border-semantic-error",
|
|
104
|
+
"wgt:bg-semantic-error-50"
|
|
105
|
+
), T.textContent = A.error, T.classList.remove("wgt:hidden"));
|
|
106
|
+
}), V.appendChild(H), V.appendChild(u), V.appendChild(T), { field: V, input: u, errorEl: T };
|
|
107
|
+
}
|
|
108
|
+
const {
|
|
109
|
+
field: s,
|
|
110
|
+
input: g,
|
|
111
|
+
errorEl: c
|
|
112
|
+
} = d({
|
|
113
|
+
label: i("representativeName"),
|
|
114
|
+
required: !0,
|
|
115
|
+
name: "representativeName",
|
|
116
|
+
placeholder: i("representativeName_input")
|
|
117
|
+
}), { field: v, errorEl: x } = d({
|
|
118
|
+
label: i("buyerAddress"),
|
|
119
|
+
required: !1,
|
|
120
|
+
name: "buyerAddress",
|
|
121
|
+
placeholder: i("buyerAddress_input")
|
|
122
|
+
}), {
|
|
123
|
+
field: M,
|
|
124
|
+
input: b,
|
|
125
|
+
errorEl: w
|
|
126
|
+
} = d({
|
|
127
|
+
label: i("email"),
|
|
128
|
+
required: !0,
|
|
129
|
+
name: "email",
|
|
130
|
+
type: "email",
|
|
131
|
+
placeholder: i("email_input")
|
|
132
|
+
});
|
|
133
|
+
n.appendChild(s), n.appendChild(v), n.appendChild(M);
|
|
134
|
+
function p() {
|
|
135
|
+
let P = !0;
|
|
136
|
+
function o(C, V, H) {
|
|
137
|
+
C.classList.add(
|
|
138
|
+
"wgt:border-semantic-error",
|
|
139
|
+
"wgt:bg-semantic-error-50"
|
|
140
|
+
), H && V && (V.textContent = H, V.classList.remove("wgt:hidden")), P = !1;
|
|
141
|
+
}
|
|
142
|
+
const a = D(t.representativeName);
|
|
143
|
+
if (a.valid || o(g, c, a.error), t.buyerAddress.trim()) {
|
|
144
|
+
const C = Q(t.buyerAddress);
|
|
145
|
+
C.valid || o(
|
|
146
|
+
document.querySelector('input[name="buyerAddress"]'),
|
|
147
|
+
x,
|
|
148
|
+
C.error
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
const m = z(t.email);
|
|
152
|
+
return m.valid || o(b, w, m.error), P;
|
|
153
|
+
}
|
|
154
|
+
function k() {
|
|
155
|
+
return O({}, t);
|
|
156
|
+
}
|
|
157
|
+
return { container: n, getValues: k, validate: p };
|
|
158
|
+
}
|
|
159
|
+
function we({
|
|
160
|
+
defaultValues: r = {},
|
|
161
|
+
onChange: e,
|
|
162
|
+
onFetchByTaxCode: t
|
|
163
|
+
} = {}) {
|
|
164
|
+
const n = {
|
|
165
|
+
noTaxCode: !!r.noTaxCode,
|
|
166
|
+
taxCode: r.taxCode || "",
|
|
167
|
+
businessName: r.businessName || "",
|
|
168
|
+
representativeName: r.representativeName || "",
|
|
169
|
+
buyerAddress: r.buyerAddress || "",
|
|
170
|
+
// performerName: defaultValues.performerName || '',
|
|
171
|
+
email: r.email || "",
|
|
172
|
+
phone: r.phone || ""
|
|
173
|
+
}, l = document.createElement("div");
|
|
174
|
+
l.className = "wgt:space-y-2";
|
|
175
|
+
function d() {
|
|
176
|
+
typeof e == "function" && e(O({}, n));
|
|
177
|
+
}
|
|
178
|
+
function s({ label: h, required: L, name: f, type: K = "text", placeholder: U }) {
|
|
179
|
+
const X = document.createElement("div");
|
|
180
|
+
X.className = "";
|
|
181
|
+
const j = document.createElement("label");
|
|
182
|
+
j.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950", j.htmlFor = f, j.innerHTML = L ? `${h} <span class="wgt:text-[#ED1C24]">*</span>` : h;
|
|
183
|
+
const N = document.createElement("input");
|
|
184
|
+
N.id = f, N.name = f, N.type = K, N.placeholder = U || "", N.className = "wgt:w-full wgt:rounded-lg wgt:border wgt:border-[#E4E7EC] wgt:mt-2 wgt:bg-white wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:text-strong-950 focus:wgt:outline-none focus:wgt:border-primary focus:wgt:ring-1 focus:wgt:ring-primary", N.value = n[f] || "";
|
|
185
|
+
const B = document.createElement("div");
|
|
186
|
+
return B.className = "wgt:text-xs wgt:text-[#ED1C24] wgt:mt-1 wgt:hidden", B.setAttribute("data-error-for", f), N.addEventListener("input", () => {
|
|
187
|
+
n[f] = N.value, N.classList.remove(
|
|
188
|
+
"wgt:border-semantic-error",
|
|
189
|
+
"wgt:bg-semantic-error-50"
|
|
190
|
+
), B.classList.add("wgt:hidden"), d();
|
|
191
|
+
}), N.addEventListener("blur", () => {
|
|
192
|
+
if (!N.value.trim() && !L) return;
|
|
193
|
+
let R;
|
|
194
|
+
switch (f) {
|
|
195
|
+
case "businesName":
|
|
196
|
+
case "representativeName":
|
|
197
|
+
R = D(N.value);
|
|
198
|
+
break;
|
|
199
|
+
case "buyerAddress":
|
|
200
|
+
R = Q(N.value);
|
|
201
|
+
break;
|
|
202
|
+
case "email":
|
|
203
|
+
R = z(N.value);
|
|
204
|
+
break;
|
|
205
|
+
case "phone":
|
|
206
|
+
R = ee(N.value, !0);
|
|
207
|
+
break;
|
|
208
|
+
default:
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
!R.valid && R.error && (N.classList.add(
|
|
212
|
+
"wgt:border-semantic-error",
|
|
213
|
+
"wgt:bg-semantic-error-50"
|
|
214
|
+
), B.textContent = R.error, B.classList.remove("wgt:hidden"));
|
|
215
|
+
}), X.appendChild(j), X.appendChild(N), X.appendChild(B), { field: X, input: N, errorEl: B };
|
|
216
|
+
}
|
|
217
|
+
const g = document.createElement("label");
|
|
218
|
+
g.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:font-medium wgt:text-strong-950 wgt:text-sm";
|
|
219
|
+
const c = document.createElement("input");
|
|
220
|
+
c.type = "checkbox", c.className = "wgt:h-4 wgt:w-4 wgt:rounded wgt:border-[#E4E7EC] focus:wgt:outline-none focus:wgt:ring-primary", c.checked = n.noTaxCode;
|
|
221
|
+
const v = document.createElement("span");
|
|
222
|
+
v.textContent = i("business_noTaxCode"), v.className = "wgt:italic wgt:font-normal wgt:text-[14px] wgt:leading-[20px] wgt:tracking-[0px] wgt:align-middle wgt:text-[#525866]", v.style.fontFamily = "Inter, sans-serif", c.addEventListener("change", () => {
|
|
223
|
+
n.noTaxCode = c.checked, w.disabled = n.noTaxCode, k.disabled = n.noTaxCode, w.classList.remove(
|
|
224
|
+
"wgt:border-semantic-error",
|
|
225
|
+
"wgt:bg-semantic-error-50"
|
|
226
|
+
), p.classList.add("wgt:hidden"), d();
|
|
227
|
+
}), g.appendChild(c), g.appendChild(v);
|
|
228
|
+
const x = document.createElement("div");
|
|
229
|
+
x.className = "wgt:space-y-2";
|
|
230
|
+
const M = document.createElement("label");
|
|
231
|
+
M.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950 ", M.innerHTML = i("confirmation_popup_taxCode") + '<span class="wgt:text-[#ED1C24]">*</span>';
|
|
232
|
+
const b = document.createElement("div");
|
|
233
|
+
b.className = "wgt:flex wgt:gap-2 wgt:mt-2";
|
|
234
|
+
const w = document.createElement("input");
|
|
235
|
+
w.type = "text", w.name = "taxCode", w.placeholder = i("taxCode_input"), w.value = n.taxCode, w.className = "wgt:flex-1 wgt:rounded-lg wgt:border wgt:border-[#E4E7EC] wgt:bg-white wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:text-strong-950 focus:wgt:outline-none focus:wgt:border-primary focus:wgt:ring-1 focus:wgt:ring-primary";
|
|
236
|
+
const p = document.createElement("div");
|
|
237
|
+
p.className = "wgt:text-xs wgt:text-[#ED1C24] wgt:mt-1 wgt:hidden", w.addEventListener("input", () => {
|
|
238
|
+
n.taxCode = w.value, w.classList.remove(
|
|
239
|
+
"wgt:border-semantic-error",
|
|
240
|
+
"wgt:bg-semantic-error-50"
|
|
241
|
+
), p.classList.add("wgt:hidden"), d();
|
|
242
|
+
}), w.addEventListener("blur", () => {
|
|
243
|
+
if (n.noTaxCode || !w.value.trim()) return;
|
|
244
|
+
const h = G(w.value);
|
|
245
|
+
h.valid || (w.classList.add(
|
|
246
|
+
"wgt:border-semantic-error",
|
|
247
|
+
"wgt:bg-semantic-error-50"
|
|
248
|
+
), p.textContent = h.error, p.classList.remove("wgt:hidden"));
|
|
249
|
+
});
|
|
250
|
+
const k = I({
|
|
251
|
+
type: "button",
|
|
252
|
+
title: i("fetch_info"),
|
|
253
|
+
className: "wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:font-semibold wgt:rounded-lg wgt:flex-shrink-0 wgt:text-primary wgt:bg-white wgt:border wgt:border-primary",
|
|
254
|
+
handleClick: () => W(null, null, function* () {
|
|
255
|
+
if (n.noTaxCode || typeof t != "function")
|
|
256
|
+
return;
|
|
257
|
+
const h = String(n.taxCode || "").trim();
|
|
258
|
+
if (!h) {
|
|
259
|
+
w.classList.add(
|
|
260
|
+
"wgt:border-semantic-error",
|
|
261
|
+
"wgt:bg-semantic-error-50"
|
|
262
|
+
), p.textContent = "Vui lòng nhập MST", p.classList.remove("wgt:hidden");
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
const L = G(h);
|
|
266
|
+
if (!L.valid) {
|
|
267
|
+
w.classList.add(
|
|
268
|
+
"wgt:border-semantic-error",
|
|
269
|
+
"wgt:bg-semantic-error-50"
|
|
270
|
+
), p.textContent = L.error, p.classList.remove("wgt:hidden");
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
try {
|
|
274
|
+
k.disabled = !0;
|
|
275
|
+
const f = yield t(h, O({}, n));
|
|
276
|
+
if (!f || typeof f != "object") return;
|
|
277
|
+
f.businessName != null && (n.businessName = String(f.businessName || ""), o.value = n.businessName), f.representativeName != null && (n.representativeName = String(f.representativeName || ""), C.value = n.representativeName), f.buyerAddress != null && (n.buyerAddress = String(f.buyerAddress || ""), u.value = n.buyerAddress), d();
|
|
278
|
+
} catch (f) {
|
|
279
|
+
w.classList.add(
|
|
280
|
+
"wgt:border-semantic-error",
|
|
281
|
+
"wgt:bg-semantic-error-50"
|
|
282
|
+
), p.textContent = "Không tìm thấy thông tin MST", p.classList.remove("wgt:hidden");
|
|
283
|
+
} finally {
|
|
284
|
+
k.disabled = n.noTaxCode;
|
|
285
|
+
}
|
|
286
|
+
})
|
|
287
|
+
});
|
|
288
|
+
b.appendChild(w), b.appendChild(k), x.appendChild(M), x.appendChild(b), x.appendChild(p);
|
|
289
|
+
const {
|
|
290
|
+
field: P,
|
|
291
|
+
input: o,
|
|
292
|
+
errorEl: a
|
|
293
|
+
} = s({
|
|
294
|
+
label: i("businessName"),
|
|
295
|
+
required: !0,
|
|
296
|
+
name: "businessName",
|
|
297
|
+
placeholder: i("businessName_input")
|
|
298
|
+
}), {
|
|
299
|
+
field: m,
|
|
300
|
+
input: C,
|
|
301
|
+
errorEl: V
|
|
302
|
+
} = s({
|
|
303
|
+
label: i("representativeName"),
|
|
304
|
+
required: !0,
|
|
305
|
+
name: "representativeName",
|
|
306
|
+
placeholder: i("representativeName_input")
|
|
307
|
+
}), {
|
|
308
|
+
field: H,
|
|
309
|
+
input: u,
|
|
310
|
+
errorEl: T
|
|
311
|
+
} = s({
|
|
312
|
+
label: i("buyerAddress"),
|
|
313
|
+
required: !1,
|
|
314
|
+
name: "buyerAddress",
|
|
315
|
+
placeholder: i("buyerAddress_input")
|
|
316
|
+
}), {
|
|
317
|
+
field: A,
|
|
318
|
+
input: Z,
|
|
319
|
+
errorEl: F
|
|
320
|
+
} = s({
|
|
321
|
+
label: i("email"),
|
|
322
|
+
required: !0,
|
|
323
|
+
name: "email",
|
|
324
|
+
type: "email",
|
|
325
|
+
placeholder: i("email_input")
|
|
326
|
+
}), {
|
|
327
|
+
field: y,
|
|
328
|
+
input: E,
|
|
329
|
+
errorEl: S
|
|
330
|
+
} = s({
|
|
331
|
+
label: i("phone"),
|
|
332
|
+
required: !1,
|
|
333
|
+
name: "phone",
|
|
334
|
+
type: "tel",
|
|
335
|
+
placeholder: i("phone_input")
|
|
336
|
+
});
|
|
337
|
+
l.appendChild(g), l.appendChild(x), l.appendChild(P), l.appendChild(m), l.appendChild(H), l.appendChild(A), l.appendChild(y), w.disabled = n.noTaxCode, k.disabled = n.noTaxCode;
|
|
338
|
+
function q() {
|
|
339
|
+
let h = !0;
|
|
340
|
+
function L(X, j, N) {
|
|
341
|
+
X.classList.add(
|
|
342
|
+
"wgt:border-semantic-error",
|
|
343
|
+
"wgt:bg-semantic-error-50",
|
|
344
|
+
"wgt:mt-2"
|
|
345
|
+
), N && j && (j.textContent = N, j.classList.remove("wgt:hidden")), h = !1;
|
|
346
|
+
}
|
|
347
|
+
if (!n.noTaxCode) {
|
|
348
|
+
const X = G(n.taxCode);
|
|
349
|
+
X.valid || L(w, p, X.error);
|
|
350
|
+
}
|
|
351
|
+
const f = D(n.businessName);
|
|
352
|
+
f.valid || L(o, a, f.error);
|
|
353
|
+
const K = D(n.representativeName);
|
|
354
|
+
if (K.valid || L(C, V, K.error), n.buyerAddress.trim()) {
|
|
355
|
+
const X = Q(n.buyerAddress);
|
|
356
|
+
X.valid || L(u, T, X.error);
|
|
357
|
+
}
|
|
358
|
+
const U = z(n.email);
|
|
359
|
+
if (U.valid || L(Z, F, U.error), n.phone.trim()) {
|
|
360
|
+
const X = ee(n.phone, !0);
|
|
361
|
+
X.valid || L(E, S, X.error);
|
|
362
|
+
}
|
|
363
|
+
return h;
|
|
364
|
+
}
|
|
365
|
+
function Y() {
|
|
366
|
+
return O({}, n);
|
|
367
|
+
}
|
|
368
|
+
return { container: l, getValues: Y, validate: q };
|
|
369
|
+
}
|
|
370
|
+
function pe({
|
|
371
|
+
type: r,
|
|
372
|
+
data: e,
|
|
373
|
+
orderInfo: t,
|
|
374
|
+
theme: n,
|
|
375
|
+
onClose: l,
|
|
376
|
+
onConfirm: d
|
|
377
|
+
}) {
|
|
378
|
+
const s = document.createElement("div");
|
|
379
|
+
s.className = "wgt:fixed wgt:inset-0 wgt:flex wgt:items-center wgt:justify-center wgt:z-50 wgt:p-4", s.style.cssText = `
|
|
380
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
381
|
+
backdrop-filter: blur(4px);
|
|
382
|
+
`, n && s.setAttribute("data-theme", n);
|
|
383
|
+
const g = document.createElement("div");
|
|
384
|
+
g.className = "wgt:w-full wgt:max-w-md wgt:bg-white wgt:rounded-2xl wgt:shadow-xl wgt:max-h-[90vh] wgt:overflow-y-auto";
|
|
385
|
+
const c = document.createElement("div");
|
|
386
|
+
c.className = "wgt:px-6 wgt:pt-6 wgt:pb-4 wgt:space-y-2";
|
|
387
|
+
const v = document.createElement("h3");
|
|
388
|
+
v.className = "wgt:text-xl wgt:font-semibold wgt:text-center wgt:text-strong-950", v.textContent = i("confirmation_popup_title");
|
|
389
|
+
const x = document.createElement("p");
|
|
390
|
+
x.className = "wgt:text-sm wgt:text-center wgt:text-[#525866]", x.textContent = i("confirmation_popup_subtitle"), c.appendChild(v), c.appendChild(x), g.appendChild(c);
|
|
391
|
+
const M = document.createElement("div");
|
|
392
|
+
M.className = "wgt:px-6 wgt:pb-4";
|
|
393
|
+
const b = document.createElement("div");
|
|
394
|
+
b.className = "wgt:space-y-3 wgt:rounded-xl wgt:bg-weak-50 wgt:px-4 wgt:py-3";
|
|
395
|
+
function w(u, T, A) {
|
|
396
|
+
const Z = document.createElement("div");
|
|
397
|
+
Z.className = "wgt:flex wgt:items-start wgt:gap-3";
|
|
398
|
+
const F = document.createElement("span");
|
|
399
|
+
F.className = "wgt:text-primary wgt:flex-shrink-0", F.innerHTML = u;
|
|
400
|
+
const y = document.createElement("div");
|
|
401
|
+
y.className = "wgt:flex wgt:items-start wgt:justify-between wgt:flex-1 wgt:gap-2";
|
|
402
|
+
const E = document.createElement("span");
|
|
403
|
+
E.className = "wgt:text-sm wgt:text-[#525866] wgt:w-1/3", E.textContent = T;
|
|
404
|
+
const S = document.createElement("span");
|
|
405
|
+
return S.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:text-right wgt:w-2/3", S.textContent = A || "-", y.appendChild(E), y.appendChild(S), Z.appendChild(F), Z.appendChild(y), Z;
|
|
406
|
+
}
|
|
407
|
+
const p = '<svg class="wgt:w-4 wgt:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>', k = '<svg class="wgt:w-4 wgt:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" /></svg>', P = '<svg class="wgt:w-4 wgt:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>';
|
|
408
|
+
b.appendChild(
|
|
409
|
+
w(
|
|
410
|
+
p,
|
|
411
|
+
i("confirmation_popup_orderCode"),
|
|
412
|
+
t == null ? void 0 : t.billNo
|
|
413
|
+
)
|
|
414
|
+
), b.appendChild(
|
|
415
|
+
w(
|
|
416
|
+
k,
|
|
417
|
+
i("confirmation_popup_address"),
|
|
418
|
+
t == null ? void 0 : t.merchantAddress
|
|
419
|
+
)
|
|
420
|
+
), b.appendChild(
|
|
421
|
+
w(
|
|
422
|
+
P,
|
|
423
|
+
i("confirmation_popup_totalAmount"),
|
|
424
|
+
te(t == null ? void 0 : t.amount) + " VND"
|
|
425
|
+
)
|
|
426
|
+
), M.appendChild(b), g.appendChild(M);
|
|
427
|
+
const o = document.createElement("div");
|
|
428
|
+
o.className = "wgt:px-6 wgt:pb-6";
|
|
429
|
+
const a = document.createElement("div");
|
|
430
|
+
a.className = "wgt:space-y-3 wgt:rounded-xl wgt:border wgt:border-[#E1E4EA] wgt:px-4 wgt:py-4";
|
|
431
|
+
function m(u, T) {
|
|
432
|
+
const A = document.createElement("div");
|
|
433
|
+
A.className = "wgt:flex wgt:items-start wgt:justify-between wgt:gap-4";
|
|
434
|
+
const Z = document.createElement("span");
|
|
435
|
+
Z.className = "wgt:text-sm wgt:text-[#0E121B] wgt:w-1/3", Z.textContent = u;
|
|
436
|
+
const F = document.createElement("span");
|
|
437
|
+
return F.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:text-right wgt:w-2/3", F.textContent = T || "-", A.appendChild(Z), A.appendChild(F), A;
|
|
438
|
+
}
|
|
439
|
+
r === "business" ? (a.appendChild(
|
|
440
|
+
m(i("confirmation_popup_taxCode"), e.taxCode)
|
|
441
|
+
), a.appendChild(
|
|
442
|
+
m(i("businessName"), e.businessName)
|
|
443
|
+
), a.appendChild(
|
|
444
|
+
m(
|
|
445
|
+
i("confirmation_popup_representativeName"),
|
|
446
|
+
e.representativeName
|
|
447
|
+
)
|
|
448
|
+
), a.appendChild(
|
|
449
|
+
m(i("confirmation_popup_buyerAddress"), e.buyerAddress)
|
|
450
|
+
), a.appendChild(
|
|
451
|
+
m(i("confirmation_popup_email"), e.email)
|
|
452
|
+
), a.appendChild(
|
|
453
|
+
m(i("confirmation_popup_phone"), e.phone)
|
|
454
|
+
)) : (a.appendChild(
|
|
455
|
+
m(
|
|
456
|
+
i("confirmation_popup_representativeName"),
|
|
457
|
+
e.representativeName
|
|
458
|
+
)
|
|
459
|
+
), a.appendChild(
|
|
460
|
+
m(i("confirmation_popup_buyerAddress"), e.buyerAddress)
|
|
461
|
+
), a.appendChild(
|
|
462
|
+
m(i("confirmation_popup_email"), e.email)
|
|
463
|
+
)), o.appendChild(a), g.appendChild(o);
|
|
464
|
+
const C = document.createElement("div");
|
|
465
|
+
C.className = "wgt:px-6 wgt:pb-6 wgt:flex wgt:gap-3";
|
|
466
|
+
const V = I({
|
|
467
|
+
type: "button",
|
|
468
|
+
title: "Đóng",
|
|
469
|
+
className: "wgt:flex-1 wgt:py-3 wgt:text-sm wgt:font-semibold wgt:rounded-[8px] wgt:bg-white wgt:text-primary wgt:border wgt:border-primary",
|
|
470
|
+
handleClick: () => {
|
|
471
|
+
typeof l == "function" && l(), s.remove();
|
|
472
|
+
}
|
|
473
|
+
}), H = I({
|
|
474
|
+
type: "button",
|
|
475
|
+
title: "Xác nhận",
|
|
476
|
+
className: "wgt:flex-1 wgt:py-3 wgt:text-sm wgt:font-semibold wgt:rounded-[8px] wgt:bg-primary wgt:text-white",
|
|
477
|
+
handleClick: () => {
|
|
478
|
+
typeof d == "function" && d({ type: r, data: e }), s.remove();
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
return C.appendChild(V), C.appendChild(H), g.appendChild(C), s.appendChild(g), s.addEventListener("click", (u) => {
|
|
482
|
+
u.target === s && (typeof l == "function" && l(), s.remove());
|
|
483
|
+
}), { overlay: s };
|
|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Kq25PjJyOhqibBKtqEadLPvcXWyC+4mvzWJkxXwul8mkSee7ekYqgDar5NyGaas29utgffQ5b89nzZogGtZk3Glmcw3n2IdtH72fLY28pkqdceBp2tTfT5ofLtFOy0grJAXxY7E7FnRS7j2A0UR4RTPI7TrW043iP8VEqlWKuVH60wbYrytLW8bymyiT72iDX77nXIkt+eL1tQv9Vca9+QYY9LsbeL3s+Wx95WLUu91ufkIdpEnx8q307BriRsBPNVb8cKkKVG1WIB6CWK4aF5PjwBaFABPcDh+VVE0/ur59PdZwy/ZW7n1i/h282tc/gGsKsJG49OUt9Ixv4S4My9wKBrhRqklMpHA6WH4bVnissOAY6v4Sw7gAWeh9b+rkfh282pc/iGsKsJWyfKd6XogywrKpb1h+0l1o65eT50GeN/Kni4J6X7KXTOrBIHoYeIL88llD9by8khh9FidyzxeiB/c0XdE4UMc3ZM1eNY8exrfUNDHi9s6pflGtD/VYe+y0V1sxwbVlNPVzRvOhN2/D8Q5PA9xC4XRcBUCJ7qS17h5B14Pog+mYhXE/fwqgZR62EexsZhkpy8AHf1RK+C9PafHHIYE3YHYev1XB/Z0tMJyo1+TkAP5OB/CjM/dWLHCFM//iP1lHLjHwc62mH3tS+H7xh2p7VBF0ni1XuskFV5miQT4mas//mAkfGAGx/HruAa182A0e9FzCGHbbA7OaIeL3JWw5ofeBnfRgevoW9Xt33iJ54LWODNa1r4wxn03JIccvjWYNBj1VZR+1etag/0Qmpa9YxUV0XdY1qaoL+v/5slh52Eb4IzDp6FUV9U5M3TtNIirrTlrPavBmDb47ZyyOFbh5y4kUMOOeQwFvw/nuqxEggnLfAAAAAASUVORK5CYII=";
|
|
486
|
+
function me({ theme: r, assets: e = {}, year: t } = {}) {
|
|
487
|
+
const n = t != null ? t : (/* @__PURE__ */ new Date()).getFullYear(), l = document.createElement("div");
|
|
488
|
+
l.className = "wgt:w-full wgt:bg-white", r && l.setAttribute("data-theme", r);
|
|
489
|
+
const d = document.createElement("div");
|
|
490
|
+
d.className = "wgt:w-full wgt:border-t wgt:border-[#E5E7EB]", l.appendChild(d);
|
|
491
|
+
const s = document.createElement("div");
|
|
492
|
+
s.className = "wgt:w-full wgt:max-w-md wgt:mx-auto wgt:px-4 wgt:py-4", l.appendChild(s);
|
|
493
|
+
const g = document.createElement("div");
|
|
494
|
+
g.className = "wgt:flex wgt:items-center wgt:justify-center wgt:gap-2 wgt:mb-3 wgt:flex-wrap";
|
|
495
|
+
const c = document.createElement("div");
|
|
496
|
+
c.className = "wgt:text-base wgt:font-semibold wgt:text-strong-950", c.textContent = "Giải pháp thanh toán được cung cấp bởi";
|
|
497
|
+
const v = document.createElement("div");
|
|
498
|
+
v.className = "wgt:flex wgt:items-center wgt:justify-center wgt:shrink-0";
|
|
499
|
+
const x = document.createElement("img");
|
|
500
|
+
if (x.src = ue, x.alt = "ATOM", x.className = "wgt:h-6 wgt:w-auto", x.loading = "lazy", v.appendChild(x), g.appendChild(c), g.appendChild(v), s.appendChild(g), e.cyberSourceLogo || e.pciLogo) {
|
|
501
|
+
const w = document.createElement("div");
|
|
502
|
+
if (w.className = "wgt:flex wgt:items-center wgt:justify-center wgt:gap-6 wgt:py-2", e.cyberSourceLogo) {
|
|
503
|
+
const p = document.createElement("img");
|
|
504
|
+
p.src = e.cyberSourceLogo, p.alt = "CyberSource", p.className = "wgt:h-10 wgt:w-auto", p.loading = "lazy", w.appendChild(p);
|
|
505
|
+
}
|
|
506
|
+
if (e.pciLogo) {
|
|
507
|
+
const p = document.createElement("img");
|
|
508
|
+
p.src = e.pciLogo, p.alt = "PCI DSS", p.className = "wgt:h-10 wgt:w-auto", p.loading = "lazy", w.appendChild(p);
|
|
509
|
+
}
|
|
510
|
+
s.appendChild(w);
|
|
511
|
+
}
|
|
512
|
+
const M = document.createElement("div");
|
|
513
|
+
M.className = "wgt:w-full wgt:border-t wgt:border-[#E5E7EB]", l.appendChild(M);
|
|
514
|
+
const b = document.createElement("div");
|
|
515
|
+
return b.className = "wgt:w-full wgt:max-w-md wgt:mx-auto wgt:px-4 wgt:py-3 wgt:text-center wgt:text-sm wgt:text-[#9CA3AF]", b.textContent = `© ${n} Bản quyền thuộc về ATOM`, l.appendChild(b), { container: l };
|
|
516
|
+
}
|
|
517
|
+
function Ce({
|
|
518
|
+
orderInfo: r,
|
|
519
|
+
onPreview: e,
|
|
520
|
+
theme: t,
|
|
521
|
+
onSubmit: n,
|
|
522
|
+
taxCode: l = ""
|
|
523
|
+
}) {
|
|
524
|
+
const d = document.createElement("div");
|
|
525
|
+
d.className = "wgt:flex wgt:flex-col wgt:items-center wgt:justify-between wgt:h-full wgt:shadow wgt:rounded-xl", t && d.setAttribute("data-theme", t);
|
|
526
|
+
const s = document.createElement("div");
|
|
527
|
+
s.className = "wgt:w-full wgt:max-w-md wgt:space-y-4 wgt:rounded-xl wgt:bg-white wgt:p-4", d.appendChild(s);
|
|
528
|
+
const {
|
|
529
|
+
container: g,
|
|
530
|
+
open: c,
|
|
531
|
+
close: v
|
|
532
|
+
} = oe();
|
|
533
|
+
d.style.position = d.style.position || "relative", d.appendChild(g);
|
|
534
|
+
const x = document.createElement("div");
|
|
535
|
+
x.className = "wgt:space-y-1";
|
|
536
|
+
const M = document.createElement("h3");
|
|
537
|
+
M.className = "wgt:text-2xl wgt:font-semibold wgt:text-text-black wgt:text-center wgt:justify-center", M.textContent = i("invoiceform_title");
|
|
538
|
+
const b = document.createElement("p");
|
|
539
|
+
b.className = "wgt:text-sm wgt:text-weak-700 wgt:text-center wgt:justify-center", b.textContent = i("invoiceform_subtitle"), x.appendChild(M), x.appendChild(b), s.appendChild(x);
|
|
540
|
+
const w = document.createElement("div");
|
|
541
|
+
w.className = "wgt:mt-2 wgt:space-y-3 wgt:rounded-xl wgt:bg-weak-50 wgt:px-6 wgt:py-6";
|
|
542
|
+
function p(y, E) {
|
|
543
|
+
const S = document.createElement("div");
|
|
544
|
+
S.className = "wgt:flex wgt:items-start";
|
|
545
|
+
const q = document.createElement("div");
|
|
546
|
+
q.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:w-1/3";
|
|
547
|
+
const Y = document.createElement("span");
|
|
548
|
+
Y.className = "wgt:inline-flex wgt:items-center wgt:justify-center wgt:w-4 wgt:h-4 wgt:text-icon-primary";
|
|
549
|
+
let h = "";
|
|
550
|
+
y === i("invoice_number") ? h = `
|
|
551
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
552
|
+
<path d="M12.7996 14H3.19961C3.04048 14 2.88787 13.9368 2.77535 13.8243C2.66282 13.7117 2.59961 13.5591 2.59961 13.4V2.6C2.59961 2.44087 2.66282 2.28826 2.77535 2.17574C2.88787 2.06321 3.04048 2 3.19961 2H12.7996C12.9587 2 13.1114 2.06321 13.2239 2.17574C13.3364 2.28826 13.3996 2.44087 13.3996 2.6V13.4C13.3996 13.5591 13.3364 13.7117 13.2239 13.8243C13.1114 13.9368 12.9587 14 12.7996 14ZM12.1996 12.8V3.2H3.79961V12.8H12.1996ZM5.59961 6.2H10.3996V7.4H5.59961V6.2ZM5.59961 8.6H10.3996V9.8H5.59961V8.6Z" fill="currentColor"/>
|
|
553
|
+
</svg>
|
|
554
|
+
` : y === i("address_form") ? h = `
|
|
555
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
556
|
+
<path d="M7.99961 13.34L10.9696 10.37C11.557 9.78256 11.9569 9.03419 12.1189 8.21948C12.281 7.40477 12.1978 6.56031 11.8799 5.79289C11.562 5.02546 11.0236 4.36954 10.333 3.90805C9.64229 3.44657 8.83028 3.20026 7.99961 3.20026C7.16895 3.20026 6.35694 3.44657 5.66626 3.90805C4.97558 4.36954 4.43726 5.02546 4.11936 5.79289C3.80146 6.56031 3.71826 7.40477 3.88028 8.21948C4.04231 9.03419 4.44227 9.78256 5.02961 10.37L7.99961 13.34ZM7.99961 15.0368L4.18121 11.2184C3.42602 10.4631 2.91172 9.50096 2.70337 8.45346C2.49501 7.40597 2.60195 6.32021 3.01067 5.33349C3.41938 4.34678 4.11152 3.50342 4.99954 2.91006C5.88756 2.3167 6.9316 2 7.99961 2C9.06763 2 10.1117 2.3167 10.9997 2.91006C11.8877 3.50342 12.5798 4.34678 12.9886 5.33349C13.3973 6.32021 13.5042 7.40597 13.2959 8.45346C13.0875 9.50096 12.5732 10.4631 11.818 11.2184L7.99961 15.0368ZM7.99961 8.59995C8.31787 8.59995 8.6231 8.47353 8.84814 8.24848C9.07318 8.02344 9.19961 7.71821 9.19961 7.39995C9.19961 7.08169 9.07318 6.77647 8.84814 6.55143C8.6231 6.32638 8.31787 6.19995 7.99961 6.19995C7.68135 6.19995 7.37613 6.32638 7.15108 6.55143C6.92604 6.77647 6.79961 7.08169 6.79961 7.39995C6.79961 7.71821 6.92604 8.02344 7.15108 8.24848C7.37613 8.47353 7.68135 8.59995 7.99961 8.59995ZM7.99961 9.79995C7.36309 9.79995 6.75264 9.5471 6.30256 9.09701C5.85247 8.64692 5.59961 8.03647 5.59961 7.39995C5.59961 6.76343 5.85247 6.15298 6.30256 5.7029C6.75264 5.25281 7.36309 4.99995 7.99961 4.99995C8.63613 4.99995 9.24658 5.25281 9.69667 5.7029C10.1468 6.15298 10.3996 6.76343 10.3996 7.39995C10.3996 8.03647 10.1468 8.64692 9.69667 9.09701C9.24658 9.5471 8.63613 9.79995 7.99961 9.79995Z" fill="currentColor"/>
|
|
557
|
+
</svg>
|
|
558
|
+
` : y === i("total_amount") && (h = `
|
|
559
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
560
|
+
<path d="M8 14C4.6862 14 2 11.3138 2 8C2 4.6862 4.6862 2 8 2C11.3138 2 14 4.6862 14 8C14 11.3138 11.3138 14 8 14ZM8 12.8C9.27304 12.8 10.4939 12.2943 11.3941 11.3941C12.2943 10.4939 12.8 9.27304 12.8 8C12.8 6.72696 12.2943 5.50606 11.3941 4.60589C10.4939 3.70571 9.27304 3.2 8 3.2C6.72696 3.2 5.50606 3.70571 4.60589 4.60589C3.70571 5.50606 3.2 6.72696 3.2 8C3.2 9.27304 3.70571 10.4939 4.60589 11.3941C5.50606 12.2943 6.72696 12.8 8 12.8V12.8ZM5.9 9.2H9.2C9.27957 9.2 9.35587 9.16839 9.41213 9.11213C9.46839 9.05587 9.5 8.97957 9.5 8.9C9.5 8.82044 9.46839 8.74413 9.41213 8.68787C9.35587 8.63161 9.27957 8.6 9.2 8.6H6.8C6.40218 8.6 6.02064 8.44197 5.73934 8.16066C5.45804 7.87936 5.3 7.49783 5.3 7.1C5.3 6.70218 5.45804 6.32065 5.73934 6.03934C6.02064 5.75804 6.40218 5.6 6.8 5.6H7.4V4.4H8.6V5.6H10.1V6.8H6.8C6.72044 6.8 6.64413 6.83161 6.58787 6.88787C6.53161 6.94413 6.5 7.02044 6.5 7.1C6.5 7.17957 6.53161 7.25587 6.58787 7.31213C6.64413 7.36839 6.72044 7.4 6.8 7.4H9.2C9.59783 7.4 9.97936 7.55804 10.2607 7.83934C10.542 8.12065 10.7 8.50218 10.7 8.9C10.7 9.29783 10.542 9.67936 10.2607 9.96066C9.97936 10.242 9.59783 10.4 9.2 10.4H8.6V11.6H7.4V10.4H5.9V9.2Z" fill="currentColor"/>
|
|
561
|
+
</svg>
|
|
562
|
+
`), Y.innerHTML = h;
|
|
563
|
+
const L = document.createElement("span");
|
|
564
|
+
L.className = "wgt:text-sm wgt:text-weak-700", L.textContent = y, q.appendChild(Y), q.appendChild(L);
|
|
565
|
+
const f = document.createElement("span");
|
|
566
|
+
return f.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:w-2/3 wgt:text-right", f.textContent = E != null ? E : "", S.appendChild(q), S.appendChild(f), S;
|
|
567
|
+
}
|
|
568
|
+
w.appendChild(p(i("invoice_number"), r == null ? void 0 : r.billNo)), w.appendChild(
|
|
569
|
+
p(i("address_form"), r == null ? void 0 : r.merchantAddress)
|
|
570
|
+
), w.appendChild(
|
|
571
|
+
p(
|
|
572
|
+
i("total_amount"),
|
|
573
|
+
`${te(r == null ? void 0 : r.amount)} VND`
|
|
574
|
+
)
|
|
575
|
+
), s.appendChild(w);
|
|
576
|
+
const k = document.createElement("div");
|
|
577
|
+
k.className = "wgt:mt-4 wgt:rounded-xl wgt:border wgt:border-[#E1E4EA] wgt:bg-white wgt:pb-6", s.appendChild(k);
|
|
578
|
+
const P = document.createElement("div");
|
|
579
|
+
P.className = "wgt:flex wgt:border-b wgt:border-[#E1E4EA]", k.appendChild(P);
|
|
580
|
+
const o = document.createElement("button");
|
|
581
|
+
o.type = "button", o.className = "wgt:relative wgt:flex-1 wgt:py-4 wgt:text-sm wgt:font-semibold", o.innerHTML = `
|
|
582
|
+
<span class="wgt:flex wgt:items-center wgt:justify-center wgt:gap-2">
|
|
583
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
584
|
+
<path d="M10 12C11.4587 12 12.8572 12.5799 13.8887 13.6113C14.8016 14.5242 15.3592 15.7247 15.4756 17H14.9746C14.8598 15.8576 14.3542 14.7839 13.5352 13.9648C12.5975 13.0272 11.3261 12.5 10 12.5C8.67392 12.5 7.40253 13.0272 6.46484 13.9648C5.64577 14.7839 5.14018 15.8576 5.02539 17H4.52441C4.64082 15.7247 5.19843 14.5242 6.11133 13.6113C7.07838 12.6443 8.36805 12.0742 9.72754 12.0068L10 12ZM10 2.25C12.2101 2.25 14 4.03989 14 6.25C14 8.46011 12.2101 10.25 10 10.25C7.78989 10.25 6 8.46011 6 6.25C6 4.03989 7.78989 2.25 10 2.25ZM10 2.75C8.06636 2.75 6.5 4.31636 6.5 6.25C6.5 8.18364 8.06636 9.75 10 9.75C11.9336 9.75 13.5 8.18364 13.5 6.25C13.5 4.31636 11.9336 2.75 10 2.75Z" fill="currentColor" stroke="currentColor"/>
|
|
585
|
+
</svg>
|
|
586
|
+
${i("individual")}
|
|
587
|
+
</span>
|
|
588
|
+
`;
|
|
589
|
+
const a = document.createElement("button");
|
|
590
|
+
a.type = "button", a.className = "wgt:relative wgt:flex-1 wgt:py-4 wgt:text-sm wgt:font-semibold", a.innerHTML = `
|
|
591
|
+
<span class="wgt:flex wgt:items-center wgt:justify-center wgt:gap-2">
|
|
592
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
593
|
+
<path d="M4 3.875H11.5C11.5332 3.875 11.5654 3.88769 11.5889 3.91113C11.6123 3.93457 11.625 3.96685 11.625 4V15.875H15.875V8.625H14.375V8.375H16C16.0332 8.375 16.0654 8.38769 16.0889 8.41113C16.1123 8.43457 16.125 8.46685 16.125 8.5V15.875H17.625V16.125H2.375V15.875H3.875V4C3.875 3.96685 3.88769 3.93457 3.91113 3.91113C3.93457 3.88769 3.96685 3.875 4 3.875ZM4.125 15.875H11.375V4.125H4.125V15.875ZM8.625 9.875V10.125H6.875V9.875H8.625ZM8.625 6.875V7.125H6.875V6.875H8.625Z" fill="currentColor" stroke="currentColor" stroke-width="1.25"/>
|
|
594
|
+
</svg>
|
|
595
|
+
${i("business")}
|
|
596
|
+
</span>
|
|
597
|
+
`, P.appendChild(o), P.appendChild(a);
|
|
598
|
+
const m = document.createElement("div");
|
|
599
|
+
m.className = "wgt:mt-4 wgt:px-4", k.appendChild(m);
|
|
600
|
+
const C = ge(), V = we({
|
|
601
|
+
defaultValues: { taxCode: l || "" },
|
|
602
|
+
onFetchByTaxCode: (y) => W(null, null, function* () {
|
|
603
|
+
var S, q, Y;
|
|
604
|
+
const E = yield le(y);
|
|
605
|
+
return {
|
|
606
|
+
representativeName: (S = E.nguoi_dai_dien) != null ? S : "",
|
|
607
|
+
buyerAddress: (q = E.dia_chi) != null ? q : "",
|
|
608
|
+
businessName: (Y = E.ten_cty) != null ? Y : ""
|
|
609
|
+
};
|
|
610
|
+
})
|
|
611
|
+
});
|
|
612
|
+
let H = "individual", u = C;
|
|
613
|
+
function T(y) {
|
|
614
|
+
H = y, o.style.borderBottom = "none", a.style.borderBottom = "none";
|
|
615
|
+
const E = "wgt:relative wgt:flex-1 wgt:py-4 wgt:text-sm wgt:font-semibold";
|
|
616
|
+
y === "individual" ? (o.className = `${E} wgt:text-strong-950`, o.style.borderBottom = "2px solid var(--primary)", a.className = `${E} wgt:text-soft-400`, m.innerHTML = "", m.appendChild(C.container), u = C) : (a.className = `${E} wgt:text-strong-950`, a.style.borderBottom = "2px solid var(--primary)", o.className = `${E} wgt:text-soft-400`, m.innerHTML = "", m.appendChild(V.container), u = V);
|
|
617
|
+
}
|
|
618
|
+
o.addEventListener("click", () => T("individual")), a.addEventListener("click", () => T("business")), T("individual");
|
|
619
|
+
const A = document.createElement("p");
|
|
620
|
+
A.className = "wgt:mt-2 wgt:text-xs wgt:text-[#FF8447] wgt:text-left wgt:justify-center", A.textContent = i("invoiceform_note"), s.appendChild(A);
|
|
621
|
+
const Z = document.createElement("div");
|
|
622
|
+
Z.className = "wgt:mt-6 wgt:w-full wgt:flex wgt:justify-center wgt:items-center";
|
|
623
|
+
const F = I({
|
|
624
|
+
type: "button",
|
|
625
|
+
title: i("btn_preview"),
|
|
626
|
+
className: "wgt:min-w-[163px] wgt:text-white",
|
|
627
|
+
handleClick: () => {
|
|
628
|
+
if (!u.validate()) return;
|
|
629
|
+
const y = {
|
|
630
|
+
type: H,
|
|
631
|
+
data: u.getValues()
|
|
632
|
+
}, { overlay: E } = pe({
|
|
633
|
+
type: y.type,
|
|
634
|
+
data: y.data,
|
|
635
|
+
orderInfo: r,
|
|
636
|
+
theme: t,
|
|
637
|
+
onClose: () => {
|
|
638
|
+
console.log("Popup closed");
|
|
639
|
+
},
|
|
640
|
+
onConfirm: () => W(null, null, function* () {
|
|
641
|
+
var S, q, Y;
|
|
642
|
+
E.remove(), c();
|
|
643
|
+
try {
|
|
644
|
+
if (typeof n != "function") return;
|
|
645
|
+
const h = yield n({
|
|
646
|
+
type: y.type,
|
|
647
|
+
data: y.data
|
|
648
|
+
}), L = (Y = (q = (S = h == null ? void 0 : h.finalData) != null ? S : h == null ? void 0 : h.data) != null ? q : h) != null ? Y : {}, f = String((L == null ? void 0 : L.status) || "").trim().toLowerCase();
|
|
649
|
+
if (v(), f === "invoiced") {
|
|
650
|
+
J({
|
|
651
|
+
message: i("invoice_success"),
|
|
652
|
+
description: i("invoice_description"),
|
|
653
|
+
isSuccess: !0,
|
|
654
|
+
hideOkButton: !0,
|
|
655
|
+
theme: t,
|
|
656
|
+
closeOnClickOutside: !1
|
|
657
|
+
}).open();
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
if (f === "failed") {
|
|
661
|
+
J({
|
|
662
|
+
message: i("invoice_failed"),
|
|
663
|
+
description: i("invoice_description_failed"),
|
|
664
|
+
okLabel: i("close"),
|
|
665
|
+
isSuccess: !1,
|
|
666
|
+
hideOkButton: !1,
|
|
667
|
+
theme: t,
|
|
668
|
+
closeOnClickOutside: !1
|
|
669
|
+
}).open();
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
} catch (h) {
|
|
673
|
+
v(), J({
|
|
674
|
+
message: i("invoice_failed"),
|
|
675
|
+
description: i("invoice_description_failed"),
|
|
676
|
+
okLabel: i("close"),
|
|
677
|
+
isSuccess: !1,
|
|
678
|
+
hideOkButton: !1,
|
|
679
|
+
closeOnClickOutside: !1,
|
|
680
|
+
theme: t
|
|
681
|
+
}).open(), console.error(h);
|
|
682
|
+
}
|
|
683
|
+
})
|
|
684
|
+
});
|
|
685
|
+
document.body.appendChild(E);
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
return Z.appendChild(F), s.appendChild(Z), { container: d };
|
|
689
|
+
}
|
|
690
|
+
function he({ theme: r, onClose: e } = {}) {
|
|
691
|
+
const t = document.createElement("div");
|
|
692
|
+
t.className = " wgt:flex wgt:h-screen wgt:bg-[#F3F4F6] wgt:p-4", r && t.setAttribute("data-theme", r);
|
|
693
|
+
const n = document.createElement("div");
|
|
694
|
+
n.className = "wgt:w-full wgt:max-w-md wgt:max-h-[208px] wgt:bg-white wgt:rounded-2xl wgt:shadow-sm wgt:p-8 wgt:text-center";
|
|
695
|
+
const l = document.createElement("div");
|
|
696
|
+
l.className = "wgt:flex wgt:justify-center wgt:mb-4";
|
|
697
|
+
const d = document.createElement("div");
|
|
698
|
+
d.className = "wgt:w-12 wgt:h-12 wgt:rounded-full wgt:flex wgt:items-center wgt:justify-center", d.style.backgroundColor = "#335CFF", d.innerHTML = `
|
|
699
|
+
<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
700
|
+
<path d="M20.7996 22.75H5.19961C4.94102 22.75 4.69303 22.6473 4.51018 22.4644C4.32733 22.2816 4.22461 22.0336 4.22461 21.775V4.225C4.22461 3.96641 4.32733 3.71842 4.51018 3.53557C4.69303 3.35272 4.94102 3.25 5.19961 3.25H20.7996C21.0582 3.25 21.3062 3.35272 21.489 3.53557C21.6719 3.71842 21.7746 3.96641 21.7746 4.225V21.775C21.7746 22.0336 21.6719 22.2816 21.489 22.4644C21.3062 22.6473 21.0582 22.75 20.7996 22.75ZM9.09961 10.075V12.025H16.8996V10.075H9.09961ZM9.09961 13.975V15.925H16.8996V13.975H9.09961Z" fill="white"/>
|
|
701
|
+
</svg>
|
|
702
|
+
|
|
703
|
+
`, l.appendChild(d), n.appendChild(l);
|
|
704
|
+
const s = document.createElement("h2");
|
|
705
|
+
s.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", s.textContent = i("invoiceCheckout_title"), n.appendChild(s);
|
|
706
|
+
const g = document.createElement("p");
|
|
707
|
+
return g.className = "wgt:text-sm wgt:text-[#525866] wgt:leading-relaxed", g.textContent = i("invoiceCheckout_description"), n.appendChild(g), t.appendChild(n), { container: t };
|
|
708
|
+
}
|
|
709
|
+
function fe({ theme: r, onClose: e } = {}) {
|
|
710
|
+
const t = document.createElement("div");
|
|
711
|
+
t.className = "wgt:min-h-screen wgt:flex wgt:bg-[#F3F4F6] wgt:p-4", r && t.setAttribute("data-theme", r);
|
|
712
|
+
const n = document.createElement("div");
|
|
713
|
+
n.className = "wgt:w-full wgt:max-w-md wgt:max-h-[252px] wgt:bg-white wgt:rounded-2xl wgt:shadow-sm wgt:px-4 wgt:py-5 wgt:text-center";
|
|
714
|
+
const l = document.createElement("div");
|
|
715
|
+
l.className = "wgt:flex wgt:justify-center wgt:mb-2";
|
|
716
|
+
const d = document.createElement("div");
|
|
717
|
+
d.innerHTML = `
|
|
718
|
+
<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
719
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M54.1342 21.7247L55.1467 20.5742C56.1143 19.4756 55.9467 17.7277 54.7361 16.6283C53.5262 15.5258 51.7494 15.5022 50.7825 16.6009L49.7715 17.7521L54.1342 21.7247Z" fill="#525866"/>
|
|
720
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M36.6582 10.4023H40.9028V14.1966H36.6582V10.4023Z" fill="#99A0AE"/>
|
|
721
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M35.076 6.51758H42.4863C43.3495 6.51758 44.0467 7.21472 44.0467 8.08329V9.87377C44.0467 10.7423 43.3495 11.4395 42.4863 11.4395H35.076C34.212 11.4395 33.5156 10.7423 33.5156 9.87377V8.08329C33.5156 7.21472 34.212 6.51758 35.076 6.51758Z" fill="#525866"/>
|
|
722
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.7787 13.9316C50.4526 13.9316 59.9162 23.4113 59.9162 35.1042C59.9162 46.7987 50.4526 56.2791 38.7787 56.2791C33.0141 56.2791 29.1962 54.3682 21.3722 51.7076L23.5505 49.5141C24.5288 48.5267 23.5695 46.7278 22.125 47.2855C15.5551 49.8128 11.7257 47.1141 9.85831 41.0181C12.6842 42.8139 16.5867 41.5758 17.8095 40.3499C19.7044 38.4535 18.9646 36.26 14.6995 37.6695C9.22974 39.473 3.46364 36.3164 0.693359 28.5092C9.06212 32.7134 9.6785 24.0612 18.5181 26.3667C17.7661 23.3335 15.7273 22.3332 11.0575 22.4528C15.6884 16.6166 22.4236 19.6383 29.5269 16.0673C32.3208 14.6996 35.4583 13.9316 38.7787 13.9316Z" fill="#FF8447"/>
|
|
723
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M53.9358 35.102C53.9358 43.4875 47.1518 50.2844 38.7784 50.2844C34.7579 50.2844 30.9026 48.6867 28.06 45.8372C25.218 42.9907 23.6211 39.1286 23.6211 35.102C23.6211 31.073 25.2173 27.2155 28.06 24.3644C30.9026 21.518 34.7579 19.918 38.7784 19.918C47.1518 19.918 53.9358 26.718 53.9358 35.102Z" fill="#F2F2F2"/>
|
|
724
|
+
<path d="M38.5516 22.0568C38.1143 22.0636 37.7631 22.427 37.7676 22.8651V24.0118C37.7676 25.0709 39.36 25.0709 39.36 24.0118V22.8651C39.3676 22.4149 39.0019 22.0491 38.5516 22.0568Z" fill="#808080"/>
|
|
725
|
+
<path d="M38.5516 45.3908C38.1143 45.3946 37.7631 45.7565 37.7676 46.1991V47.342C37.7676 48.4049 39.36 48.4049 39.36 47.342V46.1991C39.3676 45.7496 39.0019 45.3824 38.5516 45.3908Z" fill="#808080"/>
|
|
726
|
+
<path d="M49.64 34.3066C48.5809 34.3066 48.5809 35.8998 49.64 35.8998H50.7828C51.8411 35.8998 51.8411 34.3066 50.7828 34.3066H49.64Z" fill="#808080"/>
|
|
727
|
+
<path d="M26.3406 34.3066C25.2823 34.3066 25.2823 35.8998 26.3406 35.8998H27.4873C28.5463 35.8998 28.5463 34.3066 27.4873 34.3066H26.3406Z" fill="#808080"/>
|
|
728
|
+
<path d="M46.3873 42.1465C45.6711 42.1465 45.3206 43.0151 45.8333 43.5118L46.6379 44.321C46.945 44.6524 47.4653 44.6585 47.7846 44.3415C48.1023 44.0223 48.0916 43.505 47.7602 43.1987L46.9556 42.3903C46.8055 42.2349 46.6029 42.1465 46.3873 42.1465Z" fill="#808080"/>
|
|
729
|
+
<path d="M29.9141 25.6484C29.2002 25.6484 28.8513 26.517 29.361 27.0145L30.1694 27.8191C30.4749 28.149 30.9968 28.162 31.316 27.842C31.6337 27.5242 31.6216 27.0023 31.2917 26.6953L30.4871 25.8915C30.3362 25.7361 30.1297 25.6484 29.9141 25.6484Z" fill="#808080"/>
|
|
730
|
+
<path d="M47.1912 25.6489C46.9847 25.6535 46.7843 25.7411 46.6418 25.8919L45.8373 26.6958C45.5074 27.0028 45.4952 27.5247 45.8129 27.8424C46.1314 28.1617 46.654 28.1495 46.9596 27.8196L47.7641 27.015C48.286 26.5091 47.9157 25.6253 47.1912 25.6489Z" fill="#808080"/>
|
|
731
|
+
<path d="M30.7206 42.1468C30.5142 42.1552 30.3138 42.2382 30.1713 42.3906L29.3629 43.199C29.0323 43.5053 29.0246 44.0226 29.3423 44.3418C29.6608 44.6596 30.182 44.6527 30.489 44.3213L31.2936 43.5121C31.8155 43.0077 31.446 42.1277 30.7206 42.1468Z" fill="#808080"/>
|
|
732
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.7788 33.9142C39.4439 33.9142 39.9696 34.4369 39.9696 35.1051C39.9696 35.7748 39.4447 36.2959 38.7788 36.2959C38.1144 36.2959 37.5879 35.7748 37.5879 35.1051C37.5879 34.4361 38.1144 33.9142 38.7788 33.9142ZM44.1494 28.6799C43.9468 28.6837 43.7479 28.7675 43.6039 28.9146L39.9376 32.59C39.5826 32.4232 39.1925 32.3234 38.7788 32.3234C37.2542 32.3234 36.0039 33.5813 36.0039 35.1051C36.0039 36.6296 37.2542 37.8891 38.7788 37.8891C40.3033 37.8891 41.5544 36.6296 41.5544 35.1051C41.5544 34.5679 41.3944 34.0712 41.1285 33.6445L44.727 30.0376C45.2367 29.5317 44.8702 28.6632 44.1494 28.6799Z" fill="#808080"/>
|
|
733
|
+
</svg>
|
|
734
|
+
|
|
735
|
+
`, l.appendChild(d), n.appendChild(l);
|
|
736
|
+
const s = document.createElement("h2");
|
|
737
|
+
s.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", s.textContent = i("invoiceExpired_title"), n.appendChild(s);
|
|
738
|
+
const g = document.createElement("p");
|
|
739
|
+
g.className = "wgt:text-sm wgt:text-[#525866] wgt:leading-relaxed wgt:px-2 wgt:mb-3", g.textContent = i("invoiceExpired_description"), n.appendChild(g);
|
|
740
|
+
const c = document.createElement("p");
|
|
741
|
+
return c.className = "wgt:text-sm wgt:text-[#99A0AE] wgt:italic wgt:leading-relaxed wgt:px-4", c.textContent = i("invoiceExpired_note"), n.appendChild(c), t.appendChild(n), { container: t };
|
|
742
|
+
}
|
|
743
|
+
function ie(r) {
|
|
744
|
+
return String(r || "").trim().toLowerCase();
|
|
745
|
+
}
|
|
746
|
+
function Me({ uuid: r, orderInfo: e, theme: t }) {
|
|
747
|
+
const n = document.createElement("div");
|
|
748
|
+
n.className = "wgt:w-full wgt:min-h-screen wgt:flex wgt:flex-col wgt:bg-[#F3F4F6]";
|
|
749
|
+
let l = !1;
|
|
750
|
+
const d = document.createElement("div");
|
|
751
|
+
d.className = "wgt:flex-1 wgt:w-full", n.appendChild(d);
|
|
752
|
+
const s = me({
|
|
753
|
+
theme: t,
|
|
754
|
+
year: 2025
|
|
755
|
+
});
|
|
756
|
+
n.appendChild(s.container);
|
|
757
|
+
function g(o) {
|
|
758
|
+
l || (d.innerHTML = "", o && d.appendChild(o));
|
|
759
|
+
}
|
|
760
|
+
function c(o) {
|
|
761
|
+
o && console.log("[DEBUG] renderFailedPage:", o);
|
|
762
|
+
const a = ce({
|
|
763
|
+
theme: t,
|
|
764
|
+
onClose: w
|
|
765
|
+
});
|
|
766
|
+
g(a.container);
|
|
767
|
+
}
|
|
768
|
+
function v() {
|
|
769
|
+
const o = fe({
|
|
770
|
+
theme: t
|
|
771
|
+
});
|
|
772
|
+
g(o.container);
|
|
773
|
+
}
|
|
774
|
+
function x(o) {
|
|
775
|
+
const a = he({
|
|
776
|
+
theme: t
|
|
777
|
+
});
|
|
778
|
+
g(a.container);
|
|
779
|
+
}
|
|
780
|
+
function M(o) {
|
|
781
|
+
const a = Ce({
|
|
782
|
+
orderInfo: o || {},
|
|
783
|
+
theme: t,
|
|
784
|
+
onSubmit: (V) => W(null, [V], function* ({ type: m, data: C }) {
|
|
785
|
+
const H = b();
|
|
786
|
+
if (!H)
|
|
787
|
+
return c({ reason: "MISSING_UUID_ON_SUBMIT" }), { ok: !1 };
|
|
788
|
+
const u = ve(m, C);
|
|
789
|
+
return yield de(H, u), { ok: !0, finalData: yield be(H, {
|
|
790
|
+
maxTries: 20,
|
|
791
|
+
intervalMs: 1500
|
|
792
|
+
}) };
|
|
793
|
+
}),
|
|
794
|
+
onBack: w
|
|
795
|
+
});
|
|
796
|
+
g(a.container);
|
|
797
|
+
}
|
|
798
|
+
function b() {
|
|
799
|
+
var m;
|
|
800
|
+
const o = new URLSearchParams(window.location.search || "");
|
|
801
|
+
return String((m = o.get("uuid")) != null ? m : "").trim() || String(r || "").trim() || String((e == null ? void 0 : e.uuid) || "").trim();
|
|
802
|
+
}
|
|
803
|
+
function w() {
|
|
804
|
+
return W(this, null, function* () {
|
|
805
|
+
yield p();
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
function p() {
|
|
809
|
+
return W(this, null, function* () {
|
|
810
|
+
try {
|
|
811
|
+
const o = b();
|
|
812
|
+
if (!o)
|
|
813
|
+
return c({ reason: "EMPTY_UUID_NO_API_CALL" });
|
|
814
|
+
const a = yield ne(o), m = String((a == null ? void 0 : a.message) || "").trim();
|
|
815
|
+
if (m)
|
|
816
|
+
return c({ reason: "API_MESSAGE", apiMsg: m, res: a });
|
|
817
|
+
const C = ie(a == null ? void 0 : a.status);
|
|
818
|
+
return C === "expired" ? v() : C === "invoiced" ? x(a) : C === "pending" || C === "waiting" ? M(a || e || {}) : C === "" && a && Object.keys(a).length > 0 ? M(a) : c({ reason: "UNKNOWN_STATUS", status: C, res: a });
|
|
819
|
+
} catch (o) {
|
|
820
|
+
return console.log("[DEBUG] loadAndRender error:", o), c({ reason: "EXCEPTION", error: (o == null ? void 0 : o.message) || o });
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
function k() {
|
|
825
|
+
return W(this, null, function* () {
|
|
826
|
+
c({ reason: "INIT_DEFAULT_RENDER" });
|
|
827
|
+
try {
|
|
828
|
+
yield p();
|
|
829
|
+
} catch (o) {
|
|
830
|
+
return c({
|
|
831
|
+
reason: "INIT_EXCEPTION",
|
|
832
|
+
error: (o == null ? void 0 : o.message) || o
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
function P() {
|
|
838
|
+
l = !0, n.innerHTML = "";
|
|
839
|
+
}
|
|
840
|
+
return { container: n, init: k, destroy: P };
|
|
841
|
+
}
|
|
842
|
+
function xe(r) {
|
|
843
|
+
return String(r || "").trim().toLowerCase() === "business" ? "enterprise" : "individual";
|
|
844
|
+
}
|
|
845
|
+
function ve(r, e) {
|
|
846
|
+
const t = xe(r), n = {
|
|
847
|
+
invoiceType: t,
|
|
848
|
+
buyerName: (e == null ? void 0 : e.representativeName) || "",
|
|
849
|
+
address: (e == null ? void 0 : e.buyerAddress) || "",
|
|
850
|
+
email: (e == null ? void 0 : e.email) || ""
|
|
851
|
+
};
|
|
852
|
+
return t === "enterprise" && (n.taxCode = e != null && e.noTaxCode ? "" : (e == null ? void 0 : e.taxCode) || "", n.businessName = (e == null ? void 0 : e.businessName) || ""), n;
|
|
853
|
+
}
|
|
854
|
+
function be(n) {
|
|
855
|
+
return W(this, arguments, function* (r, { maxTries: e = 20, intervalMs: t = 1500 } = {}) {
|
|
856
|
+
for (let d = 0; d < e; d++) {
|
|
857
|
+
yield ye(t);
|
|
858
|
+
const s = yield ne(r), g = ie(s == null ? void 0 : s.status);
|
|
859
|
+
if (g === "invoiced") return s;
|
|
860
|
+
if (g === "expired") {
|
|
861
|
+
const c = new Error("Invoice request expired while polling");
|
|
862
|
+
throw c.code = "EXPIRED", c.data = s, c;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
const l = new Error("Polling timeout: status not invoiced");
|
|
866
|
+
throw l.code = "POLL_TIMEOUT", l;
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
function ye(r) {
|
|
870
|
+
return new Promise((e) => setTimeout(e, r));
|
|
871
|
+
}
|
|
872
|
+
export {
|
|
873
|
+
Me as createInvoiceRequestFlow
|
|
874
|
+
};
|