firecrawl 1.23.0 → 1.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ var require_delayed_stream = __commonJS({
39
39
  "node_modules/delayed-stream/lib/delayed_stream.js"(exports, module) {
40
40
  "use strict";
41
41
  var Stream = __require("stream").Stream;
42
- var util2 = __require("util");
42
+ var util3 = __require("util");
43
43
  module.exports = DelayedStream;
44
44
  function DelayedStream() {
45
45
  this.source = null;
@@ -50,7 +50,7 @@ var require_delayed_stream = __commonJS({
50
50
  this._released = false;
51
51
  this._bufferedEvents = [];
52
52
  }
53
- util2.inherits(DelayedStream, Stream);
53
+ util3.inherits(DelayedStream, Stream);
54
54
  DelayedStream.create = function(source, options) {
55
55
  var delayedStream = new this();
56
56
  options = options || {};
@@ -130,7 +130,7 @@ var require_delayed_stream = __commonJS({
130
130
  var require_combined_stream = __commonJS({
131
131
  "node_modules/combined-stream/lib/combined_stream.js"(exports, module) {
132
132
  "use strict";
133
- var util2 = __require("util");
133
+ var util3 = __require("util");
134
134
  var Stream = __require("stream").Stream;
135
135
  var DelayedStream = require_delayed_stream();
136
136
  module.exports = CombinedStream;
@@ -146,7 +146,7 @@ var require_combined_stream = __commonJS({
146
146
  this._insideLoop = false;
147
147
  this._pendingNext = false;
148
148
  }
149
- util2.inherits(CombinedStream, Stream);
149
+ util3.inherits(CombinedStream, Stream);
150
150
  CombinedStream.create = function(options) {
151
151
  var combinedStream = new this();
152
152
  options = options || {};
@@ -9156,7 +9156,7 @@ var require_form_data = __commonJS({
9156
9156
  "node_modules/form-data/lib/form_data.js"(exports, module) {
9157
9157
  "use strict";
9158
9158
  var CombinedStream = require_combined_stream();
9159
- var util2 = __require("util");
9159
+ var util3 = __require("util");
9160
9160
  var path = __require("path");
9161
9161
  var http2 = __require("http");
9162
9162
  var https2 = __require("https");
@@ -9167,7 +9167,7 @@ var require_form_data = __commonJS({
9167
9167
  var asynckit = require_asynckit();
9168
9168
  var populate = require_populate();
9169
9169
  module.exports = FormData3;
9170
- util2.inherits(FormData3, CombinedStream);
9170
+ util3.inherits(FormData3, CombinedStream);
9171
9171
  function FormData3(options) {
9172
9172
  if (!(this instanceof FormData3)) {
9173
9173
  return new FormData3(options);
@@ -9192,7 +9192,7 @@ var require_form_data = __commonJS({
9192
9192
  if (typeof value == "number") {
9193
9193
  value = "" + value;
9194
9194
  }
9195
- if (util2.isArray(value)) {
9195
+ if (util3.isArray(value)) {
9196
9196
  this._error(new Error("Arrays are not supported."));
9197
9197
  return;
9198
9198
  }
@@ -9482,7 +9482,7 @@ var require_proxy_from_env = __commonJS({
9482
9482
  var stringEndsWith = String.prototype.endsWith || function(s) {
9483
9483
  return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
9484
9484
  };
9485
- function getProxyForUrl2(url2) {
9485
+ function getProxyForUrl(url2) {
9486
9486
  var parsedUrl = typeof url2 === "string" ? parseUrl(url2) : url2 || {};
9487
9487
  var proto = parsedUrl.protocol;
9488
9488
  var hostname = parsedUrl.host;
@@ -9532,7 +9532,7 @@ var require_proxy_from_env = __commonJS({
9532
9532
  function getEnv(key) {
9533
9533
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
9534
9534
  }
9535
- exports.getProxyForUrl = getProxyForUrl2;
9535
+ exports.getProxyForUrl = getProxyForUrl;
9536
9536
  }
9537
9537
  });
9538
9538
 
@@ -10108,14 +10108,14 @@ var require_node = __commonJS({
10108
10108
  "node_modules/debug/src/node.js"(exports, module) {
10109
10109
  "use strict";
10110
10110
  var tty = __require("tty");
10111
- var util2 = __require("util");
10111
+ var util3 = __require("util");
10112
10112
  exports.init = init;
10113
10113
  exports.log = log;
10114
10114
  exports.formatArgs = formatArgs;
10115
10115
  exports.save = save;
10116
10116
  exports.load = load;
10117
10117
  exports.useColors = useColors;
10118
- exports.destroy = util2.deprecate(
10118
+ exports.destroy = util3.deprecate(
10119
10119
  () => {
10120
10120
  },
10121
10121
  "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
@@ -10246,7 +10246,7 @@ var require_node = __commonJS({
10246
10246
  return (/* @__PURE__ */ new Date()).toISOString() + " ";
10247
10247
  }
10248
10248
  function log(...args) {
10249
- return process.stderr.write(util2.formatWithOptions(exports.inspectOpts, ...args) + "\n");
10249
+ return process.stderr.write(util3.formatWithOptions(exports.inspectOpts, ...args) + "\n");
10250
10250
  }
10251
10251
  function save(namespaces) {
10252
10252
  if (namespaces) {
@@ -10269,11 +10269,11 @@ var require_node = __commonJS({
10269
10269
  var { formatters } = module.exports;
10270
10270
  formatters.o = function(v) {
10271
10271
  this.inspectOpts.colors = this.useColors;
10272
- return util2.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
10272
+ return util3.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
10273
10273
  };
10274
10274
  formatters.O = function(v) {
10275
10275
  this.inspectOpts.colors = this.useColors;
10276
- return util2.inspect(v, this.inspectOpts);
10276
+ return util3.inspect(v, this.inspectOpts);
10277
10277
  };
10278
10278
  }
10279
10279
  });
@@ -10855,6 +10855,7 @@ var isFormData = (thing) => {
10855
10855
  kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
10856
10856
  };
10857
10857
  var isURLSearchParams = kindOfTest("URLSearchParams");
10858
+ var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
10858
10859
  var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
10859
10860
  function forEach(obj, fn, { allOwnKeys = false } = {}) {
10860
10861
  if (obj === null || typeof obj === "undefined") {
@@ -11058,23 +11059,7 @@ var toObjectSet = (arrayOrString, delimiter) => {
11058
11059
  var noop = () => {
11059
11060
  };
11060
11061
  var toFiniteNumber = (value, defaultValue) => {
11061
- value = +value;
11062
- return Number.isFinite(value) ? value : defaultValue;
11063
- };
11064
- var ALPHA = "abcdefghijklmnopqrstuvwxyz";
11065
- var DIGIT = "0123456789";
11066
- var ALPHABET = {
11067
- DIGIT,
11068
- ALPHA,
11069
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
11070
- };
11071
- var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
11072
- let str = "";
11073
- const { length } = alphabet;
11074
- while (size--) {
11075
- str += alphabet[Math.random() * length | 0];
11076
- }
11077
- return str;
11062
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
11078
11063
  };
11079
11064
  function isSpecCompliantForm(thing) {
11080
11065
  return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
@@ -11103,6 +11088,26 @@ var toJSONObject = (obj) => {
11103
11088
  };
11104
11089
  var isAsyncFn = kindOfTest("AsyncFunction");
11105
11090
  var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
11091
+ var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
11092
+ if (setImmediateSupported) {
11093
+ return setImmediate;
11094
+ }
11095
+ return postMessageSupported ? ((token, callbacks) => {
11096
+ _global.addEventListener("message", ({ source, data }) => {
11097
+ if (source === _global && data === token) {
11098
+ callbacks.length && callbacks.shift()();
11099
+ }
11100
+ }, false);
11101
+ return (cb) => {
11102
+ callbacks.push(cb);
11103
+ _global.postMessage(token, "*");
11104
+ };
11105
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
11106
+ })(
11107
+ typeof setImmediate === "function",
11108
+ isFunction(_global.postMessage)
11109
+ );
11110
+ var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
11106
11111
  var utils_default = {
11107
11112
  isArray,
11108
11113
  isArrayBuffer,
@@ -11114,6 +11119,10 @@ var utils_default = {
11114
11119
  isBoolean,
11115
11120
  isObject,
11116
11121
  isPlainObject,
11122
+ isReadableStream,
11123
+ isRequest,
11124
+ isResponse,
11125
+ isHeaders,
11117
11126
  isUndefined,
11118
11127
  isDate,
11119
11128
  isFile,
@@ -11150,12 +11159,12 @@ var utils_default = {
11150
11159
  findKey,
11151
11160
  global: _global,
11152
11161
  isContextDefined,
11153
- ALPHABET,
11154
- generateString,
11155
11162
  isSpecCompliantForm,
11156
11163
  toJSONObject,
11157
11164
  isAsyncFn,
11158
- isThenable
11165
+ isThenable,
11166
+ setImmediate: _setImmediate,
11167
+ asap
11159
11168
  };
11160
11169
 
11161
11170
  // node_modules/axios/lib/core/AxiosError.js
@@ -11171,7 +11180,10 @@ function AxiosError(message, code, config, request, response) {
11171
11180
  code && (this.code = code);
11172
11181
  config && (this.config = config);
11173
11182
  request && (this.request = request);
11174
- response && (this.response = response);
11183
+ if (response) {
11184
+ this.response = response;
11185
+ this.status = response.status ? response.status : null;
11186
+ }
11175
11187
  }
11176
11188
  utils_default.inherits(AxiosError, Error, {
11177
11189
  toJSON: function toJSON() {
@@ -11190,7 +11202,7 @@ utils_default.inherits(AxiosError, Error, {
11190
11202
  // Axios
11191
11203
  config: utils_default.toJSONObject(this.config),
11192
11204
  code: this.code,
11193
- status: this.response && this.response.status ? this.response.status : null
11205
+ status: this.status
11194
11206
  };
11195
11207
  }
11196
11208
  });
@@ -11388,6 +11400,11 @@ function buildURL(url2, params, options) {
11388
11400
  return url2;
11389
11401
  }
11390
11402
  const _encode = options && options.encode || encode2;
11403
+ if (utils_default.isFunction(options)) {
11404
+ options = {
11405
+ serialize: options
11406
+ };
11407
+ }
11391
11408
  const serializeFn = options && options.serialize;
11392
11409
  let serializedParams;
11393
11410
  if (serializeFn) {
@@ -11476,11 +11493,31 @@ var transitional_default = {
11476
11493
  clarifyTimeoutError: false
11477
11494
  };
11478
11495
 
11496
+ // node_modules/axios/lib/platform/node/index.js
11497
+ import crypto from "crypto";
11498
+
11479
11499
  // node_modules/axios/lib/platform/node/classes/URLSearchParams.js
11480
11500
  import url from "url";
11481
11501
  var URLSearchParams_default = url.URLSearchParams;
11482
11502
 
11483
11503
  // node_modules/axios/lib/platform/node/index.js
11504
+ var ALPHA = "abcdefghijklmnopqrstuvwxyz";
11505
+ var DIGIT = "0123456789";
11506
+ var ALPHABET = {
11507
+ DIGIT,
11508
+ ALPHA,
11509
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
11510
+ };
11511
+ var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
11512
+ let str = "";
11513
+ const { length } = alphabet;
11514
+ const randomValues = new Uint32Array(size);
11515
+ crypto.randomFillSync(randomValues);
11516
+ for (let i = 0; i < size; i++) {
11517
+ str += alphabet[randomValues[i] % length];
11518
+ }
11519
+ return str;
11520
+ };
11484
11521
  var node_default = {
11485
11522
  isNode: true,
11486
11523
  classes: {
@@ -11488,6 +11525,8 @@ var node_default = {
11488
11525
  FormData: FormData_default,
11489
11526
  Blob: typeof Blob !== "undefined" && Blob || null
11490
11527
  },
11528
+ ALPHABET,
11529
+ generateString,
11491
11530
  protocols: ["http", "https", "file", "data"]
11492
11531
  };
11493
11532
 
@@ -11496,16 +11535,18 @@ var utils_exports = {};
11496
11535
  __export(utils_exports, {
11497
11536
  hasBrowserEnv: () => hasBrowserEnv,
11498
11537
  hasStandardBrowserEnv: () => hasStandardBrowserEnv,
11499
- hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv
11538
+ hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
11539
+ navigator: () => _navigator,
11540
+ origin: () => origin
11500
11541
  });
11501
11542
  var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
11502
- var hasStandardBrowserEnv = ((product) => {
11503
- return hasBrowserEnv && ["ReactNative", "NativeScript", "NS"].indexOf(product) < 0;
11504
- })(typeof navigator !== "undefined" && navigator.product);
11543
+ var _navigator = typeof navigator === "object" && navigator || void 0;
11544
+ var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
11505
11545
  var hasStandardBrowserWebWorkerEnv = (() => {
11506
11546
  return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
11507
11547
  self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
11508
11548
  })();
11549
+ var origin = hasBrowserEnv && window.location.href || "http://localhost";
11509
11550
 
11510
11551
  // node_modules/axios/lib/platform/index.js
11511
11552
  var platform_default = {
@@ -11595,7 +11636,7 @@ function stringifySafely(rawValue, parser, encoder) {
11595
11636
  }
11596
11637
  var defaults = {
11597
11638
  transitional: transitional_default,
11598
- adapter: ["xhr", "http"],
11639
+ adapter: ["xhr", "http", "fetch"],
11599
11640
  transformRequest: [function transformRequest(data, headers) {
11600
11641
  const contentType = headers.getContentType() || "";
11601
11642
  const hasJSONContentType = contentType.indexOf("application/json") > -1;
@@ -11607,7 +11648,7 @@ var defaults = {
11607
11648
  if (isFormData2) {
11608
11649
  return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
11609
11650
  }
11610
- if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
11651
+ if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) {
11611
11652
  return data;
11612
11653
  }
11613
11654
  if (utils_default.isArrayBufferView(data)) {
@@ -11641,6 +11682,9 @@ var defaults = {
11641
11682
  const transitional2 = this.transitional || defaults.transitional;
11642
11683
  const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
11643
11684
  const JSONRequested = this.responseType === "json";
11685
+ if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
11686
+ return data;
11687
+ }
11644
11688
  if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
11645
11689
  const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
11646
11690
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
@@ -11803,6 +11847,10 @@ var AxiosHeaders = class {
11803
11847
  setHeaders(header, valueOrRewrite);
11804
11848
  } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
11805
11849
  setHeaders(parseHeaders_default(header), valueOrRewrite);
11850
+ } else if (utils_default.isHeaders(header)) {
11851
+ for (const [key, value] of header.entries()) {
11852
+ setHeader(value, key, rewrite);
11853
+ }
11806
11854
  } else {
11807
11855
  header != null && setHeader(valueOrRewrite, header, rewrite);
11808
11856
  }
@@ -12002,8 +12050,9 @@ function combineURLs(baseURL, relativeURL) {
12002
12050
  }
12003
12051
 
12004
12052
  // node_modules/axios/lib/core/buildFullPath.js
12005
- function buildFullPath(baseURL, requestedURL) {
12006
- if (baseURL && !isAbsoluteURL(requestedURL)) {
12053
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
12054
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
12055
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
12007
12056
  return combineURLs(baseURL, requestedURL);
12008
12057
  }
12009
12058
  return requestedURL;
@@ -12014,11 +12063,11 @@ var import_proxy_from_env = __toESM(require_proxy_from_env(), 1);
12014
12063
  var import_follow_redirects = __toESM(require_follow_redirects(), 1);
12015
12064
  import http from "http";
12016
12065
  import https from "https";
12017
- import util from "util";
12066
+ import util2 from "util";
12018
12067
  import zlib from "zlib";
12019
12068
 
12020
12069
  // node_modules/axios/lib/env/data.js
12021
- var VERSION = "1.6.8";
12070
+ var VERSION = "1.8.4";
12022
12071
 
12023
12072
  // node_modules/axios/lib/helpers/parseProtocol.js
12024
12073
  function parseProtocol(url2) {
@@ -12060,70 +12109,6 @@ import stream3 from "stream";
12060
12109
 
12061
12110
  // node_modules/axios/lib/helpers/AxiosTransformStream.js
12062
12111
  import stream from "stream";
12063
-
12064
- // node_modules/axios/lib/helpers/throttle.js
12065
- function throttle(fn, freq) {
12066
- let timestamp = 0;
12067
- const threshold = 1e3 / freq;
12068
- let timer = null;
12069
- return function throttled(force, args) {
12070
- const now = Date.now();
12071
- if (force || now - timestamp > threshold) {
12072
- if (timer) {
12073
- clearTimeout(timer);
12074
- timer = null;
12075
- }
12076
- timestamp = now;
12077
- return fn.apply(null, args);
12078
- }
12079
- if (!timer) {
12080
- timer = setTimeout(() => {
12081
- timer = null;
12082
- timestamp = Date.now();
12083
- return fn.apply(null, args);
12084
- }, threshold - (now - timestamp));
12085
- }
12086
- };
12087
- }
12088
- var throttle_default = throttle;
12089
-
12090
- // node_modules/axios/lib/helpers/speedometer.js
12091
- function speedometer(samplesCount, min) {
12092
- samplesCount = samplesCount || 10;
12093
- const bytes = new Array(samplesCount);
12094
- const timestamps = new Array(samplesCount);
12095
- let head = 0;
12096
- let tail = 0;
12097
- let firstSampleTS;
12098
- min = min !== void 0 ? min : 1e3;
12099
- return function push(chunkLength) {
12100
- const now = Date.now();
12101
- const startedAt = timestamps[tail];
12102
- if (!firstSampleTS) {
12103
- firstSampleTS = now;
12104
- }
12105
- bytes[head] = chunkLength;
12106
- timestamps[head] = now;
12107
- let i = tail;
12108
- let bytesCount = 0;
12109
- while (i !== head) {
12110
- bytesCount += bytes[i++];
12111
- i = i % samplesCount;
12112
- }
12113
- head = (head + 1) % samplesCount;
12114
- if (head === tail) {
12115
- tail = (tail + 1) % samplesCount;
12116
- }
12117
- if (now - firstSampleTS < min) {
12118
- return;
12119
- }
12120
- const passed = startedAt && now - startedAt;
12121
- return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
12122
- };
12123
- }
12124
- var speedometer_default = speedometer;
12125
-
12126
- // node_modules/axios/lib/helpers/AxiosTransformStream.js
12127
12112
  var kInternals = Symbol("internals");
12128
12113
  var AxiosTransformStream = class extends stream.Transform {
12129
12114
  constructor(options) {
@@ -12140,11 +12125,8 @@ var AxiosTransformStream = class extends stream.Transform {
12140
12125
  super({
12141
12126
  readableHighWaterMark: options.chunkSize
12142
12127
  });
12143
- const self2 = this;
12144
12128
  const internals = this[kInternals] = {
12145
- length: options.length,
12146
12129
  timeWindow: options.timeWindow,
12147
- ticksRate: options.ticksRate,
12148
12130
  chunkSize: options.chunkSize,
12149
12131
  maxRate: options.maxRate,
12150
12132
  minChunkSize: options.minChunkSize,
@@ -12155,7 +12137,6 @@ var AxiosTransformStream = class extends stream.Transform {
12155
12137
  bytes: 0,
12156
12138
  onReadCallback: null
12157
12139
  };
12158
- const _speedometer = speedometer_default(internals.ticksRate * options.samplesCount, internals.timeWindow);
12159
12140
  this.on("newListener", (event) => {
12160
12141
  if (event === "progress") {
12161
12142
  if (!internals.isCaptured) {
@@ -12163,30 +12144,6 @@ var AxiosTransformStream = class extends stream.Transform {
12163
12144
  }
12164
12145
  }
12165
12146
  });
12166
- let bytesNotified = 0;
12167
- internals.updateProgress = throttle_default(function throttledHandler() {
12168
- const totalBytes = internals.length;
12169
- const bytesTransferred = internals.bytesSeen;
12170
- const progressBytes = bytesTransferred - bytesNotified;
12171
- if (!progressBytes || self2.destroyed) return;
12172
- const rate = _speedometer(progressBytes);
12173
- bytesNotified = bytesTransferred;
12174
- process.nextTick(() => {
12175
- self2.emit("progress", {
12176
- "loaded": bytesTransferred,
12177
- "total": totalBytes,
12178
- "progress": totalBytes ? bytesTransferred / totalBytes : void 0,
12179
- "bytes": progressBytes,
12180
- "rate": rate ? rate : void 0,
12181
- "estimated": rate && totalBytes && bytesTransferred <= totalBytes ? (totalBytes - bytesTransferred) / rate : void 0
12182
- });
12183
- });
12184
- }, internals.ticksRate);
12185
- const onFinish = () => {
12186
- internals.updateProgress(true);
12187
- };
12188
- this.once("end", onFinish);
12189
- this.once("error", onFinish);
12190
12147
  }
12191
12148
  _read(size) {
12192
12149
  const internals = this[kInternals];
@@ -12196,7 +12153,6 @@ var AxiosTransformStream = class extends stream.Transform {
12196
12153
  return super._read(size);
12197
12154
  }
12198
12155
  _transform(chunk, encoding, callback) {
12199
- const self2 = this;
12200
12156
  const internals = this[kInternals];
12201
12157
  const maxRate = internals.maxRate;
12202
12158
  const readableHighWaterMark = this.readableHighWaterMark;
@@ -12204,14 +12160,12 @@ var AxiosTransformStream = class extends stream.Transform {
12204
12160
  const divider = 1e3 / timeWindow;
12205
12161
  const bytesThreshold = maxRate / divider;
12206
12162
  const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
12207
- function pushChunk(_chunk, _callback) {
12163
+ const pushChunk = (_chunk, _callback) => {
12208
12164
  const bytes = Buffer.byteLength(_chunk);
12209
12165
  internals.bytesSeen += bytes;
12210
12166
  internals.bytes += bytes;
12211
- if (internals.isCaptured) {
12212
- internals.updateProgress();
12213
- }
12214
- if (self2.push(_chunk)) {
12167
+ internals.isCaptured && this.emit("progress", internals.bytesSeen);
12168
+ if (this.push(_chunk)) {
12215
12169
  process.nextTick(_callback);
12216
12170
  } else {
12217
12171
  internals.onReadCallback = () => {
@@ -12219,7 +12173,7 @@ var AxiosTransformStream = class extends stream.Transform {
12219
12173
  process.nextTick(_callback);
12220
12174
  };
12221
12175
  }
12222
- }
12176
+ };
12223
12177
  const transformChunk = (_chunk, _callback) => {
12224
12178
  const chunkSize = Buffer.byteLength(_chunk);
12225
12179
  let chunkRemainder = null;
@@ -12265,10 +12219,6 @@ var AxiosTransformStream = class extends stream.Transform {
12265
12219
  }
12266
12220
  });
12267
12221
  }
12268
- setLength(length) {
12269
- this[kInternals].length = +length;
12270
- return this;
12271
- }
12272
12222
  };
12273
12223
  var AxiosTransformStream_default = AxiosTransformStream;
12274
12224
 
@@ -12276,7 +12226,7 @@ var AxiosTransformStream_default = AxiosTransformStream;
12276
12226
  import { EventEmitter } from "events";
12277
12227
 
12278
12228
  // node_modules/axios/lib/helpers/formDataToStream.js
12279
- import { TextEncoder } from "util";
12229
+ import util from "util";
12280
12230
  import { Readable } from "stream";
12281
12231
 
12282
12232
  // node_modules/axios/lib/helpers/readBlob.js
@@ -12295,8 +12245,8 @@ var readBlob = async function* (blob) {
12295
12245
  var readBlob_default = readBlob;
12296
12246
 
12297
12247
  // node_modules/axios/lib/helpers/formDataToStream.js
12298
- var BOUNDARY_ALPHABET = utils_default.ALPHABET.ALPHA_DIGIT + "-_";
12299
- var textEncoder = new TextEncoder();
12248
+ var BOUNDARY_ALPHABET = platform_default.ALPHABET.ALPHA_DIGIT + "-_";
12249
+ var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util.TextEncoder();
12300
12250
  var CRLF = "\r\n";
12301
12251
  var CRLF_BYTES = textEncoder.encode(CRLF);
12302
12252
  var CRLF_BYTES_COUNT = 2;
@@ -12338,7 +12288,7 @@ var formDataToStream = (form, headersHandler, options) => {
12338
12288
  const {
12339
12289
  tag = "form-data-boundary",
12340
12290
  size = 25,
12341
- boundary = tag + "-" + utils_default.generateString(size, BOUNDARY_ALPHABET)
12291
+ boundary = tag + "-" + platform_default.generateString(size, BOUNDARY_ALPHABET)
12342
12292
  } = options || {};
12343
12293
  if (!utils_default.isFormData(form)) {
12344
12294
  throw TypeError("FormData instance required");
@@ -12410,6 +12360,112 @@ var callbackify = (fn, reducer) => {
12410
12360
  };
12411
12361
  var callbackify_default = callbackify;
12412
12362
 
12363
+ // node_modules/axios/lib/helpers/speedometer.js
12364
+ function speedometer(samplesCount, min) {
12365
+ samplesCount = samplesCount || 10;
12366
+ const bytes = new Array(samplesCount);
12367
+ const timestamps = new Array(samplesCount);
12368
+ let head = 0;
12369
+ let tail = 0;
12370
+ let firstSampleTS;
12371
+ min = min !== void 0 ? min : 1e3;
12372
+ return function push(chunkLength) {
12373
+ const now = Date.now();
12374
+ const startedAt = timestamps[tail];
12375
+ if (!firstSampleTS) {
12376
+ firstSampleTS = now;
12377
+ }
12378
+ bytes[head] = chunkLength;
12379
+ timestamps[head] = now;
12380
+ let i = tail;
12381
+ let bytesCount = 0;
12382
+ while (i !== head) {
12383
+ bytesCount += bytes[i++];
12384
+ i = i % samplesCount;
12385
+ }
12386
+ head = (head + 1) % samplesCount;
12387
+ if (head === tail) {
12388
+ tail = (tail + 1) % samplesCount;
12389
+ }
12390
+ if (now - firstSampleTS < min) {
12391
+ return;
12392
+ }
12393
+ const passed = startedAt && now - startedAt;
12394
+ return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
12395
+ };
12396
+ }
12397
+ var speedometer_default = speedometer;
12398
+
12399
+ // node_modules/axios/lib/helpers/throttle.js
12400
+ function throttle(fn, freq) {
12401
+ let timestamp = 0;
12402
+ let threshold = 1e3 / freq;
12403
+ let lastArgs;
12404
+ let timer;
12405
+ const invoke = (args, now = Date.now()) => {
12406
+ timestamp = now;
12407
+ lastArgs = null;
12408
+ if (timer) {
12409
+ clearTimeout(timer);
12410
+ timer = null;
12411
+ }
12412
+ fn.apply(null, args);
12413
+ };
12414
+ const throttled = (...args) => {
12415
+ const now = Date.now();
12416
+ const passed = now - timestamp;
12417
+ if (passed >= threshold) {
12418
+ invoke(args, now);
12419
+ } else {
12420
+ lastArgs = args;
12421
+ if (!timer) {
12422
+ timer = setTimeout(() => {
12423
+ timer = null;
12424
+ invoke(lastArgs);
12425
+ }, threshold - passed);
12426
+ }
12427
+ }
12428
+ };
12429
+ const flush = () => lastArgs && invoke(lastArgs);
12430
+ return [throttled, flush];
12431
+ }
12432
+ var throttle_default = throttle;
12433
+
12434
+ // node_modules/axios/lib/helpers/progressEventReducer.js
12435
+ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
12436
+ let bytesNotified = 0;
12437
+ const _speedometer = speedometer_default(50, 250);
12438
+ return throttle_default((e2) => {
12439
+ const loaded = e2.loaded;
12440
+ const total = e2.lengthComputable ? e2.total : void 0;
12441
+ const progressBytes = loaded - bytesNotified;
12442
+ const rate = _speedometer(progressBytes);
12443
+ const inRange = loaded <= total;
12444
+ bytesNotified = loaded;
12445
+ const data = {
12446
+ loaded,
12447
+ total,
12448
+ progress: total ? loaded / total : void 0,
12449
+ bytes: progressBytes,
12450
+ rate: rate ? rate : void 0,
12451
+ estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
12452
+ event: e2,
12453
+ lengthComputable: total != null,
12454
+ [isDownloadStream ? "download" : "upload"]: true
12455
+ };
12456
+ listener(data);
12457
+ }, freq);
12458
+ };
12459
+ var progressEventDecorator = (total, throttled) => {
12460
+ const lengthComputable = total != null;
12461
+ return [(loaded) => throttled[0]({
12462
+ lengthComputable,
12463
+ total,
12464
+ loaded
12465
+ }), throttled[1]];
12466
+ };
12467
+ var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
12468
+
12413
12469
  // node_modules/axios/lib/adapters/http.js
12414
12470
  var zlibOptions = {
12415
12471
  flush: zlib.constants.Z_SYNC_FLUSH,
@@ -12425,6 +12481,10 @@ var isHttps = /https:?/;
12425
12481
  var supportedProtocols = platform_default.protocols.map((protocol) => {
12426
12482
  return protocol + ":";
12427
12483
  });
12484
+ var flushOnFinish = (stream4, [throttled, flush]) => {
12485
+ stream4.on("end", flush).on("error", flush);
12486
+ return throttled;
12487
+ };
12428
12488
  function dispatchBeforeRedirect(options, responseDetails) {
12429
12489
  if (options.beforeRedirects.proxy) {
12430
12490
  options.beforeRedirects.proxy(options);
@@ -12436,7 +12496,7 @@ function dispatchBeforeRedirect(options, responseDetails) {
12436
12496
  function setProxy(options, configProxy, location) {
12437
12497
  let proxy = configProxy;
12438
12498
  if (!proxy && proxy !== false) {
12439
- const proxyUrl = (0, import_proxy_from_env.getProxyForUrl)(location);
12499
+ const proxyUrl = import_proxy_from_env.default.getProxyForUrl(location);
12440
12500
  if (proxyUrl) {
12441
12501
  proxy = new URL(proxyUrl);
12442
12502
  }
@@ -12544,8 +12604,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12544
12604
  config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
12545
12605
  }
12546
12606
  }
12547
- const fullPath = buildFullPath(config.baseURL, config.url);
12548
- const parsed = new URL(fullPath, "http://localhost");
12607
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
12608
+ const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
12549
12609
  const protocol = parsed.protocol || supportedProtocols[0];
12550
12610
  if (protocol === "data:") {
12551
12611
  let convertedData;
@@ -12589,8 +12649,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12589
12649
  }
12590
12650
  const headers = AxiosHeaders_default.from(config.headers).normalize();
12591
12651
  headers.set("User-Agent", "axios/" + VERSION, false);
12592
- const onDownloadProgress = config.onDownloadProgress;
12593
- const onUploadProgress = config.onUploadProgress;
12652
+ const { onUploadProgress, onDownloadProgress } = config;
12594
12653
  const maxRate = config.maxRate;
12595
12654
  let maxUploadRate = void 0;
12596
12655
  let maxDownloadRate = void 0;
@@ -12606,12 +12665,12 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12606
12665
  headers.set(data.getHeaders());
12607
12666
  if (!headers.hasContentLength()) {
12608
12667
  try {
12609
- const knownLength = await util.promisify(data.getLength).call(data);
12668
+ const knownLength = await util2.promisify(data.getLength).call(data);
12610
12669
  Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
12611
12670
  } catch (e2) {
12612
12671
  }
12613
12672
  }
12614
- } else if (utils_default.isBlob(data)) {
12673
+ } else if (utils_default.isBlob(data) || utils_default.isFile(data)) {
12615
12674
  data.size && headers.setContentType(data.type || "application/octet-stream");
12616
12675
  headers.setContentLength(data.size || 0);
12617
12676
  data = stream3.Readable.from(readBlob_default(data));
@@ -12649,14 +12708,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12649
12708
  data = stream3.Readable.from(data, { objectMode: false });
12650
12709
  }
12651
12710
  data = stream3.pipeline([data, new AxiosTransformStream_default({
12652
- length: contentLength,
12653
12711
  maxRate: utils_default.toFiniteNumber(maxUploadRate)
12654
12712
  })], utils_default.noop);
12655
- onUploadProgress && data.on("progress", (progress) => {
12656
- onUploadProgress(Object.assign(progress, {
12657
- upload: true
12658
- }));
12659
- });
12713
+ onUploadProgress && data.on("progress", flushOnFinish(
12714
+ data,
12715
+ progressEventDecorator(
12716
+ contentLength,
12717
+ progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
12718
+ )
12719
+ ));
12660
12720
  }
12661
12721
  let auth = void 0;
12662
12722
  if (config.auth) {
@@ -12704,7 +12764,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12704
12764
  if (config.socketPath) {
12705
12765
  options.socketPath = config.socketPath;
12706
12766
  } else {
12707
- options.hostname = parsed.hostname;
12767
+ options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
12708
12768
  options.port = parsed.port;
12709
12769
  setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
12710
12770
  }
@@ -12736,16 +12796,17 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12736
12796
  if (req.destroyed) return;
12737
12797
  const streams = [res];
12738
12798
  const responseLength = +res.headers["content-length"];
12739
- if (onDownloadProgress) {
12799
+ if (onDownloadProgress || maxDownloadRate) {
12740
12800
  const transformStream = new AxiosTransformStream_default({
12741
- length: utils_default.toFiniteNumber(responseLength),
12742
12801
  maxRate: utils_default.toFiniteNumber(maxDownloadRate)
12743
12802
  });
12744
- onDownloadProgress && transformStream.on("progress", (progress) => {
12745
- onDownloadProgress(Object.assign(progress, {
12746
- download: true
12747
- }));
12748
- });
12803
+ onDownloadProgress && transformStream.on("progress", flushOnFinish(
12804
+ transformStream,
12805
+ progressEventDecorator(
12806
+ responseLength,
12807
+ progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
12808
+ )
12809
+ ));
12749
12810
  streams.push(transformStream);
12750
12811
  }
12751
12812
  let responseStream = res;
@@ -12812,7 +12873,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12812
12873
  return;
12813
12874
  }
12814
12875
  const err = new AxiosError_default(
12815
- "maxContentLength size of " + config.maxContentLength + " exceeded",
12876
+ "stream has been aborted",
12816
12877
  AxiosError_default.ERR_BAD_RESPONSE,
12817
12878
  config,
12818
12879
  lastRequest
@@ -12906,6 +12967,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12906
12967
  });
12907
12968
  };
12908
12969
 
12970
+ // node_modules/axios/lib/helpers/isURLSameOrigin.js
12971
+ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => {
12972
+ url2 = new URL(url2, platform_default.origin);
12973
+ return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port);
12974
+ })(
12975
+ new URL(platform_default.origin),
12976
+ platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
12977
+ ) : () => true;
12978
+
12909
12979
  // node_modules/axios/lib/helpers/cookies.js
12910
12980
  var cookies_default = platform_default.hasStandardBrowserEnv ? (
12911
12981
  // Standard browser envs support document.cookie
@@ -12939,104 +13009,139 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? (
12939
13009
  }
12940
13010
  );
12941
13011
 
12942
- // node_modules/axios/lib/helpers/isURLSameOrigin.js
12943
- var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? (
12944
- // Standard browser envs have full support of the APIs needed to test
12945
- // whether the request URL is of the same origin as current location.
12946
- function standardBrowserEnv() {
12947
- const msie = /(msie|trident)/i.test(navigator.userAgent);
12948
- const urlParsingNode = document.createElement("a");
12949
- let originURL;
12950
- function resolveURL(url2) {
12951
- let href = url2;
12952
- if (msie) {
12953
- urlParsingNode.setAttribute("href", href);
12954
- href = urlParsingNode.href;
12955
- }
12956
- urlParsingNode.setAttribute("href", href);
12957
- return {
12958
- href: urlParsingNode.href,
12959
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
12960
- host: urlParsingNode.host,
12961
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
12962
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
12963
- hostname: urlParsingNode.hostname,
12964
- port: urlParsingNode.port,
12965
- pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
12966
- };
13012
+ // node_modules/axios/lib/core/mergeConfig.js
13013
+ var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
13014
+ function mergeConfig(config1, config2) {
13015
+ config2 = config2 || {};
13016
+ const config = {};
13017
+ function getMergedValue(target, source, prop, caseless) {
13018
+ if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
13019
+ return utils_default.merge.call({ caseless }, target, source);
13020
+ } else if (utils_default.isPlainObject(source)) {
13021
+ return utils_default.merge({}, source);
13022
+ } else if (utils_default.isArray(source)) {
13023
+ return source.slice();
12967
13024
  }
12968
- originURL = resolveURL(window.location.href);
12969
- return function isURLSameOrigin(requestURL) {
12970
- const parsed = utils_default.isString(requestURL) ? resolveURL(requestURL) : requestURL;
12971
- return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
12972
- };
12973
- }()
12974
- ) : (
12975
- // Non standard browser envs (web workers, react-native) lack needed support.
12976
- /* @__PURE__ */ function nonStandardBrowserEnv() {
12977
- return function isURLSameOrigin() {
12978
- return true;
12979
- };
12980
- }()
12981
- );
12982
-
12983
- // node_modules/axios/lib/adapters/xhr.js
12984
- function progressEventReducer(listener, isDownloadStream) {
12985
- let bytesNotified = 0;
12986
- const _speedometer = speedometer_default(50, 250);
12987
- return (e2) => {
12988
- const loaded = e2.loaded;
12989
- const total = e2.lengthComputable ? e2.total : void 0;
12990
- const progressBytes = loaded - bytesNotified;
12991
- const rate = _speedometer(progressBytes);
12992
- const inRange = loaded <= total;
12993
- bytesNotified = loaded;
12994
- const data = {
12995
- loaded,
12996
- total,
12997
- progress: total ? loaded / total : void 0,
12998
- bytes: progressBytes,
12999
- rate: rate ? rate : void 0,
13000
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
13001
- event: e2
13002
- };
13003
- data[isDownloadStream ? "download" : "upload"] = true;
13004
- listener(data);
13025
+ return source;
13026
+ }
13027
+ function mergeDeepProperties(a, b, prop, caseless) {
13028
+ if (!utils_default.isUndefined(b)) {
13029
+ return getMergedValue(a, b, prop, caseless);
13030
+ } else if (!utils_default.isUndefined(a)) {
13031
+ return getMergedValue(void 0, a, prop, caseless);
13032
+ }
13033
+ }
13034
+ function valueFromConfig2(a, b) {
13035
+ if (!utils_default.isUndefined(b)) {
13036
+ return getMergedValue(void 0, b);
13037
+ }
13038
+ }
13039
+ function defaultToConfig2(a, b) {
13040
+ if (!utils_default.isUndefined(b)) {
13041
+ return getMergedValue(void 0, b);
13042
+ } else if (!utils_default.isUndefined(a)) {
13043
+ return getMergedValue(void 0, a);
13044
+ }
13045
+ }
13046
+ function mergeDirectKeys(a, b, prop) {
13047
+ if (prop in config2) {
13048
+ return getMergedValue(a, b);
13049
+ } else if (prop in config1) {
13050
+ return getMergedValue(void 0, a);
13051
+ }
13052
+ }
13053
+ const mergeMap = {
13054
+ url: valueFromConfig2,
13055
+ method: valueFromConfig2,
13056
+ data: valueFromConfig2,
13057
+ baseURL: defaultToConfig2,
13058
+ transformRequest: defaultToConfig2,
13059
+ transformResponse: defaultToConfig2,
13060
+ paramsSerializer: defaultToConfig2,
13061
+ timeout: defaultToConfig2,
13062
+ timeoutMessage: defaultToConfig2,
13063
+ withCredentials: defaultToConfig2,
13064
+ withXSRFToken: defaultToConfig2,
13065
+ adapter: defaultToConfig2,
13066
+ responseType: defaultToConfig2,
13067
+ xsrfCookieName: defaultToConfig2,
13068
+ xsrfHeaderName: defaultToConfig2,
13069
+ onUploadProgress: defaultToConfig2,
13070
+ onDownloadProgress: defaultToConfig2,
13071
+ decompress: defaultToConfig2,
13072
+ maxContentLength: defaultToConfig2,
13073
+ maxBodyLength: defaultToConfig2,
13074
+ beforeRedirect: defaultToConfig2,
13075
+ transport: defaultToConfig2,
13076
+ httpAgent: defaultToConfig2,
13077
+ httpsAgent: defaultToConfig2,
13078
+ cancelToken: defaultToConfig2,
13079
+ socketPath: defaultToConfig2,
13080
+ responseEncoding: defaultToConfig2,
13081
+ validateStatus: mergeDirectKeys,
13082
+ headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
13005
13083
  };
13084
+ utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
13085
+ const merge2 = mergeMap[prop] || mergeDeepProperties;
13086
+ const configValue = merge2(config1[prop], config2[prop], prop);
13087
+ utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
13088
+ });
13089
+ return config;
13006
13090
  }
13091
+
13092
+ // node_modules/axios/lib/helpers/resolveConfig.js
13093
+ var resolveConfig_default = (config) => {
13094
+ const newConfig = mergeConfig({}, config);
13095
+ let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
13096
+ newConfig.headers = headers = AxiosHeaders_default.from(headers);
13097
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
13098
+ if (auth) {
13099
+ headers.set(
13100
+ "Authorization",
13101
+ "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
13102
+ );
13103
+ }
13104
+ let contentType;
13105
+ if (utils_default.isFormData(data)) {
13106
+ if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
13107
+ headers.setContentType(void 0);
13108
+ } else if ((contentType = headers.getContentType()) !== false) {
13109
+ const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
13110
+ headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
13111
+ }
13112
+ }
13113
+ if (platform_default.hasStandardBrowserEnv) {
13114
+ withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
13115
+ if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
13116
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
13117
+ if (xsrfValue) {
13118
+ headers.set(xsrfHeaderName, xsrfValue);
13119
+ }
13120
+ }
13121
+ }
13122
+ return newConfig;
13123
+ };
13124
+
13125
+ // node_modules/axios/lib/adapters/xhr.js
13007
13126
  var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
13008
13127
  var xhr_default = isXHRAdapterSupported && function(config) {
13009
13128
  return new Promise(function dispatchXhrRequest(resolve, reject) {
13010
- let requestData = config.data;
13011
- const requestHeaders = AxiosHeaders_default.from(config.headers).normalize();
13012
- let { responseType, withXSRFToken } = config;
13129
+ const _config = resolveConfig_default(config);
13130
+ let requestData = _config.data;
13131
+ const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
13132
+ let { responseType, onUploadProgress, onDownloadProgress } = _config;
13013
13133
  let onCanceled;
13134
+ let uploadThrottled, downloadThrottled;
13135
+ let flushUpload, flushDownload;
13014
13136
  function done() {
13015
- if (config.cancelToken) {
13016
- config.cancelToken.unsubscribe(onCanceled);
13017
- }
13018
- if (config.signal) {
13019
- config.signal.removeEventListener("abort", onCanceled);
13020
- }
13021
- }
13022
- let contentType;
13023
- if (utils_default.isFormData(requestData)) {
13024
- if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
13025
- requestHeaders.setContentType(false);
13026
- } else if ((contentType = requestHeaders.getContentType()) !== false) {
13027
- const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
13028
- requestHeaders.setContentType([type || "multipart/form-data", ...tokens].join("; "));
13029
- }
13137
+ flushUpload && flushUpload();
13138
+ flushDownload && flushDownload();
13139
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
13140
+ _config.signal && _config.signal.removeEventListener("abort", onCanceled);
13030
13141
  }
13031
13142
  let request = new XMLHttpRequest();
13032
- if (config.auth) {
13033
- const username = config.auth.username || "";
13034
- const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
13035
- requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
13036
- }
13037
- const fullPath = buildFullPath(config.baseURL, config.url);
13038
- request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
13039
- request.timeout = config.timeout;
13143
+ request.open(_config.method.toUpperCase(), _config.url, true);
13144
+ request.timeout = _config.timeout;
13040
13145
  function onloadend() {
13041
13146
  if (!request) {
13042
13147
  return;
@@ -13087,10 +13192,10 @@ var xhr_default = isXHRAdapterSupported && function(config) {
13087
13192
  request = null;
13088
13193
  };
13089
13194
  request.ontimeout = function handleTimeout() {
13090
- let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
13091
- const transitional2 = config.transitional || transitional_default;
13092
- if (config.timeoutErrorMessage) {
13093
- timeoutErrorMessage = config.timeoutErrorMessage;
13195
+ let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
13196
+ const transitional2 = _config.transitional || transitional_default;
13197
+ if (_config.timeoutErrorMessage) {
13198
+ timeoutErrorMessage = _config.timeoutErrorMessage;
13094
13199
  }
13095
13200
  reject(new AxiosError_default(
13096
13201
  timeoutErrorMessage,
@@ -13100,34 +13205,28 @@ var xhr_default = isXHRAdapterSupported && function(config) {
13100
13205
  ));
13101
13206
  request = null;
13102
13207
  };
13103
- if (platform_default.hasStandardBrowserEnv) {
13104
- withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
13105
- if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(fullPath)) {
13106
- const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies_default.read(config.xsrfCookieName);
13107
- if (xsrfValue) {
13108
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
13109
- }
13110
- }
13111
- }
13112
13208
  requestData === void 0 && requestHeaders.setContentType(null);
13113
13209
  if ("setRequestHeader" in request) {
13114
13210
  utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
13115
13211
  request.setRequestHeader(key, val);
13116
13212
  });
13117
13213
  }
13118
- if (!utils_default.isUndefined(config.withCredentials)) {
13119
- request.withCredentials = !!config.withCredentials;
13214
+ if (!utils_default.isUndefined(_config.withCredentials)) {
13215
+ request.withCredentials = !!_config.withCredentials;
13120
13216
  }
13121
13217
  if (responseType && responseType !== "json") {
13122
- request.responseType = config.responseType;
13218
+ request.responseType = _config.responseType;
13123
13219
  }
13124
- if (typeof config.onDownloadProgress === "function") {
13125
- request.addEventListener("progress", progressEventReducer(config.onDownloadProgress, true));
13220
+ if (onDownloadProgress) {
13221
+ [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
13222
+ request.addEventListener("progress", downloadThrottled);
13126
13223
  }
13127
- if (typeof config.onUploadProgress === "function" && request.upload) {
13128
- request.upload.addEventListener("progress", progressEventReducer(config.onUploadProgress));
13224
+ if (onUploadProgress && request.upload) {
13225
+ [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
13226
+ request.upload.addEventListener("progress", uploadThrottled);
13227
+ request.upload.addEventListener("loadend", flushUpload);
13129
13228
  }
13130
- if (config.cancelToken || config.signal) {
13229
+ if (_config.cancelToken || _config.signal) {
13131
13230
  onCanceled = (cancel) => {
13132
13231
  if (!request) {
13133
13232
  return;
@@ -13136,12 +13235,12 @@ var xhr_default = isXHRAdapterSupported && function(config) {
13136
13235
  request.abort();
13137
13236
  request = null;
13138
13237
  };
13139
- config.cancelToken && config.cancelToken.subscribe(onCanceled);
13140
- if (config.signal) {
13141
- config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
13238
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
13239
+ if (_config.signal) {
13240
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
13142
13241
  }
13143
13242
  }
13144
- const protocol = parseProtocol(fullPath);
13243
+ const protocol = parseProtocol(_config.url);
13145
13244
  if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
13146
13245
  reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
13147
13246
  return;
@@ -13150,10 +13249,288 @@ var xhr_default = isXHRAdapterSupported && function(config) {
13150
13249
  });
13151
13250
  };
13152
13251
 
13252
+ // node_modules/axios/lib/helpers/composeSignals.js
13253
+ var composeSignals = (signals, timeout) => {
13254
+ const { length } = signals = signals ? signals.filter(Boolean) : [];
13255
+ if (timeout || length) {
13256
+ let controller = new AbortController();
13257
+ let aborted;
13258
+ const onabort = function(reason) {
13259
+ if (!aborted) {
13260
+ aborted = true;
13261
+ unsubscribe();
13262
+ const err = reason instanceof Error ? reason : this.reason;
13263
+ controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
13264
+ }
13265
+ };
13266
+ let timer = timeout && setTimeout(() => {
13267
+ timer = null;
13268
+ onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT));
13269
+ }, timeout);
13270
+ const unsubscribe = () => {
13271
+ if (signals) {
13272
+ timer && clearTimeout(timer);
13273
+ timer = null;
13274
+ signals.forEach((signal2) => {
13275
+ signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
13276
+ });
13277
+ signals = null;
13278
+ }
13279
+ };
13280
+ signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
13281
+ const { signal } = controller;
13282
+ signal.unsubscribe = () => utils_default.asap(unsubscribe);
13283
+ return signal;
13284
+ }
13285
+ };
13286
+ var composeSignals_default = composeSignals;
13287
+
13288
+ // node_modules/axios/lib/helpers/trackStream.js
13289
+ var streamChunk = function* (chunk, chunkSize) {
13290
+ let len = chunk.byteLength;
13291
+ if (!chunkSize || len < chunkSize) {
13292
+ yield chunk;
13293
+ return;
13294
+ }
13295
+ let pos = 0;
13296
+ let end;
13297
+ while (pos < len) {
13298
+ end = pos + chunkSize;
13299
+ yield chunk.slice(pos, end);
13300
+ pos = end;
13301
+ }
13302
+ };
13303
+ var readBytes = async function* (iterable, chunkSize) {
13304
+ for await (const chunk of readStream(iterable)) {
13305
+ yield* streamChunk(chunk, chunkSize);
13306
+ }
13307
+ };
13308
+ var readStream = async function* (stream4) {
13309
+ if (stream4[Symbol.asyncIterator]) {
13310
+ yield* stream4;
13311
+ return;
13312
+ }
13313
+ const reader = stream4.getReader();
13314
+ try {
13315
+ for (; ; ) {
13316
+ const { done, value } = await reader.read();
13317
+ if (done) {
13318
+ break;
13319
+ }
13320
+ yield value;
13321
+ }
13322
+ } finally {
13323
+ await reader.cancel();
13324
+ }
13325
+ };
13326
+ var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
13327
+ const iterator = readBytes(stream4, chunkSize);
13328
+ let bytes = 0;
13329
+ let done;
13330
+ let _onFinish = (e2) => {
13331
+ if (!done) {
13332
+ done = true;
13333
+ onFinish && onFinish(e2);
13334
+ }
13335
+ };
13336
+ return new ReadableStream({
13337
+ async pull(controller) {
13338
+ try {
13339
+ const { done: done2, value } = await iterator.next();
13340
+ if (done2) {
13341
+ _onFinish();
13342
+ controller.close();
13343
+ return;
13344
+ }
13345
+ let len = value.byteLength;
13346
+ if (onProgress) {
13347
+ let loadedBytes = bytes += len;
13348
+ onProgress(loadedBytes);
13349
+ }
13350
+ controller.enqueue(new Uint8Array(value));
13351
+ } catch (err) {
13352
+ _onFinish(err);
13353
+ throw err;
13354
+ }
13355
+ },
13356
+ cancel(reason) {
13357
+ _onFinish(reason);
13358
+ return iterator.return();
13359
+ }
13360
+ }, {
13361
+ highWaterMark: 2
13362
+ });
13363
+ };
13364
+
13365
+ // node_modules/axios/lib/adapters/fetch.js
13366
+ var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
13367
+ var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
13368
+ var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
13369
+ var test = (fn, ...args) => {
13370
+ try {
13371
+ return !!fn(...args);
13372
+ } catch (e2) {
13373
+ return false;
13374
+ }
13375
+ };
13376
+ var supportsRequestStream = isReadableStreamSupported && test(() => {
13377
+ let duplexAccessed = false;
13378
+ const hasContentType = new Request(platform_default.origin, {
13379
+ body: new ReadableStream(),
13380
+ method: "POST",
13381
+ get duplex() {
13382
+ duplexAccessed = true;
13383
+ return "half";
13384
+ }
13385
+ }).headers.has("Content-Type");
13386
+ return duplexAccessed && !hasContentType;
13387
+ });
13388
+ var DEFAULT_CHUNK_SIZE = 64 * 1024;
13389
+ var supportsResponseStream = isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
13390
+ var resolvers = {
13391
+ stream: supportsResponseStream && ((res) => res.body)
13392
+ };
13393
+ isFetchSupported && ((res) => {
13394
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
13395
+ !resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
13396
+ throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
13397
+ });
13398
+ });
13399
+ })(new Response());
13400
+ var getBodyLength = async (body) => {
13401
+ if (body == null) {
13402
+ return 0;
13403
+ }
13404
+ if (utils_default.isBlob(body)) {
13405
+ return body.size;
13406
+ }
13407
+ if (utils_default.isSpecCompliantForm(body)) {
13408
+ const _request = new Request(platform_default.origin, {
13409
+ method: "POST",
13410
+ body
13411
+ });
13412
+ return (await _request.arrayBuffer()).byteLength;
13413
+ }
13414
+ if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
13415
+ return body.byteLength;
13416
+ }
13417
+ if (utils_default.isURLSearchParams(body)) {
13418
+ body = body + "";
13419
+ }
13420
+ if (utils_default.isString(body)) {
13421
+ return (await encodeText(body)).byteLength;
13422
+ }
13423
+ };
13424
+ var resolveBodyLength = async (headers, body) => {
13425
+ const length = utils_default.toFiniteNumber(headers.getContentLength());
13426
+ return length == null ? getBodyLength(body) : length;
13427
+ };
13428
+ var fetch_default = isFetchSupported && (async (config) => {
13429
+ let {
13430
+ url: url2,
13431
+ method,
13432
+ data,
13433
+ signal,
13434
+ cancelToken,
13435
+ timeout,
13436
+ onDownloadProgress,
13437
+ onUploadProgress,
13438
+ responseType,
13439
+ headers,
13440
+ withCredentials = "same-origin",
13441
+ fetchOptions
13442
+ } = resolveConfig_default(config);
13443
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
13444
+ let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
13445
+ let request;
13446
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
13447
+ composedSignal.unsubscribe();
13448
+ });
13449
+ let requestContentLength;
13450
+ try {
13451
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
13452
+ let _request = new Request(url2, {
13453
+ method: "POST",
13454
+ body: data,
13455
+ duplex: "half"
13456
+ });
13457
+ let contentTypeHeader;
13458
+ if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
13459
+ headers.setContentType(contentTypeHeader);
13460
+ }
13461
+ if (_request.body) {
13462
+ const [onProgress, flush] = progressEventDecorator(
13463
+ requestContentLength,
13464
+ progressEventReducer(asyncDecorator(onUploadProgress))
13465
+ );
13466
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
13467
+ }
13468
+ }
13469
+ if (!utils_default.isString(withCredentials)) {
13470
+ withCredentials = withCredentials ? "include" : "omit";
13471
+ }
13472
+ const isCredentialsSupported = "credentials" in Request.prototype;
13473
+ request = new Request(url2, {
13474
+ ...fetchOptions,
13475
+ signal: composedSignal,
13476
+ method: method.toUpperCase(),
13477
+ headers: headers.normalize().toJSON(),
13478
+ body: data,
13479
+ duplex: "half",
13480
+ credentials: isCredentialsSupported ? withCredentials : void 0
13481
+ });
13482
+ let response = await fetch(request);
13483
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
13484
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
13485
+ const options = {};
13486
+ ["status", "statusText", "headers"].forEach((prop) => {
13487
+ options[prop] = response[prop];
13488
+ });
13489
+ const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
13490
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
13491
+ responseContentLength,
13492
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
13493
+ ) || [];
13494
+ response = new Response(
13495
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
13496
+ flush && flush();
13497
+ unsubscribe && unsubscribe();
13498
+ }),
13499
+ options
13500
+ );
13501
+ }
13502
+ responseType = responseType || "text";
13503
+ let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
13504
+ !isStreamResponse && unsubscribe && unsubscribe();
13505
+ return await new Promise((resolve, reject) => {
13506
+ settle(resolve, reject, {
13507
+ data: responseData,
13508
+ headers: AxiosHeaders_default.from(response.headers),
13509
+ status: response.status,
13510
+ statusText: response.statusText,
13511
+ config,
13512
+ request
13513
+ });
13514
+ });
13515
+ } catch (err) {
13516
+ unsubscribe && unsubscribe();
13517
+ if (err && err.name === "TypeError" && /fetch/i.test(err.message)) {
13518
+ throw Object.assign(
13519
+ new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
13520
+ {
13521
+ cause: err.cause || err
13522
+ }
13523
+ );
13524
+ }
13525
+ throw AxiosError_default.from(err, err && err.code, config, request);
13526
+ }
13527
+ });
13528
+
13153
13529
  // node_modules/axios/lib/adapters/adapters.js
13154
13530
  var knownAdapters = {
13155
13531
  http: http_default,
13156
- xhr: xhr_default
13532
+ xhr: xhr_default,
13533
+ fetch: fetch_default
13157
13534
  };
13158
13535
  utils_default.forEach(knownAdapters, (fn, value) => {
13159
13536
  if (fn) {
@@ -13248,86 +13625,6 @@ function dispatchRequest(config) {
13248
13625
  });
13249
13626
  }
13250
13627
 
13251
- // node_modules/axios/lib/core/mergeConfig.js
13252
- var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
13253
- function mergeConfig(config1, config2) {
13254
- config2 = config2 || {};
13255
- const config = {};
13256
- function getMergedValue(target, source, caseless) {
13257
- if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
13258
- return utils_default.merge.call({ caseless }, target, source);
13259
- } else if (utils_default.isPlainObject(source)) {
13260
- return utils_default.merge({}, source);
13261
- } else if (utils_default.isArray(source)) {
13262
- return source.slice();
13263
- }
13264
- return source;
13265
- }
13266
- function mergeDeepProperties(a, b, caseless) {
13267
- if (!utils_default.isUndefined(b)) {
13268
- return getMergedValue(a, b, caseless);
13269
- } else if (!utils_default.isUndefined(a)) {
13270
- return getMergedValue(void 0, a, caseless);
13271
- }
13272
- }
13273
- function valueFromConfig2(a, b) {
13274
- if (!utils_default.isUndefined(b)) {
13275
- return getMergedValue(void 0, b);
13276
- }
13277
- }
13278
- function defaultToConfig2(a, b) {
13279
- if (!utils_default.isUndefined(b)) {
13280
- return getMergedValue(void 0, b);
13281
- } else if (!utils_default.isUndefined(a)) {
13282
- return getMergedValue(void 0, a);
13283
- }
13284
- }
13285
- function mergeDirectKeys(a, b, prop) {
13286
- if (prop in config2) {
13287
- return getMergedValue(a, b);
13288
- } else if (prop in config1) {
13289
- return getMergedValue(void 0, a);
13290
- }
13291
- }
13292
- const mergeMap = {
13293
- url: valueFromConfig2,
13294
- method: valueFromConfig2,
13295
- data: valueFromConfig2,
13296
- baseURL: defaultToConfig2,
13297
- transformRequest: defaultToConfig2,
13298
- transformResponse: defaultToConfig2,
13299
- paramsSerializer: defaultToConfig2,
13300
- timeout: defaultToConfig2,
13301
- timeoutMessage: defaultToConfig2,
13302
- withCredentials: defaultToConfig2,
13303
- withXSRFToken: defaultToConfig2,
13304
- adapter: defaultToConfig2,
13305
- responseType: defaultToConfig2,
13306
- xsrfCookieName: defaultToConfig2,
13307
- xsrfHeaderName: defaultToConfig2,
13308
- onUploadProgress: defaultToConfig2,
13309
- onDownloadProgress: defaultToConfig2,
13310
- decompress: defaultToConfig2,
13311
- maxContentLength: defaultToConfig2,
13312
- maxBodyLength: defaultToConfig2,
13313
- beforeRedirect: defaultToConfig2,
13314
- transport: defaultToConfig2,
13315
- httpAgent: defaultToConfig2,
13316
- httpsAgent: defaultToConfig2,
13317
- cancelToken: defaultToConfig2,
13318
- socketPath: defaultToConfig2,
13319
- responseEncoding: defaultToConfig2,
13320
- validateStatus: mergeDirectKeys,
13321
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
13322
- };
13323
- utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
13324
- const merge2 = mergeMap[prop] || mergeDeepProperties;
13325
- const configValue = merge2(config1[prop], config2[prop], prop);
13326
- utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
13327
- });
13328
- return config;
13329
- }
13330
-
13331
13628
  // node_modules/axios/lib/helpers/validator.js
13332
13629
  var validators = {};
13333
13630
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
@@ -13359,6 +13656,12 @@ validators.transitional = function transitional(validator, version, message) {
13359
13656
  return validator ? validator(value, opt, opts) : true;
13360
13657
  };
13361
13658
  };
13659
+ validators.spelling = function spelling(correctSpelling) {
13660
+ return (value, opt) => {
13661
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
13662
+ return true;
13663
+ };
13664
+ };
13362
13665
  function assertOptions(options, schema, allowUnknown) {
13363
13666
  if (typeof options !== "object") {
13364
13667
  throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
@@ -13409,13 +13712,16 @@ var Axios = class {
13409
13712
  return await this._request(configOrUrl, config);
13410
13713
  } catch (err) {
13411
13714
  if (err instanceof Error) {
13412
- let dummy;
13413
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
13715
+ let dummy = {};
13716
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
13414
13717
  const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
13415
- if (!err.stack) {
13416
- err.stack = stack;
13417
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
13418
- err.stack += "\n" + stack;
13718
+ try {
13719
+ if (!err.stack) {
13720
+ err.stack = stack;
13721
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
13722
+ err.stack += "\n" + stack;
13723
+ }
13724
+ } catch (e2) {
13419
13725
  }
13420
13726
  }
13421
13727
  throw err;
@@ -13449,6 +13755,16 @@ var Axios = class {
13449
13755
  }, true);
13450
13756
  }
13451
13757
  }
13758
+ if (config.allowAbsoluteUrls !== void 0) {
13759
+ } else if (this.defaults.allowAbsoluteUrls !== void 0) {
13760
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
13761
+ } else {
13762
+ config.allowAbsoluteUrls = true;
13763
+ }
13764
+ validator_default.assertOptions(config, {
13765
+ baseUrl: validators2.spelling("baseURL"),
13766
+ withXsrfToken: validators2.spelling("withXSRFToken")
13767
+ }, true);
13452
13768
  config.method = (config.method || this.defaults.method || "get").toLowerCase();
13453
13769
  let contextHeaders = headers && utils_default.merge(
13454
13770
  headers.common,
@@ -13515,7 +13831,7 @@ var Axios = class {
13515
13831
  }
13516
13832
  getUri(config) {
13517
13833
  config = mergeConfig(this.defaults, config);
13518
- const fullPath = buildFullPath(config.baseURL, config.url);
13834
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
13519
13835
  return buildURL(fullPath, config.params, config.paramsSerializer);
13520
13836
  }
13521
13837
  };
@@ -13618,6 +13934,15 @@ var CancelToken = class _CancelToken {
13618
13934
  this._listeners.splice(index, 1);
13619
13935
  }
13620
13936
  }
13937
+ toAbortSignal() {
13938
+ const controller = new AbortController();
13939
+ const abort = (err) => {
13940
+ controller.abort(err);
13941
+ };
13942
+ this.subscribe(abort);
13943
+ controller.signal.unsubscribe = () => this.unsubscribe(abort);
13944
+ return controller.signal;
13945
+ }
13621
13946
  /**
13622
13947
  * Returns an object that contains a new `CancelToken` and a function that, when called,
13623
13948
  * cancels the `CancelToken`.