@nsshunt/stsuxvue 1.0.121 → 1.0.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stsuxvue.cjs +894 -695
- package/dist/stsuxvue.cjs.map +1 -1
- package/dist/stsuxvue.mjs +894 -695
- package/dist/stsuxvue.mjs.map +1 -1
- package/package.json +12 -12
package/dist/stsuxvue.cjs
CHANGED
|
@@ -9680,9 +9680,9 @@ var isFile = kindOfTest("File");
|
|
|
9680
9680
|
* also have a `name` and `type` attribute to specify filename and content type
|
|
9681
9681
|
*
|
|
9682
9682
|
* @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
|
|
9683
|
-
*
|
|
9683
|
+
*
|
|
9684
9684
|
* @param {*} value The value to test
|
|
9685
|
-
*
|
|
9685
|
+
*
|
|
9686
9686
|
* @returns {boolean} True if value is a React Native Blob, otherwise false
|
|
9687
9687
|
*/
|
|
9688
9688
|
var isReactNativeBlob = (value) => {
|
|
@@ -9691,9 +9691,9 @@ var isReactNativeBlob = (value) => {
|
|
|
9691
9691
|
/**
|
|
9692
9692
|
* Determine if environment is React Native
|
|
9693
9693
|
* ReactNative `FormData` has a non-standard `getParts()` method
|
|
9694
|
-
*
|
|
9694
|
+
*
|
|
9695
9695
|
* @param {*} formData The formData to test
|
|
9696
|
-
*
|
|
9696
|
+
*
|
|
9697
9697
|
* @returns {boolean} True if environment is React Native, otherwise false
|
|
9698
9698
|
*/
|
|
9699
9699
|
var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
|
|
@@ -9710,7 +9710,7 @@ var isBlob = kindOfTest("Blob");
|
|
|
9710
9710
|
*
|
|
9711
9711
|
* @param {*} val The value to test
|
|
9712
9712
|
*
|
|
9713
|
-
* @returns {boolean} True if value is a
|
|
9713
|
+
* @returns {boolean} True if value is a FileList, otherwise false
|
|
9714
9714
|
*/
|
|
9715
9715
|
var isFileList = kindOfTest("FileList");
|
|
9716
9716
|
/**
|
|
@@ -9846,18 +9846,19 @@ var isContextDefined = (context) => !isUndefined(context) && context !== _global
|
|
|
9846
9846
|
*
|
|
9847
9847
|
* @returns {Object} Result of all merge properties
|
|
9848
9848
|
*/
|
|
9849
|
-
function merge() {
|
|
9849
|
+
function merge(...objs) {
|
|
9850
9850
|
const { caseless, skipUndefined } = isContextDefined(this) && this || {};
|
|
9851
9851
|
const result = {};
|
|
9852
9852
|
const assignValue = (val, key) => {
|
|
9853
9853
|
if (key === "__proto__" || key === "constructor" || key === "prototype") return;
|
|
9854
9854
|
const targetKey = caseless && findKey(result, key) || key;
|
|
9855
|
-
|
|
9855
|
+
const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : void 0;
|
|
9856
|
+
if (isPlainObject(existing) && isPlainObject(val)) result[targetKey] = merge(existing, val);
|
|
9856
9857
|
else if (isPlainObject(val)) result[targetKey] = merge({}, val);
|
|
9857
9858
|
else if (isArray(val)) result[targetKey] = val.slice();
|
|
9858
9859
|
else if (!skipUndefined || !isUndefined(val)) result[targetKey] = val;
|
|
9859
9860
|
};
|
|
9860
|
-
for (let i = 0, l =
|
|
9861
|
+
for (let i = 0, l = objs.length; i < l; i++) objs[i] && forEach(objs[i], assignValue);
|
|
9861
9862
|
return result;
|
|
9862
9863
|
}
|
|
9863
9864
|
/**
|
|
@@ -9874,12 +9875,14 @@ function merge() {
|
|
|
9874
9875
|
var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
9875
9876
|
forEach(b, (val, key) => {
|
|
9876
9877
|
if (thisArg && isFunction$1(val)) Object.defineProperty(a, key, {
|
|
9878
|
+
__proto__: null,
|
|
9877
9879
|
value: bind(val, thisArg),
|
|
9878
9880
|
writable: true,
|
|
9879
9881
|
enumerable: true,
|
|
9880
9882
|
configurable: true
|
|
9881
9883
|
});
|
|
9882
9884
|
else Object.defineProperty(a, key, {
|
|
9885
|
+
__proto__: null,
|
|
9883
9886
|
value: val,
|
|
9884
9887
|
writable: true,
|
|
9885
9888
|
enumerable: true,
|
|
@@ -9911,12 +9914,16 @@ var stripBOM = (content) => {
|
|
|
9911
9914
|
var inherits = (constructor, superConstructor, props, descriptors) => {
|
|
9912
9915
|
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
9913
9916
|
Object.defineProperty(constructor.prototype, "constructor", {
|
|
9917
|
+
__proto__: null,
|
|
9914
9918
|
value: constructor,
|
|
9915
9919
|
writable: true,
|
|
9916
9920
|
enumerable: false,
|
|
9917
9921
|
configurable: true
|
|
9918
9922
|
});
|
|
9919
|
-
Object.defineProperty(constructor, "super", {
|
|
9923
|
+
Object.defineProperty(constructor, "super", {
|
|
9924
|
+
__proto__: null,
|
|
9925
|
+
value: superConstructor.prototype
|
|
9926
|
+
});
|
|
9920
9927
|
props && Object.assign(constructor.prototype, props);
|
|
9921
9928
|
};
|
|
9922
9929
|
/**
|
|
@@ -10058,7 +10065,7 @@ var freezeMethods = (obj) => {
|
|
|
10058
10065
|
"arguments",
|
|
10059
10066
|
"caller",
|
|
10060
10067
|
"callee"
|
|
10061
|
-
].
|
|
10068
|
+
].includes(name)) return false;
|
|
10062
10069
|
const value = obj[name];
|
|
10063
10070
|
if (!isFunction$1(value)) return;
|
|
10064
10071
|
descriptor.enumerable = false;
|
|
@@ -10234,177 +10241,496 @@ var utils_default = {
|
|
|
10234
10241
|
isIterable
|
|
10235
10242
|
};
|
|
10236
10243
|
//#endregion
|
|
10237
|
-
//#region node_modules/axios/lib/
|
|
10238
|
-
var
|
|
10239
|
-
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
*/
|
|
10258
|
-
constructor(message, code, config, request, response) {
|
|
10259
|
-
super(message);
|
|
10260
|
-
Object.defineProperty(this, "message", {
|
|
10261
|
-
value: message,
|
|
10262
|
-
enumerable: true,
|
|
10263
|
-
writable: true,
|
|
10264
|
-
configurable: true
|
|
10265
|
-
});
|
|
10266
|
-
this.name = "AxiosError";
|
|
10267
|
-
this.isAxiosError = true;
|
|
10268
|
-
code && (this.code = code);
|
|
10269
|
-
config && (this.config = config);
|
|
10270
|
-
request && (this.request = request);
|
|
10271
|
-
if (response) {
|
|
10272
|
-
this.response = response;
|
|
10273
|
-
this.status = response.status;
|
|
10274
|
-
}
|
|
10275
|
-
}
|
|
10276
|
-
toJSON() {
|
|
10277
|
-
return {
|
|
10278
|
-
message: this.message,
|
|
10279
|
-
name: this.name,
|
|
10280
|
-
description: this.description,
|
|
10281
|
-
number: this.number,
|
|
10282
|
-
fileName: this.fileName,
|
|
10283
|
-
lineNumber: this.lineNumber,
|
|
10284
|
-
columnNumber: this.columnNumber,
|
|
10285
|
-
stack: this.stack,
|
|
10286
|
-
config: utils_default.toJSONObject(this.config),
|
|
10287
|
-
code: this.code,
|
|
10288
|
-
status: this.status
|
|
10289
|
-
};
|
|
10290
|
-
}
|
|
10291
|
-
};
|
|
10292
|
-
AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
10293
|
-
AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
10294
|
-
AxiosError.ECONNABORTED = "ECONNABORTED";
|
|
10295
|
-
AxiosError.ETIMEDOUT = "ETIMEDOUT";
|
|
10296
|
-
AxiosError.ERR_NETWORK = "ERR_NETWORK";
|
|
10297
|
-
AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
10298
|
-
AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
10299
|
-
AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
10300
|
-
AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
10301
|
-
AxiosError.ERR_CANCELED = "ERR_CANCELED";
|
|
10302
|
-
AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
10303
|
-
AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
10304
|
-
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
|
|
10305
|
-
//#endregion
|
|
10306
|
-
//#region node_modules/axios/lib/helpers/toFormData.js
|
|
10244
|
+
//#region node_modules/axios/lib/helpers/parseHeaders.js
|
|
10245
|
+
var ignoreDuplicateOf = utils_default.toObjectSet([
|
|
10246
|
+
"age",
|
|
10247
|
+
"authorization",
|
|
10248
|
+
"content-length",
|
|
10249
|
+
"content-type",
|
|
10250
|
+
"etag",
|
|
10251
|
+
"expires",
|
|
10252
|
+
"from",
|
|
10253
|
+
"host",
|
|
10254
|
+
"if-modified-since",
|
|
10255
|
+
"if-unmodified-since",
|
|
10256
|
+
"last-modified",
|
|
10257
|
+
"location",
|
|
10258
|
+
"max-forwards",
|
|
10259
|
+
"proxy-authorization",
|
|
10260
|
+
"referer",
|
|
10261
|
+
"retry-after",
|
|
10262
|
+
"user-agent"
|
|
10263
|
+
]);
|
|
10307
10264
|
/**
|
|
10308
|
-
*
|
|
10309
|
-
*
|
|
10310
|
-
* @param {string} thing - The object or array to be visited.
|
|
10265
|
+
* Parse headers into an object
|
|
10311
10266
|
*
|
|
10312
|
-
*
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
* It removes the brackets from the end of a string
|
|
10267
|
+
* ```
|
|
10268
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
10269
|
+
* Content-Type: application/json
|
|
10270
|
+
* Connection: keep-alive
|
|
10271
|
+
* Transfer-Encoding: chunked
|
|
10272
|
+
* ```
|
|
10319
10273
|
*
|
|
10320
|
-
* @param {
|
|
10274
|
+
* @param {String} rawHeaders Headers needing to be parsed
|
|
10321
10275
|
*
|
|
10322
|
-
* @returns {
|
|
10276
|
+
* @returns {Object} Headers parsed into an object
|
|
10323
10277
|
*/
|
|
10324
|
-
|
|
10325
|
-
|
|
10278
|
+
var parseHeaders_default = (rawHeaders) => {
|
|
10279
|
+
const parsed = {};
|
|
10280
|
+
let key;
|
|
10281
|
+
let val;
|
|
10282
|
+
let i;
|
|
10283
|
+
rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
|
|
10284
|
+
i = line.indexOf(":");
|
|
10285
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
10286
|
+
val = line.substring(i + 1).trim();
|
|
10287
|
+
if (!key || parsed[key] && ignoreDuplicateOf[key]) return;
|
|
10288
|
+
if (key === "set-cookie") if (parsed[key]) parsed[key].push(val);
|
|
10289
|
+
else parsed[key] = [val];
|
|
10290
|
+
else parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
10291
|
+
});
|
|
10292
|
+
return parsed;
|
|
10293
|
+
};
|
|
10294
|
+
//#endregion
|
|
10295
|
+
//#region node_modules/axios/lib/core/AxiosHeaders.js
|
|
10296
|
+
var $internals = Symbol("internals");
|
|
10297
|
+
var INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
|
|
10298
|
+
function trimSPorHTAB(str) {
|
|
10299
|
+
let start = 0;
|
|
10300
|
+
let end = str.length;
|
|
10301
|
+
while (start < end) {
|
|
10302
|
+
const code = str.charCodeAt(start);
|
|
10303
|
+
if (code !== 9 && code !== 32) break;
|
|
10304
|
+
start += 1;
|
|
10305
|
+
}
|
|
10306
|
+
while (end > start) {
|
|
10307
|
+
const code = str.charCodeAt(end - 1);
|
|
10308
|
+
if (code !== 9 && code !== 32) break;
|
|
10309
|
+
end -= 1;
|
|
10310
|
+
}
|
|
10311
|
+
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
10326
10312
|
}
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
*
|
|
10330
|
-
* @param {string} path - The path to the current key.
|
|
10331
|
-
* @param {string} key - The key of the current object being iterated over.
|
|
10332
|
-
* @param {string} dots - If true, the key will be rendered with dots instead of brackets.
|
|
10333
|
-
*
|
|
10334
|
-
* @returns {string} The path to the current key.
|
|
10335
|
-
*/
|
|
10336
|
-
function renderKey(path, key, dots) {
|
|
10337
|
-
if (!path) return key;
|
|
10338
|
-
return path.concat(key).map(function each(token, i) {
|
|
10339
|
-
token = removeBrackets(token);
|
|
10340
|
-
return !dots && i ? "[" + token + "]" : token;
|
|
10341
|
-
}).join(dots ? "." : "");
|
|
10313
|
+
function normalizeHeader(header) {
|
|
10314
|
+
return header && String(header).trim().toLowerCase();
|
|
10342
10315
|
}
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
*
|
|
10346
|
-
* @param {Array<any>} arr - The array to check
|
|
10347
|
-
*
|
|
10348
|
-
* @returns {boolean}
|
|
10349
|
-
*/
|
|
10350
|
-
function isFlatArray(arr) {
|
|
10351
|
-
return utils_default.isArray(arr) && !arr.some(isVisitable);
|
|
10316
|
+
function sanitizeHeaderValue(str) {
|
|
10317
|
+
return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ""));
|
|
10352
10318
|
}
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
*
|
|
10376
|
-
* @returns
|
|
10377
|
-
*/
|
|
10378
|
-
function toFormData(obj, formData, options) {
|
|
10379
|
-
if (!utils_default.isObject(obj)) throw new TypeError("target must be an object");
|
|
10380
|
-
formData = formData || new FormData();
|
|
10381
|
-
options = utils_default.toFlatObject(options, {
|
|
10382
|
-
metaTokens: true,
|
|
10383
|
-
dots: false,
|
|
10384
|
-
indexes: false
|
|
10385
|
-
}, false, function defined(option, source) {
|
|
10386
|
-
return !utils_default.isUndefined(source[option]);
|
|
10319
|
+
function normalizeValue(value) {
|
|
10320
|
+
if (value === false || value == null) return value;
|
|
10321
|
+
return utils_default.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
|
|
10322
|
+
}
|
|
10323
|
+
function parseTokens(str) {
|
|
10324
|
+
const tokens = Object.create(null);
|
|
10325
|
+
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
10326
|
+
let match;
|
|
10327
|
+
while (match = tokensRE.exec(str)) tokens[match[1]] = match[2];
|
|
10328
|
+
return tokens;
|
|
10329
|
+
}
|
|
10330
|
+
var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
10331
|
+
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
10332
|
+
if (utils_default.isFunction(filter)) return filter.call(this, value, header);
|
|
10333
|
+
if (isHeaderNameFilter) value = header;
|
|
10334
|
+
if (!utils_default.isString(value)) return;
|
|
10335
|
+
if (utils_default.isString(filter)) return value.indexOf(filter) !== -1;
|
|
10336
|
+
if (utils_default.isRegExp(filter)) return filter.test(value);
|
|
10337
|
+
}
|
|
10338
|
+
function formatHeader(header) {
|
|
10339
|
+
return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
10340
|
+
return char.toUpperCase() + str;
|
|
10387
10341
|
});
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
const
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
}
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10342
|
+
}
|
|
10343
|
+
function buildAccessors(obj, header) {
|
|
10344
|
+
const accessorName = utils_default.toCamelCase(" " + header);
|
|
10345
|
+
[
|
|
10346
|
+
"get",
|
|
10347
|
+
"set",
|
|
10348
|
+
"has"
|
|
10349
|
+
].forEach((methodName) => {
|
|
10350
|
+
Object.defineProperty(obj, methodName + accessorName, {
|
|
10351
|
+
__proto__: null,
|
|
10352
|
+
value: function(arg1, arg2, arg3) {
|
|
10353
|
+
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
10354
|
+
},
|
|
10355
|
+
configurable: true
|
|
10356
|
+
});
|
|
10357
|
+
});
|
|
10358
|
+
}
|
|
10359
|
+
var AxiosHeaders = class {
|
|
10360
|
+
constructor(headers) {
|
|
10361
|
+
headers && this.set(headers);
|
|
10362
|
+
}
|
|
10363
|
+
set(header, valueOrRewrite, rewrite) {
|
|
10364
|
+
const self = this;
|
|
10365
|
+
function setHeader(_value, _header, _rewrite) {
|
|
10366
|
+
const lHeader = normalizeHeader(_header);
|
|
10367
|
+
if (!lHeader) throw new Error("header name must be a non-empty string");
|
|
10368
|
+
const key = utils_default.findKey(self, lHeader);
|
|
10369
|
+
if (!key || self[key] === void 0 || _rewrite === true || _rewrite === void 0 && self[key] !== false) self[key || _header] = normalizeValue(_value);
|
|
10370
|
+
}
|
|
10371
|
+
const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
10372
|
+
if (utils_default.isPlainObject(header) || header instanceof this.constructor) setHeaders(header, valueOrRewrite);
|
|
10373
|
+
else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) setHeaders(parseHeaders_default(header), valueOrRewrite);
|
|
10374
|
+
else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
|
|
10375
|
+
let obj = {}, dest, key;
|
|
10376
|
+
for (const entry of header) {
|
|
10377
|
+
if (!utils_default.isArray(entry)) throw TypeError("Object iterator must return a key-value pair");
|
|
10378
|
+
obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
|
|
10379
|
+
}
|
|
10380
|
+
setHeaders(obj, valueOrRewrite);
|
|
10381
|
+
} else header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
10382
|
+
return this;
|
|
10383
|
+
}
|
|
10384
|
+
get(header, parser) {
|
|
10385
|
+
header = normalizeHeader(header);
|
|
10386
|
+
if (header) {
|
|
10387
|
+
const key = utils_default.findKey(this, header);
|
|
10388
|
+
if (key) {
|
|
10389
|
+
const value = this[key];
|
|
10390
|
+
if (!parser) return value;
|
|
10391
|
+
if (parser === true) return parseTokens(value);
|
|
10392
|
+
if (utils_default.isFunction(parser)) return parser.call(this, value, key);
|
|
10393
|
+
if (utils_default.isRegExp(parser)) return parser.exec(value);
|
|
10394
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
10395
|
+
}
|
|
10396
|
+
}
|
|
10397
|
+
}
|
|
10398
|
+
has(header, matcher) {
|
|
10399
|
+
header = normalizeHeader(header);
|
|
10400
|
+
if (header) {
|
|
10401
|
+
const key = utils_default.findKey(this, header);
|
|
10402
|
+
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
10403
|
+
}
|
|
10404
|
+
return false;
|
|
10405
|
+
}
|
|
10406
|
+
delete(header, matcher) {
|
|
10407
|
+
const self = this;
|
|
10408
|
+
let deleted = false;
|
|
10409
|
+
function deleteHeader(_header) {
|
|
10410
|
+
_header = normalizeHeader(_header);
|
|
10411
|
+
if (_header) {
|
|
10412
|
+
const key = utils_default.findKey(self, _header);
|
|
10413
|
+
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
|
10414
|
+
delete self[key];
|
|
10415
|
+
deleted = true;
|
|
10416
|
+
}
|
|
10417
|
+
}
|
|
10418
|
+
}
|
|
10419
|
+
if (utils_default.isArray(header)) header.forEach(deleteHeader);
|
|
10420
|
+
else deleteHeader(header);
|
|
10421
|
+
return deleted;
|
|
10422
|
+
}
|
|
10423
|
+
clear(matcher) {
|
|
10424
|
+
const keys = Object.keys(this);
|
|
10425
|
+
let i = keys.length;
|
|
10426
|
+
let deleted = false;
|
|
10427
|
+
while (i--) {
|
|
10428
|
+
const key = keys[i];
|
|
10429
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
10430
|
+
delete this[key];
|
|
10431
|
+
deleted = true;
|
|
10432
|
+
}
|
|
10433
|
+
}
|
|
10434
|
+
return deleted;
|
|
10435
|
+
}
|
|
10436
|
+
normalize(format) {
|
|
10437
|
+
const self = this;
|
|
10438
|
+
const headers = {};
|
|
10439
|
+
utils_default.forEach(this, (value, header) => {
|
|
10440
|
+
const key = utils_default.findKey(headers, header);
|
|
10441
|
+
if (key) {
|
|
10442
|
+
self[key] = normalizeValue(value);
|
|
10443
|
+
delete self[header];
|
|
10444
|
+
return;
|
|
10445
|
+
}
|
|
10446
|
+
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
10447
|
+
if (normalized !== header) delete self[header];
|
|
10448
|
+
self[normalized] = normalizeValue(value);
|
|
10449
|
+
headers[normalized] = true;
|
|
10450
|
+
});
|
|
10451
|
+
return this;
|
|
10452
|
+
}
|
|
10453
|
+
concat(...targets) {
|
|
10454
|
+
return this.constructor.concat(this, ...targets);
|
|
10455
|
+
}
|
|
10456
|
+
toJSON(asStrings) {
|
|
10457
|
+
const obj = Object.create(null);
|
|
10458
|
+
utils_default.forEach(this, (value, header) => {
|
|
10459
|
+
value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
|
|
10460
|
+
});
|
|
10461
|
+
return obj;
|
|
10462
|
+
}
|
|
10463
|
+
[Symbol.iterator]() {
|
|
10464
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
10465
|
+
}
|
|
10466
|
+
toString() {
|
|
10467
|
+
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
10468
|
+
}
|
|
10469
|
+
getSetCookie() {
|
|
10470
|
+
return this.get("set-cookie") || [];
|
|
10471
|
+
}
|
|
10472
|
+
get [Symbol.toStringTag]() {
|
|
10473
|
+
return "AxiosHeaders";
|
|
10474
|
+
}
|
|
10475
|
+
static from(thing) {
|
|
10476
|
+
return thing instanceof this ? thing : new this(thing);
|
|
10477
|
+
}
|
|
10478
|
+
static concat(first, ...targets) {
|
|
10479
|
+
const computed = new this(first);
|
|
10480
|
+
targets.forEach((target) => computed.set(target));
|
|
10481
|
+
return computed;
|
|
10482
|
+
}
|
|
10483
|
+
static accessor(header) {
|
|
10484
|
+
const accessors = (this[$internals] = this[$internals] = { accessors: {} }).accessors;
|
|
10485
|
+
const prototype = this.prototype;
|
|
10486
|
+
function defineAccessor(_header) {
|
|
10487
|
+
const lHeader = normalizeHeader(_header);
|
|
10488
|
+
if (!accessors[lHeader]) {
|
|
10489
|
+
buildAccessors(prototype, _header);
|
|
10490
|
+
accessors[lHeader] = true;
|
|
10491
|
+
}
|
|
10492
|
+
}
|
|
10493
|
+
utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
10494
|
+
return this;
|
|
10495
|
+
}
|
|
10496
|
+
};
|
|
10497
|
+
AxiosHeaders.accessor([
|
|
10498
|
+
"Content-Type",
|
|
10499
|
+
"Content-Length",
|
|
10500
|
+
"Accept",
|
|
10501
|
+
"Accept-Encoding",
|
|
10502
|
+
"User-Agent",
|
|
10503
|
+
"Authorization"
|
|
10504
|
+
]);
|
|
10505
|
+
utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
10506
|
+
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
10507
|
+
return {
|
|
10508
|
+
get: () => value,
|
|
10509
|
+
set(headerValue) {
|
|
10510
|
+
this[mapped] = headerValue;
|
|
10511
|
+
}
|
|
10512
|
+
};
|
|
10513
|
+
});
|
|
10514
|
+
utils_default.freezeMethods(AxiosHeaders);
|
|
10515
|
+
//#endregion
|
|
10516
|
+
//#region node_modules/axios/lib/core/AxiosError.js
|
|
10517
|
+
var REDACTED = "[REDACTED ****]";
|
|
10518
|
+
function hasOwnOrPrototypeToJSON(source) {
|
|
10519
|
+
if (utils_default.hasOwnProp(source, "toJSON")) return true;
|
|
10520
|
+
let prototype = Object.getPrototypeOf(source);
|
|
10521
|
+
while (prototype && prototype !== Object.prototype) {
|
|
10522
|
+
if (utils_default.hasOwnProp(prototype, "toJSON")) return true;
|
|
10523
|
+
prototype = Object.getPrototypeOf(prototype);
|
|
10524
|
+
}
|
|
10525
|
+
return false;
|
|
10526
|
+
}
|
|
10527
|
+
function redactConfig(config, redactKeys) {
|
|
10528
|
+
const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
|
|
10529
|
+
const seen = [];
|
|
10530
|
+
const visit = (source) => {
|
|
10531
|
+
if (source === null || typeof source !== "object") return source;
|
|
10532
|
+
if (utils_default.isBuffer(source)) return source;
|
|
10533
|
+
if (seen.indexOf(source) !== -1) return void 0;
|
|
10534
|
+
if (source instanceof AxiosHeaders) source = source.toJSON();
|
|
10535
|
+
seen.push(source);
|
|
10536
|
+
let result;
|
|
10537
|
+
if (utils_default.isArray(source)) {
|
|
10538
|
+
result = [];
|
|
10539
|
+
source.forEach((v, i) => {
|
|
10540
|
+
const reducedValue = visit(v);
|
|
10541
|
+
if (!utils_default.isUndefined(reducedValue)) result[i] = reducedValue;
|
|
10542
|
+
});
|
|
10543
|
+
} else {
|
|
10544
|
+
if (!utils_default.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
|
|
10545
|
+
seen.pop();
|
|
10546
|
+
return source;
|
|
10547
|
+
}
|
|
10548
|
+
result = Object.create(null);
|
|
10549
|
+
for (const [key, value] of Object.entries(source)) {
|
|
10550
|
+
const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
|
|
10551
|
+
if (!utils_default.isUndefined(reducedValue)) result[key] = reducedValue;
|
|
10552
|
+
}
|
|
10553
|
+
}
|
|
10554
|
+
seen.pop();
|
|
10555
|
+
return result;
|
|
10556
|
+
};
|
|
10557
|
+
return visit(config);
|
|
10558
|
+
}
|
|
10559
|
+
var AxiosError = class AxiosError extends Error {
|
|
10560
|
+
static from(error, code, config, request, response, customProps) {
|
|
10561
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
10562
|
+
axiosError.cause = error;
|
|
10563
|
+
axiosError.name = error.name;
|
|
10564
|
+
if (error.status != null && axiosError.status == null) axiosError.status = error.status;
|
|
10565
|
+
customProps && Object.assign(axiosError, customProps);
|
|
10566
|
+
return axiosError;
|
|
10567
|
+
}
|
|
10568
|
+
/**
|
|
10569
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
10570
|
+
*
|
|
10571
|
+
* @param {string} message The error message.
|
|
10572
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
10573
|
+
* @param {Object} [config] The config.
|
|
10574
|
+
* @param {Object} [request] The request.
|
|
10575
|
+
* @param {Object} [response] The response.
|
|
10576
|
+
*
|
|
10577
|
+
* @returns {Error} The created error.
|
|
10578
|
+
*/
|
|
10579
|
+
constructor(message, code, config, request, response) {
|
|
10580
|
+
super(message);
|
|
10581
|
+
Object.defineProperty(this, "message", {
|
|
10582
|
+
__proto__: null,
|
|
10583
|
+
value: message,
|
|
10584
|
+
enumerable: true,
|
|
10585
|
+
writable: true,
|
|
10586
|
+
configurable: true
|
|
10587
|
+
});
|
|
10588
|
+
this.name = "AxiosError";
|
|
10589
|
+
this.isAxiosError = true;
|
|
10590
|
+
code && (this.code = code);
|
|
10591
|
+
config && (this.config = config);
|
|
10592
|
+
request && (this.request = request);
|
|
10593
|
+
if (response) {
|
|
10594
|
+
this.response = response;
|
|
10595
|
+
this.status = response.status;
|
|
10596
|
+
}
|
|
10597
|
+
}
|
|
10598
|
+
toJSON() {
|
|
10599
|
+
const config = this.config;
|
|
10600
|
+
const redactKeys = config && utils_default.hasOwnProp(config, "redact") ? config.redact : void 0;
|
|
10601
|
+
const serializedConfig = utils_default.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils_default.toJSONObject(config);
|
|
10602
|
+
return {
|
|
10603
|
+
message: this.message,
|
|
10604
|
+
name: this.name,
|
|
10605
|
+
description: this.description,
|
|
10606
|
+
number: this.number,
|
|
10607
|
+
fileName: this.fileName,
|
|
10608
|
+
lineNumber: this.lineNumber,
|
|
10609
|
+
columnNumber: this.columnNumber,
|
|
10610
|
+
stack: this.stack,
|
|
10611
|
+
config: serializedConfig,
|
|
10612
|
+
code: this.code,
|
|
10613
|
+
status: this.status
|
|
10614
|
+
};
|
|
10615
|
+
}
|
|
10616
|
+
};
|
|
10617
|
+
AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
10618
|
+
AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
10619
|
+
AxiosError.ECONNABORTED = "ECONNABORTED";
|
|
10620
|
+
AxiosError.ETIMEDOUT = "ETIMEDOUT";
|
|
10621
|
+
AxiosError.ECONNREFUSED = "ECONNREFUSED";
|
|
10622
|
+
AxiosError.ERR_NETWORK = "ERR_NETWORK";
|
|
10623
|
+
AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
10624
|
+
AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
10625
|
+
AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
10626
|
+
AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
10627
|
+
AxiosError.ERR_CANCELED = "ERR_CANCELED";
|
|
10628
|
+
AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
10629
|
+
AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
10630
|
+
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
|
|
10631
|
+
//#endregion
|
|
10632
|
+
//#region node_modules/axios/lib/helpers/toFormData.js
|
|
10633
|
+
/**
|
|
10634
|
+
* Determines if the given thing is a array or js object.
|
|
10635
|
+
*
|
|
10636
|
+
* @param {string} thing - The object or array to be visited.
|
|
10637
|
+
*
|
|
10638
|
+
* @returns {boolean}
|
|
10639
|
+
*/
|
|
10640
|
+
function isVisitable(thing) {
|
|
10641
|
+
return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
|
|
10642
|
+
}
|
|
10643
|
+
/**
|
|
10644
|
+
* It removes the brackets from the end of a string
|
|
10645
|
+
*
|
|
10646
|
+
* @param {string} key - The key of the parameter.
|
|
10647
|
+
*
|
|
10648
|
+
* @returns {string} the key without the brackets.
|
|
10649
|
+
*/
|
|
10650
|
+
function removeBrackets(key) {
|
|
10651
|
+
return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
10652
|
+
}
|
|
10653
|
+
/**
|
|
10654
|
+
* It takes a path, a key, and a boolean, and returns a string
|
|
10655
|
+
*
|
|
10656
|
+
* @param {string} path - The path to the current key.
|
|
10657
|
+
* @param {string} key - The key of the current object being iterated over.
|
|
10658
|
+
* @param {string} dots - If true, the key will be rendered with dots instead of brackets.
|
|
10659
|
+
*
|
|
10660
|
+
* @returns {string} The path to the current key.
|
|
10661
|
+
*/
|
|
10662
|
+
function renderKey(path, key, dots) {
|
|
10663
|
+
if (!path) return key;
|
|
10664
|
+
return path.concat(key).map(function each(token, i) {
|
|
10665
|
+
token = removeBrackets(token);
|
|
10666
|
+
return !dots && i ? "[" + token + "]" : token;
|
|
10667
|
+
}).join(dots ? "." : "");
|
|
10668
|
+
}
|
|
10669
|
+
/**
|
|
10670
|
+
* If the array is an array and none of its elements are visitable, then it's a flat array.
|
|
10671
|
+
*
|
|
10672
|
+
* @param {Array<any>} arr - The array to check
|
|
10673
|
+
*
|
|
10674
|
+
* @returns {boolean}
|
|
10675
|
+
*/
|
|
10676
|
+
function isFlatArray(arr) {
|
|
10677
|
+
return utils_default.isArray(arr) && !arr.some(isVisitable);
|
|
10678
|
+
}
|
|
10679
|
+
var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
|
|
10680
|
+
return /^is[A-Z]/.test(prop);
|
|
10681
|
+
});
|
|
10682
|
+
/**
|
|
10683
|
+
* Convert a data object to FormData
|
|
10684
|
+
*
|
|
10685
|
+
* @param {Object} obj
|
|
10686
|
+
* @param {?Object} [formData]
|
|
10687
|
+
* @param {?Object} [options]
|
|
10688
|
+
* @param {Function} [options.visitor]
|
|
10689
|
+
* @param {Boolean} [options.metaTokens = true]
|
|
10690
|
+
* @param {Boolean} [options.dots = false]
|
|
10691
|
+
* @param {?Boolean} [options.indexes = false]
|
|
10692
|
+
*
|
|
10693
|
+
* @returns {Object}
|
|
10694
|
+
**/
|
|
10695
|
+
/**
|
|
10696
|
+
* It converts an object into a FormData object
|
|
10697
|
+
*
|
|
10698
|
+
* @param {Object<any, any>} obj - The object to convert to form data.
|
|
10699
|
+
* @param {string} formData - The FormData object to append to.
|
|
10700
|
+
* @param {Object<string, any>} options
|
|
10701
|
+
*
|
|
10702
|
+
* @returns
|
|
10703
|
+
*/
|
|
10704
|
+
function toFormData(obj, formData, options) {
|
|
10705
|
+
if (!utils_default.isObject(obj)) throw new TypeError("target must be an object");
|
|
10706
|
+
formData = formData || new FormData();
|
|
10707
|
+
options = utils_default.toFlatObject(options, {
|
|
10708
|
+
metaTokens: true,
|
|
10709
|
+
dots: false,
|
|
10710
|
+
indexes: false
|
|
10711
|
+
}, false, function defined(option, source) {
|
|
10712
|
+
return !utils_default.isUndefined(source[option]);
|
|
10713
|
+
});
|
|
10714
|
+
const metaTokens = options.metaTokens;
|
|
10715
|
+
const visitor = options.visitor || defaultVisitor;
|
|
10716
|
+
const dots = options.dots;
|
|
10717
|
+
const indexes = options.indexes;
|
|
10718
|
+
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
10719
|
+
const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth;
|
|
10720
|
+
const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
|
|
10721
|
+
if (!utils_default.isFunction(visitor)) throw new TypeError("visitor must be a function");
|
|
10722
|
+
function convertValue(value) {
|
|
10723
|
+
if (value === null) return "";
|
|
10724
|
+
if (utils_default.isDate(value)) return value.toISOString();
|
|
10725
|
+
if (utils_default.isBoolean(value)) return value.toString();
|
|
10726
|
+
if (!useBlob && utils_default.isBlob(value)) throw new AxiosError("Blob is not supported. Use a Buffer instead.");
|
|
10727
|
+
if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
10728
|
+
return value;
|
|
10729
|
+
}
|
|
10730
|
+
/**
|
|
10731
|
+
* Default visitor.
|
|
10732
|
+
*
|
|
10733
|
+
* @param {*} value
|
|
10408
10734
|
* @param {String|Number} key
|
|
10409
10735
|
* @param {Array<String|Number>} path
|
|
10410
10736
|
* @this {FormData}
|
|
@@ -10620,514 +10946,244 @@ var browser_default = {
|
|
|
10620
10946
|
"url",
|
|
10621
10947
|
"data"
|
|
10622
10948
|
]
|
|
10623
|
-
};
|
|
10624
|
-
//#endregion
|
|
10625
|
-
//#region node_modules/axios/lib/platform/common/utils.js
|
|
10626
|
-
var utils_exports = /* @__PURE__ */ __exportAll({
|
|
10627
|
-
hasBrowserEnv: () => hasBrowserEnv,
|
|
10628
|
-
hasStandardBrowserEnv: () => hasStandardBrowserEnv,
|
|
10629
|
-
hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
|
|
10630
|
-
navigator: () => _navigator,
|
|
10631
|
-
origin: () => origin
|
|
10632
|
-
});
|
|
10633
|
-
var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
10634
|
-
var _navigator = typeof navigator === "object" && navigator || void 0;
|
|
10635
|
-
/**
|
|
10636
|
-
* Determine if we're running in a standard browser environment
|
|
10637
|
-
*
|
|
10638
|
-
* This allows axios to run in a web worker, and react-native.
|
|
10639
|
-
* Both environments support XMLHttpRequest, but not fully standard globals.
|
|
10640
|
-
*
|
|
10641
|
-
* web workers:
|
|
10642
|
-
* typeof window -> undefined
|
|
10643
|
-
* typeof document -> undefined
|
|
10644
|
-
*
|
|
10645
|
-
* react-native:
|
|
10646
|
-
* navigator.product -> 'ReactNative'
|
|
10647
|
-
* nativescript
|
|
10648
|
-
* navigator.product -> 'NativeScript' or 'NS'
|
|
10649
|
-
*
|
|
10650
|
-
* @returns {boolean}
|
|
10651
|
-
*/
|
|
10652
|
-
var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || [
|
|
10653
|
-
"ReactNative",
|
|
10654
|
-
"NativeScript",
|
|
10655
|
-
"NS"
|
|
10656
|
-
].indexOf(_navigator.product) < 0);
|
|
10657
|
-
/**
|
|
10658
|
-
* Determine if we're running in a standard browser webWorker environment
|
|
10659
|
-
*
|
|
10660
|
-
* Although the `isStandardBrowserEnv` method indicates that
|
|
10661
|
-
* `allows axios to run in a web worker`, the WebWorker will still be
|
|
10662
|
-
* filtered out due to its judgment standard
|
|
10663
|
-
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
|
10664
|
-
* This leads to a problem when axios post `FormData` in webWorker
|
|
10665
|
-
*/
|
|
10666
|
-
var hasStandardBrowserWebWorkerEnv = typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
10667
|
-
var origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
10668
|
-
//#endregion
|
|
10669
|
-
//#region node_modules/axios/lib/platform/index.js
|
|
10670
|
-
var platform_default = {
|
|
10671
|
-
...utils_exports,
|
|
10672
|
-
...browser_default
|
|
10673
|
-
};
|
|
10674
|
-
//#endregion
|
|
10675
|
-
//#region node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
10676
|
-
function toURLEncodedForm(data, options) {
|
|
10677
|
-
return toFormData(data, new platform_default.classes.URLSearchParams(), {
|
|
10678
|
-
visitor: function(value, key, path, helpers) {
|
|
10679
|
-
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
10680
|
-
this.append(key, value.toString("base64"));
|
|
10681
|
-
return false;
|
|
10682
|
-
}
|
|
10683
|
-
return helpers.defaultVisitor.apply(this, arguments);
|
|
10684
|
-
},
|
|
10685
|
-
...options
|
|
10686
|
-
});
|
|
10687
|
-
}
|
|
10688
|
-
//#endregion
|
|
10689
|
-
//#region node_modules/axios/lib/helpers/formDataToJSON.js
|
|
10690
|
-
/**
|
|
10691
|
-
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
|
|
10692
|
-
*
|
|
10693
|
-
* @param {string} name - The name of the property to get.
|
|
10694
|
-
*
|
|
10695
|
-
* @returns An array of strings.
|
|
10696
|
-
*/
|
|
10697
|
-
function parsePropPath(name) {
|
|
10698
|
-
return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
10699
|
-
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
10700
|
-
});
|
|
10701
|
-
}
|
|
10702
|
-
/**
|
|
10703
|
-
* Convert an array to an object.
|
|
10704
|
-
*
|
|
10705
|
-
* @param {Array<any>} arr - The array to convert to an object.
|
|
10706
|
-
*
|
|
10707
|
-
* @returns An object with the same keys and values as the array.
|
|
10708
|
-
*/
|
|
10709
|
-
function arrayToObject(arr) {
|
|
10710
|
-
const obj = {};
|
|
10711
|
-
const keys = Object.keys(arr);
|
|
10712
|
-
let i;
|
|
10713
|
-
const len = keys.length;
|
|
10714
|
-
let key;
|
|
10715
|
-
for (i = 0; i < len; i++) {
|
|
10716
|
-
key = keys[i];
|
|
10717
|
-
obj[key] = arr[key];
|
|
10718
|
-
}
|
|
10719
|
-
return obj;
|
|
10720
|
-
}
|
|
10721
|
-
/**
|
|
10722
|
-
* It takes a FormData object and returns a JavaScript object
|
|
10723
|
-
*
|
|
10724
|
-
* @param {string} formData The FormData object to convert to JSON.
|
|
10725
|
-
*
|
|
10726
|
-
* @returns {Object<string, any> | null} The converted object.
|
|
10727
|
-
*/
|
|
10728
|
-
function formDataToJSON(formData) {
|
|
10729
|
-
function buildPath(path, value, target, index) {
|
|
10730
|
-
let name = path[index++];
|
|
10731
|
-
if (name === "__proto__") return true;
|
|
10732
|
-
const isNumericKey = Number.isFinite(+name);
|
|
10733
|
-
const isLast = index >= path.length;
|
|
10734
|
-
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
10735
|
-
if (isLast) {
|
|
10736
|
-
if (utils_default.hasOwnProp(target, name)) target[name] = utils_default.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
|
|
10737
|
-
else target[name] = value;
|
|
10738
|
-
return !isNumericKey;
|
|
10739
|
-
}
|
|
10740
|
-
if (!target[name] || !utils_default.isObject(target[name])) target[name] = [];
|
|
10741
|
-
if (buildPath(path, value, target[name], index) && utils_default.isArray(target[name])) target[name] = arrayToObject(target[name]);
|
|
10742
|
-
return !isNumericKey;
|
|
10743
|
-
}
|
|
10744
|
-
if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
|
|
10745
|
-
const obj = {};
|
|
10746
|
-
utils_default.forEachEntry(formData, (name, value) => {
|
|
10747
|
-
buildPath(parsePropPath(name), value, obj, 0);
|
|
10748
|
-
});
|
|
10749
|
-
return obj;
|
|
10750
|
-
}
|
|
10751
|
-
return null;
|
|
10752
|
-
}
|
|
10753
|
-
//#endregion
|
|
10754
|
-
//#region node_modules/axios/lib/defaults/index.js
|
|
10755
|
-
var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : void 0;
|
|
10756
|
-
/**
|
|
10757
|
-
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
10758
|
-
* of the input
|
|
10759
|
-
*
|
|
10760
|
-
* @param {any} rawValue - The value to be stringified.
|
|
10761
|
-
* @param {Function} parser - A function that parses a string into a JavaScript object.
|
|
10762
|
-
* @param {Function} encoder - A function that takes a value and returns a string.
|
|
10763
|
-
*
|
|
10764
|
-
* @returns {string} A stringified version of the rawValue.
|
|
10765
|
-
*/
|
|
10766
|
-
function stringifySafely(rawValue, parser, encoder) {
|
|
10767
|
-
if (utils_default.isString(rawValue)) try {
|
|
10768
|
-
(parser || JSON.parse)(rawValue);
|
|
10769
|
-
return utils_default.trim(rawValue);
|
|
10770
|
-
} catch (e) {
|
|
10771
|
-
if (e.name !== "SyntaxError") throw e;
|
|
10772
|
-
}
|
|
10773
|
-
return (encoder || JSON.stringify)(rawValue);
|
|
10774
|
-
}
|
|
10775
|
-
var defaults = {
|
|
10776
|
-
transitional: transitional_default,
|
|
10777
|
-
adapter: [
|
|
10778
|
-
"xhr",
|
|
10779
|
-
"http",
|
|
10780
|
-
"fetch"
|
|
10781
|
-
],
|
|
10782
|
-
transformRequest: [function transformRequest(data, headers) {
|
|
10783
|
-
const contentType = headers.getContentType() || "";
|
|
10784
|
-
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
10785
|
-
const isObjectPayload = utils_default.isObject(data);
|
|
10786
|
-
if (isObjectPayload && utils_default.isHTMLForm(data)) data = new FormData(data);
|
|
10787
|
-
if (utils_default.isFormData(data)) return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
10788
|
-
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) return data;
|
|
10789
|
-
if (utils_default.isArrayBufferView(data)) return data.buffer;
|
|
10790
|
-
if (utils_default.isURLSearchParams(data)) {
|
|
10791
|
-
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
10792
|
-
return data.toString();
|
|
10793
|
-
}
|
|
10794
|
-
let isFileList;
|
|
10795
|
-
if (isObjectPayload) {
|
|
10796
|
-
const formSerializer = own(this, "formSerializer");
|
|
10797
|
-
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) return toURLEncodedForm(data, formSerializer).toString();
|
|
10798
|
-
if ((isFileList = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
10799
|
-
const env = own(this, "env");
|
|
10800
|
-
const _FormData = env && env.FormData;
|
|
10801
|
-
return toFormData(isFileList ? { "files[]": data } : data, _FormData && new _FormData(), formSerializer);
|
|
10802
|
-
}
|
|
10803
|
-
}
|
|
10804
|
-
if (isObjectPayload || hasJSONContentType) {
|
|
10805
|
-
headers.setContentType("application/json", false);
|
|
10806
|
-
return stringifySafely(data);
|
|
10807
|
-
}
|
|
10808
|
-
return data;
|
|
10809
|
-
}],
|
|
10810
|
-
transformResponse: [function transformResponse(data) {
|
|
10811
|
-
const transitional = own(this, "transitional") || defaults.transitional;
|
|
10812
|
-
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
10813
|
-
const responseType = own(this, "responseType");
|
|
10814
|
-
const JSONRequested = responseType === "json";
|
|
10815
|
-
if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) return data;
|
|
10816
|
-
if (data && utils_default.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
|
|
10817
|
-
const strictJSONParsing = !(transitional && transitional.silentJSONParsing) && JSONRequested;
|
|
10818
|
-
try {
|
|
10819
|
-
return JSON.parse(data, own(this, "parseReviver"));
|
|
10820
|
-
} catch (e) {
|
|
10821
|
-
if (strictJSONParsing) {
|
|
10822
|
-
if (e.name === "SyntaxError") throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, "response"));
|
|
10823
|
-
throw e;
|
|
10824
|
-
}
|
|
10825
|
-
}
|
|
10826
|
-
}
|
|
10827
|
-
return data;
|
|
10828
|
-
}],
|
|
10829
|
-
/**
|
|
10830
|
-
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
10831
|
-
* timeout is not created.
|
|
10832
|
-
*/
|
|
10833
|
-
timeout: 0,
|
|
10834
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
10835
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
10836
|
-
maxContentLength: -1,
|
|
10837
|
-
maxBodyLength: -1,
|
|
10838
|
-
env: {
|
|
10839
|
-
FormData: platform_default.classes.FormData,
|
|
10840
|
-
Blob: platform_default.classes.Blob
|
|
10841
|
-
},
|
|
10842
|
-
validateStatus: function validateStatus(status) {
|
|
10843
|
-
return status >= 200 && status < 300;
|
|
10844
|
-
},
|
|
10845
|
-
headers: { common: {
|
|
10846
|
-
Accept: "application/json, text/plain, */*",
|
|
10847
|
-
"Content-Type": void 0
|
|
10848
|
-
} }
|
|
10849
|
-
};
|
|
10850
|
-
utils_default.forEach([
|
|
10851
|
-
"delete",
|
|
10852
|
-
"get",
|
|
10853
|
-
"head",
|
|
10854
|
-
"post",
|
|
10855
|
-
"put",
|
|
10856
|
-
"patch"
|
|
10857
|
-
], (method) => {
|
|
10858
|
-
defaults.headers[method] = {};
|
|
10859
|
-
});
|
|
10949
|
+
};
|
|
10860
10950
|
//#endregion
|
|
10861
|
-
//#region node_modules/axios/lib/
|
|
10862
|
-
var
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
"if-modified-since",
|
|
10872
|
-
"if-unmodified-since",
|
|
10873
|
-
"last-modified",
|
|
10874
|
-
"location",
|
|
10875
|
-
"max-forwards",
|
|
10876
|
-
"proxy-authorization",
|
|
10877
|
-
"referer",
|
|
10878
|
-
"retry-after",
|
|
10879
|
-
"user-agent"
|
|
10880
|
-
]);
|
|
10951
|
+
//#region node_modules/axios/lib/platform/common/utils.js
|
|
10952
|
+
var utils_exports = /* @__PURE__ */ __exportAll({
|
|
10953
|
+
hasBrowserEnv: () => hasBrowserEnv,
|
|
10954
|
+
hasStandardBrowserEnv: () => hasStandardBrowserEnv,
|
|
10955
|
+
hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
|
|
10956
|
+
navigator: () => _navigator,
|
|
10957
|
+
origin: () => origin
|
|
10958
|
+
});
|
|
10959
|
+
var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
10960
|
+
var _navigator = typeof navigator === "object" && navigator || void 0;
|
|
10881
10961
|
/**
|
|
10882
|
-
*
|
|
10962
|
+
* Determine if we're running in a standard browser environment
|
|
10883
10963
|
*
|
|
10884
|
-
*
|
|
10885
|
-
*
|
|
10886
|
-
* Content-Type: application/json
|
|
10887
|
-
* Connection: keep-alive
|
|
10888
|
-
* Transfer-Encoding: chunked
|
|
10889
|
-
* ```
|
|
10964
|
+
* This allows axios to run in a web worker, and react-native.
|
|
10965
|
+
* Both environments support XMLHttpRequest, but not fully standard globals.
|
|
10890
10966
|
*
|
|
10891
|
-
*
|
|
10967
|
+
* web workers:
|
|
10968
|
+
* typeof window -> undefined
|
|
10969
|
+
* typeof document -> undefined
|
|
10892
10970
|
*
|
|
10893
|
-
*
|
|
10971
|
+
* react-native:
|
|
10972
|
+
* navigator.product -> 'ReactNative'
|
|
10973
|
+
* nativescript
|
|
10974
|
+
* navigator.product -> 'NativeScript' or 'NS'
|
|
10975
|
+
*
|
|
10976
|
+
* @returns {boolean}
|
|
10894
10977
|
*/
|
|
10895
|
-
var
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10978
|
+
var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || [
|
|
10979
|
+
"ReactNative",
|
|
10980
|
+
"NativeScript",
|
|
10981
|
+
"NS"
|
|
10982
|
+
].indexOf(_navigator.product) < 0);
|
|
10983
|
+
/**
|
|
10984
|
+
* Determine if we're running in a standard browser webWorker environment
|
|
10985
|
+
*
|
|
10986
|
+
* Although the `isStandardBrowserEnv` method indicates that
|
|
10987
|
+
* `allows axios to run in a web worker`, the WebWorker will still be
|
|
10988
|
+
* filtered out due to its judgment standard
|
|
10989
|
+
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
|
10990
|
+
* This leads to a problem when axios post `FormData` in webWorker
|
|
10991
|
+
*/
|
|
10992
|
+
var hasStandardBrowserWebWorkerEnv = typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
10993
|
+
var origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
10994
|
+
//#endregion
|
|
10995
|
+
//#region node_modules/axios/lib/platform/index.js
|
|
10996
|
+
var platform_default = {
|
|
10997
|
+
...utils_exports,
|
|
10998
|
+
...browser_default
|
|
10910
10999
|
};
|
|
10911
11000
|
//#endregion
|
|
10912
|
-
//#region node_modules/axios/lib/
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
function
|
|
10916
|
-
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
|
|
10922
|
-
|
|
10923
|
-
while (end > start) {
|
|
10924
|
-
const code = str.charCodeAt(end - 1);
|
|
10925
|
-
if (code !== 9 && code !== 32) break;
|
|
10926
|
-
end -= 1;
|
|
10927
|
-
}
|
|
10928
|
-
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
10929
|
-
}
|
|
10930
|
-
function normalizeHeader(header) {
|
|
10931
|
-
return header && String(header).trim().toLowerCase();
|
|
10932
|
-
}
|
|
10933
|
-
function sanitizeHeaderValue(str) {
|
|
10934
|
-
return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ""));
|
|
10935
|
-
}
|
|
10936
|
-
function normalizeValue(value) {
|
|
10937
|
-
if (value === false || value == null) return value;
|
|
10938
|
-
return utils_default.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
|
|
10939
|
-
}
|
|
10940
|
-
function parseTokens(str) {
|
|
10941
|
-
const tokens = Object.create(null);
|
|
10942
|
-
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
10943
|
-
let match;
|
|
10944
|
-
while (match = tokensRE.exec(str)) tokens[match[1]] = match[2];
|
|
10945
|
-
return tokens;
|
|
10946
|
-
}
|
|
10947
|
-
var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
10948
|
-
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
10949
|
-
if (utils_default.isFunction(filter)) return filter.call(this, value, header);
|
|
10950
|
-
if (isHeaderNameFilter) value = header;
|
|
10951
|
-
if (!utils_default.isString(value)) return;
|
|
10952
|
-
if (utils_default.isString(filter)) return value.indexOf(filter) !== -1;
|
|
10953
|
-
if (utils_default.isRegExp(filter)) return filter.test(value);
|
|
10954
|
-
}
|
|
10955
|
-
function formatHeader(header) {
|
|
10956
|
-
return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
10957
|
-
return char.toUpperCase() + str;
|
|
10958
|
-
});
|
|
10959
|
-
}
|
|
10960
|
-
function buildAccessors(obj, header) {
|
|
10961
|
-
const accessorName = utils_default.toCamelCase(" " + header);
|
|
10962
|
-
[
|
|
10963
|
-
"get",
|
|
10964
|
-
"set",
|
|
10965
|
-
"has"
|
|
10966
|
-
].forEach((methodName) => {
|
|
10967
|
-
Object.defineProperty(obj, methodName + accessorName, {
|
|
10968
|
-
value: function(arg1, arg2, arg3) {
|
|
10969
|
-
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
10970
|
-
},
|
|
10971
|
-
configurable: true
|
|
10972
|
-
});
|
|
11001
|
+
//#region node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
11002
|
+
function toURLEncodedForm(data, options) {
|
|
11003
|
+
return toFormData(data, new platform_default.classes.URLSearchParams(), {
|
|
11004
|
+
visitor: function(value, key, path, helpers) {
|
|
11005
|
+
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
11006
|
+
this.append(key, value.toString("base64"));
|
|
11007
|
+
return false;
|
|
11008
|
+
}
|
|
11009
|
+
return helpers.defaultVisitor.apply(this, arguments);
|
|
11010
|
+
},
|
|
11011
|
+
...options
|
|
10973
11012
|
});
|
|
10974
11013
|
}
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
const value = this[key];
|
|
11006
|
-
if (!parser) return value;
|
|
11007
|
-
if (parser === true) return parseTokens(value);
|
|
11008
|
-
if (utils_default.isFunction(parser)) return parser.call(this, value, key);
|
|
11009
|
-
if (utils_default.isRegExp(parser)) return parser.exec(value);
|
|
11010
|
-
throw new TypeError("parser must be boolean|regexp|function");
|
|
11011
|
-
}
|
|
11012
|
-
}
|
|
11013
|
-
}
|
|
11014
|
-
has(header, matcher) {
|
|
11015
|
-
header = normalizeHeader(header);
|
|
11016
|
-
if (header) {
|
|
11017
|
-
const key = utils_default.findKey(this, header);
|
|
11018
|
-
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
11019
|
-
}
|
|
11020
|
-
return false;
|
|
11021
|
-
}
|
|
11022
|
-
delete(header, matcher) {
|
|
11023
|
-
const self = this;
|
|
11024
|
-
let deleted = false;
|
|
11025
|
-
function deleteHeader(_header) {
|
|
11026
|
-
_header = normalizeHeader(_header);
|
|
11027
|
-
if (_header) {
|
|
11028
|
-
const key = utils_default.findKey(self, _header);
|
|
11029
|
-
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
|
11030
|
-
delete self[key];
|
|
11031
|
-
deleted = true;
|
|
11032
|
-
}
|
|
11033
|
-
}
|
|
11034
|
-
}
|
|
11035
|
-
if (utils_default.isArray(header)) header.forEach(deleteHeader);
|
|
11036
|
-
else deleteHeader(header);
|
|
11037
|
-
return deleted;
|
|
11038
|
-
}
|
|
11039
|
-
clear(matcher) {
|
|
11040
|
-
const keys = Object.keys(this);
|
|
11041
|
-
let i = keys.length;
|
|
11042
|
-
let deleted = false;
|
|
11043
|
-
while (i--) {
|
|
11044
|
-
const key = keys[i];
|
|
11045
|
-
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
11046
|
-
delete this[key];
|
|
11047
|
-
deleted = true;
|
|
11048
|
-
}
|
|
11049
|
-
}
|
|
11050
|
-
return deleted;
|
|
11051
|
-
}
|
|
11052
|
-
normalize(format) {
|
|
11053
|
-
const self = this;
|
|
11054
|
-
const headers = {};
|
|
11055
|
-
utils_default.forEach(this, (value, header) => {
|
|
11056
|
-
const key = utils_default.findKey(headers, header);
|
|
11057
|
-
if (key) {
|
|
11058
|
-
self[key] = normalizeValue(value);
|
|
11059
|
-
delete self[header];
|
|
11060
|
-
return;
|
|
11061
|
-
}
|
|
11062
|
-
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
11063
|
-
if (normalized !== header) delete self[header];
|
|
11064
|
-
self[normalized] = normalizeValue(value);
|
|
11065
|
-
headers[normalized] = true;
|
|
11066
|
-
});
|
|
11067
|
-
return this;
|
|
11014
|
+
//#endregion
|
|
11015
|
+
//#region node_modules/axios/lib/helpers/formDataToJSON.js
|
|
11016
|
+
/**
|
|
11017
|
+
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
|
|
11018
|
+
*
|
|
11019
|
+
* @param {string} name - The name of the property to get.
|
|
11020
|
+
*
|
|
11021
|
+
* @returns An array of strings.
|
|
11022
|
+
*/
|
|
11023
|
+
function parsePropPath(name) {
|
|
11024
|
+
return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
11025
|
+
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
11026
|
+
});
|
|
11027
|
+
}
|
|
11028
|
+
/**
|
|
11029
|
+
* Convert an array to an object.
|
|
11030
|
+
*
|
|
11031
|
+
* @param {Array<any>} arr - The array to convert to an object.
|
|
11032
|
+
*
|
|
11033
|
+
* @returns An object with the same keys and values as the array.
|
|
11034
|
+
*/
|
|
11035
|
+
function arrayToObject(arr) {
|
|
11036
|
+
const obj = {};
|
|
11037
|
+
const keys = Object.keys(arr);
|
|
11038
|
+
let i;
|
|
11039
|
+
const len = keys.length;
|
|
11040
|
+
let key;
|
|
11041
|
+
for (i = 0; i < len; i++) {
|
|
11042
|
+
key = keys[i];
|
|
11043
|
+
obj[key] = arr[key];
|
|
11068
11044
|
}
|
|
11069
|
-
|
|
11070
|
-
|
|
11045
|
+
return obj;
|
|
11046
|
+
}
|
|
11047
|
+
/**
|
|
11048
|
+
* It takes a FormData object and returns a JavaScript object
|
|
11049
|
+
*
|
|
11050
|
+
* @param {string} formData The FormData object to convert to JSON.
|
|
11051
|
+
*
|
|
11052
|
+
* @returns {Object<string, any> | null} The converted object.
|
|
11053
|
+
*/
|
|
11054
|
+
function formDataToJSON(formData) {
|
|
11055
|
+
function buildPath(path, value, target, index) {
|
|
11056
|
+
let name = path[index++];
|
|
11057
|
+
if (name === "__proto__") return true;
|
|
11058
|
+
const isNumericKey = Number.isFinite(+name);
|
|
11059
|
+
const isLast = index >= path.length;
|
|
11060
|
+
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
11061
|
+
if (isLast) {
|
|
11062
|
+
if (utils_default.hasOwnProp(target, name)) target[name] = utils_default.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
|
|
11063
|
+
else target[name] = value;
|
|
11064
|
+
return !isNumericKey;
|
|
11065
|
+
}
|
|
11066
|
+
if (!target[name] || !utils_default.isObject(target[name])) target[name] = [];
|
|
11067
|
+
if (buildPath(path, value, target[name], index) && utils_default.isArray(target[name])) target[name] = arrayToObject(target[name]);
|
|
11068
|
+
return !isNumericKey;
|
|
11071
11069
|
}
|
|
11072
|
-
|
|
11073
|
-
const obj =
|
|
11074
|
-
utils_default.
|
|
11075
|
-
|
|
11070
|
+
if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
|
|
11071
|
+
const obj = {};
|
|
11072
|
+
utils_default.forEachEntry(formData, (name, value) => {
|
|
11073
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
11076
11074
|
});
|
|
11077
11075
|
return obj;
|
|
11078
11076
|
}
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
return
|
|
11077
|
+
return null;
|
|
11078
|
+
}
|
|
11079
|
+
//#endregion
|
|
11080
|
+
//#region node_modules/axios/lib/defaults/index.js
|
|
11081
|
+
var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : void 0;
|
|
11082
|
+
/**
|
|
11083
|
+
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
11084
|
+
* of the input
|
|
11085
|
+
*
|
|
11086
|
+
* @param {any} rawValue - The value to be stringified.
|
|
11087
|
+
* @param {Function} parser - A function that parses a string into a JavaScript object.
|
|
11088
|
+
* @param {Function} encoder - A function that takes a value and returns a string.
|
|
11089
|
+
*
|
|
11090
|
+
* @returns {string} A stringified version of the rawValue.
|
|
11091
|
+
*/
|
|
11092
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
11093
|
+
if (utils_default.isString(rawValue)) try {
|
|
11094
|
+
(parser || JSON.parse)(rawValue);
|
|
11095
|
+
return utils_default.trim(rawValue);
|
|
11096
|
+
} catch (e) {
|
|
11097
|
+
if (e.name !== "SyntaxError") throw e;
|
|
11098
11098
|
}
|
|
11099
|
-
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11099
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
11100
|
+
}
|
|
11101
|
+
var defaults = {
|
|
11102
|
+
transitional: transitional_default,
|
|
11103
|
+
adapter: [
|
|
11104
|
+
"xhr",
|
|
11105
|
+
"http",
|
|
11106
|
+
"fetch"
|
|
11107
|
+
],
|
|
11108
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
11109
|
+
const contentType = headers.getContentType() || "";
|
|
11110
|
+
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
11111
|
+
const isObjectPayload = utils_default.isObject(data);
|
|
11112
|
+
if (isObjectPayload && utils_default.isHTMLForm(data)) data = new FormData(data);
|
|
11113
|
+
if (utils_default.isFormData(data)) return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
11114
|
+
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) return data;
|
|
11115
|
+
if (utils_default.isArrayBufferView(data)) return data.buffer;
|
|
11116
|
+
if (utils_default.isURLSearchParams(data)) {
|
|
11117
|
+
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
11118
|
+
return data.toString();
|
|
11119
|
+
}
|
|
11120
|
+
let isFileList;
|
|
11121
|
+
if (isObjectPayload) {
|
|
11122
|
+
const formSerializer = own(this, "formSerializer");
|
|
11123
|
+
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) return toURLEncodedForm(data, formSerializer).toString();
|
|
11124
|
+
if ((isFileList = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
11125
|
+
const env = own(this, "env");
|
|
11126
|
+
const _FormData = env && env.FormData;
|
|
11127
|
+
return toFormData(isFileList ? { "files[]": data } : data, _FormData && new _FormData(), formSerializer);
|
|
11107
11128
|
}
|
|
11108
11129
|
}
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
};
|
|
11113
|
-
AxiosHeaders.accessor([
|
|
11114
|
-
"Content-Type",
|
|
11115
|
-
"Content-Length",
|
|
11116
|
-
"Accept",
|
|
11117
|
-
"Accept-Encoding",
|
|
11118
|
-
"User-Agent",
|
|
11119
|
-
"Authorization"
|
|
11120
|
-
]);
|
|
11121
|
-
utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
11122
|
-
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
11123
|
-
return {
|
|
11124
|
-
get: () => value,
|
|
11125
|
-
set(headerValue) {
|
|
11126
|
-
this[mapped] = headerValue;
|
|
11130
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
11131
|
+
headers.setContentType("application/json", false);
|
|
11132
|
+
return stringifySafely(data);
|
|
11127
11133
|
}
|
|
11128
|
-
|
|
11134
|
+
return data;
|
|
11135
|
+
}],
|
|
11136
|
+
transformResponse: [function transformResponse(data) {
|
|
11137
|
+
const transitional = own(this, "transitional") || defaults.transitional;
|
|
11138
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
11139
|
+
const responseType = own(this, "responseType");
|
|
11140
|
+
const JSONRequested = responseType === "json";
|
|
11141
|
+
if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) return data;
|
|
11142
|
+
if (data && utils_default.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
|
|
11143
|
+
const strictJSONParsing = !(transitional && transitional.silentJSONParsing) && JSONRequested;
|
|
11144
|
+
try {
|
|
11145
|
+
return JSON.parse(data, own(this, "parseReviver"));
|
|
11146
|
+
} catch (e) {
|
|
11147
|
+
if (strictJSONParsing) {
|
|
11148
|
+
if (e.name === "SyntaxError") throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, "response"));
|
|
11149
|
+
throw e;
|
|
11150
|
+
}
|
|
11151
|
+
}
|
|
11152
|
+
}
|
|
11153
|
+
return data;
|
|
11154
|
+
}],
|
|
11155
|
+
/**
|
|
11156
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
11157
|
+
* timeout is not created.
|
|
11158
|
+
*/
|
|
11159
|
+
timeout: 0,
|
|
11160
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
11161
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
11162
|
+
maxContentLength: -1,
|
|
11163
|
+
maxBodyLength: -1,
|
|
11164
|
+
env: {
|
|
11165
|
+
FormData: platform_default.classes.FormData,
|
|
11166
|
+
Blob: platform_default.classes.Blob
|
|
11167
|
+
},
|
|
11168
|
+
validateStatus: function validateStatus(status) {
|
|
11169
|
+
return status >= 200 && status < 300;
|
|
11170
|
+
},
|
|
11171
|
+
headers: { common: {
|
|
11172
|
+
Accept: "application/json, text/plain, */*",
|
|
11173
|
+
"Content-Type": void 0
|
|
11174
|
+
} }
|
|
11175
|
+
};
|
|
11176
|
+
utils_default.forEach([
|
|
11177
|
+
"delete",
|
|
11178
|
+
"get",
|
|
11179
|
+
"head",
|
|
11180
|
+
"post",
|
|
11181
|
+
"put",
|
|
11182
|
+
"patch",
|
|
11183
|
+
"query"
|
|
11184
|
+
], (method) => {
|
|
11185
|
+
defaults.headers[method] = {};
|
|
11129
11186
|
});
|
|
11130
|
-
utils_default.freezeMethods(AxiosHeaders);
|
|
11131
11187
|
//#endregion
|
|
11132
11188
|
//#region node_modules/axios/lib/core/transformData.js
|
|
11133
11189
|
/**
|
|
@@ -11186,12 +11242,12 @@ var CanceledError = class extends AxiosError {
|
|
|
11186
11242
|
function settle(resolve, reject, response) {
|
|
11187
11243
|
const validateStatus = response.config.validateStatus;
|
|
11188
11244
|
if (!response.status || !validateStatus || validateStatus(response.status)) resolve(response);
|
|
11189
|
-
else reject(new AxiosError("Request failed with status code " + response.status,
|
|
11245
|
+
else 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));
|
|
11190
11246
|
}
|
|
11191
11247
|
//#endregion
|
|
11192
11248
|
//#region node_modules/axios/lib/helpers/parseProtocol.js
|
|
11193
11249
|
function parseProtocol(url) {
|
|
11194
|
-
const match = /^([-+\w]{1,25})(
|
|
11250
|
+
const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
|
|
11195
11251
|
return match && match[1] || "";
|
|
11196
11252
|
}
|
|
11197
11253
|
//#endregion
|
|
@@ -11321,8 +11377,13 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? {
|
|
|
11321
11377
|
},
|
|
11322
11378
|
read(name) {
|
|
11323
11379
|
if (typeof document === "undefined") return null;
|
|
11324
|
-
const
|
|
11325
|
-
|
|
11380
|
+
const cookies = document.cookie.split(";");
|
|
11381
|
+
for (let i = 0; i < cookies.length; i++) {
|
|
11382
|
+
const cookie = cookies[i].replace(/^\s+/, "");
|
|
11383
|
+
const eq = cookie.indexOf("=");
|
|
11384
|
+
if (eq !== -1 && cookie.slice(0, eq) === name) return decodeURIComponent(cookie.slice(eq + 1));
|
|
11385
|
+
}
|
|
11386
|
+
return null;
|
|
11326
11387
|
},
|
|
11327
11388
|
remove(name) {
|
|
11328
11389
|
this.write(name, "", Date.now() - 864e5, "/");
|
|
@@ -11393,6 +11454,7 @@ function mergeConfig(config1, config2) {
|
|
|
11393
11454
|
config2 = config2 || {};
|
|
11394
11455
|
const config = Object.create(null);
|
|
11395
11456
|
Object.defineProperty(config, "hasOwnProperty", {
|
|
11457
|
+
__proto__: null,
|
|
11396
11458
|
value: Object.prototype.hasOwnProperty,
|
|
11397
11459
|
enumerable: false,
|
|
11398
11460
|
writable: true,
|
|
@@ -11464,6 +11526,25 @@ function mergeConfig(config1, config2) {
|
|
|
11464
11526
|
}
|
|
11465
11527
|
//#endregion
|
|
11466
11528
|
//#region node_modules/axios/lib/helpers/resolveConfig.js
|
|
11529
|
+
var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
|
|
11530
|
+
function setFormDataHeaders(headers, formHeaders, policy) {
|
|
11531
|
+
if (policy !== "content-only") {
|
|
11532
|
+
headers.set(formHeaders);
|
|
11533
|
+
return;
|
|
11534
|
+
}
|
|
11535
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
11536
|
+
if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) headers.set(key, val);
|
|
11537
|
+
});
|
|
11538
|
+
}
|
|
11539
|
+
/**
|
|
11540
|
+
* Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
|
|
11541
|
+
* This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
|
|
11542
|
+
*
|
|
11543
|
+
* @param {string} str The string to encode
|
|
11544
|
+
*
|
|
11545
|
+
* @returns {string} UTF-8 bytes as a Latin-1 string
|
|
11546
|
+
*/
|
|
11547
|
+
var encodeUTF8 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
|
|
11467
11548
|
var resolveConfig_default = (config) => {
|
|
11468
11549
|
const newConfig = mergeConfig({}, config);
|
|
11469
11550
|
const own = (key) => utils_default.hasOwnProp(newConfig, key) ? newConfig[key] : void 0;
|
|
@@ -11478,16 +11559,10 @@ var resolveConfig_default = (config) => {
|
|
|
11478
11559
|
const url = own("url");
|
|
11479
11560
|
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
11480
11561
|
newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls), config.params, config.paramsSerializer);
|
|
11481
|
-
if (auth) headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ?
|
|
11562
|
+
if (auth) headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? encodeUTF8(auth.password) : "")));
|
|
11482
11563
|
if (utils_default.isFormData(data)) {
|
|
11483
11564
|
if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) headers.setContentType(void 0);
|
|
11484
|
-
else if (utils_default.isFunction(data.getHeaders))
|
|
11485
|
-
const formHeaders = data.getHeaders();
|
|
11486
|
-
const allowedHeaders = ["content-type", "content-length"];
|
|
11487
|
-
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
11488
|
-
if (allowedHeaders.includes(key.toLowerCase())) headers.set(key, val);
|
|
11489
|
-
});
|
|
11490
|
-
}
|
|
11565
|
+
else if (utils_default.isFunction(data.getHeaders)) setFormDataHeaders(headers, data.getHeaders(), own("formDataHeaderPolicy"));
|
|
11491
11566
|
}
|
|
11492
11567
|
if (platform_default.hasStandardBrowserEnv) {
|
|
11493
11568
|
if (utils_default.isFunction(withXSRFToken)) withXSRFToken = withXSRFToken(newConfig);
|
|
@@ -11538,18 +11613,20 @@ var xhr_default = typeof XMLHttpRequest !== "undefined" && function(config) {
|
|
|
11538
11613
|
if ("onloadend" in request) request.onloadend = onloadend;
|
|
11539
11614
|
else request.onreadystatechange = function handleLoad() {
|
|
11540
11615
|
if (!request || request.readyState !== 4) return;
|
|
11541
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.
|
|
11616
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith("file:"))) return;
|
|
11542
11617
|
setTimeout(onloadend);
|
|
11543
11618
|
};
|
|
11544
11619
|
request.onabort = function handleAbort() {
|
|
11545
11620
|
if (!request) return;
|
|
11546
11621
|
reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request));
|
|
11622
|
+
done();
|
|
11547
11623
|
request = null;
|
|
11548
11624
|
};
|
|
11549
11625
|
request.onerror = function handleError(event) {
|
|
11550
11626
|
const err = new AxiosError(event && event.message ? event.message : "Network Error", AxiosError.ERR_NETWORK, config, request);
|
|
11551
11627
|
err.event = event || null;
|
|
11552
11628
|
reject(err);
|
|
11629
|
+
done();
|
|
11553
11630
|
request = null;
|
|
11554
11631
|
};
|
|
11555
11632
|
request.ontimeout = function handleTimeout() {
|
|
@@ -11557,6 +11634,7 @@ var xhr_default = typeof XMLHttpRequest !== "undefined" && function(config) {
|
|
|
11557
11634
|
const transitional = _config.transitional || transitional_default;
|
|
11558
11635
|
if (_config.timeoutErrorMessage) timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
11559
11636
|
reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request));
|
|
11637
|
+
done();
|
|
11560
11638
|
request = null;
|
|
11561
11639
|
};
|
|
11562
11640
|
requestData === void 0 && requestHeaders.setContentType(null);
|
|
@@ -11579,13 +11657,14 @@ var xhr_default = typeof XMLHttpRequest !== "undefined" && function(config) {
|
|
|
11579
11657
|
if (!request) return;
|
|
11580
11658
|
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
|
|
11581
11659
|
request.abort();
|
|
11660
|
+
done();
|
|
11582
11661
|
request = null;
|
|
11583
11662
|
};
|
|
11584
11663
|
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
11585
11664
|
if (_config.signal) _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
|
|
11586
11665
|
}
|
|
11587
11666
|
const protocol = parseProtocol(_config.url);
|
|
11588
|
-
if (protocol && platform_default.protocols.
|
|
11667
|
+
if (protocol && !platform_default.protocols.includes(protocol)) {
|
|
11589
11668
|
reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
|
|
11590
11669
|
return;
|
|
11591
11670
|
}
|
|
@@ -11696,14 +11775,76 @@ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
11696
11775
|
}, { highWaterMark: 2 });
|
|
11697
11776
|
};
|
|
11698
11777
|
//#endregion
|
|
11778
|
+
//#region node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
|
|
11779
|
+
/**
|
|
11780
|
+
* Estimate decoded byte length of a data:// URL *without* allocating large buffers.
|
|
11781
|
+
* - For base64: compute exact decoded size using length and padding;
|
|
11782
|
+
* handle %XX at the character-count level (no string allocation).
|
|
11783
|
+
* - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
|
|
11784
|
+
*
|
|
11785
|
+
* @param {string} url
|
|
11786
|
+
* @returns {number}
|
|
11787
|
+
*/
|
|
11788
|
+
function estimateDataURLDecodedBytes(url) {
|
|
11789
|
+
if (!url || typeof url !== "string") return 0;
|
|
11790
|
+
if (!url.startsWith("data:")) return 0;
|
|
11791
|
+
const comma = url.indexOf(",");
|
|
11792
|
+
if (comma < 0) return 0;
|
|
11793
|
+
const meta = url.slice(5, comma);
|
|
11794
|
+
const body = url.slice(comma + 1);
|
|
11795
|
+
if (/;base64/i.test(meta)) {
|
|
11796
|
+
let effectiveLen = body.length;
|
|
11797
|
+
const len = body.length;
|
|
11798
|
+
for (let i = 0; i < len; i++) if (body.charCodeAt(i) === 37 && i + 2 < len) {
|
|
11799
|
+
const a = body.charCodeAt(i + 1);
|
|
11800
|
+
const b = body.charCodeAt(i + 2);
|
|
11801
|
+
if ((a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102)) {
|
|
11802
|
+
effectiveLen -= 2;
|
|
11803
|
+
i += 2;
|
|
11804
|
+
}
|
|
11805
|
+
}
|
|
11806
|
+
let pad = 0;
|
|
11807
|
+
let idx = len - 1;
|
|
11808
|
+
const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && body.charCodeAt(j - 1) === 51 && (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
|
|
11809
|
+
if (idx >= 0) {
|
|
11810
|
+
if (body.charCodeAt(idx) === 61) {
|
|
11811
|
+
pad++;
|
|
11812
|
+
idx--;
|
|
11813
|
+
} else if (tailIsPct3D(idx)) {
|
|
11814
|
+
pad++;
|
|
11815
|
+
idx -= 3;
|
|
11816
|
+
}
|
|
11817
|
+
}
|
|
11818
|
+
if (pad === 1 && idx >= 0) {
|
|
11819
|
+
if (body.charCodeAt(idx) === 61) pad++;
|
|
11820
|
+
else if (tailIsPct3D(idx)) pad++;
|
|
11821
|
+
}
|
|
11822
|
+
const bytes = Math.floor(effectiveLen / 4) * 3 - (pad || 0);
|
|
11823
|
+
return bytes > 0 ? bytes : 0;
|
|
11824
|
+
}
|
|
11825
|
+
if (typeof Buffer !== "undefined" && typeof Buffer.byteLength === "function") return Buffer.byteLength(body, "utf8");
|
|
11826
|
+
let bytes = 0;
|
|
11827
|
+
for (let i = 0, len = body.length; i < len; i++) {
|
|
11828
|
+
const c = body.charCodeAt(i);
|
|
11829
|
+
if (c < 128) bytes += 1;
|
|
11830
|
+
else if (c < 2048) bytes += 2;
|
|
11831
|
+
else if (c >= 55296 && c <= 56319 && i + 1 < len) {
|
|
11832
|
+
const next = body.charCodeAt(i + 1);
|
|
11833
|
+
if (next >= 56320 && next <= 57343) {
|
|
11834
|
+
bytes += 4;
|
|
11835
|
+
i++;
|
|
11836
|
+
} else bytes += 3;
|
|
11837
|
+
} else bytes += 3;
|
|
11838
|
+
}
|
|
11839
|
+
return bytes;
|
|
11840
|
+
}
|
|
11841
|
+
//#endregion
|
|
11842
|
+
//#region node_modules/axios/lib/env/data.js
|
|
11843
|
+
var VERSION = "1.16.0";
|
|
11844
|
+
//#endregion
|
|
11699
11845
|
//#region node_modules/axios/lib/adapters/fetch.js
|
|
11700
11846
|
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
11701
11847
|
var { isFunction } = utils_default;
|
|
11702
|
-
var globalFetchAPI = (({ Request, Response }) => ({
|
|
11703
|
-
Request,
|
|
11704
|
-
Response
|
|
11705
|
-
}))(utils_default.global);
|
|
11706
|
-
var { ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1 } = utils_default.global;
|
|
11707
11848
|
var test = (fn, ...args) => {
|
|
11708
11849
|
try {
|
|
11709
11850
|
return !!fn(...args);
|
|
@@ -11712,18 +11853,23 @@ var test = (fn, ...args) => {
|
|
|
11712
11853
|
}
|
|
11713
11854
|
};
|
|
11714
11855
|
var factory = (env) => {
|
|
11715
|
-
|
|
11856
|
+
const globalObject = utils_default.global ?? globalThis;
|
|
11857
|
+
const { ReadableStream, TextEncoder } = globalObject;
|
|
11858
|
+
env = utils_default.merge.call({ skipUndefined: true }, {
|
|
11859
|
+
Request: globalObject.Request,
|
|
11860
|
+
Response: globalObject.Response
|
|
11861
|
+
}, env);
|
|
11716
11862
|
const { fetch: envFetch, Request, Response } = env;
|
|
11717
11863
|
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
|
|
11718
11864
|
const isRequestSupported = isFunction(Request);
|
|
11719
11865
|
const isResponseSupported = isFunction(Response);
|
|
11720
11866
|
if (!isFetchSupported) return false;
|
|
11721
|
-
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream
|
|
11722
|
-
const encodeText = isFetchSupported && (typeof TextEncoder
|
|
11867
|
+
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
|
|
11868
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
11723
11869
|
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
11724
11870
|
let duplexAccessed = false;
|
|
11725
11871
|
const request = new Request(platform_default.origin, {
|
|
11726
|
-
body: new ReadableStream
|
|
11872
|
+
body: new ReadableStream(),
|
|
11727
11873
|
method: "POST",
|
|
11728
11874
|
get duplex() {
|
|
11729
11875
|
duplexAccessed = true;
|
|
@@ -11765,7 +11911,9 @@ var factory = (env) => {
|
|
|
11765
11911
|
return length == null ? getBodyLength(body) : length;
|
|
11766
11912
|
};
|
|
11767
11913
|
return async (config) => {
|
|
11768
|
-
let { url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = "same-origin", fetchOptions } = resolveConfig_default(config);
|
|
11914
|
+
let { url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = "same-origin", fetchOptions, maxContentLength, maxBodyLength } = resolveConfig_default(config);
|
|
11915
|
+
const hasMaxContentLength = utils_default.isNumber(maxContentLength) && maxContentLength > -1;
|
|
11916
|
+
const hasMaxBodyLength = utils_default.isNumber(maxBodyLength) && maxBodyLength > -1;
|
|
11769
11917
|
let _fetch = envFetch || fetch;
|
|
11770
11918
|
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
11771
11919
|
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
@@ -11775,6 +11923,13 @@ var factory = (env) => {
|
|
|
11775
11923
|
});
|
|
11776
11924
|
let requestContentLength;
|
|
11777
11925
|
try {
|
|
11926
|
+
if (hasMaxContentLength && typeof url === "string" && url.startsWith("data:")) {
|
|
11927
|
+
if (estimateDataURLDecodedBytes(url) > maxContentLength) throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
|
|
11928
|
+
}
|
|
11929
|
+
if (hasMaxBodyLength && method !== "get" && method !== "head") {
|
|
11930
|
+
const outboundLength = await resolveBodyLength(headers, data);
|
|
11931
|
+
if (typeof outboundLength === "number" && isFinite(outboundLength) && outboundLength > maxBodyLength) throw new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config, request);
|
|
11932
|
+
}
|
|
11778
11933
|
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
11779
11934
|
let _request = new Request(url, {
|
|
11780
11935
|
method: "POST",
|
|
@@ -11794,6 +11949,7 @@ var factory = (env) => {
|
|
|
11794
11949
|
const contentType = headers.getContentType();
|
|
11795
11950
|
if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) headers.delete("content-type");
|
|
11796
11951
|
}
|
|
11952
|
+
headers.set("User-Agent", "axios/" + VERSION, false);
|
|
11797
11953
|
const resolvedOptions = {
|
|
11798
11954
|
...fetchOptions,
|
|
11799
11955
|
signal: composedSignal,
|
|
@@ -11805,8 +11961,12 @@ var factory = (env) => {
|
|
|
11805
11961
|
};
|
|
11806
11962
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
11807
11963
|
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
|
11964
|
+
if (hasMaxContentLength) {
|
|
11965
|
+
const declaredLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
|
|
11966
|
+
if (declaredLength != null && declaredLength > maxContentLength) throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
|
|
11967
|
+
}
|
|
11808
11968
|
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
11809
|
-
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
11969
|
+
if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) {
|
|
11810
11970
|
const options = {};
|
|
11811
11971
|
[
|
|
11812
11972
|
"status",
|
|
@@ -11817,13 +11977,30 @@ var factory = (env) => {
|
|
|
11817
11977
|
});
|
|
11818
11978
|
const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
|
|
11819
11979
|
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
|
|
11820
|
-
|
|
11980
|
+
let bytesRead = 0;
|
|
11981
|
+
const onChunkProgress = (loadedBytes) => {
|
|
11982
|
+
if (hasMaxContentLength) {
|
|
11983
|
+
bytesRead = loadedBytes;
|
|
11984
|
+
if (bytesRead > maxContentLength) throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
|
|
11985
|
+
}
|
|
11986
|
+
onProgress && onProgress(loadedBytes);
|
|
11987
|
+
};
|
|
11988
|
+
response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
|
|
11821
11989
|
flush && flush();
|
|
11822
11990
|
unsubscribe && unsubscribe();
|
|
11823
11991
|
}), options);
|
|
11824
11992
|
}
|
|
11825
11993
|
responseType = responseType || "text";
|
|
11826
11994
|
let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
|
|
11995
|
+
if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
|
|
11996
|
+
let materializedSize;
|
|
11997
|
+
if (responseData != null) {
|
|
11998
|
+
if (typeof responseData.byteLength === "number") materializedSize = responseData.byteLength;
|
|
11999
|
+
else if (typeof responseData.size === "number") materializedSize = responseData.size;
|
|
12000
|
+
else if (typeof responseData === "string") materializedSize = typeof TextEncoder === "function" ? new TextEncoder().encode(responseData).byteLength : responseData.length;
|
|
12001
|
+
}
|
|
12002
|
+
if (typeof materializedSize === "number" && materializedSize > maxContentLength) throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
|
|
12003
|
+
}
|
|
11827
12004
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
11828
12005
|
return await new Promise((resolve, reject) => {
|
|
11829
12006
|
settle(resolve, reject, {
|
|
@@ -11837,6 +12014,13 @@ var factory = (env) => {
|
|
|
11837
12014
|
});
|
|
11838
12015
|
} catch (err) {
|
|
11839
12016
|
unsubscribe && unsubscribe();
|
|
12017
|
+
if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {
|
|
12018
|
+
const canceledError = composedSignal.reason;
|
|
12019
|
+
canceledError.config = config;
|
|
12020
|
+
request && (canceledError.request = request);
|
|
12021
|
+
err !== canceledError && (canceledError.cause = err);
|
|
12022
|
+
throw canceledError;
|
|
12023
|
+
}
|
|
11840
12024
|
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) throw Object.assign(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, err && err.response), { cause: err.cause || err });
|
|
11841
12025
|
throw AxiosError.from(err, err && err.code, config, request, err && err.response);
|
|
11842
12026
|
}
|
|
@@ -11880,9 +12064,15 @@ var knownAdapters = {
|
|
|
11880
12064
|
utils_default.forEach(knownAdapters, (fn, value) => {
|
|
11881
12065
|
if (fn) {
|
|
11882
12066
|
try {
|
|
11883
|
-
Object.defineProperty(fn, "name", {
|
|
12067
|
+
Object.defineProperty(fn, "name", {
|
|
12068
|
+
__proto__: null,
|
|
12069
|
+
value
|
|
12070
|
+
});
|
|
11884
12071
|
} catch (e) {}
|
|
11885
|
-
Object.defineProperty(fn, "adapterName", {
|
|
12072
|
+
Object.defineProperty(fn, "adapterName", {
|
|
12073
|
+
__proto__: null,
|
|
12074
|
+
value
|
|
12075
|
+
});
|
|
11886
12076
|
}
|
|
11887
12077
|
});
|
|
11888
12078
|
/**
|
|
@@ -11978,14 +12168,24 @@ function dispatchRequest(config) {
|
|
|
11978
12168
|
].indexOf(config.method) !== -1) config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
11979
12169
|
return adapters_default.getAdapter(config.adapter || defaults.adapter, config)(config).then(function onAdapterResolution(response) {
|
|
11980
12170
|
throwIfCancellationRequested(config);
|
|
11981
|
-
response
|
|
12171
|
+
config.response = response;
|
|
12172
|
+
try {
|
|
12173
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
12174
|
+
} finally {
|
|
12175
|
+
delete config.response;
|
|
12176
|
+
}
|
|
11982
12177
|
response.headers = AxiosHeaders.from(response.headers);
|
|
11983
12178
|
return response;
|
|
11984
12179
|
}, function onAdapterRejection(reason) {
|
|
11985
12180
|
if (!isCancel(reason)) {
|
|
11986
12181
|
throwIfCancellationRequested(config);
|
|
11987
12182
|
if (reason && reason.response) {
|
|
11988
|
-
|
|
12183
|
+
config.response = reason.response;
|
|
12184
|
+
try {
|
|
12185
|
+
reason.response.data = transformData.call(config, config.transformResponse, reason.response);
|
|
12186
|
+
} finally {
|
|
12187
|
+
delete config.response;
|
|
12188
|
+
}
|
|
11989
12189
|
reason.response.headers = AxiosHeaders.from(reason.response.headers);
|
|
11990
12190
|
}
|
|
11991
12191
|
}
|
|
@@ -11993,9 +12193,6 @@ function dispatchRequest(config) {
|
|
|
11993
12193
|
});
|
|
11994
12194
|
}
|
|
11995
12195
|
//#endregion
|
|
11996
|
-
//#region node_modules/axios/lib/env/data.js
|
|
11997
|
-
var VERSION = "1.15.2";
|
|
11998
|
-
//#endregion
|
|
11999
12196
|
//#region node_modules/axios/lib/helpers/validator.js
|
|
12000
12197
|
var validators$1 = {};
|
|
12001
12198
|
[
|
|
@@ -12152,6 +12349,7 @@ var Axios = class {
|
|
|
12152
12349
|
"post",
|
|
12153
12350
|
"put",
|
|
12154
12351
|
"patch",
|
|
12352
|
+
"query",
|
|
12155
12353
|
"common"
|
|
12156
12354
|
], (method) => {
|
|
12157
12355
|
delete headers[method];
|
|
@@ -12226,7 +12424,8 @@ utils_default.forEach([
|
|
|
12226
12424
|
utils_default.forEach([
|
|
12227
12425
|
"post",
|
|
12228
12426
|
"put",
|
|
12229
|
-
"patch"
|
|
12427
|
+
"patch",
|
|
12428
|
+
"query"
|
|
12230
12429
|
], function forEachMethodWithData(method) {
|
|
12231
12430
|
function generateHTTPMethod(isForm) {
|
|
12232
12431
|
return function httpMethod(url, data, config) {
|
|
@@ -12239,7 +12438,7 @@ utils_default.forEach([
|
|
|
12239
12438
|
};
|
|
12240
12439
|
}
|
|
12241
12440
|
Axios.prototype[method] = generateHTTPMethod();
|
|
12242
|
-
Axios.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
12441
|
+
if (method !== "query") Axios.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
12243
12442
|
});
|
|
12244
12443
|
//#endregion
|
|
12245
12444
|
//#region node_modules/axios/lib/cancel/CancelToken.js
|