@timeax/form-palette 0.0.28 → 0.0.30

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/adapters.mjs CHANGED
@@ -1,2613 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all3) => {
3
- for (var name in all3)
4
- __defProp(target, name, { get: all3[name], enumerable: true });
5
- };
6
-
7
- // ../../node_modules/axios/lib/helpers/bind.js
8
- function bind(fn, thisArg) {
9
- return function wrap() {
10
- return fn.apply(thisArg, arguments);
11
- };
12
- }
13
-
14
- // ../../node_modules/axios/lib/utils.js
15
- var { toString } = Object.prototype;
16
- var { getPrototypeOf } = Object;
17
- var { iterator, toStringTag } = Symbol;
18
- var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
19
- const str = toString.call(thing);
20
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
21
- })(/* @__PURE__ */ Object.create(null));
22
- var kindOfTest = (type) => {
23
- type = type.toLowerCase();
24
- return (thing) => kindOf(thing) === type;
25
- };
26
- var typeOfTest = (type) => (thing) => typeof thing === type;
27
- var { isArray } = Array;
28
- var isUndefined = typeOfTest("undefined");
29
- function isBuffer(val) {
30
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
31
- }
32
- var isArrayBuffer = kindOfTest("ArrayBuffer");
33
- function isArrayBufferView(val) {
34
- let result;
35
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
36
- result = ArrayBuffer.isView(val);
37
- } else {
38
- result = val && val.buffer && isArrayBuffer(val.buffer);
39
- }
40
- return result;
41
- }
42
- var isString = typeOfTest("string");
43
- var isFunction = typeOfTest("function");
44
- var isNumber = typeOfTest("number");
45
- var isObject = (thing) => thing !== null && typeof thing === "object";
46
- var isBoolean = (thing) => thing === true || thing === false;
47
- var isPlainObject = (val) => {
48
- if (kindOf(val) !== "object") {
49
- return false;
50
- }
51
- const prototype3 = getPrototypeOf(val);
52
- return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(toStringTag in val) && !(iterator in val);
53
- };
54
- var isEmptyObject = (val) => {
55
- if (!isObject(val) || isBuffer(val)) {
56
- return false;
57
- }
58
- try {
59
- return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
60
- } catch (e) {
61
- return false;
62
- }
63
- };
64
- var isDate = kindOfTest("Date");
65
- var isFile = kindOfTest("File");
66
- var isBlob = kindOfTest("Blob");
67
- var isFileList = kindOfTest("FileList");
68
- var isStream = (val) => isObject(val) && isFunction(val.pipe);
69
- var isFormData = (thing) => {
70
- let kind;
71
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
72
- kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
73
- };
74
- var isURLSearchParams = kindOfTest("URLSearchParams");
75
- var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
76
- var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
77
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
78
- if (obj === null || typeof obj === "undefined") {
79
- return;
80
- }
81
- let i;
82
- let l;
83
- if (typeof obj !== "object") {
84
- obj = [obj];
85
- }
86
- if (isArray(obj)) {
87
- for (i = 0, l = obj.length; i < l; i++) {
88
- fn.call(null, obj[i], i, obj);
89
- }
90
- } else {
91
- if (isBuffer(obj)) {
92
- return;
93
- }
94
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
95
- const len = keys.length;
96
- let key;
97
- for (i = 0; i < len; i++) {
98
- key = keys[i];
99
- fn.call(null, obj[key], key, obj);
100
- }
101
- }
102
- }
103
- function findKey(obj, key) {
104
- if (isBuffer(obj)) {
105
- return null;
106
- }
107
- key = key.toLowerCase();
108
- const keys = Object.keys(obj);
109
- let i = keys.length;
110
- let _key;
111
- while (i-- > 0) {
112
- _key = keys[i];
113
- if (key === _key.toLowerCase()) {
114
- return _key;
115
- }
116
- }
117
- return null;
118
- }
119
- var _global = (() => {
120
- if (typeof globalThis !== "undefined") return globalThis;
121
- return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
122
- })();
123
- var isContextDefined = (context) => !isUndefined(context) && context !== _global;
124
- function merge() {
125
- const { caseless, skipUndefined } = isContextDefined(this) && this || {};
126
- const result = {};
127
- const assignValue = (val, key) => {
128
- const targetKey = caseless && findKey(result, key) || key;
129
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
130
- result[targetKey] = merge(result[targetKey], val);
131
- } else if (isPlainObject(val)) {
132
- result[targetKey] = merge({}, val);
133
- } else if (isArray(val)) {
134
- result[targetKey] = val.slice();
135
- } else if (!skipUndefined || !isUndefined(val)) {
136
- result[targetKey] = val;
137
- }
138
- };
139
- for (let i = 0, l = arguments.length; i < l; i++) {
140
- arguments[i] && forEach(arguments[i], assignValue);
141
- }
142
- return result;
143
- }
144
- var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
145
- forEach(b, (val, key) => {
146
- if (thisArg && isFunction(val)) {
147
- a[key] = bind(val, thisArg);
148
- } else {
149
- a[key] = val;
150
- }
151
- }, { allOwnKeys });
152
- return a;
153
- };
154
- var stripBOM = (content) => {
155
- if (content.charCodeAt(0) === 65279) {
156
- content = content.slice(1);
157
- }
158
- return content;
159
- };
160
- var inherits = (constructor, superConstructor, props, descriptors2) => {
161
- constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
162
- constructor.prototype.constructor = constructor;
163
- Object.defineProperty(constructor, "super", {
164
- value: superConstructor.prototype
165
- });
166
- props && Object.assign(constructor.prototype, props);
167
- };
168
- var toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
169
- let props;
170
- let i;
171
- let prop;
172
- const merged = {};
173
- destObj = destObj || {};
174
- if (sourceObj == null) return destObj;
175
- do {
176
- props = Object.getOwnPropertyNames(sourceObj);
177
- i = props.length;
178
- while (i-- > 0) {
179
- prop = props[i];
180
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
181
- destObj[prop] = sourceObj[prop];
182
- merged[prop] = true;
183
- }
184
- }
185
- sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
186
- } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
187
- return destObj;
188
- };
189
- var endsWith = (str, searchString, position) => {
190
- str = String(str);
191
- if (position === void 0 || position > str.length) {
192
- position = str.length;
193
- }
194
- position -= searchString.length;
195
- const lastIndex = str.indexOf(searchString, position);
196
- return lastIndex !== -1 && lastIndex === position;
197
- };
198
- var toArray = (thing) => {
199
- if (!thing) return null;
200
- if (isArray(thing)) return thing;
201
- let i = thing.length;
202
- if (!isNumber(i)) return null;
203
- const arr = new Array(i);
204
- while (i-- > 0) {
205
- arr[i] = thing[i];
206
- }
207
- return arr;
208
- };
209
- var isTypedArray = /* @__PURE__ */ ((TypedArray) => {
210
- return (thing) => {
211
- return TypedArray && thing instanceof TypedArray;
212
- };
213
- })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
214
- var forEachEntry = (obj, fn) => {
215
- const generator = obj && obj[iterator];
216
- const _iterator = generator.call(obj);
217
- let result;
218
- while ((result = _iterator.next()) && !result.done) {
219
- const pair = result.value;
220
- fn.call(obj, pair[0], pair[1]);
221
- }
222
- };
223
- var matchAll = (regExp, str) => {
224
- let matches;
225
- const arr = [];
226
- while ((matches = regExp.exec(str)) !== null) {
227
- arr.push(matches);
228
- }
229
- return arr;
230
- };
231
- var isHTMLForm = kindOfTest("HTMLFormElement");
232
- var toCamelCase = (str) => {
233
- return str.toLowerCase().replace(
234
- /[-_\s]([a-z\d])(\w*)/g,
235
- function replacer(m, p1, p2) {
236
- return p1.toUpperCase() + p2;
237
- }
238
- );
239
- };
240
- var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
241
- var isRegExp = kindOfTest("RegExp");
242
- var reduceDescriptors = (obj, reducer) => {
243
- const descriptors2 = Object.getOwnPropertyDescriptors(obj);
244
- const reducedDescriptors = {};
245
- forEach(descriptors2, (descriptor, name) => {
246
- let ret;
247
- if ((ret = reducer(descriptor, name, obj)) !== false) {
248
- reducedDescriptors[name] = ret || descriptor;
249
- }
250
- });
251
- Object.defineProperties(obj, reducedDescriptors);
252
- };
253
- var freezeMethods = (obj) => {
254
- reduceDescriptors(obj, (descriptor, name) => {
255
- if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
256
- return false;
257
- }
258
- const value = obj[name];
259
- if (!isFunction(value)) return;
260
- descriptor.enumerable = false;
261
- if ("writable" in descriptor) {
262
- descriptor.writable = false;
263
- return;
264
- }
265
- if (!descriptor.set) {
266
- descriptor.set = () => {
267
- throw Error("Can not rewrite read-only method '" + name + "'");
268
- };
269
- }
270
- });
271
- };
272
- var toObjectSet = (arrayOrString, delimiter) => {
273
- const obj = {};
274
- const define = (arr) => {
275
- arr.forEach((value) => {
276
- obj[value] = true;
277
- });
278
- };
279
- isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
280
- return obj;
281
- };
282
- var noop = () => {
283
- };
284
- var toFiniteNumber = (value, defaultValue) => {
285
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
286
- };
287
- function isSpecCompliantForm(thing) {
288
- return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
289
- }
290
- var toJSONObject = (obj) => {
291
- const stack = new Array(10);
292
- const visit = (source, i) => {
293
- if (isObject(source)) {
294
- if (stack.indexOf(source) >= 0) {
295
- return;
296
- }
297
- if (isBuffer(source)) {
298
- return source;
299
- }
300
- if (!("toJSON" in source)) {
301
- stack[i] = source;
302
- const target = isArray(source) ? [] : {};
303
- forEach(source, (value, key) => {
304
- const reducedValue = visit(value, i + 1);
305
- !isUndefined(reducedValue) && (target[key] = reducedValue);
306
- });
307
- stack[i] = void 0;
308
- return target;
309
- }
310
- }
311
- return source;
312
- };
313
- return visit(obj, 0);
314
- };
315
- var isAsyncFn = kindOfTest("AsyncFunction");
316
- var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
317
- var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
318
- if (setImmediateSupported) {
319
- return setImmediate;
320
- }
321
- return postMessageSupported ? ((token, callbacks) => {
322
- _global.addEventListener("message", ({ source, data }) => {
323
- if (source === _global && data === token) {
324
- callbacks.length && callbacks.shift()();
325
- }
326
- }, false);
327
- return (cb) => {
328
- callbacks.push(cb);
329
- _global.postMessage(token, "*");
330
- };
331
- })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
332
- })(
333
- typeof setImmediate === "function",
334
- isFunction(_global.postMessage)
335
- );
336
- var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
337
- var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
338
- var utils_default = {
339
- isArray,
340
- isArrayBuffer,
341
- isBuffer,
342
- isFormData,
343
- isArrayBufferView,
344
- isString,
345
- isNumber,
346
- isBoolean,
347
- isObject,
348
- isPlainObject,
349
- isEmptyObject,
350
- isReadableStream,
351
- isRequest,
352
- isResponse,
353
- isHeaders,
354
- isUndefined,
355
- isDate,
356
- isFile,
357
- isBlob,
358
- isRegExp,
359
- isFunction,
360
- isStream,
361
- isURLSearchParams,
362
- isTypedArray,
363
- isFileList,
364
- forEach,
365
- merge,
366
- extend,
367
- trim,
368
- stripBOM,
369
- inherits,
370
- toFlatObject,
371
- kindOf,
372
- kindOfTest,
373
- endsWith,
374
- toArray,
375
- forEachEntry,
376
- matchAll,
377
- isHTMLForm,
378
- hasOwnProperty,
379
- hasOwnProp: hasOwnProperty,
380
- // an alias to avoid ESLint no-prototype-builtins detection
381
- reduceDescriptors,
382
- freezeMethods,
383
- toObjectSet,
384
- toCamelCase,
385
- noop,
386
- toFiniteNumber,
387
- findKey,
388
- global: _global,
389
- isContextDefined,
390
- isSpecCompliantForm,
391
- toJSONObject,
392
- isAsyncFn,
393
- isThenable,
394
- setImmediate: _setImmediate,
395
- asap,
396
- isIterable
397
- };
398
-
399
- // ../../node_modules/axios/lib/core/AxiosError.js
400
- function AxiosError(message, code, config, request, response) {
401
- Error.call(this);
402
- if (Error.captureStackTrace) {
403
- Error.captureStackTrace(this, this.constructor);
404
- } else {
405
- this.stack = new Error().stack;
406
- }
407
- this.message = message;
408
- this.name = "AxiosError";
409
- code && (this.code = code);
410
- config && (this.config = config);
411
- request && (this.request = request);
412
- if (response) {
413
- this.response = response;
414
- this.status = response.status ? response.status : null;
415
- }
416
- }
417
- utils_default.inherits(AxiosError, Error, {
418
- toJSON: function toJSON() {
419
- return {
420
- // Standard
421
- message: this.message,
422
- name: this.name,
423
- // Microsoft
424
- description: this.description,
425
- number: this.number,
426
- // Mozilla
427
- fileName: this.fileName,
428
- lineNumber: this.lineNumber,
429
- columnNumber: this.columnNumber,
430
- stack: this.stack,
431
- // Axios
432
- config: utils_default.toJSONObject(this.config),
433
- code: this.code,
434
- status: this.status
435
- };
436
- }
437
- });
438
- var prototype = AxiosError.prototype;
439
- var descriptors = {};
440
- [
441
- "ERR_BAD_OPTION_VALUE",
442
- "ERR_BAD_OPTION",
443
- "ECONNABORTED",
444
- "ETIMEDOUT",
445
- "ERR_NETWORK",
446
- "ERR_FR_TOO_MANY_REDIRECTS",
447
- "ERR_DEPRECATED",
448
- "ERR_BAD_RESPONSE",
449
- "ERR_BAD_REQUEST",
450
- "ERR_CANCELED",
451
- "ERR_NOT_SUPPORT",
452
- "ERR_INVALID_URL"
453
- // eslint-disable-next-line func-names
454
- ].forEach((code) => {
455
- descriptors[code] = { value: code };
456
- });
457
- Object.defineProperties(AxiosError, descriptors);
458
- Object.defineProperty(prototype, "isAxiosError", { value: true });
459
- AxiosError.from = (error, code, config, request, response, customProps) => {
460
- const axiosError = Object.create(prototype);
461
- utils_default.toFlatObject(error, axiosError, function filter2(obj) {
462
- return obj !== Error.prototype;
463
- }, (prop) => {
464
- return prop !== "isAxiosError";
465
- });
466
- const msg = error && error.message ? error.message : "Error";
467
- const errCode = code == null && error ? error.code : code;
468
- AxiosError.call(axiosError, msg, errCode, config, request, response);
469
- if (error && axiosError.cause == null) {
470
- Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
471
- }
472
- axiosError.name = error && error.name || "Error";
473
- customProps && Object.assign(axiosError, customProps);
474
- return axiosError;
475
- };
476
- var AxiosError_default = AxiosError;
477
-
478
- // ../../node_modules/axios/lib/helpers/null.js
479
- var null_default = null;
480
-
481
- // ../../node_modules/axios/lib/helpers/toFormData.js
482
- function isVisitable(thing) {
483
- return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
484
- }
485
- function removeBrackets(key) {
486
- return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
487
- }
488
- function renderKey(path, key, dots) {
489
- if (!path) return key;
490
- return path.concat(key).map(function each(token, i) {
491
- token = removeBrackets(token);
492
- return !dots && i ? "[" + token + "]" : token;
493
- }).join(dots ? "." : "");
494
- }
495
- function isFlatArray(arr) {
496
- return utils_default.isArray(arr) && !arr.some(isVisitable);
497
- }
498
- var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
499
- return /^is[A-Z]/.test(prop);
500
- });
501
- function toFormData(obj, formData, options) {
502
- if (!utils_default.isObject(obj)) {
503
- throw new TypeError("target must be an object");
504
- }
505
- formData = formData || new (FormData)();
506
- options = utils_default.toFlatObject(options, {
507
- metaTokens: true,
508
- dots: false,
509
- indexes: false
510
- }, false, function defined(option, source) {
511
- return !utils_default.isUndefined(source[option]);
512
- });
513
- const metaTokens = options.metaTokens;
514
- const visitor = options.visitor || defaultVisitor;
515
- const dots = options.dots;
516
- const indexes = options.indexes;
517
- const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
518
- const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
519
- if (!utils_default.isFunction(visitor)) {
520
- throw new TypeError("visitor must be a function");
521
- }
522
- function convertValue(value) {
523
- if (value === null) return "";
524
- if (utils_default.isDate(value)) {
525
- return value.toISOString();
526
- }
527
- if (utils_default.isBoolean(value)) {
528
- return value.toString();
529
- }
530
- if (!useBlob && utils_default.isBlob(value)) {
531
- throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
532
- }
533
- if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) {
534
- return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
535
- }
536
- return value;
537
- }
538
- function defaultVisitor(value, key, path) {
539
- let arr = value;
540
- if (value && !path && typeof value === "object") {
541
- if (utils_default.endsWith(key, "{}")) {
542
- key = metaTokens ? key : key.slice(0, -2);
543
- value = JSON.stringify(value);
544
- } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
545
- key = removeBrackets(key);
546
- arr.forEach(function each(el, index) {
547
- !(utils_default.isUndefined(el) || el === null) && formData.append(
548
- // eslint-disable-next-line no-nested-ternary
549
- indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
550
- convertValue(el)
551
- );
552
- });
553
- return false;
554
- }
555
- }
556
- if (isVisitable(value)) {
557
- return true;
558
- }
559
- formData.append(renderKey(path, key, dots), convertValue(value));
560
- return false;
561
- }
562
- const stack = [];
563
- const exposedHelpers = Object.assign(predicates, {
564
- defaultVisitor,
565
- convertValue,
566
- isVisitable
567
- });
568
- function build(value, path) {
569
- if (utils_default.isUndefined(value)) return;
570
- if (stack.indexOf(value) !== -1) {
571
- throw Error("Circular reference detected in " + path.join("."));
572
- }
573
- stack.push(value);
574
- utils_default.forEach(value, function each(el, key) {
575
- const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(
576
- formData,
577
- el,
578
- utils_default.isString(key) ? key.trim() : key,
579
- path,
580
- exposedHelpers
581
- );
582
- if (result === true) {
583
- build(el, path ? path.concat(key) : [key]);
584
- }
585
- });
586
- stack.pop();
587
- }
588
- if (!utils_default.isObject(obj)) {
589
- throw new TypeError("data must be an object");
590
- }
591
- build(obj);
592
- return formData;
593
- }
594
- var toFormData_default = toFormData;
595
-
596
- // ../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js
597
- function encode(str) {
598
- const charMap = {
599
- "!": "%21",
600
- "'": "%27",
601
- "(": "%28",
602
- ")": "%29",
603
- "~": "%7E",
604
- "%20": "+",
605
- "%00": "\0"
606
- };
607
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
608
- return charMap[match];
609
- });
610
- }
611
- function AxiosURLSearchParams(params, options) {
612
- this._pairs = [];
613
- params && toFormData_default(params, this, options);
614
- }
615
- var prototype2 = AxiosURLSearchParams.prototype;
616
- prototype2.append = function append(name, value) {
617
- this._pairs.push([name, value]);
618
- };
619
- prototype2.toString = function toString2(encoder) {
620
- const _encode = encoder ? function(value) {
621
- return encoder.call(this, value, encode);
622
- } : encode;
623
- return this._pairs.map(function each(pair) {
624
- return _encode(pair[0]) + "=" + _encode(pair[1]);
625
- }, "").join("&");
626
- };
627
- var AxiosURLSearchParams_default = AxiosURLSearchParams;
628
-
629
- // ../../node_modules/axios/lib/helpers/buildURL.js
630
- function encode2(val) {
631
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
632
- }
633
- function buildURL(url, params, options) {
634
- if (!params) {
635
- return url;
636
- }
637
- const _encode = options && options.encode || encode2;
638
- if (utils_default.isFunction(options)) {
639
- options = {
640
- serialize: options
641
- };
642
- }
643
- const serializeFn = options && options.serialize;
644
- let serializedParams;
645
- if (serializeFn) {
646
- serializedParams = serializeFn(params, options);
647
- } else {
648
- serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, options).toString(_encode);
649
- }
650
- if (serializedParams) {
651
- const hashmarkIndex = url.indexOf("#");
652
- if (hashmarkIndex !== -1) {
653
- url = url.slice(0, hashmarkIndex);
654
- }
655
- url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
656
- }
657
- return url;
658
- }
659
-
660
- // ../../node_modules/axios/lib/core/InterceptorManager.js
661
- var InterceptorManager = class {
662
- constructor() {
663
- this.handlers = [];
664
- }
665
- /**
666
- * Add a new interceptor to the stack
667
- *
668
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
669
- * @param {Function} rejected The function to handle `reject` for a `Promise`
670
- *
671
- * @return {Number} An ID used to remove interceptor later
672
- */
673
- use(fulfilled, rejected, options) {
674
- this.handlers.push({
675
- fulfilled,
676
- rejected,
677
- synchronous: options ? options.synchronous : false,
678
- runWhen: options ? options.runWhen : null
679
- });
680
- return this.handlers.length - 1;
681
- }
682
- /**
683
- * Remove an interceptor from the stack
684
- *
685
- * @param {Number} id The ID that was returned by `use`
686
- *
687
- * @returns {void}
688
- */
689
- eject(id) {
690
- if (this.handlers[id]) {
691
- this.handlers[id] = null;
692
- }
693
- }
694
- /**
695
- * Clear all interceptors from the stack
696
- *
697
- * @returns {void}
698
- */
699
- clear() {
700
- if (this.handlers) {
701
- this.handlers = [];
702
- }
703
- }
704
- /**
705
- * Iterate over all the registered interceptors
706
- *
707
- * This method is particularly useful for skipping over any
708
- * interceptors that may have become `null` calling `eject`.
709
- *
710
- * @param {Function} fn The function to call for each interceptor
711
- *
712
- * @returns {void}
713
- */
714
- forEach(fn) {
715
- utils_default.forEach(this.handlers, function forEachHandler(h) {
716
- if (h !== null) {
717
- fn(h);
718
- }
719
- });
720
- }
721
- };
722
- var InterceptorManager_default = InterceptorManager;
723
-
724
- // ../../node_modules/axios/lib/defaults/transitional.js
725
- var transitional_default = {
726
- silentJSONParsing: true,
727
- forcedJSONParsing: true,
728
- clarifyTimeoutError: false
729
- };
730
-
731
- // ../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
732
- var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default;
733
-
734
- // ../../node_modules/axios/lib/platform/browser/classes/FormData.js
735
- var FormData_default = typeof FormData !== "undefined" ? FormData : null;
736
-
737
- // ../../node_modules/axios/lib/platform/browser/classes/Blob.js
738
- var Blob_default = typeof Blob !== "undefined" ? Blob : null;
739
-
740
- // ../../node_modules/axios/lib/platform/browser/index.js
741
- var browser_default = {
742
- isBrowser: true,
743
- classes: {
744
- URLSearchParams: URLSearchParams_default,
745
- FormData: FormData_default,
746
- Blob: Blob_default
747
- },
748
- protocols: ["http", "https", "file", "blob", "url", "data"]
749
- };
750
-
751
- // ../../node_modules/axios/lib/platform/common/utils.js
752
- var utils_exports = {};
753
- __export(utils_exports, {
754
- hasBrowserEnv: () => hasBrowserEnv,
755
- hasStandardBrowserEnv: () => hasStandardBrowserEnv,
756
- hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
757
- navigator: () => _navigator,
758
- origin: () => origin
759
- });
760
- var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
761
- var _navigator = typeof navigator === "object" && navigator || void 0;
762
- var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
763
- var hasStandardBrowserWebWorkerEnv = (() => {
764
- return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
765
- self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
766
- })();
767
- var origin = hasBrowserEnv && window.location.href || "http://localhost";
768
-
769
- // ../../node_modules/axios/lib/platform/index.js
770
- var platform_default = {
771
- ...utils_exports,
772
- ...browser_default
773
- };
774
-
775
- // ../../node_modules/axios/lib/helpers/toURLEncodedForm.js
776
- function toURLEncodedForm(data, options) {
777
- return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
778
- visitor: function(value, key, path, helpers) {
779
- if (platform_default.isNode && utils_default.isBuffer(value)) {
780
- this.append(key, value.toString("base64"));
781
- return false;
782
- }
783
- return helpers.defaultVisitor.apply(this, arguments);
784
- },
785
- ...options
786
- });
787
- }
788
-
789
- // ../../node_modules/axios/lib/helpers/formDataToJSON.js
790
- function parsePropPath(name) {
791
- return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
792
- return match[0] === "[]" ? "" : match[1] || match[0];
793
- });
794
- }
795
- function arrayToObject(arr) {
796
- const obj = {};
797
- const keys = Object.keys(arr);
798
- let i;
799
- const len = keys.length;
800
- let key;
801
- for (i = 0; i < len; i++) {
802
- key = keys[i];
803
- obj[key] = arr[key];
804
- }
805
- return obj;
806
- }
807
- function formDataToJSON(formData) {
808
- function buildPath(path, value, target, index) {
809
- let name = path[index++];
810
- if (name === "__proto__") return true;
811
- const isNumericKey = Number.isFinite(+name);
812
- const isLast = index >= path.length;
813
- name = !name && utils_default.isArray(target) ? target.length : name;
814
- if (isLast) {
815
- if (utils_default.hasOwnProp(target, name)) {
816
- target[name] = [target[name], value];
817
- } else {
818
- target[name] = value;
819
- }
820
- return !isNumericKey;
821
- }
822
- if (!target[name] || !utils_default.isObject(target[name])) {
823
- target[name] = [];
824
- }
825
- const result = buildPath(path, value, target[name], index);
826
- if (result && utils_default.isArray(target[name])) {
827
- target[name] = arrayToObject(target[name]);
828
- }
829
- return !isNumericKey;
830
- }
831
- if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
832
- const obj = {};
833
- utils_default.forEachEntry(formData, (name, value) => {
834
- buildPath(parsePropPath(name), value, obj, 0);
835
- });
836
- return obj;
837
- }
838
- return null;
839
- }
840
- var formDataToJSON_default = formDataToJSON;
841
-
842
- // ../../node_modules/axios/lib/defaults/index.js
843
- function stringifySafely(rawValue, parser, encoder) {
844
- if (utils_default.isString(rawValue)) {
845
- try {
846
- (parser || JSON.parse)(rawValue);
847
- return utils_default.trim(rawValue);
848
- } catch (e) {
849
- if (e.name !== "SyntaxError") {
850
- throw e;
851
- }
852
- }
853
- }
854
- return (encoder || JSON.stringify)(rawValue);
855
- }
856
- var defaults = {
857
- transitional: transitional_default,
858
- adapter: ["xhr", "http", "fetch"],
859
- transformRequest: [function transformRequest(data, headers) {
860
- const contentType = headers.getContentType() || "";
861
- const hasJSONContentType = contentType.indexOf("application/json") > -1;
862
- const isObjectPayload = utils_default.isObject(data);
863
- if (isObjectPayload && utils_default.isHTMLForm(data)) {
864
- data = new FormData(data);
865
- }
866
- const isFormData2 = utils_default.isFormData(data);
867
- if (isFormData2) {
868
- return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
869
- }
870
- 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)) {
871
- return data;
872
- }
873
- if (utils_default.isArrayBufferView(data)) {
874
- return data.buffer;
875
- }
876
- if (utils_default.isURLSearchParams(data)) {
877
- headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
878
- return data.toString();
879
- }
880
- let isFileList2;
881
- if (isObjectPayload) {
882
- if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
883
- return toURLEncodedForm(data, this.formSerializer).toString();
884
- }
885
- if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
886
- const _FormData = this.env && this.env.FormData;
887
- return toFormData_default(
888
- isFileList2 ? { "files[]": data } : data,
889
- _FormData && new _FormData(),
890
- this.formSerializer
891
- );
892
- }
893
- }
894
- if (isObjectPayload || hasJSONContentType) {
895
- headers.setContentType("application/json", false);
896
- return stringifySafely(data);
897
- }
898
- return data;
899
- }],
900
- transformResponse: [function transformResponse(data) {
901
- const transitional2 = this.transitional || defaults.transitional;
902
- const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
903
- const JSONRequested = this.responseType === "json";
904
- if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
905
- return data;
906
- }
907
- if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
908
- const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
909
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
910
- try {
911
- return JSON.parse(data, this.parseReviver);
912
- } catch (e) {
913
- if (strictJSONParsing) {
914
- if (e.name === "SyntaxError") {
915
- throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
916
- }
917
- throw e;
918
- }
919
- }
920
- }
921
- return data;
922
- }],
923
- /**
924
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
925
- * timeout is not created.
926
- */
927
- timeout: 0,
928
- xsrfCookieName: "XSRF-TOKEN",
929
- xsrfHeaderName: "X-XSRF-TOKEN",
930
- maxContentLength: -1,
931
- maxBodyLength: -1,
932
- env: {
933
- FormData: platform_default.classes.FormData,
934
- Blob: platform_default.classes.Blob
935
- },
936
- validateStatus: function validateStatus(status) {
937
- return status >= 200 && status < 300;
938
- },
939
- headers: {
940
- common: {
941
- "Accept": "application/json, text/plain, */*",
942
- "Content-Type": void 0
943
- }
944
- }
945
- };
946
- utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
947
- defaults.headers[method] = {};
948
- });
949
- var defaults_default = defaults;
950
-
951
- // ../../node_modules/axios/lib/helpers/parseHeaders.js
952
- var ignoreDuplicateOf = utils_default.toObjectSet([
953
- "age",
954
- "authorization",
955
- "content-length",
956
- "content-type",
957
- "etag",
958
- "expires",
959
- "from",
960
- "host",
961
- "if-modified-since",
962
- "if-unmodified-since",
963
- "last-modified",
964
- "location",
965
- "max-forwards",
966
- "proxy-authorization",
967
- "referer",
968
- "retry-after",
969
- "user-agent"
970
- ]);
971
- var parseHeaders_default = (rawHeaders) => {
972
- const parsed = {};
973
- let key;
974
- let val;
975
- let i;
976
- rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
977
- i = line.indexOf(":");
978
- key = line.substring(0, i).trim().toLowerCase();
979
- val = line.substring(i + 1).trim();
980
- if (!key || parsed[key] && ignoreDuplicateOf[key]) {
981
- return;
982
- }
983
- if (key === "set-cookie") {
984
- if (parsed[key]) {
985
- parsed[key].push(val);
986
- } else {
987
- parsed[key] = [val];
988
- }
989
- } else {
990
- parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
991
- }
992
- });
993
- return parsed;
994
- };
995
-
996
- // ../../node_modules/axios/lib/core/AxiosHeaders.js
997
- var $internals = /* @__PURE__ */ Symbol("internals");
998
- function normalizeHeader(header) {
999
- return header && String(header).trim().toLowerCase();
1000
- }
1001
- function normalizeValue(value) {
1002
- if (value === false || value == null) {
1003
- return value;
1004
- }
1005
- return utils_default.isArray(value) ? value.map(normalizeValue) : String(value);
1006
- }
1007
- function parseTokens(str) {
1008
- const tokens = /* @__PURE__ */ Object.create(null);
1009
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1010
- let match;
1011
- while (match = tokensRE.exec(str)) {
1012
- tokens[match[1]] = match[2];
1013
- }
1014
- return tokens;
1015
- }
1016
- var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1017
- function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
1018
- if (utils_default.isFunction(filter2)) {
1019
- return filter2.call(this, value, header);
1020
- }
1021
- if (isHeaderNameFilter) {
1022
- value = header;
1023
- }
1024
- if (!utils_default.isString(value)) return;
1025
- if (utils_default.isString(filter2)) {
1026
- return value.indexOf(filter2) !== -1;
1027
- }
1028
- if (utils_default.isRegExp(filter2)) {
1029
- return filter2.test(value);
1030
- }
1031
- }
1032
- function formatHeader(header) {
1033
- return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1034
- return char.toUpperCase() + str;
1035
- });
1036
- }
1037
- function buildAccessors(obj, header) {
1038
- const accessorName = utils_default.toCamelCase(" " + header);
1039
- ["get", "set", "has"].forEach((methodName) => {
1040
- Object.defineProperty(obj, methodName + accessorName, {
1041
- value: function(arg1, arg2, arg3) {
1042
- return this[methodName].call(this, header, arg1, arg2, arg3);
1043
- },
1044
- configurable: true
1045
- });
1046
- });
1047
- }
1048
- var AxiosHeaders = class {
1049
- constructor(headers) {
1050
- headers && this.set(headers);
1051
- }
1052
- set(header, valueOrRewrite, rewrite) {
1053
- const self2 = this;
1054
- function setHeader(_value, _header, _rewrite) {
1055
- const lHeader = normalizeHeader(_header);
1056
- if (!lHeader) {
1057
- throw new Error("header name must be a non-empty string");
1058
- }
1059
- const key = utils_default.findKey(self2, lHeader);
1060
- if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
1061
- self2[key || _header] = normalizeValue(_value);
1062
- }
1063
- }
1064
- const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1065
- if (utils_default.isPlainObject(header) || header instanceof this.constructor) {
1066
- setHeaders(header, valueOrRewrite);
1067
- } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1068
- setHeaders(parseHeaders_default(header), valueOrRewrite);
1069
- } else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
1070
- let obj = {}, dest, key;
1071
- for (const entry of header) {
1072
- if (!utils_default.isArray(entry)) {
1073
- throw TypeError("Object iterator must return a key-value pair");
1074
- }
1075
- obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
1076
- }
1077
- setHeaders(obj, valueOrRewrite);
1078
- } else {
1079
- header != null && setHeader(valueOrRewrite, header, rewrite);
1080
- }
1081
- return this;
1082
- }
1083
- get(header, parser) {
1084
- header = normalizeHeader(header);
1085
- if (header) {
1086
- const key = utils_default.findKey(this, header);
1087
- if (key) {
1088
- const value = this[key];
1089
- if (!parser) {
1090
- return value;
1091
- }
1092
- if (parser === true) {
1093
- return parseTokens(value);
1094
- }
1095
- if (utils_default.isFunction(parser)) {
1096
- return parser.call(this, value, key);
1097
- }
1098
- if (utils_default.isRegExp(parser)) {
1099
- return parser.exec(value);
1100
- }
1101
- throw new TypeError("parser must be boolean|regexp|function");
1102
- }
1103
- }
1104
- }
1105
- has(header, matcher) {
1106
- header = normalizeHeader(header);
1107
- if (header) {
1108
- const key = utils_default.findKey(this, header);
1109
- return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1110
- }
1111
- return false;
1112
- }
1113
- delete(header, matcher) {
1114
- const self2 = this;
1115
- let deleted = false;
1116
- function deleteHeader(_header) {
1117
- _header = normalizeHeader(_header);
1118
- if (_header) {
1119
- const key = utils_default.findKey(self2, _header);
1120
- if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
1121
- delete self2[key];
1122
- deleted = true;
1123
- }
1124
- }
1125
- }
1126
- if (utils_default.isArray(header)) {
1127
- header.forEach(deleteHeader);
1128
- } else {
1129
- deleteHeader(header);
1130
- }
1131
- return deleted;
1132
- }
1133
- clear(matcher) {
1134
- const keys = Object.keys(this);
1135
- let i = keys.length;
1136
- let deleted = false;
1137
- while (i--) {
1138
- const key = keys[i];
1139
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1140
- delete this[key];
1141
- deleted = true;
1142
- }
1143
- }
1144
- return deleted;
1145
- }
1146
- normalize(format) {
1147
- const self2 = this;
1148
- const headers = {};
1149
- utils_default.forEach(this, (value, header) => {
1150
- const key = utils_default.findKey(headers, header);
1151
- if (key) {
1152
- self2[key] = normalizeValue(value);
1153
- delete self2[header];
1154
- return;
1155
- }
1156
- const normalized = format ? formatHeader(header) : String(header).trim();
1157
- if (normalized !== header) {
1158
- delete self2[header];
1159
- }
1160
- self2[normalized] = normalizeValue(value);
1161
- headers[normalized] = true;
1162
- });
1163
- return this;
1164
- }
1165
- concat(...targets) {
1166
- return this.constructor.concat(this, ...targets);
1167
- }
1168
- toJSON(asStrings) {
1169
- const obj = /* @__PURE__ */ Object.create(null);
1170
- utils_default.forEach(this, (value, header) => {
1171
- value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
1172
- });
1173
- return obj;
1174
- }
1175
- [Symbol.iterator]() {
1176
- return Object.entries(this.toJSON())[Symbol.iterator]();
1177
- }
1178
- toString() {
1179
- return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
1180
- }
1181
- getSetCookie() {
1182
- return this.get("set-cookie") || [];
1183
- }
1184
- get [Symbol.toStringTag]() {
1185
- return "AxiosHeaders";
1186
- }
1187
- static from(thing) {
1188
- return thing instanceof this ? thing : new this(thing);
1189
- }
1190
- static concat(first, ...targets) {
1191
- const computed = new this(first);
1192
- targets.forEach((target) => computed.set(target));
1193
- return computed;
1194
- }
1195
- static accessor(header) {
1196
- const internals = this[$internals] = this[$internals] = {
1197
- accessors: {}
1198
- };
1199
- const accessors = internals.accessors;
1200
- const prototype3 = this.prototype;
1201
- function defineAccessor(_header) {
1202
- const lHeader = normalizeHeader(_header);
1203
- if (!accessors[lHeader]) {
1204
- buildAccessors(prototype3, _header);
1205
- accessors[lHeader] = true;
1206
- }
1207
- }
1208
- utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1209
- return this;
1210
- }
1211
- };
1212
- AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1213
- utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
1214
- let mapped = key[0].toUpperCase() + key.slice(1);
1215
- return {
1216
- get: () => value,
1217
- set(headerValue) {
1218
- this[mapped] = headerValue;
1219
- }
1220
- };
1221
- });
1222
- utils_default.freezeMethods(AxiosHeaders);
1223
- var AxiosHeaders_default = AxiosHeaders;
1224
-
1225
- // ../../node_modules/axios/lib/core/transformData.js
1226
- function transformData(fns, response) {
1227
- const config = this || defaults_default;
1228
- const context = response || config;
1229
- const headers = AxiosHeaders_default.from(context.headers);
1230
- let data = context.data;
1231
- utils_default.forEach(fns, function transform(fn) {
1232
- data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
1233
- });
1234
- headers.normalize();
1235
- return data;
1236
- }
1237
-
1238
- // ../../node_modules/axios/lib/cancel/isCancel.js
1239
- function isCancel(value) {
1240
- return !!(value && value.__CANCEL__);
1241
- }
1242
-
1243
- // ../../node_modules/axios/lib/cancel/CanceledError.js
1244
- function CanceledError(message, config, request) {
1245
- AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
1246
- this.name = "CanceledError";
1247
- }
1248
- utils_default.inherits(CanceledError, AxiosError_default, {
1249
- __CANCEL__: true
1250
- });
1251
- var CanceledError_default = CanceledError;
1252
-
1253
- // ../../node_modules/axios/lib/core/settle.js
1254
- function settle(resolve, reject, response) {
1255
- const validateStatus2 = response.config.validateStatus;
1256
- if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
1257
- resolve(response);
1258
- } else {
1259
- reject(new AxiosError_default(
1260
- "Request failed with status code " + response.status,
1261
- [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
1262
- response.config,
1263
- response.request,
1264
- response
1265
- ));
1266
- }
1267
- }
1268
-
1269
- // ../../node_modules/axios/lib/helpers/parseProtocol.js
1270
- function parseProtocol(url) {
1271
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
1272
- return match && match[1] || "";
1273
- }
1274
-
1275
- // ../../node_modules/axios/lib/helpers/speedometer.js
1276
- function speedometer(samplesCount, min) {
1277
- samplesCount = samplesCount || 10;
1278
- const bytes = new Array(samplesCount);
1279
- const timestamps = new Array(samplesCount);
1280
- let head = 0;
1281
- let tail = 0;
1282
- let firstSampleTS;
1283
- min = min !== void 0 ? min : 1e3;
1284
- return function push(chunkLength) {
1285
- const now = Date.now();
1286
- const startedAt = timestamps[tail];
1287
- if (!firstSampleTS) {
1288
- firstSampleTS = now;
1289
- }
1290
- bytes[head] = chunkLength;
1291
- timestamps[head] = now;
1292
- let i = tail;
1293
- let bytesCount = 0;
1294
- while (i !== head) {
1295
- bytesCount += bytes[i++];
1296
- i = i % samplesCount;
1297
- }
1298
- head = (head + 1) % samplesCount;
1299
- if (head === tail) {
1300
- tail = (tail + 1) % samplesCount;
1301
- }
1302
- if (now - firstSampleTS < min) {
1303
- return;
1304
- }
1305
- const passed = startedAt && now - startedAt;
1306
- return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
1307
- };
1308
- }
1309
- var speedometer_default = speedometer;
1310
-
1311
- // ../../node_modules/axios/lib/helpers/throttle.js
1312
- function throttle(fn, freq) {
1313
- let timestamp = 0;
1314
- let threshold = 1e3 / freq;
1315
- let lastArgs;
1316
- let timer;
1317
- const invoke = (args, now = Date.now()) => {
1318
- timestamp = now;
1319
- lastArgs = null;
1320
- if (timer) {
1321
- clearTimeout(timer);
1322
- timer = null;
1323
- }
1324
- fn(...args);
1325
- };
1326
- const throttled = (...args) => {
1327
- const now = Date.now();
1328
- const passed = now - timestamp;
1329
- if (passed >= threshold) {
1330
- invoke(args, now);
1331
- } else {
1332
- lastArgs = args;
1333
- if (!timer) {
1334
- timer = setTimeout(() => {
1335
- timer = null;
1336
- invoke(lastArgs);
1337
- }, threshold - passed);
1338
- }
1339
- }
1340
- };
1341
- const flush = () => lastArgs && invoke(lastArgs);
1342
- return [throttled, flush];
1343
- }
1344
- var throttle_default = throttle;
1345
-
1346
- // ../../node_modules/axios/lib/helpers/progressEventReducer.js
1347
- var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
1348
- let bytesNotified = 0;
1349
- const _speedometer = speedometer_default(50, 250);
1350
- return throttle_default((e) => {
1351
- const loaded = e.loaded;
1352
- const total = e.lengthComputable ? e.total : void 0;
1353
- const progressBytes = loaded - bytesNotified;
1354
- const rate = _speedometer(progressBytes);
1355
- const inRange = loaded <= total;
1356
- bytesNotified = loaded;
1357
- const data = {
1358
- loaded,
1359
- total,
1360
- progress: total ? loaded / total : void 0,
1361
- bytes: progressBytes,
1362
- rate: rate ? rate : void 0,
1363
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
1364
- event: e,
1365
- lengthComputable: total != null,
1366
- [isDownloadStream ? "download" : "upload"]: true
1367
- };
1368
- listener(data);
1369
- }, freq);
1370
- };
1371
- var progressEventDecorator = (total, throttled) => {
1372
- const lengthComputable = total != null;
1373
- return [(loaded) => throttled[0]({
1374
- lengthComputable,
1375
- total,
1376
- loaded
1377
- }), throttled[1]];
1378
- };
1379
- var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
1380
-
1381
- // ../../node_modules/axios/lib/helpers/isURLSameOrigin.js
1382
- var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
1383
- url = new URL(url, platform_default.origin);
1384
- return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
1385
- })(
1386
- new URL(platform_default.origin),
1387
- platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
1388
- ) : () => true;
1389
-
1390
- // ../../node_modules/axios/lib/helpers/cookies.js
1391
- var cookies_default = platform_default.hasStandardBrowserEnv ? (
1392
- // Standard browser envs support document.cookie
1393
- {
1394
- write(name, value, expires, path, domain, secure, sameSite) {
1395
- if (typeof document === "undefined") return;
1396
- const cookie = [`${name}=${encodeURIComponent(value)}`];
1397
- if (utils_default.isNumber(expires)) {
1398
- cookie.push(`expires=${new Date(expires).toUTCString()}`);
1399
- }
1400
- if (utils_default.isString(path)) {
1401
- cookie.push(`path=${path}`);
1402
- }
1403
- if (utils_default.isString(domain)) {
1404
- cookie.push(`domain=${domain}`);
1405
- }
1406
- if (secure === true) {
1407
- cookie.push("secure");
1408
- }
1409
- if (utils_default.isString(sameSite)) {
1410
- cookie.push(`SameSite=${sameSite}`);
1411
- }
1412
- document.cookie = cookie.join("; ");
1413
- },
1414
- read(name) {
1415
- if (typeof document === "undefined") return null;
1416
- const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
1417
- return match ? decodeURIComponent(match[1]) : null;
1418
- },
1419
- remove(name) {
1420
- this.write(name, "", Date.now() - 864e5, "/");
1421
- }
1422
- }
1423
- ) : (
1424
- // Non-standard browser env (web workers, react-native) lack needed support.
1425
- {
1426
- write() {
1427
- },
1428
- read() {
1429
- return null;
1430
- },
1431
- remove() {
1432
- }
1433
- }
1434
- );
1435
-
1436
- // ../../node_modules/axios/lib/helpers/isAbsoluteURL.js
1437
- function isAbsoluteURL(url) {
1438
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
1439
- }
1440
-
1441
- // ../../node_modules/axios/lib/helpers/combineURLs.js
1442
- function combineURLs(baseURL, relativeURL) {
1443
- return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
1444
- }
1445
-
1446
- // ../../node_modules/axios/lib/core/buildFullPath.js
1447
- function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
1448
- let isRelativeUrl = !isAbsoluteURL(requestedURL);
1449
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
1450
- return combineURLs(baseURL, requestedURL);
1451
- }
1452
- return requestedURL;
1453
- }
1454
-
1455
- // ../../node_modules/axios/lib/core/mergeConfig.js
1456
- var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
1457
- function mergeConfig(config1, config2) {
1458
- config2 = config2 || {};
1459
- const config = {};
1460
- function getMergedValue(target, source, prop, caseless) {
1461
- if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
1462
- return utils_default.merge.call({ caseless }, target, source);
1463
- } else if (utils_default.isPlainObject(source)) {
1464
- return utils_default.merge({}, source);
1465
- } else if (utils_default.isArray(source)) {
1466
- return source.slice();
1467
- }
1468
- return source;
1469
- }
1470
- function mergeDeepProperties(a, b, prop, caseless) {
1471
- if (!utils_default.isUndefined(b)) {
1472
- return getMergedValue(a, b, prop, caseless);
1473
- } else if (!utils_default.isUndefined(a)) {
1474
- return getMergedValue(void 0, a, prop, caseless);
1475
- }
1476
- }
1477
- function valueFromConfig2(a, b) {
1478
- if (!utils_default.isUndefined(b)) {
1479
- return getMergedValue(void 0, b);
1480
- }
1481
- }
1482
- function defaultToConfig2(a, b) {
1483
- if (!utils_default.isUndefined(b)) {
1484
- return getMergedValue(void 0, b);
1485
- } else if (!utils_default.isUndefined(a)) {
1486
- return getMergedValue(void 0, a);
1487
- }
1488
- }
1489
- function mergeDirectKeys(a, b, prop) {
1490
- if (prop in config2) {
1491
- return getMergedValue(a, b);
1492
- } else if (prop in config1) {
1493
- return getMergedValue(void 0, a);
1494
- }
1495
- }
1496
- const mergeMap = {
1497
- url: valueFromConfig2,
1498
- method: valueFromConfig2,
1499
- data: valueFromConfig2,
1500
- baseURL: defaultToConfig2,
1501
- transformRequest: defaultToConfig2,
1502
- transformResponse: defaultToConfig2,
1503
- paramsSerializer: defaultToConfig2,
1504
- timeout: defaultToConfig2,
1505
- timeoutMessage: defaultToConfig2,
1506
- withCredentials: defaultToConfig2,
1507
- withXSRFToken: defaultToConfig2,
1508
- adapter: defaultToConfig2,
1509
- responseType: defaultToConfig2,
1510
- xsrfCookieName: defaultToConfig2,
1511
- xsrfHeaderName: defaultToConfig2,
1512
- onUploadProgress: defaultToConfig2,
1513
- onDownloadProgress: defaultToConfig2,
1514
- decompress: defaultToConfig2,
1515
- maxContentLength: defaultToConfig2,
1516
- maxBodyLength: defaultToConfig2,
1517
- beforeRedirect: defaultToConfig2,
1518
- transport: defaultToConfig2,
1519
- httpAgent: defaultToConfig2,
1520
- httpsAgent: defaultToConfig2,
1521
- cancelToken: defaultToConfig2,
1522
- socketPath: defaultToConfig2,
1523
- responseEncoding: defaultToConfig2,
1524
- validateStatus: mergeDirectKeys,
1525
- headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
1526
- };
1527
- utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
1528
- const merge2 = mergeMap[prop] || mergeDeepProperties;
1529
- const configValue = merge2(config1[prop], config2[prop], prop);
1530
- utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
1531
- });
1532
- return config;
1533
- }
1534
-
1535
- // ../../node_modules/axios/lib/helpers/resolveConfig.js
1536
- var resolveConfig_default = (config) => {
1537
- const newConfig = mergeConfig({}, config);
1538
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
1539
- newConfig.headers = headers = AxiosHeaders_default.from(headers);
1540
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
1541
- if (auth) {
1542
- headers.set(
1543
- "Authorization",
1544
- "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
1545
- );
1546
- }
1547
- if (utils_default.isFormData(data)) {
1548
- if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
1549
- headers.setContentType(void 0);
1550
- } else if (utils_default.isFunction(data.getHeaders)) {
1551
- const formHeaders = data.getHeaders();
1552
- const allowedHeaders = ["content-type", "content-length"];
1553
- Object.entries(formHeaders).forEach(([key, val]) => {
1554
- if (allowedHeaders.includes(key.toLowerCase())) {
1555
- headers.set(key, val);
1556
- }
1557
- });
1558
- }
1559
- }
1560
- if (platform_default.hasStandardBrowserEnv) {
1561
- withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
1562
- if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
1563
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
1564
- if (xsrfValue) {
1565
- headers.set(xsrfHeaderName, xsrfValue);
1566
- }
1567
- }
1568
- }
1569
- return newConfig;
1570
- };
1571
-
1572
- // ../../node_modules/axios/lib/adapters/xhr.js
1573
- var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
1574
- var xhr_default = isXHRAdapterSupported && function(config) {
1575
- return new Promise(function dispatchXhrRequest(resolve, reject) {
1576
- const _config = resolveConfig_default(config);
1577
- let requestData = _config.data;
1578
- const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
1579
- let { responseType, onUploadProgress, onDownloadProgress } = _config;
1580
- let onCanceled;
1581
- let uploadThrottled, downloadThrottled;
1582
- let flushUpload, flushDownload;
1583
- function done() {
1584
- flushUpload && flushUpload();
1585
- flushDownload && flushDownload();
1586
- _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
1587
- _config.signal && _config.signal.removeEventListener("abort", onCanceled);
1588
- }
1589
- let request = new XMLHttpRequest();
1590
- request.open(_config.method.toUpperCase(), _config.url, true);
1591
- request.timeout = _config.timeout;
1592
- function onloadend() {
1593
- if (!request) {
1594
- return;
1595
- }
1596
- const responseHeaders = AxiosHeaders_default.from(
1597
- "getAllResponseHeaders" in request && request.getAllResponseHeaders()
1598
- );
1599
- const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
1600
- const response = {
1601
- data: responseData,
1602
- status: request.status,
1603
- statusText: request.statusText,
1604
- headers: responseHeaders,
1605
- config,
1606
- request
1607
- };
1608
- settle(function _resolve(value) {
1609
- resolve(value);
1610
- done();
1611
- }, function _reject(err) {
1612
- reject(err);
1613
- done();
1614
- }, response);
1615
- request = null;
1616
- }
1617
- if ("onloadend" in request) {
1618
- request.onloadend = onloadend;
1619
- } else {
1620
- request.onreadystatechange = function handleLoad() {
1621
- if (!request || request.readyState !== 4) {
1622
- return;
1623
- }
1624
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
1625
- return;
1626
- }
1627
- setTimeout(onloadend);
1628
- };
1629
- }
1630
- request.onabort = function handleAbort() {
1631
- if (!request) {
1632
- return;
1633
- }
1634
- reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
1635
- request = null;
1636
- };
1637
- request.onerror = function handleError(event) {
1638
- const msg = event && event.message ? event.message : "Network Error";
1639
- const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request);
1640
- err.event = event || null;
1641
- reject(err);
1642
- request = null;
1643
- };
1644
- request.ontimeout = function handleTimeout() {
1645
- let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
1646
- const transitional2 = _config.transitional || transitional_default;
1647
- if (_config.timeoutErrorMessage) {
1648
- timeoutErrorMessage = _config.timeoutErrorMessage;
1649
- }
1650
- reject(new AxiosError_default(
1651
- timeoutErrorMessage,
1652
- transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
1653
- config,
1654
- request
1655
- ));
1656
- request = null;
1657
- };
1658
- requestData === void 0 && requestHeaders.setContentType(null);
1659
- if ("setRequestHeader" in request) {
1660
- utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
1661
- request.setRequestHeader(key, val);
1662
- });
1663
- }
1664
- if (!utils_default.isUndefined(_config.withCredentials)) {
1665
- request.withCredentials = !!_config.withCredentials;
1666
- }
1667
- if (responseType && responseType !== "json") {
1668
- request.responseType = _config.responseType;
1669
- }
1670
- if (onDownloadProgress) {
1671
- [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
1672
- request.addEventListener("progress", downloadThrottled);
1673
- }
1674
- if (onUploadProgress && request.upload) {
1675
- [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
1676
- request.upload.addEventListener("progress", uploadThrottled);
1677
- request.upload.addEventListener("loadend", flushUpload);
1678
- }
1679
- if (_config.cancelToken || _config.signal) {
1680
- onCanceled = (cancel) => {
1681
- if (!request) {
1682
- return;
1683
- }
1684
- reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
1685
- request.abort();
1686
- request = null;
1687
- };
1688
- _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
1689
- if (_config.signal) {
1690
- _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
1691
- }
1692
- }
1693
- const protocol = parseProtocol(_config.url);
1694
- if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
1695
- reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
1696
- return;
1697
- }
1698
- request.send(requestData || null);
1699
- });
1700
- };
1701
-
1702
- // ../../node_modules/axios/lib/helpers/composeSignals.js
1703
- var composeSignals = (signals, timeout) => {
1704
- const { length } = signals = signals ? signals.filter(Boolean) : [];
1705
- if (timeout || length) {
1706
- let controller = new AbortController();
1707
- let aborted;
1708
- const onabort = function(reason) {
1709
- if (!aborted) {
1710
- aborted = true;
1711
- unsubscribe();
1712
- const err = reason instanceof Error ? reason : this.reason;
1713
- controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
1714
- }
1715
- };
1716
- let timer = timeout && setTimeout(() => {
1717
- timer = null;
1718
- onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT));
1719
- }, timeout);
1720
- const unsubscribe = () => {
1721
- if (signals) {
1722
- timer && clearTimeout(timer);
1723
- timer = null;
1724
- signals.forEach((signal2) => {
1725
- signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
1726
- });
1727
- signals = null;
1728
- }
1729
- };
1730
- signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
1731
- const { signal } = controller;
1732
- signal.unsubscribe = () => utils_default.asap(unsubscribe);
1733
- return signal;
1734
- }
1735
- };
1736
- var composeSignals_default = composeSignals;
1737
-
1738
- // ../../node_modules/axios/lib/helpers/trackStream.js
1739
- var streamChunk = function* (chunk, chunkSize) {
1740
- let len = chunk.byteLength;
1741
- if (len < chunkSize) {
1742
- yield chunk;
1743
- return;
1744
- }
1745
- let pos = 0;
1746
- let end;
1747
- while (pos < len) {
1748
- end = pos + chunkSize;
1749
- yield chunk.slice(pos, end);
1750
- pos = end;
1751
- }
1752
- };
1753
- var readBytes = async function* (iterable, chunkSize) {
1754
- for await (const chunk of readStream(iterable)) {
1755
- yield* streamChunk(chunk, chunkSize);
1756
- }
1757
- };
1758
- var readStream = async function* (stream) {
1759
- if (stream[Symbol.asyncIterator]) {
1760
- yield* stream;
1761
- return;
1762
- }
1763
- const reader = stream.getReader();
1764
- try {
1765
- for (; ; ) {
1766
- const { done, value } = await reader.read();
1767
- if (done) {
1768
- break;
1769
- }
1770
- yield value;
1771
- }
1772
- } finally {
1773
- await reader.cancel();
1774
- }
1775
- };
1776
- var trackStream = (stream, chunkSize, onProgress, onFinish) => {
1777
- const iterator2 = readBytes(stream, chunkSize);
1778
- let bytes = 0;
1779
- let done;
1780
- let _onFinish = (e) => {
1781
- if (!done) {
1782
- done = true;
1783
- onFinish && onFinish(e);
1784
- }
1785
- };
1786
- return new ReadableStream({
1787
- async pull(controller) {
1788
- try {
1789
- const { done: done2, value } = await iterator2.next();
1790
- if (done2) {
1791
- _onFinish();
1792
- controller.close();
1793
- return;
1794
- }
1795
- let len = value.byteLength;
1796
- if (onProgress) {
1797
- let loadedBytes = bytes += len;
1798
- onProgress(loadedBytes);
1799
- }
1800
- controller.enqueue(new Uint8Array(value));
1801
- } catch (err) {
1802
- _onFinish(err);
1803
- throw err;
1804
- }
1805
- },
1806
- cancel(reason) {
1807
- _onFinish(reason);
1808
- return iterator2.return();
1809
- }
1810
- }, {
1811
- highWaterMark: 2
1812
- });
1813
- };
1814
-
1815
- // ../../node_modules/axios/lib/adapters/fetch.js
1816
- var DEFAULT_CHUNK_SIZE = 64 * 1024;
1817
- var { isFunction: isFunction2 } = utils_default;
1818
- var globalFetchAPI = (({ Request, Response }) => ({
1819
- Request,
1820
- Response
1821
- }))(utils_default.global);
1822
- var {
1823
- ReadableStream: ReadableStream2,
1824
- TextEncoder
1825
- } = utils_default.global;
1826
- var test = (fn, ...args) => {
1827
- try {
1828
- return !!fn(...args);
1829
- } catch (e) {
1830
- return false;
1831
- }
1832
- };
1833
- var factory = (env) => {
1834
- env = utils_default.merge.call({
1835
- skipUndefined: true
1836
- }, globalFetchAPI, env);
1837
- const { fetch: envFetch, Request, Response } = env;
1838
- const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
1839
- const isRequestSupported = isFunction2(Request);
1840
- const isResponseSupported = isFunction2(Response);
1841
- if (!isFetchSupported) {
1842
- return false;
1843
- }
1844
- const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
1845
- const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
1846
- const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
1847
- let duplexAccessed = false;
1848
- const hasContentType = new Request(platform_default.origin, {
1849
- body: new ReadableStream2(),
1850
- method: "POST",
1851
- get duplex() {
1852
- duplexAccessed = true;
1853
- return "half";
1854
- }
1855
- }).headers.has("Content-Type");
1856
- return duplexAccessed && !hasContentType;
1857
- });
1858
- const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
1859
- const resolvers = {
1860
- stream: supportsResponseStream && ((res) => res.body)
1861
- };
1862
- isFetchSupported && (() => {
1863
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
1864
- !resolvers[type] && (resolvers[type] = (res, config) => {
1865
- let method = res && res[type];
1866
- if (method) {
1867
- return method.call(res);
1868
- }
1869
- throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
1870
- });
1871
- });
1872
- })();
1873
- const getBodyLength = async (body) => {
1874
- if (body == null) {
1875
- return 0;
1876
- }
1877
- if (utils_default.isBlob(body)) {
1878
- return body.size;
1879
- }
1880
- if (utils_default.isSpecCompliantForm(body)) {
1881
- const _request = new Request(platform_default.origin, {
1882
- method: "POST",
1883
- body
1884
- });
1885
- return (await _request.arrayBuffer()).byteLength;
1886
- }
1887
- if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
1888
- return body.byteLength;
1889
- }
1890
- if (utils_default.isURLSearchParams(body)) {
1891
- body = body + "";
1892
- }
1893
- if (utils_default.isString(body)) {
1894
- return (await encodeText(body)).byteLength;
1895
- }
1896
- };
1897
- const resolveBodyLength = async (headers, body) => {
1898
- const length = utils_default.toFiniteNumber(headers.getContentLength());
1899
- return length == null ? getBodyLength(body) : length;
1900
- };
1901
- return async (config) => {
1902
- let {
1903
- url,
1904
- method,
1905
- data,
1906
- signal,
1907
- cancelToken,
1908
- timeout,
1909
- onDownloadProgress,
1910
- onUploadProgress,
1911
- responseType,
1912
- headers,
1913
- withCredentials = "same-origin",
1914
- fetchOptions
1915
- } = resolveConfig_default(config);
1916
- let _fetch = envFetch || fetch;
1917
- responseType = responseType ? (responseType + "").toLowerCase() : "text";
1918
- let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
1919
- let request = null;
1920
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
1921
- composedSignal.unsubscribe();
1922
- });
1923
- let requestContentLength;
1924
- try {
1925
- if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
1926
- let _request = new Request(url, {
1927
- method: "POST",
1928
- body: data,
1929
- duplex: "half"
1930
- });
1931
- let contentTypeHeader;
1932
- if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
1933
- headers.setContentType(contentTypeHeader);
1934
- }
1935
- if (_request.body) {
1936
- const [onProgress, flush] = progressEventDecorator(
1937
- requestContentLength,
1938
- progressEventReducer(asyncDecorator(onUploadProgress))
1939
- );
1940
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
1941
- }
1942
- }
1943
- if (!utils_default.isString(withCredentials)) {
1944
- withCredentials = withCredentials ? "include" : "omit";
1945
- }
1946
- const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
1947
- const resolvedOptions = {
1948
- ...fetchOptions,
1949
- signal: composedSignal,
1950
- method: method.toUpperCase(),
1951
- headers: headers.normalize().toJSON(),
1952
- body: data,
1953
- duplex: "half",
1954
- credentials: isCredentialsSupported ? withCredentials : void 0
1955
- };
1956
- request = isRequestSupported && new Request(url, resolvedOptions);
1957
- let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
1958
- const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
1959
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
1960
- const options = {};
1961
- ["status", "statusText", "headers"].forEach((prop) => {
1962
- options[prop] = response[prop];
1963
- });
1964
- const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
1965
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
1966
- responseContentLength,
1967
- progressEventReducer(asyncDecorator(onDownloadProgress), true)
1968
- ) || [];
1969
- response = new Response(
1970
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
1971
- flush && flush();
1972
- unsubscribe && unsubscribe();
1973
- }),
1974
- options
1975
- );
1976
- }
1977
- responseType = responseType || "text";
1978
- let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
1979
- !isStreamResponse && unsubscribe && unsubscribe();
1980
- return await new Promise((resolve, reject) => {
1981
- settle(resolve, reject, {
1982
- data: responseData,
1983
- headers: AxiosHeaders_default.from(response.headers),
1984
- status: response.status,
1985
- statusText: response.statusText,
1986
- config,
1987
- request
1988
- });
1989
- });
1990
- } catch (err) {
1991
- unsubscribe && unsubscribe();
1992
- if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
1993
- throw Object.assign(
1994
- new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
1995
- {
1996
- cause: err.cause || err
1997
- }
1998
- );
1999
- }
2000
- throw AxiosError_default.from(err, err && err.code, config, request);
2001
- }
2002
- };
2003
- };
2004
- var seedCache = /* @__PURE__ */ new Map();
2005
- var getFetch = (config) => {
2006
- let env = config && config.env || {};
2007
- const { fetch: fetch2, Request, Response } = env;
2008
- const seeds = [
2009
- Request,
2010
- Response,
2011
- fetch2
2012
- ];
2013
- let len = seeds.length, i = len, seed, target, map = seedCache;
2014
- while (i--) {
2015
- seed = seeds[i];
2016
- target = map.get(seed);
2017
- target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
2018
- map = target;
2019
- }
2020
- return target;
2021
- };
2022
- getFetch();
2023
-
2024
- // ../../node_modules/axios/lib/adapters/adapters.js
2025
- var knownAdapters = {
2026
- http: null_default,
2027
- xhr: xhr_default,
2028
- fetch: {
2029
- get: getFetch
2030
- }
2031
- };
2032
- utils_default.forEach(knownAdapters, (fn, value) => {
2033
- if (fn) {
2034
- try {
2035
- Object.defineProperty(fn, "name", { value });
2036
- } catch (e) {
2037
- }
2038
- Object.defineProperty(fn, "adapterName", { value });
2039
- }
2040
- });
2041
- var renderReason = (reason) => `- ${reason}`;
2042
- var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
2043
- function getAdapter(adapters, config) {
2044
- adapters = utils_default.isArray(adapters) ? adapters : [adapters];
2045
- const { length } = adapters;
2046
- let nameOrAdapter;
2047
- let adapter2;
2048
- const rejectedReasons = {};
2049
- for (let i = 0; i < length; i++) {
2050
- nameOrAdapter = adapters[i];
2051
- let id;
2052
- adapter2 = nameOrAdapter;
2053
- if (!isResolvedHandle(nameOrAdapter)) {
2054
- adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
2055
- if (adapter2 === void 0) {
2056
- throw new AxiosError_default(`Unknown adapter '${id}'`);
2057
- }
2058
- }
2059
- if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
2060
- break;
2061
- }
2062
- rejectedReasons[id || "#" + i] = adapter2;
2063
- }
2064
- if (!adapter2) {
2065
- const reasons = Object.entries(rejectedReasons).map(
2066
- ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
2067
- );
2068
- let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
2069
- throw new AxiosError_default(
2070
- `There is no suitable adapter to dispatch the request ` + s,
2071
- "ERR_NOT_SUPPORT"
2072
- );
2073
- }
2074
- return adapter2;
2075
- }
2076
- var adapters_default = {
2077
- /**
2078
- * Resolve an adapter from a list of adapter names or functions.
2079
- * @type {Function}
2080
- */
2081
- getAdapter,
2082
- /**
2083
- * Exposes all known adapters
2084
- * @type {Object<string, Function|Object>}
2085
- */
2086
- adapters: knownAdapters
2087
- };
2088
-
2089
- // ../../node_modules/axios/lib/core/dispatchRequest.js
2090
- function throwIfCancellationRequested(config) {
2091
- if (config.cancelToken) {
2092
- config.cancelToken.throwIfRequested();
2093
- }
2094
- if (config.signal && config.signal.aborted) {
2095
- throw new CanceledError_default(null, config);
2096
- }
2097
- }
2098
- function dispatchRequest(config) {
2099
- throwIfCancellationRequested(config);
2100
- config.headers = AxiosHeaders_default.from(config.headers);
2101
- config.data = transformData.call(
2102
- config,
2103
- config.transformRequest
2104
- );
2105
- if (["post", "put", "patch"].indexOf(config.method) !== -1) {
2106
- config.headers.setContentType("application/x-www-form-urlencoded", false);
2107
- }
2108
- const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
2109
- return adapter2(config).then(function onAdapterResolution(response) {
2110
- throwIfCancellationRequested(config);
2111
- response.data = transformData.call(
2112
- config,
2113
- config.transformResponse,
2114
- response
2115
- );
2116
- response.headers = AxiosHeaders_default.from(response.headers);
2117
- return response;
2118
- }, function onAdapterRejection(reason) {
2119
- if (!isCancel(reason)) {
2120
- throwIfCancellationRequested(config);
2121
- if (reason && reason.response) {
2122
- reason.response.data = transformData.call(
2123
- config,
2124
- config.transformResponse,
2125
- reason.response
2126
- );
2127
- reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
2128
- }
2129
- }
2130
- return Promise.reject(reason);
2131
- });
2132
- }
2133
-
2134
- // ../../node_modules/axios/lib/env/data.js
2135
- var VERSION = "1.13.2";
2136
-
2137
- // ../../node_modules/axios/lib/helpers/validator.js
2138
- var validators = {};
2139
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
2140
- validators[type] = function validator(thing) {
2141
- return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
2142
- };
2143
- });
2144
- var deprecatedWarnings = {};
2145
- validators.transitional = function transitional(validator, version, message) {
2146
- function formatMessage(opt, desc) {
2147
- return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
2148
- }
2149
- return (value, opt, opts) => {
2150
- if (validator === false) {
2151
- throw new AxiosError_default(
2152
- formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
2153
- AxiosError_default.ERR_DEPRECATED
2154
- );
2155
- }
2156
- if (version && !deprecatedWarnings[opt]) {
2157
- deprecatedWarnings[opt] = true;
2158
- console.warn(
2159
- formatMessage(
2160
- opt,
2161
- " has been deprecated since v" + version + " and will be removed in the near future"
2162
- )
2163
- );
2164
- }
2165
- return validator ? validator(value, opt, opts) : true;
2166
- };
2167
- };
2168
- validators.spelling = function spelling(correctSpelling) {
2169
- return (value, opt) => {
2170
- console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
2171
- return true;
2172
- };
2173
- };
2174
- function assertOptions(options, schema, allowUnknown) {
2175
- if (typeof options !== "object") {
2176
- throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
2177
- }
2178
- const keys = Object.keys(options);
2179
- let i = keys.length;
2180
- while (i-- > 0) {
2181
- const opt = keys[i];
2182
- const validator = schema[opt];
2183
- if (validator) {
2184
- const value = options[opt];
2185
- const result = value === void 0 || validator(value, opt, options);
2186
- if (result !== true) {
2187
- throw new AxiosError_default("option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE);
2188
- }
2189
- continue;
2190
- }
2191
- if (allowUnknown !== true) {
2192
- throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION);
2193
- }
2194
- }
2195
- }
2196
- var validator_default = {
2197
- assertOptions,
2198
- validators
2199
- };
2200
-
2201
- // ../../node_modules/axios/lib/core/Axios.js
2202
- var validators2 = validator_default.validators;
2203
- var Axios = class {
2204
- constructor(instanceConfig) {
2205
- this.defaults = instanceConfig || {};
2206
- this.interceptors = {
2207
- request: new InterceptorManager_default(),
2208
- response: new InterceptorManager_default()
2209
- };
2210
- }
2211
- /**
2212
- * Dispatch a request
2213
- *
2214
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2215
- * @param {?Object} config
2216
- *
2217
- * @returns {Promise} The Promise to be fulfilled
2218
- */
2219
- async request(configOrUrl, config) {
2220
- try {
2221
- return await this._request(configOrUrl, config);
2222
- } catch (err) {
2223
- if (err instanceof Error) {
2224
- let dummy = {};
2225
- Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
2226
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
2227
- try {
2228
- if (!err.stack) {
2229
- err.stack = stack;
2230
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
2231
- err.stack += "\n" + stack;
2232
- }
2233
- } catch (e) {
2234
- }
2235
- }
2236
- throw err;
2237
- }
2238
- }
2239
- _request(configOrUrl, config) {
2240
- if (typeof configOrUrl === "string") {
2241
- config = config || {};
2242
- config.url = configOrUrl;
2243
- } else {
2244
- config = configOrUrl || {};
2245
- }
2246
- config = mergeConfig(this.defaults, config);
2247
- const { transitional: transitional2, paramsSerializer, headers } = config;
2248
- if (transitional2 !== void 0) {
2249
- validator_default.assertOptions(transitional2, {
2250
- silentJSONParsing: validators2.transitional(validators2.boolean),
2251
- forcedJSONParsing: validators2.transitional(validators2.boolean),
2252
- clarifyTimeoutError: validators2.transitional(validators2.boolean)
2253
- }, false);
2254
- }
2255
- if (paramsSerializer != null) {
2256
- if (utils_default.isFunction(paramsSerializer)) {
2257
- config.paramsSerializer = {
2258
- serialize: paramsSerializer
2259
- };
2260
- } else {
2261
- validator_default.assertOptions(paramsSerializer, {
2262
- encode: validators2.function,
2263
- serialize: validators2.function
2264
- }, true);
2265
- }
2266
- }
2267
- if (config.allowAbsoluteUrls !== void 0) ; else if (this.defaults.allowAbsoluteUrls !== void 0) {
2268
- config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
2269
- } else {
2270
- config.allowAbsoluteUrls = true;
2271
- }
2272
- validator_default.assertOptions(config, {
2273
- baseUrl: validators2.spelling("baseURL"),
2274
- withXsrfToken: validators2.spelling("withXSRFToken")
2275
- }, true);
2276
- config.method = (config.method || this.defaults.method || "get").toLowerCase();
2277
- let contextHeaders = headers && utils_default.merge(
2278
- headers.common,
2279
- headers[config.method]
2280
- );
2281
- headers && utils_default.forEach(
2282
- ["delete", "get", "head", "post", "put", "patch", "common"],
2283
- (method) => {
2284
- delete headers[method];
2285
- }
2286
- );
2287
- config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
2288
- const requestInterceptorChain = [];
2289
- let synchronousRequestInterceptors = true;
2290
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
2291
- if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
2292
- return;
2293
- }
2294
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
2295
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
2296
- });
2297
- const responseInterceptorChain = [];
2298
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
2299
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
2300
- });
2301
- let promise;
2302
- let i = 0;
2303
- let len;
2304
- if (!synchronousRequestInterceptors) {
2305
- const chain = [dispatchRequest.bind(this), void 0];
2306
- chain.unshift(...requestInterceptorChain);
2307
- chain.push(...responseInterceptorChain);
2308
- len = chain.length;
2309
- promise = Promise.resolve(config);
2310
- while (i < len) {
2311
- promise = promise.then(chain[i++], chain[i++]);
2312
- }
2313
- return promise;
2314
- }
2315
- len = requestInterceptorChain.length;
2316
- let newConfig = config;
2317
- while (i < len) {
2318
- const onFulfilled = requestInterceptorChain[i++];
2319
- const onRejected = requestInterceptorChain[i++];
2320
- try {
2321
- newConfig = onFulfilled(newConfig);
2322
- } catch (error) {
2323
- onRejected.call(this, error);
2324
- break;
2325
- }
2326
- }
2327
- try {
2328
- promise = dispatchRequest.call(this, newConfig);
2329
- } catch (error) {
2330
- return Promise.reject(error);
2331
- }
2332
- i = 0;
2333
- len = responseInterceptorChain.length;
2334
- while (i < len) {
2335
- promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
2336
- }
2337
- return promise;
2338
- }
2339
- getUri(config) {
2340
- config = mergeConfig(this.defaults, config);
2341
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
2342
- return buildURL(fullPath, config.params, config.paramsSerializer);
2343
- }
2344
- };
2345
- utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
2346
- Axios.prototype[method] = function(url, config) {
2347
- return this.request(mergeConfig(config || {}, {
2348
- method,
2349
- url,
2350
- data: (config || {}).data
2351
- }));
2352
- };
2353
- });
2354
- utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
2355
- function generateHTTPMethod(isForm) {
2356
- return function httpMethod(url, data, config) {
2357
- return this.request(mergeConfig(config || {}, {
2358
- method,
2359
- headers: isForm ? {
2360
- "Content-Type": "multipart/form-data"
2361
- } : {},
2362
- url,
2363
- data
2364
- }));
2365
- };
2366
- }
2367
- Axios.prototype[method] = generateHTTPMethod();
2368
- Axios.prototype[method + "Form"] = generateHTTPMethod(true);
2369
- });
2370
- var Axios_default = Axios;
2371
-
2372
- // ../../node_modules/axios/lib/cancel/CancelToken.js
2373
- var CancelToken = class _CancelToken {
2374
- constructor(executor) {
2375
- if (typeof executor !== "function") {
2376
- throw new TypeError("executor must be a function.");
2377
- }
2378
- let resolvePromise;
2379
- this.promise = new Promise(function promiseExecutor(resolve) {
2380
- resolvePromise = resolve;
2381
- });
2382
- const token = this;
2383
- this.promise.then((cancel) => {
2384
- if (!token._listeners) return;
2385
- let i = token._listeners.length;
2386
- while (i-- > 0) {
2387
- token._listeners[i](cancel);
2388
- }
2389
- token._listeners = null;
2390
- });
2391
- this.promise.then = (onfulfilled) => {
2392
- let _resolve;
2393
- const promise = new Promise((resolve) => {
2394
- token.subscribe(resolve);
2395
- _resolve = resolve;
2396
- }).then(onfulfilled);
2397
- promise.cancel = function reject() {
2398
- token.unsubscribe(_resolve);
2399
- };
2400
- return promise;
2401
- };
2402
- executor(function cancel(message, config, request) {
2403
- if (token.reason) {
2404
- return;
2405
- }
2406
- token.reason = new CanceledError_default(message, config, request);
2407
- resolvePromise(token.reason);
2408
- });
2409
- }
2410
- /**
2411
- * Throws a `CanceledError` if cancellation has been requested.
2412
- */
2413
- throwIfRequested() {
2414
- if (this.reason) {
2415
- throw this.reason;
2416
- }
2417
- }
2418
- /**
2419
- * Subscribe to the cancel signal
2420
- */
2421
- subscribe(listener) {
2422
- if (this.reason) {
2423
- listener(this.reason);
2424
- return;
2425
- }
2426
- if (this._listeners) {
2427
- this._listeners.push(listener);
2428
- } else {
2429
- this._listeners = [listener];
2430
- }
2431
- }
2432
- /**
2433
- * Unsubscribe from the cancel signal
2434
- */
2435
- unsubscribe(listener) {
2436
- if (!this._listeners) {
2437
- return;
2438
- }
2439
- const index = this._listeners.indexOf(listener);
2440
- if (index !== -1) {
2441
- this._listeners.splice(index, 1);
2442
- }
2443
- }
2444
- toAbortSignal() {
2445
- const controller = new AbortController();
2446
- const abort = (err) => {
2447
- controller.abort(err);
2448
- };
2449
- this.subscribe(abort);
2450
- controller.signal.unsubscribe = () => this.unsubscribe(abort);
2451
- return controller.signal;
2452
- }
2453
- /**
2454
- * Returns an object that contains a new `CancelToken` and a function that, when called,
2455
- * cancels the `CancelToken`.
2456
- */
2457
- static source() {
2458
- let cancel;
2459
- const token = new _CancelToken(function executor(c) {
2460
- cancel = c;
2461
- });
2462
- return {
2463
- token,
2464
- cancel
2465
- };
2466
- }
2467
- };
2468
- var CancelToken_default = CancelToken;
2469
-
2470
- // ../../node_modules/axios/lib/helpers/spread.js
2471
- function spread(callback) {
2472
- return function wrap(arr) {
2473
- return callback.apply(null, arr);
2474
- };
2475
- }
2476
-
2477
- // ../../node_modules/axios/lib/helpers/isAxiosError.js
2478
- function isAxiosError(payload) {
2479
- return utils_default.isObject(payload) && payload.isAxiosError === true;
2480
- }
1
+ import axios from 'axios';
2481
2
 
2482
- // ../../node_modules/axios/lib/helpers/HttpStatusCode.js
2483
- var HttpStatusCode = {
2484
- Continue: 100,
2485
- SwitchingProtocols: 101,
2486
- Processing: 102,
2487
- EarlyHints: 103,
2488
- Ok: 200,
2489
- Created: 201,
2490
- Accepted: 202,
2491
- NonAuthoritativeInformation: 203,
2492
- NoContent: 204,
2493
- ResetContent: 205,
2494
- PartialContent: 206,
2495
- MultiStatus: 207,
2496
- AlreadyReported: 208,
2497
- ImUsed: 226,
2498
- MultipleChoices: 300,
2499
- MovedPermanently: 301,
2500
- Found: 302,
2501
- SeeOther: 303,
2502
- NotModified: 304,
2503
- UseProxy: 305,
2504
- Unused: 306,
2505
- TemporaryRedirect: 307,
2506
- PermanentRedirect: 308,
2507
- BadRequest: 400,
2508
- Unauthorized: 401,
2509
- PaymentRequired: 402,
2510
- Forbidden: 403,
2511
- NotFound: 404,
2512
- MethodNotAllowed: 405,
2513
- NotAcceptable: 406,
2514
- ProxyAuthenticationRequired: 407,
2515
- RequestTimeout: 408,
2516
- Conflict: 409,
2517
- Gone: 410,
2518
- LengthRequired: 411,
2519
- PreconditionFailed: 412,
2520
- PayloadTooLarge: 413,
2521
- UriTooLong: 414,
2522
- UnsupportedMediaType: 415,
2523
- RangeNotSatisfiable: 416,
2524
- ExpectationFailed: 417,
2525
- ImATeapot: 418,
2526
- MisdirectedRequest: 421,
2527
- UnprocessableEntity: 422,
2528
- Locked: 423,
2529
- FailedDependency: 424,
2530
- TooEarly: 425,
2531
- UpgradeRequired: 426,
2532
- PreconditionRequired: 428,
2533
- TooManyRequests: 429,
2534
- RequestHeaderFieldsTooLarge: 431,
2535
- UnavailableForLegalReasons: 451,
2536
- InternalServerError: 500,
2537
- NotImplemented: 501,
2538
- BadGateway: 502,
2539
- ServiceUnavailable: 503,
2540
- GatewayTimeout: 504,
2541
- HttpVersionNotSupported: 505,
2542
- VariantAlsoNegotiates: 506,
2543
- InsufficientStorage: 507,
2544
- LoopDetected: 508,
2545
- NotExtended: 510,
2546
- NetworkAuthenticationRequired: 511,
2547
- WebServerIsDown: 521,
2548
- ConnectionTimedOut: 522,
2549
- OriginIsUnreachable: 523,
2550
- TimeoutOccurred: 524,
2551
- SslHandshakeFailed: 525,
2552
- InvalidSslCertificate: 526
2553
- };
2554
- Object.entries(HttpStatusCode).forEach(([key, value]) => {
2555
- HttpStatusCode[value] = key;
2556
- });
2557
- var HttpStatusCode_default = HttpStatusCode;
2558
-
2559
- // ../../node_modules/axios/lib/axios.js
2560
- function createInstance(defaultConfig) {
2561
- const context = new Axios_default(defaultConfig);
2562
- const instance = bind(Axios_default.prototype.request, context);
2563
- utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
2564
- utils_default.extend(instance, context, null, { allOwnKeys: true });
2565
- instance.create = function create(instanceConfig) {
2566
- return createInstance(mergeConfig(defaultConfig, instanceConfig));
2567
- };
2568
- return instance;
2569
- }
2570
- var axios = createInstance(defaults_default);
2571
- axios.Axios = Axios_default;
2572
- axios.CanceledError = CanceledError_default;
2573
- axios.CancelToken = CancelToken_default;
2574
- axios.isCancel = isCancel;
2575
- axios.VERSION = VERSION;
2576
- axios.toFormData = toFormData_default;
2577
- axios.AxiosError = AxiosError_default;
2578
- axios.Cancel = axios.CanceledError;
2579
- axios.all = function all(promises) {
2580
- return Promise.all(promises);
2581
- };
2582
- axios.spread = spread;
2583
- axios.isAxiosError = isAxiosError;
2584
- axios.mergeConfig = mergeConfig;
2585
- axios.AxiosHeaders = AxiosHeaders_default;
2586
- axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
2587
- axios.getAdapter = adapters_default.getAdapter;
2588
- axios.HttpStatusCode = HttpStatusCode_default;
2589
- axios.default = axios;
2590
- var axios_default = axios;
2591
-
2592
- // ../../node_modules/axios/index.js
2593
- var {
2594
- Axios: Axios2,
2595
- AxiosError: AxiosError2,
2596
- CanceledError: CanceledError2,
2597
- isCancel: isCancel2,
2598
- CancelToken: CancelToken2,
2599
- VERSION: VERSION2,
2600
- all: all2,
2601
- Cancel,
2602
- isAxiosError: isAxiosError2,
2603
- spread: spread2,
2604
- toFormData: toFormData2,
2605
- AxiosHeaders: AxiosHeaders2,
2606
- HttpStatusCode: HttpStatusCode2,
2607
- formToJSON,
2608
- getAdapter: getAdapter2,
2609
- mergeConfig: mergeConfig2
2610
- } = axios_default;
3
+ // src/adapters/index.ts
2611
4
 
2612
5
  // src/core/adapter-registry.ts
2613
6
  var registry = {};
@@ -2632,18 +25,16 @@ var localAdapter = (config) => {
2632
25
  };
2633
26
  };
2634
27
  registry.local = localAdapter;
2635
- function registerAdapter(key, factory2) {
2636
- registry[key] = factory2;
28
+ function registerAdapter(key, factory) {
29
+ registry[key] = factory;
2637
30
  }
2638
- function getAdapter3(key) {
2639
- const factory2 = registry[key];
2640
- return factory2;
31
+ function getAdapter(key) {
32
+ const factory = registry[key];
33
+ return factory;
2641
34
  }
2642
35
  function hasAdapter(key) {
2643
36
  return typeof registry[key] === "function";
2644
37
  }
2645
-
2646
- // src/adapters/axios.ts
2647
38
  var createAxiosAdapter = (config) => {
2648
39
  const { method, url, data, callbacks, errorBag } = config;
2649
40
  function buildRequestConfig(options) {
@@ -2667,7 +58,7 @@ var createAxiosAdapter = (config) => {
2667
58
  finished = true;
2668
59
  (_a = callbacks == null ? void 0 : callbacks.onFinish) == null ? void 0 : _a.call(callbacks);
2669
60
  };
2670
- axios_default.request(buildRequestConfig(options)).then((response) => {
61
+ axios.request(buildRequestConfig(options)).then((response) => {
2671
62
  var _a;
2672
63
  (_a = callbacks == null ? void 0 : callbacks.onSuccess) == null ? void 0 : _a.call(callbacks, response);
2673
64
  }).catch((error) => {
@@ -2688,7 +79,7 @@ var createAxiosAdapter = (config) => {
2688
79
  finished = true;
2689
80
  (_a = callbacks == null ? void 0 : callbacks.onFinish) == null ? void 0 : _a.call(callbacks);
2690
81
  };
2691
- axios_default.request(buildRequestConfig(options)).then((response) => {
82
+ axios.request(buildRequestConfig(options)).then((response) => {
2692
83
  var _a;
2693
84
  (_a = callbacks == null ? void 0 : callbacks.onSuccess) == null ? void 0 : _a.call(callbacks, response);
2694
85
  resolve(response);
@@ -2834,7 +225,7 @@ var createInertiaAdapter = (config) => {
2834
225
 
2835
226
  // src/adapters/index.ts
2836
227
  function registerAxiosAdapter() {
2837
- if (!axios_default || typeof axios_default.request !== "function") {
228
+ if (!axios || typeof axios.request !== "function") {
2838
229
  throw new Error(
2839
230
  "[form-palette] Axios does not appear to be available. Make sure 'axios' is installed and resolvable before calling registerAxiosAdapter()."
2840
231
  );
@@ -2877,6 +268,6 @@ function registerAllAdapters() {
2877
268
  registerInertiaAdapter();
2878
269
  }
2879
270
 
2880
- export { createAxiosAdapter, createInertiaAdapter, getAdapter3 as getAdapter, hasAdapter, localAdapter, registerAdapter, registerAllAdapters, registerAxiosAdapter, registerInertiaAdapter, registerKnownAdapter };
271
+ export { createAxiosAdapter, createInertiaAdapter, getAdapter, hasAdapter, localAdapter, registerAdapter, registerAllAdapters, registerAxiosAdapter, registerInertiaAdapter, registerKnownAdapter };
2881
272
  //# sourceMappingURL=adapters.mjs.map
2882
273
  //# sourceMappingURL=adapters.mjs.map