yxuse 3.0.39 → 3.0.41

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.
Files changed (53) hide show
  1. package/lib/api.cjs.js +1 -1
  2. package/lib/api.es.js +9 -10
  3. package/lib/components.cjs.js +1 -1
  4. package/lib/components.es.js +11 -18
  5. package/lib/directives.cjs.js +1 -1
  6. package/lib/directives.es.js +2 -4
  7. package/lib/hooks.cjs.js +1 -1
  8. package/lib/hooks.es.js +2 -3
  9. package/lib/index.cjs.js +1 -1
  10. package/lib/index.cjs10.js +1 -1
  11. package/lib/index.cjs11.js +1 -3
  12. package/lib/index.cjs11.js.gz +0 -0
  13. package/lib/index.cjs12.js +1 -1
  14. package/lib/index.cjs13.js +1 -1
  15. package/lib/index.cjs2.js +1 -1
  16. package/lib/index.cjs3.js +1 -1
  17. package/lib/index.cjs4.js +1 -1
  18. package/lib/index.cjs5.js +8 -28
  19. package/lib/index.cjs5.js.gz +0 -0
  20. package/lib/index.cjs6.js +1 -1
  21. package/lib/index.cjs6.js.gz +0 -0
  22. package/lib/index.cjs7.js +1 -1
  23. package/lib/index.cjs9.js +1 -1
  24. package/lib/index.es.js +43 -44
  25. package/lib/index.es10.js +236 -246
  26. package/lib/index.es10.js.gz +0 -0
  27. package/lib/index.es11.js +1832 -1148
  28. package/lib/index.es11.js.gz +0 -0
  29. package/lib/index.es12.js +176 -103
  30. package/lib/index.es13.js +15 -12
  31. package/lib/index.es2.js +13 -13
  32. package/lib/index.es3.js +58 -40
  33. package/lib/index.es4.js +47 -37
  34. package/lib/index.es5.js +9647 -5958
  35. package/lib/index.es5.js.gz +0 -0
  36. package/lib/index.es6.js +805 -620
  37. package/lib/index.es6.js.gz +0 -0
  38. package/lib/index.es7.js +21 -17
  39. package/lib/index.es8.js +4 -4
  40. package/lib/index.es9.js +9 -7
  41. package/lib/style.css +1 -1
  42. package/lib/style.css.gz +0 -0
  43. package/lib/theme.cjs.js +1 -1
  44. package/lib/theme.es.js +11 -13
  45. package/lib/translate.cjs.js +1 -1
  46. package/lib/translate.es.js +6 -9
  47. package/lib/utils.cjs.js +1 -1
  48. package/lib/utils.es.js +11 -12
  49. package/lib/yxIcon.cjs.js +1 -1
  50. package/lib/yxIcon.es.js +2 -2
  51. package/package.json +3 -2
  52. package/lib/style.cjs.js +0 -1
  53. package/lib/style.es.js +0 -1
package/lib/index.es11.js CHANGED
@@ -1,258 +1,407 @@
1
- var rt = Object.defineProperty;
2
- var we = Object.getOwnPropertySymbols;
3
- var st = Object.prototype.hasOwnProperty, ot = Object.prototype.propertyIsEnumerable;
4
- var Q = (e, t, n) => t in e ? rt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, U = (e, t) => {
5
- for (var n in t || (t = {}))
6
- st.call(t, n) && Q(e, n, t[n]);
7
- if (we)
8
- for (var n of we(t))
9
- ot.call(t, n) && Q(e, n, t[n]);
10
- return e;
11
- };
12
- var Y = (e, t, n) => (Q(e, typeof t != "symbol" ? t + "" : t, n), n);
13
- var M = (e, t, n) => new Promise((r, s) => {
14
- var i = (l) => {
15
- try {
16
- c(n.next(l));
17
- } catch (u) {
18
- s(u);
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
19
14
  }
20
- }, o = (l) => {
21
- try {
22
- c(n.throw(l));
23
- } catch (u) {
24
- s(u);
25
- }
26
- }, c = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(i, o);
27
- c((n = n.apply(e, t)).next());
28
- });
29
- import { ElMessage as S, ElLoading as it, ElNotification as Se } from "element-plus";
30
- function Ue(e, t) {
31
- return function() {
32
- return e.apply(t, arguments);
15
+ return a;
16
+ };
17
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
18
+ var __async = (__this, __arguments, generator) => {
19
+ return new Promise((resolve, reject) => {
20
+ var fulfilled = (value) => {
21
+ try {
22
+ step(generator.next(value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ };
27
+ var rejected = (value) => {
28
+ try {
29
+ step(generator.throw(value));
30
+ } catch (e) {
31
+ reject(e);
32
+ }
33
+ };
34
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
35
+ step((generator = generator.apply(__this, __arguments)).next());
36
+ });
37
+ };
38
+ import { ElMessage, ElLoading, ElNotification } from "element-plus";
39
+ function bind(fn, thisArg) {
40
+ return function wrap() {
41
+ return fn.apply(thisArg, arguments);
33
42
  };
34
43
  }
35
- const { toString: _e } = Object.prototype, { getPrototypeOf: ce } = Object, ue = /* @__PURE__ */ ((e) => (t) => {
36
- const n = _e.call(t);
37
- return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
38
- })(/* @__PURE__ */ Object.create(null)), A = (e) => (e = e.toLowerCase(), (t) => ue(t) === e), G = (e) => (t) => typeof t === e, { isArray: L } = Array, F = G("undefined");
39
- function at(e) {
40
- return e !== null && !F(e) && e.constructor !== null && !F(e.constructor) && N(e.constructor.isBuffer) && e.constructor.isBuffer(e);
44
+ const { toString } = Object.prototype;
45
+ const { getPrototypeOf } = Object;
46
+ const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
47
+ const str = toString.call(thing);
48
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
49
+ })(/* @__PURE__ */ Object.create(null));
50
+ const kindOfTest = (type) => {
51
+ type = type.toLowerCase();
52
+ return (thing) => kindOf(thing) === type;
53
+ };
54
+ const typeOfTest = (type) => (thing) => typeof thing === type;
55
+ const { isArray } = Array;
56
+ const isUndefined = typeOfTest("undefined");
57
+ function isBuffer(val) {
58
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
41
59
  }
42
- const Be = A("ArrayBuffer");
43
- function ct(e) {
44
- let t;
45
- return typeof ArrayBuffer != "undefined" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Be(e.buffer), t;
60
+ const isArrayBuffer = kindOfTest("ArrayBuffer");
61
+ function isArrayBufferView(val) {
62
+ let result;
63
+ if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
64
+ result = ArrayBuffer.isView(val);
65
+ } else {
66
+ result = val && val.buffer && isArrayBuffer(val.buffer);
67
+ }
68
+ return result;
46
69
  }
47
- const ut = G("string"), N = G("function"), Fe = G("number"), le = (e) => e !== null && typeof e == "object", lt = (e) => e === !0 || e === !1, H = (e) => {
48
- if (ue(e) !== "object")
49
- return !1;
50
- const t = ce(e);
51
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
52
- }, ft = A("Date"), dt = A("File"), pt = A("Blob"), ht = A("FileList"), mt = (e) => le(e) && N(e.pipe), yt = (e) => {
53
- const t = "[object FormData]";
54
- return e && (typeof FormData == "function" && e instanceof FormData || _e.call(e) === t || N(e.toString) && e.toString() === t);
55
- }, Et = A("URLSearchParams"), wt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
56
- function D(e, t, { allOwnKeys: n = !1 } = {}) {
57
- if (e === null || typeof e == "undefined")
70
+ const isString = typeOfTest("string");
71
+ const isFunction = typeOfTest("function");
72
+ const isNumber = typeOfTest("number");
73
+ const isObject = (thing) => thing !== null && typeof thing === "object";
74
+ const isBoolean = (thing) => thing === true || thing === false;
75
+ const isPlainObject = (val) => {
76
+ if (kindOf(val) !== "object") {
77
+ return false;
78
+ }
79
+ const prototype2 = getPrototypeOf(val);
80
+ return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
81
+ };
82
+ const isDate = kindOfTest("Date");
83
+ const isFile = kindOfTest("File");
84
+ const isBlob = kindOfTest("Blob");
85
+ const isFileList = kindOfTest("FileList");
86
+ const isStream = (val) => isObject(val) && isFunction(val.pipe);
87
+ const isFormData = (thing) => {
88
+ const pattern = "[object FormData]";
89
+ return thing && (typeof FormData === "function" && thing instanceof FormData || toString.call(thing) === pattern || isFunction(thing.toString) && thing.toString() === pattern);
90
+ };
91
+ const isURLSearchParams = kindOfTest("URLSearchParams");
92
+ const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
93
+ function forEach(obj, fn, { allOwnKeys = false } = {}) {
94
+ if (obj === null || typeof obj === "undefined") {
58
95
  return;
59
- let r, s;
60
- if (typeof e != "object" && (e = [e]), L(e))
61
- for (r = 0, s = e.length; r < s; r++)
62
- t.call(null, e[r], r, e);
63
- else {
64
- const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), o = i.length;
65
- let c;
66
- for (r = 0; r < o; r++)
67
- c = i[r], t.call(null, e[c], c, e);
96
+ }
97
+ let i;
98
+ let l;
99
+ if (typeof obj !== "object") {
100
+ obj = [obj];
101
+ }
102
+ if (isArray(obj)) {
103
+ for (i = 0, l = obj.length; i < l; i++) {
104
+ fn.call(null, obj[i], i, obj);
105
+ }
106
+ } else {
107
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
108
+ const len = keys.length;
109
+ let key;
110
+ for (i = 0; i < len; i++) {
111
+ key = keys[i];
112
+ fn.call(null, obj[key], key, obj);
113
+ }
68
114
  }
69
115
  }
70
- function De(e, t) {
71
- t = t.toLowerCase();
72
- const n = Object.keys(e);
73
- let r = n.length, s;
74
- for (; r-- > 0; )
75
- if (s = n[r], t === s.toLowerCase())
76
- return s;
116
+ function findKey(obj, key) {
117
+ key = key.toLowerCase();
118
+ const keys = Object.keys(obj);
119
+ let i = keys.length;
120
+ let _key;
121
+ while (i-- > 0) {
122
+ _key = keys[i];
123
+ if (key === _key.toLowerCase()) {
124
+ return _key;
125
+ }
126
+ }
77
127
  return null;
78
128
  }
79
- const ke = typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : global, Ie = (e) => !F(e) && e !== ke;
80
- function re() {
81
- const { caseless: e } = Ie(this) && this || {}, t = {}, n = (r, s) => {
82
- const i = e && De(t, s) || s;
83
- H(t[i]) && H(r) ? t[i] = re(t[i], r) : H(r) ? t[i] = re({}, r) : L(r) ? t[i] = r.slice() : t[i] = r;
129
+ const _global = (() => {
130
+ if (typeof globalThis !== "undefined") return globalThis;
131
+ return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
132
+ })();
133
+ const isContextDefined = (context) => !isUndefined(context) && context !== _global;
134
+ function merge() {
135
+ const { caseless } = isContextDefined(this) && this || {};
136
+ const result = {};
137
+ const assignValue = (val, key) => {
138
+ const targetKey = caseless && findKey(result, key) || key;
139
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
140
+ result[targetKey] = merge(result[targetKey], val);
141
+ } else if (isPlainObject(val)) {
142
+ result[targetKey] = merge({}, val);
143
+ } else if (isArray(val)) {
144
+ result[targetKey] = val.slice();
145
+ } else {
146
+ result[targetKey] = val;
147
+ }
84
148
  };
85
- for (let r = 0, s = arguments.length; r < s; r++)
86
- arguments[r] && D(arguments[r], n);
87
- return t;
149
+ for (let i = 0, l = arguments.length; i < l; i++) {
150
+ arguments[i] && forEach(arguments[i], assignValue);
151
+ }
152
+ return result;
88
153
  }
89
- const St = (e, t, n, { allOwnKeys: r } = {}) => (D(t, (s, i) => {
90
- n && N(s) ? e[i] = Ue(s, n) : e[i] = s;
91
- }, { allOwnKeys: r }), e), bt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Rt = (e, t, n, r) => {
92
- e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
93
- value: t.prototype
94
- }), n && Object.assign(e.prototype, n);
95
- }, Ot = (e, t, n, r) => {
96
- let s, i, o;
97
- const c = {};
98
- if (t = t || {}, e == null)
99
- return t;
154
+ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
155
+ forEach(b, (val, key) => {
156
+ if (thisArg && isFunction(val)) {
157
+ a[key] = bind(val, thisArg);
158
+ } else {
159
+ a[key] = val;
160
+ }
161
+ }, { allOwnKeys });
162
+ return a;
163
+ };
164
+ const stripBOM = (content) => {
165
+ if (content.charCodeAt(0) === 65279) {
166
+ content = content.slice(1);
167
+ }
168
+ return content;
169
+ };
170
+ const inherits = (constructor, superConstructor, props, descriptors2) => {
171
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
172
+ constructor.prototype.constructor = constructor;
173
+ Object.defineProperty(constructor, "super", {
174
+ value: superConstructor.prototype
175
+ });
176
+ props && Object.assign(constructor.prototype, props);
177
+ };
178
+ const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
179
+ let props;
180
+ let i;
181
+ let prop;
182
+ const merged = {};
183
+ destObj = destObj || {};
184
+ if (sourceObj == null) return destObj;
100
185
  do {
101
- for (s = Object.getOwnPropertyNames(e), i = s.length; i-- > 0; )
102
- o = s[i], (!r || r(o, e, t)) && !c[o] && (t[o] = e[o], c[o] = !0);
103
- e = n !== !1 && ce(e);
104
- } while (e && (!n || n(e, t)) && e !== Object.prototype);
105
- return t;
106
- }, gt = (e, t, n) => {
107
- e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
108
- const r = e.indexOf(t, n);
109
- return r !== -1 && r === n;
110
- }, At = (e) => {
111
- if (!e)
112
- return null;
113
- if (L(e))
114
- return e;
115
- let t = e.length;
116
- if (!Fe(t))
117
- return null;
118
- const n = new Array(t);
119
- for (; t-- > 0; )
120
- n[t] = e[t];
121
- return n;
122
- }, Tt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array != "undefined" && ce(Uint8Array)), Nt = (e, t) => {
123
- const r = (e && e[Symbol.iterator]).call(e);
124
- let s;
125
- for (; (s = r.next()) && !s.done; ) {
126
- const i = s.value;
127
- t.call(e, i[0], i[1]);
128
- }
129
- }, Pt = (e, t) => {
130
- let n;
131
- const r = [];
132
- for (; (n = e.exec(t)) !== null; )
133
- r.push(n);
134
- return r;
135
- }, xt = A("HTMLFormElement"), Ct = (e) => e.toLowerCase().replace(
136
- /[-_\s]([a-z\d])(\w*)/g,
137
- function(n, r, s) {
138
- return r.toUpperCase() + s;
139
- }
140
- ), be = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Lt = A("RegExp"), je = (e, t) => {
141
- const n = Object.getOwnPropertyDescriptors(e), r = {};
142
- D(n, (s, i) => {
143
- t(s, i, e) !== !1 && (r[i] = s);
144
- }), Object.defineProperties(e, r);
145
- }, Ut = (e) => {
146
- je(e, (t, n) => {
147
- if (N(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
148
- return !1;
149
- const r = e[n];
150
- if (N(r)) {
151
- if (t.enumerable = !1, "writable" in t) {
152
- t.writable = !1;
153
- return;
186
+ props = Object.getOwnPropertyNames(sourceObj);
187
+ i = props.length;
188
+ while (i-- > 0) {
189
+ prop = props[i];
190
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
191
+ destObj[prop] = sourceObj[prop];
192
+ merged[prop] = true;
154
193
  }
155
- t.set || (t.set = () => {
156
- throw Error("Can not rewrite read-only method '" + n + "'");
157
- });
194
+ }
195
+ sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
196
+ } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
197
+ return destObj;
198
+ };
199
+ const endsWith = (str, searchString, position) => {
200
+ str = String(str);
201
+ if (position === void 0 || position > str.length) {
202
+ position = str.length;
203
+ }
204
+ position -= searchString.length;
205
+ const lastIndex = str.indexOf(searchString, position);
206
+ return lastIndex !== -1 && lastIndex === position;
207
+ };
208
+ const toArray = (thing) => {
209
+ if (!thing) return null;
210
+ if (isArray(thing)) return thing;
211
+ let i = thing.length;
212
+ if (!isNumber(i)) return null;
213
+ const arr = new Array(i);
214
+ while (i-- > 0) {
215
+ arr[i] = thing[i];
216
+ }
217
+ return arr;
218
+ };
219
+ const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
220
+ return (thing) => {
221
+ return TypedArray && thing instanceof TypedArray;
222
+ };
223
+ })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
224
+ const forEachEntry = (obj, fn) => {
225
+ const generator = obj && obj[Symbol.iterator];
226
+ const iterator = generator.call(obj);
227
+ let result;
228
+ while ((result = iterator.next()) && !result.done) {
229
+ const pair = result.value;
230
+ fn.call(obj, pair[0], pair[1]);
231
+ }
232
+ };
233
+ const matchAll = (regExp, str) => {
234
+ let matches;
235
+ const arr = [];
236
+ while ((matches = regExp.exec(str)) !== null) {
237
+ arr.push(matches);
238
+ }
239
+ return arr;
240
+ };
241
+ const isHTMLForm = kindOfTest("HTMLFormElement");
242
+ const toCamelCase = (str) => {
243
+ return str.toLowerCase().replace(
244
+ /[-_\s]([a-z\d])(\w*)/g,
245
+ function replacer(m, p1, p2) {
246
+ return p1.toUpperCase() + p2;
247
+ }
248
+ );
249
+ };
250
+ const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
251
+ const isRegExp = kindOfTest("RegExp");
252
+ const reduceDescriptors = (obj, reducer) => {
253
+ const descriptors2 = Object.getOwnPropertyDescriptors(obj);
254
+ const reducedDescriptors = {};
255
+ forEach(descriptors2, (descriptor, name) => {
256
+ if (reducer(descriptor, name, obj) !== false) {
257
+ reducedDescriptors[name] = descriptor;
158
258
  }
159
259
  });
160
- }, _t = (e, t) => {
161
- const n = {}, r = (s) => {
162
- s.forEach((i) => {
163
- n[i] = !0;
260
+ Object.defineProperties(obj, reducedDescriptors);
261
+ };
262
+ const freezeMethods = (obj) => {
263
+ reduceDescriptors(obj, (descriptor, name) => {
264
+ if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
265
+ return false;
266
+ }
267
+ const value = obj[name];
268
+ if (!isFunction(value)) return;
269
+ descriptor.enumerable = false;
270
+ if ("writable" in descriptor) {
271
+ descriptor.writable = false;
272
+ return;
273
+ }
274
+ if (!descriptor.set) {
275
+ descriptor.set = () => {
276
+ throw Error("Can not rewrite read-only method '" + name + "'");
277
+ };
278
+ }
279
+ });
280
+ };
281
+ const toObjectSet = (arrayOrString, delimiter) => {
282
+ const obj = {};
283
+ const define = (arr) => {
284
+ arr.forEach((value) => {
285
+ obj[value] = true;
164
286
  });
165
287
  };
166
- return L(e) ? r(e) : r(String(e).split(t)), n;
167
- }, Bt = () => {
168
- }, Ft = (e, t) => (e = +e, Number.isFinite(e) ? e : t), Z = "abcdefghijklmnopqrstuvwxyz", Re = "0123456789", Me = {
169
- DIGIT: Re,
170
- ALPHA: Z,
171
- ALPHA_DIGIT: Z + Z.toUpperCase() + Re
172
- }, Dt = (e = 16, t = Me.ALPHA_DIGIT) => {
173
- let n = "";
174
- const { length: r } = t;
175
- for (; e--; )
176
- n += t[Math.random() * r | 0];
177
- return n;
288
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
289
+ return obj;
178
290
  };
179
- function kt(e) {
180
- return !!(e && N(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
291
+ const noop = () => {
292
+ };
293
+ const toFiniteNumber = (value, defaultValue) => {
294
+ value = +value;
295
+ return Number.isFinite(value) ? value : defaultValue;
296
+ };
297
+ const ALPHA = "abcdefghijklmnopqrstuvwxyz";
298
+ const DIGIT = "0123456789";
299
+ const ALPHABET = {
300
+ DIGIT,
301
+ ALPHA,
302
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
303
+ };
304
+ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
305
+ let str = "";
306
+ const { length } = alphabet;
307
+ while (size--) {
308
+ str += alphabet[Math.random() * length | 0];
309
+ }
310
+ return str;
311
+ };
312
+ function isSpecCompliantForm(thing) {
313
+ return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
181
314
  }
182
- const It = (e) => {
183
- const t = new Array(10), n = (r, s) => {
184
- if (le(r)) {
185
- if (t.indexOf(r) >= 0)
315
+ const toJSONObject = (obj) => {
316
+ const stack = new Array(10);
317
+ const visit = (source, i) => {
318
+ if (isObject(source)) {
319
+ if (stack.indexOf(source) >= 0) {
186
320
  return;
187
- if (!("toJSON" in r)) {
188
- t[s] = r;
189
- const i = L(r) ? [] : {};
190
- return D(r, (o, c) => {
191
- const l = n(o, s + 1);
192
- !F(l) && (i[c] = l);
193
- }), t[s] = void 0, i;
321
+ }
322
+ if (!("toJSON" in source)) {
323
+ stack[i] = source;
324
+ const target = isArray(source) ? [] : {};
325
+ forEach(source, (value, key) => {
326
+ const reducedValue = visit(value, i + 1);
327
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
328
+ });
329
+ stack[i] = void 0;
330
+ return target;
194
331
  }
195
332
  }
196
- return r;
333
+ return source;
197
334
  };
198
- return n(e, 0);
199
- }, a = {
200
- isArray: L,
201
- isArrayBuffer: Be,
202
- isBuffer: at,
203
- isFormData: yt,
204
- isArrayBufferView: ct,
205
- isString: ut,
206
- isNumber: Fe,
207
- isBoolean: lt,
208
- isObject: le,
209
- isPlainObject: H,
210
- isUndefined: F,
211
- isDate: ft,
212
- isFile: dt,
213
- isBlob: pt,
214
- isRegExp: Lt,
215
- isFunction: N,
216
- isStream: mt,
217
- isURLSearchParams: Et,
218
- isTypedArray: Tt,
219
- isFileList: ht,
220
- forEach: D,
221
- merge: re,
222
- extend: St,
223
- trim: wt,
224
- stripBOM: bt,
225
- inherits: Rt,
226
- toFlatObject: Ot,
227
- kindOf: ue,
228
- kindOfTest: A,
229
- endsWith: gt,
230
- toArray: At,
231
- forEachEntry: Nt,
232
- matchAll: Pt,
233
- isHTMLForm: xt,
234
- hasOwnProperty: be,
235
- hasOwnProp: be,
335
+ return visit(obj, 0);
336
+ };
337
+ const utils = {
338
+ isArray,
339
+ isArrayBuffer,
340
+ isBuffer,
341
+ isFormData,
342
+ isArrayBufferView,
343
+ isString,
344
+ isNumber,
345
+ isBoolean,
346
+ isObject,
347
+ isPlainObject,
348
+ isUndefined,
349
+ isDate,
350
+ isFile,
351
+ isBlob,
352
+ isRegExp,
353
+ isFunction,
354
+ isStream,
355
+ isURLSearchParams,
356
+ isTypedArray,
357
+ isFileList,
358
+ forEach,
359
+ merge,
360
+ extend,
361
+ trim,
362
+ stripBOM,
363
+ inherits,
364
+ toFlatObject,
365
+ kindOf,
366
+ kindOfTest,
367
+ endsWith,
368
+ toArray,
369
+ forEachEntry,
370
+ matchAll,
371
+ isHTMLForm,
372
+ hasOwnProperty,
373
+ hasOwnProp: hasOwnProperty,
236
374
  // an alias to avoid ESLint no-prototype-builtins detection
237
- reduceDescriptors: je,
238
- freezeMethods: Ut,
239
- toObjectSet: _t,
240
- toCamelCase: Ct,
241
- noop: Bt,
242
- toFiniteNumber: Ft,
243
- findKey: De,
244
- global: ke,
245
- isContextDefined: Ie,
246
- ALPHABET: Me,
247
- generateString: Dt,
248
- isSpecCompliantForm: kt,
249
- toJSONObject: It
375
+ reduceDescriptors,
376
+ freezeMethods,
377
+ toObjectSet,
378
+ toCamelCase,
379
+ noop,
380
+ toFiniteNumber,
381
+ findKey,
382
+ global: _global,
383
+ isContextDefined,
384
+ ALPHABET,
385
+ generateString,
386
+ isSpecCompliantForm,
387
+ toJSONObject
250
388
  };
251
- function m(e, t, n, r, s) {
252
- 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);
389
+ function AxiosError(message, code, config2, request, response) {
390
+ Error.call(this);
391
+ if (Error.captureStackTrace) {
392
+ Error.captureStackTrace(this, this.constructor);
393
+ } else {
394
+ this.stack = new Error().stack;
395
+ }
396
+ this.message = message;
397
+ this.name = "AxiosError";
398
+ code && (this.code = code);
399
+ config2 && (this.config = config2);
400
+ request && (this.request = request);
401
+ response && (this.response = response);
253
402
  }
254
- a.inherits(m, Error, {
255
- toJSON: function() {
403
+ utils.inherits(AxiosError, Error, {
404
+ toJSON: function toJSON() {
256
405
  return {
257
406
  // Standard
258
407
  message: this.message,
@@ -266,13 +415,14 @@ a.inherits(m, Error, {
266
415
  columnNumber: this.columnNumber,
267
416
  stack: this.stack,
268
417
  // Axios
269
- config: a.toJSONObject(this.config),
418
+ config: utils.toJSONObject(this.config),
270
419
  code: this.code,
271
420
  status: this.response && this.response.status ? this.response.status : null
272
421
  };
273
422
  }
274
423
  });
275
- const He = m.prototype, qe = {};
424
+ const prototype$1 = AxiosError.prototype;
425
+ const descriptors = {};
276
426
  [
277
427
  "ERR_BAD_OPTION_VALUE",
278
428
  "ERR_BAD_OPTION",
@@ -287,99 +437,136 @@ const He = m.prototype, qe = {};
287
437
  "ERR_NOT_SUPPORT",
288
438
  "ERR_INVALID_URL"
289
439
  // eslint-disable-next-line func-names
290
- ].forEach((e) => {
291
- qe[e] = { value: e };
440
+ ].forEach((code) => {
441
+ descriptors[code] = { value: code };
292
442
  });
293
- Object.defineProperties(m, qe);
294
- Object.defineProperty(He, "isAxiosError", { value: !0 });
295
- m.from = (e, t, n, r, s, i) => {
296
- const o = Object.create(He);
297
- return a.toFlatObject(e, o, function(l) {
298
- return l !== Error.prototype;
299
- }, (c) => c !== "isAxiosError"), m.call(o, e.message, t, n, r, s), o.cause = e, o.name = e.name, i && Object.assign(o, i), o;
443
+ Object.defineProperties(AxiosError, descriptors);
444
+ Object.defineProperty(prototype$1, "isAxiosError", { value: true });
445
+ AxiosError.from = (error, code, config2, request, response, customProps) => {
446
+ const axiosError = Object.create(prototype$1);
447
+ utils.toFlatObject(error, axiosError, function filter2(obj) {
448
+ return obj !== Error.prototype;
449
+ }, (prop) => {
450
+ return prop !== "isAxiosError";
451
+ });
452
+ AxiosError.call(axiosError, error.message, code, config2, request, response);
453
+ axiosError.cause = error;
454
+ axiosError.name = error.name;
455
+ customProps && Object.assign(axiosError, customProps);
456
+ return axiosError;
300
457
  };
301
- const jt = null;
302
- function se(e) {
303
- return a.isPlainObject(e) || a.isArray(e);
458
+ const httpAdapter = null;
459
+ function isVisitable(thing) {
460
+ return utils.isPlainObject(thing) || utils.isArray(thing);
304
461
  }
305
- function Je(e) {
306
- return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
462
+ function removeBrackets(key) {
463
+ return utils.endsWith(key, "[]") ? key.slice(0, -2) : key;
307
464
  }
308
- function Oe(e, t, n) {
309
- return e ? e.concat(t).map(function(s, i) {
310
- return s = Je(s), !n && i ? "[" + s + "]" : s;
311
- }).join(n ? "." : "") : t;
465
+ function renderKey(path, key, dots) {
466
+ if (!path) return key;
467
+ return path.concat(key).map(function each(token, i) {
468
+ token = removeBrackets(token);
469
+ return !dots && i ? "[" + token + "]" : token;
470
+ }).join(dots ? "." : "");
312
471
  }
313
- function Mt(e) {
314
- return a.isArray(e) && !e.some(se);
472
+ function isFlatArray(arr) {
473
+ return utils.isArray(arr) && !arr.some(isVisitable);
315
474
  }
316
- const Ht = a.toFlatObject(a, {}, null, function(t) {
317
- return /^is[A-Z]/.test(t);
475
+ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
476
+ return /^is[A-Z]/.test(prop);
318
477
  });
319
- function $(e, t, n) {
320
- if (!a.isObject(e))
478
+ function toFormData(obj, formData, options) {
479
+ if (!utils.isObject(obj)) {
321
480
  throw new TypeError("target must be an object");
322
- t = t || new FormData(), n = a.toFlatObject(n, {
323
- metaTokens: !0,
324
- dots: !1,
325
- indexes: !1
326
- }, !1, function(h, O) {
327
- return !a.isUndefined(O[h]);
481
+ }
482
+ formData = formData || new FormData();
483
+ options = utils.toFlatObject(options, {
484
+ metaTokens: true,
485
+ dots: false,
486
+ indexes: false
487
+ }, false, function defined(option, source) {
488
+ return !utils.isUndefined(source[option]);
328
489
  });
329
- const r = n.metaTokens, s = n.visitor || f, i = n.dots, o = n.indexes, l = (n.Blob || typeof Blob != "undefined" && Blob) && a.isSpecCompliantForm(t);
330
- if (!a.isFunction(s))
490
+ const metaTokens = options.metaTokens;
491
+ const visitor = options.visitor || defaultVisitor;
492
+ const dots = options.dots;
493
+ const indexes = options.indexes;
494
+ const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
495
+ const useBlob = _Blob && utils.isSpecCompliantForm(formData);
496
+ if (!utils.isFunction(visitor)) {
331
497
  throw new TypeError("visitor must be a function");
332
- function u(d) {
333
- if (d === null)
334
- return "";
335
- if (a.isDate(d))
336
- return d.toISOString();
337
- if (!l && a.isBlob(d))
338
- throw new m("Blob is not supported. Use a Buffer instead.");
339
- return a.isArrayBuffer(d) || a.isTypedArray(d) ? l && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
340
- }
341
- function f(d, h, O) {
342
- let b = d;
343
- if (d && !O && typeof d == "object") {
344
- if (a.endsWith(h, "{}"))
345
- h = r ? h : h.slice(0, -2), d = JSON.stringify(d);
346
- else if (a.isArray(d) && Mt(d) || (a.isFileList(d) || a.endsWith(h, "[]")) && (b = a.toArray(d)))
347
- return h = Je(h), b.forEach(function(j, nt) {
348
- !(a.isUndefined(j) || j === null) && t.append(
498
+ }
499
+ function convertValue(value) {
500
+ if (value === null) return "";
501
+ if (utils.isDate(value)) {
502
+ return value.toISOString();
503
+ }
504
+ if (!useBlob && utils.isBlob(value)) {
505
+ throw new AxiosError("Blob is not supported. Use a Buffer instead.");
506
+ }
507
+ if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
508
+ return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
509
+ }
510
+ return value;
511
+ }
512
+ function defaultVisitor(value, key, path) {
513
+ let arr = value;
514
+ if (value && !path && typeof value === "object") {
515
+ if (utils.endsWith(key, "{}")) {
516
+ key = metaTokens ? key : key.slice(0, -2);
517
+ value = JSON.stringify(value);
518
+ } else if (utils.isArray(value) && isFlatArray(value) || (utils.isFileList(value) || utils.endsWith(key, "[]")) && (arr = utils.toArray(value))) {
519
+ key = removeBrackets(key);
520
+ arr.forEach(function each(el, index2) {
521
+ !(utils.isUndefined(el) || el === null) && formData.append(
349
522
  // eslint-disable-next-line no-nested-ternary
350
- o === !0 ? Oe([h], nt, i) : o === null ? h : h + "[]",
351
- u(j)
523
+ indexes === true ? renderKey([key], index2, dots) : indexes === null ? key : key + "[]",
524
+ convertValue(el)
352
525
  );
353
- }), !1;
526
+ });
527
+ return false;
528
+ }
354
529
  }
355
- return se(d) ? !0 : (t.append(Oe(O, h, i), u(d)), !1);
530
+ if (isVisitable(value)) {
531
+ return true;
532
+ }
533
+ formData.append(renderKey(path, key, dots), convertValue(value));
534
+ return false;
356
535
  }
357
- const p = [], w = Object.assign(Ht, {
358
- defaultVisitor: f,
359
- convertValue: u,
360
- isVisitable: se
536
+ const stack = [];
537
+ const exposedHelpers = Object.assign(predicates, {
538
+ defaultVisitor,
539
+ convertValue,
540
+ isVisitable
361
541
  });
362
- function y(d, h) {
363
- if (!a.isUndefined(d)) {
364
- if (p.indexOf(d) !== -1)
365
- throw Error("Circular reference detected in " + h.join("."));
366
- p.push(d), a.forEach(d, function(b, P) {
367
- (!(a.isUndefined(b) || b === null) && s.call(
368
- t,
369
- b,
370
- a.isString(P) ? P.trim() : P,
371
- h,
372
- w
373
- )) === !0 && y(b, h ? h.concat(P) : [P]);
374
- }), p.pop();
375
- }
376
- }
377
- if (!a.isObject(e))
542
+ function build(value, path) {
543
+ if (utils.isUndefined(value)) return;
544
+ if (stack.indexOf(value) !== -1) {
545
+ throw Error("Circular reference detected in " + path.join("."));
546
+ }
547
+ stack.push(value);
548
+ utils.forEach(value, function each(el, key) {
549
+ const result = !(utils.isUndefined(el) || el === null) && visitor.call(
550
+ formData,
551
+ el,
552
+ utils.isString(key) ? key.trim() : key,
553
+ path,
554
+ exposedHelpers
555
+ );
556
+ if (result === true) {
557
+ build(el, path ? path.concat(key) : [key]);
558
+ }
559
+ });
560
+ stack.pop();
561
+ }
562
+ if (!utils.isObject(obj)) {
378
563
  throw new TypeError("data must be an object");
379
- return y(e), t;
564
+ }
565
+ build(obj);
566
+ return formData;
380
567
  }
381
- function ge(e) {
382
- const t = {
568
+ function encode$1(str) {
569
+ const charMap = {
383
570
  "!": "%21",
384
571
  "'": "%27",
385
572
  "(": "%28",
@@ -388,40 +575,51 @@ function ge(e) {
388
575
  "%20": "+",
389
576
  "%00": "\0"
390
577
  };
391
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
392
- return t[r];
578
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
579
+ return charMap[match];
393
580
  });
394
581
  }
395
- function fe(e, t) {
396
- this._pairs = [], e && $(e, this, t);
582
+ function AxiosURLSearchParams(params, options) {
583
+ this._pairs = [];
584
+ params && toFormData(params, this, options);
397
585
  }
398
- const ze = fe.prototype;
399
- ze.append = function(t, n) {
400
- this._pairs.push([t, n]);
586
+ const prototype = AxiosURLSearchParams.prototype;
587
+ prototype.append = function append(name, value) {
588
+ this._pairs.push([name, value]);
401
589
  };
402
- ze.toString = function(t) {
403
- const n = t ? function(r) {
404
- return t.call(this, r, ge);
405
- } : ge;
406
- return this._pairs.map(function(s) {
407
- return n(s[0]) + "=" + n(s[1]);
590
+ prototype.toString = function toString2(encoder) {
591
+ const _encode = encoder ? function(value) {
592
+ return encoder.call(this, value, encode$1);
593
+ } : encode$1;
594
+ return this._pairs.map(function each(pair) {
595
+ return _encode(pair[0]) + "=" + _encode(pair[1]);
408
596
  }, "").join("&");
409
597
  };
410
- function qt(e) {
411
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
598
+ function encode(val) {
599
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
412
600
  }
413
- function Ve(e, t, n) {
414
- if (!t)
415
- return e;
416
- const r = n && n.encode || qt, s = n && n.serialize;
417
- let i;
418
- if (s ? i = s(t, n) : i = a.isURLSearchParams(t) ? t.toString() : new fe(t, n).toString(r), i) {
419
- const o = e.indexOf("#");
420
- o !== -1 && (e = e.slice(0, o)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
601
+ function buildURL(url, params, options) {
602
+ if (!params) {
603
+ return url;
421
604
  }
422
- return e;
605
+ const _encode = options && options.encode || encode;
606
+ const serializeFn = options && options.serialize;
607
+ let serializedParams;
608
+ if (serializeFn) {
609
+ serializedParams = serializeFn(params, options);
610
+ } else {
611
+ serializedParams = utils.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
612
+ }
613
+ if (serializedParams) {
614
+ const hashmarkIndex = url.indexOf("#");
615
+ if (hashmarkIndex !== -1) {
616
+ url = url.slice(0, hashmarkIndex);
617
+ }
618
+ url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
619
+ }
620
+ return url;
423
621
  }
424
- class Ae {
622
+ class InterceptorManager {
425
623
  constructor() {
426
624
  this.handlers = [];
427
625
  }
@@ -433,13 +631,14 @@ class Ae {
433
631
  *
434
632
  * @return {Number} An ID used to remove interceptor later
435
633
  */
436
- use(t, n, r) {
437
- return this.handlers.push({
438
- fulfilled: t,
439
- rejected: n,
440
- synchronous: r ? r.synchronous : !1,
441
- runWhen: r ? r.runWhen : null
442
- }), this.handlers.length - 1;
634
+ use(fulfilled, rejected, options) {
635
+ this.handlers.push({
636
+ fulfilled,
637
+ rejected,
638
+ synchronous: options ? options.synchronous : false,
639
+ runWhen: options ? options.runWhen : null
640
+ });
641
+ return this.handlers.length - 1;
443
642
  }
444
643
  /**
445
644
  * Remove an interceptor from the stack
@@ -448,8 +647,10 @@ class Ae {
448
647
  *
449
648
  * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
450
649
  */
451
- eject(t) {
452
- this.handlers[t] && (this.handlers[t] = null);
650
+ eject(id) {
651
+ if (this.handlers[id]) {
652
+ this.handlers[id] = null;
653
+ }
453
654
  }
454
655
  /**
455
656
  * Clear all interceptors from the stack
@@ -457,7 +658,9 @@ class Ae {
457
658
  * @returns {void}
458
659
  */
459
660
  clear() {
460
- this.handlers && (this.handlers = []);
661
+ if (this.handlers) {
662
+ this.handlers = [];
663
+ }
461
664
  }
462
665
  /**
463
666
  * Iterate over all the registered interceptors
@@ -469,117 +672,185 @@ class Ae {
469
672
  *
470
673
  * @returns {void}
471
674
  */
472
- forEach(t) {
473
- a.forEach(this.handlers, function(r) {
474
- r !== null && t(r);
675
+ forEach(fn) {
676
+ utils.forEach(this.handlers, function forEachHandler(h) {
677
+ if (h !== null) {
678
+ fn(h);
679
+ }
475
680
  });
476
681
  }
477
682
  }
478
- const Ge = {
479
- silentJSONParsing: !0,
480
- forcedJSONParsing: !0,
481
- clarifyTimeoutError: !1
482
- }, Jt = typeof URLSearchParams != "undefined" ? URLSearchParams : fe, zt = typeof FormData != "undefined" ? FormData : null, Vt = (() => {
483
- let e;
484
- return typeof navigator != "undefined" && ((e = navigator.product) === "ReactNative" || e === "NativeScript" || e === "NS") ? !1 : typeof window != "undefined" && typeof document != "undefined";
485
- })(), Gt = typeof WorkerGlobalScope != "undefined" && // eslint-disable-next-line no-undef
486
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", R = {
487
- isBrowser: !0,
683
+ const transitionalDefaults = {
684
+ silentJSONParsing: true,
685
+ forcedJSONParsing: true,
686
+ clarifyTimeoutError: false
687
+ };
688
+ const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
689
+ const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
690
+ const isStandardBrowserEnv = (() => {
691
+ let product;
692
+ if (typeof navigator !== "undefined" && ((product = navigator.product) === "ReactNative" || product === "NativeScript" || product === "NS")) {
693
+ return false;
694
+ }
695
+ return typeof window !== "undefined" && typeof document !== "undefined";
696
+ })();
697
+ const isStandardBrowserWebWorkerEnv = (() => {
698
+ return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
699
+ self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
700
+ })();
701
+ const platform = {
702
+ isBrowser: true,
488
703
  classes: {
489
- URLSearchParams: Jt,
490
- FormData: zt,
704
+ URLSearchParams: URLSearchParams$1,
705
+ FormData: FormData$1,
491
706
  Blob
492
707
  },
493
- isStandardBrowserEnv: Vt,
494
- isStandardBrowserWebWorkerEnv: Gt,
708
+ isStandardBrowserEnv,
709
+ isStandardBrowserWebWorkerEnv,
495
710
  protocols: ["http", "https", "file", "blob", "url", "data"]
496
711
  };
497
- function $t(e, t) {
498
- return $(e, new R.classes.URLSearchParams(), Object.assign({
499
- visitor: function(n, r, s, i) {
500
- return R.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
712
+ function toURLEncodedForm(data, options) {
713
+ return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
714
+ visitor: function(value, key, path, helpers) {
715
+ if (platform.isNode && utils.isBuffer(value)) {
716
+ this.append(key, value.toString("base64"));
717
+ return false;
718
+ }
719
+ return helpers.defaultVisitor.apply(this, arguments);
501
720
  }
502
- }, t));
721
+ }, options));
503
722
  }
504
- function vt(e) {
505
- return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
723
+ function parsePropPath(name) {
724
+ return utils.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
725
+ return match[0] === "[]" ? "" : match[1] || match[0];
726
+ });
506
727
  }
507
- function Kt(e) {
508
- const t = {}, n = Object.keys(e);
509
- let r;
510
- const s = n.length;
728
+ function arrayToObject(arr) {
729
+ const obj = {};
730
+ const keys = Object.keys(arr);
511
731
  let i;
512
- for (r = 0; r < s; r++)
513
- i = n[r], t[i] = e[i];
514
- return t;
732
+ const len = keys.length;
733
+ let key;
734
+ for (i = 0; i < len; i++) {
735
+ key = keys[i];
736
+ obj[key] = arr[key];
737
+ }
738
+ return obj;
515
739
  }
516
- function $e(e) {
517
- function t(n, r, s, i) {
518
- let o = n[i++];
519
- const c = Number.isFinite(+o), l = i >= n.length;
520
- return o = !o && a.isArray(s) ? s.length : o, l ? (a.hasOwnProp(s, o) ? s[o] = [s[o], r] : s[o] = r, !c) : ((!s[o] || !a.isObject(s[o])) && (s[o] = []), t(n, r, s[o], i) && a.isArray(s[o]) && (s[o] = Kt(s[o])), !c);
521
- }
522
- if (a.isFormData(e) && a.isFunction(e.entries)) {
523
- const n = {};
524
- return a.forEachEntry(e, (r, s) => {
525
- t(vt(r), s, n, 0);
526
- }), n;
740
+ function formDataToJSON(formData) {
741
+ function buildPath(path, value, target, index2) {
742
+ let name = path[index2++];
743
+ const isNumericKey = Number.isFinite(+name);
744
+ const isLast = index2 >= path.length;
745
+ name = !name && utils.isArray(target) ? target.length : name;
746
+ if (isLast) {
747
+ if (utils.hasOwnProp(target, name)) {
748
+ target[name] = [target[name], value];
749
+ } else {
750
+ target[name] = value;
751
+ }
752
+ return !isNumericKey;
753
+ }
754
+ if (!target[name] || !utils.isObject(target[name])) {
755
+ target[name] = [];
756
+ }
757
+ const result = buildPath(path, value, target[name], index2);
758
+ if (result && utils.isArray(target[name])) {
759
+ target[name] = arrayToObject(target[name]);
760
+ }
761
+ return !isNumericKey;
762
+ }
763
+ if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
764
+ const obj = {};
765
+ utils.forEachEntry(formData, (name, value) => {
766
+ buildPath(parsePropPath(name), value, obj, 0);
767
+ });
768
+ return obj;
527
769
  }
528
770
  return null;
529
771
  }
530
- const Wt = {
772
+ const DEFAULT_CONTENT_TYPE = {
531
773
  "Content-Type": void 0
532
774
  };
533
- function Xt(e, t, n) {
534
- if (a.isString(e))
775
+ function stringifySafely(rawValue, parser, encoder) {
776
+ if (utils.isString(rawValue)) {
535
777
  try {
536
- return (t || JSON.parse)(e), a.trim(e);
537
- } catch (r) {
538
- if (r.name !== "SyntaxError")
539
- throw r;
778
+ (parser || JSON.parse)(rawValue);
779
+ return utils.trim(rawValue);
780
+ } catch (e) {
781
+ if (e.name !== "SyntaxError") {
782
+ throw e;
783
+ }
540
784
  }
541
- return (n || JSON.stringify)(e);
785
+ }
786
+ return (encoder || JSON.stringify)(rawValue);
542
787
  }
543
- const v = {
544
- transitional: Ge,
788
+ const defaults = {
789
+ transitional: transitionalDefaults,
545
790
  adapter: ["xhr", "http"],
546
- transformRequest: [function(t, n) {
547
- const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, i = a.isObject(t);
548
- if (i && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
549
- return s && s ? JSON.stringify($e(t)) : t;
550
- if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t))
551
- return t;
552
- if (a.isArrayBufferView(t))
553
- return t.buffer;
554
- if (a.isURLSearchParams(t))
555
- return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
556
- let c;
557
- if (i) {
558
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
559
- return $t(t, this.formSerializer).toString();
560
- if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
561
- const l = this.env && this.env.FormData;
562
- return $(
563
- c ? { "files[]": t } : t,
564
- l && new l(),
791
+ transformRequest: [function transformRequest(data, headers) {
792
+ const contentType = headers.getContentType() || "";
793
+ const hasJSONContentType = contentType.indexOf("application/json") > -1;
794
+ const isObjectPayload = utils.isObject(data);
795
+ if (isObjectPayload && utils.isHTMLForm(data)) {
796
+ data = new FormData(data);
797
+ }
798
+ const isFormData2 = utils.isFormData(data);
799
+ if (isFormData2) {
800
+ if (!hasJSONContentType) {
801
+ return data;
802
+ }
803
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
804
+ }
805
+ if (utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {
806
+ return data;
807
+ }
808
+ if (utils.isArrayBufferView(data)) {
809
+ return data.buffer;
810
+ }
811
+ if (utils.isURLSearchParams(data)) {
812
+ headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
813
+ return data.toString();
814
+ }
815
+ let isFileList2;
816
+ if (isObjectPayload) {
817
+ if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
818
+ return toURLEncodedForm(data, this.formSerializer).toString();
819
+ }
820
+ if ((isFileList2 = utils.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
821
+ const _FormData = this.env && this.env.FormData;
822
+ return toFormData(
823
+ isFileList2 ? { "files[]": data } : data,
824
+ _FormData && new _FormData(),
565
825
  this.formSerializer
566
826
  );
567
827
  }
568
828
  }
569
- return i || s ? (n.setContentType("application/json", !1), Xt(t)) : t;
829
+ if (isObjectPayload || hasJSONContentType) {
830
+ headers.setContentType("application/json", false);
831
+ return stringifySafely(data);
832
+ }
833
+ return data;
570
834
  }],
571
- transformResponse: [function(t) {
572
- const n = this.transitional || v.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
573
- if (t && a.isString(t) && (r && !this.responseType || s)) {
574
- const o = !(n && n.silentJSONParsing) && s;
835
+ transformResponse: [function transformResponse(data) {
836
+ const transitional2 = this.transitional || defaults.transitional;
837
+ const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
838
+ const JSONRequested = this.responseType === "json";
839
+ if (data && utils.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
840
+ const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
841
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
575
842
  try {
576
- return JSON.parse(t);
577
- } catch (c) {
578
- if (o)
579
- throw c.name === "SyntaxError" ? m.from(c, m.ERR_BAD_RESPONSE, this, null, this.response) : c;
843
+ return JSON.parse(data);
844
+ } catch (e) {
845
+ if (strictJSONParsing) {
846
+ if (e.name === "SyntaxError") {
847
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
848
+ }
849
+ throw e;
850
+ }
580
851
  }
581
852
  }
582
- return t;
853
+ return data;
583
854
  }],
584
855
  /**
585
856
  * A timeout in milliseconds to abort a request. If set to 0 (default) a
@@ -591,25 +862,25 @@ const v = {
591
862
  maxContentLength: -1,
592
863
  maxBodyLength: -1,
593
864
  env: {
594
- FormData: R.classes.FormData,
595
- Blob: R.classes.Blob
865
+ FormData: platform.classes.FormData,
866
+ Blob: platform.classes.Blob
596
867
  },
597
- validateStatus: function(t) {
598
- return t >= 200 && t < 300;
868
+ validateStatus: function validateStatus(status) {
869
+ return status >= 200 && status < 300;
599
870
  },
600
871
  headers: {
601
872
  common: {
602
- Accept: "application/json, text/plain, */*"
873
+ "Accept": "application/json, text/plain, */*"
603
874
  }
604
875
  }
605
876
  };
606
- a.forEach(["delete", "get", "head"], function(t) {
607
- v.headers[t] = {};
877
+ utils.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
878
+ defaults.headers[method] = {};
608
879
  });
609
- a.forEach(["post", "put", "patch"], function(t) {
610
- v.headers[t] = a.merge(Wt);
880
+ utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
881
+ defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
611
882
  });
612
- const de = v, Qt = a.toObjectSet([
883
+ const ignoreDuplicateOf = utils.toObjectSet([
613
884
  "age",
614
885
  "authorization",
615
886
  "content-length",
@@ -627,541 +898,792 @@ const de = v, Qt = a.toObjectSet([
627
898
  "referer",
628
899
  "retry-after",
629
900
  "user-agent"
630
- ]), Yt = (e) => {
631
- const t = {};
632
- let n, r, s;
633
- return e && e.split(`
634
- `).forEach(function(o) {
635
- s = o.indexOf(":"), n = o.substring(0, s).trim().toLowerCase(), r = o.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);
636
- }), t;
637
- }, Te = Symbol("internals");
638
- function _(e) {
639
- return e && String(e).trim().toLowerCase();
901
+ ]);
902
+ const parseHeaders = (rawHeaders) => {
903
+ const parsed = {};
904
+ let key;
905
+ let val;
906
+ let i;
907
+ rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
908
+ i = line.indexOf(":");
909
+ key = line.substring(0, i).trim().toLowerCase();
910
+ val = line.substring(i + 1).trim();
911
+ if (!key || parsed[key] && ignoreDuplicateOf[key]) {
912
+ return;
913
+ }
914
+ if (key === "set-cookie") {
915
+ if (parsed[key]) {
916
+ parsed[key].push(val);
917
+ } else {
918
+ parsed[key] = [val];
919
+ }
920
+ } else {
921
+ parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
922
+ }
923
+ });
924
+ return parsed;
925
+ };
926
+ const $internals = Symbol("internals");
927
+ function normalizeHeader(header) {
928
+ return header && String(header).trim().toLowerCase();
640
929
  }
641
- function q(e) {
642
- return e === !1 || e == null ? e : a.isArray(e) ? e.map(q) : String(e);
930
+ function normalizeValue(value) {
931
+ if (value === false || value == null) {
932
+ return value;
933
+ }
934
+ return utils.isArray(value) ? value.map(normalizeValue) : String(value);
643
935
  }
644
- function Zt(e) {
645
- const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
646
- let r;
647
- for (; r = n.exec(e); )
648
- t[r[1]] = r[2];
649
- return t;
936
+ function parseTokens(str) {
937
+ const tokens = /* @__PURE__ */ Object.create(null);
938
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
939
+ let match;
940
+ while (match = tokensRE.exec(str)) {
941
+ tokens[match[1]] = match[2];
942
+ }
943
+ return tokens;
650
944
  }
651
- function en(e) {
652
- return /^[-_a-zA-Z]+$/.test(e.trim());
945
+ function isValidHeaderName(str) {
946
+ return /^[-_a-zA-Z]+$/.test(str.trim());
653
947
  }
654
- function ee(e, t, n, r, s) {
655
- if (a.isFunction(r))
656
- return r.call(this, t, n);
657
- if (s && (t = n), !!a.isString(t)) {
658
- if (a.isString(r))
659
- return t.indexOf(r) !== -1;
660
- if (a.isRegExp(r))
661
- return r.test(t);
948
+ function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
949
+ if (utils.isFunction(filter2)) {
950
+ return filter2.call(this, value, header);
951
+ }
952
+ if (isHeaderNameFilter) {
953
+ value = header;
954
+ }
955
+ if (!utils.isString(value)) return;
956
+ if (utils.isString(filter2)) {
957
+ return value.indexOf(filter2) !== -1;
958
+ }
959
+ if (utils.isRegExp(filter2)) {
960
+ return filter2.test(value);
662
961
  }
663
962
  }
664
- function tn(e) {
665
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
963
+ function formatHeader(header) {
964
+ return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
965
+ return char.toUpperCase() + str;
966
+ });
666
967
  }
667
- function nn(e, t) {
668
- const n = a.toCamelCase(" " + t);
669
- ["get", "set", "has"].forEach((r) => {
670
- Object.defineProperty(e, r + n, {
671
- value: function(s, i, o) {
672
- return this[r].call(this, t, s, i, o);
968
+ function buildAccessors(obj, header) {
969
+ const accessorName = utils.toCamelCase(" " + header);
970
+ ["get", "set", "has"].forEach((methodName) => {
971
+ Object.defineProperty(obj, methodName + accessorName, {
972
+ value: function(arg1, arg2, arg3) {
973
+ return this[methodName].call(this, header, arg1, arg2, arg3);
673
974
  },
674
- configurable: !0
975
+ configurable: true
675
976
  });
676
977
  });
677
978
  }
678
- class K {
679
- constructor(t) {
680
- t && this.set(t);
681
- }
682
- set(t, n, r) {
683
- const s = this;
684
- function i(c, l, u) {
685
- const f = _(l);
686
- if (!f)
979
+ class AxiosHeaders {
980
+ constructor(headers) {
981
+ headers && this.set(headers);
982
+ }
983
+ set(header, valueOrRewrite, rewrite) {
984
+ const self2 = this;
985
+ function setHeader(_value, _header, _rewrite) {
986
+ const lHeader = normalizeHeader(_header);
987
+ if (!lHeader) {
687
988
  throw new Error("header name must be a non-empty string");
688
- const p = a.findKey(s, f);
689
- (!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p || l] = q(c));
690
- }
691
- const o = (c, l) => a.forEach(c, (u, f) => i(u, f, l));
692
- return a.isPlainObject(t) || t instanceof this.constructor ? o(t, n) : a.isString(t) && (t = t.trim()) && !en(t) ? o(Yt(t), n) : t != null && i(n, t, r), this;
693
- }
694
- get(t, n) {
695
- if (t = _(t), t) {
696
- const r = a.findKey(this, t);
697
- if (r) {
698
- const s = this[r];
699
- if (!n)
700
- return s;
701
- if (n === !0)
702
- return Zt(s);
703
- if (a.isFunction(n))
704
- return n.call(this, s, r);
705
- if (a.isRegExp(n))
706
- return n.exec(s);
989
+ }
990
+ const key = utils.findKey(self2, lHeader);
991
+ if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
992
+ self2[key || _header] = normalizeValue(_value);
993
+ }
994
+ }
995
+ const setHeaders = (headers, _rewrite) => utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
996
+ if (utils.isPlainObject(header) || header instanceof this.constructor) {
997
+ setHeaders(header, valueOrRewrite);
998
+ } else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
999
+ setHeaders(parseHeaders(header), valueOrRewrite);
1000
+ } else {
1001
+ header != null && setHeader(valueOrRewrite, header, rewrite);
1002
+ }
1003
+ return this;
1004
+ }
1005
+ get(header, parser) {
1006
+ header = normalizeHeader(header);
1007
+ if (header) {
1008
+ const key = utils.findKey(this, header);
1009
+ if (key) {
1010
+ const value = this[key];
1011
+ if (!parser) {
1012
+ return value;
1013
+ }
1014
+ if (parser === true) {
1015
+ return parseTokens(value);
1016
+ }
1017
+ if (utils.isFunction(parser)) {
1018
+ return parser.call(this, value, key);
1019
+ }
1020
+ if (utils.isRegExp(parser)) {
1021
+ return parser.exec(value);
1022
+ }
707
1023
  throw new TypeError("parser must be boolean|regexp|function");
708
1024
  }
709
1025
  }
710
1026
  }
711
- has(t, n) {
712
- if (t = _(t), t) {
713
- const r = a.findKey(this, t);
714
- return !!(r && this[r] !== void 0 && (!n || ee(this, this[r], r, n)));
1027
+ has(header, matcher) {
1028
+ header = normalizeHeader(header);
1029
+ if (header) {
1030
+ const key = utils.findKey(this, header);
1031
+ return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
715
1032
  }
716
- return !1;
1033
+ return false;
717
1034
  }
718
- delete(t, n) {
719
- const r = this;
720
- let s = !1;
721
- function i(o) {
722
- if (o = _(o), o) {
723
- const c = a.findKey(r, o);
724
- c && (!n || ee(r, r[c], c, n)) && (delete r[c], s = !0);
1035
+ delete(header, matcher) {
1036
+ const self2 = this;
1037
+ let deleted = false;
1038
+ function deleteHeader(_header) {
1039
+ _header = normalizeHeader(_header);
1040
+ if (_header) {
1041
+ const key = utils.findKey(self2, _header);
1042
+ if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
1043
+ delete self2[key];
1044
+ deleted = true;
1045
+ }
725
1046
  }
726
1047
  }
727
- return a.isArray(t) ? t.forEach(i) : i(t), s;
1048
+ if (utils.isArray(header)) {
1049
+ header.forEach(deleteHeader);
1050
+ } else {
1051
+ deleteHeader(header);
1052
+ }
1053
+ return deleted;
728
1054
  }
729
- clear(t) {
730
- const n = Object.keys(this);
731
- let r = n.length, s = !1;
732
- for (; r--; ) {
733
- const i = n[r];
734
- (!t || ee(this, this[i], i, t, !0)) && (delete this[i], s = !0);
1055
+ clear(matcher) {
1056
+ const keys = Object.keys(this);
1057
+ let i = keys.length;
1058
+ let deleted = false;
1059
+ while (i--) {
1060
+ const key = keys[i];
1061
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1062
+ delete this[key];
1063
+ deleted = true;
1064
+ }
735
1065
  }
736
- return s;
1066
+ return deleted;
737
1067
  }
738
- normalize(t) {
739
- const n = this, r = {};
740
- return a.forEach(this, (s, i) => {
741
- const o = a.findKey(r, i);
742
- if (o) {
743
- n[o] = q(s), delete n[i];
1068
+ normalize(format) {
1069
+ const self2 = this;
1070
+ const headers = {};
1071
+ utils.forEach(this, (value, header) => {
1072
+ const key = utils.findKey(headers, header);
1073
+ if (key) {
1074
+ self2[key] = normalizeValue(value);
1075
+ delete self2[header];
744
1076
  return;
745
1077
  }
746
- const c = t ? tn(i) : String(i).trim();
747
- c !== i && delete n[i], n[c] = q(s), r[c] = !0;
748
- }), this;
1078
+ const normalized = format ? formatHeader(header) : String(header).trim();
1079
+ if (normalized !== header) {
1080
+ delete self2[header];
1081
+ }
1082
+ self2[normalized] = normalizeValue(value);
1083
+ headers[normalized] = true;
1084
+ });
1085
+ return this;
749
1086
  }
750
- concat(...t) {
751
- return this.constructor.concat(this, ...t);
1087
+ concat(...targets) {
1088
+ return this.constructor.concat(this, ...targets);
752
1089
  }
753
- toJSON(t) {
754
- const n = /* @__PURE__ */ Object.create(null);
755
- return a.forEach(this, (r, s) => {
756
- r != null && r !== !1 && (n[s] = t && a.isArray(r) ? r.join(", ") : r);
757
- }), n;
1090
+ toJSON(asStrings) {
1091
+ const obj = /* @__PURE__ */ Object.create(null);
1092
+ utils.forEach(this, (value, header) => {
1093
+ value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(", ") : value);
1094
+ });
1095
+ return obj;
758
1096
  }
759
1097
  [Symbol.iterator]() {
760
1098
  return Object.entries(this.toJSON())[Symbol.iterator]();
761
1099
  }
762
1100
  toString() {
763
- return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
764
- `);
1101
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
765
1102
  }
766
1103
  get [Symbol.toStringTag]() {
767
1104
  return "AxiosHeaders";
768
1105
  }
769
- static from(t) {
770
- return t instanceof this ? t : new this(t);
1106
+ static from(thing) {
1107
+ return thing instanceof this ? thing : new this(thing);
771
1108
  }
772
- static concat(t, ...n) {
773
- const r = new this(t);
774
- return n.forEach((s) => r.set(s)), r;
1109
+ static concat(first, ...targets) {
1110
+ const computed = new this(first);
1111
+ targets.forEach((target) => computed.set(target));
1112
+ return computed;
775
1113
  }
776
- static accessor(t) {
777
- const r = (this[Te] = this[Te] = {
1114
+ static accessor(header) {
1115
+ const internals = this[$internals] = this[$internals] = {
778
1116
  accessors: {}
779
- }).accessors, s = this.prototype;
780
- function i(o) {
781
- const c = _(o);
782
- r[c] || (nn(s, o), r[c] = !0);
1117
+ };
1118
+ const accessors = internals.accessors;
1119
+ const prototype2 = this.prototype;
1120
+ function defineAccessor(_header) {
1121
+ const lHeader = normalizeHeader(_header);
1122
+ if (!accessors[lHeader]) {
1123
+ buildAccessors(prototype2, _header);
1124
+ accessors[lHeader] = true;
1125
+ }
783
1126
  }
784
- return a.isArray(t) ? t.forEach(i) : i(t), this;
1127
+ utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1128
+ return this;
785
1129
  }
786
1130
  }
787
- K.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
788
- a.freezeMethods(K.prototype);
789
- a.freezeMethods(K);
790
- const g = K;
791
- function te(e, t) {
792
- const n = this || de, r = t || n, s = g.from(r.headers);
793
- let i = r.data;
794
- return a.forEach(e, function(c) {
795
- i = c.call(n, i, s.normalize(), t ? t.status : void 0);
796
- }), s.normalize(), i;
1131
+ AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1132
+ utils.freezeMethods(AxiosHeaders.prototype);
1133
+ utils.freezeMethods(AxiosHeaders);
1134
+ function transformData(fns, response) {
1135
+ const config2 = this || defaults;
1136
+ const context = response || config2;
1137
+ const headers = AxiosHeaders.from(context.headers);
1138
+ let data = context.data;
1139
+ utils.forEach(fns, function transform(fn) {
1140
+ data = fn.call(config2, data, headers.normalize(), response ? response.status : void 0);
1141
+ });
1142
+ headers.normalize();
1143
+ return data;
797
1144
  }
798
- function ve(e) {
799
- return !!(e && e.__CANCEL__);
1145
+ function isCancel(value) {
1146
+ return !!(value && value.__CANCEL__);
800
1147
  }
801
- function k(e, t, n) {
802
- m.call(this, e == null ? "canceled" : e, m.ERR_CANCELED, t, n), this.name = "CanceledError";
1148
+ function CanceledError(message, config2, request) {
1149
+ AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config2, request);
1150
+ this.name = "CanceledError";
803
1151
  }
804
- a.inherits(k, m, {
805
- __CANCEL__: !0
1152
+ utils.inherits(CanceledError, AxiosError, {
1153
+ __CANCEL__: true
806
1154
  });
807
- function rn(e, t, n) {
808
- const r = n.config.validateStatus;
809
- !n.status || !r || r(n.status) ? e(n) : t(new m(
810
- "Request failed with status code " + n.status,
811
- [m.ERR_BAD_REQUEST, m.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
812
- n.config,
813
- n.request,
814
- n
815
- ));
1155
+ function settle(resolve, reject, response) {
1156
+ const validateStatus2 = response.config.validateStatus;
1157
+ if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
1158
+ resolve(response);
1159
+ } else {
1160
+ reject(new AxiosError(
1161
+ "Request failed with status code " + response.status,
1162
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
1163
+ response.config,
1164
+ response.request,
1165
+ response
1166
+ ));
1167
+ }
816
1168
  }
817
- const sn = R.isStandardBrowserEnv ? (
1169
+ const cookies = platform.isStandardBrowserEnv ? (
818
1170
  // Standard browser envs support document.cookie
819
- /* @__PURE__ */ function() {
1171
+ /* @__PURE__ */ function standardBrowserEnv() {
820
1172
  return {
821
- write: function(n, r, s, i, o, c) {
822
- const l = [];
823
- l.push(n + "=" + encodeURIComponent(r)), a.isNumber(s) && l.push("expires=" + new Date(s).toGMTString()), a.isString(i) && l.push("path=" + i), a.isString(o) && l.push("domain=" + o), c === !0 && l.push("secure"), document.cookie = l.join("; ");
1173
+ write: function write(name, value, expires, path, domain, secure) {
1174
+ const cookie = [];
1175
+ cookie.push(name + "=" + encodeURIComponent(value));
1176
+ if (utils.isNumber(expires)) {
1177
+ cookie.push("expires=" + new Date(expires).toGMTString());
1178
+ }
1179
+ if (utils.isString(path)) {
1180
+ cookie.push("path=" + path);
1181
+ }
1182
+ if (utils.isString(domain)) {
1183
+ cookie.push("domain=" + domain);
1184
+ }
1185
+ if (secure === true) {
1186
+ cookie.push("secure");
1187
+ }
1188
+ document.cookie = cookie.join("; ");
824
1189
  },
825
- read: function(n) {
826
- const r = document.cookie.match(new RegExp("(^|;\\s*)(" + n + ")=([^;]*)"));
827
- return r ? decodeURIComponent(r[3]) : null;
1190
+ read: function read(name) {
1191
+ const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
1192
+ return match ? decodeURIComponent(match[3]) : null;
828
1193
  },
829
- remove: function(n) {
830
- this.write(n, "", Date.now() - 864e5);
1194
+ remove: function remove(name) {
1195
+ this.write(name, "", Date.now() - 864e5);
831
1196
  }
832
1197
  };
833
1198
  }()
834
1199
  ) : (
835
1200
  // Non standard browser env (web workers, react-native) lack needed support.
836
- /* @__PURE__ */ function() {
1201
+ /* @__PURE__ */ function nonStandardBrowserEnv() {
837
1202
  return {
838
- write: function() {
1203
+ write: function write() {
839
1204
  },
840
- read: function() {
1205
+ read: function read() {
841
1206
  return null;
842
1207
  },
843
- remove: function() {
1208
+ remove: function remove() {
844
1209
  }
845
1210
  };
846
1211
  }()
847
1212
  );
848
- function on(e) {
849
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1213
+ function isAbsoluteURL(url) {
1214
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
850
1215
  }
851
- function an(e, t) {
852
- return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
1216
+ function combineURLs(baseURL, relativeURL) {
1217
+ return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
853
1218
  }
854
- function Ke(e, t) {
855
- return e && !on(t) ? an(e, t) : t;
1219
+ function buildFullPath(baseURL, requestedURL) {
1220
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
1221
+ return combineURLs(baseURL, requestedURL);
1222
+ }
1223
+ return requestedURL;
856
1224
  }
857
- const cn = R.isStandardBrowserEnv ? (
1225
+ const isURLSameOrigin = platform.isStandardBrowserEnv ? (
858
1226
  // Standard browser envs have full support of the APIs needed to test
859
1227
  // whether the request URL is of the same origin as current location.
860
- function() {
861
- const t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
862
- let r;
863
- function s(i) {
864
- let o = i;
865
- return t && (n.setAttribute("href", o), o = n.href), n.setAttribute("href", o), {
866
- href: n.href,
867
- protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
868
- host: n.host,
869
- search: n.search ? n.search.replace(/^\?/, "") : "",
870
- hash: n.hash ? n.hash.replace(/^#/, "") : "",
871
- hostname: n.hostname,
872
- port: n.port,
873
- pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
1228
+ function standardBrowserEnv2() {
1229
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
1230
+ const urlParsingNode = document.createElement("a");
1231
+ let originURL;
1232
+ function resolveURL(url) {
1233
+ let href = url;
1234
+ if (msie) {
1235
+ urlParsingNode.setAttribute("href", href);
1236
+ href = urlParsingNode.href;
1237
+ }
1238
+ urlParsingNode.setAttribute("href", href);
1239
+ return {
1240
+ href: urlParsingNode.href,
1241
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
1242
+ host: urlParsingNode.host,
1243
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
1244
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
1245
+ hostname: urlParsingNode.hostname,
1246
+ port: urlParsingNode.port,
1247
+ pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
874
1248
  };
875
1249
  }
876
- return r = s(window.location.href), function(o) {
877
- const c = a.isString(o) ? s(o) : o;
878
- return c.protocol === r.protocol && c.host === r.host;
1250
+ originURL = resolveURL(window.location.href);
1251
+ return function isURLSameOrigin2(requestURL) {
1252
+ const parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;
1253
+ return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
879
1254
  };
880
1255
  }()
881
1256
  ) : (
882
1257
  // Non standard browser envs (web workers, react-native) lack needed support.
883
- /* @__PURE__ */ function() {
884
- return function() {
885
- return !0;
1258
+ /* @__PURE__ */ function nonStandardBrowserEnv2() {
1259
+ return function isURLSameOrigin2() {
1260
+ return true;
886
1261
  };
887
1262
  }()
888
1263
  );
889
- function un(e) {
890
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
891
- return t && t[1] || "";
1264
+ function parseProtocol(url) {
1265
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
1266
+ return match && match[1] || "";
892
1267
  }
893
- function ln(e, t) {
894
- e = e || 10;
895
- const n = new Array(e), r = new Array(e);
896
- let s = 0, i = 0, o;
897
- return t = t !== void 0 ? t : 1e3, function(l) {
898
- const u = Date.now(), f = r[i];
899
- o || (o = u), n[s] = l, r[s] = u;
900
- let p = i, w = 0;
901
- for (; p !== s; )
902
- w += n[p++], p = p % e;
903
- if (s = (s + 1) % e, s === i && (i = (i + 1) % e), u - o < t)
1268
+ function speedometer(samplesCount, min) {
1269
+ samplesCount = samplesCount || 10;
1270
+ const bytes = new Array(samplesCount);
1271
+ const timestamps = new Array(samplesCount);
1272
+ let head = 0;
1273
+ let tail = 0;
1274
+ let firstSampleTS;
1275
+ min = min !== void 0 ? min : 1e3;
1276
+ return function push(chunkLength) {
1277
+ const now = Date.now();
1278
+ const startedAt = timestamps[tail];
1279
+ if (!firstSampleTS) {
1280
+ firstSampleTS = now;
1281
+ }
1282
+ bytes[head] = chunkLength;
1283
+ timestamps[head] = now;
1284
+ let i = tail;
1285
+ let bytesCount = 0;
1286
+ while (i !== head) {
1287
+ bytesCount += bytes[i++];
1288
+ i = i % samplesCount;
1289
+ }
1290
+ head = (head + 1) % samplesCount;
1291
+ if (head === tail) {
1292
+ tail = (tail + 1) % samplesCount;
1293
+ }
1294
+ if (now - firstSampleTS < min) {
904
1295
  return;
905
- const y = f && u - f;
906
- return y ? Math.round(w * 1e3 / y) : void 0;
1296
+ }
1297
+ const passed = startedAt && now - startedAt;
1298
+ return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
907
1299
  };
908
1300
  }
909
- function Ne(e, t) {
910
- let n = 0;
911
- const r = ln(50, 250);
912
- return (s) => {
913
- const i = s.loaded, o = s.lengthComputable ? s.total : void 0, c = i - n, l = r(c), u = i <= o;
914
- n = i;
915
- const f = {
916
- loaded: i,
917
- total: o,
918
- progress: o ? i / o : void 0,
919
- bytes: c,
920
- rate: l || void 0,
921
- estimated: l && o && u ? (o - i) / l : void 0,
922
- event: s
1301
+ function progressEventReducer(listener, isDownloadStream) {
1302
+ let bytesNotified = 0;
1303
+ const _speedometer = speedometer(50, 250);
1304
+ return (e) => {
1305
+ const loaded = e.loaded;
1306
+ const total = e.lengthComputable ? e.total : void 0;
1307
+ const progressBytes = loaded - bytesNotified;
1308
+ const rate = _speedometer(progressBytes);
1309
+ const inRange = loaded <= total;
1310
+ bytesNotified = loaded;
1311
+ const data = {
1312
+ loaded,
1313
+ total,
1314
+ progress: total ? loaded / total : void 0,
1315
+ bytes: progressBytes,
1316
+ rate: rate ? rate : void 0,
1317
+ estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
1318
+ event: e
923
1319
  };
924
- f[t ? "download" : "upload"] = !0, e(f);
1320
+ data[isDownloadStream ? "download" : "upload"] = true;
1321
+ listener(data);
925
1322
  };
926
1323
  }
927
- const fn = typeof XMLHttpRequest != "undefined", dn = fn && function(e) {
928
- return new Promise(function(n, r) {
929
- let s = e.data;
930
- const i = g.from(e.headers).normalize(), o = e.responseType;
931
- let c;
932
- function l() {
933
- e.cancelToken && e.cancelToken.unsubscribe(c), e.signal && e.signal.removeEventListener("abort", c);
934
- }
935
- a.isFormData(s) && (R.isStandardBrowserEnv || R.isStandardBrowserWebWorkerEnv) && i.setContentType(!1);
936
- let u = new XMLHttpRequest();
937
- if (e.auth) {
938
- const y = e.auth.username || "", d = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
939
- i.set("Authorization", "Basic " + btoa(y + ":" + d));
940
- }
941
- const f = Ke(e.baseURL, e.url);
942
- u.open(e.method.toUpperCase(), Ve(f, e.params, e.paramsSerializer), !0), u.timeout = e.timeout;
943
- function p() {
944
- if (!u)
1324
+ const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
1325
+ const xhrAdapter = isXHRAdapterSupported && function(config2) {
1326
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
1327
+ let requestData = config2.data;
1328
+ const requestHeaders = AxiosHeaders.from(config2.headers).normalize();
1329
+ const responseType = config2.responseType;
1330
+ let onCanceled;
1331
+ function done() {
1332
+ if (config2.cancelToken) {
1333
+ config2.cancelToken.unsubscribe(onCanceled);
1334
+ }
1335
+ if (config2.signal) {
1336
+ config2.signal.removeEventListener("abort", onCanceled);
1337
+ }
1338
+ }
1339
+ if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
1340
+ requestHeaders.setContentType(false);
1341
+ }
1342
+ let request = new XMLHttpRequest();
1343
+ if (config2.auth) {
1344
+ const username = config2.auth.username || "";
1345
+ const password = config2.auth.password ? unescape(encodeURIComponent(config2.auth.password)) : "";
1346
+ requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
1347
+ }
1348
+ const fullPath = buildFullPath(config2.baseURL, config2.url);
1349
+ request.open(config2.method.toUpperCase(), buildURL(fullPath, config2.params, config2.paramsSerializer), true);
1350
+ request.timeout = config2.timeout;
1351
+ function onloadend() {
1352
+ if (!request) {
1353
+ return;
1354
+ }
1355
+ const responseHeaders = AxiosHeaders.from(
1356
+ "getAllResponseHeaders" in request && request.getAllResponseHeaders()
1357
+ );
1358
+ const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
1359
+ const response = {
1360
+ data: responseData,
1361
+ status: request.status,
1362
+ statusText: request.statusText,
1363
+ headers: responseHeaders,
1364
+ config: config2,
1365
+ request
1366
+ };
1367
+ settle(function _resolve(value) {
1368
+ resolve(value);
1369
+ done();
1370
+ }, function _reject(err) {
1371
+ reject(err);
1372
+ done();
1373
+ }, response);
1374
+ request = null;
1375
+ }
1376
+ if ("onloadend" in request) {
1377
+ request.onloadend = onloadend;
1378
+ } else {
1379
+ request.onreadystatechange = function handleLoad() {
1380
+ if (!request || request.readyState !== 4) {
1381
+ return;
1382
+ }
1383
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
1384
+ return;
1385
+ }
1386
+ setTimeout(onloadend);
1387
+ };
1388
+ }
1389
+ request.onabort = function handleAbort() {
1390
+ if (!request) {
945
1391
  return;
946
- const y = g.from(
947
- "getAllResponseHeaders" in u && u.getAllResponseHeaders()
948
- ), h = {
949
- data: !o || o === "text" || o === "json" ? u.responseText : u.response,
950
- status: u.status,
951
- statusText: u.statusText,
952
- headers: y,
953
- config: e,
954
- request: u
1392
+ }
1393
+ reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config2, request));
1394
+ request = null;
1395
+ };
1396
+ request.onerror = function handleError() {
1397
+ reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config2, request));
1398
+ request = null;
1399
+ };
1400
+ request.ontimeout = function handleTimeout() {
1401
+ let timeoutErrorMessage = config2.timeout ? "timeout of " + config2.timeout + "ms exceeded" : "timeout exceeded";
1402
+ const transitional2 = config2.transitional || transitionalDefaults;
1403
+ if (config2.timeoutErrorMessage) {
1404
+ timeoutErrorMessage = config2.timeoutErrorMessage;
1405
+ }
1406
+ reject(new AxiosError(
1407
+ timeoutErrorMessage,
1408
+ transitional2.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
1409
+ config2,
1410
+ request
1411
+ ));
1412
+ request = null;
1413
+ };
1414
+ if (platform.isStandardBrowserEnv) {
1415
+ const xsrfValue = (config2.withCredentials || isURLSameOrigin(fullPath)) && config2.xsrfCookieName && cookies.read(config2.xsrfCookieName);
1416
+ if (xsrfValue) {
1417
+ requestHeaders.set(config2.xsrfHeaderName, xsrfValue);
1418
+ }
1419
+ }
1420
+ requestData === void 0 && requestHeaders.setContentType(null);
1421
+ if ("setRequestHeader" in request) {
1422
+ utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
1423
+ request.setRequestHeader(key, val);
1424
+ });
1425
+ }
1426
+ if (!utils.isUndefined(config2.withCredentials)) {
1427
+ request.withCredentials = !!config2.withCredentials;
1428
+ }
1429
+ if (responseType && responseType !== "json") {
1430
+ request.responseType = config2.responseType;
1431
+ }
1432
+ if (typeof config2.onDownloadProgress === "function") {
1433
+ request.addEventListener("progress", progressEventReducer(config2.onDownloadProgress, true));
1434
+ }
1435
+ if (typeof config2.onUploadProgress === "function" && request.upload) {
1436
+ request.upload.addEventListener("progress", progressEventReducer(config2.onUploadProgress));
1437
+ }
1438
+ if (config2.cancelToken || config2.signal) {
1439
+ onCanceled = (cancel) => {
1440
+ if (!request) {
1441
+ return;
1442
+ }
1443
+ reject(!cancel || cancel.type ? new CanceledError(null, config2, request) : cancel);
1444
+ request.abort();
1445
+ request = null;
955
1446
  };
956
- rn(function(b) {
957
- n(b), l();
958
- }, function(b) {
959
- r(b), l();
960
- }, h), u = null;
961
- }
962
- if ("onloadend" in u ? u.onloadend = p : u.onreadystatechange = function() {
963
- !u || u.readyState !== 4 || u.status === 0 && !(u.responseURL && u.responseURL.indexOf("file:") === 0) || setTimeout(p);
964
- }, u.onabort = function() {
965
- u && (r(new m("Request aborted", m.ECONNABORTED, e, u)), u = null);
966
- }, u.onerror = function() {
967
- r(new m("Network Error", m.ERR_NETWORK, e, u)), u = null;
968
- }, u.ontimeout = function() {
969
- let d = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded";
970
- const h = e.transitional || Ge;
971
- e.timeoutErrorMessage && (d = e.timeoutErrorMessage), r(new m(
972
- d,
973
- h.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
974
- e,
975
- u
976
- )), u = null;
977
- }, R.isStandardBrowserEnv) {
978
- const y = (e.withCredentials || cn(f)) && e.xsrfCookieName && sn.read(e.xsrfCookieName);
979
- y && i.set(e.xsrfHeaderName, y);
980
- }
981
- s === void 0 && i.setContentType(null), "setRequestHeader" in u && a.forEach(i.toJSON(), function(d, h) {
982
- u.setRequestHeader(h, d);
983
- }), a.isUndefined(e.withCredentials) || (u.withCredentials = !!e.withCredentials), o && o !== "json" && (u.responseType = e.responseType), typeof e.onDownloadProgress == "function" && u.addEventListener("progress", Ne(e.onDownloadProgress, !0)), typeof e.onUploadProgress == "function" && u.upload && u.upload.addEventListener("progress", Ne(e.onUploadProgress)), (e.cancelToken || e.signal) && (c = (y) => {
984
- u && (r(!y || y.type ? new k(null, e, u) : y), u.abort(), u = null);
985
- }, e.cancelToken && e.cancelToken.subscribe(c), e.signal && (e.signal.aborted ? c() : e.signal.addEventListener("abort", c)));
986
- const w = un(f);
987
- if (w && R.protocols.indexOf(w) === -1) {
988
- r(new m("Unsupported protocol " + w + ":", m.ERR_BAD_REQUEST, e));
1447
+ config2.cancelToken && config2.cancelToken.subscribe(onCanceled);
1448
+ if (config2.signal) {
1449
+ config2.signal.aborted ? onCanceled() : config2.signal.addEventListener("abort", onCanceled);
1450
+ }
1451
+ }
1452
+ const protocol = parseProtocol(fullPath);
1453
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
1454
+ reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config2));
989
1455
  return;
990
1456
  }
991
- u.send(s || null);
1457
+ request.send(requestData || null);
992
1458
  });
993
- }, J = {
994
- http: jt,
995
- xhr: dn
996
1459
  };
997
- a.forEach(J, (e, t) => {
998
- if (e) {
1460
+ const knownAdapters = {
1461
+ http: httpAdapter,
1462
+ xhr: xhrAdapter
1463
+ };
1464
+ utils.forEach(knownAdapters, (fn, value) => {
1465
+ if (fn) {
999
1466
  try {
1000
- Object.defineProperty(e, "name", { value: t });
1001
- } catch (n) {
1467
+ Object.defineProperty(fn, "name", { value });
1468
+ } catch (e) {
1002
1469
  }
1003
- Object.defineProperty(e, "adapterName", { value: t });
1470
+ Object.defineProperty(fn, "adapterName", { value });
1004
1471
  }
1005
1472
  });
1006
- const pn = {
1007
- getAdapter: (e) => {
1008
- e = a.isArray(e) ? e : [e];
1009
- const { length: t } = e;
1010
- let n, r;
1011
- for (let s = 0; s < t && (n = e[s], !(r = a.isString(n) ? J[n.toLowerCase()] : n)); s++)
1012
- ;
1013
- if (!r)
1014
- throw r === !1 ? new m(
1015
- `Adapter ${n} is not supported by the environment`,
1016
- "ERR_NOT_SUPPORT"
1017
- ) : new Error(
1018
- a.hasOwnProp(J, n) ? `Adapter '${n}' is not available in the build` : `Unknown adapter '${n}'`
1473
+ const adapters = {
1474
+ getAdapter: (adapters2) => {
1475
+ adapters2 = utils.isArray(adapters2) ? adapters2 : [adapters2];
1476
+ const { length } = adapters2;
1477
+ let nameOrAdapter;
1478
+ let adapter;
1479
+ for (let i = 0; i < length; i++) {
1480
+ nameOrAdapter = adapters2[i];
1481
+ if (adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter) {
1482
+ break;
1483
+ }
1484
+ }
1485
+ if (!adapter) {
1486
+ if (adapter === false) {
1487
+ throw new AxiosError(
1488
+ `Adapter ${nameOrAdapter} is not supported by the environment`,
1489
+ "ERR_NOT_SUPPORT"
1490
+ );
1491
+ }
1492
+ throw new Error(
1493
+ utils.hasOwnProp(knownAdapters, nameOrAdapter) ? `Adapter '${nameOrAdapter}' is not available in the build` : `Unknown adapter '${nameOrAdapter}'`
1019
1494
  );
1020
- if (!a.isFunction(r))
1495
+ }
1496
+ if (!utils.isFunction(adapter)) {
1021
1497
  throw new TypeError("adapter is not a function");
1022
- return r;
1498
+ }
1499
+ return adapter;
1023
1500
  },
1024
- adapters: J
1501
+ adapters: knownAdapters
1025
1502
  };
1026
- function ne(e) {
1027
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1028
- throw new k(null, e);
1503
+ function throwIfCancellationRequested(config2) {
1504
+ if (config2.cancelToken) {
1505
+ config2.cancelToken.throwIfRequested();
1506
+ }
1507
+ if (config2.signal && config2.signal.aborted) {
1508
+ throw new CanceledError(null, config2);
1509
+ }
1029
1510
  }
1030
- function Pe(e) {
1031
- return ne(e), e.headers = g.from(e.headers), e.data = te.call(
1032
- e,
1033
- e.transformRequest
1034
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), pn.getAdapter(e.adapter || de.adapter)(e).then(function(r) {
1035
- return ne(e), r.data = te.call(
1036
- e,
1037
- e.transformResponse,
1038
- r
1039
- ), r.headers = g.from(r.headers), r;
1040
- }, function(r) {
1041
- return ve(r) || (ne(e), r && r.response && (r.response.data = te.call(
1042
- e,
1043
- e.transformResponse,
1044
- r.response
1045
- ), r.response.headers = g.from(r.response.headers))), Promise.reject(r);
1511
+ function dispatchRequest(config2) {
1512
+ throwIfCancellationRequested(config2);
1513
+ config2.headers = AxiosHeaders.from(config2.headers);
1514
+ config2.data = transformData.call(
1515
+ config2,
1516
+ config2.transformRequest
1517
+ );
1518
+ if (["post", "put", "patch"].indexOf(config2.method) !== -1) {
1519
+ config2.headers.setContentType("application/x-www-form-urlencoded", false);
1520
+ }
1521
+ const adapter = adapters.getAdapter(config2.adapter || defaults.adapter);
1522
+ return adapter(config2).then(function onAdapterResolution(response) {
1523
+ throwIfCancellationRequested(config2);
1524
+ response.data = transformData.call(
1525
+ config2,
1526
+ config2.transformResponse,
1527
+ response
1528
+ );
1529
+ response.headers = AxiosHeaders.from(response.headers);
1530
+ return response;
1531
+ }, function onAdapterRejection(reason) {
1532
+ if (!isCancel(reason)) {
1533
+ throwIfCancellationRequested(config2);
1534
+ if (reason && reason.response) {
1535
+ reason.response.data = transformData.call(
1536
+ config2,
1537
+ config2.transformResponse,
1538
+ reason.response
1539
+ );
1540
+ reason.response.headers = AxiosHeaders.from(reason.response.headers);
1541
+ }
1542
+ }
1543
+ return Promise.reject(reason);
1046
1544
  });
1047
1545
  }
1048
- const xe = (e) => e instanceof g ? e.toJSON() : e;
1049
- function C(e, t) {
1050
- t = t || {};
1051
- const n = {};
1052
- function r(u, f, p) {
1053
- return a.isPlainObject(u) && a.isPlainObject(f) ? a.merge.call({ caseless: p }, u, f) : a.isPlainObject(f) ? a.merge({}, f) : a.isArray(f) ? f.slice() : f;
1054
- }
1055
- function s(u, f, p) {
1056
- if (a.isUndefined(f)) {
1057
- if (!a.isUndefined(u))
1058
- return r(void 0, u, p);
1059
- } else
1060
- return r(u, f, p);
1061
- }
1062
- function i(u, f) {
1063
- if (!a.isUndefined(f))
1064
- return r(void 0, f);
1065
- }
1066
- function o(u, f) {
1067
- if (a.isUndefined(f)) {
1068
- if (!a.isUndefined(u))
1069
- return r(void 0, u);
1070
- } else
1071
- return r(void 0, f);
1072
- }
1073
- function c(u, f, p) {
1074
- if (p in t)
1075
- return r(u, f);
1076
- if (p in e)
1077
- return r(void 0, u);
1078
- }
1079
- const l = {
1080
- url: i,
1081
- method: i,
1082
- data: i,
1083
- baseURL: o,
1084
- transformRequest: o,
1085
- transformResponse: o,
1086
- paramsSerializer: o,
1087
- timeout: o,
1088
- timeoutMessage: o,
1089
- withCredentials: o,
1090
- adapter: o,
1091
- responseType: o,
1092
- xsrfCookieName: o,
1093
- xsrfHeaderName: o,
1094
- onUploadProgress: o,
1095
- onDownloadProgress: o,
1096
- decompress: o,
1097
- maxContentLength: o,
1098
- maxBodyLength: o,
1099
- beforeRedirect: o,
1100
- transport: o,
1101
- httpAgent: o,
1102
- httpsAgent: o,
1103
- cancelToken: o,
1104
- socketPath: o,
1105
- responseEncoding: o,
1106
- validateStatus: c,
1107
- headers: (u, f) => s(xe(u), xe(f), !0)
1546
+ const headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;
1547
+ function mergeConfig(config1, config2) {
1548
+ config2 = config2 || {};
1549
+ const config3 = {};
1550
+ function getMergedValue(target, source, caseless) {
1551
+ if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
1552
+ return utils.merge.call({ caseless }, target, source);
1553
+ } else if (utils.isPlainObject(source)) {
1554
+ return utils.merge({}, source);
1555
+ } else if (utils.isArray(source)) {
1556
+ return source.slice();
1557
+ }
1558
+ return source;
1559
+ }
1560
+ function mergeDeepProperties(a, b, caseless) {
1561
+ if (!utils.isUndefined(b)) {
1562
+ return getMergedValue(a, b, caseless);
1563
+ } else if (!utils.isUndefined(a)) {
1564
+ return getMergedValue(void 0, a, caseless);
1565
+ }
1566
+ }
1567
+ function valueFromConfig2(a, b) {
1568
+ if (!utils.isUndefined(b)) {
1569
+ return getMergedValue(void 0, b);
1570
+ }
1571
+ }
1572
+ function defaultToConfig2(a, b) {
1573
+ if (!utils.isUndefined(b)) {
1574
+ return getMergedValue(void 0, b);
1575
+ } else if (!utils.isUndefined(a)) {
1576
+ return getMergedValue(void 0, a);
1577
+ }
1578
+ }
1579
+ function mergeDirectKeys(a, b, prop) {
1580
+ if (prop in config2) {
1581
+ return getMergedValue(a, b);
1582
+ } else if (prop in config1) {
1583
+ return getMergedValue(void 0, a);
1584
+ }
1585
+ }
1586
+ const mergeMap = {
1587
+ url: valueFromConfig2,
1588
+ method: valueFromConfig2,
1589
+ data: valueFromConfig2,
1590
+ baseURL: defaultToConfig2,
1591
+ transformRequest: defaultToConfig2,
1592
+ transformResponse: defaultToConfig2,
1593
+ paramsSerializer: defaultToConfig2,
1594
+ timeout: defaultToConfig2,
1595
+ timeoutMessage: defaultToConfig2,
1596
+ withCredentials: defaultToConfig2,
1597
+ adapter: defaultToConfig2,
1598
+ responseType: defaultToConfig2,
1599
+ xsrfCookieName: defaultToConfig2,
1600
+ xsrfHeaderName: defaultToConfig2,
1601
+ onUploadProgress: defaultToConfig2,
1602
+ onDownloadProgress: defaultToConfig2,
1603
+ decompress: defaultToConfig2,
1604
+ maxContentLength: defaultToConfig2,
1605
+ maxBodyLength: defaultToConfig2,
1606
+ beforeRedirect: defaultToConfig2,
1607
+ transport: defaultToConfig2,
1608
+ httpAgent: defaultToConfig2,
1609
+ httpsAgent: defaultToConfig2,
1610
+ cancelToken: defaultToConfig2,
1611
+ socketPath: defaultToConfig2,
1612
+ responseEncoding: defaultToConfig2,
1613
+ validateStatus: mergeDirectKeys,
1614
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
1108
1615
  };
1109
- return a.forEach(Object.keys(e).concat(Object.keys(t)), function(f) {
1110
- const p = l[f] || s, w = p(e[f], t[f], f);
1111
- a.isUndefined(w) && p !== c || (n[f] = w);
1112
- }), n;
1616
+ utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
1617
+ const merge2 = mergeMap[prop] || mergeDeepProperties;
1618
+ const configValue = merge2(config1[prop], config2[prop], prop);
1619
+ utils.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config3[prop] = configValue);
1620
+ });
1621
+ return config3;
1113
1622
  }
1114
- const We = "1.3.3", pe = {};
1115
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1116
- pe[e] = function(r) {
1117
- return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1623
+ const VERSION = "1.3.3";
1624
+ const validators$1 = {};
1625
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
1626
+ validators$1[type] = function validator2(thing) {
1627
+ return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
1118
1628
  };
1119
1629
  });
1120
- const Ce = {};
1121
- pe.transitional = function(t, n, r) {
1122
- function s(i, o) {
1123
- return "[Axios v" + We + "] Transitional option '" + i + "'" + o + (r ? ". " + r : "");
1124
- }
1125
- return (i, o, c) => {
1126
- if (t === !1)
1127
- throw new m(
1128
- s(o, " has been removed" + (n ? " in " + n : "")),
1129
- m.ERR_DEPRECATED
1630
+ const deprecatedWarnings = {};
1631
+ validators$1.transitional = function transitional(validator2, version, message) {
1632
+ function formatMessage(opt, desc) {
1633
+ return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
1634
+ }
1635
+ return (value, opt, opts) => {
1636
+ if (validator2 === false) {
1637
+ throw new AxiosError(
1638
+ formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
1639
+ AxiosError.ERR_DEPRECATED
1130
1640
  );
1131
- return n && !Ce[o] && (Ce[o] = !0, console.warn(
1132
- s(
1133
- o,
1134
- " has been deprecated since v" + n + " and will be removed in the near future"
1135
- )
1136
- )), t ? t(i, o, c) : !0;
1641
+ }
1642
+ if (version && !deprecatedWarnings[opt]) {
1643
+ deprecatedWarnings[opt] = true;
1644
+ console.warn(
1645
+ formatMessage(
1646
+ opt,
1647
+ " has been deprecated since v" + version + " and will be removed in the near future"
1648
+ )
1649
+ );
1650
+ }
1651
+ return validator2 ? validator2(value, opt, opts) : true;
1137
1652
  };
1138
1653
  };
1139
- function hn(e, t, n) {
1140
- if (typeof e != "object")
1141
- throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);
1142
- const r = Object.keys(e);
1143
- let s = r.length;
1144
- for (; s-- > 0; ) {
1145
- const i = r[s], o = t[i];
1146
- if (o) {
1147
- const c = e[i], l = c === void 0 || o(c, i, e);
1148
- if (l !== !0)
1149
- throw new m("option " + i + " must be " + l, m.ERR_BAD_OPTION_VALUE);
1654
+ function assertOptions(options, schema, allowUnknown) {
1655
+ if (typeof options !== "object") {
1656
+ throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
1657
+ }
1658
+ const keys = Object.keys(options);
1659
+ let i = keys.length;
1660
+ while (i-- > 0) {
1661
+ const opt = keys[i];
1662
+ const validator2 = schema[opt];
1663
+ if (validator2) {
1664
+ const value = options[opt];
1665
+ const result = value === void 0 || validator2(value, opt, options);
1666
+ if (result !== true) {
1667
+ throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE);
1668
+ }
1150
1669
  continue;
1151
1670
  }
1152
- if (n !== !0)
1153
- throw new m("Unknown option " + i, m.ERR_BAD_OPTION);
1671
+ if (allowUnknown !== true) {
1672
+ throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION);
1673
+ }
1154
1674
  }
1155
1675
  }
1156
- const oe = {
1157
- assertOptions: hn,
1158
- validators: pe
1159
- }, T = oe.validators;
1160
- class V {
1161
- constructor(t) {
1162
- this.defaults = t, this.interceptors = {
1163
- request: new Ae(),
1164
- response: new Ae()
1676
+ const validator = {
1677
+ assertOptions,
1678
+ validators: validators$1
1679
+ };
1680
+ const validators = validator.validators;
1681
+ class Axios {
1682
+ constructor(instanceConfig) {
1683
+ this.defaults = instanceConfig;
1684
+ this.interceptors = {
1685
+ request: new InterceptorManager(),
1686
+ response: new InterceptorManager()
1165
1687
  };
1166
1688
  }
1167
1689
  /**
@@ -1172,172 +1694,219 @@ class V {
1172
1694
  *
1173
1695
  * @returns {Promise} The Promise to be fulfilled
1174
1696
  */
1175
- request(t, n) {
1176
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = C(this.defaults, n);
1177
- const { transitional: r, paramsSerializer: s, headers: i } = n;
1178
- r !== void 0 && oe.assertOptions(r, {
1179
- silentJSONParsing: T.transitional(T.boolean),
1180
- forcedJSONParsing: T.transitional(T.boolean),
1181
- clarifyTimeoutError: T.transitional(T.boolean)
1182
- }, !1), s !== void 0 && oe.assertOptions(s, {
1183
- encode: T.function,
1184
- serialize: T.function
1185
- }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1186
- let o;
1187
- o = i && a.merge(
1188
- i.common,
1189
- i[n.method]
1190
- ), o && a.forEach(
1697
+ request(configOrUrl, config2) {
1698
+ if (typeof configOrUrl === "string") {
1699
+ config2 = config2 || {};
1700
+ config2.url = configOrUrl;
1701
+ } else {
1702
+ config2 = configOrUrl || {};
1703
+ }
1704
+ config2 = mergeConfig(this.defaults, config2);
1705
+ const { transitional: transitional2, paramsSerializer, headers } = config2;
1706
+ if (transitional2 !== void 0) {
1707
+ validator.assertOptions(transitional2, {
1708
+ silentJSONParsing: validators.transitional(validators.boolean),
1709
+ forcedJSONParsing: validators.transitional(validators.boolean),
1710
+ clarifyTimeoutError: validators.transitional(validators.boolean)
1711
+ }, false);
1712
+ }
1713
+ if (paramsSerializer !== void 0) {
1714
+ validator.assertOptions(paramsSerializer, {
1715
+ encode: validators.function,
1716
+ serialize: validators.function
1717
+ }, true);
1718
+ }
1719
+ config2.method = (config2.method || this.defaults.method || "get").toLowerCase();
1720
+ let contextHeaders;
1721
+ contextHeaders = headers && utils.merge(
1722
+ headers.common,
1723
+ headers[config2.method]
1724
+ );
1725
+ contextHeaders && utils.forEach(
1191
1726
  ["delete", "get", "head", "post", "put", "patch", "common"],
1192
- (d) => {
1193
- delete i[d];
1727
+ (method) => {
1728
+ delete headers[method];
1729
+ }
1730
+ );
1731
+ config2.headers = AxiosHeaders.concat(contextHeaders, headers);
1732
+ const requestInterceptorChain = [];
1733
+ let synchronousRequestInterceptors = true;
1734
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
1735
+ if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config2) === false) {
1736
+ return;
1194
1737
  }
1195
- ), n.headers = g.concat(o, i);
1196
- const c = [];
1197
- let l = !0;
1198
- this.interceptors.request.forEach(function(h) {
1199
- typeof h.runWhen == "function" && h.runWhen(n) === !1 || (l = l && h.synchronous, c.unshift(h.fulfilled, h.rejected));
1738
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
1739
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
1200
1740
  });
1201
- const u = [];
1202
- this.interceptors.response.forEach(function(h) {
1203
- u.push(h.fulfilled, h.rejected);
1741
+ const responseInterceptorChain = [];
1742
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
1743
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
1204
1744
  });
1205
- let f, p = 0, w;
1206
- if (!l) {
1207
- const d = [Pe.bind(this), void 0];
1208
- for (d.unshift.apply(d, c), d.push.apply(d, u), w = d.length, f = Promise.resolve(n); p < w; )
1209
- f = f.then(d[p++], d[p++]);
1210
- return f;
1211
- }
1212
- w = c.length;
1213
- let y = n;
1214
- for (p = 0; p < w; ) {
1215
- const d = c[p++], h = c[p++];
1745
+ let promise;
1746
+ let i = 0;
1747
+ let len;
1748
+ if (!synchronousRequestInterceptors) {
1749
+ const chain = [dispatchRequest.bind(this), void 0];
1750
+ chain.unshift.apply(chain, requestInterceptorChain);
1751
+ chain.push.apply(chain, responseInterceptorChain);
1752
+ len = chain.length;
1753
+ promise = Promise.resolve(config2);
1754
+ while (i < len) {
1755
+ promise = promise.then(chain[i++], chain[i++]);
1756
+ }
1757
+ return promise;
1758
+ }
1759
+ len = requestInterceptorChain.length;
1760
+ let newConfig = config2;
1761
+ i = 0;
1762
+ while (i < len) {
1763
+ const onFulfilled = requestInterceptorChain[i++];
1764
+ const onRejected = requestInterceptorChain[i++];
1216
1765
  try {
1217
- y = d(y);
1218
- } catch (O) {
1219
- h.call(this, O);
1766
+ newConfig = onFulfilled(newConfig);
1767
+ } catch (error) {
1768
+ onRejected.call(this, error);
1220
1769
  break;
1221
1770
  }
1222
1771
  }
1223
1772
  try {
1224
- f = Pe.call(this, y);
1225
- } catch (d) {
1226
- return Promise.reject(d);
1773
+ promise = dispatchRequest.call(this, newConfig);
1774
+ } catch (error) {
1775
+ return Promise.reject(error);
1776
+ }
1777
+ i = 0;
1778
+ len = responseInterceptorChain.length;
1779
+ while (i < len) {
1780
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
1227
1781
  }
1228
- for (p = 0, w = u.length; p < w; )
1229
- f = f.then(u[p++], u[p++]);
1230
- return f;
1782
+ return promise;
1231
1783
  }
1232
- getUri(t) {
1233
- t = C(this.defaults, t);
1234
- const n = Ke(t.baseURL, t.url);
1235
- return Ve(n, t.params, t.paramsSerializer);
1784
+ getUri(config2) {
1785
+ config2 = mergeConfig(this.defaults, config2);
1786
+ const fullPath = buildFullPath(config2.baseURL, config2.url);
1787
+ return buildURL(fullPath, config2.params, config2.paramsSerializer);
1236
1788
  }
1237
1789
  }
1238
- a.forEach(["delete", "get", "head", "options"], function(t) {
1239
- V.prototype[t] = function(n, r) {
1240
- return this.request(C(r || {}, {
1241
- method: t,
1242
- url: n,
1243
- data: (r || {}).data
1790
+ utils.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
1791
+ Axios.prototype[method] = function(url, config2) {
1792
+ return this.request(mergeConfig(config2 || {}, {
1793
+ method,
1794
+ url,
1795
+ data: (config2 || {}).data
1244
1796
  }));
1245
1797
  };
1246
1798
  });
1247
- a.forEach(["post", "put", "patch"], function(t) {
1248
- function n(r) {
1249
- return function(i, o, c) {
1250
- return this.request(C(c || {}, {
1251
- method: t,
1252
- headers: r ? {
1799
+ utils.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
1800
+ function generateHTTPMethod(isForm) {
1801
+ return function httpMethod(url, data, config2) {
1802
+ return this.request(mergeConfig(config2 || {}, {
1803
+ method,
1804
+ headers: isForm ? {
1253
1805
  "Content-Type": "multipart/form-data"
1254
1806
  } : {},
1255
- url: i,
1256
- data: o
1807
+ url,
1808
+ data
1257
1809
  }));
1258
1810
  };
1259
1811
  }
1260
- V.prototype[t] = n(), V.prototype[t + "Form"] = n(!0);
1812
+ Axios.prototype[method] = generateHTTPMethod();
1813
+ Axios.prototype[method + "Form"] = generateHTTPMethod(true);
1261
1814
  });
1262
- const z = V;
1263
- class he {
1264
- constructor(t) {
1265
- if (typeof t != "function")
1815
+ class CancelToken {
1816
+ constructor(executor) {
1817
+ if (typeof executor !== "function") {
1266
1818
  throw new TypeError("executor must be a function.");
1267
- let n;
1268
- this.promise = new Promise(function(i) {
1269
- n = i;
1819
+ }
1820
+ let resolvePromise;
1821
+ this.promise = new Promise(function promiseExecutor(resolve) {
1822
+ resolvePromise = resolve;
1823
+ });
1824
+ const token = this;
1825
+ this.promise.then((cancel) => {
1826
+ if (!token._listeners) return;
1827
+ let i = token._listeners.length;
1828
+ while (i-- > 0) {
1829
+ token._listeners[i](cancel);
1830
+ }
1831
+ token._listeners = null;
1270
1832
  });
1271
- const r = this;
1272
- this.promise.then((s) => {
1273
- if (!r._listeners)
1833
+ this.promise.then = (onfulfilled) => {
1834
+ let _resolve;
1835
+ const promise = new Promise((resolve) => {
1836
+ token.subscribe(resolve);
1837
+ _resolve = resolve;
1838
+ }).then(onfulfilled);
1839
+ promise.cancel = function reject() {
1840
+ token.unsubscribe(_resolve);
1841
+ };
1842
+ return promise;
1843
+ };
1844
+ executor(function cancel(message, config2, request) {
1845
+ if (token.reason) {
1274
1846
  return;
1275
- let i = r._listeners.length;
1276
- for (; i-- > 0; )
1277
- r._listeners[i](s);
1278
- r._listeners = null;
1279
- }), this.promise.then = (s) => {
1280
- let i;
1281
- const o = new Promise((c) => {
1282
- r.subscribe(c), i = c;
1283
- }).then(s);
1284
- return o.cancel = function() {
1285
- r.unsubscribe(i);
1286
- }, o;
1287
- }, t(function(i, o, c) {
1288
- r.reason || (r.reason = new k(i, o, c), n(r.reason));
1847
+ }
1848
+ token.reason = new CanceledError(message, config2, request);
1849
+ resolvePromise(token.reason);
1289
1850
  });
1290
1851
  }
1291
1852
  /**
1292
1853
  * Throws a `CanceledError` if cancellation has been requested.
1293
1854
  */
1294
1855
  throwIfRequested() {
1295
- if (this.reason)
1856
+ if (this.reason) {
1296
1857
  throw this.reason;
1858
+ }
1297
1859
  }
1298
1860
  /**
1299
1861
  * Subscribe to the cancel signal
1300
1862
  */
1301
- subscribe(t) {
1863
+ subscribe(listener) {
1302
1864
  if (this.reason) {
1303
- t(this.reason);
1865
+ listener(this.reason);
1304
1866
  return;
1305
1867
  }
1306
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
1868
+ if (this._listeners) {
1869
+ this._listeners.push(listener);
1870
+ } else {
1871
+ this._listeners = [listener];
1872
+ }
1307
1873
  }
1308
1874
  /**
1309
1875
  * Unsubscribe from the cancel signal
1310
1876
  */
1311
- unsubscribe(t) {
1312
- if (!this._listeners)
1877
+ unsubscribe(listener) {
1878
+ if (!this._listeners) {
1313
1879
  return;
1314
- const n = this._listeners.indexOf(t);
1315
- n !== -1 && this._listeners.splice(n, 1);
1880
+ }
1881
+ const index2 = this._listeners.indexOf(listener);
1882
+ if (index2 !== -1) {
1883
+ this._listeners.splice(index2, 1);
1884
+ }
1316
1885
  }
1317
1886
  /**
1318
1887
  * Returns an object that contains a new `CancelToken` and a function that, when called,
1319
1888
  * cancels the `CancelToken`.
1320
1889
  */
1321
1890
  static source() {
1322
- let t;
1891
+ let cancel;
1892
+ const token = new CancelToken(function executor(c) {
1893
+ cancel = c;
1894
+ });
1323
1895
  return {
1324
- token: new he(function(s) {
1325
- t = s;
1326
- }),
1327
- cancel: t
1896
+ token,
1897
+ cancel
1328
1898
  };
1329
1899
  }
1330
1900
  }
1331
- const mn = he;
1332
- function yn(e) {
1333
- return function(n) {
1334
- return e.apply(null, n);
1901
+ function spread(callback) {
1902
+ return function wrap(arr) {
1903
+ return callback.apply(null, arr);
1335
1904
  };
1336
1905
  }
1337
- function En(e) {
1338
- return a.isObject(e) && e.isAxiosError === !0;
1906
+ function isAxiosError(payload) {
1907
+ return utils.isObject(payload) && payload.isAxiosError === true;
1339
1908
  }
1340
- const ie = {
1909
+ const HttpStatusCode = {
1341
1910
  Continue: 100,
1342
1911
  SwitchingProtocols: 101,
1343
1912
  Processing: 102,
@@ -1402,233 +1971,348 @@ const ie = {
1402
1971
  NotExtended: 510,
1403
1972
  NetworkAuthenticationRequired: 511
1404
1973
  };
1405
- Object.entries(ie).forEach(([e, t]) => {
1406
- ie[t] = e;
1974
+ Object.entries(HttpStatusCode).forEach(([key, value]) => {
1975
+ HttpStatusCode[value] = key;
1407
1976
  });
1408
- const wn = ie;
1409
- function Xe(e) {
1410
- const t = new z(e), n = Ue(z.prototype.request, t);
1411
- return a.extend(n, z.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
1412
- return Xe(C(e, s));
1413
- }, n;
1977
+ function createInstance(defaultConfig) {
1978
+ const context = new Axios(defaultConfig);
1979
+ const instance = bind(Axios.prototype.request, context);
1980
+ utils.extend(instance, Axios.prototype, context, { allOwnKeys: true });
1981
+ utils.extend(instance, context, null, { allOwnKeys: true });
1982
+ instance.create = function create(instanceConfig) {
1983
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
1984
+ };
1985
+ return instance;
1414
1986
  }
1415
- const E = Xe(de);
1416
- E.Axios = z;
1417
- E.CanceledError = k;
1418
- E.CancelToken = mn;
1419
- E.isCancel = ve;
1420
- E.VERSION = We;
1421
- E.toFormData = $;
1422
- E.AxiosError = m;
1423
- E.Cancel = E.CanceledError;
1424
- E.all = function(t) {
1425
- return Promise.all(t);
1987
+ const axios = createInstance(defaults);
1988
+ axios.Axios = Axios;
1989
+ axios.CanceledError = CanceledError;
1990
+ axios.CancelToken = CancelToken;
1991
+ axios.isCancel = isCancel;
1992
+ axios.VERSION = VERSION;
1993
+ axios.toFormData = toFormData;
1994
+ axios.AxiosError = AxiosError;
1995
+ axios.Cancel = axios.CanceledError;
1996
+ axios.all = function all(promises) {
1997
+ return Promise.all(promises);
1426
1998
  };
1427
- E.spread = yn;
1428
- E.isAxiosError = En;
1429
- E.mergeConfig = C;
1430
- E.AxiosHeaders = g;
1431
- E.formToJSON = (e) => $e(a.isHTMLForm(e) ? new FormData(e) : e);
1432
- E.HttpStatusCode = wn;
1433
- E.default = E;
1434
- const Sn = {
1999
+ axios.spread = spread;
2000
+ axios.isAxiosError = isAxiosError;
2001
+ axios.mergeConfig = mergeConfig;
2002
+ axios.AxiosHeaders = AxiosHeaders;
2003
+ axios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
2004
+ axios.HttpStatusCode = HttpStatusCode;
2005
+ axios.default = axios;
2006
+ const ttc = {
1435
2007
  LOGIN_URL: `${window.location.origin}/ttc/cloud/#/login`,
1436
2008
  HOME_URL: `${window.location.origin}/ttc/cloud/#/cloud`,
1437
- INTEGRATED_BASE_URL: "/gateway/integrated-management/api/v1"
1438
- }, Qe = {
1439
- ttc: Sn
1440
- }, In = "THEME", jn = "LANG", bn = (e = "ttc") => Ee.get(`${Qe[e].INTEGRATED_BASE_URL}/account/auth/route/list`), Rn = (e = "ttc") => Ee.get(`${Qe[e].INTEGRATED_BASE_URL}/account/home/menu`), me = (e = "ttc") => {
1441
- ye({ token: "" });
1442
- }, W = (e = "ttc") => {
1443
- var s;
1444
- const t = `${e}GlobalState`, n = (s = localStorage.getItem(t)) != null ? s : "{}";
1445
- return JSON.parse(n) ? JSON.parse(n).token : null;
1446
- }, Ye = (r, ...s) => M(void 0, [r, ...s], function* ({ userName: e, password: t }, n = "ttc") {
1447
- const i = I("loginApiUrl"), { data: o } = yield Ee.post(i, { userName: e, password: t });
1448
- o.tokenValue && S.success("登录成功"), ye({ token: o.tokenValue, userInfo: o });
1449
- }), On = (e = "ttc") => {
1450
- var s;
1451
- const t = `${e}GlobalState`, n = (s = localStorage.getItem(t)) != null ? s : "{}";
1452
- return JSON.parse(n) ? JSON.parse(n).userInfo : null;
1453
- }, gn = () => M(void 0, null, function* () {
1454
- return W() ? yield Rn() : [];
1455
- }), X = () => {
1456
- if (et()) {
1457
- me();
1458
- const e = location.pathname;
1459
- if (console.log("跳转至登录页", e, e.includes(x())), e.includes(x()))
2009
+ INTEGRATED_BASE_URL: `/gateway/integrated-management/api/v1`
2010
+ };
2011
+ const URL = {
2012
+ ttc
2013
+ };
2014
+ const BC_THEME_NAME = "THEME";
2015
+ const BC_LANG_NAME = "LANG";
2016
+ const getAuthRouteList = (systemName = "ttc") => {
2017
+ return http.get(`${URL[systemName].INTEGRATED_BASE_URL}/account/auth/route/list`);
2018
+ };
2019
+ const getHomeMenuList = (systemName = "ttc") => {
2020
+ return http.get(`${URL[systemName].INTEGRATED_BASE_URL}/account/home/menu`);
2021
+ };
2022
+ const removeToken = (systemName = "ttc") => {
2023
+ setSystemConfig({ token: "" });
2024
+ };
2025
+ const getToken = (systemName = "ttc") => {
2026
+ var _a;
2027
+ const GlobalStateKey = `${systemName}GlobalState`;
2028
+ const GlobalState = (_a = localStorage.getItem(GlobalStateKey)) != null ? _a : "{}";
2029
+ const token = JSON.parse(GlobalState) ? JSON.parse(GlobalState).token : null;
2030
+ return token;
2031
+ };
2032
+ const autoLogin = (_0, ..._1) => __async(void 0, [_0, ..._1], function* ({ userName, password }, systemName = "ttc") {
2033
+ const loginApiUrl = getSystemConfig("loginApiUrl");
2034
+ const { data } = yield http.post(loginApiUrl, { userName, password });
2035
+ if (data.tokenValue) {
2036
+ ElMessage.success("登录成功");
2037
+ }
2038
+ setSystemConfig({ token: data.tokenValue, userInfo: data });
2039
+ });
2040
+ const getUserInfo = (systemName = "ttc") => {
2041
+ var _a;
2042
+ const GlobalStateKey = `${systemName}GlobalState`;
2043
+ const GlobalState = (_a = localStorage.getItem(GlobalStateKey)) != null ? _a : "{}";
2044
+ const userInfo = JSON.parse(GlobalState) ? JSON.parse(GlobalState).userInfo : null;
2045
+ return userInfo;
2046
+ };
2047
+ const getUserRouteList = () => __async(void 0, null, function* () {
2048
+ if (!getToken()) return [];
2049
+ const data = yield getHomeMenuList();
2050
+ return data;
2051
+ });
2052
+ const jumpToLogin = () => {
2053
+ if (isProduction()) {
2054
+ removeToken();
2055
+ const curRoute = location.pathname;
2056
+ console.log("跳转至登录页", curRoute, curRoute.includes(getLoginUrl()));
2057
+ if (curRoute.includes(getLoginUrl())) {
1460
2058
  return;
1461
- console.log("跳转至登录页", x()), location.replace(x());
2059
+ } else {
2060
+ console.log("跳转至登录页", getLoginUrl());
2061
+ location.replace(getLoginUrl());
2062
+ }
1462
2063
  } else {
1463
2064
  console.log("开发环境!!!");
1464
- const e = window.prompt("当前系统处于开发环境,当前登录过期,请输入登录账号", "");
1465
- if (e !== null) {
1466
- const t = window.prompt("请输入登录密码", "");
1467
- (t === null || t == "") && window.prompt("请输入登录密码", ""), Ye({ userName: e, password: t });
1468
- }
1469
- }
1470
- }, An = () => {
1471
- window.location.replace(Ze());
1472
- }, x = () => I("loginUrl"), Ze = () => I("homeUrl"), ye = (e) => {
1473
- var r;
1474
- const t = (r = localStorage.getItem("ttcGlobalState")) != null ? r : "{}", n = U(U({}, JSON.parse(t)), e);
1475
- localStorage.setItem("ttcGlobalState", JSON.stringify(n));
1476
- }, I = (e) => {
1477
- var n, r;
1478
- return (r = JSON.parse((n = localStorage.getItem("ttcGlobalState")) != null ? n : "{}")[e]) != null ? r : "";
1479
- }, et = () => I("environment") === "production", Tn = (e, t = !0, n) => M(void 0, null, function* () {
1480
- if (!W() && t)
1481
- return X();
2065
+ const userName = window.prompt("当前系统处于开发环境,当前登录过期,请输入登录账号", "");
2066
+ if (userName !== null) {
2067
+ const password = window.prompt("请输入登录密码", "");
2068
+ if (password === null || password == "") window.prompt("请输入登录密码", "");
2069
+ autoLogin({ userName, password });
2070
+ }
2071
+ }
2072
+ };
2073
+ const jumpToHome = () => {
2074
+ window.location.replace(getHomeUrl());
2075
+ };
2076
+ const getLoginUrl = () => {
2077
+ return getSystemConfig("loginUrl");
2078
+ };
2079
+ const getHomeUrl = () => {
2080
+ return getSystemConfig("homeUrl");
2081
+ };
2082
+ const setSystemConfig = (config2) => {
2083
+ var _a;
2084
+ const GlobalState = (_a = localStorage.getItem("ttcGlobalState")) != null ? _a : "{}";
2085
+ const newGlobalState = __spreadValues(__spreadValues({}, JSON.parse(GlobalState)), config2);
2086
+ localStorage.setItem("ttcGlobalState", JSON.stringify(newGlobalState));
2087
+ };
2088
+ const getSystemConfig = (key) => {
2089
+ var _a, _b;
2090
+ const GlobalState = JSON.parse((_a = localStorage.getItem("ttcGlobalState")) != null ? _a : "{}");
2091
+ return (_b = GlobalState[key]) != null ? _b : "";
2092
+ };
2093
+ const isProduction = () => {
2094
+ return getSystemConfig("environment") === "production";
2095
+ };
2096
+ const getUserPermissions = (systemName, isJumpLogin = true, serverName) => __async(void 0, null, function* () {
2097
+ if (!getToken() && isJumpLogin) return jumpToLogin();
1482
2098
  try {
1483
- const { data: r } = yield bn(n), s = r.filter((c) => c.routeTag.includes(e)), i = s.filter((c) => c.routeType === "VIEW"), o = s.filter((c) => c.routeType === "BTN");
1484
- return sessionStorage.setItem("ttcUserBtnList", JSON.stringify(o.map((c) => c.routeTag))), {
1485
- userMenuList: i,
1486
- userBtnList: o
2099
+ const { data } = yield getAuthRouteList(serverName);
2100
+ const systemPermissionList = data.filter((route) => route.routeTag.includes(systemName));
2101
+ const userMenuList = systemPermissionList.filter((item) => item.routeType === "VIEW");
2102
+ const userBtnList = systemPermissionList.filter((item) => item.routeType === "BTN");
2103
+ sessionStorage.setItem("ttcUserBtnList", JSON.stringify(userBtnList.map((item) => item.routeTag)));
2104
+ return {
2105
+ userMenuList,
2106
+ userBtnList
1487
2107
  };
1488
- } catch (r) {
1489
- }
1490
- }), Nn = (e, t, n) => {
1491
- let r = [];
1492
- return e.forEach((s) => {
1493
- const i = `/src/views${s.routeView}/config.ts`, o = `/src/views${s.routeView}/index.vue`;
1494
- if (t[o] && n[i]) {
1495
- const c = n[i], l = {
1496
- path: s.routeView,
1497
- name: s.routeView.split("/")[1],
2108
+ } catch (err) {
2109
+ }
2110
+ });
2111
+ const getUserRouter = (userMenuList, viewModules, viewConfig) => {
2112
+ let menuList = [];
2113
+ userMenuList.forEach((item) => {
2114
+ const configKey = `/src/views${item.routeView}/config.ts`;
2115
+ const viewKey = `/src/views${item.routeView}/index.vue`;
2116
+ if (viewModules[viewKey] && viewConfig[configKey]) {
2117
+ const pageConfig = viewConfig[configKey];
2118
+ const routerObject = {
2119
+ path: item.routeView,
2120
+ name: item.routeView.split("/")[1],
1498
2121
  meta: {
1499
- title: c.title,
1500
- icon: c.icon
2122
+ title: pageConfig.title,
2123
+ icon: pageConfig.icon
1501
2124
  },
1502
- component: t[o]
2125
+ component: viewModules[viewKey]
1503
2126
  };
1504
- r.push(l);
1505
- }
1506
- }), r;
1507
- }, Pn = (e) => {
1508
- var n;
1509
- if (!e)
1510
- return !1;
1511
- const t = (n = sessionStorage.getItem("ttcUserBtnList")) != null ? n : "[]";
1512
- return JSON.parse(t).includes(e);
1513
- }, Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2127
+ menuList.push(routerObject);
2128
+ }
2129
+ });
2130
+ return menuList;
2131
+ };
2132
+ const getUserIsHaveBtnPower = (routeTag) => {
2133
+ var _a;
2134
+ if (!routeTag) return false;
2135
+ const authButtonListGet = (_a = sessionStorage.getItem("ttcUserBtnList")) != null ? _a : "[]";
2136
+ return JSON.parse(authButtonListGet).includes(routeTag);
2137
+ };
2138
+ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1514
2139
  __proto__: null,
1515
- autoLogin: Ye,
1516
- getHomeUrl: Ze,
1517
- getLoginUrl: x,
1518
- getSystemConfig: I,
1519
- getToken: W,
1520
- getUserInfo: On,
1521
- getUserIsHaveBtnPower: Pn,
1522
- getUserPermissions: Tn,
1523
- getUserRouteList: gn,
1524
- getUserRouter: Nn,
1525
- isProduction: et,
1526
- jumpToHome: An,
1527
- jumpToLogin: X,
1528
- removeToken: me,
1529
- setSystemConfig: ye
2140
+ autoLogin,
2141
+ getHomeUrl,
2142
+ getLoginUrl,
2143
+ getSystemConfig,
2144
+ getToken,
2145
+ getUserInfo,
2146
+ getUserIsHaveBtnPower,
2147
+ getUserPermissions,
2148
+ getUserRouteList,
2149
+ getUserRouter,
2150
+ isProduction,
2151
+ jumpToHome,
2152
+ jumpToLogin,
2153
+ removeToken,
2154
+ setSystemConfig
1530
2155
  }, Symbol.toStringTag, { value: "Module" }));
1531
- let tt;
1532
- const xn = {
1533
- lock: !0,
2156
+ let loadingInstance;
2157
+ const loadingOptions = {
2158
+ lock: true,
1534
2159
  text: "加载中...",
1535
- fullscreen: !0,
2160
+ fullscreen: true,
1536
2161
  background: "rgba(0, 0, 0, 0.6)"
1537
- }, Cn = () => {
1538
- tt = it.service(xn);
1539
- }, Ln = () => {
1540
- tt.close();
1541
2162
  };
1542
- let B = 0;
1543
- const Un = () => {
1544
- B === 0 && Cn(), B++;
1545
- }, Le = () => {
1546
- B <= 0 || (B--, B === 0 && Ln());
2163
+ const startLoading = () => {
2164
+ loadingInstance = ElLoading.service(loadingOptions);
2165
+ };
2166
+ const endLoading = () => {
2167
+ loadingInstance.close();
2168
+ };
2169
+ let needLoadingRequestCount = 0;
2170
+ const showFullScreenLoading = () => {
2171
+ if (needLoadingRequestCount === 0) {
2172
+ startLoading();
2173
+ }
2174
+ needLoadingRequestCount++;
2175
+ };
2176
+ const hideFullScreenLoading = () => {
2177
+ if (needLoadingRequestCount <= 0) return;
2178
+ needLoadingRequestCount--;
2179
+ if (needLoadingRequestCount === 0) {
2180
+ endLoading();
2181
+ }
1547
2182
  };
1548
- var ae = /* @__PURE__ */ ((e) => (e[e.SUCCESS = 200] = "SUCCESS", e[e.ERROR = 500] = "ERROR", e[e.OVERDUE = 401] = "OVERDUE", e[e.TIMEOUT = 3e4] = "TIMEOUT", e))(ae || {});
1549
- const _n = {
2183
+ var ResultEnum = /* @__PURE__ */ ((ResultEnum2) => {
2184
+ ResultEnum2[ResultEnum2["SUCCESS"] = 200] = "SUCCESS";
2185
+ ResultEnum2[ResultEnum2["ERROR"] = 500] = "ERROR";
2186
+ ResultEnum2[ResultEnum2["OVERDUE"] = 401] = "OVERDUE";
2187
+ ResultEnum2[ResultEnum2["TIMEOUT"] = 3e4] = "TIMEOUT";
2188
+ return ResultEnum2;
2189
+ })(ResultEnum || {});
2190
+ const config = {
1550
2191
  // 默认地址请求地址,可在 .env.*** 文件中修改
1551
2192
  // 设置超时时间(30s)
1552
2193
  timeout: 3e4,
1553
2194
  // 跨域时候允许携带凭证
1554
- withCredentials: !0
1555
- }, Bn = (e, t) => {
1556
- switch (e) {
2195
+ withCredentials: true
2196
+ };
2197
+ const checkStatus = (status, msg) => {
2198
+ switch (status) {
1557
2199
  case 400:
1558
- S.error(t || "请求失败!请您稍后重试");
2200
+ ElMessage.error("请求失败!请您稍后重试");
1559
2201
  break;
1560
2202
  case 401:
1561
- location.href.includes(x()) || (S.error(t || "登录失效!请您重新登录"), X());
2203
+ if (!location.href.includes(getLoginUrl())) {
2204
+ ElMessage.error("登录失效!请您重新登录");
2205
+ jumpToLogin();
2206
+ }
1562
2207
  break;
1563
2208
  case 403:
1564
- S.error(t || "当前账号无权限访问!");
2209
+ ElMessage.error("当前账号无权限访问!");
1565
2210
  break;
1566
2211
  case 404:
1567
- S.error("你所访问的资源不存在!");
2212
+ ElMessage.error("你所访问的资源不存在!");
1568
2213
  break;
1569
2214
  case 405:
1570
- S.error(t || "请求方式错误!请您稍后重试");
2215
+ ElMessage.error("请求方式错误!请您稍后重试");
1571
2216
  break;
1572
2217
  case 408:
1573
- S.error(t || "请求超时!请您稍后重试");
2218
+ ElMessage.error("请求超时!请您稍后重试");
1574
2219
  break;
1575
2220
  case 500:
1576
- S.error(t || "服务异常!");
2221
+ ElMessage.error("服务异常!");
1577
2222
  break;
1578
2223
  case 502:
1579
- S.error("网关错误!");
2224
+ ElMessage.error("网关错误!");
1580
2225
  break;
1581
2226
  case 503:
1582
- S.error("服务不可用!");
2227
+ ElMessage.error("服务不可用!");
1583
2228
  break;
1584
2229
  case 504:
1585
- S.error("网关超时!");
2230
+ ElMessage.error("网关超时!");
1586
2231
  break;
1587
2232
  default:
1588
- S.error("请求失败!");
2233
+ ElMessage.error("请求失败!");
1589
2234
  }
1590
2235
  };
1591
- class Fn {
1592
- constructor(t) {
1593
- Y(this, "service");
2236
+ class YxHttp {
2237
+ constructor(config2) {
2238
+ __publicField(this, "service");
1594
2239
  /** 自定义响应处理map */
1595
- Y(this, "customResMap");
1596
- this.service = E.create(t), this.setupInterceptors(), this.customResMap = {};
2240
+ __publicField(this, "customResMap");
2241
+ this.service = axios.create(config2);
2242
+ this.setupInterceptors();
2243
+ this.customResMap = {};
1597
2244
  }
1598
2245
  setupInterceptors() {
1599
2246
  this.service.interceptors.request.use(
1600
- (t) => {
1601
- var n;
1602
- return (n = t.headers) != null && n.noLoading || Un(), t.headers.token = W(), t != null && t.customResHandler && (t != null && t.url) && (this.customResMap[t == null ? void 0 : t.url] = t.customResHandler), t;
2247
+ (config2) => {
2248
+ var _a;
2249
+ if (!((_a = config2.headers) == null ? void 0 : _a.noLoading)) {
2250
+ showFullScreenLoading();
2251
+ }
2252
+ config2.headers.token = getToken();
2253
+ if ((config2 == null ? void 0 : config2.customResHandler) && (config2 == null ? void 0 : config2.url)) {
2254
+ this.customResMap[config2 == null ? void 0 : config2.url] = config2.customResHandler;
2255
+ }
2256
+ return config2;
1603
2257
  },
1604
- (t) => Promise.reject(t)
1605
- ), this.service.interceptors.response.use(
1606
- (t) => {
1607
- const { data: n, config: r } = t;
1608
- return Le(), r.url && this.customResMap[r.url] ? this.customResMap[r.url](n) : (n.code == ae.OVERDUE ? this.handleOverdueResponse(n) : n.code !== ae.SUCCESS && this.handleErrorResponse(n), n);
2258
+ (error) => {
2259
+ return Promise.reject(error);
2260
+ }
2261
+ );
2262
+ this.service.interceptors.response.use(
2263
+ (response) => {
2264
+ const { data, config: config2 } = response;
2265
+ hideFullScreenLoading();
2266
+ if (config2.url && this.customResMap[config2.url]) {
2267
+ return this.customResMap[config2.url](data);
2268
+ }
2269
+ if (data.code == ResultEnum.OVERDUE) {
2270
+ this.handleOverdueResponse(data);
2271
+ } else if (data.code !== ResultEnum.SUCCESS) {
2272
+ this.handleErrorResponse(data);
2273
+ }
2274
+ return data;
1609
2275
  },
1610
- (t) => {
1611
- Le();
1612
- const { config: n } = t;
1613
- return n != null && n.url && this.customResMap[n.url] && this.customResMap[n.url](t.response), t.message.includes("timeout") ? S.error("请求超时!请稍后重试") : t.message.includes("Network Error") && S.error("网络错误!请稍后重试"), t.response && Bn(t.response.status), window.navigator.onLine || Se({
1614
- title: "提示",
1615
- message: "当前网络似乎开小差了",
1616
- type: "warning",
1617
- duration: 5e3
1618
- }), Promise.reject(t);
2276
+ (error) => {
2277
+ hideFullScreenLoading();
2278
+ const { config: config2 } = error;
2279
+ if ((config2 == null ? void 0 : config2.url) && this.customResMap[config2.url]) {
2280
+ this.customResMap[config2.url](error.response);
2281
+ }
2282
+ if (error.message.includes("timeout")) {
2283
+ ElMessage.error("请求超时!请稍后重试");
2284
+ } else if (error.message.includes("Network Error")) {
2285
+ ElMessage.error("网络错误!请稍后重试");
2286
+ }
2287
+ if (error.response) {
2288
+ checkStatus(error.response.status);
2289
+ }
2290
+ if (!window.navigator.onLine) {
2291
+ ElNotification({
2292
+ title: "提示",
2293
+ message: "当前网络似乎开小差了",
2294
+ type: "warning",
2295
+ duration: 5e3
2296
+ });
2297
+ }
2298
+ return Promise.reject(error);
1619
2299
  }
1620
2300
  );
1621
2301
  }
1622
- handleOverdueResponse(t) {
1623
- return me(), X(), Se({
2302
+ handleOverdueResponse(data) {
2303
+ removeToken();
2304
+ jumpToLogin();
2305
+ ElNotification({
1624
2306
  title: "登录过期提醒",
1625
- message: t.resultMsg || "当前登录失效",
2307
+ message: data.resultMsg || "当前登录失效",
1626
2308
  type: "warning",
1627
2309
  duration: 5e3
1628
- }), Promise.reject(t);
2310
+ });
2311
+ return Promise.reject(data);
1629
2312
  }
1630
- handleErrorResponse(t) {
1631
- return S.error(t.resultMsg), Promise.reject(t);
2313
+ handleErrorResponse(data) {
2314
+ ElMessage.error(data.resultMsg);
2315
+ return Promise.reject(data);
1632
2316
  }
1633
2317
  /**
1634
2318
  *
@@ -1637,8 +2321,8 @@ class Fn {
1637
2321
  * @param options : AxiosRequestConfig
1638
2322
  * @description get 请求
1639
2323
  */
1640
- get(t, n, r = {}) {
1641
- return this.service.get(t, U({ params: n }, r));
2324
+ get(url, params, options = {}) {
2325
+ return this.service.get(url, __spreadValues({ params }, options));
1642
2326
  }
1643
2327
  /**
1644
2328
  *
@@ -1647,8 +2331,8 @@ class Fn {
1647
2331
  * @param options : AxiosRequestConfig
1648
2332
  * @description post 请求
1649
2333
  */
1650
- post(t, n, r = {}) {
1651
- return this.service.post(t, n, r);
2334
+ post(url, params, options = {}) {
2335
+ return this.service.post(url, params, options);
1652
2336
  }
1653
2337
  /**
1654
2338
  *
@@ -1656,8 +2340,8 @@ class Fn {
1656
2340
  * @param params
1657
2341
  * @param options : AxiosRequestConfig
1658
2342
  */
1659
- put(t, n, r = {}) {
1660
- return this.service.put(t, n, r);
2343
+ put(url, params, options = {}) {
2344
+ return this.service.put(url, params, options);
1661
2345
  }
1662
2346
  /**
1663
2347
  *
@@ -1665,18 +2349,18 @@ class Fn {
1665
2349
  * @param params
1666
2350
  * @param options : AxiosRequestConfig
1667
2351
  */
1668
- delete(t, n, r = {}) {
1669
- return this.service.delete(t, U({ params: n }, r));
2352
+ delete(url, params, options = {}) {
2353
+ return this.service.delete(url, __spreadValues({ params }, options));
1670
2354
  }
1671
2355
  }
1672
- const Ee = new Fn(_n);
2356
+ const http = new YxHttp(config);
1673
2357
  export {
1674
- jn as B,
1675
- Qe as U,
1676
- I as a,
1677
- In as b,
1678
- Pn as g,
1679
- Ee as h,
1680
- Mn as i,
1681
- ye as s
2358
+ BC_LANG_NAME as B,
2359
+ URL as U,
2360
+ getSystemConfig as a,
2361
+ BC_THEME_NAME as b,
2362
+ getUserIsHaveBtnPower as g,
2363
+ http as h,
2364
+ index as i,
2365
+ setSystemConfig as s
1682
2366
  };