wcz-test 6.24.4 → 6.24.5

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