@invoice-sdk/widget 1.124.1 → 1.124.3

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/package.json CHANGED
@@ -46,7 +46,7 @@
46
46
  "prepare": "npm run build"
47
47
  },
48
48
  "type": "module",
49
- "version": "1.124.1",
49
+ "version": "1.124.3",
50
50
  "repository": {},
51
51
  "dependencies": {
52
52
  "@invoice-sdk/id_extraction_qr": "^1.8.3",
@@ -1,8 +0,0 @@
1
- var o = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
2
- function l(e) {
3
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
- }
5
- export {
6
- o as c,
7
- l as g
8
- };
@@ -1,266 +0,0 @@
1
- var n = (e, t, r) => new Promise((o, g) => {
2
- var s = (i) => {
3
- try {
4
- c(r.next(i));
5
- } catch (d) {
6
- g(d);
7
- }
8
- }, p = (i) => {
9
- try {
10
- c(r.throw(i));
11
- } catch (d) {
12
- g(d);
13
- }
14
- }, c = (i) => i.done ? o(i.value) : Promise.resolve(i.value).then(s, p);
15
- c((r = r.apply(e, t)).next());
16
- });
17
- import { k as l, g as w, l as f, C as m, G as E, n as R, o as y, I as C, p as I, S as v, q as T, a as h, r as O, u, w as S, O as _ } from "./index-CFPN9ZW0.js";
18
- function $({
19
- title: e,
20
- isDisabled: t = !1,
21
- handleClick: r = null,
22
- type: o = "button",
23
- className: g = ""
24
- } = {}) {
25
- const s = document.createElement("button");
26
- return s.type = o, s.disabled = t, s.className = [
27
- "wgt:bg-primary",
28
- "wgt:hover:bg-primary-dark",
29
- "wgt:px-6",
30
- "wgt:py-2",
31
- "wgt:rounded-lg",
32
- "wgt:disabled:opacity-50",
33
- "wgt:disabled:cursor-not-allowed",
34
- "wgt:cursor-pointer",
35
- "wgt:hover:text-primary-hover-text",
36
- g
37
- ].filter(Boolean).join(" "), s.innerText = e, typeof r == "function" && s.addEventListener("click", (p) => n(null, null, function* () {
38
- if (!s.disabled) {
39
- s.disabled = !0;
40
- try {
41
- yield r(p);
42
- } catch (c) {
43
- console.error("Button click handler error:", c);
44
- } finally {
45
- s.disabled = !1;
46
- }
47
- }
48
- })), s;
49
- }
50
- const a = l.create({
51
- headers: {
52
- Accept: "application/json"
53
- }
54
- });
55
- a.interceptors.request.use(
56
- function(e) {
57
- return e.baseURL = w().invoiceHubBaseUrl, e;
58
- },
59
- function(e) {
60
- return Promise.reject(e);
61
- }
62
- );
63
- f(a, {});
64
- function k(e) {
65
- return n(this, null, function* () {
66
- if (!e)
67
- throw new Error("Tax code is required to fetch tax information.");
68
- return yield a.get(R, {
69
- params: {
70
- tax: e
71
- }
72
- });
73
- });
74
- }
75
- function x(e, t, r) {
76
- return n(this, null, function* () {
77
- if (!t)
78
- throw new Error("Tax code is required to check new customer.");
79
- return (yield a.get(m, {
80
- params: {
81
- provider: e,
82
- taxCode: t,
83
- invoiceType: r
84
- }
85
- })).data;
86
- });
87
- }
88
- function A(e, t) {
89
- return n(this, null, function* () {
90
- return (yield a.get(E, {
91
- params: {
92
- provider: e,
93
- taxCode: t
94
- }
95
- })).data;
96
- });
97
- }
98
- const M = (e) => new Intl.NumberFormat("vi-VN").format(e), U = "1.124.1";
99
- function q(r) {
100
- return n(this, arguments, function* ({ search: e, bank: t }) {
101
- return (yield a.get(`${u}`, {
102
- params: {
103
- isActive: !0,
104
- search: e || null,
105
- type: "service",
106
- bank: t
107
- }
108
- })).data;
109
- });
110
- }
111
- function B(t) {
112
- return n(this, arguments, function* ({ bank: e }) {
113
- return (yield a.get(`${u}`, {
114
- params: {
115
- isActive: !0,
116
- type: "initial_fee",
117
- bank: e
118
- }
119
- })).data;
120
- });
121
- }
122
- function F(g) {
123
- return n(this, arguments, function* ({
124
- bank: e,
125
- hasRenew: t,
126
- isCashRegister: r,
127
- customerType: o
128
- }) {
129
- return (yield a.get(`${u}`, {
130
- params: {
131
- isActive: !0,
132
- type: "service",
133
- bank: e,
134
- hasRenew: t,
135
- limit: 99,
136
- isCashRegister: r,
137
- customerType: "ENTERPRISE"
138
- }
139
- })).data;
140
- });
141
- }
142
- function G(t) {
143
- return n(this, arguments, function* ({ bank: e }) {
144
- return (yield a.get(`${u}`, {
145
- params: {
146
- isActive: !0,
147
- type: "signature",
148
- bank: e,
149
- limit: 99
150
- }
151
- })).data;
152
- });
153
- }
154
- function V(e) {
155
- return n(this, null, function* () {
156
- const t = new FormData();
157
- return t.append(
158
- "eInvoiceRegistration",
159
- JSON.stringify(e.eInvoiceRegistration)
160
- ), t.append("provider", e.provider), t.append("bank", e.bank), t.append("packages", JSON.stringify(e.packages)), t.append("promotionCodes", JSON.stringify(e.promotionCodes)), t.append("logo", e.logo), t.append(
161
- "organizationRegistrationCert",
162
- e.organizationRegistrationCert
163
- ), e.legalRepresentativeIdCard.forEach((o) => {
164
- t.append("legalRepresentativeIdCard", o);
165
- }), t.append("isRenew", e.isRenew), t.append("isCashRegister", e.isCashRegister), yield a.post(T, t, {
166
- headers: {
167
- "Content-Type": "multipart/form-data",
168
- "X-Invoice-Widget-Mode": h(),
169
- "X-Invoice-Widget-Version": U
170
- }
171
- });
172
- });
173
- }
174
- function j(e) {
175
- return n(this, null, function* () {
176
- return yield a.get(`${_}/${e}/status`);
177
- });
178
- }
179
- function W() {
180
- return n(this, arguments, function* ({ isRenewable: e, serialNumber: t } = {}) {
181
- const r = {
182
- isRenewable: !!e,
183
- serialNumber: (t != null ? t : "").trim()
184
- };
185
- return console.log("PROMO params:", r), (yield a.get(O, { params: r })).data;
186
- });
187
- }
188
- function D(e) {
189
- return n(this, null, function* () {
190
- return yield a.post(`${S}/${e}`);
191
- });
192
- }
193
- function L(e) {
194
- return n(this, null, function* () {
195
- return yield a.get(
196
- `${C}/${encodeURIComponent(e)}`
197
- );
198
- });
199
- }
200
- function Q(e, t) {
201
- return n(this, null, function* () {
202
- try {
203
- return yield a.post(
204
- `${v}/${encodeURIComponent(e)}`,
205
- t
206
- );
207
- } catch (r) {
208
- throw r;
209
- }
210
- });
211
- }
212
- function z(e) {
213
- return n(this, null, function* () {
214
- return yield a.get(
215
- `${y}/${encodeURIComponent(e)}`
216
- );
217
- });
218
- }
219
- function J(e, t) {
220
- return n(this, null, function* () {
221
- try {
222
- return yield a.post(
223
- `${I}/${encodeURIComponent(e)}`,
224
- t
225
- );
226
- } catch (r) {
227
- throw r;
228
- }
229
- });
230
- }
231
- function X() {
232
- const e = document.createElement("div");
233
- e.className = "wgt:absolute wgt:inset-0 wgt:bg-white/80 wgt:items-center wgt:justify-center wgt:z-50 wgt:w-full wgt:h-full wgt:backdrop-blur-sm", e.style.display = "none";
234
- const t = document.createElement("div");
235
- t.className = "wgt:flex wgt:flex-col wgt:items-center wgt:gap-4 wgt:bg-white wgt:rounded-lg wgt:p-6 wgt:shadow-lg";
236
- const r = document.createElement("div");
237
- return r.className = "wgt:h-12 wgt:w-12 wgt:animate-spin wgt:rounded-full wgt:border-4 wgt:border-solid wgt:border-primary wgt:border-t-transparent", t.appendChild(r), e.appendChild(t), {
238
- container: e,
239
- open: () => {
240
- e.style.display = "flex";
241
- },
242
- close: () => {
243
- e.style.display = "none";
244
- }
245
- };
246
- }
247
- export {
248
- x as a,
249
- k as b,
250
- $ as c,
251
- q as d,
252
- X as e,
253
- M as f,
254
- A as g,
255
- V as h,
256
- W as i,
257
- B as j,
258
- F as k,
259
- G as l,
260
- D as m,
261
- j as n,
262
- z as o,
263
- L as p,
264
- Q as q,
265
- J as s
266
- };