@invoice-sdk/widget 1.84.1 → 1.85.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.
@@ -4648,7 +4648,7 @@ function GQ(e) {
4648
4648
  return K(this, null, function* () {
4649
4649
  var t, i;
4650
4650
  const A = localStorage.getItem("accessToken");
4651
- for (DA = !1; uA.length; ) {
4651
+ for (; uA.length; ) {
4652
4652
  const n = uA.shift();
4653
4653
  if (n)
4654
4654
  try {
@@ -4657,7 +4657,12 @@ function GQ(e) {
4657
4657
  n.reject(C);
4658
4658
  }
4659
4659
  }
4660
- return e.headers = (i = e.headers) != null ? i : {}, A && (e.headers.Authorization = `Bearer ${A}`), oA(e);
4660
+ e.headers = (i = e.headers) != null ? i : {}, A && (e.headers.Authorization = `Bearer ${A}`);
4661
+ try {
4662
+ return yield oA(e);
4663
+ } finally {
4664
+ DA = !1;
4665
+ }
4661
4666
  });
4662
4667
  }
4663
4668
  oA.interceptors.response.use(
@@ -4668,11 +4673,9 @@ oA.interceptors.response.use(
4668
4673
  return Promise.reject(e);
4669
4674
  if (e.response.status === 401)
4670
4675
  try {
4671
- if (DA)
4672
- return new Promise((t, i) => {
4673
- uA.push({ resolve: t, reject: i, request: A });
4674
- });
4675
- DA = !0, yield kA == null ? void 0 : kA(), yield GQ(A);
4676
+ return DA ? new Promise((t, i) => {
4677
+ uA.push({ resolve: t, reject: i, request: A });
4678
+ }) : (DA = !0, yield kA == null ? void 0 : kA(), GQ(A));
4676
4679
  } catch (t) {
4677
4680
  for (; uA.length; ) {
4678
4681
  const i = uA.shift();
@@ -4686,7 +4689,7 @@ oA.interceptors.response.use(
4686
4689
  Tt(oA, {});
4687
4690
  function EB(e) {
4688
4691
  return K(this, null, function* () {
4689
- return (yield oA.post(
4692
+ const A = yield oA.post(
4690
4693
  _g,
4691
4694
  {
4692
4695
  bill_number: e.orderId,
@@ -4699,14 +4702,15 @@ function EB(e) {
4699
4702
  "Content-Type": "application/json"
4700
4703
  }
4701
4704
  }
4702
- )).data;
4705
+ );
4706
+ return A && typeof A == "object" && "data" in A ? A.data : A;
4703
4707
  });
4704
4708
  }
4705
4709
  let te = null, ie = null, nA = null, CA = null;
4706
4710
  function QB(e) {
4707
4711
  return K(this, null, function* () {
4708
4712
  if (e.mode && qt(e.mode), e.baseUrl && mt(e.mode, e.baseUrl), e.language && Vt(e.language), e.onRefreshToken && LQ(e.onRefreshToken), !ie) {
4709
- const { InvoiceRegisterWidget: i } = yield import("./widget-CbXgbWB_.js");
4713
+ const { InvoiceRegisterWidget: i } = yield import("./widget-xruUcf2o.js");
4710
4714
  ie = i;
4711
4715
  }
4712
4716
  const A = typeof e.selector == "string" ? document.querySelector(e.selector) : e.selector;
@@ -4732,7 +4736,7 @@ function QB(e) {
4732
4736
  function BB(e) {
4733
4737
  return K(this, null, function* () {
4734
4738
  if (e.mode && qt(e.mode), e.baseUrl && mt(e.mode, e.baseUrl), e.language && Vt(e.language), !te) {
4735
- const { EContractWidget: i } = yield import("./widget-CbXgbWB_.js");
4739
+ const { EContractWidget: i } = yield import("./widget-xruUcf2o.js");
4736
4740
  te = i;
4737
4741
  }
4738
4742
  const A = typeof e.selector == "string" ? document.querySelector(e.selector) : e.selector;
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as s, w as a, p as i, q as r, r as g, y as n, x as o, z as u, u as c } from "./index-B3zerqp-.js";
1
+ import { A as s, w as a, p as i, q as r, r as g, y as n, x as o, z as u, u as c } from "./index-BuUQi4Zw.js";
2
2
  export {
3
3
  s as checkContractStatus,
4
4
  a as getSettings,