tevrocsdk 0.1.5 → 0.1.6

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/tevroc-sdk.esm.js CHANGED
@@ -1,3 +1,3323 @@
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 hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
19
+ var hasOwnInPrototypeChain = (thing, prop) => {
20
+ let obj = thing;
21
+ const seen = [];
22
+ while (obj != null && obj !== Object.prototype) {
23
+ if (seen.indexOf(obj) !== -1) {
24
+ return false;
25
+ }
26
+ seen.push(obj);
27
+ if (hasOwnProperty(obj, prop)) {
28
+ return true;
29
+ }
30
+ obj = getPrototypeOf(obj);
31
+ }
32
+ return false;
33
+ };
34
+ var getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : void 0;
35
+ var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
36
+ const str = toString.call(thing);
37
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
38
+ })(/* @__PURE__ */ Object.create(null));
39
+ var kindOfTest = (type) => {
40
+ type = type.toLowerCase();
41
+ return (thing) => kindOf(thing) === type;
42
+ };
43
+ var typeOfTest = (type) => (thing) => typeof thing === type;
44
+ var { isArray } = Array;
45
+ var isUndefined = typeOfTest("undefined");
46
+ function isBuffer(val) {
47
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
48
+ }
49
+ var isArrayBuffer = kindOfTest("ArrayBuffer");
50
+ function isArrayBufferView(val) {
51
+ let result;
52
+ if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
53
+ result = ArrayBuffer.isView(val);
54
+ } else {
55
+ result = val && val.buffer && isArrayBuffer(val.buffer);
56
+ }
57
+ return result;
58
+ }
59
+ var isString = typeOfTest("string");
60
+ var isFunction = typeOfTest("function");
61
+ var isNumber = typeOfTest("number");
62
+ var isObject = (thing) => thing !== null && typeof thing === "object";
63
+ var isBoolean = (thing) => thing === true || thing === false;
64
+ var isPlainObject = (val) => {
65
+ if (!isObject(val)) {
66
+ return false;
67
+ }
68
+ const prototype2 = getPrototypeOf(val);
69
+ return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
70
+ // Symbol.iterator as evidence the value is a tagged/iterable type rather
71
+ // than a plain object, while ignoring keys injected onto Object.prototype.
72
+ !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
73
+ };
74
+ var isEmptyObject = (val) => {
75
+ if (!isObject(val) || isBuffer(val)) {
76
+ return false;
77
+ }
78
+ try {
79
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
80
+ } catch (e) {
81
+ return false;
82
+ }
83
+ };
84
+ var isDate = kindOfTest("Date");
85
+ var isFile = kindOfTest("File");
86
+ var isReactNativeBlob = (value) => {
87
+ return !!(value && typeof value.uri !== "undefined");
88
+ };
89
+ var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
90
+ var isBlob = kindOfTest("Blob");
91
+ var isFileList = kindOfTest("FileList");
92
+ var isStream = (val) => isObject(val) && isFunction(val.pipe);
93
+ function getGlobal() {
94
+ if (typeof globalThis !== "undefined") return globalThis;
95
+ if (typeof self !== "undefined") return self;
96
+ if (typeof window !== "undefined") return window;
97
+ if (typeof global !== "undefined") return global;
98
+ return {};
99
+ }
100
+ var G = getGlobal();
101
+ var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
102
+ var isFormData = (thing) => {
103
+ if (!thing) return false;
104
+ if (FormDataCtor && thing instanceof FormDataCtor) return true;
105
+ const proto = getPrototypeOf(thing);
106
+ if (!proto || proto === Object.prototype) return false;
107
+ if (!isFunction(thing.append)) return false;
108
+ const kind = kindOf(thing);
109
+ return kind === "formdata" || // detect form-data instance
110
+ kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]";
111
+ };
112
+ var isURLSearchParams = kindOfTest("URLSearchParams");
113
+ var [isReadableStream, isRequest, isResponse, isHeaders] = [
114
+ "ReadableStream",
115
+ "Request",
116
+ "Response",
117
+ "Headers"
118
+ ].map(kindOfTest);
119
+ var trim = (str) => {
120
+ return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
121
+ };
122
+ function forEach(obj, fn, { allOwnKeys = false } = {}) {
123
+ if (obj === null || typeof obj === "undefined") {
124
+ return;
125
+ }
126
+ let i;
127
+ let l;
128
+ if (typeof obj !== "object") {
129
+ obj = [obj];
130
+ }
131
+ if (isArray(obj)) {
132
+ for (i = 0, l = obj.length; i < l; i++) {
133
+ fn.call(null, obj[i], i, obj);
134
+ }
135
+ } else {
136
+ if (isBuffer(obj)) {
137
+ return;
138
+ }
139
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
140
+ const len = keys.length;
141
+ let key;
142
+ for (i = 0; i < len; i++) {
143
+ key = keys[i];
144
+ fn.call(null, obj[key], key, obj);
145
+ }
146
+ }
147
+ }
148
+ function findKey(obj, key) {
149
+ if (isBuffer(obj)) {
150
+ return null;
151
+ }
152
+ key = key.toLowerCase();
153
+ const keys = Object.keys(obj);
154
+ let i = keys.length;
155
+ let _key;
156
+ while (i-- > 0) {
157
+ _key = keys[i];
158
+ if (key === _key.toLowerCase()) {
159
+ return _key;
160
+ }
161
+ }
162
+ return null;
163
+ }
164
+ var _global = (() => {
165
+ if (typeof globalThis !== "undefined") return globalThis;
166
+ return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
167
+ })();
168
+ var isContextDefined = (context) => !isUndefined(context) && context !== _global;
169
+ function merge(...objs) {
170
+ const { caseless, skipUndefined } = isContextDefined(this) && this || {};
171
+ const result = {};
172
+ const assignValue = (val, key) => {
173
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
174
+ return;
175
+ }
176
+ const targetKey = caseless && typeof key === "string" && findKey(result, key) || key;
177
+ const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : void 0;
178
+ if (isPlainObject(existing) && isPlainObject(val)) {
179
+ result[targetKey] = merge(existing, val);
180
+ } else if (isPlainObject(val)) {
181
+ result[targetKey] = merge({}, val);
182
+ } else if (isArray(val)) {
183
+ result[targetKey] = val.slice();
184
+ } else if (!skipUndefined || !isUndefined(val)) {
185
+ result[targetKey] = val;
186
+ }
187
+ };
188
+ for (let i = 0, l = objs.length; i < l; i++) {
189
+ const source = objs[i];
190
+ if (!source || isBuffer(source)) {
191
+ continue;
192
+ }
193
+ forEach(source, assignValue);
194
+ if (typeof source !== "object" || isArray(source)) {
195
+ continue;
196
+ }
197
+ const symbols = Object.getOwnPropertySymbols(source);
198
+ for (let j = 0; j < symbols.length; j++) {
199
+ const symbol = symbols[j];
200
+ if (propertyIsEnumerable.call(source, symbol)) {
201
+ assignValue(source[symbol], symbol);
202
+ }
203
+ }
204
+ }
205
+ return result;
206
+ }
207
+ var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
208
+ forEach(
209
+ b,
210
+ (val, key) => {
211
+ if (thisArg && isFunction(val)) {
212
+ Object.defineProperty(a, key, {
213
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
214
+ // hijack defineProperty's accessor-vs-data resolution.
215
+ __proto__: null,
216
+ value: bind(val, thisArg),
217
+ writable: true,
218
+ enumerable: true,
219
+ configurable: true
220
+ });
221
+ } else {
222
+ Object.defineProperty(a, key, {
223
+ __proto__: null,
224
+ value: val,
225
+ writable: true,
226
+ enumerable: true,
227
+ configurable: true
228
+ });
229
+ }
230
+ },
231
+ { allOwnKeys }
232
+ );
233
+ return a;
234
+ };
235
+ var stripBOM = (content) => {
236
+ if (content.charCodeAt(0) === 65279) {
237
+ content = content.slice(1);
238
+ }
239
+ return content;
240
+ };
241
+ var inherits = (constructor, superConstructor, props, descriptors) => {
242
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
243
+ Object.defineProperty(constructor.prototype, "constructor", {
244
+ __proto__: null,
245
+ value: constructor,
246
+ writable: true,
247
+ enumerable: false,
248
+ configurable: true
249
+ });
250
+ Object.defineProperty(constructor, "super", {
251
+ __proto__: null,
252
+ value: superConstructor.prototype
253
+ });
254
+ props && Object.assign(constructor.prototype, props);
255
+ };
256
+ var toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
257
+ let props;
258
+ let i;
259
+ let prop;
260
+ const merged = {};
261
+ destObj = destObj || {};
262
+ if (sourceObj == null) return destObj;
263
+ do {
264
+ props = Object.getOwnPropertyNames(sourceObj);
265
+ i = props.length;
266
+ while (i-- > 0) {
267
+ prop = props[i];
268
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
269
+ destObj[prop] = sourceObj[prop];
270
+ merged[prop] = true;
271
+ }
272
+ }
273
+ sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
274
+ } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
275
+ return destObj;
276
+ };
277
+ var endsWith = (str, searchString, position) => {
278
+ str = String(str);
279
+ if (position === void 0 || position > str.length) {
280
+ position = str.length;
281
+ }
282
+ position -= searchString.length;
283
+ const lastIndex = str.indexOf(searchString, position);
284
+ return lastIndex !== -1 && lastIndex === position;
285
+ };
286
+ var toArray = (thing) => {
287
+ if (!thing) return null;
288
+ if (isArray(thing)) return thing;
289
+ let i = thing.length;
290
+ if (!isNumber(i)) return null;
291
+ const arr = new Array(i);
292
+ while (i-- > 0) {
293
+ arr[i] = thing[i];
294
+ }
295
+ return arr;
296
+ };
297
+ var isTypedArray = /* @__PURE__ */ ((TypedArray) => {
298
+ return (thing) => {
299
+ return TypedArray && thing instanceof TypedArray;
300
+ };
301
+ })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
302
+ var forEachEntry = (obj, fn) => {
303
+ const generator = obj && obj[iterator];
304
+ const _iterator = generator.call(obj);
305
+ let result;
306
+ while ((result = _iterator.next()) && !result.done) {
307
+ const pair = result.value;
308
+ fn.call(obj, pair[0], pair[1]);
309
+ }
310
+ };
311
+ var matchAll = (regExp, str) => {
312
+ let matches;
313
+ const arr = [];
314
+ while ((matches = regExp.exec(str)) !== null) {
315
+ arr.push(matches);
316
+ }
317
+ return arr;
318
+ };
319
+ var isHTMLForm = kindOfTest("HTMLFormElement");
320
+ var toCamelCase = (str) => {
321
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
322
+ return p1.toUpperCase() + p2;
323
+ });
324
+ };
325
+ var { propertyIsEnumerable } = Object.prototype;
326
+ var isRegExp = kindOfTest("RegExp");
327
+ var reduceDescriptors = (obj, reducer) => {
328
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
329
+ const reducedDescriptors = {};
330
+ forEach(descriptors, (descriptor, name) => {
331
+ let ret;
332
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
333
+ reducedDescriptors[name] = ret || descriptor;
334
+ }
335
+ });
336
+ Object.defineProperties(obj, reducedDescriptors);
337
+ };
338
+ var freezeMethods = (obj) => {
339
+ reduceDescriptors(obj, (descriptor, name) => {
340
+ if (isFunction(obj) && ["arguments", "caller", "callee"].includes(name)) {
341
+ return false;
342
+ }
343
+ const value = obj[name];
344
+ if (!isFunction(value)) return;
345
+ descriptor.enumerable = false;
346
+ if ("writable" in descriptor) {
347
+ descriptor.writable = false;
348
+ return;
349
+ }
350
+ if (!descriptor.set) {
351
+ descriptor.set = () => {
352
+ throw Error("Can not rewrite read-only method '" + name + "'");
353
+ };
354
+ }
355
+ });
356
+ };
357
+ var toObjectSet = (arrayOrString, delimiter) => {
358
+ const obj = {};
359
+ const define = (arr) => {
360
+ arr.forEach((value) => {
361
+ obj[value] = true;
362
+ });
363
+ };
364
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
365
+ return obj;
366
+ };
367
+ var noop = () => {
368
+ };
369
+ var toFiniteNumber = (value, defaultValue) => {
370
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
371
+ };
372
+ function isSpecCompliantForm(thing) {
373
+ return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
374
+ }
375
+ var toJSONObject = (obj) => {
376
+ const visited = /* @__PURE__ */ new WeakSet();
377
+ const visit = (source) => {
378
+ if (isObject(source)) {
379
+ if (visited.has(source)) {
380
+ return;
381
+ }
382
+ if (isBuffer(source)) {
383
+ return source;
384
+ }
385
+ if (!("toJSON" in source)) {
386
+ visited.add(source);
387
+ const target = isArray(source) ? [] : {};
388
+ forEach(source, (value, key) => {
389
+ const reducedValue = visit(value);
390
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
391
+ });
392
+ visited.delete(source);
393
+ return target;
394
+ }
395
+ }
396
+ return source;
397
+ };
398
+ return visit(obj);
399
+ };
400
+ var isAsyncFn = kindOfTest("AsyncFunction");
401
+ var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
402
+ var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
403
+ if (setImmediateSupported) {
404
+ return setImmediate;
405
+ }
406
+ return postMessageSupported ? ((token, callbacks) => {
407
+ _global.addEventListener(
408
+ "message",
409
+ ({ source, data }) => {
410
+ if (source === _global && data === token) {
411
+ callbacks.length && callbacks.shift()();
412
+ }
413
+ },
414
+ false
415
+ );
416
+ return (cb) => {
417
+ callbacks.push(cb);
418
+ _global.postMessage(token, "*");
419
+ };
420
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
421
+ })(typeof setImmediate === "function", isFunction(_global.postMessage));
422
+ var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
423
+ var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
424
+ var isSafeIterable = (thing) => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
425
+ var utils_default = {
426
+ isArray,
427
+ isArrayBuffer,
428
+ isBuffer,
429
+ isFormData,
430
+ isArrayBufferView,
431
+ isString,
432
+ isNumber,
433
+ isBoolean,
434
+ isObject,
435
+ isPlainObject,
436
+ isEmptyObject,
437
+ isReadableStream,
438
+ isRequest,
439
+ isResponse,
440
+ isHeaders,
441
+ isUndefined,
442
+ isDate,
443
+ isFile,
444
+ isReactNativeBlob,
445
+ isReactNative,
446
+ isBlob,
447
+ isRegExp,
448
+ isFunction,
449
+ isStream,
450
+ isURLSearchParams,
451
+ isTypedArray,
452
+ isFileList,
453
+ forEach,
454
+ merge,
455
+ extend,
456
+ trim,
457
+ stripBOM,
458
+ inherits,
459
+ toFlatObject,
460
+ kindOf,
461
+ kindOfTest,
462
+ endsWith,
463
+ toArray,
464
+ forEachEntry,
465
+ matchAll,
466
+ isHTMLForm,
467
+ hasOwnProperty,
468
+ hasOwnProp: hasOwnProperty,
469
+ // an alias to avoid ESLint no-prototype-builtins detection
470
+ hasOwnInPrototypeChain,
471
+ getSafeProp,
472
+ reduceDescriptors,
473
+ freezeMethods,
474
+ toObjectSet,
475
+ toCamelCase,
476
+ noop,
477
+ toFiniteNumber,
478
+ findKey,
479
+ global: _global,
480
+ isContextDefined,
481
+ isSpecCompliantForm,
482
+ toJSONObject,
483
+ isAsyncFn,
484
+ isThenable,
485
+ setImmediate: _setImmediate,
486
+ asap,
487
+ isIterable,
488
+ isSafeIterable
489
+ };
490
+
491
+ // node_modules/axios/lib/helpers/parseHeaders.js
492
+ var ignoreDuplicateOf = utils_default.toObjectSet([
493
+ "age",
494
+ "authorization",
495
+ "content-length",
496
+ "content-type",
497
+ "etag",
498
+ "expires",
499
+ "from",
500
+ "host",
501
+ "if-modified-since",
502
+ "if-unmodified-since",
503
+ "last-modified",
504
+ "location",
505
+ "max-forwards",
506
+ "proxy-authorization",
507
+ "referer",
508
+ "retry-after",
509
+ "user-agent"
510
+ ]);
511
+ var parseHeaders_default = (rawHeaders) => {
512
+ const parsed = {};
513
+ let key;
514
+ let val;
515
+ let i;
516
+ rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
517
+ i = line.indexOf(":");
518
+ key = line.substring(0, i).trim().toLowerCase();
519
+ val = line.substring(i + 1).trim();
520
+ if (!key || parsed[key] && ignoreDuplicateOf[key]) {
521
+ return;
522
+ }
523
+ if (key === "set-cookie") {
524
+ if (parsed[key]) {
525
+ parsed[key].push(val);
526
+ } else {
527
+ parsed[key] = [val];
528
+ }
529
+ } else {
530
+ parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
531
+ }
532
+ });
533
+ return parsed;
534
+ };
535
+
536
+ // node_modules/axios/lib/helpers/sanitizeHeaderValue.js
537
+ function trimSPorHTAB(str) {
538
+ let start = 0;
539
+ let end = str.length;
540
+ while (start < end) {
541
+ const code = str.charCodeAt(start);
542
+ if (code !== 9 && code !== 32) {
543
+ break;
544
+ }
545
+ start += 1;
546
+ }
547
+ while (end > start) {
548
+ const code = str.charCodeAt(end - 1);
549
+ if (code !== 9 && code !== 32) {
550
+ break;
551
+ }
552
+ end -= 1;
553
+ }
554
+ return start === 0 && end === str.length ? str : str.slice(start, end);
555
+ }
556
+ var INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g");
557
+ var INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g");
558
+ function sanitizeValue(value, invalidChars) {
559
+ if (utils_default.isArray(value)) {
560
+ return value.map((item) => sanitizeValue(item, invalidChars));
561
+ }
562
+ return trimSPorHTAB(String(value).replace(invalidChars, ""));
563
+ }
564
+ var sanitizeHeaderValue = (value) => sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
565
+ var sanitizeByteStringHeaderValue = (value) => sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
566
+ function toByteStringHeaderObject(headers) {
567
+ const byteStringHeaders = /* @__PURE__ */ Object.create(null);
568
+ utils_default.forEach(headers.toJSON(), (value, header) => {
569
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
570
+ });
571
+ return byteStringHeaders;
572
+ }
573
+
574
+ // node_modules/axios/lib/core/AxiosHeaders.js
575
+ var $internals = /* @__PURE__ */ Symbol("internals");
576
+ function normalizeHeader(header) {
577
+ return header && String(header).trim().toLowerCase();
578
+ }
579
+ function normalizeValue(value) {
580
+ if (value === false || value == null) {
581
+ return value;
582
+ }
583
+ return utils_default.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
584
+ }
585
+ function parseTokens(str) {
586
+ const tokens = /* @__PURE__ */ Object.create(null);
587
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
588
+ let match;
589
+ while (match = tokensRE.exec(str)) {
590
+ tokens[match[1]] = match[2];
591
+ }
592
+ return tokens;
593
+ }
594
+ var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
595
+ function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
596
+ if (utils_default.isFunction(filter2)) {
597
+ return filter2.call(this, value, header);
598
+ }
599
+ if (isHeaderNameFilter) {
600
+ value = header;
601
+ }
602
+ if (!utils_default.isString(value)) return;
603
+ if (utils_default.isString(filter2)) {
604
+ return value.indexOf(filter2) !== -1;
605
+ }
606
+ if (utils_default.isRegExp(filter2)) {
607
+ return filter2.test(value);
608
+ }
609
+ }
610
+ function formatHeader(header) {
611
+ return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
612
+ return char.toUpperCase() + str;
613
+ });
614
+ }
615
+ function buildAccessors(obj, header) {
616
+ const accessorName = utils_default.toCamelCase(" " + header);
617
+ ["get", "set", "has"].forEach((methodName) => {
618
+ Object.defineProperty(obj, methodName + accessorName, {
619
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
620
+ // this data descriptor into an accessor descriptor on the way in.
621
+ __proto__: null,
622
+ value: function(arg1, arg2, arg3) {
623
+ return this[methodName].call(this, header, arg1, arg2, arg3);
624
+ },
625
+ configurable: true
626
+ });
627
+ });
628
+ }
629
+ var AxiosHeaders = class {
630
+ constructor(headers) {
631
+ headers && this.set(headers);
632
+ }
633
+ set(header, valueOrRewrite, rewrite) {
634
+ const self2 = this;
635
+ function setHeader(_value, _header, _rewrite) {
636
+ const lHeader = normalizeHeader(_header);
637
+ if (!lHeader) {
638
+ return;
639
+ }
640
+ const key = utils_default.findKey(self2, lHeader);
641
+ if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
642
+ self2[key || _header] = normalizeValue(_value);
643
+ }
644
+ }
645
+ const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
646
+ if (utils_default.isPlainObject(header) || header instanceof this.constructor) {
647
+ setHeaders(header, valueOrRewrite);
648
+ } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
649
+ setHeaders(parseHeaders_default(header), valueOrRewrite);
650
+ } else if (utils_default.isObject(header) && utils_default.isSafeIterable(header)) {
651
+ let obj = /* @__PURE__ */ Object.create(null), dest, key;
652
+ for (const entry of header) {
653
+ if (!utils_default.isArray(entry)) {
654
+ throw new TypeError("Object iterator must return a key-value pair");
655
+ }
656
+ key = entry[0];
657
+ if (utils_default.hasOwnProp(obj, key)) {
658
+ dest = obj[key];
659
+ obj[key] = utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];
660
+ } else {
661
+ obj[key] = entry[1];
662
+ }
663
+ }
664
+ setHeaders(obj, valueOrRewrite);
665
+ } else {
666
+ header != null && setHeader(valueOrRewrite, header, rewrite);
667
+ }
668
+ return this;
669
+ }
670
+ get(header, parser) {
671
+ header = normalizeHeader(header);
672
+ if (header) {
673
+ const key = utils_default.findKey(this, header);
674
+ if (key) {
675
+ const value = this[key];
676
+ if (!parser) {
677
+ return value;
678
+ }
679
+ if (parser === true) {
680
+ return parseTokens(value);
681
+ }
682
+ if (utils_default.isFunction(parser)) {
683
+ return parser.call(this, value, key);
684
+ }
685
+ if (utils_default.isRegExp(parser)) {
686
+ return parser.exec(value);
687
+ }
688
+ throw new TypeError("parser must be boolean|regexp|function");
689
+ }
690
+ }
691
+ }
692
+ has(header, matcher) {
693
+ header = normalizeHeader(header);
694
+ if (header) {
695
+ const key = utils_default.findKey(this, header);
696
+ return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
697
+ }
698
+ return false;
699
+ }
700
+ delete(header, matcher) {
701
+ const self2 = this;
702
+ let deleted = false;
703
+ function deleteHeader(_header) {
704
+ _header = normalizeHeader(_header);
705
+ if (_header) {
706
+ const key = utils_default.findKey(self2, _header);
707
+ if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
708
+ delete self2[key];
709
+ deleted = true;
710
+ }
711
+ }
712
+ }
713
+ if (utils_default.isArray(header)) {
714
+ header.forEach(deleteHeader);
715
+ } else {
716
+ deleteHeader(header);
717
+ }
718
+ return deleted;
719
+ }
720
+ clear(matcher) {
721
+ const keys = Object.keys(this);
722
+ let i = keys.length;
723
+ let deleted = false;
724
+ while (i--) {
725
+ const key = keys[i];
726
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
727
+ delete this[key];
728
+ deleted = true;
729
+ }
730
+ }
731
+ return deleted;
732
+ }
733
+ normalize(format) {
734
+ const self2 = this;
735
+ const headers = {};
736
+ utils_default.forEach(this, (value, header) => {
737
+ const key = utils_default.findKey(headers, header);
738
+ if (key) {
739
+ self2[key] = normalizeValue(value);
740
+ delete self2[header];
741
+ return;
742
+ }
743
+ const normalized = format ? formatHeader(header) : String(header).trim();
744
+ if (normalized !== header) {
745
+ delete self2[header];
746
+ }
747
+ self2[normalized] = normalizeValue(value);
748
+ headers[normalized] = true;
749
+ });
750
+ return this;
751
+ }
752
+ concat(...targets) {
753
+ return this.constructor.concat(this, ...targets);
754
+ }
755
+ toJSON(asStrings) {
756
+ const obj = /* @__PURE__ */ Object.create(null);
757
+ utils_default.forEach(this, (value, header) => {
758
+ value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
759
+ });
760
+ return obj;
761
+ }
762
+ [Symbol.iterator]() {
763
+ return Object.entries(this.toJSON())[Symbol.iterator]();
764
+ }
765
+ toString() {
766
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
767
+ }
768
+ getSetCookie() {
769
+ return this.get("set-cookie") || [];
770
+ }
771
+ get [Symbol.toStringTag]() {
772
+ return "AxiosHeaders";
773
+ }
774
+ static from(thing) {
775
+ return thing instanceof this ? thing : new this(thing);
776
+ }
777
+ static concat(first, ...targets) {
778
+ const computed = new this(first);
779
+ targets.forEach((target) => computed.set(target));
780
+ return computed;
781
+ }
782
+ static accessor(header) {
783
+ const internals = this[$internals] = this[$internals] = {
784
+ accessors: {}
785
+ };
786
+ const accessors = internals.accessors;
787
+ const prototype2 = this.prototype;
788
+ function defineAccessor(_header) {
789
+ const lHeader = normalizeHeader(_header);
790
+ if (!accessors[lHeader]) {
791
+ buildAccessors(prototype2, _header);
792
+ accessors[lHeader] = true;
793
+ }
794
+ }
795
+ utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
796
+ return this;
797
+ }
798
+ };
799
+ AxiosHeaders.accessor([
800
+ "Content-Type",
801
+ "Content-Length",
802
+ "Accept",
803
+ "Accept-Encoding",
804
+ "User-Agent",
805
+ "Authorization"
806
+ ]);
807
+ utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
808
+ let mapped = key[0].toUpperCase() + key.slice(1);
809
+ return {
810
+ get: () => value,
811
+ set(headerValue) {
812
+ this[mapped] = headerValue;
813
+ }
814
+ };
815
+ });
816
+ utils_default.freezeMethods(AxiosHeaders);
817
+ var AxiosHeaders_default = AxiosHeaders;
818
+
819
+ // node_modules/axios/lib/core/AxiosError.js
820
+ var REDACTED = "[REDACTED ****]";
821
+ function hasOwnOrPrototypeToJSON(source) {
822
+ if (utils_default.hasOwnProp(source, "toJSON")) {
823
+ return true;
824
+ }
825
+ let prototype2 = Object.getPrototypeOf(source);
826
+ while (prototype2 && prototype2 !== Object.prototype) {
827
+ if (utils_default.hasOwnProp(prototype2, "toJSON")) {
828
+ return true;
829
+ }
830
+ prototype2 = Object.getPrototypeOf(prototype2);
831
+ }
832
+ return false;
833
+ }
834
+ function redactConfig(config, redactKeys) {
835
+ const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
836
+ const seen = [];
837
+ const visit = (source) => {
838
+ if (source === null || typeof source !== "object") return source;
839
+ if (utils_default.isBuffer(source)) return source;
840
+ if (seen.indexOf(source) !== -1) return void 0;
841
+ if (source instanceof AxiosHeaders_default) {
842
+ source = source.toJSON();
843
+ }
844
+ seen.push(source);
845
+ let result;
846
+ if (utils_default.isArray(source)) {
847
+ result = [];
848
+ source.forEach((v, i) => {
849
+ const reducedValue = visit(v);
850
+ if (!utils_default.isUndefined(reducedValue)) {
851
+ result[i] = reducedValue;
852
+ }
853
+ });
854
+ } else {
855
+ if (!utils_default.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
856
+ seen.pop();
857
+ return source;
858
+ }
859
+ result = /* @__PURE__ */ Object.create(null);
860
+ for (const [key, value] of Object.entries(source)) {
861
+ const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
862
+ if (!utils_default.isUndefined(reducedValue)) {
863
+ result[key] = reducedValue;
864
+ }
865
+ }
866
+ }
867
+ seen.pop();
868
+ return result;
869
+ };
870
+ return visit(config);
871
+ }
872
+ var AxiosError = class _AxiosError extends Error {
873
+ static from(error, code, config, request, response, customProps) {
874
+ const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
875
+ axiosError.cause = error;
876
+ axiosError.name = error.name;
877
+ if (error.status != null && axiosError.status == null) {
878
+ axiosError.status = error.status;
879
+ }
880
+ customProps && Object.assign(axiosError, customProps);
881
+ return axiosError;
882
+ }
883
+ /**
884
+ * Create an Error with the specified message, config, error code, request and response.
885
+ *
886
+ * @param {string} message The error message.
887
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
888
+ * @param {Object} [config] The config.
889
+ * @param {Object} [request] The request.
890
+ * @param {Object} [response] The response.
891
+ *
892
+ * @returns {Error} The created error.
893
+ */
894
+ constructor(message, code, config, request, response) {
895
+ super(message);
896
+ Object.defineProperty(this, "message", {
897
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
898
+ // this data descriptor into an accessor descriptor on the way in.
899
+ __proto__: null,
900
+ value: message,
901
+ enumerable: true,
902
+ writable: true,
903
+ configurable: true
904
+ });
905
+ this.name = "AxiosError";
906
+ this.isAxiosError = true;
907
+ code && (this.code = code);
908
+ config && (this.config = config);
909
+ request && (this.request = request);
910
+ if (response) {
911
+ this.response = response;
912
+ this.status = response.status;
913
+ }
914
+ }
915
+ toJSON() {
916
+ const config = this.config;
917
+ const redactKeys = config && utils_default.hasOwnProp(config, "redact") ? config.redact : void 0;
918
+ const serializedConfig = utils_default.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils_default.toJSONObject(config);
919
+ return {
920
+ // Standard
921
+ message: this.message,
922
+ name: this.name,
923
+ // Microsoft
924
+ description: this.description,
925
+ number: this.number,
926
+ // Mozilla
927
+ fileName: this.fileName,
928
+ lineNumber: this.lineNumber,
929
+ columnNumber: this.columnNumber,
930
+ stack: this.stack,
931
+ // Axios
932
+ config: serializedConfig,
933
+ code: this.code,
934
+ status: this.status
935
+ };
936
+ }
937
+ };
938
+ AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
939
+ AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
940
+ AxiosError.ECONNABORTED = "ECONNABORTED";
941
+ AxiosError.ETIMEDOUT = "ETIMEDOUT";
942
+ AxiosError.ECONNREFUSED = "ECONNREFUSED";
943
+ AxiosError.ERR_NETWORK = "ERR_NETWORK";
944
+ AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
945
+ AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
946
+ AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
947
+ AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
948
+ AxiosError.ERR_CANCELED = "ERR_CANCELED";
949
+ AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
950
+ AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
951
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
952
+ var AxiosError_default = AxiosError;
953
+
954
+ // node_modules/axios/lib/helpers/null.js
955
+ var null_default = null;
956
+
957
+ // node_modules/axios/lib/helpers/toFormData.js
958
+ var DEFAULT_FORM_DATA_MAX_DEPTH = 100;
959
+ function isVisitable(thing) {
960
+ return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
961
+ }
962
+ function removeBrackets(key) {
963
+ return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
964
+ }
965
+ function renderKey(path, key, dots) {
966
+ if (!path) return key;
967
+ return path.concat(key).map(function each(token, i) {
968
+ token = removeBrackets(token);
969
+ return !dots && i ? "[" + token + "]" : token;
970
+ }).join(dots ? "." : "");
971
+ }
972
+ function isFlatArray(arr) {
973
+ return utils_default.isArray(arr) && !arr.some(isVisitable);
974
+ }
975
+ var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
976
+ return /^is[A-Z]/.test(prop);
977
+ });
978
+ function toFormData(obj, formData, options) {
979
+ if (!utils_default.isObject(obj)) {
980
+ throw new TypeError("target must be an object");
981
+ }
982
+ formData = formData || new (null_default || FormData)();
983
+ options = utils_default.toFlatObject(
984
+ options,
985
+ {
986
+ metaTokens: true,
987
+ dots: false,
988
+ indexes: false
989
+ },
990
+ false,
991
+ function defined(option, source) {
992
+ return !utils_default.isUndefined(source[option]);
993
+ }
994
+ );
995
+ const metaTokens = options.metaTokens;
996
+ const visitor = options.visitor || defaultVisitor;
997
+ const dots = options.dots;
998
+ const indexes = options.indexes;
999
+ const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
1000
+ const maxDepth = options.maxDepth === void 0 ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;
1001
+ const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
1002
+ const stack = [];
1003
+ if (!utils_default.isFunction(visitor)) {
1004
+ throw new TypeError("visitor must be a function");
1005
+ }
1006
+ function convertValue(value) {
1007
+ if (value === null) return "";
1008
+ if (utils_default.isDate(value)) {
1009
+ return value.toISOString();
1010
+ }
1011
+ if (utils_default.isBoolean(value)) {
1012
+ return value.toString();
1013
+ }
1014
+ if (!useBlob && utils_default.isBlob(value)) {
1015
+ throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
1016
+ }
1017
+ if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) {
1018
+ return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
1019
+ }
1020
+ return value;
1021
+ }
1022
+ function throwIfMaxDepthExceeded(depth) {
1023
+ if (depth > maxDepth) {
1024
+ throw new AxiosError_default(
1025
+ "Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth,
1026
+ AxiosError_default.ERR_FORM_DATA_DEPTH_EXCEEDED
1027
+ );
1028
+ }
1029
+ }
1030
+ function stringifyWithDepthLimit(value, depth) {
1031
+ if (maxDepth === Infinity) {
1032
+ return JSON.stringify(value);
1033
+ }
1034
+ const ancestors = [];
1035
+ return JSON.stringify(value, function limitDepth(_key, currentValue) {
1036
+ if (!utils_default.isObject(currentValue)) {
1037
+ return currentValue;
1038
+ }
1039
+ while (ancestors.length && ancestors[ancestors.length - 1] !== this) {
1040
+ ancestors.pop();
1041
+ }
1042
+ ancestors.push(currentValue);
1043
+ throwIfMaxDepthExceeded(depth + ancestors.length - 1);
1044
+ return currentValue;
1045
+ });
1046
+ }
1047
+ function defaultVisitor(value, key, path) {
1048
+ let arr = value;
1049
+ if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) {
1050
+ formData.append(renderKey(path, key, dots), convertValue(value));
1051
+ return false;
1052
+ }
1053
+ if (value && !path && typeof value === "object") {
1054
+ if (utils_default.endsWith(key, "{}")) {
1055
+ key = metaTokens ? key : key.slice(0, -2);
1056
+ value = stringifyWithDepthLimit(value, 1);
1057
+ } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
1058
+ key = removeBrackets(key);
1059
+ arr.forEach(function each(el, index) {
1060
+ !(utils_default.isUndefined(el) || el === null) && formData.append(
1061
+ // eslint-disable-next-line no-nested-ternary
1062
+ indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
1063
+ convertValue(el)
1064
+ );
1065
+ });
1066
+ return false;
1067
+ }
1068
+ }
1069
+ if (isVisitable(value)) {
1070
+ return true;
1071
+ }
1072
+ formData.append(renderKey(path, key, dots), convertValue(value));
1073
+ return false;
1074
+ }
1075
+ const exposedHelpers = Object.assign(predicates, {
1076
+ defaultVisitor,
1077
+ convertValue,
1078
+ isVisitable
1079
+ });
1080
+ function build(value, path, depth = 0) {
1081
+ if (utils_default.isUndefined(value)) return;
1082
+ throwIfMaxDepthExceeded(depth);
1083
+ if (stack.indexOf(value) !== -1) {
1084
+ throw new Error("Circular reference detected in " + path.join("."));
1085
+ }
1086
+ stack.push(value);
1087
+ utils_default.forEach(value, function each(el, key) {
1088
+ const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path, exposedHelpers);
1089
+ if (result === true) {
1090
+ build(el, path ? path.concat(key) : [key], depth + 1);
1091
+ }
1092
+ });
1093
+ stack.pop();
1094
+ }
1095
+ if (!utils_default.isObject(obj)) {
1096
+ throw new TypeError("data must be an object");
1097
+ }
1098
+ build(obj);
1099
+ return formData;
1100
+ }
1101
+ var toFormData_default = toFormData;
1102
+
1103
+ // node_modules/axios/lib/helpers/AxiosURLSearchParams.js
1104
+ function encode(str) {
1105
+ const charMap = {
1106
+ "!": "%21",
1107
+ "'": "%27",
1108
+ "(": "%28",
1109
+ ")": "%29",
1110
+ "~": "%7E",
1111
+ "%20": "+"
1112
+ };
1113
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
1114
+ return charMap[match];
1115
+ });
1116
+ }
1117
+ function AxiosURLSearchParams(params, options) {
1118
+ this._pairs = [];
1119
+ params && toFormData_default(params, this, options);
1120
+ }
1121
+ var prototype = AxiosURLSearchParams.prototype;
1122
+ prototype.append = function append(name, value) {
1123
+ this._pairs.push([name, value]);
1124
+ };
1125
+ prototype.toString = function toString2(encoder) {
1126
+ const _encode = encoder ? function(value) {
1127
+ return encoder.call(this, value, encode);
1128
+ } : encode;
1129
+ return this._pairs.map(function each(pair) {
1130
+ return _encode(pair[0]) + "=" + _encode(pair[1]);
1131
+ }, "").join("&");
1132
+ };
1133
+ var AxiosURLSearchParams_default = AxiosURLSearchParams;
1134
+
1135
+ // node_modules/axios/lib/helpers/buildURL.js
1136
+ function encode2(val) {
1137
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
1138
+ }
1139
+ function buildURL(url, params, options) {
1140
+ if (!params) {
1141
+ return url;
1142
+ }
1143
+ const _options = utils_default.isFunction(options) ? {
1144
+ serialize: options
1145
+ } : options;
1146
+ const _encode = utils_default.getSafeProp(_options, "encode") || encode2;
1147
+ const serializeFn = utils_default.getSafeProp(_options, "serialize");
1148
+ let serializedParams;
1149
+ if (serializeFn) {
1150
+ serializedParams = serializeFn(params, _options);
1151
+ } else {
1152
+ serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, _options).toString(_encode);
1153
+ }
1154
+ if (serializedParams) {
1155
+ const hashmarkIndex = url.indexOf("#");
1156
+ if (hashmarkIndex !== -1) {
1157
+ url = url.slice(0, hashmarkIndex);
1158
+ }
1159
+ url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
1160
+ }
1161
+ return url;
1162
+ }
1163
+
1164
+ // node_modules/axios/lib/core/InterceptorManager.js
1165
+ var InterceptorManager = class {
1166
+ constructor() {
1167
+ this.handlers = [];
1168
+ }
1169
+ /**
1170
+ * Add a new interceptor to the stack
1171
+ *
1172
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
1173
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
1174
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
1175
+ *
1176
+ * @return {Number} An ID used to remove interceptor later
1177
+ */
1178
+ use(fulfilled, rejected, options) {
1179
+ this.handlers.push({
1180
+ fulfilled,
1181
+ rejected,
1182
+ synchronous: options ? options.synchronous : false,
1183
+ runWhen: options ? options.runWhen : null
1184
+ });
1185
+ return this.handlers.length - 1;
1186
+ }
1187
+ /**
1188
+ * Remove an interceptor from the stack
1189
+ *
1190
+ * @param {Number} id The ID that was returned by `use`
1191
+ *
1192
+ * @returns {void}
1193
+ */
1194
+ eject(id) {
1195
+ if (this.handlers[id]) {
1196
+ this.handlers[id] = null;
1197
+ }
1198
+ }
1199
+ /**
1200
+ * Clear all interceptors from the stack
1201
+ *
1202
+ * @returns {void}
1203
+ */
1204
+ clear() {
1205
+ if (this.handlers) {
1206
+ this.handlers = [];
1207
+ }
1208
+ }
1209
+ /**
1210
+ * Iterate over all the registered interceptors
1211
+ *
1212
+ * This method is particularly useful for skipping over any
1213
+ * interceptors that may have become `null` calling `eject`.
1214
+ *
1215
+ * @param {Function} fn The function to call for each interceptor
1216
+ *
1217
+ * @returns {void}
1218
+ */
1219
+ forEach(fn) {
1220
+ utils_default.forEach(this.handlers, function forEachHandler(h) {
1221
+ if (h !== null) {
1222
+ fn(h);
1223
+ }
1224
+ });
1225
+ }
1226
+ };
1227
+ var InterceptorManager_default = InterceptorManager;
1228
+
1229
+ // node_modules/axios/lib/defaults/transitional.js
1230
+ var transitional_default = {
1231
+ silentJSONParsing: true,
1232
+ forcedJSONParsing: true,
1233
+ clarifyTimeoutError: false,
1234
+ legacyInterceptorReqResOrdering: true,
1235
+ advertiseZstdAcceptEncoding: false,
1236
+ validateStatusUndefinedResolves: true
1237
+ };
1238
+
1239
+ // node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
1240
+ var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default;
1241
+
1242
+ // node_modules/axios/lib/platform/browser/classes/FormData.js
1243
+ var FormData_default = typeof FormData !== "undefined" ? FormData : null;
1244
+
1245
+ // node_modules/axios/lib/platform/browser/classes/Blob.js
1246
+ var Blob_default = typeof Blob !== "undefined" ? Blob : null;
1247
+
1248
+ // node_modules/axios/lib/platform/browser/index.js
1249
+ var browser_default = {
1250
+ isBrowser: true,
1251
+ classes: {
1252
+ URLSearchParams: URLSearchParams_default,
1253
+ FormData: FormData_default,
1254
+ Blob: Blob_default
1255
+ },
1256
+ protocols: ["http", "https", "file", "blob", "url", "data"]
1257
+ };
1258
+
1259
+ // node_modules/axios/lib/platform/common/utils.js
1260
+ var utils_exports = {};
1261
+ __export(utils_exports, {
1262
+ hasBrowserEnv: () => hasBrowserEnv,
1263
+ hasStandardBrowserEnv: () => hasStandardBrowserEnv,
1264
+ hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
1265
+ navigator: () => _navigator,
1266
+ origin: () => origin
1267
+ });
1268
+ var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
1269
+ var _navigator = typeof navigator === "object" && navigator || void 0;
1270
+ var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
1271
+ var hasStandardBrowserWebWorkerEnv = (() => {
1272
+ return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
1273
+ self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
1274
+ })();
1275
+ var origin = hasBrowserEnv && window.location.href || "http://localhost";
1276
+
1277
+ // node_modules/axios/lib/platform/index.js
1278
+ var platform_default = {
1279
+ ...utils_exports,
1280
+ ...browser_default
1281
+ };
1282
+
1283
+ // node_modules/axios/lib/helpers/toURLEncodedForm.js
1284
+ function toURLEncodedForm(data, options) {
1285
+ return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
1286
+ visitor: function(value, key, path, helpers) {
1287
+ if (platform_default.isNode && utils_default.isBuffer(value)) {
1288
+ this.append(key, value.toString("base64"));
1289
+ return false;
1290
+ }
1291
+ return helpers.defaultVisitor.apply(this, arguments);
1292
+ },
1293
+ ...options
1294
+ });
1295
+ }
1296
+
1297
+ // node_modules/axios/lib/helpers/formDataToJSON.js
1298
+ var MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;
1299
+ function throwIfDepthExceeded(index) {
1300
+ if (index > MAX_DEPTH) {
1301
+ throw new AxiosError_default(
1302
+ "FormData field is too deeply nested (" + index + " levels). Max depth: " + MAX_DEPTH,
1303
+ AxiosError_default.ERR_FORM_DATA_DEPTH_EXCEEDED
1304
+ );
1305
+ }
1306
+ }
1307
+ function parsePropPath(name) {
1308
+ const path = [];
1309
+ const pattern = /\w+|\[(\w*)]/g;
1310
+ let match;
1311
+ while ((match = pattern.exec(name)) !== null) {
1312
+ throwIfDepthExceeded(path.length);
1313
+ path.push(match[0] === "[]" ? "" : match[1] || match[0]);
1314
+ }
1315
+ return path;
1316
+ }
1317
+ function arrayToObject(arr) {
1318
+ const obj = {};
1319
+ const keys = Object.keys(arr);
1320
+ let i;
1321
+ const len = keys.length;
1322
+ let key;
1323
+ for (i = 0; i < len; i++) {
1324
+ key = keys[i];
1325
+ obj[key] = arr[key];
1326
+ }
1327
+ return obj;
1328
+ }
1329
+ function formDataToJSON(formData) {
1330
+ function buildPath(path, value, target, index) {
1331
+ throwIfDepthExceeded(index);
1332
+ let name = path[index++];
1333
+ if (name === "__proto__") return true;
1334
+ const isNumericKey = Number.isFinite(+name);
1335
+ const isLast = index >= path.length;
1336
+ name = !name && utils_default.isArray(target) ? target.length : name;
1337
+ if (isLast) {
1338
+ if (utils_default.hasOwnProp(target, name)) {
1339
+ target[name] = utils_default.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
1340
+ } else {
1341
+ target[name] = value;
1342
+ }
1343
+ return !isNumericKey;
1344
+ }
1345
+ if (!utils_default.hasOwnProp(target, name) || !utils_default.isObject(target[name])) {
1346
+ target[name] = [];
1347
+ }
1348
+ const result = buildPath(path, value, target[name], index);
1349
+ if (result && utils_default.isArray(target[name])) {
1350
+ target[name] = arrayToObject(target[name]);
1351
+ }
1352
+ return !isNumericKey;
1353
+ }
1354
+ if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
1355
+ const obj = {};
1356
+ utils_default.forEachEntry(formData, (name, value) => {
1357
+ buildPath(parsePropPath(name), value, obj, 0);
1358
+ });
1359
+ return obj;
1360
+ }
1361
+ return null;
1362
+ }
1363
+ var formDataToJSON_default = formDataToJSON;
1364
+
1365
+ // node_modules/axios/lib/defaults/index.js
1366
+ var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : void 0;
1367
+ function stringifySafely(rawValue, parser, encoder) {
1368
+ if (utils_default.isString(rawValue)) {
1369
+ try {
1370
+ (parser || JSON.parse)(rawValue);
1371
+ return utils_default.trim(rawValue);
1372
+ } catch (e) {
1373
+ if (e.name !== "SyntaxError") {
1374
+ throw e;
1375
+ }
1376
+ }
1377
+ }
1378
+ return (encoder || JSON.stringify)(rawValue);
1379
+ }
1380
+ var defaults = {
1381
+ transitional: transitional_default,
1382
+ adapter: ["xhr", "http", "fetch"],
1383
+ transformRequest: [
1384
+ function transformRequest(data, headers) {
1385
+ const contentType = headers.getContentType() || "";
1386
+ const hasJSONContentType = contentType.indexOf("application/json") > -1;
1387
+ const isObjectPayload = utils_default.isObject(data);
1388
+ if (isObjectPayload && utils_default.isHTMLForm(data)) {
1389
+ data = new FormData(data);
1390
+ }
1391
+ const isFormData2 = utils_default.isFormData(data);
1392
+ if (isFormData2) {
1393
+ return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
1394
+ }
1395
+ 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)) {
1396
+ return data;
1397
+ }
1398
+ if (utils_default.isArrayBufferView(data)) {
1399
+ return data.buffer;
1400
+ }
1401
+ if (utils_default.isURLSearchParams(data)) {
1402
+ headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
1403
+ return data.toString();
1404
+ }
1405
+ let isFileList2;
1406
+ if (isObjectPayload) {
1407
+ const formSerializer = own(this, "formSerializer");
1408
+ if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
1409
+ return toURLEncodedForm(data, formSerializer).toString();
1410
+ }
1411
+ if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
1412
+ const env = own(this, "env");
1413
+ const _FormData = env && env.FormData;
1414
+ return toFormData_default(
1415
+ isFileList2 ? { "files[]": data } : data,
1416
+ _FormData && new _FormData(),
1417
+ formSerializer
1418
+ );
1419
+ }
1420
+ }
1421
+ if (isObjectPayload || hasJSONContentType) {
1422
+ headers.setContentType("application/json", false);
1423
+ return stringifySafely(data);
1424
+ }
1425
+ return data;
1426
+ }
1427
+ ],
1428
+ transformResponse: [
1429
+ function transformResponse(data) {
1430
+ const transitional2 = own(this, "transitional") || defaults.transitional;
1431
+ const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
1432
+ const responseType = own(this, "responseType");
1433
+ const JSONRequested = responseType === "json";
1434
+ if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
1435
+ return data;
1436
+ }
1437
+ if (data && utils_default.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
1438
+ const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
1439
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
1440
+ try {
1441
+ return JSON.parse(data, own(this, "parseReviver"));
1442
+ } catch (e) {
1443
+ if (strictJSONParsing) {
1444
+ if (e.name === "SyntaxError") {
1445
+ throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, own(this, "response"));
1446
+ }
1447
+ throw e;
1448
+ }
1449
+ }
1450
+ }
1451
+ return data;
1452
+ }
1453
+ ],
1454
+ /**
1455
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
1456
+ * timeout is not created.
1457
+ */
1458
+ timeout: 0,
1459
+ xsrfCookieName: "XSRF-TOKEN",
1460
+ xsrfHeaderName: "X-XSRF-TOKEN",
1461
+ maxContentLength: -1,
1462
+ maxBodyLength: -1,
1463
+ env: {
1464
+ FormData: platform_default.classes.FormData,
1465
+ Blob: platform_default.classes.Blob
1466
+ },
1467
+ validateStatus: function validateStatus(status) {
1468
+ return status >= 200 && status < 300;
1469
+ },
1470
+ headers: {
1471
+ common: {
1472
+ Accept: "application/json, text/plain, */*",
1473
+ "Content-Type": void 0
1474
+ }
1475
+ }
1476
+ };
1477
+ utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (method) => {
1478
+ defaults.headers[method] = {};
1479
+ });
1480
+ var defaults_default = defaults;
1481
+
1482
+ // node_modules/axios/lib/core/transformData.js
1483
+ function transformData(fns, response) {
1484
+ const config = this || defaults_default;
1485
+ const context = response || config;
1486
+ const headers = AxiosHeaders_default.from(context.headers);
1487
+ let data = context.data;
1488
+ utils_default.forEach(fns, function transform(fn) {
1489
+ data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
1490
+ });
1491
+ headers.normalize();
1492
+ return data;
1493
+ }
1494
+
1495
+ // node_modules/axios/lib/cancel/isCancel.js
1496
+ function isCancel(value) {
1497
+ return !!(value && value.__CANCEL__);
1498
+ }
1499
+
1500
+ // node_modules/axios/lib/cancel/CanceledError.js
1501
+ var CanceledError = class extends AxiosError_default {
1502
+ /**
1503
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
1504
+ *
1505
+ * @param {string=} message The message.
1506
+ * @param {Object=} config The config.
1507
+ * @param {Object=} request The request.
1508
+ *
1509
+ * @returns {CanceledError} The created error.
1510
+ */
1511
+ constructor(message, config, request) {
1512
+ super(message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
1513
+ this.name = "CanceledError";
1514
+ this.__CANCEL__ = true;
1515
+ }
1516
+ };
1517
+ var CanceledError_default = CanceledError;
1518
+
1519
+ // node_modules/axios/lib/core/settle.js
1520
+ function settle(resolve, reject, response) {
1521
+ const validateStatus2 = response.config.validateStatus;
1522
+ if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
1523
+ resolve(response);
1524
+ } else {
1525
+ reject(new AxiosError_default(
1526
+ "Request failed with status code " + response.status,
1527
+ response.status >= 400 && response.status < 500 ? AxiosError_default.ERR_BAD_REQUEST : AxiosError_default.ERR_BAD_RESPONSE,
1528
+ response.config,
1529
+ response.request,
1530
+ response
1531
+ ));
1532
+ }
1533
+ }
1534
+
1535
+ // node_modules/axios/lib/helpers/parseProtocol.js
1536
+ function parseProtocol(url) {
1537
+ const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
1538
+ return match && match[1] || "";
1539
+ }
1540
+
1541
+ // node_modules/axios/lib/helpers/speedometer.js
1542
+ function speedometer(samplesCount, min) {
1543
+ samplesCount = samplesCount || 10;
1544
+ const bytes = new Array(samplesCount);
1545
+ const timestamps = new Array(samplesCount);
1546
+ let head = 0;
1547
+ let tail = 0;
1548
+ let firstSampleTS;
1549
+ min = min !== void 0 ? min : 1e3;
1550
+ return function push(chunkLength) {
1551
+ const now = Date.now();
1552
+ const startedAt = timestamps[tail];
1553
+ if (!firstSampleTS) {
1554
+ firstSampleTS = now;
1555
+ }
1556
+ bytes[head] = chunkLength;
1557
+ timestamps[head] = now;
1558
+ let i = tail;
1559
+ let bytesCount = 0;
1560
+ while (i !== head) {
1561
+ bytesCount += bytes[i++];
1562
+ i = i % samplesCount;
1563
+ }
1564
+ head = (head + 1) % samplesCount;
1565
+ if (head === tail) {
1566
+ tail = (tail + 1) % samplesCount;
1567
+ }
1568
+ if (now - firstSampleTS < min) {
1569
+ return;
1570
+ }
1571
+ const passed = startedAt && now - startedAt;
1572
+ return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
1573
+ };
1574
+ }
1575
+ var speedometer_default = speedometer;
1576
+
1577
+ // node_modules/axios/lib/helpers/throttle.js
1578
+ function throttle(fn, freq) {
1579
+ let timestamp = 0;
1580
+ let threshold = 1e3 / freq;
1581
+ let lastArgs;
1582
+ let timer;
1583
+ const invoke = (args, now = Date.now()) => {
1584
+ timestamp = now;
1585
+ lastArgs = null;
1586
+ if (timer) {
1587
+ clearTimeout(timer);
1588
+ timer = null;
1589
+ }
1590
+ fn(...args);
1591
+ };
1592
+ const throttled = (...args) => {
1593
+ const now = Date.now();
1594
+ const passed = now - timestamp;
1595
+ if (passed >= threshold) {
1596
+ invoke(args, now);
1597
+ } else {
1598
+ lastArgs = args;
1599
+ if (!timer) {
1600
+ timer = setTimeout(() => {
1601
+ timer = null;
1602
+ invoke(lastArgs);
1603
+ }, threshold - passed);
1604
+ }
1605
+ }
1606
+ };
1607
+ const flush = () => lastArgs && invoke(lastArgs);
1608
+ return [throttled, flush];
1609
+ }
1610
+ var throttle_default = throttle;
1611
+
1612
+ // node_modules/axios/lib/helpers/progressEventReducer.js
1613
+ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
1614
+ let bytesNotified = 0;
1615
+ const _speedometer = speedometer_default(50, 250);
1616
+ return throttle_default((e) => {
1617
+ if (!e || typeof e.loaded !== "number") {
1618
+ return;
1619
+ }
1620
+ const rawLoaded = e.loaded;
1621
+ const total = e.lengthComputable ? e.total : void 0;
1622
+ const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
1623
+ const progressBytes = Math.max(0, loaded - bytesNotified);
1624
+ const rate = _speedometer(progressBytes);
1625
+ bytesNotified = Math.max(bytesNotified, loaded);
1626
+ const data = {
1627
+ loaded,
1628
+ total,
1629
+ progress: total ? loaded / total : void 0,
1630
+ bytes: progressBytes,
1631
+ rate: rate ? rate : void 0,
1632
+ estimated: rate && total ? (total - loaded) / rate : void 0,
1633
+ event: e,
1634
+ lengthComputable: total != null,
1635
+ [isDownloadStream ? "download" : "upload"]: true
1636
+ };
1637
+ listener(data);
1638
+ }, freq);
1639
+ };
1640
+ var progressEventDecorator = (total, throttled) => {
1641
+ const lengthComputable = total != null;
1642
+ return [
1643
+ (loaded) => throttled[0]({
1644
+ lengthComputable,
1645
+ total,
1646
+ loaded
1647
+ }),
1648
+ throttled[1]
1649
+ ];
1650
+ };
1651
+ var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
1652
+
1653
+ // node_modules/axios/lib/helpers/isURLSameOrigin.js
1654
+ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
1655
+ url = new URL(url, platform_default.origin);
1656
+ return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
1657
+ })(
1658
+ new URL(platform_default.origin),
1659
+ platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
1660
+ ) : () => true;
1661
+
1662
+ // node_modules/axios/lib/helpers/cookies.js
1663
+ var cookies_default = platform_default.hasStandardBrowserEnv ? (
1664
+ // Standard browser envs support document.cookie
1665
+ {
1666
+ write(name, value, expires, path, domain, secure, sameSite) {
1667
+ if (typeof document === "undefined") return;
1668
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
1669
+ if (utils_default.isNumber(expires)) {
1670
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
1671
+ }
1672
+ if (utils_default.isString(path)) {
1673
+ cookie.push(`path=${path}`);
1674
+ }
1675
+ if (utils_default.isString(domain)) {
1676
+ cookie.push(`domain=${domain}`);
1677
+ }
1678
+ if (secure === true) {
1679
+ cookie.push("secure");
1680
+ }
1681
+ if (utils_default.isString(sameSite)) {
1682
+ cookie.push(`SameSite=${sameSite}`);
1683
+ }
1684
+ document.cookie = cookie.join("; ");
1685
+ },
1686
+ read(name) {
1687
+ if (typeof document === "undefined") return null;
1688
+ const cookies = document.cookie.split(";");
1689
+ for (let i = 0; i < cookies.length; i++) {
1690
+ const cookie = cookies[i].replace(/^\s+/, "");
1691
+ const eq = cookie.indexOf("=");
1692
+ if (eq !== -1 && cookie.slice(0, eq) === name) {
1693
+ return decodeURIComponent(cookie.slice(eq + 1));
1694
+ }
1695
+ }
1696
+ return null;
1697
+ },
1698
+ remove(name) {
1699
+ this.write(name, "", Date.now() - 864e5, "/");
1700
+ }
1701
+ }
1702
+ ) : (
1703
+ // Non-standard browser env (web workers, react-native) lack needed support.
1704
+ {
1705
+ write() {
1706
+ },
1707
+ read() {
1708
+ return null;
1709
+ },
1710
+ remove() {
1711
+ }
1712
+ }
1713
+ );
1714
+
1715
+ // node_modules/axios/lib/helpers/isAbsoluteURL.js
1716
+ function isAbsoluteURL(url) {
1717
+ if (typeof url !== "string") {
1718
+ return false;
1719
+ }
1720
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
1721
+ }
1722
+
1723
+ // node_modules/axios/lib/helpers/combineURLs.js
1724
+ function combineURLs(baseURL, relativeURL) {
1725
+ return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
1726
+ }
1727
+
1728
+ // node_modules/axios/lib/core/buildFullPath.js
1729
+ var malformedHttpProtocol = /^https?:(?!\/\/)/i;
1730
+ var httpProtocolControlCharacters = /[\t\n\r]/g;
1731
+ function stripLeadingC0ControlOrSpace(url) {
1732
+ let i = 0;
1733
+ while (i < url.length && url.charCodeAt(i) <= 32) {
1734
+ i++;
1735
+ }
1736
+ return url.slice(i);
1737
+ }
1738
+ function normalizeURLForProtocolCheck(url) {
1739
+ return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, "");
1740
+ }
1741
+ function assertValidHttpProtocolURL(url, config) {
1742
+ if (typeof url === "string" && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url))) {
1743
+ throw new AxiosError_default(
1744
+ 'Invalid URL: missing "//" after protocol',
1745
+ AxiosError_default.ERR_INVALID_URL,
1746
+ config
1747
+ );
1748
+ }
1749
+ }
1750
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
1751
+ assertValidHttpProtocolURL(requestedURL, config);
1752
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
1753
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
1754
+ assertValidHttpProtocolURL(baseURL, config);
1755
+ return combineURLs(baseURL, requestedURL);
1756
+ }
1757
+ return requestedURL;
1758
+ }
1759
+
1760
+ // node_modules/axios/lib/core/mergeConfig.js
1761
+ var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
1762
+ function mergeConfig(config1, config2) {
1763
+ config2 = config2 || {};
1764
+ const config = /* @__PURE__ */ Object.create(null);
1765
+ Object.defineProperty(config, "hasOwnProperty", {
1766
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
1767
+ // this data descriptor into an accessor descriptor on the way in.
1768
+ __proto__: null,
1769
+ value: Object.prototype.hasOwnProperty,
1770
+ enumerable: false,
1771
+ writable: true,
1772
+ configurable: true
1773
+ });
1774
+ function getMergedValue(target, source, prop, caseless) {
1775
+ if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
1776
+ return utils_default.merge.call({ caseless }, target, source);
1777
+ } else if (utils_default.isPlainObject(source)) {
1778
+ return utils_default.merge({}, source);
1779
+ } else if (utils_default.isArray(source)) {
1780
+ return source.slice();
1781
+ }
1782
+ return source;
1783
+ }
1784
+ function mergeDeepProperties(a, b, prop, caseless) {
1785
+ if (!utils_default.isUndefined(b)) {
1786
+ return getMergedValue(a, b, prop, caseless);
1787
+ } else if (!utils_default.isUndefined(a)) {
1788
+ return getMergedValue(void 0, a, prop, caseless);
1789
+ }
1790
+ }
1791
+ function valueFromConfig2(a, b) {
1792
+ if (!utils_default.isUndefined(b)) {
1793
+ return getMergedValue(void 0, b);
1794
+ }
1795
+ }
1796
+ function defaultToConfig2(a, b) {
1797
+ if (!utils_default.isUndefined(b)) {
1798
+ return getMergedValue(void 0, b);
1799
+ } else if (!utils_default.isUndefined(a)) {
1800
+ return getMergedValue(void 0, a);
1801
+ }
1802
+ }
1803
+ function getMergedTransitionalOption(prop) {
1804
+ const transitional2 = utils_default.hasOwnProp(config2, "transitional") ? config2.transitional : void 0;
1805
+ if (!utils_default.isUndefined(transitional2)) {
1806
+ if (utils_default.isPlainObject(transitional2)) {
1807
+ if (utils_default.hasOwnProp(transitional2, prop)) {
1808
+ return transitional2[prop];
1809
+ }
1810
+ } else {
1811
+ return void 0;
1812
+ }
1813
+ }
1814
+ const transitional1 = utils_default.hasOwnProp(config1, "transitional") ? config1.transitional : void 0;
1815
+ if (utils_default.isPlainObject(transitional1) && utils_default.hasOwnProp(transitional1, prop)) {
1816
+ return transitional1[prop];
1817
+ }
1818
+ return void 0;
1819
+ }
1820
+ function mergeDirectKeys(a, b, prop) {
1821
+ if (utils_default.hasOwnProp(config2, prop)) {
1822
+ return getMergedValue(a, b);
1823
+ } else if (utils_default.hasOwnProp(config1, prop)) {
1824
+ return getMergedValue(void 0, a);
1825
+ }
1826
+ }
1827
+ const mergeMap = {
1828
+ url: valueFromConfig2,
1829
+ method: valueFromConfig2,
1830
+ data: valueFromConfig2,
1831
+ baseURL: defaultToConfig2,
1832
+ transformRequest: defaultToConfig2,
1833
+ transformResponse: defaultToConfig2,
1834
+ paramsSerializer: defaultToConfig2,
1835
+ timeout: defaultToConfig2,
1836
+ timeoutMessage: defaultToConfig2,
1837
+ withCredentials: defaultToConfig2,
1838
+ withXSRFToken: defaultToConfig2,
1839
+ adapter: defaultToConfig2,
1840
+ responseType: defaultToConfig2,
1841
+ xsrfCookieName: defaultToConfig2,
1842
+ xsrfHeaderName: defaultToConfig2,
1843
+ onUploadProgress: defaultToConfig2,
1844
+ onDownloadProgress: defaultToConfig2,
1845
+ decompress: defaultToConfig2,
1846
+ maxContentLength: defaultToConfig2,
1847
+ maxBodyLength: defaultToConfig2,
1848
+ beforeRedirect: defaultToConfig2,
1849
+ transport: defaultToConfig2,
1850
+ httpAgent: defaultToConfig2,
1851
+ httpsAgent: defaultToConfig2,
1852
+ cancelToken: defaultToConfig2,
1853
+ socketPath: defaultToConfig2,
1854
+ allowedSocketPaths: defaultToConfig2,
1855
+ responseEncoding: defaultToConfig2,
1856
+ validateStatus: mergeDirectKeys,
1857
+ headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
1858
+ };
1859
+ utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
1860
+ if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
1861
+ const merge2 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
1862
+ const a = utils_default.hasOwnProp(config1, prop) ? config1[prop] : void 0;
1863
+ const b = utils_default.hasOwnProp(config2, prop) ? config2[prop] : void 0;
1864
+ const configValue = merge2(a, b, prop);
1865
+ utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
1866
+ });
1867
+ if (utils_default.hasOwnProp(config2, "validateStatus") && utils_default.isUndefined(config2.validateStatus) && getMergedTransitionalOption("validateStatusUndefinedResolves") === false) {
1868
+ if (utils_default.hasOwnProp(config1, "validateStatus")) {
1869
+ config.validateStatus = getMergedValue(void 0, config1.validateStatus);
1870
+ } else {
1871
+ delete config.validateStatus;
1872
+ }
1873
+ }
1874
+ return config;
1875
+ }
1876
+
1877
+ // node_modules/axios/lib/helpers/resolveConfig.js
1878
+ var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
1879
+ function setFormDataHeaders(headers, formHeaders, policy) {
1880
+ if (policy !== "content-only") {
1881
+ headers.set(formHeaders);
1882
+ return;
1883
+ }
1884
+ Object.entries(formHeaders).forEach(([key, val]) => {
1885
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
1886
+ headers.set(key, val);
1887
+ }
1888
+ });
1889
+ }
1890
+ var encodeUTF8 = (str) => encodeURIComponent(str).replace(
1891
+ /%([0-9A-F]{2})/gi,
1892
+ (_, hex) => String.fromCharCode(parseInt(hex, 16))
1893
+ );
1894
+ function resolveConfig(config) {
1895
+ const newConfig = mergeConfig({}, config);
1896
+ const own2 = (key) => utils_default.hasOwnProp(newConfig, key) ? newConfig[key] : void 0;
1897
+ const data = own2("data");
1898
+ let withXSRFToken = own2("withXSRFToken");
1899
+ const xsrfHeaderName = own2("xsrfHeaderName");
1900
+ const xsrfCookieName = own2("xsrfCookieName");
1901
+ let headers = own2("headers");
1902
+ const auth = own2("auth");
1903
+ const baseURL = own2("baseURL");
1904
+ const allowAbsoluteUrls = own2("allowAbsoluteUrls");
1905
+ const url = own2("url");
1906
+ newConfig.headers = headers = AxiosHeaders_default.from(headers);
1907
+ newConfig.url = buildURL(
1908
+ buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig),
1909
+ own2("params"),
1910
+ own2("paramsSerializer")
1911
+ );
1912
+ if (auth) {
1913
+ const username = utils_default.getSafeProp(auth, "username") || "";
1914
+ const password = utils_default.getSafeProp(auth, "password") || "";
1915
+ headers.set(
1916
+ "Authorization",
1917
+ "Basic " + btoa(username + ":" + (password ? encodeUTF8(password) : ""))
1918
+ );
1919
+ }
1920
+ if (utils_default.isFormData(data)) {
1921
+ if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv || utils_default.isReactNative(data)) {
1922
+ headers.setContentType(void 0);
1923
+ } else if (utils_default.isFunction(data.getHeaders)) {
1924
+ setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy"));
1925
+ }
1926
+ }
1927
+ if (platform_default.hasStandardBrowserEnv) {
1928
+ if (utils_default.isFunction(withXSRFToken)) {
1929
+ withXSRFToken = withXSRFToken(newConfig);
1930
+ }
1931
+ const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin_default(newConfig.url);
1932
+ if (shouldSendXSRF) {
1933
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
1934
+ if (xsrfValue) {
1935
+ headers.set(xsrfHeaderName, xsrfValue);
1936
+ }
1937
+ }
1938
+ }
1939
+ return newConfig;
1940
+ }
1941
+ var resolveConfig_default = resolveConfig;
1942
+
1943
+ // node_modules/axios/lib/adapters/xhr.js
1944
+ var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
1945
+ var xhr_default = isXHRAdapterSupported && function(config) {
1946
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
1947
+ const _config = resolveConfig_default(config);
1948
+ let requestData = _config.data;
1949
+ const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
1950
+ let { responseType, onUploadProgress, onDownloadProgress } = _config;
1951
+ let onCanceled;
1952
+ let uploadThrottled, downloadThrottled;
1953
+ let flushUpload, flushDownload;
1954
+ function done() {
1955
+ flushUpload && flushUpload();
1956
+ flushDownload && flushDownload();
1957
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
1958
+ _config.signal && _config.signal.removeEventListener("abort", onCanceled);
1959
+ }
1960
+ let request = new XMLHttpRequest();
1961
+ request.open(_config.method.toUpperCase(), _config.url, true);
1962
+ request.timeout = _config.timeout;
1963
+ function onloadend() {
1964
+ if (!request) {
1965
+ return;
1966
+ }
1967
+ const responseHeaders = AxiosHeaders_default.from(
1968
+ "getAllResponseHeaders" in request && request.getAllResponseHeaders()
1969
+ );
1970
+ const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
1971
+ const response = {
1972
+ data: responseData,
1973
+ status: request.status,
1974
+ statusText: request.statusText,
1975
+ headers: responseHeaders,
1976
+ config,
1977
+ request
1978
+ };
1979
+ settle(
1980
+ function _resolve(value) {
1981
+ resolve(value);
1982
+ done();
1983
+ },
1984
+ function _reject(err) {
1985
+ reject(err);
1986
+ done();
1987
+ },
1988
+ response
1989
+ );
1990
+ request = null;
1991
+ }
1992
+ if ("onloadend" in request) {
1993
+ request.onloadend = onloadend;
1994
+ } else {
1995
+ request.onreadystatechange = function handleLoad() {
1996
+ if (!request || request.readyState !== 4) {
1997
+ return;
1998
+ }
1999
+ if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith("file:"))) {
2000
+ return;
2001
+ }
2002
+ setTimeout(onloadend);
2003
+ };
2004
+ }
2005
+ request.onabort = function handleAbort() {
2006
+ if (!request) {
2007
+ return;
2008
+ }
2009
+ reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
2010
+ done();
2011
+ request = null;
2012
+ };
2013
+ request.onerror = function handleError(event) {
2014
+ const msg = event && event.message ? event.message : "Network Error";
2015
+ const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request);
2016
+ err.event = event || null;
2017
+ reject(err);
2018
+ done();
2019
+ request = null;
2020
+ };
2021
+ request.ontimeout = function handleTimeout() {
2022
+ let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
2023
+ const transitional2 = _config.transitional || transitional_default;
2024
+ if (_config.timeoutErrorMessage) {
2025
+ timeoutErrorMessage = _config.timeoutErrorMessage;
2026
+ }
2027
+ reject(
2028
+ new AxiosError_default(
2029
+ timeoutErrorMessage,
2030
+ transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
2031
+ config,
2032
+ request
2033
+ )
2034
+ );
2035
+ done();
2036
+ request = null;
2037
+ };
2038
+ requestData === void 0 && requestHeaders.setContentType(null);
2039
+ if ("setRequestHeader" in request) {
2040
+ utils_default.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
2041
+ request.setRequestHeader(key, val);
2042
+ });
2043
+ }
2044
+ if (!utils_default.isUndefined(_config.withCredentials)) {
2045
+ request.withCredentials = !!_config.withCredentials;
2046
+ }
2047
+ if (responseType && responseType !== "json") {
2048
+ request.responseType = _config.responseType;
2049
+ }
2050
+ if (onDownloadProgress) {
2051
+ [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
2052
+ request.addEventListener("progress", downloadThrottled);
2053
+ }
2054
+ if (onUploadProgress && request.upload) {
2055
+ [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
2056
+ request.upload.addEventListener("progress", uploadThrottled);
2057
+ request.upload.addEventListener("loadend", flushUpload);
2058
+ }
2059
+ if (_config.cancelToken || _config.signal) {
2060
+ onCanceled = (cancel) => {
2061
+ if (!request) {
2062
+ return;
2063
+ }
2064
+ reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
2065
+ request.abort();
2066
+ done();
2067
+ request = null;
2068
+ };
2069
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
2070
+ if (_config.signal) {
2071
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
2072
+ }
2073
+ }
2074
+ const protocol = parseProtocol(_config.url);
2075
+ if (protocol && !platform_default.protocols.includes(protocol)) {
2076
+ reject(
2077
+ new AxiosError_default(
2078
+ "Unsupported protocol " + protocol + ":",
2079
+ AxiosError_default.ERR_BAD_REQUEST,
2080
+ config
2081
+ )
2082
+ );
2083
+ return;
2084
+ }
2085
+ request.send(requestData || null);
2086
+ });
2087
+ };
2088
+
2089
+ // node_modules/axios/lib/helpers/composeSignals.js
2090
+ var composeSignals = (signals, timeout) => {
2091
+ signals = signals ? signals.filter(Boolean) : [];
2092
+ if (!timeout && !signals.length) {
2093
+ return;
2094
+ }
2095
+ const controller = new AbortController();
2096
+ let aborted = false;
2097
+ const onabort = function(reason) {
2098
+ if (!aborted) {
2099
+ aborted = true;
2100
+ unsubscribe();
2101
+ const err = reason instanceof Error ? reason : this.reason;
2102
+ controller.abort(
2103
+ err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err)
2104
+ );
2105
+ }
2106
+ };
2107
+ let timer = timeout && setTimeout(() => {
2108
+ timer = null;
2109
+ onabort(new AxiosError_default(`timeout of ${timeout}ms exceeded`, AxiosError_default.ETIMEDOUT));
2110
+ }, timeout);
2111
+ const unsubscribe = () => {
2112
+ if (!signals) {
2113
+ return;
2114
+ }
2115
+ timer && clearTimeout(timer);
2116
+ timer = null;
2117
+ signals.forEach((signal2) => {
2118
+ signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
2119
+ });
2120
+ signals = null;
2121
+ };
2122
+ signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
2123
+ const { signal } = controller;
2124
+ signal.unsubscribe = () => utils_default.asap(unsubscribe);
2125
+ return signal;
2126
+ };
2127
+ var composeSignals_default = composeSignals;
2128
+
2129
+ // node_modules/axios/lib/helpers/trackStream.js
2130
+ var streamChunk = function* (chunk, chunkSize) {
2131
+ let len = chunk.byteLength;
2132
+ if (!chunkSize || len < chunkSize) {
2133
+ yield chunk;
2134
+ return;
2135
+ }
2136
+ let pos = 0;
2137
+ let end;
2138
+ while (pos < len) {
2139
+ end = pos + chunkSize;
2140
+ yield chunk.slice(pos, end);
2141
+ pos = end;
2142
+ }
2143
+ };
2144
+ var readBytes = async function* (iterable, chunkSize) {
2145
+ for await (const chunk of readStream(iterable)) {
2146
+ yield* streamChunk(chunk, chunkSize);
2147
+ }
2148
+ };
2149
+ var readStream = async function* (stream) {
2150
+ if (stream[Symbol.asyncIterator]) {
2151
+ yield* stream;
2152
+ return;
2153
+ }
2154
+ const reader = stream.getReader();
2155
+ try {
2156
+ for (; ; ) {
2157
+ const { done, value } = await reader.read();
2158
+ if (done) {
2159
+ break;
2160
+ }
2161
+ yield value;
2162
+ }
2163
+ } finally {
2164
+ await reader.cancel();
2165
+ }
2166
+ };
2167
+ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
2168
+ const iterator2 = readBytes(stream, chunkSize);
2169
+ let bytes = 0;
2170
+ let done;
2171
+ let _onFinish = (e) => {
2172
+ if (!done) {
2173
+ done = true;
2174
+ onFinish && onFinish(e);
2175
+ }
2176
+ };
2177
+ return new ReadableStream(
2178
+ {
2179
+ async pull(controller) {
2180
+ try {
2181
+ const { done: done2, value } = await iterator2.next();
2182
+ if (done2) {
2183
+ _onFinish();
2184
+ controller.close();
2185
+ return;
2186
+ }
2187
+ let len = value.byteLength;
2188
+ if (onProgress) {
2189
+ let loadedBytes = bytes += len;
2190
+ onProgress(loadedBytes);
2191
+ }
2192
+ controller.enqueue(new Uint8Array(value));
2193
+ } catch (err) {
2194
+ _onFinish(err);
2195
+ throw err;
2196
+ }
2197
+ },
2198
+ cancel(reason) {
2199
+ _onFinish(reason);
2200
+ return iterator2.return();
2201
+ }
2202
+ },
2203
+ {
2204
+ highWaterMark: 2
2205
+ }
2206
+ );
2207
+ };
2208
+
2209
+ // node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
2210
+ var isHexDigit = (charCode) => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
2211
+ var isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
2212
+ function estimateDataURLDecodedBytes(url) {
2213
+ if (!url || typeof url !== "string") return 0;
2214
+ if (!url.startsWith("data:")) return 0;
2215
+ const comma = url.indexOf(",");
2216
+ if (comma < 0) return 0;
2217
+ const meta = url.slice(5, comma);
2218
+ const body = url.slice(comma + 1);
2219
+ const isBase64 = /;base64/i.test(meta);
2220
+ if (isBase64) {
2221
+ let effectiveLen = body.length;
2222
+ const len = body.length;
2223
+ for (let i = 0; i < len; i++) {
2224
+ if (body.charCodeAt(i) === 37 && i + 2 < len) {
2225
+ const a = body.charCodeAt(i + 1);
2226
+ const b = body.charCodeAt(i + 2);
2227
+ const isHex = isHexDigit(a) && isHexDigit(b);
2228
+ if (isHex) {
2229
+ effectiveLen -= 2;
2230
+ i += 2;
2231
+ }
2232
+ }
2233
+ }
2234
+ let pad = 0;
2235
+ let idx = len - 1;
2236
+ const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
2237
+ body.charCodeAt(j - 1) === 51 && // '3'
2238
+ (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
2239
+ if (idx >= 0) {
2240
+ if (body.charCodeAt(idx) === 61) {
2241
+ pad++;
2242
+ idx--;
2243
+ } else if (tailIsPct3D(idx)) {
2244
+ pad++;
2245
+ idx -= 3;
2246
+ }
2247
+ }
2248
+ if (pad === 1 && idx >= 0) {
2249
+ if (body.charCodeAt(idx) === 61) {
2250
+ pad++;
2251
+ } else if (tailIsPct3D(idx)) {
2252
+ pad++;
2253
+ }
2254
+ }
2255
+ const groups = Math.floor(effectiveLen / 4);
2256
+ const bytes2 = groups * 3 - (pad || 0);
2257
+ return bytes2 > 0 ? bytes2 : 0;
2258
+ }
2259
+ let bytes = 0;
2260
+ for (let i = 0, len = body.length; i < len; i++) {
2261
+ const c = body.charCodeAt(i);
2262
+ if (c === 37 && isPercentEncodedByte(body, i, len)) {
2263
+ bytes += 1;
2264
+ i += 2;
2265
+ } else if (c < 128) {
2266
+ bytes += 1;
2267
+ } else if (c < 2048) {
2268
+ bytes += 2;
2269
+ } else if (c >= 55296 && c <= 56319 && i + 1 < len) {
2270
+ const next = body.charCodeAt(i + 1);
2271
+ if (next >= 56320 && next <= 57343) {
2272
+ bytes += 4;
2273
+ i++;
2274
+ } else {
2275
+ bytes += 3;
2276
+ }
2277
+ } else {
2278
+ bytes += 3;
2279
+ }
2280
+ }
2281
+ return bytes;
2282
+ }
2283
+
2284
+ // node_modules/axios/lib/env/data.js
2285
+ var VERSION = "1.18.0";
2286
+
2287
+ // node_modules/axios/lib/adapters/fetch.js
2288
+ var DEFAULT_CHUNK_SIZE = 64 * 1024;
2289
+ var { isFunction: isFunction2 } = utils_default;
2290
+ var encodeUTF82 = (str) => encodeURIComponent(str).replace(
2291
+ /%([0-9A-F]{2})/gi,
2292
+ (_, hex) => String.fromCharCode(parseInt(hex, 16))
2293
+ );
2294
+ var decodeURIComponentSafe = (value) => {
2295
+ if (!utils_default.isString(value)) {
2296
+ return value;
2297
+ }
2298
+ try {
2299
+ return decodeURIComponent(value);
2300
+ } catch (error) {
2301
+ return value;
2302
+ }
2303
+ };
2304
+ var test = (fn, ...args) => {
2305
+ try {
2306
+ return !!fn(...args);
2307
+ } catch (e) {
2308
+ return false;
2309
+ }
2310
+ };
2311
+ var maybeWithAuthCredentials = (url) => {
2312
+ const protocolIndex = url.indexOf("://");
2313
+ let urlToCheck = url;
2314
+ if (protocolIndex !== -1) {
2315
+ urlToCheck = urlToCheck.slice(protocolIndex + 3);
2316
+ }
2317
+ return urlToCheck.includes("@") || urlToCheck.includes(":");
2318
+ };
2319
+ var factory = (env) => {
2320
+ const globalObject = utils_default.global !== void 0 && utils_default.global !== null ? utils_default.global : globalThis;
2321
+ const { ReadableStream: ReadableStream2, TextEncoder } = globalObject;
2322
+ env = utils_default.merge.call(
2323
+ {
2324
+ skipUndefined: true
2325
+ },
2326
+ {
2327
+ Request: globalObject.Request,
2328
+ Response: globalObject.Response
2329
+ },
2330
+ env
2331
+ );
2332
+ const { fetch: envFetch, Request, Response } = env;
2333
+ const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
2334
+ const isRequestSupported = isFunction2(Request);
2335
+ const isResponseSupported = isFunction2(Response);
2336
+ if (!isFetchSupported) {
2337
+ return false;
2338
+ }
2339
+ const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
2340
+ const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
2341
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
2342
+ let duplexAccessed = false;
2343
+ const request = new Request(platform_default.origin, {
2344
+ body: new ReadableStream2(),
2345
+ method: "POST",
2346
+ get duplex() {
2347
+ duplexAccessed = true;
2348
+ return "half";
2349
+ }
2350
+ });
2351
+ const hasContentType = request.headers.has("Content-Type");
2352
+ if (request.body != null) {
2353
+ request.body.cancel();
2354
+ }
2355
+ return duplexAccessed && !hasContentType;
2356
+ });
2357
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
2358
+ const resolvers = {
2359
+ stream: supportsResponseStream && ((res) => res.body)
2360
+ };
2361
+ isFetchSupported && (() => {
2362
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
2363
+ !resolvers[type] && (resolvers[type] = (res, config) => {
2364
+ let method = res && res[type];
2365
+ if (method) {
2366
+ return method.call(res);
2367
+ }
2368
+ throw new AxiosError_default(
2369
+ `Response type '${type}' is not supported`,
2370
+ AxiosError_default.ERR_NOT_SUPPORT,
2371
+ config
2372
+ );
2373
+ });
2374
+ });
2375
+ })();
2376
+ const getBodyLength = async (body) => {
2377
+ if (body == null) {
2378
+ return 0;
2379
+ }
2380
+ if (utils_default.isBlob(body)) {
2381
+ return body.size;
2382
+ }
2383
+ if (utils_default.isSpecCompliantForm(body)) {
2384
+ const _request = new Request(platform_default.origin, {
2385
+ method: "POST",
2386
+ body
2387
+ });
2388
+ return (await _request.arrayBuffer()).byteLength;
2389
+ }
2390
+ if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
2391
+ return body.byteLength;
2392
+ }
2393
+ if (utils_default.isURLSearchParams(body)) {
2394
+ body = body + "";
2395
+ }
2396
+ if (utils_default.isString(body)) {
2397
+ return (await encodeText(body)).byteLength;
2398
+ }
2399
+ };
2400
+ const resolveBodyLength = async (headers, body) => {
2401
+ const length = utils_default.toFiniteNumber(headers.getContentLength());
2402
+ return length == null ? getBodyLength(body) : length;
2403
+ };
2404
+ return async (config) => {
2405
+ let {
2406
+ url,
2407
+ method,
2408
+ data,
2409
+ signal,
2410
+ cancelToken,
2411
+ timeout,
2412
+ onDownloadProgress,
2413
+ onUploadProgress,
2414
+ responseType,
2415
+ headers,
2416
+ withCredentials = "same-origin",
2417
+ fetchOptions,
2418
+ maxContentLength,
2419
+ maxBodyLength
2420
+ } = resolveConfig_default(config);
2421
+ const hasMaxContentLength = utils_default.isNumber(maxContentLength) && maxContentLength > -1;
2422
+ const hasMaxBodyLength = utils_default.isNumber(maxBodyLength) && maxBodyLength > -1;
2423
+ const own2 = (key) => utils_default.hasOwnProp(config, key) ? config[key] : void 0;
2424
+ let _fetch = envFetch || fetch;
2425
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
2426
+ let composedSignal = composeSignals_default(
2427
+ [signal, cancelToken && cancelToken.toAbortSignal()],
2428
+ timeout
2429
+ );
2430
+ let request = null;
2431
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
2432
+ composedSignal.unsubscribe();
2433
+ });
2434
+ let requestContentLength;
2435
+ let pendingBodyError = null;
2436
+ const maxBodyLengthError = () => new AxiosError_default(
2437
+ "Request body larger than maxBodyLength limit",
2438
+ AxiosError_default.ERR_BAD_REQUEST,
2439
+ config,
2440
+ request
2441
+ );
2442
+ try {
2443
+ let auth = void 0;
2444
+ const configAuth = own2("auth");
2445
+ if (configAuth) {
2446
+ const username = utils_default.getSafeProp(configAuth, "username") || "";
2447
+ const password = utils_default.getSafeProp(configAuth, "password") || "";
2448
+ auth = {
2449
+ username,
2450
+ password
2451
+ };
2452
+ }
2453
+ if (maybeWithAuthCredentials(url)) {
2454
+ const parsedURL = new URL(url, platform_default.origin);
2455
+ if (!auth && (parsedURL.username || parsedURL.password)) {
2456
+ const urlUsername = decodeURIComponentSafe(parsedURL.username);
2457
+ const urlPassword = decodeURIComponentSafe(parsedURL.password);
2458
+ auth = {
2459
+ username: urlUsername,
2460
+ password: urlPassword
2461
+ };
2462
+ }
2463
+ if (parsedURL.username || parsedURL.password) {
2464
+ parsedURL.username = "";
2465
+ parsedURL.password = "";
2466
+ url = parsedURL.href;
2467
+ }
2468
+ }
2469
+ if (auth) {
2470
+ headers.delete("authorization");
2471
+ headers.set(
2472
+ "Authorization",
2473
+ "Basic " + btoa(encodeUTF82((auth.username || "") + ":" + (auth.password || "")))
2474
+ );
2475
+ }
2476
+ if (hasMaxContentLength && typeof url === "string" && url.startsWith("data:")) {
2477
+ const estimated = estimateDataURLDecodedBytes(url);
2478
+ if (estimated > maxContentLength) {
2479
+ throw new AxiosError_default(
2480
+ "maxContentLength size of " + maxContentLength + " exceeded",
2481
+ AxiosError_default.ERR_BAD_RESPONSE,
2482
+ config,
2483
+ request
2484
+ );
2485
+ }
2486
+ }
2487
+ if (hasMaxBodyLength && method !== "get" && method !== "head") {
2488
+ const outboundLength = await getBodyLength(data);
2489
+ if (typeof outboundLength === "number" && isFinite(outboundLength)) {
2490
+ requestContentLength = outboundLength;
2491
+ if (outboundLength > maxBodyLength) {
2492
+ throw maxBodyLengthError();
2493
+ }
2494
+ }
2495
+ }
2496
+ const mustEnforceStreamBody = hasMaxBodyLength && (utils_default.isReadableStream(data) || utils_default.isStream(data));
2497
+ const trackRequestStream = (stream, onProgress, flush) => trackStream(
2498
+ stream,
2499
+ DEFAULT_CHUNK_SIZE,
2500
+ (loadedBytes) => {
2501
+ if (hasMaxBodyLength && loadedBytes > maxBodyLength) {
2502
+ throw pendingBodyError = maxBodyLengthError();
2503
+ }
2504
+ onProgress && onProgress(loadedBytes);
2505
+ },
2506
+ flush
2507
+ );
2508
+ if (supportsRequestStream && method !== "get" && method !== "head" && (onUploadProgress || mustEnforceStreamBody)) {
2509
+ requestContentLength = requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;
2510
+ if (requestContentLength !== 0 || mustEnforceStreamBody) {
2511
+ let _request = new Request(url, {
2512
+ method: "POST",
2513
+ body: data,
2514
+ duplex: "half"
2515
+ });
2516
+ let contentTypeHeader;
2517
+ if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
2518
+ headers.setContentType(contentTypeHeader);
2519
+ }
2520
+ if (_request.body) {
2521
+ const [onProgress, flush] = onUploadProgress && progressEventDecorator(
2522
+ requestContentLength,
2523
+ progressEventReducer(asyncDecorator(onUploadProgress))
2524
+ ) || [];
2525
+ data = trackRequestStream(_request.body, onProgress, flush);
2526
+ }
2527
+ }
2528
+ } else if (mustEnforceStreamBody && !isRequestSupported && isReadableStreamSupported && method !== "get" && method !== "head") {
2529
+ data = trackRequestStream(data);
2530
+ } else if (mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== "get" && method !== "head") {
2531
+ throw new AxiosError_default(
2532
+ "Stream request bodies are not supported by the current fetch implementation",
2533
+ AxiosError_default.ERR_NOT_SUPPORT,
2534
+ config,
2535
+ request
2536
+ );
2537
+ }
2538
+ if (!utils_default.isString(withCredentials)) {
2539
+ withCredentials = withCredentials ? "include" : "omit";
2540
+ }
2541
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
2542
+ if (utils_default.isFormData(data)) {
2543
+ const contentType = headers.getContentType();
2544
+ if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) {
2545
+ headers.delete("content-type");
2546
+ }
2547
+ }
2548
+ headers.set("User-Agent", "axios/" + VERSION, false);
2549
+ const resolvedOptions = {
2550
+ ...fetchOptions,
2551
+ signal: composedSignal,
2552
+ method: method.toUpperCase(),
2553
+ headers: toByteStringHeaderObject(headers.normalize()),
2554
+ body: data,
2555
+ duplex: "half",
2556
+ credentials: isCredentialsSupported ? withCredentials : void 0
2557
+ };
2558
+ request = isRequestSupported && new Request(url, resolvedOptions);
2559
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
2560
+ const responseHeaders = AxiosHeaders_default.from(response.headers);
2561
+ if (hasMaxContentLength) {
2562
+ const declaredLength = utils_default.toFiniteNumber(responseHeaders.getContentLength());
2563
+ if (declaredLength != null && declaredLength > maxContentLength) {
2564
+ throw new AxiosError_default(
2565
+ "maxContentLength size of " + maxContentLength + " exceeded",
2566
+ AxiosError_default.ERR_BAD_RESPONSE,
2567
+ config,
2568
+ request
2569
+ );
2570
+ }
2571
+ }
2572
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
2573
+ if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) {
2574
+ const options = {};
2575
+ ["status", "statusText", "headers"].forEach((prop) => {
2576
+ options[prop] = response[prop];
2577
+ });
2578
+ const responseContentLength = utils_default.toFiniteNumber(responseHeaders.getContentLength());
2579
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
2580
+ responseContentLength,
2581
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
2582
+ ) || [];
2583
+ let bytesRead = 0;
2584
+ const onChunkProgress = (loadedBytes) => {
2585
+ if (hasMaxContentLength) {
2586
+ bytesRead = loadedBytes;
2587
+ if (bytesRead > maxContentLength) {
2588
+ throw new AxiosError_default(
2589
+ "maxContentLength size of " + maxContentLength + " exceeded",
2590
+ AxiosError_default.ERR_BAD_RESPONSE,
2591
+ config,
2592
+ request
2593
+ );
2594
+ }
2595
+ }
2596
+ onProgress && onProgress(loadedBytes);
2597
+ };
2598
+ response = new Response(
2599
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
2600
+ flush && flush();
2601
+ unsubscribe && unsubscribe();
2602
+ }),
2603
+ options
2604
+ );
2605
+ }
2606
+ responseType = responseType || "text";
2607
+ let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](
2608
+ response,
2609
+ config
2610
+ );
2611
+ if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
2612
+ let materializedSize;
2613
+ if (responseData != null) {
2614
+ if (typeof responseData.byteLength === "number") {
2615
+ materializedSize = responseData.byteLength;
2616
+ } else if (typeof responseData.size === "number") {
2617
+ materializedSize = responseData.size;
2618
+ } else if (typeof responseData === "string") {
2619
+ materializedSize = typeof TextEncoder === "function" ? new TextEncoder().encode(responseData).byteLength : responseData.length;
2620
+ }
2621
+ }
2622
+ if (typeof materializedSize === "number" && materializedSize > maxContentLength) {
2623
+ throw new AxiosError_default(
2624
+ "maxContentLength size of " + maxContentLength + " exceeded",
2625
+ AxiosError_default.ERR_BAD_RESPONSE,
2626
+ config,
2627
+ request
2628
+ );
2629
+ }
2630
+ }
2631
+ !isStreamResponse && unsubscribe && unsubscribe();
2632
+ return await new Promise((resolve, reject) => {
2633
+ settle(resolve, reject, {
2634
+ data: responseData,
2635
+ headers: AxiosHeaders_default.from(response.headers),
2636
+ status: response.status,
2637
+ statusText: response.statusText,
2638
+ config,
2639
+ request
2640
+ });
2641
+ });
2642
+ } catch (err) {
2643
+ unsubscribe && unsubscribe();
2644
+ if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError_default) {
2645
+ const canceledError = composedSignal.reason;
2646
+ canceledError.config = config;
2647
+ request && (canceledError.request = request);
2648
+ err !== canceledError && (canceledError.cause = err);
2649
+ throw canceledError;
2650
+ }
2651
+ if (pendingBodyError) {
2652
+ request && !pendingBodyError.request && (pendingBodyError.request = request);
2653
+ throw pendingBodyError;
2654
+ }
2655
+ if (err instanceof AxiosError_default) {
2656
+ request && !err.request && (err.request = request);
2657
+ throw err;
2658
+ }
2659
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
2660
+ throw Object.assign(
2661
+ new AxiosError_default(
2662
+ "Network Error",
2663
+ AxiosError_default.ERR_NETWORK,
2664
+ config,
2665
+ request,
2666
+ err && err.response
2667
+ ),
2668
+ {
2669
+ cause: err.cause || err
2670
+ }
2671
+ );
2672
+ }
2673
+ throw AxiosError_default.from(err, err && err.code, config, request, err && err.response);
2674
+ }
2675
+ };
2676
+ };
2677
+ var seedCache = /* @__PURE__ */ new Map();
2678
+ var getFetch = (config) => {
2679
+ let env = config && config.env || {};
2680
+ const { fetch: fetch2, Request, Response } = env;
2681
+ const seeds = [Request, Response, fetch2];
2682
+ let len = seeds.length, i = len, seed, target, map = seedCache;
2683
+ while (i--) {
2684
+ seed = seeds[i];
2685
+ target = map.get(seed);
2686
+ target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
2687
+ map = target;
2688
+ }
2689
+ return target;
2690
+ };
2691
+ var adapter = getFetch();
2692
+
2693
+ // node_modules/axios/lib/adapters/adapters.js
2694
+ var knownAdapters = {
2695
+ http: null_default,
2696
+ xhr: xhr_default,
2697
+ fetch: {
2698
+ get: getFetch
2699
+ }
2700
+ };
2701
+ utils_default.forEach(knownAdapters, (fn, value) => {
2702
+ if (fn) {
2703
+ try {
2704
+ Object.defineProperty(fn, "name", { __proto__: null, value });
2705
+ } catch (e) {
2706
+ }
2707
+ Object.defineProperty(fn, "adapterName", { __proto__: null, value });
2708
+ }
2709
+ });
2710
+ var renderReason = (reason) => `- ${reason}`;
2711
+ var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
2712
+ function getAdapter(adapters, config) {
2713
+ adapters = utils_default.isArray(adapters) ? adapters : [adapters];
2714
+ const { length } = adapters;
2715
+ let nameOrAdapter;
2716
+ let adapter2;
2717
+ const rejectedReasons = {};
2718
+ for (let i = 0; i < length; i++) {
2719
+ nameOrAdapter = adapters[i];
2720
+ let id;
2721
+ adapter2 = nameOrAdapter;
2722
+ if (!isResolvedHandle(nameOrAdapter)) {
2723
+ adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
2724
+ if (adapter2 === void 0) {
2725
+ throw new AxiosError_default(`Unknown adapter '${id}'`);
2726
+ }
2727
+ }
2728
+ if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
2729
+ break;
2730
+ }
2731
+ rejectedReasons[id || "#" + i] = adapter2;
2732
+ }
2733
+ if (!adapter2) {
2734
+ const reasons = Object.entries(rejectedReasons).map(
2735
+ ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
2736
+ );
2737
+ let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
2738
+ throw new AxiosError_default(
2739
+ `There is no suitable adapter to dispatch the request ` + s,
2740
+ "ERR_NOT_SUPPORT"
2741
+ );
2742
+ }
2743
+ return adapter2;
2744
+ }
2745
+ var adapters_default = {
2746
+ /**
2747
+ * Resolve an adapter from a list of adapter names or functions.
2748
+ * @type {Function}
2749
+ */
2750
+ getAdapter,
2751
+ /**
2752
+ * Exposes all known adapters
2753
+ * @type {Object<string, Function|Object>}
2754
+ */
2755
+ adapters: knownAdapters
2756
+ };
2757
+
2758
+ // node_modules/axios/lib/core/dispatchRequest.js
2759
+ function throwIfCancellationRequested(config) {
2760
+ if (config.cancelToken) {
2761
+ config.cancelToken.throwIfRequested();
2762
+ }
2763
+ if (config.signal && config.signal.aborted) {
2764
+ throw new CanceledError_default(null, config);
2765
+ }
2766
+ }
2767
+ function dispatchRequest(config) {
2768
+ throwIfCancellationRequested(config);
2769
+ config.headers = AxiosHeaders_default.from(config.headers);
2770
+ config.data = transformData.call(config, config.transformRequest);
2771
+ if (["post", "put", "patch"].indexOf(config.method) !== -1) {
2772
+ config.headers.setContentType("application/x-www-form-urlencoded", false);
2773
+ }
2774
+ const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
2775
+ return adapter2(config).then(
2776
+ function onAdapterResolution(response) {
2777
+ throwIfCancellationRequested(config);
2778
+ config.response = response;
2779
+ try {
2780
+ response.data = transformData.call(config, config.transformResponse, response);
2781
+ } finally {
2782
+ delete config.response;
2783
+ }
2784
+ response.headers = AxiosHeaders_default.from(response.headers);
2785
+ return response;
2786
+ },
2787
+ function onAdapterRejection(reason) {
2788
+ if (!isCancel(reason)) {
2789
+ throwIfCancellationRequested(config);
2790
+ if (reason && reason.response) {
2791
+ config.response = reason.response;
2792
+ try {
2793
+ reason.response.data = transformData.call(
2794
+ config,
2795
+ config.transformResponse,
2796
+ reason.response
2797
+ );
2798
+ } finally {
2799
+ delete config.response;
2800
+ }
2801
+ reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
2802
+ }
2803
+ }
2804
+ return Promise.reject(reason);
2805
+ }
2806
+ );
2807
+ }
2808
+
2809
+ // node_modules/axios/lib/helpers/validator.js
2810
+ var validators = {};
2811
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
2812
+ validators[type] = function validator(thing) {
2813
+ return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
2814
+ };
2815
+ });
2816
+ var deprecatedWarnings = {};
2817
+ validators.transitional = function transitional(validator, version, message) {
2818
+ function formatMessage(opt, desc) {
2819
+ return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
2820
+ }
2821
+ return (value, opt, opts) => {
2822
+ if (validator === false) {
2823
+ throw new AxiosError_default(
2824
+ formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
2825
+ AxiosError_default.ERR_DEPRECATED
2826
+ );
2827
+ }
2828
+ if (version && !deprecatedWarnings[opt]) {
2829
+ deprecatedWarnings[opt] = true;
2830
+ console.warn(
2831
+ formatMessage(
2832
+ opt,
2833
+ " has been deprecated since v" + version + " and will be removed in the near future"
2834
+ )
2835
+ );
2836
+ }
2837
+ return validator ? validator(value, opt, opts) : true;
2838
+ };
2839
+ };
2840
+ validators.spelling = function spelling(correctSpelling) {
2841
+ return (value, opt) => {
2842
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
2843
+ return true;
2844
+ };
2845
+ };
2846
+ function assertOptions(options, schema, allowUnknown) {
2847
+ if (typeof options !== "object") {
2848
+ throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
2849
+ }
2850
+ const keys = Object.keys(options);
2851
+ let i = keys.length;
2852
+ while (i-- > 0) {
2853
+ const opt = keys[i];
2854
+ const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : void 0;
2855
+ if (validator) {
2856
+ const value = options[opt];
2857
+ const result = value === void 0 || validator(value, opt, options);
2858
+ if (result !== true) {
2859
+ throw new AxiosError_default(
2860
+ "option " + opt + " must be " + result,
2861
+ AxiosError_default.ERR_BAD_OPTION_VALUE
2862
+ );
2863
+ }
2864
+ continue;
2865
+ }
2866
+ if (allowUnknown !== true) {
2867
+ throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION);
2868
+ }
2869
+ }
2870
+ }
2871
+ var validator_default = {
2872
+ assertOptions,
2873
+ validators
2874
+ };
2875
+
2876
+ // node_modules/axios/lib/core/Axios.js
2877
+ var validators2 = validator_default.validators;
2878
+ var Axios = class {
2879
+ constructor(instanceConfig) {
2880
+ this.defaults = instanceConfig || {};
2881
+ this.interceptors = {
2882
+ request: new InterceptorManager_default(),
2883
+ response: new InterceptorManager_default()
2884
+ };
2885
+ }
2886
+ /**
2887
+ * Dispatch a request
2888
+ *
2889
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2890
+ * @param {?Object} config
2891
+ *
2892
+ * @returns {Promise} The Promise to be fulfilled
2893
+ */
2894
+ async request(configOrUrl, config) {
2895
+ try {
2896
+ return await this._request(configOrUrl, config);
2897
+ } catch (err) {
2898
+ if (err instanceof Error) {
2899
+ let dummy = {};
2900
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
2901
+ const stack = (() => {
2902
+ if (!dummy.stack) {
2903
+ return "";
2904
+ }
2905
+ const firstNewlineIndex = dummy.stack.indexOf("\n");
2906
+ return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1);
2907
+ })();
2908
+ try {
2909
+ if (!err.stack) {
2910
+ err.stack = stack;
2911
+ } else if (stack) {
2912
+ const firstNewlineIndex = stack.indexOf("\n");
2913
+ const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf("\n", firstNewlineIndex + 1);
2914
+ const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1);
2915
+ if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
2916
+ err.stack += "\n" + stack;
2917
+ }
2918
+ }
2919
+ } catch (e) {
2920
+ }
2921
+ }
2922
+ throw err;
2923
+ }
2924
+ }
2925
+ _request(configOrUrl, config) {
2926
+ if (typeof configOrUrl === "string") {
2927
+ config = config || {};
2928
+ config.url = configOrUrl;
2929
+ } else {
2930
+ config = configOrUrl || {};
2931
+ }
2932
+ config = mergeConfig(this.defaults, config);
2933
+ const { transitional: transitional2, paramsSerializer, headers } = config;
2934
+ if (transitional2 !== void 0) {
2935
+ validator_default.assertOptions(
2936
+ transitional2,
2937
+ {
2938
+ silentJSONParsing: validators2.transitional(validators2.boolean),
2939
+ forcedJSONParsing: validators2.transitional(validators2.boolean),
2940
+ clarifyTimeoutError: validators2.transitional(validators2.boolean),
2941
+ legacyInterceptorReqResOrdering: validators2.transitional(validators2.boolean),
2942
+ advertiseZstdAcceptEncoding: validators2.transitional(validators2.boolean),
2943
+ validateStatusUndefinedResolves: validators2.transitional(validators2.boolean)
2944
+ },
2945
+ false
2946
+ );
2947
+ }
2948
+ if (paramsSerializer != null) {
2949
+ if (utils_default.isFunction(paramsSerializer)) {
2950
+ config.paramsSerializer = {
2951
+ serialize: paramsSerializer
2952
+ };
2953
+ } else {
2954
+ validator_default.assertOptions(
2955
+ paramsSerializer,
2956
+ {
2957
+ encode: validators2.function,
2958
+ serialize: validators2.function
2959
+ },
2960
+ true
2961
+ );
2962
+ }
2963
+ }
2964
+ if (config.allowAbsoluteUrls !== void 0) {
2965
+ } else if (this.defaults.allowAbsoluteUrls !== void 0) {
2966
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
2967
+ } else {
2968
+ config.allowAbsoluteUrls = true;
2969
+ }
2970
+ validator_default.assertOptions(
2971
+ config,
2972
+ {
2973
+ baseUrl: validators2.spelling("baseURL"),
2974
+ withXsrfToken: validators2.spelling("withXSRFToken")
2975
+ },
2976
+ true
2977
+ );
2978
+ config.method = (config.method || this.defaults.method || "get").toLowerCase();
2979
+ let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]);
2980
+ headers && utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (method) => {
2981
+ delete headers[method];
2982
+ });
2983
+ config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
2984
+ const requestInterceptorChain = [];
2985
+ let synchronousRequestInterceptors = true;
2986
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
2987
+ if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
2988
+ return;
2989
+ }
2990
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
2991
+ const transitional3 = config.transitional || transitional_default;
2992
+ const legacyInterceptorReqResOrdering = transitional3 && transitional3.legacyInterceptorReqResOrdering;
2993
+ if (legacyInterceptorReqResOrdering) {
2994
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
2995
+ } else {
2996
+ requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
2997
+ }
2998
+ });
2999
+ const responseInterceptorChain = [];
3000
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
3001
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
3002
+ });
3003
+ let promise;
3004
+ let i = 0;
3005
+ let len;
3006
+ if (!synchronousRequestInterceptors) {
3007
+ const chain = [dispatchRequest.bind(this), void 0];
3008
+ chain.unshift(...requestInterceptorChain);
3009
+ chain.push(...responseInterceptorChain);
3010
+ len = chain.length;
3011
+ promise = Promise.resolve(config);
3012
+ while (i < len) {
3013
+ promise = promise.then(chain[i++], chain[i++]);
3014
+ }
3015
+ return promise;
3016
+ }
3017
+ len = requestInterceptorChain.length;
3018
+ let newConfig = config;
3019
+ while (i < len) {
3020
+ const onFulfilled = requestInterceptorChain[i++];
3021
+ const onRejected = requestInterceptorChain[i++];
3022
+ try {
3023
+ newConfig = onFulfilled(newConfig);
3024
+ } catch (error) {
3025
+ onRejected.call(this, error);
3026
+ break;
3027
+ }
3028
+ }
3029
+ try {
3030
+ promise = dispatchRequest.call(this, newConfig);
3031
+ } catch (error) {
3032
+ return Promise.reject(error);
3033
+ }
3034
+ i = 0;
3035
+ len = responseInterceptorChain.length;
3036
+ while (i < len) {
3037
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
3038
+ }
3039
+ return promise;
3040
+ }
3041
+ getUri(config) {
3042
+ config = mergeConfig(this.defaults, config);
3043
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);
3044
+ return buildURL(fullPath, config.params, config.paramsSerializer);
3045
+ }
3046
+ };
3047
+ utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
3048
+ Axios.prototype[method] = function(url, config) {
3049
+ return this.request(
3050
+ mergeConfig(config || {}, {
3051
+ method,
3052
+ url,
3053
+ data: config && utils_default.hasOwnProp(config, "data") ? config.data : void 0
3054
+ })
3055
+ );
3056
+ };
3057
+ });
3058
+ utils_default.forEach(["post", "put", "patch", "query"], function forEachMethodWithData(method) {
3059
+ function generateHTTPMethod(isForm) {
3060
+ return function httpMethod(url, data, config) {
3061
+ return this.request(
3062
+ mergeConfig(config || {}, {
3063
+ method,
3064
+ headers: isForm ? {
3065
+ "Content-Type": "multipart/form-data"
3066
+ } : {},
3067
+ url,
3068
+ data
3069
+ })
3070
+ );
3071
+ };
3072
+ }
3073
+ Axios.prototype[method] = generateHTTPMethod();
3074
+ if (method !== "query") {
3075
+ Axios.prototype[method + "Form"] = generateHTTPMethod(true);
3076
+ }
3077
+ });
3078
+ var Axios_default = Axios;
3079
+
3080
+ // node_modules/axios/lib/cancel/CancelToken.js
3081
+ var CancelToken = class _CancelToken {
3082
+ constructor(executor) {
3083
+ if (typeof executor !== "function") {
3084
+ throw new TypeError("executor must be a function.");
3085
+ }
3086
+ let resolvePromise;
3087
+ this.promise = new Promise(function promiseExecutor(resolve) {
3088
+ resolvePromise = resolve;
3089
+ });
3090
+ const token = this;
3091
+ this.promise.then((cancel) => {
3092
+ if (!token._listeners) return;
3093
+ let i = token._listeners.length;
3094
+ while (i-- > 0) {
3095
+ token._listeners[i](cancel);
3096
+ }
3097
+ token._listeners = null;
3098
+ });
3099
+ this.promise.then = (onfulfilled) => {
3100
+ let _resolve;
3101
+ const promise = new Promise((resolve) => {
3102
+ token.subscribe(resolve);
3103
+ _resolve = resolve;
3104
+ }).then(onfulfilled);
3105
+ promise.cancel = function reject() {
3106
+ token.unsubscribe(_resolve);
3107
+ };
3108
+ return promise;
3109
+ };
3110
+ executor(function cancel(message, config, request) {
3111
+ if (token.reason) {
3112
+ return;
3113
+ }
3114
+ token.reason = new CanceledError_default(message, config, request);
3115
+ resolvePromise(token.reason);
3116
+ });
3117
+ }
3118
+ /**
3119
+ * Throws a `CanceledError` if cancellation has been requested.
3120
+ */
3121
+ throwIfRequested() {
3122
+ if (this.reason) {
3123
+ throw this.reason;
3124
+ }
3125
+ }
3126
+ /**
3127
+ * Subscribe to the cancel signal
3128
+ */
3129
+ subscribe(listener) {
3130
+ if (this.reason) {
3131
+ listener(this.reason);
3132
+ return;
3133
+ }
3134
+ if (this._listeners) {
3135
+ this._listeners.push(listener);
3136
+ } else {
3137
+ this._listeners = [listener];
3138
+ }
3139
+ }
3140
+ /**
3141
+ * Unsubscribe from the cancel signal
3142
+ */
3143
+ unsubscribe(listener) {
3144
+ if (!this._listeners) {
3145
+ return;
3146
+ }
3147
+ const index = this._listeners.indexOf(listener);
3148
+ if (index !== -1) {
3149
+ this._listeners.splice(index, 1);
3150
+ }
3151
+ }
3152
+ toAbortSignal() {
3153
+ const controller = new AbortController();
3154
+ const abort = (err) => {
3155
+ controller.abort(err);
3156
+ };
3157
+ this.subscribe(abort);
3158
+ controller.signal.unsubscribe = () => this.unsubscribe(abort);
3159
+ return controller.signal;
3160
+ }
3161
+ /**
3162
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
3163
+ * cancels the `CancelToken`.
3164
+ */
3165
+ static source() {
3166
+ let cancel;
3167
+ const token = new _CancelToken(function executor(c) {
3168
+ cancel = c;
3169
+ });
3170
+ return {
3171
+ token,
3172
+ cancel
3173
+ };
3174
+ }
3175
+ };
3176
+ var CancelToken_default = CancelToken;
3177
+
3178
+ // node_modules/axios/lib/helpers/spread.js
3179
+ function spread(callback) {
3180
+ return function wrap(arr) {
3181
+ return callback.apply(null, arr);
3182
+ };
3183
+ }
3184
+
3185
+ // node_modules/axios/lib/helpers/isAxiosError.js
3186
+ function isAxiosError(payload) {
3187
+ return utils_default.isObject(payload) && payload.isAxiosError === true;
3188
+ }
3189
+
3190
+ // node_modules/axios/lib/helpers/HttpStatusCode.js
3191
+ var HttpStatusCode = {
3192
+ Continue: 100,
3193
+ SwitchingProtocols: 101,
3194
+ Processing: 102,
3195
+ EarlyHints: 103,
3196
+ Ok: 200,
3197
+ Created: 201,
3198
+ Accepted: 202,
3199
+ NonAuthoritativeInformation: 203,
3200
+ NoContent: 204,
3201
+ ResetContent: 205,
3202
+ PartialContent: 206,
3203
+ MultiStatus: 207,
3204
+ AlreadyReported: 208,
3205
+ ImUsed: 226,
3206
+ MultipleChoices: 300,
3207
+ MovedPermanently: 301,
3208
+ Found: 302,
3209
+ SeeOther: 303,
3210
+ NotModified: 304,
3211
+ UseProxy: 305,
3212
+ Unused: 306,
3213
+ TemporaryRedirect: 307,
3214
+ PermanentRedirect: 308,
3215
+ BadRequest: 400,
3216
+ Unauthorized: 401,
3217
+ PaymentRequired: 402,
3218
+ Forbidden: 403,
3219
+ NotFound: 404,
3220
+ MethodNotAllowed: 405,
3221
+ NotAcceptable: 406,
3222
+ ProxyAuthenticationRequired: 407,
3223
+ RequestTimeout: 408,
3224
+ Conflict: 409,
3225
+ Gone: 410,
3226
+ LengthRequired: 411,
3227
+ PreconditionFailed: 412,
3228
+ PayloadTooLarge: 413,
3229
+ UriTooLong: 414,
3230
+ UnsupportedMediaType: 415,
3231
+ RangeNotSatisfiable: 416,
3232
+ ExpectationFailed: 417,
3233
+ ImATeapot: 418,
3234
+ MisdirectedRequest: 421,
3235
+ UnprocessableEntity: 422,
3236
+ Locked: 423,
3237
+ FailedDependency: 424,
3238
+ TooEarly: 425,
3239
+ UpgradeRequired: 426,
3240
+ PreconditionRequired: 428,
3241
+ TooManyRequests: 429,
3242
+ RequestHeaderFieldsTooLarge: 431,
3243
+ UnavailableForLegalReasons: 451,
3244
+ InternalServerError: 500,
3245
+ NotImplemented: 501,
3246
+ BadGateway: 502,
3247
+ ServiceUnavailable: 503,
3248
+ GatewayTimeout: 504,
3249
+ HttpVersionNotSupported: 505,
3250
+ VariantAlsoNegotiates: 506,
3251
+ InsufficientStorage: 507,
3252
+ LoopDetected: 508,
3253
+ NotExtended: 510,
3254
+ NetworkAuthenticationRequired: 511,
3255
+ WebServerIsDown: 521,
3256
+ ConnectionTimedOut: 522,
3257
+ OriginIsUnreachable: 523,
3258
+ TimeoutOccurred: 524,
3259
+ SslHandshakeFailed: 525,
3260
+ InvalidSslCertificate: 526
3261
+ };
3262
+ Object.entries(HttpStatusCode).forEach(([key, value]) => {
3263
+ HttpStatusCode[value] = key;
3264
+ });
3265
+ var HttpStatusCode_default = HttpStatusCode;
3266
+
3267
+ // node_modules/axios/lib/axios.js
3268
+ function createInstance(defaultConfig) {
3269
+ const context = new Axios_default(defaultConfig);
3270
+ const instance = bind(Axios_default.prototype.request, context);
3271
+ utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
3272
+ utils_default.extend(instance, context, null, { allOwnKeys: true });
3273
+ instance.create = function create2(instanceConfig) {
3274
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
3275
+ };
3276
+ return instance;
3277
+ }
3278
+ var axios = createInstance(defaults_default);
3279
+ axios.Axios = Axios_default;
3280
+ axios.CanceledError = CanceledError_default;
3281
+ axios.CancelToken = CancelToken_default;
3282
+ axios.isCancel = isCancel;
3283
+ axios.VERSION = VERSION;
3284
+ axios.toFormData = toFormData_default;
3285
+ axios.AxiosError = AxiosError_default;
3286
+ axios.Cancel = axios.CanceledError;
3287
+ axios.all = function all(promises) {
3288
+ return Promise.all(promises);
3289
+ };
3290
+ axios.spread = spread;
3291
+ axios.isAxiosError = isAxiosError;
3292
+ axios.mergeConfig = mergeConfig;
3293
+ axios.AxiosHeaders = AxiosHeaders_default;
3294
+ axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
3295
+ axios.getAdapter = adapters_default.getAdapter;
3296
+ axios.HttpStatusCode = HttpStatusCode_default;
3297
+ axios.default = axios;
3298
+ var axios_default = axios;
3299
+
3300
+ // node_modules/axios/index.js
3301
+ var {
3302
+ Axios: Axios2,
3303
+ AxiosError: AxiosError2,
3304
+ CanceledError: CanceledError2,
3305
+ isCancel: isCancel2,
3306
+ CancelToken: CancelToken2,
3307
+ VERSION: VERSION2,
3308
+ all: all2,
3309
+ Cancel,
3310
+ isAxiosError: isAxiosError2,
3311
+ spread: spread2,
3312
+ toFormData: toFormData2,
3313
+ AxiosHeaders: AxiosHeaders2,
3314
+ HttpStatusCode: HttpStatusCode2,
3315
+ formToJSON,
3316
+ getAdapter: getAdapter2,
3317
+ mergeConfig: mergeConfig2,
3318
+ create
3319
+ } = axios_default;
3320
+
1
3321
  // src/index.js
2
3322
  var DEFAULT_TIMEOUT_MS = 3e4;
3
3323
  var TevrocError = class extends Error {
@@ -18,11 +3338,10 @@ var TevrocClient = class {
18
3338
  const baseUrl = options.baseUrl ?? options.url;
19
3339
  if (!baseUrl) throw new TypeError("createClient requires a baseUrl");
20
3340
  this.baseUrl = normalizeBaseUrl(baseUrl);
21
- this.fetch = options.fetch ?? globalThis.fetch;
22
- if (typeof this.fetch !== "function") throw new TypeError("No fetch implementation available");
23
3341
  this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
24
3342
  this.defaultHeaders = normalizeHeaders(options.headers);
25
3343
  this.token = options.token ?? null;
3344
+ this.http = options.axios ?? axios_default;
26
3345
  this.auth = createAuthApi(this);
27
3346
  this.entities = createEntityRegistry(this);
28
3347
  this.functions = createFunctionRegistry(this);
@@ -44,36 +3363,35 @@ var TevrocClient = class {
44
3363
  }
45
3364
  async request(path, options = {}) {
46
3365
  const method = (options.method ?? "GET").toUpperCase();
47
- const headers = new Headers(this.defaultHeaders);
3366
+ const headers = { ...this.defaultHeaders };
48
3367
  const query = options.query ? toSearchParams(options.query) : "";
49
3368
  const url = `${this.baseUrl}${path.startsWith("/") ? path : `/${path}`}${query}`;
50
- const controller = new AbortController();
51
- const timeout = setTimeout(() => controller.abort(), options.timeoutMs ?? this.timeoutMs);
52
- if (this.token && options.auth !== false) headers.set("authorization", `Bearer ${this.token}`);
3369
+ if (this.token && options.auth !== false) headers.authorization = `Bearer ${this.token}`;
53
3370
  let body = options.body;
54
3371
  if (body !== void 0 && body !== null && isJsonBody(body)) {
55
- headers.set("content-type", "application/json");
3372
+ headers["content-type"] = "application/json";
56
3373
  body = JSON.stringify(body);
57
3374
  }
58
3375
  if (options.headers) {
59
3376
  for (const [key, value] of Object.entries(options.headers)) {
60
- if (value !== void 0 && value !== null) headers.set(key, String(value));
3377
+ if (value !== void 0 && value !== null) headers[key.toLowerCase()] = String(value);
61
3378
  }
62
3379
  }
63
3380
  try {
64
- const response = await this.fetch(url, {
3381
+ const response = await this.http.request({
3382
+ url,
65
3383
  method,
66
3384
  headers,
67
- body,
68
- signal: options.signal ?? controller.signal
3385
+ data: body,
3386
+ signal: options.signal,
3387
+ timeout: options.timeoutMs ?? this.timeoutMs,
3388
+ validateStatus: () => true
69
3389
  });
70
3390
  return await parseResponse(response, options.parseAs);
71
3391
  } catch (error) {
72
- if (error?.name === "AbortError") throw new TevrocError("Request timed out", { code: "timeout" });
3392
+ if (error?.code === "ECONNABORTED" || error?.code === "ERR_CANCELED") throw new TevrocError("Request timed out", { code: "timeout" });
73
3393
  if (error instanceof TevrocError) throw error;
74
3394
  throw new TevrocError(error?.message ?? "Network request failed", { code: "network_error", details: error });
75
- } finally {
76
- clearTimeout(timeout);
77
3395
  }
78
3396
  }
79
3397
  };
@@ -89,6 +3407,11 @@ function createAuthApi(client) {
89
3407
  if (result.token) client.setToken(result.token);
90
3408
  return result;
91
3409
  },
3410
+ async loginWithGoogle(input) {
3411
+ const result = await client.request("/auth/google", { method: "POST", body: input, auth: false });
3412
+ if (result.token) client.setToken(result.token);
3413
+ return result;
3414
+ },
92
3415
  async logout() {
93
3416
  const result = await client.request("/auth/logout", { method: "POST" });
94
3417
  client.clearToken();
@@ -245,12 +3568,12 @@ function upload(client, path, file, options) {
245
3568
  }
246
3569
  async function parseResponse(response, parseAs) {
247
3570
  if (parseAs === "response") return response;
248
- const contentType = response.headers.get("content-type") ?? "";
3571
+ const contentType = getHeader(response.headers, "content-type");
249
3572
  const isJson = contentType.includes("application/json");
250
- const data = isJson ? await response.json() : await response.text();
251
- if (!response.ok) {
3573
+ const data = response.data;
3574
+ if (response.status < 200 || response.status >= 300) {
252
3575
  const error = isJson && data?.error ? data.error : {};
253
- throw new TevrocError(error.message ?? response.statusText, {
3576
+ throw new TevrocError(error.message ?? response.statusText ?? "Request failed", {
254
3577
  status: response.status,
255
3578
  code: error.code ?? "api_error",
256
3579
  details: error.details ?? data,
@@ -259,6 +3582,12 @@ async function parseResponse(response, parseAs) {
259
3582
  }
260
3583
  return data;
261
3584
  }
3585
+ function getHeader(headers, name) {
3586
+ if (!headers) return "";
3587
+ if (typeof headers.get === "function") return headers.get(name) ?? "";
3588
+ const value = headers[name] ?? headers[name.toLowerCase()];
3589
+ return Array.isArray(value) ? value.join(", ") : String(value ?? "");
3590
+ }
262
3591
  function toSearchParams(query) {
263
3592
  const params = new URLSearchParams();
264
3593
  for (const [key, value2] of Object.entries(query)) {
@@ -276,13 +3605,14 @@ function normalizeBaseUrl(url) {
276
3605
  return String(url).replace(/\/+$/, "");
277
3606
  }
278
3607
  function normalizeHeaders(headers = {}) {
279
- return Object.fromEntries(new Headers(headers).entries());
3608
+ if (typeof headers.entries === "function") return Object.fromEntries(Array.from(headers.entries(), ([key, value]) => [key.toLowerCase(), value]));
3609
+ return Object.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), String(value)]));
280
3610
  }
281
3611
  function isJsonBody(body) {
282
- const isArrayBuffer = typeof ArrayBuffer !== "undefined" && body instanceof ArrayBuffer;
283
- const isBlob = typeof Blob !== "undefined" && body instanceof Blob;
284
- const isFormData = typeof FormData !== "undefined" && body instanceof FormData;
285
- return typeof body === "object" && !isArrayBuffer && !isBlob && !isFormData;
3612
+ const isArrayBuffer2 = typeof ArrayBuffer !== "undefined" && body instanceof ArrayBuffer;
3613
+ const isBlob2 = typeof Blob !== "undefined" && body instanceof Blob;
3614
+ const isFormData2 = typeof FormData !== "undefined" && body instanceof FormData;
3615
+ return typeof body === "object" && !isArrayBuffer2 && !isBlob2 && !isFormData2;
286
3616
  }
287
3617
  export {
288
3618
  TevrocClient,