@invoice-sdk/widget 1.123.0 → 1.124.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.
@@ -2,20 +2,20 @@ var n = (e, t, r) => new Promise((o, g) => {
2
2
  var s = (i) => {
3
3
  try {
4
4
  c(r.next(i));
5
- } catch (u) {
6
- g(u);
5
+ } catch (d) {
6
+ g(d);
7
7
  }
8
- }, d = (i) => {
8
+ }, p = (i) => {
9
9
  try {
10
10
  c(r.throw(i));
11
- } catch (u) {
12
- g(u);
11
+ } catch (d) {
12
+ g(d);
13
13
  }
14
- }, c = (i) => i.done ? o(i.value) : Promise.resolve(i.value).then(s, d);
14
+ }, c = (i) => i.done ? o(i.value) : Promise.resolve(i.value).then(s, p);
15
15
  c((r = r.apply(e, t)).next());
16
16
  });
17
- import { k as l, g as w, l as f, C as m, G as E, n as y, I as R, S as v, o as C, a as h, p as I, q as p, r as T, O } from "./index-BfJuM4Fb.js";
18
- function k({
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-Bh9yQ9hE.js";
18
+ function $({
19
19
  title: e,
20
20
  isDisabled: t = !1,
21
21
  handleClick: r = null,
@@ -34,11 +34,11 @@ function k({
34
34
  "wgt:cursor-pointer",
35
35
  "wgt:hover:text-primary-hover-text",
36
36
  g
37
- ].filter(Boolean).join(" "), s.innerText = e, typeof r == "function" && s.addEventListener("click", (d) => n(null, null, function* () {
37
+ ].filter(Boolean).join(" "), s.innerText = e, typeof r == "function" && s.addEventListener("click", (p) => n(null, null, function* () {
38
38
  if (!s.disabled) {
39
39
  s.disabled = !0;
40
40
  try {
41
- yield r(d);
41
+ yield r(p);
42
42
  } catch (c) {
43
43
  console.error("Button click handler error:", c);
44
44
  } finally {
@@ -61,18 +61,18 @@ a.interceptors.request.use(
61
61
  }
62
62
  );
63
63
  f(a, {});
64
- function x(e) {
64
+ function k(e) {
65
65
  return n(this, null, function* () {
66
66
  if (!e)
67
67
  throw new Error("Tax code is required to fetch tax information.");
68
- return yield a.get(y, {
68
+ return yield a.get(R, {
69
69
  params: {
70
70
  tax: e
71
71
  }
72
72
  });
73
73
  });
74
74
  }
75
- function N(e, t, r) {
75
+ function x(e, t, r) {
76
76
  return n(this, null, function* () {
77
77
  if (!t)
78
78
  throw new Error("Tax code is required to check new customer.");
@@ -85,7 +85,7 @@ function N(e, t, r) {
85
85
  })).data;
86
86
  });
87
87
  }
88
- function $(e, t) {
88
+ function A(e, t) {
89
89
  return n(this, null, function* () {
90
90
  return (yield a.get(E, {
91
91
  params: {
@@ -95,10 +95,10 @@ function $(e, t) {
95
95
  })).data;
96
96
  });
97
97
  }
98
- const A = (e) => new Intl.NumberFormat("vi-VN").format(e), S = "1.123.0";
99
- function U(r) {
98
+ const M = (e) => new Intl.NumberFormat("vi-VN").format(e), U = "1.124.0";
99
+ function q(r) {
100
100
  return n(this, arguments, function* ({ search: e, bank: t }) {
101
- return (yield a.get(`${p}`, {
101
+ return (yield a.get(`${u}`, {
102
102
  params: {
103
103
  isActive: !0,
104
104
  search: e || null,
@@ -108,9 +108,9 @@ function U(r) {
108
108
  })).data;
109
109
  });
110
110
  }
111
- function M(t) {
111
+ function B(t) {
112
112
  return n(this, arguments, function* ({ bank: e }) {
113
- return (yield a.get(`${p}`, {
113
+ return (yield a.get(`${u}`, {
114
114
  params: {
115
115
  isActive: !0,
116
116
  type: "initial_fee",
@@ -119,14 +119,14 @@ function M(t) {
119
119
  })).data;
120
120
  });
121
121
  }
122
- function q(g) {
122
+ function F(g) {
123
123
  return n(this, arguments, function* ({
124
124
  bank: e,
125
125
  hasRenew: t,
126
126
  isCashRegister: r,
127
127
  customerType: o
128
128
  }) {
129
- return (yield a.get(`${p}`, {
129
+ return (yield a.get(`${u}`, {
130
130
  params: {
131
131
  isActive: !0,
132
132
  type: "service",
@@ -139,9 +139,9 @@ function q(g) {
139
139
  })).data;
140
140
  });
141
141
  }
142
- function B(t) {
142
+ function G(t) {
143
143
  return n(this, arguments, function* ({ bank: e }) {
144
- return (yield a.get(`${p}`, {
144
+ return (yield a.get(`${u}`, {
145
145
  params: {
146
146
  isActive: !0,
147
147
  type: "signature",
@@ -151,7 +151,7 @@ function B(t) {
151
151
  })).data;
152
152
  });
153
153
  }
154
- function F(e) {
154
+ function V(e) {
155
155
  return n(this, null, function* () {
156
156
  const t = new FormData();
157
157
  return t.append(
@@ -162,42 +162,42 @@ function F(e) {
162
162
  e.organizationRegistrationCert
163
163
  ), e.legalRepresentativeIdCard.forEach((o) => {
164
164
  t.append("legalRepresentativeIdCard", o);
165
- }), t.append("isRenew", e.isRenew), t.append("isCashRegister", e.isCashRegister), yield a.post(C, t, {
165
+ }), t.append("isRenew", e.isRenew), t.append("isCashRegister", e.isCashRegister), yield a.post(T, t, {
166
166
  headers: {
167
167
  "Content-Type": "multipart/form-data",
168
168
  "X-Invoice-Widget-Mode": h(),
169
- "X-Invoice-Widget-Version": S
169
+ "X-Invoice-Widget-Version": U
170
170
  }
171
171
  });
172
172
  });
173
173
  }
174
- function G(e) {
174
+ function j(e) {
175
175
  return n(this, null, function* () {
176
- return yield a.get(`${O}/${e}/status`);
176
+ return yield a.get(`${_}/${e}/status`);
177
177
  });
178
178
  }
179
- function j() {
179
+ function W() {
180
180
  return n(this, arguments, function* ({ isRenewable: e, serialNumber: t } = {}) {
181
181
  const r = {
182
182
  isRenewable: !!e,
183
183
  serialNumber: (t != null ? t : "").trim()
184
184
  };
185
- return console.log("PROMO params:", r), (yield a.get(I, { params: r })).data;
185
+ return console.log("PROMO params:", r), (yield a.get(O, { params: r })).data;
186
186
  });
187
187
  }
188
- function W(e) {
188
+ function D(e) {
189
189
  return n(this, null, function* () {
190
- return yield a.post(`${T}/${e}`);
190
+ return yield a.post(`${S}/${e}`);
191
191
  });
192
192
  }
193
- function D(e) {
193
+ function L(e) {
194
194
  return n(this, null, function* () {
195
195
  return yield a.get(
196
- `${R}/${encodeURIComponent(e)}`
196
+ `${C}/${encodeURIComponent(e)}`
197
197
  );
198
198
  });
199
199
  }
200
- function L(e, t) {
200
+ function Q(e, t) {
201
201
  return n(this, null, function* () {
202
202
  try {
203
203
  return yield a.post(
@@ -209,7 +209,26 @@ function L(e, t) {
209
209
  }
210
210
  });
211
211
  }
212
- function V() {
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() {
213
232
  const e = document.createElement("div");
214
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";
215
234
  const t = document.createElement("div");
@@ -226,20 +245,22 @@ function V() {
226
245
  };
227
246
  }
228
247
  export {
229
- N as a,
230
- x as b,
231
- k as c,
232
- U as d,
233
- V as e,
234
- A as f,
235
- $ as g,
236
- F as h,
237
- j as i,
238
- M as j,
239
- q as k,
240
- B as l,
241
- W as m,
242
- G as n,
243
- D as o,
244
- L as s
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
245
266
  };
@@ -35,8 +35,8 @@ var on = (t, n, e) => new Promise((c, h) => {
35
35
  }, o = (u) => u.done ? c(u.value) : Promise.resolve(u.value).then(a, A);
36
36
  o((e = e.apply(t, n)).next());
37
37
  });
38
- import { t as g, g as _h, a as $h, b as wt, s as _t, c as Lt, d as Tc, e as xc, f as dc, m as wc, h as pc, i as Cc, v as fc } from "./index-BfJuM4Fb.js";
39
- import { c as Ct, a as t0, g as $t, b as Xc, f as Vn, d as Bc, e as c0, h as Nc, i as Ec, j as Hc, k as yc, l as Pc, m as kc, n as vc } from "./loading-COG4W_q5.js";
38
+ import { t as g, g as _h, a as $h, b as wt, s as _t, c as Lt, d as Tc, e as xc, f as dc, m as wc, h as pc, i as Cc, v as fc } from "./index-Bh9yQ9hE.js";
39
+ import { c as Ct, a as t0, g as $t, b as Xc, f as Vn, d as Bc, e as c0, h as Nc, i as Ec, j as Hc, k as yc, l as Pc, m as kc, n as vc } from "./loading-BU9hOP_i.js";
40
40
  import { g as nc } from "./_commonjsHelpers-bAxELxBV.js";
41
41
  function ih({ steps: t = [], currentStep: n = 1 } = {}) {
42
42
  const e = document.createElement("div");
package/package.json CHANGED
@@ -46,7 +46,7 @@
46
46
  "prepare": "npm run build"
47
47
  },
48
48
  "type": "module",
49
- "version": "1.123.0",
49
+ "version": "1.124.0",
50
50
  "repository": {},
51
51
  "dependencies": {
52
52
  "@invoice-sdk/id_extraction_qr": "^1.8.3",