@meterian/cli 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +32 -2
  2. package/dist/cli.js +2229 -1364
  3. package/package.json +2 -3
  4. package/CHANGELOG.md +0 -23
package/dist/cli.js CHANGED
@@ -10269,81 +10269,11 @@ var require_form_data = __commonJS({
10269
10269
  FormData2.prototype.toString = function() {
10270
10270
  return "[object FormData]";
10271
10271
  };
10272
- setToStringTag(FormData2, "FormData");
10272
+ setToStringTag(FormData2.prototype, "FormData");
10273
10273
  module2.exports = FormData2;
10274
10274
  }
10275
10275
  });
10276
10276
 
10277
- // ../../node_modules/proxy-from-env/index.js
10278
- var require_proxy_from_env = __commonJS({
10279
- "../../node_modules/proxy-from-env/index.js"(exports2) {
10280
- "use strict";
10281
- var parseUrl = require("url").parse;
10282
- var DEFAULT_PORTS = {
10283
- ftp: 21,
10284
- gopher: 70,
10285
- http: 80,
10286
- https: 443,
10287
- ws: 80,
10288
- wss: 443
10289
- };
10290
- var stringEndsWith = String.prototype.endsWith || function(s) {
10291
- return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
10292
- };
10293
- function getProxyForUrl(url) {
10294
- var parsedUrl = typeof url === "string" ? parseUrl(url) : url || {};
10295
- var proto = parsedUrl.protocol;
10296
- var hostname = parsedUrl.host;
10297
- var port = parsedUrl.port;
10298
- if (typeof hostname !== "string" || !hostname || typeof proto !== "string") {
10299
- return "";
10300
- }
10301
- proto = proto.split(":", 1)[0];
10302
- hostname = hostname.replace(/:\d*$/, "");
10303
- port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
10304
- if (!shouldProxy(hostname, port)) {
10305
- return "";
10306
- }
10307
- var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy");
10308
- if (proxy && proxy.indexOf("://") === -1) {
10309
- proxy = proto + "://" + proxy;
10310
- }
10311
- return proxy;
10312
- }
10313
- function shouldProxy(hostname, port) {
10314
- var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase();
10315
- if (!NO_PROXY) {
10316
- return true;
10317
- }
10318
- if (NO_PROXY === "*") {
10319
- return false;
10320
- }
10321
- return NO_PROXY.split(/[,\s]/).every(function(proxy) {
10322
- if (!proxy) {
10323
- return true;
10324
- }
10325
- var parsedProxy = proxy.match(/^(.+):(\d+)$/);
10326
- var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
10327
- var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
10328
- if (parsedProxyPort && parsedProxyPort !== port) {
10329
- return true;
10330
- }
10331
- if (!/^[.*]/.test(parsedProxyHostname)) {
10332
- return hostname !== parsedProxyHostname;
10333
- }
10334
- if (parsedProxyHostname.charAt(0) === "*") {
10335
- parsedProxyHostname = parsedProxyHostname.slice(1);
10336
- }
10337
- return !stringEndsWith.call(hostname, parsedProxyHostname);
10338
- });
10339
- }
10340
- function getEnv(key) {
10341
- return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
10342
- }
10343
- exports2.getProxyForUrl = getProxyForUrl;
10344
- }
10345
- });
10346
-
10347
10277
  // ../../node_modules/ms/index.js
10348
10278
  var require_ms = __commonJS({
10349
10279
  "../../node_modules/ms/index.js"(exports2, module2) {
@@ -11151,6 +11081,11 @@ var require_follow_redirects = __commonJS({
11151
11081
  } catch (error) {
11152
11082
  useNativeURL = error.code === "ERR_INVALID_URL";
11153
11083
  }
11084
+ var sensitiveHeaders = [
11085
+ "Authorization",
11086
+ "Proxy-Authorization",
11087
+ "Cookie"
11088
+ ];
11154
11089
  var preservedUrlFields = [
11155
11090
  "auth",
11156
11091
  "host",
@@ -11215,6 +11150,7 @@ var require_follow_redirects = __commonJS({
11215
11150
  self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
11216
11151
  }
11217
11152
  };
11153
+ this._headerFilter = new RegExp("^(?:" + sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") + ")$", "i");
11218
11154
  this._performRequest();
11219
11155
  }
11220
11156
  RedirectableRequest.prototype = Object.create(Writable.prototype);
@@ -11352,6 +11288,9 @@ var require_follow_redirects = __commonJS({
11352
11288
  if (!options.headers) {
11353
11289
  options.headers = {};
11354
11290
  }
11291
+ if (!isArray(options.sensitiveHeaders)) {
11292
+ options.sensitiveHeaders = [];
11293
+ }
11355
11294
  if (options.host) {
11356
11295
  if (!options.hostname) {
11357
11296
  options.hostname = options.host;
@@ -11457,7 +11396,7 @@ var require_follow_redirects = __commonJS({
11457
11396
  this._isRedirect = true;
11458
11397
  spreadUrlObject(redirectUrl, this._options);
11459
11398
  if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
11460
- removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
11399
+ removeMatchingHeaders(this._headerFilter, this._options.headers);
11461
11400
  }
11462
11401
  if (isFunction(beforeRedirect)) {
11463
11402
  var responseDetails = {
@@ -11606,6 +11545,9 @@ var require_follow_redirects = __commonJS({
11606
11545
  var dot = subdomain.length - domain.length - 1;
11607
11546
  return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
11608
11547
  }
11548
+ function isArray(value) {
11549
+ return value instanceof Array;
11550
+ }
11609
11551
  function isString(value) {
11610
11552
  return typeof value === "string" || value instanceof String;
11611
11553
  }
@@ -11618,6 +11560,9 @@ var require_follow_redirects = __commonJS({
11618
11560
  function isURL(value) {
11619
11561
  return URL2 && value instanceof URL2;
11620
11562
  }
11563
+ function escapeRegex(regex) {
11564
+ return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
11565
+ }
11621
11566
  module2.exports = wrap({ http, https });
11622
11567
  module2.exports.wrap = wrap;
11623
11568
  }
@@ -11630,35 +11575,30 @@ var require_axios = __commonJS({
11630
11575
  var FormData$1 = require_form_data();
11631
11576
  var crypto = require("crypto");
11632
11577
  var url = require("url");
11633
- var proxyFromEnv = require_proxy_from_env();
11634
11578
  var http = require("http");
11635
11579
  var https = require("https");
11580
+ var http2 = require("http2");
11636
11581
  var util = require("util");
11582
+ var path2 = require("path");
11637
11583
  var followRedirects = require_follow_redirects();
11638
11584
  var zlib = require("zlib");
11639
11585
  var stream = require("stream");
11640
11586
  var events = require("events");
11641
- function _interopDefaultLegacy(e) {
11642
- return e && typeof e === "object" && "default" in e ? e : { "default": e };
11643
- }
11644
- var FormData__default = /* @__PURE__ */ _interopDefaultLegacy(FormData$1);
11645
- var crypto__default = /* @__PURE__ */ _interopDefaultLegacy(crypto);
11646
- var url__default = /* @__PURE__ */ _interopDefaultLegacy(url);
11647
- var proxyFromEnv__default = /* @__PURE__ */ _interopDefaultLegacy(proxyFromEnv);
11648
- var http__default = /* @__PURE__ */ _interopDefaultLegacy(http);
11649
- var https__default = /* @__PURE__ */ _interopDefaultLegacy(https);
11650
- var util__default = /* @__PURE__ */ _interopDefaultLegacy(util);
11651
- var followRedirects__default = /* @__PURE__ */ _interopDefaultLegacy(followRedirects);
11652
- var zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib);
11653
- var stream__default = /* @__PURE__ */ _interopDefaultLegacy(stream);
11654
11587
  function bind(fn, thisArg) {
11655
11588
  return function wrap() {
11656
11589
  return fn.apply(thisArg, arguments);
11657
11590
  };
11658
11591
  }
11659
- var { toString } = Object.prototype;
11660
- var { getPrototypeOf } = Object;
11661
- var { iterator, toStringTag } = Symbol;
11592
+ var {
11593
+ toString
11594
+ } = Object.prototype;
11595
+ var {
11596
+ getPrototypeOf
11597
+ } = Object;
11598
+ var {
11599
+ iterator,
11600
+ toStringTag
11601
+ } = Symbol;
11662
11602
  var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
11663
11603
  const str = toString.call(thing);
11664
11604
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
@@ -11668,10 +11608,12 @@ var require_axios = __commonJS({
11668
11608
  return (thing) => kindOf(thing) === type;
11669
11609
  };
11670
11610
  var typeOfTest = (type) => (thing) => typeof thing === type;
11671
- var { isArray } = Array;
11611
+ var {
11612
+ isArray
11613
+ } = Array;
11672
11614
  var isUndefined = typeOfTest("undefined");
11673
11615
  function isBuffer(val) {
11674
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
11616
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
11675
11617
  }
11676
11618
  var isArrayBuffer = kindOfTest("ArrayBuffer");
11677
11619
  function isArrayBufferView(val) {
@@ -11684,7 +11626,7 @@ var require_axios = __commonJS({
11684
11626
  return result;
11685
11627
  }
11686
11628
  var isString = typeOfTest("string");
11687
- var isFunction = typeOfTest("function");
11629
+ var isFunction$1 = typeOfTest("function");
11688
11630
  var isNumber = typeOfTest("number");
11689
11631
  var isObject = (thing) => thing !== null && typeof thing === "object";
11690
11632
  var isBoolean = (thing) => thing === true || thing === false;
@@ -11707,18 +11649,40 @@ var require_axios = __commonJS({
11707
11649
  };
11708
11650
  var isDate = kindOfTest("Date");
11709
11651
  var isFile = kindOfTest("File");
11652
+ var isReactNativeBlob = (value) => {
11653
+ return !!(value && typeof value.uri !== "undefined");
11654
+ };
11655
+ var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
11710
11656
  var isBlob = kindOfTest("Blob");
11711
11657
  var isFileList = kindOfTest("FileList");
11712
- var isStream = (val) => isObject(val) && isFunction(val.pipe);
11658
+ var isStream = (val) => isObject(val) && isFunction$1(val.pipe);
11659
+ function getGlobal() {
11660
+ if (typeof globalThis !== "undefined") return globalThis;
11661
+ if (typeof self !== "undefined") return self;
11662
+ if (typeof window !== "undefined") return window;
11663
+ if (typeof global !== "undefined") return global;
11664
+ return {};
11665
+ }
11666
+ var G = getGlobal();
11667
+ var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
11713
11668
  var isFormData = (thing) => {
11714
- let kind;
11715
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
11716
- kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
11669
+ if (!thing) return false;
11670
+ if (FormDataCtor && thing instanceof FormDataCtor) return true;
11671
+ const proto = getPrototypeOf(thing);
11672
+ if (!proto || proto === Object.prototype) return false;
11673
+ if (!isFunction$1(thing.append)) return false;
11674
+ const kind = kindOf(thing);
11675
+ return kind === "formdata" || // detect form-data instance
11676
+ kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]";
11717
11677
  };
11718
11678
  var isURLSearchParams = kindOfTest("URLSearchParams");
11719
11679
  var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
11720
- var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
11721
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
11680
+ var trim = (str) => {
11681
+ return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
11682
+ };
11683
+ function forEach(obj, fn, {
11684
+ allOwnKeys = false
11685
+ } = {}) {
11722
11686
  if (obj === null || typeof obj === "undefined") {
11723
11687
  return;
11724
11688
  }
@@ -11765,34 +11729,59 @@ var require_axios = __commonJS({
11765
11729
  return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
11766
11730
  })();
11767
11731
  var isContextDefined = (context) => !isUndefined(context) && context !== _global;
11768
- function merge() {
11769
- const { caseless } = isContextDefined(this) && this || {};
11732
+ function merge(...objs) {
11733
+ const {
11734
+ caseless,
11735
+ skipUndefined
11736
+ } = isContextDefined(this) && this || {};
11770
11737
  const result = {};
11771
11738
  const assignValue = (val, key) => {
11739
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
11740
+ return;
11741
+ }
11772
11742
  const targetKey = caseless && findKey(result, key) || key;
11773
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
11774
- result[targetKey] = merge(result[targetKey], val);
11743
+ const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : void 0;
11744
+ if (isPlainObject(existing) && isPlainObject(val)) {
11745
+ result[targetKey] = merge(existing, val);
11775
11746
  } else if (isPlainObject(val)) {
11776
11747
  result[targetKey] = merge({}, val);
11777
11748
  } else if (isArray(val)) {
11778
11749
  result[targetKey] = val.slice();
11779
- } else {
11750
+ } else if (!skipUndefined || !isUndefined(val)) {
11780
11751
  result[targetKey] = val;
11781
11752
  }
11782
11753
  };
11783
- for (let i = 0, l = arguments.length; i < l; i++) {
11784
- arguments[i] && forEach(arguments[i], assignValue);
11754
+ for (let i = 0, l = objs.length; i < l; i++) {
11755
+ objs[i] && forEach(objs[i], assignValue);
11785
11756
  }
11786
11757
  return result;
11787
11758
  }
11788
- var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
11759
+ var extend = (a, b, thisArg, {
11760
+ allOwnKeys
11761
+ } = {}) => {
11789
11762
  forEach(b, (val, key) => {
11790
- if (thisArg && isFunction(val)) {
11791
- a[key] = bind(val, thisArg);
11763
+ if (thisArg && isFunction$1(val)) {
11764
+ Object.defineProperty(a, key, {
11765
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
11766
+ // hijack defineProperty's accessor-vs-data resolution.
11767
+ __proto__: null,
11768
+ value: bind(val, thisArg),
11769
+ writable: true,
11770
+ enumerable: true,
11771
+ configurable: true
11772
+ });
11792
11773
  } else {
11793
- a[key] = val;
11774
+ Object.defineProperty(a, key, {
11775
+ __proto__: null,
11776
+ value: val,
11777
+ writable: true,
11778
+ enumerable: true,
11779
+ configurable: true
11780
+ });
11794
11781
  }
11795
- }, { allOwnKeys });
11782
+ }, {
11783
+ allOwnKeys
11784
+ });
11796
11785
  return a;
11797
11786
  };
11798
11787
  var stripBOM = (content) => {
@@ -11801,10 +11790,17 @@ var require_axios = __commonJS({
11801
11790
  }
11802
11791
  return content;
11803
11792
  };
11804
- var inherits = (constructor, superConstructor, props, descriptors2) => {
11805
- constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
11806
- constructor.prototype.constructor = constructor;
11793
+ var inherits = (constructor, superConstructor, props, descriptors) => {
11794
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
11795
+ Object.defineProperty(constructor.prototype, "constructor", {
11796
+ __proto__: null,
11797
+ value: constructor,
11798
+ writable: true,
11799
+ enumerable: false,
11800
+ configurable: true
11801
+ });
11807
11802
  Object.defineProperty(constructor, "super", {
11803
+ __proto__: null,
11808
11804
  value: superConstructor.prototype
11809
11805
  });
11810
11806
  props && Object.assign(constructor.prototype, props);
@@ -11874,19 +11870,18 @@ var require_axios = __commonJS({
11874
11870
  };
11875
11871
  var isHTMLForm = kindOfTest("HTMLFormElement");
11876
11872
  var toCamelCase = (str) => {
11877
- return str.toLowerCase().replace(
11878
- /[-_\s]([a-z\d])(\w*)/g,
11879
- function replacer(m, p1, p2) {
11880
- return p1.toUpperCase() + p2;
11881
- }
11882
- );
11873
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
11874
+ return p1.toUpperCase() + p2;
11875
+ });
11883
11876
  };
11884
- var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
11877
+ var hasOwnProperty = (({
11878
+ hasOwnProperty: hasOwnProperty2
11879
+ }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
11885
11880
  var isRegExp = kindOfTest("RegExp");
11886
11881
  var reduceDescriptors = (obj, reducer) => {
11887
- const descriptors2 = Object.getOwnPropertyDescriptors(obj);
11882
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
11888
11883
  const reducedDescriptors = {};
11889
- forEach(descriptors2, (descriptor, name) => {
11884
+ forEach(descriptors, (descriptor, name) => {
11890
11885
  let ret;
11891
11886
  if ((ret = reducer(descriptor, name, obj)) !== false) {
11892
11887
  reducedDescriptors[name] = ret || descriptor;
@@ -11896,11 +11891,11 @@ var require_axios = __commonJS({
11896
11891
  };
11897
11892
  var freezeMethods = (obj) => {
11898
11893
  reduceDescriptors(obj, (descriptor, name) => {
11899
- if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
11894
+ if (isFunction$1(obj) && ["arguments", "caller", "callee"].includes(name)) {
11900
11895
  return false;
11901
11896
  }
11902
11897
  const value = obj[name];
11903
- if (!isFunction(value)) return;
11898
+ if (!isFunction$1(value)) return;
11904
11899
  descriptor.enumerable = false;
11905
11900
  if ("writable" in descriptor) {
11906
11901
  descriptor.writable = false;
@@ -11929,7 +11924,7 @@ var require_axios = __commonJS({
11929
11924
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
11930
11925
  };
11931
11926
  function isSpecCompliantForm(thing) {
11932
- return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
11927
+ return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
11933
11928
  }
11934
11929
  var toJSONObject = (obj) => {
11935
11930
  const stack = new Array(10);
@@ -11957,13 +11952,16 @@ var require_axios = __commonJS({
11957
11952
  return visit(obj, 0);
11958
11953
  };
11959
11954
  var isAsyncFn = kindOfTest("AsyncFunction");
11960
- var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
11955
+ var isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
11961
11956
  var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
11962
11957
  if (setImmediateSupported) {
11963
11958
  return setImmediate;
11964
11959
  }
11965
11960
  return postMessageSupported ? ((token, callbacks) => {
11966
- _global.addEventListener("message", ({ source, data }) => {
11961
+ _global.addEventListener("message", ({
11962
+ source,
11963
+ data
11964
+ }) => {
11967
11965
  if (source === _global && data === token) {
11968
11966
  callbacks.length && callbacks.shift()();
11969
11967
  }
@@ -11973,12 +11971,9 @@ var require_axios = __commonJS({
11973
11971
  _global.postMessage(token, "*");
11974
11972
  };
11975
11973
  })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
11976
- })(
11977
- typeof setImmediate === "function",
11978
- isFunction(_global.postMessage)
11979
- );
11974
+ })(typeof setImmediate === "function", isFunction$1(_global.postMessage));
11980
11975
  var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
11981
- var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
11976
+ var isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
11982
11977
  var utils$1 = {
11983
11978
  isArray,
11984
11979
  isArrayBuffer,
@@ -11998,9 +11993,11 @@ var require_axios = __commonJS({
11998
11993
  isUndefined,
11999
11994
  isDate,
12000
11995
  isFile,
11996
+ isReactNativeBlob,
11997
+ isReactNative,
12001
11998
  isBlob,
12002
11999
  isRegExp,
12003
- isFunction,
12000
+ isFunction: isFunction$1,
12004
12001
  isStream,
12005
12002
  isURLSearchParams,
12006
12003
  isTypedArray,
@@ -12039,808 +12036,880 @@ var require_axios = __commonJS({
12039
12036
  asap,
12040
12037
  isIterable
12041
12038
  };
12042
- function AxiosError(message, code, config, request, response) {
12043
- Error.call(this);
12044
- if (Error.captureStackTrace) {
12045
- Error.captureStackTrace(this, this.constructor);
12046
- } else {
12047
- this.stack = new Error().stack;
12039
+ 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"]);
12040
+ var parseHeaders = (rawHeaders) => {
12041
+ const parsed = {};
12042
+ let key;
12043
+ let val;
12044
+ let i;
12045
+ rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
12046
+ i = line.indexOf(":");
12047
+ key = line.substring(0, i).trim().toLowerCase();
12048
+ val = line.substring(i + 1).trim();
12049
+ if (!key || parsed[key] && ignoreDuplicateOf[key]) {
12050
+ return;
12051
+ }
12052
+ if (key === "set-cookie") {
12053
+ if (parsed[key]) {
12054
+ parsed[key].push(val);
12055
+ } else {
12056
+ parsed[key] = [val];
12057
+ }
12058
+ } else {
12059
+ parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
12060
+ }
12061
+ });
12062
+ return parsed;
12063
+ };
12064
+ var $internals = Symbol("internals");
12065
+ var INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
12066
+ function trimSPorHTAB(str) {
12067
+ let start = 0;
12068
+ let end = str.length;
12069
+ while (start < end) {
12070
+ const code = str.charCodeAt(start);
12071
+ if (code !== 9 && code !== 32) {
12072
+ break;
12073
+ }
12074
+ start += 1;
12048
12075
  }
12049
- this.message = message;
12050
- this.name = "AxiosError";
12051
- code && (this.code = code);
12052
- config && (this.config = config);
12053
- request && (this.request = request);
12054
- if (response) {
12055
- this.response = response;
12056
- this.status = response.status ? response.status : null;
12076
+ while (end > start) {
12077
+ const code = str.charCodeAt(end - 1);
12078
+ if (code !== 9 && code !== 32) {
12079
+ break;
12080
+ }
12081
+ end -= 1;
12057
12082
  }
12083
+ return start === 0 && end === str.length ? str : str.slice(start, end);
12058
12084
  }
12059
- utils$1.inherits(AxiosError, Error, {
12060
- toJSON: function toJSON() {
12061
- return {
12062
- // Standard
12063
- message: this.message,
12064
- name: this.name,
12065
- // Microsoft
12066
- description: this.description,
12067
- number: this.number,
12068
- // Mozilla
12069
- fileName: this.fileName,
12070
- lineNumber: this.lineNumber,
12071
- columnNumber: this.columnNumber,
12072
- stack: this.stack,
12073
- // Axios
12074
- config: utils$1.toJSONObject(this.config),
12075
- code: this.code,
12076
- status: this.status
12077
- };
12078
- }
12079
- });
12080
- var prototype$1 = AxiosError.prototype;
12081
- var descriptors = {};
12082
- [
12083
- "ERR_BAD_OPTION_VALUE",
12084
- "ERR_BAD_OPTION",
12085
- "ECONNABORTED",
12086
- "ETIMEDOUT",
12087
- "ERR_NETWORK",
12088
- "ERR_FR_TOO_MANY_REDIRECTS",
12089
- "ERR_DEPRECATED",
12090
- "ERR_BAD_RESPONSE",
12091
- "ERR_BAD_REQUEST",
12092
- "ERR_CANCELED",
12093
- "ERR_NOT_SUPPORT",
12094
- "ERR_INVALID_URL"
12095
- // eslint-disable-next-line func-names
12096
- ].forEach((code) => {
12097
- descriptors[code] = { value: code };
12098
- });
12099
- Object.defineProperties(AxiosError, descriptors);
12100
- Object.defineProperty(prototype$1, "isAxiosError", { value: true });
12101
- AxiosError.from = (error, code, config, request, response, customProps) => {
12102
- const axiosError = Object.create(prototype$1);
12103
- utils$1.toFlatObject(error, axiosError, function filter(obj) {
12104
- return obj !== Error.prototype;
12105
- }, (prop) => {
12106
- return prop !== "isAxiosError";
12107
- });
12108
- AxiosError.call(axiosError, error.message, code, config, request, response);
12109
- axiosError.cause = error;
12110
- axiosError.name = error.name;
12111
- customProps && Object.assign(axiosError, customProps);
12112
- return axiosError;
12113
- };
12114
- function isVisitable(thing) {
12115
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
12085
+ function normalizeHeader(header) {
12086
+ return header && String(header).trim().toLowerCase();
12116
12087
  }
12117
- function removeBrackets(key) {
12118
- return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
12088
+ function sanitizeHeaderValue(str) {
12089
+ return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ""));
12119
12090
  }
12120
- function renderKey(path2, key, dots) {
12121
- if (!path2) return key;
12122
- return path2.concat(key).map(function each(token, i) {
12123
- token = removeBrackets(token);
12124
- return !dots && i ? "[" + token + "]" : token;
12125
- }).join(dots ? "." : "");
12091
+ function normalizeValue(value) {
12092
+ if (value === false || value == null) {
12093
+ return value;
12094
+ }
12095
+ return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
12126
12096
  }
12127
- function isFlatArray(arr) {
12128
- return utils$1.isArray(arr) && !arr.some(isVisitable);
12097
+ function parseTokens(str) {
12098
+ const tokens = /* @__PURE__ */ Object.create(null);
12099
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
12100
+ let match;
12101
+ while (match = tokensRE.exec(str)) {
12102
+ tokens[match[1]] = match[2];
12103
+ }
12104
+ return tokens;
12129
12105
  }
12130
- var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
12131
- return /^is[A-Z]/.test(prop);
12132
- });
12133
- function toFormData(obj, formData, options) {
12134
- if (!utils$1.isObject(obj)) {
12135
- throw new TypeError("target must be an object");
12106
+ var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
12107
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
12108
+ if (utils$1.isFunction(filter)) {
12109
+ return filter.call(this, value, header);
12136
12110
  }
12137
- formData = formData || new (FormData__default["default"] || FormData)();
12138
- options = utils$1.toFlatObject(options, {
12139
- metaTokens: true,
12140
- dots: false,
12141
- indexes: false
12142
- }, false, function defined(option, source) {
12143
- return !utils$1.isUndefined(source[option]);
12144
- });
12145
- const metaTokens = options.metaTokens;
12146
- const visitor = options.visitor || defaultVisitor;
12147
- const dots = options.dots;
12148
- const indexes = options.indexes;
12149
- const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
12150
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
12151
- if (!utils$1.isFunction(visitor)) {
12152
- throw new TypeError("visitor must be a function");
12111
+ if (isHeaderNameFilter) {
12112
+ value = header;
12153
12113
  }
12154
- function convertValue(value) {
12155
- if (value === null) return "";
12156
- if (utils$1.isDate(value)) {
12157
- return value.toISOString();
12158
- }
12159
- if (utils$1.isBoolean(value)) {
12160
- return value.toString();
12161
- }
12162
- if (!useBlob && utils$1.isBlob(value)) {
12163
- throw new AxiosError("Blob is not supported. Use a Buffer instead.");
12164
- }
12165
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
12166
- return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
12167
- }
12168
- return value;
12114
+ if (!utils$1.isString(value)) return;
12115
+ if (utils$1.isString(filter)) {
12116
+ return value.indexOf(filter) !== -1;
12169
12117
  }
12170
- function defaultVisitor(value, key, path2) {
12171
- let arr = value;
12172
- if (value && !path2 && typeof value === "object") {
12173
- if (utils$1.endsWith(key, "{}")) {
12174
- key = metaTokens ? key : key.slice(0, -2);
12175
- value = JSON.stringify(value);
12176
- } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
12177
- key = removeBrackets(key);
12178
- arr.forEach(function each(el, index) {
12179
- !(utils$1.isUndefined(el) || el === null) && formData.append(
12180
- // eslint-disable-next-line no-nested-ternary
12181
- indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
12182
- convertValue(el)
12183
- );
12184
- });
12185
- return false;
12186
- }
12187
- }
12188
- if (isVisitable(value)) {
12189
- return true;
12190
- }
12191
- formData.append(renderKey(path2, key, dots), convertValue(value));
12192
- return false;
12118
+ if (utils$1.isRegExp(filter)) {
12119
+ return filter.test(value);
12193
12120
  }
12194
- const stack = [];
12195
- const exposedHelpers = Object.assign(predicates, {
12196
- defaultVisitor,
12197
- convertValue,
12198
- isVisitable
12121
+ }
12122
+ function formatHeader(header) {
12123
+ return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
12124
+ return char.toUpperCase() + str;
12199
12125
  });
12200
- function build(value, path2) {
12201
- if (utils$1.isUndefined(value)) return;
12202
- if (stack.indexOf(value) !== -1) {
12203
- throw Error("Circular reference detected in " + path2.join("."));
12204
- }
12205
- stack.push(value);
12206
- utils$1.forEach(value, function each(el, key) {
12207
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
12208
- formData,
12209
- el,
12210
- utils$1.isString(key) ? key.trim() : key,
12211
- path2,
12212
- exposedHelpers
12213
- );
12214
- if (result === true) {
12215
- build(el, path2 ? path2.concat(key) : [key]);
12216
- }
12126
+ }
12127
+ function buildAccessors(obj, header) {
12128
+ const accessorName = utils$1.toCamelCase(" " + header);
12129
+ ["get", "set", "has"].forEach((methodName) => {
12130
+ Object.defineProperty(obj, methodName + accessorName, {
12131
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
12132
+ // this data descriptor into an accessor descriptor on the way in.
12133
+ __proto__: null,
12134
+ value: function(arg1, arg2, arg3) {
12135
+ return this[methodName].call(this, header, arg1, arg2, arg3);
12136
+ },
12137
+ configurable: true
12217
12138
  });
12218
- stack.pop();
12139
+ });
12140
+ }
12141
+ var AxiosHeaders = class {
12142
+ constructor(headers) {
12143
+ headers && this.set(headers);
12219
12144
  }
12220
- if (!utils$1.isObject(obj)) {
12221
- throw new TypeError("data must be an object");
12145
+ set(header, valueOrRewrite, rewrite) {
12146
+ const self2 = this;
12147
+ function setHeader(_value, _header, _rewrite) {
12148
+ const lHeader = normalizeHeader(_header);
12149
+ if (!lHeader) {
12150
+ throw new Error("header name must be a non-empty string");
12151
+ }
12152
+ const key = utils$1.findKey(self2, lHeader);
12153
+ if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
12154
+ self2[key || _header] = normalizeValue(_value);
12155
+ }
12156
+ }
12157
+ const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
12158
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
12159
+ setHeaders(header, valueOrRewrite);
12160
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
12161
+ setHeaders(parseHeaders(header), valueOrRewrite);
12162
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
12163
+ let obj = {}, dest, key;
12164
+ for (const entry of header) {
12165
+ if (!utils$1.isArray(entry)) {
12166
+ throw TypeError("Object iterator must return a key-value pair");
12167
+ }
12168
+ obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
12169
+ }
12170
+ setHeaders(obj, valueOrRewrite);
12171
+ } else {
12172
+ header != null && setHeader(valueOrRewrite, header, rewrite);
12173
+ }
12174
+ return this;
12222
12175
  }
12223
- build(obj);
12224
- return formData;
12225
- }
12226
- function encode$1(str) {
12227
- const charMap = {
12228
- "!": "%21",
12229
- "'": "%27",
12230
- "(": "%28",
12231
- ")": "%29",
12232
- "~": "%7E",
12233
- "%20": "+",
12234
- "%00": "\0"
12235
- };
12236
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
12237
- return charMap[match];
12238
- });
12239
- }
12240
- function AxiosURLSearchParams(params, options) {
12241
- this._pairs = [];
12242
- params && toFormData(params, this, options);
12243
- }
12244
- var prototype = AxiosURLSearchParams.prototype;
12245
- prototype.append = function append(name, value) {
12246
- this._pairs.push([name, value]);
12247
- };
12248
- prototype.toString = function toString2(encoder) {
12249
- const _encode = encoder ? function(value) {
12250
- return encoder.call(this, value, encode$1);
12251
- } : encode$1;
12252
- return this._pairs.map(function each(pair) {
12253
- return _encode(pair[0]) + "=" + _encode(pair[1]);
12254
- }, "").join("&");
12255
- };
12256
- function encode(val) {
12257
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
12258
- }
12259
- function buildURL(url2, params, options) {
12260
- if (!params) {
12261
- return url2;
12176
+ get(header, parser) {
12177
+ header = normalizeHeader(header);
12178
+ if (header) {
12179
+ const key = utils$1.findKey(this, header);
12180
+ if (key) {
12181
+ const value = this[key];
12182
+ if (!parser) {
12183
+ return value;
12184
+ }
12185
+ if (parser === true) {
12186
+ return parseTokens(value);
12187
+ }
12188
+ if (utils$1.isFunction(parser)) {
12189
+ return parser.call(this, value, key);
12190
+ }
12191
+ if (utils$1.isRegExp(parser)) {
12192
+ return parser.exec(value);
12193
+ }
12194
+ throw new TypeError("parser must be boolean|regexp|function");
12195
+ }
12196
+ }
12262
12197
  }
12263
- const _encode = options && options.encode || encode;
12264
- if (utils$1.isFunction(options)) {
12265
- options = {
12266
- serialize: options
12267
- };
12198
+ has(header, matcher) {
12199
+ header = normalizeHeader(header);
12200
+ if (header) {
12201
+ const key = utils$1.findKey(this, header);
12202
+ return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
12203
+ }
12204
+ return false;
12268
12205
  }
12269
- const serializeFn = options && options.serialize;
12270
- let serializedParams;
12271
- if (serializeFn) {
12272
- serializedParams = serializeFn(params, options);
12273
- } else {
12274
- serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
12206
+ delete(header, matcher) {
12207
+ const self2 = this;
12208
+ let deleted = false;
12209
+ function deleteHeader(_header) {
12210
+ _header = normalizeHeader(_header);
12211
+ if (_header) {
12212
+ const key = utils$1.findKey(self2, _header);
12213
+ if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
12214
+ delete self2[key];
12215
+ deleted = true;
12216
+ }
12217
+ }
12218
+ }
12219
+ if (utils$1.isArray(header)) {
12220
+ header.forEach(deleteHeader);
12221
+ } else {
12222
+ deleteHeader(header);
12223
+ }
12224
+ return deleted;
12275
12225
  }
12276
- if (serializedParams) {
12277
- const hashmarkIndex = url2.indexOf("#");
12278
- if (hashmarkIndex !== -1) {
12279
- url2 = url2.slice(0, hashmarkIndex);
12226
+ clear(matcher) {
12227
+ const keys = Object.keys(this);
12228
+ let i = keys.length;
12229
+ let deleted = false;
12230
+ while (i--) {
12231
+ const key = keys[i];
12232
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
12233
+ delete this[key];
12234
+ deleted = true;
12235
+ }
12280
12236
  }
12281
- url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
12237
+ return deleted;
12282
12238
  }
12283
- return url2;
12284
- }
12285
- var InterceptorManager = class {
12286
- constructor() {
12287
- this.handlers = [];
12239
+ normalize(format) {
12240
+ const self2 = this;
12241
+ const headers = {};
12242
+ utils$1.forEach(this, (value, header) => {
12243
+ const key = utils$1.findKey(headers, header);
12244
+ if (key) {
12245
+ self2[key] = normalizeValue(value);
12246
+ delete self2[header];
12247
+ return;
12248
+ }
12249
+ const normalized = format ? formatHeader(header) : String(header).trim();
12250
+ if (normalized !== header) {
12251
+ delete self2[header];
12252
+ }
12253
+ self2[normalized] = normalizeValue(value);
12254
+ headers[normalized] = true;
12255
+ });
12256
+ return this;
12288
12257
  }
12289
- /**
12290
- * Add a new interceptor to the stack
12291
- *
12292
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
12293
- * @param {Function} rejected The function to handle `reject` for a `Promise`
12294
- *
12295
- * @return {Number} An ID used to remove interceptor later
12296
- */
12297
- use(fulfilled, rejected, options) {
12298
- this.handlers.push({
12299
- fulfilled,
12300
- rejected,
12301
- synchronous: options ? options.synchronous : false,
12302
- runWhen: options ? options.runWhen : null
12258
+ concat(...targets) {
12259
+ return this.constructor.concat(this, ...targets);
12260
+ }
12261
+ toJSON(asStrings) {
12262
+ const obj = /* @__PURE__ */ Object.create(null);
12263
+ utils$1.forEach(this, (value, header) => {
12264
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
12303
12265
  });
12304
- return this.handlers.length - 1;
12266
+ return obj;
12305
12267
  }
12306
- /**
12307
- * Remove an interceptor from the stack
12308
- *
12309
- * @param {Number} id The ID that was returned by `use`
12310
- *
12311
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
12312
- */
12313
- eject(id) {
12314
- if (this.handlers[id]) {
12315
- this.handlers[id] = null;
12316
- }
12268
+ [Symbol.iterator]() {
12269
+ return Object.entries(this.toJSON())[Symbol.iterator]();
12317
12270
  }
12318
- /**
12319
- * Clear all interceptors from the stack
12320
- *
12321
- * @returns {void}
12322
- */
12323
- clear() {
12324
- if (this.handlers) {
12325
- this.handlers = [];
12326
- }
12271
+ toString() {
12272
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
12327
12273
  }
12328
- /**
12329
- * Iterate over all the registered interceptors
12330
- *
12331
- * This method is particularly useful for skipping over any
12332
- * interceptors that may have become `null` calling `eject`.
12333
- *
12334
- * @param {Function} fn The function to call for each interceptor
12335
- *
12336
- * @returns {void}
12337
- */
12338
- forEach(fn) {
12339
- utils$1.forEach(this.handlers, function forEachHandler(h) {
12340
- if (h !== null) {
12341
- fn(h);
12342
- }
12343
- });
12274
+ getSetCookie() {
12275
+ return this.get("set-cookie") || [];
12344
12276
  }
12345
- };
12346
- var InterceptorManager$1 = InterceptorManager;
12347
- var transitionalDefaults = {
12348
- silentJSONParsing: true,
12349
- forcedJSONParsing: true,
12350
- clarifyTimeoutError: false
12351
- };
12352
- var URLSearchParams = url__default["default"].URLSearchParams;
12353
- var ALPHA = "abcdefghijklmnopqrstuvwxyz";
12354
- var DIGIT = "0123456789";
12355
- var ALPHABET = {
12356
- DIGIT,
12357
- ALPHA,
12358
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
12359
- };
12360
- var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
12361
- let str = "";
12362
- const { length } = alphabet;
12363
- const randomValues = new Uint32Array(size);
12364
- crypto__default["default"].randomFillSync(randomValues);
12365
- for (let i = 0; i < size; i++) {
12366
- str += alphabet[randomValues[i] % length];
12277
+ get [Symbol.toStringTag]() {
12278
+ return "AxiosHeaders";
12279
+ }
12280
+ static from(thing) {
12281
+ return thing instanceof this ? thing : new this(thing);
12282
+ }
12283
+ static concat(first, ...targets) {
12284
+ const computed = new this(first);
12285
+ targets.forEach((target) => computed.set(target));
12286
+ return computed;
12287
+ }
12288
+ static accessor(header) {
12289
+ const internals = this[$internals] = this[$internals] = {
12290
+ accessors: {}
12291
+ };
12292
+ const accessors = internals.accessors;
12293
+ const prototype2 = this.prototype;
12294
+ function defineAccessor(_header) {
12295
+ const lHeader = normalizeHeader(_header);
12296
+ if (!accessors[lHeader]) {
12297
+ buildAccessors(prototype2, _header);
12298
+ accessors[lHeader] = true;
12299
+ }
12300
+ }
12301
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
12302
+ return this;
12367
12303
  }
12368
- return str;
12369
- };
12370
- var platform$1 = {
12371
- isNode: true,
12372
- classes: {
12373
- URLSearchParams,
12374
- FormData: FormData__default["default"],
12375
- Blob: typeof Blob !== "undefined" && Blob || null
12376
- },
12377
- ALPHABET,
12378
- generateString,
12379
- protocols: ["http", "https", "file", "data"]
12380
12304
  };
12381
- var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
12382
- var _navigator = typeof navigator === "object" && navigator || void 0;
12383
- var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
12384
- var hasStandardBrowserWebWorkerEnv = (() => {
12385
- return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
12386
- self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
12387
- })();
12388
- var origin = hasBrowserEnv && window.location.href || "http://localhost";
12389
- var utils = /* @__PURE__ */ Object.freeze({
12390
- __proto__: null,
12391
- hasBrowserEnv,
12392
- hasStandardBrowserWebWorkerEnv,
12393
- hasStandardBrowserEnv,
12394
- navigator: _navigator,
12395
- origin
12305
+ AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
12306
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({
12307
+ value
12308
+ }, key) => {
12309
+ let mapped = key[0].toUpperCase() + key.slice(1);
12310
+ return {
12311
+ get: () => value,
12312
+ set(headerValue) {
12313
+ this[mapped] = headerValue;
12314
+ }
12315
+ };
12396
12316
  });
12397
- var platform = {
12398
- ...utils,
12399
- ...platform$1
12400
- };
12401
- function toURLEncodedForm(data, options) {
12402
- return toFormData(data, new platform.classes.URLSearchParams(), {
12403
- visitor: function(value, key, path2, helpers) {
12404
- if (platform.isNode && utils$1.isBuffer(value)) {
12405
- this.append(key, value.toString("base64"));
12406
- return false;
12407
- }
12408
- return helpers.defaultVisitor.apply(this, arguments);
12409
- },
12410
- ...options
12411
- });
12412
- }
12413
- function parsePropPath(name) {
12414
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
12415
- return match[0] === "[]" ? "" : match[1] || match[0];
12416
- });
12417
- }
12418
- function arrayToObject(arr) {
12419
- const obj = {};
12420
- const keys = Object.keys(arr);
12421
- let i;
12422
- const len = keys.length;
12423
- let key;
12424
- for (i = 0; i < len; i++) {
12425
- key = keys[i];
12426
- obj[key] = arr[key];
12317
+ utils$1.freezeMethods(AxiosHeaders);
12318
+ var REDACTED = "[REDACTED ****]";
12319
+ function hasOwnOrPrototypeToJSON(source) {
12320
+ if (utils$1.hasOwnProp(source, "toJSON")) {
12321
+ return true;
12427
12322
  }
12428
- return obj;
12323
+ let prototype2 = Object.getPrototypeOf(source);
12324
+ while (prototype2 && prototype2 !== Object.prototype) {
12325
+ if (utils$1.hasOwnProp(prototype2, "toJSON")) {
12326
+ return true;
12327
+ }
12328
+ prototype2 = Object.getPrototypeOf(prototype2);
12329
+ }
12330
+ return false;
12429
12331
  }
12430
- function formDataToJSON(formData) {
12431
- function buildPath(path2, value, target, index) {
12432
- let name = path2[index++];
12433
- if (name === "__proto__") return true;
12434
- const isNumericKey = Number.isFinite(+name);
12435
- const isLast = index >= path2.length;
12436
- name = !name && utils$1.isArray(target) ? target.length : name;
12437
- if (isLast) {
12438
- if (utils$1.hasOwnProp(target, name)) {
12439
- target[name] = [target[name], value];
12440
- } else {
12441
- target[name] = value;
12332
+ function redactConfig(config, redactKeys) {
12333
+ const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
12334
+ const seen = [];
12335
+ const visit = (source) => {
12336
+ if (source === null || typeof source !== "object") return source;
12337
+ if (utils$1.isBuffer(source)) return source;
12338
+ if (seen.indexOf(source) !== -1) return void 0;
12339
+ if (source instanceof AxiosHeaders) {
12340
+ source = source.toJSON();
12341
+ }
12342
+ seen.push(source);
12343
+ let result;
12344
+ if (utils$1.isArray(source)) {
12345
+ result = [];
12346
+ source.forEach((v, i) => {
12347
+ const reducedValue = visit(v);
12348
+ if (!utils$1.isUndefined(reducedValue)) {
12349
+ result[i] = reducedValue;
12350
+ }
12351
+ });
12352
+ } else {
12353
+ if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
12354
+ seen.pop();
12355
+ return source;
12356
+ }
12357
+ result = /* @__PURE__ */ Object.create(null);
12358
+ for (const [key, value] of Object.entries(source)) {
12359
+ const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
12360
+ if (!utils$1.isUndefined(reducedValue)) {
12361
+ result[key] = reducedValue;
12362
+ }
12442
12363
  }
12443
- return !isNumericKey;
12444
- }
12445
- if (!target[name] || !utils$1.isObject(target[name])) {
12446
- target[name] = [];
12447
12364
  }
12448
- const result = buildPath(path2, value, target[name], index);
12449
- if (result && utils$1.isArray(target[name])) {
12450
- target[name] = arrayToObject(target[name]);
12365
+ seen.pop();
12366
+ return result;
12367
+ };
12368
+ return visit(config);
12369
+ }
12370
+ var AxiosError = class _AxiosError extends Error {
12371
+ static from(error, code, config, request, response, customProps) {
12372
+ const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
12373
+ axiosError.cause = error;
12374
+ axiosError.name = error.name;
12375
+ if (error.status != null && axiosError.status == null) {
12376
+ axiosError.status = error.status;
12451
12377
  }
12452
- return !isNumericKey;
12378
+ customProps && Object.assign(axiosError, customProps);
12379
+ return axiosError;
12453
12380
  }
12454
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
12455
- const obj = {};
12456
- utils$1.forEachEntry(formData, (name, value) => {
12457
- buildPath(parsePropPath(name), value, obj, 0);
12381
+ /**
12382
+ * Create an Error with the specified message, config, error code, request and response.
12383
+ *
12384
+ * @param {string} message The error message.
12385
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
12386
+ * @param {Object} [config] The config.
12387
+ * @param {Object} [request] The request.
12388
+ * @param {Object} [response] The response.
12389
+ *
12390
+ * @returns {Error} The created error.
12391
+ */
12392
+ constructor(message, code, config, request, response) {
12393
+ super(message);
12394
+ Object.defineProperty(this, "message", {
12395
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
12396
+ // this data descriptor into an accessor descriptor on the way in.
12397
+ __proto__: null,
12398
+ value: message,
12399
+ enumerable: true,
12400
+ writable: true,
12401
+ configurable: true
12458
12402
  });
12459
- return obj;
12403
+ this.name = "AxiosError";
12404
+ this.isAxiosError = true;
12405
+ code && (this.code = code);
12406
+ config && (this.config = config);
12407
+ request && (this.request = request);
12408
+ if (response) {
12409
+ this.response = response;
12410
+ this.status = response.status;
12411
+ }
12412
+ }
12413
+ toJSON() {
12414
+ const config = this.config;
12415
+ const redactKeys = config && utils$1.hasOwnProp(config, "redact") ? config.redact : void 0;
12416
+ const serializedConfig = utils$1.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils$1.toJSONObject(config);
12417
+ return {
12418
+ // Standard
12419
+ message: this.message,
12420
+ name: this.name,
12421
+ // Microsoft
12422
+ description: this.description,
12423
+ number: this.number,
12424
+ // Mozilla
12425
+ fileName: this.fileName,
12426
+ lineNumber: this.lineNumber,
12427
+ columnNumber: this.columnNumber,
12428
+ stack: this.stack,
12429
+ // Axios
12430
+ config: serializedConfig,
12431
+ code: this.code,
12432
+ status: this.status
12433
+ };
12460
12434
  }
12461
- return null;
12435
+ };
12436
+ AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
12437
+ AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
12438
+ AxiosError.ECONNABORTED = "ECONNABORTED";
12439
+ AxiosError.ETIMEDOUT = "ETIMEDOUT";
12440
+ AxiosError.ECONNREFUSED = "ECONNREFUSED";
12441
+ AxiosError.ERR_NETWORK = "ERR_NETWORK";
12442
+ AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
12443
+ AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
12444
+ AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
12445
+ AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
12446
+ AxiosError.ERR_CANCELED = "ERR_CANCELED";
12447
+ AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
12448
+ AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
12449
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
12450
+ function isVisitable(thing) {
12451
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
12462
12452
  }
12463
- function stringifySafely(rawValue, parser, encoder) {
12464
- if (utils$1.isString(rawValue)) {
12465
- try {
12466
- (parser || JSON.parse)(rawValue);
12467
- return utils$1.trim(rawValue);
12468
- } catch (e) {
12469
- if (e.name !== "SyntaxError") {
12470
- throw e;
12471
- }
12472
- }
12473
- }
12474
- return (encoder || JSON.stringify)(rawValue);
12453
+ function removeBrackets(key) {
12454
+ return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
12475
12455
  }
12476
- var defaults = {
12477
- transitional: transitionalDefaults,
12478
- adapter: ["xhr", "http", "fetch"],
12479
- transformRequest: [function transformRequest(data, headers) {
12480
- const contentType = headers.getContentType() || "";
12481
- const hasJSONContentType = contentType.indexOf("application/json") > -1;
12482
- const isObjectPayload = utils$1.isObject(data);
12483
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
12484
- data = new FormData(data);
12485
- }
12486
- const isFormData2 = utils$1.isFormData(data);
12487
- if (isFormData2) {
12488
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
12489
- }
12490
- if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
12491
- return data;
12492
- }
12493
- if (utils$1.isArrayBufferView(data)) {
12494
- return data.buffer;
12456
+ function renderKey(path3, key, dots) {
12457
+ if (!path3) return key;
12458
+ return path3.concat(key).map(function each(token, i) {
12459
+ token = removeBrackets(token);
12460
+ return !dots && i ? "[" + token + "]" : token;
12461
+ }).join(dots ? "." : "");
12462
+ }
12463
+ function isFlatArray(arr) {
12464
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
12465
+ }
12466
+ var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
12467
+ return /^is[A-Z]/.test(prop);
12468
+ });
12469
+ function toFormData(obj, formData, options) {
12470
+ if (!utils$1.isObject(obj)) {
12471
+ throw new TypeError("target must be an object");
12472
+ }
12473
+ formData = formData || new (FormData$1 || FormData)();
12474
+ options = utils$1.toFlatObject(options, {
12475
+ metaTokens: true,
12476
+ dots: false,
12477
+ indexes: false
12478
+ }, false, function defined(option, source) {
12479
+ return !utils$1.isUndefined(source[option]);
12480
+ });
12481
+ const metaTokens = options.metaTokens;
12482
+ const visitor = options.visitor || defaultVisitor;
12483
+ const dots = options.dots;
12484
+ const indexes = options.indexes;
12485
+ const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
12486
+ const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth;
12487
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
12488
+ if (!utils$1.isFunction(visitor)) {
12489
+ throw new TypeError("visitor must be a function");
12490
+ }
12491
+ function convertValue(value) {
12492
+ if (value === null) return "";
12493
+ if (utils$1.isDate(value)) {
12494
+ return value.toISOString();
12495
12495
  }
12496
- if (utils$1.isURLSearchParams(data)) {
12497
- headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
12498
- return data.toString();
12496
+ if (utils$1.isBoolean(value)) {
12497
+ return value.toString();
12499
12498
  }
12500
- let isFileList2;
12501
- if (isObjectPayload) {
12502
- if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
12503
- return toURLEncodedForm(data, this.formSerializer).toString();
12504
- }
12505
- if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
12506
- const _FormData = this.env && this.env.FormData;
12507
- return toFormData(
12508
- isFileList2 ? { "files[]": data } : data,
12509
- _FormData && new _FormData(),
12510
- this.formSerializer
12511
- );
12512
- }
12499
+ if (!useBlob && utils$1.isBlob(value)) {
12500
+ throw new AxiosError("Blob is not supported. Use a Buffer instead.");
12513
12501
  }
12514
- if (isObjectPayload || hasJSONContentType) {
12515
- headers.setContentType("application/json", false);
12516
- return stringifySafely(data);
12502
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
12503
+ return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
12517
12504
  }
12518
- return data;
12519
- }],
12520
- transformResponse: [function transformResponse(data) {
12521
- const transitional = this.transitional || defaults.transitional;
12522
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
12523
- const JSONRequested = this.responseType === "json";
12524
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
12525
- return data;
12505
+ return value;
12506
+ }
12507
+ function defaultVisitor(value, key, path3) {
12508
+ let arr = value;
12509
+ if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
12510
+ formData.append(renderKey(path3, key, dots), convertValue(value));
12511
+ return false;
12526
12512
  }
12527
- if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
12528
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
12529
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
12530
- try {
12531
- return JSON.parse(data);
12532
- } catch (e) {
12533
- if (strictJSONParsing) {
12534
- if (e.name === "SyntaxError") {
12535
- throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
12536
- }
12537
- throw e;
12538
- }
12513
+ if (value && !path3 && typeof value === "object") {
12514
+ if (utils$1.endsWith(key, "{}")) {
12515
+ key = metaTokens ? key : key.slice(0, -2);
12516
+ value = JSON.stringify(value);
12517
+ } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
12518
+ key = removeBrackets(key);
12519
+ arr.forEach(function each(el, index) {
12520
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
12521
+ // eslint-disable-next-line no-nested-ternary
12522
+ indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
12523
+ convertValue(el)
12524
+ );
12525
+ });
12526
+ return false;
12539
12527
  }
12540
12528
  }
12541
- return data;
12542
- }],
12543
- /**
12544
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
12545
- * timeout is not created.
12546
- */
12547
- timeout: 0,
12548
- xsrfCookieName: "XSRF-TOKEN",
12549
- xsrfHeaderName: "X-XSRF-TOKEN",
12550
- maxContentLength: -1,
12551
- maxBodyLength: -1,
12552
- env: {
12553
- FormData: platform.classes.FormData,
12554
- Blob: platform.classes.Blob
12555
- },
12556
- validateStatus: function validateStatus(status) {
12557
- return status >= 200 && status < 300;
12558
- },
12559
- headers: {
12560
- common: {
12561
- "Accept": "application/json, text/plain, */*",
12562
- "Content-Type": void 0
12529
+ if (isVisitable(value)) {
12530
+ return true;
12563
12531
  }
12532
+ formData.append(renderKey(path3, key, dots), convertValue(value));
12533
+ return false;
12564
12534
  }
12565
- };
12566
- utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
12567
- defaults.headers[method] = {};
12568
- });
12569
- var defaults$1 = defaults;
12570
- var ignoreDuplicateOf = utils$1.toObjectSet([
12571
- "age",
12572
- "authorization",
12573
- "content-length",
12574
- "content-type",
12575
- "etag",
12576
- "expires",
12577
- "from",
12578
- "host",
12579
- "if-modified-since",
12580
- "if-unmodified-since",
12581
- "last-modified",
12582
- "location",
12583
- "max-forwards",
12584
- "proxy-authorization",
12585
- "referer",
12586
- "retry-after",
12587
- "user-agent"
12588
- ]);
12589
- var parseHeaders = (rawHeaders) => {
12590
- const parsed = {};
12591
- let key;
12592
- let val;
12593
- let i;
12594
- rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
12595
- i = line.indexOf(":");
12596
- key = line.substring(0, i).trim().toLowerCase();
12597
- val = line.substring(i + 1).trim();
12598
- if (!key || parsed[key] && ignoreDuplicateOf[key]) {
12599
- return;
12535
+ const stack = [];
12536
+ const exposedHelpers = Object.assign(predicates, {
12537
+ defaultVisitor,
12538
+ convertValue,
12539
+ isVisitable
12540
+ });
12541
+ function build(value, path3, depth = 0) {
12542
+ if (utils$1.isUndefined(value)) return;
12543
+ if (depth > maxDepth) {
12544
+ throw new AxiosError("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
12600
12545
  }
12601
- if (key === "set-cookie") {
12602
- if (parsed[key]) {
12603
- parsed[key].push(val);
12604
- } else {
12605
- parsed[key] = [val];
12606
- }
12607
- } else {
12608
- parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
12546
+ if (stack.indexOf(value) !== -1) {
12547
+ throw Error("Circular reference detected in " + path3.join("."));
12609
12548
  }
12610
- });
12611
- return parsed;
12612
- };
12613
- var $internals = Symbol("internals");
12614
- function normalizeHeader(header) {
12615
- return header && String(header).trim().toLowerCase();
12616
- }
12617
- function normalizeValue(value) {
12618
- if (value === false || value == null) {
12619
- return value;
12620
- }
12621
- return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
12622
- }
12623
- function parseTokens(str) {
12624
- const tokens = /* @__PURE__ */ Object.create(null);
12625
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
12626
- let match;
12627
- while (match = tokensRE.exec(str)) {
12628
- tokens[match[1]] = match[2];
12629
- }
12630
- return tokens;
12631
- }
12632
- var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
12633
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
12634
- if (utils$1.isFunction(filter)) {
12635
- return filter.call(this, value, header);
12636
- }
12637
- if (isHeaderNameFilter) {
12638
- value = header;
12639
- }
12640
- if (!utils$1.isString(value)) return;
12641
- if (utils$1.isString(filter)) {
12642
- return value.indexOf(filter) !== -1;
12549
+ stack.push(value);
12550
+ utils$1.forEach(value, function each(el, key) {
12551
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path3, exposedHelpers);
12552
+ if (result === true) {
12553
+ build(el, path3 ? path3.concat(key) : [key], depth + 1);
12554
+ }
12555
+ });
12556
+ stack.pop();
12643
12557
  }
12644
- if (utils$1.isRegExp(filter)) {
12645
- return filter.test(value);
12558
+ if (!utils$1.isObject(obj)) {
12559
+ throw new TypeError("data must be an object");
12646
12560
  }
12561
+ build(obj);
12562
+ return formData;
12647
12563
  }
12648
- function formatHeader(header) {
12649
- return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
12650
- return char.toUpperCase() + str;
12564
+ function encode$1(str) {
12565
+ const charMap = {
12566
+ "!": "%21",
12567
+ "'": "%27",
12568
+ "(": "%28",
12569
+ ")": "%29",
12570
+ "~": "%7E",
12571
+ "%20": "+"
12572
+ };
12573
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
12574
+ return charMap[match];
12651
12575
  });
12652
12576
  }
12653
- function buildAccessors(obj, header) {
12654
- const accessorName = utils$1.toCamelCase(" " + header);
12655
- ["get", "set", "has"].forEach((methodName) => {
12656
- Object.defineProperty(obj, methodName + accessorName, {
12657
- value: function(arg1, arg2, arg3) {
12658
- return this[methodName].call(this, header, arg1, arg2, arg3);
12659
- },
12660
- configurable: true
12661
- });
12662
- });
12577
+ function AxiosURLSearchParams(params, options) {
12578
+ this._pairs = [];
12579
+ params && toFormData(params, this, options);
12663
12580
  }
12664
- var AxiosHeaders = class {
12665
- constructor(headers) {
12666
- headers && this.set(headers);
12581
+ var prototype = AxiosURLSearchParams.prototype;
12582
+ prototype.append = function append(name, value) {
12583
+ this._pairs.push([name, value]);
12584
+ };
12585
+ prototype.toString = function toString2(encoder) {
12586
+ const _encode = encoder ? function(value) {
12587
+ return encoder.call(this, value, encode$1);
12588
+ } : encode$1;
12589
+ return this._pairs.map(function each(pair) {
12590
+ return _encode(pair[0]) + "=" + _encode(pair[1]);
12591
+ }, "").join("&");
12592
+ };
12593
+ function encode(val) {
12594
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
12595
+ }
12596
+ function buildURL(url2, params, options) {
12597
+ if (!params) {
12598
+ return url2;
12667
12599
  }
12668
- set(header, valueOrRewrite, rewrite) {
12669
- const self2 = this;
12670
- function setHeader(_value, _header, _rewrite) {
12671
- const lHeader = normalizeHeader(_header);
12672
- if (!lHeader) {
12673
- throw new Error("header name must be a non-empty string");
12674
- }
12675
- const key = utils$1.findKey(self2, lHeader);
12676
- if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
12677
- self2[key || _header] = normalizeValue(_value);
12678
- }
12679
- }
12680
- const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
12681
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
12682
- setHeaders(header, valueOrRewrite);
12683
- } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
12684
- setHeaders(parseHeaders(header), valueOrRewrite);
12685
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
12686
- let obj = {}, dest, key;
12687
- for (const entry of header) {
12688
- if (!utils$1.isArray(entry)) {
12689
- throw TypeError("Object iterator must return a key-value pair");
12690
- }
12691
- obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
12692
- }
12693
- setHeaders(obj, valueOrRewrite);
12694
- } else {
12695
- header != null && setHeader(valueOrRewrite, header, rewrite);
12696
- }
12697
- return this;
12600
+ const _encode = options && options.encode || encode;
12601
+ const _options = utils$1.isFunction(options) ? {
12602
+ serialize: options
12603
+ } : options;
12604
+ const serializeFn = _options && _options.serialize;
12605
+ let serializedParams;
12606
+ if (serializeFn) {
12607
+ serializedParams = serializeFn(params, _options);
12608
+ } else {
12609
+ serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
12698
12610
  }
12699
- get(header, parser) {
12700
- header = normalizeHeader(header);
12701
- if (header) {
12702
- const key = utils$1.findKey(this, header);
12703
- if (key) {
12704
- const value = this[key];
12705
- if (!parser) {
12706
- return value;
12707
- }
12708
- if (parser === true) {
12709
- return parseTokens(value);
12710
- }
12711
- if (utils$1.isFunction(parser)) {
12712
- return parser.call(this, value, key);
12713
- }
12714
- if (utils$1.isRegExp(parser)) {
12715
- return parser.exec(value);
12716
- }
12717
- throw new TypeError("parser must be boolean|regexp|function");
12718
- }
12611
+ if (serializedParams) {
12612
+ const hashmarkIndex = url2.indexOf("#");
12613
+ if (hashmarkIndex !== -1) {
12614
+ url2 = url2.slice(0, hashmarkIndex);
12719
12615
  }
12616
+ url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
12720
12617
  }
12721
- has(header, matcher) {
12722
- header = normalizeHeader(header);
12723
- if (header) {
12724
- const key = utils$1.findKey(this, header);
12725
- return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
12726
- }
12727
- return false;
12618
+ return url2;
12619
+ }
12620
+ var InterceptorManager = class {
12621
+ constructor() {
12622
+ this.handlers = [];
12728
12623
  }
12729
- delete(header, matcher) {
12730
- const self2 = this;
12731
- let deleted = false;
12732
- function deleteHeader(_header) {
12733
- _header = normalizeHeader(_header);
12734
- if (_header) {
12735
- const key = utils$1.findKey(self2, _header);
12736
- if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
12737
- delete self2[key];
12738
- deleted = true;
12739
- }
12740
- }
12741
- }
12742
- if (utils$1.isArray(header)) {
12743
- header.forEach(deleteHeader);
12744
- } else {
12745
- deleteHeader(header);
12624
+ /**
12625
+ * Add a new interceptor to the stack
12626
+ *
12627
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
12628
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
12629
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
12630
+ *
12631
+ * @return {Number} An ID used to remove interceptor later
12632
+ */
12633
+ use(fulfilled, rejected, options) {
12634
+ this.handlers.push({
12635
+ fulfilled,
12636
+ rejected,
12637
+ synchronous: options ? options.synchronous : false,
12638
+ runWhen: options ? options.runWhen : null
12639
+ });
12640
+ return this.handlers.length - 1;
12641
+ }
12642
+ /**
12643
+ * Remove an interceptor from the stack
12644
+ *
12645
+ * @param {Number} id The ID that was returned by `use`
12646
+ *
12647
+ * @returns {void}
12648
+ */
12649
+ eject(id) {
12650
+ if (this.handlers[id]) {
12651
+ this.handlers[id] = null;
12746
12652
  }
12747
- return deleted;
12748
12653
  }
12749
- clear(matcher) {
12750
- const keys = Object.keys(this);
12751
- let i = keys.length;
12752
- let deleted = false;
12753
- while (i--) {
12754
- const key = keys[i];
12755
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
12756
- delete this[key];
12757
- deleted = true;
12758
- }
12654
+ /**
12655
+ * Clear all interceptors from the stack
12656
+ *
12657
+ * @returns {void}
12658
+ */
12659
+ clear() {
12660
+ if (this.handlers) {
12661
+ this.handlers = [];
12759
12662
  }
12760
- return deleted;
12761
12663
  }
12762
- normalize(format) {
12763
- const self2 = this;
12764
- const headers = {};
12765
- utils$1.forEach(this, (value, header) => {
12766
- const key = utils$1.findKey(headers, header);
12767
- if (key) {
12768
- self2[key] = normalizeValue(value);
12769
- delete self2[header];
12770
- return;
12771
- }
12772
- const normalized = format ? formatHeader(header) : String(header).trim();
12773
- if (normalized !== header) {
12774
- delete self2[header];
12664
+ /**
12665
+ * Iterate over all the registered interceptors
12666
+ *
12667
+ * This method is particularly useful for skipping over any
12668
+ * interceptors that may have become `null` calling `eject`.
12669
+ *
12670
+ * @param {Function} fn The function to call for each interceptor
12671
+ *
12672
+ * @returns {void}
12673
+ */
12674
+ forEach(fn) {
12675
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
12676
+ if (h !== null) {
12677
+ fn(h);
12775
12678
  }
12776
- self2[normalized] = normalizeValue(value);
12777
- headers[normalized] = true;
12778
- });
12779
- return this;
12780
- }
12781
- concat(...targets) {
12782
- return this.constructor.concat(this, ...targets);
12783
- }
12784
- toJSON(asStrings) {
12785
- const obj = /* @__PURE__ */ Object.create(null);
12786
- utils$1.forEach(this, (value, header) => {
12787
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
12788
12679
  });
12789
- return obj;
12790
- }
12791
- [Symbol.iterator]() {
12792
- return Object.entries(this.toJSON())[Symbol.iterator]();
12793
12680
  }
12794
- toString() {
12795
- return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
12681
+ };
12682
+ var transitionalDefaults = {
12683
+ silentJSONParsing: true,
12684
+ forcedJSONParsing: true,
12685
+ clarifyTimeoutError: false,
12686
+ legacyInterceptorReqResOrdering: true
12687
+ };
12688
+ var URLSearchParams = url.URLSearchParams;
12689
+ var ALPHA = "abcdefghijklmnopqrstuvwxyz";
12690
+ var DIGIT = "0123456789";
12691
+ var ALPHABET = {
12692
+ DIGIT,
12693
+ ALPHA,
12694
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
12695
+ };
12696
+ var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
12697
+ let str = "";
12698
+ const {
12699
+ length
12700
+ } = alphabet;
12701
+ const randomValues = new Uint32Array(size);
12702
+ crypto.randomFillSync(randomValues);
12703
+ for (let i = 0; i < size; i++) {
12704
+ str += alphabet[randomValues[i] % length];
12796
12705
  }
12797
- getSetCookie() {
12798
- return this.get("set-cookie") || [];
12706
+ return str;
12707
+ };
12708
+ var platform$1 = {
12709
+ isNode: true,
12710
+ classes: {
12711
+ URLSearchParams,
12712
+ FormData: FormData$1,
12713
+ Blob: typeof Blob !== "undefined" && Blob || null
12714
+ },
12715
+ ALPHABET,
12716
+ generateString,
12717
+ protocols: ["http", "https", "file", "data"]
12718
+ };
12719
+ var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
12720
+ var _navigator = typeof navigator === "object" && navigator || void 0;
12721
+ var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
12722
+ var hasStandardBrowserWebWorkerEnv = (() => {
12723
+ return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
12724
+ self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
12725
+ })();
12726
+ var origin = hasBrowserEnv && window.location.href || "http://localhost";
12727
+ var utils = /* @__PURE__ */ Object.freeze({
12728
+ __proto__: null,
12729
+ hasBrowserEnv,
12730
+ hasStandardBrowserEnv,
12731
+ hasStandardBrowserWebWorkerEnv,
12732
+ navigator: _navigator,
12733
+ origin
12734
+ });
12735
+ var platform = {
12736
+ ...utils,
12737
+ ...platform$1
12738
+ };
12739
+ function toURLEncodedForm(data, options) {
12740
+ return toFormData(data, new platform.classes.URLSearchParams(), {
12741
+ visitor: function(value, key, path3, helpers) {
12742
+ if (platform.isNode && utils$1.isBuffer(value)) {
12743
+ this.append(key, value.toString("base64"));
12744
+ return false;
12745
+ }
12746
+ return helpers.defaultVisitor.apply(this, arguments);
12747
+ },
12748
+ ...options
12749
+ });
12750
+ }
12751
+ function parsePropPath(name) {
12752
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
12753
+ return match[0] === "[]" ? "" : match[1] || match[0];
12754
+ });
12755
+ }
12756
+ function arrayToObject(arr) {
12757
+ const obj = {};
12758
+ const keys = Object.keys(arr);
12759
+ let i;
12760
+ const len = keys.length;
12761
+ let key;
12762
+ for (i = 0; i < len; i++) {
12763
+ key = keys[i];
12764
+ obj[key] = arr[key];
12799
12765
  }
12800
- get [Symbol.toStringTag]() {
12801
- return "AxiosHeaders";
12766
+ return obj;
12767
+ }
12768
+ function formDataToJSON(formData) {
12769
+ function buildPath(path3, value, target, index) {
12770
+ let name = path3[index++];
12771
+ if (name === "__proto__") return true;
12772
+ const isNumericKey = Number.isFinite(+name);
12773
+ const isLast = index >= path3.length;
12774
+ name = !name && utils$1.isArray(target) ? target.length : name;
12775
+ if (isLast) {
12776
+ if (utils$1.hasOwnProp(target, name)) {
12777
+ target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
12778
+ } else {
12779
+ target[name] = value;
12780
+ }
12781
+ return !isNumericKey;
12782
+ }
12783
+ if (!target[name] || !utils$1.isObject(target[name])) {
12784
+ target[name] = [];
12785
+ }
12786
+ const result = buildPath(path3, value, target[name], index);
12787
+ if (result && utils$1.isArray(target[name])) {
12788
+ target[name] = arrayToObject(target[name]);
12789
+ }
12790
+ return !isNumericKey;
12802
12791
  }
12803
- static from(thing) {
12804
- return thing instanceof this ? thing : new this(thing);
12792
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
12793
+ const obj = {};
12794
+ utils$1.forEachEntry(formData, (name, value) => {
12795
+ buildPath(parsePropPath(name), value, obj, 0);
12796
+ });
12797
+ return obj;
12805
12798
  }
12806
- static concat(first, ...targets) {
12807
- const computed = new this(first);
12808
- targets.forEach((target) => computed.set(target));
12809
- return computed;
12799
+ return null;
12800
+ }
12801
+ var own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : void 0;
12802
+ function stringifySafely(rawValue, parser, encoder) {
12803
+ if (utils$1.isString(rawValue)) {
12804
+ try {
12805
+ (parser || JSON.parse)(rawValue);
12806
+ return utils$1.trim(rawValue);
12807
+ } catch (e) {
12808
+ if (e.name !== "SyntaxError") {
12809
+ throw e;
12810
+ }
12811
+ }
12810
12812
  }
12811
- static accessor(header) {
12812
- const internals = this[$internals] = this[$internals] = {
12813
- accessors: {}
12814
- };
12815
- const accessors = internals.accessors;
12816
- const prototype2 = this.prototype;
12817
- function defineAccessor(_header) {
12818
- const lHeader = normalizeHeader(_header);
12819
- if (!accessors[lHeader]) {
12820
- buildAccessors(prototype2, _header);
12821
- accessors[lHeader] = true;
12813
+ return (encoder || JSON.stringify)(rawValue);
12814
+ }
12815
+ var defaults = {
12816
+ transitional: transitionalDefaults,
12817
+ adapter: ["xhr", "http", "fetch"],
12818
+ transformRequest: [function transformRequest(data, headers) {
12819
+ const contentType = headers.getContentType() || "";
12820
+ const hasJSONContentType = contentType.indexOf("application/json") > -1;
12821
+ const isObjectPayload = utils$1.isObject(data);
12822
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
12823
+ data = new FormData(data);
12824
+ }
12825
+ const isFormData2 = utils$1.isFormData(data);
12826
+ if (isFormData2) {
12827
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
12828
+ }
12829
+ if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
12830
+ return data;
12831
+ }
12832
+ if (utils$1.isArrayBufferView(data)) {
12833
+ return data.buffer;
12834
+ }
12835
+ if (utils$1.isURLSearchParams(data)) {
12836
+ headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
12837
+ return data.toString();
12838
+ }
12839
+ let isFileList2;
12840
+ if (isObjectPayload) {
12841
+ const formSerializer = own(this, "formSerializer");
12842
+ if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
12843
+ return toURLEncodedForm(data, formSerializer).toString();
12844
+ }
12845
+ if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
12846
+ const env = own(this, "env");
12847
+ const _FormData = env && env.FormData;
12848
+ return toFormData(isFileList2 ? {
12849
+ "files[]": data
12850
+ } : data, _FormData && new _FormData(), formSerializer);
12822
12851
  }
12823
12852
  }
12824
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
12825
- return this;
12853
+ if (isObjectPayload || hasJSONContentType) {
12854
+ headers.setContentType("application/json", false);
12855
+ return stringifySafely(data);
12856
+ }
12857
+ return data;
12858
+ }],
12859
+ transformResponse: [function transformResponse(data) {
12860
+ const transitional = own(this, "transitional") || defaults.transitional;
12861
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
12862
+ const responseType = own(this, "responseType");
12863
+ const JSONRequested = responseType === "json";
12864
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
12865
+ return data;
12866
+ }
12867
+ if (data && utils$1.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
12868
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
12869
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
12870
+ try {
12871
+ return JSON.parse(data, own(this, "parseReviver"));
12872
+ } catch (e) {
12873
+ if (strictJSONParsing) {
12874
+ if (e.name === "SyntaxError") {
12875
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, "response"));
12876
+ }
12877
+ throw e;
12878
+ }
12879
+ }
12880
+ }
12881
+ return data;
12882
+ }],
12883
+ /**
12884
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
12885
+ * timeout is not created.
12886
+ */
12887
+ timeout: 0,
12888
+ xsrfCookieName: "XSRF-TOKEN",
12889
+ xsrfHeaderName: "X-XSRF-TOKEN",
12890
+ maxContentLength: -1,
12891
+ maxBodyLength: -1,
12892
+ env: {
12893
+ FormData: platform.classes.FormData,
12894
+ Blob: platform.classes.Blob
12895
+ },
12896
+ validateStatus: function validateStatus(status) {
12897
+ return status >= 200 && status < 300;
12898
+ },
12899
+ headers: {
12900
+ common: {
12901
+ Accept: "application/json, text/plain, */*",
12902
+ "Content-Type": void 0
12903
+ }
12826
12904
  }
12827
12905
  };
12828
- AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
12829
- utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
12830
- let mapped = key[0].toUpperCase() + key.slice(1);
12831
- return {
12832
- get: () => value,
12833
- set(headerValue) {
12834
- this[mapped] = headerValue;
12835
- }
12836
- };
12906
+ utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (method) => {
12907
+ defaults.headers[method] = {};
12837
12908
  });
12838
- utils$1.freezeMethods(AxiosHeaders);
12839
- var AxiosHeaders$1 = AxiosHeaders;
12840
12909
  function transformData(fns, response) {
12841
- const config = this || defaults$1;
12910
+ const config = this || defaults;
12842
12911
  const context = response || config;
12843
- const headers = AxiosHeaders$1.from(context.headers);
12912
+ const headers = AxiosHeaders.from(context.headers);
12844
12913
  let data = context.data;
12845
12914
  utils$1.forEach(fns, function transform(fn) {
12846
12915
  data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
@@ -12851,28 +12920,34 @@ var require_axios = __commonJS({
12851
12920
  function isCancel(value) {
12852
12921
  return !!(value && value.__CANCEL__);
12853
12922
  }
12854
- function CanceledError(message, config, request) {
12855
- AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request);
12856
- this.name = "CanceledError";
12857
- }
12858
- utils$1.inherits(CanceledError, AxiosError, {
12859
- __CANCEL__: true
12860
- });
12923
+ var CanceledError = class extends AxiosError {
12924
+ /**
12925
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
12926
+ *
12927
+ * @param {string=} message The message.
12928
+ * @param {Object=} config The config.
12929
+ * @param {Object=} request The request.
12930
+ *
12931
+ * @returns {CanceledError} The created error.
12932
+ */
12933
+ constructor(message, config, request) {
12934
+ super(message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request);
12935
+ this.name = "CanceledError";
12936
+ this.__CANCEL__ = true;
12937
+ }
12938
+ };
12861
12939
  function settle(resolve, reject, response) {
12862
12940
  const validateStatus = response.config.validateStatus;
12863
12941
  if (!response.status || !validateStatus || validateStatus(response.status)) {
12864
12942
  resolve(response);
12865
12943
  } else {
12866
- reject(new AxiosError(
12867
- "Request failed with status code " + response.status,
12868
- [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
12869
- response.config,
12870
- response.request,
12871
- response
12872
- ));
12944
+ reject(new AxiosError("Request failed with status code " + response.status, response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE, response.config, response.request, response));
12873
12945
  }
12874
12946
  }
12875
12947
  function isAbsoluteURL(url2) {
12948
+ if (typeof url2 !== "string") {
12949
+ return false;
12950
+ }
12876
12951
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
12877
12952
  }
12878
12953
  function combineURLs(baseURL, relativeURL) {
@@ -12880,14 +12955,79 @@ var require_axios = __commonJS({
12880
12955
  }
12881
12956
  function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
12882
12957
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
12883
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
12958
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
12884
12959
  return combineURLs(baseURL, requestedURL);
12885
12960
  }
12886
12961
  return requestedURL;
12887
12962
  }
12888
- var VERSION = "1.11.0";
12963
+ var DEFAULT_PORTS$1 = {
12964
+ ftp: 21,
12965
+ gopher: 70,
12966
+ http: 80,
12967
+ https: 443,
12968
+ ws: 80,
12969
+ wss: 443
12970
+ };
12971
+ function parseUrl(urlString) {
12972
+ try {
12973
+ return new URL(urlString);
12974
+ } catch {
12975
+ return null;
12976
+ }
12977
+ }
12978
+ function getProxyForUrl(url2) {
12979
+ var parsedUrl = (typeof url2 === "string" ? parseUrl(url2) : url2) || {};
12980
+ var proto = parsedUrl.protocol;
12981
+ var hostname = parsedUrl.host;
12982
+ var port = parsedUrl.port;
12983
+ if (typeof hostname !== "string" || !hostname || typeof proto !== "string") {
12984
+ return "";
12985
+ }
12986
+ proto = proto.split(":", 1)[0];
12987
+ hostname = hostname.replace(/:\d*$/, "");
12988
+ port = parseInt(port) || DEFAULT_PORTS$1[proto] || 0;
12989
+ if (!shouldProxy(hostname, port)) {
12990
+ return "";
12991
+ }
12992
+ var proxy = getEnv(proto + "_proxy") || getEnv("all_proxy");
12993
+ if (proxy && proxy.indexOf("://") === -1) {
12994
+ proxy = proto + "://" + proxy;
12995
+ }
12996
+ return proxy;
12997
+ }
12998
+ function shouldProxy(hostname, port) {
12999
+ var NO_PROXY = getEnv("no_proxy").toLowerCase();
13000
+ if (!NO_PROXY) {
13001
+ return true;
13002
+ }
13003
+ if (NO_PROXY === "*") {
13004
+ return false;
13005
+ }
13006
+ return NO_PROXY.split(/[,\s]/).every(function(proxy) {
13007
+ if (!proxy) {
13008
+ return true;
13009
+ }
13010
+ var parsedProxy = proxy.match(/^(.+):(\d+)$/);
13011
+ var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
13012
+ var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
13013
+ if (parsedProxyPort && parsedProxyPort !== port) {
13014
+ return true;
13015
+ }
13016
+ if (!/^[.*]/.test(parsedProxyHostname)) {
13017
+ return hostname !== parsedProxyHostname;
13018
+ }
13019
+ if (parsedProxyHostname.charAt(0) === "*") {
13020
+ parsedProxyHostname = parsedProxyHostname.slice(1);
13021
+ }
13022
+ return !hostname.endsWith(parsedProxyHostname);
13023
+ });
13024
+ }
13025
+ function getEnv(key) {
13026
+ return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
13027
+ }
13028
+ var VERSION = "1.16.0";
12889
13029
  function parseProtocol(url2) {
12890
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
13030
+ const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url2);
12891
13031
  return match && match[1] || "";
12892
13032
  }
12893
13033
  var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
@@ -12911,14 +13051,16 @@ var require_axios = __commonJS({
12911
13051
  if (!_Blob) {
12912
13052
  throw new AxiosError("Blob is not supported", AxiosError.ERR_NOT_SUPPORT);
12913
13053
  }
12914
- return new _Blob([buffer], { type: mime });
13054
+ return new _Blob([buffer], {
13055
+ type: mime
13056
+ });
12915
13057
  }
12916
13058
  return buffer;
12917
13059
  }
12918
13060
  throw new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_NOT_SUPPORT);
12919
13061
  }
12920
13062
  var kInternals = Symbol("internals");
12921
- var AxiosTransformStream = class extends stream__default["default"].Transform {
13063
+ var AxiosTransformStream = class extends stream.Transform {
12922
13064
  constructor(options) {
12923
13065
  options = utils$1.toFlatObject(options, {
12924
13066
  maxRate: 0,
@@ -13028,8 +13170,9 @@ var require_axios = __commonJS({
13028
13170
  });
13029
13171
  }
13030
13172
  };
13031
- var AxiosTransformStream$1 = AxiosTransformStream;
13032
- var { asyncIterator } = Symbol;
13173
+ var {
13174
+ asyncIterator
13175
+ } = Symbol;
13033
13176
  var readBlob = async function* (blob) {
13034
13177
  if (blob.stream) {
13035
13178
  yield* blob.stream();
@@ -13041,21 +13184,23 @@ var require_axios = __commonJS({
13041
13184
  yield blob;
13042
13185
  }
13043
13186
  };
13044
- var readBlob$1 = readBlob;
13045
13187
  var BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + "-_";
13046
- var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util__default["default"].TextEncoder();
13188
+ var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util.TextEncoder();
13047
13189
  var CRLF = "\r\n";
13048
13190
  var CRLF_BYTES = textEncoder.encode(CRLF);
13049
13191
  var CRLF_BYTES_COUNT = 2;
13050
13192
  var FormDataPart = class {
13051
13193
  constructor(name, value) {
13052
- const { escapeName } = this.constructor;
13194
+ const {
13195
+ escapeName
13196
+ } = this.constructor;
13053
13197
  const isStringValue = utils$1.isString(value);
13054
13198
  let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`;
13055
13199
  if (isStringValue) {
13056
13200
  value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
13057
13201
  } else {
13058
- headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
13202
+ const safeType = String(value.type || "application/octet-stream").replace(/[\r\n]/g, "");
13203
+ headers += `Content-Type: ${safeType}${CRLF}`;
13059
13204
  }
13060
13205
  this.headers = textEncoder.encode(headers + CRLF);
13061
13206
  this.contentLength = isStringValue ? value.byteLength : value.size;
@@ -13065,11 +13210,13 @@ var require_axios = __commonJS({
13065
13210
  }
13066
13211
  async *encode() {
13067
13212
  yield this.headers;
13068
- const { value } = this;
13213
+ const {
13214
+ value
13215
+ } = this;
13069
13216
  if (utils$1.isTypedArray(value)) {
13070
13217
  yield value;
13071
13218
  } else {
13072
- yield* readBlob$1(value);
13219
+ yield* readBlob(value);
13073
13220
  }
13074
13221
  yield CRLF_BYTES;
13075
13222
  }
@@ -13091,7 +13238,7 @@ var require_axios = __commonJS({
13091
13238
  throw TypeError("FormData instance required");
13092
13239
  }
13093
13240
  if (boundary.length < 1 || boundary.length > 70) {
13094
- throw Error("boundary must be 10-70 characters long");
13241
+ throw Error("boundary must be 1-70 characters long");
13095
13242
  }
13096
13243
  const boundaryBytes = textEncoder.encode("--" + boundary + CRLF);
13097
13244
  const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF);
@@ -13118,8 +13265,7 @@ var require_axios = __commonJS({
13118
13265
  yield footerBytes;
13119
13266
  })());
13120
13267
  };
13121
- var formDataToStream$1 = formDataToStream;
13122
- var ZlibHeaderTransformStream = class extends stream__default["default"].Transform {
13268
+ var ZlibHeaderTransformStream = class extends stream.Transform {
13123
13269
  __transform(chunk, encoding, callback) {
13124
13270
  this.push(chunk);
13125
13271
  callback();
@@ -13137,7 +13283,6 @@ var require_axios = __commonJS({
13137
13283
  this.__transform(chunk, encoding, callback);
13138
13284
  }
13139
13285
  };
13140
- var ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream;
13141
13286
  var callbackify = (fn, reducer) => {
13142
13287
  return utils$1.isAsyncFn(fn) ? function(...args) {
13143
13288
  const cb = args.pop();
@@ -13150,7 +13295,126 @@ var require_axios = __commonJS({
13150
13295
  }, cb);
13151
13296
  } : fn;
13152
13297
  };
13153
- var callbackify$1 = callbackify;
13298
+ var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost"]);
13299
+ var isIPv4Loopback = (host) => {
13300
+ const parts = host.split(".");
13301
+ if (parts.length !== 4) return false;
13302
+ if (parts[0] !== "127") return false;
13303
+ return parts.every((p) => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255);
13304
+ };
13305
+ var isIPv6Loopback = (host) => {
13306
+ if (host === "::1") return true;
13307
+ const v4MappedDotted = host.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);
13308
+ if (v4MappedDotted) return isIPv4Loopback(v4MappedDotted[1]);
13309
+ const v4MappedHex = host.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);
13310
+ if (v4MappedHex) {
13311
+ const high = parseInt(v4MappedHex[1], 16);
13312
+ return high >= 32512 && high <= 32767;
13313
+ }
13314
+ const groups = host.split(":");
13315
+ if (groups.length === 8) {
13316
+ for (let i = 0; i < 7; i++) {
13317
+ if (!/^0+$/.test(groups[i])) return false;
13318
+ }
13319
+ return /^0*1$/.test(groups[7]);
13320
+ }
13321
+ return false;
13322
+ };
13323
+ var isLoopback = (host) => {
13324
+ if (!host) return false;
13325
+ if (LOOPBACK_HOSTNAMES.has(host)) return true;
13326
+ if (isIPv4Loopback(host)) return true;
13327
+ return isIPv6Loopback(host);
13328
+ };
13329
+ var DEFAULT_PORTS = {
13330
+ http: 80,
13331
+ https: 443,
13332
+ ws: 80,
13333
+ wss: 443,
13334
+ ftp: 21
13335
+ };
13336
+ var parseNoProxyEntry = (entry) => {
13337
+ let entryHost = entry;
13338
+ let entryPort = 0;
13339
+ if (entryHost.charAt(0) === "[") {
13340
+ const bracketIndex = entryHost.indexOf("]");
13341
+ if (bracketIndex !== -1) {
13342
+ const host = entryHost.slice(1, bracketIndex);
13343
+ const rest = entryHost.slice(bracketIndex + 1);
13344
+ if (rest.charAt(0) === ":" && /^\d+$/.test(rest.slice(1))) {
13345
+ entryPort = Number.parseInt(rest.slice(1), 10);
13346
+ }
13347
+ return [host, entryPort];
13348
+ }
13349
+ }
13350
+ const firstColon = entryHost.indexOf(":");
13351
+ const lastColon = entryHost.lastIndexOf(":");
13352
+ if (firstColon !== -1 && firstColon === lastColon && /^\d+$/.test(entryHost.slice(lastColon + 1))) {
13353
+ entryPort = Number.parseInt(entryHost.slice(lastColon + 1), 10);
13354
+ entryHost = entryHost.slice(0, lastColon);
13355
+ }
13356
+ return [entryHost, entryPort];
13357
+ };
13358
+ var IPV4_MAPPED_DOTTED_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i;
13359
+ var IPV4_MAPPED_HEX_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i;
13360
+ var unmapIPv4MappedIPv6 = (host) => {
13361
+ if (typeof host !== "string" || host.indexOf(":") === -1) return host;
13362
+ const dotted = host.match(IPV4_MAPPED_DOTTED_RE);
13363
+ if (dotted) return dotted[1];
13364
+ const hex = host.match(IPV4_MAPPED_HEX_RE);
13365
+ if (hex) {
13366
+ const high = parseInt(hex[1], 16);
13367
+ const low = parseInt(hex[2], 16);
13368
+ return `${high >> 8}.${high & 255}.${low >> 8}.${low & 255}`;
13369
+ }
13370
+ return host;
13371
+ };
13372
+ var normalizeNoProxyHost = (hostname) => {
13373
+ if (!hostname) {
13374
+ return hostname;
13375
+ }
13376
+ if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") {
13377
+ hostname = hostname.slice(1, -1);
13378
+ }
13379
+ return unmapIPv4MappedIPv6(hostname.replace(/\.+$/, ""));
13380
+ };
13381
+ function shouldBypassProxy(location) {
13382
+ let parsed;
13383
+ try {
13384
+ parsed = new URL(location);
13385
+ } catch (_err) {
13386
+ return false;
13387
+ }
13388
+ const noProxy = (process.env.no_proxy || process.env.NO_PROXY || "").toLowerCase();
13389
+ if (!noProxy) {
13390
+ return false;
13391
+ }
13392
+ if (noProxy === "*") {
13393
+ return true;
13394
+ }
13395
+ const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(":", 1)[0]] || 0;
13396
+ const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase());
13397
+ return noProxy.split(/[\s,]+/).some((entry) => {
13398
+ if (!entry) {
13399
+ return false;
13400
+ }
13401
+ let [entryHost, entryPort] = parseNoProxyEntry(entry);
13402
+ entryHost = normalizeNoProxyHost(entryHost);
13403
+ if (!entryHost) {
13404
+ return false;
13405
+ }
13406
+ if (entryPort && entryPort !== port) {
13407
+ return false;
13408
+ }
13409
+ if (entryHost.charAt(0) === "*") {
13410
+ entryHost = entryHost.slice(1);
13411
+ }
13412
+ if (entryHost.charAt(0) === ".") {
13413
+ return hostname.endsWith(entryHost);
13414
+ }
13415
+ return hostname === entryHost || isLoopback(hostname) && isLoopback(entryHost);
13416
+ });
13417
+ }
13154
13418
  function speedometer(samplesCount, min) {
13155
13419
  samplesCount = samplesCount || 10;
13156
13420
  const bytes = new Array(samplesCount);
@@ -13220,19 +13484,19 @@ var require_axios = __commonJS({
13220
13484
  let bytesNotified = 0;
13221
13485
  const _speedometer = speedometer(50, 250);
13222
13486
  return throttle((e) => {
13223
- const loaded = e.loaded;
13487
+ const rawLoaded = e.loaded;
13224
13488
  const total = e.lengthComputable ? e.total : void 0;
13225
- const progressBytes = loaded - bytesNotified;
13489
+ const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
13490
+ const progressBytes = Math.max(0, loaded - bytesNotified);
13226
13491
  const rate = _speedometer(progressBytes);
13227
- const inRange = loaded <= total;
13228
- bytesNotified = loaded;
13492
+ bytesNotified = Math.max(bytesNotified, loaded);
13229
13493
  const data = {
13230
13494
  loaded,
13231
13495
  total,
13232
13496
  progress: total ? loaded / total : void 0,
13233
13497
  bytes: progressBytes,
13234
13498
  rate: rate ? rate : void 0,
13235
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
13499
+ estimated: rate && total ? (total - loaded) / rate : void 0,
13236
13500
  event: e,
13237
13501
  lengthComputable: total != null,
13238
13502
  [isDownloadStream ? "download" : "upload"]: true
@@ -13249,63 +13513,265 @@ var require_axios = __commonJS({
13249
13513
  }), throttled[1]];
13250
13514
  };
13251
13515
  var asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
13516
+ function estimateDataURLDecodedBytes(url2) {
13517
+ if (!url2 || typeof url2 !== "string") return 0;
13518
+ if (!url2.startsWith("data:")) return 0;
13519
+ const comma = url2.indexOf(",");
13520
+ if (comma < 0) return 0;
13521
+ const meta = url2.slice(5, comma);
13522
+ const body = url2.slice(comma + 1);
13523
+ const isBase64 = /;base64/i.test(meta);
13524
+ if (isBase64) {
13525
+ let effectiveLen = body.length;
13526
+ const len = body.length;
13527
+ for (let i = 0; i < len; i++) {
13528
+ if (body.charCodeAt(i) === 37 && i + 2 < len) {
13529
+ const a = body.charCodeAt(i + 1);
13530
+ const b = body.charCodeAt(i + 2);
13531
+ 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);
13532
+ if (isHex) {
13533
+ effectiveLen -= 2;
13534
+ i += 2;
13535
+ }
13536
+ }
13537
+ }
13538
+ let pad = 0;
13539
+ let idx = len - 1;
13540
+ const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
13541
+ body.charCodeAt(j - 1) === 51 && // '3'
13542
+ (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
13543
+ if (idx >= 0) {
13544
+ if (body.charCodeAt(idx) === 61) {
13545
+ pad++;
13546
+ idx--;
13547
+ } else if (tailIsPct3D(idx)) {
13548
+ pad++;
13549
+ idx -= 3;
13550
+ }
13551
+ }
13552
+ if (pad === 1 && idx >= 0) {
13553
+ if (body.charCodeAt(idx) === 61) {
13554
+ pad++;
13555
+ } else if (tailIsPct3D(idx)) {
13556
+ pad++;
13557
+ }
13558
+ }
13559
+ const groups = Math.floor(effectiveLen / 4);
13560
+ const bytes2 = groups * 3 - (pad || 0);
13561
+ return bytes2 > 0 ? bytes2 : 0;
13562
+ }
13563
+ if (typeof Buffer !== "undefined" && typeof Buffer.byteLength === "function") {
13564
+ return Buffer.byteLength(body, "utf8");
13565
+ }
13566
+ let bytes = 0;
13567
+ for (let i = 0, len = body.length; i < len; i++) {
13568
+ const c = body.charCodeAt(i);
13569
+ if (c < 128) {
13570
+ bytes += 1;
13571
+ } else if (c < 2048) {
13572
+ bytes += 2;
13573
+ } else if (c >= 55296 && c <= 56319 && i + 1 < len) {
13574
+ const next = body.charCodeAt(i + 1);
13575
+ if (next >= 56320 && next <= 57343) {
13576
+ bytes += 4;
13577
+ i++;
13578
+ } else {
13579
+ bytes += 3;
13580
+ }
13581
+ } else {
13582
+ bytes += 3;
13583
+ }
13584
+ }
13585
+ return bytes;
13586
+ }
13252
13587
  var zlibOptions = {
13253
- flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
13254
- finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
13588
+ flush: zlib.constants.Z_SYNC_FLUSH,
13589
+ finishFlush: zlib.constants.Z_SYNC_FLUSH
13255
13590
  };
13256
13591
  var brotliOptions = {
13257
- flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH,
13258
- finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH
13592
+ flush: zlib.constants.BROTLI_OPERATION_FLUSH,
13593
+ finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
13259
13594
  };
13260
- var isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress);
13261
- var { http: httpFollow, https: httpsFollow } = followRedirects__default["default"];
13595
+ var isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress);
13596
+ var {
13597
+ http: httpFollow,
13598
+ https: httpsFollow
13599
+ } = followRedirects;
13262
13600
  var isHttps = /https:?/;
13601
+ var FORM_DATA_CONTENT_HEADERS$1 = ["content-type", "content-length"];
13602
+ function setFormDataHeaders$1(headers, formHeaders, policy) {
13603
+ if (policy !== "content-only") {
13604
+ headers.set(formHeaders);
13605
+ return;
13606
+ }
13607
+ Object.entries(formHeaders).forEach(([key, val]) => {
13608
+ if (FORM_DATA_CONTENT_HEADERS$1.includes(key.toLowerCase())) {
13609
+ headers.set(key, val);
13610
+ }
13611
+ });
13612
+ }
13613
+ var kAxiosSocketListener = Symbol("axios.http.socketListener");
13614
+ var kAxiosCurrentReq = Symbol("axios.http.currentReq");
13263
13615
  var supportedProtocols = platform.protocols.map((protocol) => {
13264
13616
  return protocol + ":";
13265
13617
  });
13618
+ var decodeURIComponentSafe = (value) => {
13619
+ if (!utils$1.isString(value)) {
13620
+ return value;
13621
+ }
13622
+ try {
13623
+ return decodeURIComponent(value);
13624
+ } catch (error) {
13625
+ return value;
13626
+ }
13627
+ };
13266
13628
  var flushOnFinish = (stream2, [throttled, flush]) => {
13267
13629
  stream2.on("end", flush).on("error", flush);
13268
13630
  return throttled;
13269
13631
  };
13270
- function dispatchBeforeRedirect(options, responseDetails) {
13632
+ var Http2Sessions = class {
13633
+ constructor() {
13634
+ this.sessions = /* @__PURE__ */ Object.create(null);
13635
+ }
13636
+ getSession(authority, options) {
13637
+ options = Object.assign({
13638
+ sessionTimeout: 1e3
13639
+ }, options);
13640
+ let authoritySessions = this.sessions[authority];
13641
+ if (authoritySessions) {
13642
+ let len = authoritySessions.length;
13643
+ for (let i = 0; i < len; i++) {
13644
+ const [sessionHandle, sessionOptions] = authoritySessions[i];
13645
+ if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) {
13646
+ return sessionHandle;
13647
+ }
13648
+ }
13649
+ }
13650
+ const session = http2.connect(authority, options);
13651
+ let removed;
13652
+ const removeSession = () => {
13653
+ if (removed) {
13654
+ return;
13655
+ }
13656
+ removed = true;
13657
+ let entries = authoritySessions, len = entries.length, i = len;
13658
+ while (i--) {
13659
+ if (entries[i][0] === session) {
13660
+ if (len === 1) {
13661
+ delete this.sessions[authority];
13662
+ } else {
13663
+ entries.splice(i, 1);
13664
+ }
13665
+ if (!session.closed) {
13666
+ session.close();
13667
+ }
13668
+ return;
13669
+ }
13670
+ }
13671
+ };
13672
+ const originalRequestFn = session.request;
13673
+ const {
13674
+ sessionTimeout
13675
+ } = options;
13676
+ if (sessionTimeout != null) {
13677
+ let timer;
13678
+ let streamsCount = 0;
13679
+ session.request = function() {
13680
+ const stream2 = originalRequestFn.apply(this, arguments);
13681
+ streamsCount++;
13682
+ if (timer) {
13683
+ clearTimeout(timer);
13684
+ timer = null;
13685
+ }
13686
+ stream2.once("close", () => {
13687
+ if (!--streamsCount) {
13688
+ timer = setTimeout(() => {
13689
+ timer = null;
13690
+ removeSession();
13691
+ }, sessionTimeout);
13692
+ }
13693
+ });
13694
+ return stream2;
13695
+ };
13696
+ }
13697
+ session.once("close", removeSession);
13698
+ let entry = [session, options];
13699
+ authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
13700
+ return session;
13701
+ }
13702
+ };
13703
+ var http2Sessions = new Http2Sessions();
13704
+ function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
13271
13705
  if (options.beforeRedirects.proxy) {
13272
13706
  options.beforeRedirects.proxy(options);
13273
13707
  }
13274
13708
  if (options.beforeRedirects.config) {
13275
- options.beforeRedirects.config(options, responseDetails);
13709
+ options.beforeRedirects.config(options, responseDetails, requestDetails);
13276
13710
  }
13277
13711
  }
13278
- function setProxy(options, configProxy, location) {
13712
+ function setProxy(options, configProxy, location, isRedirect) {
13279
13713
  let proxy = configProxy;
13280
13714
  if (!proxy && proxy !== false) {
13281
- const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location);
13715
+ const proxyUrl = getProxyForUrl(location);
13282
13716
  if (proxyUrl) {
13283
- proxy = new URL(proxyUrl);
13717
+ if (!shouldBypassProxy(location)) {
13718
+ proxy = new URL(proxyUrl);
13719
+ }
13284
13720
  }
13285
13721
  }
13286
- if (proxy) {
13287
- if (proxy.username) {
13288
- proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
13722
+ if (isRedirect && options.headers) {
13723
+ for (const name of Object.keys(options.headers)) {
13724
+ if (name.toLowerCase() === "proxy-authorization") {
13725
+ delete options.headers[name];
13726
+ }
13289
13727
  }
13290
- if (proxy.auth) {
13291
- if (proxy.auth.username || proxy.auth.password) {
13292
- proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || "");
13728
+ }
13729
+ if (proxy) {
13730
+ const isProxyURL = proxy instanceof URL;
13731
+ const readProxyField = (key) => isProxyURL || utils$1.hasOwnProp(proxy, key) ? proxy[key] : void 0;
13732
+ const proxyUsername = readProxyField("username");
13733
+ const proxyPassword = readProxyField("password");
13734
+ let proxyAuth = utils$1.hasOwnProp(proxy, "auth") ? proxy.auth : void 0;
13735
+ if (proxyUsername) {
13736
+ proxyAuth = (proxyUsername || "") + ":" + (proxyPassword || "");
13737
+ }
13738
+ if (proxyAuth) {
13739
+ const authIsObject = typeof proxyAuth === "object";
13740
+ const authUsername = authIsObject && utils$1.hasOwnProp(proxyAuth, "username") ? proxyAuth.username : void 0;
13741
+ const authPassword = authIsObject && utils$1.hasOwnProp(proxyAuth, "password") ? proxyAuth.password : void 0;
13742
+ const validProxyAuth = Boolean(authUsername || authPassword);
13743
+ if (validProxyAuth) {
13744
+ proxyAuth = (authUsername || "") + ":" + (authPassword || "");
13745
+ } else if (authIsObject) {
13746
+ throw new AxiosError("Invalid proxy authorization", AxiosError.ERR_BAD_OPTION, {
13747
+ proxy
13748
+ });
13293
13749
  }
13294
- const base64 = Buffer.from(proxy.auth, "utf8").toString("base64");
13750
+ const base64 = Buffer.from(proxyAuth, "utf8").toString("base64");
13295
13751
  options.headers["Proxy-Authorization"] = "Basic " + base64;
13296
13752
  }
13297
- options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
13298
- const proxyHost = proxy.hostname || proxy.host;
13753
+ let hasUserHostHeader = false;
13754
+ for (const name of Object.keys(options.headers)) {
13755
+ if (name.toLowerCase() === "host") {
13756
+ hasUserHostHeader = true;
13757
+ break;
13758
+ }
13759
+ }
13760
+ if (!hasUserHostHeader) {
13761
+ options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
13762
+ }
13763
+ const proxyHost = readProxyField("hostname") || readProxyField("host");
13299
13764
  options.hostname = proxyHost;
13300
13765
  options.host = proxyHost;
13301
- options.port = proxy.port;
13766
+ options.port = readProxyField("port");
13302
13767
  options.path = location;
13303
- if (proxy.protocol) {
13304
- options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`;
13768
+ const proxyProtocol = readProxyField("protocol");
13769
+ if (proxyProtocol) {
13770
+ options.protocol = proxyProtocol.includes(":") ? proxyProtocol : `${proxyProtocol}:`;
13305
13771
  }
13306
13772
  }
13307
13773
  options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
13308
- setProxy(redirectOptions, configProxy, redirectOptions.href);
13774
+ setProxy(redirectOptions, configProxy, redirectOptions.href, true);
13309
13775
  };
13310
13776
  }
13311
13777
  var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process";
@@ -13329,7 +13795,10 @@ var require_axios = __commonJS({
13329
13795
  asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject);
13330
13796
  });
13331
13797
  };
13332
- var resolveFamily = ({ address, family }) => {
13798
+ var resolveFamily = ({
13799
+ address,
13800
+ family
13801
+ }) => {
13333
13802
  if (!utils$1.isString(address)) {
13334
13803
  throw TypeError("address must be a string");
13335
13804
  }
@@ -13338,17 +13807,71 @@ var require_axios = __commonJS({
13338
13807
  family: family || (address.indexOf(".") < 0 ? 6 : 4)
13339
13808
  };
13340
13809
  };
13341
- var buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : { address, family });
13810
+ var buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {
13811
+ address,
13812
+ family
13813
+ });
13814
+ var http2Transport = {
13815
+ request(options, cb) {
13816
+ const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
13817
+ const {
13818
+ http2Options,
13819
+ headers
13820
+ } = options;
13821
+ const session = http2Sessions.getSession(authority, http2Options);
13822
+ const {
13823
+ HTTP2_HEADER_SCHEME,
13824
+ HTTP2_HEADER_METHOD,
13825
+ HTTP2_HEADER_PATH,
13826
+ HTTP2_HEADER_STATUS
13827
+ } = http2.constants;
13828
+ const http2Headers = {
13829
+ [HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""),
13830
+ [HTTP2_HEADER_METHOD]: options.method,
13831
+ [HTTP2_HEADER_PATH]: options.path
13832
+ };
13833
+ utils$1.forEach(headers, (header, name) => {
13834
+ name.charAt(0) !== ":" && (http2Headers[name] = header);
13835
+ });
13836
+ const req = session.request(http2Headers);
13837
+ req.once("response", (responseHeaders) => {
13838
+ const response = req;
13839
+ responseHeaders = Object.assign({}, responseHeaders);
13840
+ const status = responseHeaders[HTTP2_HEADER_STATUS];
13841
+ delete responseHeaders[HTTP2_HEADER_STATUS];
13842
+ response.headers = responseHeaders;
13843
+ response.statusCode = +status;
13844
+ cb(response);
13845
+ });
13846
+ return req;
13847
+ }
13848
+ };
13342
13849
  var httpAdapter = isHttpAdapterSupported && function httpAdapter2(config) {
13343
13850
  return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
13344
- let { data, lookup, family } = config;
13345
- const { responseType, responseEncoding } = config;
13851
+ const own2 = (key) => utils$1.hasOwnProp(config, key) ? config[key] : void 0;
13852
+ let data = own2("data");
13853
+ let lookup = own2("lookup");
13854
+ let family = own2("family");
13855
+ let httpVersion = own2("httpVersion");
13856
+ if (httpVersion === void 0) httpVersion = 1;
13857
+ let http2Options = own2("http2Options");
13858
+ const responseType = own2("responseType");
13859
+ const responseEncoding = own2("responseEncoding");
13346
13860
  const method = config.method.toUpperCase();
13347
13861
  let isDone;
13348
13862
  let rejected = false;
13349
13863
  let req;
13864
+ let connectPhaseTimer;
13865
+ httpVersion = +httpVersion;
13866
+ if (Number.isNaN(httpVersion)) {
13867
+ throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
13868
+ }
13869
+ if (httpVersion !== 1 && httpVersion !== 2) {
13870
+ throw TypeError(`Unsupported protocol version '${httpVersion}'`);
13871
+ }
13872
+ const isHttp2 = httpVersion === 2;
13350
13873
  if (lookup) {
13351
- const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]);
13874
+ const _lookup = callbackify(lookup, (value) => utils$1.isArray(value) ? value : [value]);
13352
13875
  lookup = (hostname, opt, cb) => {
13353
13876
  _lookup(hostname, opt, (err, arg0, arg1) => {
13354
13877
  if (err) {
@@ -13359,37 +13882,76 @@ var require_axios = __commonJS({
13359
13882
  });
13360
13883
  };
13361
13884
  }
13362
- const emitter = new events.EventEmitter();
13885
+ const abortEmitter = new events.EventEmitter();
13886
+ function abort(reason) {
13887
+ try {
13888
+ abortEmitter.emit("abort", !reason || reason.type ? new CanceledError(null, config, req) : reason);
13889
+ } catch (err) {
13890
+ console.warn("emit error", err);
13891
+ }
13892
+ }
13893
+ function clearConnectPhaseTimer() {
13894
+ if (connectPhaseTimer) {
13895
+ clearTimeout(connectPhaseTimer);
13896
+ connectPhaseTimer = null;
13897
+ }
13898
+ }
13899
+ function createTimeoutError() {
13900
+ let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
13901
+ const transitional = config.transitional || transitionalDefaults;
13902
+ if (config.timeoutErrorMessage) {
13903
+ timeoutErrorMessage = config.timeoutErrorMessage;
13904
+ }
13905
+ return new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req);
13906
+ }
13907
+ abortEmitter.once("abort", reject);
13363
13908
  const onFinished = () => {
13909
+ clearConnectPhaseTimer();
13364
13910
  if (config.cancelToken) {
13365
13911
  config.cancelToken.unsubscribe(abort);
13366
13912
  }
13367
13913
  if (config.signal) {
13368
13914
  config.signal.removeEventListener("abort", abort);
13369
13915
  }
13370
- emitter.removeAllListeners();
13916
+ abortEmitter.removeAllListeners();
13371
13917
  };
13372
- onDone((value, isRejected) => {
13373
- isDone = true;
13374
- if (isRejected) {
13375
- rejected = true;
13376
- onFinished();
13377
- }
13378
- });
13379
- function abort(reason) {
13380
- emitter.emit("abort", !reason || reason.type ? new CanceledError(null, config, req) : reason);
13381
- }
13382
- emitter.once("abort", reject);
13383
13918
  if (config.cancelToken || config.signal) {
13384
13919
  config.cancelToken && config.cancelToken.subscribe(abort);
13385
13920
  if (config.signal) {
13386
13921
  config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
13387
13922
  }
13388
13923
  }
13924
+ onDone((response, isRejected) => {
13925
+ isDone = true;
13926
+ clearConnectPhaseTimer();
13927
+ if (isRejected) {
13928
+ rejected = true;
13929
+ onFinished();
13930
+ return;
13931
+ }
13932
+ const {
13933
+ data: data2
13934
+ } = response;
13935
+ if (data2 instanceof stream.Readable || data2 instanceof stream.Duplex) {
13936
+ const offListeners = stream.finished(data2, () => {
13937
+ offListeners();
13938
+ onFinished();
13939
+ });
13940
+ } else {
13941
+ onFinished();
13942
+ }
13943
+ });
13389
13944
  const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
13390
13945
  const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : void 0);
13391
13946
  const protocol = parsed.protocol || supportedProtocols[0];
13392
13947
  if (protocol === "data:") {
13948
+ if (config.maxContentLength > -1) {
13949
+ const dataUrl = String(config.url || fullPath || "");
13950
+ const estimated = estimateDataURLDecodedBytes(dataUrl);
13951
+ if (estimated > config.maxContentLength) {
13952
+ return reject(new AxiosError("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config));
13953
+ }
13954
+ }
13393
13955
  let convertedData;
13394
13956
  if (method !== "GET") {
13395
13957
  return settle(resolve, reject, {
@@ -13412,42 +13974,41 @@ var require_axios = __commonJS({
13412
13974
  convertedData = utils$1.stripBOM(convertedData);
13413
13975
  }
13414
13976
  } else if (responseType === "stream") {
13415
- convertedData = stream__default["default"].Readable.from(convertedData);
13977
+ convertedData = stream.Readable.from(convertedData);
13416
13978
  }
13417
13979
  return settle(resolve, reject, {
13418
13980
  data: convertedData,
13419
13981
  status: 200,
13420
13982
  statusText: "OK",
13421
- headers: new AxiosHeaders$1(),
13983
+ headers: new AxiosHeaders(),
13422
13984
  config
13423
13985
  });
13424
13986
  }
13425
13987
  if (supportedProtocols.indexOf(protocol) === -1) {
13426
- return reject(new AxiosError(
13427
- "Unsupported protocol " + protocol,
13428
- AxiosError.ERR_BAD_REQUEST,
13429
- config
13430
- ));
13988
+ return reject(new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_BAD_REQUEST, config));
13431
13989
  }
13432
- const headers = AxiosHeaders$1.from(config.headers).normalize();
13990
+ const headers = AxiosHeaders.from(config.headers).normalize();
13433
13991
  headers.set("User-Agent", "axios/" + VERSION, false);
13434
- const { onUploadProgress, onDownloadProgress } = config;
13992
+ const {
13993
+ onUploadProgress,
13994
+ onDownloadProgress
13995
+ } = config;
13435
13996
  const maxRate = config.maxRate;
13436
13997
  let maxUploadRate = void 0;
13437
13998
  let maxDownloadRate = void 0;
13438
13999
  if (utils$1.isSpecCompliantForm(data)) {
13439
14000
  const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
13440
- data = formDataToStream$1(data, (formHeaders) => {
14001
+ data = formDataToStream(data, (formHeaders) => {
13441
14002
  headers.set(formHeaders);
13442
14003
  }, {
13443
14004
  tag: `axios-${VERSION}-boundary`,
13444
14005
  boundary: userBoundary && userBoundary[1] || void 0
13445
14006
  });
13446
- } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
13447
- headers.set(data.getHeaders());
14007
+ } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) {
14008
+ setFormDataHeaders$1(headers, data.getHeaders(), own2("formDataHeaderPolicy"));
13448
14009
  if (!headers.hasContentLength()) {
13449
14010
  try {
13450
- const knownLength = await util__default["default"].promisify(data.getLength).call(data);
14011
+ const knownLength = await util.promisify(data.getLength).call(data);
13451
14012
  Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
13452
14013
  } catch (e) {
13453
14014
  }
@@ -13455,7 +14016,7 @@ var require_axios = __commonJS({
13455
14016
  } else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
13456
14017
  data.size && headers.setContentType(data.type || "application/octet-stream");
13457
14018
  headers.setContentLength(data.size || 0);
13458
- data = stream__default["default"].Readable.from(readBlob$1(data));
14019
+ data = stream.Readable.from(readBlob(data));
13459
14020
  } else if (data && !utils$1.isStream(data)) {
13460
14021
  if (Buffer.isBuffer(data)) ;
13461
14022
  else if (utils$1.isArrayBuffer(data)) {
@@ -13463,19 +14024,11 @@ var require_axios = __commonJS({
13463
14024
  } else if (utils$1.isString(data)) {
13464
14025
  data = Buffer.from(data, "utf-8");
13465
14026
  } else {
13466
- return reject(new AxiosError(
13467
- "Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
13468
- AxiosError.ERR_BAD_REQUEST,
13469
- config
13470
- ));
14027
+ return reject(new AxiosError("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", AxiosError.ERR_BAD_REQUEST, config));
13471
14028
  }
13472
14029
  headers.setContentLength(data.length, false);
13473
14030
  if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
13474
- return reject(new AxiosError(
13475
- "Request body larger than maxBodyLength limit",
13476
- AxiosError.ERR_BAD_REQUEST,
13477
- config
13478
- ));
14031
+ return reject(new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config));
13479
14032
  }
13480
14033
  }
13481
14034
  const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
@@ -13487,38 +14040,31 @@ var require_axios = __commonJS({
13487
14040
  }
13488
14041
  if (data && (onUploadProgress || maxUploadRate)) {
13489
14042
  if (!utils$1.isStream(data)) {
13490
- data = stream__default["default"].Readable.from(data, { objectMode: false });
14043
+ data = stream.Readable.from(data, {
14044
+ objectMode: false
14045
+ });
13491
14046
  }
13492
- data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({
14047
+ data = stream.pipeline([data, new AxiosTransformStream({
13493
14048
  maxRate: utils$1.toFiniteNumber(maxUploadRate)
13494
14049
  })], utils$1.noop);
13495
- onUploadProgress && data.on("progress", flushOnFinish(
13496
- data,
13497
- progressEventDecorator(
13498
- contentLength,
13499
- progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
13500
- )
13501
- ));
14050
+ onUploadProgress && data.on("progress", flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress), false, 3))));
13502
14051
  }
13503
14052
  let auth = void 0;
13504
- if (config.auth) {
13505
- const username = config.auth.username || "";
13506
- const password = config.auth.password || "";
14053
+ const configAuth = own2("auth");
14054
+ if (configAuth) {
14055
+ const username = configAuth.username || "";
14056
+ const password = configAuth.password || "";
13507
14057
  auth = username + ":" + password;
13508
14058
  }
13509
14059
  if (!auth && parsed.username) {
13510
- const urlUsername = parsed.username;
13511
- const urlPassword = parsed.password;
14060
+ const urlUsername = decodeURIComponentSafe(parsed.username);
14061
+ const urlPassword = decodeURIComponentSafe(parsed.password);
13512
14062
  auth = urlUsername + ":" + urlPassword;
13513
14063
  }
13514
14064
  auth && headers.delete("authorization");
13515
- let path2;
14065
+ let path$1;
13516
14066
  try {
13517
- path2 = buildURL(
13518
- parsed.pathname + parsed.search,
13519
- config.params,
13520
- config.paramsSerializer
13521
- ).replace(/^\?/, "");
14067
+ path$1 = buildURL(parsed.pathname + parsed.search, config.params, config.paramsSerializer).replace(/^\?/, "");
13522
14068
  } catch (err) {
13523
14069
  const customErr = new Error(err.message);
13524
14070
  customErr.config = config;
@@ -13526,24 +14072,35 @@ var require_axios = __commonJS({
13526
14072
  customErr.exists = true;
13527
14073
  return reject(customErr);
13528
14074
  }
13529
- headers.set(
13530
- "Accept-Encoding",
13531
- "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""),
13532
- false
13533
- );
13534
- const options = {
13535
- path: path2,
14075
+ headers.set("Accept-Encoding", "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), false);
14076
+ const options = Object.assign(/* @__PURE__ */ Object.create(null), {
14077
+ path: path$1,
13536
14078
  method,
13537
14079
  headers: headers.toJSON(),
13538
- agents: { http: config.httpAgent, https: config.httpsAgent },
14080
+ agents: {
14081
+ http: config.httpAgent,
14082
+ https: config.httpsAgent
14083
+ },
13539
14084
  auth,
13540
14085
  protocol,
13541
14086
  family,
13542
14087
  beforeRedirect: dispatchBeforeRedirect,
13543
- beforeRedirects: {}
13544
- };
14088
+ beforeRedirects: /* @__PURE__ */ Object.create(null),
14089
+ http2Options
14090
+ });
13545
14091
  !utils$1.isUndefined(lookup) && (options.lookup = lookup);
13546
14092
  if (config.socketPath) {
14093
+ if (typeof config.socketPath !== "string") {
14094
+ return reject(new AxiosError("socketPath must be a string", AxiosError.ERR_BAD_OPTION_VALUE, config));
14095
+ }
14096
+ if (config.allowedSocketPaths != null) {
14097
+ const allowed = Array.isArray(config.allowedSocketPaths) ? config.allowedSocketPaths : [config.allowedSocketPaths];
14098
+ const resolvedSocket = path2.resolve(config.socketPath);
14099
+ const isAllowed = allowed.some((entry) => typeof entry === "string" && path2.resolve(entry) === resolvedSocket);
14100
+ if (!isAllowed) {
14101
+ return reject(new AxiosError(`socketPath "${config.socketPath}" is not permitted by allowedSocketPaths`, AxiosError.ERR_BAD_OPTION_VALUE, config));
14102
+ }
14103
+ }
13547
14104
  options.socketPath = config.socketPath;
13548
14105
  } else {
13549
14106
  options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
@@ -13551,44 +14108,45 @@ var require_axios = __commonJS({
13551
14108
  setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
13552
14109
  }
13553
14110
  let transport;
14111
+ let isNativeTransport = false;
13554
14112
  const isHttpsRequest = isHttps.test(options.protocol);
13555
14113
  options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
13556
- if (config.transport) {
13557
- transport = config.transport;
13558
- } else if (config.maxRedirects === 0) {
13559
- transport = isHttpsRequest ? https__default["default"] : http__default["default"];
14114
+ if (isHttp2) {
14115
+ transport = http2Transport;
13560
14116
  } else {
13561
- if (config.maxRedirects) {
13562
- options.maxRedirects = config.maxRedirects;
13563
- }
13564
- if (config.beforeRedirect) {
13565
- options.beforeRedirects.config = config.beforeRedirect;
14117
+ const configTransport = own2("transport");
14118
+ if (configTransport) {
14119
+ transport = configTransport;
14120
+ } else if (config.maxRedirects === 0) {
14121
+ transport = isHttpsRequest ? https : http;
14122
+ isNativeTransport = true;
14123
+ } else {
14124
+ if (config.maxRedirects) {
14125
+ options.maxRedirects = config.maxRedirects;
14126
+ }
14127
+ const configBeforeRedirect = own2("beforeRedirect");
14128
+ if (configBeforeRedirect) {
14129
+ options.beforeRedirects.config = configBeforeRedirect;
14130
+ }
14131
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
13566
14132
  }
13567
- transport = isHttpsRequest ? httpsFollow : httpFollow;
13568
14133
  }
13569
14134
  if (config.maxBodyLength > -1) {
13570
14135
  options.maxBodyLength = config.maxBodyLength;
13571
14136
  } else {
13572
14137
  options.maxBodyLength = Infinity;
13573
14138
  }
13574
- if (config.insecureHTTPParser) {
13575
- options.insecureHTTPParser = config.insecureHTTPParser;
13576
- }
14139
+ options.insecureHTTPParser = Boolean(own2("insecureHTTPParser"));
13577
14140
  req = transport.request(options, function handleResponse(res) {
14141
+ clearConnectPhaseTimer();
13578
14142
  if (req.destroyed) return;
13579
14143
  const streams = [res];
13580
- const responseLength = +res.headers["content-length"];
14144
+ const responseLength = utils$1.toFiniteNumber(res.headers["content-length"]);
13581
14145
  if (onDownloadProgress || maxDownloadRate) {
13582
- const transformStream = new AxiosTransformStream$1({
14146
+ const transformStream = new AxiosTransformStream({
13583
14147
  maxRate: utils$1.toFiniteNumber(maxDownloadRate)
13584
14148
  });
13585
- onDownloadProgress && transformStream.on("progress", flushOnFinish(
13586
- transformStream,
13587
- progressEventDecorator(
13588
- responseLength,
13589
- progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
13590
- )
13591
- ));
14149
+ onDownloadProgress && transformStream.on("progress", flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress), true, 3))));
13592
14150
  streams.push(transformStream);
13593
14151
  }
13594
14152
  let responseStream = res;
@@ -13603,34 +14161,47 @@ var require_axios = __commonJS({
13603
14161
  case "x-gzip":
13604
14162
  case "compress":
13605
14163
  case "x-compress":
13606
- streams.push(zlib__default["default"].createUnzip(zlibOptions));
14164
+ streams.push(zlib.createUnzip(zlibOptions));
13607
14165
  delete res.headers["content-encoding"];
13608
14166
  break;
13609
14167
  case "deflate":
13610
- streams.push(new ZlibHeaderTransformStream$1());
13611
- streams.push(zlib__default["default"].createUnzip(zlibOptions));
14168
+ streams.push(new ZlibHeaderTransformStream());
14169
+ streams.push(zlib.createUnzip(zlibOptions));
13612
14170
  delete res.headers["content-encoding"];
13613
14171
  break;
13614
14172
  case "br":
13615
14173
  if (isBrotliSupported) {
13616
- streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions));
14174
+ streams.push(zlib.createBrotliDecompress(brotliOptions));
13617
14175
  delete res.headers["content-encoding"];
13618
14176
  }
13619
14177
  }
13620
14178
  }
13621
- responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0];
13622
- const offListeners = stream__default["default"].finished(responseStream, () => {
13623
- offListeners();
13624
- onFinished();
13625
- });
14179
+ responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0];
13626
14180
  const response = {
13627
14181
  status: res.statusCode,
13628
14182
  statusText: res.statusMessage,
13629
- headers: new AxiosHeaders$1(res.headers),
14183
+ headers: new AxiosHeaders(res.headers),
13630
14184
  config,
13631
14185
  request: lastRequest
13632
14186
  };
13633
14187
  if (responseType === "stream") {
14188
+ if (config.maxContentLength > -1) {
14189
+ const limit = config.maxContentLength;
14190
+ const source = responseStream;
14191
+ async function* enforceMaxContentLength() {
14192
+ let totalResponseBytes = 0;
14193
+ for await (const chunk of source) {
14194
+ totalResponseBytes += chunk.length;
14195
+ if (totalResponseBytes > limit) {
14196
+ throw new AxiosError("maxContentLength size of " + limit + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, lastRequest);
14197
+ }
14198
+ yield chunk;
14199
+ }
14200
+ }
14201
+ responseStream = stream.Readable.from(enforceMaxContentLength(), {
14202
+ objectMode: false
14203
+ });
14204
+ }
13634
14205
  response.data = responseStream;
13635
14206
  settle(resolve, reject, response);
13636
14207
  } else {
@@ -13642,30 +14213,20 @@ var require_axios = __commonJS({
13642
14213
  if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
13643
14214
  rejected = true;
13644
14215
  responseStream.destroy();
13645
- reject(new AxiosError(
13646
- "maxContentLength size of " + config.maxContentLength + " exceeded",
13647
- AxiosError.ERR_BAD_RESPONSE,
13648
- config,
13649
- lastRequest
13650
- ));
14216
+ abort(new AxiosError("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
13651
14217
  }
13652
14218
  });
13653
14219
  responseStream.on("aborted", function handlerStreamAborted() {
13654
14220
  if (rejected) {
13655
14221
  return;
13656
14222
  }
13657
- const err = new AxiosError(
13658
- "stream has been aborted",
13659
- AxiosError.ERR_BAD_RESPONSE,
13660
- config,
13661
- lastRequest
13662
- );
14223
+ const err = new AxiosError("stream has been aborted", AxiosError.ERR_BAD_RESPONSE, config, lastRequest, response);
13663
14224
  responseStream.destroy(err);
13664
14225
  reject(err);
13665
14226
  });
13666
14227
  responseStream.on("error", function handleStreamError(err) {
13667
- if (req.destroyed) return;
13668
- reject(AxiosError.from(err, null, config, lastRequest));
14228
+ if (rejected) return;
14229
+ reject(AxiosError.from(err, null, config, lastRequest, response));
13669
14230
  });
13670
14231
  responseStream.on("end", function handleStreamEnd() {
13671
14232
  try {
@@ -13683,49 +14244,63 @@ var require_axios = __commonJS({
13683
14244
  settle(resolve, reject, response);
13684
14245
  });
13685
14246
  }
13686
- emitter.once("abort", (err) => {
14247
+ abortEmitter.once("abort", (err) => {
13687
14248
  if (!responseStream.destroyed) {
13688
14249
  responseStream.emit("error", err);
13689
14250
  responseStream.destroy();
13690
14251
  }
13691
14252
  });
13692
14253
  });
13693
- emitter.once("abort", (err) => {
13694
- reject(err);
13695
- req.destroy(err);
14254
+ abortEmitter.once("abort", (err) => {
14255
+ if (req.close) {
14256
+ req.close();
14257
+ } else {
14258
+ req.destroy(err);
14259
+ }
13696
14260
  });
13697
14261
  req.on("error", function handleRequestError(err) {
13698
14262
  reject(AxiosError.from(err, null, config, req));
13699
14263
  });
14264
+ const boundSockets = /* @__PURE__ */ new Set();
13700
14265
  req.on("socket", function handleRequestSocket(socket) {
13701
14266
  socket.setKeepAlive(true, 1e3 * 60);
14267
+ if (!socket[kAxiosSocketListener]) {
14268
+ socket.on("error", function handleSocketError(err) {
14269
+ const current = socket[kAxiosCurrentReq];
14270
+ if (current && !current.destroyed) {
14271
+ current.destroy(err);
14272
+ }
14273
+ });
14274
+ socket[kAxiosSocketListener] = true;
14275
+ }
14276
+ socket[kAxiosCurrentReq] = req;
14277
+ boundSockets.add(socket);
14278
+ });
14279
+ req.once("close", function clearCurrentReq() {
14280
+ clearConnectPhaseTimer();
14281
+ for (const socket of boundSockets) {
14282
+ if (socket[kAxiosCurrentReq] === req) {
14283
+ socket[kAxiosCurrentReq] = null;
14284
+ }
14285
+ }
14286
+ boundSockets.clear();
13702
14287
  });
13703
14288
  if (config.timeout) {
13704
14289
  const timeout = parseInt(config.timeout, 10);
13705
14290
  if (Number.isNaN(timeout)) {
13706
- reject(new AxiosError(
13707
- "error trying to parse `config.timeout` to int",
13708
- AxiosError.ERR_BAD_OPTION_VALUE,
13709
- config,
13710
- req
13711
- ));
14291
+ abort(new AxiosError("error trying to parse `config.timeout` to int", AxiosError.ERR_BAD_OPTION_VALUE, config, req));
13712
14292
  return;
13713
14293
  }
13714
- req.setTimeout(timeout, function handleRequestTimeout() {
14294
+ const handleTimeout = function handleTimeout2() {
13715
14295
  if (isDone) return;
13716
- let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
13717
- const transitional = config.transitional || transitionalDefaults;
13718
- if (config.timeoutErrorMessage) {
13719
- timeoutErrorMessage = config.timeoutErrorMessage;
13720
- }
13721
- reject(new AxiosError(
13722
- timeoutErrorMessage,
13723
- transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
13724
- config,
13725
- req
13726
- ));
13727
- abort();
13728
- });
14296
+ abort(createTimeoutError());
14297
+ };
14298
+ if (isNativeTransport && timeout > 0) {
14299
+ connectPhaseTimer = setTimeout(handleTimeout, timeout);
14300
+ }
14301
+ req.setTimeout(timeout, handleTimeout);
14302
+ } else {
14303
+ req.setTimeout(0);
13729
14304
  }
13730
14305
  if (utils$1.isStream(data)) {
13731
14306
  let ended = false;
@@ -13742,36 +14317,71 @@ var require_axios = __commonJS({
13742
14317
  abort(new CanceledError("Request stream has been aborted", config, req));
13743
14318
  }
13744
14319
  });
13745
- data.pipe(req);
14320
+ let uploadStream = data;
14321
+ if (config.maxBodyLength > -1 && config.maxRedirects === 0) {
14322
+ const limit = config.maxBodyLength;
14323
+ let bytesSent = 0;
14324
+ uploadStream = stream.pipeline([data, new stream.Transform({
14325
+ transform(chunk, _enc, cb) {
14326
+ bytesSent += chunk.length;
14327
+ if (bytesSent > limit) {
14328
+ return cb(new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config, req));
14329
+ }
14330
+ cb(null, chunk);
14331
+ }
14332
+ })], utils$1.noop);
14333
+ uploadStream.on("error", (err) => {
14334
+ if (!req.destroyed) req.destroy(err);
14335
+ });
14336
+ }
14337
+ uploadStream.pipe(req);
13746
14338
  } else {
13747
- req.end(data);
14339
+ data && req.write(data);
14340
+ req.end();
13748
14341
  }
13749
14342
  });
13750
14343
  };
13751
14344
  var isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => {
13752
14345
  url2 = new URL(url2, platform.origin);
13753
14346
  return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port);
13754
- })(
13755
- new URL(platform.origin),
13756
- platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
13757
- ) : () => true;
14347
+ })(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : () => true;
13758
14348
  var cookies = platform.hasStandardBrowserEnv ? (
13759
14349
  // Standard browser envs support document.cookie
13760
14350
  {
13761
- write(name, value, expires, path2, domain, secure) {
13762
- const cookie = [name + "=" + encodeURIComponent(value)];
13763
- utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
13764
- utils$1.isString(path2) && cookie.push("path=" + path2);
13765
- utils$1.isString(domain) && cookie.push("domain=" + domain);
13766
- secure === true && cookie.push("secure");
14351
+ write(name, value, expires, path3, domain, secure, sameSite) {
14352
+ if (typeof document === "undefined") return;
14353
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
14354
+ if (utils$1.isNumber(expires)) {
14355
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
14356
+ }
14357
+ if (utils$1.isString(path3)) {
14358
+ cookie.push(`path=${path3}`);
14359
+ }
14360
+ if (utils$1.isString(domain)) {
14361
+ cookie.push(`domain=${domain}`);
14362
+ }
14363
+ if (secure === true) {
14364
+ cookie.push("secure");
14365
+ }
14366
+ if (utils$1.isString(sameSite)) {
14367
+ cookie.push(`SameSite=${sameSite}`);
14368
+ }
13767
14369
  document.cookie = cookie.join("; ");
13768
14370
  },
13769
14371
  read(name) {
13770
- const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
13771
- return match ? decodeURIComponent(match[3]) : null;
14372
+ if (typeof document === "undefined") return null;
14373
+ const cookies2 = document.cookie.split(";");
14374
+ for (let i = 0; i < cookies2.length; i++) {
14375
+ const cookie = cookies2[i].replace(/^\s+/, "");
14376
+ const eq = cookie.indexOf("=");
14377
+ if (eq !== -1 && cookie.slice(0, eq) === name) {
14378
+ return decodeURIComponent(cookie.slice(eq + 1));
14379
+ }
14380
+ }
14381
+ return null;
13772
14382
  },
13773
14383
  remove(name) {
13774
- this.write(name, "", Date.now() - 864e5);
14384
+ this.write(name, "", Date.now() - 864e5, "/");
13775
14385
  }
13776
14386
  }
13777
14387
  ) : (
@@ -13786,13 +14396,26 @@ var require_axios = __commonJS({
13786
14396
  }
13787
14397
  }
13788
14398
  );
13789
- var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
14399
+ var headersToObject = (thing) => thing instanceof AxiosHeaders ? {
14400
+ ...thing
14401
+ } : thing;
13790
14402
  function mergeConfig(config1, config2) {
13791
14403
  config2 = config2 || {};
13792
- const config = {};
14404
+ const config = /* @__PURE__ */ Object.create(null);
14405
+ Object.defineProperty(config, "hasOwnProperty", {
14406
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
14407
+ // this data descriptor into an accessor descriptor on the way in.
14408
+ __proto__: null,
14409
+ value: Object.prototype.hasOwnProperty,
14410
+ enumerable: false,
14411
+ writable: true,
14412
+ configurable: true
14413
+ });
13793
14414
  function getMergedValue(target, source, prop, caseless) {
13794
14415
  if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
13795
- return utils$1.merge.call({ caseless }, target, source);
14416
+ return utils$1.merge.call({
14417
+ caseless
14418
+ }, target, source);
13796
14419
  } else if (utils$1.isPlainObject(source)) {
13797
14420
  return utils$1.merge({}, source);
13798
14421
  } else if (utils$1.isArray(source)) {
@@ -13820,9 +14443,9 @@ var require_axios = __commonJS({
13820
14443
  }
13821
14444
  }
13822
14445
  function mergeDirectKeys(a, b, prop) {
13823
- if (prop in config2) {
14446
+ if (utils$1.hasOwnProp(config2, prop)) {
13824
14447
  return getMergedValue(a, b);
13825
- } else if (prop in config1) {
14448
+ } else if (utils$1.hasOwnProp(config1, prop)) {
13826
14449
  return getMergedValue(void 0, a);
13827
14450
  }
13828
14451
  }
@@ -13853,40 +14476,67 @@ var require_axios = __commonJS({
13853
14476
  httpsAgent: defaultToConfig2,
13854
14477
  cancelToken: defaultToConfig2,
13855
14478
  socketPath: defaultToConfig2,
14479
+ allowedSocketPaths: defaultToConfig2,
13856
14480
  responseEncoding: defaultToConfig2,
13857
14481
  validateStatus: mergeDirectKeys,
13858
14482
  headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
13859
14483
  };
13860
- utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
13861
- const merge2 = mergeMap[prop] || mergeDeepProperties;
13862
- const configValue = merge2(config1[prop], config2[prop], prop);
14484
+ utils$1.forEach(Object.keys({
14485
+ ...config1,
14486
+ ...config2
14487
+ }), function computeConfigValue(prop) {
14488
+ if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
14489
+ const merge2 = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
14490
+ const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : void 0;
14491
+ const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : void 0;
14492
+ const configValue = merge2(a, b, prop);
13863
14493
  utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
13864
14494
  });
13865
14495
  return config;
13866
14496
  }
14497
+ var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
14498
+ function setFormDataHeaders(headers, formHeaders, policy) {
14499
+ if (policy !== "content-only") {
14500
+ headers.set(formHeaders);
14501
+ return;
14502
+ }
14503
+ Object.entries(formHeaders).forEach(([key, val]) => {
14504
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
14505
+ headers.set(key, val);
14506
+ }
14507
+ });
14508
+ }
14509
+ var encodeUTF8 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
13867
14510
  var resolveConfig = (config) => {
13868
14511
  const newConfig = mergeConfig({}, config);
13869
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
13870
- newConfig.headers = headers = AxiosHeaders$1.from(headers);
13871
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
14512
+ const own2 = (key) => utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : void 0;
14513
+ const data = own2("data");
14514
+ let withXSRFToken = own2("withXSRFToken");
14515
+ const xsrfHeaderName = own2("xsrfHeaderName");
14516
+ const xsrfCookieName = own2("xsrfCookieName");
14517
+ let headers = own2("headers");
14518
+ const auth = own2("auth");
14519
+ const baseURL = own2("baseURL");
14520
+ const allowAbsoluteUrls = own2("allowAbsoluteUrls");
14521
+ const url2 = own2("url");
14522
+ newConfig.headers = headers = AxiosHeaders.from(headers);
14523
+ newConfig.url = buildURL(buildFullPath(baseURL, url2, allowAbsoluteUrls), config.params, config.paramsSerializer);
13872
14524
  if (auth) {
13873
- headers.set(
13874
- "Authorization",
13875
- "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
13876
- );
14525
+ headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? encodeUTF8(auth.password) : "")));
13877
14526
  }
13878
- let contentType;
13879
14527
  if (utils$1.isFormData(data)) {
13880
14528
  if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
13881
14529
  headers.setContentType(void 0);
13882
- } else if ((contentType = headers.getContentType()) !== false) {
13883
- const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
13884
- headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
14530
+ } else if (utils$1.isFunction(data.getHeaders)) {
14531
+ setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy"));
13885
14532
  }
13886
14533
  }
13887
14534
  if (platform.hasStandardBrowserEnv) {
13888
- withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
13889
- if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
14535
+ if (utils$1.isFunction(withXSRFToken)) {
14536
+ withXSRFToken = withXSRFToken(newConfig);
14537
+ }
14538
+ const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin(newConfig.url);
14539
+ if (shouldSendXSRF) {
13890
14540
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
13891
14541
  if (xsrfValue) {
13892
14542
  headers.set(xsrfHeaderName, xsrfValue);
@@ -13900,8 +14550,12 @@ var require_axios = __commonJS({
13900
14550
  return new Promise(function dispatchXhrRequest(resolve, reject) {
13901
14551
  const _config = resolveConfig(config);
13902
14552
  let requestData = _config.data;
13903
- const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
13904
- let { responseType, onUploadProgress, onDownloadProgress } = _config;
14553
+ const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
14554
+ let {
14555
+ responseType,
14556
+ onUploadProgress,
14557
+ onDownloadProgress
14558
+ } = _config;
13905
14559
  let onCanceled;
13906
14560
  let uploadThrottled, downloadThrottled;
13907
14561
  let flushUpload, flushDownload;
@@ -13918,9 +14572,7 @@ var require_axios = __commonJS({
13918
14572
  if (!request) {
13919
14573
  return;
13920
14574
  }
13921
- const responseHeaders = AxiosHeaders$1.from(
13922
- "getAllResponseHeaders" in request && request.getAllResponseHeaders()
13923
- );
14575
+ const responseHeaders = AxiosHeaders.from("getAllResponseHeaders" in request && request.getAllResponseHeaders());
13924
14576
  const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
13925
14577
  const response = {
13926
14578
  data: responseData,
@@ -13946,7 +14598,7 @@ var require_axios = __commonJS({
13946
14598
  if (!request || request.readyState !== 4) {
13947
14599
  return;
13948
14600
  }
13949
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
14601
+ if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith("file:"))) {
13950
14602
  return;
13951
14603
  }
13952
14604
  setTimeout(onloadend);
@@ -13957,10 +14609,15 @@ var require_axios = __commonJS({
13957
14609
  return;
13958
14610
  }
13959
14611
  reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request));
14612
+ done();
13960
14613
  request = null;
13961
14614
  };
13962
- request.onerror = function handleError() {
13963
- reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request));
14615
+ request.onerror = function handleError(event) {
14616
+ const msg = event && event.message ? event.message : "Network Error";
14617
+ const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
14618
+ err.event = event || null;
14619
+ reject(err);
14620
+ done();
13964
14621
  request = null;
13965
14622
  };
13966
14623
  request.ontimeout = function handleTimeout() {
@@ -13969,12 +14626,8 @@ var require_axios = __commonJS({
13969
14626
  if (_config.timeoutErrorMessage) {
13970
14627
  timeoutErrorMessage = _config.timeoutErrorMessage;
13971
14628
  }
13972
- reject(new AxiosError(
13973
- timeoutErrorMessage,
13974
- transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
13975
- config,
13976
- request
13977
- ));
14629
+ reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request));
14630
+ done();
13978
14631
  request = null;
13979
14632
  };
13980
14633
  requestData === void 0 && requestHeaders.setContentType(null);
@@ -14005,6 +14658,7 @@ var require_axios = __commonJS({
14005
14658
  }
14006
14659
  reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
14007
14660
  request.abort();
14661
+ done();
14008
14662
  request = null;
14009
14663
  };
14010
14664
  _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
@@ -14013,7 +14667,7 @@ var require_axios = __commonJS({
14013
14667
  }
14014
14668
  }
14015
14669
  const protocol = parseProtocol(_config.url);
14016
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
14670
+ if (protocol && !platform.protocols.includes(protocol)) {
14017
14671
  reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
14018
14672
  return;
14019
14673
  }
@@ -14021,7 +14675,9 @@ var require_axios = __commonJS({
14021
14675
  });
14022
14676
  };
14023
14677
  var composeSignals = (signals, timeout) => {
14024
- const { length } = signals = signals ? signals.filter(Boolean) : [];
14678
+ const {
14679
+ length
14680
+ } = signals = signals ? signals.filter(Boolean) : [];
14025
14681
  if (timeout || length) {
14026
14682
  let controller = new AbortController();
14027
14683
  let aborted;
@@ -14035,7 +14691,7 @@ var require_axios = __commonJS({
14035
14691
  };
14036
14692
  let timer = timeout && setTimeout(() => {
14037
14693
  timer = null;
14038
- onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
14694
+ onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
14039
14695
  }, timeout);
14040
14696
  const unsubscribe = () => {
14041
14697
  if (signals) {
@@ -14048,15 +14704,16 @@ var require_axios = __commonJS({
14048
14704
  }
14049
14705
  };
14050
14706
  signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
14051
- const { signal } = controller;
14707
+ const {
14708
+ signal
14709
+ } = controller;
14052
14710
  signal.unsubscribe = () => utils$1.asap(unsubscribe);
14053
14711
  return signal;
14054
14712
  }
14055
14713
  };
14056
- var composeSignals$1 = composeSignals;
14057
14714
  var streamChunk = function* (chunk, chunkSize) {
14058
14715
  let len = chunk.byteLength;
14059
- if (!chunkSize || len < chunkSize) {
14716
+ if (len < chunkSize) {
14060
14717
  yield chunk;
14061
14718
  return;
14062
14719
  }
@@ -14081,7 +14738,10 @@ var require_axios = __commonJS({
14081
14738
  const reader = stream2.getReader();
14082
14739
  try {
14083
14740
  for (; ; ) {
14084
- const { done, value } = await reader.read();
14741
+ const {
14742
+ done,
14743
+ value
14744
+ } = await reader.read();
14085
14745
  if (done) {
14086
14746
  break;
14087
14747
  }
@@ -14104,7 +14764,10 @@ var require_axios = __commonJS({
14104
14764
  return new ReadableStream({
14105
14765
  async pull(controller) {
14106
14766
  try {
14107
- const { done: done2, value } = await iterator2.next();
14767
+ const {
14768
+ done: done2,
14769
+ value
14770
+ } = await iterator2.next();
14108
14771
  if (done2) {
14109
14772
  _onFinish();
14110
14773
  controller.close();
@@ -14129,9 +14792,10 @@ var require_axios = __commonJS({
14129
14792
  highWaterMark: 2
14130
14793
  });
14131
14794
  };
14132
- var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
14133
- var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
14134
- var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
14795
+ var DEFAULT_CHUNK_SIZE = 64 * 1024;
14796
+ var {
14797
+ isFunction
14798
+ } = utils$1;
14135
14799
  var test = (fn, ...args) => {
14136
14800
  try {
14137
14801
  return !!fn(...args);
@@ -14139,208 +14803,326 @@ var require_axios = __commonJS({
14139
14803
  return false;
14140
14804
  }
14141
14805
  };
14142
- var supportsRequestStream = isReadableStreamSupported && test(() => {
14143
- let duplexAccessed = false;
14144
- const hasContentType = new Request(platform.origin, {
14145
- body: new ReadableStream(),
14146
- method: "POST",
14147
- get duplex() {
14148
- duplexAccessed = true;
14149
- return "half";
14150
- }
14151
- }).headers.has("Content-Type");
14152
- return duplexAccessed && !hasContentType;
14153
- });
14154
- var DEFAULT_CHUNK_SIZE = 64 * 1024;
14155
- var supportsResponseStream = isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
14156
- var resolvers = {
14157
- stream: supportsResponseStream && ((res) => res.body)
14158
- };
14159
- isFetchSupported && ((res) => {
14160
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
14161
- !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
14162
- throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
14163
- });
14164
- });
14165
- })(new Response());
14166
- var getBodyLength = async (body) => {
14167
- if (body == null) {
14168
- return 0;
14169
- }
14170
- if (utils$1.isBlob(body)) {
14171
- return body.size;
14806
+ var factory = (env) => {
14807
+ var _utils$global;
14808
+ const globalObject = (_utils$global = utils$1.global) !== null && _utils$global !== void 0 ? _utils$global : globalThis;
14809
+ const {
14810
+ ReadableStream: ReadableStream2,
14811
+ TextEncoder: TextEncoder2
14812
+ } = globalObject;
14813
+ env = utils$1.merge.call({
14814
+ skipUndefined: true
14815
+ }, {
14816
+ Request: globalObject.Request,
14817
+ Response: globalObject.Response
14818
+ }, env);
14819
+ const {
14820
+ fetch: envFetch,
14821
+ Request,
14822
+ Response
14823
+ } = env;
14824
+ const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
14825
+ const isRequestSupported = isFunction(Request);
14826
+ const isResponseSupported = isFunction(Response);
14827
+ if (!isFetchSupported) {
14828
+ return false;
14172
14829
  }
14173
- if (utils$1.isSpecCompliantForm(body)) {
14174
- const _request = new Request(platform.origin, {
14830
+ const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream2);
14831
+ const encodeText = isFetchSupported && (typeof TextEncoder2 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder2()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
14832
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
14833
+ let duplexAccessed = false;
14834
+ const request = new Request(platform.origin, {
14835
+ body: new ReadableStream2(),
14175
14836
  method: "POST",
14176
- body
14837
+ get duplex() {
14838
+ duplexAccessed = true;
14839
+ return "half";
14840
+ }
14177
14841
  });
14178
- return (await _request.arrayBuffer()).byteLength;
14179
- }
14180
- if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
14181
- return body.byteLength;
14182
- }
14183
- if (utils$1.isURLSearchParams(body)) {
14184
- body = body + "";
14185
- }
14186
- if (utils$1.isString(body)) {
14187
- return (await encodeText(body)).byteLength;
14188
- }
14189
- };
14190
- var resolveBodyLength = async (headers, body) => {
14191
- const length = utils$1.toFiniteNumber(headers.getContentLength());
14192
- return length == null ? getBodyLength(body) : length;
14193
- };
14194
- var fetchAdapter = isFetchSupported && (async (config) => {
14195
- let {
14196
- url: url2,
14197
- method,
14198
- data,
14199
- signal,
14200
- cancelToken,
14201
- timeout,
14202
- onDownloadProgress,
14203
- onUploadProgress,
14204
- responseType,
14205
- headers,
14206
- withCredentials = "same-origin",
14207
- fetchOptions
14208
- } = resolveConfig(config);
14209
- responseType = responseType ? (responseType + "").toLowerCase() : "text";
14210
- let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
14211
- let request;
14212
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
14213
- composedSignal.unsubscribe();
14842
+ const hasContentType = request.headers.has("Content-Type");
14843
+ if (request.body != null) {
14844
+ request.body.cancel();
14845
+ }
14846
+ return duplexAccessed && !hasContentType;
14214
14847
  });
14215
- let requestContentLength;
14216
- try {
14217
- if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
14218
- let _request = new Request(url2, {
14848
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
14849
+ const resolvers = {
14850
+ stream: supportsResponseStream && ((res) => res.body)
14851
+ };
14852
+ isFetchSupported && (() => {
14853
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
14854
+ !resolvers[type] && (resolvers[type] = (res, config) => {
14855
+ let method = res && res[type];
14856
+ if (method) {
14857
+ return method.call(res);
14858
+ }
14859
+ throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
14860
+ });
14861
+ });
14862
+ })();
14863
+ const getBodyLength = async (body) => {
14864
+ if (body == null) {
14865
+ return 0;
14866
+ }
14867
+ if (utils$1.isBlob(body)) {
14868
+ return body.size;
14869
+ }
14870
+ if (utils$1.isSpecCompliantForm(body)) {
14871
+ const _request = new Request(platform.origin, {
14219
14872
  method: "POST",
14220
- body: data,
14221
- duplex: "half"
14873
+ body
14222
14874
  });
14223
- let contentTypeHeader;
14224
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
14225
- headers.setContentType(contentTypeHeader);
14226
- }
14227
- if (_request.body) {
14228
- const [onProgress, flush] = progressEventDecorator(
14229
- requestContentLength,
14230
- progressEventReducer(asyncDecorator(onUploadProgress))
14231
- );
14232
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
14233
- }
14875
+ return (await _request.arrayBuffer()).byteLength;
14876
+ }
14877
+ if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
14878
+ return body.byteLength;
14234
14879
  }
14235
- if (!utils$1.isString(withCredentials)) {
14236
- withCredentials = withCredentials ? "include" : "omit";
14237
- }
14238
- const isCredentialsSupported = "credentials" in Request.prototype;
14239
- request = new Request(url2, {
14240
- ...fetchOptions,
14241
- signal: composedSignal,
14242
- method: method.toUpperCase(),
14243
- headers: headers.normalize().toJSON(),
14244
- body: data,
14245
- duplex: "half",
14246
- credentials: isCredentialsSupported ? withCredentials : void 0
14880
+ if (utils$1.isURLSearchParams(body)) {
14881
+ body = body + "";
14882
+ }
14883
+ if (utils$1.isString(body)) {
14884
+ return (await encodeText(body)).byteLength;
14885
+ }
14886
+ };
14887
+ const resolveBodyLength = async (headers, body) => {
14888
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
14889
+ return length == null ? getBodyLength(body) : length;
14890
+ };
14891
+ return async (config) => {
14892
+ let {
14893
+ url: url2,
14894
+ method,
14895
+ data,
14896
+ signal,
14897
+ cancelToken,
14898
+ timeout,
14899
+ onDownloadProgress,
14900
+ onUploadProgress,
14901
+ responseType,
14902
+ headers,
14903
+ withCredentials = "same-origin",
14904
+ fetchOptions,
14905
+ maxContentLength,
14906
+ maxBodyLength
14907
+ } = resolveConfig(config);
14908
+ const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
14909
+ const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
14910
+ let _fetch = envFetch || fetch;
14911
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
14912
+ let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
14913
+ let request = null;
14914
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
14915
+ composedSignal.unsubscribe();
14247
14916
  });
14248
- let response = await fetch(request, fetchOptions);
14249
- const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
14250
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
14251
- const options = {};
14252
- ["status", "statusText", "headers"].forEach((prop) => {
14253
- options[prop] = response[prop];
14254
- });
14255
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
14256
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
14257
- responseContentLength,
14258
- progressEventReducer(asyncDecorator(onDownloadProgress), true)
14259
- ) || [];
14260
- response = new Response(
14261
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
14917
+ let requestContentLength;
14918
+ try {
14919
+ if (hasMaxContentLength && typeof url2 === "string" && url2.startsWith("data:")) {
14920
+ const estimated = estimateDataURLDecodedBytes(url2);
14921
+ if (estimated > maxContentLength) {
14922
+ throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
14923
+ }
14924
+ }
14925
+ if (hasMaxBodyLength && method !== "get" && method !== "head") {
14926
+ const outboundLength = await resolveBodyLength(headers, data);
14927
+ if (typeof outboundLength === "number" && isFinite(outboundLength) && outboundLength > maxBodyLength) {
14928
+ throw new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config, request);
14929
+ }
14930
+ }
14931
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
14932
+ let _request = new Request(url2, {
14933
+ method: "POST",
14934
+ body: data,
14935
+ duplex: "half"
14936
+ });
14937
+ let contentTypeHeader;
14938
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
14939
+ headers.setContentType(contentTypeHeader);
14940
+ }
14941
+ if (_request.body) {
14942
+ const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)));
14943
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
14944
+ }
14945
+ }
14946
+ if (!utils$1.isString(withCredentials)) {
14947
+ withCredentials = withCredentials ? "include" : "omit";
14948
+ }
14949
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
14950
+ if (utils$1.isFormData(data)) {
14951
+ const contentType = headers.getContentType();
14952
+ if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) {
14953
+ headers.delete("content-type");
14954
+ }
14955
+ }
14956
+ headers.set("User-Agent", "axios/" + VERSION, false);
14957
+ const resolvedOptions = {
14958
+ ...fetchOptions,
14959
+ signal: composedSignal,
14960
+ method: method.toUpperCase(),
14961
+ headers: headers.normalize().toJSON(),
14962
+ body: data,
14963
+ duplex: "half",
14964
+ credentials: isCredentialsSupported ? withCredentials : void 0
14965
+ };
14966
+ request = isRequestSupported && new Request(url2, resolvedOptions);
14967
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions));
14968
+ if (hasMaxContentLength) {
14969
+ const declaredLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
14970
+ if (declaredLength != null && declaredLength > maxContentLength) {
14971
+ throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
14972
+ }
14973
+ }
14974
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
14975
+ if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) {
14976
+ const options = {};
14977
+ ["status", "statusText", "headers"].forEach((prop) => {
14978
+ options[prop] = response[prop];
14979
+ });
14980
+ const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
14981
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
14982
+ let bytesRead = 0;
14983
+ const onChunkProgress = (loadedBytes) => {
14984
+ if (hasMaxContentLength) {
14985
+ bytesRead = loadedBytes;
14986
+ if (bytesRead > maxContentLength) {
14987
+ throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
14988
+ }
14989
+ }
14990
+ onProgress && onProgress(loadedBytes);
14991
+ };
14992
+ response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
14262
14993
  flush && flush();
14263
14994
  unsubscribe && unsubscribe();
14264
- }),
14265
- options
14266
- );
14267
- }
14268
- responseType = responseType || "text";
14269
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
14270
- !isStreamResponse && unsubscribe && unsubscribe();
14271
- return await new Promise((resolve, reject) => {
14272
- settle(resolve, reject, {
14273
- data: responseData,
14274
- headers: AxiosHeaders$1.from(response.headers),
14275
- status: response.status,
14276
- statusText: response.statusText,
14277
- config,
14278
- request
14995
+ }), options);
14996
+ }
14997
+ responseType = responseType || "text";
14998
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
14999
+ if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
15000
+ let materializedSize;
15001
+ if (responseData != null) {
15002
+ if (typeof responseData.byteLength === "number") {
15003
+ materializedSize = responseData.byteLength;
15004
+ } else if (typeof responseData.size === "number") {
15005
+ materializedSize = responseData.size;
15006
+ } else if (typeof responseData === "string") {
15007
+ materializedSize = typeof TextEncoder2 === "function" ? new TextEncoder2().encode(responseData).byteLength : responseData.length;
15008
+ }
15009
+ }
15010
+ if (typeof materializedSize === "number" && materializedSize > maxContentLength) {
15011
+ throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
15012
+ }
15013
+ }
15014
+ !isStreamResponse && unsubscribe && unsubscribe();
15015
+ return await new Promise((resolve, reject) => {
15016
+ settle(resolve, reject, {
15017
+ data: responseData,
15018
+ headers: AxiosHeaders.from(response.headers),
15019
+ status: response.status,
15020
+ statusText: response.statusText,
15021
+ config,
15022
+ request
15023
+ });
14279
15024
  });
14280
- });
14281
- } catch (err) {
14282
- unsubscribe && unsubscribe();
14283
- if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
14284
- throw Object.assign(
14285
- new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request),
14286
- {
15025
+ } catch (err) {
15026
+ unsubscribe && unsubscribe();
15027
+ if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {
15028
+ const canceledError = composedSignal.reason;
15029
+ canceledError.config = config;
15030
+ request && (canceledError.request = request);
15031
+ err !== canceledError && (canceledError.cause = err);
15032
+ throw canceledError;
15033
+ }
15034
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
15035
+ throw Object.assign(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, err && err.response), {
14287
15036
  cause: err.cause || err
14288
- }
14289
- );
15037
+ });
15038
+ }
15039
+ throw AxiosError.from(err, err && err.code, config, request, err && err.response);
14290
15040
  }
14291
- throw AxiosError.from(err, err && err.code, config, request);
14292
- }
14293
- });
15041
+ };
15042
+ };
15043
+ var seedCache = /* @__PURE__ */ new Map();
15044
+ var getFetch = (config) => {
15045
+ let env = config && config.env || {};
15046
+ const {
15047
+ fetch: fetch2,
15048
+ Request,
15049
+ Response
15050
+ } = env;
15051
+ const seeds = [Request, Response, fetch2];
15052
+ let len = seeds.length, i = len, seed, target, map = seedCache;
15053
+ while (i--) {
15054
+ seed = seeds[i];
15055
+ target = map.get(seed);
15056
+ target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
15057
+ map = target;
15058
+ }
15059
+ return target;
15060
+ };
15061
+ getFetch();
14294
15062
  var knownAdapters = {
14295
15063
  http: httpAdapter,
14296
15064
  xhr: xhrAdapter,
14297
- fetch: fetchAdapter
15065
+ fetch: {
15066
+ get: getFetch
15067
+ }
14298
15068
  };
14299
15069
  utils$1.forEach(knownAdapters, (fn, value) => {
14300
15070
  if (fn) {
14301
15071
  try {
14302
- Object.defineProperty(fn, "name", { value });
15072
+ Object.defineProperty(fn, "name", {
15073
+ __proto__: null,
15074
+ value
15075
+ });
14303
15076
  } catch (e) {
14304
15077
  }
14305
- Object.defineProperty(fn, "adapterName", { value });
15078
+ Object.defineProperty(fn, "adapterName", {
15079
+ __proto__: null,
15080
+ value
15081
+ });
14306
15082
  }
14307
15083
  });
14308
15084
  var renderReason = (reason) => `- ${reason}`;
14309
15085
  var isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
14310
- var adapters = {
14311
- getAdapter: (adapters2) => {
14312
- adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
14313
- const { length } = adapters2;
14314
- let nameOrAdapter;
14315
- let adapter;
14316
- const rejectedReasons = {};
14317
- for (let i = 0; i < length; i++) {
14318
- nameOrAdapter = adapters2[i];
14319
- let id;
14320
- adapter = nameOrAdapter;
14321
- if (!isResolvedHandle(nameOrAdapter)) {
14322
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
14323
- if (adapter === void 0) {
14324
- throw new AxiosError(`Unknown adapter '${id}'`);
14325
- }
14326
- }
14327
- if (adapter) {
14328
- break;
15086
+ function getAdapter(adapters2, config) {
15087
+ adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
15088
+ const {
15089
+ length
15090
+ } = adapters2;
15091
+ let nameOrAdapter;
15092
+ let adapter;
15093
+ const rejectedReasons = {};
15094
+ for (let i = 0; i < length; i++) {
15095
+ nameOrAdapter = adapters2[i];
15096
+ let id;
15097
+ adapter = nameOrAdapter;
15098
+ if (!isResolvedHandle(nameOrAdapter)) {
15099
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
15100
+ if (adapter === void 0) {
15101
+ throw new AxiosError(`Unknown adapter '${id}'`);
14329
15102
  }
14330
- rejectedReasons[id || "#" + i] = adapter;
14331
15103
  }
14332
- if (!adapter) {
14333
- const reasons = Object.entries(rejectedReasons).map(
14334
- ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
14335
- );
14336
- let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
14337
- throw new AxiosError(
14338
- `There is no suitable adapter to dispatch the request ` + s,
14339
- "ERR_NOT_SUPPORT"
14340
- );
15104
+ if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
15105
+ break;
14341
15106
  }
14342
- return adapter;
14343
- },
15107
+ rejectedReasons[id || "#" + i] = adapter;
15108
+ }
15109
+ if (!adapter) {
15110
+ const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build"));
15111
+ let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
15112
+ throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, "ERR_NOT_SUPPORT");
15113
+ }
15114
+ return adapter;
15115
+ }
15116
+ var adapters = {
15117
+ /**
15118
+ * Resolve an adapter from a list of adapter names or functions.
15119
+ * @type {Function}
15120
+ */
15121
+ getAdapter,
15122
+ /**
15123
+ * Exposes all known adapters
15124
+ * @type {Object<string, Function|Object>}
15125
+ */
14344
15126
  adapters: knownAdapters
14345
15127
  };
14346
15128
  function throwIfCancellationRequested(config) {
@@ -14353,34 +15135,33 @@ var require_axios = __commonJS({
14353
15135
  }
14354
15136
  function dispatchRequest(config) {
14355
15137
  throwIfCancellationRequested(config);
14356
- config.headers = AxiosHeaders$1.from(config.headers);
14357
- config.data = transformData.call(
14358
- config,
14359
- config.transformRequest
14360
- );
15138
+ config.headers = AxiosHeaders.from(config.headers);
15139
+ config.data = transformData.call(config, config.transformRequest);
14361
15140
  if (["post", "put", "patch"].indexOf(config.method) !== -1) {
14362
15141
  config.headers.setContentType("application/x-www-form-urlencoded", false);
14363
15142
  }
14364
- const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
15143
+ const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
14365
15144
  return adapter(config).then(function onAdapterResolution(response) {
14366
15145
  throwIfCancellationRequested(config);
14367
- response.data = transformData.call(
14368
- config,
14369
- config.transformResponse,
14370
- response
14371
- );
14372
- response.headers = AxiosHeaders$1.from(response.headers);
15146
+ config.response = response;
15147
+ try {
15148
+ response.data = transformData.call(config, config.transformResponse, response);
15149
+ } finally {
15150
+ delete config.response;
15151
+ }
15152
+ response.headers = AxiosHeaders.from(response.headers);
14373
15153
  return response;
14374
15154
  }, function onAdapterRejection(reason) {
14375
15155
  if (!isCancel(reason)) {
14376
15156
  throwIfCancellationRequested(config);
14377
15157
  if (reason && reason.response) {
14378
- reason.response.data = transformData.call(
14379
- config,
14380
- config.transformResponse,
14381
- reason.response
14382
- );
14383
- reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
15158
+ config.response = reason.response;
15159
+ try {
15160
+ reason.response.data = transformData.call(config, config.transformResponse, reason.response);
15161
+ } finally {
15162
+ delete config.response;
15163
+ }
15164
+ reason.response.headers = AxiosHeaders.from(reason.response.headers);
14384
15165
  }
14385
15166
  }
14386
15167
  return Promise.reject(reason);
@@ -14399,19 +15180,11 @@ var require_axios = __commonJS({
14399
15180
  }
14400
15181
  return (value, opt, opts) => {
14401
15182
  if (validator2 === false) {
14402
- throw new AxiosError(
14403
- formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
14404
- AxiosError.ERR_DEPRECATED
14405
- );
15183
+ throw new AxiosError(formatMessage(opt, " has been removed" + (version ? " in " + version : "")), AxiosError.ERR_DEPRECATED);
14406
15184
  }
14407
15185
  if (version && !deprecatedWarnings[opt]) {
14408
15186
  deprecatedWarnings[opt] = true;
14409
- console.warn(
14410
- formatMessage(
14411
- opt,
14412
- " has been deprecated since v" + version + " and will be removed in the near future"
14413
- )
14414
- );
15187
+ console.warn(formatMessage(opt, " has been deprecated since v" + version + " and will be removed in the near future"));
14415
15188
  }
14416
15189
  return validator2 ? validator2(value, opt, opts) : true;
14417
15190
  };
@@ -14430,7 +15203,7 @@ var require_axios = __commonJS({
14430
15203
  let i = keys.length;
14431
15204
  while (i-- > 0) {
14432
15205
  const opt = keys[i];
14433
- const validator2 = schema[opt];
15206
+ const validator2 = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : void 0;
14434
15207
  if (validator2) {
14435
15208
  const value = options[opt];
14436
15209
  const result = value === void 0 || validator2(value, opt, options);
@@ -14453,8 +15226,8 @@ var require_axios = __commonJS({
14453
15226
  constructor(instanceConfig) {
14454
15227
  this.defaults = instanceConfig || {};
14455
15228
  this.interceptors = {
14456
- request: new InterceptorManager$1(),
14457
- response: new InterceptorManager$1()
15229
+ request: new InterceptorManager(),
15230
+ response: new InterceptorManager()
14458
15231
  };
14459
15232
  }
14460
15233
  /**
@@ -14472,12 +15245,23 @@ var require_axios = __commonJS({
14472
15245
  if (err instanceof Error) {
14473
15246
  let dummy = {};
14474
15247
  Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
14475
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
15248
+ const stack = (() => {
15249
+ if (!dummy.stack) {
15250
+ return "";
15251
+ }
15252
+ const firstNewlineIndex = dummy.stack.indexOf("\n");
15253
+ return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1);
15254
+ })();
14476
15255
  try {
14477
15256
  if (!err.stack) {
14478
15257
  err.stack = stack;
14479
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
14480
- err.stack += "\n" + stack;
15258
+ } else if (stack) {
15259
+ const firstNewlineIndex = stack.indexOf("\n");
15260
+ const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf("\n", firstNewlineIndex + 1);
15261
+ const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1);
15262
+ if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
15263
+ err.stack += "\n" + stack;
15264
+ }
14481
15265
  }
14482
15266
  } catch (e) {
14483
15267
  }
@@ -14493,12 +15277,17 @@ var require_axios = __commonJS({
14493
15277
  config = configOrUrl || {};
14494
15278
  }
14495
15279
  config = mergeConfig(this.defaults, config);
14496
- const { transitional, paramsSerializer, headers } = config;
15280
+ const {
15281
+ transitional,
15282
+ paramsSerializer,
15283
+ headers
15284
+ } = config;
14497
15285
  if (transitional !== void 0) {
14498
15286
  validator.assertOptions(transitional, {
14499
15287
  silentJSONParsing: validators.transitional(validators.boolean),
14500
15288
  forcedJSONParsing: validators.transitional(validators.boolean),
14501
- clarifyTimeoutError: validators.transitional(validators.boolean)
15289
+ clarifyTimeoutError: validators.transitional(validators.boolean),
15290
+ legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
14502
15291
  }, false);
14503
15292
  }
14504
15293
  if (paramsSerializer != null) {
@@ -14524,17 +15313,11 @@ var require_axios = __commonJS({
14524
15313
  withXsrfToken: validators.spelling("withXSRFToken")
14525
15314
  }, true);
14526
15315
  config.method = (config.method || this.defaults.method || "get").toLowerCase();
14527
- let contextHeaders = headers && utils$1.merge(
14528
- headers.common,
14529
- headers[config.method]
14530
- );
14531
- headers && utils$1.forEach(
14532
- ["delete", "get", "head", "post", "put", "patch", "common"],
14533
- (method) => {
14534
- delete headers[method];
14535
- }
14536
- );
14537
- config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
15316
+ let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
15317
+ headers && utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (method) => {
15318
+ delete headers[method];
15319
+ });
15320
+ config.headers = AxiosHeaders.concat(contextHeaders, headers);
14538
15321
  const requestInterceptorChain = [];
14539
15322
  let synchronousRequestInterceptors = true;
14540
15323
  this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
@@ -14542,7 +15325,13 @@ var require_axios = __commonJS({
14542
15325
  return;
14543
15326
  }
14544
15327
  synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
14545
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
15328
+ const transitional2 = config.transitional || transitionalDefaults;
15329
+ const legacyInterceptorReqResOrdering = transitional2 && transitional2.legacyInterceptorReqResOrdering;
15330
+ if (legacyInterceptorReqResOrdering) {
15331
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
15332
+ } else {
15333
+ requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
15334
+ }
14546
15335
  });
14547
15336
  const responseInterceptorChain = [];
14548
15337
  this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
@@ -14564,7 +15353,6 @@ var require_axios = __commonJS({
14564
15353
  }
14565
15354
  len = requestInterceptorChain.length;
14566
15355
  let newConfig = config;
14567
- i = 0;
14568
15356
  while (i < len) {
14569
15357
  const onFulfilled = requestInterceptorChain[i++];
14570
15358
  const onRejected = requestInterceptorChain[i++];
@@ -14602,7 +15390,7 @@ var require_axios = __commonJS({
14602
15390
  }));
14603
15391
  };
14604
15392
  });
14605
- utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
15393
+ utils$1.forEach(["post", "put", "patch", "query"], function forEachMethodWithData(method) {
14606
15394
  function generateHTTPMethod(isForm) {
14607
15395
  return function httpMethod(url2, data, config) {
14608
15396
  return this.request(mergeConfig(config || {}, {
@@ -14616,9 +15404,10 @@ var require_axios = __commonJS({
14616
15404
  };
14617
15405
  }
14618
15406
  Axios.prototype[method] = generateHTTPMethod();
14619
- Axios.prototype[method + "Form"] = generateHTTPMethod(true);
15407
+ if (method !== "query") {
15408
+ Axios.prototype[method + "Form"] = generateHTTPMethod(true);
15409
+ }
14620
15410
  });
14621
- var Axios$1 = Axios;
14622
15411
  var CancelToken = class _CancelToken {
14623
15412
  constructor(executor) {
14624
15413
  if (typeof executor !== "function") {
@@ -14714,7 +15503,6 @@ var require_axios = __commonJS({
14714
15503
  };
14715
15504
  }
14716
15505
  };
14717
- var CancelToken$1 = CancelToken;
14718
15506
  function spread(callback) {
14719
15507
  return function wrap(arr) {
14720
15508
  return callback.apply(null, arr);
@@ -14786,26 +15574,35 @@ var require_axios = __commonJS({
14786
15574
  InsufficientStorage: 507,
14787
15575
  LoopDetected: 508,
14788
15576
  NotExtended: 510,
14789
- NetworkAuthenticationRequired: 511
15577
+ NetworkAuthenticationRequired: 511,
15578
+ WebServerIsDown: 521,
15579
+ ConnectionTimedOut: 522,
15580
+ OriginIsUnreachable: 523,
15581
+ TimeoutOccurred: 524,
15582
+ SslHandshakeFailed: 525,
15583
+ InvalidSslCertificate: 526
14790
15584
  };
14791
15585
  Object.entries(HttpStatusCode).forEach(([key, value]) => {
14792
15586
  HttpStatusCode[value] = key;
14793
15587
  });
14794
- var HttpStatusCode$1 = HttpStatusCode;
14795
15588
  function createInstance(defaultConfig) {
14796
- const context = new Axios$1(defaultConfig);
14797
- const instance = bind(Axios$1.prototype.request, context);
14798
- utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
14799
- utils$1.extend(instance, context, null, { allOwnKeys: true });
15589
+ const context = new Axios(defaultConfig);
15590
+ const instance = bind(Axios.prototype.request, context);
15591
+ utils$1.extend(instance, Axios.prototype, context, {
15592
+ allOwnKeys: true
15593
+ });
15594
+ utils$1.extend(instance, context, null, {
15595
+ allOwnKeys: true
15596
+ });
14800
15597
  instance.create = function create(instanceConfig) {
14801
15598
  return createInstance(mergeConfig(defaultConfig, instanceConfig));
14802
15599
  };
14803
15600
  return instance;
14804
15601
  }
14805
- var axios = createInstance(defaults$1);
14806
- axios.Axios = Axios$1;
15602
+ var axios = createInstance(defaults);
15603
+ axios.Axios = Axios;
14807
15604
  axios.CanceledError = CanceledError;
14808
- axios.CancelToken = CancelToken$1;
15605
+ axios.CancelToken = CancelToken;
14809
15606
  axios.isCancel = isCancel;
14810
15607
  axios.VERSION = VERSION;
14811
15608
  axios.toFormData = toFormData;
@@ -14817,10 +15614,10 @@ var require_axios = __commonJS({
14817
15614
  axios.spread = spread;
14818
15615
  axios.isAxiosError = isAxiosError;
14819
15616
  axios.mergeConfig = mergeConfig;
14820
- axios.AxiosHeaders = AxiosHeaders$1;
15617
+ axios.AxiosHeaders = AxiosHeaders;
14821
15618
  axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
14822
15619
  axios.getAdapter = adapters.getAdapter;
14823
- axios.HttpStatusCode = HttpStatusCode$1;
15620
+ axios.HttpStatusCode = HttpStatusCode;
14824
15621
  axios.default = axios;
14825
15622
  module2.exports = axios;
14826
15623
  }
@@ -21047,6 +21844,40 @@ var require_vs = __commonJS({
21047
21844
  }
21048
21845
  });
21049
21846
 
21847
+ // ../../src/meterian/CanonicalUserId.js
21848
+ var require_CanonicalUserId = __commonJS({
21849
+ "../../src/meterian/CanonicalUserId.js"(exports2, module2) {
21850
+ var fs = require("fs");
21851
+ var path2 = require("path");
21852
+ var os2 = require("os");
21853
+ var log = require_log4js().getLogger("Heidi.CanonicalUserId");
21854
+ var USER_JSON_PATH = path2.join(os2.homedir(), ".meterian", "heidi", "config", "user.json");
21855
+ function getOrCreate(computeFn) {
21856
+ try {
21857
+ const content = fs.readFileSync(USER_JSON_PATH, "utf8");
21858
+ const { canonicalUserId } = JSON.parse(content);
21859
+ if (canonicalUserId && typeof canonicalUserId === "string") {
21860
+ return canonicalUserId;
21861
+ }
21862
+ } catch (_) {
21863
+ }
21864
+ const id = computeFn();
21865
+ if (!id || typeof id !== "string") {
21866
+ log.warn("computeFn returned invalid ID; canonical user ID not persisted");
21867
+ return id;
21868
+ }
21869
+ try {
21870
+ fs.mkdirSync(path2.dirname(USER_JSON_PATH), { recursive: true });
21871
+ fs.writeFileSync(USER_JSON_PATH, JSON.stringify({ canonicalUserId: id }));
21872
+ } catch (e) {
21873
+ log.warn(`Unable to persist canonical user ID: ${e.message}`);
21874
+ }
21875
+ return id;
21876
+ }
21877
+ module2.exports = { getOrCreate };
21878
+ }
21879
+ });
21880
+
21050
21881
  // ../../src/meterian/Auth.js
21051
21882
  var require_Auth = __commonJS({
21052
21883
  "../../src/meterian/Auth.js"(exports2, module2) {
@@ -21058,7 +21889,8 @@ var require_Auth = __commonJS({
21058
21889
  this.token = token;
21059
21890
  if (config != null) {
21060
21891
  const { workspace } = require_vs();
21061
- this.id = workspace.getId();
21892
+ const { getOrCreate } = require_CanonicalUserId();
21893
+ this.id = getOrCreate(() => workspace.getId());
21062
21894
  this.config = config;
21063
21895
  }
21064
21896
  }
@@ -21070,8 +21902,9 @@ var require_Auth = __commonJS({
21070
21902
  const machineId = crypto.createHash("sha256").update(data).digest("hex");
21071
21903
  const username = os2.userInfo().username;
21072
21904
  const usernameHash = crypto.createHash("md5").update(username).digest("hex");
21905
+ const { getOrCreate } = require_CanonicalUserId();
21073
21906
  const auth = new _Auth(null, null);
21074
- auth.id = machineId + ":" + usernameHash;
21907
+ auth.id = getOrCreate(() => machineId + ":" + usernameHash);
21075
21908
  return auth;
21076
21909
  }
21077
21910
  async isAuthenticated() {
@@ -21336,6 +22169,39 @@ var require_check = __commonJS({
21336
22169
  if (ghsa) return ghsa;
21337
22170
  return ids[0] || null;
21338
22171
  }
22172
+ function stripMarkdown(text) {
22173
+ return text.replace(/```[\s\S]*?```/g, "").replace(/`[^`]*`/g, "").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/^#{1,6}\s+/gm, "").replace(/(\*\*|__)([^*_]+?)\1/g, "$2").replace(/(\*|_)([^*_]+?)\1/g, "$2").replace(/^\s*[-*+]\s+/gm, "").replace(/^\s*\d+\.\s+/gm, "").replace(/\n+/g, " ").replace(/\s{2,}/g, " ").trim();
22174
+ }
22175
+ var LINK_TYPE_PRIORITY = ["ANNOUNCE", "NVD", "CVE"];
22176
+ var LINK_URL_PATTERNS = ["github.com/advisories", "osv.dev"];
22177
+ function resolveLink(advisory) {
22178
+ const links = advisory.links || [];
22179
+ if (links.length === 0) return null;
22180
+ for (const type of LINK_TYPE_PRIORITY) {
22181
+ const match = links.find((l) => l.type === type);
22182
+ if (match) return match.url;
22183
+ }
22184
+ for (const pattern of LINK_URL_PATTERNS) {
22185
+ const match = links.find((l) => l.url && l.url.includes(pattern));
22186
+ if (match) return match.url;
22187
+ }
22188
+ return links[0].url || null;
22189
+ }
22190
+ function formatAdvisory(advisory) {
22191
+ const raw = stripMarkdown(advisory.description || "");
22192
+ const description = raw.length > 180 ? raw.slice(0, 180) + "\u2026" : raw;
22193
+ return {
22194
+ id: advisory.id,
22195
+ description,
22196
+ severity: advisory.severity,
22197
+ cvss: advisory.cvss ?? null,
22198
+ cwe: advisory.cwe ?? null,
22199
+ cve: advisory.cve || "",
22200
+ identifiers: advisory.identifiers || [],
22201
+ versionRange: advisory.versionRange || null,
22202
+ link: resolveLink(advisory)
22203
+ };
22204
+ }
21339
22205
  async function run(kiwi, kiwiLanguages, inputJson) {
21340
22206
  const entries = JSON.parse(inputJson);
21341
22207
  const results = await Promise.all(entries.map(async ({ language, name, version }) => {
@@ -21348,13 +22214,13 @@ var require_check = __commonJS({
21348
22214
  const worst = sorted[0];
21349
22215
  const safe = await kiwi.getNextSafe(lang, name, version);
21350
22216
  const safeVersions = [safe.latestPatch, safe.latestMinor, safe.latestMajor].filter(Boolean);
21351
- return { language, name, version, severity: worst.severity, id: resolveId(worst), safeVersions };
22217
+ return { language, name, version, severity: worst.severity, id: resolveId(worst), safeVersions, advisories: advisories.map(formatAdvisory) };
21352
22218
  }));
21353
22219
  const vulnerable = results.filter(Boolean);
21354
22220
  const summary = { total: entries.length, vulnerable: vulnerable.length, clean: entries.length - vulnerable.length };
21355
22221
  process.stdout.write(JSON.stringify({ vulnerable, summary }) + "\n");
21356
22222
  }
21357
- module2.exports = { run, resolveId };
22223
+ module2.exports = { run, resolveId, resolveLink, formatAdvisory, stripMarkdown };
21358
22224
  }
21359
22225
  });
21360
22226
 
@@ -21363,15 +22229,14 @@ var require_package = __commonJS({
21363
22229
  "package.json"(exports2, module2) {
21364
22230
  module2.exports = {
21365
22231
  name: "@meterian/cli",
21366
- version: "0.1.1",
22232
+ version: "0.1.3",
21367
22233
  description: "Meterian security audit CLI \u2014 check open-source dependencies for vulnerabilities",
21368
22234
  bin: {
21369
22235
  meterian: "bin/meterian"
21370
22236
  },
21371
22237
  files: [
21372
22238
  "dist/",
21373
- "bin/",
21374
- "CHANGELOG.md"
22239
+ "bin/"
21375
22240
  ],
21376
22241
  scripts: {
21377
22242
  prepack: "esbuild src/cli.js --bundle --platform=node --external:vscode --outfile=dist/cli.js",
@@ -21491,5 +22356,5 @@ mime-types/index.js:
21491
22356
  *)
21492
22357
 
21493
22358
  axios/dist/node/axios.cjs:
21494
- (*! Axios v1.11.0 Copyright (c) 2025 Matt Zabriskie and contributors *)
22359
+ (*! Axios v1.16.0 Copyright (c) 2026 Matt Zabriskie and contributors *)
21495
22360
  */