@invoice-sdk/widget 1.117.3 → 1.117.5
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-CeiOdPnU.js → index-O9T8X9G_.js} +3 -3
- package/dist/{index-C0svoYBT.js → index-tPFGhFcF.js} +402 -402
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +97 -97
- package/dist/{loading-rwAF7i1q.js → loading-DXHjg-K-.js} +2 -2
- package/dist/{widget-DirvUEFw.js → widget-J1JuhRxL.js} +1923 -1916
- package/package.json +1 -1
|
@@ -1,473 +1,473 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var W = (
|
|
5
|
-
for (var t in
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var t of
|
|
9
|
-
|
|
10
|
-
return
|
|
1
|
+
var I = Object.defineProperty;
|
|
2
|
+
var q = Object.getOwnPropertySymbols;
|
|
3
|
+
var X = Object.prototype.hasOwnProperty, G = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var W = (r, n, t) => n in r ? I(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t, P = (r, n) => {
|
|
5
|
+
for (var t in n || (n = {}))
|
|
6
|
+
X.call(n, t) && W(r, t, n[t]);
|
|
7
|
+
if (q)
|
|
8
|
+
for (var t of q(n))
|
|
9
|
+
G.call(n, t) && W(r, t, n[t]);
|
|
10
|
+
return r;
|
|
11
11
|
};
|
|
12
|
-
var Z = (
|
|
13
|
-
var
|
|
12
|
+
var Z = (r, n, t) => new Promise((e, l) => {
|
|
13
|
+
var s = (d) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
|
|
15
|
+
g(t.next(d));
|
|
16
|
+
} catch (h) {
|
|
17
|
+
l(h);
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, o = (d) => {
|
|
20
20
|
try {
|
|
21
|
-
|
|
22
|
-
} catch (
|
|
23
|
-
|
|
21
|
+
g(t.throw(d));
|
|
22
|
+
} catch (h) {
|
|
23
|
+
l(h);
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
|
|
25
|
+
}, g = (d) => d.done ? e(d.value) : Promise.resolve(d.value).then(s, o);
|
|
26
|
+
g((t = t.apply(r, n)).next());
|
|
27
27
|
});
|
|
28
|
-
import { c as
|
|
29
|
-
import { t as
|
|
30
|
-
function Y({ defaultValues:
|
|
28
|
+
import { c as O, f as U, e as J, b as K, o as $, s as Q } from "./loading-DXHjg-K-.js";
|
|
29
|
+
import { t as i, c as R } from "./index-O9T8X9G_.js";
|
|
30
|
+
function Y({ defaultValues: r = {}, onChange: n } = {}) {
|
|
31
31
|
const t = {
|
|
32
|
-
representativeName:
|
|
33
|
-
buyerAddress:
|
|
34
|
-
email:
|
|
35
|
-
phone:
|
|
32
|
+
representativeName: r.representativeName || "",
|
|
33
|
+
buyerAddress: r.buyerAddress || "",
|
|
34
|
+
email: r.email || "",
|
|
35
|
+
phone: r.phone || ""
|
|
36
36
|
}, e = document.createElement("div");
|
|
37
37
|
e.className = "wgt:space-y-2";
|
|
38
|
-
function
|
|
39
|
-
typeof
|
|
38
|
+
function l() {
|
|
39
|
+
typeof n == "function" && n(P({}, t));
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
t[
|
|
41
|
+
function s({ label: p, required: f, name: E, type: A = "text", placeholder: C }) {
|
|
42
|
+
const a = document.createElement("div");
|
|
43
|
+
a.className = "";
|
|
44
|
+
const w = document.createElement("label");
|
|
45
|
+
w.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950", w.htmlFor = E, w.innerHTML = f ? `${p} <span class="wgt:text-semantic-error wgt:text-[#ED1C24]">*</span>` : p;
|
|
46
|
+
const m = document.createElement("input");
|
|
47
|
+
return m.id = E, m.name = E, m.type = A, m.placeholder = C || "", m.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", m.value = t[E] || "", m.addEventListener("input", () => {
|
|
48
|
+
t[E] = m.value, m.classList.remove(
|
|
49
49
|
"wgt:border-semantic-error",
|
|
50
50
|
"wgt:bg-semantic-error-50"
|
|
51
|
-
),
|
|
52
|
-
}),
|
|
51
|
+
), l();
|
|
52
|
+
}), a.appendChild(w), a.appendChild(m), { field: a, input: m };
|
|
53
53
|
}
|
|
54
|
-
const { field:
|
|
55
|
-
label:
|
|
54
|
+
const { field: o, input: g } = s({
|
|
55
|
+
label: i("representativeName"),
|
|
56
56
|
required: !0,
|
|
57
57
|
name: "representativeName",
|
|
58
|
-
placeholder:
|
|
59
|
-
}), { field:
|
|
60
|
-
label:
|
|
58
|
+
placeholder: i("representativeName_input")
|
|
59
|
+
}), { field: d } = s({
|
|
60
|
+
label: i("buyerAddress"),
|
|
61
61
|
required: !1,
|
|
62
62
|
name: "buyerAddress",
|
|
63
|
-
placeholder:
|
|
64
|
-
}), { field:
|
|
65
|
-
label:
|
|
63
|
+
placeholder: i("buyerAddress_input")
|
|
64
|
+
}), { field: h, input: x } = s({
|
|
65
|
+
label: i("email"),
|
|
66
66
|
required: !0,
|
|
67
67
|
name: "email",
|
|
68
68
|
type: "email",
|
|
69
|
-
placeholder:
|
|
69
|
+
placeholder: i("email_input")
|
|
70
70
|
});
|
|
71
|
-
e.appendChild(
|
|
72
|
-
function
|
|
73
|
-
let
|
|
74
|
-
function
|
|
75
|
-
|
|
71
|
+
e.appendChild(o), e.appendChild(d), e.appendChild(h);
|
|
72
|
+
function M() {
|
|
73
|
+
let p = !0;
|
|
74
|
+
function f(E) {
|
|
75
|
+
E.classList.add(
|
|
76
76
|
"wgt:border-semantic-error",
|
|
77
77
|
"wgt:bg-semantic-error-50"
|
|
78
|
-
),
|
|
78
|
+
), p = !1;
|
|
79
79
|
}
|
|
80
|
-
return t.representativeName.trim() ||
|
|
80
|
+
return t.representativeName.trim() || f(g), t.email.trim() || f(x), p;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
return
|
|
82
|
+
function y() {
|
|
83
|
+
return P({}, t);
|
|
84
84
|
}
|
|
85
|
-
return { container: e, getValues:
|
|
85
|
+
return { container: e, getValues: y, validate: M };
|
|
86
86
|
}
|
|
87
87
|
function D({
|
|
88
|
-
defaultValues:
|
|
89
|
-
onChange:
|
|
88
|
+
defaultValues: r = {},
|
|
89
|
+
onChange: n,
|
|
90
90
|
onFetchByTaxCode: t
|
|
91
91
|
} = {}) {
|
|
92
92
|
const e = {
|
|
93
|
-
noTaxCode: !!
|
|
94
|
-
taxCode:
|
|
95
|
-
representativeName:
|
|
96
|
-
buyerAddress:
|
|
97
|
-
performerName:
|
|
98
|
-
email:
|
|
99
|
-
phone:
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
function
|
|
103
|
-
typeof
|
|
93
|
+
noTaxCode: !!r.noTaxCode,
|
|
94
|
+
taxCode: r.taxCode || "",
|
|
95
|
+
representativeName: r.representativeName || "",
|
|
96
|
+
buyerAddress: r.buyerAddress || "",
|
|
97
|
+
performerName: r.performerName || "",
|
|
98
|
+
email: r.email || "",
|
|
99
|
+
phone: r.phone || ""
|
|
100
|
+
}, l = document.createElement("div");
|
|
101
|
+
l.className = "wgt:space-y-2";
|
|
102
|
+
function s() {
|
|
103
|
+
typeof n == "function" && n(P({}, e));
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function o({ label: N, required: c, name: u, type: L = "text", placeholder: V }) {
|
|
106
106
|
const F = document.createElement("div");
|
|
107
107
|
F.className = "";
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
return
|
|
112
|
-
e[u] =
|
|
108
|
+
const v = document.createElement("label");
|
|
109
|
+
v.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950", v.htmlFor = u, v.innerHTML = c ? `${N} <span class="wgt:text-[#ED1C24]">*</span>` : N;
|
|
110
|
+
const b = document.createElement("input");
|
|
111
|
+
return b.id = u, b.name = u, b.type = L, b.placeholder = V || "", b.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", b.value = e[u] || "", b.addEventListener("input", () => {
|
|
112
|
+
e[u] = b.value, b.classList.remove(
|
|
113
113
|
"wgt:border-semantic-error",
|
|
114
114
|
"wgt:bg-semantic-error-50"
|
|
115
|
-
),
|
|
116
|
-
}), F.appendChild(
|
|
115
|
+
), s();
|
|
116
|
+
}), F.appendChild(v), F.appendChild(b), { field: F, input: b };
|
|
117
117
|
}
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
e.noTaxCode =
|
|
125
|
-
}),
|
|
118
|
+
const g = document.createElement("label");
|
|
119
|
+
g.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:font-medium wgt:text-strong-950 wgt:text-sm";
|
|
120
|
+
const d = document.createElement("input");
|
|
121
|
+
d.type = "checkbox", d.className = "wgt:h-4 wgt:w-4 wgt:rounded wgt:border-[#E4E7EC] focus:wgt:outline-none focus:wgt:ring-primary", d.checked = e.noTaxCode;
|
|
122
|
+
const h = document.createElement("span");
|
|
123
|
+
h.textContent = i("business_noTaxCode"), h.className = "wgt:italic wgt:font-normal wgt:text-[14px] wgt:leading-[20px] wgt:tracking-[0px] wgt:align-middle wgt:text-[#525866]", h.style.fontFamily = "Inter, sans-serif", d.addEventListener("change", () => {
|
|
124
|
+
e.noTaxCode = d.checked, p.disabled = e.noTaxCode, f.disabled = e.noTaxCode, s();
|
|
125
|
+
}), g.appendChild(d), g.appendChild(h);
|
|
126
126
|
const x = document.createElement("div");
|
|
127
127
|
x.className = "wgt:space-y-2";
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
e.taxCode =
|
|
128
|
+
const M = document.createElement("label");
|
|
129
|
+
M.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950 ", M.innerHTML = i("confirmation_popup_taxCode") + '<span class="wgt:text-[#ED1C24]">*</span>';
|
|
130
|
+
const y = document.createElement("div");
|
|
131
|
+
y.className = "wgt:flex wgt:gap-2 wgt:mt-2";
|
|
132
|
+
const p = document.createElement("input");
|
|
133
|
+
p.type = "text", p.name = "taxCode", p.placeholder = i("taxCode_input"), p.value = e.taxCode, p.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", p.addEventListener("input", () => {
|
|
134
|
+
e.taxCode = p.value, p.classList.remove(
|
|
135
135
|
"wgt:border-semantic-error",
|
|
136
136
|
"wgt:bg-semantic-error-50"
|
|
137
|
-
),
|
|
137
|
+
), s();
|
|
138
138
|
});
|
|
139
|
-
const
|
|
139
|
+
const f = O({
|
|
140
140
|
type: "button",
|
|
141
|
-
title:
|
|
141
|
+
title: i("fetch_info"),
|
|
142
142
|
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",
|
|
143
143
|
handleClick: () => Z(null, null, function* () {
|
|
144
144
|
if (e.noTaxCode || typeof t != "function")
|
|
145
145
|
return;
|
|
146
146
|
const N = String(e.taxCode || "").trim();
|
|
147
147
|
if (!N) {
|
|
148
|
-
|
|
148
|
+
p.classList.add(
|
|
149
149
|
"wgt:border-semantic-error",
|
|
150
150
|
"wgt:bg-semantic-error-50"
|
|
151
151
|
);
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
154
|
try {
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
if (!
|
|
158
|
-
|
|
159
|
-
} catch (
|
|
160
|
-
|
|
155
|
+
f.disabled = !0;
|
|
156
|
+
const c = yield t(N, P({}, e));
|
|
157
|
+
if (!c || typeof c != "object") return;
|
|
158
|
+
c.representativeName != null && (e.representativeName = String(c.representativeName || ""), A.value = e.representativeName), c.buyerAddress != null && (e.buyerAddress = String(c.buyerAddress || ""), a.value = e.buyerAddress), s();
|
|
159
|
+
} catch (c) {
|
|
160
|
+
p.classList.add(
|
|
161
161
|
"wgt:border-semantic-error",
|
|
162
162
|
"wgt:bg-semantic-error-50"
|
|
163
163
|
);
|
|
164
164
|
} finally {
|
|
165
|
-
|
|
165
|
+
f.disabled = e.noTaxCode;
|
|
166
166
|
}
|
|
167
167
|
})
|
|
168
168
|
});
|
|
169
|
-
|
|
170
|
-
const { field:
|
|
171
|
-
label:
|
|
169
|
+
y.appendChild(p), y.appendChild(f), x.appendChild(M), x.appendChild(y);
|
|
170
|
+
const { field: E, input: A } = o({
|
|
171
|
+
label: i("representativeName"),
|
|
172
172
|
required: !0,
|
|
173
173
|
name: "representativeName",
|
|
174
|
-
placeholder:
|
|
175
|
-
}), { field:
|
|
176
|
-
label:
|
|
174
|
+
placeholder: i("representativeName_input")
|
|
175
|
+
}), { field: C, input: a } = o({
|
|
176
|
+
label: i("buyerAddress"),
|
|
177
177
|
required: !1,
|
|
178
178
|
name: "buyerAddress",
|
|
179
|
-
placeholder:
|
|
180
|
-
}), { field:
|
|
181
|
-
label:
|
|
179
|
+
placeholder: i("buyerAddress_input")
|
|
180
|
+
}), { field: w, input: m } = o({
|
|
181
|
+
label: i("performerName"),
|
|
182
182
|
required: !0,
|
|
183
183
|
name: "performerName",
|
|
184
|
-
placeholder:
|
|
185
|
-
}), { field: B, input: S } =
|
|
186
|
-
label:
|
|
184
|
+
placeholder: i("performerName_input")
|
|
185
|
+
}), { field: B, input: S } = o({
|
|
186
|
+
label: i("email"),
|
|
187
187
|
required: !0,
|
|
188
188
|
name: "email",
|
|
189
189
|
type: "email",
|
|
190
|
-
placeholder:
|
|
191
|
-
}), { field:
|
|
192
|
-
label:
|
|
190
|
+
placeholder: i("email_input")
|
|
191
|
+
}), { field: H, input: T } = o({
|
|
192
|
+
label: i("phone"),
|
|
193
193
|
required: !0,
|
|
194
194
|
name: "phone",
|
|
195
195
|
type: "tel",
|
|
196
|
-
placeholder:
|
|
196
|
+
placeholder: i("phone_input")
|
|
197
197
|
});
|
|
198
|
-
|
|
199
|
-
function
|
|
198
|
+
l.appendChild(g), l.appendChild(x), l.appendChild(E), l.appendChild(C), l.appendChild(w), l.appendChild(B), l.appendChild(H), p.disabled = e.noTaxCode, f.disabled = e.noTaxCode;
|
|
199
|
+
function _() {
|
|
200
200
|
let N = !0;
|
|
201
|
-
function
|
|
201
|
+
function c(u) {
|
|
202
202
|
u.classList.add(
|
|
203
203
|
"wgt:border-semantic-error",
|
|
204
204
|
"wgt:bg-semantic-error-50 ",
|
|
205
205
|
"wgt:mt-2"
|
|
206
206
|
), N = !1;
|
|
207
207
|
}
|
|
208
|
-
return !e.noTaxCode && !e.taxCode.trim() &&
|
|
208
|
+
return !e.noTaxCode && !e.taxCode.trim() && c(p), e.representativeName.trim() || c(A), e.performerName.trim() || c(m), e.email.trim() || c(S), e.phone.trim() || c(T), N;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
return
|
|
210
|
+
function k() {
|
|
211
|
+
return P({}, e);
|
|
212
212
|
}
|
|
213
|
-
return { container:
|
|
213
|
+
return { container: l, getValues: k, validate: _ };
|
|
214
214
|
}
|
|
215
215
|
function ee({
|
|
216
|
-
type:
|
|
217
|
-
data:
|
|
216
|
+
type: r,
|
|
217
|
+
data: n,
|
|
218
218
|
orderInfo: t,
|
|
219
219
|
theme: e,
|
|
220
|
-
onClose:
|
|
221
|
-
onConfirm:
|
|
220
|
+
onClose: l,
|
|
221
|
+
onConfirm: s
|
|
222
222
|
}) {
|
|
223
|
-
const
|
|
224
|
-
|
|
223
|
+
const o = document.createElement("div");
|
|
224
|
+
o.className = "wgt:fixed wgt:inset-0 wgt:flex wgt:items-center wgt:justify-center wgt:z-50 wgt:p-4", o.style.cssText = `
|
|
225
225
|
background-color: rgba(0, 0, 0, 0.5);
|
|
226
226
|
backdrop-filter: blur(4px);
|
|
227
|
-
`, e &&
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
|
|
227
|
+
`, e && o.setAttribute("data-theme", e);
|
|
228
|
+
const g = document.createElement("div");
|
|
229
|
+
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";
|
|
230
|
+
const d = document.createElement("div");
|
|
231
|
+
d.className = "wgt:px-6 wgt:pt-6 wgt:pb-4 wgt:space-y-2";
|
|
232
|
+
const h = document.createElement("h3");
|
|
233
|
+
h.className = "wgt:text-xl wgt:font-semibold wgt:text-center wgt:text-strong-950", h.textContent = i("confirmation_popup_title");
|
|
234
234
|
const x = document.createElement("p");
|
|
235
|
-
x.className = "wgt:text-sm wgt:text-center wgt:text-[#525866]", x.textContent =
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
function
|
|
241
|
-
const
|
|
242
|
-
|
|
235
|
+
x.className = "wgt:text-sm wgt:text-center wgt:text-[#525866]", x.textContent = i("confirmation_popup_subtitle"), d.appendChild(h), d.appendChild(x), g.appendChild(d);
|
|
236
|
+
const M = document.createElement("div");
|
|
237
|
+
M.className = "wgt:px-6 wgt:pb-4";
|
|
238
|
+
const y = document.createElement("div");
|
|
239
|
+
y.className = "wgt:space-y-3 wgt:rounded-xl wgt:bg-weak-50 wgt:px-4 wgt:py-3";
|
|
240
|
+
function p(H, T, _) {
|
|
241
|
+
const k = document.createElement("div");
|
|
242
|
+
k.className = "wgt:flex wgt:items-start wgt:gap-3";
|
|
243
243
|
const N = document.createElement("span");
|
|
244
|
-
N.className = "wgt:text-primary wgt:flex-shrink-0", N.innerHTML =
|
|
245
|
-
const
|
|
246
|
-
|
|
244
|
+
N.className = "wgt:text-primary wgt:flex-shrink-0", N.innerHTML = H;
|
|
245
|
+
const c = document.createElement("div");
|
|
246
|
+
c.className = "wgt:flex wgt:items-start wgt:justify-between wgt:flex-1 wgt:gap-2";
|
|
247
247
|
const u = document.createElement("span");
|
|
248
248
|
u.className = "wgt:text-sm wgt:text-[#525866] wgt:w-1/3", u.textContent = T;
|
|
249
|
-
const
|
|
250
|
-
return
|
|
249
|
+
const L = document.createElement("span");
|
|
250
|
+
return L.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:text-right wgt:w-2/3", L.textContent = _ || "-", c.appendChild(u), c.appendChild(L), k.appendChild(N), k.appendChild(c), k;
|
|
251
251
|
}
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
252
|
+
const f = '<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>', E = '<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>', A = '<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>';
|
|
253
|
+
y.appendChild(
|
|
254
|
+
p(
|
|
255
|
+
f,
|
|
256
|
+
i("confirmation_popup_orderCode"),
|
|
257
257
|
t == null ? void 0 : t.billNo
|
|
258
258
|
)
|
|
259
|
-
),
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
259
|
+
), y.appendChild(
|
|
260
|
+
p(
|
|
261
|
+
E,
|
|
262
|
+
i("confirmation_popup_address"),
|
|
263
263
|
t == null ? void 0 : t.merchantAddress
|
|
264
264
|
)
|
|
265
|
-
),
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
265
|
+
), y.appendChild(
|
|
266
|
+
p(
|
|
267
|
+
A,
|
|
268
|
+
i("confirmation_popup_totalAmount"),
|
|
269
|
+
U(t == null ? void 0 : t.amount) + " VND"
|
|
270
270
|
)
|
|
271
|
-
),
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
function
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
const
|
|
280
|
-
|
|
271
|
+
), M.appendChild(y), g.appendChild(M);
|
|
272
|
+
const C = document.createElement("div");
|
|
273
|
+
C.className = "wgt:px-6 wgt:pb-6";
|
|
274
|
+
const a = document.createElement("div");
|
|
275
|
+
a.className = "wgt:space-y-3 wgt:rounded-xl wgt:border wgt:border-[#E1E4EA] wgt:px-4 wgt:py-4";
|
|
276
|
+
function w(H, T) {
|
|
277
|
+
const _ = document.createElement("div");
|
|
278
|
+
_.className = "wgt:flex wgt:items-start wgt:justify-between wgt:gap-4";
|
|
279
|
+
const k = document.createElement("span");
|
|
280
|
+
k.className = "wgt:text-sm wgt:text-[#0E121B] wgt:w-1/3", k.textContent = H;
|
|
281
281
|
const N = document.createElement("span");
|
|
282
|
-
return N.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:text-right wgt:w-2/3", N.textContent = T || "-",
|
|
282
|
+
return N.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:text-right wgt:w-2/3", N.textContent = T || "-", _.appendChild(k), _.appendChild(N), _;
|
|
283
283
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
),
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
284
|
+
r === "business" ? (a.appendChild(
|
|
285
|
+
w(i("confirmation_popup_taxCode"), n.taxCode)
|
|
286
|
+
), a.appendChild(
|
|
287
|
+
w(
|
|
288
|
+
i("confirmation_popup_representativeName"),
|
|
289
|
+
n.representativeName
|
|
290
290
|
)
|
|
291
|
-
),
|
|
292
|
-
|
|
293
|
-
),
|
|
294
|
-
|
|
295
|
-
),
|
|
296
|
-
|
|
297
|
-
),
|
|
298
|
-
|
|
299
|
-
)) : (
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
291
|
+
), a.appendChild(
|
|
292
|
+
w(i("confirmation_popup_buyerAddress"), n.buyerAddress)
|
|
293
|
+
), a.appendChild(
|
|
294
|
+
w(i("confirmation_popup_performerName"), n.performerName)
|
|
295
|
+
), a.appendChild(
|
|
296
|
+
w(i("confirmation_popup_email"), n.email)
|
|
297
|
+
), a.appendChild(
|
|
298
|
+
w(i("confirmation_popup_phone"), n.phone)
|
|
299
|
+
)) : (a.appendChild(
|
|
300
|
+
w(
|
|
301
|
+
i("confirmation_popup_representativeName"),
|
|
302
|
+
n.representativeName
|
|
303
303
|
)
|
|
304
|
-
),
|
|
305
|
-
|
|
306
|
-
),
|
|
307
|
-
|
|
308
|
-
)),
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
const B =
|
|
304
|
+
), a.appendChild(
|
|
305
|
+
w(i("confirmation_popup_buyerAddress"), n.buyerAddress)
|
|
306
|
+
), a.appendChild(
|
|
307
|
+
w(i("confirmation_popup_email"), n.email)
|
|
308
|
+
)), C.appendChild(a), g.appendChild(C);
|
|
309
|
+
const m = document.createElement("div");
|
|
310
|
+
m.className = "wgt:px-6 wgt:pb-6 wgt:flex wgt:gap-3";
|
|
311
|
+
const B = O({
|
|
312
312
|
type: "button",
|
|
313
313
|
title: "Đóng",
|
|
314
314
|
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",
|
|
315
315
|
handleClick: () => {
|
|
316
|
-
typeof
|
|
316
|
+
typeof l == "function" && l(), o.remove();
|
|
317
317
|
}
|
|
318
|
-
}), S =
|
|
318
|
+
}), S = O({
|
|
319
319
|
type: "button",
|
|
320
320
|
title: "Xác nhận",
|
|
321
321
|
className: "wgt:flex-1 wgt:py-3 wgt:text-sm wgt:font-semibold wgt:rounded-[8px] wgt:bg-primary wgt:text-white",
|
|
322
322
|
handleClick: () => {
|
|
323
|
-
typeof
|
|
323
|
+
typeof s == "function" && s({ type: r, data: n }), o.remove();
|
|
324
324
|
}
|
|
325
325
|
});
|
|
326
|
-
return
|
|
327
|
-
|
|
328
|
-
}), { overlay:
|
|
326
|
+
return m.appendChild(B), m.appendChild(S), g.appendChild(m), o.appendChild(g), o.addEventListener("click", (H) => {
|
|
327
|
+
H.target === o && (typeof l == "function" && l(), o.remove());
|
|
328
|
+
}), { overlay: o };
|
|
329
329
|
}
|
|
330
330
|
function te({
|
|
331
|
-
orderInfo:
|
|
332
|
-
onPreview:
|
|
331
|
+
orderInfo: r,
|
|
332
|
+
onPreview: n,
|
|
333
333
|
theme: t,
|
|
334
334
|
onSubmit: e,
|
|
335
|
-
taxCode:
|
|
335
|
+
taxCode: l = ""
|
|
336
336
|
}) {
|
|
337
|
+
const s = document.createElement("div");
|
|
338
|
+
s.className = "wgt:flex wgt:flex-col wgt:items-center wgt:justify-between wgt:h-full wgt:shadow wgt:rounded-xl", t && s.setAttribute("data-theme", t);
|
|
337
339
|
const o = document.createElement("div");
|
|
338
|
-
o.className = "wgt:
|
|
339
|
-
const a = document.createElement("div");
|
|
340
|
-
a.className = "wgt:w-full wgt:max-w-md wgt:space-y-4 wgt:rounded-xl wgt:bg-white wgt:p-4", o.appendChild(a);
|
|
340
|
+
o.className = "wgt:w-full wgt:max-w-md wgt:space-y-4 wgt:rounded-xl wgt:bg-white wgt:p-4", s.appendChild(o);
|
|
341
341
|
const {
|
|
342
|
-
container:
|
|
343
|
-
open:
|
|
344
|
-
close:
|
|
342
|
+
container: g,
|
|
343
|
+
open: d,
|
|
344
|
+
close: h
|
|
345
345
|
} = J();
|
|
346
|
-
|
|
346
|
+
s.style.position = s.style.position || "relative", s.appendChild(g);
|
|
347
347
|
const x = document.createElement("div");
|
|
348
348
|
x.className = "wgt:space-y-1";
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
function
|
|
356
|
-
const
|
|
357
|
-
|
|
349
|
+
const M = document.createElement("h3");
|
|
350
|
+
M.className = "wgt:text-2xl wgt:font-semibold wgt:text-text-black wgt:text-center wgt:justify-center", M.textContent = i("invoiceform_title");
|
|
351
|
+
const y = document.createElement("p");
|
|
352
|
+
y.className = "wgt:text-sm wgt:text-weak-700 wgt:text-center wgt:justify-center", y.textContent = i("invoiceform_subtitle"), x.appendChild(M), x.appendChild(y), o.appendChild(x);
|
|
353
|
+
const p = document.createElement("div");
|
|
354
|
+
p.className = "wgt:mt-2 wgt:space-y-3 wgt:rounded-xl wgt:bg-weak-50 wgt:px-6 wgt:py-6";
|
|
355
|
+
function f(c, u) {
|
|
356
|
+
const L = document.createElement("div");
|
|
357
|
+
L.className = "wgt:flex wgt:items-start";
|
|
358
358
|
const V = document.createElement("div");
|
|
359
359
|
V.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:w-1/3";
|
|
360
360
|
const F = document.createElement("span");
|
|
361
361
|
F.className = "wgt:inline-flex wgt:items-center wgt:justify-center wgt:w-4 wgt:h-4 wgt:text-icon-primary";
|
|
362
|
-
let
|
|
363
|
-
|
|
362
|
+
let v = "";
|
|
363
|
+
c === i("orderCode") ? v = `
|
|
364
364
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
365
365
|
<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"/>
|
|
366
366
|
</svg>
|
|
367
367
|
|
|
368
|
-
` :
|
|
368
|
+
` : c === i("address_form") ? v = `
|
|
369
369
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
370
370
|
<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"/>
|
|
371
371
|
</svg>
|
|
372
372
|
|
|
373
|
-
` :
|
|
373
|
+
` : c === i("total_amount") && (v = `
|
|
374
374
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
375
375
|
<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"/>
|
|
376
376
|
</svg>
|
|
377
377
|
|
|
378
|
-
`), F.innerHTML =
|
|
379
|
-
const
|
|
380
|
-
|
|
378
|
+
`), F.innerHTML = v;
|
|
379
|
+
const b = document.createElement("span");
|
|
380
|
+
b.className = "wgt:text-sm wgt:text-weak-700", b.textContent = c, V.appendChild(F), V.appendChild(b);
|
|
381
381
|
const j = document.createElement("span");
|
|
382
|
-
return j.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:w-2/3 wgt:text-right", j.textContent = u,
|
|
382
|
+
return j.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:w-2/3 wgt:text-right", j.textContent = u, L.appendChild(V), L.appendChild(j), L;
|
|
383
383
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
),
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
384
|
+
p.appendChild(f(i("orderCode"), r == null ? void 0 : r.billNo)), p.appendChild(
|
|
385
|
+
f(i("address_form"), r == null ? void 0 : r.merchantAddress)
|
|
386
|
+
), p.appendChild(
|
|
387
|
+
f(
|
|
388
|
+
i("total_amount"),
|
|
389
|
+
U(r == null ? void 0 : r.amount) + " VND"
|
|
390
390
|
)
|
|
391
|
-
),
|
|
392
|
-
const
|
|
393
|
-
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
|
|
391
|
+
), o.appendChild(p);
|
|
392
|
+
const E = document.createElement("div");
|
|
393
|
+
E.className = "wgt:mt-4 wgt:rounded-xl wgt:border wgt:border-[#E1E4EA] wgt:bg-white wgt:pb-6", o.appendChild(E);
|
|
394
|
+
const A = document.createElement("div");
|
|
395
|
+
A.className = "wgt:flex wgt:border-b wgt:border-[#E1E4EA]", E.appendChild(A);
|
|
396
|
+
const C = document.createElement("button");
|
|
397
|
+
C.type = "button", C.className = "wgt:relative wgt:flex-1 wgt:py-4 wgt:text-sm wgt:font-semibold ", C.innerHTML = `
|
|
398
398
|
<span class="wgt:flex wgt:items-center wgt:justify-center wgt:gap-2">
|
|
399
399
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
400
400
|
<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"/>
|
|
401
401
|
</svg>
|
|
402
402
|
|
|
403
|
-
${
|
|
403
|
+
${i("individual")}
|
|
404
404
|
</span>
|
|
405
405
|
`;
|
|
406
|
-
const
|
|
407
|
-
|
|
406
|
+
const a = document.createElement("button");
|
|
407
|
+
a.type = "button", a.className = "wgt:relative wgt:flex-1 wgt:py-4 wgt:text-sm wgt:font-semibold", a.innerHTML = `
|
|
408
408
|
<span class="wgt:flex wgt:items-center wgt:justify-center wgt:gap-2">
|
|
409
409
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
410
410
|
<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"/>
|
|
411
411
|
</svg>
|
|
412
412
|
|
|
413
|
-
${
|
|
413
|
+
${i("business")}
|
|
414
414
|
</span>
|
|
415
|
-
`,
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
const
|
|
419
|
-
defaultValues: { taxCode:
|
|
420
|
-
onFetchByTaxCode: (
|
|
421
|
-
var
|
|
422
|
-
const u = yield K(
|
|
415
|
+
`, A.appendChild(C), A.appendChild(a);
|
|
416
|
+
const w = document.createElement("div");
|
|
417
|
+
w.className = "wgt:mt-4 wgt:px-4", E.appendChild(w);
|
|
418
|
+
const m = Y(), B = D({
|
|
419
|
+
defaultValues: { taxCode: l || "" },
|
|
420
|
+
onFetchByTaxCode: (c) => Z(null, null, function* () {
|
|
421
|
+
var L, V;
|
|
422
|
+
const u = yield K(c);
|
|
423
423
|
return {
|
|
424
|
-
representativeName: (
|
|
424
|
+
representativeName: (L = u.nguoi_dai_dien) != null ? L : "",
|
|
425
425
|
buyerAddress: (V = u.dia_chi) != null ? V : ""
|
|
426
426
|
};
|
|
427
427
|
})
|
|
428
428
|
});
|
|
429
|
-
let S = "individual",
|
|
430
|
-
function T(
|
|
431
|
-
S =
|
|
429
|
+
let S = "individual", H = m;
|
|
430
|
+
function T(c) {
|
|
431
|
+
S = c, C.style.borderBottom = "none", a.style.borderBottom = "none";
|
|
432
432
|
const u = "wgt:relative wgt:flex-1 wgt:py-4 wgt:text-sm wgt:font-semibold";
|
|
433
|
-
|
|
433
|
+
c === "individual" ? (C.className = `${u} wgt:text-strong-950`, C.style.borderBottom = "2px solid var(--primary)", a.className = `${u} wgt:text-soft-400`, w.innerHTML = "", w.appendChild(m.container), H = m) : (a.className = `${u} wgt:text-strong-950`, a.style.borderBottom = "2px solid var(--primary)", C.className = `${u} wgt:text-soft-400`, w.innerHTML = "", w.appendChild(B.container), H = B);
|
|
434
434
|
}
|
|
435
|
-
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
const
|
|
439
|
-
|
|
440
|
-
const N =
|
|
435
|
+
C.addEventListener("click", () => T("individual")), a.addEventListener("click", () => T("business")), T("individual");
|
|
436
|
+
const _ = document.createElement("p");
|
|
437
|
+
_.className = "wgt:mt-2 wgt:text-xs wgt:text-[#FF8447] wgt:text-left wgt:justify-center", _.textContent = i("invoiceform_note"), o.appendChild(_);
|
|
438
|
+
const k = document.createElement("div");
|
|
439
|
+
k.className = "wgt:mt-6 wgt:w-full wgt:flex wgt:justify-center wgt:items-center";
|
|
440
|
+
const N = O({
|
|
441
441
|
type: "button",
|
|
442
|
-
title:
|
|
442
|
+
title: i("btn_preview"),
|
|
443
443
|
className: "wgt:min-w-[163px] wgt:text-white",
|
|
444
444
|
handleClick: () => {
|
|
445
|
-
if (!
|
|
445
|
+
if (!H.validate())
|
|
446
446
|
return;
|
|
447
|
-
const
|
|
447
|
+
const c = {
|
|
448
448
|
type: S,
|
|
449
|
-
data:
|
|
449
|
+
data: H.getValues()
|
|
450
450
|
}, { overlay: u } = ee({
|
|
451
|
-
type:
|
|
452
|
-
data:
|
|
453
|
-
orderInfo:
|
|
451
|
+
type: c.type,
|
|
452
|
+
data: c.data,
|
|
453
|
+
orderInfo: r,
|
|
454
454
|
theme: t,
|
|
455
455
|
onClose: () => {
|
|
456
456
|
console.log("Popup closed");
|
|
457
457
|
},
|
|
458
458
|
onConfirm: () => Z(null, null, function* () {
|
|
459
|
-
var
|
|
460
|
-
u.remove(),
|
|
459
|
+
var L, V, F;
|
|
460
|
+
u.remove(), d();
|
|
461
461
|
try {
|
|
462
462
|
if (typeof e != "function") return;
|
|
463
|
-
const
|
|
464
|
-
type:
|
|
465
|
-
data:
|
|
466
|
-
}),
|
|
467
|
-
if (
|
|
468
|
-
|
|
469
|
-
message:
|
|
470
|
-
description:
|
|
463
|
+
const v = yield e({
|
|
464
|
+
type: c.type,
|
|
465
|
+
data: c.data
|
|
466
|
+
}), b = (F = (V = (L = v == null ? void 0 : v.finalData) != null ? L : v == null ? void 0 : v.data) != null ? V : v) != null ? F : {}, j = String((b == null ? void 0 : b.status) || "").trim().toLowerCase();
|
|
467
|
+
if (h(), j === "invoiced") {
|
|
468
|
+
R({
|
|
469
|
+
message: i("invoice_success"),
|
|
470
|
+
description: i("invoice_description"),
|
|
471
471
|
// okLabel: t('close'),
|
|
472
472
|
isSuccess: !0,
|
|
473
473
|
hideOkButton: !0,
|
|
@@ -477,9 +477,9 @@ function te({
|
|
|
477
477
|
return;
|
|
478
478
|
}
|
|
479
479
|
if (j === "failed") {
|
|
480
|
-
|
|
481
|
-
message:
|
|
482
|
-
description:
|
|
480
|
+
R({
|
|
481
|
+
message: i("invoice_failed"),
|
|
482
|
+
description: i("invoice_description_failed"),
|
|
483
483
|
// okLabel: t('close'),
|
|
484
484
|
isSuccess: !1,
|
|
485
485
|
hideOkButton: !0,
|
|
@@ -488,52 +488,52 @@ function te({
|
|
|
488
488
|
}).open();
|
|
489
489
|
return;
|
|
490
490
|
}
|
|
491
|
-
} catch (
|
|
492
|
-
|
|
493
|
-
message:
|
|
494
|
-
description:
|
|
491
|
+
} catch (v) {
|
|
492
|
+
h(), R({
|
|
493
|
+
message: i("invoice_failed"),
|
|
494
|
+
description: i("invoice_description_failed"),
|
|
495
495
|
// okLabel: t('close'),
|
|
496
496
|
isSuccess: !1,
|
|
497
497
|
hideOkButton: !0,
|
|
498
498
|
closeOnClickOutside: !1,
|
|
499
499
|
theme: t
|
|
500
|
-
}).open(), console.error(
|
|
500
|
+
}).open(), console.error(v);
|
|
501
501
|
}
|
|
502
502
|
})
|
|
503
503
|
});
|
|
504
504
|
document.body.appendChild(u);
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
|
-
return
|
|
507
|
+
return k.appendChild(N), o.appendChild(k), { container: s };
|
|
508
508
|
}
|
|
509
|
-
function ne({ theme:
|
|
509
|
+
function ne({ theme: r, onClose: n } = {}) {
|
|
510
510
|
const t = document.createElement("div");
|
|
511
|
-
t.className = " wgt:flex wgt:h-screen wgt:bg-[#F3F4F6] wgt:p-4",
|
|
511
|
+
t.className = " wgt:flex wgt:h-screen wgt:bg-[#F3F4F6] wgt:p-4", r && t.setAttribute("data-theme", r);
|
|
512
512
|
const e = document.createElement("div");
|
|
513
513
|
e.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";
|
|
514
|
+
const l = document.createElement("div");
|
|
515
|
+
l.className = "wgt:flex wgt:justify-center wgt:mb-4";
|
|
514
516
|
const s = document.createElement("div");
|
|
515
|
-
s.className = "wgt:flex wgt:
|
|
516
|
-
const o = document.createElement("div");
|
|
517
|
-
o.className = "wgt:w-12 wgt:h-12 wgt:rounded-full wgt:flex wgt:items-center wgt:justify-center", o.style.backgroundColor = "#335CFF", o.innerHTML = `
|
|
517
|
+
s.className = "wgt:w-12 wgt:h-12 wgt:rounded-full wgt:flex wgt:items-center wgt:justify-center", s.style.backgroundColor = "#335CFF", s.innerHTML = `
|
|
518
518
|
<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
519
519
|
<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"/>
|
|
520
520
|
</svg>
|
|
521
521
|
|
|
522
|
-
`,
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
const
|
|
526
|
-
return
|
|
522
|
+
`, l.appendChild(s), e.appendChild(l);
|
|
523
|
+
const o = document.createElement("h2");
|
|
524
|
+
o.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", o.textContent = i("invoiceCheckout_title"), e.appendChild(o);
|
|
525
|
+
const g = document.createElement("p");
|
|
526
|
+
return g.className = "wgt:text-sm wgt:text-[#525866] wgt:leading-relaxed", g.textContent = i("invoiceCheckout_description"), e.appendChild(g), t.appendChild(e), { container: t };
|
|
527
527
|
}
|
|
528
|
-
function ie({ theme:
|
|
528
|
+
function ie({ theme: r, onClose: n } = {}) {
|
|
529
529
|
const t = document.createElement("div");
|
|
530
|
-
t.className = "wgt:min-h-screen wgt:flex wgt:bg-[#F3F4F6] wgt:p-4",
|
|
530
|
+
t.className = "wgt:min-h-screen wgt:flex wgt:bg-[#F3F4F6] wgt:p-4", r && t.setAttribute("data-theme", r);
|
|
531
531
|
const e = document.createElement("div");
|
|
532
532
|
e.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";
|
|
533
|
+
const l = document.createElement("div");
|
|
534
|
+
l.className = "wgt:flex wgt:justify-center wgt:mb-2";
|
|
533
535
|
const s = document.createElement("div");
|
|
534
|
-
s.
|
|
535
|
-
const o = document.createElement("div");
|
|
536
|
-
o.innerHTML = `
|
|
536
|
+
s.innerHTML = `
|
|
537
537
|
<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
538
538
|
<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"/>
|
|
539
539
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M36.6582 10.4023H40.9028V14.1966H36.6582V10.4023Z" fill="#99A0AE"/>
|
|
@@ -551,23 +551,23 @@ function ie({ theme: n, onClose: i } = {}) {
|
|
|
551
551
|
<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"/>
|
|
552
552
|
</svg>
|
|
553
553
|
|
|
554
|
-
`,
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
const
|
|
560
|
-
return
|
|
554
|
+
`, l.appendChild(s), e.appendChild(l);
|
|
555
|
+
const o = document.createElement("h2");
|
|
556
|
+
o.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", o.textContent = i("invoiceExpired_title"), e.appendChild(o);
|
|
557
|
+
const g = document.createElement("p");
|
|
558
|
+
g.className = "wgt:text-sm wgt:text-[#525866] wgt:leading-relaxed wgt:px-2 wgt:mb-3", g.textContent = i("invoiceExpired_description"), e.appendChild(g);
|
|
559
|
+
const d = document.createElement("p");
|
|
560
|
+
return d.className = "wgt:text-sm wgt:text-[#99A0AE] wgt:italic wgt:leading-relaxed wgt:px-4", d.textContent = i("invoiceExpired_note"), e.appendChild(d), t.appendChild(e), { container: t };
|
|
561
561
|
}
|
|
562
|
-
function re({ theme:
|
|
562
|
+
function re({ theme: r, onClose: n } = {}) {
|
|
563
563
|
const t = document.createElement("div");
|
|
564
|
-
t.className = "wgt:min-h-screen wgt:flex wgt:items-center wgt:bg-[#F3F4F6] wgt:p-4 wgt:justify-center",
|
|
564
|
+
t.className = "wgt:min-h-screen wgt:flex wgt:items-center wgt:bg-[#F3F4F6] wgt:p-4 wgt:justify-center", r && t.setAttribute("data-theme", r);
|
|
565
565
|
const e = document.createElement("div");
|
|
566
566
|
e.className = "wgt:w-full wgt:items-center wgt:flex wgt:flex-col wgt:min-h-screen wgt:justify-center wgt:bg-white wgt:rounded-2xl wgt:shadow-sm wgt:px-4 wgt:py-5 wgt:text-center";
|
|
567
|
+
const l = document.createElement("div");
|
|
568
|
+
l.className = "wgt:flex wgt:justify-center wgt:mb-2 wgt:items-center wgt:justify-center";
|
|
567
569
|
const s = document.createElement("div");
|
|
568
|
-
s.
|
|
569
|
-
const o = document.createElement("div");
|
|
570
|
-
o.innerHTML = `
|
|
570
|
+
s.innerHTML = `
|
|
571
571
|
<svg width="148" height="148" viewBox="0 0 148 148" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
572
572
|
<path d="M135.244 83.385C135.244 100.471 128.265 115.873 117.075 126.943C106.125 137.892 90.9645 144.51 74.2393 144.51C57.6344 144.51 42.4734 137.772 31.4035 126.943C20.2132 115.873 13.2344 100.471 13.2344 83.385C13.2344 49.5736 40.5482 22.2598 74.2393 22.2598C107.93 22.2598 135.244 49.6939 135.244 83.385Z" fill="#F1F3FA" stroke="#D5DAE5" stroke-width="1.58571" stroke-miterlimit="10"/>
|
|
573
573
|
<path d="M65.7815 28.5312L61.2562 44.4926L72.0884 51.9999L71.3267 70.3394L84.999 45.2472L78.6484 40.1734L85.9114 28.5312H94.065L118.732 55.3638L119.694 132.853C119.694 135.5 117.528 137.546 114.881 137.546H39.317C36.6697 137.546 34.5039 135.38 34.5039 132.853V33.224C34.5039 30.5768 36.6697 28.5312 39.317 28.5312H65.7815Z" fill="white" stroke="#D5DAE5" stroke-width="1.58571" stroke-miterlimit="10" stroke-linejoin="round"/>
|
|
@@ -583,121 +583,121 @@ function re({ theme: n, onClose: i } = {}) {
|
|
|
583
583
|
</svg>
|
|
584
584
|
|
|
585
585
|
|
|
586
|
-
`,
|
|
587
|
-
const
|
|
588
|
-
return
|
|
586
|
+
`, l.appendChild(s), e.appendChild(l);
|
|
587
|
+
const o = document.createElement("h2");
|
|
588
|
+
return o.className = "wgt:text-base wgt:font-medium wgt:text-[#99A0AE] wgt:mb-2", o.textContent = i("order_not_found_title"), e.appendChild(o), t.appendChild(e), { container: t };
|
|
589
589
|
}
|
|
590
|
-
function
|
|
591
|
-
return String(
|
|
590
|
+
function z(r) {
|
|
591
|
+
return String(r || "").trim().toLowerCase();
|
|
592
592
|
}
|
|
593
|
-
function ge({ uuid:
|
|
593
|
+
function ge({ uuid: r, orderInfo: n, theme: t }) {
|
|
594
|
+
var C;
|
|
594
595
|
const e = document.createElement("div");
|
|
595
596
|
e.className = "wgt:w-full wgt:min-h-screen";
|
|
596
|
-
let
|
|
597
|
-
function
|
|
598
|
-
|
|
597
|
+
let l = !1;
|
|
598
|
+
function s(a) {
|
|
599
|
+
l || (e.innerHTML = "", e.appendChild(a));
|
|
599
600
|
}
|
|
600
|
-
|
|
601
|
+
const o = new URLSearchParams(window.location.search || "");
|
|
602
|
+
o.has("uuid");
|
|
603
|
+
const d = String((C = o.get("uuid")) != null ? C : "").trim() || String(r || "").trim();
|
|
604
|
+
function h() {
|
|
601
605
|
return Z(this, null, function* () {
|
|
602
|
-
yield
|
|
606
|
+
yield f();
|
|
603
607
|
});
|
|
604
608
|
}
|
|
605
|
-
function
|
|
606
|
-
const
|
|
607
|
-
|
|
608
|
-
theme: t,
|
|
609
|
-
onSubmit: (w) => Z(null, [w], function* ({ type: M, data: v }) {
|
|
610
|
-
try {
|
|
611
|
-
const m = oe(M, v);
|
|
612
|
-
return yield Q(n, m), { ok: !0, finalData: yield se(n, {
|
|
613
|
-
maxTries: 20,
|
|
614
|
-
intervalMs: 1500
|
|
615
|
-
}) };
|
|
616
|
-
} catch (m) {
|
|
617
|
-
throw m;
|
|
618
|
-
}
|
|
619
|
-
}),
|
|
620
|
-
onBack: a
|
|
609
|
+
function x() {
|
|
610
|
+
const a = re({
|
|
611
|
+
theme: t
|
|
621
612
|
});
|
|
622
|
-
|
|
613
|
+
s(a.container);
|
|
623
614
|
}
|
|
624
|
-
function
|
|
625
|
-
const
|
|
615
|
+
function M() {
|
|
616
|
+
const a = ie({
|
|
626
617
|
theme: t
|
|
627
618
|
});
|
|
628
|
-
|
|
619
|
+
s(a.container);
|
|
629
620
|
}
|
|
630
|
-
function
|
|
631
|
-
const
|
|
621
|
+
function y(a) {
|
|
622
|
+
const w = ne({
|
|
632
623
|
theme: t
|
|
633
624
|
});
|
|
634
|
-
|
|
625
|
+
s(w.container);
|
|
635
626
|
}
|
|
636
|
-
function
|
|
637
|
-
const
|
|
638
|
-
|
|
627
|
+
function p(a) {
|
|
628
|
+
const w = te({
|
|
629
|
+
orderInfo: a || {},
|
|
630
|
+
theme: t,
|
|
631
|
+
onSubmit: (S) => Z(null, [S], function* ({ type: m, data: B }) {
|
|
632
|
+
if (!d) {
|
|
633
|
+
const _ = new Error("Missing uuid");
|
|
634
|
+
throw _.code = "MISSING_UUID", _;
|
|
635
|
+
}
|
|
636
|
+
const H = oe(m, B);
|
|
637
|
+
return yield Q(d, H), { ok: !0, finalData: yield se(d, {
|
|
638
|
+
maxTries: 20,
|
|
639
|
+
intervalMs: 1500
|
|
640
|
+
}) };
|
|
641
|
+
}),
|
|
642
|
+
onBack: h
|
|
639
643
|
});
|
|
640
|
-
|
|
644
|
+
s(w.container);
|
|
641
645
|
}
|
|
642
|
-
function
|
|
646
|
+
function f() {
|
|
643
647
|
return Z(this, null, function* () {
|
|
644
648
|
try {
|
|
645
|
-
const
|
|
646
|
-
if (String((
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
return console.error("[EINV_FLOW] loadAndRender error:", l), x();
|
|
649
|
+
const a = yield $(d);
|
|
650
|
+
if (String((a == null ? void 0 : a.message) || "").trim()) return x();
|
|
651
|
+
const m = z(a == null ? void 0 : a.status);
|
|
652
|
+
return m === "expired" ? M() : m === "invoiced" ? y(a) : p(a || n || {});
|
|
653
|
+
} catch (a) {
|
|
654
|
+
return console.error("[EINV_FLOW] loadAndRender error:", a), x();
|
|
652
655
|
}
|
|
653
656
|
});
|
|
654
657
|
}
|
|
655
658
|
function E() {
|
|
656
659
|
return Z(this, null, function* () {
|
|
657
|
-
if (!n)
|
|
658
|
-
return x();
|
|
659
660
|
try {
|
|
660
|
-
yield
|
|
661
|
-
} catch (
|
|
662
|
-
return console.error("[EINV_FLOW] init error:",
|
|
661
|
+
yield f();
|
|
662
|
+
} catch (a) {
|
|
663
|
+
return console.error("[EINV_FLOW] init error:", a), x();
|
|
663
664
|
}
|
|
664
665
|
});
|
|
665
666
|
}
|
|
666
|
-
function
|
|
667
|
-
|
|
667
|
+
function A() {
|
|
668
|
+
l = !0, e.innerHTML = "";
|
|
668
669
|
}
|
|
669
|
-
return { container: e, init: E, destroy:
|
|
670
|
+
return { container: e, init: E, destroy: A };
|
|
670
671
|
}
|
|
671
|
-
function ae(
|
|
672
|
-
return String(
|
|
672
|
+
function ae(r) {
|
|
673
|
+
return String(r || "").trim().toLowerCase() === "business" ? "enterprise" : "individual";
|
|
673
674
|
}
|
|
674
|
-
function oe(
|
|
675
|
-
const t = ae(
|
|
675
|
+
function oe(r, n) {
|
|
676
|
+
const t = ae(r), e = {
|
|
676
677
|
invoiceType: t,
|
|
677
|
-
buyerName: (
|
|
678
|
-
address: (
|
|
679
|
-
email: (
|
|
678
|
+
buyerName: (n == null ? void 0 : n.representativeName) || "",
|
|
679
|
+
address: (n == null ? void 0 : n.buyerAddress) || "",
|
|
680
|
+
email: (n == null ? void 0 : n.email) || ""
|
|
680
681
|
};
|
|
681
|
-
return t === "enterprise" && (e.taxCode =
|
|
682
|
+
return t === "enterprise" && (e.taxCode = n != null && n.noTaxCode ? "" : (n == null ? void 0 : n.taxCode) || "", e.performerName = (n == null ? void 0 : n.performerName) || ""), e;
|
|
682
683
|
}
|
|
683
684
|
function se(e) {
|
|
684
|
-
return Z(this, arguments, function* (
|
|
685
|
-
for (let
|
|
685
|
+
return Z(this, arguments, function* (r, { maxTries: n = 20, intervalMs: t = 1500 } = {}) {
|
|
686
|
+
for (let s = 0; s < n; s++) {
|
|
686
687
|
yield le(t);
|
|
687
|
-
const
|
|
688
|
-
if (
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
throw c.code = "EXPIRED", c.data = a, c;
|
|
688
|
+
const o = yield $(r), g = z(o == null ? void 0 : o.status);
|
|
689
|
+
if (g === "invoiced") return o;
|
|
690
|
+
if (g === "expired") {
|
|
691
|
+
const d = new Error("Invoice request expired while polling");
|
|
692
|
+
throw d.code = "EXPIRED", d.data = o, d;
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
-
const
|
|
696
|
-
throw
|
|
695
|
+
const l = new Error("Polling timeout: status not invoiced");
|
|
696
|
+
throw l.code = "POLL_TIMEOUT", l;
|
|
697
697
|
});
|
|
698
698
|
}
|
|
699
|
-
function le(
|
|
700
|
-
return new Promise((
|
|
699
|
+
function le(r) {
|
|
700
|
+
return new Promise((n) => setTimeout(n, r));
|
|
701
701
|
}
|
|
702
702
|
export {
|
|
703
703
|
ge as createInvoiceRequestFlow
|