@kontent-ai/delivery-sdk 16.4.2 → 16.4.3

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.
@@ -3501,7 +3501,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
3501
3501
  exports.sdkInfo = void 0;
3502
3502
  exports.sdkInfo = {
3503
3503
  host: 'npmjs.com',
3504
- version: '16.4.2',
3504
+ version: '16.4.3',
3505
3505
  name: '@kontent-ai/delivery-sdk'
3506
3506
  };
3507
3507
 
@@ -5270,11 +5270,13 @@ const knownAdapters = {
5270
5270
  _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(knownAdapters, (fn, value) => {
5271
5271
  if (fn) {
5272
5272
  try {
5273
- Object.defineProperty(fn, 'name', { value });
5273
+ // Null-proto descriptors so a polluted Object.prototype.get cannot turn
5274
+ // these data descriptors into accessor descriptors on the way in.
5275
+ Object.defineProperty(fn, 'name', { __proto__: null, value });
5274
5276
  } catch (e) {
5275
5277
  // eslint-disable-next-line no-empty
5276
5278
  }
5277
- Object.defineProperty(fn, 'adapterName', { value });
5279
+ Object.defineProperty(fn, 'adapterName', { __proto__: null, value });
5278
5280
  }
5279
5281
  });
5280
5282
 
@@ -5397,6 +5399,9 @@ __webpack_require__.r(__webpack_exports__);
5397
5399
  /* harmony import */ var _helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/progressEventReducer.js */ "./node_modules/axios/lib/helpers/progressEventReducer.js");
5398
5400
  /* harmony import */ var _helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/resolveConfig.js */ "./node_modules/axios/lib/helpers/resolveConfig.js");
5399
5401
  /* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/settle.js */ "./node_modules/axios/lib/core/settle.js");
5402
+ /* harmony import */ var _helpers_estimateDataURLDecodedBytes_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../helpers/estimateDataURLDecodedBytes.js */ "./node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js");
5403
+ /* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../env/data.js */ "./node_modules/axios/lib/env/data.js");
5404
+ /* harmony import */ var _helpers_sanitizeHeaderValue_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../helpers/sanitizeHeaderValue.js */ "./node_modules/axios/lib/helpers/sanitizeHeaderValue.js");
5400
5405
 
5401
5406
 
5402
5407
 
@@ -5407,16 +5412,12 @@ __webpack_require__.r(__webpack_exports__);
5407
5412
 
5408
5413
 
5409
5414
 
5410
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
5411
5415
 
5412
- const { isFunction } = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"];
5413
5416
 
5414
- const globalFetchAPI = (({ Request, Response }) => ({
5415
- Request,
5416
- Response,
5417
- }))(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].global);
5418
5417
 
5419
- const { ReadableStream, TextEncoder } = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].global;
5418
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
5419
+
5420
+ const { isFunction } = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"];
5420
5421
 
5421
5422
  const test = (fn, ...args) => {
5422
5423
  try {
@@ -5427,11 +5428,20 @@ const test = (fn, ...args) => {
5427
5428
  };
5428
5429
 
5429
5430
  const factory = (env) => {
5431
+ const globalObject =
5432
+ _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].global !== undefined && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].global !== null
5433
+ ? _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].global
5434
+ : globalThis;
5435
+ const { ReadableStream, TextEncoder } = globalObject;
5436
+
5430
5437
  env = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge.call(
5431
5438
  {
5432
5439
  skipUndefined: true,
5433
5440
  },
5434
- globalFetchAPI,
5441
+ {
5442
+ Request: globalObject.Request,
5443
+ Response: globalObject.Response,
5444
+ },
5435
5445
  env
5436
5446
  );
5437
5447
 
@@ -5461,18 +5471,20 @@ const factory = (env) => {
5461
5471
  test(() => {
5462
5472
  let duplexAccessed = false;
5463
5473
 
5464
- const body = new ReadableStream();
5465
-
5466
- const hasContentType = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin, {
5467
- body,
5474
+ const request = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin, {
5475
+ body: new ReadableStream(),
5468
5476
  method: 'POST',
5469
5477
  get duplex() {
5470
5478
  duplexAccessed = true;
5471
5479
  return 'half';
5472
5480
  },
5473
- }).headers.has('Content-Type');
5481
+ });
5474
5482
 
5475
- body.cancel();
5483
+ const hasContentType = request.headers.has('Content-Type');
5484
+
5485
+ if (request.body != null) {
5486
+ request.body.cancel();
5487
+ }
5476
5488
 
5477
5489
  return duplexAccessed && !hasContentType;
5478
5490
  });
@@ -5556,8 +5568,13 @@ const factory = (env) => {
5556
5568
  headers,
5557
5569
  withCredentials = 'same-origin',
5558
5570
  fetchOptions,
5571
+ maxContentLength,
5572
+ maxBodyLength,
5559
5573
  } = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_7__["default"])(config);
5560
5574
 
5575
+ const hasMaxContentLength = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNumber(maxContentLength) && maxContentLength > -1;
5576
+ const hasMaxBodyLength = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNumber(maxBodyLength) && maxBodyLength > -1;
5577
+
5561
5578
  let _fetch = envFetch || fetch;
5562
5579
 
5563
5580
  responseType = responseType ? (responseType + '').toLowerCase() : 'text';
@@ -5579,6 +5596,41 @@ const factory = (env) => {
5579
5596
  let requestContentLength;
5580
5597
 
5581
5598
  try {
5599
+ // Enforce maxContentLength for data: URLs up-front so we never materialize
5600
+ // an oversized payload. The HTTP adapter applies the same check (see http.js
5601
+ // "if (protocol === 'data:')" branch).
5602
+ if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
5603
+ const estimated = (0,_helpers_estimateDataURLDecodedBytes_js__WEBPACK_IMPORTED_MODULE_9__["default"])(url);
5604
+ if (estimated > maxContentLength) {
5605
+ throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"](
5606
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
5607
+ _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_BAD_RESPONSE,
5608
+ config,
5609
+ request
5610
+ );
5611
+ }
5612
+ }
5613
+
5614
+ // Enforce maxBodyLength against the outbound request body before dispatch.
5615
+ // Mirrors http.js behavior (ERR_BAD_REQUEST / 'Request body larger than
5616
+ // maxBodyLength limit'). Skip when the body length cannot be determined
5617
+ // (e.g. a live ReadableStream supplied by the caller).
5618
+ if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
5619
+ const outboundLength = await resolveBodyLength(headers, data);
5620
+ if (
5621
+ typeof outboundLength === 'number' &&
5622
+ isFinite(outboundLength) &&
5623
+ outboundLength > maxBodyLength
5624
+ ) {
5625
+ throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"](
5626
+ 'Request body larger than maxBodyLength limit',
5627
+ _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_BAD_REQUEST,
5628
+ config,
5629
+ request
5630
+ );
5631
+ }
5632
+ }
5633
+
5582
5634
  if (
5583
5635
  onUploadProgress &&
5584
5636
  supportsRequestStream &&
@@ -5616,11 +5668,27 @@ const factory = (env) => {
5616
5668
  // see https://github.com/cloudflare/workerd/issues/902
5617
5669
  const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
5618
5670
 
5671
+ // If data is FormData and Content-Type is multipart/form-data without boundary,
5672
+ // delete it so fetch can set it correctly with the boundary
5673
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFormData(data)) {
5674
+ const contentType = headers.getContentType();
5675
+ if (
5676
+ contentType &&
5677
+ /^multipart\/form-data/i.test(contentType) &&
5678
+ !/boundary=/i.test(contentType)
5679
+ ) {
5680
+ headers.delete('content-type');
5681
+ }
5682
+ }
5683
+
5684
+ // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
5685
+ headers.set('User-Agent', 'axios/' + _env_data_js__WEBPACK_IMPORTED_MODULE_10__.VERSION, false);
5686
+
5619
5687
  const resolvedOptions = {
5620
5688
  ...fetchOptions,
5621
5689
  signal: composedSignal,
5622
5690
  method: method.toUpperCase(),
5623
- headers: headers.normalize().toJSON(),
5691
+ headers: (0,_helpers_sanitizeHeaderValue_js__WEBPACK_IMPORTED_MODULE_11__.toByteStringHeaderObject)(headers.normalize()),
5624
5692
  body: data,
5625
5693
  duplex: 'half',
5626
5694
  credentials: isCredentialsSupported ? withCredentials : undefined,
@@ -5632,10 +5700,28 @@ const factory = (env) => {
5632
5700
  ? _fetch(request, fetchOptions)
5633
5701
  : _fetch(url, resolvedOptions));
5634
5702
 
5703
+ // Cheap pre-check: if the server honestly declares a content-length that
5704
+ // already exceeds the cap, reject before we start streaming.
5705
+ if (hasMaxContentLength) {
5706
+ const declaredLength = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].toFiniteNumber(response.headers.get('content-length'));
5707
+ if (declaredLength != null && declaredLength > maxContentLength) {
5708
+ throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"](
5709
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
5710
+ _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_BAD_RESPONSE,
5711
+ config,
5712
+ request
5713
+ );
5714
+ }
5715
+ }
5716
+
5635
5717
  const isStreamResponse =
5636
5718
  supportsResponseStream && (responseType === 'stream' || responseType === 'response');
5637
5719
 
5638
- if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
5720
+ if (
5721
+ supportsResponseStream &&
5722
+ response.body &&
5723
+ (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))
5724
+ ) {
5639
5725
  const options = {};
5640
5726
 
5641
5727
  ['status', 'statusText', 'headers'].forEach((prop) => {
@@ -5652,8 +5738,24 @@ const factory = (env) => {
5652
5738
  )) ||
5653
5739
  [];
5654
5740
 
5741
+ let bytesRead = 0;
5742
+ const onChunkProgress = (loadedBytes) => {
5743
+ if (hasMaxContentLength) {
5744
+ bytesRead = loadedBytes;
5745
+ if (bytesRead > maxContentLength) {
5746
+ throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"](
5747
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
5748
+ _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_BAD_RESPONSE,
5749
+ config,
5750
+ request
5751
+ );
5752
+ }
5753
+ }
5754
+ onProgress && onProgress(loadedBytes);
5755
+ };
5756
+
5655
5757
  response = new Response(
5656
- (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_4__.trackStream)(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
5758
+ (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_4__.trackStream)(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
5657
5759
  flush && flush();
5658
5760
  unsubscribe && unsubscribe();
5659
5761
  }),
@@ -5668,6 +5770,33 @@ const factory = (env) => {
5668
5770
  config
5669
5771
  );
5670
5772
 
5773
+ // Fallback enforcement for environments without ReadableStream support
5774
+ // (legacy runtimes). Detect materialized size from typed output; skip
5775
+ // streams/Response passthrough since the user will read those themselves.
5776
+ if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
5777
+ let materializedSize;
5778
+ if (responseData != null) {
5779
+ if (typeof responseData.byteLength === 'number') {
5780
+ materializedSize = responseData.byteLength;
5781
+ } else if (typeof responseData.size === 'number') {
5782
+ materializedSize = responseData.size;
5783
+ } else if (typeof responseData === 'string') {
5784
+ materializedSize =
5785
+ typeof TextEncoder === 'function'
5786
+ ? new TextEncoder().encode(responseData).byteLength
5787
+ : responseData.length;
5788
+ }
5789
+ }
5790
+ if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
5791
+ throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"](
5792
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
5793
+ _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_BAD_RESPONSE,
5794
+ config,
5795
+ request
5796
+ );
5797
+ }
5798
+ }
5799
+
5671
5800
  !isStreamResponse && unsubscribe && unsubscribe();
5672
5801
 
5673
5802
  return await new Promise((resolve, reject) => {
@@ -5683,6 +5812,17 @@ const factory = (env) => {
5683
5812
  } catch (err) {
5684
5813
  unsubscribe && unsubscribe();
5685
5814
 
5815
+ // Safari can surface fetch aborts as a DOMException-like object whose
5816
+ // branded getters throw. Prefer our composed signal reason before reading
5817
+ // the caught error, preserving timeout vs cancellation semantics.
5818
+ if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]) {
5819
+ const canceledError = composedSignal.reason;
5820
+ canceledError.config = config;
5821
+ request && (canceledError.request = request);
5822
+ err !== canceledError && (canceledError.cause = err);
5823
+ throw canceledError;
5824
+ }
5825
+
5686
5826
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
5687
5827
  throw Object.assign(
5688
5828
  new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"](
@@ -5755,6 +5895,8 @@ __webpack_require__.r(__webpack_exports__);
5755
5895
  /* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js");
5756
5896
  /* harmony import */ var _helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../helpers/progressEventReducer.js */ "./node_modules/axios/lib/helpers/progressEventReducer.js");
5757
5897
  /* harmony import */ var _helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../helpers/resolveConfig.js */ "./node_modules/axios/lib/helpers/resolveConfig.js");
5898
+ /* harmony import */ var _helpers_sanitizeHeaderValue_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../helpers/sanitizeHeaderValue.js */ "./node_modules/axios/lib/helpers/sanitizeHeaderValue.js");
5899
+
5758
5900
 
5759
5901
 
5760
5902
 
@@ -5848,7 +5990,7 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
5848
5990
  // will return status as 0 even though it's a successful request
5849
5991
  if (
5850
5992
  request.status === 0 &&
5851
- !(request.responseURL && request.responseURL.indexOf('file:') === 0)
5993
+ !(request.responseURL && request.responseURL.startsWith('file:'))
5852
5994
  ) {
5853
5995
  return;
5854
5996
  }
@@ -5865,6 +6007,7 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
5865
6007
  }
5866
6008
 
5867
6009
  reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ECONNABORTED, config, request));
6010
+ done();
5868
6011
 
5869
6012
  // Clean up request
5870
6013
  request = null;
@@ -5880,6 +6023,7 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
5880
6023
  // attach the underlying event for consumers who want details
5881
6024
  err.event = event || null;
5882
6025
  reject(err);
6026
+ done();
5883
6027
  request = null;
5884
6028
  };
5885
6029
 
@@ -5900,6 +6044,7 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
5900
6044
  request
5901
6045
  )
5902
6046
  );
6047
+ done();
5903
6048
 
5904
6049
  // Clean up request
5905
6050
  request = null;
@@ -5910,7 +6055,7 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
5910
6055
 
5911
6056
  // Add headers to the request
5912
6057
  if ('setRequestHeader' in request) {
5913
- _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
6058
+ _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach((0,_helpers_sanitizeHeaderValue_js__WEBPACK_IMPORTED_MODULE_10__.toByteStringHeaderObject)(requestHeaders), function setRequestHeader(val, key) {
5914
6059
  request.setRequestHeader(key, val);
5915
6060
  });
5916
6061
  }
@@ -5949,6 +6094,7 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
5949
6094
  }
5950
6095
  reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_4__["default"](null, config, request) : cancel);
5951
6096
  request.abort();
6097
+ done();
5952
6098
  request = null;
5953
6099
  };
5954
6100
 
@@ -5962,7 +6108,7 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
5962
6108
 
5963
6109
  const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_config.url);
5964
6110
 
5965
- if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].protocols.indexOf(protocol) === -1) {
6111
+ if (protocol && !_platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].protocols.includes(protocol)) {
5966
6112
  reject(
5967
6113
  new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"](
5968
6114
  'Unsupported protocol ' + protocol + ':',
@@ -6476,7 +6622,7 @@ class Axios {
6476
6622
  let contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge(headers.common, headers[config.method]);
6477
6623
 
6478
6624
  headers &&
6479
- _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
6625
+ _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => {
6480
6626
  delete headers[method];
6481
6627
  });
6482
6628
 
@@ -6579,7 +6725,7 @@ _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'hea
6579
6725
  };
6580
6726
  });
6581
6727
 
6582
- _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
6728
+ _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
6583
6729
  function generateHTTPMethod(isForm) {
6584
6730
  return function httpMethod(url, data, config) {
6585
6731
  return this.request(
@@ -6599,7 +6745,11 @@ _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['post', 'put', 'patch
6599
6745
 
6600
6746
  Axios.prototype[method] = generateHTTPMethod();
6601
6747
 
6602
- Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
6748
+ // QUERY is a safe/idempotent read method; multipart form bodies don't fit
6749
+ // its semantics, so no queryForm shorthand is generated.
6750
+ if (method !== 'query') {
6751
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
6752
+ }
6603
6753
  });
6604
6754
 
6605
6755
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Axios);
@@ -6618,9 +6768,80 @@ __webpack_require__.r(__webpack_exports__);
6618
6768
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
6619
6769
  /* harmony export */ });
6620
6770
  /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
6771
+ /* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js");
6772
+
6773
+
6774
+
6775
+
6776
+
6777
+ const REDACTED = '[REDACTED ****]';
6778
+
6779
+ function hasOwnOrPrototypeToJSON(source) {
6780
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(source, 'toJSON')) {
6781
+ return true;
6782
+ }
6783
+
6784
+ let prototype = Object.getPrototypeOf(source);
6785
+
6786
+ while (prototype && prototype !== Object.prototype) {
6787
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(prototype, 'toJSON')) {
6788
+ return true;
6789
+ }
6621
6790
 
6791
+ prototype = Object.getPrototypeOf(prototype);
6792
+ }
6793
+
6794
+ return false;
6795
+ }
6796
+
6797
+ // Build a plain-object snapshot of `config` and replace the value of any key
6798
+ // (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
6799
+ // and AxiosHeaders, and short-circuits on circular references.
6800
+ function redactConfig(config, redactKeys) {
6801
+ const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
6802
+ const seen = [];
6803
+
6804
+ const visit = (source) => {
6805
+ if (source === null || typeof source !== 'object') return source;
6806
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(source)) return source;
6807
+ if (seen.indexOf(source) !== -1) return undefined;
6808
+
6809
+ if (source instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"]) {
6810
+ source = source.toJSON();
6811
+ }
6812
+
6813
+ seen.push(source);
6814
+
6815
+ let result;
6816
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(source)) {
6817
+ result = [];
6818
+ source.forEach((v, i) => {
6819
+ const reducedValue = visit(v);
6820
+ if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(reducedValue)) {
6821
+ result[i] = reducedValue;
6822
+ }
6823
+ });
6824
+ } else {
6825
+ if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
6826
+ seen.pop();
6827
+ return source;
6828
+ }
6829
+
6830
+ result = Object.create(null);
6831
+ for (const [key, value] of Object.entries(source)) {
6832
+ const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
6833
+ if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(reducedValue)) {
6834
+ result[key] = reducedValue;
6835
+ }
6836
+ }
6837
+ }
6622
6838
 
6839
+ seen.pop();
6840
+ return result;
6841
+ };
6623
6842
 
6843
+ return visit(config);
6844
+ }
6624
6845
 
6625
6846
  class AxiosError extends Error {
6626
6847
  static from(error, code, config, request, response, customProps) {
@@ -6637,42 +6858,56 @@ class AxiosError extends Error {
6637
6858
  return axiosError;
6638
6859
  }
6639
6860
 
6640
- /**
6641
- * Create an Error with the specified message, config, error code, request and response.
6642
- *
6643
- * @param {string} message The error message.
6644
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
6645
- * @param {Object} [config] The config.
6646
- * @param {Object} [request] The request.
6647
- * @param {Object} [response] The response.
6648
- *
6649
- * @returns {Error} The created error.
6650
- */
6651
- constructor(message, code, config, request, response) {
6652
- super(message);
6653
-
6654
- // Make message enumerable to maintain backward compatibility
6655
- // The native Error constructor sets message as non-enumerable,
6656
- // but axios < v1.13.3 had it as enumerable
6657
- Object.defineProperty(this, 'message', {
6658
- value: message,
6659
- enumerable: true,
6660
- writable: true,
6661
- configurable: true
6662
- });
6663
-
6664
- this.name = 'AxiosError';
6665
- this.isAxiosError = true;
6666
- code && (this.code = code);
6667
- config && (this.config = config);
6668
- request && (this.request = request);
6669
- if (response) {
6670
- this.response = response;
6671
- this.status = response.status;
6672
- }
6861
+ /**
6862
+ * Create an Error with the specified message, config, error code, request and response.
6863
+ *
6864
+ * @param {string} message The error message.
6865
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
6866
+ * @param {Object} [config] The config.
6867
+ * @param {Object} [request] The request.
6868
+ * @param {Object} [response] The response.
6869
+ *
6870
+ * @returns {Error} The created error.
6871
+ */
6872
+ constructor(message, code, config, request, response) {
6873
+ super(message);
6874
+
6875
+ // Make message enumerable to maintain backward compatibility
6876
+ // The native Error constructor sets message as non-enumerable,
6877
+ // but axios < v1.13.3 had it as enumerable
6878
+ Object.defineProperty(this, 'message', {
6879
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
6880
+ // this data descriptor into an accessor descriptor on the way in.
6881
+ __proto__: null,
6882
+ value: message,
6883
+ enumerable: true,
6884
+ writable: true,
6885
+ configurable: true,
6886
+ });
6887
+
6888
+ this.name = 'AxiosError';
6889
+ this.isAxiosError = true;
6890
+ code && (this.code = code);
6891
+ config && (this.config = config);
6892
+ request && (this.request = request);
6893
+ if (response) {
6894
+ this.response = response;
6895
+ this.status = response.status;
6673
6896
  }
6897
+ }
6674
6898
 
6675
6899
  toJSON() {
6900
+ // Opt-in redaction: when the request config carries a `redact` array, the
6901
+ // value of any matching key (case-insensitive, at any depth) is replaced
6902
+ // with REDACTED in the serialized snapshot. Undefined or empty leaves the
6903
+ // existing serialization behavior unchanged.
6904
+ const config = this.config;
6905
+ const redactKeys = config && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(config, 'redact') ? config.redact : undefined;
6906
+ const serializedConfig =
6907
+ _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(redactKeys) && redactKeys.length > 0
6908
+ ? redactConfig(config, redactKeys)
6909
+ : _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toJSONObject(config);
6910
+
6676
6911
  return {
6677
6912
  // Standard
6678
6913
  message: this.message,
@@ -6686,7 +6921,7 @@ class AxiosError extends Error {
6686
6921
  columnNumber: this.columnNumber,
6687
6922
  stack: this.stack,
6688
6923
  // Axios
6689
- config: _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toJSONObject(this.config),
6924
+ config: serializedConfig,
6690
6925
  code: this.code,
6691
6926
  status: this.status,
6692
6927
  };
@@ -6698,6 +6933,7 @@ AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
6698
6933
  AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
6699
6934
  AxiosError.ECONNABORTED = 'ECONNABORTED';
6700
6935
  AxiosError.ETIMEDOUT = 'ETIMEDOUT';
6936
+ AxiosError.ECONNREFUSED = 'ECONNREFUSED';
6701
6937
  AxiosError.ERR_NETWORK = 'ERR_NETWORK';
6702
6938
  AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
6703
6939
  AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
@@ -6706,6 +6942,7 @@ AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
6706
6942
  AxiosError.ERR_CANCELED = 'ERR_CANCELED';
6707
6943
  AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
6708
6944
  AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
6945
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
6709
6946
 
6710
6947
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosError);
6711
6948
 
@@ -6724,56 +6961,25 @@ __webpack_require__.r(__webpack_exports__);
6724
6961
  /* harmony export */ });
6725
6962
  /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
6726
6963
  /* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ "./node_modules/axios/lib/helpers/parseHeaders.js");
6964
+ /* harmony import */ var _helpers_sanitizeHeaderValue_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/sanitizeHeaderValue.js */ "./node_modules/axios/lib/helpers/sanitizeHeaderValue.js");
6727
6965
 
6728
6966
 
6729
6967
 
6730
6968
 
6731
6969
 
6732
- const $internals = Symbol('internals');
6733
-
6734
- const isValidHeaderValue = (value) => !/[\r\n]/.test(value);
6735
-
6736
- function assertValidHeaderValue(value, header) {
6737
- if (value === false || value == null) {
6738
- return;
6739
- }
6740
-
6741
- if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value)) {
6742
- value.forEach((v) => assertValidHeaderValue(v, header));
6743
- return;
6744
- }
6745
6970
 
6746
- if (!isValidHeaderValue(String(value))) {
6747
- throw new Error(`Invalid character in header content ["${header}"]`);
6748
- }
6749
- }
6971
+ const $internals = Symbol('internals');
6750
6972
 
6751
6973
  function normalizeHeader(header) {
6752
6974
  return header && String(header).trim().toLowerCase();
6753
6975
  }
6754
6976
 
6755
- function stripTrailingCRLF(str) {
6756
- let end = str.length;
6757
-
6758
- while (end > 0) {
6759
- const charCode = str.charCodeAt(end - 1);
6760
-
6761
- if (charCode !== 10 && charCode !== 13) {
6762
- break;
6763
- }
6764
-
6765
- end -= 1;
6766
- }
6767
-
6768
- return end === str.length ? str : str.slice(0, end);
6769
- }
6770
-
6771
6977
  function normalizeValue(value) {
6772
6978
  if (value === false || value == null) {
6773
6979
  return value;
6774
6980
  }
6775
6981
 
6776
- return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.map(normalizeValue) : stripTrailingCRLF(String(value));
6982
+ return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.map(normalizeValue) : (0,_helpers_sanitizeHeaderValue_js__WEBPACK_IMPORTED_MODULE_2__.sanitizeHeaderValue)(String(value));
6777
6983
  }
6778
6984
 
6779
6985
  function parseTokens(str) {
@@ -6824,6 +7030,9 @@ function buildAccessors(obj, header) {
6824
7030
 
6825
7031
  ['get', 'set', 'has'].forEach((methodName) => {
6826
7032
  Object.defineProperty(obj, methodName + accessorName, {
7033
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
7034
+ // this data descriptor into an accessor descriptor on the way in.
7035
+ __proto__: null,
6827
7036
  value: function (arg1, arg2, arg3) {
6828
7037
  return this[methodName].call(this, header, arg1, arg2, arg3);
6829
7038
  },
@@ -6855,7 +7064,6 @@ class AxiosHeaders {
6855
7064
  _rewrite === true ||
6856
7065
  (_rewrite === undefined && self[key] !== false)
6857
7066
  ) {
6858
- assertValidHeaderValue(_value, _header);
6859
7067
  self[key || _header] = normalizeValue(_value);
6860
7068
  }
6861
7069
  }
@@ -7222,7 +7430,7 @@ __webpack_require__.r(__webpack_exports__);
7222
7430
  */
7223
7431
  function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
7224
7432
  let isRelativeUrl = !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL);
7225
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
7433
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
7226
7434
  return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURL, requestedURL);
7227
7435
  }
7228
7436
  return requestedURL;
@@ -7298,8 +7506,15 @@ function dispatchRequest(config) {
7298
7506
  function onAdapterResolution(response) {
7299
7507
  throwIfCancellationRequested(config);
7300
7508
 
7301
- // Transform response data
7302
- response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(config, config.transformResponse, response);
7509
+ // Expose the current response on config so that transformResponse can
7510
+ // attach it to any AxiosError it throws (e.g. on JSON parse failure).
7511
+ // We clean it up afterwards to avoid polluting the config object.
7512
+ config.response = response;
7513
+ try {
7514
+ response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(config, config.transformResponse, response);
7515
+ } finally {
7516
+ delete config.response;
7517
+ }
7303
7518
 
7304
7519
  response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].from(response.headers);
7305
7520
 
@@ -7311,11 +7526,16 @@ function dispatchRequest(config) {
7311
7526
 
7312
7527
  // Transform response data
7313
7528
  if (reason && reason.response) {
7314
- reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(
7315
- config,
7316
- config.transformResponse,
7317
- reason.response
7318
- );
7529
+ config.response = reason.response;
7530
+ try {
7531
+ reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(
7532
+ config,
7533
+ config.transformResponse,
7534
+ reason.response
7535
+ );
7536
+ } finally {
7537
+ delete config.response;
7538
+ }
7319
7539
  reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].from(reason.response.headers);
7320
7540
  }
7321
7541
  }
@@ -7359,7 +7579,21 @@ const headersToObject = (thing) => (thing instanceof _AxiosHeaders_js__WEBPACK_I
7359
7579
  function mergeConfig(config1, config2) {
7360
7580
  // eslint-disable-next-line no-param-reassign
7361
7581
  config2 = config2 || {};
7362
- const config = {};
7582
+
7583
+ // Use a null-prototype object so that downstream reads such as `config.auth`
7584
+ // or `config.baseURL` cannot inherit polluted values from Object.prototype.
7585
+ // `hasOwnProperty` is restored as a non-enumerable own slot to preserve
7586
+ // ergonomics for user code that relies on it.
7587
+ const config = Object.create(null);
7588
+ Object.defineProperty(config, 'hasOwnProperty', {
7589
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
7590
+ // this data descriptor into an accessor descriptor on the way in.
7591
+ __proto__: null,
7592
+ value: Object.prototype.hasOwnProperty,
7593
+ enumerable: false,
7594
+ writable: true,
7595
+ configurable: true,
7596
+ });
7363
7597
 
7364
7598
  function getMergedValue(target, source, prop, caseless) {
7365
7599
  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(source)) {
@@ -7398,9 +7632,9 @@ function mergeConfig(config1, config2) {
7398
7632
 
7399
7633
  // eslint-disable-next-line consistent-return
7400
7634
  function mergeDirectKeys(a, b, prop) {
7401
- if (prop in config2) {
7635
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(config2, prop)) {
7402
7636
  return getMergedValue(a, b);
7403
- } else if (prop in config1) {
7637
+ } else if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(config1, prop)) {
7404
7638
  return getMergedValue(undefined, a);
7405
7639
  }
7406
7640
  }
@@ -7432,6 +7666,7 @@ function mergeConfig(config1, config2) {
7432
7666
  httpsAgent: defaultToConfig2,
7433
7667
  cancelToken: defaultToConfig2,
7434
7668
  socketPath: defaultToConfig2,
7669
+ allowedSocketPaths: defaultToConfig2,
7435
7670
  responseEncoding: defaultToConfig2,
7436
7671
  validateStatus: mergeDirectKeys,
7437
7672
  headers: (a, b, prop) =>
@@ -7441,7 +7676,9 @@ function mergeConfig(config1, config2) {
7441
7676
  _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
7442
7677
  if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
7443
7678
  const merge = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
7444
- const configValue = merge(config1[prop], config2[prop], prop);
7679
+ const a = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(config1, prop) ? config1[prop] : undefined;
7680
+ const b = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(config2, prop) ? config2[prop] : undefined;
7681
+ const configValue = merge(a, b, prop);
7445
7682
  (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
7446
7683
  });
7447
7684
 
@@ -7480,17 +7717,13 @@ function settle(resolve, reject, response) {
7480
7717
  if (!response.status || !validateStatus || validateStatus(response.status)) {
7481
7718
  resolve(response);
7482
7719
  } else {
7483
- reject(
7484
- new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"](
7485
- 'Request failed with status code ' + response.status,
7486
- [_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_REQUEST, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_RESPONSE][
7487
- Math.floor(response.status / 100) - 4
7488
- ],
7489
- response.config,
7490
- response.request,
7491
- response
7492
- )
7493
- );
7720
+ reject(new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"](
7721
+ 'Request failed with status code ' + response.status,
7722
+ response.status >= 400 && response.status < 500 ? _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_REQUEST : _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_RESPONSE,
7723
+ response.config,
7724
+ response.request,
7725
+ response
7726
+ ));
7494
7727
  }
7495
7728
  }
7496
7729
 
@@ -7569,6 +7802,8 @@ __webpack_require__.r(__webpack_exports__);
7569
7802
 
7570
7803
 
7571
7804
 
7805
+ const own = (obj, key) => (obj != null && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(obj, key) ? obj[key] : undefined);
7806
+
7572
7807
  /**
7573
7808
  * It takes a string, tries to parse it, and if it fails, it returns the stringified version
7574
7809
  * of the input
@@ -7636,20 +7871,22 @@ const defaults = {
7636
7871
  let isFileList;
7637
7872
 
7638
7873
  if (isObjectPayload) {
7874
+ const formSerializer = own(this, 'formSerializer');
7639
7875
  if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
7640
- return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_4__["default"])(data, this.formSerializer).toString();
7876
+ return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_4__["default"])(data, formSerializer).toString();
7641
7877
  }
7642
7878
 
7643
7879
  if (
7644
7880
  (isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(data)) ||
7645
7881
  contentType.indexOf('multipart/form-data') > -1
7646
7882
  ) {
7647
- const _FormData = this.env && this.env.FormData;
7883
+ const env = own(this, 'env');
7884
+ const _FormData = env && env.FormData;
7648
7885
 
7649
7886
  return (0,_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
7650
7887
  isFileList ? { 'files[]': data } : data,
7651
7888
  _FormData && new _FormData(),
7652
- this.formSerializer
7889
+ formSerializer
7653
7890
  );
7654
7891
  }
7655
7892
  }
@@ -7665,9 +7902,10 @@ const defaults = {
7665
7902
 
7666
7903
  transformResponse: [
7667
7904
  function transformResponse(data) {
7668
- const transitional = this.transitional || defaults.transitional;
7905
+ const transitional = own(this, 'transitional') || defaults.transitional;
7669
7906
  const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
7670
- const JSONRequested = this.responseType === 'json';
7907
+ const responseType = own(this, 'responseType');
7908
+ const JSONRequested = responseType === 'json';
7671
7909
 
7672
7910
  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isResponse(data) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isReadableStream(data)) {
7673
7911
  return data;
@@ -7676,17 +7914,17 @@ const defaults = {
7676
7914
  if (
7677
7915
  data &&
7678
7916
  _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(data) &&
7679
- ((forcedJSONParsing && !this.responseType) || JSONRequested)
7917
+ ((forcedJSONParsing && !responseType) || JSONRequested)
7680
7918
  ) {
7681
7919
  const silentJSONParsing = transitional && transitional.silentJSONParsing;
7682
7920
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
7683
7921
 
7684
7922
  try {
7685
- return JSON.parse(data, this.parseReviver);
7923
+ return JSON.parse(data, own(this, 'parseReviver'));
7686
7924
  } catch (e) {
7687
7925
  if (strictJSONParsing) {
7688
7926
  if (e.name === 'SyntaxError') {
7689
- throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_RESPONSE, this, null, this.response);
7927
+ throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_RESPONSE, this, null, own(this, 'response'));
7690
7928
  }
7691
7929
  throw e;
7692
7930
  }
@@ -7726,7 +7964,7 @@ const defaults = {
7726
7964
  },
7727
7965
  };
7728
7966
 
7729
- _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
7967
+ _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => {
7730
7968
  defaults.headers[method] = {};
7731
7969
  });
7732
7970
 
@@ -7767,7 +8005,7 @@ __webpack_require__.r(__webpack_exports__);
7767
8005
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7768
8006
  /* harmony export */ VERSION: () => (/* binding */ VERSION)
7769
8007
  /* harmony export */ });
7770
- const VERSION = "1.15.0";
8008
+ const VERSION = "1.16.1";
7771
8009
 
7772
8010
  /***/ }),
7773
8011
 
@@ -7802,9 +8040,8 @@ function encode(str) {
7802
8040
  ')': '%29',
7803
8041
  '~': '%7E',
7804
8042
  '%20': '+',
7805
- '%00': '\x00',
7806
8043
  };
7807
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
8044
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
7808
8045
  return charMap[match];
7809
8046
  });
7810
8047
  }
@@ -7975,7 +8212,8 @@ function bind(fn, thisArg) {
7975
8212
 
7976
8213
  __webpack_require__.r(__webpack_exports__);
7977
8214
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7978
- /* harmony export */ "default": () => (/* binding */ buildURL)
8215
+ /* harmony export */ "default": () => (/* binding */ buildURL),
8216
+ /* harmony export */ encode: () => (/* binding */ encode)
7979
8217
  /* harmony export */ });
7980
8218
  /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
7981
8219
  /* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js");
@@ -8096,54 +8334,55 @@ __webpack_require__.r(__webpack_exports__);
8096
8334
 
8097
8335
 
8098
8336
  const composeSignals = (signals, timeout) => {
8099
- const { length } = (signals = signals ? signals.filter(Boolean) : []);
8100
-
8101
- if (timeout || length) {
8102
- let controller = new AbortController();
8103
-
8104
- let aborted;
8105
-
8106
- const onabort = function (reason) {
8107
- if (!aborted) {
8108
- aborted = true;
8109
- unsubscribe();
8110
- const err = reason instanceof Error ? reason : this.reason;
8111
- controller.abort(
8112
- err instanceof _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]
8113
- ? err
8114
- : new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](err instanceof Error ? err.message : err)
8115
- );
8116
- }
8117
- };
8337
+ signals = signals ? signals.filter(Boolean) : [];
8118
8338
 
8119
- let timer =
8120
- timeout &&
8121
- setTimeout(() => {
8122
- timer = null;
8123
- onabort(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"](`timeout of ${timeout}ms exceeded`, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ETIMEDOUT));
8124
- }, timeout);
8125
-
8126
- const unsubscribe = () => {
8127
- if (signals) {
8128
- timer && clearTimeout(timer);
8129
- timer = null;
8130
- signals.forEach((signal) => {
8131
- signal.unsubscribe
8132
- ? signal.unsubscribe(onabort)
8133
- : signal.removeEventListener('abort', onabort);
8134
- });
8135
- signals = null;
8136
- }
8137
- };
8339
+ if (!timeout && !signals.length) {
8340
+ return;
8341
+ }
8138
8342
 
8139
- signals.forEach((signal) => signal.addEventListener('abort', onabort));
8343
+ const controller = new AbortController();
8140
8344
 
8141
- const { signal } = controller;
8345
+ let aborted = false;
8142
8346
 
8143
- signal.unsubscribe = () => _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].asap(unsubscribe);
8347
+ const onabort = function (reason) {
8348
+ if (!aborted) {
8349
+ aborted = true;
8350
+ unsubscribe();
8351
+ const err = reason instanceof Error ? reason : this.reason;
8352
+ controller.abort(
8353
+ err instanceof _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]
8354
+ ? err
8355
+ : new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](err instanceof Error ? err.message : err)
8356
+ );
8357
+ }
8358
+ };
8144
8359
 
8145
- return signal;
8146
- }
8360
+ let timer =
8361
+ timeout &&
8362
+ setTimeout(() => {
8363
+ timer = null;
8364
+ onabort(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"](`timeout of ${timeout}ms exceeded`, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ETIMEDOUT));
8365
+ }, timeout);
8366
+
8367
+ const unsubscribe = () => {
8368
+ if (!signals) { return; }
8369
+ timer && clearTimeout(timer);
8370
+ timer = null;
8371
+ signals.forEach((signal) => {
8372
+ signal.unsubscribe
8373
+ ? signal.unsubscribe(onabort)
8374
+ : signal.removeEventListener('abort', onabort);
8375
+ });
8376
+ signals = null;
8377
+ };
8378
+
8379
+ signals.forEach((signal) => signal.addEventListener('abort', onabort));
8380
+
8381
+ const { signal } = controller;
8382
+
8383
+ signal.unsubscribe = () => _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].asap(unsubscribe);
8384
+
8385
+ return signal;
8147
8386
  };
8148
8387
 
8149
8388
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (composeSignals);
@@ -8195,8 +8434,20 @@ __webpack_require__.r(__webpack_exports__);
8195
8434
 
8196
8435
  read(name) {
8197
8436
  if (typeof document === 'undefined') return null;
8198
- const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
8199
- return match ? decodeURIComponent(match[1]) : null;
8437
+ // Match name=value by splitting on the semicolon separator instead of building a
8438
+ // RegExp from `name` interpolating an unescaped string into a RegExp would let
8439
+ // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
8440
+ // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
8441
+ // "; ", so ignore optional whitespace before each cookie name.
8442
+ const cookies = document.cookie.split(';');
8443
+ for (let i = 0; i < cookies.length; i++) {
8444
+ const cookie = cookies[i].replace(/^\s+/, '');
8445
+ const eq = cookie.indexOf('=');
8446
+ if (eq !== -1 && cookie.slice(0, eq) === name) {
8447
+ return decodeURIComponent(cookie.slice(eq + 1));
8448
+ }
8449
+ }
8450
+ return null;
8200
8451
  },
8201
8452
 
8202
8453
  remove(name) {
@@ -8213,6 +8464,120 @@ __webpack_require__.r(__webpack_exports__);
8213
8464
  });
8214
8465
 
8215
8466
 
8467
+ /***/ }),
8468
+
8469
+ /***/ "./node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js":
8470
+ /*!***********************************************************************!*\
8471
+ !*** ./node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js ***!
8472
+ \***********************************************************************/
8473
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
8474
+
8475
+ __webpack_require__.r(__webpack_exports__);
8476
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8477
+ /* harmony export */ "default": () => (/* binding */ estimateDataURLDecodedBytes)
8478
+ /* harmony export */ });
8479
+ /**
8480
+ * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
8481
+ * - For base64: compute exact decoded size using length and padding;
8482
+ * handle %XX at the character-count level (no string allocation).
8483
+ * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
8484
+ *
8485
+ * @param {string} url
8486
+ * @returns {number}
8487
+ */
8488
+ function estimateDataURLDecodedBytes(url) {
8489
+ if (!url || typeof url !== 'string') return 0;
8490
+ if (!url.startsWith('data:')) return 0;
8491
+
8492
+ const comma = url.indexOf(',');
8493
+ if (comma < 0) return 0;
8494
+
8495
+ const meta = url.slice(5, comma);
8496
+ const body = url.slice(comma + 1);
8497
+ const isBase64 = /;base64/i.test(meta);
8498
+
8499
+ if (isBase64) {
8500
+ let effectiveLen = body.length;
8501
+ const len = body.length; // cache length
8502
+
8503
+ for (let i = 0; i < len; i++) {
8504
+ if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
8505
+ const a = body.charCodeAt(i + 1);
8506
+ const b = body.charCodeAt(i + 2);
8507
+ const isHex =
8508
+ ((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
8509
+ ((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
8510
+
8511
+ if (isHex) {
8512
+ effectiveLen -= 2;
8513
+ i += 2;
8514
+ }
8515
+ }
8516
+ }
8517
+
8518
+ let pad = 0;
8519
+ let idx = len - 1;
8520
+
8521
+ const tailIsPct3D = (j) =>
8522
+ j >= 2 &&
8523
+ body.charCodeAt(j - 2) === 37 && // '%'
8524
+ body.charCodeAt(j - 1) === 51 && // '3'
8525
+ (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
8526
+
8527
+ if (idx >= 0) {
8528
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
8529
+ pad++;
8530
+ idx--;
8531
+ } else if (tailIsPct3D(idx)) {
8532
+ pad++;
8533
+ idx -= 3;
8534
+ }
8535
+ }
8536
+
8537
+ if (pad === 1 && idx >= 0) {
8538
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
8539
+ pad++;
8540
+ } else if (tailIsPct3D(idx)) {
8541
+ pad++;
8542
+ }
8543
+ }
8544
+
8545
+ const groups = Math.floor(effectiveLen / 4);
8546
+ const bytes = groups * 3 - (pad || 0);
8547
+ return bytes > 0 ? bytes : 0;
8548
+ }
8549
+
8550
+ if (typeof Buffer !== 'undefined' && typeof Buffer.byteLength === 'function') {
8551
+ return Buffer.byteLength(body, 'utf8');
8552
+ }
8553
+
8554
+ // Compute UTF-8 byte length directly from UTF-16 code units without allocating
8555
+ // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
8556
+ // Using body.length here would undercount non-ASCII (e.g. '€' is 1 code unit
8557
+ // but 3 UTF-8 bytes).
8558
+ let bytes = 0;
8559
+ for (let i = 0, len = body.length; i < len; i++) {
8560
+ const c = body.charCodeAt(i);
8561
+ if (c < 0x80) {
8562
+ bytes += 1;
8563
+ } else if (c < 0x800) {
8564
+ bytes += 2;
8565
+ } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
8566
+ const next = body.charCodeAt(i + 1);
8567
+ if (next >= 0xdc00 && next <= 0xdfff) {
8568
+ bytes += 4;
8569
+ i++;
8570
+ } else {
8571
+ bytes += 3;
8572
+ }
8573
+ } else {
8574
+ bytes += 3;
8575
+ }
8576
+ }
8577
+ return bytes;
8578
+ }
8579
+
8580
+
8216
8581
  /***/ }),
8217
8582
 
8218
8583
  /***/ "./node_modules/axios/lib/helpers/formDataToJSON.js":
@@ -8286,7 +8651,9 @@ function formDataToJSON(formData) {
8286
8651
 
8287
8652
  if (isLast) {
8288
8653
  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(target, name)) {
8289
- target[name] = [target[name], value];
8654
+ target[name] = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target[name])
8655
+ ? target[name].concat(value)
8656
+ : [target[name], value];
8290
8657
  } else {
8291
8658
  target[name] = value;
8292
8659
  }
@@ -8294,7 +8661,7 @@ function formDataToJSON(formData) {
8294
8661
  return !isNumericKey;
8295
8662
  }
8296
8663
 
8297
- if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(target[name])) {
8664
+ if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(target, name) || !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(target[name])) {
8298
8665
  target[name] = [];
8299
8666
  }
8300
8667
 
@@ -8531,7 +8898,7 @@ __webpack_require__.r(__webpack_exports__);
8531
8898
 
8532
8899
 
8533
8900
  function parseProtocol(url) {
8534
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
8901
+ const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
8535
8902
  return (match && match[1]) || '';
8536
8903
  }
8537
8904
 
@@ -8562,13 +8929,16 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
8562
8929
  const _speedometer = (0,_speedometer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(50, 250);
8563
8930
 
8564
8931
  return (0,_throttle_js__WEBPACK_IMPORTED_MODULE_1__["default"])((e) => {
8565
- const loaded = e.loaded;
8932
+ if (!e || typeof e.loaded !== 'number') {
8933
+ return;
8934
+ }
8935
+ const rawLoaded = e.loaded;
8566
8936
  const total = e.lengthComputable ? e.total : undefined;
8567
- const progressBytes = loaded - bytesNotified;
8937
+ const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
8938
+ const progressBytes = Math.max(0, loaded - bytesNotified);
8568
8939
  const rate = _speedometer(progressBytes);
8569
- const inRange = loaded <= total;
8570
8940
 
8571
- bytesNotified = loaded;
8941
+ bytesNotified = Math.max(bytesNotified, loaded);
8572
8942
 
8573
8943
  const data = {
8574
8944
  loaded,
@@ -8576,7 +8946,7 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
8576
8946
  progress: total ? loaded / total : undefined,
8577
8947
  bytes: progressBytes,
8578
8948
  rate: rate ? rate : undefined,
8579
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
8949
+ estimated: rate && total ? (total - loaded) / rate : undefined,
8580
8950
  event: e,
8581
8951
  lengthComputable: total != null,
8582
8952
  [isDownloadStream ? 'download' : 'upload']: true,
@@ -8635,15 +9005,55 @@ __webpack_require__.r(__webpack_exports__);
8635
9005
 
8636
9006
 
8637
9007
 
9008
+ const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
9009
+
9010
+ function setFormDataHeaders(headers, formHeaders, policy) {
9011
+ if (policy !== 'content-only') {
9012
+ headers.set(formHeaders);
9013
+ return;
9014
+ }
9015
+
9016
+ Object.entries(formHeaders).forEach(([key, val]) => {
9017
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
9018
+ headers.set(key, val);
9019
+ }
9020
+ });
9021
+ }
9022
+
9023
+ /**
9024
+ * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
9025
+ * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
9026
+ *
9027
+ * @param {string} str The string to encode
9028
+ *
9029
+ * @returns {string} UTF-8 bytes as a Latin-1 string
9030
+ */
9031
+ const encodeUTF8 = (str) =>
9032
+ encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>
9033
+ String.fromCharCode(parseInt(hex, 16))
9034
+ );
9035
+
8638
9036
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((config) => {
8639
9037
  const newConfig = (0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_5__["default"])({}, config);
8640
9038
 
8641
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
9039
+ // Read only own properties to prevent prototype pollution gadgets
9040
+ // (e.g. Object.prototype.baseURL = 'https://evil.com').
9041
+ const own = (key) => (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
9042
+
9043
+ const data = own('data');
9044
+ let withXSRFToken = own('withXSRFToken');
9045
+ const xsrfHeaderName = own('xsrfHeaderName');
9046
+ const xsrfCookieName = own('xsrfCookieName');
9047
+ let headers = own('headers');
9048
+ const auth = own('auth');
9049
+ const baseURL = own('baseURL');
9050
+ const allowAbsoluteUrls = own('allowAbsoluteUrls');
9051
+ const url = own('url');
8642
9052
 
8643
9053
  newConfig.headers = headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_6__["default"].from(headers);
8644
9054
 
8645
9055
  newConfig.url = (0,_buildURL_js__WEBPACK_IMPORTED_MODULE_7__["default"])(
8646
- (0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls),
9056
+ (0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(baseURL, url, allowAbsoluteUrls),
8647
9057
  config.params,
8648
9058
  config.paramsSerializer
8649
9059
  );
@@ -8653,11 +9063,7 @@ __webpack_require__.r(__webpack_exports__);
8653
9063
  headers.set(
8654
9064
  'Authorization',
8655
9065
  'Basic ' +
8656
- btoa(
8657
- (auth.username || '') +
8658
- ':' +
8659
- (auth.password ? unescape(encodeURIComponent(auth.password)) : '')
8660
- )
9066
+ btoa((auth.username || '') + ':' + (auth.password ? encodeUTF8(auth.password) : ''))
8661
9067
  );
8662
9068
  }
8663
9069
 
@@ -8666,14 +9072,7 @@ __webpack_require__.r(__webpack_exports__);
8666
9072
  headers.setContentType(undefined); // browser handles it
8667
9073
  } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFunction(data.getHeaders)) {
8668
9074
  // Node.js FormData (like form-data package)
8669
- const formHeaders = data.getHeaders();
8670
- // Only set safe headers to avoid overwriting security headers
8671
- const allowedHeaders = ['content-type', 'content-length'];
8672
- Object.entries(formHeaders).forEach(([key, val]) => {
8673
- if (allowedHeaders.includes(key.toLowerCase())) {
8674
- headers.set(key, val);
8675
- }
8676
- });
9075
+ setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
8677
9076
  }
8678
9077
  }
8679
9078
 
@@ -8682,10 +9081,17 @@ __webpack_require__.r(__webpack_exports__);
8682
9081
  // Specifically not if we're in a web worker, or react-native.
8683
9082
 
8684
9083
  if (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv) {
8685
- withXSRFToken && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
9084
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFunction(withXSRFToken)) {
9085
+ withXSRFToken = withXSRFToken(newConfig);
9086
+ }
8686
9087
 
8687
- if (withXSRFToken || (withXSRFToken !== false && (0,_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_2__["default"])(newConfig.url))) {
8688
- // Add xsrf header
9088
+ // Strict boolean check prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
9089
+ // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
9090
+ // the XSRF token cross-origin.
9091
+ const shouldSendXSRF =
9092
+ withXSRFToken === true || (withXSRFToken == null && (0,_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_2__["default"])(newConfig.url));
9093
+
9094
+ if (shouldSendXSRF) {
8689
9095
  const xsrfValue = xsrfHeaderName && xsrfCookieName && _cookies_js__WEBPACK_IMPORTED_MODULE_3__["default"].read(xsrfCookieName);
8690
9096
 
8691
9097
  if (xsrfValue) {
@@ -8698,6 +9104,83 @@ __webpack_require__.r(__webpack_exports__);
8698
9104
  });
8699
9105
 
8700
9106
 
9107
+ /***/ }),
9108
+
9109
+ /***/ "./node_modules/axios/lib/helpers/sanitizeHeaderValue.js":
9110
+ /*!***************************************************************!*\
9111
+ !*** ./node_modules/axios/lib/helpers/sanitizeHeaderValue.js ***!
9112
+ \***************************************************************/
9113
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
9114
+
9115
+ __webpack_require__.r(__webpack_exports__);
9116
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9117
+ /* harmony export */ sanitizeByteStringHeaderValue: () => (/* binding */ sanitizeByteStringHeaderValue),
9118
+ /* harmony export */ sanitizeHeaderValue: () => (/* binding */ sanitizeHeaderValue),
9119
+ /* harmony export */ toByteStringHeaderObject: () => (/* binding */ toByteStringHeaderObject)
9120
+ /* harmony export */ });
9121
+ /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js");
9122
+
9123
+
9124
+
9125
+
9126
+ function trimSPorHTAB(str) {
9127
+ let start = 0;
9128
+ let end = str.length;
9129
+
9130
+ while (start < end) {
9131
+ const code = str.charCodeAt(start);
9132
+
9133
+ if (code !== 0x09 && code !== 0x20) {
9134
+ break;
9135
+ }
9136
+
9137
+ start += 1;
9138
+ }
9139
+
9140
+ while (end > start) {
9141
+ const code = str.charCodeAt(end - 1);
9142
+
9143
+ if (code !== 0x09 && code !== 0x20) {
9144
+ break;
9145
+ }
9146
+
9147
+ end -= 1;
9148
+ }
9149
+
9150
+ return start === 0 && end === str.length ? str : str.slice(start, end);
9151
+ }
9152
+
9153
+ // The control-code ranges are intentional: header sanitization strips C0/DEL bytes.
9154
+ // eslint-disable-next-line no-control-regex
9155
+ const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+', 'g');
9156
+ // eslint-disable-next-line no-control-regex
9157
+ const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g');
9158
+
9159
+ function sanitizeValue(value, invalidChars) {
9160
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value)) {
9161
+ return value.map((item) => sanitizeValue(item, invalidChars));
9162
+ }
9163
+
9164
+ return trimSPorHTAB(String(value).replace(invalidChars, ''));
9165
+ }
9166
+
9167
+ const sanitizeHeaderValue = (value) =>
9168
+ sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
9169
+
9170
+ const sanitizeByteStringHeaderValue = (value) =>
9171
+ sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
9172
+
9173
+ function toByteStringHeaderObject(headers) {
9174
+ const byteStringHeaders = Object.create(null);
9175
+
9176
+ _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(headers.toJSON(), (value, header) => {
9177
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
9178
+ });
9179
+
9180
+ return byteStringHeaders;
9181
+ }
9182
+
9183
+
8701
9184
  /***/ }),
8702
9185
 
8703
9186
  /***/ "./node_modules/axios/lib/helpers/speedometer.js":
@@ -8999,6 +9482,7 @@ function toFormData(obj, formData, options) {
8999
9482
  const dots = options.dots;
9000
9483
  const indexes = options.indexes;
9001
9484
  const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
9485
+ const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
9002
9486
  const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isSpecCompliantForm(formData);
9003
9487
 
9004
9488
  if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(visitor)) {
@@ -9091,9 +9575,16 @@ function toFormData(obj, formData, options) {
9091
9575
  isVisitable,
9092
9576
  });
9093
9577
 
9094
- function build(value, path) {
9578
+ function build(value, path, depth = 0) {
9095
9579
  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(value)) return;
9096
9580
 
9581
+ if (depth > maxDepth) {
9582
+ throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"](
9583
+ 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
9584
+ _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_FORM_DATA_DEPTH_EXCEEDED
9585
+ );
9586
+ }
9587
+
9097
9588
  if (stack.indexOf(value) !== -1) {
9098
9589
  throw Error('Circular reference detected in ' + path.join('.'));
9099
9590
  }
@@ -9106,7 +9597,7 @@ function toFormData(obj, formData, options) {
9106
9597
  visitor.call(formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(key) ? key.trim() : key, path, exposedHelpers);
9107
9598
 
9108
9599
  if (result === true) {
9109
- build(el, path ? path.concat(key) : [key]);
9600
+ build(el, path ? path.concat(key) : [key], depth + 1);
9110
9601
  }
9111
9602
  });
9112
9603
 
@@ -9368,7 +9859,9 @@ function assertOptions(options, schema, allowUnknown) {
9368
9859
  let i = keys.length;
9369
9860
  while (i-- > 0) {
9370
9861
  const opt = keys[i];
9371
- const validator = schema[opt];
9862
+ // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
9863
+ // a non-function validator and cause a TypeError.
9864
+ const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
9372
9865
  if (validator) {
9373
9866
  const value = options[opt];
9374
9867
  const result = value === undefined || validator(value, opt, options);
@@ -9769,21 +10262,21 @@ const isFile = kindOfTest('File');
9769
10262
  * also have a `name` and `type` attribute to specify filename and content type
9770
10263
  *
9771
10264
  * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
9772
- *
10265
+ *
9773
10266
  * @param {*} value The value to test
9774
- *
10267
+ *
9775
10268
  * @returns {boolean} True if value is a React Native Blob, otherwise false
9776
10269
  */
9777
10270
  const isReactNativeBlob = (value) => {
9778
10271
  return !!(value && typeof value.uri !== 'undefined');
9779
- }
10272
+ };
9780
10273
 
9781
10274
  /**
9782
10275
  * Determine if environment is React Native
9783
10276
  * ReactNative `FormData` has a non-standard `getParts()` method
9784
- *
10277
+ *
9785
10278
  * @param {*} formData The formData to test
9786
- *
10279
+ *
9787
10280
  * @returns {boolean} True if environment is React Native, otherwise false
9788
10281
  */
9789
10282
  const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
@@ -9802,7 +10295,7 @@ const isBlob = kindOfTest('Blob');
9802
10295
  *
9803
10296
  * @param {*} val The value to test
9804
10297
  *
9805
- * @returns {boolean} True if value is a File, otherwise false
10298
+ * @returns {boolean} True if value is a FileList, otherwise false
9806
10299
  */
9807
10300
  const isFileList = kindOfTest('FileList');
9808
10301
 
@@ -9834,15 +10327,17 @@ const G = getGlobal();
9834
10327
  const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
9835
10328
 
9836
10329
  const isFormData = (thing) => {
9837
- let kind;
9838
- return thing && (
9839
- (FormDataCtor && thing instanceof FormDataCtor) || (
9840
- isFunction(thing.append) && (
9841
- (kind = kindOf(thing)) === 'formdata' ||
9842
- // detect form-data instance
9843
- (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
9844
- )
9845
- )
10330
+ if (!thing) return false;
10331
+ if (FormDataCtor && thing instanceof FormDataCtor) return true;
10332
+ // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.
10333
+ const proto = getPrototypeOf(thing);
10334
+ if (!proto || proto === Object.prototype) return false;
10335
+ if (!isFunction(thing.append)) return false;
10336
+ const kind = kindOf(thing);
10337
+ return (
10338
+ kind === 'formdata' ||
10339
+ // detect form-data instance
10340
+ (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
9846
10341
  );
9847
10342
  };
9848
10343
 
@@ -9978,7 +10473,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
9978
10473
  *
9979
10474
  * @returns {Object} Result of all merge properties
9980
10475
  */
9981
- function merge(/* obj1, obj2, obj3, ... */) {
10476
+ function merge(...objs) {
9982
10477
  const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
9983
10478
  const result = {};
9984
10479
  const assignValue = (val, key) => {
@@ -9988,8 +10483,12 @@ function merge(/* obj1, obj2, obj3, ... */) {
9988
10483
  }
9989
10484
 
9990
10485
  const targetKey = (caseless && findKey(result, key)) || key;
9991
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
9992
- result[targetKey] = merge(result[targetKey], val);
10486
+ // Read via own-prop only — a bare `result[targetKey]` walks the prototype
10487
+ // chain, so a polluted Object.prototype value could surface here and get
10488
+ // copied into the merged result.
10489
+ const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
10490
+ if (isPlainObject(existing) && isPlainObject(val)) {
10491
+ result[targetKey] = merge(existing, val);
9993
10492
  } else if (isPlainObject(val)) {
9994
10493
  result[targetKey] = merge({}, val);
9995
10494
  } else if (isArray(val)) {
@@ -9999,8 +10498,8 @@ function merge(/* obj1, obj2, obj3, ... */) {
9999
10498
  }
10000
10499
  };
10001
10500
 
10002
- for (let i = 0, l = arguments.length; i < l; i++) {
10003
- arguments[i] && forEach(arguments[i], assignValue);
10501
+ for (let i = 0, l = objs.length; i < l; i++) {
10502
+ objs[i] && forEach(objs[i], assignValue);
10004
10503
  }
10005
10504
  return result;
10006
10505
  }
@@ -10022,6 +10521,9 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
10022
10521
  (val, key) => {
10023
10522
  if (thisArg && isFunction(val)) {
10024
10523
  Object.defineProperty(a, key, {
10524
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
10525
+ // hijack defineProperty's accessor-vs-data resolution.
10526
+ __proto__: null,
10025
10527
  value: (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(val, thisArg),
10026
10528
  writable: true,
10027
10529
  enumerable: true,
@@ -10029,6 +10531,7 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
10029
10531
  });
10030
10532
  } else {
10031
10533
  Object.defineProperty(a, key, {
10534
+ __proto__: null,
10032
10535
  value: val,
10033
10536
  writable: true,
10034
10537
  enumerable: true,
@@ -10067,12 +10570,14 @@ const stripBOM = (content) => {
10067
10570
  const inherits = (constructor, superConstructor, props, descriptors) => {
10068
10571
  constructor.prototype = Object.create(superConstructor.prototype, descriptors);
10069
10572
  Object.defineProperty(constructor.prototype, 'constructor', {
10573
+ __proto__: null,
10070
10574
  value: constructor,
10071
10575
  writable: true,
10072
10576
  enumerable: false,
10073
10577
  configurable: true,
10074
10578
  });
10075
10579
  Object.defineProperty(constructor, 'super', {
10580
+ __proto__: null,
10076
10581
  value: superConstructor.prototype,
10077
10582
  });
10078
10583
  props && Object.assign(constructor.prototype, props);
@@ -10254,7 +10759,7 @@ const reduceDescriptors = (obj, reducer) => {
10254
10759
  const freezeMethods = (obj) => {
10255
10760
  reduceDescriptors(obj, (descriptor, name) => {
10256
10761
  // skip restricted props in strict mode
10257
- if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
10762
+ if (isFunction(obj) && ['arguments', 'caller', 'callee'].includes(name)) {
10258
10763
  return false;
10259
10764
  }
10260
10765
 
@@ -10328,11 +10833,11 @@ function isSpecCompliantForm(thing) {
10328
10833
  * @returns {Object} The JSON-compatible object.
10329
10834
  */
10330
10835
  const toJSONObject = (obj) => {
10331
- const stack = new Array(10);
10836
+ const visited = new WeakSet();
10332
10837
 
10333
- const visit = (source, i) => {
10838
+ const visit = (source) => {
10334
10839
  if (isObject(source)) {
10335
- if (stack.indexOf(source) >= 0) {
10840
+ if (visited.has(source)) {
10336
10841
  return;
10337
10842
  }
10338
10843
 
@@ -10342,15 +10847,16 @@ const toJSONObject = (obj) => {
10342
10847
  }
10343
10848
 
10344
10849
  if (!('toJSON' in source)) {
10345
- stack[i] = source;
10850
+ // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
10851
+ visited.add(source);
10346
10852
  const target = isArray(source) ? [] : {};
10347
10853
 
10348
10854
  forEach(source, (value, key) => {
10349
- const reducedValue = visit(value, i + 1);
10855
+ const reducedValue = visit(value);
10350
10856
  !isUndefined(reducedValue) && (target[key] = reducedValue);
10351
10857
  });
10352
10858
 
10353
- stack[i] = undefined;
10859
+ visited.delete(source);
10354
10860
 
10355
10861
  return target;
10356
10862
  }
@@ -10359,7 +10865,7 @@ const toJSONObject = (obj) => {
10359
10865
  return source;
10360
10866
  };
10361
10867
 
10362
- return visit(obj, 0);
10868
+ return visit(obj);
10363
10869
  };
10364
10870
 
10365
10871
  /**