@esvndev/es-react-template-chat 0.0.18 → 0.0.20

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/index.mjs CHANGED
@@ -6,7 +6,7 @@ import '@styles/base/pages/app-chat-list.scss';
6
6
  import 'react-dom';
7
7
  import { useAppDispatch, useAppSelector } from '@src/redux/configureStore';
8
8
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
9
- import require$$1 from 'util';
9
+ import require$$1, { TextEncoder as TextEncoder$1 } from 'util';
10
10
  import stream, { Readable } from 'stream';
11
11
  import require$$1$1 from 'path';
12
12
  import require$$3 from 'http';
@@ -14,7 +14,6 @@ import require$$4 from 'https';
14
14
  import require$$0$1 from 'url';
15
15
  import require$$6 from 'fs';
16
16
  import require$$8 from 'crypto';
17
- import http2 from 'http2';
18
17
  import require$$4$1 from 'assert';
19
18
  import require$$1$2 from 'tty';
20
19
  import require$$0$2 from 'os';
@@ -26240,13 +26239,6 @@ const FORM_CONFIG = {
26240
26239
  }
26241
26240
  };
26242
26241
 
26243
- /**
26244
- * Create a bound version of a function with a specified `this` context
26245
- *
26246
- * @param {Function} fn - The function to bind
26247
- * @param {*} thisArg - The value to be passed as the `this` parameter
26248
- * @returns {Function} A new function that will call the original function with the specified `this` context
26249
- */
26250
26242
  function bind$4(fn, thisArg) {
26251
26243
  return function wrap() {
26252
26244
  return fn.apply(thisArg, arguments);
@@ -26255,30 +26247,29 @@ function bind$4(fn, thisArg) {
26255
26247
 
26256
26248
  // utils is a library of generic helper functions non-specific to axios
26257
26249
 
26258
- const { toString } = Object.prototype;
26259
- const { getPrototypeOf } = Object;
26260
- const { iterator, toStringTag: toStringTag$1 } = Symbol;
26250
+ const {toString} = Object.prototype;
26251
+ const {getPrototypeOf} = Object;
26261
26252
 
26262
- const kindOf = ((cache) => (thing) => {
26263
- const str = toString.call(thing);
26264
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
26253
+ const kindOf = (cache => thing => {
26254
+ const str = toString.call(thing);
26255
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
26265
26256
  })(Object.create(null));
26266
26257
 
26267
26258
  const kindOfTest = (type) => {
26268
26259
  type = type.toLowerCase();
26269
- return (thing) => kindOf(thing) === type;
26260
+ return (thing) => kindOf(thing) === type
26270
26261
  };
26271
26262
 
26272
- const typeOfTest = (type) => (thing) => typeof thing === type;
26263
+ const typeOfTest = type => thing => typeof thing === type;
26273
26264
 
26274
26265
  /**
26275
- * Determine if a value is a non-null object
26266
+ * Determine if a value is an Array
26276
26267
  *
26277
26268
  * @param {Object} val The value to test
26278
26269
  *
26279
26270
  * @returns {boolean} True if value is an Array, otherwise false
26280
26271
  */
26281
- const { isArray } = Array;
26272
+ const {isArray} = Array;
26282
26273
 
26283
26274
  /**
26284
26275
  * Determine if a value is undefined
@@ -26287,7 +26278,7 @@ const { isArray } = Array;
26287
26278
  *
26288
26279
  * @returns {boolean} True if the value is undefined, otherwise false
26289
26280
  */
26290
- const isUndefined = typeOfTest("undefined");
26281
+ const isUndefined = typeOfTest('undefined');
26291
26282
 
26292
26283
  /**
26293
26284
  * Determine if a value is a Buffer
@@ -26297,14 +26288,8 @@ const isUndefined = typeOfTest("undefined");
26297
26288
  * @returns {boolean} True if value is a Buffer, otherwise false
26298
26289
  */
26299
26290
  function isBuffer$1(val) {
26300
- return (
26301
- val !== null &&
26302
- !isUndefined(val) &&
26303
- val.constructor !== null &&
26304
- !isUndefined(val.constructor) &&
26305
- isFunction$2(val.constructor.isBuffer) &&
26306
- val.constructor.isBuffer(val)
26307
- );
26291
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
26292
+ && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
26308
26293
  }
26309
26294
 
26310
26295
  /**
@@ -26314,7 +26299,8 @@ function isBuffer$1(val) {
26314
26299
  *
26315
26300
  * @returns {boolean} True if value is an ArrayBuffer, otherwise false
26316
26301
  */
26317
- const isArrayBuffer = kindOfTest("ArrayBuffer");
26302
+ const isArrayBuffer = kindOfTest('ArrayBuffer');
26303
+
26318
26304
 
26319
26305
  /**
26320
26306
  * Determine if a value is a view on an ArrayBuffer
@@ -26325,10 +26311,10 @@ const isArrayBuffer = kindOfTest("ArrayBuffer");
26325
26311
  */
26326
26312
  function isArrayBufferView(val) {
26327
26313
  let result;
26328
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
26314
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
26329
26315
  result = ArrayBuffer.isView(val);
26330
26316
  } else {
26331
- result = val && val.buffer && isArrayBuffer(val.buffer);
26317
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
26332
26318
  }
26333
26319
  return result;
26334
26320
  }
@@ -26340,7 +26326,7 @@ function isArrayBufferView(val) {
26340
26326
  *
26341
26327
  * @returns {boolean} True if value is a String, otherwise false
26342
26328
  */
26343
- const isString$1 = typeOfTest("string");
26329
+ const isString$1 = typeOfTest('string');
26344
26330
 
26345
26331
  /**
26346
26332
  * Determine if a value is a Function
@@ -26348,7 +26334,7 @@ const isString$1 = typeOfTest("string");
26348
26334
  * @param {*} val The value to test
26349
26335
  * @returns {boolean} True if value is a Function, otherwise false
26350
26336
  */
26351
- const isFunction$2 = typeOfTest("function");
26337
+ const isFunction$1 = typeOfTest('function');
26352
26338
 
26353
26339
  /**
26354
26340
  * Determine if a value is a Number
@@ -26357,7 +26343,7 @@ const isFunction$2 = typeOfTest("function");
26357
26343
  *
26358
26344
  * @returns {boolean} True if value is a Number, otherwise false
26359
26345
  */
26360
- const isNumber = typeOfTest("number");
26346
+ const isNumber = typeOfTest('number');
26361
26347
 
26362
26348
  /**
26363
26349
  * Determine if a value is an Object
@@ -26366,7 +26352,7 @@ const isNumber = typeOfTest("number");
26366
26352
  *
26367
26353
  * @returns {boolean} True if value is an Object, otherwise false
26368
26354
  */
26369
- const isObject = (thing) => thing !== null && typeof thing === "object";
26355
+ const isObject = (thing) => thing !== null && typeof thing === 'object';
26370
26356
 
26371
26357
  /**
26372
26358
  * Determine if a value is a Boolean
@@ -26374,7 +26360,7 @@ const isObject = (thing) => thing !== null && typeof thing === "object";
26374
26360
  * @param {*} thing The value to test
26375
26361
  * @returns {boolean} True if value is a Boolean, otherwise false
26376
26362
  */
26377
- const isBoolean = (thing) => thing === true || thing === false;
26363
+ const isBoolean = thing => thing === true || thing === false;
26378
26364
 
26379
26365
  /**
26380
26366
  * Determine if a value is a plain Object
@@ -26384,42 +26370,12 @@ const isBoolean = (thing) => thing === true || thing === false;
26384
26370
  * @returns {boolean} True if value is a plain Object, otherwise false
26385
26371
  */
26386
26372
  const isPlainObject = (val) => {
26387
- if (kindOf(val) !== "object") {
26373
+ if (kindOf(val) !== 'object') {
26388
26374
  return false;
26389
26375
  }
26390
26376
 
26391
26377
  const prototype = getPrototypeOf(val);
26392
- return (
26393
- (prototype === null ||
26394
- prototype === Object.prototype ||
26395
- Object.getPrototypeOf(prototype) === null) &&
26396
- !(toStringTag$1 in val) &&
26397
- !(iterator in val)
26398
- );
26399
- };
26400
-
26401
- /**
26402
- * Determine if a value is an empty object (safely handles Buffers)
26403
- *
26404
- * @param {*} val The value to test
26405
- *
26406
- * @returns {boolean} True if value is an empty object, otherwise false
26407
- */
26408
- const isEmptyObject = (val) => {
26409
- // Early return for non-objects or Buffers to prevent RangeError
26410
- if (!isObject(val) || isBuffer$1(val)) {
26411
- return false;
26412
- }
26413
-
26414
- try {
26415
- return (
26416
- Object.keys(val).length === 0 &&
26417
- Object.getPrototypeOf(val) === Object.prototype
26418
- );
26419
- } catch (e) {
26420
- // Fallback for any other objects that might cause RangeError with Object.keys()
26421
- return false;
26422
- }
26378
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
26423
26379
  };
26424
26380
 
26425
26381
  /**
@@ -26429,7 +26385,7 @@ const isEmptyObject = (val) => {
26429
26385
  *
26430
26386
  * @returns {boolean} True if value is a Date, otherwise false
26431
26387
  */
26432
- const isDate = kindOfTest("Date");
26388
+ const isDate = kindOfTest('Date');
26433
26389
 
26434
26390
  /**
26435
26391
  * Determine if a value is a File
@@ -26438,7 +26394,7 @@ const isDate = kindOfTest("Date");
26438
26394
  *
26439
26395
  * @returns {boolean} True if value is a File, otherwise false
26440
26396
  */
26441
- const isFile = kindOfTest("File");
26397
+ const isFile = kindOfTest('File');
26442
26398
 
26443
26399
  /**
26444
26400
  * Determine if a value is a Blob
@@ -26447,7 +26403,7 @@ const isFile = kindOfTest("File");
26447
26403
  *
26448
26404
  * @returns {boolean} True if value is a Blob, otherwise false
26449
26405
  */
26450
- const isBlob = kindOfTest("Blob");
26406
+ const isBlob = kindOfTest('Blob');
26451
26407
 
26452
26408
  /**
26453
26409
  * Determine if a value is a FileList
@@ -26456,7 +26412,7 @@ const isBlob = kindOfTest("Blob");
26456
26412
  *
26457
26413
  * @returns {boolean} True if value is a File, otherwise false
26458
26414
  */
26459
- const isFileList = kindOfTest("FileList");
26415
+ const isFileList = kindOfTest('FileList');
26460
26416
 
26461
26417
  /**
26462
26418
  * Determine if a value is a Stream
@@ -26465,7 +26421,7 @@ const isFileList = kindOfTest("FileList");
26465
26421
  *
26466
26422
  * @returns {boolean} True if value is a Stream, otherwise false
26467
26423
  */
26468
- const isStream = (val) => isObject(val) && isFunction$2(val.pipe);
26424
+ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
26469
26425
 
26470
26426
  /**
26471
26427
  * Determine if a value is a FormData
@@ -26476,16 +26432,15 @@ const isStream = (val) => isObject(val) && isFunction$2(val.pipe);
26476
26432
  */
26477
26433
  const isFormData = (thing) => {
26478
26434
  let kind;
26479
- return (
26480
- thing &&
26481
- ((typeof FormData === "function" && thing instanceof FormData) ||
26482
- (isFunction$2(thing.append) &&
26483
- ((kind = kindOf(thing)) === "formdata" ||
26484
- // detect form-data instance
26485
- (kind === "object" &&
26486
- isFunction$2(thing.toString) &&
26487
- thing.toString() === "[object FormData]"))))
26488
- );
26435
+ return thing && (
26436
+ (typeof FormData === 'function' && thing instanceof FormData) || (
26437
+ isFunction$1(thing.append) && (
26438
+ (kind = kindOf(thing)) === 'formdata' ||
26439
+ // detect form-data instance
26440
+ (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
26441
+ )
26442
+ )
26443
+ )
26489
26444
  };
26490
26445
 
26491
26446
  /**
@@ -26495,14 +26450,9 @@ const isFormData = (thing) => {
26495
26450
  *
26496
26451
  * @returns {boolean} True if value is a URLSearchParams object, otherwise false
26497
26452
  */
26498
- const isURLSearchParams = kindOfTest("URLSearchParams");
26453
+ const isURLSearchParams = kindOfTest('URLSearchParams');
26499
26454
 
26500
- const [isReadableStream, isRequest, isResponse, isHeaders] = [
26501
- "ReadableStream",
26502
- "Request",
26503
- "Response",
26504
- "Headers",
26505
- ].map(kindOfTest);
26455
+ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
26506
26456
 
26507
26457
  /**
26508
26458
  * Trim excess whitespace off the beginning and end of a string
@@ -26511,8 +26461,8 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = [
26511
26461
  *
26512
26462
  * @returns {String} The String freed of excess whitespace
26513
26463
  */
26514
- const trim = (str) =>
26515
- str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
26464
+ const trim = (str) => str.trim ?
26465
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
26516
26466
 
26517
26467
  /**
26518
26468
  * Iterate over an Array or an Object invoking a function for each item.
@@ -26523,16 +26473,15 @@ const trim = (str) =>
26523
26473
  * If 'obj' is an Object callback will be called passing
26524
26474
  * the value, key, and complete object for each property.
26525
26475
  *
26526
- * @param {Object|Array<unknown>} obj The object to iterate
26476
+ * @param {Object|Array} obj The object to iterate
26527
26477
  * @param {Function} fn The callback to invoke for each item
26528
26478
  *
26529
- * @param {Object} [options]
26530
- * @param {Boolean} [options.allOwnKeys = false]
26479
+ * @param {Boolean} [allOwnKeys = false]
26531
26480
  * @returns {any}
26532
26481
  */
26533
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
26482
+ function forEach(obj, fn, {allOwnKeys = false} = {}) {
26534
26483
  // Don't bother if no value provided
26535
- if (obj === null || typeof obj === "undefined") {
26484
+ if (obj === null || typeof obj === 'undefined') {
26536
26485
  return;
26537
26486
  }
26538
26487
 
@@ -26540,7 +26489,7 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
26540
26489
  let l;
26541
26490
 
26542
26491
  // Force an array if not already something iterable
26543
- if (typeof obj !== "object") {
26492
+ if (typeof obj !== 'object') {
26544
26493
  /*eslint no-param-reassign:0*/
26545
26494
  obj = [obj];
26546
26495
  }
@@ -26551,15 +26500,8 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
26551
26500
  fn.call(null, obj[i], i, obj);
26552
26501
  }
26553
26502
  } else {
26554
- // Buffer check
26555
- if (isBuffer$1(obj)) {
26556
- return;
26557
- }
26558
-
26559
26503
  // Iterate over object keys
26560
- const keys = allOwnKeys
26561
- ? Object.getOwnPropertyNames(obj)
26562
- : Object.keys(obj);
26504
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
26563
26505
  const len = keys.length;
26564
26506
  let key;
26565
26507
 
@@ -26571,10 +26513,6 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
26571
26513
  }
26572
26514
 
26573
26515
  function findKey(obj, key) {
26574
- if (isBuffer$1(obj)) {
26575
- return null;
26576
- }
26577
-
26578
26516
  key = key.toLowerCase();
26579
26517
  const keys = Object.keys(obj);
26580
26518
  let i = keys.length;
@@ -26591,15 +26529,10 @@ function findKey(obj, key) {
26591
26529
  const _global = (() => {
26592
26530
  /*eslint no-undef:0*/
26593
26531
  if (typeof globalThis !== "undefined") return globalThis;
26594
- return typeof self !== "undefined"
26595
- ? self
26596
- : typeof window !== "undefined"
26597
- ? window
26598
- : global;
26532
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
26599
26533
  })();
26600
26534
 
26601
- const isContextDefined = (context) =>
26602
- !isUndefined(context) && context !== _global;
26535
+ const isContextDefined = (context) => !isUndefined(context) && context !== _global;
26603
26536
 
26604
26537
  /**
26605
26538
  * Accepts varargs expecting each argument to be an object, then
@@ -26611,7 +26544,7 @@ const isContextDefined = (context) =>
26611
26544
  * Example:
26612
26545
  *
26613
26546
  * ```js
26614
- * const result = merge({foo: 123}, {foo: 456});
26547
+ * var result = merge({foo: 123}, {foo: 456});
26615
26548
  * console.log(result.foo); // outputs 456
26616
26549
  * ```
26617
26550
  *
@@ -26620,22 +26553,17 @@ const isContextDefined = (context) =>
26620
26553
  * @returns {Object} Result of all merge properties
26621
26554
  */
26622
26555
  function merge(/* obj1, obj2, obj3, ... */) {
26623
- const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
26556
+ const {caseless} = isContextDefined(this) && this || {};
26624
26557
  const result = {};
26625
26558
  const assignValue = (val, key) => {
26626
- // Skip dangerous property names to prevent prototype pollution
26627
- if (key === "__proto__" || key === "constructor" || key === "prototype") {
26628
- return;
26629
- }
26630
-
26631
- const targetKey = (caseless && findKey(result, key)) || key;
26559
+ const targetKey = caseless && findKey(result, key) || key;
26632
26560
  if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
26633
26561
  result[targetKey] = merge(result[targetKey], val);
26634
26562
  } else if (isPlainObject(val)) {
26635
26563
  result[targetKey] = merge({}, val);
26636
26564
  } else if (isArray(val)) {
26637
26565
  result[targetKey] = val.slice();
26638
- } else if (!skipUndefined || !isUndefined(val)) {
26566
+ } else {
26639
26567
  result[targetKey] = val;
26640
26568
  }
26641
26569
  };
@@ -26653,32 +26581,17 @@ function merge(/* obj1, obj2, obj3, ... */) {
26653
26581
  * @param {Object} b The object to copy properties from
26654
26582
  * @param {Object} thisArg The object to bind function to
26655
26583
  *
26656
- * @param {Object} [options]
26657
- * @param {Boolean} [options.allOwnKeys]
26584
+ * @param {Boolean} [allOwnKeys]
26658
26585
  * @returns {Object} The resulting value of object a
26659
26586
  */
26660
- const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
26661
- forEach(
26662
- b,
26663
- (val, key) => {
26664
- if (thisArg && isFunction$2(val)) {
26665
- Object.defineProperty(a, key, {
26666
- value: bind$4(val, thisArg),
26667
- writable: true,
26668
- enumerable: true,
26669
- configurable: true,
26670
- });
26671
- } else {
26672
- Object.defineProperty(a, key, {
26673
- value: val,
26674
- writable: true,
26675
- enumerable: true,
26676
- configurable: true,
26677
- });
26678
- }
26679
- },
26680
- { allOwnKeys },
26681
- );
26587
+ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
26588
+ forEach(b, (val, key) => {
26589
+ if (thisArg && isFunction$1(val)) {
26590
+ a[key] = bind$4(val, thisArg);
26591
+ } else {
26592
+ a[key] = val;
26593
+ }
26594
+ }, {allOwnKeys});
26682
26595
  return a;
26683
26596
  };
26684
26597
 
@@ -26690,7 +26603,7 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
26690
26603
  * @returns {string} content value without BOM
26691
26604
  */
26692
26605
  const stripBOM = (content) => {
26693
- if (content.charCodeAt(0) === 0xfeff) {
26606
+ if (content.charCodeAt(0) === 0xFEFF) {
26694
26607
  content = content.slice(1);
26695
26608
  }
26696
26609
  return content;
@@ -26706,18 +26619,10 @@ const stripBOM = (content) => {
26706
26619
  * @returns {void}
26707
26620
  */
26708
26621
  const inherits = (constructor, superConstructor, props, descriptors) => {
26709
- constructor.prototype = Object.create(
26710
- superConstructor.prototype,
26711
- descriptors,
26712
- );
26713
- Object.defineProperty(constructor.prototype, "constructor", {
26714
- value: constructor,
26715
- writable: true,
26716
- enumerable: false,
26717
- configurable: true,
26718
- });
26719
- Object.defineProperty(constructor, "super", {
26720
- value: superConstructor.prototype,
26622
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
26623
+ constructor.prototype.constructor = constructor;
26624
+ Object.defineProperty(constructor, 'super', {
26625
+ value: superConstructor.prototype
26721
26626
  });
26722
26627
  props && Object.assign(constructor.prototype, props);
26723
26628
  };
@@ -26746,20 +26651,13 @@ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
26746
26651
  i = props.length;
26747
26652
  while (i-- > 0) {
26748
26653
  prop = props[i];
26749
- if (
26750
- (!propFilter || propFilter(prop, sourceObj, destObj)) &&
26751
- !merged[prop]
26752
- ) {
26654
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
26753
26655
  destObj[prop] = sourceObj[prop];
26754
26656
  merged[prop] = true;
26755
26657
  }
26756
26658
  }
26757
26659
  sourceObj = filter !== false && getPrototypeOf(sourceObj);
26758
- } while (
26759
- sourceObj &&
26760
- (!filter || filter(sourceObj, destObj)) &&
26761
- sourceObj !== Object.prototype
26762
- );
26660
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
26763
26661
 
26764
26662
  return destObj;
26765
26663
  };
@@ -26783,6 +26681,7 @@ const endsWith = (str, searchString, position) => {
26783
26681
  return lastIndex !== -1 && lastIndex === position;
26784
26682
  };
26785
26683
 
26684
+
26786
26685
  /**
26787
26686
  * Returns new array from array like object or null if failed
26788
26687
  *
@@ -26811,12 +26710,12 @@ const toArray = (thing) => {
26811
26710
  * @returns {Array}
26812
26711
  */
26813
26712
  // eslint-disable-next-line func-names
26814
- const isTypedArray = ((TypedArray) => {
26713
+ const isTypedArray = (TypedArray => {
26815
26714
  // eslint-disable-next-line func-names
26816
- return (thing) => {
26715
+ return thing => {
26817
26716
  return TypedArray && thing instanceof TypedArray;
26818
26717
  };
26819
- })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
26718
+ })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
26820
26719
 
26821
26720
  /**
26822
26721
  * For each entry in the object, call the function with the key and value.
@@ -26827,13 +26726,13 @@ const isTypedArray = ((TypedArray) => {
26827
26726
  * @returns {void}
26828
26727
  */
26829
26728
  const forEachEntry = (obj, fn) => {
26830
- const generator = obj && obj[iterator];
26729
+ const generator = obj && obj[Symbol.iterator];
26831
26730
 
26832
- const _iterator = generator.call(obj);
26731
+ const iterator = generator.call(obj);
26833
26732
 
26834
26733
  let result;
26835
26734
 
26836
- while ((result = _iterator.next()) && !result.done) {
26735
+ while ((result = iterator.next()) && !result.done) {
26837
26736
  const pair = result.value;
26838
26737
  fn.call(obj, pair[0], pair[1]);
26839
26738
  }
@@ -26859,22 +26758,18 @@ const matchAll = (regExp, str) => {
26859
26758
  };
26860
26759
 
26861
26760
  /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
26862
- const isHTMLForm = kindOfTest("HTMLFormElement");
26761
+ const isHTMLForm = kindOfTest('HTMLFormElement');
26863
26762
 
26864
- const toCamelCase = (str) => {
26865
- return str
26866
- .toLowerCase()
26867
- .replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
26763
+ const toCamelCase = str => {
26764
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
26765
+ function replacer(m, p1, p2) {
26868
26766
  return p1.toUpperCase() + p2;
26869
- });
26767
+ }
26768
+ );
26870
26769
  };
26871
26770
 
26872
26771
  /* Creating a function that will check if an object has a property. */
26873
- const hasOwnProperty = (
26874
- ({ hasOwnProperty }) =>
26875
- (obj, prop) =>
26876
- hasOwnProperty.call(obj, prop)
26877
- )(Object.prototype);
26772
+ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
26878
26773
 
26879
26774
  /**
26880
26775
  * Determine if a value is a RegExp object
@@ -26883,7 +26778,7 @@ const hasOwnProperty = (
26883
26778
  *
26884
26779
  * @returns {boolean} True if value is a RegExp object, otherwise false
26885
26780
  */
26886
- const isRegExp = kindOfTest("RegExp");
26781
+ const isRegExp = kindOfTest('RegExp');
26887
26782
 
26888
26783
  const reduceDescriptors = (obj, reducer) => {
26889
26784
  const descriptors = Object.getOwnPropertyDescriptors(obj);
@@ -26907,27 +26802,24 @@ const reduceDescriptors = (obj, reducer) => {
26907
26802
  const freezeMethods = (obj) => {
26908
26803
  reduceDescriptors(obj, (descriptor, name) => {
26909
26804
  // skip restricted props in strict mode
26910
- if (
26911
- isFunction$2(obj) &&
26912
- ["arguments", "caller", "callee"].indexOf(name) !== -1
26913
- ) {
26805
+ if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
26914
26806
  return false;
26915
26807
  }
26916
26808
 
26917
26809
  const value = obj[name];
26918
26810
 
26919
- if (!isFunction$2(value)) return;
26811
+ if (!isFunction$1(value)) return;
26920
26812
 
26921
26813
  descriptor.enumerable = false;
26922
26814
 
26923
- if ("writable" in descriptor) {
26815
+ if ('writable' in descriptor) {
26924
26816
  descriptor.writable = false;
26925
26817
  return;
26926
26818
  }
26927
26819
 
26928
26820
  if (!descriptor.set) {
26929
26821
  descriptor.set = () => {
26930
- throw Error("Can not rewrite read-only method '" + name + "'");
26822
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
26931
26823
  };
26932
26824
  }
26933
26825
  });
@@ -26937,14 +26829,12 @@ const toObjectSet = (arrayOrString, delimiter) => {
26937
26829
  const obj = {};
26938
26830
 
26939
26831
  const define = (arr) => {
26940
- arr.forEach((value) => {
26832
+ arr.forEach(value => {
26941
26833
  obj[value] = true;
26942
26834
  });
26943
26835
  };
26944
26836
 
26945
- isArray(arrayOrString)
26946
- ? define(arrayOrString)
26947
- : define(String(arrayOrString).split(delimiter));
26837
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
26948
26838
 
26949
26839
  return obj;
26950
26840
  };
@@ -26952,9 +26842,27 @@ const toObjectSet = (arrayOrString, delimiter) => {
26952
26842
  const noop$1 = () => {};
26953
26843
 
26954
26844
  const toFiniteNumber = (value, defaultValue) => {
26955
- return value != null && Number.isFinite((value = +value))
26956
- ? value
26957
- : defaultValue;
26845
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
26846
+ };
26847
+
26848
+ const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
26849
+
26850
+ const DIGIT = '0123456789';
26851
+
26852
+ const ALPHABET = {
26853
+ DIGIT,
26854
+ ALPHA,
26855
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
26856
+ };
26857
+
26858
+ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
26859
+ let str = '';
26860
+ const {length} = alphabet;
26861
+ while (size--) {
26862
+ str += alphabet[Math.random() * length|0];
26863
+ }
26864
+
26865
+ return str;
26958
26866
  };
26959
26867
 
26960
26868
  /**
@@ -26965,29 +26873,20 @@ const toFiniteNumber = (value, defaultValue) => {
26965
26873
  * @returns {boolean}
26966
26874
  */
26967
26875
  function isSpecCompliantForm(thing) {
26968
- return !!(
26969
- thing &&
26970
- isFunction$2(thing.append) &&
26971
- thing[toStringTag$1] === "FormData" &&
26972
- thing[iterator]
26973
- );
26876
+ return !!(thing && isFunction$1(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
26974
26877
  }
26975
26878
 
26976
26879
  const toJSONObject = (obj) => {
26977
26880
  const stack = new Array(10);
26978
26881
 
26979
26882
  const visit = (source, i) => {
26883
+
26980
26884
  if (isObject(source)) {
26981
26885
  if (stack.indexOf(source) >= 0) {
26982
26886
  return;
26983
26887
  }
26984
26888
 
26985
- //Buffer check
26986
- if (isBuffer$1(source)) {
26987
- return source;
26988
- }
26989
-
26990
- if (!("toJSON" in source)) {
26889
+ if(!('toJSON' in source)) {
26991
26890
  stack[i] = source;
26992
26891
  const target = isArray(source) ? [] : {};
26993
26892
 
@@ -27008,50 +26907,10 @@ const toJSONObject = (obj) => {
27008
26907
  return visit(obj, 0);
27009
26908
  };
27010
26909
 
27011
- const isAsyncFn = kindOfTest("AsyncFunction");
26910
+ const isAsyncFn = kindOfTest('AsyncFunction');
27012
26911
 
27013
26912
  const isThenable = (thing) =>
27014
- thing &&
27015
- (isObject(thing) || isFunction$2(thing)) &&
27016
- isFunction$2(thing.then) &&
27017
- isFunction$2(thing.catch);
27018
-
27019
- // original code
27020
- // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
27021
-
27022
- const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
27023
- if (setImmediateSupported) {
27024
- return setImmediate;
27025
- }
27026
-
27027
- return postMessageSupported
27028
- ? ((token, callbacks) => {
27029
- _global.addEventListener(
27030
- "message",
27031
- ({ source, data }) => {
27032
- if (source === _global && data === token) {
27033
- callbacks.length && callbacks.shift()();
27034
- }
27035
- },
27036
- false,
27037
- );
27038
-
27039
- return (cb) => {
27040
- callbacks.push(cb);
27041
- _global.postMessage(token, "*");
27042
- };
27043
- })(`axios@${Math.random()}`, [])
27044
- : (cb) => setTimeout(cb);
27045
- })(typeof setImmediate === "function", isFunction$2(_global.postMessage));
27046
-
27047
- const asap =
27048
- typeof queueMicrotask !== "undefined"
27049
- ? queueMicrotask.bind(_global)
27050
- : (typeof process !== "undefined" && process.nextTick) || _setImmediate;
27051
-
27052
- // *********************
27053
-
27054
- const isIterable = (thing) => thing != null && isFunction$2(thing[iterator]);
26913
+ thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
27055
26914
 
27056
26915
  var utils$1 = {
27057
26916
  isArray,
@@ -27064,7 +26923,6 @@ var utils$1 = {
27064
26923
  isBoolean,
27065
26924
  isObject,
27066
26925
  isPlainObject,
27067
- isEmptyObject,
27068
26926
  isReadableStream,
27069
26927
  isRequest,
27070
26928
  isResponse,
@@ -27074,7 +26932,7 @@ var utils$1 = {
27074
26932
  isFile,
27075
26933
  isBlob,
27076
26934
  isRegExp,
27077
- isFunction: isFunction$2,
26935
+ isFunction: isFunction$1,
27078
26936
  isStream,
27079
26937
  isURLSearchParams,
27080
26938
  isTypedArray,
@@ -27104,84 +26962,108 @@ var utils$1 = {
27104
26962
  findKey,
27105
26963
  global: _global,
27106
26964
  isContextDefined,
26965
+ ALPHABET,
26966
+ generateString,
27107
26967
  isSpecCompliantForm,
27108
26968
  toJSONObject,
27109
26969
  isAsyncFn,
27110
- isThenable,
27111
- setImmediate: _setImmediate,
27112
- asap,
27113
- isIterable,
26970
+ isThenable
27114
26971
  };
27115
26972
 
27116
- class AxiosError extends Error {
27117
- static from(error, code, config, request, response, customProps) {
27118
- const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
27119
- axiosError.cause = error;
27120
- axiosError.name = error.name;
27121
- customProps && Object.assign(axiosError, customProps);
27122
- return axiosError;
27123
- }
26973
+ /**
26974
+ * Create an Error with the specified message, config, error code, request and response.
26975
+ *
26976
+ * @param {string} message The error message.
26977
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
26978
+ * @param {Object} [config] The config.
26979
+ * @param {Object} [request] The request.
26980
+ * @param {Object} [response] The response.
26981
+ *
26982
+ * @returns {Error} The created error.
26983
+ */
26984
+ function AxiosError(message, code, config, request, response) {
26985
+ Error.call(this);
27124
26986
 
27125
- /**
27126
- * Create an Error with the specified message, config, error code, request and response.
27127
- *
27128
- * @param {string} message The error message.
27129
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
27130
- * @param {Object} [config] The config.
27131
- * @param {Object} [request] The request.
27132
- * @param {Object} [response] The response.
27133
- *
27134
- * @returns {Error} The created error.
27135
- */
27136
- constructor(message, code, config, request, response) {
27137
- super(message);
27138
- this.name = 'AxiosError';
27139
- this.isAxiosError = true;
27140
- code && (this.code = code);
27141
- config && (this.config = config);
27142
- request && (this.request = request);
27143
- if (response) {
27144
- this.response = response;
27145
- this.status = response.status;
27146
- }
27147
- }
26987
+ if (Error.captureStackTrace) {
26988
+ Error.captureStackTrace(this, this.constructor);
26989
+ } else {
26990
+ this.stack = (new Error()).stack;
26991
+ }
27148
26992
 
27149
- toJSON() {
27150
- return {
27151
- // Standard
27152
- message: this.message,
27153
- name: this.name,
27154
- // Microsoft
27155
- description: this.description,
27156
- number: this.number,
27157
- // Mozilla
27158
- fileName: this.fileName,
27159
- lineNumber: this.lineNumber,
27160
- columnNumber: this.columnNumber,
27161
- stack: this.stack,
27162
- // Axios
27163
- config: utils$1.toJSONObject(this.config),
27164
- code: this.code,
27165
- status: this.status,
27166
- };
27167
- }
26993
+ this.message = message;
26994
+ this.name = 'AxiosError';
26995
+ code && (this.code = code);
26996
+ config && (this.config = config);
26997
+ request && (this.request = request);
26998
+ response && (this.response = response);
27168
26999
  }
27169
27000
 
27170
- // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
27171
- AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
27172
- AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
27173
- AxiosError.ECONNABORTED = 'ECONNABORTED';
27174
- AxiosError.ETIMEDOUT = 'ETIMEDOUT';
27175
- AxiosError.ERR_NETWORK = 'ERR_NETWORK';
27176
- AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
27177
- AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
27178
- AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
27179
- AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
27180
- AxiosError.ERR_CANCELED = 'ERR_CANCELED';
27181
- AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
27182
- AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
27001
+ utils$1.inherits(AxiosError, Error, {
27002
+ toJSON: function toJSON() {
27003
+ return {
27004
+ // Standard
27005
+ message: this.message,
27006
+ name: this.name,
27007
+ // Microsoft
27008
+ description: this.description,
27009
+ number: this.number,
27010
+ // Mozilla
27011
+ fileName: this.fileName,
27012
+ lineNumber: this.lineNumber,
27013
+ columnNumber: this.columnNumber,
27014
+ stack: this.stack,
27015
+ // Axios
27016
+ config: utils$1.toJSONObject(this.config),
27017
+ code: this.code,
27018
+ status: this.response && this.response.status ? this.response.status : null
27019
+ };
27020
+ }
27021
+ });
27183
27022
 
27184
- var AxiosError$1 = AxiosError;
27023
+ const prototype$1 = AxiosError.prototype;
27024
+ const descriptors = {};
27025
+
27026
+ [
27027
+ 'ERR_BAD_OPTION_VALUE',
27028
+ 'ERR_BAD_OPTION',
27029
+ 'ECONNABORTED',
27030
+ 'ETIMEDOUT',
27031
+ 'ERR_NETWORK',
27032
+ 'ERR_FR_TOO_MANY_REDIRECTS',
27033
+ 'ERR_DEPRECATED',
27034
+ 'ERR_BAD_RESPONSE',
27035
+ 'ERR_BAD_REQUEST',
27036
+ 'ERR_CANCELED',
27037
+ 'ERR_NOT_SUPPORT',
27038
+ 'ERR_INVALID_URL'
27039
+ // eslint-disable-next-line func-names
27040
+ ].forEach(code => {
27041
+ descriptors[code] = {value: code};
27042
+ });
27043
+
27044
+ Object.defineProperties(AxiosError, descriptors);
27045
+ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
27046
+
27047
+ // eslint-disable-next-line func-names
27048
+ AxiosError.from = (error, code, config, request, response, customProps) => {
27049
+ const axiosError = Object.create(prototype$1);
27050
+
27051
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
27052
+ return obj !== Error.prototype;
27053
+ }, prop => {
27054
+ return prop !== 'isAxiosError';
27055
+ });
27056
+
27057
+ AxiosError.call(axiosError, error.message, code, config, request, response);
27058
+
27059
+ axiosError.cause = error;
27060
+
27061
+ axiosError.name = error.name;
27062
+
27063
+ customProps && Object.assign(axiosError, customProps);
27064
+
27065
+ return axiosError;
27066
+ };
27185
27067
 
27186
27068
  var Stream$2 = stream.Stream;
27187
27069
  var util$2 = require$$1;
@@ -40161,12 +40043,8 @@ function toFormData(obj, formData, options) {
40161
40043
  return value.toISOString();
40162
40044
  }
40163
40045
 
40164
- if (utils$1.isBoolean(value)) {
40165
- return value.toString();
40166
- }
40167
-
40168
40046
  if (!useBlob && utils$1.isBlob(value)) {
40169
- throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
40047
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
40170
40048
  }
40171
40049
 
40172
40050
  if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
@@ -40327,7 +40205,9 @@ function encode(val) {
40327
40205
  replace(/%3A/gi, ':').
40328
40206
  replace(/%24/g, '$').
40329
40207
  replace(/%2C/gi, ',').
40330
- replace(/%20/g, '+');
40208
+ replace(/%20/g, '+').
40209
+ replace(/%5B/gi, '[').
40210
+ replace(/%5D/gi, ']');
40331
40211
  }
40332
40212
 
40333
40213
  /**
@@ -40335,31 +40215,28 @@ function encode(val) {
40335
40215
  *
40336
40216
  * @param {string} url The base of the url (e.g., http://www.google.com)
40337
40217
  * @param {object} [params] The params to be appended
40338
- * @param {?(object|Function)} options
40218
+ * @param {?object} options
40339
40219
  *
40340
40220
  * @returns {string} The formatted url
40341
40221
  */
40342
40222
  function buildURL(url, params, options) {
40223
+ /*eslint no-param-reassign:0*/
40343
40224
  if (!params) {
40344
40225
  return url;
40345
40226
  }
40346
-
40227
+
40347
40228
  const _encode = options && options.encode || encode;
40348
40229
 
40349
- const _options = utils$1.isFunction(options) ? {
40350
- serialize: options
40351
- } : options;
40352
-
40353
- const serializeFn = _options && _options.serialize;
40230
+ const serializeFn = options && options.serialize;
40354
40231
 
40355
40232
  let serializedParams;
40356
40233
 
40357
40234
  if (serializeFn) {
40358
- serializedParams = serializeFn(params, _options);
40235
+ serializedParams = serializeFn(params, options);
40359
40236
  } else {
40360
40237
  serializedParams = utils$1.isURLSearchParams(params) ?
40361
40238
  params.toString() :
40362
- new AxiosURLSearchParams(params, _options).toString(_encode);
40239
+ new AxiosURLSearchParams(params, options).toString(_encode);
40363
40240
  }
40364
40241
 
40365
40242
  if (serializedParams) {
@@ -40384,7 +40261,6 @@ class InterceptorManager {
40384
40261
  *
40385
40262
  * @param {Function} fulfilled The function to handle `then` for a `Promise`
40386
40263
  * @param {Function} rejected The function to handle `reject` for a `Promise`
40387
- * @param {Object} options The options for the interceptor, synchronous and runWhen
40388
40264
  *
40389
40265
  * @return {Number} An ID used to remove interceptor later
40390
40266
  */
@@ -40403,7 +40279,7 @@ class InterceptorManager {
40403
40279
  *
40404
40280
  * @param {Number} id The ID that was returned by `use`
40405
40281
  *
40406
- * @returns {void}
40282
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
40407
40283
  */
40408
40284
  eject(id) {
40409
40285
  if (this.handlers[id]) {
@@ -40446,35 +40322,11 @@ var InterceptorManager$1 = InterceptorManager;
40446
40322
  var transitionalDefaults = {
40447
40323
  silentJSONParsing: true,
40448
40324
  forcedJSONParsing: true,
40449
- clarifyTimeoutError: false,
40450
- legacyInterceptorReqResOrdering: true
40325
+ clarifyTimeoutError: false
40451
40326
  };
40452
40327
 
40453
40328
  var URLSearchParams$1 = require$$0$1.URLSearchParams;
40454
40329
 
40455
- const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
40456
-
40457
- const DIGIT = '0123456789';
40458
-
40459
- const ALPHABET = {
40460
- DIGIT,
40461
- ALPHA,
40462
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
40463
- };
40464
-
40465
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
40466
- let str = '';
40467
- const {length} = alphabet;
40468
- const randomValues = new Uint32Array(size);
40469
- require$$8.randomFillSync(randomValues);
40470
- for (let i = 0; i < size; i++) {
40471
- str += alphabet[randomValues[i] % length];
40472
- }
40473
-
40474
- return str;
40475
- };
40476
-
40477
-
40478
40330
  var platform$1 = {
40479
40331
  isNode: true,
40480
40332
  classes: {
@@ -40482,15 +40334,11 @@ var platform$1 = {
40482
40334
  FormData: FormData$2,
40483
40335
  Blob: typeof Blob !== 'undefined' && Blob || null
40484
40336
  },
40485
- ALPHABET,
40486
- generateString,
40487
40337
  protocols: [ 'http', 'https', 'file', 'data' ]
40488
40338
  };
40489
40339
 
40490
40340
  const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
40491
40341
 
40492
- const _navigator = typeof navigator === 'object' && navigator || undefined;
40493
-
40494
40342
  /**
40495
40343
  * Determine if we're running in a standard browser environment
40496
40344
  *
@@ -40508,8 +40356,10 @@ const _navigator = typeof navigator === 'object' && navigator || undefined;
40508
40356
  *
40509
40357
  * @returns {boolean}
40510
40358
  */
40511
- const hasStandardBrowserEnv = hasBrowserEnv &&
40512
- (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
40359
+ const hasStandardBrowserEnv = (
40360
+ (product) => {
40361
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
40362
+ })(typeof navigator !== 'undefined' && navigator.product);
40513
40363
 
40514
40364
  /**
40515
40365
  * Determine if we're running in a standard browser webWorker environment
@@ -40536,7 +40386,6 @@ var utils = /*#__PURE__*/Object.freeze({
40536
40386
  hasBrowserEnv: hasBrowserEnv,
40537
40387
  hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
40538
40388
  hasStandardBrowserEnv: hasStandardBrowserEnv,
40539
- navigator: _navigator,
40540
40389
  origin: origin
40541
40390
  });
40542
40391
 
@@ -40546,7 +40395,7 @@ var platform = {
40546
40395
  };
40547
40396
 
40548
40397
  function toURLEncodedForm(data, options) {
40549
- return toFormData(data, new platform.classes.URLSearchParams(), {
40398
+ return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
40550
40399
  visitor: function(value, key, path, helpers) {
40551
40400
  if (platform.isNode && utils$1.isBuffer(value)) {
40552
40401
  this.append(key, value.toString('base64'));
@@ -40554,9 +40403,8 @@ function toURLEncodedForm(data, options) {
40554
40403
  }
40555
40404
 
40556
40405
  return helpers.defaultVisitor.apply(this, arguments);
40557
- },
40558
- ...options
40559
- });
40406
+ }
40407
+ }, options));
40560
40408
  }
40561
40409
 
40562
40410
  /**
@@ -40752,11 +40600,11 @@ const defaults = {
40752
40600
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
40753
40601
 
40754
40602
  try {
40755
- return JSON.parse(data, this.parseReviver);
40603
+ return JSON.parse(data);
40756
40604
  } catch (e) {
40757
40605
  if (strictJSONParsing) {
40758
40606
  if (e.name === 'SyntaxError') {
40759
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
40607
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
40760
40608
  }
40761
40609
  throw e;
40762
40610
  }
@@ -40950,18 +40798,10 @@ class AxiosHeaders {
40950
40798
  setHeaders(header, valueOrRewrite);
40951
40799
  } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
40952
40800
  setHeaders(parseHeaders(header), valueOrRewrite);
40953
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
40954
- let obj = {}, dest, key;
40955
- for (const entry of header) {
40956
- if (!utils$1.isArray(entry)) {
40957
- throw TypeError('Object iterator must return a key-value pair');
40958
- }
40959
-
40960
- obj[key = entry[0]] = (dest = obj[key]) ?
40961
- (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
40801
+ } else if (utils$1.isHeaders(header)) {
40802
+ for (const [key, value] of header.entries()) {
40803
+ setHeader(value, key, rewrite);
40962
40804
  }
40963
-
40964
- setHeaders(obj, valueOrRewrite);
40965
40805
  } else {
40966
40806
  header != null && setHeader(valueOrRewrite, header, rewrite);
40967
40807
  }
@@ -41103,10 +40943,6 @@ class AxiosHeaders {
41103
40943
  return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
41104
40944
  }
41105
40945
 
41106
- getSetCookie() {
41107
- return this.get("set-cookie") || [];
41108
- }
41109
-
41110
40946
  get [Symbol.toStringTag]() {
41111
40947
  return 'AxiosHeaders';
41112
40948
  }
@@ -41190,24 +41026,24 @@ function isCancel(value) {
41190
41026
  return !!(value && value.__CANCEL__);
41191
41027
  }
41192
41028
 
41193
- class CanceledError extends AxiosError$1 {
41194
- /**
41195
- * A `CanceledError` is an object that is thrown when an operation is canceled.
41196
- *
41197
- * @param {string=} message The message.
41198
- * @param {Object=} config The config.
41199
- * @param {Object=} request The request.
41200
- *
41201
- * @returns {CanceledError} The created error.
41202
- */
41203
- constructor(message, config, request) {
41204
- super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
41205
- this.name = 'CanceledError';
41206
- this.__CANCEL__ = true;
41207
- }
41029
+ /**
41030
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
41031
+ *
41032
+ * @param {string=} message The message.
41033
+ * @param {Object=} config The config.
41034
+ * @param {Object=} request The request.
41035
+ *
41036
+ * @returns {CanceledError} The created error.
41037
+ */
41038
+ function CanceledError(message, config, request) {
41039
+ // eslint-disable-next-line no-eq-null,eqeqeq
41040
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
41041
+ this.name = 'CanceledError';
41208
41042
  }
41209
41043
 
41210
- var CanceledError$1 = CanceledError;
41044
+ utils$1.inherits(CanceledError, AxiosError, {
41045
+ __CANCEL__: true
41046
+ });
41211
41047
 
41212
41048
  /**
41213
41049
  * Resolve or reject a Promise based on response status.
@@ -41223,9 +41059,9 @@ function settle(resolve, reject, response) {
41223
41059
  if (!response.status || !validateStatus || validateStatus(response.status)) {
41224
41060
  resolve(response);
41225
41061
  } else {
41226
- reject(new AxiosError$1(
41062
+ reject(new AxiosError(
41227
41063
  'Request failed with status code ' + response.status,
41228
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
41064
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
41229
41065
  response.config,
41230
41066
  response.request,
41231
41067
  response
@@ -41244,10 +41080,6 @@ function isAbsoluteURL(url) {
41244
41080
  // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
41245
41081
  // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
41246
41082
  // by any combination of letters, digits, plus, period, or hyphen.
41247
- if (typeof url !== 'string') {
41248
- return false;
41249
- }
41250
-
41251
41083
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
41252
41084
  }
41253
41085
 
@@ -41275,16 +41107,13 @@ function combineURLs(baseURL, relativeURL) {
41275
41107
  *
41276
41108
  * @returns {string} The combined full path
41277
41109
  */
41278
- function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
41279
- let isRelativeUrl = !isAbsoluteURL(requestedURL);
41280
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
41110
+ function buildFullPath(baseURL, requestedURL) {
41111
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
41281
41112
  return combineURLs(baseURL, requestedURL);
41282
41113
  }
41283
41114
  return requestedURL;
41284
41115
  }
41285
41116
 
41286
- var proxyFromEnv = {};
41287
-
41288
41117
  var parseUrl$1 = require$$0$1.parse;
41289
41118
 
41290
41119
  var DEFAULT_PORTS = {
@@ -41390,7 +41219,7 @@ function getEnv(key) {
41390
41219
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';
41391
41220
  }
41392
41221
 
41393
- proxyFromEnv.getProxyForUrl = getProxyForUrl;
41222
+ var getProxyForUrl_1 = getProxyForUrl;
41394
41223
 
41395
41224
  var followRedirects$1 = {exports: {}};
41396
41225
 
@@ -42578,7 +42407,7 @@ var debug = debug_1;
42578
42407
  (function detectUnsupportedEnvironment() {
42579
42408
  var looksLikeNode = typeof process !== "undefined";
42580
42409
  var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
42581
- var looksLikeV8 = isFunction$1(Error.captureStackTrace);
42410
+ var looksLikeV8 = isFunction(Error.captureStackTrace);
42582
42411
  if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
42583
42412
  console.warn("The follow-redirects package should be excluded from browser builds.");
42584
42413
  }
@@ -42702,7 +42531,7 @@ RedirectableRequest.prototype.write = function (data, encoding, callback) {
42702
42531
  if (!isString(data) && !isBuffer(data)) {
42703
42532
  throw new TypeError("data should be a string, Buffer or Uint8Array");
42704
42533
  }
42705
- if (isFunction$1(encoding)) {
42534
+ if (isFunction(encoding)) {
42706
42535
  callback = encoding;
42707
42536
  encoding = null;
42708
42537
  }
@@ -42731,11 +42560,11 @@ RedirectableRequest.prototype.write = function (data, encoding, callback) {
42731
42560
  // Ends the current native request
42732
42561
  RedirectableRequest.prototype.end = function (data, encoding, callback) {
42733
42562
  // Shift parameters if necessary
42734
- if (isFunction$1(data)) {
42563
+ if (isFunction(data)) {
42735
42564
  callback = data;
42736
42565
  data = encoding = null;
42737
42566
  }
42738
- else if (isFunction$1(encoding)) {
42567
+ else if (isFunction(encoding)) {
42739
42568
  callback = encoding;
42740
42569
  encoding = null;
42741
42570
  }
@@ -43043,7 +42872,7 @@ RedirectableRequest.prototype._processResponse = function (response) {
43043
42872
  }
43044
42873
 
43045
42874
  // Evaluate the beforeRedirect callback
43046
- if (isFunction$1(beforeRedirect)) {
42875
+ if (isFunction(beforeRedirect)) {
43047
42876
  var responseDetails = {
43048
42877
  headers: response.headers,
43049
42878
  statusCode: statusCode,
@@ -43090,7 +42919,7 @@ function wrap(protocols) {
43090
42919
  options = validateUrl(input);
43091
42920
  input = { protocol: protocol };
43092
42921
  }
43093
- if (isFunction$1(options)) {
42922
+ if (isFunction(options)) {
43094
42923
  callback = options;
43095
42924
  options = null;
43096
42925
  }
@@ -43195,7 +43024,7 @@ function createErrorType(code, message, baseClass) {
43195
43024
  // Create constructor
43196
43025
  function CustomError(properties) {
43197
43026
  // istanbul ignore else
43198
- if (isFunction$1(Error.captureStackTrace)) {
43027
+ if (isFunction(Error.captureStackTrace)) {
43199
43028
  Error.captureStackTrace(this, this.constructor);
43200
43029
  }
43201
43030
  Object.assign(this, properties || {});
@@ -43236,7 +43065,7 @@ function isString(value) {
43236
43065
  return typeof value === "string" || value instanceof String;
43237
43066
  }
43238
43067
 
43239
- function isFunction$1(value) {
43068
+ function isFunction(value) {
43240
43069
  return typeof value === "function";
43241
43070
  }
43242
43071
 
@@ -43254,7 +43083,7 @@ followRedirects$1.exports.wrap = wrap;
43254
43083
 
43255
43084
  var followRedirects = followRedirects$1.exports;
43256
43085
 
43257
- const VERSION = "1.13.5";
43086
+ const VERSION = "1.7.2";
43258
43087
 
43259
43088
  function parseProtocol(url) {
43260
43089
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -43287,7 +43116,7 @@ function fromDataURI(uri, asBlob, options) {
43287
43116
  const match = DATA_URL_PATTERN.exec(uri);
43288
43117
 
43289
43118
  if (!match) {
43290
- throw new AxiosError$1('Invalid URL', AxiosError$1.ERR_INVALID_URL);
43119
+ throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
43291
43120
  }
43292
43121
 
43293
43122
  const mime = match[1];
@@ -43297,7 +43126,7 @@ function fromDataURI(uri, asBlob, options) {
43297
43126
 
43298
43127
  if (asBlob) {
43299
43128
  if (!_Blob) {
43300
- throw new AxiosError$1('Blob is not supported', AxiosError$1.ERR_NOT_SUPPORT);
43129
+ throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
43301
43130
  }
43302
43131
 
43303
43132
  return new _Blob([buffer], {type: mime});
@@ -43306,7 +43135,91 @@ function fromDataURI(uri, asBlob, options) {
43306
43135
  return buffer;
43307
43136
  }
43308
43137
 
43309
- throw new AxiosError$1('Unsupported protocol ' + protocol, AxiosError$1.ERR_NOT_SUPPORT);
43138
+ throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
43139
+ }
43140
+
43141
+ /**
43142
+ * Throttle decorator
43143
+ * @param {Function} fn
43144
+ * @param {Number} freq
43145
+ * @return {Function}
43146
+ */
43147
+ function throttle(fn, freq) {
43148
+ let timestamp = 0;
43149
+ const threshold = 1000 / freq;
43150
+ let timer = null;
43151
+ return function throttled() {
43152
+ const force = this === true;
43153
+
43154
+ const now = Date.now();
43155
+ if (force || now - timestamp > threshold) {
43156
+ if (timer) {
43157
+ clearTimeout(timer);
43158
+ timer = null;
43159
+ }
43160
+ timestamp = now;
43161
+ return fn.apply(null, arguments);
43162
+ }
43163
+ if (!timer) {
43164
+ timer = setTimeout(() => {
43165
+ timer = null;
43166
+ timestamp = Date.now();
43167
+ return fn.apply(null, arguments);
43168
+ }, threshold - (now - timestamp));
43169
+ }
43170
+ };
43171
+ }
43172
+
43173
+ /**
43174
+ * Calculate data maxRate
43175
+ * @param {Number} [samplesCount= 10]
43176
+ * @param {Number} [min= 1000]
43177
+ * @returns {Function}
43178
+ */
43179
+ function speedometer(samplesCount, min) {
43180
+ samplesCount = samplesCount || 10;
43181
+ const bytes = new Array(samplesCount);
43182
+ const timestamps = new Array(samplesCount);
43183
+ let head = 0;
43184
+ let tail = 0;
43185
+ let firstSampleTS;
43186
+
43187
+ min = min !== undefined ? min : 1000;
43188
+
43189
+ return function push(chunkLength) {
43190
+ const now = Date.now();
43191
+
43192
+ const startedAt = timestamps[tail];
43193
+
43194
+ if (!firstSampleTS) {
43195
+ firstSampleTS = now;
43196
+ }
43197
+
43198
+ bytes[head] = chunkLength;
43199
+ timestamps[head] = now;
43200
+
43201
+ let i = tail;
43202
+ let bytesCount = 0;
43203
+
43204
+ while (i !== head) {
43205
+ bytesCount += bytes[i++];
43206
+ i = i % samplesCount;
43207
+ }
43208
+
43209
+ head = (head + 1) % samplesCount;
43210
+
43211
+ if (head === tail) {
43212
+ tail = (tail + 1) % samplesCount;
43213
+ }
43214
+
43215
+ if (now - firstSampleTS < min) {
43216
+ return;
43217
+ }
43218
+
43219
+ const passed = startedAt && now - startedAt;
43220
+
43221
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
43222
+ };
43310
43223
  }
43311
43224
 
43312
43225
  const kInternals = Symbol('internals');
@@ -43328,8 +43241,12 @@ class AxiosTransformStream extends stream.Transform{
43328
43241
  readableHighWaterMark: options.chunkSize
43329
43242
  });
43330
43243
 
43244
+ const self = this;
43245
+
43331
43246
  const internals = this[kInternals] = {
43247
+ length: options.length,
43332
43248
  timeWindow: options.timeWindow,
43249
+ ticksRate: options.ticksRate,
43333
43250
  chunkSize: options.chunkSize,
43334
43251
  maxRate: options.maxRate,
43335
43252
  minChunkSize: options.minChunkSize,
@@ -43341,6 +43258,8 @@ class AxiosTransformStream extends stream.Transform{
43341
43258
  onReadCallback: null
43342
43259
  };
43343
43260
 
43261
+ const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);
43262
+
43344
43263
  this.on('newListener', event => {
43345
43264
  if (event === 'progress') {
43346
43265
  if (!internals.isCaptured) {
@@ -43348,6 +43267,39 @@ class AxiosTransformStream extends stream.Transform{
43348
43267
  }
43349
43268
  }
43350
43269
  });
43270
+
43271
+ let bytesNotified = 0;
43272
+
43273
+ internals.updateProgress = throttle(function throttledHandler() {
43274
+ const totalBytes = internals.length;
43275
+ const bytesTransferred = internals.bytesSeen;
43276
+ const progressBytes = bytesTransferred - bytesNotified;
43277
+ if (!progressBytes || self.destroyed) return;
43278
+
43279
+ const rate = _speedometer(progressBytes);
43280
+
43281
+ bytesNotified = bytesTransferred;
43282
+
43283
+ process.nextTick(() => {
43284
+ self.emit('progress', {
43285
+ loaded: bytesTransferred,
43286
+ total: totalBytes,
43287
+ progress: totalBytes ? (bytesTransferred / totalBytes) : undefined,
43288
+ bytes: progressBytes,
43289
+ rate: rate ? rate : undefined,
43290
+ estimated: rate && totalBytes && bytesTransferred <= totalBytes ?
43291
+ (totalBytes - bytesTransferred) / rate : undefined,
43292
+ lengthComputable: totalBytes != null
43293
+ });
43294
+ });
43295
+ }, internals.ticksRate);
43296
+
43297
+ const onFinish = () => {
43298
+ internals.updateProgress.call(true);
43299
+ };
43300
+
43301
+ this.once('end', onFinish);
43302
+ this.once('error', onFinish);
43351
43303
  }
43352
43304
 
43353
43305
  _read(size) {
@@ -43361,6 +43313,7 @@ class AxiosTransformStream extends stream.Transform{
43361
43313
  }
43362
43314
 
43363
43315
  _transform(chunk, encoding, callback) {
43316
+ const self = this;
43364
43317
  const internals = this[kInternals];
43365
43318
  const maxRate = internals.maxRate;
43366
43319
 
@@ -43372,14 +43325,16 @@ class AxiosTransformStream extends stream.Transform{
43372
43325
  const bytesThreshold = (maxRate / divider);
43373
43326
  const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
43374
43327
 
43375
- const pushChunk = (_chunk, _callback) => {
43328
+ function pushChunk(_chunk, _callback) {
43376
43329
  const bytes = Buffer.byteLength(_chunk);
43377
43330
  internals.bytesSeen += bytes;
43378
43331
  internals.bytes += bytes;
43379
43332
 
43380
- internals.isCaptured && this.emit('progress', internals.bytesSeen);
43333
+ if (internals.isCaptured) {
43334
+ internals.updateProgress();
43335
+ }
43381
43336
 
43382
- if (this.push(_chunk)) {
43337
+ if (self.push(_chunk)) {
43383
43338
  process.nextTick(_callback);
43384
43339
  } else {
43385
43340
  internals.onReadCallback = () => {
@@ -43387,7 +43342,7 @@ class AxiosTransformStream extends stream.Transform{
43387
43342
  process.nextTick(_callback);
43388
43343
  };
43389
43344
  }
43390
- };
43345
+ }
43391
43346
 
43392
43347
  const transformChunk = (_chunk, _callback) => {
43393
43348
  const chunkSize = Buffer.byteLength(_chunk);
@@ -43444,6 +43399,11 @@ class AxiosTransformStream extends stream.Transform{
43444
43399
  }
43445
43400
  });
43446
43401
  }
43402
+
43403
+ setLength(length) {
43404
+ this[kInternals].length = +length;
43405
+ return this;
43406
+ }
43447
43407
  }
43448
43408
 
43449
43409
  var AxiosTransformStream$1 = AxiosTransformStream;
@@ -43464,9 +43424,9 @@ const readBlob = async function* (blob) {
43464
43424
 
43465
43425
  var readBlob$1 = readBlob;
43466
43426
 
43467
- const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';
43427
+ const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_';
43468
43428
 
43469
- const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new require$$1.TextEncoder();
43429
+ const textEncoder = new TextEncoder$1();
43470
43430
 
43471
43431
  const CRLF = '\r\n';
43472
43432
  const CRLF_BYTES = textEncoder.encode(CRLF);
@@ -43524,7 +43484,7 @@ const formDataToStream = (form, headersHandler, options) => {
43524
43484
  const {
43525
43485
  tag = 'form-data-boundary',
43526
43486
  size = 25,
43527
- boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)
43487
+ boundary = tag + '-' + utils$1.generateString(size, BOUNDARY_ALPHABET)
43528
43488
  } = options || {};
43529
43489
 
43530
43490
  if(!utils$1.isFormData(form)) {
@@ -43536,7 +43496,7 @@ const formDataToStream = (form, headersHandler, options) => {
43536
43496
  }
43537
43497
 
43538
43498
  const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
43539
- const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
43499
+ const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
43540
43500
  let contentLength = footerBytes.byteLength;
43541
43501
 
43542
43502
  const parts = Array.from(form.entries()).map(([name, value]) => {
@@ -43611,216 +43571,6 @@ const callbackify = (fn, reducer) => {
43611
43571
 
43612
43572
  var callbackify$1 = callbackify;
43613
43573
 
43614
- /**
43615
- * Calculate data maxRate
43616
- * @param {Number} [samplesCount= 10]
43617
- * @param {Number} [min= 1000]
43618
- * @returns {Function}
43619
- */
43620
- function speedometer(samplesCount, min) {
43621
- samplesCount = samplesCount || 10;
43622
- const bytes = new Array(samplesCount);
43623
- const timestamps = new Array(samplesCount);
43624
- let head = 0;
43625
- let tail = 0;
43626
- let firstSampleTS;
43627
-
43628
- min = min !== undefined ? min : 1000;
43629
-
43630
- return function push(chunkLength) {
43631
- const now = Date.now();
43632
-
43633
- const startedAt = timestamps[tail];
43634
-
43635
- if (!firstSampleTS) {
43636
- firstSampleTS = now;
43637
- }
43638
-
43639
- bytes[head] = chunkLength;
43640
- timestamps[head] = now;
43641
-
43642
- let i = tail;
43643
- let bytesCount = 0;
43644
-
43645
- while (i !== head) {
43646
- bytesCount += bytes[i++];
43647
- i = i % samplesCount;
43648
- }
43649
-
43650
- head = (head + 1) % samplesCount;
43651
-
43652
- if (head === tail) {
43653
- tail = (tail + 1) % samplesCount;
43654
- }
43655
-
43656
- if (now - firstSampleTS < min) {
43657
- return;
43658
- }
43659
-
43660
- const passed = startedAt && now - startedAt;
43661
-
43662
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
43663
- };
43664
- }
43665
-
43666
- /**
43667
- * Throttle decorator
43668
- * @param {Function} fn
43669
- * @param {Number} freq
43670
- * @return {Function}
43671
- */
43672
- function throttle(fn, freq) {
43673
- let timestamp = 0;
43674
- let threshold = 1000 / freq;
43675
- let lastArgs;
43676
- let timer;
43677
-
43678
- const invoke = (args, now = Date.now()) => {
43679
- timestamp = now;
43680
- lastArgs = null;
43681
- if (timer) {
43682
- clearTimeout(timer);
43683
- timer = null;
43684
- }
43685
- fn(...args);
43686
- };
43687
-
43688
- const throttled = (...args) => {
43689
- const now = Date.now();
43690
- const passed = now - timestamp;
43691
- if ( passed >= threshold) {
43692
- invoke(args, now);
43693
- } else {
43694
- lastArgs = args;
43695
- if (!timer) {
43696
- timer = setTimeout(() => {
43697
- timer = null;
43698
- invoke(lastArgs);
43699
- }, threshold - passed);
43700
- }
43701
- }
43702
- };
43703
-
43704
- const flush = () => lastArgs && invoke(lastArgs);
43705
-
43706
- return [throttled, flush];
43707
- }
43708
-
43709
- const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
43710
- let bytesNotified = 0;
43711
- const _speedometer = speedometer(50, 250);
43712
-
43713
- return throttle(e => {
43714
- const loaded = e.loaded;
43715
- const total = e.lengthComputable ? e.total : undefined;
43716
- const progressBytes = loaded - bytesNotified;
43717
- const rate = _speedometer(progressBytes);
43718
- const inRange = loaded <= total;
43719
-
43720
- bytesNotified = loaded;
43721
-
43722
- const data = {
43723
- loaded,
43724
- total,
43725
- progress: total ? (loaded / total) : undefined,
43726
- bytes: progressBytes,
43727
- rate: rate ? rate : undefined,
43728
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
43729
- event: e,
43730
- lengthComputable: total != null,
43731
- [isDownloadStream ? 'download' : 'upload']: true
43732
- };
43733
-
43734
- listener(data);
43735
- }, freq);
43736
- };
43737
-
43738
- const progressEventDecorator = (total, throttled) => {
43739
- const lengthComputable = total != null;
43740
-
43741
- return [(loaded) => throttled[0]({
43742
- lengthComputable,
43743
- total,
43744
- loaded
43745
- }), throttled[1]];
43746
- };
43747
-
43748
- const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
43749
-
43750
- /**
43751
- * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
43752
- * - For base64: compute exact decoded size using length and padding;
43753
- * handle %XX at the character-count level (no string allocation).
43754
- * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
43755
- *
43756
- * @param {string} url
43757
- * @returns {number}
43758
- */
43759
- function estimateDataURLDecodedBytes(url) {
43760
- if (!url || typeof url !== 'string') return 0;
43761
- if (!url.startsWith('data:')) return 0;
43762
-
43763
- const comma = url.indexOf(',');
43764
- if (comma < 0) return 0;
43765
-
43766
- const meta = url.slice(5, comma);
43767
- const body = url.slice(comma + 1);
43768
- const isBase64 = /;base64/i.test(meta);
43769
-
43770
- if (isBase64) {
43771
- let effectiveLen = body.length;
43772
- const len = body.length; // cache length
43773
-
43774
- for (let i = 0; i < len; i++) {
43775
- if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
43776
- const a = body.charCodeAt(i + 1);
43777
- const b = body.charCodeAt(i + 2);
43778
- const isHex =
43779
- ((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
43780
- ((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
43781
-
43782
- if (isHex) {
43783
- effectiveLen -= 2;
43784
- i += 2;
43785
- }
43786
- }
43787
- }
43788
-
43789
- let pad = 0;
43790
- let idx = len - 1;
43791
-
43792
- const tailIsPct3D = (j) =>
43793
- j >= 2 &&
43794
- body.charCodeAt(j - 2) === 37 && // '%'
43795
- body.charCodeAt(j - 1) === 51 && // '3'
43796
- (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
43797
-
43798
- if (idx >= 0) {
43799
- if (body.charCodeAt(idx) === 61 /* '=' */) {
43800
- pad++;
43801
- idx--;
43802
- } else if (tailIsPct3D(idx)) {
43803
- pad++;
43804
- idx -= 3;
43805
- }
43806
- }
43807
-
43808
- if (pad === 1 && idx >= 0) {
43809
- if (body.charCodeAt(idx) === 61 /* '=' */) {
43810
- pad++;
43811
- } else if (tailIsPct3D(idx)) {
43812
- pad++;
43813
- }
43814
- }
43815
-
43816
- const groups = Math.floor(effectiveLen / 4);
43817
- const bytes = groups * 3 - (pad || 0);
43818
- return bytes > 0 ? bytes : 0;
43819
- }
43820
-
43821
- return Buffer.byteLength(body, 'utf8');
43822
- }
43823
-
43824
43574
  const zlibOptions = {
43825
43575
  flush: zlib.constants.Z_SYNC_FLUSH,
43826
43576
  finishFlush: zlib.constants.Z_SYNC_FLUSH
@@ -43841,111 +43591,6 @@ const supportedProtocols = platform.protocols.map(protocol => {
43841
43591
  return protocol + ':';
43842
43592
  });
43843
43593
 
43844
-
43845
- const flushOnFinish = (stream, [throttled, flush]) => {
43846
- stream
43847
- .on('end', flush)
43848
- .on('error', flush);
43849
-
43850
- return throttled;
43851
- };
43852
-
43853
- class Http2Sessions {
43854
- constructor() {
43855
- this.sessions = Object.create(null);
43856
- }
43857
-
43858
- getSession(authority, options) {
43859
- options = Object.assign({
43860
- sessionTimeout: 1000
43861
- }, options);
43862
-
43863
- let authoritySessions = this.sessions[authority];
43864
-
43865
- if (authoritySessions) {
43866
- let len = authoritySessions.length;
43867
-
43868
- for (let i = 0; i < len; i++) {
43869
- const [sessionHandle, sessionOptions] = authoritySessions[i];
43870
- if (!sessionHandle.destroyed && !sessionHandle.closed && require$$1.isDeepStrictEqual(sessionOptions, options)) {
43871
- return sessionHandle;
43872
- }
43873
- }
43874
- }
43875
-
43876
- const session = http2.connect(authority, options);
43877
-
43878
- let removed;
43879
-
43880
- const removeSession = () => {
43881
- if (removed) {
43882
- return;
43883
- }
43884
-
43885
- removed = true;
43886
-
43887
- let entries = authoritySessions, len = entries.length, i = len;
43888
-
43889
- while (i--) {
43890
- if (entries[i][0] === session) {
43891
- if (len === 1) {
43892
- delete this.sessions[authority];
43893
- } else {
43894
- entries.splice(i, 1);
43895
- }
43896
- return;
43897
- }
43898
- }
43899
- };
43900
-
43901
- const originalRequestFn = session.request;
43902
-
43903
- const {sessionTimeout} = options;
43904
-
43905
- if(sessionTimeout != null) {
43906
-
43907
- let timer;
43908
- let streamsCount = 0;
43909
-
43910
- session.request = function () {
43911
- const stream = originalRequestFn.apply(this, arguments);
43912
-
43913
- streamsCount++;
43914
-
43915
- if (timer) {
43916
- clearTimeout(timer);
43917
- timer = null;
43918
- }
43919
-
43920
- stream.once('close', () => {
43921
- if (!--streamsCount) {
43922
- timer = setTimeout(() => {
43923
- timer = null;
43924
- removeSession();
43925
- }, sessionTimeout);
43926
- }
43927
- });
43928
-
43929
- return stream;
43930
- };
43931
- }
43932
-
43933
- session.once('close', removeSession);
43934
-
43935
- let entry = [
43936
- session,
43937
- options
43938
- ];
43939
-
43940
- authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
43941
-
43942
- return session;
43943
- }
43944
- }
43945
-
43946
- const http2Sessions = new Http2Sessions();
43947
-
43948
-
43949
43594
  /**
43950
43595
  * If the proxy or config beforeRedirects functions are defined, call them with the options
43951
43596
  * object.
@@ -43975,7 +43620,7 @@ function dispatchBeforeRedirect(options, responseDetails) {
43975
43620
  function setProxy(options, configProxy, location) {
43976
43621
  let proxy = configProxy;
43977
43622
  if (!proxy && proxy !== false) {
43978
- const proxyUrl = proxyFromEnv.getProxyForUrl(location);
43623
+ const proxyUrl = getProxyForUrl_1(location);
43979
43624
  if (proxyUrl) {
43980
43625
  proxy = new URL(proxyUrl);
43981
43626
  }
@@ -43988,16 +43633,12 @@ function setProxy(options, configProxy, location) {
43988
43633
 
43989
43634
  if (proxy.auth) {
43990
43635
  // Support proxy auth object form
43991
- const validProxyAuth = Boolean(proxy.auth.username || proxy.auth.password);
43992
-
43993
- if (validProxyAuth) {
43636
+ if (proxy.auth.username || proxy.auth.password) {
43994
43637
  proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');
43995
- } else if (typeof proxy.auth === 'object') {
43996
- throw new AxiosError$1('Invalid proxy authorization', AxiosError$1.ERR_BAD_OPTION, { proxy });
43997
43638
  }
43998
-
43999
- const base64 = Buffer.from(proxy.auth, 'utf8').toString('base64');
44000
-
43639
+ const base64 = Buffer
43640
+ .from(proxy.auth, 'utf8')
43641
+ .toString('base64');
44001
43642
  options.headers['Proxy-Authorization'] = 'Basic ' + base64;
44002
43643
  }
44003
43644
 
@@ -44061,76 +43702,16 @@ const resolveFamily = ({address, family}) => {
44061
43702
 
44062
43703
  const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {address, family});
44063
43704
 
44064
- const http2Transport = {
44065
- request(options, cb) {
44066
- const authority = options.protocol + '//' + options.hostname + ':' + (options.port ||(options.protocol === 'https:' ? 443 : 80));
44067
-
44068
-
44069
- const {http2Options, headers} = options;
44070
-
44071
- const session = http2Sessions.getSession(authority, http2Options);
44072
-
44073
- const {
44074
- HTTP2_HEADER_SCHEME,
44075
- HTTP2_HEADER_METHOD,
44076
- HTTP2_HEADER_PATH,
44077
- HTTP2_HEADER_STATUS
44078
- } = http2.constants;
44079
-
44080
- const http2Headers = {
44081
- [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),
44082
- [HTTP2_HEADER_METHOD]: options.method,
44083
- [HTTP2_HEADER_PATH]: options.path,
44084
- };
44085
-
44086
- utils$1.forEach(headers, (header, name) => {
44087
- name.charAt(0) !== ':' && (http2Headers[name] = header);
44088
- });
44089
-
44090
- const req = session.request(http2Headers);
44091
-
44092
- req.once('response', (responseHeaders) => {
44093
- const response = req; //duplex
44094
-
44095
- responseHeaders = Object.assign({}, responseHeaders);
44096
-
44097
- const status = responseHeaders[HTTP2_HEADER_STATUS];
44098
-
44099
- delete responseHeaders[HTTP2_HEADER_STATUS];
44100
-
44101
- response.headers = responseHeaders;
44102
-
44103
- response.statusCode = +status;
44104
-
44105
- cb(response);
44106
- });
44107
-
44108
- return req;
44109
- }
44110
- };
44111
-
44112
43705
  /*eslint consistent-return:0*/
44113
43706
  var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44114
43707
  return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
44115
- let {data, lookup, family, httpVersion = 1, http2Options} = config;
43708
+ let {data, lookup, family} = config;
44116
43709
  const {responseType, responseEncoding} = config;
44117
43710
  const method = config.method.toUpperCase();
44118
43711
  let isDone;
44119
43712
  let rejected = false;
44120
43713
  let req;
44121
43714
 
44122
- httpVersion = +httpVersion;
44123
-
44124
- if (Number.isNaN(httpVersion)) {
44125
- throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
44126
- }
44127
-
44128
- if (httpVersion !== 1 && httpVersion !== 2) {
44129
- throw TypeError(`Unsupported protocol version '${httpVersion}'`);
44130
- }
44131
-
44132
- const isHttp2 = httpVersion === 2;
44133
-
44134
43715
  if (lookup) {
44135
43716
  const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]);
44136
43717
  // hotfix to support opt.all option which is required for node 20.x
@@ -44147,17 +43728,8 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44147
43728
  };
44148
43729
  }
44149
43730
 
44150
- const abortEmitter = new EventEmitter();
44151
-
44152
- function abort(reason) {
44153
- try {
44154
- abortEmitter.emit('abort', !reason || reason.type ? new CanceledError$1(null, config, req) : reason);
44155
- } catch(err) {
44156
- console.warn('emit error', err);
44157
- }
44158
- }
44159
-
44160
- abortEmitter.once('abort', reject);
43731
+ // temporary internal emitter until the AxiosRequest class will be implemented
43732
+ const emitter = new EventEmitter();
44161
43733
 
44162
43734
  const onFinished = () => {
44163
43735
  if (config.cancelToken) {
@@ -44168,62 +43740,36 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44168
43740
  config.signal.removeEventListener('abort', abort);
44169
43741
  }
44170
43742
 
44171
- abortEmitter.removeAllListeners();
43743
+ emitter.removeAllListeners();
44172
43744
  };
44173
43745
 
44174
- if (config.cancelToken || config.signal) {
44175
- config.cancelToken && config.cancelToken.subscribe(abort);
44176
- if (config.signal) {
44177
- config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
44178
- }
44179
- }
44180
-
44181
- onDone((response, isRejected) => {
43746
+ onDone((value, isRejected) => {
44182
43747
  isDone = true;
44183
-
44184
43748
  if (isRejected) {
44185
43749
  rejected = true;
44186
43750
  onFinished();
44187
- return;
44188
- }
44189
-
44190
- const {data} = response;
44191
-
44192
- if (data instanceof stream.Readable || data instanceof stream.Duplex) {
44193
- const offListeners = stream.finished(data, () => {
44194
- offListeners();
44195
- onFinished();
44196
- });
44197
- } else {
44198
- onFinished();
44199
43751
  }
44200
43752
  });
44201
43753
 
43754
+ function abort(reason) {
43755
+ emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
43756
+ }
44202
43757
 
43758
+ emitter.once('abort', reject);
44203
43759
 
44204
-
43760
+ if (config.cancelToken || config.signal) {
43761
+ config.cancelToken && config.cancelToken.subscribe(abort);
43762
+ if (config.signal) {
43763
+ config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
43764
+ }
43765
+ }
44205
43766
 
44206
43767
  // Parse url
44207
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
44208
- const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
43768
+ const fullPath = buildFullPath(config.baseURL, config.url);
43769
+ const parsed = new URL(fullPath, 'http://localhost');
44209
43770
  const protocol = parsed.protocol || supportedProtocols[0];
44210
43771
 
44211
43772
  if (protocol === 'data:') {
44212
- // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.
44213
- if (config.maxContentLength > -1) {
44214
- // Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed.
44215
- const dataUrl = String(config.url || fullPath || '');
44216
- const estimated = estimateDataURLDecodedBytes(dataUrl);
44217
-
44218
- if (estimated > config.maxContentLength) {
44219
- return reject(new AxiosError$1(
44220
- 'maxContentLength size of ' + config.maxContentLength + ' exceeded',
44221
- AxiosError$1.ERR_BAD_RESPONSE,
44222
- config
44223
- ));
44224
- }
44225
- }
44226
-
44227
43773
  let convertedData;
44228
43774
 
44229
43775
  if (method !== 'GET') {
@@ -44240,7 +43786,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44240
43786
  Blob: config.env && config.env.Blob
44241
43787
  });
44242
43788
  } catch (err) {
44243
- throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config);
43789
+ throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
44244
43790
  }
44245
43791
 
44246
43792
  if (responseType === 'text') {
@@ -44263,9 +43809,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44263
43809
  }
44264
43810
 
44265
43811
  if (supportedProtocols.indexOf(protocol) === -1) {
44266
- return reject(new AxiosError$1(
43812
+ return reject(new AxiosError(
44267
43813
  'Unsupported protocol ' + protocol,
44268
- AxiosError$1.ERR_BAD_REQUEST,
43814
+ AxiosError.ERR_BAD_REQUEST,
44269
43815
  config
44270
43816
  ));
44271
43817
  }
@@ -44278,7 +43824,8 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44278
43824
  // Only set header if it hasn't been set in config
44279
43825
  headers.set('User-Agent', 'axios/' + VERSION, false);
44280
43826
 
44281
- const {onUploadProgress, onDownloadProgress} = config;
43827
+ const onDownloadProgress = config.onDownloadProgress;
43828
+ const onUploadProgress = config.onUploadProgress;
44282
43829
  const maxRate = config.maxRate;
44283
43830
  let maxUploadRate = undefined;
44284
43831
  let maxDownloadRate = undefined;
@@ -44305,7 +43852,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44305
43852
  } catch (e) {
44306
43853
  }
44307
43854
  }
44308
- } else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
43855
+ } else if (utils$1.isBlob(data)) {
44309
43856
  data.size && headers.setContentType(data.type || 'application/octet-stream');
44310
43857
  headers.setContentLength(data.size || 0);
44311
43858
  data = stream.Readable.from(readBlob$1(data));
@@ -44315,9 +43862,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44315
43862
  } else if (utils$1.isString(data)) {
44316
43863
  data = Buffer.from(data, 'utf-8');
44317
43864
  } else {
44318
- return reject(new AxiosError$1(
43865
+ return reject(new AxiosError(
44319
43866
  'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
44320
- AxiosError$1.ERR_BAD_REQUEST,
43867
+ AxiosError.ERR_BAD_REQUEST,
44321
43868
  config
44322
43869
  ));
44323
43870
  }
@@ -44326,9 +43873,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44326
43873
  headers.setContentLength(data.length, false);
44327
43874
 
44328
43875
  if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
44329
- return reject(new AxiosError$1(
43876
+ return reject(new AxiosError(
44330
43877
  'Request body larger than maxBodyLength limit',
44331
- AxiosError$1.ERR_BAD_REQUEST,
43878
+ AxiosError.ERR_BAD_REQUEST,
44332
43879
  config
44333
43880
  ));
44334
43881
  }
@@ -44349,16 +43896,15 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44349
43896
  }
44350
43897
 
44351
43898
  data = stream.pipeline([data, new AxiosTransformStream$1({
43899
+ length: contentLength,
44352
43900
  maxRate: utils$1.toFiniteNumber(maxUploadRate)
44353
43901
  })], utils$1.noop);
44354
43902
 
44355
- onUploadProgress && data.on('progress', flushOnFinish(
44356
- data,
44357
- progressEventDecorator(
44358
- contentLength,
44359
- progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
44360
- )
44361
- ));
43903
+ onUploadProgress && data.on('progress', progress => {
43904
+ onUploadProgress(Object.assign(progress, {
43905
+ upload: true
43906
+ }));
43907
+ });
44362
43908
  }
44363
43909
 
44364
43910
  // HTTP basic authentication
@@ -44407,8 +43953,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44407
43953
  protocol,
44408
43954
  family,
44409
43955
  beforeRedirect: dispatchBeforeRedirect,
44410
- beforeRedirects: {},
44411
- http2Options
43956
+ beforeRedirects: {}
44412
43957
  };
44413
43958
 
44414
43959
  // cacheable-lookup integration hotfix
@@ -44417,7 +43962,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44417
43962
  if (config.socketPath) {
44418
43963
  options.socketPath = config.socketPath;
44419
43964
  } else {
44420
- options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
43965
+ options.hostname = parsed.hostname;
44421
43966
  options.port = parsed.port;
44422
43967
  setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
44423
43968
  }
@@ -44425,23 +43970,18 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44425
43970
  let transport;
44426
43971
  const isHttpsRequest = isHttps.test(options.protocol);
44427
43972
  options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
44428
-
44429
- if (isHttp2) {
44430
- transport = http2Transport;
43973
+ if (config.transport) {
43974
+ transport = config.transport;
43975
+ } else if (config.maxRedirects === 0) {
43976
+ transport = isHttpsRequest ? require$$4 : require$$3;
44431
43977
  } else {
44432
- if (config.transport) {
44433
- transport = config.transport;
44434
- } else if (config.maxRedirects === 0) {
44435
- transport = isHttpsRequest ? require$$4 : require$$3;
44436
- } else {
44437
- if (config.maxRedirects) {
44438
- options.maxRedirects = config.maxRedirects;
44439
- }
44440
- if (config.beforeRedirect) {
44441
- options.beforeRedirects.config = config.beforeRedirect;
44442
- }
44443
- transport = isHttpsRequest ? httpsFollow : httpFollow;
43978
+ if (config.maxRedirects) {
43979
+ options.maxRedirects = config.maxRedirects;
43980
+ }
43981
+ if (config.beforeRedirect) {
43982
+ options.beforeRedirects.config = config.beforeRedirect;
44444
43983
  }
43984
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
44445
43985
  }
44446
43986
 
44447
43987
  if (config.maxBodyLength > -1) {
@@ -44461,20 +44001,19 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44461
44001
 
44462
44002
  const streams = [res];
44463
44003
 
44464
- const responseLength = utils$1.toFiniteNumber(res.headers['content-length']);
44004
+ const responseLength = +res.headers['content-length'];
44465
44005
 
44466
- if (onDownloadProgress || maxDownloadRate) {
44006
+ if (onDownloadProgress) {
44467
44007
  const transformStream = new AxiosTransformStream$1({
44008
+ length: utils$1.toFiniteNumber(responseLength),
44468
44009
  maxRate: utils$1.toFiniteNumber(maxDownloadRate)
44469
44010
  });
44470
44011
 
44471
- onDownloadProgress && transformStream.on('progress', flushOnFinish(
44472
- transformStream,
44473
- progressEventDecorator(
44474
- responseLength,
44475
- progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
44476
- )
44477
- ));
44012
+ onDownloadProgress && transformStream.on('progress', progress => {
44013
+ onDownloadProgress(Object.assign(progress, {
44014
+ download: true
44015
+ }));
44016
+ });
44478
44017
 
44479
44018
  streams.push(transformStream);
44480
44019
  }
@@ -44524,7 +44063,10 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44524
44063
 
44525
44064
  responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0];
44526
44065
 
44527
-
44066
+ const offListeners = stream.finished(responseStream, () => {
44067
+ offListeners();
44068
+ onFinished();
44069
+ });
44528
44070
 
44529
44071
  const response = {
44530
44072
  status: res.statusCode,
@@ -44550,8 +44092,8 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44550
44092
  // stream.destroy() emit aborted event before calling reject() on Node.js v16
44551
44093
  rejected = true;
44552
44094
  responseStream.destroy();
44553
- abort(new AxiosError$1('maxContentLength size of ' + config.maxContentLength + ' exceeded',
44554
- AxiosError$1.ERR_BAD_RESPONSE, config, lastRequest));
44095
+ reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
44096
+ AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
44555
44097
  }
44556
44098
  });
44557
44099
 
@@ -44560,9 +44102,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44560
44102
  return;
44561
44103
  }
44562
44104
 
44563
- const err = new AxiosError$1(
44564
- 'stream has been aborted',
44565
- AxiosError$1.ERR_BAD_RESPONSE,
44105
+ const err = new AxiosError(
44106
+ 'maxContentLength size of ' + config.maxContentLength + ' exceeded',
44107
+ AxiosError.ERR_BAD_RESPONSE,
44566
44108
  config,
44567
44109
  lastRequest
44568
44110
  );
@@ -44572,7 +44114,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44572
44114
 
44573
44115
  responseStream.on('error', function handleStreamError(err) {
44574
44116
  if (req.destroyed) return;
44575
- reject(AxiosError$1.from(err, null, config, lastRequest));
44117
+ reject(AxiosError.from(err, null, config, lastRequest));
44576
44118
  });
44577
44119
 
44578
44120
  responseStream.on('end', function handleStreamEnd() {
@@ -44586,13 +44128,13 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44586
44128
  }
44587
44129
  response.data = responseData;
44588
44130
  } catch (err) {
44589
- return reject(AxiosError$1.from(err, null, config, response.request, response));
44131
+ return reject(AxiosError.from(err, null, config, response.request, response));
44590
44132
  }
44591
44133
  settle(resolve, reject, response);
44592
44134
  });
44593
44135
  }
44594
44136
 
44595
- abortEmitter.once('abort', err => {
44137
+ emitter.once('abort', err => {
44596
44138
  if (!responseStream.destroyed) {
44597
44139
  responseStream.emit('error', err);
44598
44140
  responseStream.destroy();
@@ -44600,17 +44142,16 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44600
44142
  });
44601
44143
  });
44602
44144
 
44603
- abortEmitter.once('abort', err => {
44604
- if (req.close) {
44605
- req.close();
44606
- } else {
44607
- req.destroy(err);
44608
- }
44145
+ emitter.once('abort', err => {
44146
+ reject(err);
44147
+ req.destroy(err);
44609
44148
  });
44610
44149
 
44611
44150
  // Handle errors
44612
44151
  req.on('error', function handleRequestError(err) {
44613
- reject(AxiosError$1.from(err, null, config, req));
44152
+ // @todo remove
44153
+ // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;
44154
+ reject(AxiosError.from(err, null, config, req));
44614
44155
  });
44615
44156
 
44616
44157
  // set tcp keep alive to prevent drop connection by peer
@@ -44625,9 +44166,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44625
44166
  const timeout = parseInt(config.timeout, 10);
44626
44167
 
44627
44168
  if (Number.isNaN(timeout)) {
44628
- abort(new AxiosError$1(
44169
+ reject(new AxiosError(
44629
44170
  'error trying to parse `config.timeout` to int',
44630
- AxiosError$1.ERR_BAD_OPTION_VALUE,
44171
+ AxiosError.ERR_BAD_OPTION_VALUE,
44631
44172
  config,
44632
44173
  req
44633
44174
  ));
@@ -44647,16 +44188,14 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44647
44188
  if (config.timeoutErrorMessage) {
44648
44189
  timeoutErrorMessage = config.timeoutErrorMessage;
44649
44190
  }
44650
- abort(new AxiosError$1(
44191
+ reject(new AxiosError(
44651
44192
  timeoutErrorMessage,
44652
- transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
44193
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
44653
44194
  config,
44654
44195
  req
44655
44196
  ));
44197
+ abort();
44656
44198
  });
44657
- } else {
44658
- // explicitly reset the socket timeout value for a possible `keep-alive` request
44659
- req.setTimeout(0);
44660
44199
  }
44661
44200
 
44662
44201
 
@@ -44676,67 +44215,135 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44676
44215
 
44677
44216
  data.on('close', () => {
44678
44217
  if (!ended && !errored) {
44679
- abort(new CanceledError$1('Request stream has been aborted', config, req));
44218
+ abort(new CanceledError('Request stream has been aborted', config, req));
44680
44219
  }
44681
44220
  });
44682
44221
 
44683
44222
  data.pipe(req);
44684
44223
  } else {
44685
- data && req.write(data);
44686
- req.end();
44224
+ req.end(data);
44687
44225
  }
44688
44226
  });
44689
44227
  };
44690
44228
 
44691
- var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
44692
- url = new URL(url, platform.origin);
44229
+ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
44230
+ let bytesNotified = 0;
44231
+ const _speedometer = speedometer(50, 250);
44693
44232
 
44694
- return (
44695
- origin.protocol === url.protocol &&
44696
- origin.host === url.host &&
44697
- (isMSIE || origin.port === url.port)
44698
- );
44699
- })(
44700
- new URL(platform.origin),
44701
- platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
44702
- ) : () => true;
44233
+ return throttle(e => {
44234
+ const loaded = e.loaded;
44235
+ const total = e.lengthComputable ? e.total : undefined;
44236
+ const progressBytes = loaded - bytesNotified;
44237
+ const rate = _speedometer(progressBytes);
44238
+ const inRange = loaded <= total;
44239
+
44240
+ bytesNotified = loaded;
44241
+
44242
+ const data = {
44243
+ loaded,
44244
+ total,
44245
+ progress: total ? (loaded / total) : undefined,
44246
+ bytes: progressBytes,
44247
+ rate: rate ? rate : undefined,
44248
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
44249
+ event: e,
44250
+ lengthComputable: total != null
44251
+ };
44252
+
44253
+ data[isDownloadStream ? 'download' : 'upload'] = true;
44254
+
44255
+ listener(data);
44256
+ }, freq);
44257
+ };
44258
+
44259
+ var isURLSameOrigin = platform.hasStandardBrowserEnv ?
44260
+
44261
+ // Standard browser envs have full support of the APIs needed to test
44262
+ // whether the request URL is of the same origin as current location.
44263
+ (function standardBrowserEnv() {
44264
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
44265
+ const urlParsingNode = document.createElement('a');
44266
+ let originURL;
44267
+
44268
+ /**
44269
+ * Parse a URL to discover its components
44270
+ *
44271
+ * @param {String} url The URL to be parsed
44272
+ * @returns {Object}
44273
+ */
44274
+ function resolveURL(url) {
44275
+ let href = url;
44276
+
44277
+ if (msie) {
44278
+ // IE needs attribute set twice to normalize properties
44279
+ urlParsingNode.setAttribute('href', href);
44280
+ href = urlParsingNode.href;
44281
+ }
44282
+
44283
+ urlParsingNode.setAttribute('href', href);
44284
+
44285
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
44286
+ return {
44287
+ href: urlParsingNode.href,
44288
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
44289
+ host: urlParsingNode.host,
44290
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
44291
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
44292
+ hostname: urlParsingNode.hostname,
44293
+ port: urlParsingNode.port,
44294
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
44295
+ urlParsingNode.pathname :
44296
+ '/' + urlParsingNode.pathname
44297
+ };
44298
+ }
44299
+
44300
+ originURL = resolveURL(window.location.href);
44301
+
44302
+ /**
44303
+ * Determine if a URL shares the same origin as the current location
44304
+ *
44305
+ * @param {String} requestURL The URL to test
44306
+ * @returns {boolean} True if URL shares the same origin, otherwise false
44307
+ */
44308
+ return function isURLSameOrigin(requestURL) {
44309
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
44310
+ return (parsed.protocol === originURL.protocol &&
44311
+ parsed.host === originURL.host);
44312
+ };
44313
+ })() :
44314
+
44315
+ // Non standard browser envs (web workers, react-native) lack needed support.
44316
+ (function nonStandardBrowserEnv() {
44317
+ return function isURLSameOrigin() {
44318
+ return true;
44319
+ };
44320
+ })();
44703
44321
 
44704
44322
  var cookies = platform.hasStandardBrowserEnv ?
44705
44323
 
44706
44324
  // Standard browser envs support document.cookie
44707
44325
  {
44708
- write(name, value, expires, path, domain, secure, sameSite) {
44709
- if (typeof document === 'undefined') return;
44326
+ write(name, value, expires, path, domain, secure) {
44327
+ const cookie = [name + '=' + encodeURIComponent(value)];
44710
44328
 
44711
- const cookie = [`${name}=${encodeURIComponent(value)}`];
44329
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
44712
44330
 
44713
- if (utils$1.isNumber(expires)) {
44714
- cookie.push(`expires=${new Date(expires).toUTCString()}`);
44715
- }
44716
- if (utils$1.isString(path)) {
44717
- cookie.push(`path=${path}`);
44718
- }
44719
- if (utils$1.isString(domain)) {
44720
- cookie.push(`domain=${domain}`);
44721
- }
44722
- if (secure === true) {
44723
- cookie.push('secure');
44724
- }
44725
- if (utils$1.isString(sameSite)) {
44726
- cookie.push(`SameSite=${sameSite}`);
44727
- }
44331
+ utils$1.isString(path) && cookie.push('path=' + path);
44332
+
44333
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
44334
+
44335
+ secure === true && cookie.push('secure');
44728
44336
 
44729
44337
  document.cookie = cookie.join('; ');
44730
44338
  },
44731
44339
 
44732
44340
  read(name) {
44733
- if (typeof document === 'undefined') return null;
44734
- const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
44735
- return match ? decodeURIComponent(match[1]) : null;
44341
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
44342
+ return (match ? decodeURIComponent(match[3]) : null);
44736
44343
  },
44737
44344
 
44738
44345
  remove(name) {
44739
- this.write(name, '', Date.now() - 86400000, '/');
44346
+ this.write(name, '', Date.now() - 86400000);
44740
44347
  }
44741
44348
  }
44742
44349
 
@@ -44751,8 +44358,7 @@ var cookies = platform.hasStandardBrowserEnv ?
44751
44358
  remove() {}
44752
44359
  };
44753
44360
 
44754
- const headersToObject = (thing) =>
44755
- thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
44361
+ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
44756
44362
 
44757
44363
  /**
44758
44364
  * Config-specific merge-function which creates a new config-object
@@ -44768,9 +44374,9 @@ function mergeConfig(config1, config2) {
44768
44374
  config2 = config2 || {};
44769
44375
  const config = {};
44770
44376
 
44771
- function getMergedValue(target, source, prop, caseless) {
44377
+ function getMergedValue(target, source, caseless) {
44772
44378
  if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
44773
- return utils$1.merge.call({ caseless }, target, source);
44379
+ return utils$1.merge.call({caseless}, target, source);
44774
44380
  } else if (utils$1.isPlainObject(source)) {
44775
44381
  return utils$1.merge({}, source);
44776
44382
  } else if (utils$1.isArray(source)) {
@@ -44779,11 +44385,12 @@ function mergeConfig(config1, config2) {
44779
44385
  return source;
44780
44386
  }
44781
44387
 
44782
- function mergeDeepProperties(a, b, prop, caseless) {
44388
+ // eslint-disable-next-line consistent-return
44389
+ function mergeDeepProperties(a, b, caseless) {
44783
44390
  if (!utils$1.isUndefined(b)) {
44784
- return getMergedValue(a, b, prop, caseless);
44391
+ return getMergedValue(a, b, caseless);
44785
44392
  } else if (!utils$1.isUndefined(a)) {
44786
- return getMergedValue(undefined, a, prop, caseless);
44393
+ return getMergedValue(undefined, a, caseless);
44787
44394
  }
44788
44395
  }
44789
44396
 
@@ -44841,27 +44448,14 @@ function mergeConfig(config1, config2) {
44841
44448
  socketPath: defaultToConfig2,
44842
44449
  responseEncoding: defaultToConfig2,
44843
44450
  validateStatus: mergeDirectKeys,
44844
- headers: (a, b, prop) =>
44845
- mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
44451
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
44846
44452
  };
44847
44453
 
44848
- utils$1.forEach(
44849
- Object.keys({ ...config1, ...config2 }),
44850
- function computeConfigValue(prop) {
44851
- if (
44852
- prop === "__proto__" ||
44853
- prop === "constructor" ||
44854
- prop === "prototype"
44855
- )
44856
- return;
44857
- const merge = utils$1.hasOwnProp(mergeMap, prop)
44858
- ? mergeMap[prop]
44859
- : mergeDeepProperties;
44860
- const configValue = merge(config1[prop], config2[prop], prop);
44861
- (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) ||
44862
- (config[prop] = configValue);
44863
- },
44864
- );
44454
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
44455
+ const merge = mergeMap[prop] || mergeDeepProperties;
44456
+ const configValue = merge(config1[prop], config2[prop], prop);
44457
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
44458
+ });
44865
44459
 
44866
44460
  return config;
44867
44461
  }
@@ -44869,11 +44463,11 @@ function mergeConfig(config1, config2) {
44869
44463
  var resolveConfig = (config) => {
44870
44464
  const newConfig = mergeConfig({}, config);
44871
44465
 
44872
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
44466
+ let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
44873
44467
 
44874
44468
  newConfig.headers = headers = AxiosHeaders$1.from(headers);
44875
44469
 
44876
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
44470
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
44877
44471
 
44878
44472
  // HTTP basic authentication
44879
44473
  if (auth) {
@@ -44882,21 +44476,17 @@ var resolveConfig = (config) => {
44882
44476
  );
44883
44477
  }
44884
44478
 
44479
+ let contentType;
44480
+
44885
44481
  if (utils$1.isFormData(data)) {
44886
44482
  if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
44887
- headers.setContentType(undefined); // browser handles it
44888
- } else if (utils$1.isFunction(data.getHeaders)) {
44889
- // Node.js FormData (like form-data package)
44890
- const formHeaders = data.getHeaders();
44891
- // Only set safe headers to avoid overwriting security headers
44892
- const allowedHeaders = ['content-type', 'content-length'];
44893
- Object.entries(formHeaders).forEach(([key, val]) => {
44894
- if (allowedHeaders.includes(key.toLowerCase())) {
44895
- headers.set(key, val);
44896
- }
44897
- });
44483
+ headers.setContentType(undefined); // Let the browser set it
44484
+ } else if ((contentType = headers.getContentType()) !== false) {
44485
+ // fix semicolon duplication issue for ReactNative FormData implementation
44486
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
44487
+ headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
44898
44488
  }
44899
- }
44489
+ }
44900
44490
 
44901
44491
  // Add xsrf header
44902
44492
  // This is only done if running in a standard browser environment.
@@ -44925,18 +44515,16 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
44925
44515
  const _config = resolveConfig(config);
44926
44516
  let requestData = _config.data;
44927
44517
  const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
44928
- let {responseType, onUploadProgress, onDownloadProgress} = _config;
44518
+ let {responseType} = _config;
44929
44519
  let onCanceled;
44930
- let uploadThrottled, downloadThrottled;
44931
- let flushUpload, flushDownload;
44932
-
44933
44520
  function done() {
44934
- flushUpload && flushUpload(); // flush events
44935
- flushDownload && flushDownload(); // flush events
44936
-
44937
- _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
44521
+ if (_config.cancelToken) {
44522
+ _config.cancelToken.unsubscribe(onCanceled);
44523
+ }
44938
44524
 
44939
- _config.signal && _config.signal.removeEventListener('abort', onCanceled);
44525
+ if (_config.signal) {
44526
+ _config.signal.removeEventListener('abort', onCanceled);
44527
+ }
44940
44528
  }
44941
44529
 
44942
44530
  let request = new XMLHttpRequest();
@@ -45006,25 +44594,22 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45006
44594
  return;
45007
44595
  }
45008
44596
 
45009
- reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
44597
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, _config, request));
45010
44598
 
45011
44599
  // Clean up request
45012
44600
  request = null;
45013
44601
  };
45014
44602
 
45015
44603
  // Handle low level network errors
45016
- request.onerror = function handleError(event) {
45017
- // Browsers deliver a ProgressEvent in XHR onerror
45018
- // (message may be empty; when present, surface it)
45019
- // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
45020
- const msg = event && event.message ? event.message : 'Network Error';
45021
- const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
45022
- // attach the underlying event for consumers who want details
45023
- err.event = event || null;
45024
- reject(err);
45025
- request = null;
45026
- };
45027
-
44604
+ request.onerror = function handleError() {
44605
+ // Real errors are hidden from us by the browser
44606
+ // onerror should only fire if it's a network error
44607
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, _config, request));
44608
+
44609
+ // Clean up request
44610
+ request = null;
44611
+ };
44612
+
45028
44613
  // Handle timeout
45029
44614
  request.ontimeout = function handleTimeout() {
45030
44615
  let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
@@ -45032,10 +44617,10 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45032
44617
  if (_config.timeoutErrorMessage) {
45033
44618
  timeoutErrorMessage = _config.timeoutErrorMessage;
45034
44619
  }
45035
- reject(new AxiosError$1(
44620
+ reject(new AxiosError(
45036
44621
  timeoutErrorMessage,
45037
- transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
45038
- config,
44622
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
44623
+ _config,
45039
44624
  request));
45040
44625
 
45041
44626
  // Clean up request
@@ -45063,18 +44648,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45063
44648
  }
45064
44649
 
45065
44650
  // Handle progress if needed
45066
- if (onDownloadProgress) {
45067
- ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
45068
- request.addEventListener('progress', downloadThrottled);
44651
+ if (typeof _config.onDownloadProgress === 'function') {
44652
+ request.addEventListener('progress', progressEventReducer(_config.onDownloadProgress, true));
45069
44653
  }
45070
44654
 
45071
44655
  // Not all browsers support upload events
45072
- if (onUploadProgress && request.upload) {
45073
- ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
45074
-
45075
- request.upload.addEventListener('progress', uploadThrottled);
45076
-
45077
- request.upload.addEventListener('loadend', flushUpload);
44656
+ if (typeof _config.onUploadProgress === 'function' && request.upload) {
44657
+ request.upload.addEventListener('progress', progressEventReducer(_config.onUploadProgress));
45078
44658
  }
45079
44659
 
45080
44660
  if (_config.cancelToken || _config.signal) {
@@ -45084,7 +44664,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45084
44664
  if (!request) {
45085
44665
  return;
45086
44666
  }
45087
- reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
44667
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
45088
44668
  request.abort();
45089
44669
  request = null;
45090
44670
  };
@@ -45098,7 +44678,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45098
44678
  const protocol = parseProtocol(_config.url);
45099
44679
 
45100
44680
  if (protocol && platform.protocols.indexOf(protocol) === -1) {
45101
- reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
44681
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
45102
44682
  return;
45103
44683
  }
45104
44684
 
@@ -45109,46 +44689,45 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45109
44689
  };
45110
44690
 
45111
44691
  const composeSignals = (signals, timeout) => {
45112
- const {length} = (signals = signals ? signals.filter(Boolean) : []);
44692
+ let controller = new AbortController();
45113
44693
 
45114
- if (timeout || length) {
45115
- let controller = new AbortController();
44694
+ let aborted;
45116
44695
 
45117
- let aborted;
44696
+ const onabort = function (cancel) {
44697
+ if (!aborted) {
44698
+ aborted = true;
44699
+ unsubscribe();
44700
+ const err = cancel instanceof Error ? cancel : this.reason;
44701
+ controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
44702
+ }
44703
+ };
45118
44704
 
45119
- const onabort = function (reason) {
45120
- if (!aborted) {
45121
- aborted = true;
45122
- unsubscribe();
45123
- const err = reason instanceof Error ? reason : this.reason;
45124
- controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
45125
- }
45126
- };
44705
+ let timer = timeout && setTimeout(() => {
44706
+ onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
44707
+ }, timeout);
45127
44708
 
45128
- let timer = timeout && setTimeout(() => {
44709
+ const unsubscribe = () => {
44710
+ if (signals) {
44711
+ timer && clearTimeout(timer);
45129
44712
  timer = null;
45130
- onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
45131
- }, timeout);
45132
-
45133
- const unsubscribe = () => {
45134
- if (signals) {
45135
- timer && clearTimeout(timer);
45136
- timer = null;
45137
- signals.forEach(signal => {
45138
- signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
45139
- });
45140
- signals = null;
45141
- }
45142
- };
44713
+ signals.forEach(signal => {
44714
+ signal &&
44715
+ (signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
44716
+ });
44717
+ signals = null;
44718
+ }
44719
+ };
45143
44720
 
45144
- signals.forEach((signal) => signal.addEventListener('abort', onabort));
44721
+ signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
45145
44722
 
45146
- const {signal} = controller;
44723
+ const {signal} = controller;
45147
44724
 
45148
- signal.unsubscribe = () => utils$1.asap(unsubscribe);
44725
+ signal.unsubscribe = unsubscribe;
45149
44726
 
45150
- return signal;
45151
- }
44727
+ return [signal, () => {
44728
+ timer && clearTimeout(timer);
44729
+ timer = null;
44730
+ }];
45152
44731
  };
45153
44732
 
45154
44733
  var composeSignals$1 = composeSignals;
@@ -45171,68 +44750,35 @@ const streamChunk = function* (chunk, chunkSize) {
45171
44750
  }
45172
44751
  };
45173
44752
 
45174
- const readBytes = async function* (iterable, chunkSize) {
45175
- for await (const chunk of readStream(iterable)) {
45176
- yield* streamChunk(chunk, chunkSize);
45177
- }
45178
- };
45179
-
45180
- const readStream = async function* (stream) {
45181
- if (stream[Symbol.asyncIterator]) {
45182
- yield* stream;
45183
- return;
45184
- }
45185
-
45186
- const reader = stream.getReader();
45187
- try {
45188
- for (;;) {
45189
- const {done, value} = await reader.read();
45190
- if (done) {
45191
- break;
45192
- }
45193
- yield value;
45194
- }
45195
- } finally {
45196
- await reader.cancel();
44753
+ const readBytes = async function* (iterable, chunkSize, encode) {
44754
+ for await (const chunk of iterable) {
44755
+ yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
45197
44756
  }
45198
44757
  };
45199
44758
 
45200
- const trackStream = (stream, chunkSize, onProgress, onFinish) => {
45201
- const iterator = readBytes(stream, chunkSize);
44759
+ const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
44760
+ const iterator = readBytes(stream, chunkSize, encode);
45202
44761
 
45203
44762
  let bytes = 0;
45204
- let done;
45205
- let _onFinish = (e) => {
45206
- if (!done) {
45207
- done = true;
45208
- onFinish && onFinish(e);
45209
- }
45210
- };
45211
44763
 
45212
44764
  return new ReadableStream({
45213
- async pull(controller) {
45214
- try {
45215
- const {done, value} = await iterator.next();
44765
+ type: 'bytes',
45216
44766
 
45217
- if (done) {
45218
- _onFinish();
45219
- controller.close();
45220
- return;
45221
- }
44767
+ async pull(controller) {
44768
+ const {done, value} = await iterator.next();
45222
44769
 
45223
- let len = value.byteLength;
45224
- if (onProgress) {
45225
- let loadedBytes = bytes += len;
45226
- onProgress(loadedBytes);
45227
- }
45228
- controller.enqueue(new Uint8Array(value));
45229
- } catch (err) {
45230
- _onFinish(err);
45231
- throw err;
44770
+ if (done) {
44771
+ controller.close();
44772
+ onFinish();
44773
+ return;
45232
44774
  }
44775
+
44776
+ let len = value.byteLength;
44777
+ onProgress && onProgress(bytes += len);
44778
+ controller.enqueue(new Uint8Array(value));
45233
44779
  },
45234
44780
  cancel(reason) {
45235
- _onFinish(reason);
44781
+ onFinish(reason);
45236
44782
  return iterator.return();
45237
44783
  }
45238
44784
  }, {
@@ -45240,401 +44786,293 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
45240
44786
  })
45241
44787
  };
45242
44788
 
45243
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
44789
+ const fetchProgressDecorator = (total, fn) => {
44790
+ const lengthComputable = total != null;
44791
+ return (loaded) => setTimeout(() => fn({
44792
+ lengthComputable,
44793
+ total,
44794
+ loaded
44795
+ }));
44796
+ };
44797
+
44798
+ const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
44799
+ const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
44800
+
44801
+ // used only inside the fetch adapter
44802
+ const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
44803
+ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
44804
+ async (str) => new Uint8Array(await new Response(str).arrayBuffer())
44805
+ );
45244
44806
 
45245
- const {isFunction} = utils$1;
44807
+ const supportsRequestStream = isReadableStreamSupported && (() => {
44808
+ let duplexAccessed = false;
45246
44809
 
45247
- const globalFetchAPI = (({Request, Response}) => ({
45248
- Request, Response
45249
- }))(utils$1.global);
44810
+ const hasContentType = new Request(platform.origin, {
44811
+ body: new ReadableStream(),
44812
+ method: 'POST',
44813
+ get duplex() {
44814
+ duplexAccessed = true;
44815
+ return 'half';
44816
+ },
44817
+ }).headers.has('Content-Type');
45250
44818
 
45251
- const {
45252
- ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1
45253
- } = utils$1.global;
44819
+ return duplexAccessed && !hasContentType;
44820
+ })();
45254
44821
 
44822
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
45255
44823
 
45256
- const test = (fn, ...args) => {
44824
+ const supportsResponseStream = isReadableStreamSupported && !!(()=> {
45257
44825
  try {
45258
- return !!fn(...args);
45259
- } catch (e) {
45260
- return false
44826
+ return utils$1.isReadableStream(new Response('').body);
44827
+ } catch(err) {
44828
+ // return undefined
45261
44829
  }
45262
- };
44830
+ })();
45263
44831
 
45264
- const factory = (env) => {
45265
- env = utils$1.merge.call({
45266
- skipUndefined: true
45267
- }, globalFetchAPI, env);
44832
+ const resolvers = {
44833
+ stream: supportsResponseStream && ((res) => res.body)
44834
+ };
45268
44835
 
45269
- const {fetch: envFetch, Request, Response} = env;
45270
- const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
45271
- const isRequestSupported = isFunction(Request);
45272
- const isResponseSupported = isFunction(Response);
44836
+ isFetchSupported && (((res) => {
44837
+ ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
44838
+ !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
44839
+ (_, config) => {
44840
+ throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
44841
+ });
44842
+ });
44843
+ })(new Response));
45273
44844
 
45274
- if (!isFetchSupported) {
45275
- return false;
44845
+ const getBodyLength = async (body) => {
44846
+ if (body == null) {
44847
+ return 0;
45276
44848
  }
45277
44849
 
45278
- const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
45279
-
45280
- const encodeText = isFetchSupported && (typeof TextEncoder$1 === 'function' ?
45281
- ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) :
45282
- async (str) => new Uint8Array(await new Request(str).arrayBuffer())
45283
- );
45284
-
45285
- const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
45286
- let duplexAccessed = false;
44850
+ if(utils$1.isBlob(body)) {
44851
+ return body.size;
44852
+ }
45287
44853
 
45288
- const hasContentType = new Request(platform.origin, {
45289
- body: new ReadableStream$1(),
45290
- method: 'POST',
45291
- get duplex() {
45292
- duplexAccessed = true;
45293
- return 'half';
45294
- },
45295
- }).headers.has('Content-Type');
44854
+ if(utils$1.isSpecCompliantForm(body)) {
44855
+ return (await new Request(body).arrayBuffer()).byteLength;
44856
+ }
45296
44857
 
45297
- return duplexAccessed && !hasContentType;
45298
- });
44858
+ if(utils$1.isArrayBufferView(body)) {
44859
+ return body.byteLength;
44860
+ }
45299
44861
 
45300
- const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
45301
- test(() => utils$1.isReadableStream(new Response('').body));
44862
+ if(utils$1.isURLSearchParams(body)) {
44863
+ body = body + '';
44864
+ }
45302
44865
 
45303
- const resolvers = {
45304
- stream: supportsResponseStream && ((res) => res.body)
45305
- };
44866
+ if(utils$1.isString(body)) {
44867
+ return (await encodeText(body)).byteLength;
44868
+ }
44869
+ };
45306
44870
 
45307
- isFetchSupported && ((() => {
45308
- ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
45309
- !resolvers[type] && (resolvers[type] = (res, config) => {
45310
- let method = res && res[type];
44871
+ const resolveBodyLength = async (headers, body) => {
44872
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
45311
44873
 
45312
- if (method) {
45313
- return method.call(res);
45314
- }
44874
+ return length == null ? getBodyLength(body) : length;
44875
+ };
45315
44876
 
45316
- throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
45317
- });
44877
+ var fetchAdapter = isFetchSupported && (async (config) => {
44878
+ let {
44879
+ url,
44880
+ method,
44881
+ data,
44882
+ signal,
44883
+ cancelToken,
44884
+ timeout,
44885
+ onDownloadProgress,
44886
+ onUploadProgress,
44887
+ responseType,
44888
+ headers,
44889
+ withCredentials = 'same-origin',
44890
+ fetchOptions
44891
+ } = resolveConfig(config);
44892
+
44893
+ responseType = responseType ? (responseType + '').toLowerCase() : 'text';
44894
+
44895
+ let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?
44896
+ composeSignals$1([signal, cancelToken], timeout) : [];
44897
+
44898
+ let finished, request;
44899
+
44900
+ const onFinish = () => {
44901
+ !finished && setTimeout(() => {
44902
+ composedSignal && composedSignal.unsubscribe();
45318
44903
  });
45319
- })());
45320
44904
 
45321
- const getBodyLength = async (body) => {
45322
- if (body == null) {
45323
- return 0;
45324
- }
44905
+ finished = true;
44906
+ };
45325
44907
 
45326
- if (utils$1.isBlob(body)) {
45327
- return body.size;
45328
- }
44908
+ let requestContentLength;
45329
44909
 
45330
- if (utils$1.isSpecCompliantForm(body)) {
45331
- const _request = new Request(platform.origin, {
44910
+ try {
44911
+ if (
44912
+ onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
44913
+ (requestContentLength = await resolveBodyLength(headers, data)) !== 0
44914
+ ) {
44915
+ let _request = new Request(url, {
45332
44916
  method: 'POST',
45333
- body,
44917
+ body: data,
44918
+ duplex: "half"
45334
44919
  });
45335
- return (await _request.arrayBuffer()).byteLength;
45336
- }
45337
-
45338
- if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
45339
- return body.byteLength;
45340
- }
45341
-
45342
- if (utils$1.isURLSearchParams(body)) {
45343
- body = body + '';
45344
- }
45345
-
45346
- if (utils$1.isString(body)) {
45347
- return (await encodeText(body)).byteLength;
45348
- }
45349
- };
45350
-
45351
- const resolveBodyLength = async (headers, body) => {
45352
- const length = utils$1.toFiniteNumber(headers.getContentLength());
45353
-
45354
- return length == null ? getBodyLength(body) : length;
45355
- };
45356
-
45357
- return async (config) => {
45358
- let {
45359
- url,
45360
- method,
45361
- data,
45362
- signal,
45363
- cancelToken,
45364
- timeout,
45365
- onDownloadProgress,
45366
- onUploadProgress,
45367
- responseType,
45368
- headers,
45369
- withCredentials = 'same-origin',
45370
- fetchOptions
45371
- } = resolveConfig(config);
45372
-
45373
- let _fetch = envFetch || fetch;
45374
-
45375
- responseType = responseType ? (responseType + '').toLowerCase() : 'text';
45376
-
45377
- let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
45378
-
45379
- let request = null;
45380
44920
 
45381
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
45382
- composedSignal.unsubscribe();
45383
- });
45384
-
45385
- let requestContentLength;
45386
-
45387
- try {
45388
- if (
45389
- onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
45390
- (requestContentLength = await resolveBodyLength(headers, data)) !== 0
45391
- ) {
45392
- let _request = new Request(url, {
45393
- method: 'POST',
45394
- body: data,
45395
- duplex: "half"
45396
- });
45397
-
45398
- let contentTypeHeader;
44921
+ let contentTypeHeader;
45399
44922
 
45400
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
45401
- headers.setContentType(contentTypeHeader);
45402
- }
45403
-
45404
- if (_request.body) {
45405
- const [onProgress, flush] = progressEventDecorator(
45406
- requestContentLength,
45407
- progressEventReducer(asyncDecorator(onUploadProgress))
45408
- );
45409
-
45410
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
45411
- }
44923
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
44924
+ headers.setContentType(contentTypeHeader);
45412
44925
  }
45413
44926
 
45414
- if (!utils$1.isString(withCredentials)) {
45415
- withCredentials = withCredentials ? 'include' : 'omit';
44927
+ if (_request.body) {
44928
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, fetchProgressDecorator(
44929
+ requestContentLength,
44930
+ progressEventReducer(onUploadProgress)
44931
+ ), null, encodeText);
45416
44932
  }
44933
+ }
45417
44934
 
45418
- // Cloudflare Workers throws when credentials are defined
45419
- // see https://github.com/cloudflare/workerd/issues/902
45420
- const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
45421
-
45422
- const resolvedOptions = {
45423
- ...fetchOptions,
45424
- signal: composedSignal,
45425
- method: method.toUpperCase(),
45426
- headers: headers.normalize().toJSON(),
45427
- body: data,
45428
- duplex: "half",
45429
- credentials: isCredentialsSupported ? withCredentials : undefined
45430
- };
44935
+ if (!utils$1.isString(withCredentials)) {
44936
+ withCredentials = withCredentials ? 'cors' : 'omit';
44937
+ }
45431
44938
 
45432
- request = isRequestSupported && new Request(url, resolvedOptions);
44939
+ request = new Request(url, {
44940
+ ...fetchOptions,
44941
+ signal: composedSignal,
44942
+ method: method.toUpperCase(),
44943
+ headers: headers.normalize().toJSON(),
44944
+ body: data,
44945
+ duplex: "half",
44946
+ withCredentials
44947
+ });
45433
44948
 
45434
- let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
44949
+ let response = await fetch(request);
45435
44950
 
45436
- const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
44951
+ const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
45437
44952
 
45438
- if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
45439
- const options = {};
44953
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
44954
+ const options = {};
45440
44955
 
45441
- ['status', 'statusText', 'headers'].forEach(prop => {
45442
- options[prop] = response[prop];
45443
- });
44956
+ ['status', 'statusText', 'headers'].forEach(prop => {
44957
+ options[prop] = response[prop];
44958
+ });
45444
44959
 
45445
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
44960
+ const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
45446
44961
 
45447
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
44962
+ response = new Response(
44963
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onDownloadProgress && fetchProgressDecorator(
45448
44964
  responseContentLength,
45449
- progressEventReducer(asyncDecorator(onDownloadProgress), true)
45450
- ) || [];
45451
-
45452
- response = new Response(
45453
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
45454
- flush && flush();
45455
- unsubscribe && unsubscribe();
45456
- }),
45457
- options
45458
- );
45459
- }
44965
+ progressEventReducer(onDownloadProgress, true)
44966
+ ), isStreamResponse && onFinish, encodeText),
44967
+ options
44968
+ );
44969
+ }
45460
44970
 
45461
- responseType = responseType || 'text';
44971
+ responseType = responseType || 'text';
45462
44972
 
45463
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
44973
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
45464
44974
 
45465
- !isStreamResponse && unsubscribe && unsubscribe();
44975
+ !isStreamResponse && onFinish();
45466
44976
 
45467
- return await new Promise((resolve, reject) => {
45468
- settle(resolve, reject, {
45469
- data: responseData,
45470
- headers: AxiosHeaders$1.from(response.headers),
45471
- status: response.status,
45472
- statusText: response.statusText,
45473
- config,
45474
- request
45475
- });
45476
- })
45477
- } catch (err) {
45478
- unsubscribe && unsubscribe();
44977
+ stopTimeout && stopTimeout();
45479
44978
 
45480
- if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
45481
- throw Object.assign(
45482
- new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request, err && err.response),
45483
- {
45484
- cause: err.cause || err
45485
- }
45486
- )
45487
- }
44979
+ return await new Promise((resolve, reject) => {
44980
+ settle(resolve, reject, {
44981
+ data: responseData,
44982
+ headers: AxiosHeaders$1.from(response.headers),
44983
+ status: response.status,
44984
+ statusText: response.statusText,
44985
+ config,
44986
+ request
44987
+ });
44988
+ })
44989
+ } catch (err) {
44990
+ onFinish();
45488
44991
 
45489
- throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
44992
+ if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
44993
+ throw Object.assign(
44994
+ new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
44995
+ {
44996
+ cause: err.cause || err
44997
+ }
44998
+ )
45490
44999
  }
45491
- }
45492
- };
45493
-
45494
- const seedCache = new Map();
45495
-
45496
- const getFetch = (config) => {
45497
- let env = (config && config.env) || {};
45498
- const {fetch, Request, Response} = env;
45499
- const seeds = [
45500
- Request, Response, fetch
45501
- ];
45502
-
45503
- let len = seeds.length, i = len,
45504
- seed, target, map = seedCache;
45505
-
45506
- while (i--) {
45507
- seed = seeds[i];
45508
- target = map.get(seed);
45509
45000
 
45510
- target === undefined && map.set(seed, target = (i ? new Map() : factory(env)));
45511
-
45512
- map = target;
45001
+ throw AxiosError.from(err, err && err.code, config, request);
45513
45002
  }
45003
+ });
45514
45004
 
45515
- return target;
45516
- };
45517
-
45518
- getFetch();
45519
-
45520
- /**
45521
- * Known adapters mapping.
45522
- * Provides environment-specific adapters for Axios:
45523
- * - `http` for Node.js
45524
- * - `xhr` for browsers
45525
- * - `fetch` for fetch API-based requests
45526
- *
45527
- * @type {Object<string, Function|Object>}
45528
- */
45529
45005
  const knownAdapters = {
45530
45006
  http: httpAdapter,
45531
45007
  xhr: xhrAdapter,
45532
- fetch: {
45533
- get: getFetch,
45534
- }
45008
+ fetch: fetchAdapter
45535
45009
  };
45536
45010
 
45537
- // Assign adapter names for easier debugging and identification
45538
45011
  utils$1.forEach(knownAdapters, (fn, value) => {
45539
45012
  if (fn) {
45540
45013
  try {
45541
- Object.defineProperty(fn, 'name', { value });
45014
+ Object.defineProperty(fn, 'name', {value});
45542
45015
  } catch (e) {
45543
45016
  // eslint-disable-next-line no-empty
45544
45017
  }
45545
- Object.defineProperty(fn, 'adapterName', { value });
45018
+ Object.defineProperty(fn, 'adapterName', {value});
45546
45019
  }
45547
45020
  });
45548
45021
 
45549
- /**
45550
- * Render a rejection reason string for unknown or unsupported adapters
45551
- *
45552
- * @param {string} reason
45553
- * @returns {string}
45554
- */
45555
45022
  const renderReason = (reason) => `- ${reason}`;
45556
45023
 
45557
- /**
45558
- * Check if the adapter is resolved (function, null, or false)
45559
- *
45560
- * @param {Function|null|false} adapter
45561
- * @returns {boolean}
45562
- */
45563
45024
  const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
45564
45025
 
45565
- /**
45566
- * Get the first suitable adapter from the provided list.
45567
- * Tries each adapter in order until a supported one is found.
45568
- * Throws an AxiosError if no adapter is suitable.
45569
- *
45570
- * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
45571
- * @param {Object} config - Axios request configuration
45572
- * @throws {AxiosError} If no suitable adapter is available
45573
- * @returns {Function} The resolved adapter function
45574
- */
45575
- function getAdapter(adapters, config) {
45576
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
45026
+ var adapters = {
45027
+ getAdapter: (adapters) => {
45028
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
45577
45029
 
45578
- const { length } = adapters;
45579
- let nameOrAdapter;
45580
- let adapter;
45030
+ const {length} = adapters;
45031
+ let nameOrAdapter;
45032
+ let adapter;
45581
45033
 
45582
- const rejectedReasons = {};
45034
+ const rejectedReasons = {};
45583
45035
 
45584
- for (let i = 0; i < length; i++) {
45585
- nameOrAdapter = adapters[i];
45586
- let id;
45036
+ for (let i = 0; i < length; i++) {
45037
+ nameOrAdapter = adapters[i];
45038
+ let id;
45587
45039
 
45588
- adapter = nameOrAdapter;
45040
+ adapter = nameOrAdapter;
45589
45041
 
45590
- if (!isResolvedHandle(nameOrAdapter)) {
45591
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
45042
+ if (!isResolvedHandle(nameOrAdapter)) {
45043
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
45592
45044
 
45593
- if (adapter === undefined) {
45594
- throw new AxiosError$1(`Unknown adapter '${id}'`);
45045
+ if (adapter === undefined) {
45046
+ throw new AxiosError(`Unknown adapter '${id}'`);
45047
+ }
45595
45048
  }
45596
- }
45597
-
45598
- if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
45599
- break;
45600
- }
45601
45049
 
45602
- rejectedReasons[id || '#' + i] = adapter;
45603
- }
45050
+ if (adapter) {
45051
+ break;
45052
+ }
45604
45053
 
45605
- if (!adapter) {
45606
- const reasons = Object.entries(rejectedReasons)
45607
- .map(([id, state]) => `adapter ${id} ` +
45608
- (state === false ? 'is not supported by the environment' : 'is not available in the build')
45609
- );
45054
+ rejectedReasons[id || '#' + i] = adapter;
45055
+ }
45610
45056
 
45611
- let s = length ?
45612
- (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
45613
- 'as no adapter specified';
45057
+ if (!adapter) {
45614
45058
 
45615
- throw new AxiosError$1(
45616
- `There is no suitable adapter to dispatch the request ` + s,
45617
- 'ERR_NOT_SUPPORT'
45618
- );
45619
- }
45059
+ const reasons = Object.entries(rejectedReasons)
45060
+ .map(([id, state]) => `adapter ${id} ` +
45061
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
45062
+ );
45620
45063
 
45621
- return adapter;
45622
- }
45064
+ let s = length ?
45065
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
45066
+ 'as no adapter specified';
45623
45067
 
45624
- /**
45625
- * Exports Axios adapters and utility to resolve an adapter
45626
- */
45627
- var adapters = {
45628
- /**
45629
- * Resolve an adapter from a list of adapter names or functions.
45630
- * @type {Function}
45631
- */
45632
- getAdapter,
45068
+ throw new AxiosError(
45069
+ `There is no suitable adapter to dispatch the request ` + s,
45070
+ 'ERR_NOT_SUPPORT'
45071
+ );
45072
+ }
45633
45073
 
45634
- /**
45635
- * Exposes all known adapters
45636
- * @type {Object<string, Function|Object>}
45637
- */
45074
+ return adapter;
45075
+ },
45638
45076
  adapters: knownAdapters
45639
45077
  };
45640
45078
 
@@ -45651,7 +45089,7 @@ function throwIfCancellationRequested(config) {
45651
45089
  }
45652
45090
 
45653
45091
  if (config.signal && config.signal.aborted) {
45654
- throw new CanceledError$1(null, config);
45092
+ throw new CanceledError(null, config);
45655
45093
  }
45656
45094
  }
45657
45095
 
@@ -45677,7 +45115,7 @@ function dispatchRequest(config) {
45677
45115
  config.headers.setContentType('application/x-www-form-urlencoded', false);
45678
45116
  }
45679
45117
 
45680
- const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
45118
+ const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
45681
45119
 
45682
45120
  return adapter(config).then(function onAdapterResolution(response) {
45683
45121
  throwIfCancellationRequested(config);
@@ -45739,9 +45177,9 @@ validators$1.transitional = function transitional(validator, version, message) {
45739
45177
  // eslint-disable-next-line func-names
45740
45178
  return (value, opt, opts) => {
45741
45179
  if (validator === false) {
45742
- throw new AxiosError$1(
45180
+ throw new AxiosError(
45743
45181
  formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
45744
- AxiosError$1.ERR_DEPRECATED
45182
+ AxiosError.ERR_DEPRECATED
45745
45183
  );
45746
45184
  }
45747
45185
 
@@ -45760,14 +45198,6 @@ validators$1.transitional = function transitional(validator, version, message) {
45760
45198
  };
45761
45199
  };
45762
45200
 
45763
- validators$1.spelling = function spelling(correctSpelling) {
45764
- return (value, opt) => {
45765
- // eslint-disable-next-line no-console
45766
- console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
45767
- return true;
45768
- }
45769
- };
45770
-
45771
45201
  /**
45772
45202
  * Assert object's properties type
45773
45203
  *
@@ -45780,7 +45210,7 @@ validators$1.spelling = function spelling(correctSpelling) {
45780
45210
 
45781
45211
  function assertOptions(options, schema, allowUnknown) {
45782
45212
  if (typeof options !== 'object') {
45783
- throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
45213
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
45784
45214
  }
45785
45215
  const keys = Object.keys(options);
45786
45216
  let i = keys.length;
@@ -45791,12 +45221,12 @@ function assertOptions(options, schema, allowUnknown) {
45791
45221
  const value = options[opt];
45792
45222
  const result = value === undefined || validator(value, opt, options);
45793
45223
  if (result !== true) {
45794
- throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
45224
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
45795
45225
  }
45796
45226
  continue;
45797
45227
  }
45798
45228
  if (allowUnknown !== true) {
45799
- throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
45229
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
45800
45230
  }
45801
45231
  }
45802
45232
  }
@@ -45817,7 +45247,7 @@ const validators = validator.validators;
45817
45247
  */
45818
45248
  class Axios {
45819
45249
  constructor(instanceConfig) {
45820
- this.defaults = instanceConfig || {};
45250
+ this.defaults = instanceConfig;
45821
45251
  this.interceptors = {
45822
45252
  request: new InterceptorManager$1(),
45823
45253
  response: new InterceptorManager$1()
@@ -45837,9 +45267,9 @@ class Axios {
45837
45267
  return await this._request(configOrUrl, config);
45838
45268
  } catch (err) {
45839
45269
  if (err instanceof Error) {
45840
- let dummy = {};
45270
+ let dummy;
45841
45271
 
45842
- Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
45272
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
45843
45273
 
45844
45274
  // slice off the Error: ... line
45845
45275
  const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
@@ -45877,8 +45307,7 @@ class Axios {
45877
45307
  validator.assertOptions(transitional, {
45878
45308
  silentJSONParsing: validators.transitional(validators.boolean),
45879
45309
  forcedJSONParsing: validators.transitional(validators.boolean),
45880
- clarifyTimeoutError: validators.transitional(validators.boolean),
45881
- legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
45310
+ clarifyTimeoutError: validators.transitional(validators.boolean)
45882
45311
  }, false);
45883
45312
  }
45884
45313
 
@@ -45895,18 +45324,6 @@ class Axios {
45895
45324
  }
45896
45325
  }
45897
45326
 
45898
- // Set config.allowAbsoluteUrls
45899
- if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
45900
- config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
45901
- } else {
45902
- config.allowAbsoluteUrls = true;
45903
- }
45904
-
45905
- validator.assertOptions(config, {
45906
- baseUrl: validators.spelling('baseURL'),
45907
- withXsrfToken: validators.spelling('withXSRFToken')
45908
- }, true);
45909
-
45910
45327
  // Set config.method
45911
45328
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
45912
45329
 
@@ -45935,14 +45352,7 @@ class Axios {
45935
45352
 
45936
45353
  synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
45937
45354
 
45938
- const transitional = config.transitional || transitionalDefaults;
45939
- const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
45940
-
45941
- if (legacyInterceptorReqResOrdering) {
45942
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
45943
- } else {
45944
- requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
45945
- }
45355
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
45946
45356
  });
45947
45357
 
45948
45358
  const responseInterceptorChain = [];
@@ -45956,8 +45366,8 @@ class Axios {
45956
45366
 
45957
45367
  if (!synchronousRequestInterceptors) {
45958
45368
  const chain = [dispatchRequest.bind(this), undefined];
45959
- chain.unshift(...requestInterceptorChain);
45960
- chain.push(...responseInterceptorChain);
45369
+ chain.unshift.apply(chain, requestInterceptorChain);
45370
+ chain.push.apply(chain, responseInterceptorChain);
45961
45371
  len = chain.length;
45962
45372
 
45963
45373
  promise = Promise.resolve(config);
@@ -45973,6 +45383,8 @@ class Axios {
45973
45383
 
45974
45384
  let newConfig = config;
45975
45385
 
45386
+ i = 0;
45387
+
45976
45388
  while (i < len) {
45977
45389
  const onFulfilled = requestInterceptorChain[i++];
45978
45390
  const onRejected = requestInterceptorChain[i++];
@@ -46002,7 +45414,7 @@ class Axios {
46002
45414
 
46003
45415
  getUri(config) {
46004
45416
  config = mergeConfig(this.defaults, config);
46005
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
45417
+ const fullPath = buildFullPath(config.baseURL, config.url);
46006
45418
  return buildURL(fullPath, config.params, config.paramsSerializer);
46007
45419
  }
46008
45420
  }
@@ -46097,7 +45509,7 @@ class CancelToken {
46097
45509
  return;
46098
45510
  }
46099
45511
 
46100
- token.reason = new CanceledError$1(message, config, request);
45512
+ token.reason = new CanceledError(message, config, request);
46101
45513
  resolvePromise(token.reason);
46102
45514
  });
46103
45515
  }
@@ -46142,20 +45554,6 @@ class CancelToken {
46142
45554
  }
46143
45555
  }
46144
45556
 
46145
- toAbortSignal() {
46146
- const controller = new AbortController();
46147
-
46148
- const abort = (err) => {
46149
- controller.abort(err);
46150
- };
46151
-
46152
- this.subscribe(abort);
46153
-
46154
- controller.signal.unsubscribe = () => this.unsubscribe(abort);
46155
-
46156
- return controller.signal;
46157
- }
46158
-
46159
45557
  /**
46160
45558
  * Returns an object that contains a new `CancelToken` and a function that, when called,
46161
45559
  * cancels the `CancelToken`.
@@ -46181,7 +45579,7 @@ var CancelToken$1 = CancelToken;
46181
45579
  *
46182
45580
  * ```js
46183
45581
  * function f(x, y, z) {}
46184
- * const args = [1, 2, 3];
45582
+ * var args = [1, 2, 3];
46185
45583
  * f.apply(null, args);
46186
45584
  * ```
46187
45585
  *
@@ -46276,12 +45674,6 @@ const HttpStatusCode = {
46276
45674
  LoopDetected: 508,
46277
45675
  NotExtended: 510,
46278
45676
  NetworkAuthenticationRequired: 511,
46279
- WebServerIsDown: 521,
46280
- ConnectionTimedOut: 522,
46281
- OriginIsUnreachable: 523,
46282
- TimeoutOccurred: 524,
46283
- SslHandshakeFailed: 525,
46284
- InvalidSslCertificate: 526,
46285
45677
  };
46286
45678
 
46287
45679
  Object.entries(HttpStatusCode).forEach(([key, value]) => {
@@ -46322,14 +45714,14 @@ const axios = createInstance(defaults$1);
46322
45714
  axios.Axios = Axios$1;
46323
45715
 
46324
45716
  // Expose Cancel & CancelToken
46325
- axios.CanceledError = CanceledError$1;
45717
+ axios.CanceledError = CanceledError;
46326
45718
  axios.CancelToken = CancelToken$1;
46327
45719
  axios.isCancel = isCancel;
46328
45720
  axios.VERSION = VERSION;
46329
45721
  axios.toFormData = toFormData;
46330
45722
 
46331
45723
  // Expose AxiosError class
46332
- axios.AxiosError = AxiosError$1;
45724
+ axios.AxiosError = AxiosError;
46333
45725
 
46334
45726
  // alias for CanceledError for backward compatibility
46335
45727
  axios.Cancel = axios.CanceledError;
@@ -46608,7 +46000,8 @@ const initialState = {
46608
46000
  };
46609
46001
  const get_history = createAsyncThunk(CHAT.ACTION_TYPES.GET_HISTORY, async (params, thunkAPI) => {
46610
46002
  try {
46611
- return await api.chatApi.getHistory(params);
46003
+ //return await api.chatApi.getHistory(params)
46004
+ return await [];
46612
46005
  }
46613
46006
  catch (error) {
46614
46007
  return thunkAPI.rejectWithValue({ error: error.response.data });
@@ -47172,7 +46565,6 @@ appChatSlice.actions;
47172
46565
  const useChat = () => {
47173
46566
  const dispatch = useAppDispatch();
47174
46567
  const { active, checkInit, chatRoomId, userLogin, listContact, contactId, typeChat, loadChat, messageByGroup, listHistory, listChatType, archiveStore, checkScroll, listGeneralGroup, pinnedMessages, typingUsers } = useAppSelector((state) => state.chat);
47175
- console.log('active', active);
47176
46568
  const getHistoryApi = (params) => {
47177
46569
  return dispatch(get_history(params));
47178
46570
  };