@jerome-benoit/sap-ai-provider 4.7.0 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +26 -31
  2. package/dist/{chunk-TVXWNZQT.js → chunk-3ZSXTKOK.js} +607 -210
  3. package/dist/chunk-3ZSXTKOK.js.map +1 -0
  4. package/dist/{chunk-GMMX46AH.js → chunk-BVDSJ4IZ.js} +10 -4
  5. package/dist/chunk-BVDSJ4IZ.js.map +1 -0
  6. package/dist/{chunk-36DFHUVQ.js → chunk-H5KD4EPO.js} +8 -2
  7. package/dist/chunk-H5KD4EPO.js.map +1 -0
  8. package/dist/{chunk-WDUOKIKD.js → chunk-KVOLFUQJ.js} +4 -2
  9. package/dist/chunk-KVOLFUQJ.js.map +1 -0
  10. package/dist/{chunk-BZZJKLDG.js → chunk-TQXCNZBC.js} +11 -5
  11. package/dist/chunk-TQXCNZBC.js.map +1 -0
  12. package/dist/{foundation-models-embedding-model-strategy-YWPDIJEN.js → foundation-models-embedding-model-strategy-SWRJNFD4.js} +7 -6
  13. package/dist/foundation-models-embedding-model-strategy-SWRJNFD4.js.map +1 -0
  14. package/dist/{foundation-models-language-model-strategy-WDSQWU64.js → foundation-models-language-model-strategy-LRAC25ZY.js} +14 -9
  15. package/dist/foundation-models-language-model-strategy-LRAC25ZY.js.map +1 -0
  16. package/dist/index.cjs +658 -228
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +24 -1
  19. package/dist/index.d.ts +24 -1
  20. package/dist/index.js +14 -10
  21. package/dist/index.js.map +1 -1
  22. package/dist/{orchestration-embedding-model-strategy-66QYAO64.js → orchestration-embedding-model-strategy-C5G735Q2.js} +8 -7
  23. package/dist/orchestration-embedding-model-strategy-C5G735Q2.js.map +1 -0
  24. package/dist/{orchestration-language-model-strategy-4TKRZK7U.js → orchestration-language-model-strategy-NUHYRIXH.js} +17 -10
  25. package/dist/orchestration-language-model-strategy-NUHYRIXH.js.map +1 -0
  26. package/package.json +19 -21
  27. package/dist/chunk-36DFHUVQ.js.map +0 -1
  28. package/dist/chunk-BZZJKLDG.js.map +0 -1
  29. package/dist/chunk-GMMX46AH.js.map +0 -1
  30. package/dist/chunk-TVXWNZQT.js.map +0 -1
  31. package/dist/chunk-WDUOKIKD.js.map +0 -1
  32. package/dist/foundation-models-embedding-model-strategy-YWPDIJEN.js.map +0 -1
  33. package/dist/foundation-models-language-model-strategy-WDSQWU64.js.map +0 -1
  34. package/dist/orchestration-embedding-model-strategy-66QYAO64.js.map +0 -1
  35. package/dist/orchestration-language-model-strategy-4TKRZK7U.js.map +0 -1
@@ -23227,6 +23227,9 @@ var require_form_data = __commonJS({
23227
23227
  var setToStringTag = require_es_set_tostringtag();
23228
23228
  var hasOwn = require_hasown();
23229
23229
  var populate = require_populate();
23230
+ function escapeHeaderParam(str) {
23231
+ return String(str).replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/"/g, "%22");
23232
+ }
23230
23233
  function FormData2(options) {
23231
23234
  if (!(this instanceof FormData2)) {
23232
23235
  return new FormData2(options);
@@ -23316,7 +23319,7 @@ var require_form_data = __commonJS({
23316
23319
  var contents = "";
23317
23320
  var headers = {
23318
23321
  // add custom disposition as third element or keep it two elements if not
23319
- "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []),
23322
+ "Content-Disposition": ["form-data", 'name="' + escapeHeaderParam(field) + '"'].concat(contentDisposition || []),
23320
23323
  // if no content type. allow it to be empty array
23321
23324
  "Content-Type": [].concat(contentType || [])
23322
23325
  };
@@ -23350,7 +23353,7 @@ var require_form_data = __commonJS({
23350
23353
  filename = path.basename(value.client._httpMessage.path || "");
23351
23354
  }
23352
23355
  if (filename) {
23353
- return 'filename="' + filename + '"';
23356
+ return 'filename="' + escapeHeaderParam(filename) + '"';
23354
23357
  }
23355
23358
  };
23356
23359
  FormData2.prototype._getContentType = function(value, options) {
@@ -25194,6 +25197,25 @@ var require_axios = __commonJS({
25194
25197
  iterator,
25195
25198
  toStringTag
25196
25199
  } = Symbol;
25200
+ var hasOwnProperty = (({
25201
+ hasOwnProperty: hasOwnProperty2
25202
+ }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
25203
+ var hasOwnInPrototypeChain = (thing, prop) => {
25204
+ let obj = thing;
25205
+ const seen = [];
25206
+ while (obj != null && obj !== Object.prototype) {
25207
+ if (seen.indexOf(obj) !== -1) {
25208
+ return false;
25209
+ }
25210
+ seen.push(obj);
25211
+ if (hasOwnProperty(obj, prop)) {
25212
+ return true;
25213
+ }
25214
+ obj = getPrototypeOf(obj);
25215
+ }
25216
+ return false;
25217
+ };
25218
+ var getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : void 0;
25197
25219
  var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
25198
25220
  const str = toString2.call(thing);
25199
25221
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
@@ -25226,11 +25248,14 @@ var require_axios = __commonJS({
25226
25248
  var isObject = (thing) => thing !== null && typeof thing === "object";
25227
25249
  var isBoolean = (thing) => thing === true || thing === false;
25228
25250
  var isPlainObject2 = (val) => {
25229
- if (kindOf(val) !== "object") {
25251
+ if (!isObject(val)) {
25230
25252
  return false;
25231
25253
  }
25232
25254
  const prototype2 = getPrototypeOf(val);
25233
- return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
25255
+ return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
25256
+ // Symbol.iterator as evidence the value is a tagged/iterable type rather
25257
+ // than a plain object, while ignoring keys injected onto Object.prototype.
25258
+ !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
25234
25259
  };
25235
25260
  var isEmptyObject = (val) => {
25236
25261
  if (!isObject(val) || isBuffer(val)) {
@@ -25334,7 +25359,7 @@ var require_axios = __commonJS({
25334
25359
  if (key === "__proto__" || key === "constructor" || key === "prototype") {
25335
25360
  return;
25336
25361
  }
25337
- const targetKey = caseless && findKey(result, key) || key;
25362
+ const targetKey = caseless && typeof key === "string" && findKey(result, key) || key;
25338
25363
  const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : void 0;
25339
25364
  if (isPlainObject2(existing) && isPlainObject2(val)) {
25340
25365
  result[targetKey] = merge(existing, val);
@@ -25347,7 +25372,21 @@ var require_axios = __commonJS({
25347
25372
  }
25348
25373
  };
25349
25374
  for (let i = 0, l = objs.length; i < l; i++) {
25350
- objs[i] && forEach(objs[i], assignValue);
25375
+ const source = objs[i];
25376
+ if (!source || isBuffer(source)) {
25377
+ continue;
25378
+ }
25379
+ forEach(source, assignValue);
25380
+ if (typeof source !== "object" || isArray(source)) {
25381
+ continue;
25382
+ }
25383
+ const symbols = Object.getOwnPropertySymbols(source);
25384
+ for (let j = 0; j < symbols.length; j++) {
25385
+ const symbol = symbols[j];
25386
+ if (propertyIsEnumerable.call(source, symbol)) {
25387
+ assignValue(source[symbol], symbol);
25388
+ }
25389
+ }
25351
25390
  }
25352
25391
  return result;
25353
25392
  }
@@ -25469,9 +25508,9 @@ var require_axios = __commonJS({
25469
25508
  return p1.toUpperCase() + p2;
25470
25509
  });
25471
25510
  };
25472
- var hasOwnProperty = (({
25473
- hasOwnProperty: hasOwnProperty2
25474
- }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
25511
+ var {
25512
+ propertyIsEnumerable
25513
+ } = Object.prototype;
25475
25514
  var isRegExp = kindOfTest("RegExp");
25476
25515
  var reduceDescriptors = (obj, reducer) => {
25477
25516
  const descriptors = Object.getOwnPropertyDescriptors(obj);
@@ -25569,6 +25608,7 @@ var require_axios = __commonJS({
25569
25608
  })(typeof setImmediate === "function", isFunction$1(_global.postMessage));
25570
25609
  var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
25571
25610
  var isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
25611
+ var isSafeIterable = (thing) => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
25572
25612
  var utils$1 = {
25573
25613
  isArray,
25574
25614
  isArrayBuffer,
@@ -25614,6 +25654,8 @@ var require_axios = __commonJS({
25614
25654
  hasOwnProperty,
25615
25655
  hasOwnProp: hasOwnProperty,
25616
25656
  // an alias to avoid ESLint no-prototype-builtins detection
25657
+ hasOwnInPrototypeChain,
25658
+ getSafeProp,
25617
25659
  reduceDescriptors,
25618
25660
  freezeMethods,
25619
25661
  toObjectSet,
@@ -25629,7 +25671,8 @@ var require_axios = __commonJS({
25629
25671
  isThenable,
25630
25672
  setImmediate: _setImmediate,
25631
25673
  asap,
25632
- isIterable
25674
+ isIterable,
25675
+ isSafeIterable
25633
25676
  };
25634
25677
  var ignoreDuplicateOf = utils$1.toObjectSet(["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"]);
25635
25678
  var parseHeaders = (rawHeaders) => {
@@ -25755,7 +25798,7 @@ var require_axios = __commonJS({
25755
25798
  function setHeader(_value, _header, _rewrite) {
25756
25799
  const lHeader = normalizeHeader(_header);
25757
25800
  if (!lHeader) {
25758
- throw new Error("header name must be a non-empty string");
25801
+ return;
25759
25802
  }
25760
25803
  const key = utils$1.findKey(self2, lHeader);
25761
25804
  if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
@@ -25767,13 +25810,19 @@ var require_axios = __commonJS({
25767
25810
  setHeaders(header, valueOrRewrite);
25768
25811
  } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
25769
25812
  setHeaders(parseHeaders(header), valueOrRewrite);
25770
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
25771
- let obj = {}, dest, key;
25813
+ } else if (utils$1.isObject(header) && utils$1.isSafeIterable(header)) {
25814
+ let obj = /* @__PURE__ */ Object.create(null), dest, key;
25772
25815
  for (const entry of header) {
25773
25816
  if (!utils$1.isArray(entry)) {
25774
- throw TypeError("Object iterator must return a key-value pair");
25817
+ throw new TypeError("Object iterator must return a key-value pair");
25818
+ }
25819
+ key = entry[0];
25820
+ if (utils$1.hasOwnProp(obj, key)) {
25821
+ dest = obj[key];
25822
+ obj[key] = utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];
25823
+ } else {
25824
+ obj[key] = entry[1];
25775
25825
  }
25776
- obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
25777
25826
  }
25778
25827
  setHeaders(obj, valueOrRewrite);
25779
25828
  } else {
@@ -25978,7 +26027,13 @@ var require_axios = __commonJS({
25978
26027
  var AxiosError = class _AxiosError extends Error {
25979
26028
  static from(error, code, config, request, response, customProps) {
25980
26029
  const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
25981
- axiosError.cause = error;
26030
+ Object.defineProperty(axiosError, "cause", {
26031
+ __proto__: null,
26032
+ value: error,
26033
+ writable: true,
26034
+ enumerable: false,
26035
+ configurable: true
26036
+ });
25982
26037
  axiosError.name = error.name;
25983
26038
  if (error.status != null && axiosError.status == null) {
25984
26039
  axiosError.status = error.status;
@@ -26055,6 +26110,7 @@ var require_axios = __commonJS({
26055
26110
  AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
26056
26111
  AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
26057
26112
  AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
26113
+ var DEFAULT_FORM_DATA_MAX_DEPTH = 100;
26058
26114
  function isVisitable(thing) {
26059
26115
  return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
26060
26116
  }
@@ -26091,8 +26147,9 @@ var require_axios = __commonJS({
26091
26147
  const dots = options.dots;
26092
26148
  const indexes = options.indexes;
26093
26149
  const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
26094
- const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth;
26150
+ const maxDepth = options.maxDepth === void 0 ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;
26095
26151
  const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
26152
+ const stack = [];
26096
26153
  if (!utils$1.isFunction(visitor)) {
26097
26154
  throw new TypeError("visitor must be a function");
26098
26155
  }
@@ -26108,10 +26165,38 @@ var require_axios = __commonJS({
26108
26165
  throw new AxiosError("Blob is not supported. Use a Buffer instead.");
26109
26166
  }
26110
26167
  if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
26111
- return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
26168
+ if (useBlob && typeof _Blob === "function") {
26169
+ return new _Blob([value]);
26170
+ }
26171
+ if (typeof Buffer !== "undefined") {
26172
+ return Buffer.from(value);
26173
+ }
26174
+ throw new AxiosError("Blob is not supported. Use a Buffer instead.", AxiosError.ERR_NOT_SUPPORT);
26112
26175
  }
26113
26176
  return value;
26114
26177
  }
26178
+ function throwIfMaxDepthExceeded(depth) {
26179
+ if (depth > maxDepth) {
26180
+ throw new AxiosError("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
26181
+ }
26182
+ }
26183
+ function stringifyWithDepthLimit(value, depth) {
26184
+ if (maxDepth === Infinity) {
26185
+ return JSON.stringify(value);
26186
+ }
26187
+ const ancestors = [];
26188
+ return JSON.stringify(value, function limitDepth(_key, currentValue) {
26189
+ if (!utils$1.isObject(currentValue)) {
26190
+ return currentValue;
26191
+ }
26192
+ while (ancestors.length && ancestors[ancestors.length - 1] !== this) {
26193
+ ancestors.pop();
26194
+ }
26195
+ ancestors.push(currentValue);
26196
+ throwIfMaxDepthExceeded(depth + ancestors.length - 1);
26197
+ return currentValue;
26198
+ });
26199
+ }
26115
26200
  function defaultVisitor(value, key, path2) {
26116
26201
  let arr = value;
26117
26202
  if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
@@ -26121,7 +26206,7 @@ var require_axios = __commonJS({
26121
26206
  if (value && !path2 && typeof value === "object") {
26122
26207
  if (utils$1.endsWith(key, "{}")) {
26123
26208
  key = metaTokens ? key : key.slice(0, -2);
26124
- value = JSON.stringify(value);
26209
+ value = stringifyWithDepthLimit(value, 1);
26125
26210
  } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
26126
26211
  key = removeBrackets(key);
26127
26212
  arr.forEach(function each(el, index) {
@@ -26140,7 +26225,6 @@ var require_axios = __commonJS({
26140
26225
  formData.append(renderKey(path2, key, dots), convertValue(value));
26141
26226
  return false;
26142
26227
  }
26143
- const stack = [];
26144
26228
  const exposedHelpers = Object.assign(predicates, {
26145
26229
  defaultVisitor,
26146
26230
  convertValue,
@@ -26148,11 +26232,9 @@ var require_axios = __commonJS({
26148
26232
  });
26149
26233
  function build(value, path2, depth = 0) {
26150
26234
  if (utils$1.isUndefined(value)) return;
26151
- if (depth > maxDepth) {
26152
- throw new AxiosError("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
26153
- }
26235
+ throwIfMaxDepthExceeded(depth);
26154
26236
  if (stack.indexOf(value) !== -1) {
26155
- throw Error("Circular reference detected in " + path2.join("."));
26237
+ throw new Error("Circular reference detected in " + path2.join("."));
26156
26238
  }
26157
26239
  stack.push(value);
26158
26240
  utils$1.forEach(value, function each(el, key) {
@@ -26191,9 +26273,7 @@ var require_axios = __commonJS({
26191
26273
  this._pairs.push([name, value]);
26192
26274
  };
26193
26275
  prototype.toString = function toString3(encoder) {
26194
- const _encode = encoder ? function(value) {
26195
- return encoder.call(this, value, encode$1);
26196
- } : encode$1;
26276
+ const _encode = encoder ? (value) => encoder.call(this, value, encode$1) : encode$1;
26197
26277
  return this._pairs.map(function each(pair) {
26198
26278
  return _encode(pair[0]) + "=" + _encode(pair[1]);
26199
26279
  }, "").join("&");
@@ -26205,11 +26285,12 @@ var require_axios = __commonJS({
26205
26285
  if (!params) {
26206
26286
  return url2;
26207
26287
  }
26208
- const _encode = options && options.encode || encode;
26288
+ url2 = url2 || "";
26209
26289
  const _options = utils$1.isFunction(options) ? {
26210
26290
  serialize: options
26211
26291
  } : options;
26212
- const serializeFn = _options && _options.serialize;
26292
+ const _encode = utils$1.getSafeProp(_options, "encode") || encode;
26293
+ const serializeFn = utils$1.getSafeProp(_options, "serialize");
26213
26294
  let serializedParams;
26214
26295
  if (serializeFn) {
26215
26296
  serializedParams = serializeFn(params, _options);
@@ -26291,7 +26372,9 @@ var require_axios = __commonJS({
26291
26372
  silentJSONParsing: true,
26292
26373
  forcedJSONParsing: true,
26293
26374
  clarifyTimeoutError: false,
26294
- legacyInterceptorReqResOrdering: true
26375
+ legacyInterceptorReqResOrdering: true,
26376
+ advertiseZstdAcceptEncoding: false,
26377
+ validateStatusUndefinedResolves: true
26295
26378
  };
26296
26379
  var URLSearchParams = url.URLSearchParams;
26297
26380
  var ALPHA = "abcdefghijklmnopqrstuvwxyz";
@@ -26356,10 +26439,21 @@ var require_axios = __commonJS({
26356
26439
  ...options
26357
26440
  });
26358
26441
  }
26442
+ var MAX_DEPTH2 = DEFAULT_FORM_DATA_MAX_DEPTH;
26443
+ function throwIfDepthExceeded(index) {
26444
+ if (index > MAX_DEPTH2) {
26445
+ throw new AxiosError("FormData field is too deeply nested (" + index + " levels). Max depth: " + MAX_DEPTH2, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
26446
+ }
26447
+ }
26359
26448
  function parsePropPath(name) {
26360
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match2) => {
26361
- return match2[0] === "[]" ? "" : match2[1] || match2[0];
26362
- });
26449
+ const path2 = [];
26450
+ const pattern = /\w+|\[(\w*)]/g;
26451
+ let match2;
26452
+ while ((match2 = pattern.exec(name)) !== null) {
26453
+ throwIfDepthExceeded(path2.length);
26454
+ path2.push(match2[0] === "[]" ? "" : match2[1] || match2[0]);
26455
+ }
26456
+ return path2;
26363
26457
  }
26364
26458
  function arrayToObject(arr) {
26365
26459
  const obj = {};
@@ -26375,6 +26469,7 @@ var require_axios = __commonJS({
26375
26469
  }
26376
26470
  function formDataToJSON(formData) {
26377
26471
  function buildPath(path2, value, target, index) {
26472
+ throwIfDepthExceeded(index);
26378
26473
  let name = path2[index++];
26379
26474
  if (name === "__proto__") return true;
26380
26475
  const isNumericKey = Number.isFinite(+name);
@@ -26561,9 +26656,28 @@ var require_axios = __commonJS({
26561
26656
  function combineURLs(baseURL, relativeURL) {
26562
26657
  return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
26563
26658
  }
26564
- function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
26659
+ var malformedHttpProtocol = /^https?:(?!\/\/)/i;
26660
+ var httpProtocolControlCharacters = /[\t\n\r]/g;
26661
+ function stripLeadingC0ControlOrSpace(url2) {
26662
+ let i = 0;
26663
+ while (i < url2.length && url2.charCodeAt(i) <= 32) {
26664
+ i++;
26665
+ }
26666
+ return url2.slice(i);
26667
+ }
26668
+ function normalizeURLForProtocolCheck(url2) {
26669
+ return stripLeadingC0ControlOrSpace(url2).replace(httpProtocolControlCharacters, "");
26670
+ }
26671
+ function assertValidHttpProtocolURL(url2, config) {
26672
+ if (typeof url2 === "string" && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url2))) {
26673
+ throw new AxiosError('Invalid URL: missing "//" after protocol', AxiosError.ERR_INVALID_URL, config);
26674
+ }
26675
+ }
26676
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
26677
+ assertValidHttpProtocolURL(requestedURL, config);
26565
26678
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
26566
26679
  if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
26680
+ assertValidHttpProtocolURL(baseURL, config);
26567
26681
  return combineURLs(baseURL, requestedURL);
26568
26682
  }
26569
26683
  return requestedURL;
@@ -26633,7 +26747,7 @@ var require_axios = __commonJS({
26633
26747
  function getEnv(key) {
26634
26748
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
26635
26749
  }
26636
- var VERSION2 = "1.16.1";
26750
+ var VERSION2 = "1.18.1";
26637
26751
  function parseProtocol(url2) {
26638
26752
  const match2 = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url2);
26639
26753
  return match2 && match2[1] || "";
@@ -26655,13 +26769,13 @@ var require_axios = __commonJS({
26655
26769
  const params = match2[2];
26656
26770
  const encoding = match2[3] ? "base64" : "utf8";
26657
26771
  const body = match2[4];
26658
- let mime;
26772
+ let mime = "";
26659
26773
  if (type) {
26660
26774
  mime = params ? type + params : type;
26661
26775
  } else if (params) {
26662
26776
  mime = "text/plain" + params;
26663
26777
  }
26664
- const buffer = Buffer.from(decodeURIComponent(body), encoding);
26778
+ const buffer = encoding === "base64" ? Buffer.from(body, "base64") : Buffer.from(decodeURIComponent(body), encoding);
26665
26779
  if (asBlob) {
26666
26780
  if (!_Blob) {
26667
26781
  throw new AxiosError("Blob is not supported", AxiosError.ERR_NOT_SUPPORT);
@@ -26850,10 +26964,10 @@ var require_axios = __commonJS({
26850
26964
  boundary = tag + "-" + platform.generateString(size, BOUNDARY_ALPHABET)
26851
26965
  } = options || {};
26852
26966
  if (!utils$1.isFormData(form)) {
26853
- throw TypeError("FormData instance required");
26967
+ throw new TypeError("FormData instance required");
26854
26968
  }
26855
26969
  if (boundary.length < 1 || boundary.length > 70) {
26856
- throw Error("boundary must be 1-70 characters long");
26970
+ throw new Error("boundary must be 1-70 characters long");
26857
26971
  }
26858
26972
  const boundaryBytes = textEncoder.encode("--" + boundary + CRLF);
26859
26973
  const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF);
@@ -26898,6 +27012,81 @@ var require_axios = __commonJS({
26898
27012
  this.__transform(chunk, encoding, callback);
26899
27013
  }
26900
27014
  };
27015
+ var Http2Sessions = class {
27016
+ constructor() {
27017
+ this.sessions = /* @__PURE__ */ Object.create(null);
27018
+ }
27019
+ getSession(authority, options) {
27020
+ options = Object.assign({
27021
+ sessionTimeout: 1e3
27022
+ }, options);
27023
+ let authoritySessions = this.sessions[authority];
27024
+ if (authoritySessions) {
27025
+ let len = authoritySessions.length;
27026
+ for (let i = 0; i < len; i++) {
27027
+ const [sessionHandle, sessionOptions] = authoritySessions[i];
27028
+ if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) {
27029
+ return sessionHandle;
27030
+ }
27031
+ }
27032
+ }
27033
+ const session = http2.connect(authority, options);
27034
+ let removed;
27035
+ let timer;
27036
+ const removeSession = () => {
27037
+ if (removed) {
27038
+ return;
27039
+ }
27040
+ removed = true;
27041
+ if (timer) {
27042
+ clearTimeout(timer);
27043
+ timer = null;
27044
+ }
27045
+ let entries = authoritySessions, len = entries.length, i = len;
27046
+ while (i--) {
27047
+ if (entries[i][0] === session) {
27048
+ if (len === 1) {
27049
+ delete this.sessions[authority];
27050
+ } else {
27051
+ entries.splice(i, 1);
27052
+ }
27053
+ if (!session.closed) {
27054
+ session.close();
27055
+ }
27056
+ return;
27057
+ }
27058
+ }
27059
+ };
27060
+ const originalRequestFn = session.request;
27061
+ const {
27062
+ sessionTimeout
27063
+ } = options;
27064
+ if (sessionTimeout != null) {
27065
+ let streamsCount = 0;
27066
+ session.request = function() {
27067
+ const stream2 = originalRequestFn.apply(this, arguments);
27068
+ streamsCount++;
27069
+ if (timer) {
27070
+ clearTimeout(timer);
27071
+ timer = null;
27072
+ }
27073
+ stream2.once("close", () => {
27074
+ if (!--streamsCount) {
27075
+ timer = setTimeout(() => {
27076
+ timer = null;
27077
+ removeSession();
27078
+ }, sessionTimeout);
27079
+ }
27080
+ });
27081
+ return stream2;
27082
+ };
27083
+ }
27084
+ session.once("close", removeSession);
27085
+ let entry = [session, options];
27086
+ authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
27087
+ return session;
27088
+ }
27089
+ };
26901
27090
  var callbackify = (fn, reducer) => {
26902
27091
  return utils$1.isAsyncFn(fn) ? function(...args) {
26903
27092
  const cb = args.pop();
@@ -26910,13 +27099,29 @@ var require_axios = __commonJS({
26910
27099
  }, cb);
26911
27100
  } : fn;
26912
27101
  };
26913
- var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost"]);
27102
+ var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "0.0.0.0"]);
26914
27103
  var isIPv4Loopback = (host) => {
26915
27104
  const parts = host.split(".");
26916
27105
  if (parts.length !== 4) return false;
26917
27106
  if (parts[0] !== "127") return false;
26918
27107
  return parts.every((p) => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255);
26919
27108
  };
27109
+ var isIPv6ZeroGroup = (group) => /^0{1,4}$/.test(group);
27110
+ var isIPv6Unspecified = (host) => {
27111
+ if (host === "::") return true;
27112
+ const compressionIndex = host.indexOf("::");
27113
+ if (compressionIndex !== -1) {
27114
+ if (compressionIndex !== host.lastIndexOf("::")) return false;
27115
+ const left = host.slice(0, compressionIndex);
27116
+ const right = host.slice(compressionIndex + 2);
27117
+ const leftGroups = left ? left.split(":") : [];
27118
+ const rightGroups = right ? right.split(":") : [];
27119
+ const explicitGroups = leftGroups.length + rightGroups.length;
27120
+ return explicitGroups < 8 && leftGroups.every(isIPv6ZeroGroup) && rightGroups.every(isIPv6ZeroGroup);
27121
+ }
27122
+ const groups = host.split(":");
27123
+ return groups.length === 8 && groups.every(isIPv6ZeroGroup);
27124
+ };
26920
27125
  var isIPv6Loopback = (host) => {
26921
27126
  if (host === "::1") return true;
26922
27127
  const v4MappedDotted = host.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);
@@ -26939,6 +27144,7 @@ var require_axios = __commonJS({
26939
27144
  if (!host) return false;
26940
27145
  if (LOOPBACK_HOSTNAMES.has(host)) return true;
26941
27146
  if (isIPv4Loopback(host)) return true;
27147
+ if (isIPv6Unspecified(host)) return true;
26942
27148
  return isIPv6Loopback(host);
26943
27149
  };
26944
27150
  var DEFAULT_PORTS = {
@@ -27131,6 +27337,8 @@ var require_axios = __commonJS({
27131
27337
  }), throttled[1]];
27132
27338
  };
27133
27339
  var asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
27340
+ var isHexDigit = (charCode) => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
27341
+ var isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
27134
27342
  function estimateDataURLDecodedBytes(url2) {
27135
27343
  if (!url2 || typeof url2 !== "string") return 0;
27136
27344
  if (!url2.startsWith("data:")) return 0;
@@ -27146,7 +27354,7 @@ var require_axios = __commonJS({
27146
27354
  if (body.charCodeAt(i) === 37 && i + 2 < len) {
27147
27355
  const a = body.charCodeAt(i + 1);
27148
27356
  const b = body.charCodeAt(i + 2);
27149
- const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102);
27357
+ const isHex = isHexDigit(a) && isHexDigit(b);
27150
27358
  if (isHex) {
27151
27359
  effectiveLen -= 2;
27152
27360
  i += 2;
@@ -27178,13 +27386,13 @@ var require_axios = __commonJS({
27178
27386
  const bytes2 = groups * 3 - (pad3 || 0);
27179
27387
  return bytes2 > 0 ? bytes2 : 0;
27180
27388
  }
27181
- if (typeof Buffer !== "undefined" && typeof Buffer.byteLength === "function") {
27182
- return Buffer.byteLength(body, "utf8");
27183
- }
27184
27389
  let bytes = 0;
27185
27390
  for (let i = 0, len = body.length; i < len; i++) {
27186
27391
  const c = body.charCodeAt(i);
27187
- if (c < 128) {
27392
+ if (c === 37 && isPercentEncodedByte(body, i, len)) {
27393
+ bytes += 1;
27394
+ i += 2;
27395
+ } else if (c < 128) {
27188
27396
  bytes += 1;
27189
27397
  } else if (c < 2048) {
27190
27398
  bytes += 2;
@@ -27210,7 +27418,14 @@ var require_axios = __commonJS({
27210
27418
  flush: zlib.constants.BROTLI_OPERATION_FLUSH,
27211
27419
  finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
27212
27420
  };
27421
+ var zstdOptions = {
27422
+ flush: zlib.constants.ZSTD_e_flush,
27423
+ finishFlush: zlib.constants.ZSTD_e_flush
27424
+ };
27213
27425
  var isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress);
27426
+ var isZstdSupported = utils$1.isFunction(zlib.createZstdDecompress);
27427
+ var ACCEPT_ENCODING = "gzip, compress, deflate" + (isBrotliSupported ? ", br" : "");
27428
+ var ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ", zstd" : "");
27214
27429
  var {
27215
27430
  http: httpFollow,
27216
27431
  https: httpsFollow
@@ -27233,6 +27448,33 @@ var require_axios = __commonJS({
27233
27448
  var kAxiosInstalledTunnel = /* @__PURE__ */ Symbol("axios.http.installedTunnel");
27234
27449
  var tunnelingAgentCache = /* @__PURE__ */ new Map();
27235
27450
  var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap();
27451
+ var NODE_NATIVE_ENV_PROXY_SUPPORT = {
27452
+ 22: 21,
27453
+ 24: 5
27454
+ };
27455
+ function isNodeNativeEnvProxySupported(nodeVersion = process.versions && process.versions.node) {
27456
+ if (!nodeVersion) {
27457
+ return false;
27458
+ }
27459
+ const [major, minor] = nodeVersion.split(".").map((part) => Number(part));
27460
+ if (!Number.isInteger(major) || !Number.isInteger(minor)) {
27461
+ return false;
27462
+ }
27463
+ if (major > 24) {
27464
+ return true;
27465
+ }
27466
+ return NODE_NATIVE_ENV_PROXY_SUPPORT[major] != null && minor >= NODE_NATIVE_ENV_PROXY_SUPPORT[major];
27467
+ }
27468
+ function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.versions.node) {
27469
+ if (!isNodeNativeEnvProxySupported(nodeVersion)) {
27470
+ return false;
27471
+ }
27472
+ const agentOptions = agent && agent.options;
27473
+ return Boolean(agentOptions && utils$1.hasOwnProp(agentOptions, "proxyEnv") && agentOptions.proxyEnv != null);
27474
+ }
27475
+ function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {
27476
+ return isHttps.test(options.protocol) ? configHttpsAgent || https.globalAgent : configHttpAgent || http.globalAgent;
27477
+ }
27236
27478
  function getTunnelingAgent(agentOptions, userHttpsAgent) {
27237
27479
  const key = agentOptions.protocol + "//" + agentOptions.hostname + ":" + (agentOptions.port || "") + "#" + (agentOptions.auth || "");
27238
27480
  const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, /* @__PURE__ */ new Map()).get(userHttpsAgent) : tunnelingAgentCache;
@@ -27243,6 +27485,18 @@ var require_axios = __commonJS({
27243
27485
  ...agentOptions
27244
27486
  } : agentOptions;
27245
27487
  agent = new HttpsProxyAgent(merged);
27488
+ if (userHttpsAgent && userHttpsAgent.options) {
27489
+ const originTLSOptions = {
27490
+ ...userHttpsAgent.options
27491
+ };
27492
+ const callback = agent.callback;
27493
+ agent.callback = function axiosTunnelingAgentCallback(req, opts) {
27494
+ return callback.call(this, req, {
27495
+ ...originTLSOptions,
27496
+ ...opts
27497
+ });
27498
+ };
27499
+ }
27246
27500
  agent[kAxiosInstalledTunnel] = true;
27247
27501
  cache.set(key, agent);
27248
27502
  return agent;
@@ -27250,7 +27504,7 @@ var require_axios = __commonJS({
27250
27504
  var supportedProtocols = platform.protocols.map((protocol) => {
27251
27505
  return protocol + ":";
27252
27506
  });
27253
- var decodeURIComponentSafe = (value) => {
27507
+ var decodeURIComponentSafe$1 = (value) => {
27254
27508
  if (!utils$1.isString(value)) {
27255
27509
  return value;
27256
27510
  }
@@ -27264,89 +27518,45 @@ var require_axios = __commonJS({
27264
27518
  stream2.on("end", flush).on("error", flush);
27265
27519
  return throttled;
27266
27520
  };
27267
- var Http2Sessions = class {
27268
- constructor() {
27269
- this.sessions = /* @__PURE__ */ Object.create(null);
27270
- }
27271
- getSession(authority, options) {
27272
- options = Object.assign({
27273
- sessionTimeout: 1e3
27274
- }, options);
27275
- let authoritySessions = this.sessions[authority];
27276
- if (authoritySessions) {
27277
- let len = authoritySessions.length;
27278
- for (let i = 0; i < len; i++) {
27279
- const [sessionHandle, sessionOptions] = authoritySessions[i];
27280
- if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) {
27281
- return sessionHandle;
27282
- }
27283
- }
27284
- }
27285
- const session = http2.connect(authority, options);
27286
- let removed;
27287
- const removeSession = () => {
27288
- if (removed) {
27289
- return;
27290
- }
27291
- removed = true;
27292
- let entries = authoritySessions, len = entries.length, i = len;
27293
- while (i--) {
27294
- if (entries[i][0] === session) {
27295
- if (len === 1) {
27296
- delete this.sessions[authority];
27297
- } else {
27298
- entries.splice(i, 1);
27299
- }
27300
- if (!session.closed) {
27301
- session.close();
27302
- }
27303
- return;
27304
- }
27305
- }
27306
- };
27307
- const originalRequestFn = session.request;
27308
- const {
27309
- sessionTimeout
27310
- } = options;
27311
- if (sessionTimeout != null) {
27312
- let timer;
27313
- let streamsCount = 0;
27314
- session.request = function() {
27315
- const stream2 = originalRequestFn.apply(this, arguments);
27316
- streamsCount++;
27317
- if (timer) {
27318
- clearTimeout(timer);
27319
- timer = null;
27320
- }
27321
- stream2.once("close", () => {
27322
- if (!--streamsCount) {
27323
- timer = setTimeout(() => {
27324
- timer = null;
27325
- removeSession();
27326
- }, sessionTimeout);
27327
- }
27328
- });
27329
- return stream2;
27330
- };
27331
- }
27332
- session.once("close", removeSession);
27333
- let entry = [session, options];
27334
- authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
27335
- return session;
27336
- }
27337
- };
27338
27521
  var http2Sessions = new Http2Sessions();
27339
27522
  function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
27340
27523
  if (options.beforeRedirects.proxy) {
27341
27524
  options.beforeRedirects.proxy(options);
27342
27525
  }
27526
+ if (options.beforeRedirects.auth) {
27527
+ options.beforeRedirects.auth(options);
27528
+ }
27529
+ if (options.beforeRedirects.sensitiveHeaders) {
27530
+ options.beforeRedirects.sensitiveHeaders(options, requestDetails);
27531
+ }
27343
27532
  if (options.beforeRedirects.config) {
27344
27533
  options.beforeRedirects.config(options, responseDetails, requestDetails);
27345
27534
  }
27346
27535
  }
27347
- function setProxy(options, configProxy, location, isRedirect, configHttpsAgent) {
27536
+ function stripMatchingHeaders(headers, sensitiveSet) {
27537
+ if (!headers) {
27538
+ return;
27539
+ }
27540
+ Object.keys(headers).forEach((header) => {
27541
+ if (sensitiveSet.has(header.toLowerCase())) {
27542
+ delete headers[header];
27543
+ }
27544
+ });
27545
+ }
27546
+ function isSameOriginRedirect(redirectOptions, requestDetails) {
27547
+ if (!requestDetails) {
27548
+ return false;
27549
+ }
27550
+ try {
27551
+ return new URL(requestDetails.url).origin === new URL(redirectOptions.href).origin;
27552
+ } catch (e) {
27553
+ return false;
27554
+ }
27555
+ }
27556
+ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) {
27348
27557
  let proxy = configProxy;
27349
- if (!proxy && proxy !== false) {
27558
+ const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent);
27559
+ if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) {
27350
27560
  const proxyUrl = getProxyForUrl(location);
27351
27561
  if (proxyUrl) {
27352
27562
  if (!shouldBypassProxy(location)) {
@@ -27437,7 +27647,7 @@ var require_axios = __commonJS({
27437
27647
  }
27438
27648
  }
27439
27649
  options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
27440
- setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent);
27650
+ setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent);
27441
27651
  };
27442
27652
  }
27443
27653
  var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process";
@@ -27514,16 +27724,25 @@ var require_axios = __commonJS({
27514
27724
  };
27515
27725
  var httpAdapter = isHttpAdapterSupported && function httpAdapter2(config) {
27516
27726
  return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
27517
- const own2 = (key) => utils$1.hasOwnProp(config, key) ? config[key] : void 0;
27727
+ const own2 = (key) => utils$1.getSafeProp(config, key);
27728
+ const transitional = own2("transitional") || transitionalDefaults;
27518
27729
  let data = own2("data");
27519
27730
  let lookup = own2("lookup");
27520
27731
  let family = own2("family");
27521
27732
  let httpVersion = own2("httpVersion");
27522
27733
  if (httpVersion === void 0) httpVersion = 1;
27523
27734
  let http2Options = own2("http2Options");
27735
+ const httpAgent = own2("httpAgent");
27736
+ const httpsAgent = own2("httpsAgent");
27737
+ const configProxy = own2("proxy");
27524
27738
  const responseType = own2("responseType");
27525
27739
  const responseEncoding = own2("responseEncoding");
27526
- const method = config.method.toUpperCase();
27740
+ const socketPath = own2("socketPath");
27741
+ const method = own2("method").toUpperCase();
27742
+ const maxRedirects = own2("maxRedirects");
27743
+ const maxBodyLength = own2("maxBodyLength");
27744
+ const maxContentLength = own2("maxContentLength");
27745
+ const decompress = own2("decompress");
27527
27746
  let isDone;
27528
27747
  let rejected = false;
27529
27748
  let req;
@@ -27553,7 +27772,6 @@ var require_axios = __commonJS({
27553
27772
  try {
27554
27773
  abortEmitter.emit("abort", !reason || reason.type ? new CanceledError(null, config, req) : reason);
27555
27774
  } catch (err) {
27556
- console.warn("emit error", err);
27557
27775
  }
27558
27776
  }
27559
27777
  function clearConnectPhaseTimer() {
@@ -27563,10 +27781,11 @@ var require_axios = __commonJS({
27563
27781
  }
27564
27782
  }
27565
27783
  function createTimeoutError() {
27566
- let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
27567
- const transitional = config.transitional || transitionalDefaults;
27568
- if (config.timeoutErrorMessage) {
27569
- timeoutErrorMessage = config.timeoutErrorMessage;
27784
+ const configTimeout = own2("timeout");
27785
+ let timeoutErrorMessage = configTimeout ? "timeout of " + configTimeout + "ms exceeded" : "timeout exceeded";
27786
+ const configTimeoutErrorMessage = own2("timeoutErrorMessage");
27787
+ if (configTimeoutErrorMessage) {
27788
+ timeoutErrorMessage = configTimeoutErrorMessage;
27570
27789
  }
27571
27790
  return new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req);
27572
27791
  }
@@ -27607,15 +27826,16 @@ var require_axios = __commonJS({
27607
27826
  onFinished();
27608
27827
  }
27609
27828
  });
27610
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
27611
- const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : void 0);
27829
+ const fullPath = buildFullPath(own2("baseURL"), own2("url"), own2("allowAbsoluteUrls"), config);
27830
+ const urlBase = socketPath ? "http://localhost" : platform.hasBrowserEnv ? platform.origin : void 0;
27831
+ const parsed = new URL(fullPath, urlBase);
27612
27832
  const protocol = parsed.protocol || supportedProtocols[0];
27613
27833
  if (protocol === "data:") {
27614
- if (config.maxContentLength > -1) {
27615
- const dataUrl = String(config.url || fullPath || "");
27834
+ if (maxContentLength > -1) {
27835
+ const dataUrl = String(own2("url") || fullPath || "");
27616
27836
  const estimated = estimateDataURLDecodedBytes(dataUrl);
27617
- if (estimated > config.maxContentLength) {
27618
- return reject(new AxiosError("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config));
27837
+ if (estimated > maxContentLength) {
27838
+ return reject(new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config));
27619
27839
  }
27620
27840
  }
27621
27841
  let convertedData;
@@ -27628,7 +27848,7 @@ var require_axios = __commonJS({
27628
27848
  });
27629
27849
  }
27630
27850
  try {
27631
- convertedData = fromDataURI(config.url, responseType === "blob", {
27851
+ convertedData = fromDataURI(own2("url"), responseType === "blob", {
27632
27852
  Blob: config.env && config.env.Blob
27633
27853
  });
27634
27854
  } catch (err) {
@@ -27693,7 +27913,7 @@ var require_axios = __commonJS({
27693
27913
  return reject(new AxiosError("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", AxiosError.ERR_BAD_REQUEST, config));
27694
27914
  }
27695
27915
  headers.setContentLength(data.length, false);
27696
- if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
27916
+ if (maxBodyLength > -1 && data.length > maxBodyLength) {
27697
27917
  return reject(new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config));
27698
27918
  }
27699
27919
  }
@@ -27718,34 +27938,33 @@ var require_axios = __commonJS({
27718
27938
  let auth = void 0;
27719
27939
  const configAuth = own2("auth");
27720
27940
  if (configAuth) {
27721
- const username = configAuth.username || "";
27722
- const password = configAuth.password || "";
27941
+ const username = utils$1.getSafeProp(configAuth, "username") || "";
27942
+ const password = utils$1.getSafeProp(configAuth, "password") || "";
27723
27943
  auth = username + ":" + password;
27724
27944
  }
27725
- if (!auth && parsed.username) {
27726
- const urlUsername = decodeURIComponentSafe(parsed.username);
27727
- const urlPassword = decodeURIComponentSafe(parsed.password);
27945
+ if (!auth && (parsed.username || parsed.password)) {
27946
+ const urlUsername = decodeURIComponentSafe$1(parsed.username);
27947
+ const urlPassword = decodeURIComponentSafe$1(parsed.password);
27728
27948
  auth = urlUsername + ":" + urlPassword;
27729
27949
  }
27730
27950
  auth && headers.delete("authorization");
27731
27951
  let path$1;
27732
27952
  try {
27733
- path$1 = buildURL(parsed.pathname + parsed.search, config.params, config.paramsSerializer).replace(/^\?/, "");
27953
+ path$1 = buildURL(parsed.pathname + parsed.search, own2("params"), own2("paramsSerializer")).replace(/^\?/, "");
27734
27954
  } catch (err) {
27735
- const customErr = new Error(err.message);
27736
- customErr.config = config;
27737
- customErr.url = config.url;
27738
- customErr.exists = true;
27739
- return reject(customErr);
27955
+ return reject(AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config, null, null, {
27956
+ url: own2("url"),
27957
+ exists: true
27958
+ }));
27740
27959
  }
27741
- headers.set("Accept-Encoding", "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), false);
27960
+ headers.set("Accept-Encoding", utils$1.hasOwnProp(transitional, "advertiseZstdAcceptEncoding") && transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING, false);
27742
27961
  const options = Object.assign(/* @__PURE__ */ Object.create(null), {
27743
27962
  path: path$1,
27744
27963
  method,
27745
27964
  headers: toByteStringHeaderObject(headers),
27746
27965
  agents: {
27747
- http: config.httpAgent,
27748
- https: config.httpsAgent
27966
+ http: httpAgent,
27967
+ https: httpsAgent
27749
27968
  },
27750
27969
  auth,
27751
27970
  protocol,
@@ -27755,29 +27974,31 @@ var require_axios = __commonJS({
27755
27974
  http2Options
27756
27975
  });
27757
27976
  !utils$1.isUndefined(lookup) && (options.lookup = lookup);
27758
- if (config.socketPath) {
27759
- if (typeof config.socketPath !== "string") {
27977
+ if (socketPath) {
27978
+ if (typeof socketPath !== "string") {
27760
27979
  return reject(new AxiosError("socketPath must be a string", AxiosError.ERR_BAD_OPTION_VALUE, config));
27761
27980
  }
27762
- if (config.allowedSocketPaths != null) {
27763
- const allowed = Array.isArray(config.allowedSocketPaths) ? config.allowedSocketPaths : [config.allowedSocketPaths];
27764
- const resolvedSocket = path.resolve(config.socketPath);
27981
+ const allowedSocketPaths = own2("allowedSocketPaths");
27982
+ if (allowedSocketPaths != null) {
27983
+ const allowed = Array.isArray(allowedSocketPaths) ? allowedSocketPaths : [allowedSocketPaths];
27984
+ const resolvedSocket = path.resolve(socketPath);
27765
27985
  const isAllowed = allowed.some((entry) => typeof entry === "string" && path.resolve(entry) === resolvedSocket);
27766
27986
  if (!isAllowed) {
27767
- return reject(new AxiosError(`socketPath "${config.socketPath}" is not permitted by allowedSocketPaths`, AxiosError.ERR_BAD_OPTION_VALUE, config));
27987
+ return reject(new AxiosError(`socketPath "${socketPath}" is not permitted by allowedSocketPaths`, AxiosError.ERR_BAD_OPTION_VALUE, config));
27768
27988
  }
27769
27989
  }
27770
- options.socketPath = config.socketPath;
27990
+ options.socketPath = socketPath;
27771
27991
  } else {
27772
27992
  options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
27773
27993
  options.port = parsed.port;
27774
- setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, config.httpsAgent);
27994
+ setProxy(options, configProxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, httpsAgent, httpAgent);
27775
27995
  }
27776
27996
  let transport;
27777
27997
  let isNativeTransport = false;
27998
+ let transportEnforcesMaxBodyLength = false;
27778
27999
  const isHttpsRequest = isHttps.test(options.protocol);
27779
28000
  if (options.agent == null) {
27780
- options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
28001
+ options.agent = isHttpsRequest ? httpsAgent : httpAgent;
27781
28002
  }
27782
28003
  if (isHttp2) {
27783
28004
  transport = http2Transport;
@@ -27785,22 +28006,57 @@ var require_axios = __commonJS({
27785
28006
  const configTransport = own2("transport");
27786
28007
  if (configTransport) {
27787
28008
  transport = configTransport;
27788
- } else if (config.maxRedirects === 0) {
28009
+ } else if (maxRedirects === 0) {
27789
28010
  transport = isHttpsRequest ? https : http;
27790
28011
  isNativeTransport = true;
27791
28012
  } else {
27792
- if (config.maxRedirects) {
27793
- options.maxRedirects = config.maxRedirects;
28013
+ transportEnforcesMaxBodyLength = true;
28014
+ options.sensitiveHeaders = [];
28015
+ if (maxRedirects) {
28016
+ options.maxRedirects = maxRedirects;
27794
28017
  }
27795
28018
  const configBeforeRedirect = own2("beforeRedirect");
27796
28019
  if (configBeforeRedirect) {
27797
28020
  options.beforeRedirects.config = configBeforeRedirect;
27798
28021
  }
28022
+ if (auth) {
28023
+ const requestOrigin = parsed.origin;
28024
+ const authToRestore = auth;
28025
+ options.beforeRedirects.auth = function beforeRedirectAuth(redirectOptions) {
28026
+ try {
28027
+ if (new URL(redirectOptions.href).origin === requestOrigin) {
28028
+ redirectOptions.auth = authToRestore;
28029
+ }
28030
+ } catch (e) {
28031
+ }
28032
+ };
28033
+ }
28034
+ const sensitiveHeaders = own2("sensitiveHeaders");
28035
+ if (sensitiveHeaders != null) {
28036
+ if (!utils$1.isArray(sensitiveHeaders)) {
28037
+ return reject(new AxiosError("sensitiveHeaders must be an array of strings", AxiosError.ERR_BAD_OPTION_VALUE, config));
28038
+ }
28039
+ const sensitiveSet = /* @__PURE__ */ new Set();
28040
+ for (const header of sensitiveHeaders) {
28041
+ if (!utils$1.isString(header)) {
28042
+ return reject(new AxiosError("sensitiveHeaders must be an array of strings", AxiosError.ERR_BAD_OPTION_VALUE, config));
28043
+ }
28044
+ sensitiveSet.add(header.toLowerCase());
28045
+ }
28046
+ if (sensitiveSet.size) {
28047
+ options.sensitiveHeaders = Array.from(sensitiveSet);
28048
+ options.beforeRedirects.sensitiveHeaders = function beforeRedirectSensitiveHeaders(redirectOptions, requestDetails) {
28049
+ if (!isSameOriginRedirect(redirectOptions, requestDetails)) {
28050
+ stripMatchingHeaders(redirectOptions.headers, sensitiveSet);
28051
+ }
28052
+ };
28053
+ }
28054
+ }
27799
28055
  transport = isHttpsRequest ? httpsFollow : httpFollow;
27800
28056
  }
27801
28057
  }
27802
- if (config.maxBodyLength > -1) {
27803
- options.maxBodyLength = config.maxBodyLength;
28058
+ if (maxBodyLength > -1) {
28059
+ options.maxBodyLength = maxBodyLength;
27804
28060
  } else {
27805
28061
  options.maxBodyLength = Infinity;
27806
28062
  }
@@ -27819,7 +28075,7 @@ var require_axios = __commonJS({
27819
28075
  }
27820
28076
  let responseStream = res;
27821
28077
  const lastRequest = res.req || req;
27822
- if (config.decompress !== false && res.headers["content-encoding"]) {
28078
+ if (decompress !== false && res.headers["content-encoding"]) {
27823
28079
  if (method === "HEAD" || res.statusCode === 204) {
27824
28080
  delete res.headers["content-encoding"];
27825
28081
  }
@@ -27842,6 +28098,13 @@ var require_axios = __commonJS({
27842
28098
  streams.push(zlib.createBrotliDecompress(brotliOptions));
27843
28099
  delete res.headers["content-encoding"];
27844
28100
  }
28101
+ break;
28102
+ case "zstd":
28103
+ if (isZstdSupported) {
28104
+ streams.push(zlib.createZstdDecompress(zstdOptions));
28105
+ delete res.headers["content-encoding"];
28106
+ }
28107
+ break;
27845
28108
  }
27846
28109
  }
27847
28110
  responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0];
@@ -27853,8 +28116,8 @@ var require_axios = __commonJS({
27853
28116
  request: lastRequest
27854
28117
  };
27855
28118
  if (responseType === "stream") {
27856
- if (config.maxContentLength > -1) {
27857
- const limit = config.maxContentLength;
28119
+ if (maxContentLength > -1) {
28120
+ const limit = maxContentLength;
27858
28121
  const source = responseStream;
27859
28122
  async function* enforceMaxContentLength() {
27860
28123
  let totalResponseBytes = 0;
@@ -27878,10 +28141,10 @@ var require_axios = __commonJS({
27878
28141
  responseStream.on("data", function handleStreamData(chunk) {
27879
28142
  responseBuffer.push(chunk);
27880
28143
  totalResponseBytes += chunk.length;
27881
- if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
28144
+ if (maxContentLength > -1 && totalResponseBytes > maxContentLength) {
27882
28145
  rejected = true;
27883
28146
  responseStream.destroy();
27884
- abort(new AxiosError("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
28147
+ abort(new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
27885
28148
  }
27886
28149
  });
27887
28150
  responseStream.on("aborted", function handlerStreamAborted() {
@@ -27931,7 +28194,9 @@ var require_axios = __commonJS({
27931
28194
  });
27932
28195
  const boundSockets = /* @__PURE__ */ new Set();
27933
28196
  req.on("socket", function handleRequestSocket(socket) {
27934
- socket.setKeepAlive(true, 1e3 * 60);
28197
+ if (typeof socket.setKeepAlive === "function") {
28198
+ socket.setKeepAlive(true, 1e3 * 60);
28199
+ }
27935
28200
  if (!socket[kAxiosSocketListener]) {
27936
28201
  socket.on("error", function handleSocketError(err) {
27937
28202
  const current = socket[kAxiosCurrentReq];
@@ -27953,8 +28218,8 @@ var require_axios = __commonJS({
27953
28218
  }
27954
28219
  boundSockets.clear();
27955
28220
  });
27956
- if (config.timeout) {
27957
- const timeout = parseInt(config.timeout, 10);
28221
+ if (own2("timeout")) {
28222
+ const timeout = parseInt(own2("timeout"), 10);
27958
28223
  if (Number.isNaN(timeout)) {
27959
28224
  abort(new AxiosError("error trying to parse `config.timeout` to int", AxiosError.ERR_BAD_OPTION_VALUE, config, req));
27960
28225
  return;
@@ -27986,8 +28251,8 @@ var require_axios = __commonJS({
27986
28251
  }
27987
28252
  });
27988
28253
  let uploadStream = data;
27989
- if (config.maxBodyLength > -1 && config.maxRedirects === 0) {
27990
- const limit = config.maxBodyLength;
28254
+ if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) {
28255
+ const limit = maxBodyLength;
27991
28256
  let bytesSent = 0;
27992
28257
  uploadStream = stream.pipeline([data, new stream.Transform({
27993
28258
  transform(chunk, _enc, cb) {
@@ -28043,7 +28308,11 @@ var require_axios = __commonJS({
28043
28308
  const cookie = cookies2[i].replace(/^\s+/, "");
28044
28309
  const eq = cookie.indexOf("=");
28045
28310
  if (eq !== -1 && cookie.slice(0, eq) === name) {
28046
- return decodeURIComponent(cookie.slice(eq + 1));
28311
+ try {
28312
+ return decodeURIComponent(cookie.slice(eq + 1));
28313
+ } catch (e) {
28314
+ return cookie.slice(eq + 1);
28315
+ }
28047
28316
  }
28048
28317
  }
28049
28318
  return null;
@@ -28068,6 +28337,7 @@ var require_axios = __commonJS({
28068
28337
  ...thing
28069
28338
  } : thing;
28070
28339
  function mergeConfig(config1, config2) {
28340
+ config1 = config1 || {};
28071
28341
  config2 = config2 || {};
28072
28342
  const config = /* @__PURE__ */ Object.create(null);
28073
28343
  Object.defineProperty(config, "hasOwnProperty", {
@@ -28110,6 +28380,23 @@ var require_axios = __commonJS({
28110
28380
  return getMergedValue(void 0, a);
28111
28381
  }
28112
28382
  }
28383
+ function getMergedTransitionalOption(prop) {
28384
+ const transitional2 = utils$1.hasOwnProp(config2, "transitional") ? config2.transitional : void 0;
28385
+ if (!utils$1.isUndefined(transitional2)) {
28386
+ if (utils$1.isPlainObject(transitional2)) {
28387
+ if (utils$1.hasOwnProp(transitional2, prop)) {
28388
+ return transitional2[prop];
28389
+ }
28390
+ } else {
28391
+ return void 0;
28392
+ }
28393
+ }
28394
+ const transitional1 = utils$1.hasOwnProp(config1, "transitional") ? config1.transitional : void 0;
28395
+ if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) {
28396
+ return transitional1[prop];
28397
+ }
28398
+ return void 0;
28399
+ }
28113
28400
  function mergeDirectKeys(a, b, prop) {
28114
28401
  if (utils$1.hasOwnProp(config2, prop)) {
28115
28402
  return getMergedValue(a, b);
@@ -28160,6 +28447,13 @@ var require_axios = __commonJS({
28160
28447
  const configValue = merge2(a, b, prop);
28161
28448
  utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
28162
28449
  });
28450
+ if (utils$1.hasOwnProp(config2, "validateStatus") && utils$1.isUndefined(config2.validateStatus) && getMergedTransitionalOption("validateStatusUndefinedResolves") === false) {
28451
+ if (utils$1.hasOwnProp(config1, "validateStatus")) {
28452
+ config.validateStatus = getMergedValue(void 0, config1.validateStatus);
28453
+ } else {
28454
+ delete config.validateStatus;
28455
+ }
28456
+ }
28163
28457
  return config;
28164
28458
  }
28165
28459
  var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
@@ -28168,14 +28462,14 @@ var require_axios = __commonJS({
28168
28462
  headers.set(formHeaders);
28169
28463
  return;
28170
28464
  }
28171
- Object.entries(formHeaders).forEach(([key, val]) => {
28465
+ Object.entries(formHeaders || {}).forEach(([key, val]) => {
28172
28466
  if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
28173
28467
  headers.set(key, val);
28174
28468
  }
28175
28469
  });
28176
28470
  }
28177
- var encodeUTF8 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
28178
- var resolveConfig = (config) => {
28471
+ var encodeUTF8$1 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
28472
+ function resolveConfig(config) {
28179
28473
  const newConfig = mergeConfig({}, config);
28180
28474
  const own2 = (key) => utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : void 0;
28181
28475
  const data = own2("data");
@@ -28188,12 +28482,18 @@ var require_axios = __commonJS({
28188
28482
  const allowAbsoluteUrls = own2("allowAbsoluteUrls");
28189
28483
  const url2 = own2("url");
28190
28484
  newConfig.headers = headers = AxiosHeaders.from(headers);
28191
- newConfig.url = buildURL(buildFullPath(baseURL, url2, allowAbsoluteUrls), config.params, config.paramsSerializer);
28485
+ newConfig.url = buildURL(buildFullPath(baseURL, url2, allowAbsoluteUrls, newConfig), own2("params"), own2("paramsSerializer"));
28192
28486
  if (auth) {
28193
- headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? encodeUTF8(auth.password) : "")));
28487
+ const username = utils$1.getSafeProp(auth, "username") || "";
28488
+ const password = utils$1.getSafeProp(auth, "password") || "";
28489
+ try {
28490
+ headers.set("Authorization", "Basic " + btoa(username + ":" + (password ? encodeUTF8$1(password) : "")));
28491
+ } catch (e) {
28492
+ throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);
28493
+ }
28194
28494
  }
28195
28495
  if (utils$1.isFormData(data)) {
28196
- if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
28496
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) {
28197
28497
  headers.setContentType(void 0);
28198
28498
  } else if (utils$1.isFunction(data.getHeaders)) {
28199
28499
  setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy"));
@@ -28212,7 +28512,7 @@ var require_axios = __commonJS({
28212
28512
  }
28213
28513
  }
28214
28514
  return newConfig;
28215
- };
28515
+ }
28216
28516
  var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
28217
28517
  var xhrAdapter = isXHRAdapterSupported && function(config) {
28218
28518
  return new Promise(function dispatchXhrRequest(resolve, reject) {
@@ -28337,6 +28637,7 @@ var require_axios = __commonJS({
28337
28637
  const protocol = parseProtocol(_config.url);
28338
28638
  if (protocol && !platform.protocols.includes(protocol)) {
28339
28639
  reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
28640
+ done();
28340
28641
  return;
28341
28642
  }
28342
28643
  request.send(requestData || null);
@@ -28372,7 +28673,9 @@ var require_axios = __commonJS({
28372
28673
  });
28373
28674
  signals = null;
28374
28675
  };
28375
- signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
28676
+ signals.forEach((signal2) => signal2.addEventListener("abort", onabort, {
28677
+ once: true
28678
+ }));
28376
28679
  const {
28377
28680
  signal
28378
28681
  } = controller;
@@ -28464,6 +28767,17 @@ var require_axios = __commonJS({
28464
28767
  var {
28465
28768
  isFunction
28466
28769
  } = utils$1;
28770
+ var encodeUTF8 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
28771
+ var decodeURIComponentSafe = (value) => {
28772
+ if (!utils$1.isString(value)) {
28773
+ return value;
28774
+ }
28775
+ try {
28776
+ return decodeURIComponent(value);
28777
+ } catch (error) {
28778
+ return value;
28779
+ }
28780
+ };
28467
28781
  var test = (fn, ...args) => {
28468
28782
  try {
28469
28783
  return !!fn(...args);
@@ -28471,6 +28785,14 @@ var require_axios = __commonJS({
28471
28785
  return false;
28472
28786
  }
28473
28787
  };
28788
+ var maybeWithAuthCredentials = (url2) => {
28789
+ const protocolIndex = url2.indexOf("://");
28790
+ let urlToCheck = url2;
28791
+ if (protocolIndex !== -1) {
28792
+ urlToCheck = urlToCheck.slice(protocolIndex + 3);
28793
+ }
28794
+ return urlToCheck.includes("@") || urlToCheck.includes(":");
28795
+ };
28474
28796
  var factory = (env) => {
28475
28797
  const globalObject2 = utils$1.global !== void 0 && utils$1.global !== null ? utils$1.global : globalThis;
28476
28798
  const {
@@ -28574,6 +28896,7 @@ var require_axios = __commonJS({
28574
28896
  } = resolveConfig(config);
28575
28897
  const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
28576
28898
  const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
28899
+ const own2 = (key) => utils$1.hasOwnProp(config, key) ? config[key] : void 0;
28577
28900
  let _fetch = envFetch || fetch;
28578
28901
  responseType = responseType ? (responseType + "").toLowerCase() : "text";
28579
28902
  let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
@@ -28582,7 +28905,39 @@ var require_axios = __commonJS({
28582
28905
  composedSignal.unsubscribe();
28583
28906
  });
28584
28907
  let requestContentLength;
28908
+ let pendingBodyError = null;
28909
+ const maxBodyLengthError = () => new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config, request);
28585
28910
  try {
28911
+ let auth = void 0;
28912
+ const configAuth = own2("auth");
28913
+ if (configAuth) {
28914
+ const username = utils$1.getSafeProp(configAuth, "username") || "";
28915
+ const password = utils$1.getSafeProp(configAuth, "password") || "";
28916
+ auth = {
28917
+ username,
28918
+ password
28919
+ };
28920
+ }
28921
+ if (maybeWithAuthCredentials(url2)) {
28922
+ const parsedURL = new URL(url2, platform.origin);
28923
+ if (!auth && (parsedURL.username || parsedURL.password)) {
28924
+ const urlUsername = decodeURIComponentSafe(parsedURL.username);
28925
+ const urlPassword = decodeURIComponentSafe(parsedURL.password);
28926
+ auth = {
28927
+ username: urlUsername,
28928
+ password: urlPassword
28929
+ };
28930
+ }
28931
+ if (parsedURL.username || parsedURL.password) {
28932
+ parsedURL.username = "";
28933
+ parsedURL.password = "";
28934
+ url2 = parsedURL.href;
28935
+ }
28936
+ }
28937
+ if (auth) {
28938
+ headers.delete("authorization");
28939
+ headers.set("Authorization", "Basic " + btoa(encodeUTF8((auth.username || "") + ":" + (auth.password || ""))));
28940
+ }
28586
28941
  if (hasMaxContentLength && typeof url2 === "string" && url2.startsWith("data:")) {
28587
28942
  const estimated = estimateDataURLDecodedBytes(url2);
28588
28943
  if (estimated > maxContentLength) {
@@ -28590,25 +28945,42 @@ var require_axios = __commonJS({
28590
28945
  }
28591
28946
  }
28592
28947
  if (hasMaxBodyLength && method !== "get" && method !== "head") {
28593
- const outboundLength = await resolveBodyLength(headers, data);
28594
- if (typeof outboundLength === "number" && isFinite(outboundLength) && outboundLength > maxBodyLength) {
28595
- throw new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config, request);
28948
+ const outboundLength = await getBodyLength(data);
28949
+ if (typeof outboundLength === "number" && isFinite(outboundLength)) {
28950
+ requestContentLength = outboundLength;
28951
+ if (outboundLength > maxBodyLength) {
28952
+ throw maxBodyLengthError();
28953
+ }
28596
28954
  }
28597
28955
  }
28598
- if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
28599
- let _request = new Request(url2, {
28600
- method: "POST",
28601
- body: data,
28602
- duplex: "half"
28603
- });
28604
- let contentTypeHeader;
28605
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
28606
- headers.setContentType(contentTypeHeader);
28956
+ const mustEnforceStreamBody = hasMaxBodyLength && (utils$1.isReadableStream(data) || utils$1.isStream(data));
28957
+ const trackRequestStream = (stream2, onProgress, flush) => trackStream(stream2, DEFAULT_CHUNK_SIZE, (loadedBytes) => {
28958
+ if (hasMaxBodyLength && loadedBytes > maxBodyLength) {
28959
+ throw pendingBodyError = maxBodyLengthError();
28607
28960
  }
28608
- if (_request.body) {
28609
- const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)));
28610
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
28961
+ onProgress && onProgress(loadedBytes);
28962
+ }, flush);
28963
+ if (supportsRequestStream && method !== "get" && method !== "head" && (onUploadProgress || mustEnforceStreamBody)) {
28964
+ requestContentLength = requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;
28965
+ if (requestContentLength !== 0 || mustEnforceStreamBody) {
28966
+ let _request = new Request(url2, {
28967
+ method: "POST",
28968
+ body: data,
28969
+ duplex: "half"
28970
+ });
28971
+ let contentTypeHeader;
28972
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
28973
+ headers.setContentType(contentTypeHeader);
28974
+ }
28975
+ if (_request.body) {
28976
+ const [onProgress, flush] = onUploadProgress && progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))) || [];
28977
+ data = trackRequestStream(_request.body, onProgress, flush);
28978
+ }
28611
28979
  }
28980
+ } else if (mustEnforceStreamBody && !isRequestSupported && isReadableStreamSupported && method !== "get" && method !== "head") {
28981
+ data = trackRequestStream(data);
28982
+ } else if (mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== "get" && method !== "head") {
28983
+ throw new AxiosError("Stream request bodies are not supported by the current fetch implementation", AxiosError.ERR_NOT_SUPPORT, config, request);
28612
28984
  }
28613
28985
  if (!utils$1.isString(withCredentials)) {
28614
28986
  withCredentials = withCredentials ? "include" : "omit";
@@ -28632,8 +29004,9 @@ var require_axios = __commonJS({
28632
29004
  };
28633
29005
  request = isRequestSupported && new Request(url2, resolvedOptions);
28634
29006
  let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions));
29007
+ const responseHeaders = AxiosHeaders.from(response.headers);
28635
29008
  if (hasMaxContentLength) {
28636
- const declaredLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
29009
+ const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
28637
29010
  if (declaredLength != null && declaredLength > maxContentLength) {
28638
29011
  throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
28639
29012
  }
@@ -28644,7 +29017,7 @@ var require_axios = __commonJS({
28644
29017
  ["status", "statusText", "headers"].forEach((prop) => {
28645
29018
  options[prop] = response[prop];
28646
29019
  });
28647
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
29020
+ const responseContentLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
28648
29021
  const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
28649
29022
  let bytesRead = 0;
28650
29023
  const onChunkProgress = (loadedBytes) => {
@@ -28695,13 +29068,35 @@ var require_axios = __commonJS({
28695
29068
  const canceledError = composedSignal.reason;
28696
29069
  canceledError.config = config;
28697
29070
  request && (canceledError.request = request);
28698
- err !== canceledError && (canceledError.cause = err);
29071
+ if (err !== canceledError) {
29072
+ Object.defineProperty(canceledError, "cause", {
29073
+ __proto__: null,
29074
+ value: err,
29075
+ writable: true,
29076
+ enumerable: false,
29077
+ configurable: true
29078
+ });
29079
+ }
28699
29080
  throw canceledError;
28700
29081
  }
29082
+ if (pendingBodyError) {
29083
+ request && !pendingBodyError.request && (pendingBodyError.request = request);
29084
+ throw pendingBodyError;
29085
+ }
29086
+ if (err instanceof AxiosError) {
29087
+ request && !err.request && (err.request = request);
29088
+ throw err;
29089
+ }
28701
29090
  if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
28702
- throw Object.assign(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, err && err.response), {
28703
- cause: err.cause || err
29091
+ const networkError = new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, err && err.response);
29092
+ Object.defineProperty(networkError, "cause", {
29093
+ __proto__: null,
29094
+ value: err.cause || err,
29095
+ writable: true,
29096
+ enumerable: false,
29097
+ configurable: true
28704
29098
  });
29099
+ throw networkError;
28705
29100
  }
28706
29101
  throw AxiosError.from(err, err && err.code, config, request, err && err.response);
28707
29102
  }
@@ -28776,7 +29171,7 @@ var require_axios = __commonJS({
28776
29171
  if (!adapter) {
28777
29172
  const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build"));
28778
29173
  let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
28779
- throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, "ERR_NOT_SUPPORT");
29174
+ throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, AxiosError.ERR_NOT_SUPPORT);
28780
29175
  }
28781
29176
  return adapter;
28782
29177
  }
@@ -28863,7 +29258,7 @@ var require_axios = __commonJS({
28863
29258
  };
28864
29259
  };
28865
29260
  function assertOptions(options, schema, allowUnknown) {
28866
- if (typeof options !== "object") {
29261
+ if (typeof options !== "object" || options === null) {
28867
29262
  throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
28868
29263
  }
28869
29264
  const keys = Object.keys(options);
@@ -28954,7 +29349,9 @@ var require_axios = __commonJS({
28954
29349
  silentJSONParsing: validators.transitional(validators.boolean),
28955
29350
  forcedJSONParsing: validators.transitional(validators.boolean),
28956
29351
  clarifyTimeoutError: validators.transitional(validators.boolean),
28957
- legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
29352
+ legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
29353
+ advertiseZstdAcceptEncoding: validators.transitional(validators.boolean),
29354
+ validateStatusUndefinedResolves: validators.transitional(validators.boolean)
28958
29355
  }, false);
28959
29356
  }
28960
29357
  if (paramsSerializer != null) {
@@ -29044,7 +29441,7 @@ var require_axios = __commonJS({
29044
29441
  }
29045
29442
  getUri(config) {
29046
29443
  config = mergeConfig(this.defaults, config);
29047
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
29444
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);
29048
29445
  return buildURL(fullPath, config.params, config.paramsSerializer);
29049
29446
  }
29050
29447
  };
@@ -29053,7 +29450,7 @@ var require_axios = __commonJS({
29053
29450
  return this.request(mergeConfig(config || {}, {
29054
29451
  method,
29055
29452
  url: url2,
29056
- data: (config || {}).data
29453
+ data: config && utils$1.hasOwnProp(config, "data") ? config.data : void 0
29057
29454
  }));
29058
29455
  };
29059
29456
  });
@@ -30069,7 +30466,7 @@ function tryExtractSAPErrorFromMessage(message) {
30069
30466
  }
30070
30467
 
30071
30468
  // src/version.ts
30072
- var VERSION = true ? "4.7.0" : "0.0.0-test";
30469
+ var VERSION = true ? "4.8.0" : "0.0.0-test";
30073
30470
 
30074
30471
  export {
30075
30472
  __toESM,
@@ -30121,6 +30518,6 @@ mime-types/index.js:
30121
30518
  *)
30122
30519
 
30123
30520
  axios/dist/node/axios.cjs:
30124
- (*! Axios v1.16.1 Copyright (c) 2026 Matt Zabriskie and contributors *)
30521
+ (*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors *)
30125
30522
  */
30126
- //# sourceMappingURL=chunk-TVXWNZQT.js.map
30523
+ //# sourceMappingURL=chunk-3ZSXTKOK.js.map