@imtbl/sdk 0.39.1 → 0.39.2-alpha.1

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.cjs CHANGED
@@ -4256,7 +4256,7 @@ class MultiRollupApiClients {
4256
4256
  }
4257
4257
 
4258
4258
  // eslint-disable-next-line @typescript-eslint/naming-convention
4259
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.1' };
4259
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.2-alpha.1' };
4260
4260
  const createConfig = ({ basePath, headers, }) => {
4261
4261
  if (!basePath.trim()) {
4262
4262
  throw Error('basePath can not be empty');
@@ -4316,7 +4316,7 @@ class APIError extends Error {
4316
4316
 
4317
4317
  /* eslint-disable implicit-arrow-linebreak */
4318
4318
  const defaultHeaders = {
4319
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.1',
4319
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.2-alpha.1',
4320
4320
  };
4321
4321
  /**
4322
4322
  * createAPIConfiguration to create a custom Configuration
@@ -4755,7 +4755,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
4755
4755
  chainID,
4756
4756
  coreContractAddress,
4757
4757
  registrationContractAddress,
4758
- sdkVersion: 'ts-immutable-sdk-0.39.1',
4758
+ sdkVersion: 'ts-immutable-sdk-0.39.2-alpha.1',
4759
4759
  });
4760
4760
  /**
4761
4761
  * Sets `sdkVersion` at the time of build
@@ -5810,8 +5810,9 @@ const reduceDescriptors$1 = (obj, reducer) => {
5810
5810
  const reducedDescriptors = {};
5811
5811
 
5812
5812
  forEach$1(descriptors, (descriptor, name) => {
5813
- if (reducer(descriptor, name, obj) !== false) {
5814
- reducedDescriptors[name] = descriptor;
5813
+ let ret;
5814
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
5815
+ reducedDescriptors[name] = ret || descriptor;
5815
5816
  }
5816
5817
  });
5817
5818
 
@@ -5937,7 +5938,7 @@ const isAsyncFn$1 = kindOfTest$1('AsyncFunction');
5937
5938
  const isThenable$1 = (thing) =>
5938
5939
  thing && (isObject$1(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
5939
5940
 
5940
- var utils$1 = {
5941
+ var utils$1$1 = {
5941
5942
  isArray: isArray$1,
5942
5943
  isArrayBuffer: isArrayBuffer$1,
5943
5944
  isBuffer: isBuffer$1,
@@ -6019,7 +6020,7 @@ function AxiosError$1(message, code, config, request, response) {
6019
6020
  response && (this.response = response);
6020
6021
  }
6021
6022
 
6022
- utils$1.inherits(AxiosError$1, Error, {
6023
+ utils$1$1.inherits(AxiosError$1, Error, {
6023
6024
  toJSON: function toJSON() {
6024
6025
  return {
6025
6026
  // Standard
@@ -6034,7 +6035,7 @@ utils$1.inherits(AxiosError$1, Error, {
6034
6035
  columnNumber: this.columnNumber,
6035
6036
  stack: this.stack,
6036
6037
  // Axios
6037
- config: utils$1.toJSONObject(this.config),
6038
+ config: utils$1$1.toJSONObject(this.config),
6038
6039
  code: this.code,
6039
6040
  status: this.response && this.response.status ? this.response.status : null
6040
6041
  };
@@ -6069,7 +6070,7 @@ Object.defineProperty(prototype$1$1, 'isAxiosError', {value: true});
6069
6070
  AxiosError$1.from = (error, code, config, request, response, customProps) => {
6070
6071
  const axiosError = Object.create(prototype$1$1);
6071
6072
 
6072
- utils$1.toFlatObject(error, axiosError, function filter(obj) {
6073
+ utils$1$1.toFlatObject(error, axiosError, function filter(obj) {
6073
6074
  return obj !== Error.prototype;
6074
6075
  }, prop => {
6075
6076
  return prop !== 'isAxiosError';
@@ -6097,7 +6098,7 @@ var httpAdapter$1 = null;
6097
6098
  * @returns {boolean}
6098
6099
  */
6099
6100
  function isVisitable$1(thing) {
6100
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
6101
+ return utils$1$1.isPlainObject(thing) || utils$1$1.isArray(thing);
6101
6102
  }
6102
6103
 
6103
6104
  /**
@@ -6108,7 +6109,7 @@ function isVisitable$1(thing) {
6108
6109
  * @returns {string} the key without the brackets.
6109
6110
  */
6110
6111
  function removeBrackets$1(key) {
6111
- return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
6112
+ return utils$1$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
6112
6113
  }
6113
6114
 
6114
6115
  /**
@@ -6137,10 +6138,10 @@ function renderKey$1(path, key, dots) {
6137
6138
  * @returns {boolean}
6138
6139
  */
6139
6140
  function isFlatArray$1(arr) {
6140
- return utils$1.isArray(arr) && !arr.some(isVisitable$1);
6141
+ return utils$1$1.isArray(arr) && !arr.some(isVisitable$1);
6141
6142
  }
6142
6143
 
6143
- const predicates$1 = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
6144
+ const predicates$1 = utils$1$1.toFlatObject(utils$1$1, {}, null, function filter(prop) {
6144
6145
  return /^is[A-Z]/.test(prop);
6145
6146
  });
6146
6147
 
@@ -6168,7 +6169,7 @@ const predicates$1 = utils$1.toFlatObject(utils$1, {}, null, function filter(pro
6168
6169
  * @returns
6169
6170
  */
6170
6171
  function toFormData$1(obj, formData, options) {
6171
- if (!utils$1.isObject(obj)) {
6172
+ if (!utils$1$1.isObject(obj)) {
6172
6173
  throw new TypeError('target must be an object');
6173
6174
  }
6174
6175
 
@@ -6176,13 +6177,13 @@ function toFormData$1(obj, formData, options) {
6176
6177
  formData = formData || new (FormData)();
6177
6178
 
6178
6179
  // eslint-disable-next-line no-param-reassign
6179
- options = utils$1.toFlatObject(options, {
6180
+ options = utils$1$1.toFlatObject(options, {
6180
6181
  metaTokens: true,
6181
6182
  dots: false,
6182
6183
  indexes: false
6183
6184
  }, false, function defined(option, source) {
6184
6185
  // eslint-disable-next-line no-eq-null,eqeqeq
6185
- return !utils$1.isUndefined(source[option]);
6186
+ return !utils$1$1.isUndefined(source[option]);
6186
6187
  });
6187
6188
 
6188
6189
  const metaTokens = options.metaTokens;
@@ -6191,24 +6192,24 @@ function toFormData$1(obj, formData, options) {
6191
6192
  const dots = options.dots;
6192
6193
  const indexes = options.indexes;
6193
6194
  const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
6194
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
6195
+ const useBlob = _Blob && utils$1$1.isSpecCompliantForm(formData);
6195
6196
 
6196
- if (!utils$1.isFunction(visitor)) {
6197
+ if (!utils$1$1.isFunction(visitor)) {
6197
6198
  throw new TypeError('visitor must be a function');
6198
6199
  }
6199
6200
 
6200
6201
  function convertValue(value) {
6201
6202
  if (value === null) return '';
6202
6203
 
6203
- if (utils$1.isDate(value)) {
6204
+ if (utils$1$1.isDate(value)) {
6204
6205
  return value.toISOString();
6205
6206
  }
6206
6207
 
6207
- if (!useBlob && utils$1.isBlob(value)) {
6208
+ if (!useBlob && utils$1$1.isBlob(value)) {
6208
6209
  throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
6209
6210
  }
6210
6211
 
6211
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
6212
+ if (utils$1$1.isArrayBuffer(value) || utils$1$1.isTypedArray(value)) {
6212
6213
  return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
6213
6214
  }
6214
6215
 
@@ -6229,20 +6230,20 @@ function toFormData$1(obj, formData, options) {
6229
6230
  let arr = value;
6230
6231
 
6231
6232
  if (value && !path && typeof value === 'object') {
6232
- if (utils$1.endsWith(key, '{}')) {
6233
+ if (utils$1$1.endsWith(key, '{}')) {
6233
6234
  // eslint-disable-next-line no-param-reassign
6234
6235
  key = metaTokens ? key : key.slice(0, -2);
6235
6236
  // eslint-disable-next-line no-param-reassign
6236
6237
  value = JSON.stringify(value);
6237
6238
  } else if (
6238
- (utils$1.isArray(value) && isFlatArray$1(value)) ||
6239
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
6239
+ (utils$1$1.isArray(value) && isFlatArray$1(value)) ||
6240
+ ((utils$1$1.isFileList(value) || utils$1$1.endsWith(key, '[]')) && (arr = utils$1$1.toArray(value))
6240
6241
  )) {
6241
6242
  // eslint-disable-next-line no-param-reassign
6242
6243
  key = removeBrackets$1(key);
6243
6244
 
6244
6245
  arr.forEach(function each(el, index) {
6245
- !(utils$1.isUndefined(el) || el === null) && formData.append(
6246
+ !(utils$1$1.isUndefined(el) || el === null) && formData.append(
6246
6247
  // eslint-disable-next-line no-nested-ternary
6247
6248
  indexes === true ? renderKey$1([key], index, dots) : (indexes === null ? key : key + '[]'),
6248
6249
  convertValue(el)
@@ -6270,7 +6271,7 @@ function toFormData$1(obj, formData, options) {
6270
6271
  });
6271
6272
 
6272
6273
  function build(value, path) {
6273
- if (utils$1.isUndefined(value)) return;
6274
+ if (utils$1$1.isUndefined(value)) return;
6274
6275
 
6275
6276
  if (stack.indexOf(value) !== -1) {
6276
6277
  throw Error('Circular reference detected in ' + path.join('.'));
@@ -6278,9 +6279,9 @@ function toFormData$1(obj, formData, options) {
6278
6279
 
6279
6280
  stack.push(value);
6280
6281
 
6281
- utils$1.forEach(value, function each(el, key) {
6282
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
6283
- formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
6282
+ utils$1$1.forEach(value, function each(el, key) {
6283
+ const result = !(utils$1$1.isUndefined(el) || el === null) && visitor.call(
6284
+ formData, el, utils$1$1.isString(key) ? key.trim() : key, path, exposedHelpers
6284
6285
  );
6285
6286
 
6286
6287
  if (result === true) {
@@ -6291,7 +6292,7 @@ function toFormData$1(obj, formData, options) {
6291
6292
  stack.pop();
6292
6293
  }
6293
6294
 
6294
- if (!utils$1.isObject(obj)) {
6295
+ if (!utils$1$1.isObject(obj)) {
6295
6296
  throw new TypeError('data must be an object');
6296
6297
  }
6297
6298
 
@@ -6395,7 +6396,7 @@ function buildURL$1(url, params, options) {
6395
6396
  if (serializeFn) {
6396
6397
  serializedParams = serializeFn(params, options);
6397
6398
  } else {
6398
- serializedParams = utils$1.isURLSearchParams(params) ?
6399
+ serializedParams = utils$1$1.isURLSearchParams(params) ?
6399
6400
  params.toString() :
6400
6401
  new AxiosURLSearchParams$1(params, options).toString(_encode);
6401
6402
  }
@@ -6470,7 +6471,7 @@ let InterceptorManager$2 = class InterceptorManager {
6470
6471
  * @returns {void}
6471
6472
  */
6472
6473
  forEach(fn) {
6473
- utils$1.forEach(this.handlers, function forEachHandler(h) {
6474
+ utils$1$1.forEach(this.handlers, function forEachHandler(h) {
6474
6475
  if (h !== null) {
6475
6476
  fn(h);
6476
6477
  }
@@ -6492,6 +6493,18 @@ var FormData$1$1 = typeof FormData !== 'undefined' ? FormData : null;
6492
6493
 
6493
6494
  var Blob$1$1 = typeof Blob !== 'undefined' ? Blob : null;
6494
6495
 
6496
+ var platform$1$1 = {
6497
+ isBrowser: true,
6498
+ classes: {
6499
+ URLSearchParams: URLSearchParams$1$1,
6500
+ FormData: FormData$1$1,
6501
+ Blob: Blob$1$1
6502
+ },
6503
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
6504
+ };
6505
+
6506
+ const hasBrowserEnv$1 = typeof window !== 'undefined' && typeof document !== 'undefined';
6507
+
6495
6508
  /**
6496
6509
  * Determine if we're running in a standard browser environment
6497
6510
  *
@@ -6509,18 +6522,10 @@ var Blob$1$1 = typeof Blob !== 'undefined' ? Blob : null;
6509
6522
  *
6510
6523
  * @returns {boolean}
6511
6524
  */
6512
- const isStandardBrowserEnv$1 = (() => {
6513
- let product;
6514
- if (typeof navigator !== 'undefined' && (
6515
- (product = navigator.product) === 'ReactNative' ||
6516
- product === 'NativeScript' ||
6517
- product === 'NS')
6518
- ) {
6519
- return false;
6520
- }
6521
-
6522
- return typeof window !== 'undefined' && typeof document !== 'undefined';
6523
- })();
6525
+ const hasStandardBrowserEnv$1 = (
6526
+ (product) => {
6527
+ return hasBrowserEnv$1 && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
6528
+ })(typeof navigator !== 'undefined' && navigator.product);
6524
6529
 
6525
6530
  /**
6526
6531
  * Determine if we're running in a standard browser webWorker environment
@@ -6531,7 +6536,7 @@ const isStandardBrowserEnv$1 = (() => {
6531
6536
  * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
6532
6537
  * This leads to a problem when axios post `FormData` in webWorker
6533
6538
  */
6534
- const isStandardBrowserWebWorkerEnv$1 = (() => {
6539
+ const hasStandardBrowserWebWorkerEnv$1 = (() => {
6535
6540
  return (
6536
6541
  typeof WorkerGlobalScope !== 'undefined' &&
6537
6542
  // eslint-disable-next-line no-undef
@@ -6540,23 +6545,22 @@ const isStandardBrowserEnv$1 = (() => {
6540
6545
  );
6541
6546
  })();
6542
6547
 
6548
+ var utils$2 = /*#__PURE__*/Object.freeze({
6549
+ __proto__: null,
6550
+ hasBrowserEnv: hasBrowserEnv$1,
6551
+ hasStandardBrowserEnv: hasStandardBrowserEnv$1,
6552
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv$1
6553
+ });
6543
6554
 
6544
- var platform$1 = {
6545
- isBrowser: true,
6546
- classes: {
6547
- URLSearchParams: URLSearchParams$1$1,
6548
- FormData: FormData$1$1,
6549
- Blob: Blob$1$1
6550
- },
6551
- isStandardBrowserEnv: isStandardBrowserEnv$1,
6552
- isStandardBrowserWebWorkerEnv: isStandardBrowserWebWorkerEnv$1,
6553
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
6555
+ var platform$2 = {
6556
+ ...utils$2,
6557
+ ...platform$1$1
6554
6558
  };
6555
6559
 
6556
6560
  function toURLEncodedForm$1(data, options) {
6557
- return toFormData$1(data, new platform$1.classes.URLSearchParams(), Object.assign({
6561
+ return toFormData$1(data, new platform$2.classes.URLSearchParams(), Object.assign({
6558
6562
  visitor: function(value, key, path, helpers) {
6559
- if (platform$1.isNode && utils$1.isBuffer(value)) {
6563
+ if (platform$2.isNode && utils$1$1.isBuffer(value)) {
6560
6564
  this.append(key, value.toString('base64'));
6561
6565
  return false;
6562
6566
  }
@@ -6578,7 +6582,7 @@ function parsePropPath$1(name) {
6578
6582
  // foo.x.y.z
6579
6583
  // foo-x-y-z
6580
6584
  // foo x y z
6581
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
6585
+ return utils$1$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
6582
6586
  return match[0] === '[]' ? '' : match[1] || match[0];
6583
6587
  });
6584
6588
  }
@@ -6613,12 +6617,15 @@ function arrayToObject$1(arr) {
6613
6617
  function formDataToJSON$1(formData) {
6614
6618
  function buildPath(path, value, target, index) {
6615
6619
  let name = path[index++];
6620
+
6621
+ if (name === '__proto__') return true;
6622
+
6616
6623
  const isNumericKey = Number.isFinite(+name);
6617
6624
  const isLast = index >= path.length;
6618
- name = !name && utils$1.isArray(target) ? target.length : name;
6625
+ name = !name && utils$1$1.isArray(target) ? target.length : name;
6619
6626
 
6620
6627
  if (isLast) {
6621
- if (utils$1.hasOwnProp(target, name)) {
6628
+ if (utils$1$1.hasOwnProp(target, name)) {
6622
6629
  target[name] = [target[name], value];
6623
6630
  } else {
6624
6631
  target[name] = value;
@@ -6627,23 +6634,23 @@ function formDataToJSON$1(formData) {
6627
6634
  return !isNumericKey;
6628
6635
  }
6629
6636
 
6630
- if (!target[name] || !utils$1.isObject(target[name])) {
6637
+ if (!target[name] || !utils$1$1.isObject(target[name])) {
6631
6638
  target[name] = [];
6632
6639
  }
6633
6640
 
6634
6641
  const result = buildPath(path, value, target[name], index);
6635
6642
 
6636
- if (result && utils$1.isArray(target[name])) {
6643
+ if (result && utils$1$1.isArray(target[name])) {
6637
6644
  target[name] = arrayToObject$1(target[name]);
6638
6645
  }
6639
6646
 
6640
6647
  return !isNumericKey;
6641
6648
  }
6642
6649
 
6643
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
6650
+ if (utils$1$1.isFormData(formData) && utils$1$1.isFunction(formData.entries)) {
6644
6651
  const obj = {};
6645
6652
 
6646
- utils$1.forEachEntry(formData, (name, value) => {
6653
+ utils$1$1.forEachEntry(formData, (name, value) => {
6647
6654
  buildPath(parsePropPath$1(name), value, obj, 0);
6648
6655
  });
6649
6656
 
@@ -6653,10 +6660,6 @@ function formDataToJSON$1(formData) {
6653
6660
  return null;
6654
6661
  }
6655
6662
 
6656
- const DEFAULT_CONTENT_TYPE$1 = {
6657
- 'Content-Type': undefined
6658
- };
6659
-
6660
6663
  /**
6661
6664
  * It takes a string, tries to parse it, and if it fails, it returns the stringified version
6662
6665
  * of the input
@@ -6668,10 +6671,10 @@ const DEFAULT_CONTENT_TYPE$1 = {
6668
6671
  * @returns {string} A stringified version of the rawValue.
6669
6672
  */
6670
6673
  function stringifySafely$1(rawValue, parser, encoder) {
6671
- if (utils$1.isString(rawValue)) {
6674
+ if (utils$1$1.isString(rawValue)) {
6672
6675
  try {
6673
6676
  (parser || JSON.parse)(rawValue);
6674
- return utils$1.trim(rawValue);
6677
+ return utils$1$1.trim(rawValue);
6675
6678
  } catch (e) {
6676
6679
  if (e.name !== 'SyntaxError') {
6677
6680
  throw e;
@@ -6691,13 +6694,13 @@ const defaults$2 = {
6691
6694
  transformRequest: [function transformRequest(data, headers) {
6692
6695
  const contentType = headers.getContentType() || '';
6693
6696
  const hasJSONContentType = contentType.indexOf('application/json') > -1;
6694
- const isObjectPayload = utils$1.isObject(data);
6697
+ const isObjectPayload = utils$1$1.isObject(data);
6695
6698
 
6696
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
6699
+ if (isObjectPayload && utils$1$1.isHTMLForm(data)) {
6697
6700
  data = new FormData(data);
6698
6701
  }
6699
6702
 
6700
- const isFormData = utils$1.isFormData(data);
6703
+ const isFormData = utils$1$1.isFormData(data);
6701
6704
 
6702
6705
  if (isFormData) {
6703
6706
  if (!hasJSONContentType) {
@@ -6706,18 +6709,18 @@ const defaults$2 = {
6706
6709
  return hasJSONContentType ? JSON.stringify(formDataToJSON$1(data)) : data;
6707
6710
  }
6708
6711
 
6709
- if (utils$1.isArrayBuffer(data) ||
6710
- utils$1.isBuffer(data) ||
6711
- utils$1.isStream(data) ||
6712
- utils$1.isFile(data) ||
6713
- utils$1.isBlob(data)
6712
+ if (utils$1$1.isArrayBuffer(data) ||
6713
+ utils$1$1.isBuffer(data) ||
6714
+ utils$1$1.isStream(data) ||
6715
+ utils$1$1.isFile(data) ||
6716
+ utils$1$1.isBlob(data)
6714
6717
  ) {
6715
6718
  return data;
6716
6719
  }
6717
- if (utils$1.isArrayBufferView(data)) {
6720
+ if (utils$1$1.isArrayBufferView(data)) {
6718
6721
  return data.buffer;
6719
6722
  }
6720
- if (utils$1.isURLSearchParams(data)) {
6723
+ if (utils$1$1.isURLSearchParams(data)) {
6721
6724
  headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
6722
6725
  return data.toString();
6723
6726
  }
@@ -6729,7 +6732,7 @@ const defaults$2 = {
6729
6732
  return toURLEncodedForm$1(data, this.formSerializer).toString();
6730
6733
  }
6731
6734
 
6732
- if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
6735
+ if ((isFileList = utils$1$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
6733
6736
  const _FormData = this.env && this.env.FormData;
6734
6737
 
6735
6738
  return toFormData$1(
@@ -6753,7 +6756,7 @@ const defaults$2 = {
6753
6756
  const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
6754
6757
  const JSONRequested = this.responseType === 'json';
6755
6758
 
6756
- if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
6759
+ if (data && utils$1$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
6757
6760
  const silentJSONParsing = transitional && transitional.silentJSONParsing;
6758
6761
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
6759
6762
 
@@ -6785,8 +6788,8 @@ const defaults$2 = {
6785
6788
  maxBodyLength: -1,
6786
6789
 
6787
6790
  env: {
6788
- FormData: platform$1.classes.FormData,
6789
- Blob: platform$1.classes.Blob
6791
+ FormData: platform$2.classes.FormData,
6792
+ Blob: platform$2.classes.Blob
6790
6793
  },
6791
6794
 
6792
6795
  validateStatus: function validateStatus(status) {
@@ -6795,24 +6798,21 @@ const defaults$2 = {
6795
6798
 
6796
6799
  headers: {
6797
6800
  common: {
6798
- 'Accept': 'application/json, text/plain, */*'
6801
+ 'Accept': 'application/json, text/plain, */*',
6802
+ 'Content-Type': undefined
6799
6803
  }
6800
6804
  }
6801
6805
  };
6802
6806
 
6803
- utils$1.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
6807
+ utils$1$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
6804
6808
  defaults$2.headers[method] = {};
6805
6809
  });
6806
6810
 
6807
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
6808
- defaults$2.headers[method] = utils$1.merge(DEFAULT_CONTENT_TYPE$1);
6809
- });
6810
-
6811
6811
  var defaults$1$1 = defaults$2;
6812
6812
 
6813
6813
  // RawAxiosHeaders whose duplicates are ignored by node
6814
6814
  // c.f. https://nodejs.org/api/http.html#http_message_headers
6815
- const ignoreDuplicateOf$1 = utils$1.toObjectSet([
6815
+ const ignoreDuplicateOf$1 = utils$1$1.toObjectSet([
6816
6816
  'age', 'authorization', 'content-length', 'content-type', 'etag',
6817
6817
  'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
6818
6818
  'last-modified', 'location', 'max-forwards', 'proxy-authorization',
@@ -6873,7 +6873,7 @@ function normalizeValue$1(value) {
6873
6873
  return value;
6874
6874
  }
6875
6875
 
6876
- return utils$1.isArray(value) ? value.map(normalizeValue$1) : String(value);
6876
+ return utils$1$1.isArray(value) ? value.map(normalizeValue$1) : String(value);
6877
6877
  }
6878
6878
 
6879
6879
  function parseTokens$1(str) {
@@ -6891,7 +6891,7 @@ function parseTokens$1(str) {
6891
6891
  const isValidHeaderName$1 = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
6892
6892
 
6893
6893
  function matchHeaderValue$1(context, value, header, filter, isHeaderNameFilter) {
6894
- if (utils$1.isFunction(filter)) {
6894
+ if (utils$1$1.isFunction(filter)) {
6895
6895
  return filter.call(this, value, header);
6896
6896
  }
6897
6897
 
@@ -6899,13 +6899,13 @@ function matchHeaderValue$1(context, value, header, filter, isHeaderNameFilter)
6899
6899
  value = header;
6900
6900
  }
6901
6901
 
6902
- if (!utils$1.isString(value)) return;
6902
+ if (!utils$1$1.isString(value)) return;
6903
6903
 
6904
- if (utils$1.isString(filter)) {
6904
+ if (utils$1$1.isString(filter)) {
6905
6905
  return value.indexOf(filter) !== -1;
6906
6906
  }
6907
6907
 
6908
- if (utils$1.isRegExp(filter)) {
6908
+ if (utils$1$1.isRegExp(filter)) {
6909
6909
  return filter.test(value);
6910
6910
  }
6911
6911
  }
@@ -6918,7 +6918,7 @@ function formatHeader$1(header) {
6918
6918
  }
6919
6919
 
6920
6920
  function buildAccessors$1(obj, header) {
6921
- const accessorName = utils$1.toCamelCase(' ' + header);
6921
+ const accessorName = utils$1$1.toCamelCase(' ' + header);
6922
6922
 
6923
6923
  ['get', 'set', 'has'].forEach(methodName => {
6924
6924
  Object.defineProperty(obj, methodName + accessorName, {
@@ -6945,7 +6945,7 @@ let AxiosHeaders$2 = class AxiosHeaders {
6945
6945
  throw new Error('header name must be a non-empty string');
6946
6946
  }
6947
6947
 
6948
- const key = utils$1.findKey(self, lHeader);
6948
+ const key = utils$1$1.findKey(self, lHeader);
6949
6949
 
6950
6950
  if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
6951
6951
  self[key || _header] = normalizeValue$1(_value);
@@ -6953,11 +6953,11 @@ let AxiosHeaders$2 = class AxiosHeaders {
6953
6953
  }
6954
6954
 
6955
6955
  const setHeaders = (headers, _rewrite) =>
6956
- utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
6956
+ utils$1$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
6957
6957
 
6958
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
6958
+ if (utils$1$1.isPlainObject(header) || header instanceof this.constructor) {
6959
6959
  setHeaders(header, valueOrRewrite);
6960
- } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName$1(header)) {
6960
+ } else if(utils$1$1.isString(header) && (header = header.trim()) && !isValidHeaderName$1(header)) {
6961
6961
  setHeaders(parseHeaders$1(header), valueOrRewrite);
6962
6962
  } else {
6963
6963
  header != null && setHeader(valueOrRewrite, header, rewrite);
@@ -6970,7 +6970,7 @@ let AxiosHeaders$2 = class AxiosHeaders {
6970
6970
  header = normalizeHeader$1(header);
6971
6971
 
6972
6972
  if (header) {
6973
- const key = utils$1.findKey(this, header);
6973
+ const key = utils$1$1.findKey(this, header);
6974
6974
 
6975
6975
  if (key) {
6976
6976
  const value = this[key];
@@ -6983,11 +6983,11 @@ let AxiosHeaders$2 = class AxiosHeaders {
6983
6983
  return parseTokens$1(value);
6984
6984
  }
6985
6985
 
6986
- if (utils$1.isFunction(parser)) {
6986
+ if (utils$1$1.isFunction(parser)) {
6987
6987
  return parser.call(this, value, key);
6988
6988
  }
6989
6989
 
6990
- if (utils$1.isRegExp(parser)) {
6990
+ if (utils$1$1.isRegExp(parser)) {
6991
6991
  return parser.exec(value);
6992
6992
  }
6993
6993
 
@@ -7000,7 +7000,7 @@ let AxiosHeaders$2 = class AxiosHeaders {
7000
7000
  header = normalizeHeader$1(header);
7001
7001
 
7002
7002
  if (header) {
7003
- const key = utils$1.findKey(this, header);
7003
+ const key = utils$1$1.findKey(this, header);
7004
7004
 
7005
7005
  return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue$1(this, this[key], key, matcher)));
7006
7006
  }
@@ -7016,7 +7016,7 @@ let AxiosHeaders$2 = class AxiosHeaders {
7016
7016
  _header = normalizeHeader$1(_header);
7017
7017
 
7018
7018
  if (_header) {
7019
- const key = utils$1.findKey(self, _header);
7019
+ const key = utils$1$1.findKey(self, _header);
7020
7020
 
7021
7021
  if (key && (!matcher || matchHeaderValue$1(self, self[key], key, matcher))) {
7022
7022
  delete self[key];
@@ -7026,7 +7026,7 @@ let AxiosHeaders$2 = class AxiosHeaders {
7026
7026
  }
7027
7027
  }
7028
7028
 
7029
- if (utils$1.isArray(header)) {
7029
+ if (utils$1$1.isArray(header)) {
7030
7030
  header.forEach(deleteHeader);
7031
7031
  } else {
7032
7032
  deleteHeader(header);
@@ -7055,8 +7055,8 @@ let AxiosHeaders$2 = class AxiosHeaders {
7055
7055
  const self = this;
7056
7056
  const headers = {};
7057
7057
 
7058
- utils$1.forEach(this, (value, header) => {
7059
- const key = utils$1.findKey(headers, header);
7058
+ utils$1$1.forEach(this, (value, header) => {
7059
+ const key = utils$1$1.findKey(headers, header);
7060
7060
 
7061
7061
  if (key) {
7062
7062
  self[key] = normalizeValue$1(value);
@@ -7085,8 +7085,8 @@ let AxiosHeaders$2 = class AxiosHeaders {
7085
7085
  toJSON(asStrings) {
7086
7086
  const obj = Object.create(null);
7087
7087
 
7088
- utils$1.forEach(this, (value, header) => {
7089
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
7088
+ utils$1$1.forEach(this, (value, header) => {
7089
+ value != null && value !== false && (obj[header] = asStrings && utils$1$1.isArray(value) ? value.join(', ') : value);
7090
7090
  });
7091
7091
 
7092
7092
  return obj;
@@ -7133,7 +7133,7 @@ let AxiosHeaders$2 = class AxiosHeaders {
7133
7133
  }
7134
7134
  }
7135
7135
 
7136
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
7136
+ utils$1$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
7137
7137
 
7138
7138
  return this;
7139
7139
  }
@@ -7141,8 +7141,18 @@ let AxiosHeaders$2 = class AxiosHeaders {
7141
7141
 
7142
7142
  AxiosHeaders$2.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
7143
7143
 
7144
- utils$1.freezeMethods(AxiosHeaders$2.prototype);
7145
- utils$1.freezeMethods(AxiosHeaders$2);
7144
+ // reserved names hotfix
7145
+ utils$1$1.reduceDescriptors(AxiosHeaders$2.prototype, ({value}, key) => {
7146
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
7147
+ return {
7148
+ get: () => value,
7149
+ set(headerValue) {
7150
+ this[mapped] = headerValue;
7151
+ }
7152
+ }
7153
+ });
7154
+
7155
+ utils$1$1.freezeMethods(AxiosHeaders$2);
7146
7156
 
7147
7157
  var AxiosHeaders$1$1 = AxiosHeaders$2;
7148
7158
 
@@ -7160,7 +7170,7 @@ function transformData$1(fns, response) {
7160
7170
  const headers = AxiosHeaders$1$1.from(context.headers);
7161
7171
  let data = context.data;
7162
7172
 
7163
- utils$1.forEach(fns, function transform(fn) {
7173
+ utils$1$1.forEach(fns, function transform(fn) {
7164
7174
  data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
7165
7175
  });
7166
7176
 
@@ -7188,7 +7198,7 @@ function CanceledError$1(message, config, request) {
7188
7198
  this.name = 'CanceledError';
7189
7199
  }
7190
7200
 
7191
- utils$1.inherits(CanceledError$1, AxiosError$1, {
7201
+ utils$1$1.inherits(CanceledError$1, AxiosError$1, {
7192
7202
  __CANCEL__: true
7193
7203
  });
7194
7204
 
@@ -7216,53 +7226,44 @@ function settle$1(resolve, reject, response) {
7216
7226
  }
7217
7227
  }
7218
7228
 
7219
- var cookies$1 = platform$1.isStandardBrowserEnv ?
7229
+ var cookies$1 = platform$2.hasStandardBrowserEnv ?
7220
7230
 
7221
- // Standard browser envs support document.cookie
7222
- (function standardBrowserEnv() {
7223
- return {
7224
- write: function write(name, value, expires, path, domain, secure) {
7225
- const cookie = [];
7226
- cookie.push(name + '=' + encodeURIComponent(value));
7231
+ // Standard browser envs support document.cookie
7232
+ {
7233
+ write(name, value, expires, path, domain, secure) {
7234
+ const cookie = [name + '=' + encodeURIComponent(value)];
7227
7235
 
7228
- if (utils$1.isNumber(expires)) {
7229
- cookie.push('expires=' + new Date(expires).toGMTString());
7230
- }
7236
+ utils$1$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
7231
7237
 
7232
- if (utils$1.isString(path)) {
7233
- cookie.push('path=' + path);
7234
- }
7238
+ utils$1$1.isString(path) && cookie.push('path=' + path);
7235
7239
 
7236
- if (utils$1.isString(domain)) {
7237
- cookie.push('domain=' + domain);
7238
- }
7240
+ utils$1$1.isString(domain) && cookie.push('domain=' + domain);
7239
7241
 
7240
- if (secure === true) {
7241
- cookie.push('secure');
7242
- }
7242
+ secure === true && cookie.push('secure');
7243
7243
 
7244
- document.cookie = cookie.join('; ');
7245
- },
7244
+ document.cookie = cookie.join('; ');
7245
+ },
7246
7246
 
7247
- read: function read(name) {
7248
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
7249
- return (match ? decodeURIComponent(match[3]) : null);
7250
- },
7247
+ read(name) {
7248
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
7249
+ return (match ? decodeURIComponent(match[3]) : null);
7250
+ },
7251
7251
 
7252
- remove: function remove(name) {
7253
- this.write(name, '', Date.now() - 86400000);
7254
- }
7255
- };
7256
- })() :
7252
+ remove(name) {
7253
+ this.write(name, '', Date.now() - 86400000);
7254
+ }
7255
+ }
7257
7256
 
7258
- // Non standard browser env (web workers, react-native) lack needed support.
7259
- (function nonStandardBrowserEnv() {
7260
- return {
7261
- write: function write() {},
7262
- read: function read() { return null; },
7263
- remove: function remove() {}
7264
- };
7265
- })();
7257
+ :
7258
+
7259
+ // Non-standard browser env (web workers, react-native) lack needed support.
7260
+ {
7261
+ write() {},
7262
+ read() {
7263
+ return null;
7264
+ },
7265
+ remove() {}
7266
+ };
7266
7267
 
7267
7268
  /**
7268
7269
  * Determines whether the specified URL is absolute
@@ -7288,7 +7289,7 @@ function isAbsoluteURL$1(url) {
7288
7289
  */
7289
7290
  function combineURLs$1(baseURL, relativeURL) {
7290
7291
  return relativeURL
7291
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
7292
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
7292
7293
  : baseURL;
7293
7294
  }
7294
7295
 
@@ -7309,7 +7310,7 @@ function buildFullPath$1(baseURL, requestedURL) {
7309
7310
  return requestedURL;
7310
7311
  }
7311
7312
 
7312
- var isURLSameOrigin$1 = platform$1.isStandardBrowserEnv ?
7313
+ var isURLSameOrigin$1 = platform$2.hasStandardBrowserEnv ?
7313
7314
 
7314
7315
  // Standard browser envs have full support of the APIs needed to test
7315
7316
  // whether the request URL is of the same origin as current location.
@@ -7319,7 +7320,7 @@ var isURLSameOrigin$1 = platform$1.isStandardBrowserEnv ?
7319
7320
  let originURL;
7320
7321
 
7321
7322
  /**
7322
- * Parse a URL to discover it's components
7323
+ * Parse a URL to discover its components
7323
7324
  *
7324
7325
  * @param {String} url The URL to be parsed
7325
7326
  * @returns {Object}
@@ -7359,7 +7360,7 @@ var isURLSameOrigin$1 = platform$1.isStandardBrowserEnv ?
7359
7360
  * @returns {boolean} True if URL shares the same origin, otherwise false
7360
7361
  */
7361
7362
  return function isURLSameOrigin(requestURL) {
7362
- const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
7363
+ const parsed = (utils$1$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
7363
7364
  return (parsed.protocol === originURL.protocol &&
7364
7365
  parsed.host === originURL.host);
7365
7366
  };
@@ -7464,7 +7465,7 @@ var xhrAdapter$1 = isXHRAdapterSupported$1 && function (config) {
7464
7465
  return new Promise(function dispatchXhrRequest(resolve, reject) {
7465
7466
  let requestData = config.data;
7466
7467
  const requestHeaders = AxiosHeaders$1$1.from(config.headers).normalize();
7467
- const responseType = config.responseType;
7468
+ let {responseType, withXSRFToken} = config;
7468
7469
  let onCanceled;
7469
7470
  function done() {
7470
7471
  if (config.cancelToken) {
@@ -7476,11 +7477,15 @@ var xhrAdapter$1 = isXHRAdapterSupported$1 && function (config) {
7476
7477
  }
7477
7478
  }
7478
7479
 
7479
- if (utils$1.isFormData(requestData)) {
7480
- if (platform$1.isStandardBrowserEnv || platform$1.isStandardBrowserWebWorkerEnv) {
7480
+ let contentType;
7481
+
7482
+ if (utils$1$1.isFormData(requestData)) {
7483
+ if (platform$2.hasStandardBrowserEnv || platform$2.hasStandardBrowserWebWorkerEnv) {
7481
7484
  requestHeaders.setContentType(false); // Let the browser set it
7482
- } else {
7483
- requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
7485
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
7486
+ // fix semicolon duplication issue for ReactNative FormData implementation
7487
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
7488
+ requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
7484
7489
  }
7485
7490
  }
7486
7491
 
@@ -7596,13 +7601,16 @@ var xhrAdapter$1 = isXHRAdapterSupported$1 && function (config) {
7596
7601
  // Add xsrf header
7597
7602
  // This is only done if running in a standard browser environment.
7598
7603
  // Specifically not if we're in a web worker, or react-native.
7599
- if (platform$1.isStandardBrowserEnv) {
7600
- // Add xsrf header
7601
- const xsrfValue = (config.withCredentials || isURLSameOrigin$1(fullPath))
7602
- && config.xsrfCookieName && cookies$1.read(config.xsrfCookieName);
7604
+ if(platform$2.hasStandardBrowserEnv) {
7605
+ withXSRFToken && utils$1$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
7606
+
7607
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin$1(fullPath))) {
7608
+ // Add xsrf header
7609
+ const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies$1.read(config.xsrfCookieName);
7603
7610
 
7604
- if (xsrfValue) {
7605
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
7611
+ if (xsrfValue) {
7612
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
7613
+ }
7606
7614
  }
7607
7615
  }
7608
7616
 
@@ -7611,13 +7619,13 @@ var xhrAdapter$1 = isXHRAdapterSupported$1 && function (config) {
7611
7619
 
7612
7620
  // Add headers to the request
7613
7621
  if ('setRequestHeader' in request) {
7614
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
7622
+ utils$1$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
7615
7623
  request.setRequestHeader(key, val);
7616
7624
  });
7617
7625
  }
7618
7626
 
7619
7627
  // Add withCredentials to request if needed
7620
- if (!utils$1.isUndefined(config.withCredentials)) {
7628
+ if (!utils$1$1.isUndefined(config.withCredentials)) {
7621
7629
  request.withCredentials = !!config.withCredentials;
7622
7630
  }
7623
7631
 
@@ -7656,7 +7664,7 @@ var xhrAdapter$1 = isXHRAdapterSupported$1 && function (config) {
7656
7664
 
7657
7665
  const protocol = parseProtocol$1(fullPath);
7658
7666
 
7659
- if (protocol && platform$1.protocols.indexOf(protocol) === -1) {
7667
+ if (protocol && platform$2.protocols.indexOf(protocol) === -1) {
7660
7668
  reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
7661
7669
  return;
7662
7670
  }
@@ -7672,8 +7680,8 @@ const knownAdapters$1 = {
7672
7680
  xhr: xhrAdapter$1
7673
7681
  };
7674
7682
 
7675
- utils$1.forEach(knownAdapters$1, (fn, value) => {
7676
- if(fn) {
7683
+ utils$1$1.forEach(knownAdapters$1, (fn, value) => {
7684
+ if (fn) {
7677
7685
  try {
7678
7686
  Object.defineProperty(fn, 'name', {value});
7679
7687
  } catch (e) {
@@ -7683,38 +7691,56 @@ utils$1.forEach(knownAdapters$1, (fn, value) => {
7683
7691
  }
7684
7692
  });
7685
7693
 
7694
+ const renderReason$1 = (reason) => `- ${reason}`;
7695
+
7696
+ const isResolvedHandle$1 = (adapter) => utils$1$1.isFunction(adapter) || adapter === null || adapter === false;
7697
+
7686
7698
  var adapters$1 = {
7687
7699
  getAdapter: (adapters) => {
7688
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
7700
+ adapters = utils$1$1.isArray(adapters) ? adapters : [adapters];
7689
7701
 
7690
7702
  const {length} = adapters;
7691
7703
  let nameOrAdapter;
7692
7704
  let adapter;
7693
7705
 
7706
+ const rejectedReasons = {};
7707
+
7694
7708
  for (let i = 0; i < length; i++) {
7695
7709
  nameOrAdapter = adapters[i];
7696
- if((adapter = utils$1.isString(nameOrAdapter) ? knownAdapters$1[nameOrAdapter.toLowerCase()] : nameOrAdapter)) {
7710
+ let id;
7711
+
7712
+ adapter = nameOrAdapter;
7713
+
7714
+ if (!isResolvedHandle$1(nameOrAdapter)) {
7715
+ adapter = knownAdapters$1[(id = String(nameOrAdapter)).toLowerCase()];
7716
+
7717
+ if (adapter === undefined) {
7718
+ throw new AxiosError$1(`Unknown adapter '${id}'`);
7719
+ }
7720
+ }
7721
+
7722
+ if (adapter) {
7697
7723
  break;
7698
7724
  }
7725
+
7726
+ rejectedReasons[id || '#' + i] = adapter;
7699
7727
  }
7700
7728
 
7701
7729
  if (!adapter) {
7702
- if (adapter === false) {
7703
- throw new AxiosError$1(
7704
- `Adapter ${nameOrAdapter} is not supported by the environment`,
7705
- 'ERR_NOT_SUPPORT'
7730
+
7731
+ const reasons = Object.entries(rejectedReasons)
7732
+ .map(([id, state]) => `adapter ${id} ` +
7733
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
7706
7734
  );
7707
- }
7708
7735
 
7709
- throw new Error(
7710
- utils$1.hasOwnProp(knownAdapters$1, nameOrAdapter) ?
7711
- `Adapter '${nameOrAdapter}' is not available in the build` :
7712
- `Unknown adapter '${nameOrAdapter}'`
7713
- );
7714
- }
7736
+ let s = length ?
7737
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason$1).join('\n') : ' ' + renderReason$1(reasons[0])) :
7738
+ 'as no adapter specified';
7715
7739
 
7716
- if (!utils$1.isFunction(adapter)) {
7717
- throw new TypeError('adapter is not a function');
7740
+ throw new AxiosError$1(
7741
+ `There is no suitable adapter to dispatch the request ` + s,
7742
+ 'ERR_NOT_SUPPORT'
7743
+ );
7718
7744
  }
7719
7745
 
7720
7746
  return adapter;
@@ -7812,11 +7838,11 @@ function mergeConfig$1(config1, config2) {
7812
7838
  const config = {};
7813
7839
 
7814
7840
  function getMergedValue(target, source, caseless) {
7815
- if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
7816
- return utils$1.merge.call({caseless}, target, source);
7817
- } else if (utils$1.isPlainObject(source)) {
7818
- return utils$1.merge({}, source);
7819
- } else if (utils$1.isArray(source)) {
7841
+ if (utils$1$1.isPlainObject(target) && utils$1$1.isPlainObject(source)) {
7842
+ return utils$1$1.merge.call({caseless}, target, source);
7843
+ } else if (utils$1$1.isPlainObject(source)) {
7844
+ return utils$1$1.merge({}, source);
7845
+ } else if (utils$1$1.isArray(source)) {
7820
7846
  return source.slice();
7821
7847
  }
7822
7848
  return source;
@@ -7824,25 +7850,25 @@ function mergeConfig$1(config1, config2) {
7824
7850
 
7825
7851
  // eslint-disable-next-line consistent-return
7826
7852
  function mergeDeepProperties(a, b, caseless) {
7827
- if (!utils$1.isUndefined(b)) {
7853
+ if (!utils$1$1.isUndefined(b)) {
7828
7854
  return getMergedValue(a, b, caseless);
7829
- } else if (!utils$1.isUndefined(a)) {
7855
+ } else if (!utils$1$1.isUndefined(a)) {
7830
7856
  return getMergedValue(undefined, a, caseless);
7831
7857
  }
7832
7858
  }
7833
7859
 
7834
7860
  // eslint-disable-next-line consistent-return
7835
7861
  function valueFromConfig2(a, b) {
7836
- if (!utils$1.isUndefined(b)) {
7862
+ if (!utils$1$1.isUndefined(b)) {
7837
7863
  return getMergedValue(undefined, b);
7838
7864
  }
7839
7865
  }
7840
7866
 
7841
7867
  // eslint-disable-next-line consistent-return
7842
7868
  function defaultToConfig2(a, b) {
7843
- if (!utils$1.isUndefined(b)) {
7869
+ if (!utils$1$1.isUndefined(b)) {
7844
7870
  return getMergedValue(undefined, b);
7845
- } else if (!utils$1.isUndefined(a)) {
7871
+ } else if (!utils$1$1.isUndefined(a)) {
7846
7872
  return getMergedValue(undefined, a);
7847
7873
  }
7848
7874
  }
@@ -7867,6 +7893,7 @@ function mergeConfig$1(config1, config2) {
7867
7893
  timeout: defaultToConfig2,
7868
7894
  timeoutMessage: defaultToConfig2,
7869
7895
  withCredentials: defaultToConfig2,
7896
+ withXSRFToken: defaultToConfig2,
7870
7897
  adapter: defaultToConfig2,
7871
7898
  responseType: defaultToConfig2,
7872
7899
  xsrfCookieName: defaultToConfig2,
@@ -7887,16 +7914,16 @@ function mergeConfig$1(config1, config2) {
7887
7914
  headers: (a, b) => mergeDeepProperties(headersToObject$1(a), headersToObject$1(b), true)
7888
7915
  };
7889
7916
 
7890
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
7917
+ utils$1$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
7891
7918
  const merge = mergeMap[prop] || mergeDeepProperties;
7892
7919
  const configValue = merge(config1[prop], config2[prop], prop);
7893
- (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
7920
+ (utils$1$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
7894
7921
  });
7895
7922
 
7896
7923
  return config;
7897
7924
  }
7898
7925
 
7899
- const VERSION$1 = "1.4.0";
7926
+ const VERSION$1 = "1.6.5";
7900
7927
 
7901
7928
  const validators$1$1 = {};
7902
7929
 
@@ -8034,7 +8061,7 @@ let Axios$2 = class Axios {
8034
8061
  }
8035
8062
 
8036
8063
  if (paramsSerializer != null) {
8037
- if (utils$1.isFunction(paramsSerializer)) {
8064
+ if (utils$1$1.isFunction(paramsSerializer)) {
8038
8065
  config.paramsSerializer = {
8039
8066
  serialize: paramsSerializer
8040
8067
  };
@@ -8049,15 +8076,13 @@ let Axios$2 = class Axios {
8049
8076
  // Set config.method
8050
8077
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
8051
8078
 
8052
- let contextHeaders;
8053
-
8054
8079
  // Flatten headers
8055
- contextHeaders = headers && utils$1.merge(
8080
+ let contextHeaders = headers && utils$1$1.merge(
8056
8081
  headers.common,
8057
8082
  headers[config.method]
8058
8083
  );
8059
8084
 
8060
- contextHeaders && utils$1.forEach(
8085
+ headers && utils$1$1.forEach(
8061
8086
  ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
8062
8087
  (method) => {
8063
8088
  delete headers[method];
@@ -8144,7 +8169,7 @@ let Axios$2 = class Axios {
8144
8169
  };
8145
8170
 
8146
8171
  // Provide aliases for supported request methods
8147
- utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
8172
+ utils$1$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
8148
8173
  /*eslint func-names:0*/
8149
8174
  Axios$2.prototype[method] = function(url, config) {
8150
8175
  return this.request(mergeConfig$1(config || {}, {
@@ -8155,7 +8180,7 @@ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoDa
8155
8180
  };
8156
8181
  });
8157
8182
 
8158
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
8183
+ utils$1$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
8159
8184
  /*eslint func-names:0*/
8160
8185
 
8161
8186
  function generateHTTPMethod(isForm) {
@@ -8331,7 +8356,7 @@ function spread$1(callback) {
8331
8356
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
8332
8357
  */
8333
8358
  function isAxiosError$1(payload) {
8334
- return utils$1.isObject(payload) && (payload.isAxiosError === true);
8359
+ return utils$1$1.isObject(payload) && (payload.isAxiosError === true);
8335
8360
  }
8336
8361
 
8337
8362
  const HttpStatusCode$2 = {
@@ -8418,10 +8443,10 @@ function createInstance$1(defaultConfig) {
8418
8443
  const instance = bind$1(Axios$1$1.prototype.request, context);
8419
8444
 
8420
8445
  // Copy axios.prototype to instance
8421
- utils$1.extend(instance, Axios$1$1.prototype, context, {allOwnKeys: true});
8446
+ utils$1$1.extend(instance, Axios$1$1.prototype, context, {allOwnKeys: true});
8422
8447
 
8423
8448
  // Copy context to instance
8424
- utils$1.extend(instance, context, null, {allOwnKeys: true});
8449
+ utils$1$1.extend(instance, context, null, {allOwnKeys: true});
8425
8450
 
8426
8451
  // Factory for creating new instances
8427
8452
  instance.create = function create(instanceConfig) {
@@ -8465,7 +8490,9 @@ axios$2.mergeConfig = mergeConfig$1;
8465
8490
 
8466
8491
  axios$2.AxiosHeaders = AxiosHeaders$1$1;
8467
8492
 
8468
- axios$2.formToJSON = thing => formDataToJSON$1(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
8493
+ axios$2.formToJSON = thing => formDataToJSON$1(utils$1$1.isHTMLForm(thing) ? new FormData(thing) : thing);
8494
+
8495
+ axios$2.getAdapter = adapters$1.getAdapter;
8469
8496
 
8470
8497
  axios$2.HttpStatusCode = HttpStatusCode$1$1;
8471
8498
 
@@ -10584,7 +10611,7 @@ class PassportConfiguration {
10584
10611
  this.magicProviderId = 'fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=';
10585
10612
  this.passportDomain = 'https://passport.immutable.com';
10586
10613
  this.imxPublicApiDomain = 'https://api.immutable.com';
10587
- this.zkEvmRpcUrl = ''; // TODO: ID-785 Update once mainnet has been deployed
10614
+ this.zkEvmRpcUrl = 'https://rpc.immutable.com';
10588
10615
  this.relayerUrl = 'https://api.immutable.com/relayer-mr';
10589
10616
  this.multiRollupConfig = multiRollupConfig.getProduction();
10590
10617
  break;
@@ -14826,8 +14853,9 @@ const reduceDescriptors = (obj, reducer) => {
14826
14853
  const reducedDescriptors = {};
14827
14854
 
14828
14855
  forEach(descriptors, (descriptor, name) => {
14829
- if (reducer(descriptor, name, obj) !== false) {
14830
- reducedDescriptors[name] = descriptor;
14856
+ let ret;
14857
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
14858
+ reducedDescriptors[name] = ret || descriptor;
14831
14859
  }
14832
14860
  });
14833
14861
 
@@ -14953,7 +14981,7 @@ const isAsyncFn = kindOfTest('AsyncFunction');
14953
14981
  const isThenable = (thing) =>
14954
14982
  thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
14955
14983
 
14956
- var utils = {
14984
+ var utils$1 = {
14957
14985
  isArray,
14958
14986
  isArrayBuffer,
14959
14987
  isBuffer,
@@ -15035,7 +15063,7 @@ function AxiosError(message, code, config, request, response) {
15035
15063
  response && (this.response = response);
15036
15064
  }
15037
15065
 
15038
- utils.inherits(AxiosError, Error, {
15066
+ utils$1.inherits(AxiosError, Error, {
15039
15067
  toJSON: function toJSON() {
15040
15068
  return {
15041
15069
  // Standard
@@ -15050,7 +15078,7 @@ utils.inherits(AxiosError, Error, {
15050
15078
  columnNumber: this.columnNumber,
15051
15079
  stack: this.stack,
15052
15080
  // Axios
15053
- config: utils.toJSONObject(this.config),
15081
+ config: utils$1.toJSONObject(this.config),
15054
15082
  code: this.code,
15055
15083
  status: this.response && this.response.status ? this.response.status : null
15056
15084
  };
@@ -15085,7 +15113,7 @@ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
15085
15113
  AxiosError.from = (error, code, config, request, response, customProps) => {
15086
15114
  const axiosError = Object.create(prototype$1);
15087
15115
 
15088
- utils.toFlatObject(error, axiosError, function filter(obj) {
15116
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
15089
15117
  return obj !== Error.prototype;
15090
15118
  }, prop => {
15091
15119
  return prop !== 'isAxiosError';
@@ -15113,7 +15141,7 @@ var httpAdapter = null;
15113
15141
  * @returns {boolean}
15114
15142
  */
15115
15143
  function isVisitable(thing) {
15116
- return utils.isPlainObject(thing) || utils.isArray(thing);
15144
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
15117
15145
  }
15118
15146
 
15119
15147
  /**
@@ -15124,7 +15152,7 @@ function isVisitable(thing) {
15124
15152
  * @returns {string} the key without the brackets.
15125
15153
  */
15126
15154
  function removeBrackets(key) {
15127
- return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
15155
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
15128
15156
  }
15129
15157
 
15130
15158
  /**
@@ -15153,10 +15181,10 @@ function renderKey(path, key, dots) {
15153
15181
  * @returns {boolean}
15154
15182
  */
15155
15183
  function isFlatArray(arr) {
15156
- return utils.isArray(arr) && !arr.some(isVisitable);
15184
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
15157
15185
  }
15158
15186
 
15159
- const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
15187
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
15160
15188
  return /^is[A-Z]/.test(prop);
15161
15189
  });
15162
15190
 
@@ -15184,7 +15212,7 @@ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
15184
15212
  * @returns
15185
15213
  */
15186
15214
  function toFormData(obj, formData, options) {
15187
- if (!utils.isObject(obj)) {
15215
+ if (!utils$1.isObject(obj)) {
15188
15216
  throw new TypeError('target must be an object');
15189
15217
  }
15190
15218
 
@@ -15192,13 +15220,13 @@ function toFormData(obj, formData, options) {
15192
15220
  formData = formData || new (FormData)();
15193
15221
 
15194
15222
  // eslint-disable-next-line no-param-reassign
15195
- options = utils.toFlatObject(options, {
15223
+ options = utils$1.toFlatObject(options, {
15196
15224
  metaTokens: true,
15197
15225
  dots: false,
15198
15226
  indexes: false
15199
15227
  }, false, function defined(option, source) {
15200
15228
  // eslint-disable-next-line no-eq-null,eqeqeq
15201
- return !utils.isUndefined(source[option]);
15229
+ return !utils$1.isUndefined(source[option]);
15202
15230
  });
15203
15231
 
15204
15232
  const metaTokens = options.metaTokens;
@@ -15207,24 +15235,24 @@ function toFormData(obj, formData, options) {
15207
15235
  const dots = options.dots;
15208
15236
  const indexes = options.indexes;
15209
15237
  const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
15210
- const useBlob = _Blob && utils.isSpecCompliantForm(formData);
15238
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
15211
15239
 
15212
- if (!utils.isFunction(visitor)) {
15240
+ if (!utils$1.isFunction(visitor)) {
15213
15241
  throw new TypeError('visitor must be a function');
15214
15242
  }
15215
15243
 
15216
15244
  function convertValue(value) {
15217
15245
  if (value === null) return '';
15218
15246
 
15219
- if (utils.isDate(value)) {
15247
+ if (utils$1.isDate(value)) {
15220
15248
  return value.toISOString();
15221
15249
  }
15222
15250
 
15223
- if (!useBlob && utils.isBlob(value)) {
15251
+ if (!useBlob && utils$1.isBlob(value)) {
15224
15252
  throw new AxiosError('Blob is not supported. Use a Buffer instead.');
15225
15253
  }
15226
15254
 
15227
- if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
15255
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
15228
15256
  return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
15229
15257
  }
15230
15258
 
@@ -15245,20 +15273,20 @@ function toFormData(obj, formData, options) {
15245
15273
  let arr = value;
15246
15274
 
15247
15275
  if (value && !path && typeof value === 'object') {
15248
- if (utils.endsWith(key, '{}')) {
15276
+ if (utils$1.endsWith(key, '{}')) {
15249
15277
  // eslint-disable-next-line no-param-reassign
15250
15278
  key = metaTokens ? key : key.slice(0, -2);
15251
15279
  // eslint-disable-next-line no-param-reassign
15252
15280
  value = JSON.stringify(value);
15253
15281
  } else if (
15254
- (utils.isArray(value) && isFlatArray(value)) ||
15255
- ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
15282
+ (utils$1.isArray(value) && isFlatArray(value)) ||
15283
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
15256
15284
  )) {
15257
15285
  // eslint-disable-next-line no-param-reassign
15258
15286
  key = removeBrackets(key);
15259
15287
 
15260
15288
  arr.forEach(function each(el, index) {
15261
- !(utils.isUndefined(el) || el === null) && formData.append(
15289
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
15262
15290
  // eslint-disable-next-line no-nested-ternary
15263
15291
  indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
15264
15292
  convertValue(el)
@@ -15286,7 +15314,7 @@ function toFormData(obj, formData, options) {
15286
15314
  });
15287
15315
 
15288
15316
  function build(value, path) {
15289
- if (utils.isUndefined(value)) return;
15317
+ if (utils$1.isUndefined(value)) return;
15290
15318
 
15291
15319
  if (stack.indexOf(value) !== -1) {
15292
15320
  throw Error('Circular reference detected in ' + path.join('.'));
@@ -15294,9 +15322,9 @@ function toFormData(obj, formData, options) {
15294
15322
 
15295
15323
  stack.push(value);
15296
15324
 
15297
- utils.forEach(value, function each(el, key) {
15298
- const result = !(utils.isUndefined(el) || el === null) && visitor.call(
15299
- formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
15325
+ utils$1.forEach(value, function each(el, key) {
15326
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
15327
+ formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
15300
15328
  );
15301
15329
 
15302
15330
  if (result === true) {
@@ -15307,7 +15335,7 @@ function toFormData(obj, formData, options) {
15307
15335
  stack.pop();
15308
15336
  }
15309
15337
 
15310
- if (!utils.isObject(obj)) {
15338
+ if (!utils$1.isObject(obj)) {
15311
15339
  throw new TypeError('data must be an object');
15312
15340
  }
15313
15341
 
@@ -15411,7 +15439,7 @@ function buildURL(url, params, options) {
15411
15439
  if (serializeFn) {
15412
15440
  serializedParams = serializeFn(params, options);
15413
15441
  } else {
15414
- serializedParams = utils.isURLSearchParams(params) ?
15442
+ serializedParams = utils$1.isURLSearchParams(params) ?
15415
15443
  params.toString() :
15416
15444
  new AxiosURLSearchParams(params, options).toString(_encode);
15417
15445
  }
@@ -15486,7 +15514,7 @@ class InterceptorManager {
15486
15514
  * @returns {void}
15487
15515
  */
15488
15516
  forEach(fn) {
15489
- utils.forEach(this.handlers, function forEachHandler(h) {
15517
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
15490
15518
  if (h !== null) {
15491
15519
  fn(h);
15492
15520
  }
@@ -15508,6 +15536,18 @@ var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
15508
15536
 
15509
15537
  var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
15510
15538
 
15539
+ var platform$1 = {
15540
+ isBrowser: true,
15541
+ classes: {
15542
+ URLSearchParams: URLSearchParams$1,
15543
+ FormData: FormData$1,
15544
+ Blob: Blob$1
15545
+ },
15546
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
15547
+ };
15548
+
15549
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
15550
+
15511
15551
  /**
15512
15552
  * Determine if we're running in a standard browser environment
15513
15553
  *
@@ -15525,18 +15565,10 @@ var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
15525
15565
  *
15526
15566
  * @returns {boolean}
15527
15567
  */
15528
- const isStandardBrowserEnv = (() => {
15529
- let product;
15530
- if (typeof navigator !== 'undefined' && (
15531
- (product = navigator.product) === 'ReactNative' ||
15532
- product === 'NativeScript' ||
15533
- product === 'NS')
15534
- ) {
15535
- return false;
15536
- }
15537
-
15538
- return typeof window !== 'undefined' && typeof document !== 'undefined';
15539
- })();
15568
+ const hasStandardBrowserEnv = (
15569
+ (product) => {
15570
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
15571
+ })(typeof navigator !== 'undefined' && navigator.product);
15540
15572
 
15541
15573
  /**
15542
15574
  * Determine if we're running in a standard browser webWorker environment
@@ -15547,7 +15579,7 @@ const isStandardBrowserEnv = (() => {
15547
15579
  * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
15548
15580
  * This leads to a problem when axios post `FormData` in webWorker
15549
15581
  */
15550
- const isStandardBrowserWebWorkerEnv = (() => {
15582
+ const hasStandardBrowserWebWorkerEnv = (() => {
15551
15583
  return (
15552
15584
  typeof WorkerGlobalScope !== 'undefined' &&
15553
15585
  // eslint-disable-next-line no-undef
@@ -15556,23 +15588,22 @@ const isStandardBrowserEnv = (() => {
15556
15588
  );
15557
15589
  })();
15558
15590
 
15591
+ var utils = /*#__PURE__*/Object.freeze({
15592
+ __proto__: null,
15593
+ hasBrowserEnv: hasBrowserEnv,
15594
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
15595
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv
15596
+ });
15559
15597
 
15560
15598
  var platform = {
15561
- isBrowser: true,
15562
- classes: {
15563
- URLSearchParams: URLSearchParams$1,
15564
- FormData: FormData$1,
15565
- Blob: Blob$1
15566
- },
15567
- isStandardBrowserEnv,
15568
- isStandardBrowserWebWorkerEnv,
15569
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
15599
+ ...utils,
15600
+ ...platform$1
15570
15601
  };
15571
15602
 
15572
15603
  function toURLEncodedForm(data, options) {
15573
15604
  return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
15574
15605
  visitor: function(value, key, path, helpers) {
15575
- if (platform.isNode && utils.isBuffer(value)) {
15606
+ if (platform.isNode && utils$1.isBuffer(value)) {
15576
15607
  this.append(key, value.toString('base64'));
15577
15608
  return false;
15578
15609
  }
@@ -15594,7 +15625,7 @@ function parsePropPath(name) {
15594
15625
  // foo.x.y.z
15595
15626
  // foo-x-y-z
15596
15627
  // foo x y z
15597
- return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
15628
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
15598
15629
  return match[0] === '[]' ? '' : match[1] || match[0];
15599
15630
  });
15600
15631
  }
@@ -15629,12 +15660,15 @@ function arrayToObject(arr) {
15629
15660
  function formDataToJSON(formData) {
15630
15661
  function buildPath(path, value, target, index) {
15631
15662
  let name = path[index++];
15663
+
15664
+ if (name === '__proto__') return true;
15665
+
15632
15666
  const isNumericKey = Number.isFinite(+name);
15633
15667
  const isLast = index >= path.length;
15634
- name = !name && utils.isArray(target) ? target.length : name;
15668
+ name = !name && utils$1.isArray(target) ? target.length : name;
15635
15669
 
15636
15670
  if (isLast) {
15637
- if (utils.hasOwnProp(target, name)) {
15671
+ if (utils$1.hasOwnProp(target, name)) {
15638
15672
  target[name] = [target[name], value];
15639
15673
  } else {
15640
15674
  target[name] = value;
@@ -15643,23 +15677,23 @@ function formDataToJSON(formData) {
15643
15677
  return !isNumericKey;
15644
15678
  }
15645
15679
 
15646
- if (!target[name] || !utils.isObject(target[name])) {
15680
+ if (!target[name] || !utils$1.isObject(target[name])) {
15647
15681
  target[name] = [];
15648
15682
  }
15649
15683
 
15650
15684
  const result = buildPath(path, value, target[name], index);
15651
15685
 
15652
- if (result && utils.isArray(target[name])) {
15686
+ if (result && utils$1.isArray(target[name])) {
15653
15687
  target[name] = arrayToObject(target[name]);
15654
15688
  }
15655
15689
 
15656
15690
  return !isNumericKey;
15657
15691
  }
15658
15692
 
15659
- if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
15693
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
15660
15694
  const obj = {};
15661
15695
 
15662
- utils.forEachEntry(formData, (name, value) => {
15696
+ utils$1.forEachEntry(formData, (name, value) => {
15663
15697
  buildPath(parsePropPath(name), value, obj, 0);
15664
15698
  });
15665
15699
 
@@ -15669,10 +15703,6 @@ function formDataToJSON(formData) {
15669
15703
  return null;
15670
15704
  }
15671
15705
 
15672
- const DEFAULT_CONTENT_TYPE = {
15673
- 'Content-Type': undefined
15674
- };
15675
-
15676
15706
  /**
15677
15707
  * It takes a string, tries to parse it, and if it fails, it returns the stringified version
15678
15708
  * of the input
@@ -15684,10 +15714,10 @@ const DEFAULT_CONTENT_TYPE = {
15684
15714
  * @returns {string} A stringified version of the rawValue.
15685
15715
  */
15686
15716
  function stringifySafely(rawValue, parser, encoder) {
15687
- if (utils.isString(rawValue)) {
15717
+ if (utils$1.isString(rawValue)) {
15688
15718
  try {
15689
15719
  (parser || JSON.parse)(rawValue);
15690
- return utils.trim(rawValue);
15720
+ return utils$1.trim(rawValue);
15691
15721
  } catch (e) {
15692
15722
  if (e.name !== 'SyntaxError') {
15693
15723
  throw e;
@@ -15707,13 +15737,13 @@ const defaults = {
15707
15737
  transformRequest: [function transformRequest(data, headers) {
15708
15738
  const contentType = headers.getContentType() || '';
15709
15739
  const hasJSONContentType = contentType.indexOf('application/json') > -1;
15710
- const isObjectPayload = utils.isObject(data);
15740
+ const isObjectPayload = utils$1.isObject(data);
15711
15741
 
15712
- if (isObjectPayload && utils.isHTMLForm(data)) {
15742
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
15713
15743
  data = new FormData(data);
15714
15744
  }
15715
15745
 
15716
- const isFormData = utils.isFormData(data);
15746
+ const isFormData = utils$1.isFormData(data);
15717
15747
 
15718
15748
  if (isFormData) {
15719
15749
  if (!hasJSONContentType) {
@@ -15722,18 +15752,18 @@ const defaults = {
15722
15752
  return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
15723
15753
  }
15724
15754
 
15725
- if (utils.isArrayBuffer(data) ||
15726
- utils.isBuffer(data) ||
15727
- utils.isStream(data) ||
15728
- utils.isFile(data) ||
15729
- utils.isBlob(data)
15755
+ if (utils$1.isArrayBuffer(data) ||
15756
+ utils$1.isBuffer(data) ||
15757
+ utils$1.isStream(data) ||
15758
+ utils$1.isFile(data) ||
15759
+ utils$1.isBlob(data)
15730
15760
  ) {
15731
15761
  return data;
15732
15762
  }
15733
- if (utils.isArrayBufferView(data)) {
15763
+ if (utils$1.isArrayBufferView(data)) {
15734
15764
  return data.buffer;
15735
15765
  }
15736
- if (utils.isURLSearchParams(data)) {
15766
+ if (utils$1.isURLSearchParams(data)) {
15737
15767
  headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
15738
15768
  return data.toString();
15739
15769
  }
@@ -15745,7 +15775,7 @@ const defaults = {
15745
15775
  return toURLEncodedForm(data, this.formSerializer).toString();
15746
15776
  }
15747
15777
 
15748
- if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
15778
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
15749
15779
  const _FormData = this.env && this.env.FormData;
15750
15780
 
15751
15781
  return toFormData(
@@ -15769,7 +15799,7 @@ const defaults = {
15769
15799
  const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
15770
15800
  const JSONRequested = this.responseType === 'json';
15771
15801
 
15772
- if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
15802
+ if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
15773
15803
  const silentJSONParsing = transitional && transitional.silentJSONParsing;
15774
15804
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
15775
15805
 
@@ -15811,24 +15841,21 @@ const defaults = {
15811
15841
 
15812
15842
  headers: {
15813
15843
  common: {
15814
- 'Accept': 'application/json, text/plain, */*'
15844
+ 'Accept': 'application/json, text/plain, */*',
15845
+ 'Content-Type': undefined
15815
15846
  }
15816
15847
  }
15817
15848
  };
15818
15849
 
15819
- utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
15850
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
15820
15851
  defaults.headers[method] = {};
15821
15852
  });
15822
15853
 
15823
- utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
15824
- defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
15825
- });
15826
-
15827
15854
  var defaults$1 = defaults;
15828
15855
 
15829
15856
  // RawAxiosHeaders whose duplicates are ignored by node
15830
15857
  // c.f. https://nodejs.org/api/http.html#http_message_headers
15831
- const ignoreDuplicateOf = utils.toObjectSet([
15858
+ const ignoreDuplicateOf = utils$1.toObjectSet([
15832
15859
  'age', 'authorization', 'content-length', 'content-type', 'etag',
15833
15860
  'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
15834
15861
  'last-modified', 'location', 'max-forwards', 'proxy-authorization',
@@ -15889,7 +15916,7 @@ function normalizeValue(value) {
15889
15916
  return value;
15890
15917
  }
15891
15918
 
15892
- return utils.isArray(value) ? value.map(normalizeValue) : String(value);
15919
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
15893
15920
  }
15894
15921
 
15895
15922
  function parseTokens(str) {
@@ -15907,7 +15934,7 @@ function parseTokens(str) {
15907
15934
  const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
15908
15935
 
15909
15936
  function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
15910
- if (utils.isFunction(filter)) {
15937
+ if (utils$1.isFunction(filter)) {
15911
15938
  return filter.call(this, value, header);
15912
15939
  }
15913
15940
 
@@ -15915,13 +15942,13 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
15915
15942
  value = header;
15916
15943
  }
15917
15944
 
15918
- if (!utils.isString(value)) return;
15945
+ if (!utils$1.isString(value)) return;
15919
15946
 
15920
- if (utils.isString(filter)) {
15947
+ if (utils$1.isString(filter)) {
15921
15948
  return value.indexOf(filter) !== -1;
15922
15949
  }
15923
15950
 
15924
- if (utils.isRegExp(filter)) {
15951
+ if (utils$1.isRegExp(filter)) {
15925
15952
  return filter.test(value);
15926
15953
  }
15927
15954
  }
@@ -15934,7 +15961,7 @@ function formatHeader(header) {
15934
15961
  }
15935
15962
 
15936
15963
  function buildAccessors(obj, header) {
15937
- const accessorName = utils.toCamelCase(' ' + header);
15964
+ const accessorName = utils$1.toCamelCase(' ' + header);
15938
15965
 
15939
15966
  ['get', 'set', 'has'].forEach(methodName => {
15940
15967
  Object.defineProperty(obj, methodName + accessorName, {
@@ -15961,7 +15988,7 @@ class AxiosHeaders {
15961
15988
  throw new Error('header name must be a non-empty string');
15962
15989
  }
15963
15990
 
15964
- const key = utils.findKey(self, lHeader);
15991
+ const key = utils$1.findKey(self, lHeader);
15965
15992
 
15966
15993
  if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
15967
15994
  self[key || _header] = normalizeValue(_value);
@@ -15969,11 +15996,11 @@ class AxiosHeaders {
15969
15996
  }
15970
15997
 
15971
15998
  const setHeaders = (headers, _rewrite) =>
15972
- utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
15999
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
15973
16000
 
15974
- if (utils.isPlainObject(header) || header instanceof this.constructor) {
16001
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
15975
16002
  setHeaders(header, valueOrRewrite);
15976
- } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
16003
+ } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
15977
16004
  setHeaders(parseHeaders(header), valueOrRewrite);
15978
16005
  } else {
15979
16006
  header != null && setHeader(valueOrRewrite, header, rewrite);
@@ -15986,7 +16013,7 @@ class AxiosHeaders {
15986
16013
  header = normalizeHeader(header);
15987
16014
 
15988
16015
  if (header) {
15989
- const key = utils.findKey(this, header);
16016
+ const key = utils$1.findKey(this, header);
15990
16017
 
15991
16018
  if (key) {
15992
16019
  const value = this[key];
@@ -15999,11 +16026,11 @@ class AxiosHeaders {
15999
16026
  return parseTokens(value);
16000
16027
  }
16001
16028
 
16002
- if (utils.isFunction(parser)) {
16029
+ if (utils$1.isFunction(parser)) {
16003
16030
  return parser.call(this, value, key);
16004
16031
  }
16005
16032
 
16006
- if (utils.isRegExp(parser)) {
16033
+ if (utils$1.isRegExp(parser)) {
16007
16034
  return parser.exec(value);
16008
16035
  }
16009
16036
 
@@ -16016,7 +16043,7 @@ class AxiosHeaders {
16016
16043
  header = normalizeHeader(header);
16017
16044
 
16018
16045
  if (header) {
16019
- const key = utils.findKey(this, header);
16046
+ const key = utils$1.findKey(this, header);
16020
16047
 
16021
16048
  return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
16022
16049
  }
@@ -16032,7 +16059,7 @@ class AxiosHeaders {
16032
16059
  _header = normalizeHeader(_header);
16033
16060
 
16034
16061
  if (_header) {
16035
- const key = utils.findKey(self, _header);
16062
+ const key = utils$1.findKey(self, _header);
16036
16063
 
16037
16064
  if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
16038
16065
  delete self[key];
@@ -16042,7 +16069,7 @@ class AxiosHeaders {
16042
16069
  }
16043
16070
  }
16044
16071
 
16045
- if (utils.isArray(header)) {
16072
+ if (utils$1.isArray(header)) {
16046
16073
  header.forEach(deleteHeader);
16047
16074
  } else {
16048
16075
  deleteHeader(header);
@@ -16071,8 +16098,8 @@ class AxiosHeaders {
16071
16098
  const self = this;
16072
16099
  const headers = {};
16073
16100
 
16074
- utils.forEach(this, (value, header) => {
16075
- const key = utils.findKey(headers, header);
16101
+ utils$1.forEach(this, (value, header) => {
16102
+ const key = utils$1.findKey(headers, header);
16076
16103
 
16077
16104
  if (key) {
16078
16105
  self[key] = normalizeValue(value);
@@ -16101,8 +16128,8 @@ class AxiosHeaders {
16101
16128
  toJSON(asStrings) {
16102
16129
  const obj = Object.create(null);
16103
16130
 
16104
- utils.forEach(this, (value, header) => {
16105
- value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
16131
+ utils$1.forEach(this, (value, header) => {
16132
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
16106
16133
  });
16107
16134
 
16108
16135
  return obj;
@@ -16149,7 +16176,7 @@ class AxiosHeaders {
16149
16176
  }
16150
16177
  }
16151
16178
 
16152
- utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
16179
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
16153
16180
 
16154
16181
  return this;
16155
16182
  }
@@ -16157,8 +16184,18 @@ class AxiosHeaders {
16157
16184
 
16158
16185
  AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
16159
16186
 
16160
- utils.freezeMethods(AxiosHeaders.prototype);
16161
- utils.freezeMethods(AxiosHeaders);
16187
+ // reserved names hotfix
16188
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
16189
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
16190
+ return {
16191
+ get: () => value,
16192
+ set(headerValue) {
16193
+ this[mapped] = headerValue;
16194
+ }
16195
+ }
16196
+ });
16197
+
16198
+ utils$1.freezeMethods(AxiosHeaders);
16162
16199
 
16163
16200
  var AxiosHeaders$1 = AxiosHeaders;
16164
16201
 
@@ -16176,7 +16213,7 @@ function transformData(fns, response) {
16176
16213
  const headers = AxiosHeaders$1.from(context.headers);
16177
16214
  let data = context.data;
16178
16215
 
16179
- utils.forEach(fns, function transform(fn) {
16216
+ utils$1.forEach(fns, function transform(fn) {
16180
16217
  data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
16181
16218
  });
16182
16219
 
@@ -16204,7 +16241,7 @@ function CanceledError(message, config, request) {
16204
16241
  this.name = 'CanceledError';
16205
16242
  }
16206
16243
 
16207
- utils.inherits(CanceledError, AxiosError, {
16244
+ utils$1.inherits(CanceledError, AxiosError, {
16208
16245
  __CANCEL__: true
16209
16246
  });
16210
16247
 
@@ -16232,53 +16269,44 @@ function settle(resolve, reject, response) {
16232
16269
  }
16233
16270
  }
16234
16271
 
16235
- var cookies = platform.isStandardBrowserEnv ?
16272
+ var cookies = platform.hasStandardBrowserEnv ?
16236
16273
 
16237
- // Standard browser envs support document.cookie
16238
- (function standardBrowserEnv() {
16239
- return {
16240
- write: function write(name, value, expires, path, domain, secure) {
16241
- const cookie = [];
16242
- cookie.push(name + '=' + encodeURIComponent(value));
16274
+ // Standard browser envs support document.cookie
16275
+ {
16276
+ write(name, value, expires, path, domain, secure) {
16277
+ const cookie = [name + '=' + encodeURIComponent(value)];
16243
16278
 
16244
- if (utils.isNumber(expires)) {
16245
- cookie.push('expires=' + new Date(expires).toGMTString());
16246
- }
16279
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
16247
16280
 
16248
- if (utils.isString(path)) {
16249
- cookie.push('path=' + path);
16250
- }
16281
+ utils$1.isString(path) && cookie.push('path=' + path);
16251
16282
 
16252
- if (utils.isString(domain)) {
16253
- cookie.push('domain=' + domain);
16254
- }
16283
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
16255
16284
 
16256
- if (secure === true) {
16257
- cookie.push('secure');
16258
- }
16285
+ secure === true && cookie.push('secure');
16259
16286
 
16260
- document.cookie = cookie.join('; ');
16261
- },
16287
+ document.cookie = cookie.join('; ');
16288
+ },
16262
16289
 
16263
- read: function read(name) {
16264
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
16265
- return (match ? decodeURIComponent(match[3]) : null);
16266
- },
16290
+ read(name) {
16291
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
16292
+ return (match ? decodeURIComponent(match[3]) : null);
16293
+ },
16267
16294
 
16268
- remove: function remove(name) {
16269
- this.write(name, '', Date.now() - 86400000);
16270
- }
16271
- };
16272
- })() :
16295
+ remove(name) {
16296
+ this.write(name, '', Date.now() - 86400000);
16297
+ }
16298
+ }
16273
16299
 
16274
- // Non standard browser env (web workers, react-native) lack needed support.
16275
- (function nonStandardBrowserEnv() {
16276
- return {
16277
- write: function write() {},
16278
- read: function read() { return null; },
16279
- remove: function remove() {}
16280
- };
16281
- })();
16300
+ :
16301
+
16302
+ // Non-standard browser env (web workers, react-native) lack needed support.
16303
+ {
16304
+ write() {},
16305
+ read() {
16306
+ return null;
16307
+ },
16308
+ remove() {}
16309
+ };
16282
16310
 
16283
16311
  /**
16284
16312
  * Determines whether the specified URL is absolute
@@ -16304,7 +16332,7 @@ function isAbsoluteURL(url) {
16304
16332
  */
16305
16333
  function combineURLs(baseURL, relativeURL) {
16306
16334
  return relativeURL
16307
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
16335
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
16308
16336
  : baseURL;
16309
16337
  }
16310
16338
 
@@ -16325,7 +16353,7 @@ function buildFullPath(baseURL, requestedURL) {
16325
16353
  return requestedURL;
16326
16354
  }
16327
16355
 
16328
- var isURLSameOrigin = platform.isStandardBrowserEnv ?
16356
+ var isURLSameOrigin = platform.hasStandardBrowserEnv ?
16329
16357
 
16330
16358
  // Standard browser envs have full support of the APIs needed to test
16331
16359
  // whether the request URL is of the same origin as current location.
@@ -16335,7 +16363,7 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
16335
16363
  let originURL;
16336
16364
 
16337
16365
  /**
16338
- * Parse a URL to discover it's components
16366
+ * Parse a URL to discover its components
16339
16367
  *
16340
16368
  * @param {String} url The URL to be parsed
16341
16369
  * @returns {Object}
@@ -16375,7 +16403,7 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
16375
16403
  * @returns {boolean} True if URL shares the same origin, otherwise false
16376
16404
  */
16377
16405
  return function isURLSameOrigin(requestURL) {
16378
- const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
16406
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
16379
16407
  return (parsed.protocol === originURL.protocol &&
16380
16408
  parsed.host === originURL.host);
16381
16409
  };
@@ -16480,7 +16508,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16480
16508
  return new Promise(function dispatchXhrRequest(resolve, reject) {
16481
16509
  let requestData = config.data;
16482
16510
  const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
16483
- const responseType = config.responseType;
16511
+ let {responseType, withXSRFToken} = config;
16484
16512
  let onCanceled;
16485
16513
  function done() {
16486
16514
  if (config.cancelToken) {
@@ -16492,11 +16520,15 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16492
16520
  }
16493
16521
  }
16494
16522
 
16495
- if (utils.isFormData(requestData)) {
16496
- if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
16523
+ let contentType;
16524
+
16525
+ if (utils$1.isFormData(requestData)) {
16526
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
16497
16527
  requestHeaders.setContentType(false); // Let the browser set it
16498
- } else {
16499
- requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
16528
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
16529
+ // fix semicolon duplication issue for ReactNative FormData implementation
16530
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
16531
+ requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
16500
16532
  }
16501
16533
  }
16502
16534
 
@@ -16612,13 +16644,16 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16612
16644
  // Add xsrf header
16613
16645
  // This is only done if running in a standard browser environment.
16614
16646
  // Specifically not if we're in a web worker, or react-native.
16615
- if (platform.isStandardBrowserEnv) {
16616
- // Add xsrf header
16617
- const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))
16618
- && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
16647
+ if(platform.hasStandardBrowserEnv) {
16648
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
16619
16649
 
16620
- if (xsrfValue) {
16621
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
16650
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
16651
+ // Add xsrf header
16652
+ const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
16653
+
16654
+ if (xsrfValue) {
16655
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
16656
+ }
16622
16657
  }
16623
16658
  }
16624
16659
 
@@ -16627,13 +16662,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16627
16662
 
16628
16663
  // Add headers to the request
16629
16664
  if ('setRequestHeader' in request) {
16630
- utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
16665
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
16631
16666
  request.setRequestHeader(key, val);
16632
16667
  });
16633
16668
  }
16634
16669
 
16635
16670
  // Add withCredentials to request if needed
16636
- if (!utils.isUndefined(config.withCredentials)) {
16671
+ if (!utils$1.isUndefined(config.withCredentials)) {
16637
16672
  request.withCredentials = !!config.withCredentials;
16638
16673
  }
16639
16674
 
@@ -16688,8 +16723,8 @@ const knownAdapters = {
16688
16723
  xhr: xhrAdapter
16689
16724
  };
16690
16725
 
16691
- utils.forEach(knownAdapters, (fn, value) => {
16692
- if(fn) {
16726
+ utils$1.forEach(knownAdapters, (fn, value) => {
16727
+ if (fn) {
16693
16728
  try {
16694
16729
  Object.defineProperty(fn, 'name', {value});
16695
16730
  } catch (e) {
@@ -16699,38 +16734,56 @@ utils.forEach(knownAdapters, (fn, value) => {
16699
16734
  }
16700
16735
  });
16701
16736
 
16737
+ const renderReason = (reason) => `- ${reason}`;
16738
+
16739
+ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
16740
+
16702
16741
  var adapters = {
16703
16742
  getAdapter: (adapters) => {
16704
- adapters = utils.isArray(adapters) ? adapters : [adapters];
16743
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
16705
16744
 
16706
16745
  const {length} = adapters;
16707
16746
  let nameOrAdapter;
16708
16747
  let adapter;
16709
16748
 
16749
+ const rejectedReasons = {};
16750
+
16710
16751
  for (let i = 0; i < length; i++) {
16711
16752
  nameOrAdapter = adapters[i];
16712
- if((adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) {
16753
+ let id;
16754
+
16755
+ adapter = nameOrAdapter;
16756
+
16757
+ if (!isResolvedHandle(nameOrAdapter)) {
16758
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
16759
+
16760
+ if (adapter === undefined) {
16761
+ throw new AxiosError(`Unknown adapter '${id}'`);
16762
+ }
16763
+ }
16764
+
16765
+ if (adapter) {
16713
16766
  break;
16714
16767
  }
16768
+
16769
+ rejectedReasons[id || '#' + i] = adapter;
16715
16770
  }
16716
16771
 
16717
16772
  if (!adapter) {
16718
- if (adapter === false) {
16719
- throw new AxiosError(
16720
- `Adapter ${nameOrAdapter} is not supported by the environment`,
16721
- 'ERR_NOT_SUPPORT'
16773
+
16774
+ const reasons = Object.entries(rejectedReasons)
16775
+ .map(([id, state]) => `adapter ${id} ` +
16776
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
16722
16777
  );
16723
- }
16724
16778
 
16725
- throw new Error(
16726
- utils.hasOwnProp(knownAdapters, nameOrAdapter) ?
16727
- `Adapter '${nameOrAdapter}' is not available in the build` :
16728
- `Unknown adapter '${nameOrAdapter}'`
16729
- );
16730
- }
16779
+ let s = length ?
16780
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
16781
+ 'as no adapter specified';
16731
16782
 
16732
- if (!utils.isFunction(adapter)) {
16733
- throw new TypeError('adapter is not a function');
16783
+ throw new AxiosError(
16784
+ `There is no suitable adapter to dispatch the request ` + s,
16785
+ 'ERR_NOT_SUPPORT'
16786
+ );
16734
16787
  }
16735
16788
 
16736
16789
  return adapter;
@@ -16828,11 +16881,11 @@ function mergeConfig(config1, config2) {
16828
16881
  const config = {};
16829
16882
 
16830
16883
  function getMergedValue(target, source, caseless) {
16831
- if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
16832
- return utils.merge.call({caseless}, target, source);
16833
- } else if (utils.isPlainObject(source)) {
16834
- return utils.merge({}, source);
16835
- } else if (utils.isArray(source)) {
16884
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
16885
+ return utils$1.merge.call({caseless}, target, source);
16886
+ } else if (utils$1.isPlainObject(source)) {
16887
+ return utils$1.merge({}, source);
16888
+ } else if (utils$1.isArray(source)) {
16836
16889
  return source.slice();
16837
16890
  }
16838
16891
  return source;
@@ -16840,25 +16893,25 @@ function mergeConfig(config1, config2) {
16840
16893
 
16841
16894
  // eslint-disable-next-line consistent-return
16842
16895
  function mergeDeepProperties(a, b, caseless) {
16843
- if (!utils.isUndefined(b)) {
16896
+ if (!utils$1.isUndefined(b)) {
16844
16897
  return getMergedValue(a, b, caseless);
16845
- } else if (!utils.isUndefined(a)) {
16898
+ } else if (!utils$1.isUndefined(a)) {
16846
16899
  return getMergedValue(undefined, a, caseless);
16847
16900
  }
16848
16901
  }
16849
16902
 
16850
16903
  // eslint-disable-next-line consistent-return
16851
16904
  function valueFromConfig2(a, b) {
16852
- if (!utils.isUndefined(b)) {
16905
+ if (!utils$1.isUndefined(b)) {
16853
16906
  return getMergedValue(undefined, b);
16854
16907
  }
16855
16908
  }
16856
16909
 
16857
16910
  // eslint-disable-next-line consistent-return
16858
16911
  function defaultToConfig2(a, b) {
16859
- if (!utils.isUndefined(b)) {
16912
+ if (!utils$1.isUndefined(b)) {
16860
16913
  return getMergedValue(undefined, b);
16861
- } else if (!utils.isUndefined(a)) {
16914
+ } else if (!utils$1.isUndefined(a)) {
16862
16915
  return getMergedValue(undefined, a);
16863
16916
  }
16864
16917
  }
@@ -16883,6 +16936,7 @@ function mergeConfig(config1, config2) {
16883
16936
  timeout: defaultToConfig2,
16884
16937
  timeoutMessage: defaultToConfig2,
16885
16938
  withCredentials: defaultToConfig2,
16939
+ withXSRFToken: defaultToConfig2,
16886
16940
  adapter: defaultToConfig2,
16887
16941
  responseType: defaultToConfig2,
16888
16942
  xsrfCookieName: defaultToConfig2,
@@ -16903,16 +16957,16 @@ function mergeConfig(config1, config2) {
16903
16957
  headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
16904
16958
  };
16905
16959
 
16906
- utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
16960
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
16907
16961
  const merge = mergeMap[prop] || mergeDeepProperties;
16908
16962
  const configValue = merge(config1[prop], config2[prop], prop);
16909
- (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
16963
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
16910
16964
  });
16911
16965
 
16912
16966
  return config;
16913
16967
  }
16914
16968
 
16915
- const VERSION = "1.4.0";
16969
+ const VERSION = "1.6.5";
16916
16970
 
16917
16971
  const validators$1 = {};
16918
16972
 
@@ -17050,7 +17104,7 @@ class Axios {
17050
17104
  }
17051
17105
 
17052
17106
  if (paramsSerializer != null) {
17053
- if (utils.isFunction(paramsSerializer)) {
17107
+ if (utils$1.isFunction(paramsSerializer)) {
17054
17108
  config.paramsSerializer = {
17055
17109
  serialize: paramsSerializer
17056
17110
  };
@@ -17065,15 +17119,13 @@ class Axios {
17065
17119
  // Set config.method
17066
17120
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
17067
17121
 
17068
- let contextHeaders;
17069
-
17070
17122
  // Flatten headers
17071
- contextHeaders = headers && utils.merge(
17123
+ let contextHeaders = headers && utils$1.merge(
17072
17124
  headers.common,
17073
17125
  headers[config.method]
17074
17126
  );
17075
17127
 
17076
- contextHeaders && utils.forEach(
17128
+ headers && utils$1.forEach(
17077
17129
  ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
17078
17130
  (method) => {
17079
17131
  delete headers[method];
@@ -17160,7 +17212,7 @@ class Axios {
17160
17212
  }
17161
17213
 
17162
17214
  // Provide aliases for supported request methods
17163
- utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
17215
+ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
17164
17216
  /*eslint func-names:0*/
17165
17217
  Axios.prototype[method] = function(url, config) {
17166
17218
  return this.request(mergeConfig(config || {}, {
@@ -17171,7 +17223,7 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
17171
17223
  };
17172
17224
  });
17173
17225
 
17174
- utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
17226
+ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
17175
17227
  /*eslint func-names:0*/
17176
17228
 
17177
17229
  function generateHTTPMethod(isForm) {
@@ -17347,7 +17399,7 @@ function spread(callback) {
17347
17399
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
17348
17400
  */
17349
17401
  function isAxiosError(payload) {
17350
- return utils.isObject(payload) && (payload.isAxiosError === true);
17402
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
17351
17403
  }
17352
17404
 
17353
17405
  const HttpStatusCode = {
@@ -17434,10 +17486,10 @@ function createInstance(defaultConfig) {
17434
17486
  const instance = bind(Axios$1.prototype.request, context);
17435
17487
 
17436
17488
  // Copy axios.prototype to instance
17437
- utils.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
17489
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
17438
17490
 
17439
17491
  // Copy context to instance
17440
- utils.extend(instance, context, null, {allOwnKeys: true});
17492
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
17441
17493
 
17442
17494
  // Factory for creating new instances
17443
17495
  instance.create = function create(instanceConfig) {
@@ -17481,7 +17533,9 @@ axios.mergeConfig = mergeConfig;
17481
17533
 
17482
17534
  axios.AxiosHeaders = AxiosHeaders$1;
17483
17535
 
17484
- axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
17536
+ axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
17537
+
17538
+ axios.getAdapter = adapters.getAdapter;
17485
17539
 
17486
17540
  axios.HttpStatusCode = HttpStatusCode$1;
17487
17541
 
@@ -30897,7 +30951,7 @@ const SUPPORTED_SANDBOX_BRIDGES = [ETH_SEPOLIA_TO_ZKEVM_DEVNET, ETH_SEPOLIA_TO_Z
30897
30951
  /**
30898
30952
  * @constant {BridgeInstance[]} SUPPORTED_PRODUCTION_BRIDGES - An array of supported bridge instances for the production environment.
30899
30953
  */
30900
- const SUPPORTED_PRODUCTION_BRIDGES = [];
30954
+ const SUPPORTED_PRODUCTION_BRIDGES = [ETH_MAINNET_TO_ZKEVM_MAINNET];
30901
30955
  /**
30902
30956
  * @constant {Object} SUPPORTED_BRIDGES_FOR_ENVIRONMENT - An object mapping environment types to their supported bridge instances.
30903
30957
  */
@@ -34276,7 +34330,7 @@ const CONTRACTS_FOR_CHAIN_ID = {
34276
34330
  coreFactory: '0xb18c44b211065E69844FbA9AE146DA362104AfBf',
34277
34331
  quoterV2: '0x87854A7D4b9BaC3D37f4516A1Ac7F36fB5ad539f',
34278
34332
  peripheryRouter: '0x786ec643F231960D4C1A4E336990F8E7bF8f1277',
34279
- secondaryFee: '0xCe11A21e7b6B4650C3B6363446fa1aa486A5146A',
34333
+ immutableSwapProxy: '0xDdBDa144cEbe1cCd68E746CDff8a6e4Be51A9e98',
34280
34334
  },
34281
34335
  };
34282
34336
  const SUPPORTED_SANDBOX_CHAINS = {
@@ -34385,7 +34439,7 @@ class Exchange {
34385
34439
  this.nativeTokenService = new NativeTokenService(this.nativeToken, this.wrappedNativeToken);
34386
34440
  this.secondaryFees = config.secondaryFees;
34387
34441
  this.routerContractAddress = config.chain.contracts.peripheryRouter;
34388
- this.swapProxyContractAddress = config.chain.contracts.secondaryFee;
34442
+ this.swapProxyContractAddress = config.chain.contracts.immutableSwapProxy;
34389
34443
  this.provider = new ethers.ethers.providers.StaticJsonRpcProvider({
34390
34444
  url: config.chain.rpcUrl,
34391
34445
  skipFetchSetup: true,
@@ -35428,7 +35482,7 @@ const GAS_OVERRIDES = {
35428
35482
  maxPriorityFeePerGas: ethers.BigNumber.from(101e9),
35429
35483
  };
35430
35484
 
35431
- const SDK_VERSION_MARKER = '0.39.1';
35485
+ const SDK_VERSION_MARKER = '0.39.2-alpha.1';
35432
35486
  // This SDK version is replaced by the `yarn build` command ran on the root level
35433
35487
  const globalPackageVersion = () => SDK_VERSION_MARKER;
35434
35488
 
@@ -35467,7 +35521,13 @@ class RemoteConfigFetcher {
35467
35521
  async loadConfig() {
35468
35522
  if (this.configCache)
35469
35523
  return this.configCache;
35470
- const response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config`);
35524
+ let response;
35525
+ try {
35526
+ response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config`);
35527
+ }
35528
+ catch (err) {
35529
+ throw new CheckoutError(`Error: ${err.message}`, CheckoutErrorType.API_ERROR);
35530
+ }
35471
35531
  // Ensure that the configuration is valid
35472
35532
  this.configCache = this.parseResponse(response);
35473
35533
  return this.configCache;
@@ -35475,7 +35535,13 @@ class RemoteConfigFetcher {
35475
35535
  async loadConfigTokens() {
35476
35536
  if (this.tokensCache)
35477
35537
  return this.tokensCache;
35478
- const response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config/tokens`);
35538
+ let response;
35539
+ try {
35540
+ response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config/tokens`);
35541
+ }
35542
+ catch (err) {
35543
+ throw new CheckoutError(`Error: ${err.message}`, CheckoutErrorType.API_ERROR);
35544
+ }
35479
35545
  // Ensure that the configuration is valid
35480
35546
  this.tokensCache = this.parseResponse(response);
35481
35547
  return this.tokensCache;
@@ -35566,6 +35632,8 @@ class CheckoutConfiguration {
35566
35632
  const getTokenAllowList = async (config, { type = TokenFilterTypes.ALL, chainId, exclude, }) => {
35567
35633
  let tokens = [];
35568
35634
  let onRampConfig;
35635
+ let onBridgeConfig;
35636
+ const targetChainId = chainId ?? getL1ChainId(config);
35569
35637
  switch (type) {
35570
35638
  case TokenFilterTypes.SWAP:
35571
35639
  // Fetch tokens from dex-tokens config because
@@ -35576,16 +35644,19 @@ const getTokenAllowList = async (config, { type = TokenFilterTypes.ALL, chainId,
35576
35644
  break;
35577
35645
  case TokenFilterTypes.ONRAMP:
35578
35646
  onRampConfig = (await config.remote.getConfig('onramp'));
35579
- // Only using Transak as it's the only on-ramp provider at the moment
35580
- if (!onRampConfig) {
35647
+ if (!onRampConfig)
35581
35648
  tokens = [];
35582
- }
35583
35649
  tokens = onRampConfig[OnRampProvider.TRANSAK]?.tokens || [];
35584
35650
  break;
35585
35651
  case TokenFilterTypes.BRIDGE:
35652
+ onBridgeConfig = (await config.remote.getConfig('bridge'));
35653
+ if (!onBridgeConfig)
35654
+ tokens = [];
35655
+ tokens = onBridgeConfig[targetChainId]?.tokens || [];
35656
+ break;
35586
35657
  case TokenFilterTypes.ALL:
35587
35658
  default:
35588
- tokens = (await config.remote.getTokensConfig(chainId || getL1ChainId(config))).allowed;
35659
+ tokens = (await config.remote.getTokensConfig(targetChainId)).allowed;
35589
35660
  }
35590
35661
  if (!exclude || exclude?.length === 0)
35591
35662
  return { tokens };
@@ -35677,13 +35748,7 @@ class Blockscout {
35677
35748
  const cached = this.getCache(url);
35678
35749
  if (cached)
35679
35750
  return Promise.resolve(cached);
35680
- const response = await this.httpClient.get(url);
35681
- if (response.status >= 400) {
35682
- return Promise.reject({
35683
- code: response.status,
35684
- message: response.statusText,
35685
- });
35686
- }
35751
+ const response = await this.httpClient.get(url); // success if 2XX response otherwise throw error
35687
35752
  // To get around an issue with native tokens being an ERC-20, there is the need
35688
35753
  // to remove IMX from `resp` and add it back in using getNativeTokenByWalletAddress.
35689
35754
  // This has affected some of the early wallets, and it might not be an issue in mainnet
@@ -35718,13 +35783,7 @@ class Blockscout {
35718
35783
  const cached = this.getCache(url);
35719
35784
  if (cached)
35720
35785
  return Promise.resolve(cached);
35721
- const response = await this.httpClient.get(url);
35722
- if (response.status >= 400) {
35723
- return Promise.reject({
35724
- code: response.status,
35725
- message: response.statusText,
35726
- });
35727
- }
35786
+ const response = await this.httpClient.get(url); // success if 2XX response otherwise throw error
35728
35787
  const data = {
35729
35788
  token: this.nativeToken,
35730
35789
  value: response.data.coin_balance,
@@ -37443,28 +37502,23 @@ const filterTokens = (allowedTokens, balances) => {
37443
37502
  };
37444
37503
  const allowListCheckForOnRamp = async (config, availableRoutingOptions) => {
37445
37504
  if (availableRoutingOptions.onRamp) {
37446
- const onRampOptions = await config.remote.getConfig('onramp');
37447
- const onRampAllowList = {};
37448
- Object.entries(onRampOptions)
37449
- .forEach(([onRampProvider, onRampProviderConfig]) => {
37450
- // Allowed list per onRamp provider
37451
- onRampAllowList[onRampProvider] = onRampProviderConfig.tokens ?? [];
37452
- });
37453
- return onRampAllowList;
37505
+ const onRampOptions = (await getTokenAllowList(config, { type: TokenFilterTypes.ONRAMP }));
37506
+ return onRampOptions.tokens;
37454
37507
  }
37455
- return {};
37508
+ return [];
37456
37509
  };
37457
37510
  const allowListCheckForBridge = async (config, tokenBalances, availableRoutingOptions) => {
37458
37511
  if (availableRoutingOptions.bridge) {
37459
- const allowedTokens = (await config.remote.getConfig('bridge'))?.tokens ?? [];
37460
- const balances = tokenBalances.get(getL1ChainId(config));
37512
+ const chainId = getL1ChainId(config);
37513
+ const allowedTokens = (await getTokenAllowList(config, { type: TokenFilterTypes.BRIDGE, chainId })).tokens;
37514
+ const balances = tokenBalances.get(chainId);
37461
37515
  return filterTokens(allowedTokens, balances);
37462
37516
  }
37463
37517
  return [];
37464
37518
  };
37465
37519
  const allowListCheckForSwap = async (config, tokenBalances, availableRoutingOptions) => {
37466
37520
  if (availableRoutingOptions.swap) {
37467
- const allowedTokens = (await config.remote.getConfig('dex'))?.tokens ?? [];
37521
+ const allowedTokens = (await getTokenAllowList(config, { type: TokenFilterTypes.SWAP })).tokens;
37468
37522
  const balances = tokenBalances.get(getL2ChainId(config));
37469
37523
  return filterTokens(allowedTokens, balances);
37470
37524
  }
@@ -38022,10 +38076,10 @@ const onRampRoute = async (config, availableRoutingOptions, balanceRequirement)
38022
38076
  return undefined;
38023
38077
  const { required, current, delta } = balanceRequirement;
38024
38078
  let hasAllowList = false;
38025
- const onRampProvidersAllowList = await allowListCheckForOnRamp(config, availableRoutingOptions);
38026
- Object.values(onRampProvidersAllowList).forEach((onRampAllowList) => {
38027
- if (onRampAllowList.length > 0 && !hasAllowList) {
38028
- hasAllowList = !!onRampAllowList.find((token) => token.address === required.token?.address);
38079
+ const onRampAllowList = await allowListCheckForOnRamp(config, availableRoutingOptions);
38080
+ onRampAllowList.forEach((token) => {
38081
+ if (token.address === required.token?.address) {
38082
+ hasAllowList = true;
38029
38083
  }
38030
38084
  });
38031
38085
  if (!hasAllowList)
@@ -38974,22 +39028,8 @@ class HttpClient {
38974
39028
  return config;
38975
39029
  }, (error) => Promise.reject(error));
38976
39030
  }
38977
- // eslint-disable-next-line class-methods-use-this
38978
- processResponse(response) {
38979
- if (response && response?.status !== 200) {
38980
- throw new CheckoutError(`Error: ${response.status} ${response.statusText}`, CheckoutErrorType.API_ERROR);
38981
- }
38982
- }
38983
39031
  async request(config) {
38984
- let response;
38985
- try {
38986
- response = await this.axiosInstance.request(config);
38987
- }
38988
- catch (error) {
38989
- throw new CheckoutError(error.message, CheckoutErrorType.API_ERROR);
38990
- }
38991
- this.processResponse(response);
38992
- return response;
39032
+ return await this.axiosInstance.request(config);
38993
39033
  }
38994
39034
  async get(url, config) {
38995
39035
  const requestConfig = {