@wiajs/req 1.7.28 → 1.7.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/web/req.mjs CHANGED
@@ -1,233 +1,183 @@
1
1
  /*!
2
- * @wia/req v1.7.28
3
- * (c) 2024 Sibyl Yu, Matt Zabriskie and contributors
2
+ * @wia/req v1.7.30
3
+ * (c) 2024-2025 Sibyl Yu, Matt Zabriskie and contributors
4
4
  * Released under the MIT License.
5
5
  */
6
- function bind$1(fn, thisArg) {
7
- return function wrap() {
8
- return fn.apply(thisArg, arguments);
9
- };
6
+ function bind$1(fn, thisArg) {
7
+ return function wrap() {
8
+ return fn.apply(thisArg, arguments);
9
+ };
10
10
  }
11
11
 
12
- // utils is a library of generic helper functions non-specific to axios
13
-
14
- const {toString: toString$1} = Object.prototype;
15
- const {getPrototypeOf: getPrototypeOf$1} = Object;
16
-
17
- const kindOf$1 = (cache => thing => {
18
- const str = toString$1.call(thing);
19
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
20
- })(Object.create(null));
21
-
22
- const kindOfTest$1 = (type) => {
23
- type = type.toLowerCase();
24
- return (thing) => kindOf$1(thing) === type
25
- };
26
-
27
- const typeOfTest$1 = type => thing => typeof thing === type;
28
-
12
+ // utils is a library of generic helper functions non-specific to axios
13
+ const { toString: toString$1 } = Object.prototype;
14
+ const { getPrototypeOf: getPrototypeOf$1 } = Object;
15
+ const kindOf$1 = ((cache)=>(thing)=>{
16
+ const str = toString$1.call(thing);
17
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
18
+ })(Object.create(null));
19
+ const kindOfTest$1 = (type)=>{
20
+ type = type.toLowerCase();
21
+ return (thing)=>kindOf$1(thing) === type;
22
+ };
23
+ const typeOfTest$1 = (type)=>(thing)=>typeof thing === type;
29
24
  /**
30
25
  * Determine if a value is an Array
31
26
  *
32
27
  * @param {Object} val The value to test
33
28
  *
34
29
  * @returns {boolean} True if value is an Array, otherwise false
35
- */
36
- const {isArray: isArray$1} = Array;
37
-
30
+ */ const { isArray: isArray$1 } = Array;
38
31
  /**
39
32
  * Determine if a value is undefined
40
33
  *
41
34
  * @param {*} val The value to test
42
35
  *
43
36
  * @returns {boolean} True if the value is undefined, otherwise false
44
- */
45
- const isUndefined$1 = typeOfTest$1('undefined');
46
-
37
+ */ const isUndefined$1 = typeOfTest$1('undefined');
47
38
  /**
48
39
  * Determine if a value is a Buffer
49
40
  *
50
41
  * @param {*} val The value to test
51
42
  *
52
43
  * @returns {boolean} True if value is a Buffer, otherwise false
53
- */
54
- function isBuffer$1(val) {
55
- return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor)
56
- && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
57
- }
58
-
44
+ */ function isBuffer$1(val) {
45
+ return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
46
+ }
59
47
  /**
60
48
  * Determine if a value is an ArrayBuffer
61
49
  *
62
50
  * @param {*} val The value to test
63
51
  *
64
52
  * @returns {boolean} True if value is an ArrayBuffer, otherwise false
65
- */
66
- const isArrayBuffer$1 = kindOfTest$1('ArrayBuffer');
67
-
68
-
53
+ */ const isArrayBuffer$1 = kindOfTest$1('ArrayBuffer');
69
54
  /**
70
55
  * Determine if a value is a view on an ArrayBuffer
71
56
  *
72
57
  * @param {*} val The value to test
73
58
  *
74
59
  * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
75
- */
76
- function isArrayBufferView$1(val) {
77
- let result;
78
- if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
79
- result = ArrayBuffer.isView(val);
80
- } else {
81
- result = (val) && (val.buffer) && (isArrayBuffer$1(val.buffer));
82
- }
83
- return result;
84
- }
85
-
60
+ */ function isArrayBufferView$1(val) {
61
+ let result;
62
+ if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
63
+ result = ArrayBuffer.isView(val);
64
+ } else {
65
+ result = val && val.buffer && isArrayBuffer$1(val.buffer);
66
+ }
67
+ return result;
68
+ }
86
69
  /**
87
70
  * Determine if a value is a String
88
71
  *
89
72
  * @param {*} val The value to test
90
73
  *
91
74
  * @returns {boolean} True if value is a String, otherwise false
92
- */
93
- const isString$1 = typeOfTest$1('string');
94
-
75
+ */ const isString$1 = typeOfTest$1('string');
95
76
  /**
96
77
  * Determine if a value is a Function
97
78
  *
98
79
  * @param {*} val The value to test
99
80
  * @returns {boolean} True if value is a Function, otherwise false
100
- */
101
- const isFunction$1 = typeOfTest$1('function');
102
-
81
+ */ const isFunction$1 = typeOfTest$1('function');
103
82
  /**
104
83
  * Determine if a value is a Number
105
84
  *
106
85
  * @param {*} val The value to test
107
86
  *
108
87
  * @returns {boolean} True if value is a Number, otherwise false
109
- */
110
- const isNumber$1 = typeOfTest$1('number');
111
-
88
+ */ const isNumber$1 = typeOfTest$1('number');
112
89
  /**
113
90
  * Determine if a value is an Object
114
91
  *
115
92
  * @param {*} thing The value to test
116
93
  *
117
94
  * @returns {boolean} True if value is an Object, otherwise false
118
- */
119
- const isObject$1 = (thing) => thing !== null && typeof thing === 'object';
120
-
95
+ */ const isObject$1 = (thing)=>thing !== null && typeof thing === 'object';
121
96
  /**
122
97
  * Determine if a value is a Boolean
123
98
  *
124
99
  * @param {*} thing The value to test
125
100
  * @returns {boolean} True if value is a Boolean, otherwise false
126
- */
127
- const isBoolean$1 = thing => thing === true || thing === false;
128
-
101
+ */ const isBoolean$1 = (thing)=>thing === true || thing === false;
129
102
  /**
130
103
  * Determine if a value is a plain Object
131
104
  *
132
105
  * @param {*} val The value to test
133
106
  *
134
107
  * @returns {boolean} True if value is a plain Object, otherwise false
135
- */
136
- const isPlainObject$1 = (val) => {
137
- if (kindOf$1(val) !== 'object') {
138
- return false;
139
- }
140
-
141
- const prototype = getPrototypeOf$1(val);
142
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
143
- };
144
-
108
+ */ const isPlainObject$1 = (val)=>{
109
+ if (kindOf$1(val) !== 'object') {
110
+ return false;
111
+ }
112
+ const prototype = getPrototypeOf$1(val);
113
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
114
+ };
145
115
  /**
146
116
  * Determine if a value is a Date
147
117
  *
148
118
  * @param {*} val The value to test
149
119
  *
150
120
  * @returns {boolean} True if value is a Date, otherwise false
151
- */
152
- const isDate$1 = kindOfTest$1('Date');
153
-
121
+ */ const isDate$1 = kindOfTest$1('Date');
154
122
  /**
155
123
  * Determine if a value is a File
156
124
  *
157
125
  * @param {*} val The value to test
158
126
  *
159
127
  * @returns {boolean} True if value is a File, otherwise false
160
- */
161
- const isFile$1 = kindOfTest$1('File');
162
-
128
+ */ const isFile$1 = kindOfTest$1('File');
163
129
  /**
164
130
  * Determine if a value is a Blob
165
131
  *
166
132
  * @param {*} val The value to test
167
133
  *
168
134
  * @returns {boolean} True if value is a Blob, otherwise false
169
- */
170
- const isBlob$1 = kindOfTest$1('Blob');
171
-
135
+ */ const isBlob$1 = kindOfTest$1('Blob');
172
136
  /**
173
137
  * Determine if a value is a FileList
174
138
  *
175
139
  * @param {*} val The value to test
176
140
  *
177
141
  * @returns {boolean} True if value is a File, otherwise false
178
- */
179
- const isFileList$1 = kindOfTest$1('FileList');
180
-
142
+ */ const isFileList$1 = kindOfTest$1('FileList');
181
143
  /**
182
144
  * Determine if a value is a Stream
183
145
  *
184
146
  * @param {*} val The value to test
185
147
  *
186
148
  * @returns {boolean} True if value is a Stream, otherwise false
187
- */
188
- const isStream$1 = (val) => isObject$1(val) && isFunction$1(val.pipe);
189
-
149
+ */ const isStream$1 = (val)=>isObject$1(val) && isFunction$1(val.pipe);
190
150
  /**
191
151
  * Determine if a value is a FormData
192
152
  *
193
153
  * @param {*} thing The value to test
194
154
  *
195
155
  * @returns {boolean} True if value is an FormData, otherwise false
196
- */
197
- const isFormData$1 = (thing) => {
198
- let kind;
199
- return thing && (
200
- (typeof FormData === 'function' && thing instanceof FormData) || (
201
- isFunction$1(thing.append) && (
202
- (kind = kindOf$1(thing)) === 'formdata' ||
203
- // detect form-data instance
204
- (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
205
- )
206
- )
207
- )
208
- };
209
-
156
+ */ const isFormData$1 = (thing)=>{
157
+ let kind;
158
+ return thing && (typeof FormData === 'function' && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf$1(thing)) === 'formdata' || // detect form-data instance
159
+ kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]'));
160
+ };
210
161
  /**
211
162
  * Determine if a value is a URLSearchParams object
212
163
  *
213
164
  * @param {*} val The value to test
214
165
  *
215
166
  * @returns {boolean} True if value is a URLSearchParams object, otherwise false
216
- */
217
- const isURLSearchParams$1 = kindOfTest$1('URLSearchParams');
218
-
219
- const [isReadableStream$1, isRequest$1, isResponse$1, isHeaders$1] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest$1);
220
-
167
+ */ const isURLSearchParams$1 = kindOfTest$1('URLSearchParams');
168
+ const [isReadableStream$1, isRequest$1, isResponse$1, isHeaders$1] = [
169
+ 'ReadableStream',
170
+ 'Request',
171
+ 'Response',
172
+ 'Headers'
173
+ ].map(kindOfTest$1);
221
174
  /**
222
175
  * Trim excess whitespace off the beginning and end of a string
223
176
  *
224
177
  * @param {String} str The String to trim
225
178
  *
226
179
  * @returns {String} The String freed of excess whitespace
227
- */
228
- const trim$1 = (str) => str.trim ?
229
- str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
230
-
180
+ */ const trim$1 = (str)=>str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
231
181
  /**
232
182
  * Iterate over an Array or an Object invoking a function for each item.
233
183
  *
@@ -242,62 +192,53 @@ const trim$1 = (str) => str.trim ?
242
192
  *
243
193
  * @param {Boolean} [allOwnKeys = false]
244
194
  * @returns {any}
245
- */
246
- function forEach$1(obj, fn, {allOwnKeys = false} = {}) {
247
- // Don't bother if no value provided
248
- if (obj === null || typeof obj === 'undefined') {
249
- return;
250
- }
251
-
252
- let i;
253
- let l;
254
-
255
- // Force an array if not already something iterable
256
- if (typeof obj !== 'object') {
257
- /*eslint no-param-reassign:0*/
258
- obj = [obj];
259
- }
260
-
261
- if (isArray$1(obj)) {
262
- // Iterate over array values
263
- for (i = 0, l = obj.length; i < l; i++) {
264
- fn.call(null, obj[i], i, obj);
265
- }
266
- } else {
267
- // Iterate over object keys
268
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
269
- const len = keys.length;
270
- let key;
271
-
272
- for (i = 0; i < len; i++) {
273
- key = keys[i];
274
- fn.call(null, obj[key], key, obj);
275
- }
276
- }
277
- }
278
-
279
- function findKey$1(obj, key) {
280
- key = key.toLowerCase();
281
- const keys = Object.keys(obj);
282
- let i = keys.length;
283
- let _key;
284
- while (i-- > 0) {
285
- _key = keys[i];
286
- if (key === _key.toLowerCase()) {
287
- return _key;
288
- }
289
- }
290
- return null;
291
- }
292
-
293
- const _global$1 = (() => {
294
- /*eslint no-undef:0*/
295
- if (typeof globalThis !== "undefined") return globalThis;
296
- return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
297
- })();
298
-
299
- const isContextDefined$1 = (context) => !isUndefined$1(context) && context !== _global$1;
300
-
195
+ */ function forEach$1(obj, fn, { allOwnKeys = false } = {}) {
196
+ // Don't bother if no value provided
197
+ if (obj === null || typeof obj === 'undefined') {
198
+ return;
199
+ }
200
+ let i;
201
+ let l;
202
+ // Force an array if not already something iterable
203
+ if (typeof obj !== 'object') {
204
+ /*eslint no-param-reassign:0*/ obj = [
205
+ obj
206
+ ];
207
+ }
208
+ if (isArray$1(obj)) {
209
+ // Iterate over array values
210
+ for(i = 0, l = obj.length; i < l; i++){
211
+ fn.call(null, obj[i], i, obj);
212
+ }
213
+ } else {
214
+ // Iterate over object keys
215
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
216
+ const len = keys.length;
217
+ let key;
218
+ for(i = 0; i < len; i++){
219
+ key = keys[i];
220
+ fn.call(null, obj[key], key, obj);
221
+ }
222
+ }
223
+ }
224
+ function findKey$1(obj, key) {
225
+ key = key.toLowerCase();
226
+ const keys = Object.keys(obj);
227
+ let i = keys.length;
228
+ let _key;
229
+ while(i-- > 0){
230
+ _key = keys[i];
231
+ if (key === _key.toLowerCase()) {
232
+ return _key;
233
+ }
234
+ }
235
+ return null;
236
+ }
237
+ const _global$1 = (()=>{
238
+ /*eslint no-undef:0*/ if (typeof globalThis !== "undefined") return globalThis;
239
+ return typeof self !== "undefined" ? self : typeof window !== 'undefined' ? window : global;
240
+ })();
241
+ const isContextDefined$1 = (context)=>!isUndefined$1(context) && context !== _global$1;
301
242
  /**
302
243
  * Accepts varargs expecting each argument to be an object, then
303
244
  * immutably merges the properties of each object and returns result.
@@ -315,29 +256,26 @@ const isContextDefined$1 = (context) => !isUndefined$1(context) && context !== _
315
256
  * @param {Object} obj1 Object to merge
316
257
  *
317
258
  * @returns {Object} Result of all merge properties
318
- */
319
- function merge$1(/* obj1, obj2, obj3, ... */) {
320
- const {caseless} = isContextDefined$1(this) && this || {};
321
- const result = {};
322
- const assignValue = (val, key) => {
323
- const targetKey = caseless && findKey$1(result, key) || key;
324
- if (isPlainObject$1(result[targetKey]) && isPlainObject$1(val)) {
325
- result[targetKey] = merge$1(result[targetKey], val);
326
- } else if (isPlainObject$1(val)) {
327
- result[targetKey] = merge$1({}, val);
328
- } else if (isArray$1(val)) {
329
- result[targetKey] = val.slice();
330
- } else {
331
- result[targetKey] = val;
332
- }
333
- };
334
-
335
- for (let i = 0, l = arguments.length; i < l; i++) {
336
- arguments[i] && forEach$1(arguments[i], assignValue);
337
- }
338
- return result;
339
- }
340
-
259
+ */ function merge$1() {
260
+ const { caseless } = isContextDefined$1(this) && this || {};
261
+ const result = {};
262
+ const assignValue = (val, key)=>{
263
+ const targetKey = caseless && findKey$1(result, key) || key;
264
+ if (isPlainObject$1(result[targetKey]) && isPlainObject$1(val)) {
265
+ result[targetKey] = merge$1(result[targetKey], val);
266
+ } else if (isPlainObject$1(val)) {
267
+ result[targetKey] = merge$1({}, val);
268
+ } else if (isArray$1(val)) {
269
+ result[targetKey] = val.slice();
270
+ } else {
271
+ result[targetKey] = val;
272
+ }
273
+ };
274
+ for(let i = 0, l = arguments.length; i < l; i++){
275
+ arguments[i] && forEach$1(arguments[i], assignValue);
276
+ }
277
+ return result;
278
+ }
341
279
  /**
342
280
  * Extends object a by mutably adding to it the properties of object b.
343
281
  *
@@ -347,32 +285,30 @@ function merge$1(/* obj1, obj2, obj3, ... */) {
347
285
  *
348
286
  * @param {Boolean} [allOwnKeys]
349
287
  * @returns {Object} The resulting value of object a
350
- */
351
- const extend$1 = (a, b, thisArg, {allOwnKeys} = {}) => {
352
- forEach$1(b, (val, key) => {
353
- if (thisArg && isFunction$1(val)) {
354
- a[key] = bind$1(val, thisArg);
355
- } else {
356
- a[key] = val;
357
- }
358
- }, {allOwnKeys});
359
- return a;
360
- };
361
-
288
+ */ const extend$1 = (a, b, thisArg, { allOwnKeys } = {})=>{
289
+ forEach$1(b, (val, key)=>{
290
+ if (thisArg && isFunction$1(val)) {
291
+ a[key] = bind$1(val, thisArg);
292
+ } else {
293
+ a[key] = val;
294
+ }
295
+ }, {
296
+ allOwnKeys
297
+ });
298
+ return a;
299
+ };
362
300
  /**
363
301
  * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
364
302
  *
365
303
  * @param {string} content with BOM
366
304
  *
367
305
  * @returns {string} content value without BOM
368
- */
369
- const stripBOM$1 = (content) => {
370
- if (content.charCodeAt(0) === 0xFEFF) {
371
- content = content.slice(1);
372
- }
373
- return content;
374
- };
375
-
306
+ */ const stripBOM$1 = (content)=>{
307
+ if (content.charCodeAt(0) === 0xFEFF) {
308
+ content = content.slice(1);
309
+ }
310
+ return content;
311
+ };
376
312
  /**
377
313
  * Inherit the prototype methods from one constructor into another
378
314
  * @param {function} constructor
@@ -381,16 +317,14 @@ const stripBOM$1 = (content) => {
381
317
  * @param {object} [descriptors]
382
318
  *
383
319
  * @returns {void}
384
- */
385
- const inherits$1 = (constructor, superConstructor, props, descriptors) => {
386
- constructor.prototype = Object.create(superConstructor.prototype, descriptors);
387
- constructor.prototype.constructor = constructor;
388
- Object.defineProperty(constructor, 'super', {
389
- value: superConstructor.prototype
390
- });
391
- props && Object.assign(constructor.prototype, props);
392
- };
393
-
320
+ */ const inherits$1 = (constructor, superConstructor, props, descriptors)=>{
321
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
322
+ constructor.prototype.constructor = constructor;
323
+ Object.defineProperty(constructor, 'super', {
324
+ value: superConstructor.prototype
325
+ });
326
+ props && Object.assign(constructor.prototype, props);
327
+ };
394
328
  /**
395
329
  * Resolve object with deep prototype chain to a flat object
396
330
  * @param {Object} sourceObj source object
@@ -399,33 +333,28 @@ const inherits$1 = (constructor, superConstructor, props, descriptors) => {
399
333
  * @param {Function} [propFilter]
400
334
  *
401
335
  * @returns {Object}
402
- */
403
- const toFlatObject$1 = (sourceObj, destObj, filter, propFilter) => {
404
- let props;
405
- let i;
406
- let prop;
407
- const merged = {};
408
-
409
- destObj = destObj || {};
410
- // eslint-disable-next-line no-eq-null,eqeqeq
411
- if (sourceObj == null) return destObj;
412
-
413
- do {
414
- props = Object.getOwnPropertyNames(sourceObj);
415
- i = props.length;
416
- while (i-- > 0) {
417
- prop = props[i];
418
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
419
- destObj[prop] = sourceObj[prop];
420
- merged[prop] = true;
421
- }
422
- }
423
- sourceObj = filter !== false && getPrototypeOf$1(sourceObj);
424
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
425
-
426
- return destObj;
427
- };
428
-
336
+ */ const toFlatObject$1 = (sourceObj, destObj, filter, propFilter)=>{
337
+ let props;
338
+ let i;
339
+ let prop;
340
+ const merged = {};
341
+ destObj = destObj || {};
342
+ // eslint-disable-next-line no-eq-null,eqeqeq
343
+ if (sourceObj == null) return destObj;
344
+ do {
345
+ props = Object.getOwnPropertyNames(sourceObj);
346
+ i = props.length;
347
+ while(i-- > 0){
348
+ prop = props[i];
349
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
350
+ destObj[prop] = sourceObj[prop];
351
+ merged[prop] = true;
352
+ }
353
+ }
354
+ sourceObj = filter !== false && getPrototypeOf$1(sourceObj);
355
+ }while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype)
356
+ return destObj;
357
+ };
429
358
  /**
430
359
  * Determines whether a string ends with the characters of a specified string
431
360
  *
@@ -434,37 +363,32 @@ const toFlatObject$1 = (sourceObj, destObj, filter, propFilter) => {
434
363
  * @param {Number} [position= 0]
435
364
  *
436
365
  * @returns {boolean}
437
- */
438
- const endsWith$1 = (str, searchString, position) => {
439
- str = String(str);
440
- if (position === undefined || position > str.length) {
441
- position = str.length;
442
- }
443
- position -= searchString.length;
444
- const lastIndex = str.indexOf(searchString, position);
445
- return lastIndex !== -1 && lastIndex === position;
446
- };
447
-
448
-
366
+ */ const endsWith$1 = (str, searchString, position)=>{
367
+ str = String(str);
368
+ if (position === undefined || position > str.length) {
369
+ position = str.length;
370
+ }
371
+ position -= searchString.length;
372
+ const lastIndex = str.indexOf(searchString, position);
373
+ return lastIndex !== -1 && lastIndex === position;
374
+ };
449
375
  /**
450
376
  * Returns new array from array like object or null if failed
451
377
  *
452
378
  * @param {*} [thing]
453
379
  *
454
380
  * @returns {?Array}
455
- */
456
- const toArray$1 = (thing) => {
457
- if (!thing) return null;
458
- if (isArray$1(thing)) return thing;
459
- let i = thing.length;
460
- if (!isNumber$1(i)) return null;
461
- const arr = new Array(i);
462
- while (i-- > 0) {
463
- arr[i] = thing[i];
464
- }
465
- return arr;
466
- };
467
-
381
+ */ const toArray$1 = (thing)=>{
382
+ if (!thing) return null;
383
+ if (isArray$1(thing)) return thing;
384
+ let i = thing.length;
385
+ if (!isNumber$1(i)) return null;
386
+ const arr = new Array(i);
387
+ while(i-- > 0){
388
+ arr[i] = thing[i];
389
+ }
390
+ return arr;
391
+ };
468
392
  /**
469
393
  * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
470
394
  * thing passed in is an instance of Uint8Array
@@ -472,15 +396,13 @@ const toArray$1 = (thing) => {
472
396
  * @param {TypedArray}
473
397
  *
474
398
  * @returns {Array}
475
- */
476
- // eslint-disable-next-line func-names
477
- const isTypedArray$1 = (TypedArray => {
478
- // eslint-disable-next-line func-names
479
- return thing => {
480
- return TypedArray && thing instanceof TypedArray;
481
- };
482
- })(typeof Uint8Array !== 'undefined' && getPrototypeOf$1(Uint8Array));
483
-
399
+ */ // eslint-disable-next-line func-names
400
+ const isTypedArray$1 = ((TypedArray)=>{
401
+ // eslint-disable-next-line func-names
402
+ return (thing)=>{
403
+ return TypedArray && thing instanceof TypedArray;
404
+ };
405
+ })(typeof Uint8Array !== 'undefined' && getPrototypeOf$1(Uint8Array));
484
406
  /**
485
407
  * For each entry in the object, call the function with the key and value.
486
408
  *
@@ -488,20 +410,15 @@ const isTypedArray$1 = (TypedArray => {
488
410
  * @param {Function} fn - The function to call for each entry.
489
411
  *
490
412
  * @returns {void}
491
- */
492
- const forEachEntry$1 = (obj, fn) => {
493
- const generator = obj && obj[Symbol.iterator];
494
-
495
- const iterator = generator.call(obj);
496
-
497
- let result;
498
-
499
- while ((result = iterator.next()) && !result.done) {
500
- const pair = result.value;
501
- fn.call(obj, pair[0], pair[1]);
502
- }
503
- };
504
-
413
+ */ const forEachEntry$1 = (obj, fn)=>{
414
+ const generator = obj && obj[Symbol.iterator];
415
+ const iterator = generator.call(obj);
416
+ let result;
417
+ while((result = iterator.next()) && !result.done){
418
+ const pair = result.value;
419
+ fn.call(obj, pair[0], pair[1]);
420
+ }
421
+ };
505
422
  /**
506
423
  * It takes a regular expression and a string, and returns an array of all the matches
507
424
  *
@@ -509,280 +426,221 @@ const forEachEntry$1 = (obj, fn) => {
509
426
  * @param {string} str - The string to search.
510
427
  *
511
428
  * @returns {Array<boolean>}
512
- */
513
- const matchAll$1 = (regExp, str) => {
514
- let matches;
515
- const arr = [];
516
-
517
- while ((matches = regExp.exec(str)) !== null) {
518
- arr.push(matches);
519
- }
520
-
521
- return arr;
522
- };
523
-
524
- /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
525
- const isHTMLForm$1 = kindOfTest$1('HTMLFormElement');
526
-
527
- const toCamelCase$1 = str => {
528
- return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
529
- function replacer(m, p1, p2) {
530
- return p1.toUpperCase() + p2;
531
- }
532
- );
533
- };
534
-
535
- /* Creating a function that will check if an object has a property. */
536
- const hasOwnProperty$1 = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
537
-
429
+ */ const matchAll$1 = (regExp, str)=>{
430
+ let matches;
431
+ const arr = [];
432
+ while((matches = regExp.exec(str)) !== null){
433
+ arr.push(matches);
434
+ }
435
+ return arr;
436
+ };
437
+ /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ const isHTMLForm$1 = kindOfTest$1('HTMLFormElement');
438
+ const toCamelCase$1 = (str)=>{
439
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
440
+ return p1.toUpperCase() + p2;
441
+ });
442
+ };
443
+ /* Creating a function that will check if an object has a property. */ const hasOwnProperty$1 = (({ hasOwnProperty })=>(obj, prop)=>hasOwnProperty.call(obj, prop))(Object.prototype);
538
444
  /**
539
445
  * Determine if a value is a RegExp object
540
446
  *
541
447
  * @param {*} val The value to test
542
448
  *
543
449
  * @returns {boolean} True if value is a RegExp object, otherwise false
544
- */
545
- const isRegExp$1 = kindOfTest$1('RegExp');
546
-
547
- const reduceDescriptors$1 = (obj, reducer) => {
548
- const descriptors = Object.getOwnPropertyDescriptors(obj);
549
- const reducedDescriptors = {};
550
-
551
- forEach$1(descriptors, (descriptor, name) => {
552
- let ret;
553
- if ((ret = reducer(descriptor, name, obj)) !== false) {
554
- reducedDescriptors[name] = ret || descriptor;
555
- }
556
- });
557
-
558
- Object.defineProperties(obj, reducedDescriptors);
559
- };
560
-
450
+ */ const isRegExp$1 = kindOfTest$1('RegExp');
451
+ const reduceDescriptors$1 = (obj, reducer)=>{
452
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
453
+ const reducedDescriptors = {};
454
+ forEach$1(descriptors, (descriptor, name)=>{
455
+ let ret;
456
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
457
+ reducedDescriptors[name] = ret || descriptor;
458
+ }
459
+ });
460
+ Object.defineProperties(obj, reducedDescriptors);
461
+ };
561
462
  /**
562
463
  * Makes all methods read-only
563
464
  * @param {Object} obj
564
- */
565
-
566
- const freezeMethods$1 = (obj) => {
567
- reduceDescriptors$1(obj, (descriptor, name) => {
568
- // skip restricted props in strict mode
569
- if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
570
- return false;
571
- }
572
-
573
- const value = obj[name];
574
-
575
- if (!isFunction$1(value)) return;
576
-
577
- descriptor.enumerable = false;
578
-
579
- if ('writable' in descriptor) {
580
- descriptor.writable = false;
581
- return;
582
- }
583
-
584
- if (!descriptor.set) {
585
- descriptor.set = () => {
586
- throw Error('Can not rewrite read-only method \'' + name + '\'');
587
- };
588
- }
589
- });
590
- };
591
-
592
- const toObjectSet$1 = (arrayOrString, delimiter) => {
593
- const obj = {};
594
-
595
- const define = (arr) => {
596
- arr.forEach(value => {
597
- obj[value] = true;
598
- });
599
- };
600
-
601
- isArray$1(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
602
-
603
- return obj;
604
- };
605
-
606
- const noop$1 = () => {};
607
-
608
- const toFiniteNumber$1 = (value, defaultValue) => {
609
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
610
- };
611
-
612
- const ALPHA$1 = 'abcdefghijklmnopqrstuvwxyz';
613
-
614
- const DIGIT$1 = '0123456789';
615
-
616
- const ALPHABET$1 = {
617
- DIGIT: DIGIT$1,
618
- ALPHA: ALPHA$1,
619
- ALPHA_DIGIT: ALPHA$1 + ALPHA$1.toUpperCase() + DIGIT$1
620
- };
621
-
622
- const generateString$1 = (size = 16, alphabet = ALPHABET$1.ALPHA_DIGIT) => {
623
- let str = '';
624
- const {length} = alphabet;
625
- while (size--) {
626
- str += alphabet[Math.random() * length|0];
627
- }
628
-
629
- return str;
630
- };
631
-
465
+ */ const freezeMethods$1 = (obj)=>{
466
+ reduceDescriptors$1(obj, (descriptor, name)=>{
467
+ // skip restricted props in strict mode
468
+ if (isFunction$1(obj) && [
469
+ 'arguments',
470
+ 'caller',
471
+ 'callee'
472
+ ].indexOf(name) !== -1) {
473
+ return false;
474
+ }
475
+ const value = obj[name];
476
+ if (!isFunction$1(value)) return;
477
+ descriptor.enumerable = false;
478
+ if ('writable' in descriptor) {
479
+ descriptor.writable = false;
480
+ return;
481
+ }
482
+ if (!descriptor.set) {
483
+ descriptor.set = ()=>{
484
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
485
+ };
486
+ }
487
+ });
488
+ };
489
+ const toObjectSet$1 = (arrayOrString, delimiter)=>{
490
+ const obj = {};
491
+ const define = (arr)=>{
492
+ arr.forEach((value)=>{
493
+ obj[value] = true;
494
+ });
495
+ };
496
+ isArray$1(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
497
+ return obj;
498
+ };
499
+ const noop$1 = ()=>{};
500
+ const toFiniteNumber$1 = (value, defaultValue)=>{
501
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
502
+ };
503
+ const ALPHA$1 = 'abcdefghijklmnopqrstuvwxyz';
504
+ const DIGIT$1 = '0123456789';
505
+ const ALPHABET$1 = {
506
+ DIGIT: DIGIT$1,
507
+ ALPHA: ALPHA$1,
508
+ ALPHA_DIGIT: ALPHA$1 + ALPHA$1.toUpperCase() + DIGIT$1
509
+ };
510
+ const generateString$1 = (size = 16, alphabet = ALPHABET$1.ALPHA_DIGIT)=>{
511
+ let str = '';
512
+ const { length } = alphabet;
513
+ while(size--){
514
+ str += alphabet[Math.random() * length | 0];
515
+ }
516
+ return str;
517
+ };
632
518
  /**
633
519
  * If the thing is a FormData object, return true, otherwise return false.
634
520
  *
635
521
  * @param {unknown} thing - The thing to check.
636
522
  *
637
523
  * @returns {boolean}
638
- */
639
- function isSpecCompliantForm$1(thing) {
640
- return !!(thing && isFunction$1(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
641
- }
642
-
643
- const toJSONObject$1 = (obj) => {
644
- const stack = new Array(10);
645
-
646
- const visit = (source, i) => {
647
-
648
- if (isObject$1(source)) {
649
- if (stack.indexOf(source) >= 0) {
650
- return;
651
- }
652
-
653
- if (!('toJSON' in source)) {
654
- stack[i] = source;
655
- const target = isArray$1(source) ? [] : {};
656
-
657
- forEach$1(source, (value, key) => {
658
- const reducedValue = visit(value, i + 1);
659
- !isUndefined$1(reducedValue) && (target[key] = reducedValue);
660
- });
661
-
662
- stack[i] = undefined;
663
-
664
- return target;
665
- }
666
- }
667
-
668
- return source;
669
- };
670
-
671
- return visit(obj, 0);
672
- };
673
-
674
- const isAsyncFn$1 = kindOfTest$1('AsyncFunction');
675
-
676
- const isThenable$1 = (thing) =>
677
- thing && (isObject$1(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
678
-
679
- // original code
680
- // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
681
-
682
- const _setImmediate$1 = ((setImmediateSupported, postMessageSupported) => {
683
- if (setImmediateSupported) {
684
- return setImmediate;
685
- }
686
-
687
- return postMessageSupported ? ((token, callbacks) => {
688
- _global$1.addEventListener("message", ({source, data}) => {
689
- if (source === _global$1 && data === token) {
690
- callbacks.length && callbacks.shift()();
691
- }
692
- }, false);
693
-
694
- return (cb) => {
695
- callbacks.push(cb);
696
- _global$1.postMessage(token, "*");
697
- }
698
- })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
699
- })(
700
- typeof setImmediate === 'function',
701
- isFunction$1(_global$1.postMessage)
702
- );
703
-
704
- const asap$1 = typeof queueMicrotask !== 'undefined' ?
705
- queueMicrotask.bind(_global$1) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate$1);
706
-
707
-
708
- function createErrorType$1(code, message, baseClass) {
709
- // Create constructor
710
- function CustomError(properties) {
711
- Error.captureStackTrace(this, this.constructor);
712
- Object.assign(this, properties || {});
713
- this.code = code;
714
- this.message = this.cause ? `${message}: ${this.cause.message}` : message;
715
- }
716
-
717
- // Attach constructor and set default properties
718
- CustomError.prototype = new (baseClass || Error)();
719
- CustomError.prototype.constructor = CustomError;
720
- CustomError.prototype.name = `Error [${code}]`;
721
- return CustomError;
722
- }
723
-
724
-
725
- // *********************
726
-
727
- const utils$2 = {
728
- isArray: isArray$1,
729
- isArrayBuffer: isArrayBuffer$1,
730
- isBuffer: isBuffer$1,
731
- isFormData: isFormData$1,
732
- isArrayBufferView: isArrayBufferView$1,
733
- isString: isString$1,
734
- isNumber: isNumber$1,
735
- isBoolean: isBoolean$1,
736
- isObject: isObject$1,
737
- isPlainObject: isPlainObject$1,
738
- isReadableStream: isReadableStream$1,
739
- isRequest: isRequest$1,
740
- isResponse: isResponse$1,
741
- isHeaders: isHeaders$1,
742
- isUndefined: isUndefined$1,
743
- isDate: isDate$1,
744
- isFile: isFile$1,
745
- isBlob: isBlob$1,
746
- isRegExp: isRegExp$1,
747
- isFunction: isFunction$1,
748
- isStream: isStream$1,
749
- isURLSearchParams: isURLSearchParams$1,
750
- isTypedArray: isTypedArray$1,
751
- isFileList: isFileList$1,
752
- forEach: forEach$1,
753
- merge: merge$1,
754
- extend: extend$1,
755
- trim: trim$1,
756
- stripBOM: stripBOM$1,
757
- inherits: inherits$1,
758
- toFlatObject: toFlatObject$1,
759
- kindOf: kindOf$1,
760
- kindOfTest: kindOfTest$1,
761
- endsWith: endsWith$1,
762
- toArray: toArray$1,
763
- forEachEntry: forEachEntry$1,
764
- matchAll: matchAll$1,
765
- isHTMLForm: isHTMLForm$1,
766
- hasOwnProperty: hasOwnProperty$1,
767
- hasOwnProp: hasOwnProperty$1, // an alias to avoid ESLint no-prototype-builtins detection
768
- reduceDescriptors: reduceDescriptors$1,
769
- freezeMethods: freezeMethods$1,
770
- toObjectSet: toObjectSet$1,
771
- toCamelCase: toCamelCase$1,
772
- noop: noop$1,
773
- toFiniteNumber: toFiniteNumber$1,
774
- findKey: findKey$1,
775
- global: _global$1,
776
- isContextDefined: isContextDefined$1,
777
- ALPHABET: ALPHABET$1,
778
- generateString: generateString$1,
779
- isSpecCompliantForm: isSpecCompliantForm$1,
780
- toJSONObject: toJSONObject$1,
781
- isAsyncFn: isAsyncFn$1,
782
- isThenable: isThenable$1,
783
- setImmediate: _setImmediate$1,
784
- asap: asap$1,
785
- createErrorType: createErrorType$1
524
+ */ function isSpecCompliantForm$1(thing) {
525
+ return !!(thing && isFunction$1(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
526
+ }
527
+ const toJSONObject$1 = (obj)=>{
528
+ const stack = new Array(10);
529
+ const visit = (source, i)=>{
530
+ if (isObject$1(source)) {
531
+ if (stack.indexOf(source) >= 0) {
532
+ return;
533
+ }
534
+ if (!('toJSON' in source)) {
535
+ stack[i] = source;
536
+ const target = isArray$1(source) ? [] : {};
537
+ forEach$1(source, (value, key)=>{
538
+ const reducedValue = visit(value, i + 1);
539
+ !isUndefined$1(reducedValue) && (target[key] = reducedValue);
540
+ });
541
+ stack[i] = undefined;
542
+ return target;
543
+ }
544
+ }
545
+ return source;
546
+ };
547
+ return visit(obj, 0);
548
+ };
549
+ const isAsyncFn$1 = kindOfTest$1('AsyncFunction');
550
+ const isThenable$1 = (thing)=>thing && (isObject$1(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
551
+ // original code
552
+ // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
553
+ const _setImmediate$1 = ((setImmediateSupported, postMessageSupported)=>{
554
+ if (setImmediateSupported) {
555
+ return setImmediate;
556
+ }
557
+ return postMessageSupported ? ((token, callbacks)=>{
558
+ _global$1.addEventListener("message", ({ source, data })=>{
559
+ if (source === _global$1 && data === token) {
560
+ callbacks.length && callbacks.shift()();
561
+ }
562
+ }, false);
563
+ return (cb)=>{
564
+ callbacks.push(cb);
565
+ _global$1.postMessage(token, "*");
566
+ };
567
+ })(`axios@${Math.random()}`, []) : (cb)=>setTimeout(cb);
568
+ })(typeof setImmediate === 'function', isFunction$1(_global$1.postMessage));
569
+ const asap$1 = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global$1) : typeof process !== 'undefined' && process.nextTick || _setImmediate$1;
570
+ function createErrorType$1(code, message, baseClass) {
571
+ // Create constructor
572
+ function CustomError(properties) {
573
+ Error.captureStackTrace(this, this.constructor);
574
+ Object.assign(this, properties || {});
575
+ this.code = code;
576
+ this.message = this.cause ? `${message}: ${this.cause.message}` : message;
577
+ }
578
+ // Attach constructor and set default properties
579
+ CustomError.prototype = new (baseClass || Error)();
580
+ CustomError.prototype.constructor = CustomError;
581
+ CustomError.prototype.name = `Error [${code}]`;
582
+ return CustomError;
583
+ }
584
+ // *********************
585
+ const utils$2 = {
586
+ isArray: isArray$1,
587
+ isArrayBuffer: isArrayBuffer$1,
588
+ isBuffer: isBuffer$1,
589
+ isFormData: isFormData$1,
590
+ isArrayBufferView: isArrayBufferView$1,
591
+ isString: isString$1,
592
+ isNumber: isNumber$1,
593
+ isBoolean: isBoolean$1,
594
+ isObject: isObject$1,
595
+ isPlainObject: isPlainObject$1,
596
+ isReadableStream: isReadableStream$1,
597
+ isRequest: isRequest$1,
598
+ isResponse: isResponse$1,
599
+ isHeaders: isHeaders$1,
600
+ isUndefined: isUndefined$1,
601
+ isDate: isDate$1,
602
+ isFile: isFile$1,
603
+ isBlob: isBlob$1,
604
+ isRegExp: isRegExp$1,
605
+ isFunction: isFunction$1,
606
+ isStream: isStream$1,
607
+ isURLSearchParams: isURLSearchParams$1,
608
+ isTypedArray: isTypedArray$1,
609
+ isFileList: isFileList$1,
610
+ forEach: forEach$1,
611
+ merge: merge$1,
612
+ extend: extend$1,
613
+ trim: trim$1,
614
+ stripBOM: stripBOM$1,
615
+ inherits: inherits$1,
616
+ toFlatObject: toFlatObject$1,
617
+ kindOf: kindOf$1,
618
+ kindOfTest: kindOfTest$1,
619
+ endsWith: endsWith$1,
620
+ toArray: toArray$1,
621
+ forEachEntry: forEachEntry$1,
622
+ matchAll: matchAll$1,
623
+ isHTMLForm: isHTMLForm$1,
624
+ hasOwnProperty: hasOwnProperty$1,
625
+ hasOwnProp: hasOwnProperty$1,
626
+ reduceDescriptors: reduceDescriptors$1,
627
+ freezeMethods: freezeMethods$1,
628
+ toObjectSet: toObjectSet$1,
629
+ toCamelCase: toCamelCase$1,
630
+ noop: noop$1,
631
+ toFiniteNumber: toFiniteNumber$1,
632
+ findKey: findKey$1,
633
+ global: _global$1,
634
+ isContextDefined: isContextDefined$1,
635
+ ALPHABET: ALPHABET$1,
636
+ generateString: generateString$1,
637
+ isSpecCompliantForm: isSpecCompliantForm$1,
638
+ toJSONObject: toJSONObject$1,
639
+ isAsyncFn: isAsyncFn$1,
640
+ isThenable: isThenable$1,
641
+ setImmediate: _setImmediate$1,
642
+ asap: asap$1,
643
+ createErrorType: createErrorType$1
786
644
  };
787
645
 
788
646
  /**
@@ -795,92 +653,81 @@ const utils$2 = {
795
653
  * @param {Object} [response] The response.
796
654
  *
797
655
  * @returns {Error} The created error.
798
- */
799
- function AxiosError$2(message, code, config, request, response) {
800
- Error.call(this);
801
-
802
- if (Error.captureStackTrace) {
803
- Error.captureStackTrace(this, this.constructor);
804
- } else {
805
- this.stack = (new Error()).stack;
806
- }
807
-
808
- this.message = message;
809
- this.name = 'AxiosError';
810
- code && (this.code = code);
811
- config && (this.config = config);
812
- request && (this.request = request);
813
- if (response) {
814
- this.response = response;
815
- this.status = response.status ? response.status : null;
816
- }
817
- }
818
-
819
- utils$2.inherits(AxiosError$2, Error, {
820
- toJSON: function toJSON() {
821
- return {
822
- // Standard
823
- message: this.message,
824
- name: this.name,
825
- // Microsoft
826
- description: this.description,
827
- number: this.number,
828
- // Mozilla
829
- fileName: this.fileName,
830
- lineNumber: this.lineNumber,
831
- columnNumber: this.columnNumber,
832
- stack: this.stack,
833
- // Axios
834
- config: utils$2.toJSONObject(this.config),
835
- code: this.code,
836
- status: this.status
837
- };
838
- }
839
- });
840
-
841
- const prototype$3 = AxiosError$2.prototype;
842
- const descriptors$1 = {};
843
-
844
- [
845
- 'ERR_BAD_OPTION_VALUE',
846
- 'ERR_BAD_OPTION',
847
- 'ECONNABORTED',
848
- 'ETIMEDOUT',
849
- 'ERR_NETWORK',
850
- 'ERR_FR_TOO_MANY_REDIRECTS',
851
- 'ERR_DEPRECATED',
852
- 'ERR_BAD_RESPONSE',
853
- 'ERR_BAD_REQUEST',
854
- 'ERR_CANCELED',
855
- 'ERR_NOT_SUPPORT',
856
- 'ERR_INVALID_URL'
857
- // eslint-disable-next-line func-names
858
- ].forEach(code => {
859
- descriptors$1[code] = {value: code};
860
- });
861
-
862
- Object.defineProperties(AxiosError$2, descriptors$1);
863
- Object.defineProperty(prototype$3, 'isAxiosError', {value: true});
864
-
865
- // eslint-disable-next-line func-names
866
- AxiosError$2.from = (error, code, config, request, response, customProps) => {
867
- const axiosError = Object.create(prototype$3);
868
-
869
- utils$2.toFlatObject(error, axiosError, function filter(obj) {
870
- return obj !== Error.prototype;
871
- }, prop => {
872
- return prop !== 'isAxiosError';
873
- });
874
-
875
- AxiosError$2.call(axiosError, error.message, code, config, request, response);
876
-
877
- axiosError.cause = error;
878
-
879
- axiosError.name = error.name;
880
-
881
- customProps && Object.assign(axiosError, customProps);
882
-
883
- return axiosError;
656
+ */ function AxiosError$2(message, code, config, request, response) {
657
+ Error.call(this);
658
+ if (Error.captureStackTrace) {
659
+ Error.captureStackTrace(this, this.constructor);
660
+ } else {
661
+ this.stack = new Error().stack;
662
+ }
663
+ this.message = message;
664
+ this.name = 'AxiosError';
665
+ code && (this.code = code);
666
+ config && (this.config = config);
667
+ request && (this.request = request);
668
+ if (response) {
669
+ this.response = response;
670
+ this.status = response.status ? response.status : null;
671
+ }
672
+ }
673
+ utils$2.inherits(AxiosError$2, Error, {
674
+ toJSON: function toJSON() {
675
+ return {
676
+ // Standard
677
+ message: this.message,
678
+ name: this.name,
679
+ // Microsoft
680
+ description: this.description,
681
+ number: this.number,
682
+ // Mozilla
683
+ fileName: this.fileName,
684
+ lineNumber: this.lineNumber,
685
+ columnNumber: this.columnNumber,
686
+ stack: this.stack,
687
+ // Axios
688
+ config: utils$2.toJSONObject(this.config),
689
+ code: this.code,
690
+ status: this.status
691
+ };
692
+ }
693
+ });
694
+ const prototype$3 = AxiosError$2.prototype;
695
+ const descriptors$1 = {};
696
+ [
697
+ 'ERR_BAD_OPTION_VALUE',
698
+ 'ERR_BAD_OPTION',
699
+ 'ECONNABORTED',
700
+ 'ETIMEDOUT',
701
+ 'ERR_NETWORK',
702
+ 'ERR_FR_TOO_MANY_REDIRECTS',
703
+ 'ERR_DEPRECATED',
704
+ 'ERR_BAD_RESPONSE',
705
+ 'ERR_BAD_REQUEST',
706
+ 'ERR_CANCELED',
707
+ 'ERR_NOT_SUPPORT',
708
+ 'ERR_INVALID_URL'
709
+ ].forEach((code)=>{
710
+ descriptors$1[code] = {
711
+ value: code
712
+ };
713
+ });
714
+ Object.defineProperties(AxiosError$2, descriptors$1);
715
+ Object.defineProperty(prototype$3, 'isAxiosError', {
716
+ value: true
717
+ });
718
+ // eslint-disable-next-line func-names
719
+ AxiosError$2.from = (error, code, config, request, response, customProps)=>{
720
+ const axiosError = Object.create(prototype$3);
721
+ utils$2.toFlatObject(error, axiosError, function filter(obj) {
722
+ return obj !== Error.prototype;
723
+ }, (prop)=>{
724
+ return prop !== 'isAxiosError';
725
+ });
726
+ AxiosError$2.call(axiosError, error.message, code, config, request, response);
727
+ axiosError.cause = error;
728
+ axiosError.name = error.name;
729
+ customProps && Object.assign(axiosError, customProps);
730
+ return axiosError;
884
731
  };
885
732
 
886
733
  // eslint-disable-next-line strict
@@ -892,22 +739,18 @@ const HttpAdapter = null;
892
739
  * @param {string} thing - The object or array to be visited.
893
740
  *
894
741
  * @returns {boolean}
895
- */
896
- function isVisitable$1(thing) {
897
- return utils$2.isPlainObject(thing) || utils$2.isArray(thing);
898
- }
899
-
742
+ */ function isVisitable$1(thing) {
743
+ return utils$2.isPlainObject(thing) || utils$2.isArray(thing);
744
+ }
900
745
  /**
901
746
  * It removes the brackets from the end of a string
902
747
  *
903
748
  * @param {string} key - The key of the parameter.
904
749
  *
905
750
  * @returns {string} the key without the brackets.
906
- */
907
- function removeBrackets$1(key) {
908
- return utils$2.endsWith(key, '[]') ? key.slice(0, -2) : key;
909
- }
910
-
751
+ */ function removeBrackets$1(key) {
752
+ return utils$2.endsWith(key, '[]') ? key.slice(0, -2) : key;
753
+ }
911
754
  /**
912
755
  * It takes a path, a key, and a boolean, and returns a string
913
756
  *
@@ -916,31 +759,26 @@ function removeBrackets$1(key) {
916
759
  * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
917
760
  *
918
761
  * @returns {string} The path to the current key.
919
- */
920
- function renderKey$1(path, key, dots) {
921
- if (!path) return key;
922
- return path.concat(key).map(function each(token, i) {
923
- // eslint-disable-next-line no-param-reassign
924
- token = removeBrackets$1(token);
925
- return !dots && i ? '[' + token + ']' : token;
926
- }).join(dots ? '.' : '');
927
- }
928
-
762
+ */ function renderKey$1(path, key, dots) {
763
+ if (!path) return key;
764
+ return path.concat(key).map(function each(token, i) {
765
+ // eslint-disable-next-line no-param-reassign
766
+ token = removeBrackets$1(token);
767
+ return !dots && i ? '[' + token + ']' : token;
768
+ }).join(dots ? '.' : '');
769
+ }
929
770
  /**
930
771
  * If the array is an array and none of its elements are visitable, then it's a flat array.
931
772
  *
932
773
  * @param {Array<any>} arr - The array to check
933
774
  *
934
775
  * @returns {boolean}
935
- */
936
- function isFlatArray$1(arr) {
937
- return utils$2.isArray(arr) && !arr.some(isVisitable$1);
938
- }
939
-
940
- const predicates$1 = utils$2.toFlatObject(utils$2, {}, null, function filter(prop) {
941
- return /^is[A-Z]/.test(prop);
942
- });
943
-
776
+ */ function isFlatArray$1(arr) {
777
+ return utils$2.isArray(arr) && !arr.some(isVisitable$1);
778
+ }
779
+ const predicates$1 = utils$2.toFlatObject(utils$2, {}, null, function filter(prop) {
780
+ return /^is[A-Z]/.test(prop);
781
+ });
944
782
  /**
945
783
  * Convert a data object to FormData
946
784
  *
@@ -953,9 +791,7 @@ const predicates$1 = utils$2.toFlatObject(utils$2, {}, null, function filter(pro
953
791
  * @param {?Boolean} [options.indexes = false]
954
792
  *
955
793
  * @returns {Object}
956
- **/
957
-
958
- /**
794
+ **/ /**
959
795
  * It converts an object into a FormData object
960
796
  *
961
797
  * @param {Object<any, any>} obj - The object to convert to form data.
@@ -963,56 +799,47 @@ const predicates$1 = utils$2.toFlatObject(utils$2, {}, null, function filter(pro
963
799
  * @param {Object<string, any>} options
964
800
  *
965
801
  * @returns
966
- */
967
- function toFormData$2(obj, formData, options) {
968
- if (!utils$2.isObject(obj)) {
969
- throw new TypeError('target must be an object');
970
- }
971
-
972
- // eslint-disable-next-line no-param-reassign
973
- formData = formData || new (FormData)();
974
-
975
- // eslint-disable-next-line no-param-reassign
976
- options = utils$2.toFlatObject(options, {
977
- metaTokens: true,
978
- dots: false,
979
- indexes: false
980
- }, false, function defined(option, source) {
981
- // eslint-disable-next-line no-eq-null,eqeqeq
982
- return !utils$2.isUndefined(source[option]);
983
- });
984
-
985
- const metaTokens = options.metaTokens;
986
- // eslint-disable-next-line no-use-before-define
987
- const visitor = options.visitor || defaultVisitor;
988
- const dots = options.dots;
989
- const indexes = options.indexes;
990
- const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
991
- const useBlob = _Blob && utils$2.isSpecCompliantForm(formData);
992
-
993
- if (!utils$2.isFunction(visitor)) {
994
- throw new TypeError('visitor must be a function');
995
- }
996
-
997
- function convertValue(value) {
998
- if (value === null) return '';
999
-
1000
- if (utils$2.isDate(value)) {
1001
- return value.toISOString();
1002
- }
1003
-
1004
- if (!useBlob && utils$2.isBlob(value)) {
1005
- throw new AxiosError$2('Blob is not supported. Use a Buffer instead.');
1006
- }
1007
-
1008
- if (utils$2.isArrayBuffer(value) || utils$2.isTypedArray(value)) {
1009
- return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
1010
- }
1011
-
1012
- return value;
1013
- }
1014
-
1015
- /**
802
+ */ function toFormData$2(obj, formData, options) {
803
+ if (!utils$2.isObject(obj)) {
804
+ throw new TypeError('target must be an object');
805
+ }
806
+ // eslint-disable-next-line no-param-reassign
807
+ formData = formData || new (FormData)();
808
+ // eslint-disable-next-line no-param-reassign
809
+ options = utils$2.toFlatObject(options, {
810
+ metaTokens: true,
811
+ dots: false,
812
+ indexes: false
813
+ }, false, function defined(option, source) {
814
+ // eslint-disable-next-line no-eq-null,eqeqeq
815
+ return !utils$2.isUndefined(source[option]);
816
+ });
817
+ const metaTokens = options.metaTokens;
818
+ // eslint-disable-next-line no-use-before-define
819
+ const visitor = options.visitor || defaultVisitor;
820
+ const dots = options.dots;
821
+ const indexes = options.indexes;
822
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
823
+ const useBlob = _Blob && utils$2.isSpecCompliantForm(formData);
824
+ if (!utils$2.isFunction(visitor)) {
825
+ throw new TypeError('visitor must be a function');
826
+ }
827
+ function convertValue(value) {
828
+ if (value === null) return '';
829
+ if (utils$2.isDate(value)) {
830
+ return value.toISOString();
831
+ }
832
+ if (!useBlob && utils$2.isBlob(value)) {
833
+ throw new AxiosError$2('Blob is not supported. Use a Buffer instead.');
834
+ }
835
+ if (utils$2.isArrayBuffer(value) || utils$2.isTypedArray(value)) {
836
+ return useBlob && typeof Blob === 'function' ? new Blob([
837
+ value
838
+ ]) : Buffer.from(value);
839
+ }
840
+ return value;
841
+ }
842
+ /**
1016
843
  * Default visitor.
1017
844
  *
1018
845
  * @param {*} value
@@ -1021,80 +848,59 @@ function toFormData$2(obj, formData, options) {
1021
848
  * @this {FormData}
1022
849
  *
1023
850
  * @returns {boolean} return true to visit the each prop of the value recursively
1024
- */
1025
- function defaultVisitor(value, key, path) {
1026
- let arr = value;
1027
-
1028
- if (value && !path && typeof value === 'object') {
1029
- if (utils$2.endsWith(key, '{}')) {
1030
- // eslint-disable-next-line no-param-reassign
1031
- key = metaTokens ? key : key.slice(0, -2);
1032
- // eslint-disable-next-line no-param-reassign
1033
- value = JSON.stringify(value);
1034
- } else if (
1035
- (utils$2.isArray(value) && isFlatArray$1(value)) ||
1036
- ((utils$2.isFileList(value) || utils$2.endsWith(key, '[]')) && (arr = utils$2.toArray(value))
1037
- )) {
1038
- // eslint-disable-next-line no-param-reassign
1039
- key = removeBrackets$1(key);
1040
-
1041
- arr.forEach(function each(el, index) {
1042
- !(utils$2.isUndefined(el) || el === null) && formData.append(
1043
- // eslint-disable-next-line no-nested-ternary
1044
- indexes === true ? renderKey$1([key], index, dots) : (indexes === null ? key : key + '[]'),
1045
- convertValue(el)
1046
- );
1047
- });
1048
- return false;
1049
- }
1050
- }
1051
-
1052
- if (isVisitable$1(value)) {
1053
- return true;
1054
- }
1055
-
1056
- formData.append(renderKey$1(path, key, dots), convertValue(value));
1057
-
1058
- return false;
1059
- }
1060
-
1061
- const stack = [];
1062
-
1063
- const exposedHelpers = Object.assign(predicates$1, {
1064
- defaultVisitor,
1065
- convertValue,
1066
- isVisitable: isVisitable$1
1067
- });
1068
-
1069
- function build(value, path) {
1070
- if (utils$2.isUndefined(value)) return;
1071
-
1072
- if (stack.indexOf(value) !== -1) {
1073
- throw Error('Circular reference detected in ' + path.join('.'));
1074
- }
1075
-
1076
- stack.push(value);
1077
-
1078
- utils$2.forEach(value, function each(el, key) {
1079
- const result = !(utils$2.isUndefined(el) || el === null) && visitor.call(
1080
- formData, el, utils$2.isString(key) ? key.trim() : key, path, exposedHelpers
1081
- );
1082
-
1083
- if (result === true) {
1084
- build(el, path ? path.concat(key) : [key]);
1085
- }
1086
- });
1087
-
1088
- stack.pop();
1089
- }
1090
-
1091
- if (!utils$2.isObject(obj)) {
1092
- throw new TypeError('data must be an object');
1093
- }
1094
-
1095
- build(obj);
1096
-
1097
- return formData;
851
+ */ function defaultVisitor(value, key, path) {
852
+ let arr = value;
853
+ if (value && !path && typeof value === 'object') {
854
+ if (utils$2.endsWith(key, '{}')) {
855
+ // eslint-disable-next-line no-param-reassign
856
+ key = metaTokens ? key : key.slice(0, -2);
857
+ // eslint-disable-next-line no-param-reassign
858
+ value = JSON.stringify(value);
859
+ } else if (utils$2.isArray(value) && isFlatArray$1(value) || (utils$2.isFileList(value) || utils$2.endsWith(key, '[]')) && (arr = utils$2.toArray(value))) {
860
+ // eslint-disable-next-line no-param-reassign
861
+ key = removeBrackets$1(key);
862
+ arr.forEach(function each(el, index) {
863
+ !(utils$2.isUndefined(el) || el === null) && formData.append(// eslint-disable-next-line no-nested-ternary
864
+ indexes === true ? renderKey$1([
865
+ key
866
+ ], index, dots) : indexes === null ? key : key + '[]', convertValue(el));
867
+ });
868
+ return false;
869
+ }
870
+ }
871
+ if (isVisitable$1(value)) {
872
+ return true;
873
+ }
874
+ formData.append(renderKey$1(path, key, dots), convertValue(value));
875
+ return false;
876
+ }
877
+ const stack = [];
878
+ const exposedHelpers = Object.assign(predicates$1, {
879
+ defaultVisitor,
880
+ convertValue,
881
+ isVisitable: isVisitable$1
882
+ });
883
+ function build(value, path) {
884
+ if (utils$2.isUndefined(value)) return;
885
+ if (stack.indexOf(value) !== -1) {
886
+ throw Error('Circular reference detected in ' + path.join('.'));
887
+ }
888
+ stack.push(value);
889
+ utils$2.forEach(value, function each(el, key) {
890
+ const result = !(utils$2.isUndefined(el) || el === null) && visitor.call(formData, el, utils$2.isString(key) ? key.trim() : key, path, exposedHelpers);
891
+ if (result === true) {
892
+ build(el, path ? path.concat(key) : [
893
+ key
894
+ ]);
895
+ }
896
+ });
897
+ stack.pop();
898
+ }
899
+ if (!utils$2.isObject(obj)) {
900
+ throw new TypeError('data must be an object');
901
+ }
902
+ build(obj);
903
+ return formData;
1098
904
  }
1099
905
 
1100
906
  /**
@@ -1104,22 +910,20 @@ function toFormData$2(obj, formData, options) {
1104
910
  * @param {string} str - The string to encode.
1105
911
  *
1106
912
  * @returns {string} The encoded string.
1107
- */
1108
- function encode$2(str) {
1109
- const charMap = {
1110
- '!': '%21',
1111
- "'": '%27',
1112
- '(': '%28',
1113
- ')': '%29',
1114
- '~': '%7E',
1115
- '%20': '+',
1116
- '%00': '\x00'
1117
- };
1118
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
1119
- return charMap[match];
1120
- });
1121
- }
1122
-
913
+ */ function encode$2(str) {
914
+ const charMap = {
915
+ '!': '%21',
916
+ "'": '%27',
917
+ '(': '%28',
918
+ ')': '%29',
919
+ '~': '%7E',
920
+ '%20': '+',
921
+ '%00': '\x00'
922
+ };
923
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
924
+ return charMap[match];
925
+ });
926
+ }
1123
927
  /**
1124
928
  * It takes a params object and converts it to a FormData object
1125
929
  *
@@ -1127,27 +931,24 @@ function encode$2(str) {
1127
931
  * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1128
932
  *
1129
933
  * @returns {void}
1130
- */
1131
- function AxiosURLSearchParams$1(params, options) {
1132
- this._pairs = [];
1133
-
1134
- params && toFormData$2(params, this, options);
1135
- }
1136
-
1137
- const prototype$2 = AxiosURLSearchParams$1.prototype;
1138
-
1139
- prototype$2.append = function append(name, value) {
1140
- this._pairs.push([name, value]);
1141
- };
1142
-
1143
- prototype$2.toString = function toString(encoder) {
1144
- const _encode = encoder ? function(value) {
1145
- return encoder.call(this, value, encode$2);
1146
- } : encode$2;
1147
-
1148
- return this._pairs.map(function each(pair) {
1149
- return _encode(pair[0]) + '=' + _encode(pair[1]);
1150
- }, '').join('&');
934
+ */ function AxiosURLSearchParams$1(params, options) {
935
+ this._pairs = [];
936
+ params && toFormData$2(params, this, options);
937
+ }
938
+ const prototype$2 = AxiosURLSearchParams$1.prototype;
939
+ prototype$2.append = function append(name, value) {
940
+ this._pairs.push([
941
+ name,
942
+ value
943
+ ]);
944
+ };
945
+ prototype$2.toString = function toString(encoder) {
946
+ const _encode = encoder ? function(value) {
947
+ return encoder.call(this, value, encode$2);
948
+ } : encode$2;
949
+ return this._pairs.map(function each(pair) {
950
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
951
+ }, '').join('&');
1151
952
  };
1152
953
 
1153
954
  /**
@@ -1157,17 +958,9 @@ prototype$2.toString = function toString(encoder) {
1157
958
  * @param {string} val The value to be encoded.
1158
959
  *
1159
960
  * @returns {string} The encoded value.
1160
- */
1161
- function encode$1(val) {
1162
- return encodeURIComponent(val).
1163
- replace(/%3A/gi, ':').
1164
- replace(/%24/g, '$').
1165
- replace(/%2C/gi, ',').
1166
- replace(/%20/g, '+').
1167
- replace(/%5B/gi, '[').
1168
- replace(/%5D/gi, ']');
1169
- }
1170
-
961
+ */ function encode$1(val) {
962
+ return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']');
963
+ }
1171
964
  /**
1172
965
  * Build a URL by appending params to the end
1173
966
  *
@@ -1176,87 +969,66 @@ function encode$1(val) {
1176
969
  * @param {?object} options
1177
970
  *
1178
971
  * @returns {string} The formatted url
1179
- */
1180
- function buildURL(url, params, options) {
1181
- /*eslint no-param-reassign:0*/
1182
- if (!params) {
1183
- return url;
1184
- }
1185
-
1186
- const _encode = options && options.encode || encode$1;
1187
-
1188
- const serializeFn = options && options.serialize;
1189
-
1190
- let serializedParams;
1191
-
1192
- if (serializeFn) {
1193
- serializedParams = serializeFn(params, options);
1194
- } else {
1195
- serializedParams = utils$2.isURLSearchParams(params) ?
1196
- params.toString() :
1197
- new AxiosURLSearchParams$1(params, options).toString(_encode);
1198
- }
1199
-
1200
- if (serializedParams) {
1201
- const hashmarkIndex = url.indexOf("#");
1202
-
1203
- if (hashmarkIndex !== -1) {
1204
- url = url.slice(0, hashmarkIndex);
1205
- }
1206
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1207
- }
1208
-
1209
- return url;
972
+ */ function buildURL(url, params, options) {
973
+ /*eslint no-param-reassign:0*/ if (!params) {
974
+ return url;
975
+ }
976
+ const _encode = options && options.encode || encode$1;
977
+ const serializeFn = options && options.serialize;
978
+ let serializedParams;
979
+ if (serializeFn) {
980
+ serializedParams = serializeFn(params, options);
981
+ } else {
982
+ serializedParams = utils$2.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams$1(params, options).toString(_encode);
983
+ }
984
+ if (serializedParams) {
985
+ const hashmarkIndex = url.indexOf("#");
986
+ if (hashmarkIndex !== -1) {
987
+ url = url.slice(0, hashmarkIndex);
988
+ }
989
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
990
+ }
991
+ return url;
1210
992
  }
1211
993
 
1212
- class InterceptorManager {
1213
- constructor() {
1214
- this.handlers = [];
1215
- }
1216
-
1217
- /**
994
+ let InterceptorManager = class InterceptorManager {
995
+ /**
1218
996
  * Add a new interceptor to the stack
1219
997
  *
1220
998
  * @param {Function} fulfilled The function to handle `then` for a `Promise`
1221
999
  * @param {Function} rejected The function to handle `reject` for a `Promise`
1222
1000
  *
1223
1001
  * @return {Number} An ID used to remove interceptor later
1224
- */
1225
- use(fulfilled, rejected, options) {
1226
- this.handlers.push({
1227
- fulfilled,
1228
- rejected,
1229
- synchronous: options ? options.synchronous : false,
1230
- runWhen: options ? options.runWhen : null
1231
- });
1232
- return this.handlers.length - 1;
1233
- }
1234
-
1235
- /**
1002
+ */ use(fulfilled, rejected, options) {
1003
+ this.handlers.push({
1004
+ fulfilled,
1005
+ rejected,
1006
+ synchronous: options ? options.synchronous : false,
1007
+ runWhen: options ? options.runWhen : null
1008
+ });
1009
+ return this.handlers.length - 1;
1010
+ }
1011
+ /**
1236
1012
  * Remove an interceptor from the stack
1237
1013
  *
1238
1014
  * @param {Number} id The ID that was returned by `use`
1239
1015
  *
1240
1016
  * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
1241
- */
1242
- eject(id) {
1243
- if (this.handlers[id]) {
1244
- this.handlers[id] = null;
1245
- }
1246
- }
1247
-
1248
- /**
1017
+ */ eject(id) {
1018
+ if (this.handlers[id]) {
1019
+ this.handlers[id] = null;
1020
+ }
1021
+ }
1022
+ /**
1249
1023
  * Clear all interceptors from the stack
1250
1024
  *
1251
1025
  * @returns {void}
1252
- */
1253
- clear() {
1254
- if (this.handlers) {
1255
- this.handlers = [];
1256
- }
1257
- }
1258
-
1259
- /**
1026
+ */ clear() {
1027
+ if (this.handlers) {
1028
+ this.handlers = [];
1029
+ }
1030
+ }
1031
+ /**
1260
1032
  * Iterate over all the registered interceptors
1261
1033
  *
1262
1034
  * This method is particularly useful for skipping over any
@@ -1265,22 +1037,23 @@ class InterceptorManager {
1265
1037
  * @param {Function} fn The function to call for each interceptor
1266
1038
  *
1267
1039
  * @returns {void}
1268
- */
1269
- forEach(fn) {
1270
- utils$2.forEach(this.handlers, function forEachHandler(h) {
1271
- if (h !== null) {
1272
- fn(h);
1273
- }
1274
- });
1275
- }
1276
- }
1277
-
1040
+ */ forEach(fn) {
1041
+ utils$2.forEach(this.handlers, function forEachHandler(h) {
1042
+ if (h !== null) {
1043
+ fn(h);
1044
+ }
1045
+ });
1046
+ }
1047
+ constructor(){
1048
+ this.handlers = [];
1049
+ }
1050
+ };
1278
1051
  const InterceptorManager$1 = InterceptorManager;
1279
1052
 
1280
- const transitionalDefaults = {
1281
- silentJSONParsing: true,
1282
- forcedJSONParsing: true,
1283
- clarifyTimeoutError: false
1053
+ const transitionalDefaults = {
1054
+ silentJSONParsing: true,
1055
+ forcedJSONParsing: true,
1056
+ clarifyTimeoutError: false
1284
1057
  };
1285
1058
 
1286
1059
  function bind(fn, thisArg) {
@@ -2147,8 +1920,7 @@ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop)
2147
1920
  // eslint-disable-next-line no-param-reassign
2148
1921
  key = removeBrackets(key);
2149
1922
  arr.forEach(function each(el, index) {
2150
- !(utils$1.isUndefined(el) || el === null) && formData.append(// eslint-disable-next-line no-nested-ternary
2151
- indexes === true ? renderKey([
1923
+ !(utils$1.isUndefined(el) || el === null) && formData.append(indexes === true ? renderKey([
2152
1924
  key
2153
1925
  ], index, dots) : indexes === null ? key : key + '[]', convertValue(el));
2154
1926
  });
@@ -2261,10 +2033,8 @@ const platform$1 = {
2261
2033
  ]
2262
2034
  };
2263
2035
 
2264
- const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
2265
-
2266
- const _navigator = typeof navigator === 'object' && navigator || undefined;
2267
-
2036
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
2037
+ const _navigator = typeof navigator === 'object' && navigator || undefined;
2268
2038
  /**
2269
2039
  * Determine if we're running in a standard browser environment
2270
2040
  *
@@ -2281,10 +2051,11 @@ const _navigator = typeof navigator === 'object' && navigator || undefined;
2281
2051
  * navigator.product -> 'NativeScript' or 'NS'
2282
2052
  *
2283
2053
  * @returns {boolean}
2284
- */
2285
- const hasStandardBrowserEnv = hasBrowserEnv &&
2286
- (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
2287
-
2054
+ */ const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || [
2055
+ 'ReactNative',
2056
+ 'NativeScript',
2057
+ 'NS'
2058
+ ].indexOf(_navigator.product) < 0);
2288
2059
  /**
2289
2060
  * Determine if we're running in a standard browser webWorker environment
2290
2061
  *
@@ -2293,16 +2064,10 @@ const hasStandardBrowserEnv = hasBrowserEnv &&
2293
2064
  * filtered out due to its judgment standard
2294
2065
  * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
2295
2066
  * This leads to a problem when axios post `FormData` in webWorker
2296
- */
2297
- const hasStandardBrowserWebWorkerEnv = (() => {
2298
- return (
2299
- typeof WorkerGlobalScope !== 'undefined' &&
2300
- // eslint-disable-next-line no-undef
2301
- self instanceof WorkerGlobalScope &&
2302
- typeof self.importScripts === 'function'
2303
- );
2304
- })();
2305
-
2067
+ */ const hasStandardBrowserWebWorkerEnv = (()=>{
2068
+ return typeof WorkerGlobalScope !== 'undefined' && // eslint-disable-next-line no-undef
2069
+ self instanceof WorkerGlobalScope && typeof self.importScripts === 'function';
2070
+ })();
2306
2071
  const origin = hasBrowserEnv && window.location.href || 'http://localhost';
2307
2072
 
2308
2073
  const utils = /*#__PURE__*/Object.freeze({
@@ -2314,22 +2079,21 @@ const utils = /*#__PURE__*/Object.freeze({
2314
2079
  origin: origin
2315
2080
  });
2316
2081
 
2317
- const platform = {
2318
- ...utils,
2319
- ...platform$1
2082
+ const platform = {
2083
+ ...utils,
2084
+ ...platform$1
2320
2085
  };
2321
2086
 
2322
- function toURLEncodedForm(data, options) {
2323
- return toFormData$2(data, new platform.classes.URLSearchParams(), Object.assign({
2324
- visitor: function(value, key, path, helpers) {
2325
- if (platform.isNode && utils$2.isBuffer(value)) {
2326
- this.append(key, value.toString('base64'));
2327
- return false;
2328
- }
2329
-
2330
- return helpers.defaultVisitor.apply(this, arguments);
2331
- }
2332
- }, options));
2087
+ function toURLEncodedForm(data, options) {
2088
+ return toFormData$2(data, new platform.classes.URLSearchParams(), Object.assign({
2089
+ visitor: function(value, key, path, helpers) {
2090
+ if (platform.isNode && utils$2.isBuffer(value)) {
2091
+ this.append(key, value.toString('base64'));
2092
+ return false;
2093
+ }
2094
+ return helpers.defaultVisitor.apply(this, arguments);
2095
+ }
2096
+ }, options));
2333
2097
  }
2334
2098
 
2335
2099
  /**
@@ -2338,88 +2102,74 @@ function toURLEncodedForm(data, options) {
2338
2102
  * @param {string} name - The name of the property to get.
2339
2103
  *
2340
2104
  * @returns An array of strings.
2341
- */
2342
- function parsePropPath(name) {
2343
- // foo[x][y][z]
2344
- // foo.x.y.z
2345
- // foo-x-y-z
2346
- // foo x y z
2347
- return utils$2.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
2348
- return match[0] === '[]' ? '' : match[1] || match[0];
2349
- });
2350
- }
2351
-
2105
+ */ function parsePropPath(name) {
2106
+ // foo[x][y][z]
2107
+ // foo.x.y.z
2108
+ // foo-x-y-z
2109
+ // foo x y z
2110
+ return utils$2.matchAll(/\w+|\[(\w*)]/g, name).map((match)=>{
2111
+ return match[0] === '[]' ? '' : match[1] || match[0];
2112
+ });
2113
+ }
2352
2114
  /**
2353
2115
  * Convert an array to an object.
2354
2116
  *
2355
2117
  * @param {Array<any>} arr - The array to convert to an object.
2356
2118
  *
2357
2119
  * @returns An object with the same keys and values as the array.
2358
- */
2359
- function arrayToObject(arr) {
2360
- const obj = {};
2361
- const keys = Object.keys(arr);
2362
- let i;
2363
- const len = keys.length;
2364
- let key;
2365
- for (i = 0; i < len; i++) {
2366
- key = keys[i];
2367
- obj[key] = arr[key];
2368
- }
2369
- return obj;
2370
- }
2371
-
2120
+ */ function arrayToObject(arr) {
2121
+ const obj = {};
2122
+ const keys = Object.keys(arr);
2123
+ let i;
2124
+ const len = keys.length;
2125
+ let key;
2126
+ for(i = 0; i < len; i++){
2127
+ key = keys[i];
2128
+ obj[key] = arr[key];
2129
+ }
2130
+ return obj;
2131
+ }
2372
2132
  /**
2373
2133
  * It takes a FormData object and returns a JavaScript object
2374
2134
  *
2375
2135
  * @param {string} formData The FormData object to convert to JSON.
2376
2136
  *
2377
2137
  * @returns {Object<string, any> | null} The converted object.
2378
- */
2379
- function formDataToJSON(formData) {
2380
- function buildPath(path, value, target, index) {
2381
- let name = path[index++];
2382
-
2383
- if (name === '__proto__') return true;
2384
-
2385
- const isNumericKey = Number.isFinite(+name);
2386
- const isLast = index >= path.length;
2387
- name = !name && utils$2.isArray(target) ? target.length : name;
2388
-
2389
- if (isLast) {
2390
- if (utils$2.hasOwnProp(target, name)) {
2391
- target[name] = [target[name], value];
2392
- } else {
2393
- target[name] = value;
2394
- }
2395
-
2396
- return !isNumericKey;
2397
- }
2398
-
2399
- if (!target[name] || !utils$2.isObject(target[name])) {
2400
- target[name] = [];
2401
- }
2402
-
2403
- const result = buildPath(path, value, target[name], index);
2404
-
2405
- if (result && utils$2.isArray(target[name])) {
2406
- target[name] = arrayToObject(target[name]);
2407
- }
2408
-
2409
- return !isNumericKey;
2410
- }
2411
-
2412
- if (utils$2.isFormData(formData) && utils$2.isFunction(formData.entries)) {
2413
- const obj = {};
2414
-
2415
- utils$2.forEachEntry(formData, (name, value) => {
2416
- buildPath(parsePropPath(name), value, obj, 0);
2417
- });
2418
-
2419
- return obj;
2420
- }
2421
-
2422
- return null;
2138
+ */ function formDataToJSON(formData) {
2139
+ function buildPath(path, value, target, index) {
2140
+ let name = path[index++];
2141
+ if (name === '__proto__') return true;
2142
+ const isNumericKey = Number.isFinite(+name);
2143
+ const isLast = index >= path.length;
2144
+ name = !name && utils$2.isArray(target) ? target.length : name;
2145
+ if (isLast) {
2146
+ if (utils$2.hasOwnProp(target, name)) {
2147
+ target[name] = [
2148
+ target[name],
2149
+ value
2150
+ ];
2151
+ } else {
2152
+ target[name] = value;
2153
+ }
2154
+ return !isNumericKey;
2155
+ }
2156
+ if (!target[name] || !utils$2.isObject(target[name])) {
2157
+ target[name] = [];
2158
+ }
2159
+ const result = buildPath(path, value, target[name], index);
2160
+ if (result && utils$2.isArray(target[name])) {
2161
+ target[name] = arrayToObject(target[name]);
2162
+ }
2163
+ return !isNumericKey;
2164
+ }
2165
+ if (utils$2.isFormData(formData) && utils$2.isFunction(formData.entries)) {
2166
+ const obj = {};
2167
+ utils$2.forEachEntry(formData, (name, value)=>{
2168
+ buildPath(parsePropPath(name), value, obj, 0);
2169
+ });
2170
+ return obj;
2171
+ }
2172
+ return null;
2423
2173
  }
2424
2174
 
2425
2175
  /**
@@ -2431,158 +2181,147 @@ function formDataToJSON(formData) {
2431
2181
  * @param {Function} encoder - A function that takes a value and returns a string.
2432
2182
  *
2433
2183
  * @returns {string} A stringified version of the rawValue.
2434
- */
2435
- function stringifySafely(rawValue, parser, encoder) {
2436
- if (utils$2.isString(rawValue)) {
2437
- try {
2438
- (parser || JSON.parse)(rawValue);
2439
- return utils$2.trim(rawValue);
2440
- } catch (e) {
2441
- if (e.name !== 'SyntaxError') {
2442
- throw e;
2443
- }
2444
- }
2445
- }
2446
-
2447
- return (encoder || JSON.stringify)(rawValue);
2448
- }
2449
-
2450
- const defaults = {
2451
-
2452
- transitional: transitionalDefaults,
2453
-
2454
- adapter: ['xhr', 'http', 'fetch'],
2455
-
2456
- transformRequest: [function transformRequest(data, headers) {
2457
- const contentType = headers.getContentType() || '';
2458
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
2459
- const isObjectPayload = utils$2.isObject(data);
2460
-
2461
- if (isObjectPayload && utils$2.isHTMLForm(data)) {
2462
- data = new FormData(data);
2463
- }
2464
-
2465
- const isFormData = utils$2.isFormData(data);
2466
-
2467
- if (isFormData) {
2468
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
2469
- }
2470
-
2471
- if (utils$2.isArrayBuffer(data) ||
2472
- utils$2.isBuffer(data) ||
2473
- utils$2.isStream(data) ||
2474
- utils$2.isFile(data) ||
2475
- utils$2.isBlob(data) ||
2476
- utils$2.isReadableStream(data)
2477
- ) {
2478
- return data;
2479
- }
2480
- if (utils$2.isArrayBufferView(data)) {
2481
- return data.buffer;
2482
- }
2483
- if (utils$2.isURLSearchParams(data)) {
2484
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
2485
- return data.toString();
2486
- }
2487
-
2488
- let isFileList;
2489
-
2490
- if (isObjectPayload) {
2491
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
2492
- return toURLEncodedForm(data, this.formSerializer).toString();
2493
- }
2494
-
2495
- if ((isFileList = utils$2.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
2496
- const _FormData = this.env && this.env.FormData;
2497
-
2498
- return toFormData$2(
2499
- isFileList ? {'files[]': data} : data,
2500
- _FormData && new _FormData(),
2501
- this.formSerializer
2502
- );
2503
- }
2504
- }
2505
-
2506
- if (isObjectPayload || hasJSONContentType) {
2507
- headers.setContentType('application/json', false);
2508
- return stringifySafely(data);
2509
- }
2510
-
2511
- return data;
2512
- }],
2513
-
2514
- transformResponse: [function transformResponse(data) {
2515
- const transitional = this.transitional || defaults.transitional;
2516
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
2517
- const JSONRequested = this.responseType === 'json';
2518
-
2519
- if (utils$2.isResponse(data) || utils$2.isReadableStream(data)) {
2520
- return data;
2521
- }
2522
-
2523
- if (data && utils$2.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
2524
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
2525
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
2526
-
2527
- try {
2528
- return JSON.parse(data);
2529
- } catch (e) {
2530
- if (strictJSONParsing) {
2531
- if (e.name === 'SyntaxError') {
2532
- throw AxiosError$2.from(e, AxiosError$2.ERR_BAD_RESPONSE, this, null, this.response);
2533
- }
2534
- throw e;
2535
- }
2536
- }
2537
- }
2538
-
2539
- return data;
2540
- }],
2541
-
2542
- /**
2184
+ */ function stringifySafely(rawValue, parser, encoder) {
2185
+ if (utils$2.isString(rawValue)) {
2186
+ try {
2187
+ (parser || JSON.parse)(rawValue);
2188
+ return utils$2.trim(rawValue);
2189
+ } catch (e) {
2190
+ if (e.name !== 'SyntaxError') {
2191
+ throw e;
2192
+ }
2193
+ }
2194
+ }
2195
+ return (encoder || JSON.stringify)(rawValue);
2196
+ }
2197
+ const defaults = {
2198
+ transitional: transitionalDefaults,
2199
+ adapter: [
2200
+ 'xhr',
2201
+ 'http',
2202
+ 'fetch'
2203
+ ],
2204
+ transformRequest: [
2205
+ function transformRequest(data, headers) {
2206
+ const contentType = headers.getContentType() || '';
2207
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
2208
+ const isObjectPayload = utils$2.isObject(data);
2209
+ if (isObjectPayload && utils$2.isHTMLForm(data)) {
2210
+ data = new FormData(data);
2211
+ }
2212
+ const isFormData = utils$2.isFormData(data);
2213
+ if (isFormData) {
2214
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
2215
+ }
2216
+ if (utils$2.isArrayBuffer(data) || utils$2.isBuffer(data) || utils$2.isStream(data) || utils$2.isFile(data) || utils$2.isBlob(data) || utils$2.isReadableStream(data)) {
2217
+ return data;
2218
+ }
2219
+ if (utils$2.isArrayBufferView(data)) {
2220
+ return data.buffer;
2221
+ }
2222
+ if (utils$2.isURLSearchParams(data)) {
2223
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
2224
+ return data.toString();
2225
+ }
2226
+ let isFileList;
2227
+ if (isObjectPayload) {
2228
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
2229
+ return toURLEncodedForm(data, this.formSerializer).toString();
2230
+ }
2231
+ if ((isFileList = utils$2.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
2232
+ const _FormData = this.env && this.env.FormData;
2233
+ return toFormData$2(isFileList ? {
2234
+ 'files[]': data
2235
+ } : data, _FormData && new _FormData(), this.formSerializer);
2236
+ }
2237
+ }
2238
+ if (isObjectPayload || hasJSONContentType) {
2239
+ headers.setContentType('application/json', false);
2240
+ return stringifySafely(data);
2241
+ }
2242
+ return data;
2243
+ }
2244
+ ],
2245
+ transformResponse: [
2246
+ function transformResponse(data) {
2247
+ const transitional = this.transitional || defaults.transitional;
2248
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
2249
+ const JSONRequested = this.responseType === 'json';
2250
+ if (utils$2.isResponse(data) || utils$2.isReadableStream(data)) {
2251
+ return data;
2252
+ }
2253
+ if (data && utils$2.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
2254
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
2255
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
2256
+ try {
2257
+ return JSON.parse(data);
2258
+ } catch (e) {
2259
+ if (strictJSONParsing) {
2260
+ if (e.name === 'SyntaxError') {
2261
+ throw AxiosError$2.from(e, AxiosError$2.ERR_BAD_RESPONSE, this, null, this.response);
2262
+ }
2263
+ throw e;
2264
+ }
2265
+ }
2266
+ }
2267
+ return data;
2268
+ }
2269
+ ],
2270
+ /**
2543
2271
  * A timeout in milliseconds to abort a request. If set to 0 (default) a
2544
2272
  * timeout is not created.
2545
- */
2546
- timeout: 0,
2547
-
2548
- xsrfCookieName: 'XSRF-TOKEN',
2549
- xsrfHeaderName: 'X-XSRF-TOKEN',
2550
-
2551
- maxContentLength: -1,
2552
- maxBodyLength: -1,
2553
-
2554
- env: {
2555
- FormData: platform.classes.FormData,
2556
- Blob: platform.classes.Blob
2557
- },
2558
-
2559
- validateStatus: function validateStatus(status) {
2560
- return status >= 200 && status < 300;
2561
- },
2562
-
2563
- headers: {
2564
- common: {
2565
- 'Accept': 'application/json, text/plain, */*',
2566
- 'Content-Type': undefined
2567
- }
2568
- }
2569
- };
2570
-
2571
- utils$2.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
2572
- defaults.headers[method] = {};
2573
- });
2574
-
2273
+ */ timeout: 0,
2274
+ xsrfCookieName: 'XSRF-TOKEN',
2275
+ xsrfHeaderName: 'X-XSRF-TOKEN',
2276
+ maxContentLength: -1,
2277
+ maxBodyLength: -1,
2278
+ env: {
2279
+ FormData: platform.classes.FormData,
2280
+ Blob: platform.classes.Blob
2281
+ },
2282
+ validateStatus: function validateStatus(status) {
2283
+ return status >= 200 && status < 300;
2284
+ },
2285
+ headers: {
2286
+ common: {
2287
+ 'Accept': 'application/json, text/plain, */*',
2288
+ 'Content-Type': undefined
2289
+ }
2290
+ }
2291
+ };
2292
+ utils$2.forEach([
2293
+ 'delete',
2294
+ 'get',
2295
+ 'head',
2296
+ 'post',
2297
+ 'put',
2298
+ 'patch'
2299
+ ], (method)=>{
2300
+ defaults.headers[method] = {};
2301
+ });
2575
2302
  const defaults$1 = defaults;
2576
2303
 
2577
- // RawAxiosHeaders whose duplicates are ignored by node
2578
- // c.f. https://nodejs.org/api/http.html#http_message_headers
2579
- const ignoreDuplicateOf = utils$2.toObjectSet([
2580
- 'age', 'authorization', 'content-length', 'content-type', 'etag',
2581
- 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
2582
- 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
2583
- 'referer', 'retry-after', 'user-agent'
2584
- ]);
2585
-
2304
+ // RawAxiosHeaders whose duplicates are ignored by node
2305
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
2306
+ const ignoreDuplicateOf = utils$2.toObjectSet([
2307
+ 'age',
2308
+ 'authorization',
2309
+ 'content-length',
2310
+ 'content-type',
2311
+ 'etag',
2312
+ 'expires',
2313
+ 'from',
2314
+ 'host',
2315
+ 'if-modified-since',
2316
+ 'if-unmodified-since',
2317
+ 'last-modified',
2318
+ 'location',
2319
+ 'max-forwards',
2320
+ 'proxy-authorization',
2321
+ 'referer',
2322
+ 'retry-after',
2323
+ 'user-agent'
2324
+ ]);
2586
2325
  /**
2587
2326
  * Parse headers into an object
2588
2327
  *
@@ -2596,346 +2335,270 @@ const ignoreDuplicateOf = utils$2.toObjectSet([
2596
2335
  * @param {String} rawHeaders Headers needing to be parsed
2597
2336
  *
2598
2337
  * @returns {Object} Headers parsed into an object
2599
- */
2600
- const parseHeaders = rawHeaders => {
2601
- const parsed = {};
2602
- let key;
2603
- let val;
2604
- let i;
2605
-
2606
- rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
2607
- i = line.indexOf(':');
2608
- key = line.substring(0, i).trim().toLowerCase();
2609
- val = line.substring(i + 1).trim();
2610
-
2611
- if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
2612
- return;
2613
- }
2614
-
2615
- if (key === 'set-cookie') {
2616
- if (parsed[key]) {
2617
- parsed[key].push(val);
2618
- } else {
2619
- parsed[key] = [val];
2620
- }
2621
- } else {
2622
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
2623
- }
2624
- });
2625
-
2626
- return parsed;
2627
- };
2338
+ */ const parseHeaders = ((rawHeaders)=>{
2339
+ const parsed = {};
2340
+ let key;
2341
+ let val;
2342
+ let i;
2343
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
2344
+ i = line.indexOf(':');
2345
+ key = line.substring(0, i).trim().toLowerCase();
2346
+ val = line.substring(i + 1).trim();
2347
+ if (!key || parsed[key] && ignoreDuplicateOf[key]) {
2348
+ return;
2349
+ }
2350
+ if (key === 'set-cookie') {
2351
+ if (parsed[key]) {
2352
+ parsed[key].push(val);
2353
+ } else {
2354
+ parsed[key] = [
2355
+ val
2356
+ ];
2357
+ }
2358
+ } else {
2359
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
2360
+ }
2361
+ });
2362
+ return parsed;
2363
+ });
2628
2364
 
2629
- const $internals = Symbol('internals');
2630
-
2631
- function normalizeHeader(header) {
2632
- return header && String(header).trim().toLowerCase();
2633
- }
2634
-
2635
- function normalizeValue(value) {
2636
- if (value === false || value == null) {
2637
- return value;
2638
- }
2639
-
2640
- return utils$2.isArray(value) ? value.map(normalizeValue) : String(value);
2641
- }
2642
-
2643
- function parseTokens(str) {
2644
- const tokens = Object.create(null);
2645
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
2646
- let match;
2647
-
2648
- while ((match = tokensRE.exec(str))) {
2649
- tokens[match[1]] = match[2];
2650
- }
2651
-
2652
- return tokens;
2653
- }
2654
-
2655
- const isValidHeaderName = str => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
2656
-
2657
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
2658
- if (utils$2.isFunction(filter)) {
2659
- return filter.call(this, value, header);
2660
- }
2661
-
2662
- if (isHeaderNameFilter) {
2663
- value = header;
2664
- }
2665
-
2666
- if (!utils$2.isString(value)) return;
2667
-
2668
- if (utils$2.isString(filter)) {
2669
- return value.indexOf(filter) !== -1;
2670
- }
2671
-
2672
- if (utils$2.isRegExp(filter)) {
2673
- return filter.test(value);
2674
- }
2675
- }
2676
-
2677
- function formatHeader(header) {
2678
- return header
2679
- .trim()
2680
- .toLowerCase()
2681
- .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
2682
- return char.toUpperCase() + str;
2683
- });
2684
- }
2685
-
2686
- function buildAccessors(obj, header) {
2687
- const accessorName = utils$2.toCamelCase(' ' + header);
2688
- ['get', 'set', 'has'].forEach(methodName => {
2689
- Object.defineProperty(obj, methodName + accessorName, {
2690
- value: function (arg1, arg2, arg3) {
2691
- return this[methodName].call(this, header, arg1, arg2, arg3);
2692
- },
2693
- configurable: true,
2694
- });
2695
- });
2696
- }
2697
-
2698
- let AxiosHeaders$1 = class AxiosHeaders {
2699
- constructor(headers) {
2700
- headers && this.set(headers);
2701
- }
2702
-
2703
- /**
2365
+ const $internals = Symbol('internals');
2366
+ function normalizeHeader(header) {
2367
+ return header && String(header).trim().toLowerCase();
2368
+ }
2369
+ function normalizeValue(value) {
2370
+ if (value === false || value == null) {
2371
+ return value;
2372
+ }
2373
+ return utils$2.isArray(value) ? value.map(normalizeValue) : String(value);
2374
+ }
2375
+ function parseTokens(str) {
2376
+ const tokens = Object.create(null);
2377
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
2378
+ let match;
2379
+ while(match = tokensRE.exec(str)){
2380
+ tokens[match[1]] = match[2];
2381
+ }
2382
+ return tokens;
2383
+ }
2384
+ const isValidHeaderName = (str)=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
2385
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
2386
+ if (utils$2.isFunction(filter)) {
2387
+ return filter.call(this, value, header);
2388
+ }
2389
+ if (isHeaderNameFilter) {
2390
+ value = header;
2391
+ }
2392
+ if (!utils$2.isString(value)) return;
2393
+ if (utils$2.isString(filter)) {
2394
+ return value.indexOf(filter) !== -1;
2395
+ }
2396
+ if (utils$2.isRegExp(filter)) {
2397
+ return filter.test(value);
2398
+ }
2399
+ }
2400
+ function formatHeader(header) {
2401
+ return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str)=>{
2402
+ return char.toUpperCase() + str;
2403
+ });
2404
+ }
2405
+ function buildAccessors(obj, header) {
2406
+ const accessorName = utils$2.toCamelCase(' ' + header);
2407
+ [
2408
+ 'get',
2409
+ 'set',
2410
+ 'has'
2411
+ ].forEach((methodName)=>{
2412
+ Object.defineProperty(obj, methodName + accessorName, {
2413
+ value: function(arg1, arg2, arg3) {
2414
+ return this[methodName].call(this, header, arg1, arg2, arg3);
2415
+ },
2416
+ configurable: true
2417
+ });
2418
+ });
2419
+ }
2420
+ let AxiosHeaders$1 = class AxiosHeaders {
2421
+ /**
2704
2422
  *
2705
2423
  * @param {*} header
2706
2424
  * @param {*} valueOrRewrite
2707
2425
  * @param {*} rewrite true:无论源值是否存在均赋值,false:源值如存在不覆盖,
2708
2426
  * undefined:源值不为 false 直接赋值,false 不赋值
2709
2427
  * @returns
2710
- */
2711
- set(header, valueOrRewrite, rewrite) {
2712
- const self = this;
2713
-
2714
- function setHeader(_value, _header, _rewrite) {
2715
- const lHeader = normalizeHeader(_header);
2716
-
2717
- if (!lHeader) {
2718
- throw new Error('header name must be a non-empty string');
2719
- }
2720
-
2721
- const key = utils$2.findKey(self, lHeader);
2722
-
2723
- if (!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
2724
- self[key || _header] = normalizeValue(_value);
2725
- }
2726
- }
2727
-
2728
- const setHeaders = (headers, _rewrite) =>
2729
- utils$2.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
2730
-
2731
- if (utils$2.isPlainObject(header) || header instanceof this.constructor) {
2732
- setHeaders(header, valueOrRewrite);
2733
- } else if (utils$2.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
2734
- setHeaders(parseHeaders(header), valueOrRewrite);
2735
- } else if (utils$2.isHeaders(header)) {
2736
- for (const [key, value] of header.entries()) {
2737
- setHeader(value, key, rewrite);
2738
- }
2739
- } else {
2740
- header != null && setHeader(valueOrRewrite, header, rewrite);
2741
- }
2742
-
2743
- return this;
2744
- }
2745
-
2746
- get(header, parser) {
2747
- header = normalizeHeader(header);
2748
-
2749
- if (header) {
2750
- const key = utils$2.findKey(this, header);
2751
-
2752
- if (key) {
2753
- const value = this[key];
2754
-
2755
- if (!parser) {
2756
- return value;
2757
- }
2758
-
2759
- if (parser === true) {
2760
- return parseTokens(value);
2761
- }
2762
-
2763
- if (utils$2.isFunction(parser)) {
2764
- return parser.call(this, value, key);
2765
- }
2766
-
2767
- if (utils$2.isRegExp(parser)) {
2768
- return parser.exec(value);
2769
- }
2770
-
2771
- throw new TypeError('parser must be boolean|regexp|function');
2772
- }
2773
- }
2774
- }
2775
-
2776
- has(header, matcher) {
2777
- header = normalizeHeader(header);
2778
-
2779
- if (header) {
2780
- const key = utils$2.findKey(this, header);
2781
-
2782
- return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
2783
- }
2784
-
2785
- return false;
2786
- }
2787
-
2788
- delete(header, matcher) {
2789
- const self = this;
2790
- let deleted = false;
2791
-
2792
- function deleteHeader(_header) {
2793
- _header = normalizeHeader(_header);
2794
-
2795
- if (_header) {
2796
- const key = utils$2.findKey(self, _header);
2797
-
2798
- if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
2799
- delete self[key];
2800
-
2801
- deleted = true;
2802
- }
2803
- }
2804
- }
2805
-
2806
- if (utils$2.isArray(header)) {
2807
- header.forEach(deleteHeader);
2808
- } else {
2809
- deleteHeader(header);
2810
- }
2811
-
2812
- return deleted;
2813
- }
2814
-
2815
- clear(matcher) {
2816
- const keys = Object.keys(this);
2817
- let i = keys.length;
2818
- let deleted = false;
2819
-
2820
- while (i--) {
2821
- const key = keys[i];
2822
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
2823
- delete this[key];
2824
- deleted = true;
2825
- }
2826
- }
2827
-
2828
- return deleted;
2829
- }
2830
-
2831
- normalize(format) {
2832
- const self = this;
2833
- const headers = {};
2834
-
2835
- utils$2.forEach(this, (value, header) => {
2836
- const key = utils$2.findKey(headers, header);
2837
-
2838
- if (key) {
2839
- self[key] = normalizeValue(value);
2840
- delete self[header];
2841
- return;
2842
- }
2843
-
2844
- const normalized = format ? formatHeader(header) : String(header).trim();
2845
-
2846
- if (normalized !== header) {
2847
- delete self[header];
2848
- }
2849
-
2850
- self[normalized] = normalizeValue(value);
2851
-
2852
- headers[normalized] = true;
2853
- });
2854
-
2855
- return this;
2856
- }
2857
-
2858
- concat(...targets) {
2859
- return this.constructor.concat(this, ...targets);
2860
- }
2861
-
2862
- toJSON(asStrings) {
2863
- const obj = Object.create(null);
2864
-
2865
- utils$2.forEach(this, (value, header) => {
2866
- value != null && value !== false && (obj[header] = asStrings && utils$2.isArray(value) ? value.join(', ') : value);
2867
- });
2868
-
2869
- return obj;
2870
- }
2871
-
2872
- [Symbol.iterator]() {
2873
- return Object.entries(this.toJSON())[Symbol.iterator]();
2874
- }
2875
-
2876
- toString() {
2877
- return Object.entries(this.toJSON())
2878
- .map(([header, value]) => header + ': ' + value)
2879
- .join('\n');
2880
- }
2881
-
2882
- get [Symbol.toStringTag]() {
2883
- return 'AxiosHeaders';
2884
- }
2885
-
2886
- static from(thing) {
2887
- return thing instanceof this ? thing : new this(thing);
2888
- }
2889
-
2890
- static concat(first, ...targets) {
2891
- const computed = new this(first);
2892
-
2893
- targets.forEach(target => computed.set(target));
2894
-
2895
- return computed;
2896
- }
2897
-
2898
- static accessor(header) {
2899
- const internals =
2900
- (this[$internals] =
2901
- this[$internals] =
2902
- {
2903
- accessors: {},
2904
- });
2905
-
2906
- const accessors = internals.accessors;
2907
- const prototype = this.prototype;
2908
-
2909
- function defineAccessor(_header) {
2910
- const lHeader = normalizeHeader(_header);
2911
-
2912
- if (!accessors[lHeader]) {
2913
- buildAccessors(prototype, _header);
2914
- accessors[lHeader] = true;
2915
- }
2916
- }
2917
-
2918
- utils$2.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
2919
-
2920
- return this;
2921
- }
2922
- };
2923
-
2924
- AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
2925
-
2926
- // reserved names hotfix
2927
- utils$2.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
2928
- let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
2929
- return {
2930
- get: () => value,
2931
- set(headerValue) {
2932
- this[mapped] = headerValue;
2933
- },
2934
- };
2935
- });
2936
-
2937
- utils$2.freezeMethods(AxiosHeaders$1);
2938
-
2428
+ */ set(header, valueOrRewrite, rewrite) {
2429
+ const self = this;
2430
+ function setHeader(_value, _header, _rewrite) {
2431
+ const lHeader = normalizeHeader(_header);
2432
+ if (!lHeader) {
2433
+ throw new Error('header name must be a non-empty string');
2434
+ }
2435
+ const key = utils$2.findKey(self, lHeader);
2436
+ if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) {
2437
+ self[key || _header] = normalizeValue(_value);
2438
+ }
2439
+ }
2440
+ const setHeaders = (headers, _rewrite)=>utils$2.forEach(headers, (_value, _header)=>setHeader(_value, _header, _rewrite));
2441
+ if (utils$2.isPlainObject(header) || header instanceof this.constructor) {
2442
+ setHeaders(header, valueOrRewrite);
2443
+ } else if (utils$2.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
2444
+ setHeaders(parseHeaders(header), valueOrRewrite);
2445
+ } else if (utils$2.isHeaders(header)) {
2446
+ for (const [key, value] of header.entries()){
2447
+ setHeader(value, key, rewrite);
2448
+ }
2449
+ } else {
2450
+ header != null && setHeader(valueOrRewrite, header, rewrite);
2451
+ }
2452
+ return this;
2453
+ }
2454
+ get(header, parser) {
2455
+ header = normalizeHeader(header);
2456
+ if (header) {
2457
+ const key = utils$2.findKey(this, header);
2458
+ if (key) {
2459
+ const value = this[key];
2460
+ if (!parser) {
2461
+ return value;
2462
+ }
2463
+ if (parser === true) {
2464
+ return parseTokens(value);
2465
+ }
2466
+ if (utils$2.isFunction(parser)) {
2467
+ return parser.call(this, value, key);
2468
+ }
2469
+ if (utils$2.isRegExp(parser)) {
2470
+ return parser.exec(value);
2471
+ }
2472
+ throw new TypeError('parser must be boolean|regexp|function');
2473
+ }
2474
+ }
2475
+ }
2476
+ has(header, matcher) {
2477
+ header = normalizeHeader(header);
2478
+ if (header) {
2479
+ const key = utils$2.findKey(this, header);
2480
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
2481
+ }
2482
+ return false;
2483
+ }
2484
+ delete(header, matcher) {
2485
+ const self = this;
2486
+ let deleted = false;
2487
+ function deleteHeader(_header) {
2488
+ _header = normalizeHeader(_header);
2489
+ if (_header) {
2490
+ const key = utils$2.findKey(self, _header);
2491
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
2492
+ delete self[key];
2493
+ deleted = true;
2494
+ }
2495
+ }
2496
+ }
2497
+ if (utils$2.isArray(header)) {
2498
+ header.forEach(deleteHeader);
2499
+ } else {
2500
+ deleteHeader(header);
2501
+ }
2502
+ return deleted;
2503
+ }
2504
+ clear(matcher) {
2505
+ const keys = Object.keys(this);
2506
+ let i = keys.length;
2507
+ let deleted = false;
2508
+ while(i--){
2509
+ const key = keys[i];
2510
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
2511
+ delete this[key];
2512
+ deleted = true;
2513
+ }
2514
+ }
2515
+ return deleted;
2516
+ }
2517
+ normalize(format) {
2518
+ const self = this;
2519
+ const headers = {};
2520
+ utils$2.forEach(this, (value, header)=>{
2521
+ const key = utils$2.findKey(headers, header);
2522
+ if (key) {
2523
+ self[key] = normalizeValue(value);
2524
+ delete self[header];
2525
+ return;
2526
+ }
2527
+ const normalized = format ? formatHeader(header) : String(header).trim();
2528
+ if (normalized !== header) {
2529
+ delete self[header];
2530
+ }
2531
+ self[normalized] = normalizeValue(value);
2532
+ headers[normalized] = true;
2533
+ });
2534
+ return this;
2535
+ }
2536
+ concat(...targets) {
2537
+ return this.constructor.concat(this, ...targets);
2538
+ }
2539
+ toJSON(asStrings) {
2540
+ const obj = Object.create(null);
2541
+ utils$2.forEach(this, (value, header)=>{
2542
+ value != null && value !== false && (obj[header] = asStrings && utils$2.isArray(value) ? value.join(', ') : value);
2543
+ });
2544
+ return obj;
2545
+ }
2546
+ [Symbol.iterator]() {
2547
+ return Object.entries(this.toJSON())[Symbol.iterator]();
2548
+ }
2549
+ toString() {
2550
+ return Object.entries(this.toJSON()).map(([header, value])=>header + ': ' + value).join('\n');
2551
+ }
2552
+ get [Symbol.toStringTag]() {
2553
+ return 'AxiosHeaders';
2554
+ }
2555
+ static from(thing) {
2556
+ return thing instanceof this ? thing : new this(thing);
2557
+ }
2558
+ static concat(first, ...targets) {
2559
+ const computed = new this(first);
2560
+ targets.forEach((target)=>computed.set(target));
2561
+ return computed;
2562
+ }
2563
+ static accessor(header) {
2564
+ const internals = this[$internals] = this[$internals] = {
2565
+ accessors: {}
2566
+ };
2567
+ const accessors = internals.accessors;
2568
+ const prototype = this.prototype;
2569
+ function defineAccessor(_header) {
2570
+ const lHeader = normalizeHeader(_header);
2571
+ if (!accessors[lHeader]) {
2572
+ buildAccessors(prototype, _header);
2573
+ accessors[lHeader] = true;
2574
+ }
2575
+ }
2576
+ utils$2.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
2577
+ return this;
2578
+ }
2579
+ constructor(headers){
2580
+ headers && this.set(headers);
2581
+ }
2582
+ };
2583
+ AxiosHeaders$1.accessor([
2584
+ 'Content-Type',
2585
+ 'Content-Length',
2586
+ 'Accept',
2587
+ 'Accept-Encoding',
2588
+ 'User-Agent',
2589
+ 'Authorization'
2590
+ ]);
2591
+ // reserved names hotfix
2592
+ utils$2.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key)=>{
2593
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
2594
+ return {
2595
+ get: ()=>value,
2596
+ set (headerValue) {
2597
+ this[mapped] = headerValue;
2598
+ }
2599
+ };
2600
+ });
2601
+ utils$2.freezeMethods(AxiosHeaders$1);
2939
2602
  const AxiosHeaders$2 = AxiosHeaders$1;
2940
2603
 
2941
2604
  /**
@@ -2945,24 +2608,20 @@ const AxiosHeaders$2 = AxiosHeaders$1;
2945
2608
  * @param {?Object} response The response object
2946
2609
  *
2947
2610
  * @returns {*} The resulting transformed data
2948
- */
2949
- function transformData(fns, response) {
2950
- const config = this || defaults$1;
2951
- const context = response || config;
2952
- const headers = AxiosHeaders$2.from(context.headers);
2953
- let data = context.data;
2954
-
2955
- utils$2.forEach(fns, function transform(fn) {
2956
- data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
2957
- });
2958
-
2959
- headers.normalize();
2960
-
2961
- return data;
2611
+ */ function transformData(fns, response) {
2612
+ const config = this || defaults$1;
2613
+ const context = response || config;
2614
+ const headers = AxiosHeaders$2.from(context.headers);
2615
+ let data = context.data;
2616
+ utils$2.forEach(fns, function transform(fn) {
2617
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
2618
+ });
2619
+ headers.normalize();
2620
+ return data;
2962
2621
  }
2963
2622
 
2964
- function isCancel$1(value) {
2965
- return !!(value && value.__CANCEL__);
2623
+ function isCancel$1(value) {
2624
+ return !!(value && value.__CANCEL__);
2966
2625
  }
2967
2626
 
2968
2627
  /**
@@ -2973,15 +2632,13 @@ function isCancel$1(value) {
2973
2632
  * @param {Object=} request The request.
2974
2633
  *
2975
2634
  * @returns {CanceledError} The created error.
2976
- */
2977
- function CanceledError$1(message, config, request) {
2978
- // eslint-disable-next-line no-eq-null,eqeqeq
2979
- AxiosError$2.call(this, message == null ? 'canceled' : message, AxiosError$2.ERR_CANCELED, config, request);
2980
- this.name = 'CanceledError';
2981
- }
2982
-
2983
- utils$2.inherits(CanceledError$1, AxiosError$2, {
2984
- __CANCEL__: true
2635
+ */ function CanceledError$1(message, config, request) {
2636
+ // eslint-disable-next-line no-eq-null,eqeqeq
2637
+ AxiosError$2.call(this, message == null ? 'canceled' : message, AxiosError$2.ERR_CANCELED, config, request);
2638
+ this.name = 'CanceledError';
2639
+ }
2640
+ utils$2.inherits(CanceledError$1, AxiosError$2, {
2641
+ __CANCEL__: true
2985
2642
  });
2986
2643
 
2987
2644
  /**
@@ -2990,12 +2647,11 @@ utils$2.inherits(CanceledError$1, AxiosError$2, {
2990
2647
  * @param {string} url The URL to test
2991
2648
  *
2992
2649
  * @returns {boolean} True if the specified URL is absolute, otherwise false
2993
- */
2994
- function isAbsoluteURL(url) {
2995
- // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2996
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2997
- // by any combination of letters, digits, plus, period, or hyphen.
2998
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2650
+ */ function isAbsoluteURL(url) {
2651
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2652
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2653
+ // by any combination of letters, digits, plus, period, or hyphen.
2654
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2999
2655
  }
3000
2656
 
3001
2657
  /**
@@ -3005,11 +2661,8 @@ function isAbsoluteURL(url) {
3005
2661
  * @param {string} relativeURL The relative URL
3006
2662
  *
3007
2663
  * @returns {string} The combined URL
3008
- */
3009
- function combineURLs(baseURL, relativeURL) {
3010
- return relativeURL
3011
- ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
3012
- : baseURL;
2664
+ */ function combineURLs(baseURL, relativeURL) {
2665
+ return relativeURL ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL;
3013
2666
  }
3014
2667
 
3015
2668
  /**
@@ -3021,96 +2674,76 @@ function combineURLs(baseURL, relativeURL) {
3021
2674
  * @param {string} requestedURL Absolute or relative URL to combine
3022
2675
  *
3023
2676
  * @returns {string} The combined full path
3024
- */
3025
- function buildFullPath(baseURL, requestedURL) {
3026
- if (baseURL && !isAbsoluteURL(requestedURL)) {
3027
- return combineURLs(baseURL, requestedURL);
3028
- }
3029
- return requestedURL;
2677
+ */ function buildFullPath(baseURL, requestedURL) {
2678
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
2679
+ return combineURLs(baseURL, requestedURL);
2680
+ }
2681
+ return requestedURL;
3030
2682
  }
3031
2683
 
3032
- const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
3033
- class XhrAdapter {
3034
- constructor(config) {
3035
- this.init(config);
3036
- }
3037
-
3038
- init(config) {}
3039
-
3040
- request() {}
3041
-
3042
- stream() {}
3043
- }
3044
-
2684
+ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
2685
+ let XhrAdapter = class XhrAdapter {
2686
+ init(config) {}
2687
+ request() {}
2688
+ stream() {}
2689
+ constructor(config){
2690
+ this.init(config);
2691
+ }
2692
+ };
3045
2693
  const XhrAdapter$1 = isXHRAdapterSupported && XhrAdapter;
3046
2694
 
3047
- const knownAdapters = {
3048
- http: HttpAdapter, // browser mode: httpAdapter === null
3049
- xhr: XhrAdapter$1, // node mode: xhrAdapter === null
3050
- };
3051
-
2695
+ const knownAdapters = {
2696
+ http: HttpAdapter,
2697
+ xhr: XhrAdapter$1
2698
+ };
3052
2699
  /**
3053
2700
  * define adapter's name and adapterName to http or xhr
3054
2701
  * browser: httpAdapter is null!
3055
- */
3056
- utils$2.forEach(knownAdapters, (val, key) => {
3057
- if (val) {
3058
- try {
3059
- Object.defineProperty(val, 'name', {value: key});
3060
- } catch (e) {
3061
- // eslint-disable-next-line no-empty
3062
- }
3063
- Object.defineProperty(val, 'adapterName', {value: key});
3064
- }
3065
- });
3066
-
3067
- const adapters = {
3068
- /**
2702
+ */ utils$2.forEach(knownAdapters, (val, key)=>{
2703
+ if (val) {
2704
+ try {
2705
+ Object.defineProperty(val, 'name', {
2706
+ value: key
2707
+ });
2708
+ } catch (e) {
2709
+ // eslint-disable-next-line no-empty
2710
+ }
2711
+ Object.defineProperty(val, 'adapterName', {
2712
+ value: key
2713
+ });
2714
+ }
2715
+ });
2716
+ const adapters = {
2717
+ /**
3069
2718
  * get http or xhr adapter
3070
2719
  * @param {*} adapters user pass or ['xhr', 'http']
3071
2720
  * @returns
3072
- */
3073
- getAdapter: adapters => {
3074
- adapters = utils$2.isArray(adapters) ? adapters : [adapters];
3075
-
3076
- const {length} = adapters;
3077
- let nameOrAdapter;
3078
- let adapter;
3079
-
3080
- // find not null adapter
3081
- for (let i = 0; i < length; i++) {
3082
- nameOrAdapter = adapters[i];
3083
- if (
3084
- (adapter = utils$2.isString(nameOrAdapter)
3085
- ? knownAdapters[nameOrAdapter.toLowerCase()]
3086
- : nameOrAdapter)
3087
- ) {
3088
- break;
3089
- }
3090
- }
3091
-
3092
- if (!adapter) {
3093
- if (adapter === false) {
3094
- throw new AxiosError$2(
3095
- `Adapter ${nameOrAdapter} is not supported by the environment`,
3096
- 'ERR_NOT_SUPPORT'
3097
- );
3098
- }
3099
-
3100
- throw new Error(
3101
- utils$2.hasOwnProp(knownAdapters, nameOrAdapter)
3102
- ? `Adapter '${nameOrAdapter}' is not available in the build`
3103
- : `Unknown adapter '${nameOrAdapter}'`
3104
- );
3105
- }
3106
-
3107
- if (!utils$2.isFunction(adapter)) {
3108
- throw new TypeError('adapter is not a function');
3109
- }
3110
-
3111
- return adapter;
3112
- },
3113
- adapters: knownAdapters,
2721
+ */ getAdapter: (adapters)=>{
2722
+ adapters = utils$2.isArray(adapters) ? adapters : [
2723
+ adapters
2724
+ ];
2725
+ const { length } = adapters;
2726
+ let nameOrAdapter;
2727
+ let adapter;
2728
+ // find not null adapter
2729
+ for(let i = 0; i < length; i++){
2730
+ nameOrAdapter = adapters[i];
2731
+ if (adapter = utils$2.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter) {
2732
+ break;
2733
+ }
2734
+ }
2735
+ if (!adapter) {
2736
+ if (adapter === false) {
2737
+ throw new AxiosError$2(`Adapter ${nameOrAdapter} is not supported by the environment`, 'ERR_NOT_SUPPORT');
2738
+ }
2739
+ throw new Error(utils$2.hasOwnProp(knownAdapters, nameOrAdapter) ? `Adapter '${nameOrAdapter}' is not available in the build` : `Unknown adapter '${nameOrAdapter}'`);
2740
+ }
2741
+ if (!utils$2.isFunction(adapter)) {
2742
+ throw new TypeError('adapter is not a function');
2743
+ }
2744
+ return adapter;
2745
+ },
2746
+ adapters: knownAdapters
3114
2747
  };
3115
2748
 
3116
2749
  /**
@@ -3119,82 +2752,70 @@ const adapters = {
3119
2752
  * @param {Object} config The config that is to be used for the request
3120
2753
  *
3121
2754
  * @returns {void}
3122
- */
3123
- function throwIfCancellationRequested(config) {
3124
- if (config.cancelToken) {
3125
- config.cancelToken.throwIfRequested();
3126
- }
3127
-
3128
- if (config.signal && config.signal.aborted) {
3129
- throw new CanceledError$1(null, config)
3130
- }
3131
- }
3132
-
2755
+ */ function throwIfCancellationRequested(config) {
2756
+ if (config.cancelToken) {
2757
+ config.cancelToken.throwIfRequested();
2758
+ }
2759
+ if (config.signal && config.signal.aborted) {
2760
+ throw new CanceledError$1(null, config);
2761
+ }
2762
+ }
3133
2763
  /**
3134
2764
  * Dispatch a request to the server using the configured adapter.
3135
2765
  * 请求如有异常,需向外抛出异常,不拦截
3136
2766
  * @param {object} config The config that is to be used for the request
3137
2767
  *
3138
2768
  * @returns {Promise<*>} The Promise to be fulfilled
3139
- */
3140
- function dispatchRequest(config) {
3141
- let R;
3142
- throwIfCancellationRequested(config);
3143
-
3144
- config.headers = AxiosHeaders$2.from(config.headers);
3145
-
3146
- // Transform request data
3147
- config.data = transformData.call(config, config.transformRequest);
3148
-
3149
- if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
3150
- config.headers.setContentType('application/x-www-form-urlencoded', false);
3151
- }
3152
-
3153
- const Adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
3154
- const adapter = new Adapter(config);
3155
-
3156
- if (config.stream) R = adapter.request(this);
3157
- else {
3158
- R = adapter.request(this).then(
3159
- response => {
3160
- throwIfCancellationRequested(config);
3161
-
3162
- // Transform response data
3163
- response.data = transformData.call(config, config.transformResponse, response);
3164
- // ! body === data
3165
- Object.defineProperty(response, 'body', {
3166
- get() {
3167
- return response.data
3168
- },
3169
- });
3170
- // if (response.data && !response.body) response.body = response.data
3171
-
3172
- response.headers = AxiosHeaders$2.from(response.headers);
3173
-
3174
- return response
3175
- },
3176
- reason => {
3177
- if (!isCancel$1(reason)) {
3178
- throwIfCancellationRequested(config);
3179
-
3180
- // Transform response data
3181
- if (reason && reason.response) {
3182
- reason.response.data = transformData.call(config, config.transformResponse, reason.response);
3183
- // body === data
3184
- if (reason.response.data && !reason.response.body) reason.response.body = reason.response.data;
3185
- reason.response.headers = AxiosHeaders$2.from(reason.response.headers);
3186
- }
3187
- }
3188
-
3189
- return Promise.reject(reason)
3190
- }
3191
- );
3192
- }
3193
- return R
2769
+ */ function dispatchRequest(config) {
2770
+ let R;
2771
+ throwIfCancellationRequested(config);
2772
+ config.headers = AxiosHeaders$2.from(config.headers);
2773
+ // Transform request data
2774
+ config.data = transformData.call(config, config.transformRequest);
2775
+ if ([
2776
+ 'post',
2777
+ 'put',
2778
+ 'patch'
2779
+ ].indexOf(config.method) !== -1) {
2780
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
2781
+ }
2782
+ const Adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
2783
+ const adapter = new Adapter(config);
2784
+ if (config.stream) R = adapter.request(this);
2785
+ else {
2786
+ R = adapter.request(this).then((response)=>{
2787
+ throwIfCancellationRequested(config);
2788
+ // Transform response data
2789
+ response.data = transformData.call(config, config.transformResponse, response);
2790
+ // ! body === data
2791
+ Object.defineProperty(response, 'body', {
2792
+ get () {
2793
+ return response.data;
2794
+ }
2795
+ });
2796
+ // if (response.data && !response.body) response.body = response.data
2797
+ response.headers = AxiosHeaders$2.from(response.headers);
2798
+ return response;
2799
+ }, (reason)=>{
2800
+ if (!isCancel$1(reason)) {
2801
+ throwIfCancellationRequested(config);
2802
+ // Transform response data
2803
+ if (reason && reason.response) {
2804
+ reason.response.data = transformData.call(config, config.transformResponse, reason.response);
2805
+ // body === data
2806
+ if (reason.response.data && !reason.response.body) reason.response.body = reason.response.data;
2807
+ reason.response.headers = AxiosHeaders$2.from(reason.response.headers);
2808
+ }
2809
+ }
2810
+ return Promise.reject(reason);
2811
+ });
2812
+ }
2813
+ return R;
3194
2814
  }
3195
2815
 
3196
- const headersToObject = (thing) => thing instanceof AxiosHeaders$2 ? { ...thing } : thing;
3197
-
2816
+ const headersToObject = (thing)=>thing instanceof AxiosHeaders$2 ? {
2817
+ ...thing
2818
+ } : thing;
3198
2819
  /**
3199
2820
  * Config-specific merge-function which creates a new config-object
3200
2821
  * by merging two configuration objects together.
@@ -3203,111 +2824,108 @@ const headersToObject = (thing) => thing instanceof AxiosHeaders$2 ? { ...thing
3203
2824
  * @param {Object} config2
3204
2825
  *
3205
2826
  * @returns {Object} New object resulting from merging config2 to config1
3206
- */
3207
- function mergeConfig$1(config1, config2) {
3208
- // eslint-disable-next-line no-param-reassign
3209
- config2 = config2 || {};
3210
- const config = {};
3211
-
3212
- function getMergedValue(target, source, caseless) {
3213
- if (utils$2.isPlainObject(target) && utils$2.isPlainObject(source)) {
3214
- return utils$2.merge.call({caseless}, target, source);
3215
- } else if (utils$2.isPlainObject(source)) {
3216
- return utils$2.merge({}, source);
3217
- } else if (utils$2.isArray(source)) {
3218
- return source.slice();
3219
- }
3220
- return source;
3221
- }
3222
-
3223
- // eslint-disable-next-line consistent-return
3224
- function mergeDeepProperties(a, b, caseless) {
3225
- if (!utils$2.isUndefined(b)) {
3226
- return getMergedValue(a, b, caseless);
3227
- } else if (!utils$2.isUndefined(a)) {
3228
- return getMergedValue(undefined, a, caseless);
3229
- }
3230
- }
3231
-
3232
- // eslint-disable-next-line consistent-return
3233
- function valueFromConfig2(a, b) {
3234
- if (!utils$2.isUndefined(b)) {
3235
- return getMergedValue(undefined, b);
3236
- }
3237
- }
3238
-
3239
- // eslint-disable-next-line consistent-return
3240
- function defaultToConfig2(a, b) {
3241
- if (!utils$2.isUndefined(b)) {
3242
- return getMergedValue(undefined, b);
3243
- } else if (!utils$2.isUndefined(a)) {
3244
- return getMergedValue(undefined, a);
3245
- }
3246
- }
3247
-
3248
- // eslint-disable-next-line consistent-return
3249
- function mergeDirectKeys(a, b, prop) {
3250
- if (prop in config2) {
3251
- return getMergedValue(a, b);
3252
- } else if (prop in config1) {
3253
- return getMergedValue(undefined, a);
3254
- }
3255
- }
3256
-
3257
- const mergeMap = {
3258
- url: valueFromConfig2,
3259
- method: valueFromConfig2,
3260
- data: valueFromConfig2,
3261
- baseURL: defaultToConfig2,
3262
- transformRequest: defaultToConfig2,
3263
- transformResponse: defaultToConfig2,
3264
- paramsSerializer: defaultToConfig2,
3265
- timeout: defaultToConfig2,
3266
- timeoutMessage: defaultToConfig2,
3267
- withCredentials: defaultToConfig2,
3268
- withXSRFToken: defaultToConfig2,
3269
- adapter: defaultToConfig2,
3270
- responseType: defaultToConfig2,
3271
- xsrfCookieName: defaultToConfig2,
3272
- xsrfHeaderName: defaultToConfig2,
3273
- onUploadProgress: defaultToConfig2,
3274
- onDownloadProgress: defaultToConfig2,
3275
- decompress: defaultToConfig2,
3276
- maxContentLength: defaultToConfig2,
3277
- maxBodyLength: defaultToConfig2,
3278
- beforeRedirect: defaultToConfig2,
3279
- transport: defaultToConfig2,
3280
- httpAgent: defaultToConfig2,
3281
- httpsAgent: defaultToConfig2,
3282
- cancelToken: defaultToConfig2,
3283
- socketPath: defaultToConfig2,
3284
- responseEncoding: defaultToConfig2,
3285
- validateStatus: mergeDirectKeys,
3286
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
3287
- };
3288
-
3289
- utils$2.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
3290
- const merge = mergeMap[prop] || mergeDeepProperties;
3291
- const configValue = merge(config1[prop], config2[prop], prop);
3292
- (utils$2.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
3293
- });
3294
-
3295
- return config;
2827
+ */ function mergeConfig$1(config1, config2) {
2828
+ // eslint-disable-next-line no-param-reassign
2829
+ config2 = config2 || {};
2830
+ const config = {};
2831
+ function getMergedValue(target, source, caseless) {
2832
+ if (utils$2.isPlainObject(target) && utils$2.isPlainObject(source)) {
2833
+ return utils$2.merge.call({
2834
+ caseless
2835
+ }, target, source);
2836
+ } else if (utils$2.isPlainObject(source)) {
2837
+ return utils$2.merge({}, source);
2838
+ } else if (utils$2.isArray(source)) {
2839
+ return source.slice();
2840
+ }
2841
+ return source;
2842
+ }
2843
+ // eslint-disable-next-line consistent-return
2844
+ function mergeDeepProperties(a, b, caseless) {
2845
+ if (!utils$2.isUndefined(b)) {
2846
+ return getMergedValue(a, b, caseless);
2847
+ } else if (!utils$2.isUndefined(a)) {
2848
+ return getMergedValue(undefined, a, caseless);
2849
+ }
2850
+ }
2851
+ // eslint-disable-next-line consistent-return
2852
+ function valueFromConfig2(a, b) {
2853
+ if (!utils$2.isUndefined(b)) {
2854
+ return getMergedValue(undefined, b);
2855
+ }
2856
+ }
2857
+ // eslint-disable-next-line consistent-return
2858
+ function defaultToConfig2(a, b) {
2859
+ if (!utils$2.isUndefined(b)) {
2860
+ return getMergedValue(undefined, b);
2861
+ } else if (!utils$2.isUndefined(a)) {
2862
+ return getMergedValue(undefined, a);
2863
+ }
2864
+ }
2865
+ // eslint-disable-next-line consistent-return
2866
+ function mergeDirectKeys(a, b, prop) {
2867
+ if (prop in config2) {
2868
+ return getMergedValue(a, b);
2869
+ } else if (prop in config1) {
2870
+ return getMergedValue(undefined, a);
2871
+ }
2872
+ }
2873
+ const mergeMap = {
2874
+ url: valueFromConfig2,
2875
+ method: valueFromConfig2,
2876
+ data: valueFromConfig2,
2877
+ baseURL: defaultToConfig2,
2878
+ transformRequest: defaultToConfig2,
2879
+ transformResponse: defaultToConfig2,
2880
+ paramsSerializer: defaultToConfig2,
2881
+ timeout: defaultToConfig2,
2882
+ timeoutMessage: defaultToConfig2,
2883
+ withCredentials: defaultToConfig2,
2884
+ withXSRFToken: defaultToConfig2,
2885
+ adapter: defaultToConfig2,
2886
+ responseType: defaultToConfig2,
2887
+ xsrfCookieName: defaultToConfig2,
2888
+ xsrfHeaderName: defaultToConfig2,
2889
+ onUploadProgress: defaultToConfig2,
2890
+ onDownloadProgress: defaultToConfig2,
2891
+ decompress: defaultToConfig2,
2892
+ maxContentLength: defaultToConfig2,
2893
+ maxBodyLength: defaultToConfig2,
2894
+ beforeRedirect: defaultToConfig2,
2895
+ transport: defaultToConfig2,
2896
+ httpAgent: defaultToConfig2,
2897
+ httpsAgent: defaultToConfig2,
2898
+ cancelToken: defaultToConfig2,
2899
+ socketPath: defaultToConfig2,
2900
+ responseEncoding: defaultToConfig2,
2901
+ validateStatus: mergeDirectKeys,
2902
+ headers: (a, b)=>mergeDeepProperties(headersToObject(a), headersToObject(b), true)
2903
+ };
2904
+ utils$2.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2905
+ const merge = mergeMap[prop] || mergeDeepProperties;
2906
+ const configValue = merge(config1[prop], config2[prop], prop);
2907
+ utils$2.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
2908
+ });
2909
+ return config;
3296
2910
  }
3297
2911
 
3298
2912
  const VERSION$1 = "1.7.7";
3299
2913
 
3300
- const validators$1 = {};
3301
-
3302
- // eslint-disable-next-line func-names
3303
- ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
3304
- validators$1[type] = function validator(thing) {
3305
- return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
3306
- };
3307
- });
3308
-
3309
- const deprecatedWarnings = {};
3310
-
2914
+ const validators$1 = {};
2915
+ // eslint-disable-next-line func-names
2916
+ [
2917
+ 'object',
2918
+ 'boolean',
2919
+ 'number',
2920
+ 'function',
2921
+ 'string',
2922
+ 'symbol'
2923
+ ].forEach((type, i)=>{
2924
+ validators$1[type] = function validator(thing) {
2925
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
2926
+ };
2927
+ });
2928
+ const deprecatedWarnings = {};
3311
2929
  /**
3312
2930
  * Transitional option validator
3313
2931
  *
@@ -3316,44 +2934,30 @@ const deprecatedWarnings = {};
3316
2934
  * @param {string?} message - some message with additional info
3317
2935
  *
3318
2936
  * @returns {function}
3319
- */
3320
- validators$1.transitional = function transitional(validator, version, message) {
3321
- function formatMessage(opt, desc) {
3322
- return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
3323
- }
3324
-
3325
- // eslint-disable-next-line func-names
3326
- return (value, opt, opts) => {
3327
- if (validator === false) {
3328
- throw new AxiosError$2(
3329
- formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
3330
- AxiosError$2.ERR_DEPRECATED
3331
- );
3332
- }
3333
-
3334
- if (version && !deprecatedWarnings[opt]) {
3335
- deprecatedWarnings[opt] = true;
3336
- // eslint-disable-next-line no-console
3337
- console.warn(
3338
- formatMessage(
3339
- opt,
3340
- ' has been deprecated since v' + version + ' and will be removed in the near future'
3341
- )
3342
- );
3343
- }
3344
-
3345
- return validator ? validator(value, opt, opts) : true;
3346
- };
3347
- };
3348
-
3349
- validators$1.spelling = function spelling(correctSpelling) {
3350
- return (value, opt) => {
3351
- // eslint-disable-next-line no-console
3352
- console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
3353
- return true;
3354
- }
3355
- };
3356
-
2937
+ */ validators$1.transitional = function transitional(validator, version, message) {
2938
+ function formatMessage(opt, desc) {
2939
+ return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
2940
+ }
2941
+ // eslint-disable-next-line func-names
2942
+ return (value, opt, opts)=>{
2943
+ if (validator === false) {
2944
+ throw new AxiosError$2(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError$2.ERR_DEPRECATED);
2945
+ }
2946
+ if (version && !deprecatedWarnings[opt]) {
2947
+ deprecatedWarnings[opt] = true;
2948
+ // eslint-disable-next-line no-console
2949
+ console.warn(formatMessage(opt, ' has been deprecated since v' + version + ' and will be removed in the near future'));
2950
+ }
2951
+ return validator ? validator(value, opt, opts) : true;
2952
+ };
2953
+ };
2954
+ validators$1.spelling = function spelling(correctSpelling) {
2955
+ return (value, opt)=>{
2956
+ // eslint-disable-next-line no-console
2957
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
2958
+ return true;
2959
+ };
2960
+ };
3357
2961
  /**
3358
2962
  * Assert object's properties type
3359
2963
  *
@@ -3362,58 +2966,42 @@ validators$1.spelling = function spelling(correctSpelling) {
3362
2966
  * @param {boolean?} allowUnknown
3363
2967
  *
3364
2968
  * @returns {object}
3365
- */
3366
-
3367
- function assertOptions(options, schema, allowUnknown) {
3368
- if (typeof options !== 'object') {
3369
- throw new AxiosError$2('options must be an object', AxiosError$2.ERR_BAD_OPTION_VALUE);
3370
- }
3371
- const keys = Object.keys(options);
3372
- let i = keys.length;
3373
- while (i-- > 0) {
3374
- const opt = keys[i];
3375
- const validator = schema[opt];
3376
- if (validator) {
3377
- const value = options[opt];
3378
- const result = value === undefined || validator(value, opt, options);
3379
- if (result !== true) {
3380
- throw new AxiosError$2('option ' + opt + ' must be ' + result, AxiosError$2.ERR_BAD_OPTION_VALUE);
3381
- }
3382
- continue;
3383
- }
3384
- if (allowUnknown !== true) {
3385
- throw new AxiosError$2('Unknown option ' + opt, AxiosError$2.ERR_BAD_OPTION);
3386
- }
3387
- }
3388
- }
3389
-
3390
- const validator = {
3391
- assertOptions,
3392
- validators: validators$1
2969
+ */ function assertOptions(options, schema, allowUnknown) {
2970
+ if (typeof options !== 'object') {
2971
+ throw new AxiosError$2('options must be an object', AxiosError$2.ERR_BAD_OPTION_VALUE);
2972
+ }
2973
+ const keys = Object.keys(options);
2974
+ let i = keys.length;
2975
+ while(i-- > 0){
2976
+ const opt = keys[i];
2977
+ const validator = schema[opt];
2978
+ if (validator) {
2979
+ const value = options[opt];
2980
+ const result = value === undefined || validator(value, opt, options);
2981
+ if (result !== true) {
2982
+ throw new AxiosError$2('option ' + opt + ' must be ' + result, AxiosError$2.ERR_BAD_OPTION_VALUE);
2983
+ }
2984
+ continue;
2985
+ }
2986
+ if (allowUnknown !== true) {
2987
+ throw new AxiosError$2('Unknown option ' + opt, AxiosError$2.ERR_BAD_OPTION);
2988
+ }
2989
+ }
2990
+ }
2991
+ const validator = {
2992
+ assertOptions,
2993
+ validators: validators$1
3393
2994
  };
3394
2995
 
3395
- const {validators} = validator;
3396
-
2996
+ const { validators } = validator;
3397
2997
  /**
3398
2998
  * Create a new instance of Axios
3399
2999
  *
3400
3000
  * @param {Object} instanceConfig The default config for the instance
3401
3001
  *
3402
3002
  * @return {Axios} A new instance of Axios
3403
- */
3404
- let Axios$1 = class Axios {
3405
- constructor(instanceConfig) {
3406
- this.defaults = instanceConfig;
3407
- this.config = this.defaults; // !+++
3408
- this.interceptors = {
3409
- request: new InterceptorManager$1(),
3410
- response: new InterceptorManager$1(),
3411
- };
3412
-
3413
- this.init(); // !+++
3414
- }
3415
-
3416
- /**
3003
+ */ let Axios$1 = class Axios {
3004
+ /**
3417
3005
  * !+++
3418
3006
  * config 属性直接挂在到实例上,方便读取、设置、修改
3419
3007
  * 需注意,不要与其属性、方法冲突!!!
@@ -3426,252 +3014,222 @@ let Axios$1 = class Axios {
3426
3014
  put(url[, data[, config]])
3427
3015
  patch(url[, data[, config]])
3428
3016
  getUri([config])
3429
- */
3430
- init() {
3431
- const m = this
3432
- ;[
3433
- 'url',
3434
- 'method',
3435
- 'baseURL',
3436
- 'transformRequest', // [function],
3437
- 'transformResponse',
3438
- 'headers', // {'X-Requested-With': 'XMLHttpRequest'},
3439
- 'params', // {ID: 12345},
3440
- 'paramsSerializer',
3441
- 'body',
3442
- 'data', // {firstName: 'Fred'}, 'Country=Brasil&City=Belo',
3443
- 'timeout', // default is `0` (no timeout)
3444
- 'withCredentials', // default false
3445
- 'adapter', // func
3446
- 'auth', // {username: 'janedoe', password: 's00pers3cret'}
3447
- 'responseType', // default 'json'
3448
- 'responseEncoding', // default 'utf8'
3449
- 'xsrfCookieName', // default 'XSRF-TOKEN'
3450
- 'xsrfHeaderName', // default 'X-XSRF-TOKEN'
3451
- 'onUploadProgress', // func
3452
- 'onDownloadProgress', // func
3453
- 'maxContentLength',
3454
- 'maxBodyLength',
3455
- 'validateStatus', // status => status >= 200 && status < 300;
3456
- 'maxRedirects', // default 21
3457
- 'beforeRedirect', // (options, { headers }) => {}
3458
- 'socketPath', // default null
3459
- 'httpAgent', // new http.Agent({ keepAlive: true }),
3460
- 'httpsAgent', // new https.Agent({ keepAlive: true }),
3461
- 'agent', // {},
3462
- 'cancelToken', // new CancelToken(function (cancel) {}),
3463
- 'signal', // new AbortController().signal,
3464
- 'decompress', // default true
3465
- 'insecureHTTPParser', // default undefined
3466
- 'transitional',
3467
- 'env', // {FormData: window?.FormData || global?.FormData},
3468
- 'formSerializer',
3469
- 'maxRate', // [100 * 1024, 100 * 1024] // upload, download limit
3470
- ].forEach(p =>
3471
- Object.defineProperty(m, p, {
3472
- enumerable: true,
3473
- get() {
3474
- return m.config[p]
3475
- },
3476
-
3477
- set(value) {
3478
- m.config[p] = value;
3479
- },
3480
- })
3481
- );
3482
- }
3483
-
3484
- /**
3017
+ */ init() {
3018
+ const m = this;
3019
+ [
3020
+ 'url',
3021
+ 'method',
3022
+ 'baseURL',
3023
+ 'transformRequest',
3024
+ 'transformResponse',
3025
+ 'headers',
3026
+ 'params',
3027
+ 'paramsSerializer',
3028
+ 'body',
3029
+ 'data',
3030
+ 'timeout',
3031
+ 'withCredentials',
3032
+ 'adapter',
3033
+ 'auth',
3034
+ 'responseType',
3035
+ 'responseEncoding',
3036
+ 'xsrfCookieName',
3037
+ 'xsrfHeaderName',
3038
+ 'onUploadProgress',
3039
+ 'onDownloadProgress',
3040
+ 'maxContentLength',
3041
+ 'maxBodyLength',
3042
+ 'validateStatus',
3043
+ 'maxRedirects',
3044
+ 'beforeRedirect',
3045
+ 'socketPath',
3046
+ 'httpAgent',
3047
+ 'httpsAgent',
3048
+ 'agent',
3049
+ 'cancelToken',
3050
+ 'signal',
3051
+ 'decompress',
3052
+ 'insecureHTTPParser',
3053
+ 'transitional',
3054
+ 'env',
3055
+ 'formSerializer',
3056
+ 'maxRate'
3057
+ ].forEach((p)=>Object.defineProperty(m, p, {
3058
+ enumerable: true,
3059
+ get () {
3060
+ return m.config[p];
3061
+ },
3062
+ set (value) {
3063
+ m.config[p] = value;
3064
+ }
3065
+ }));
3066
+ }
3067
+ /**
3485
3068
  * Dispatch a request
3486
3069
  * 启动执行请求,返回 Promise 实例
3487
3070
  * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
3488
3071
  * @param {?Object} config
3489
3072
  * @returns {Promise} The Promise to be fulfilled
3490
- */
3491
- async request(configOrUrl, config) {
3492
- try {
3493
- return await this._request(configOrUrl, config)
3494
- } catch (err) {
3495
- if (err instanceof Error) {
3496
- let dummy = {};
3497
-
3498
- Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
3499
-
3500
- // slice off the Error: ... line
3501
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
3502
- try {
3503
- if (!err.stack) {
3504
- err.stack = stack;
3505
- // match without the 2 top stack lines
3506
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
3507
- err.stack += '\n' + stack;
3508
- }
3509
- } catch (e) {
3510
- // ignore the case where "stack" is an un-writable property
3511
- }
3512
- }
3513
-
3514
- throw err // 抛出异常
3515
- }
3516
- }
3517
-
3518
- /**
3073
+ */ async request(configOrUrl, config) {
3074
+ try {
3075
+ return await this._request(configOrUrl, config);
3076
+ } catch (err) {
3077
+ if (err instanceof Error) {
3078
+ let dummy = {};
3079
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
3080
+ // slice off the Error: ... line
3081
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
3082
+ try {
3083
+ if (!err.stack) {
3084
+ err.stack = stack;
3085
+ // match without the 2 top stack lines
3086
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
3087
+ err.stack += '\n' + stack;
3088
+ }
3089
+ } catch (e) {
3090
+ // ignore the case where "stack" is an un-writable property
3091
+ }
3092
+ }
3093
+ throw err // 抛出异常
3094
+ ;
3095
+ }
3096
+ }
3097
+ /**
3519
3098
  * 执行请求
3520
3099
  * @param {*} configOrUrl
3521
3100
  * @param {*} config
3522
3101
  * @param {boolean} [stream = false] - 是否返回 stream
3523
3102
  * @returns
3524
- */
3525
- _request(configOrUrl, config, stream = false) {
3526
- let R = null;
3527
-
3528
- /* eslint no-param-reassign:0 */
3529
- // Allow for axios('example/url'[, config]) a la fetch API
3530
- if (typeof configOrUrl === 'string') {
3531
- config = config || {};
3532
- config.url = configOrUrl;
3533
- } else {
3534
- config = configOrUrl || {};
3535
- }
3536
-
3537
- // ! body as data alias, body ==> data,内部保持data不变
3538
- if (!config.data && config.body) {
3539
- config.data = config.body;
3540
- // config.body = undefined;
3541
- }
3542
-
3543
- config = mergeConfig$1(this.defaults, config);
3544
-
3545
- const {transitional, paramsSerializer, headers} = config;
3546
-
3547
- if (transitional !== undefined) {
3548
- validator.assertOptions(
3549
- transitional,
3550
- {
3551
- silentJSONParsing: validators.transitional(validators.boolean),
3552
- forcedJSONParsing: validators.transitional(validators.boolean),
3553
- clarifyTimeoutError: validators.transitional(validators.boolean),
3554
- },
3555
- false
3556
- );
3557
- }
3558
-
3559
- if (paramsSerializer) {
3560
- if (utils$2.isFunction(paramsSerializer)) {
3561
- config.paramsSerializer = {
3562
- serialize: paramsSerializer,
3563
- };
3564
- } else {
3565
- validator.assertOptions(
3566
- paramsSerializer,
3567
- {
3568
- encode: validators.function,
3569
- serialize: validators.function,
3570
- },
3571
- true
3572
- );
3573
- }
3574
- }
3575
-
3576
- validator.assertOptions(
3577
- config,
3578
- {
3579
- baseUrl: validators.spelling('baseURL'),
3580
- withXsrfToken: validators.spelling('withXSRFToken'),
3581
- },
3582
- true
3583
- );
3584
-
3585
- // Set config.method
3586
- config.method = (config.method || this.defaults.method || 'get').toLowerCase();
3587
-
3588
- // Flatten headers,方法头覆盖通用头
3589
- const contextHeaders = headers && utils$2.merge(headers.common, headers[config.method]);
3590
-
3591
- headers &&
3592
- utils$2.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], method => {
3593
- delete headers[method];
3594
- });
3595
-
3596
- // 源值存在,则不覆盖,contextHeaders 优先于 headers
3597
- config.headers = AxiosHeaders$2.concat(contextHeaders, headers);
3598
-
3599
- // filter out skipped interceptors
3600
- const requestInterceptorChain = []; // 请求拦截器,hook
3601
- let synchronousRequestInterceptors = true;
3602
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
3603
- if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
3604
- return
3605
- }
3606
-
3607
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
3608
-
3609
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
3610
- });
3611
-
3612
- const responseInterceptorChain = []; // 响应拦截器,hook
3613
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
3614
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
3615
- });
3616
-
3617
- let promise;
3618
- let i = 0;
3619
- let len;
3620
- debugger
3621
- // 执行dispatchRequest
3622
- // !+++ stream
3623
- if (stream) {
3624
- config.stream = true;
3625
- R = dispatchRequest.call(this, config); // not promise
3626
- } else if (!synchronousRequestInterceptors) {
3627
- // 异步拦截器
3628
- const chain = [dispatchRequest.bind(this), undefined]; // dispatchRequest 放入运行链
3629
- chain.unshift(...requestInterceptorChain); // !*** 插入头
3630
- chain.push(...responseInterceptorChain); // !*** 加入尾
3631
- len = chain.length;
3632
-
3633
- promise = Promise.resolve(config); // promise 对象
3634
-
3635
- // 传入config配置,按顺序执行
3636
- while (i < len) promise = promise.then(chain[i++], chain[i++]);
3637
-
3638
- R = promise;
3639
- } else {
3640
- // 同步拦截器
3641
- len = requestInterceptorChain.length;
3642
- let newConfig = config;
3643
- i = 0;
3644
-
3645
- // 按加入顺序运行 request 拦截器
3646
- while (i < len) {
3647
- const onFulfilled = requestInterceptorChain[i++];
3648
- const onRejected = requestInterceptorChain[i++];
3649
- try {
3650
- newConfig = onFulfilled(newConfig); // 执行
3651
- } catch (error) {
3652
- onRejected.call(this, error);
3653
- break
3654
- }
3655
- }
3656
-
3657
- try {
3658
- promise = dispatchRequest.call(this, newConfig);
3659
- i = 0;
3660
- len = responseInterceptorChain.length;
3661
-
3662
- // 按顺序执行响应 hook
3663
- while (i < len) promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
3664
-
3665
- R = promise;
3666
- } catch (error) {
3667
- R = Promise.reject(error);
3668
- }
3669
- }
3670
-
3671
- return R
3672
- }
3673
-
3674
- /**
3103
+ */ _request(configOrUrl, config, stream = false) {
3104
+ let R = null;
3105
+ /* eslint no-param-reassign:0 */ // Allow for axios('example/url'[, config]) a la fetch API
3106
+ if (typeof configOrUrl === 'string') {
3107
+ config = config || {};
3108
+ config.url = configOrUrl;
3109
+ } else {
3110
+ config = configOrUrl || {};
3111
+ }
3112
+ // ! body as data alias, body ==> data,内部保持data不变
3113
+ if (!config.data && config.body) {
3114
+ config.data = config.body;
3115
+ // config.body = undefined;
3116
+ }
3117
+ config = mergeConfig$1(this.defaults, config);
3118
+ const { transitional, paramsSerializer, headers } = config;
3119
+ if (transitional !== undefined) {
3120
+ validator.assertOptions(transitional, {
3121
+ silentJSONParsing: validators.transitional(validators.boolean),
3122
+ forcedJSONParsing: validators.transitional(validators.boolean),
3123
+ clarifyTimeoutError: validators.transitional(validators.boolean)
3124
+ }, false);
3125
+ }
3126
+ if (paramsSerializer) {
3127
+ if (utils$2.isFunction(paramsSerializer)) {
3128
+ config.paramsSerializer = {
3129
+ serialize: paramsSerializer
3130
+ };
3131
+ } else {
3132
+ validator.assertOptions(paramsSerializer, {
3133
+ encode: validators.function,
3134
+ serialize: validators.function
3135
+ }, true);
3136
+ }
3137
+ }
3138
+ validator.assertOptions(config, {
3139
+ baseUrl: validators.spelling('baseURL'),
3140
+ withXsrfToken: validators.spelling('withXSRFToken')
3141
+ }, true);
3142
+ // Set config.method
3143
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
3144
+ // Flatten headers,方法头覆盖通用头
3145
+ const contextHeaders = headers && utils$2.merge(headers.common, headers[config.method]);
3146
+ headers && utils$2.forEach([
3147
+ 'delete',
3148
+ 'get',
3149
+ 'head',
3150
+ 'post',
3151
+ 'put',
3152
+ 'patch',
3153
+ 'common'
3154
+ ], (method)=>{
3155
+ delete headers[method];
3156
+ });
3157
+ // 源值存在,则不覆盖,contextHeaders 优先于 headers
3158
+ config.headers = AxiosHeaders$2.concat(contextHeaders, headers);
3159
+ // filter out skipped interceptors
3160
+ const requestInterceptorChain = [] // 请求拦截器,hook
3161
+ ;
3162
+ let synchronousRequestInterceptors = true;
3163
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
3164
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
3165
+ return;
3166
+ }
3167
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
3168
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
3169
+ });
3170
+ const responseInterceptorChain = [] // 响应拦截器,hook
3171
+ ;
3172
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
3173
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
3174
+ });
3175
+ let promise;
3176
+ let i = 0;
3177
+ let len;
3178
+ debugger;
3179
+ // 执行dispatchRequest
3180
+ // !+++ stream
3181
+ if (stream) {
3182
+ config.stream = true;
3183
+ R = dispatchRequest.call(this, config) // not promise
3184
+ ;
3185
+ } else if (!synchronousRequestInterceptors) {
3186
+ // 异步拦截器
3187
+ const chain = [
3188
+ dispatchRequest.bind(this),
3189
+ undefined
3190
+ ] // dispatchRequest 放入运行链
3191
+ ;
3192
+ chain.unshift(...requestInterceptorChain) // !*** 插入头
3193
+ ;
3194
+ chain.push(...responseInterceptorChain) // !*** 加入尾
3195
+ ;
3196
+ len = chain.length;
3197
+ promise = Promise.resolve(config) // promise 对象
3198
+ ;
3199
+ // 传入config配置,按顺序执行
3200
+ while(i < len)promise = promise.then(chain[i++], chain[i++]);
3201
+ R = promise;
3202
+ } else {
3203
+ // 同步拦截器
3204
+ len = requestInterceptorChain.length;
3205
+ let newConfig = config;
3206
+ i = 0;
3207
+ // 按加入顺序运行 request 拦截器
3208
+ while(i < len){
3209
+ const onFulfilled = requestInterceptorChain[i++];
3210
+ const onRejected = requestInterceptorChain[i++];
3211
+ try {
3212
+ newConfig = onFulfilled(newConfig) // 执行
3213
+ ;
3214
+ } catch (error) {
3215
+ onRejected.call(this, error);
3216
+ break;
3217
+ }
3218
+ }
3219
+ try {
3220
+ promise = dispatchRequest.call(this, newConfig);
3221
+ i = 0;
3222
+ len = responseInterceptorChain.length;
3223
+ // 按顺序执行响应 hook
3224
+ while(i < len)promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
3225
+ R = promise;
3226
+ } catch (error) {
3227
+ R = Promise.reject(error);
3228
+ }
3229
+ }
3230
+ return R;
3231
+ }
3232
+ /**
3675
3233
  * !+++
3676
3234
  * 类似 request 库,返回 stream
3677
3235
  * stream 模式下,拦截器无效
@@ -3680,111 +3238,110 @@ let Axios$1 = class Axios {
3680
3238
  * @param {*} configOrUrl
3681
3239
  * @param {*} config
3682
3240
  * @returns
3683
- */
3684
- stream(configOrUrl, config) {
3685
- return this._request(configOrUrl, config, true)
3686
- }
3687
-
3688
- /**
3241
+ */ stream(configOrUrl, config) {
3242
+ return this._request(configOrUrl, config, true);
3243
+ }
3244
+ /**
3689
3245
  *
3690
3246
  * @param {*} config
3691
3247
  * @returns
3692
- */
3693
- getUri(config) {
3694
- config = mergeConfig$1(this.defaults, config);
3695
- const fullPath = buildFullPath(config.baseURL, config.url);
3696
- return buildURL(fullPath, config.params, config.paramsSerializer)
3697
- }
3698
- };
3699
-
3700
- // Provide aliases for supported request methods
3701
- utils$2.forEach(['head', 'options'], function forEachMethodNoData(method) {
3702
- /* eslint func-names:0 */
3703
- Axios$1.prototype[method] = function (url, config) {
3704
- return this.request(
3705
- mergeConfig$1(config || {}, {
3706
- method,
3707
- url,
3708
- data: (config || {}).data,
3709
- })
3710
- )
3711
- };
3712
- });
3713
-
3714
- // delete、get, axios不同,第二个参数为 params,而不是 data
3715
- utils$2.forEach(['delete', 'get'], function forEachMethodNoData(method) {
3716
- Axios$1.prototype[method] = function (url, params, config) {
3717
- return this.request(
3718
- mergeConfig$1(config || {}, {
3719
- method,
3720
- url,
3721
- params,
3722
- })
3723
- )
3724
- };
3725
- });
3726
-
3727
- utils$2.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
3728
- function generateHTTPMethod(isForm) {
3729
- return function httpMethod(url, data, config) {
3730
- return this.request(
3731
- mergeConfig$1(config || {}, {
3732
- method,
3733
- headers: isForm
3734
- ? {
3735
- 'Content-Type': 'multipart/form-data',
3736
- }
3737
- : {},
3738
- url,
3739
- data,
3740
- })
3741
- )
3742
- }
3743
- }
3744
-
3745
- Axios$1.prototype[method] = generateHTTPMethod();
3746
-
3747
- Axios$1.prototype[`${method}Form`] = generateHTTPMethod(true);
3748
- });
3749
-
3750
- // stream get, 与 axios不同,第二个参数为 params,而不是 data
3751
- utils$2.forEach(['gets'], function forEachMethodNoData(method) {
3752
- Axios$1.prototype[method] = function (url, params, config) {
3753
- return this.stream(
3754
- mergeConfig$1(config || {}, {
3755
- method,
3756
- url,
3757
- params,
3758
- data: (config || {}).data,
3759
- })
3760
- )
3761
- };
3762
- });
3763
-
3764
- // stream post put patch
3765
- utils$2.forEach(['posts', 'puts', 'patchs'], function forEachMethodWithData(method) {
3766
- function generateStreamMethod(isForm) {
3767
- return function httpMethod(url, data, config) {
3768
- return this.stream(
3769
- mergeConfig$1(config || {}, {
3770
- method,
3771
- headers: isForm
3772
- ? {
3773
- 'Content-Type': 'multipart/form-data',
3774
- }
3775
- : {},
3776
- url,
3777
- data,
3778
- })
3779
- )
3780
- }
3781
- }
3782
-
3783
- Axios$1.prototype[method] = generateStreamMethod();
3784
-
3785
- Axios$1.prototype[`${method}Forms`] = generateStreamMethod(true);
3786
- });
3787
-
3248
+ */ getUri(config) {
3249
+ config = mergeConfig$1(this.defaults, config);
3250
+ const fullPath = buildFullPath(config.baseURL, config.url);
3251
+ return buildURL(fullPath, config.params, config.paramsSerializer);
3252
+ }
3253
+ constructor(instanceConfig){
3254
+ this.defaults = instanceConfig;
3255
+ this.config = this.defaults // !+++
3256
+ ;
3257
+ this.interceptors = {
3258
+ request: new InterceptorManager$1(),
3259
+ response: new InterceptorManager$1()
3260
+ };
3261
+ this.init() // !+++
3262
+ ;
3263
+ }
3264
+ };
3265
+ // Provide aliases for supported request methods
3266
+ utils$2.forEach([
3267
+ 'head',
3268
+ 'options'
3269
+ ], function forEachMethodNoData(method) {
3270
+ /* eslint func-names:0 */ Axios$1.prototype[method] = function(url, config) {
3271
+ return this.request(mergeConfig$1(config || {}, {
3272
+ method,
3273
+ url,
3274
+ data: (config || {}).data
3275
+ }));
3276
+ };
3277
+ });
3278
+ // delete、get, 与 axios不同,第二个参数为 params,而不是 data
3279
+ utils$2.forEach([
3280
+ 'delete',
3281
+ 'get'
3282
+ ], function forEachMethodNoData(method) {
3283
+ Axios$1.prototype[method] = function(url, params, config) {
3284
+ return this.request(mergeConfig$1(config || {}, {
3285
+ method,
3286
+ url,
3287
+ params
3288
+ }));
3289
+ };
3290
+ });
3291
+ utils$2.forEach([
3292
+ 'post',
3293
+ 'put',
3294
+ 'patch'
3295
+ ], function forEachMethodWithData(method) {
3296
+ function generateHTTPMethod(isForm) {
3297
+ return function httpMethod(url, data, config) {
3298
+ return this.request(mergeConfig$1(config || {}, {
3299
+ method,
3300
+ headers: isForm ? {
3301
+ 'Content-Type': 'multipart/form-data'
3302
+ } : {},
3303
+ url,
3304
+ data
3305
+ }));
3306
+ };
3307
+ }
3308
+ Axios$1.prototype[method] = generateHTTPMethod();
3309
+ Axios$1.prototype[`${method}Form`] = generateHTTPMethod(true);
3310
+ });
3311
+ // stream get, 与 axios不同,第二个参数为 params,而不是 data
3312
+ utils$2.forEach([
3313
+ 'gets'
3314
+ ], function forEachMethodNoData(method) {
3315
+ Axios$1.prototype[method] = function(url, params, config) {
3316
+ return this.stream(mergeConfig$1(config || {}, {
3317
+ method,
3318
+ url,
3319
+ params,
3320
+ data: (config || {}).data
3321
+ }));
3322
+ };
3323
+ });
3324
+ // stream post put patch
3325
+ utils$2.forEach([
3326
+ 'posts',
3327
+ 'puts',
3328
+ 'patchs'
3329
+ ], function forEachMethodWithData(method) {
3330
+ function generateStreamMethod(isForm) {
3331
+ return function httpMethod(url, data, config) {
3332
+ return this.stream(mergeConfig$1(config || {}, {
3333
+ method,
3334
+ headers: isForm ? {
3335
+ 'Content-Type': 'multipart/form-data'
3336
+ } : {},
3337
+ url,
3338
+ data
3339
+ }));
3340
+ };
3341
+ }
3342
+ Axios$1.prototype[method] = generateStreamMethod();
3343
+ Axios$1.prototype[`${method}Forms`] = generateStreamMethod(true);
3344
+ });
3788
3345
  const Axios$2 = Axios$1;
3789
3346
 
3790
3347
  /**
@@ -3793,130 +3350,103 @@ const Axios$2 = Axios$1;
3793
3350
  * @param {Function} executor The executor function.
3794
3351
  *
3795
3352
  * @returns {CancelToken}
3796
- */
3797
- let CancelToken$1 = class CancelToken {
3798
- constructor(executor) {
3799
- if (typeof executor !== 'function') {
3800
- throw new TypeError('executor must be a function.');
3801
- }
3802
-
3803
- let resolvePromise;
3804
-
3805
- this.promise = new Promise(function promiseExecutor(resolve) {
3806
- resolvePromise = resolve;
3807
- });
3808
-
3809
- const token = this;
3810
-
3811
- // eslint-disable-next-line func-names
3812
- this.promise.then(cancel => {
3813
- if (!token._listeners) return;
3814
-
3815
- let i = token._listeners.length;
3816
-
3817
- while (i-- > 0) {
3818
- token._listeners[i](cancel);
3819
- }
3820
- token._listeners = null;
3821
- });
3822
-
3823
- // eslint-disable-next-line func-names
3824
- this.promise.then = onfulfilled => {
3825
- let _resolve;
3826
- // eslint-disable-next-line func-names
3827
- const promise = new Promise(resolve => {
3828
- token.subscribe(resolve);
3829
- _resolve = resolve;
3830
- }).then(onfulfilled);
3831
-
3832
- promise.cancel = function reject() {
3833
- token.unsubscribe(_resolve);
3834
- };
3835
-
3836
- return promise;
3837
- };
3838
-
3839
- executor(function cancel(message, config, request) {
3840
- if (token.reason) {
3841
- // Cancellation has already been requested
3842
- return;
3843
- }
3844
-
3845
- token.reason = new CanceledError$1(message, config, request);
3846
- resolvePromise(token.reason);
3847
- });
3848
- }
3849
-
3850
- /**
3353
+ */ let CancelToken$1 = class CancelToken {
3354
+ /**
3851
3355
  * Throws a `CanceledError` if cancellation has been requested.
3852
- */
3853
- throwIfRequested() {
3854
- if (this.reason) {
3855
- throw this.reason;
3856
- }
3857
- }
3858
-
3859
- /**
3356
+ */ throwIfRequested() {
3357
+ if (this.reason) {
3358
+ throw this.reason;
3359
+ }
3360
+ }
3361
+ /**
3860
3362
  * Subscribe to the cancel signal
3861
- */
3862
-
3863
- subscribe(listener) {
3864
- if (this.reason) {
3865
- listener(this.reason);
3866
- return;
3867
- }
3868
-
3869
- if (this._listeners) {
3870
- this._listeners.push(listener);
3871
- } else {
3872
- this._listeners = [listener];
3873
- }
3874
- }
3875
-
3876
- /**
3363
+ */ subscribe(listener) {
3364
+ if (this.reason) {
3365
+ listener(this.reason);
3366
+ return;
3367
+ }
3368
+ if (this._listeners) {
3369
+ this._listeners.push(listener);
3370
+ } else {
3371
+ this._listeners = [
3372
+ listener
3373
+ ];
3374
+ }
3375
+ }
3376
+ /**
3877
3377
  * Unsubscribe from the cancel signal
3878
- */
3879
-
3880
- unsubscribe(listener) {
3881
- if (!this._listeners) {
3882
- return;
3883
- }
3884
- const index = this._listeners.indexOf(listener);
3885
- if (index !== -1) {
3886
- this._listeners.splice(index, 1);
3887
- }
3888
- }
3889
-
3890
- toAbortSignal() {
3891
- const controller = new AbortController();
3892
-
3893
- const abort = (err) => {
3894
- controller.abort(err);
3895
- };
3896
-
3897
- this.subscribe(abort);
3898
-
3899
- controller.signal.unsubscribe = () => this.unsubscribe(abort);
3900
-
3901
- return controller.signal;
3902
- }
3903
-
3904
- /**
3378
+ */ unsubscribe(listener) {
3379
+ if (!this._listeners) {
3380
+ return;
3381
+ }
3382
+ const index = this._listeners.indexOf(listener);
3383
+ if (index !== -1) {
3384
+ this._listeners.splice(index, 1);
3385
+ }
3386
+ }
3387
+ toAbortSignal() {
3388
+ const controller = new AbortController();
3389
+ const abort = (err)=>{
3390
+ controller.abort(err);
3391
+ };
3392
+ this.subscribe(abort);
3393
+ controller.signal.unsubscribe = ()=>this.unsubscribe(abort);
3394
+ return controller.signal;
3395
+ }
3396
+ /**
3905
3397
  * Returns an object that contains a new `CancelToken` and a function that, when called,
3906
3398
  * cancels the `CancelToken`.
3907
- */
3908
- static source() {
3909
- let cancel;
3910
- const token = new CancelToken(function executor(c) {
3911
- cancel = c;
3912
- });
3913
- return {
3914
- token,
3915
- cancel
3916
- };
3917
- }
3918
- };
3919
-
3399
+ */ static source() {
3400
+ let cancel;
3401
+ const token = new CancelToken(function executor(c) {
3402
+ cancel = c;
3403
+ });
3404
+ return {
3405
+ token,
3406
+ cancel
3407
+ };
3408
+ }
3409
+ constructor(executor){
3410
+ if (typeof executor !== 'function') {
3411
+ throw new TypeError('executor must be a function.');
3412
+ }
3413
+ let resolvePromise;
3414
+ this.promise = new Promise(function promiseExecutor(resolve) {
3415
+ resolvePromise = resolve;
3416
+ });
3417
+ const token = this;
3418
+ // eslint-disable-next-line func-names
3419
+ this.promise.then((cancel)=>{
3420
+ if (!token._listeners) return;
3421
+ let i = token._listeners.length;
3422
+ while(i-- > 0){
3423
+ token._listeners[i](cancel);
3424
+ }
3425
+ token._listeners = null;
3426
+ });
3427
+ // eslint-disable-next-line func-names
3428
+ this.promise.then = (onfulfilled)=>{
3429
+ let _resolve;
3430
+ // eslint-disable-next-line func-names
3431
+ const promise = new Promise((resolve)=>{
3432
+ token.subscribe(resolve);
3433
+ _resolve = resolve;
3434
+ }).then(onfulfilled);
3435
+ promise.cancel = function reject() {
3436
+ token.unsubscribe(_resolve);
3437
+ };
3438
+ return promise;
3439
+ };
3440
+ executor(function cancel(message, config, request) {
3441
+ if (token.reason) {
3442
+ // Cancellation has already been requested
3443
+ return;
3444
+ }
3445
+ token.reason = new CanceledError$1(message, config, request);
3446
+ resolvePromise(token.reason);
3447
+ });
3448
+ }
3449
+ };
3920
3450
  const CancelToken$2 = CancelToken$1;
3921
3451
 
3922
3452
  /**
@@ -3939,11 +3469,10 @@ const CancelToken$2 = CancelToken$1;
3939
3469
  * @param {Function} callback
3940
3470
  *
3941
3471
  * @returns {Function}
3942
- */
3943
- function spread$1(callback) {
3944
- return function wrap(arr) {
3945
- return callback.apply(null, arr);
3946
- };
3472
+ */ function spread$1(callback) {
3473
+ return function wrap(arr) {
3474
+ return callback.apply(null, arr);
3475
+ };
3947
3476
  }
3948
3477
 
3949
3478
  /**
@@ -3952,9 +3481,8 @@ function spread$1(callback) {
3952
3481
  * @param {*} payload The value to test
3953
3482
  *
3954
3483
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
3955
- */
3956
- function isAxiosError$1(payload) {
3957
- return utils$2.isObject(payload) && (payload.isAxiosError === true);
3484
+ */ function isAxiosError$1(payload) {
3485
+ return utils$2.isObject(payload) && payload.isAxiosError === true;
3958
3486
  }
3959
3487
 
3960
3488
  /**
@@ -3963,86 +3491,54 @@ function isAxiosError$1(payload) {
3963
3491
  * @param {Object} defaultConfig The default config for the instance
3964
3492
  *
3965
3493
  * @returns {Axios} A new instance of Axios
3966
- */
3967
- function createInstance(defaultConfig) {
3968
- const context = new Axios$2(defaultConfig);
3969
- const instance = bind$1(Axios$2.prototype.request, context);
3970
-
3971
- // Copy axios.prototype to instance
3972
- utils$2.extend(instance, Axios$2.prototype, context, {allOwnKeys: true});
3973
-
3974
- // Copy context to instance
3975
- utils$2.extend(instance, context, null, {allOwnKeys: true});
3976
-
3977
- // Factory for creating new instances
3978
- instance.create = function create(instanceConfig) {
3979
- return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
3980
- };
3981
-
3982
- return instance;
3983
- }
3984
-
3985
- // Create the default instance to be exported
3986
- const req = createInstance(defaults$1);
3987
-
3988
- // Expose Axios class to allow class inheritance
3989
- req.Axios = Axios$2;
3990
-
3991
- // Expose Cancel & CancelToken
3992
- req.CanceledError = CanceledError$1;
3993
- req.CancelToken = CancelToken$2;
3994
- req.isCancel = isCancel$1;
3995
- req.VERSION = VERSION$1;
3996
- req.toFormData = toFormData$2;
3997
-
3998
- // Expose AxiosError class
3999
- req.AxiosError = AxiosError$2;
4000
-
4001
- // alias for CanceledError for backward compatibility
4002
- req.Cancel = req.CanceledError;
4003
-
4004
- // Expose all/spread
4005
- req.all = promises => Promise.all(promises);
4006
-
4007
- req.spread = spread$1;
4008
-
4009
- // Expose isAxiosError
4010
- req.isAxiosError = isAxiosError$1;
4011
-
4012
- // Expose mergeConfig
4013
- req.mergeConfig = mergeConfig$1;
4014
-
4015
- req.AxiosHeaders = AxiosHeaders$2;
4016
-
4017
- req.formToJSON = thing => formDataToJSON(utils$2.isHTMLForm(thing) ? new FormData(thing) : thing);
4018
-
4019
- req.getAdapter = adapters.getAdapter;
4020
-
4021
- req.default = req;
4022
-
4023
- // this module should only have a default export
3494
+ */ function createInstance(defaultConfig) {
3495
+ const context = new Axios$2(defaultConfig);
3496
+ const instance = bind$1(Axios$2.prototype.request, context);
3497
+ // Copy axios.prototype to instance
3498
+ utils$2.extend(instance, Axios$2.prototype, context, {
3499
+ allOwnKeys: true
3500
+ });
3501
+ // Copy context to instance
3502
+ utils$2.extend(instance, context, null, {
3503
+ allOwnKeys: true
3504
+ });
3505
+ // Factory for creating new instances
3506
+ instance.create = function create(instanceConfig) {
3507
+ return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
3508
+ };
3509
+ return instance;
3510
+ }
3511
+ // Create the default instance to be exported
3512
+ const req = createInstance(defaults$1);
3513
+ // Expose Axios class to allow class inheritance
3514
+ req.Axios = Axios$2;
3515
+ // Expose Cancel & CancelToken
3516
+ req.CanceledError = CanceledError$1;
3517
+ req.CancelToken = CancelToken$2;
3518
+ req.isCancel = isCancel$1;
3519
+ req.VERSION = VERSION$1;
3520
+ req.toFormData = toFormData$2;
3521
+ // Expose AxiosError class
3522
+ req.AxiosError = AxiosError$2;
3523
+ // alias for CanceledError for backward compatibility
3524
+ req.Cancel = req.CanceledError;
3525
+ // Expose all/spread
3526
+ req.all = (promises)=>Promise.all(promises);
3527
+ req.spread = spread$1;
3528
+ // Expose isAxiosError
3529
+ req.isAxiosError = isAxiosError$1;
3530
+ // Expose mergeConfig
3531
+ req.mergeConfig = mergeConfig$1;
3532
+ req.AxiosHeaders = AxiosHeaders$2;
3533
+ req.formToJSON = (thing)=>formDataToJSON(utils$2.isHTMLForm(thing) ? new FormData(thing) : thing);
3534
+ req.getAdapter = adapters.getAdapter;
3535
+ req.default = req;
3536
+ // this module should only have a default export
4024
3537
  const req$1 = req;
4025
3538
 
4026
- // This module is intended to unwrap Axios default export as named.
4027
- // Keep top-level export same with static properties
4028
- // so that it can keep same with es module or cjs
4029
- const {
4030
- Axios,
4031
- AxiosError,
4032
- CanceledError,
4033
- isCancel,
4034
- CancelToken,
4035
- VERSION,
4036
- all,
4037
- Cancel,
4038
- isAxiosError,
4039
- spread,
4040
- toFormData,
4041
- AxiosHeaders,
4042
- HttpStatusCode,
4043
- formToJSON,
4044
- getAdapter,
4045
- mergeConfig,
4046
- } = req$1;
3539
+ // This module is intended to unwrap Axios default export as named.
3540
+ // Keep top-level export same with static properties
3541
+ // so that it can keep same with es module or cjs
3542
+ const { Axios, AxiosError, CanceledError, isCancel, CancelToken, VERSION, all, Cancel, isAxiosError, spread, toFormData, AxiosHeaders, HttpStatusCode, formToJSON, getAdapter, mergeConfig } = req$1;
4047
3543
 
4048
3544
  export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, req$1 as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData };