@akad/sdk 1.0.18 → 1.0.19

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.
@@ -0,0 +1,5 @@
1
+ import { Config } from '../base';
2
+
3
+ export declare const createEndorsement: (config: Config) => {
4
+ putEndorsement: <ReqPayload = unknown, ResPayload = unknown>(data: ReqPayload, attachments?: File | File[]) => Promise<ResPayload>;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
package/main.d.ts CHANGED
@@ -37,6 +37,9 @@ export default function sdkInitialize(config: Config): {
37
37
  getBroker: () => Promise<import('./broker/types').brokerType>;
38
38
  getAllBrokerages: (name: string) => Promise<import('./broker/types').brokerageFirmType>;
39
39
  };
40
+ endorsement: {
41
+ putEndorsement: <ReqPayload = unknown, ResPayload = unknown>(data: ReqPayload, attachments?: File | File[] | undefined) => Promise<ResPayload>;
42
+ };
40
43
  plugin: {
41
44
  getCnpjStatus: (cnpj: string) => Promise<import('./plugin/types').CnpjStatus>;
42
45
  getKeyNumber: () => Promise<import('./plugin/types').keyNumberType>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akad/sdk",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "main": "./ts-lib.umd.cjs",
5
5
  "module": "./ts-lib.js",
6
6
  "exports": {
package/ts-lib.js CHANGED
@@ -24,7 +24,7 @@ const ot = v("string"), R = v("function"), Fe = v("number"), W = (e) => e !== nu
24
24
  let t;
25
25
  return e && (typeof FormData == "function" && e instanceof FormData || R(e.append) && ((t = K(e)) === "formdata" || // detect form-data instance
26
26
  t === "object" && R(e.toString) && e.toString() === "[object FormData]"));
27
- }, ht = A("URLSearchParams"), [pt, mt, yt, gt] = ["ReadableStream", "Request", "Response", "Headers"].map(A), wt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
27
+ }, pt = A("URLSearchParams"), [ht, mt, yt, gt] = ["ReadableStream", "Request", "Response", "Headers"].map(A), wt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
28
28
  function I(e, t, { allOwnKeys: n = !1 } = {}) {
29
29
  if (e === null || typeof e > "u")
30
30
  return;
@@ -60,11 +60,11 @@ function re() {
60
60
  }
61
61
  const bt = (e, t, n, { allOwnKeys: r } = {}) => (I(t, (s, o) => {
62
62
  n && R(s) ? e[o] = Be(s, n) : e[o] = s;
63
- }, { allOwnKeys: r }), e), Tt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), St = (e, t, n, r) => {
63
+ }, { allOwnKeys: r }), e), Tt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Et = (e, t, n, r) => {
64
64
  e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
65
65
  value: t.prototype
66
66
  }), n && Object.assign(e.prototype, n);
67
- }, Et = (e, t, n, r) => {
67
+ }, St = (e, t, n, r) => {
68
68
  let s, o, i;
69
69
  const u = {};
70
70
  if (t = t || {}, e == null)
@@ -180,7 +180,7 @@ const Dt = (e) => {
180
180
  isBoolean: it,
181
181
  isObject: W,
182
182
  isPlainObject: M,
183
- isReadableStream: pt,
183
+ isReadableStream: ht,
184
184
  isRequest: mt,
185
185
  isResponse: yt,
186
186
  isHeaders: gt,
@@ -191,7 +191,7 @@ const Dt = (e) => {
191
191
  isRegExp: xt,
192
192
  isFunction: R,
193
193
  isStream: ft,
194
- isURLSearchParams: ht,
194
+ isURLSearchParams: pt,
195
195
  isTypedArray: At,
196
196
  isFileList: lt,
197
197
  forEach: I,
@@ -199,8 +199,8 @@ const Dt = (e) => {
199
199
  extend: bt,
200
200
  trim: wt,
201
201
  stripBOM: Tt,
202
- inherits: St,
203
- toFlatObject: Et,
202
+ inherits: Et,
203
+ toFlatObject: St,
204
204
  kindOf: K,
205
205
  kindOfTest: A,
206
206
  endsWith: Rt,
@@ -302,54 +302,54 @@ function Q(e, t, n) {
302
302
  metaTokens: !0,
303
303
  dots: !1,
304
304
  indexes: !1
305
- }, !1, function(p, w) {
306
- return !c.isUndefined(w[p]);
305
+ }, !1, function(h, w) {
306
+ return !c.isUndefined(w[h]);
307
307
  });
308
308
  const r = n.metaTokens, s = n.visitor || a, o = n.dots, i = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(t);
309
309
  if (!c.isFunction(s))
310
310
  throw new TypeError("visitor must be a function");
311
- function l(h) {
312
- if (h === null)
311
+ function l(p) {
312
+ if (p === null)
313
313
  return "";
314
- if (c.isDate(h))
315
- return h.toISOString();
316
- if (!f && c.isBlob(h))
314
+ if (c.isDate(p))
315
+ return p.toISOString();
316
+ if (!f && c.isBlob(p))
317
317
  throw new y("Blob is not supported. Use a Buffer instead.");
318
- return c.isArrayBuffer(h) || c.isTypedArray(h) ? f && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
318
+ return c.isArrayBuffer(p) || c.isTypedArray(p) ? f && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
319
319
  }
320
- function a(h, p, w) {
321
- let S = h;
322
- if (h && !w && typeof h == "object") {
323
- if (c.endsWith(p, "{}"))
324
- p = r ? p : p.slice(0, -2), h = JSON.stringify(h);
325
- else if (c.isArray(h) && Ht(h) || (c.isFileList(h) || c.endsWith(p, "[]")) && (S = c.toArray(h)))
326
- return p = He(p), S.forEach(function(b, _) {
320
+ function a(p, h, w) {
321
+ let E = p;
322
+ if (p && !w && typeof p == "object") {
323
+ if (c.endsWith(h, "{}"))
324
+ h = r ? h : h.slice(0, -2), p = JSON.stringify(p);
325
+ else if (c.isArray(p) && Ht(p) || (c.isFileList(p) || c.endsWith(h, "[]")) && (E = c.toArray(p)))
326
+ return h = He(h), E.forEach(function(b, _) {
327
327
  !(c.isUndefined(b) || b === null) && t.append(
328
328
  // eslint-disable-next-line no-nested-ternary
329
- i === !0 ? ge([p], _, o) : i === null ? p : p + "[]",
329
+ i === !0 ? ge([h], _, o) : i === null ? h : h + "[]",
330
330
  l(b)
331
331
  );
332
332
  }), !1;
333
333
  }
334
- return se(h) ? !0 : (t.append(ge(w, p, o), l(h)), !1);
334
+ return se(p) ? !0 : (t.append(ge(w, h, o), l(p)), !1);
335
335
  }
336
336
  const d = [], m = Object.assign(Jt, {
337
337
  defaultVisitor: a,
338
338
  convertValue: l,
339
339
  isVisitable: se
340
340
  });
341
- function g(h, p) {
342
- if (!c.isUndefined(h)) {
343
- if (d.indexOf(h) !== -1)
344
- throw Error("Circular reference detected in " + p.join("."));
345
- d.push(h), c.forEach(h, function(S, N) {
346
- (!(c.isUndefined(S) || S === null) && s.call(
341
+ function g(p, h) {
342
+ if (!c.isUndefined(p)) {
343
+ if (d.indexOf(p) !== -1)
344
+ throw Error("Circular reference detected in " + h.join("."));
345
+ d.push(p), c.forEach(p, function(E, N) {
346
+ (!(c.isUndefined(E) || E === null) && s.call(
347
347
  t,
348
- S,
348
+ E,
349
349
  c.isString(N) ? N.trim() : N,
350
- p,
350
+ h,
351
351
  m
352
- )) === !0 && g(S, p ? p.concat(N) : [N]);
352
+ )) === !0 && g(E, h ? h.concat(N) : [N]);
353
353
  }), d.pop();
354
354
  }
355
355
  }
@@ -655,7 +655,7 @@ function cn(e, t) {
655
655
  });
656
656
  });
657
657
  }
658
- let E = class {
658
+ let S = class {
659
659
  constructor(t) {
660
660
  t && this.set(t);
661
661
  }
@@ -773,8 +773,8 @@ let E = class {
773
773
  return c.isArray(t) ? t.forEach(o) : o(t), this;
774
774
  }
775
775
  };
776
- E.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
777
- c.reduceDescriptors(E.prototype, ({ value: e }, t) => {
776
+ S.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
777
+ c.reduceDescriptors(S.prototype, ({ value: e }, t) => {
778
778
  let n = t[0].toUpperCase() + t.slice(1);
779
779
  return {
780
780
  get: () => e,
@@ -783,9 +783,9 @@ c.reduceDescriptors(E.prototype, ({ value: e }, t) => {
783
783
  }
784
784
  };
785
785
  });
786
- c.freezeMethods(E);
786
+ c.freezeMethods(S);
787
787
  function ee(e, t) {
788
- const n = this || j, r = t || n, s = E.from(r.headers);
788
+ const n = this || j, r = t || n, s = S.from(r.headers);
789
789
  let o = r.data;
790
790
  return c.forEach(e, function(u) {
791
791
  o = u.call(n, o, s.normalize(), t ? t.status : void 0);
@@ -890,7 +890,7 @@ const V = (e, t, n = 3) => {
890
890
  return !0;
891
891
  };
892
892
  }()
893
- ), hn = O.hasStandardBrowserEnv ? (
893
+ ), pn = O.hasStandardBrowserEnv ? (
894
894
  // Standard browser envs support document.cookie
895
895
  {
896
896
  write(e, t, n, r, s, o) {
@@ -917,16 +917,16 @@ const V = (e, t, n = 3) => {
917
917
  }
918
918
  }
919
919
  );
920
- function pn(e) {
920
+ function hn(e) {
921
921
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
922
922
  }
923
923
  function mn(e, t) {
924
924
  return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
925
925
  }
926
926
  function ve(e, t) {
927
- return e && !pn(t) ? mn(e, t) : t;
927
+ return e && !hn(t) ? mn(e, t) : t;
928
928
  }
929
- const Se = (e) => e instanceof E ? { ...e } : e;
929
+ const Ee = (e) => e instanceof S ? { ...e } : e;
930
930
  function q(e, t) {
931
931
  t = t || {};
932
932
  const n = {};
@@ -986,7 +986,7 @@ function q(e, t) {
986
986
  socketPath: i,
987
987
  responseEncoding: i,
988
988
  validateStatus: u,
989
- headers: (l, a) => s(Se(l), Se(a), !0)
989
+ headers: (l, a) => s(Ee(l), Ee(a), !0)
990
990
  };
991
991
  return c.forEach(Object.keys(Object.assign({}, e, t)), function(a) {
992
992
  const d = f[a] || s, m = d(e[a], t[a], a);
@@ -996,7 +996,7 @@ function q(e, t) {
996
996
  const We = (e) => {
997
997
  const t = q({}, e);
998
998
  let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: u } = t;
999
- t.headers = i = E.from(i), t.url = Me(ve(t.baseURL, t.url), e.params, e.paramsSerializer), u && i.set(
999
+ t.headers = i = S.from(i), t.url = Me(ve(t.baseURL, t.url), e.params, e.paramsSerializer), u && i.set(
1000
1000
  "Authorization",
1001
1001
  "Basic " + btoa((u.username || "") + ":" + (u.password ? unescape(encodeURIComponent(u.password)) : ""))
1002
1002
  );
@@ -1010,7 +1010,7 @@ const We = (e) => {
1010
1010
  }
1011
1011
  }
1012
1012
  if (O.hasStandardBrowserEnv && (r && c.isFunction(r) && (r = r(t)), r || r !== !1 && dn(t.url))) {
1013
- const l = s && o && hn.read(o);
1013
+ const l = s && o && pn.read(o);
1014
1014
  l && i.set(s, l);
1015
1015
  }
1016
1016
  return t;
@@ -1018,7 +1018,7 @@ const We = (e) => {
1018
1018
  return new Promise(function(n, r) {
1019
1019
  const s = We(e);
1020
1020
  let o = s.data;
1021
- const i = E.from(s.headers).normalize();
1021
+ const i = S.from(s.headers).normalize();
1022
1022
  let { responseType: u } = s, f;
1023
1023
  function l() {
1024
1024
  s.cancelToken && s.cancelToken.unsubscribe(f), s.signal && s.signal.removeEventListener("abort", f);
@@ -1028,9 +1028,9 @@ const We = (e) => {
1028
1028
  function d() {
1029
1029
  if (!a)
1030
1030
  return;
1031
- const g = E.from(
1031
+ const g = S.from(
1032
1032
  "getAllResponseHeaders" in a && a.getAllResponseHeaders()
1033
- ), p = {
1033
+ ), h = {
1034
1034
  data: !u || u === "text" || u === "json" ? a.responseText : a.response,
1035
1035
  status: a.status,
1036
1036
  statusText: a.statusText,
@@ -1038,11 +1038,11 @@ const We = (e) => {
1038
1038
  config: e,
1039
1039
  request: a
1040
1040
  };
1041
- Ke(function(S) {
1042
- n(S), l();
1043
- }, function(S) {
1044
- r(S), l();
1045
- }, p), a = null;
1041
+ Ke(function(E) {
1042
+ n(E), l();
1043
+ }, function(E) {
1044
+ r(E), l();
1045
+ }, h), a = null;
1046
1046
  }
1047
1047
  "onloadend" in a ? a.onloadend = d : a.onreadystatechange = function() {
1048
1048
  !a || a.readyState !== 4 || a.status === 0 && !(a.responseURL && a.responseURL.indexOf("file:") === 0) || setTimeout(d);
@@ -1051,16 +1051,16 @@ const We = (e) => {
1051
1051
  }, a.onerror = function() {
1052
1052
  r(new y("Network Error", y.ERR_NETWORK, s, a)), a = null;
1053
1053
  }, a.ontimeout = function() {
1054
- let h = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1055
- const p = s.transitional || ze;
1056
- s.timeoutErrorMessage && (h = s.timeoutErrorMessage), r(new y(
1057
- h,
1058
- p.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
1054
+ let p = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1055
+ const h = s.transitional || ze;
1056
+ s.timeoutErrorMessage && (p = s.timeoutErrorMessage), r(new y(
1057
+ p,
1058
+ h.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
1059
1059
  s,
1060
1060
  a
1061
1061
  )), a = null;
1062
- }, o === void 0 && i.setContentType(null), "setRequestHeader" in a && c.forEach(i.toJSON(), function(h, p) {
1063
- a.setRequestHeader(p, h);
1062
+ }, o === void 0 && i.setContentType(null), "setRequestHeader" in a && c.forEach(i.toJSON(), function(p, h) {
1063
+ a.setRequestHeader(h, p);
1064
1064
  }), c.isUndefined(s.withCredentials) || (a.withCredentials = !!s.withCredentials), u && u !== "json" && (a.responseType = s.responseType), typeof s.onDownloadProgress == "function" && a.addEventListener("progress", V(s.onDownloadProgress, !0)), typeof s.onUploadProgress == "function" && a.upload && a.upload.addEventListener("progress", V(s.onUploadProgress)), (s.cancelToken || s.signal) && (f = (g) => {
1065
1065
  a && (r(!g || g.type ? new L(null, e, a) : g), a.abort(), a = null);
1066
1066
  }, s.cancelToken && s.cancelToken.subscribe(f), s.signal && (s.signal.aborted ? f() : s.signal.addEventListener("abort", f)));
@@ -1105,7 +1105,7 @@ const We = (e) => {
1105
1105
  }, Tn = async function* (e, t, n) {
1106
1106
  for await (const r of e)
1107
1107
  yield* bn(ArrayBuffer.isView(r) ? r : await n(String(r)), t);
1108
- }, Ee = (e, t, n, r, s) => {
1108
+ }, Se = (e, t, n, r, s) => {
1109
1109
  const o = Tn(e, t, s);
1110
1110
  let i = 0;
1111
1111
  return new ReadableStream({
@@ -1132,7 +1132,7 @@ const We = (e) => {
1132
1132
  total: e,
1133
1133
  loaded: r
1134
1134
  }));
1135
- }, X = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Qe = X && typeof ReadableStream == "function", oe = X && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), Sn = Qe && (() => {
1135
+ }, X = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Qe = X && typeof ReadableStream == "function", oe = X && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), En = Qe && (() => {
1136
1136
  let e = !1;
1137
1137
  const t = new Request(O.origin, {
1138
1138
  body: new ReadableStream(),
@@ -1157,7 +1157,7 @@ X && ((e) => {
1157
1157
  });
1158
1158
  });
1159
1159
  })(new Response());
1160
- const En = async (e) => {
1160
+ const Sn = async (e) => {
1161
1161
  if (e == null)
1162
1162
  return 0;
1163
1163
  if (c.isBlob(e))
@@ -1170,7 +1170,7 @@ const En = async (e) => {
1170
1170
  return (await oe(e)).byteLength;
1171
1171
  }, Rn = async (e, t) => {
1172
1172
  const n = c.toFiniteNumber(e.getContentLength());
1173
- return n ?? En(t);
1173
+ return n ?? Sn(t);
1174
1174
  }, On = X && (async (e) => {
1175
1175
  let {
1176
1176
  url: t,
@@ -1187,21 +1187,21 @@ const En = async (e) => {
1187
1187
  fetchOptions: m
1188
1188
  } = We(e);
1189
1189
  l = l ? (l + "").toLowerCase() : "text";
1190
- let [g, h] = s || o || i ? wn([s, o], i) : [], p, w;
1191
- const S = () => {
1192
- !p && setTimeout(() => {
1190
+ let [g, p] = s || o || i ? wn([s, o], i) : [], h, w;
1191
+ const E = () => {
1192
+ !h && setTimeout(() => {
1193
1193
  g && g.unsubscribe();
1194
- }), p = !0;
1194
+ }), h = !0;
1195
1195
  };
1196
1196
  let N;
1197
1197
  try {
1198
- if (f && Sn && n !== "get" && n !== "head" && (N = await Rn(a, r)) !== 0) {
1198
+ if (f && En && n !== "get" && n !== "head" && (N = await Rn(a, r)) !== 0) {
1199
1199
  let C = new Request(t, {
1200
1200
  method: "POST",
1201
1201
  body: r,
1202
1202
  duplex: "half"
1203
1203
  }), F;
1204
- c.isFormData(r) && (F = C.headers.get("content-type")) && a.setContentType(F), C.body && (r = Ee(C.body, Oe, Re(
1204
+ c.isFormData(r) && (F = C.headers.get("content-type")) && a.setContentType(F), C.body && (r = Se(C.body, Oe, Re(
1205
1205
  N,
1206
1206
  V(f)
1207
1207
  ), null, oe));
@@ -1219,24 +1219,24 @@ const En = async (e) => {
1219
1219
  const _ = ie && (l === "stream" || l === "response");
1220
1220
  if (ie && (u || _)) {
1221
1221
  const C = {};
1222
- ["status", "statusText", "headers"].forEach((pe) => {
1223
- C[pe] = b[pe];
1222
+ ["status", "statusText", "headers"].forEach((he) => {
1223
+ C[he] = b[he];
1224
1224
  });
1225
1225
  const F = c.toFiniteNumber(b.headers.get("content-length"));
1226
1226
  b = new Response(
1227
- Ee(b.body, Oe, u && Re(
1227
+ Se(b.body, Oe, u && Re(
1228
1228
  F,
1229
1229
  V(u, !0)
1230
- ), _ && S, oe),
1230
+ ), _ && E, oe),
1231
1231
  C
1232
1232
  );
1233
1233
  }
1234
1234
  l = l || "text";
1235
1235
  let tt = await G[c.findKey(G, l) || "text"](b, e);
1236
- return !_ && S(), h && h(), await new Promise((C, F) => {
1236
+ return !_ && E(), p && p(), await new Promise((C, F) => {
1237
1237
  Ke(C, F, {
1238
1238
  data: tt,
1239
- headers: E.from(b.headers),
1239
+ headers: S.from(b.headers),
1240
1240
  status: b.status,
1241
1241
  statusText: b.statusText,
1242
1242
  config: e,
@@ -1244,7 +1244,7 @@ const En = async (e) => {
1244
1244
  });
1245
1245
  });
1246
1246
  } catch (b) {
1247
- throw S(), b && b.name === "TypeError" && /fetch/i.test(b.message) ? Object.assign(
1247
+ throw E(), b && b.name === "TypeError" && /fetch/i.test(b.message) ? Object.assign(
1248
1248
  new y("Network Error", y.ERR_NETWORK, e, w),
1249
1249
  {
1250
1250
  cause: b.cause || b
@@ -1301,7 +1301,7 @@ function te(e) {
1301
1301
  throw new L(null, e);
1302
1302
  }
1303
1303
  function Pe(e) {
1304
- return te(e), e.headers = E.from(e.headers), e.data = ee.call(
1304
+ return te(e), e.headers = S.from(e.headers), e.data = ee.call(
1305
1305
  e,
1306
1306
  e.transformRequest
1307
1307
  ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Xe.getAdapter(e.adapter || j.adapter)(e).then(function(r) {
@@ -1309,23 +1309,23 @@ function Pe(e) {
1309
1309
  e,
1310
1310
  e.transformResponse,
1311
1311
  r
1312
- ), r.headers = E.from(r.headers), r;
1312
+ ), r.headers = S.from(r.headers), r;
1313
1313
  }, function(r) {
1314
1314
  return Ge(r) || (te(e), r && r.response && (r.response.data = ee.call(
1315
1315
  e,
1316
1316
  e.transformResponse,
1317
1317
  r.response
1318
- ), r.response.headers = E.from(r.response.headers))), Promise.reject(r);
1318
+ ), r.response.headers = S.from(r.response.headers))), Promise.reject(r);
1319
1319
  });
1320
1320
  }
1321
- const Ze = "1.7.2", he = {};
1321
+ const Ze = "1.7.2", pe = {};
1322
1322
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1323
- he[e] = function(r) {
1323
+ pe[e] = function(r) {
1324
1324
  return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1325
1325
  };
1326
1326
  });
1327
1327
  const Ne = {};
1328
- he.transitional = function(t, n, r) {
1328
+ pe.transitional = function(t, n, r) {
1329
1329
  function s(o, i) {
1330
1330
  return "[Axios v" + Ze + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
1331
1331
  }
@@ -1362,7 +1362,7 @@ function Pn(e, t, n) {
1362
1362
  }
1363
1363
  const ce = {
1364
1364
  assertOptions: Pn,
1365
- validators: he
1365
+ validators: pe
1366
1366
  }, k = ce.validators;
1367
1367
  let B = class {
1368
1368
  constructor(t) {
@@ -1415,41 +1415,41 @@ let B = class {
1415
1415
  );
1416
1416
  o && c.forEach(
1417
1417
  ["delete", "get", "head", "post", "put", "patch", "common"],
1418
- (h) => {
1419
- delete o[h];
1418
+ (p) => {
1419
+ delete o[p];
1420
1420
  }
1421
- ), n.headers = E.concat(i, o);
1421
+ ), n.headers = S.concat(i, o);
1422
1422
  const u = [];
1423
1423
  let f = !0;
1424
- this.interceptors.request.forEach(function(p) {
1425
- typeof p.runWhen == "function" && p.runWhen(n) === !1 || (f = f && p.synchronous, u.unshift(p.fulfilled, p.rejected));
1424
+ this.interceptors.request.forEach(function(h) {
1425
+ typeof h.runWhen == "function" && h.runWhen(n) === !1 || (f = f && h.synchronous, u.unshift(h.fulfilled, h.rejected));
1426
1426
  });
1427
1427
  const l = [];
1428
- this.interceptors.response.forEach(function(p) {
1429
- l.push(p.fulfilled, p.rejected);
1428
+ this.interceptors.response.forEach(function(h) {
1429
+ l.push(h.fulfilled, h.rejected);
1430
1430
  });
1431
1431
  let a, d = 0, m;
1432
1432
  if (!f) {
1433
- const h = [Pe.bind(this), void 0];
1434
- for (h.unshift.apply(h, u), h.push.apply(h, l), m = h.length, a = Promise.resolve(n); d < m; )
1435
- a = a.then(h[d++], h[d++]);
1433
+ const p = [Pe.bind(this), void 0];
1434
+ for (p.unshift.apply(p, u), p.push.apply(p, l), m = p.length, a = Promise.resolve(n); d < m; )
1435
+ a = a.then(p[d++], p[d++]);
1436
1436
  return a;
1437
1437
  }
1438
1438
  m = u.length;
1439
1439
  let g = n;
1440
1440
  for (d = 0; d < m; ) {
1441
- const h = u[d++], p = u[d++];
1441
+ const p = u[d++], h = u[d++];
1442
1442
  try {
1443
- g = h(g);
1443
+ g = p(g);
1444
1444
  } catch (w) {
1445
- p.call(this, w);
1445
+ h.call(this, w);
1446
1446
  break;
1447
1447
  }
1448
1448
  }
1449
1449
  try {
1450
1450
  a = Pe.call(this, g);
1451
- } catch (h) {
1452
- return Promise.reject(h);
1451
+ } catch (p) {
1452
+ return Promise.reject(p);
1453
1453
  }
1454
1454
  for (d = 0, m = l.length; d < m; )
1455
1455
  a = a.then(l[d++], l[d++]);
@@ -1650,28 +1650,28 @@ T.all = function(t) {
1650
1650
  T.spread = Cn;
1651
1651
  T.isAxiosError = kn;
1652
1652
  T.mergeConfig = q;
1653
- T.AxiosHeaders = E;
1653
+ T.AxiosHeaders = S;
1654
1654
  T.formToJSON = (e) => Ve(c.isHTMLForm(e) ? new FormData(e) : e);
1655
1655
  T.getAdapter = Xe.getAdapter;
1656
1656
  T.HttpStatusCode = ue;
1657
1657
  T.default = T;
1658
1658
  const {
1659
- Axios: vn,
1659
+ Axios: Qn,
1660
1660
  AxiosError: xn,
1661
- CanceledError: Wn,
1662
- isCancel: Qn,
1663
- CancelToken: Xn,
1664
- VERSION: Zn,
1665
- all: Yn,
1666
- Cancel: er,
1667
- isAxiosError: tr,
1668
- spread: nr,
1669
- toFormData: rr,
1661
+ CanceledError: Xn,
1662
+ isCancel: Zn,
1663
+ CancelToken: Yn,
1664
+ VERSION: er,
1665
+ all: tr,
1666
+ Cancel: nr,
1667
+ isAxiosError: rr,
1668
+ spread: sr,
1669
+ toFormData: or,
1670
1670
  AxiosHeaders: Ce,
1671
- HttpStatusCode: sr,
1672
- formToJSON: or,
1673
- getAdapter: ir,
1674
- mergeConfig: ar
1671
+ HttpStatusCode: ir,
1672
+ formToJSON: ar,
1673
+ getAdapter: cr,
1674
+ mergeConfig: ur
1675
1675
  } = T, H = () => new xn(
1676
1676
  "Unauthorized",
1677
1677
  "ERR_UNAUTHORIZED",
@@ -1700,23 +1700,23 @@ const {
1700
1700
  setTokens: o,
1701
1701
  clearTokens: i,
1702
1702
  handleTokenRefresh: async (a) => {
1703
- var h;
1704
- if ((h = a.url) == null ? void 0 : h.includes(
1703
+ var p;
1704
+ if ((p = a.url) == null ? void 0 : p.includes(
1705
1705
  e.refreshTokenEndpointPath
1706
1706
  )) {
1707
1707
  i();
1708
- const p = H();
1709
- throw u(p), p;
1708
+ const h = H();
1709
+ throw u(h), h;
1710
1710
  }
1711
1711
  if (!r()) {
1712
1712
  i();
1713
- const p = H();
1714
- throw u(p), p;
1713
+ const h = H();
1714
+ throw u(h), h;
1715
1715
  }
1716
1716
  if (t)
1717
- return new Promise((p, w) => {
1717
+ return new Promise((h, w) => {
1718
1718
  n.push({
1719
- resolve: p,
1719
+ resolve: h,
1720
1720
  reject: w,
1721
1721
  requestConfig: a
1722
1722
  });
@@ -1724,13 +1724,13 @@ const {
1724
1724
  const g = s();
1725
1725
  if (!g) {
1726
1726
  i();
1727
- const p = H();
1728
- throw u(p), p;
1727
+ const h = H();
1728
+ throw u(h), h;
1729
1729
  }
1730
1730
  t = !0;
1731
1731
  try {
1732
- const p = await e.onRefreshToken(g);
1733
- return o(p), a.headers || (a.headers = {}), a.headers.Authorization = `Bearer ${p.accessToken}`, u(null, p.accessToken), t = !1, a;
1732
+ const h = await e.onRefreshToken(g);
1733
+ return o(h), a.headers || (a.headers = {}), a.headers.Authorization = `Bearer ${h.accessToken}`, u(null, h.accessToken), t = !1, a;
1734
1734
  } catch {
1735
1735
  i();
1736
1736
  const w = H();
@@ -1770,21 +1770,21 @@ const {
1770
1770
  e.responseInterceptor.onReject
1771
1771
  ), {
1772
1772
  request: async (d, m) => {
1773
- const g = d.startsWith("/") ? d.substring(1) : d, h = `${o}/${r}/${n}/${g}`, p = {
1773
+ const g = d.startsWith("/") ? d.substring(1) : d, p = `${o}/${r}/${n}/${g}`, h = {
1774
1774
  "Content-Type": (m == null ? void 0 : m.contentType) || "application/json",
1775
1775
  apiVersion: n,
1776
1776
  Authorization: "",
1777
1777
  ...e.headers ?? {}
1778
1778
  }, w = l.getAccessToken();
1779
- w && (p.Authorization = `Bearer ${w}`);
1780
- const S = {
1779
+ w && (h.Authorization = `Bearer ${w}`);
1780
+ const E = {
1781
1781
  method: (m == null ? void 0 : m.method) || "GET",
1782
- headers: p,
1783
- url: h,
1782
+ headers: h,
1783
+ url: p,
1784
1784
  data: m == null ? void 0 : m.data,
1785
1785
  responseType: m == null ? void 0 : m.responseType
1786
1786
  };
1787
- return await t.request(S);
1787
+ return await t.request(E);
1788
1788
  },
1789
1789
  getAccessToken: l.getAccessToken,
1790
1790
  setTokens: l.setTokens,
@@ -1870,7 +1870,21 @@ const ke = "auth", Un = (e) => {
1870
1870
  data: JSON.stringify(r)
1871
1871
  })
1872
1872
  };
1873
- }, ne = "payment", In = (e) => {
1873
+ }, In = "endorsement", jn = (e) => {
1874
+ const t = P(e);
1875
+ return {
1876
+ putEndorsement: (r, s) => {
1877
+ const o = new FormData();
1878
+ return o.append("data", JSON.stringify(r)), s && (Array.isArray(s) ? s.forEach((i) => {
1879
+ o.append("attachments", i);
1880
+ }) : o.append("attachments", s)), t.request(`/${In}`, {
1881
+ method: "PUT",
1882
+ data: o,
1883
+ contentType: "multipart/form-data"
1884
+ });
1885
+ }
1886
+ };
1887
+ }, ne = "payment", Hn = (e) => {
1874
1888
  const t = P(e);
1875
1889
  return {
1876
1890
  postPayment: (o) => t.request(`/${ne}`, {
@@ -1892,7 +1906,7 @@ const ke = "auth", Un = (e) => {
1892
1906
  }
1893
1907
  )
1894
1908
  };
1895
- }, J = "product/action", jn = (e) => {
1909
+ }, J = "product/action", Jn = (e) => {
1896
1910
  const t = P(e);
1897
1911
  return {
1898
1912
  getCnpjStatus: (i) => t.request(`/${J}/Custom/CnpjCheck?cnpj=${i}`, {
@@ -1918,7 +1932,7 @@ const ke = "auth", Un = (e) => {
1918
1932
  }
1919
1933
  )
1920
1934
  };
1921
- }, x = "quotation", Hn = (e) => {
1935
+ }, x = "quotation", Mn = (e) => {
1922
1936
  const t = P(e);
1923
1937
  return {
1924
1938
  getQuotations: (a) => {
@@ -1972,7 +1986,7 @@ const ke = "auth", Un = (e) => {
1972
1986
  }
1973
1987
  )
1974
1988
  };
1975
- }, Jn = "report", Mn = (e) => {
1989
+ }, zn = "report", Vn = (e) => {
1976
1990
  const t = P(e);
1977
1991
  return {
1978
1992
  getReportStream: (r) => {
@@ -1982,7 +1996,7 @@ const ke = "auth", Un = (e) => {
1982
1996
  ...r.additionalParams
1983
1997
  });
1984
1998
  return t.request(
1985
- `/${Jn}/generate-stream?${s.toString()}`,
1999
+ `/${zn}/generate-stream?${s.toString()}`,
1986
2000
  {
1987
2001
  method: "GET",
1988
2002
  data: "",
@@ -1991,11 +2005,11 @@ const ke = "auth", Un = (e) => {
1991
2005
  );
1992
2006
  }
1993
2007
  };
1994
- }, zn = "SubscriberData", Vn = (e) => {
2008
+ }, Gn = "SubscriberData", Kn = (e) => {
1995
2009
  const t = P(e);
1996
2010
  return {
1997
2011
  getSubscriber: (r) => t.request(
1998
- `/${zn}/get-subscriber-data?cnpj=${r}`,
2012
+ `/${Gn}/get-subscriber-data?cnpj=${r}`,
1999
2013
  {
2000
2014
  method: "GET",
2001
2015
  data: ""
@@ -2003,8 +2017,8 @@ const ke = "auth", Un = (e) => {
2003
2017
  )
2004
2018
  };
2005
2019
  };
2006
- function cr(e) {
2007
- const t = Un(e), n = Ln(e), r = $n(e), s = Hn(e), o = In(e), i = Fn(e), u = _n(e), f = jn(e), l = Mn(e), a = Vn(e);
2020
+ function lr(e) {
2021
+ const t = Un(e), n = Ln(e), r = $n(e), s = Mn(e), o = Hn(e), i = Fn(e), u = _n(e), f = jn(e), l = Jn(e), a = Vn(e), d = Kn(e);
2008
2022
  return {
2009
2023
  auth: t,
2010
2024
  authAkad: n,
@@ -2013,11 +2027,12 @@ function cr(e) {
2013
2027
  payment: o,
2014
2028
  address: i,
2015
2029
  broker: u,
2016
- plugin: f,
2017
- report: l,
2018
- subscriber: a
2030
+ endorsement: f,
2031
+ plugin: l,
2032
+ report: a,
2033
+ subscriber: d
2019
2034
  };
2020
2035
  }
2021
2036
  export {
2022
- cr as default
2037
+ lr as default
2023
2038
  };
package/ts-lib.umd.cjs CHANGED
@@ -1,6 +1,6 @@
1
- (function(U,$){typeof exports=="object"&&typeof module<"u"?module.exports=$():typeof define=="function"&&define.amd?define($):(U=typeof globalThis<"u"?globalThis:U||self,U["ts-lib"]=$())})(this,function(){"use strict";function U(e,t){return function(){return e.apply(t,arguments)}}const{toString:$}=Object.prototype,{getPrototypeOf:ee}=Object,M=(e=>t=>{const n=$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),O=e=>(e=e.toLowerCase(),t=>M(t)===e),z=e=>t=>typeof t===e,{isArray:q}=Array,D=z("undefined");function nt(e){return e!==null&&!D(e)&&e.constructor!==null&&!D(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ye=O("ArrayBuffer");function rt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ye(e.buffer),t}const st=z("string"),R=z("function"),ge=z("number"),V=e=>e!==null&&typeof e=="object",ot=e=>e===!0||e===!1,G=e=>{if(M(e)!=="object")return!1;const t=ee(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},it=O("Date"),at=O("File"),ct=O("Blob"),ut=O("FileList"),lt=e=>V(e)&&R(e.pipe),ft=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||R(e.append)&&((t=M(e))==="formdata"||t==="object"&&R(e.toString)&&e.toString()==="[object FormData]"))},dt=O("URLSearchParams"),[ht,pt,mt,yt]=["ReadableStream","Request","Response","Headers"].map(O),gt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function I(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),q(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let u;for(r=0;r<i;r++)u=o[r],t.call(null,e[u],u,e)}}function be(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const we=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Te=e=>!D(e)&&e!==we;function te(){const{caseless:e}=Te(this)&&this||{},t={},n=(r,s)=>{const o=e&&be(t,s)||s;G(t[o])&&G(r)?t[o]=te(t[o],r):G(r)?t[o]=te({},r):q(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&I(arguments[r],n);return t}const bt=(e,t,n,{allOwnKeys:r}={})=>(I(t,(s,o)=>{n&&R(s)?e[o]=U(s,n):e[o]=s},{allOwnKeys:r}),e),wt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Tt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},St=(e,t,n,r)=>{let s,o,i;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!u[i]&&(t[i]=e[i],u[i]=!0);e=n!==!1&&ee(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Et=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Rt=e=>{if(!e)return null;if(q(e))return e;let t=e.length;if(!ge(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ot=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ee(Uint8Array)),At=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Pt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Nt=O("HTMLFormElement"),Ct=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Se=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),kt=O("RegExp"),Ee=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};I(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},xt=e=>{Ee(e,(t,n)=>{if(R(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(R(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Bt=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return q(e)?r(e):r(String(e).split(t)),n},Ft=()=>{},Ut=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,ne="abcdefghijklmnopqrstuvwxyz",Re="0123456789",Oe={DIGIT:Re,ALPHA:ne,ALPHA_DIGIT:ne+ne.toUpperCase()+Re},qt=(e=16,t=Oe.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Lt(e){return!!(e&&R(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const _t=e=>{const t=new Array(10),n=(r,s)=>{if(V(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=q(r)?[]:{};return I(r,(i,u)=>{const f=n(i,s+1);!D(f)&&(o[u]=f)}),t[s]=void 0,o}}return r};return n(e,0)},$t=O("AsyncFunction"),c={isArray:q,isArrayBuffer:ye,isBuffer:nt,isFormData:ft,isArrayBufferView:rt,isString:st,isNumber:ge,isBoolean:ot,isObject:V,isPlainObject:G,isReadableStream:ht,isRequest:pt,isResponse:mt,isHeaders:yt,isUndefined:D,isDate:it,isFile:at,isBlob:ct,isRegExp:kt,isFunction:R,isStream:lt,isURLSearchParams:dt,isTypedArray:Ot,isFileList:ut,forEach:I,merge:te,extend:bt,trim:gt,stripBOM:wt,inherits:Tt,toFlatObject:St,kindOf:M,kindOfTest:O,endsWith:Et,toArray:Rt,forEachEntry:At,matchAll:Pt,isHTMLForm:Nt,hasOwnProperty:Se,hasOwnProp:Se,reduceDescriptors:Ee,freezeMethods:xt,toObjectSet:Bt,toCamelCase:Ct,noop:Ft,toFiniteNumber:Ut,findKey:be,global:we,isContextDefined:Te,ALPHABET:Oe,generateString:qt,isSpecCompliantForm:Lt,toJSONObject:_t,isAsyncFn:$t,isThenable:e=>e&&(V(e)||R(e))&&R(e.then)&&R(e.catch)};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}c.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ae=y.prototype,Pe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Pe[e]={value:e}}),Object.defineProperties(y,Pe),Object.defineProperty(Ae,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,o)=>{const i=Object.create(Ae);return c.toFlatObject(e,i,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),y.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const Dt=null;function re(e){return c.isPlainObject(e)||c.isArray(e)}function Ne(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function Ce(e,t,n){return e?e.concat(t).map(function(s,o){return s=Ne(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function It(e){return c.isArray(e)&&!e.some(re)}const jt=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function K(e,t,n){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,b){return!c.isUndefined(b[p])});const r=n.metaTokens,s=n.visitor||a,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(s))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(c.isDate(h))return h.toISOString();if(!f&&c.isBlob(h))throw new y("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(h)||c.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function a(h,p,b){let S=h;if(h&&!b&&typeof h=="object"){if(c.endsWith(p,"{}"))p=r?p:p.slice(0,-2),h=JSON.stringify(h);else if(c.isArray(h)&&It(h)||(c.isFileList(h)||c.endsWith(p,"[]"))&&(S=c.toArray(h)))return p=Ne(p),S.forEach(function(w,J){!(c.isUndefined(w)||w===null)&&t.append(i===!0?Ce([p],J,o):i===null?p:p+"[]",l(w))}),!1}return re(h)?!0:(t.append(Ce(b,p,o),l(h)),!1)}const d=[],m=Object.assign(jt,{defaultVisitor:a,convertValue:l,isVisitable:re});function g(h,p){if(!c.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+p.join("."));d.push(h),c.forEach(h,function(S,N){(!(c.isUndefined(S)||S===null)&&s.call(t,S,c.isString(N)?N.trim():N,p,m))===!0&&g(S,p?p.concat(N):[N])}),d.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return g(e),t}function ke(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function se(e,t){this._pairs=[],e&&K(e,this,t)}const xe=se.prototype;xe.append=function(t,n){this._pairs.push([t,n])},xe.toString=function(t){const n=t?function(r){return t.call(this,r,ke)}:ke;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Ht(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Be(e,t,n){if(!t)return e;const r=n&&n.encode||Ht,s=n&&n.serialize;let o;if(s?o=s(t,n):o=c.isURLSearchParams(t)?t.toString():new se(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Fe{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Jt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:se,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},oe=typeof window<"u"&&typeof document<"u",Mt=(e=>oe&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),zt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Vt=oe&&window.location.href||"http://localhost",A={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:oe,hasStandardBrowserEnv:Mt,hasStandardBrowserWebWorkerEnv:zt,origin:Vt},Symbol.toStringTag,{value:"Module"})),...Jt};function Gt(e,t){return K(e,new A.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return A.isNode&&c.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Kt(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function vt(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function qe(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const u=Number.isFinite(+i),f=o>=n.length;return i=!i&&c.isArray(s)?s.length:i,f?(c.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!u):((!s[i]||!c.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&c.isArray(s[i])&&(s[i]=vt(s[i])),!u)}if(c.isFormData(e)&&c.isFunction(e.entries)){const n={};return c.forEachEntry(e,(r,s)=>{t(Kt(r),s,n,0)}),n}return null}function Wt(e,t,n){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const j={transitional:Ue,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=c.isObject(t);if(o&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return s?JSON.stringify(qe(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Gt(t,this.formSerializer).toString();if((u=c.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return K(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Wt(t)):t}],transformResponse:[function(t){const n=this.transitional||j.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(u){if(i)throw u.name==="SyntaxError"?y.from(u,y.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:A.classes.FormData,Blob:A.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{j.headers[e]={}});const Qt=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Xt=e=>{const t={};let n,r,s;return e&&e.split(`
1
+ (function(U,D){typeof exports=="object"&&typeof module<"u"?module.exports=D():typeof define=="function"&&define.amd?define(D):(U=typeof globalThis<"u"?globalThis:U||self,U["ts-lib"]=D())})(this,function(){"use strict";function U(e,t){return function(){return e.apply(t,arguments)}}const{toString:D}=Object.prototype,{getPrototypeOf:ee}=Object,M=(e=>t=>{const n=D.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),O=e=>(e=e.toLowerCase(),t=>M(t)===e),z=e=>t=>typeof t===e,{isArray:q}=Array,_=z("undefined");function nt(e){return e!==null&&!_(e)&&e.constructor!==null&&!_(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ye=O("ArrayBuffer");function rt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ye(e.buffer),t}const st=z("string"),R=z("function"),ge=z("number"),V=e=>e!==null&&typeof e=="object",ot=e=>e===!0||e===!1,G=e=>{if(M(e)!=="object")return!1;const t=ee(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},it=O("Date"),at=O("File"),ct=O("Blob"),ut=O("FileList"),lt=e=>V(e)&&R(e.pipe),ft=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||R(e.append)&&((t=M(e))==="formdata"||t==="object"&&R(e.toString)&&e.toString()==="[object FormData]"))},dt=O("URLSearchParams"),[pt,ht,mt,yt]=["ReadableStream","Request","Response","Headers"].map(O),gt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function I(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),q(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let u;for(r=0;r<i;r++)u=o[r],t.call(null,e[u],u,e)}}function be(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const we=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Te=e=>!_(e)&&e!==we;function te(){const{caseless:e}=Te(this)&&this||{},t={},n=(r,s)=>{const o=e&&be(t,s)||s;G(t[o])&&G(r)?t[o]=te(t[o],r):G(r)?t[o]=te({},r):q(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&I(arguments[r],n);return t}const bt=(e,t,n,{allOwnKeys:r}={})=>(I(t,(s,o)=>{n&&R(s)?e[o]=U(s,n):e[o]=s},{allOwnKeys:r}),e),wt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Tt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},St=(e,t,n,r)=>{let s,o,i;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!u[i]&&(t[i]=e[i],u[i]=!0);e=n!==!1&&ee(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Et=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Rt=e=>{if(!e)return null;if(q(e))return e;let t=e.length;if(!ge(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ot=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ee(Uint8Array)),At=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Pt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Nt=O("HTMLFormElement"),Ct=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Se=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),kt=O("RegExp"),Ee=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};I(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},xt=e=>{Ee(e,(t,n)=>{if(R(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(R(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Bt=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return q(e)?r(e):r(String(e).split(t)),n},Ft=()=>{},Ut=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,ne="abcdefghijklmnopqrstuvwxyz",Re="0123456789",Oe={DIGIT:Re,ALPHA:ne,ALPHA_DIGIT:ne+ne.toUpperCase()+Re},qt=(e=16,t=Oe.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Lt(e){return!!(e&&R(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const $t=e=>{const t=new Array(10),n=(r,s)=>{if(V(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=q(r)?[]:{};return I(r,(i,u)=>{const f=n(i,s+1);!_(f)&&(o[u]=f)}),t[s]=void 0,o}}return r};return n(e,0)},Dt=O("AsyncFunction"),c={isArray:q,isArrayBuffer:ye,isBuffer:nt,isFormData:ft,isArrayBufferView:rt,isString:st,isNumber:ge,isBoolean:ot,isObject:V,isPlainObject:G,isReadableStream:pt,isRequest:ht,isResponse:mt,isHeaders:yt,isUndefined:_,isDate:it,isFile:at,isBlob:ct,isRegExp:kt,isFunction:R,isStream:lt,isURLSearchParams:dt,isTypedArray:Ot,isFileList:ut,forEach:I,merge:te,extend:bt,trim:gt,stripBOM:wt,inherits:Tt,toFlatObject:St,kindOf:M,kindOfTest:O,endsWith:Et,toArray:Rt,forEachEntry:At,matchAll:Pt,isHTMLForm:Nt,hasOwnProperty:Se,hasOwnProp:Se,reduceDescriptors:Ee,freezeMethods:xt,toObjectSet:Bt,toCamelCase:Ct,noop:Ft,toFiniteNumber:Ut,findKey:be,global:we,isContextDefined:Te,ALPHABET:Oe,generateString:qt,isSpecCompliantForm:Lt,toJSONObject:$t,isAsyncFn:Dt,isThenable:e=>e&&(V(e)||R(e))&&R(e.then)&&R(e.catch)};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}c.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ae=y.prototype,Pe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Pe[e]={value:e}}),Object.defineProperties(y,Pe),Object.defineProperty(Ae,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,o)=>{const i=Object.create(Ae);return c.toFlatObject(e,i,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),y.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const _t=null;function re(e){return c.isPlainObject(e)||c.isArray(e)}function Ne(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function Ce(e,t,n){return e?e.concat(t).map(function(s,o){return s=Ne(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function It(e){return c.isArray(e)&&!e.some(re)}const jt=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function K(e,t,n){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,b){return!c.isUndefined(b[h])});const r=n.metaTokens,s=n.visitor||a,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(s))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(c.isDate(p))return p.toISOString();if(!f&&c.isBlob(p))throw new y("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(p)||c.isTypedArray(p)?f&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function a(p,h,b){let S=p;if(p&&!b&&typeof p=="object"){if(c.endsWith(h,"{}"))h=r?h:h.slice(0,-2),p=JSON.stringify(p);else if(c.isArray(p)&&It(p)||(c.isFileList(p)||c.endsWith(h,"[]"))&&(S=c.toArray(p)))return h=Ne(h),S.forEach(function(w,J){!(c.isUndefined(w)||w===null)&&t.append(i===!0?Ce([h],J,o):i===null?h:h+"[]",l(w))}),!1}return re(p)?!0:(t.append(Ce(b,h,o),l(p)),!1)}const d=[],m=Object.assign(jt,{defaultVisitor:a,convertValue:l,isVisitable:re});function g(p,h){if(!c.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+h.join("."));d.push(p),c.forEach(p,function(S,N){(!(c.isUndefined(S)||S===null)&&s.call(t,S,c.isString(N)?N.trim():N,h,m))===!0&&g(S,h?h.concat(N):[N])}),d.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return g(e),t}function ke(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function se(e,t){this._pairs=[],e&&K(e,this,t)}const xe=se.prototype;xe.append=function(t,n){this._pairs.push([t,n])},xe.toString=function(t){const n=t?function(r){return t.call(this,r,ke)}:ke;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Ht(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Be(e,t,n){if(!t)return e;const r=n&&n.encode||Ht,s=n&&n.serialize;let o;if(s?o=s(t,n):o=c.isURLSearchParams(t)?t.toString():new se(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Fe{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Jt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:se,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},oe=typeof window<"u"&&typeof document<"u",Mt=(e=>oe&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),zt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Vt=oe&&window.location.href||"http://localhost",A={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:oe,hasStandardBrowserEnv:Mt,hasStandardBrowserWebWorkerEnv:zt,origin:Vt},Symbol.toStringTag,{value:"Module"})),...Jt};function Gt(e,t){return K(e,new A.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return A.isNode&&c.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Kt(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function vt(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function qe(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const u=Number.isFinite(+i),f=o>=n.length;return i=!i&&c.isArray(s)?s.length:i,f?(c.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!u):((!s[i]||!c.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&c.isArray(s[i])&&(s[i]=vt(s[i])),!u)}if(c.isFormData(e)&&c.isFunction(e.entries)){const n={};return c.forEachEntry(e,(r,s)=>{t(Kt(r),s,n,0)}),n}return null}function Wt(e,t,n){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const j={transitional:Ue,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=c.isObject(t);if(o&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return s?JSON.stringify(qe(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Gt(t,this.formSerializer).toString();if((u=c.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return K(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Wt(t)):t}],transformResponse:[function(t){const n=this.transitional||j.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(u){if(i)throw u.name==="SyntaxError"?y.from(u,y.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:A.classes.FormData,Blob:A.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{j.headers[e]={}});const Qt=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Xt=e=>{const t={};let n,r,s;return e&&e.split(`
2
2
  `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Qt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Le=Symbol("internals");function H(e){return e&&String(e).trim().toLowerCase()}function v(e){return e===!1||e==null?e:c.isArray(e)?e.map(v):String(e)}function Zt(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Yt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ie(e,t,n,r,s){if(c.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!c.isString(t)){if(c.isString(r))return t.indexOf(r)!==-1;if(c.isRegExp(r))return r.test(t)}}function en(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function tn(e,t){const n=c.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let E=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(u,f,l){const a=H(f);if(!a)throw new Error("header name must be a non-empty string");const d=c.findKey(s,a);(!d||s[d]===void 0||l===!0||l===void 0&&s[d]!==!1)&&(s[d||f]=v(u))}const i=(u,f)=>c.forEach(u,(l,a)=>o(l,a,f));if(c.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(c.isString(t)&&(t=t.trim())&&!Yt(t))i(Xt(t),n);else if(c.isHeaders(t))for(const[u,f]of t.entries())o(f,u,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=H(t),t){const r=c.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Zt(s);if(c.isFunction(n))return n.call(this,s,r);if(c.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=H(t),t){const r=c.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ie(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=H(i),i){const u=c.findKey(r,i);u&&(!n||ie(r,r[u],u,n))&&(delete r[u],s=!0)}}return c.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||ie(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return c.forEach(this,(s,o)=>{const i=c.findKey(r,o);if(i){n[i]=v(s),delete n[o];return}const u=t?en(o):String(o).trim();u!==o&&delete n[o],n[u]=v(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return c.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&c.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Le]=this[Le]={accessors:{}}).accessors,s=this.prototype;function o(i){const u=H(i);r[u]||(tn(s,i),r[u]=!0)}return c.isArray(t)?t.forEach(o):o(t),this}};E.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(E.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),c.freezeMethods(E);function ae(e,t){const n=this||j,r=t||n,s=E.from(r.headers);let o=r.data;return c.forEach(e,function(u){o=u.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function _e(e){return!!(e&&e.__CANCEL__)}function L(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}c.inherits(L,y,{__CANCEL__:!0});function $e(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function nn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function rn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const l=Date.now(),a=r[o];i||(i=l),n[s]=f,r[s]=l;let d=o,m=0;for(;d!==s;)m+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const g=a&&l-a;return g?Math.round(m*1e3/g):void 0}}function sn(e,t){let n=0;const r=1e3/t;let s=null;return function(){const i=this===!0,u=Date.now();if(i||u-n>r)return s&&(clearTimeout(s),s=null),n=u,e.apply(null,arguments);s||(s=setTimeout(()=>(s=null,n=Date.now(),e.apply(null,arguments)),r-(u-n)))}}const W=(e,t,n=3)=>{let r=0;const s=rn(50,250);return sn(o=>{const i=o.loaded,u=o.lengthComputable?o.total:void 0,f=i-r,l=s(f),a=i<=u;r=i;const d={loaded:i,total:u,progress:u?i/u:void 0,bytes:f,rate:l||void 0,estimated:l&&u&&a?(u-i)/l:void 0,event:o,lengthComputable:u!=null};d[t?"download":"upload"]=!0,e(d)},n)},on=A.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const u=c.isString(i)?s(i):i;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}(),an=A.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];c.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),c.isString(r)&&i.push("path="+r),c.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function cn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function un(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function De(e,t){return e&&!cn(t)?un(e,t):t}const Ie=e=>e instanceof E?{...e}:e;function B(e,t){t=t||{};const n={};function r(l,a,d){return c.isPlainObject(l)&&c.isPlainObject(a)?c.merge.call({caseless:d},l,a):c.isPlainObject(a)?c.merge({},a):c.isArray(a)?a.slice():a}function s(l,a,d){if(c.isUndefined(a)){if(!c.isUndefined(l))return r(void 0,l,d)}else return r(l,a,d)}function o(l,a){if(!c.isUndefined(a))return r(void 0,a)}function i(l,a){if(c.isUndefined(a)){if(!c.isUndefined(l))return r(void 0,l)}else return r(void 0,a)}function u(l,a,d){if(d in t)return r(l,a);if(d in e)return r(void 0,l)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:u,headers:(l,a)=>s(Ie(l),Ie(a),!0)};return c.forEach(Object.keys(Object.assign({},e,t)),function(a){const d=f[a]||s,m=d(e[a],t[a],a);c.isUndefined(m)&&d!==u||(n[a]=m)}),n}const je=e=>{const t=B({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:u}=t;t.headers=i=E.from(i),t.url=Be(De(t.baseURL,t.url),e.params,e.paramsSerializer),u&&i.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(c.isFormData(n)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[l,...a]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([l||"multipart/form-data",...a].join("; "))}}if(A.hasStandardBrowserEnv&&(r&&c.isFunction(r)&&(r=r(t)),r||r!==!1&&on(t.url))){const l=s&&o&&an.read(o);l&&i.set(s,l)}return t},ln=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=je(e);let o=s.data;const i=E.from(s.headers).normalize();let{responseType:u}=s,f;function l(){s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let a=new XMLHttpRequest;a.open(s.method.toUpperCase(),s.url,!0),a.timeout=s.timeout;function d(){if(!a)return;const g=E.from("getAllResponseHeaders"in a&&a.getAllResponseHeaders()),p={data:!u||u==="text"||u==="json"?a.responseText:a.response,status:a.status,statusText:a.statusText,headers:g,config:e,request:a};$e(function(S){n(S),l()},function(S){r(S),l()},p),a=null}"onloadend"in a?a.onloadend=d:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(d)},a.onabort=function(){a&&(r(new y("Request aborted",y.ECONNABORTED,s,a)),a=null)},a.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,s,a)),a=null},a.ontimeout=function(){let h=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const p=s.transitional||Ue;s.timeoutErrorMessage&&(h=s.timeoutErrorMessage),r(new y(h,p.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,s,a)),a=null},o===void 0&&i.setContentType(null),"setRequestHeader"in a&&c.forEach(i.toJSON(),function(h,p){a.setRequestHeader(p,h)}),c.isUndefined(s.withCredentials)||(a.withCredentials=!!s.withCredentials),u&&u!=="json"&&(a.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&a.addEventListener("progress",W(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",W(s.onUploadProgress)),(s.cancelToken||s.signal)&&(f=g=>{a&&(r(!g||g.type?new L(null,e,a):g),a.abort(),a=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const m=nn(s.url);if(m&&A.protocols.indexOf(m)===-1){r(new y("Unsupported protocol "+m+":",y.ERR_BAD_REQUEST,e));return}a.send(o||null)})},fn=(e,t)=>{let n=new AbortController,r;const s=function(f){if(!r){r=!0,i();const l=f instanceof Error?f:this.reason;n.abort(l instanceof y?l:new L(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{s(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(f=>{f&&(f.removeEventListener?f.removeEventListener("abort",s):f.unsubscribe(s))}),e=null)};e.forEach(f=>f&&f.addEventListener&&f.addEventListener("abort",s));const{signal:u}=n;return u.unsubscribe=i,[u,()=>{o&&clearTimeout(o),o=null}]},dn=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},hn=async function*(e,t,n){for await(const r of e)yield*dn(ArrayBuffer.isView(r)?r:await n(String(r)),t)},He=(e,t,n,r,s)=>{const o=hn(e,t,s);let i=0;return new ReadableStream({type:"bytes",async pull(u){const{done:f,value:l}=await o.next();if(f){u.close(),r();return}let a=l.byteLength;n&&n(i+=a),u.enqueue(new Uint8Array(l))},cancel(u){return r(u),o.return()}},{highWaterMark:2})},Je=(e,t)=>{const n=e!=null;return r=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:r}))},Q=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Me=Q&&typeof ReadableStream=="function",ce=Q&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),pn=Me&&(()=>{let e=!1;const t=new Request(A.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),ze=64*1024,ue=Me&&!!(()=>{try{return c.isReadableStream(new Response("").body)}catch{}})(),X={stream:ue&&(e=>e.body)};Q&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!X[t]&&(X[t]=c.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,r)})})})(new Response);const mn=async e=>{if(e==null)return 0;if(c.isBlob(e))return e.size;if(c.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(c.isArrayBufferView(e))return e.byteLength;if(c.isURLSearchParams(e)&&(e=e+""),c.isString(e))return(await ce(e)).byteLength},yn=async(e,t)=>{const n=c.toFiniteNumber(e.getContentLength());return n??mn(t)},le={http:Dt,xhr:ln,fetch:Q&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:u,onUploadProgress:f,responseType:l,headers:a,withCredentials:d="same-origin",fetchOptions:m}=je(e);l=l?(l+"").toLowerCase():"text";let[g,h]=s||o||i?fn([s,o],i):[],p,b;const S=()=>{!p&&setTimeout(()=>{g&&g.unsubscribe()}),p=!0};let N;try{if(f&&pn&&n!=="get"&&n!=="head"&&(N=await yn(a,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),_;c.isFormData(r)&&(_=x.headers.get("content-type"))&&a.setContentType(_),x.body&&(r=He(x.body,ze,Je(N,W(f)),null,ce))}c.isString(d)||(d=d?"cors":"omit"),b=new Request(t,{...m,signal:g,method:n.toUpperCase(),headers:a.normalize().toJSON(),body:r,duplex:"half",withCredentials:d});let w=await fetch(b);const J=ue&&(l==="stream"||l==="response");if(ue&&(u||J)){const x={};["status","statusText","headers"].forEach(et=>{x[et]=w[et]});const _=c.toFiniteNumber(w.headers.get("content-length"));w=new Response(He(w.body,ze,u&&Je(_,W(u,!0)),J&&S,ce),x)}l=l||"text";let In=await X[c.findKey(X,l)||"text"](w,e);return!J&&S(),h&&h(),await new Promise((x,_)=>{$e(x,_,{data:In,headers:E.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:b})})}catch(w){throw S(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,b),{cause:w.cause||w}):y.from(w,w&&w.code,e,b)}})};c.forEach(le,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ve=e=>`- ${e}`,gn=e=>c.isFunction(e)||e===null||e===!1,Ge={getAdapter:e=>{e=c.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!gn(n)&&(r=le[(i=String(n)).toLowerCase()],r===void 0))throw new y(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
3
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Le]=this[Le]={accessors:{}}).accessors,s=this.prototype;function o(i){const u=H(i);r[u]||(tn(s,i),r[u]=!0)}return c.isArray(t)?t.forEach(o):o(t),this}};E.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(E.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),c.freezeMethods(E);function ae(e,t){const n=this||j,r=t||n,s=E.from(r.headers);let o=r.data;return c.forEach(e,function(u){o=u.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function $e(e){return!!(e&&e.__CANCEL__)}function L(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}c.inherits(L,y,{__CANCEL__:!0});function De(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function nn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function rn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const l=Date.now(),a=r[o];i||(i=l),n[s]=f,r[s]=l;let d=o,m=0;for(;d!==s;)m+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const g=a&&l-a;return g?Math.round(m*1e3/g):void 0}}function sn(e,t){let n=0;const r=1e3/t;let s=null;return function(){const i=this===!0,u=Date.now();if(i||u-n>r)return s&&(clearTimeout(s),s=null),n=u,e.apply(null,arguments);s||(s=setTimeout(()=>(s=null,n=Date.now(),e.apply(null,arguments)),r-(u-n)))}}const W=(e,t,n=3)=>{let r=0;const s=rn(50,250);return sn(o=>{const i=o.loaded,u=o.lengthComputable?o.total:void 0,f=i-r,l=s(f),a=i<=u;r=i;const d={loaded:i,total:u,progress:u?i/u:void 0,bytes:f,rate:l||void 0,estimated:l&&u&&a?(u-i)/l:void 0,event:o,lengthComputable:u!=null};d[t?"download":"upload"]=!0,e(d)},n)},on=A.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const u=c.isString(i)?s(i):i;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}(),an=A.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];c.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),c.isString(r)&&i.push("path="+r),c.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function cn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function un(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function _e(e,t){return e&&!cn(t)?un(e,t):t}const Ie=e=>e instanceof E?{...e}:e;function B(e,t){t=t||{};const n={};function r(l,a,d){return c.isPlainObject(l)&&c.isPlainObject(a)?c.merge.call({caseless:d},l,a):c.isPlainObject(a)?c.merge({},a):c.isArray(a)?a.slice():a}function s(l,a,d){if(c.isUndefined(a)){if(!c.isUndefined(l))return r(void 0,l,d)}else return r(l,a,d)}function o(l,a){if(!c.isUndefined(a))return r(void 0,a)}function i(l,a){if(c.isUndefined(a)){if(!c.isUndefined(l))return r(void 0,l)}else return r(void 0,a)}function u(l,a,d){if(d in t)return r(l,a);if(d in e)return r(void 0,l)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:u,headers:(l,a)=>s(Ie(l),Ie(a),!0)};return c.forEach(Object.keys(Object.assign({},e,t)),function(a){const d=f[a]||s,m=d(e[a],t[a],a);c.isUndefined(m)&&d!==u||(n[a]=m)}),n}const je=e=>{const t=B({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:u}=t;t.headers=i=E.from(i),t.url=Be(_e(t.baseURL,t.url),e.params,e.paramsSerializer),u&&i.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(c.isFormData(n)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[l,...a]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([l||"multipart/form-data",...a].join("; "))}}if(A.hasStandardBrowserEnv&&(r&&c.isFunction(r)&&(r=r(t)),r||r!==!1&&on(t.url))){const l=s&&o&&an.read(o);l&&i.set(s,l)}return t},ln=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=je(e);let o=s.data;const i=E.from(s.headers).normalize();let{responseType:u}=s,f;function l(){s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let a=new XMLHttpRequest;a.open(s.method.toUpperCase(),s.url,!0),a.timeout=s.timeout;function d(){if(!a)return;const g=E.from("getAllResponseHeaders"in a&&a.getAllResponseHeaders()),h={data:!u||u==="text"||u==="json"?a.responseText:a.response,status:a.status,statusText:a.statusText,headers:g,config:e,request:a};De(function(S){n(S),l()},function(S){r(S),l()},h),a=null}"onloadend"in a?a.onloadend=d:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(d)},a.onabort=function(){a&&(r(new y("Request aborted",y.ECONNABORTED,s,a)),a=null)},a.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,s,a)),a=null},a.ontimeout=function(){let p=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const h=s.transitional||Ue;s.timeoutErrorMessage&&(p=s.timeoutErrorMessage),r(new y(p,h.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,s,a)),a=null},o===void 0&&i.setContentType(null),"setRequestHeader"in a&&c.forEach(i.toJSON(),function(p,h){a.setRequestHeader(h,p)}),c.isUndefined(s.withCredentials)||(a.withCredentials=!!s.withCredentials),u&&u!=="json"&&(a.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&a.addEventListener("progress",W(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",W(s.onUploadProgress)),(s.cancelToken||s.signal)&&(f=g=>{a&&(r(!g||g.type?new L(null,e,a):g),a.abort(),a=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const m=nn(s.url);if(m&&A.protocols.indexOf(m)===-1){r(new y("Unsupported protocol "+m+":",y.ERR_BAD_REQUEST,e));return}a.send(o||null)})},fn=(e,t)=>{let n=new AbortController,r;const s=function(f){if(!r){r=!0,i();const l=f instanceof Error?f:this.reason;n.abort(l instanceof y?l:new L(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{s(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(f=>{f&&(f.removeEventListener?f.removeEventListener("abort",s):f.unsubscribe(s))}),e=null)};e.forEach(f=>f&&f.addEventListener&&f.addEventListener("abort",s));const{signal:u}=n;return u.unsubscribe=i,[u,()=>{o&&clearTimeout(o),o=null}]},dn=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},pn=async function*(e,t,n){for await(const r of e)yield*dn(ArrayBuffer.isView(r)?r:await n(String(r)),t)},He=(e,t,n,r,s)=>{const o=pn(e,t,s);let i=0;return new ReadableStream({type:"bytes",async pull(u){const{done:f,value:l}=await o.next();if(f){u.close(),r();return}let a=l.byteLength;n&&n(i+=a),u.enqueue(new Uint8Array(l))},cancel(u){return r(u),o.return()}},{highWaterMark:2})},Je=(e,t)=>{const n=e!=null;return r=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:r}))},Q=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Me=Q&&typeof ReadableStream=="function",ce=Q&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),hn=Me&&(()=>{let e=!1;const t=new Request(A.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),ze=64*1024,ue=Me&&!!(()=>{try{return c.isReadableStream(new Response("").body)}catch{}})(),X={stream:ue&&(e=>e.body)};Q&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!X[t]&&(X[t]=c.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,r)})})})(new Response);const mn=async e=>{if(e==null)return 0;if(c.isBlob(e))return e.size;if(c.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(c.isArrayBufferView(e))return e.byteLength;if(c.isURLSearchParams(e)&&(e=e+""),c.isString(e))return(await ce(e)).byteLength},yn=async(e,t)=>{const n=c.toFiniteNumber(e.getContentLength());return n??mn(t)},le={http:_t,xhr:ln,fetch:Q&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:u,onUploadProgress:f,responseType:l,headers:a,withCredentials:d="same-origin",fetchOptions:m}=je(e);l=l?(l+"").toLowerCase():"text";let[g,p]=s||o||i?fn([s,o],i):[],h,b;const S=()=>{!h&&setTimeout(()=>{g&&g.unsubscribe()}),h=!0};let N;try{if(f&&hn&&n!=="get"&&n!=="head"&&(N=await yn(a,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),$;c.isFormData(r)&&($=x.headers.get("content-type"))&&a.setContentType($),x.body&&(r=He(x.body,ze,Je(N,W(f)),null,ce))}c.isString(d)||(d=d?"cors":"omit"),b=new Request(t,{...m,signal:g,method:n.toUpperCase(),headers:a.normalize().toJSON(),body:r,duplex:"half",withCredentials:d});let w=await fetch(b);const J=ue&&(l==="stream"||l==="response");if(ue&&(u||J)){const x={};["status","statusText","headers"].forEach(et=>{x[et]=w[et]});const $=c.toFiniteNumber(w.headers.get("content-length"));w=new Response(He(w.body,ze,u&&Je($,W(u,!0)),J&&S,ce),x)}l=l||"text";let Hn=await X[c.findKey(X,l)||"text"](w,e);return!J&&S(),p&&p(),await new Promise((x,$)=>{De(x,$,{data:Hn,headers:E.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:b})})}catch(w){throw S(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,b),{cause:w.cause||w}):y.from(w,w&&w.code,e,b)}})};c.forEach(le,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ve=e=>`- ${e}`,gn=e=>c.isFunction(e)||e===null||e===!1,Ge={getAdapter:e=>{e=c.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!gn(n)&&(r=le[(i=String(n)).toLowerCase()],r===void 0))throw new y(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
4
4
  `+o.map(Ve).join(`
5
- `):" "+Ve(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:le};function fe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new L(null,e)}function Ke(e){return fe(e),e.headers=E.from(e.headers),e.data=ae.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ge.getAdapter(e.adapter||j.adapter)(e).then(function(r){return fe(e),r.data=ae.call(e,e.transformResponse,r),r.headers=E.from(r.headers),r},function(r){return _e(r)||(fe(e),r&&r.response&&(r.response.data=ae.call(e,e.transformResponse,r.response),r.response.headers=E.from(r.response.headers))),Promise.reject(r)})}const ve="1.7.2",de={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{de[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const We={};de.transitional=function(t,n,r){function s(o,i){return"[Axios v"+ve+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,u)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!We[i]&&(We[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,u):!0}};function bn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const u=e[o],f=u===void 0||i(u,o,e);if(f!==!0)throw new y("option "+o+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const he={assertOptions:bn,validators:de},C=he.validators;let F=class{constructor(t){this.defaults=t,this.interceptors={request:new Fe,response:new Fe}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=B(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&he.assertOptions(r,{silentJSONParsing:C.transitional(C.boolean),forcedJSONParsing:C.transitional(C.boolean),clarifyTimeoutError:C.transitional(C.boolean)},!1),s!=null&&(c.isFunction(s)?n.paramsSerializer={serialize:s}:he.assertOptions(s,{encode:C.function,serialize:C.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&c.merge(o.common,o[n.method]);o&&c.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=E.concat(i,o);const u=[];let f=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(n)===!1||(f=f&&p.synchronous,u.unshift(p.fulfilled,p.rejected))});const l=[];this.interceptors.response.forEach(function(p){l.push(p.fulfilled,p.rejected)});let a,d=0,m;if(!f){const h=[Ke.bind(this),void 0];for(h.unshift.apply(h,u),h.push.apply(h,l),m=h.length,a=Promise.resolve(n);d<m;)a=a.then(h[d++],h[d++]);return a}m=u.length;let g=n;for(d=0;d<m;){const h=u[d++],p=u[d++];try{g=h(g)}catch(b){p.call(this,b);break}}try{a=Ke.call(this,g)}catch(h){return Promise.reject(h)}for(d=0,m=l.length;d<m;)a=a.then(l[d++],l[d++]);return a}getUri(t){t=B(this.defaults,t);const n=De(t.baseURL,t.url);return Be(n,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){F.prototype[t]=function(n,r){return this.request(B(r||{},{method:t,url:n,data:(r||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,u){return this.request(B(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}F.prototype[t]=n(),F.prototype[t+"Form"]=n(!0)});let wn=class tt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(u=>{r.subscribe(u),o=u}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,u){r.reason||(r.reason=new L(o,i,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new tt(function(s){t=s}),cancel:t}}};function Tn(e){return function(n){return e.apply(null,n)}}function Sn(e){return c.isObject(e)&&e.isAxiosError===!0}const pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pe).forEach(([e,t])=>{pe[t]=e});function Qe(e){const t=new F(e),n=U(F.prototype.request,t);return c.extend(n,F.prototype,t,{allOwnKeys:!0}),c.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Qe(B(e,s))},n}const T=Qe(j);T.Axios=F,T.CanceledError=L,T.CancelToken=wn,T.isCancel=_e,T.VERSION=ve,T.toFormData=K,T.AxiosError=y,T.Cancel=T.CanceledError,T.all=function(t){return Promise.all(t)},T.spread=Tn,T.isAxiosError=Sn,T.mergeConfig=B,T.AxiosHeaders=E,T.formToJSON=e=>qe(c.isHTMLForm(e)?new FormData(e):e),T.getAdapter=Ge.getAdapter,T.HttpStatusCode=pe,T.default=T;const{Axios:Kn,AxiosError:En,CanceledError:vn,isCancel:Wn,CancelToken:Qn,VERSION:Xn,all:Zn,Cancel:Yn,isAxiosError:er,spread:tr,toFormData:nr,AxiosHeaders:Xe,HttpStatusCode:rr,formToJSON:sr,getAdapter:or,mergeConfig:ir}=T,Z=()=>new En("Unauthorized","ERR_UNAUTHORIZED",{headers:new Xe},null,{status:401,data:null,statusText:"UNAUTHORIZED",headers:{},config:{headers:new Xe}}),Rn=e=>{let t=!1;const n=[],r=()=>localStorage.getItem("accessToken"),s=()=>localStorage.getItem("refreshToken"),o=a=>{localStorage.setItem("accessToken",a.accessToken),localStorage.setItem("refreshToken",a.refreshToken)},i=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("refreshToken")},u=(a,d=null)=>{n.forEach(m=>{a?m.reject(a):(m.requestConfig.headers||(m.requestConfig.headers={}),m.requestConfig.headers.Authorization=`Bearer ${d}`,m.resolve(m.requestConfig))}),n.length=0};return{getAccessToken:r,setTokens:o,clearTokens:i,handleTokenRefresh:async a=>{var h;if((h=a.url)==null?void 0:h.includes(e.refreshTokenEndpointPath)){i();const p=Z();throw u(p),p}if(!r()){i();const p=Z();throw u(p),p}if(t)return new Promise((p,b)=>{n.push({resolve:p,reject:b,requestConfig:a})});const g=s();if(!g){i();const p=Z();throw u(p),p}t=!0;try{const p=await e.onRefreshToken(g);return o(p),a.headers||(a.headers={}),a.headers.Authorization=`Bearer ${p.accessToken}`,u(null,p.accessToken),t=!1,a}catch{i();const b=Z();throw u(b),t=!1,b}},isAuthError:a=>{var d;return((d=a==null?void 0:a.response)==null?void 0:d.status)===401}}},P=e=>{const t=T.create(),n=e.apiVersion,r=e.productCode,s=e.baseUrl,o=s?s.replace(/\/$/,""):"",i=e.refreshTokenApiVersion||n,u=e.refreshTokenEndpointPath||"/refresh-token",f=`${o}/auth/${i}${u}`,l=Rn({baseUrl:s||"",apiVersion:n,refreshTokenEndpointPath:u,onRefreshToken:async d=>(await t.post(f,{refreshToken:d})).data});return t.interceptors.response.use(d=>d,async d=>{const m=d.config;if(!l.isAuthError(d)||m._retry)return Promise.reject(d);m._retry=!0;try{const g=await l.handleTokenRefresh(m);return t.request(g)}catch(g){return Promise.reject(g)}}),e.responseInterceptor&&t.interceptors.response.use(e.responseInterceptor.onFulfilled,e.responseInterceptor.onReject),{request:async(d,m)=>{const g=d.startsWith("/")?d.substring(1):d,h=`${o}/${r}/${n}/${g}`,p={"Content-Type":(m==null?void 0:m.contentType)||"application/json",apiVersion:n,Authorization:"",...e.headers??{}},b=l.getAccessToken();b&&(p.Authorization=`Bearer ${b}`);const S={method:(m==null?void 0:m.method)||"GET",headers:p,url:h,data:m==null?void 0:m.data,responseType:m==null?void 0:m.responseType};return await t.request(S)},getAccessToken:l.getAccessToken,setTokens:l.setTokens,clearTokens:l.clearTokens}},On="cep";function An(e){const t=P(e);function n(r){return t.request(`/${On}`,{method:"POST",data:JSON.stringify(r)})}return{getAddress:n}}const Ze="auth",Pn=e=>{const t=P(e);return{postLogin:async s=>{var i;const o=await t.request(`/${Ze}/login`,{method:"POST",data:JSON.stringify(s)});return o.status===200&&((i=o.data)!=null&&i.accessToken)&&localStorage.setItem("accessToken",o.data.accessToken),o},getToken:async s=>await t.request(`/${Ze}?code=${s}`,{method:"GET",data:""})}},Nn=e=>{const t=P(e);return{signUp:async u=>await t.request("/sign-up",{method:"POST",data:JSON.stringify(u)}),signIn:async u=>{var l,a;const f=await t.request("/sign-in",{method:"POST",data:JSON.stringify(u)});return f.status===200&&((l=f.data)!=null&&l.accessToken)&&((a=f.data)!=null&&a.refreshToken)&&t.setTokens(f.data),f},getProfile:async()=>await t.request("/me",{method:"GET",data:""}),recoverPassword:async u=>await t.request("/recovery",{method:"POST",data:JSON.stringify(u)}),updatePassword:async u=>await t.request("/update-password",{method:"POST",data:JSON.stringify(u)})}},Ye="digital",Cn=e=>{const t=P(e);return{getBroker:()=>t.request(`/${Ye}/getBroker`,{method:"GET",data:""}),getAllBrokerages:s=>t.request(`/${Ye}/getAllBrokerages?name=${s}`,{method:"GET",data:""})}},kn="data",xn=e=>{const t=P(e);return{postData:async r=>await t.request(`/${kn}`,{method:"POST",data:JSON.stringify(r)})}},me="payment",Bn=e=>{const t=P(e);return{postPayment:o=>t.request(`/${me}`,{method:"POST",data:JSON.stringify(o)}),getPaymentStatus:o=>t.request(`/${me}/status?policyId=${o.policyId}`,{method:"GET",data:""}),getPaymentSummary:o=>t.request(`/${me}/summary?policyId=${o.policyId}`,{method:"GET",data:""})}},Y="product/action",Fn=e=>{const t=P(e);return{getCnpjStatus:i=>t.request(`/${Y}/Custom/CnpjCheck?cnpj=${i}`,{method:"GET",data:""}),getKeyNumber:()=>t.request(`/${Y}/Custom/GetKeyNumber`,{method:"GET",data:""}),getProposalNumberByKeyNumber:i=>t.request(`/${Y}/Custom/GetProposalNoByKeyNumber?keyNumber=${i.keyNumber}`,{method:"GET",data:""}),postCoveragesAndClausesRules:i=>t.request(`/${Y}/Custom/LoadRules`,{method:"POST",data:JSON.stringify(i)})}},k="quotation",Un=e=>{const t=P(e);return{getQuotations:a=>{const d=new URLSearchParams({...a});return t.request(`/${k}/query?${d.toString()}`,{method:"GET",data:""})},getQuotationDetail:a=>{const d=new URLSearchParams({id:a.policyId});return t.request(`/${k}?${d.toString()}`,{method:"GET",data:""})},postQuickQuote:a=>t.request(`/${k}/QuickQuote`,{method:"POST",data:JSON.stringify(a)}),postFullQuote:a=>t.request(`/${k}/FullQuote`,{method:"POST",data:JSON.stringify(a)}),postBind:a=>t.request(`/${k}/Bind`,{method:"POST",data:JSON.stringify(a)}),getQuotation:a=>t.request(`/${k}?id=${a.policyId}`,{method:"GET",data:""}),getVersions:a=>t.request(`/${k}/versions?policyId=${a.policyId}`,{method:"GET",data:""}),switchSelectedVersion:a=>t.request(`/${k}/switchSelectedVersion?policyId=${a.policyId}&quotationVersionId=${a.quotationVersionId}`,{method:"POST",data:JSON.stringify(a)})}},qn="report",Ln=e=>{const t=P(e);return{getReportStream:r=>{const s=new URLSearchParams({policyId:r.policyId,documentType:r.documentType||"certificate",...r.additionalParams});return t.request(`/${qn}/generate-stream?${s.toString()}`,{method:"GET",data:"",responseType:"blob"})}}},_n="SubscriberData",$n=e=>{const t=P(e);return{getSubscriber:r=>t.request(`/${_n}/get-subscriber-data?cnpj=${r}`,{method:"GET",data:""})}};function Dn(e){const t=Pn(e),n=Nn(e),r=xn(e),s=Un(e),o=Bn(e),i=An(e),u=Cn(e),f=Fn(e),l=Ln(e),a=$n(e);return{auth:t,authAkad:n,data:r,quotation:s,payment:o,address:i,broker:u,plugin:f,report:l,subscriber:a}}return Dn});
5
+ `):" "+Ve(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:le};function fe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new L(null,e)}function Ke(e){return fe(e),e.headers=E.from(e.headers),e.data=ae.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ge.getAdapter(e.adapter||j.adapter)(e).then(function(r){return fe(e),r.data=ae.call(e,e.transformResponse,r),r.headers=E.from(r.headers),r},function(r){return $e(r)||(fe(e),r&&r.response&&(r.response.data=ae.call(e,e.transformResponse,r.response),r.response.headers=E.from(r.response.headers))),Promise.reject(r)})}const ve="1.7.2",de={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{de[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const We={};de.transitional=function(t,n,r){function s(o,i){return"[Axios v"+ve+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,u)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!We[i]&&(We[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,u):!0}};function bn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const u=e[o],f=u===void 0||i(u,o,e);if(f!==!0)throw new y("option "+o+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const pe={assertOptions:bn,validators:de},C=pe.validators;let F=class{constructor(t){this.defaults=t,this.interceptors={request:new Fe,response:new Fe}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=B(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&pe.assertOptions(r,{silentJSONParsing:C.transitional(C.boolean),forcedJSONParsing:C.transitional(C.boolean),clarifyTimeoutError:C.transitional(C.boolean)},!1),s!=null&&(c.isFunction(s)?n.paramsSerializer={serialize:s}:pe.assertOptions(s,{encode:C.function,serialize:C.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&c.merge(o.common,o[n.method]);o&&c.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=E.concat(i,o);const u=[];let f=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(f=f&&h.synchronous,u.unshift(h.fulfilled,h.rejected))});const l=[];this.interceptors.response.forEach(function(h){l.push(h.fulfilled,h.rejected)});let a,d=0,m;if(!f){const p=[Ke.bind(this),void 0];for(p.unshift.apply(p,u),p.push.apply(p,l),m=p.length,a=Promise.resolve(n);d<m;)a=a.then(p[d++],p[d++]);return a}m=u.length;let g=n;for(d=0;d<m;){const p=u[d++],h=u[d++];try{g=p(g)}catch(b){h.call(this,b);break}}try{a=Ke.call(this,g)}catch(p){return Promise.reject(p)}for(d=0,m=l.length;d<m;)a=a.then(l[d++],l[d++]);return a}getUri(t){t=B(this.defaults,t);const n=_e(t.baseURL,t.url);return Be(n,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){F.prototype[t]=function(n,r){return this.request(B(r||{},{method:t,url:n,data:(r||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,u){return this.request(B(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}F.prototype[t]=n(),F.prototype[t+"Form"]=n(!0)});let wn=class tt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(u=>{r.subscribe(u),o=u}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,u){r.reason||(r.reason=new L(o,i,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new tt(function(s){t=s}),cancel:t}}};function Tn(e){return function(n){return e.apply(null,n)}}function Sn(e){return c.isObject(e)&&e.isAxiosError===!0}const he={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(he).forEach(([e,t])=>{he[t]=e});function Qe(e){const t=new F(e),n=U(F.prototype.request,t);return c.extend(n,F.prototype,t,{allOwnKeys:!0}),c.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Qe(B(e,s))},n}const T=Qe(j);T.Axios=F,T.CanceledError=L,T.CancelToken=wn,T.isCancel=$e,T.VERSION=ve,T.toFormData=K,T.AxiosError=y,T.Cancel=T.CanceledError,T.all=function(t){return Promise.all(t)},T.spread=Tn,T.isAxiosError=Sn,T.mergeConfig=B,T.AxiosHeaders=E,T.formToJSON=e=>qe(c.isHTMLForm(e)?new FormData(e):e),T.getAdapter=Ge.getAdapter,T.HttpStatusCode=he,T.default=T;const{Axios:Wn,AxiosError:En,CanceledError:Qn,isCancel:Xn,CancelToken:Zn,VERSION:Yn,all:er,Cancel:tr,isAxiosError:nr,spread:rr,toFormData:sr,AxiosHeaders:Xe,HttpStatusCode:or,formToJSON:ir,getAdapter:ar,mergeConfig:cr}=T,Z=()=>new En("Unauthorized","ERR_UNAUTHORIZED",{headers:new Xe},null,{status:401,data:null,statusText:"UNAUTHORIZED",headers:{},config:{headers:new Xe}}),Rn=e=>{let t=!1;const n=[],r=()=>localStorage.getItem("accessToken"),s=()=>localStorage.getItem("refreshToken"),o=a=>{localStorage.setItem("accessToken",a.accessToken),localStorage.setItem("refreshToken",a.refreshToken)},i=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("refreshToken")},u=(a,d=null)=>{n.forEach(m=>{a?m.reject(a):(m.requestConfig.headers||(m.requestConfig.headers={}),m.requestConfig.headers.Authorization=`Bearer ${d}`,m.resolve(m.requestConfig))}),n.length=0};return{getAccessToken:r,setTokens:o,clearTokens:i,handleTokenRefresh:async a=>{var p;if((p=a.url)==null?void 0:p.includes(e.refreshTokenEndpointPath)){i();const h=Z();throw u(h),h}if(!r()){i();const h=Z();throw u(h),h}if(t)return new Promise((h,b)=>{n.push({resolve:h,reject:b,requestConfig:a})});const g=s();if(!g){i();const h=Z();throw u(h),h}t=!0;try{const h=await e.onRefreshToken(g);return o(h),a.headers||(a.headers={}),a.headers.Authorization=`Bearer ${h.accessToken}`,u(null,h.accessToken),t=!1,a}catch{i();const b=Z();throw u(b),t=!1,b}},isAuthError:a=>{var d;return((d=a==null?void 0:a.response)==null?void 0:d.status)===401}}},P=e=>{const t=T.create(),n=e.apiVersion,r=e.productCode,s=e.baseUrl,o=s?s.replace(/\/$/,""):"",i=e.refreshTokenApiVersion||n,u=e.refreshTokenEndpointPath||"/refresh-token",f=`${o}/auth/${i}${u}`,l=Rn({baseUrl:s||"",apiVersion:n,refreshTokenEndpointPath:u,onRefreshToken:async d=>(await t.post(f,{refreshToken:d})).data});return t.interceptors.response.use(d=>d,async d=>{const m=d.config;if(!l.isAuthError(d)||m._retry)return Promise.reject(d);m._retry=!0;try{const g=await l.handleTokenRefresh(m);return t.request(g)}catch(g){return Promise.reject(g)}}),e.responseInterceptor&&t.interceptors.response.use(e.responseInterceptor.onFulfilled,e.responseInterceptor.onReject),{request:async(d,m)=>{const g=d.startsWith("/")?d.substring(1):d,p=`${o}/${r}/${n}/${g}`,h={"Content-Type":(m==null?void 0:m.contentType)||"application/json",apiVersion:n,Authorization:"",...e.headers??{}},b=l.getAccessToken();b&&(h.Authorization=`Bearer ${b}`);const S={method:(m==null?void 0:m.method)||"GET",headers:h,url:p,data:m==null?void 0:m.data,responseType:m==null?void 0:m.responseType};return await t.request(S)},getAccessToken:l.getAccessToken,setTokens:l.setTokens,clearTokens:l.clearTokens}},On="cep";function An(e){const t=P(e);function n(r){return t.request(`/${On}`,{method:"POST",data:JSON.stringify(r)})}return{getAddress:n}}const Ze="auth",Pn=e=>{const t=P(e);return{postLogin:async s=>{var i;const o=await t.request(`/${Ze}/login`,{method:"POST",data:JSON.stringify(s)});return o.status===200&&((i=o.data)!=null&&i.accessToken)&&localStorage.setItem("accessToken",o.data.accessToken),o},getToken:async s=>await t.request(`/${Ze}?code=${s}`,{method:"GET",data:""})}},Nn=e=>{const t=P(e);return{signUp:async u=>await t.request("/sign-up",{method:"POST",data:JSON.stringify(u)}),signIn:async u=>{var l,a;const f=await t.request("/sign-in",{method:"POST",data:JSON.stringify(u)});return f.status===200&&((l=f.data)!=null&&l.accessToken)&&((a=f.data)!=null&&a.refreshToken)&&t.setTokens(f.data),f},getProfile:async()=>await t.request("/me",{method:"GET",data:""}),recoverPassword:async u=>await t.request("/recovery",{method:"POST",data:JSON.stringify(u)}),updatePassword:async u=>await t.request("/update-password",{method:"POST",data:JSON.stringify(u)})}},Ye="digital",Cn=e=>{const t=P(e);return{getBroker:()=>t.request(`/${Ye}/getBroker`,{method:"GET",data:""}),getAllBrokerages:s=>t.request(`/${Ye}/getAllBrokerages?name=${s}`,{method:"GET",data:""})}},kn="data",xn=e=>{const t=P(e);return{postData:async r=>await t.request(`/${kn}`,{method:"POST",data:JSON.stringify(r)})}},Bn="endorsement",Fn=e=>{const t=P(e);return{putEndorsement:(r,s)=>{const o=new FormData;return o.append("data",JSON.stringify(r)),s&&(Array.isArray(s)?s.forEach(i=>{o.append("attachments",i)}):o.append("attachments",s)),t.request(`/${Bn}`,{method:"PUT",data:o,contentType:"multipart/form-data"})}}},me="payment",Un=e=>{const t=P(e);return{postPayment:o=>t.request(`/${me}`,{method:"POST",data:JSON.stringify(o)}),getPaymentStatus:o=>t.request(`/${me}/status?policyId=${o.policyId}`,{method:"GET",data:""}),getPaymentSummary:o=>t.request(`/${me}/summary?policyId=${o.policyId}`,{method:"GET",data:""})}},Y="product/action",qn=e=>{const t=P(e);return{getCnpjStatus:i=>t.request(`/${Y}/Custom/CnpjCheck?cnpj=${i}`,{method:"GET",data:""}),getKeyNumber:()=>t.request(`/${Y}/Custom/GetKeyNumber`,{method:"GET",data:""}),getProposalNumberByKeyNumber:i=>t.request(`/${Y}/Custom/GetProposalNoByKeyNumber?keyNumber=${i.keyNumber}`,{method:"GET",data:""}),postCoveragesAndClausesRules:i=>t.request(`/${Y}/Custom/LoadRules`,{method:"POST",data:JSON.stringify(i)})}},k="quotation",Ln=e=>{const t=P(e);return{getQuotations:a=>{const d=new URLSearchParams({...a});return t.request(`/${k}/query?${d.toString()}`,{method:"GET",data:""})},getQuotationDetail:a=>{const d=new URLSearchParams({id:a.policyId});return t.request(`/${k}?${d.toString()}`,{method:"GET",data:""})},postQuickQuote:a=>t.request(`/${k}/QuickQuote`,{method:"POST",data:JSON.stringify(a)}),postFullQuote:a=>t.request(`/${k}/FullQuote`,{method:"POST",data:JSON.stringify(a)}),postBind:a=>t.request(`/${k}/Bind`,{method:"POST",data:JSON.stringify(a)}),getQuotation:a=>t.request(`/${k}?id=${a.policyId}`,{method:"GET",data:""}),getVersions:a=>t.request(`/${k}/versions?policyId=${a.policyId}`,{method:"GET",data:""}),switchSelectedVersion:a=>t.request(`/${k}/switchSelectedVersion?policyId=${a.policyId}&quotationVersionId=${a.quotationVersionId}`,{method:"POST",data:JSON.stringify(a)})}},$n="report",Dn=e=>{const t=P(e);return{getReportStream:r=>{const s=new URLSearchParams({policyId:r.policyId,documentType:r.documentType||"certificate",...r.additionalParams});return t.request(`/${$n}/generate-stream?${s.toString()}`,{method:"GET",data:"",responseType:"blob"})}}},_n="SubscriberData",In=e=>{const t=P(e);return{getSubscriber:r=>t.request(`/${_n}/get-subscriber-data?cnpj=${r}`,{method:"GET",data:""})}};function jn(e){const t=Pn(e),n=Nn(e),r=xn(e),s=Ln(e),o=Un(e),i=An(e),u=Cn(e),f=Fn(e),l=qn(e),a=Dn(e),d=In(e);return{auth:t,authAkad:n,data:r,quotation:s,payment:o,address:i,broker:u,endorsement:f,plugin:l,report:a,subscriber:d}}return jn});