@valaxyjs/devtools 0.18.0-beta.2 → 0.18.0

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.
@@ -0,0 +1,4526 @@
1
+ import { g as getAppWindow, d as defineComponent, c as computed, o as openBlock, a as createElementBlock, n as normalizeClass, b as createCommentVNode, r as renderSlot, e as createBaseVNode, f as resolveComponent, h as createBlock, w as withCtx, t as toDisplayString, i as ref, F as Fragment, j as renderList, k as createTextVNode, l as createVNode, p as pageData, m as toRaw, u as unref, q as frontmatter, s as getWindowProperty, v as onMounted, x as getGlobalValaxyProperty, y as activePath, z as devtoolsRouter, A as h, B as normalizeStyle, C as isStaticMode } from './index-q944aN_L.js';
2
+ import { _ as _export_sfc } from './_plugin-vue_export-helper-PLawvS9c.js';
3
+
4
+ const target = getAppWindow();
5
+ function openInEditor(options = {}) {
6
+ const { file, line = 0, column = 0 } = options;
7
+ if (file) {
8
+ const baseUrl = window.location.origin;
9
+ target?.__VUE_INSPECTOR__.openInEditor(baseUrl, file, line, column);
10
+ }
11
+ }
12
+
13
+ /* Injected with object hook! */
14
+
15
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
16
+ __name: "AGUIButton",
17
+ props: {
18
+ icon: {},
19
+ size: {}
20
+ },
21
+ setup(__props) {
22
+ const props = __props;
23
+ const classes = computed(() => {
24
+ const cls = [];
25
+ if (props.size)
26
+ cls.push(props.size);
27
+ return cls;
28
+ });
29
+ return (_ctx, _cache) => {
30
+ return openBlock(), createElementBlock("button", {
31
+ class: normalizeClass([classes.value, "agui-button"])
32
+ }, [
33
+ _ctx.icon ? (openBlock(), createElementBlock("div", {
34
+ key: 0,
35
+ class: normalizeClass(["mr-1 inline-flex", _ctx.icon])
36
+ }, null, 2)) : createCommentVNode("", true),
37
+ renderSlot(_ctx.$slots, "default")
38
+ ], 2);
39
+ };
40
+ }
41
+ });
42
+
43
+ /* Injected with object hook! */
44
+
45
+ /* Injected with object hook! */
46
+
47
+ const _hoisted_1$6 = {
48
+ key: 0,
49
+ class: "relative flex"
50
+ };
51
+ const _hoisted_2$4 = {
52
+ key: 0,
53
+ class: "absolute"
54
+ };
55
+ const _hoisted_3$3 = { class: "absolute left-1 h-full flex items-center justify-center text-xs op-60" };
56
+ const _hoisted_4$1 = ["value", "placeholder"];
57
+ const _hoisted_5 = ["value", "placeholder"];
58
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
59
+ __name: "AGUIInput",
60
+ props: {
61
+ className: {},
62
+ prefixIcon: {},
63
+ modelValue: {},
64
+ placeholder: {}
65
+ },
66
+ emits: ["update:modelValue"],
67
+ setup(__props, { emit: __emit }) {
68
+ const emit = __emit;
69
+ function updateModelValue(event) {
70
+ const val = event.target?.value || "";
71
+ emit("update:modelValue", val);
72
+ }
73
+ return (_ctx, _cache) => {
74
+ return _ctx.prefixIcon ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
75
+ _ctx.$slots.prefix ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
76
+ renderSlot(_ctx.$slots, "prefix")
77
+ ])) : createCommentVNode("", true),
78
+ createBaseVNode("div", _hoisted_3$3, [
79
+ _ctx.prefixIcon ? (openBlock(), createElementBlock("div", {
80
+ key: 0,
81
+ class: normalizeClass(_ctx.prefixIcon)
82
+ }, null, 2)) : createCommentVNode("", true)
83
+ ]),
84
+ createBaseVNode("input", {
85
+ class: normalizeClass(["agui-input w-full px-1 shadow shadow-inset", {
86
+ "pl-5": _ctx.prefixIcon
87
+ }]),
88
+ value: _ctx.modelValue,
89
+ placeholder: _ctx.placeholder,
90
+ onInput: updateModelValue
91
+ }, null, 42, _hoisted_4$1)
92
+ ])) : (openBlock(), createElementBlock("input", {
93
+ key: 1,
94
+ class: "agui-input w-full px-1 shadow shadow-inset",
95
+ value: _ctx.modelValue,
96
+ placeholder: _ctx.placeholder,
97
+ onInput: updateModelValue
98
+ }, null, 40, _hoisted_5));
99
+ };
100
+ }
101
+ });
102
+
103
+ /* Injected with object hook! */
104
+
105
+ /* Injected with object hook! */
106
+
107
+ const _hoisted_1$5 = /* @__PURE__ */ createBaseVNode("div", {
108
+ m: "x-1",
109
+ "inline-flex": "",
110
+ "i-ri-folder-2-line": ""
111
+ }, null, -1);
112
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
113
+ __name: "VDPostCategories",
114
+ props: {
115
+ categories: {}
116
+ },
117
+ setup(__props) {
118
+ return (_ctx, _cache) => {
119
+ const _component_RouterLink = resolveComponent("RouterLink");
120
+ return openBlock(), createBlock(_component_RouterLink, {
121
+ to: {
122
+ path: "/categories",
123
+ query: { category: Array.isArray(_ctx.categories) ? _ctx.categories.join("/") : _ctx.categories }
124
+ },
125
+ class: "post-category transition text-xs hover:(text-blue-500 border-blue-500)",
126
+ "px-2": "",
127
+ "py-1": "",
128
+ border: "",
129
+ "rounded-full": "",
130
+ "inline-flex": "",
131
+ "justify-center": "",
132
+ "items-center": "",
133
+ bg: "hover:(blue-500 opacity-10)"
134
+ }, {
135
+ default: withCtx(() => [
136
+ _hoisted_1$5,
137
+ createBaseVNode("span", null, toDisplayString(Array.isArray(_ctx.categories) ? _ctx.categories.join(" > ") : _ctx.categories), 1)
138
+ ]),
139
+ _: 1
140
+ }, 8, ["to"]);
141
+ };
142
+ }
143
+ });
144
+
145
+ /* Injected with object hook! */
146
+
147
+ /* unplugin-vue-components disabled */const _sfc_main$4 = {};
148
+
149
+ const _hoisted_1$4 = {
150
+ class: "vd-tag inline-flex shadow border rounded text-xs",
151
+ p: "x-2 y-1"
152
+ };
153
+
154
+ function _sfc_render(_ctx, _cache) {
155
+ return (openBlock(), createElementBlock("div", _hoisted_1$4, [
156
+ renderSlot(_ctx.$slots, "default")
157
+ ]))
158
+ }
159
+ const __unplugin_components_0 = /*#__PURE__*/_export_sfc(_sfc_main$4, [['render',_sfc_render]]);
160
+ /* Injected with object hook! */
161
+
162
+ function bind(fn, thisArg) {
163
+ return function wrap() {
164
+ return fn.apply(thisArg, arguments);
165
+ };
166
+ }
167
+
168
+ /* Injected with object hook! */
169
+
170
+ // utils is a library of generic helper functions non-specific to axios
171
+
172
+ const {toString} = Object.prototype;
173
+ const {getPrototypeOf} = Object;
174
+
175
+ const kindOf = (cache => thing => {
176
+ const str = toString.call(thing);
177
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
178
+ })(Object.create(null));
179
+
180
+ const kindOfTest = (type) => {
181
+ type = type.toLowerCase();
182
+ return (thing) => kindOf(thing) === type
183
+ };
184
+
185
+ const typeOfTest = type => thing => typeof thing === type;
186
+
187
+ /**
188
+ * Determine if a value is an Array
189
+ *
190
+ * @param {Object} val The value to test
191
+ *
192
+ * @returns {boolean} True if value is an Array, otherwise false
193
+ */
194
+ const {isArray} = Array;
195
+
196
+ /**
197
+ * Determine if a value is undefined
198
+ *
199
+ * @param {*} val The value to test
200
+ *
201
+ * @returns {boolean} True if the value is undefined, otherwise false
202
+ */
203
+ const isUndefined = typeOfTest('undefined');
204
+
205
+ /**
206
+ * Determine if a value is a Buffer
207
+ *
208
+ * @param {*} val The value to test
209
+ *
210
+ * @returns {boolean} True if value is a Buffer, otherwise false
211
+ */
212
+ function isBuffer(val) {
213
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
214
+ && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
215
+ }
216
+
217
+ /**
218
+ * Determine if a value is an ArrayBuffer
219
+ *
220
+ * @param {*} val The value to test
221
+ *
222
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
223
+ */
224
+ const isArrayBuffer = kindOfTest('ArrayBuffer');
225
+
226
+
227
+ /**
228
+ * Determine if a value is a view on an ArrayBuffer
229
+ *
230
+ * @param {*} val The value to test
231
+ *
232
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
233
+ */
234
+ function isArrayBufferView(val) {
235
+ let result;
236
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
237
+ result = ArrayBuffer.isView(val);
238
+ } else {
239
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
240
+ }
241
+ return result;
242
+ }
243
+
244
+ /**
245
+ * Determine if a value is a String
246
+ *
247
+ * @param {*} val The value to test
248
+ *
249
+ * @returns {boolean} True if value is a String, otherwise false
250
+ */
251
+ const isString = typeOfTest('string');
252
+
253
+ /**
254
+ * Determine if a value is a Function
255
+ *
256
+ * @param {*} val The value to test
257
+ * @returns {boolean} True if value is a Function, otherwise false
258
+ */
259
+ const isFunction = typeOfTest('function');
260
+
261
+ /**
262
+ * Determine if a value is a Number
263
+ *
264
+ * @param {*} val The value to test
265
+ *
266
+ * @returns {boolean} True if value is a Number, otherwise false
267
+ */
268
+ const isNumber = typeOfTest('number');
269
+
270
+ /**
271
+ * Determine if a value is an Object
272
+ *
273
+ * @param {*} thing The value to test
274
+ *
275
+ * @returns {boolean} True if value is an Object, otherwise false
276
+ */
277
+ const isObject$1 = (thing) => thing !== null && typeof thing === 'object';
278
+
279
+ /**
280
+ * Determine if a value is a Boolean
281
+ *
282
+ * @param {*} thing The value to test
283
+ * @returns {boolean} True if value is a Boolean, otherwise false
284
+ */
285
+ const isBoolean = thing => thing === true || thing === false;
286
+
287
+ /**
288
+ * Determine if a value is a plain Object
289
+ *
290
+ * @param {*} val The value to test
291
+ *
292
+ * @returns {boolean} True if value is a plain Object, otherwise false
293
+ */
294
+ const isPlainObject$1 = (val) => {
295
+ if (kindOf(val) !== 'object') {
296
+ return false;
297
+ }
298
+
299
+ const prototype = getPrototypeOf(val);
300
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
301
+ };
302
+
303
+ /**
304
+ * Determine if a value is a Date
305
+ *
306
+ * @param {*} val The value to test
307
+ *
308
+ * @returns {boolean} True if value is a Date, otherwise false
309
+ */
310
+ const isDate = kindOfTest('Date');
311
+
312
+ /**
313
+ * Determine if a value is a File
314
+ *
315
+ * @param {*} val The value to test
316
+ *
317
+ * @returns {boolean} True if value is a File, otherwise false
318
+ */
319
+ const isFile = kindOfTest('File');
320
+
321
+ /**
322
+ * Determine if a value is a Blob
323
+ *
324
+ * @param {*} val The value to test
325
+ *
326
+ * @returns {boolean} True if value is a Blob, otherwise false
327
+ */
328
+ const isBlob = kindOfTest('Blob');
329
+
330
+ /**
331
+ * Determine if a value is a FileList
332
+ *
333
+ * @param {*} val The value to test
334
+ *
335
+ * @returns {boolean} True if value is a File, otherwise false
336
+ */
337
+ const isFileList = kindOfTest('FileList');
338
+
339
+ /**
340
+ * Determine if a value is a Stream
341
+ *
342
+ * @param {*} val The value to test
343
+ *
344
+ * @returns {boolean} True if value is a Stream, otherwise false
345
+ */
346
+ const isStream = (val) => isObject$1(val) && isFunction(val.pipe);
347
+
348
+ /**
349
+ * Determine if a value is a FormData
350
+ *
351
+ * @param {*} thing The value to test
352
+ *
353
+ * @returns {boolean} True if value is an FormData, otherwise false
354
+ */
355
+ const isFormData = (thing) => {
356
+ let kind;
357
+ return thing && (
358
+ (typeof FormData === 'function' && thing instanceof FormData) || (
359
+ isFunction(thing.append) && (
360
+ (kind = kindOf(thing)) === 'formdata' ||
361
+ // detect form-data instance
362
+ (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
363
+ )
364
+ )
365
+ )
366
+ };
367
+
368
+ /**
369
+ * Determine if a value is a URLSearchParams object
370
+ *
371
+ * @param {*} val The value to test
372
+ *
373
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
374
+ */
375
+ const isURLSearchParams = kindOfTest('URLSearchParams');
376
+
377
+ /**
378
+ * Trim excess whitespace off the beginning and end of a string
379
+ *
380
+ * @param {String} str The String to trim
381
+ *
382
+ * @returns {String} The String freed of excess whitespace
383
+ */
384
+ const trim = (str) => str.trim ?
385
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
386
+
387
+ /**
388
+ * Iterate over an Array or an Object invoking a function for each item.
389
+ *
390
+ * If `obj` is an Array callback will be called passing
391
+ * the value, index, and complete array for each item.
392
+ *
393
+ * If 'obj' is an Object callback will be called passing
394
+ * the value, key, and complete object for each property.
395
+ *
396
+ * @param {Object|Array} obj The object to iterate
397
+ * @param {Function} fn The callback to invoke for each item
398
+ *
399
+ * @param {Boolean} [allOwnKeys = false]
400
+ * @returns {any}
401
+ */
402
+ function forEach(obj, fn, {allOwnKeys = false} = {}) {
403
+ // Don't bother if no value provided
404
+ if (obj === null || typeof obj === 'undefined') {
405
+ return;
406
+ }
407
+
408
+ let i;
409
+ let l;
410
+
411
+ // Force an array if not already something iterable
412
+ if (typeof obj !== 'object') {
413
+ /*eslint no-param-reassign:0*/
414
+ obj = [obj];
415
+ }
416
+
417
+ if (isArray(obj)) {
418
+ // Iterate over array values
419
+ for (i = 0, l = obj.length; i < l; i++) {
420
+ fn.call(null, obj[i], i, obj);
421
+ }
422
+ } else {
423
+ // Iterate over object keys
424
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
425
+ const len = keys.length;
426
+ let key;
427
+
428
+ for (i = 0; i < len; i++) {
429
+ key = keys[i];
430
+ fn.call(null, obj[key], key, obj);
431
+ }
432
+ }
433
+ }
434
+
435
+ function findKey(obj, key) {
436
+ key = key.toLowerCase();
437
+ const keys = Object.keys(obj);
438
+ let i = keys.length;
439
+ let _key;
440
+ while (i-- > 0) {
441
+ _key = keys[i];
442
+ if (key === _key.toLowerCase()) {
443
+ return _key;
444
+ }
445
+ }
446
+ return null;
447
+ }
448
+
449
+ const _global = (() => {
450
+ /*eslint no-undef:0*/
451
+ if (typeof globalThis !== "undefined") return globalThis;
452
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
453
+ })();
454
+
455
+ const isContextDefined = (context) => !isUndefined(context) && context !== _global;
456
+
457
+ /**
458
+ * Accepts varargs expecting each argument to be an object, then
459
+ * immutably merges the properties of each object and returns result.
460
+ *
461
+ * When multiple objects contain the same key the later object in
462
+ * the arguments list will take precedence.
463
+ *
464
+ * Example:
465
+ *
466
+ * ```js
467
+ * var result = merge({foo: 123}, {foo: 456});
468
+ * console.log(result.foo); // outputs 456
469
+ * ```
470
+ *
471
+ * @param {Object} obj1 Object to merge
472
+ *
473
+ * @returns {Object} Result of all merge properties
474
+ */
475
+ function merge(/* obj1, obj2, obj3, ... */) {
476
+ const {caseless} = isContextDefined(this) && this || {};
477
+ const result = {};
478
+ const assignValue = (val, key) => {
479
+ const targetKey = caseless && findKey(result, key) || key;
480
+ if (isPlainObject$1(result[targetKey]) && isPlainObject$1(val)) {
481
+ result[targetKey] = merge(result[targetKey], val);
482
+ } else if (isPlainObject$1(val)) {
483
+ result[targetKey] = merge({}, val);
484
+ } else if (isArray(val)) {
485
+ result[targetKey] = val.slice();
486
+ } else {
487
+ result[targetKey] = val;
488
+ }
489
+ };
490
+
491
+ for (let i = 0, l = arguments.length; i < l; i++) {
492
+ arguments[i] && forEach(arguments[i], assignValue);
493
+ }
494
+ return result;
495
+ }
496
+
497
+ /**
498
+ * Extends object a by mutably adding to it the properties of object b.
499
+ *
500
+ * @param {Object} a The object to be extended
501
+ * @param {Object} b The object to copy properties from
502
+ * @param {Object} thisArg The object to bind function to
503
+ *
504
+ * @param {Boolean} [allOwnKeys]
505
+ * @returns {Object} The resulting value of object a
506
+ */
507
+ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
508
+ forEach(b, (val, key) => {
509
+ if (thisArg && isFunction(val)) {
510
+ a[key] = bind(val, thisArg);
511
+ } else {
512
+ a[key] = val;
513
+ }
514
+ }, {allOwnKeys});
515
+ return a;
516
+ };
517
+
518
+ /**
519
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
520
+ *
521
+ * @param {string} content with BOM
522
+ *
523
+ * @returns {string} content value without BOM
524
+ */
525
+ const stripBOM = (content) => {
526
+ if (content.charCodeAt(0) === 0xFEFF) {
527
+ content = content.slice(1);
528
+ }
529
+ return content;
530
+ };
531
+
532
+ /**
533
+ * Inherit the prototype methods from one constructor into another
534
+ * @param {function} constructor
535
+ * @param {function} superConstructor
536
+ * @param {object} [props]
537
+ * @param {object} [descriptors]
538
+ *
539
+ * @returns {void}
540
+ */
541
+ const inherits = (constructor, superConstructor, props, descriptors) => {
542
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
543
+ constructor.prototype.constructor = constructor;
544
+ Object.defineProperty(constructor, 'super', {
545
+ value: superConstructor.prototype
546
+ });
547
+ props && Object.assign(constructor.prototype, props);
548
+ };
549
+
550
+ /**
551
+ * Resolve object with deep prototype chain to a flat object
552
+ * @param {Object} sourceObj source object
553
+ * @param {Object} [destObj]
554
+ * @param {Function|Boolean} [filter]
555
+ * @param {Function} [propFilter]
556
+ *
557
+ * @returns {Object}
558
+ */
559
+ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
560
+ let props;
561
+ let i;
562
+ let prop;
563
+ const merged = {};
564
+
565
+ destObj = destObj || {};
566
+ // eslint-disable-next-line no-eq-null,eqeqeq
567
+ if (sourceObj == null) return destObj;
568
+
569
+ do {
570
+ props = Object.getOwnPropertyNames(sourceObj);
571
+ i = props.length;
572
+ while (i-- > 0) {
573
+ prop = props[i];
574
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
575
+ destObj[prop] = sourceObj[prop];
576
+ merged[prop] = true;
577
+ }
578
+ }
579
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
580
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
581
+
582
+ return destObj;
583
+ };
584
+
585
+ /**
586
+ * Determines whether a string ends with the characters of a specified string
587
+ *
588
+ * @param {String} str
589
+ * @param {String} searchString
590
+ * @param {Number} [position= 0]
591
+ *
592
+ * @returns {boolean}
593
+ */
594
+ const endsWith = (str, searchString, position) => {
595
+ str = String(str);
596
+ if (position === undefined || position > str.length) {
597
+ position = str.length;
598
+ }
599
+ position -= searchString.length;
600
+ const lastIndex = str.indexOf(searchString, position);
601
+ return lastIndex !== -1 && lastIndex === position;
602
+ };
603
+
604
+
605
+ /**
606
+ * Returns new array from array like object or null if failed
607
+ *
608
+ * @param {*} [thing]
609
+ *
610
+ * @returns {?Array}
611
+ */
612
+ const toArray = (thing) => {
613
+ if (!thing) return null;
614
+ if (isArray(thing)) return thing;
615
+ let i = thing.length;
616
+ if (!isNumber(i)) return null;
617
+ const arr = new Array(i);
618
+ while (i-- > 0) {
619
+ arr[i] = thing[i];
620
+ }
621
+ return arr;
622
+ };
623
+
624
+ /**
625
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
626
+ * thing passed in is an instance of Uint8Array
627
+ *
628
+ * @param {TypedArray}
629
+ *
630
+ * @returns {Array}
631
+ */
632
+ // eslint-disable-next-line func-names
633
+ const isTypedArray = (TypedArray => {
634
+ // eslint-disable-next-line func-names
635
+ return thing => {
636
+ return TypedArray && thing instanceof TypedArray;
637
+ };
638
+ })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
639
+
640
+ /**
641
+ * For each entry in the object, call the function with the key and value.
642
+ *
643
+ * @param {Object<any, any>} obj - The object to iterate over.
644
+ * @param {Function} fn - The function to call for each entry.
645
+ *
646
+ * @returns {void}
647
+ */
648
+ const forEachEntry = (obj, fn) => {
649
+ const generator = obj && obj[Symbol.iterator];
650
+
651
+ const iterator = generator.call(obj);
652
+
653
+ let result;
654
+
655
+ while ((result = iterator.next()) && !result.done) {
656
+ const pair = result.value;
657
+ fn.call(obj, pair[0], pair[1]);
658
+ }
659
+ };
660
+
661
+ /**
662
+ * It takes a regular expression and a string, and returns an array of all the matches
663
+ *
664
+ * @param {string} regExp - The regular expression to match against.
665
+ * @param {string} str - The string to search.
666
+ *
667
+ * @returns {Array<boolean>}
668
+ */
669
+ const matchAll = (regExp, str) => {
670
+ let matches;
671
+ const arr = [];
672
+
673
+ while ((matches = regExp.exec(str)) !== null) {
674
+ arr.push(matches);
675
+ }
676
+
677
+ return arr;
678
+ };
679
+
680
+ /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
681
+ const isHTMLForm = kindOfTest('HTMLFormElement');
682
+
683
+ const toCamelCase = str => {
684
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
685
+ function replacer(m, p1, p2) {
686
+ return p1.toUpperCase() + p2;
687
+ }
688
+ );
689
+ };
690
+
691
+ /* Creating a function that will check if an object has a property. */
692
+ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
693
+
694
+ /**
695
+ * Determine if a value is a RegExp object
696
+ *
697
+ * @param {*} val The value to test
698
+ *
699
+ * @returns {boolean} True if value is a RegExp object, otherwise false
700
+ */
701
+ const isRegExp = kindOfTest('RegExp');
702
+
703
+ const reduceDescriptors = (obj, reducer) => {
704
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
705
+ const reducedDescriptors = {};
706
+
707
+ forEach(descriptors, (descriptor, name) => {
708
+ let ret;
709
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
710
+ reducedDescriptors[name] = ret || descriptor;
711
+ }
712
+ });
713
+
714
+ Object.defineProperties(obj, reducedDescriptors);
715
+ };
716
+
717
+ /**
718
+ * Makes all methods read-only
719
+ * @param {Object} obj
720
+ */
721
+
722
+ const freezeMethods = (obj) => {
723
+ reduceDescriptors(obj, (descriptor, name) => {
724
+ // skip restricted props in strict mode
725
+ if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
726
+ return false;
727
+ }
728
+
729
+ const value = obj[name];
730
+
731
+ if (!isFunction(value)) return;
732
+
733
+ descriptor.enumerable = false;
734
+
735
+ if ('writable' in descriptor) {
736
+ descriptor.writable = false;
737
+ return;
738
+ }
739
+
740
+ if (!descriptor.set) {
741
+ descriptor.set = () => {
742
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
743
+ };
744
+ }
745
+ });
746
+ };
747
+
748
+ const toObjectSet = (arrayOrString, delimiter) => {
749
+ const obj = {};
750
+
751
+ const define = (arr) => {
752
+ arr.forEach(value => {
753
+ obj[value] = true;
754
+ });
755
+ };
756
+
757
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
758
+
759
+ return obj;
760
+ };
761
+
762
+ const noop = () => {};
763
+
764
+ const toFiniteNumber = (value, defaultValue) => {
765
+ value = +value;
766
+ return Number.isFinite(value) ? value : defaultValue;
767
+ };
768
+
769
+ const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
770
+
771
+ const DIGIT = '0123456789';
772
+
773
+ const ALPHABET = {
774
+ DIGIT,
775
+ ALPHA,
776
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
777
+ };
778
+
779
+ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
780
+ let str = '';
781
+ const {length} = alphabet;
782
+ while (size--) {
783
+ str += alphabet[Math.random() * length|0];
784
+ }
785
+
786
+ return str;
787
+ };
788
+
789
+ /**
790
+ * If the thing is a FormData object, return true, otherwise return false.
791
+ *
792
+ * @param {unknown} thing - The thing to check.
793
+ *
794
+ * @returns {boolean}
795
+ */
796
+ function isSpecCompliantForm(thing) {
797
+ return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
798
+ }
799
+
800
+ const toJSONObject = (obj) => {
801
+ const stack = new Array(10);
802
+
803
+ const visit = (source, i) => {
804
+
805
+ if (isObject$1(source)) {
806
+ if (stack.indexOf(source) >= 0) {
807
+ return;
808
+ }
809
+
810
+ if(!('toJSON' in source)) {
811
+ stack[i] = source;
812
+ const target = isArray(source) ? [] : {};
813
+
814
+ forEach(source, (value, key) => {
815
+ const reducedValue = visit(value, i + 1);
816
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
817
+ });
818
+
819
+ stack[i] = undefined;
820
+
821
+ return target;
822
+ }
823
+ }
824
+
825
+ return source;
826
+ };
827
+
828
+ return visit(obj, 0);
829
+ };
830
+
831
+ const isAsyncFn = kindOfTest('AsyncFunction');
832
+
833
+ const isThenable = (thing) =>
834
+ thing && (isObject$1(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
835
+
836
+ const utils$1 = {
837
+ isArray,
838
+ isArrayBuffer,
839
+ isBuffer,
840
+ isFormData,
841
+ isArrayBufferView,
842
+ isString,
843
+ isNumber,
844
+ isBoolean,
845
+ isObject: isObject$1,
846
+ isPlainObject: isPlainObject$1,
847
+ isUndefined,
848
+ isDate,
849
+ isFile,
850
+ isBlob,
851
+ isRegExp,
852
+ isFunction,
853
+ isStream,
854
+ isURLSearchParams,
855
+ isTypedArray,
856
+ isFileList,
857
+ forEach,
858
+ merge,
859
+ extend,
860
+ trim,
861
+ stripBOM,
862
+ inherits,
863
+ toFlatObject,
864
+ kindOf,
865
+ kindOfTest,
866
+ endsWith,
867
+ toArray,
868
+ forEachEntry,
869
+ matchAll,
870
+ isHTMLForm,
871
+ hasOwnProperty,
872
+ hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
873
+ reduceDescriptors,
874
+ freezeMethods,
875
+ toObjectSet,
876
+ toCamelCase,
877
+ noop,
878
+ toFiniteNumber,
879
+ findKey,
880
+ global: _global,
881
+ isContextDefined,
882
+ ALPHABET,
883
+ generateString,
884
+ isSpecCompliantForm,
885
+ toJSONObject,
886
+ isAsyncFn,
887
+ isThenable
888
+ };
889
+
890
+ /* Injected with object hook! */
891
+
892
+ /**
893
+ * Create an Error with the specified message, config, error code, request and response.
894
+ *
895
+ * @param {string} message The error message.
896
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
897
+ * @param {Object} [config] The config.
898
+ * @param {Object} [request] The request.
899
+ * @param {Object} [response] The response.
900
+ *
901
+ * @returns {Error} The created error.
902
+ */
903
+ function AxiosError(message, code, config, request, response) {
904
+ Error.call(this);
905
+
906
+ if (Error.captureStackTrace) {
907
+ Error.captureStackTrace(this, this.constructor);
908
+ } else {
909
+ this.stack = (new Error()).stack;
910
+ }
911
+
912
+ this.message = message;
913
+ this.name = 'AxiosError';
914
+ code && (this.code = code);
915
+ config && (this.config = config);
916
+ request && (this.request = request);
917
+ response && (this.response = response);
918
+ }
919
+
920
+ utils$1.inherits(AxiosError, Error, {
921
+ toJSON: function toJSON() {
922
+ return {
923
+ // Standard
924
+ message: this.message,
925
+ name: this.name,
926
+ // Microsoft
927
+ description: this.description,
928
+ number: this.number,
929
+ // Mozilla
930
+ fileName: this.fileName,
931
+ lineNumber: this.lineNumber,
932
+ columnNumber: this.columnNumber,
933
+ stack: this.stack,
934
+ // Axios
935
+ config: utils$1.toJSONObject(this.config),
936
+ code: this.code,
937
+ status: this.response && this.response.status ? this.response.status : null
938
+ };
939
+ }
940
+ });
941
+
942
+ const prototype$1 = AxiosError.prototype;
943
+ const descriptors = {};
944
+
945
+ [
946
+ 'ERR_BAD_OPTION_VALUE',
947
+ 'ERR_BAD_OPTION',
948
+ 'ECONNABORTED',
949
+ 'ETIMEDOUT',
950
+ 'ERR_NETWORK',
951
+ 'ERR_FR_TOO_MANY_REDIRECTS',
952
+ 'ERR_DEPRECATED',
953
+ 'ERR_BAD_RESPONSE',
954
+ 'ERR_BAD_REQUEST',
955
+ 'ERR_CANCELED',
956
+ 'ERR_NOT_SUPPORT',
957
+ 'ERR_INVALID_URL'
958
+ // eslint-disable-next-line func-names
959
+ ].forEach(code => {
960
+ descriptors[code] = {value: code};
961
+ });
962
+
963
+ Object.defineProperties(AxiosError, descriptors);
964
+ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
965
+
966
+ // eslint-disable-next-line func-names
967
+ AxiosError.from = (error, code, config, request, response, customProps) => {
968
+ const axiosError = Object.create(prototype$1);
969
+
970
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
971
+ return obj !== Error.prototype;
972
+ }, prop => {
973
+ return prop !== 'isAxiosError';
974
+ });
975
+
976
+ AxiosError.call(axiosError, error.message, code, config, request, response);
977
+
978
+ axiosError.cause = error;
979
+
980
+ axiosError.name = error.name;
981
+
982
+ customProps && Object.assign(axiosError, customProps);
983
+
984
+ return axiosError;
985
+ };
986
+
987
+ /* Injected with object hook! */
988
+
989
+ // eslint-disable-next-line strict
990
+ const httpAdapter = null;
991
+
992
+ /* Injected with object hook! */
993
+
994
+ /**
995
+ * Determines if the given thing is a array or js object.
996
+ *
997
+ * @param {string} thing - The object or array to be visited.
998
+ *
999
+ * @returns {boolean}
1000
+ */
1001
+ function isVisitable(thing) {
1002
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
1003
+ }
1004
+
1005
+ /**
1006
+ * It removes the brackets from the end of a string
1007
+ *
1008
+ * @param {string} key - The key of the parameter.
1009
+ *
1010
+ * @returns {string} the key without the brackets.
1011
+ */
1012
+ function removeBrackets(key) {
1013
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
1014
+ }
1015
+
1016
+ /**
1017
+ * It takes a path, a key, and a boolean, and returns a string
1018
+ *
1019
+ * @param {string} path - The path to the current key.
1020
+ * @param {string} key - The key of the current object being iterated over.
1021
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
1022
+ *
1023
+ * @returns {string} The path to the current key.
1024
+ */
1025
+ function renderKey(path, key, dots) {
1026
+ if (!path) return key;
1027
+ return path.concat(key).map(function each(token, i) {
1028
+ // eslint-disable-next-line no-param-reassign
1029
+ token = removeBrackets(token);
1030
+ return !dots && i ? '[' + token + ']' : token;
1031
+ }).join(dots ? '.' : '');
1032
+ }
1033
+
1034
+ /**
1035
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
1036
+ *
1037
+ * @param {Array<any>} arr - The array to check
1038
+ *
1039
+ * @returns {boolean}
1040
+ */
1041
+ function isFlatArray(arr) {
1042
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
1043
+ }
1044
+
1045
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
1046
+ return /^is[A-Z]/.test(prop);
1047
+ });
1048
+
1049
+ /**
1050
+ * Convert a data object to FormData
1051
+ *
1052
+ * @param {Object} obj
1053
+ * @param {?Object} [formData]
1054
+ * @param {?Object} [options]
1055
+ * @param {Function} [options.visitor]
1056
+ * @param {Boolean} [options.metaTokens = true]
1057
+ * @param {Boolean} [options.dots = false]
1058
+ * @param {?Boolean} [options.indexes = false]
1059
+ *
1060
+ * @returns {Object}
1061
+ **/
1062
+
1063
+ /**
1064
+ * It converts an object into a FormData object
1065
+ *
1066
+ * @param {Object<any, any>} obj - The object to convert to form data.
1067
+ * @param {string} formData - The FormData object to append to.
1068
+ * @param {Object<string, any>} options
1069
+ *
1070
+ * @returns
1071
+ */
1072
+ function toFormData(obj, formData, options) {
1073
+ if (!utils$1.isObject(obj)) {
1074
+ throw new TypeError('target must be an object');
1075
+ }
1076
+
1077
+ // eslint-disable-next-line no-param-reassign
1078
+ formData = formData || new (FormData)();
1079
+
1080
+ // eslint-disable-next-line no-param-reassign
1081
+ options = utils$1.toFlatObject(options, {
1082
+ metaTokens: true,
1083
+ dots: false,
1084
+ indexes: false
1085
+ }, false, function defined(option, source) {
1086
+ // eslint-disable-next-line no-eq-null,eqeqeq
1087
+ return !utils$1.isUndefined(source[option]);
1088
+ });
1089
+
1090
+ const metaTokens = options.metaTokens;
1091
+ // eslint-disable-next-line no-use-before-define
1092
+ const visitor = options.visitor || defaultVisitor;
1093
+ const dots = options.dots;
1094
+ const indexes = options.indexes;
1095
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
1096
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
1097
+
1098
+ if (!utils$1.isFunction(visitor)) {
1099
+ throw new TypeError('visitor must be a function');
1100
+ }
1101
+
1102
+ function convertValue(value) {
1103
+ if (value === null) return '';
1104
+
1105
+ if (utils$1.isDate(value)) {
1106
+ return value.toISOString();
1107
+ }
1108
+
1109
+ if (!useBlob && utils$1.isBlob(value)) {
1110
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
1111
+ }
1112
+
1113
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
1114
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
1115
+ }
1116
+
1117
+ return value;
1118
+ }
1119
+
1120
+ /**
1121
+ * Default visitor.
1122
+ *
1123
+ * @param {*} value
1124
+ * @param {String|Number} key
1125
+ * @param {Array<String|Number>} path
1126
+ * @this {FormData}
1127
+ *
1128
+ * @returns {boolean} return true to visit the each prop of the value recursively
1129
+ */
1130
+ function defaultVisitor(value, key, path) {
1131
+ let arr = value;
1132
+
1133
+ if (value && !path && typeof value === 'object') {
1134
+ if (utils$1.endsWith(key, '{}')) {
1135
+ // eslint-disable-next-line no-param-reassign
1136
+ key = metaTokens ? key : key.slice(0, -2);
1137
+ // eslint-disable-next-line no-param-reassign
1138
+ value = JSON.stringify(value);
1139
+ } else if (
1140
+ (utils$1.isArray(value) && isFlatArray(value)) ||
1141
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
1142
+ )) {
1143
+ // eslint-disable-next-line no-param-reassign
1144
+ key = removeBrackets(key);
1145
+
1146
+ arr.forEach(function each(el, index) {
1147
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
1148
+ // eslint-disable-next-line no-nested-ternary
1149
+ indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
1150
+ convertValue(el)
1151
+ );
1152
+ });
1153
+ return false;
1154
+ }
1155
+ }
1156
+
1157
+ if (isVisitable(value)) {
1158
+ return true;
1159
+ }
1160
+
1161
+ formData.append(renderKey(path, key, dots), convertValue(value));
1162
+
1163
+ return false;
1164
+ }
1165
+
1166
+ const stack = [];
1167
+
1168
+ const exposedHelpers = Object.assign(predicates, {
1169
+ defaultVisitor,
1170
+ convertValue,
1171
+ isVisitable
1172
+ });
1173
+
1174
+ function build(value, path) {
1175
+ if (utils$1.isUndefined(value)) return;
1176
+
1177
+ if (stack.indexOf(value) !== -1) {
1178
+ throw Error('Circular reference detected in ' + path.join('.'));
1179
+ }
1180
+
1181
+ stack.push(value);
1182
+
1183
+ utils$1.forEach(value, function each(el, key) {
1184
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
1185
+ formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
1186
+ );
1187
+
1188
+ if (result === true) {
1189
+ build(el, path ? path.concat(key) : [key]);
1190
+ }
1191
+ });
1192
+
1193
+ stack.pop();
1194
+ }
1195
+
1196
+ if (!utils$1.isObject(obj)) {
1197
+ throw new TypeError('data must be an object');
1198
+ }
1199
+
1200
+ build(obj);
1201
+
1202
+ return formData;
1203
+ }
1204
+
1205
+ /* Injected with object hook! */
1206
+
1207
+ /**
1208
+ * It encodes a string by replacing all characters that are not in the unreserved set with
1209
+ * their percent-encoded equivalents
1210
+ *
1211
+ * @param {string} str - The string to encode.
1212
+ *
1213
+ * @returns {string} The encoded string.
1214
+ */
1215
+ function encode$1(str) {
1216
+ const charMap = {
1217
+ '!': '%21',
1218
+ "'": '%27',
1219
+ '(': '%28',
1220
+ ')': '%29',
1221
+ '~': '%7E',
1222
+ '%20': '+',
1223
+ '%00': '\x00'
1224
+ };
1225
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
1226
+ return charMap[match];
1227
+ });
1228
+ }
1229
+
1230
+ /**
1231
+ * It takes a params object and converts it to a FormData object
1232
+ *
1233
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
1234
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1235
+ *
1236
+ * @returns {void}
1237
+ */
1238
+ function AxiosURLSearchParams(params, options) {
1239
+ this._pairs = [];
1240
+
1241
+ params && toFormData(params, this, options);
1242
+ }
1243
+
1244
+ const prototype = AxiosURLSearchParams.prototype;
1245
+
1246
+ prototype.append = function append(name, value) {
1247
+ this._pairs.push([name, value]);
1248
+ };
1249
+
1250
+ prototype.toString = function toString(encoder) {
1251
+ const _encode = encoder ? function(value) {
1252
+ return encoder.call(this, value, encode$1);
1253
+ } : encode$1;
1254
+
1255
+ return this._pairs.map(function each(pair) {
1256
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
1257
+ }, '').join('&');
1258
+ };
1259
+
1260
+ /* Injected with object hook! */
1261
+
1262
+ /**
1263
+ * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
1264
+ * URI encoded counterparts
1265
+ *
1266
+ * @param {string} val The value to be encoded.
1267
+ *
1268
+ * @returns {string} The encoded value.
1269
+ */
1270
+ function encode(val) {
1271
+ return encodeURIComponent(val).
1272
+ replace(/%3A/gi, ':').
1273
+ replace(/%24/g, '$').
1274
+ replace(/%2C/gi, ',').
1275
+ replace(/%20/g, '+').
1276
+ replace(/%5B/gi, '[').
1277
+ replace(/%5D/gi, ']');
1278
+ }
1279
+
1280
+ /**
1281
+ * Build a URL by appending params to the end
1282
+ *
1283
+ * @param {string} url The base of the url (e.g., http://www.google.com)
1284
+ * @param {object} [params] The params to be appended
1285
+ * @param {?object} options
1286
+ *
1287
+ * @returns {string} The formatted url
1288
+ */
1289
+ function buildURL(url, params, options) {
1290
+ /*eslint no-param-reassign:0*/
1291
+ if (!params) {
1292
+ return url;
1293
+ }
1294
+
1295
+ const _encode = options && options.encode || encode;
1296
+
1297
+ const serializeFn = options && options.serialize;
1298
+
1299
+ let serializedParams;
1300
+
1301
+ if (serializeFn) {
1302
+ serializedParams = serializeFn(params, options);
1303
+ } else {
1304
+ serializedParams = utils$1.isURLSearchParams(params) ?
1305
+ params.toString() :
1306
+ new AxiosURLSearchParams(params, options).toString(_encode);
1307
+ }
1308
+
1309
+ if (serializedParams) {
1310
+ const hashmarkIndex = url.indexOf("#");
1311
+
1312
+ if (hashmarkIndex !== -1) {
1313
+ url = url.slice(0, hashmarkIndex);
1314
+ }
1315
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1316
+ }
1317
+
1318
+ return url;
1319
+ }
1320
+
1321
+ /* Injected with object hook! */
1322
+
1323
+ class InterceptorManager {
1324
+ constructor() {
1325
+ this.handlers = [];
1326
+ }
1327
+
1328
+ /**
1329
+ * Add a new interceptor to the stack
1330
+ *
1331
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
1332
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
1333
+ *
1334
+ * @return {Number} An ID used to remove interceptor later
1335
+ */
1336
+ use(fulfilled, rejected, options) {
1337
+ this.handlers.push({
1338
+ fulfilled,
1339
+ rejected,
1340
+ synchronous: options ? options.synchronous : false,
1341
+ runWhen: options ? options.runWhen : null
1342
+ });
1343
+ return this.handlers.length - 1;
1344
+ }
1345
+
1346
+ /**
1347
+ * Remove an interceptor from the stack
1348
+ *
1349
+ * @param {Number} id The ID that was returned by `use`
1350
+ *
1351
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
1352
+ */
1353
+ eject(id) {
1354
+ if (this.handlers[id]) {
1355
+ this.handlers[id] = null;
1356
+ }
1357
+ }
1358
+
1359
+ /**
1360
+ * Clear all interceptors from the stack
1361
+ *
1362
+ * @returns {void}
1363
+ */
1364
+ clear() {
1365
+ if (this.handlers) {
1366
+ this.handlers = [];
1367
+ }
1368
+ }
1369
+
1370
+ /**
1371
+ * Iterate over all the registered interceptors
1372
+ *
1373
+ * This method is particularly useful for skipping over any
1374
+ * interceptors that may have become `null` calling `eject`.
1375
+ *
1376
+ * @param {Function} fn The function to call for each interceptor
1377
+ *
1378
+ * @returns {void}
1379
+ */
1380
+ forEach(fn) {
1381
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
1382
+ if (h !== null) {
1383
+ fn(h);
1384
+ }
1385
+ });
1386
+ }
1387
+ }
1388
+
1389
+ /* Injected with object hook! */
1390
+
1391
+ const transitionalDefaults = {
1392
+ silentJSONParsing: true,
1393
+ forcedJSONParsing: true,
1394
+ clarifyTimeoutError: false
1395
+ };
1396
+
1397
+ /* Injected with object hook! */
1398
+
1399
+ const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
1400
+
1401
+ /* Injected with object hook! */
1402
+
1403
+ const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
1404
+
1405
+ /* Injected with object hook! */
1406
+
1407
+ const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
1408
+
1409
+ /* Injected with object hook! */
1410
+
1411
+ const platform$1 = {
1412
+ isBrowser: true,
1413
+ classes: {
1414
+ URLSearchParams: URLSearchParams$1,
1415
+ FormData: FormData$1,
1416
+ Blob: Blob$1
1417
+ },
1418
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
1419
+ };
1420
+
1421
+ /* Injected with object hook! */
1422
+
1423
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1424
+
1425
+ /**
1426
+ * Determine if we're running in a standard browser environment
1427
+ *
1428
+ * This allows axios to run in a web worker, and react-native.
1429
+ * Both environments support XMLHttpRequest, but not fully standard globals.
1430
+ *
1431
+ * web workers:
1432
+ * typeof window -> undefined
1433
+ * typeof document -> undefined
1434
+ *
1435
+ * react-native:
1436
+ * navigator.product -> 'ReactNative'
1437
+ * nativescript
1438
+ * navigator.product -> 'NativeScript' or 'NS'
1439
+ *
1440
+ * @returns {boolean}
1441
+ */
1442
+ const hasStandardBrowserEnv = (
1443
+ (product) => {
1444
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
1445
+ })(typeof navigator !== 'undefined' && navigator.product);
1446
+
1447
+ /**
1448
+ * Determine if we're running in a standard browser webWorker environment
1449
+ *
1450
+ * Although the `isStandardBrowserEnv` method indicates that
1451
+ * `allows axios to run in a web worker`, the WebWorker will still be
1452
+ * filtered out due to its judgment standard
1453
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
1454
+ * This leads to a problem when axios post `FormData` in webWorker
1455
+ */
1456
+ const hasStandardBrowserWebWorkerEnv = (() => {
1457
+ return (
1458
+ typeof WorkerGlobalScope !== 'undefined' &&
1459
+ // eslint-disable-next-line no-undef
1460
+ self instanceof WorkerGlobalScope &&
1461
+ typeof self.importScripts === 'function'
1462
+ );
1463
+ })();
1464
+
1465
+ /* Injected with object hook! */
1466
+
1467
+ const utils = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1468
+ __proto__: null,
1469
+ hasBrowserEnv,
1470
+ hasStandardBrowserEnv,
1471
+ hasStandardBrowserWebWorkerEnv
1472
+ }, Symbol.toStringTag, { value: 'Module' }));
1473
+
1474
+ const platform = {
1475
+ ...utils,
1476
+ ...platform$1
1477
+ };
1478
+
1479
+ /* Injected with object hook! */
1480
+
1481
+ function toURLEncodedForm(data, options) {
1482
+ return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
1483
+ visitor: function(value, key, path, helpers) {
1484
+ if (platform.isNode && utils$1.isBuffer(value)) {
1485
+ this.append(key, value.toString('base64'));
1486
+ return false;
1487
+ }
1488
+
1489
+ return helpers.defaultVisitor.apply(this, arguments);
1490
+ }
1491
+ }, options));
1492
+ }
1493
+
1494
+ /* Injected with object hook! */
1495
+
1496
+ /**
1497
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
1498
+ *
1499
+ * @param {string} name - The name of the property to get.
1500
+ *
1501
+ * @returns An array of strings.
1502
+ */
1503
+ function parsePropPath(name) {
1504
+ // foo[x][y][z]
1505
+ // foo.x.y.z
1506
+ // foo-x-y-z
1507
+ // foo x y z
1508
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
1509
+ return match[0] === '[]' ? '' : match[1] || match[0];
1510
+ });
1511
+ }
1512
+
1513
+ /**
1514
+ * Convert an array to an object.
1515
+ *
1516
+ * @param {Array<any>} arr - The array to convert to an object.
1517
+ *
1518
+ * @returns An object with the same keys and values as the array.
1519
+ */
1520
+ function arrayToObject(arr) {
1521
+ const obj = {};
1522
+ const keys = Object.keys(arr);
1523
+ let i;
1524
+ const len = keys.length;
1525
+ let key;
1526
+ for (i = 0; i < len; i++) {
1527
+ key = keys[i];
1528
+ obj[key] = arr[key];
1529
+ }
1530
+ return obj;
1531
+ }
1532
+
1533
+ /**
1534
+ * It takes a FormData object and returns a JavaScript object
1535
+ *
1536
+ * @param {string} formData The FormData object to convert to JSON.
1537
+ *
1538
+ * @returns {Object<string, any> | null} The converted object.
1539
+ */
1540
+ function formDataToJSON(formData) {
1541
+ function buildPath(path, value, target, index) {
1542
+ let name = path[index++];
1543
+
1544
+ if (name === '__proto__') return true;
1545
+
1546
+ const isNumericKey = Number.isFinite(+name);
1547
+ const isLast = index >= path.length;
1548
+ name = !name && utils$1.isArray(target) ? target.length : name;
1549
+
1550
+ if (isLast) {
1551
+ if (utils$1.hasOwnProp(target, name)) {
1552
+ target[name] = [target[name], value];
1553
+ } else {
1554
+ target[name] = value;
1555
+ }
1556
+
1557
+ return !isNumericKey;
1558
+ }
1559
+
1560
+ if (!target[name] || !utils$1.isObject(target[name])) {
1561
+ target[name] = [];
1562
+ }
1563
+
1564
+ const result = buildPath(path, value, target[name], index);
1565
+
1566
+ if (result && utils$1.isArray(target[name])) {
1567
+ target[name] = arrayToObject(target[name]);
1568
+ }
1569
+
1570
+ return !isNumericKey;
1571
+ }
1572
+
1573
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
1574
+ const obj = {};
1575
+
1576
+ utils$1.forEachEntry(formData, (name, value) => {
1577
+ buildPath(parsePropPath(name), value, obj, 0);
1578
+ });
1579
+
1580
+ return obj;
1581
+ }
1582
+
1583
+ return null;
1584
+ }
1585
+
1586
+ /* Injected with object hook! */
1587
+
1588
+ /**
1589
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
1590
+ * of the input
1591
+ *
1592
+ * @param {any} rawValue - The value to be stringified.
1593
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
1594
+ * @param {Function} encoder - A function that takes a value and returns a string.
1595
+ *
1596
+ * @returns {string} A stringified version of the rawValue.
1597
+ */
1598
+ function stringifySafely(rawValue, parser, encoder) {
1599
+ if (utils$1.isString(rawValue)) {
1600
+ try {
1601
+ (parser || JSON.parse)(rawValue);
1602
+ return utils$1.trim(rawValue);
1603
+ } catch (e) {
1604
+ if (e.name !== 'SyntaxError') {
1605
+ throw e;
1606
+ }
1607
+ }
1608
+ }
1609
+
1610
+ return (encoder || JSON.stringify)(rawValue);
1611
+ }
1612
+
1613
+ const defaults = {
1614
+
1615
+ transitional: transitionalDefaults,
1616
+
1617
+ adapter: ['xhr', 'http'],
1618
+
1619
+ transformRequest: [function transformRequest(data, headers) {
1620
+ const contentType = headers.getContentType() || '';
1621
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
1622
+ const isObjectPayload = utils$1.isObject(data);
1623
+
1624
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
1625
+ data = new FormData(data);
1626
+ }
1627
+
1628
+ const isFormData = utils$1.isFormData(data);
1629
+
1630
+ if (isFormData) {
1631
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
1632
+ }
1633
+
1634
+ if (utils$1.isArrayBuffer(data) ||
1635
+ utils$1.isBuffer(data) ||
1636
+ utils$1.isStream(data) ||
1637
+ utils$1.isFile(data) ||
1638
+ utils$1.isBlob(data)
1639
+ ) {
1640
+ return data;
1641
+ }
1642
+ if (utils$1.isArrayBufferView(data)) {
1643
+ return data.buffer;
1644
+ }
1645
+ if (utils$1.isURLSearchParams(data)) {
1646
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
1647
+ return data.toString();
1648
+ }
1649
+
1650
+ let isFileList;
1651
+
1652
+ if (isObjectPayload) {
1653
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
1654
+ return toURLEncodedForm(data, this.formSerializer).toString();
1655
+ }
1656
+
1657
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
1658
+ const _FormData = this.env && this.env.FormData;
1659
+
1660
+ return toFormData(
1661
+ isFileList ? {'files[]': data} : data,
1662
+ _FormData && new _FormData(),
1663
+ this.formSerializer
1664
+ );
1665
+ }
1666
+ }
1667
+
1668
+ if (isObjectPayload || hasJSONContentType ) {
1669
+ headers.setContentType('application/json', false);
1670
+ return stringifySafely(data);
1671
+ }
1672
+
1673
+ return data;
1674
+ }],
1675
+
1676
+ transformResponse: [function transformResponse(data) {
1677
+ const transitional = this.transitional || defaults.transitional;
1678
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1679
+ const JSONRequested = this.responseType === 'json';
1680
+
1681
+ if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
1682
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
1683
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
1684
+
1685
+ try {
1686
+ return JSON.parse(data);
1687
+ } catch (e) {
1688
+ if (strictJSONParsing) {
1689
+ if (e.name === 'SyntaxError') {
1690
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
1691
+ }
1692
+ throw e;
1693
+ }
1694
+ }
1695
+ }
1696
+
1697
+ return data;
1698
+ }],
1699
+
1700
+ /**
1701
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
1702
+ * timeout is not created.
1703
+ */
1704
+ timeout: 0,
1705
+
1706
+ xsrfCookieName: 'XSRF-TOKEN',
1707
+ xsrfHeaderName: 'X-XSRF-TOKEN',
1708
+
1709
+ maxContentLength: -1,
1710
+ maxBodyLength: -1,
1711
+
1712
+ env: {
1713
+ FormData: platform.classes.FormData,
1714
+ Blob: platform.classes.Blob
1715
+ },
1716
+
1717
+ validateStatus: function validateStatus(status) {
1718
+ return status >= 200 && status < 300;
1719
+ },
1720
+
1721
+ headers: {
1722
+ common: {
1723
+ 'Accept': 'application/json, text/plain, */*',
1724
+ 'Content-Type': undefined
1725
+ }
1726
+ }
1727
+ };
1728
+
1729
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
1730
+ defaults.headers[method] = {};
1731
+ });
1732
+
1733
+ const defaults$1 = defaults;
1734
+
1735
+ /* Injected with object hook! */
1736
+
1737
+ // RawAxiosHeaders whose duplicates are ignored by node
1738
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
1739
+ const ignoreDuplicateOf = utils$1.toObjectSet([
1740
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
1741
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
1742
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
1743
+ 'referer', 'retry-after', 'user-agent'
1744
+ ]);
1745
+
1746
+ /**
1747
+ * Parse headers into an object
1748
+ *
1749
+ * ```
1750
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
1751
+ * Content-Type: application/json
1752
+ * Connection: keep-alive
1753
+ * Transfer-Encoding: chunked
1754
+ * ```
1755
+ *
1756
+ * @param {String} rawHeaders Headers needing to be parsed
1757
+ *
1758
+ * @returns {Object} Headers parsed into an object
1759
+ */
1760
+ const parseHeaders = rawHeaders => {
1761
+ const parsed = {};
1762
+ let key;
1763
+ let val;
1764
+ let i;
1765
+
1766
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
1767
+ i = line.indexOf(':');
1768
+ key = line.substring(0, i).trim().toLowerCase();
1769
+ val = line.substring(i + 1).trim();
1770
+
1771
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
1772
+ return;
1773
+ }
1774
+
1775
+ if (key === 'set-cookie') {
1776
+ if (parsed[key]) {
1777
+ parsed[key].push(val);
1778
+ } else {
1779
+ parsed[key] = [val];
1780
+ }
1781
+ } else {
1782
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1783
+ }
1784
+ });
1785
+
1786
+ return parsed;
1787
+ };
1788
+
1789
+ /* Injected with object hook! */
1790
+
1791
+ const $internals = Symbol('internals');
1792
+
1793
+ function normalizeHeader(header) {
1794
+ return header && String(header).trim().toLowerCase();
1795
+ }
1796
+
1797
+ function normalizeValue(value) {
1798
+ if (value === false || value == null) {
1799
+ return value;
1800
+ }
1801
+
1802
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
1803
+ }
1804
+
1805
+ function parseTokens(str) {
1806
+ const tokens = Object.create(null);
1807
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1808
+ let match;
1809
+
1810
+ while ((match = tokensRE.exec(str))) {
1811
+ tokens[match[1]] = match[2];
1812
+ }
1813
+
1814
+ return tokens;
1815
+ }
1816
+
1817
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1818
+
1819
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1820
+ if (utils$1.isFunction(filter)) {
1821
+ return filter.call(this, value, header);
1822
+ }
1823
+
1824
+ if (isHeaderNameFilter) {
1825
+ value = header;
1826
+ }
1827
+
1828
+ if (!utils$1.isString(value)) return;
1829
+
1830
+ if (utils$1.isString(filter)) {
1831
+ return value.indexOf(filter) !== -1;
1832
+ }
1833
+
1834
+ if (utils$1.isRegExp(filter)) {
1835
+ return filter.test(value);
1836
+ }
1837
+ }
1838
+
1839
+ function formatHeader(header) {
1840
+ return header.trim()
1841
+ .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1842
+ return char.toUpperCase() + str;
1843
+ });
1844
+ }
1845
+
1846
+ function buildAccessors(obj, header) {
1847
+ const accessorName = utils$1.toCamelCase(' ' + header);
1848
+
1849
+ ['get', 'set', 'has'].forEach(methodName => {
1850
+ Object.defineProperty(obj, methodName + accessorName, {
1851
+ value: function(arg1, arg2, arg3) {
1852
+ return this[methodName].call(this, header, arg1, arg2, arg3);
1853
+ },
1854
+ configurable: true
1855
+ });
1856
+ });
1857
+ }
1858
+
1859
+ class AxiosHeaders {
1860
+ constructor(headers) {
1861
+ headers && this.set(headers);
1862
+ }
1863
+
1864
+ set(header, valueOrRewrite, rewrite) {
1865
+ const self = this;
1866
+
1867
+ function setHeader(_value, _header, _rewrite) {
1868
+ const lHeader = normalizeHeader(_header);
1869
+
1870
+ if (!lHeader) {
1871
+ throw new Error('header name must be a non-empty string');
1872
+ }
1873
+
1874
+ const key = utils$1.findKey(self, lHeader);
1875
+
1876
+ if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
1877
+ self[key || _header] = normalizeValue(_value);
1878
+ }
1879
+ }
1880
+
1881
+ const setHeaders = (headers, _rewrite) =>
1882
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1883
+
1884
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
1885
+ setHeaders(header, valueOrRewrite);
1886
+ } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1887
+ setHeaders(parseHeaders(header), valueOrRewrite);
1888
+ } else {
1889
+ header != null && setHeader(valueOrRewrite, header, rewrite);
1890
+ }
1891
+
1892
+ return this;
1893
+ }
1894
+
1895
+ get(header, parser) {
1896
+ header = normalizeHeader(header);
1897
+
1898
+ if (header) {
1899
+ const key = utils$1.findKey(this, header);
1900
+
1901
+ if (key) {
1902
+ const value = this[key];
1903
+
1904
+ if (!parser) {
1905
+ return value;
1906
+ }
1907
+
1908
+ if (parser === true) {
1909
+ return parseTokens(value);
1910
+ }
1911
+
1912
+ if (utils$1.isFunction(parser)) {
1913
+ return parser.call(this, value, key);
1914
+ }
1915
+
1916
+ if (utils$1.isRegExp(parser)) {
1917
+ return parser.exec(value);
1918
+ }
1919
+
1920
+ throw new TypeError('parser must be boolean|regexp|function');
1921
+ }
1922
+ }
1923
+ }
1924
+
1925
+ has(header, matcher) {
1926
+ header = normalizeHeader(header);
1927
+
1928
+ if (header) {
1929
+ const key = utils$1.findKey(this, header);
1930
+
1931
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1932
+ }
1933
+
1934
+ return false;
1935
+ }
1936
+
1937
+ delete(header, matcher) {
1938
+ const self = this;
1939
+ let deleted = false;
1940
+
1941
+ function deleteHeader(_header) {
1942
+ _header = normalizeHeader(_header);
1943
+
1944
+ if (_header) {
1945
+ const key = utils$1.findKey(self, _header);
1946
+
1947
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
1948
+ delete self[key];
1949
+
1950
+ deleted = true;
1951
+ }
1952
+ }
1953
+ }
1954
+
1955
+ if (utils$1.isArray(header)) {
1956
+ header.forEach(deleteHeader);
1957
+ } else {
1958
+ deleteHeader(header);
1959
+ }
1960
+
1961
+ return deleted;
1962
+ }
1963
+
1964
+ clear(matcher) {
1965
+ const keys = Object.keys(this);
1966
+ let i = keys.length;
1967
+ let deleted = false;
1968
+
1969
+ while (i--) {
1970
+ const key = keys[i];
1971
+ if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1972
+ delete this[key];
1973
+ deleted = true;
1974
+ }
1975
+ }
1976
+
1977
+ return deleted;
1978
+ }
1979
+
1980
+ normalize(format) {
1981
+ const self = this;
1982
+ const headers = {};
1983
+
1984
+ utils$1.forEach(this, (value, header) => {
1985
+ const key = utils$1.findKey(headers, header);
1986
+
1987
+ if (key) {
1988
+ self[key] = normalizeValue(value);
1989
+ delete self[header];
1990
+ return;
1991
+ }
1992
+
1993
+ const normalized = format ? formatHeader(header) : String(header).trim();
1994
+
1995
+ if (normalized !== header) {
1996
+ delete self[header];
1997
+ }
1998
+
1999
+ self[normalized] = normalizeValue(value);
2000
+
2001
+ headers[normalized] = true;
2002
+ });
2003
+
2004
+ return this;
2005
+ }
2006
+
2007
+ concat(...targets) {
2008
+ return this.constructor.concat(this, ...targets);
2009
+ }
2010
+
2011
+ toJSON(asStrings) {
2012
+ const obj = Object.create(null);
2013
+
2014
+ utils$1.forEach(this, (value, header) => {
2015
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
2016
+ });
2017
+
2018
+ return obj;
2019
+ }
2020
+
2021
+ [Symbol.iterator]() {
2022
+ return Object.entries(this.toJSON())[Symbol.iterator]();
2023
+ }
2024
+
2025
+ toString() {
2026
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
2027
+ }
2028
+
2029
+ get [Symbol.toStringTag]() {
2030
+ return 'AxiosHeaders';
2031
+ }
2032
+
2033
+ static from(thing) {
2034
+ return thing instanceof this ? thing : new this(thing);
2035
+ }
2036
+
2037
+ static concat(first, ...targets) {
2038
+ const computed = new this(first);
2039
+
2040
+ targets.forEach((target) => computed.set(target));
2041
+
2042
+ return computed;
2043
+ }
2044
+
2045
+ static accessor(header) {
2046
+ const internals = this[$internals] = (this[$internals] = {
2047
+ accessors: {}
2048
+ });
2049
+
2050
+ const accessors = internals.accessors;
2051
+ const prototype = this.prototype;
2052
+
2053
+ function defineAccessor(_header) {
2054
+ const lHeader = normalizeHeader(_header);
2055
+
2056
+ if (!accessors[lHeader]) {
2057
+ buildAccessors(prototype, _header);
2058
+ accessors[lHeader] = true;
2059
+ }
2060
+ }
2061
+
2062
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
2063
+
2064
+ return this;
2065
+ }
2066
+ }
2067
+
2068
+ AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
2069
+
2070
+ // reserved names hotfix
2071
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2072
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
2073
+ return {
2074
+ get: () => value,
2075
+ set(headerValue) {
2076
+ this[mapped] = headerValue;
2077
+ }
2078
+ }
2079
+ });
2080
+
2081
+ utils$1.freezeMethods(AxiosHeaders);
2082
+
2083
+ const AxiosHeaders$1 = AxiosHeaders;
2084
+
2085
+ /* Injected with object hook! */
2086
+
2087
+ /**
2088
+ * Transform the data for a request or a response
2089
+ *
2090
+ * @param {Array|Function} fns A single function or Array of functions
2091
+ * @param {?Object} response The response object
2092
+ *
2093
+ * @returns {*} The resulting transformed data
2094
+ */
2095
+ function transformData(fns, response) {
2096
+ const config = this || defaults$1;
2097
+ const context = response || config;
2098
+ const headers = AxiosHeaders$1.from(context.headers);
2099
+ let data = context.data;
2100
+
2101
+ utils$1.forEach(fns, function transform(fn) {
2102
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
2103
+ });
2104
+
2105
+ headers.normalize();
2106
+
2107
+ return data;
2108
+ }
2109
+
2110
+ /* Injected with object hook! */
2111
+
2112
+ function isCancel(value) {
2113
+ return !!(value && value.__CANCEL__);
2114
+ }
2115
+
2116
+ /* Injected with object hook! */
2117
+
2118
+ /**
2119
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
2120
+ *
2121
+ * @param {string=} message The message.
2122
+ * @param {Object=} config The config.
2123
+ * @param {Object=} request The request.
2124
+ *
2125
+ * @returns {CanceledError} The created error.
2126
+ */
2127
+ function CanceledError(message, config, request) {
2128
+ // eslint-disable-next-line no-eq-null,eqeqeq
2129
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
2130
+ this.name = 'CanceledError';
2131
+ }
2132
+
2133
+ utils$1.inherits(CanceledError, AxiosError, {
2134
+ __CANCEL__: true
2135
+ });
2136
+
2137
+ /* Injected with object hook! */
2138
+
2139
+ /**
2140
+ * Resolve or reject a Promise based on response status.
2141
+ *
2142
+ * @param {Function} resolve A function that resolves the promise.
2143
+ * @param {Function} reject A function that rejects the promise.
2144
+ * @param {object} response The response.
2145
+ *
2146
+ * @returns {object} The response.
2147
+ */
2148
+ function settle(resolve, reject, response) {
2149
+ const validateStatus = response.config.validateStatus;
2150
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
2151
+ resolve(response);
2152
+ } else {
2153
+ reject(new AxiosError(
2154
+ 'Request failed with status code ' + response.status,
2155
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2156
+ response.config,
2157
+ response.request,
2158
+ response
2159
+ ));
2160
+ }
2161
+ }
2162
+
2163
+ /* Injected with object hook! */
2164
+
2165
+ const cookies = platform.hasStandardBrowserEnv ?
2166
+
2167
+ // Standard browser envs support document.cookie
2168
+ {
2169
+ write(name, value, expires, path, domain, secure) {
2170
+ const cookie = [name + '=' + encodeURIComponent(value)];
2171
+
2172
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
2173
+
2174
+ utils$1.isString(path) && cookie.push('path=' + path);
2175
+
2176
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
2177
+
2178
+ secure === true && cookie.push('secure');
2179
+
2180
+ document.cookie = cookie.join('; ');
2181
+ },
2182
+
2183
+ read(name) {
2184
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
2185
+ return (match ? decodeURIComponent(match[3]) : null);
2186
+ },
2187
+
2188
+ remove(name) {
2189
+ this.write(name, '', Date.now() - 86400000);
2190
+ }
2191
+ }
2192
+
2193
+ :
2194
+
2195
+ // Non-standard browser env (web workers, react-native) lack needed support.
2196
+ {
2197
+ write() {},
2198
+ read() {
2199
+ return null;
2200
+ },
2201
+ remove() {}
2202
+ };
2203
+
2204
+
2205
+ /* Injected with object hook! */
2206
+
2207
+ /**
2208
+ * Determines whether the specified URL is absolute
2209
+ *
2210
+ * @param {string} url The URL to test
2211
+ *
2212
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
2213
+ */
2214
+ function isAbsoluteURL(url) {
2215
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2216
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2217
+ // by any combination of letters, digits, plus, period, or hyphen.
2218
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2219
+ }
2220
+
2221
+ /* Injected with object hook! */
2222
+
2223
+ /**
2224
+ * Creates a new URL by combining the specified URLs
2225
+ *
2226
+ * @param {string} baseURL The base URL
2227
+ * @param {string} relativeURL The relative URL
2228
+ *
2229
+ * @returns {string} The combined URL
2230
+ */
2231
+ function combineURLs(baseURL, relativeURL) {
2232
+ return relativeURL
2233
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
2234
+ : baseURL;
2235
+ }
2236
+
2237
+ /* Injected with object hook! */
2238
+
2239
+ /**
2240
+ * Creates a new URL by combining the baseURL with the requestedURL,
2241
+ * only when the requestedURL is not already an absolute URL.
2242
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
2243
+ *
2244
+ * @param {string} baseURL The base URL
2245
+ * @param {string} requestedURL Absolute or relative URL to combine
2246
+ *
2247
+ * @returns {string} The combined full path
2248
+ */
2249
+ function buildFullPath(baseURL, requestedURL) {
2250
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
2251
+ return combineURLs(baseURL, requestedURL);
2252
+ }
2253
+ return requestedURL;
2254
+ }
2255
+
2256
+ /* Injected with object hook! */
2257
+
2258
+ const isURLSameOrigin = platform.hasStandardBrowserEnv ?
2259
+
2260
+ // Standard browser envs have full support of the APIs needed to test
2261
+ // whether the request URL is of the same origin as current location.
2262
+ (function standardBrowserEnv() {
2263
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
2264
+ const urlParsingNode = document.createElement('a');
2265
+ let originURL;
2266
+
2267
+ /**
2268
+ * Parse a URL to discover its components
2269
+ *
2270
+ * @param {String} url The URL to be parsed
2271
+ * @returns {Object}
2272
+ */
2273
+ function resolveURL(url) {
2274
+ let href = url;
2275
+
2276
+ if (msie) {
2277
+ // IE needs attribute set twice to normalize properties
2278
+ urlParsingNode.setAttribute('href', href);
2279
+ href = urlParsingNode.href;
2280
+ }
2281
+
2282
+ urlParsingNode.setAttribute('href', href);
2283
+
2284
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
2285
+ return {
2286
+ href: urlParsingNode.href,
2287
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
2288
+ host: urlParsingNode.host,
2289
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
2290
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
2291
+ hostname: urlParsingNode.hostname,
2292
+ port: urlParsingNode.port,
2293
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
2294
+ urlParsingNode.pathname :
2295
+ '/' + urlParsingNode.pathname
2296
+ };
2297
+ }
2298
+
2299
+ originURL = resolveURL(window.location.href);
2300
+
2301
+ /**
2302
+ * Determine if a URL shares the same origin as the current location
2303
+ *
2304
+ * @param {String} requestURL The URL to test
2305
+ * @returns {boolean} True if URL shares the same origin, otherwise false
2306
+ */
2307
+ return function isURLSameOrigin(requestURL) {
2308
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
2309
+ return (parsed.protocol === originURL.protocol &&
2310
+ parsed.host === originURL.host);
2311
+ };
2312
+ })() :
2313
+
2314
+ // Non standard browser envs (web workers, react-native) lack needed support.
2315
+ (function nonStandardBrowserEnv() {
2316
+ return function isURLSameOrigin() {
2317
+ return true;
2318
+ };
2319
+ })();
2320
+
2321
+ /* Injected with object hook! */
2322
+
2323
+ function parseProtocol(url) {
2324
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2325
+ return match && match[1] || '';
2326
+ }
2327
+
2328
+ /* Injected with object hook! */
2329
+
2330
+ /**
2331
+ * Calculate data maxRate
2332
+ * @param {Number} [samplesCount= 10]
2333
+ * @param {Number} [min= 1000]
2334
+ * @returns {Function}
2335
+ */
2336
+ function speedometer(samplesCount, min) {
2337
+ samplesCount = samplesCount || 10;
2338
+ const bytes = new Array(samplesCount);
2339
+ const timestamps = new Array(samplesCount);
2340
+ let head = 0;
2341
+ let tail = 0;
2342
+ let firstSampleTS;
2343
+
2344
+ min = min !== undefined ? min : 1000;
2345
+
2346
+ return function push(chunkLength) {
2347
+ const now = Date.now();
2348
+
2349
+ const startedAt = timestamps[tail];
2350
+
2351
+ if (!firstSampleTS) {
2352
+ firstSampleTS = now;
2353
+ }
2354
+
2355
+ bytes[head] = chunkLength;
2356
+ timestamps[head] = now;
2357
+
2358
+ let i = tail;
2359
+ let bytesCount = 0;
2360
+
2361
+ while (i !== head) {
2362
+ bytesCount += bytes[i++];
2363
+ i = i % samplesCount;
2364
+ }
2365
+
2366
+ head = (head + 1) % samplesCount;
2367
+
2368
+ if (head === tail) {
2369
+ tail = (tail + 1) % samplesCount;
2370
+ }
2371
+
2372
+ if (now - firstSampleTS < min) {
2373
+ return;
2374
+ }
2375
+
2376
+ const passed = startedAt && now - startedAt;
2377
+
2378
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
2379
+ };
2380
+ }
2381
+
2382
+ /* Injected with object hook! */
2383
+
2384
+ function progressEventReducer(listener, isDownloadStream) {
2385
+ let bytesNotified = 0;
2386
+ const _speedometer = speedometer(50, 250);
2387
+
2388
+ return e => {
2389
+ const loaded = e.loaded;
2390
+ const total = e.lengthComputable ? e.total : undefined;
2391
+ const progressBytes = loaded - bytesNotified;
2392
+ const rate = _speedometer(progressBytes);
2393
+ const inRange = loaded <= total;
2394
+
2395
+ bytesNotified = loaded;
2396
+
2397
+ const data = {
2398
+ loaded,
2399
+ total,
2400
+ progress: total ? (loaded / total) : undefined,
2401
+ bytes: progressBytes,
2402
+ rate: rate ? rate : undefined,
2403
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
2404
+ event: e
2405
+ };
2406
+
2407
+ data[isDownloadStream ? 'download' : 'upload'] = true;
2408
+
2409
+ listener(data);
2410
+ };
2411
+ }
2412
+
2413
+ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
2414
+
2415
+ const xhrAdapter = isXHRAdapterSupported && function (config) {
2416
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
2417
+ let requestData = config.data;
2418
+ const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
2419
+ let {responseType, withXSRFToken} = config;
2420
+ let onCanceled;
2421
+ function done() {
2422
+ if (config.cancelToken) {
2423
+ config.cancelToken.unsubscribe(onCanceled);
2424
+ }
2425
+
2426
+ if (config.signal) {
2427
+ config.signal.removeEventListener('abort', onCanceled);
2428
+ }
2429
+ }
2430
+
2431
+ let contentType;
2432
+
2433
+ if (utils$1.isFormData(requestData)) {
2434
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
2435
+ requestHeaders.setContentType(false); // Let the browser set it
2436
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
2437
+ // fix semicolon duplication issue for ReactNative FormData implementation
2438
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
2439
+ requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
2440
+ }
2441
+ }
2442
+
2443
+ let request = new XMLHttpRequest();
2444
+
2445
+ // HTTP basic authentication
2446
+ if (config.auth) {
2447
+ const username = config.auth.username || '';
2448
+ const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
2449
+ requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
2450
+ }
2451
+
2452
+ const fullPath = buildFullPath(config.baseURL, config.url);
2453
+
2454
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
2455
+
2456
+ // Set the request timeout in MS
2457
+ request.timeout = config.timeout;
2458
+
2459
+ function onloadend() {
2460
+ if (!request) {
2461
+ return;
2462
+ }
2463
+ // Prepare the response
2464
+ const responseHeaders = AxiosHeaders$1.from(
2465
+ 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
2466
+ );
2467
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
2468
+ request.responseText : request.response;
2469
+ const response = {
2470
+ data: responseData,
2471
+ status: request.status,
2472
+ statusText: request.statusText,
2473
+ headers: responseHeaders,
2474
+ config,
2475
+ request
2476
+ };
2477
+
2478
+ settle(function _resolve(value) {
2479
+ resolve(value);
2480
+ done();
2481
+ }, function _reject(err) {
2482
+ reject(err);
2483
+ done();
2484
+ }, response);
2485
+
2486
+ // Clean up request
2487
+ request = null;
2488
+ }
2489
+
2490
+ if ('onloadend' in request) {
2491
+ // Use onloadend if available
2492
+ request.onloadend = onloadend;
2493
+ } else {
2494
+ // Listen for ready state to emulate onloadend
2495
+ request.onreadystatechange = function handleLoad() {
2496
+ if (!request || request.readyState !== 4) {
2497
+ return;
2498
+ }
2499
+
2500
+ // The request errored out and we didn't get a response, this will be
2501
+ // handled by onerror instead
2502
+ // With one exception: request that using file: protocol, most browsers
2503
+ // will return status as 0 even though it's a successful request
2504
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
2505
+ return;
2506
+ }
2507
+ // readystate handler is calling before onerror or ontimeout handlers,
2508
+ // so we should call onloadend on the next 'tick'
2509
+ setTimeout(onloadend);
2510
+ };
2511
+ }
2512
+
2513
+ // Handle browser request cancellation (as opposed to a manual cancellation)
2514
+ request.onabort = function handleAbort() {
2515
+ if (!request) {
2516
+ return;
2517
+ }
2518
+
2519
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
2520
+
2521
+ // Clean up request
2522
+ request = null;
2523
+ };
2524
+
2525
+ // Handle low level network errors
2526
+ request.onerror = function handleError() {
2527
+ // Real errors are hidden from us by the browser
2528
+ // onerror should only fire if it's a network error
2529
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
2530
+
2531
+ // Clean up request
2532
+ request = null;
2533
+ };
2534
+
2535
+ // Handle timeout
2536
+ request.ontimeout = function handleTimeout() {
2537
+ let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
2538
+ const transitional = config.transitional || transitionalDefaults;
2539
+ if (config.timeoutErrorMessage) {
2540
+ timeoutErrorMessage = config.timeoutErrorMessage;
2541
+ }
2542
+ reject(new AxiosError(
2543
+ timeoutErrorMessage,
2544
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
2545
+ config,
2546
+ request));
2547
+
2548
+ // Clean up request
2549
+ request = null;
2550
+ };
2551
+
2552
+ // Add xsrf header
2553
+ // This is only done if running in a standard browser environment.
2554
+ // Specifically not if we're in a web worker, or react-native.
2555
+ if(platform.hasStandardBrowserEnv) {
2556
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
2557
+
2558
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
2559
+ // Add xsrf header
2560
+ const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
2561
+
2562
+ if (xsrfValue) {
2563
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
2564
+ }
2565
+ }
2566
+ }
2567
+
2568
+ // Remove Content-Type if data is undefined
2569
+ requestData === undefined && requestHeaders.setContentType(null);
2570
+
2571
+ // Add headers to the request
2572
+ if ('setRequestHeader' in request) {
2573
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
2574
+ request.setRequestHeader(key, val);
2575
+ });
2576
+ }
2577
+
2578
+ // Add withCredentials to request if needed
2579
+ if (!utils$1.isUndefined(config.withCredentials)) {
2580
+ request.withCredentials = !!config.withCredentials;
2581
+ }
2582
+
2583
+ // Add responseType to request if needed
2584
+ if (responseType && responseType !== 'json') {
2585
+ request.responseType = config.responseType;
2586
+ }
2587
+
2588
+ // Handle progress if needed
2589
+ if (typeof config.onDownloadProgress === 'function') {
2590
+ request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
2591
+ }
2592
+
2593
+ // Not all browsers support upload events
2594
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
2595
+ request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
2596
+ }
2597
+
2598
+ if (config.cancelToken || config.signal) {
2599
+ // Handle cancellation
2600
+ // eslint-disable-next-line func-names
2601
+ onCanceled = cancel => {
2602
+ if (!request) {
2603
+ return;
2604
+ }
2605
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
2606
+ request.abort();
2607
+ request = null;
2608
+ };
2609
+
2610
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
2611
+ if (config.signal) {
2612
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
2613
+ }
2614
+ }
2615
+
2616
+ const protocol = parseProtocol(fullPath);
2617
+
2618
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
2619
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
2620
+ return;
2621
+ }
2622
+
2623
+
2624
+ // Send the request
2625
+ request.send(requestData || null);
2626
+ });
2627
+ };
2628
+
2629
+ /* Injected with object hook! */
2630
+
2631
+ const knownAdapters = {
2632
+ http: httpAdapter,
2633
+ xhr: xhrAdapter
2634
+ };
2635
+
2636
+ utils$1.forEach(knownAdapters, (fn, value) => {
2637
+ if (fn) {
2638
+ try {
2639
+ Object.defineProperty(fn, 'name', {value});
2640
+ } catch (e) {
2641
+ // eslint-disable-next-line no-empty
2642
+ }
2643
+ Object.defineProperty(fn, 'adapterName', {value});
2644
+ }
2645
+ });
2646
+
2647
+ const renderReason = (reason) => `- ${reason}`;
2648
+
2649
+ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
2650
+
2651
+ const adapters = {
2652
+ getAdapter: (adapters) => {
2653
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
2654
+
2655
+ const {length} = adapters;
2656
+ let nameOrAdapter;
2657
+ let adapter;
2658
+
2659
+ const rejectedReasons = {};
2660
+
2661
+ for (let i = 0; i < length; i++) {
2662
+ nameOrAdapter = adapters[i];
2663
+ let id;
2664
+
2665
+ adapter = nameOrAdapter;
2666
+
2667
+ if (!isResolvedHandle(nameOrAdapter)) {
2668
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
2669
+
2670
+ if (adapter === undefined) {
2671
+ throw new AxiosError(`Unknown adapter '${id}'`);
2672
+ }
2673
+ }
2674
+
2675
+ if (adapter) {
2676
+ break;
2677
+ }
2678
+
2679
+ rejectedReasons[id || '#' + i] = adapter;
2680
+ }
2681
+
2682
+ if (!adapter) {
2683
+
2684
+ const reasons = Object.entries(rejectedReasons)
2685
+ .map(([id, state]) => `adapter ${id} ` +
2686
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
2687
+ );
2688
+
2689
+ let s = length ?
2690
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
2691
+ 'as no adapter specified';
2692
+
2693
+ throw new AxiosError(
2694
+ `There is no suitable adapter to dispatch the request ` + s,
2695
+ 'ERR_NOT_SUPPORT'
2696
+ );
2697
+ }
2698
+
2699
+ return adapter;
2700
+ },
2701
+ adapters: knownAdapters
2702
+ };
2703
+
2704
+ /* Injected with object hook! */
2705
+
2706
+ /**
2707
+ * Throws a `CanceledError` if cancellation has been requested.
2708
+ *
2709
+ * @param {Object} config The config that is to be used for the request
2710
+ *
2711
+ * @returns {void}
2712
+ */
2713
+ function throwIfCancellationRequested(config) {
2714
+ if (config.cancelToken) {
2715
+ config.cancelToken.throwIfRequested();
2716
+ }
2717
+
2718
+ if (config.signal && config.signal.aborted) {
2719
+ throw new CanceledError(null, config);
2720
+ }
2721
+ }
2722
+
2723
+ /**
2724
+ * Dispatch a request to the server using the configured adapter.
2725
+ *
2726
+ * @param {object} config The config that is to be used for the request
2727
+ *
2728
+ * @returns {Promise} The Promise to be fulfilled
2729
+ */
2730
+ function dispatchRequest(config) {
2731
+ throwIfCancellationRequested(config);
2732
+
2733
+ config.headers = AxiosHeaders$1.from(config.headers);
2734
+
2735
+ // Transform request data
2736
+ config.data = transformData.call(
2737
+ config,
2738
+ config.transformRequest
2739
+ );
2740
+
2741
+ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
2742
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
2743
+ }
2744
+
2745
+ const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
2746
+
2747
+ return adapter(config).then(function onAdapterResolution(response) {
2748
+ throwIfCancellationRequested(config);
2749
+
2750
+ // Transform response data
2751
+ response.data = transformData.call(
2752
+ config,
2753
+ config.transformResponse,
2754
+ response
2755
+ );
2756
+
2757
+ response.headers = AxiosHeaders$1.from(response.headers);
2758
+
2759
+ return response;
2760
+ }, function onAdapterRejection(reason) {
2761
+ if (!isCancel(reason)) {
2762
+ throwIfCancellationRequested(config);
2763
+
2764
+ // Transform response data
2765
+ if (reason && reason.response) {
2766
+ reason.response.data = transformData.call(
2767
+ config,
2768
+ config.transformResponse,
2769
+ reason.response
2770
+ );
2771
+ reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
2772
+ }
2773
+ }
2774
+
2775
+ return Promise.reject(reason);
2776
+ });
2777
+ }
2778
+
2779
+ /* Injected with object hook! */
2780
+
2781
+ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing;
2782
+
2783
+ /**
2784
+ * Config-specific merge-function which creates a new config-object
2785
+ * by merging two configuration objects together.
2786
+ *
2787
+ * @param {Object} config1
2788
+ * @param {Object} config2
2789
+ *
2790
+ * @returns {Object} New object resulting from merging config2 to config1
2791
+ */
2792
+ function mergeConfig(config1, config2) {
2793
+ // eslint-disable-next-line no-param-reassign
2794
+ config2 = config2 || {};
2795
+ const config = {};
2796
+
2797
+ function getMergedValue(target, source, caseless) {
2798
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
2799
+ return utils$1.merge.call({caseless}, target, source);
2800
+ } else if (utils$1.isPlainObject(source)) {
2801
+ return utils$1.merge({}, source);
2802
+ } else if (utils$1.isArray(source)) {
2803
+ return source.slice();
2804
+ }
2805
+ return source;
2806
+ }
2807
+
2808
+ // eslint-disable-next-line consistent-return
2809
+ function mergeDeepProperties(a, b, caseless) {
2810
+ if (!utils$1.isUndefined(b)) {
2811
+ return getMergedValue(a, b, caseless);
2812
+ } else if (!utils$1.isUndefined(a)) {
2813
+ return getMergedValue(undefined, a, caseless);
2814
+ }
2815
+ }
2816
+
2817
+ // eslint-disable-next-line consistent-return
2818
+ function valueFromConfig2(a, b) {
2819
+ if (!utils$1.isUndefined(b)) {
2820
+ return getMergedValue(undefined, b);
2821
+ }
2822
+ }
2823
+
2824
+ // eslint-disable-next-line consistent-return
2825
+ function defaultToConfig2(a, b) {
2826
+ if (!utils$1.isUndefined(b)) {
2827
+ return getMergedValue(undefined, b);
2828
+ } else if (!utils$1.isUndefined(a)) {
2829
+ return getMergedValue(undefined, a);
2830
+ }
2831
+ }
2832
+
2833
+ // eslint-disable-next-line consistent-return
2834
+ function mergeDirectKeys(a, b, prop) {
2835
+ if (prop in config2) {
2836
+ return getMergedValue(a, b);
2837
+ } else if (prop in config1) {
2838
+ return getMergedValue(undefined, a);
2839
+ }
2840
+ }
2841
+
2842
+ const mergeMap = {
2843
+ url: valueFromConfig2,
2844
+ method: valueFromConfig2,
2845
+ data: valueFromConfig2,
2846
+ baseURL: defaultToConfig2,
2847
+ transformRequest: defaultToConfig2,
2848
+ transformResponse: defaultToConfig2,
2849
+ paramsSerializer: defaultToConfig2,
2850
+ timeout: defaultToConfig2,
2851
+ timeoutMessage: defaultToConfig2,
2852
+ withCredentials: defaultToConfig2,
2853
+ withXSRFToken: defaultToConfig2,
2854
+ adapter: defaultToConfig2,
2855
+ responseType: defaultToConfig2,
2856
+ xsrfCookieName: defaultToConfig2,
2857
+ xsrfHeaderName: defaultToConfig2,
2858
+ onUploadProgress: defaultToConfig2,
2859
+ onDownloadProgress: defaultToConfig2,
2860
+ decompress: defaultToConfig2,
2861
+ maxContentLength: defaultToConfig2,
2862
+ maxBodyLength: defaultToConfig2,
2863
+ beforeRedirect: defaultToConfig2,
2864
+ transport: defaultToConfig2,
2865
+ httpAgent: defaultToConfig2,
2866
+ httpsAgent: defaultToConfig2,
2867
+ cancelToken: defaultToConfig2,
2868
+ socketPath: defaultToConfig2,
2869
+ responseEncoding: defaultToConfig2,
2870
+ validateStatus: mergeDirectKeys,
2871
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
2872
+ };
2873
+
2874
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2875
+ const merge = mergeMap[prop] || mergeDeepProperties;
2876
+ const configValue = merge(config1[prop], config2[prop], prop);
2877
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2878
+ });
2879
+
2880
+ return config;
2881
+ }
2882
+
2883
+ /* Injected with object hook! */
2884
+
2885
+ const VERSION = "1.6.7";
2886
+ /* Injected with object hook! */
2887
+
2888
+ const validators$1 = {};
2889
+
2890
+ // eslint-disable-next-line func-names
2891
+ ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
2892
+ validators$1[type] = function validator(thing) {
2893
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
2894
+ };
2895
+ });
2896
+
2897
+ const deprecatedWarnings = {};
2898
+
2899
+ /**
2900
+ * Transitional option validator
2901
+ *
2902
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
2903
+ * @param {string?} version - deprecated version / removed since version
2904
+ * @param {string?} message - some message with additional info
2905
+ *
2906
+ * @returns {function}
2907
+ */
2908
+ validators$1.transitional = function transitional(validator, version, message) {
2909
+ function formatMessage(opt, desc) {
2910
+ return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
2911
+ }
2912
+
2913
+ // eslint-disable-next-line func-names
2914
+ return (value, opt, opts) => {
2915
+ if (validator === false) {
2916
+ throw new AxiosError(
2917
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
2918
+ AxiosError.ERR_DEPRECATED
2919
+ );
2920
+ }
2921
+
2922
+ if (version && !deprecatedWarnings[opt]) {
2923
+ deprecatedWarnings[opt] = true;
2924
+ // eslint-disable-next-line no-console
2925
+ console.warn(
2926
+ formatMessage(
2927
+ opt,
2928
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
2929
+ )
2930
+ );
2931
+ }
2932
+
2933
+ return validator ? validator(value, opt, opts) : true;
2934
+ };
2935
+ };
2936
+
2937
+ /**
2938
+ * Assert object's properties type
2939
+ *
2940
+ * @param {object} options
2941
+ * @param {object} schema
2942
+ * @param {boolean?} allowUnknown
2943
+ *
2944
+ * @returns {object}
2945
+ */
2946
+
2947
+ function assertOptions(options, schema, allowUnknown) {
2948
+ if (typeof options !== 'object') {
2949
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
2950
+ }
2951
+ const keys = Object.keys(options);
2952
+ let i = keys.length;
2953
+ while (i-- > 0) {
2954
+ const opt = keys[i];
2955
+ const validator = schema[opt];
2956
+ if (validator) {
2957
+ const value = options[opt];
2958
+ const result = value === undefined || validator(value, opt, options);
2959
+ if (result !== true) {
2960
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
2961
+ }
2962
+ continue;
2963
+ }
2964
+ if (allowUnknown !== true) {
2965
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
2966
+ }
2967
+ }
2968
+ }
2969
+
2970
+ const validator = {
2971
+ assertOptions,
2972
+ validators: validators$1
2973
+ };
2974
+
2975
+ /* Injected with object hook! */
2976
+
2977
+ const validators = validator.validators;
2978
+
2979
+ /**
2980
+ * Create a new instance of Axios
2981
+ *
2982
+ * @param {Object} instanceConfig The default config for the instance
2983
+ *
2984
+ * @return {Axios} A new instance of Axios
2985
+ */
2986
+ class Axios {
2987
+ constructor(instanceConfig) {
2988
+ this.defaults = instanceConfig;
2989
+ this.interceptors = {
2990
+ request: new InterceptorManager(),
2991
+ response: new InterceptorManager()
2992
+ };
2993
+ }
2994
+
2995
+ /**
2996
+ * Dispatch a request
2997
+ *
2998
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2999
+ * @param {?Object} config
3000
+ *
3001
+ * @returns {Promise} The Promise to be fulfilled
3002
+ */
3003
+ async request(configOrUrl, config) {
3004
+ try {
3005
+ return await this._request(configOrUrl, config);
3006
+ } catch (err) {
3007
+ if (err instanceof Error) {
3008
+ let dummy;
3009
+
3010
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
3011
+
3012
+ // slice off the Error: ... line
3013
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
3014
+
3015
+ if (!err.stack) {
3016
+ err.stack = stack;
3017
+ // match without the 2 top stack lines
3018
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
3019
+ err.stack += '\n' + stack;
3020
+ }
3021
+ }
3022
+
3023
+ throw err;
3024
+ }
3025
+ }
3026
+
3027
+ _request(configOrUrl, config) {
3028
+ /*eslint no-param-reassign:0*/
3029
+ // Allow for axios('example/url'[, config]) a la fetch API
3030
+ if (typeof configOrUrl === 'string') {
3031
+ config = config || {};
3032
+ config.url = configOrUrl;
3033
+ } else {
3034
+ config = configOrUrl || {};
3035
+ }
3036
+
3037
+ config = mergeConfig(this.defaults, config);
3038
+
3039
+ const {transitional, paramsSerializer, headers} = config;
3040
+
3041
+ if (transitional !== undefined) {
3042
+ validator.assertOptions(transitional, {
3043
+ silentJSONParsing: validators.transitional(validators.boolean),
3044
+ forcedJSONParsing: validators.transitional(validators.boolean),
3045
+ clarifyTimeoutError: validators.transitional(validators.boolean)
3046
+ }, false);
3047
+ }
3048
+
3049
+ if (paramsSerializer != null) {
3050
+ if (utils$1.isFunction(paramsSerializer)) {
3051
+ config.paramsSerializer = {
3052
+ serialize: paramsSerializer
3053
+ };
3054
+ } else {
3055
+ validator.assertOptions(paramsSerializer, {
3056
+ encode: validators.function,
3057
+ serialize: validators.function
3058
+ }, true);
3059
+ }
3060
+ }
3061
+
3062
+ // Set config.method
3063
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
3064
+
3065
+ // Flatten headers
3066
+ let contextHeaders = headers && utils$1.merge(
3067
+ headers.common,
3068
+ headers[config.method]
3069
+ );
3070
+
3071
+ headers && utils$1.forEach(
3072
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
3073
+ (method) => {
3074
+ delete headers[method];
3075
+ }
3076
+ );
3077
+
3078
+ config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
3079
+
3080
+ // filter out skipped interceptors
3081
+ const requestInterceptorChain = [];
3082
+ let synchronousRequestInterceptors = true;
3083
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
3084
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
3085
+ return;
3086
+ }
3087
+
3088
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
3089
+
3090
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
3091
+ });
3092
+
3093
+ const responseInterceptorChain = [];
3094
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
3095
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
3096
+ });
3097
+
3098
+ let promise;
3099
+ let i = 0;
3100
+ let len;
3101
+
3102
+ if (!synchronousRequestInterceptors) {
3103
+ const chain = [dispatchRequest.bind(this), undefined];
3104
+ chain.unshift.apply(chain, requestInterceptorChain);
3105
+ chain.push.apply(chain, responseInterceptorChain);
3106
+ len = chain.length;
3107
+
3108
+ promise = Promise.resolve(config);
3109
+
3110
+ while (i < len) {
3111
+ promise = promise.then(chain[i++], chain[i++]);
3112
+ }
3113
+
3114
+ return promise;
3115
+ }
3116
+
3117
+ len = requestInterceptorChain.length;
3118
+
3119
+ let newConfig = config;
3120
+
3121
+ i = 0;
3122
+
3123
+ while (i < len) {
3124
+ const onFulfilled = requestInterceptorChain[i++];
3125
+ const onRejected = requestInterceptorChain[i++];
3126
+ try {
3127
+ newConfig = onFulfilled(newConfig);
3128
+ } catch (error) {
3129
+ onRejected.call(this, error);
3130
+ break;
3131
+ }
3132
+ }
3133
+
3134
+ try {
3135
+ promise = dispatchRequest.call(this, newConfig);
3136
+ } catch (error) {
3137
+ return Promise.reject(error);
3138
+ }
3139
+
3140
+ i = 0;
3141
+ len = responseInterceptorChain.length;
3142
+
3143
+ while (i < len) {
3144
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
3145
+ }
3146
+
3147
+ return promise;
3148
+ }
3149
+
3150
+ getUri(config) {
3151
+ config = mergeConfig(this.defaults, config);
3152
+ const fullPath = buildFullPath(config.baseURL, config.url);
3153
+ return buildURL(fullPath, config.params, config.paramsSerializer);
3154
+ }
3155
+ }
3156
+
3157
+ // Provide aliases for supported request methods
3158
+ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
3159
+ /*eslint func-names:0*/
3160
+ Axios.prototype[method] = function(url, config) {
3161
+ return this.request(mergeConfig(config || {}, {
3162
+ method,
3163
+ url,
3164
+ data: (config || {}).data
3165
+ }));
3166
+ };
3167
+ });
3168
+
3169
+ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
3170
+ /*eslint func-names:0*/
3171
+
3172
+ function generateHTTPMethod(isForm) {
3173
+ return function httpMethod(url, data, config) {
3174
+ return this.request(mergeConfig(config || {}, {
3175
+ method,
3176
+ headers: isForm ? {
3177
+ 'Content-Type': 'multipart/form-data'
3178
+ } : {},
3179
+ url,
3180
+ data
3181
+ }));
3182
+ };
3183
+ }
3184
+
3185
+ Axios.prototype[method] = generateHTTPMethod();
3186
+
3187
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
3188
+ });
3189
+
3190
+ const Axios$1 = Axios;
3191
+
3192
+ /* Injected with object hook! */
3193
+
3194
+ /**
3195
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
3196
+ *
3197
+ * @param {Function} executor The executor function.
3198
+ *
3199
+ * @returns {CancelToken}
3200
+ */
3201
+ class CancelToken {
3202
+ constructor(executor) {
3203
+ if (typeof executor !== 'function') {
3204
+ throw new TypeError('executor must be a function.');
3205
+ }
3206
+
3207
+ let resolvePromise;
3208
+
3209
+ this.promise = new Promise(function promiseExecutor(resolve) {
3210
+ resolvePromise = resolve;
3211
+ });
3212
+
3213
+ const token = this;
3214
+
3215
+ // eslint-disable-next-line func-names
3216
+ this.promise.then(cancel => {
3217
+ if (!token._listeners) return;
3218
+
3219
+ let i = token._listeners.length;
3220
+
3221
+ while (i-- > 0) {
3222
+ token._listeners[i](cancel);
3223
+ }
3224
+ token._listeners = null;
3225
+ });
3226
+
3227
+ // eslint-disable-next-line func-names
3228
+ this.promise.then = onfulfilled => {
3229
+ let _resolve;
3230
+ // eslint-disable-next-line func-names
3231
+ const promise = new Promise(resolve => {
3232
+ token.subscribe(resolve);
3233
+ _resolve = resolve;
3234
+ }).then(onfulfilled);
3235
+
3236
+ promise.cancel = function reject() {
3237
+ token.unsubscribe(_resolve);
3238
+ };
3239
+
3240
+ return promise;
3241
+ };
3242
+
3243
+ executor(function cancel(message, config, request) {
3244
+ if (token.reason) {
3245
+ // Cancellation has already been requested
3246
+ return;
3247
+ }
3248
+
3249
+ token.reason = new CanceledError(message, config, request);
3250
+ resolvePromise(token.reason);
3251
+ });
3252
+ }
3253
+
3254
+ /**
3255
+ * Throws a `CanceledError` if cancellation has been requested.
3256
+ */
3257
+ throwIfRequested() {
3258
+ if (this.reason) {
3259
+ throw this.reason;
3260
+ }
3261
+ }
3262
+
3263
+ /**
3264
+ * Subscribe to the cancel signal
3265
+ */
3266
+
3267
+ subscribe(listener) {
3268
+ if (this.reason) {
3269
+ listener(this.reason);
3270
+ return;
3271
+ }
3272
+
3273
+ if (this._listeners) {
3274
+ this._listeners.push(listener);
3275
+ } else {
3276
+ this._listeners = [listener];
3277
+ }
3278
+ }
3279
+
3280
+ /**
3281
+ * Unsubscribe from the cancel signal
3282
+ */
3283
+
3284
+ unsubscribe(listener) {
3285
+ if (!this._listeners) {
3286
+ return;
3287
+ }
3288
+ const index = this._listeners.indexOf(listener);
3289
+ if (index !== -1) {
3290
+ this._listeners.splice(index, 1);
3291
+ }
3292
+ }
3293
+
3294
+ /**
3295
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
3296
+ * cancels the `CancelToken`.
3297
+ */
3298
+ static source() {
3299
+ let cancel;
3300
+ const token = new CancelToken(function executor(c) {
3301
+ cancel = c;
3302
+ });
3303
+ return {
3304
+ token,
3305
+ cancel
3306
+ };
3307
+ }
3308
+ }
3309
+
3310
+ const CancelToken$1 = CancelToken;
3311
+
3312
+ /* Injected with object hook! */
3313
+
3314
+ /**
3315
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
3316
+ *
3317
+ * Common use case would be to use `Function.prototype.apply`.
3318
+ *
3319
+ * ```js
3320
+ * function f(x, y, z) {}
3321
+ * var args = [1, 2, 3];
3322
+ * f.apply(null, args);
3323
+ * ```
3324
+ *
3325
+ * With `spread` this example can be re-written.
3326
+ *
3327
+ * ```js
3328
+ * spread(function(x, y, z) {})([1, 2, 3]);
3329
+ * ```
3330
+ *
3331
+ * @param {Function} callback
3332
+ *
3333
+ * @returns {Function}
3334
+ */
3335
+ function spread(callback) {
3336
+ return function wrap(arr) {
3337
+ return callback.apply(null, arr);
3338
+ };
3339
+ }
3340
+
3341
+ /* Injected with object hook! */
3342
+
3343
+ /**
3344
+ * Determines whether the payload is an error thrown by Axios
3345
+ *
3346
+ * @param {*} payload The value to test
3347
+ *
3348
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
3349
+ */
3350
+ function isAxiosError(payload) {
3351
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
3352
+ }
3353
+
3354
+ /* Injected with object hook! */
3355
+
3356
+ const HttpStatusCode = {
3357
+ Continue: 100,
3358
+ SwitchingProtocols: 101,
3359
+ Processing: 102,
3360
+ EarlyHints: 103,
3361
+ Ok: 200,
3362
+ Created: 201,
3363
+ Accepted: 202,
3364
+ NonAuthoritativeInformation: 203,
3365
+ NoContent: 204,
3366
+ ResetContent: 205,
3367
+ PartialContent: 206,
3368
+ MultiStatus: 207,
3369
+ AlreadyReported: 208,
3370
+ ImUsed: 226,
3371
+ MultipleChoices: 300,
3372
+ MovedPermanently: 301,
3373
+ Found: 302,
3374
+ SeeOther: 303,
3375
+ NotModified: 304,
3376
+ UseProxy: 305,
3377
+ Unused: 306,
3378
+ TemporaryRedirect: 307,
3379
+ PermanentRedirect: 308,
3380
+ BadRequest: 400,
3381
+ Unauthorized: 401,
3382
+ PaymentRequired: 402,
3383
+ Forbidden: 403,
3384
+ NotFound: 404,
3385
+ MethodNotAllowed: 405,
3386
+ NotAcceptable: 406,
3387
+ ProxyAuthenticationRequired: 407,
3388
+ RequestTimeout: 408,
3389
+ Conflict: 409,
3390
+ Gone: 410,
3391
+ LengthRequired: 411,
3392
+ PreconditionFailed: 412,
3393
+ PayloadTooLarge: 413,
3394
+ UriTooLong: 414,
3395
+ UnsupportedMediaType: 415,
3396
+ RangeNotSatisfiable: 416,
3397
+ ExpectationFailed: 417,
3398
+ ImATeapot: 418,
3399
+ MisdirectedRequest: 421,
3400
+ UnprocessableEntity: 422,
3401
+ Locked: 423,
3402
+ FailedDependency: 424,
3403
+ TooEarly: 425,
3404
+ UpgradeRequired: 426,
3405
+ PreconditionRequired: 428,
3406
+ TooManyRequests: 429,
3407
+ RequestHeaderFieldsTooLarge: 431,
3408
+ UnavailableForLegalReasons: 451,
3409
+ InternalServerError: 500,
3410
+ NotImplemented: 501,
3411
+ BadGateway: 502,
3412
+ ServiceUnavailable: 503,
3413
+ GatewayTimeout: 504,
3414
+ HttpVersionNotSupported: 505,
3415
+ VariantAlsoNegotiates: 506,
3416
+ InsufficientStorage: 507,
3417
+ LoopDetected: 508,
3418
+ NotExtended: 510,
3419
+ NetworkAuthenticationRequired: 511,
3420
+ };
3421
+
3422
+ Object.entries(HttpStatusCode).forEach(([key, value]) => {
3423
+ HttpStatusCode[value] = key;
3424
+ });
3425
+
3426
+ const HttpStatusCode$1 = HttpStatusCode;
3427
+
3428
+ /* Injected with object hook! */
3429
+
3430
+ /**
3431
+ * Create an instance of Axios
3432
+ *
3433
+ * @param {Object} defaultConfig The default config for the instance
3434
+ *
3435
+ * @returns {Axios} A new instance of Axios
3436
+ */
3437
+ function createInstance(defaultConfig) {
3438
+ const context = new Axios$1(defaultConfig);
3439
+ const instance = bind(Axios$1.prototype.request, context);
3440
+
3441
+ // Copy axios.prototype to instance
3442
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
3443
+
3444
+ // Copy context to instance
3445
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
3446
+
3447
+ // Factory for creating new instances
3448
+ instance.create = function create(instanceConfig) {
3449
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
3450
+ };
3451
+
3452
+ return instance;
3453
+ }
3454
+
3455
+ // Create the default instance to be exported
3456
+ const axios = createInstance(defaults$1);
3457
+
3458
+ // Expose Axios class to allow class inheritance
3459
+ axios.Axios = Axios$1;
3460
+
3461
+ // Expose Cancel & CancelToken
3462
+ axios.CanceledError = CanceledError;
3463
+ axios.CancelToken = CancelToken$1;
3464
+ axios.isCancel = isCancel;
3465
+ axios.VERSION = VERSION;
3466
+ axios.toFormData = toFormData;
3467
+
3468
+ // Expose AxiosError class
3469
+ axios.AxiosError = AxiosError;
3470
+
3471
+ // alias for CanceledError for backward compatibility
3472
+ axios.Cancel = axios.CanceledError;
3473
+
3474
+ // Expose all/spread
3475
+ axios.all = function all(promises) {
3476
+ return Promise.all(promises);
3477
+ };
3478
+
3479
+ axios.spread = spread;
3480
+
3481
+ // Expose isAxiosError
3482
+ axios.isAxiosError = isAxiosError;
3483
+
3484
+ // Expose mergeConfig
3485
+ axios.mergeConfig = mergeConfig;
3486
+
3487
+ axios.AxiosHeaders = AxiosHeaders$1;
3488
+
3489
+ axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
3490
+
3491
+ axios.getAdapter = adapters.getAdapter;
3492
+
3493
+ axios.HttpStatusCode = HttpStatusCode$1;
3494
+
3495
+ axios.default = axios;
3496
+
3497
+ /* Injected with object hook! */
3498
+
3499
+ const LogLevels = {
3500
+ silent: Number.NEGATIVE_INFINITY,
3501
+ fatal: 0,
3502
+ error: 0,
3503
+ warn: 1,
3504
+ log: 2,
3505
+ info: 3,
3506
+ success: 3,
3507
+ fail: 3,
3508
+ ready: 3,
3509
+ start: 3,
3510
+ box: 3,
3511
+ debug: 4,
3512
+ trace: 5,
3513
+ verbose: Number.POSITIVE_INFINITY
3514
+ };
3515
+ const LogTypes = {
3516
+ // Silent
3517
+ silent: {
3518
+ level: -1
3519
+ },
3520
+ // Level 0
3521
+ fatal: {
3522
+ level: LogLevels.fatal
3523
+ },
3524
+ error: {
3525
+ level: LogLevels.error
3526
+ },
3527
+ // Level 1
3528
+ warn: {
3529
+ level: LogLevels.warn
3530
+ },
3531
+ // Level 2
3532
+ log: {
3533
+ level: LogLevels.log
3534
+ },
3535
+ // Level 3
3536
+ info: {
3537
+ level: LogLevels.info
3538
+ },
3539
+ success: {
3540
+ level: LogLevels.success
3541
+ },
3542
+ fail: {
3543
+ level: LogLevels.fail
3544
+ },
3545
+ ready: {
3546
+ level: LogLevels.info
3547
+ },
3548
+ start: {
3549
+ level: LogLevels.info
3550
+ },
3551
+ box: {
3552
+ level: LogLevels.info
3553
+ },
3554
+ // Level 4
3555
+ debug: {
3556
+ level: LogLevels.debug
3557
+ },
3558
+ // Level 5
3559
+ trace: {
3560
+ level: LogLevels.trace
3561
+ },
3562
+ // Verbose
3563
+ verbose: {
3564
+ level: LogLevels.verbose
3565
+ }
3566
+ };
3567
+
3568
+ function isObject(value) {
3569
+ return value !== null && typeof value === "object";
3570
+ }
3571
+ function _defu(baseObject, defaults, namespace = ".", merger) {
3572
+ if (!isObject(defaults)) {
3573
+ return _defu(baseObject, {}, namespace, merger);
3574
+ }
3575
+ const object = Object.assign({}, defaults);
3576
+ for (const key in baseObject) {
3577
+ if (key === "__proto__" || key === "constructor") {
3578
+ continue;
3579
+ }
3580
+ const value = baseObject[key];
3581
+ if (value === null || value === void 0) {
3582
+ continue;
3583
+ }
3584
+ if (merger && merger(object, key, value, namespace)) {
3585
+ continue;
3586
+ }
3587
+ if (Array.isArray(value) && Array.isArray(object[key])) {
3588
+ object[key] = [...value, ...object[key]];
3589
+ } else if (isObject(value) && isObject(object[key])) {
3590
+ object[key] = _defu(
3591
+ value,
3592
+ object[key],
3593
+ (namespace ? `${namespace}.` : "") + key.toString(),
3594
+ merger
3595
+ );
3596
+ } else {
3597
+ object[key] = value;
3598
+ }
3599
+ }
3600
+ return object;
3601
+ }
3602
+ function createDefu(merger) {
3603
+ return (...arguments_) => (
3604
+ // eslint-disable-next-line unicorn/no-array-reduce
3605
+ arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
3606
+ );
3607
+ }
3608
+ const defu = createDefu();
3609
+
3610
+ function isPlainObject(obj) {
3611
+ return Object.prototype.toString.call(obj) === "[object Object]";
3612
+ }
3613
+ function isLogObj(arg) {
3614
+ if (!isPlainObject(arg)) {
3615
+ return false;
3616
+ }
3617
+ if (!arg.message && !arg.args) {
3618
+ return false;
3619
+ }
3620
+ if (arg.stack) {
3621
+ return false;
3622
+ }
3623
+ return true;
3624
+ }
3625
+
3626
+ let paused = false;
3627
+ const queue = [];
3628
+ class Consola {
3629
+ constructor(options = {}) {
3630
+ const types = options.types || LogTypes;
3631
+ this.options = defu(
3632
+ {
3633
+ ...options,
3634
+ defaults: { ...options.defaults },
3635
+ level: _normalizeLogLevel(options.level, types),
3636
+ reporters: [...options.reporters || []]
3637
+ },
3638
+ {
3639
+ types: LogTypes,
3640
+ throttle: 1e3,
3641
+ throttleMin: 5,
3642
+ formatOptions: {
3643
+ date: true,
3644
+ colors: false,
3645
+ compact: true
3646
+ }
3647
+ }
3648
+ );
3649
+ for (const type in types) {
3650
+ const defaults = {
3651
+ type,
3652
+ ...this.options.defaults,
3653
+ ...types[type]
3654
+ };
3655
+ this[type] = this._wrapLogFn(defaults);
3656
+ this[type].raw = this._wrapLogFn(
3657
+ defaults,
3658
+ true
3659
+ );
3660
+ }
3661
+ if (this.options.mockFn) {
3662
+ this.mockTypes();
3663
+ }
3664
+ this._lastLog = {};
3665
+ }
3666
+ get level() {
3667
+ return this.options.level;
3668
+ }
3669
+ set level(level) {
3670
+ this.options.level = _normalizeLogLevel(
3671
+ level,
3672
+ this.options.types,
3673
+ this.options.level
3674
+ );
3675
+ }
3676
+ prompt(message, opts) {
3677
+ if (!this.options.prompt) {
3678
+ throw new Error("prompt is not supported!");
3679
+ }
3680
+ return this.options.prompt(message, opts);
3681
+ }
3682
+ create(options) {
3683
+ const instance = new Consola({
3684
+ ...this.options,
3685
+ ...options
3686
+ });
3687
+ if (this._mockFn) {
3688
+ instance.mockTypes(this._mockFn);
3689
+ }
3690
+ return instance;
3691
+ }
3692
+ withDefaults(defaults) {
3693
+ return this.create({
3694
+ ...this.options,
3695
+ defaults: {
3696
+ ...this.options.defaults,
3697
+ ...defaults
3698
+ }
3699
+ });
3700
+ }
3701
+ withTag(tag) {
3702
+ return this.withDefaults({
3703
+ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
3704
+ });
3705
+ }
3706
+ addReporter(reporter) {
3707
+ this.options.reporters.push(reporter);
3708
+ return this;
3709
+ }
3710
+ removeReporter(reporter) {
3711
+ if (reporter) {
3712
+ const i = this.options.reporters.indexOf(reporter);
3713
+ if (i >= 0) {
3714
+ return this.options.reporters.splice(i, 1);
3715
+ }
3716
+ } else {
3717
+ this.options.reporters.splice(0);
3718
+ }
3719
+ return this;
3720
+ }
3721
+ setReporters(reporters) {
3722
+ this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
3723
+ return this;
3724
+ }
3725
+ wrapAll() {
3726
+ this.wrapConsole();
3727
+ this.wrapStd();
3728
+ }
3729
+ restoreAll() {
3730
+ this.restoreConsole();
3731
+ this.restoreStd();
3732
+ }
3733
+ wrapConsole() {
3734
+ for (const type in this.options.types) {
3735
+ if (!console["__" + type]) {
3736
+ console["__" + type] = console[type];
3737
+ }
3738
+ console[type] = this[type].raw;
3739
+ }
3740
+ }
3741
+ restoreConsole() {
3742
+ for (const type in this.options.types) {
3743
+ if (console["__" + type]) {
3744
+ console[type] = console["__" + type];
3745
+ delete console["__" + type];
3746
+ }
3747
+ }
3748
+ }
3749
+ wrapStd() {
3750
+ this._wrapStream(this.options.stdout, "log");
3751
+ this._wrapStream(this.options.stderr, "log");
3752
+ }
3753
+ _wrapStream(stream, type) {
3754
+ if (!stream) {
3755
+ return;
3756
+ }
3757
+ if (!stream.__write) {
3758
+ stream.__write = stream.write;
3759
+ }
3760
+ stream.write = (data) => {
3761
+ this[type].raw(String(data).trim());
3762
+ };
3763
+ }
3764
+ restoreStd() {
3765
+ this._restoreStream(this.options.stdout);
3766
+ this._restoreStream(this.options.stderr);
3767
+ }
3768
+ _restoreStream(stream) {
3769
+ if (!stream) {
3770
+ return;
3771
+ }
3772
+ if (stream.__write) {
3773
+ stream.write = stream.__write;
3774
+ delete stream.__write;
3775
+ }
3776
+ }
3777
+ pauseLogs() {
3778
+ paused = true;
3779
+ }
3780
+ resumeLogs() {
3781
+ paused = false;
3782
+ const _queue = queue.splice(0);
3783
+ for (const item of _queue) {
3784
+ item[0]._logFn(item[1], item[2]);
3785
+ }
3786
+ }
3787
+ mockTypes(mockFn) {
3788
+ const _mockFn = mockFn || this.options.mockFn;
3789
+ this._mockFn = _mockFn;
3790
+ if (typeof _mockFn !== "function") {
3791
+ return;
3792
+ }
3793
+ for (const type in this.options.types) {
3794
+ this[type] = _mockFn(type, this.options.types[type]) || this[type];
3795
+ this[type].raw = this[type];
3796
+ }
3797
+ }
3798
+ _wrapLogFn(defaults, isRaw) {
3799
+ return (...args) => {
3800
+ if (paused) {
3801
+ queue.push([this, defaults, args, isRaw]);
3802
+ return;
3803
+ }
3804
+ return this._logFn(defaults, args, isRaw);
3805
+ };
3806
+ }
3807
+ _logFn(defaults, args, isRaw) {
3808
+ if ((defaults.level || 0) > this.level) {
3809
+ return false;
3810
+ }
3811
+ const logObj = {
3812
+ date: /* @__PURE__ */ new Date(),
3813
+ args: [],
3814
+ ...defaults,
3815
+ level: _normalizeLogLevel(defaults.level, this.options.types)
3816
+ };
3817
+ if (!isRaw && args.length === 1 && isLogObj(args[0])) {
3818
+ Object.assign(logObj, args[0]);
3819
+ } else {
3820
+ logObj.args = [...args];
3821
+ }
3822
+ if (logObj.message) {
3823
+ logObj.args.unshift(logObj.message);
3824
+ delete logObj.message;
3825
+ }
3826
+ if (logObj.additional) {
3827
+ if (!Array.isArray(logObj.additional)) {
3828
+ logObj.additional = logObj.additional.split("\n");
3829
+ }
3830
+ logObj.args.push("\n" + logObj.additional.join("\n"));
3831
+ delete logObj.additional;
3832
+ }
3833
+ logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
3834
+ logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
3835
+ const resolveLog = (newLog = false) => {
3836
+ const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
3837
+ if (this._lastLog.object && repeated > 0) {
3838
+ const args2 = [...this._lastLog.object.args];
3839
+ if (repeated > 1) {
3840
+ args2.push(`(repeated ${repeated} times)`);
3841
+ }
3842
+ this._log({ ...this._lastLog.object, args: args2 });
3843
+ this._lastLog.count = 1;
3844
+ }
3845
+ if (newLog) {
3846
+ this._lastLog.object = logObj;
3847
+ this._log(logObj);
3848
+ }
3849
+ };
3850
+ clearTimeout(this._lastLog.timeout);
3851
+ const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
3852
+ this._lastLog.time = logObj.date;
3853
+ if (diffTime < this.options.throttle) {
3854
+ try {
3855
+ const serializedLog = JSON.stringify([
3856
+ logObj.type,
3857
+ logObj.tag,
3858
+ logObj.args
3859
+ ]);
3860
+ const isSameLog = this._lastLog.serialized === serializedLog;
3861
+ this._lastLog.serialized = serializedLog;
3862
+ if (isSameLog) {
3863
+ this._lastLog.count = (this._lastLog.count || 0) + 1;
3864
+ if (this._lastLog.count > this.options.throttleMin) {
3865
+ this._lastLog.timeout = setTimeout(
3866
+ resolveLog,
3867
+ this.options.throttle
3868
+ );
3869
+ return;
3870
+ }
3871
+ }
3872
+ } catch {
3873
+ }
3874
+ }
3875
+ resolveLog(true);
3876
+ }
3877
+ _log(logObj) {
3878
+ for (const reporter of this.options.reporters) {
3879
+ reporter.log(logObj, {
3880
+ options: this.options
3881
+ });
3882
+ }
3883
+ }
3884
+ }
3885
+ function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
3886
+ if (input === void 0) {
3887
+ return defaultLevel;
3888
+ }
3889
+ if (typeof input === "number") {
3890
+ return input;
3891
+ }
3892
+ if (types[input] && types[input].level !== void 0) {
3893
+ return types[input].level;
3894
+ }
3895
+ return defaultLevel;
3896
+ }
3897
+ Consola.prototype.add = Consola.prototype.addReporter;
3898
+ Consola.prototype.remove = Consola.prototype.removeReporter;
3899
+ Consola.prototype.clear = Consola.prototype.removeReporter;
3900
+ Consola.prototype.withScope = Consola.prototype.withTag;
3901
+ Consola.prototype.mock = Consola.prototype.mockTypes;
3902
+ Consola.prototype.pause = Consola.prototype.pauseLogs;
3903
+ Consola.prototype.resume = Consola.prototype.resumeLogs;
3904
+ function createConsola$1(options = {}) {
3905
+ return new Consola(options);
3906
+ }
3907
+
3908
+ /* Injected with object hook! */
3909
+
3910
+ class BrowserReporter {
3911
+ constructor(options) {
3912
+ this.options = { ...options };
3913
+ this.defaultColor = "#7f8c8d";
3914
+ this.levelColorMap = {
3915
+ 0: "#c0392b",
3916
+ // Red
3917
+ 1: "#f39c12",
3918
+ // Yellow
3919
+ 3: "#00BCD4"
3920
+ // Cyan
3921
+ };
3922
+ this.typeColorMap = {
3923
+ success: "#2ecc71"
3924
+ // Green
3925
+ };
3926
+ }
3927
+ _getLogFn(level) {
3928
+ if (level < 1) {
3929
+ return console.__error || console.error;
3930
+ }
3931
+ if (level === 1) {
3932
+ return console.__warn || console.warn;
3933
+ }
3934
+ return console.__log || console.log;
3935
+ }
3936
+ log(logObj) {
3937
+ const consoleLogFn = this._getLogFn(logObj.level);
3938
+ const type = logObj.type === "log" ? "" : logObj.type;
3939
+ const tag = logObj.tag || "";
3940
+ const color = this.typeColorMap[logObj.type] || this.levelColorMap[logObj.level] || this.defaultColor;
3941
+ const style = `
3942
+ background: ${color};
3943
+ border-radius: 0.5em;
3944
+ color: white;
3945
+ font-weight: bold;
3946
+ padding: 2px 0.5em;
3947
+ `;
3948
+ const badge = `%c${[tag, type].filter(Boolean).join(":")}`;
3949
+ if (typeof logObj.args[0] === "string") {
3950
+ consoleLogFn(
3951
+ `${badge}%c ${logObj.args[0]}`,
3952
+ style,
3953
+ // Empty string as style resets to default console style
3954
+ "",
3955
+ ...logObj.args.slice(1)
3956
+ );
3957
+ } else {
3958
+ consoleLogFn(badge, style, ...logObj.args);
3959
+ }
3960
+ }
3961
+ }
3962
+
3963
+ function createConsola(options = {}) {
3964
+ const consola2 = createConsola$1({
3965
+ reporters: options.reporters || [new BrowserReporter({})],
3966
+ prompt(message, options2 = {}) {
3967
+ if (options2.type === "confirm") {
3968
+ return Promise.resolve(confirm(message));
3969
+ }
3970
+ return Promise.resolve(prompt(message));
3971
+ },
3972
+ ...options
3973
+ });
3974
+ return consola2;
3975
+ }
3976
+ const consola = createConsola();
3977
+
3978
+ /* Injected with object hook! */
3979
+
3980
+ const _hoisted_1$3 = { key: 0 };
3981
+ const _hoisted_2$3 = /* @__PURE__ */ createBaseVNode("span", { "mr-1": "" }, ":", -1);
3982
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
3983
+ __name: "PageFrontmatter",
3984
+ props: {
3985
+ frontmatter: {}
3986
+ },
3987
+ setup(__props) {
3988
+ const props = __props;
3989
+ const newFm = ref(props.frontmatter);
3990
+ async function saveNewFm() {
3991
+ const res = await axios.post("/valaxy-devtools-api/frontmatter", {
3992
+ pageData: pageData.value,
3993
+ frontmatter: toRaw(newFm.value)
3994
+ });
3995
+ if (res)
3996
+ consola.success("Frontmatter saved");
3997
+ }
3998
+ return (_ctx, _cache) => {
3999
+ const _component_VDTag = __unplugin_components_0;
4000
+ const _component_VDPostCategories = _sfc_main$5;
4001
+ const _component_AGUIInput = _sfc_main$6;
4002
+ const _component_AGUIButton = _sfc_main$7;
4003
+ return openBlock(), createElementBlock("div", null, [
4004
+ _ctx.frontmatter ? (openBlock(), createElementBlock("ul", _hoisted_1$3, [
4005
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.frontmatter, (value, key) => {
4006
+ return openBlock(), createElementBlock("li", { key }, [
4007
+ createBaseVNode("strong", null, toDisplayString(key), 1),
4008
+ _hoisted_2$3,
4009
+ key === "tags" ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(value, (tag) => {
4010
+ return openBlock(), createBlock(_component_VDTag, { key: tag }, {
4011
+ default: withCtx(() => [
4012
+ createTextVNode(toDisplayString(tag), 1)
4013
+ ]),
4014
+ _: 2
4015
+ }, 1024);
4016
+ }), 128)) : key === "categories" ? (openBlock(), createBlock(_component_VDPostCategories, {
4017
+ key: 1,
4018
+ categories: value
4019
+ }, null, 8, ["categories"])) : key === "encryptedContent" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
4020
+ createTextVNode(" [Encrypted] ")
4021
+ ], 64)) : key === "partiallyEncryptedContents" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
4022
+ createTextVNode(" [Partially Encrypted] ")
4023
+ ], 64)) : key === "title" ? (openBlock(), createBlock(_component_AGUIInput, {
4024
+ key: 4,
4025
+ modelValue: newFm.value.title,
4026
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => newFm.value.title = $event)
4027
+ }, null, 8, ["modelValue"])) : (openBlock(), createElementBlock(Fragment, { key: 5 }, [
4028
+ createTextVNode(toDisplayString(value), 1)
4029
+ ], 64))
4030
+ ]);
4031
+ }), 128))
4032
+ ])) : createCommentVNode("", true),
4033
+ createVNode(_component_AGUIButton, { onClick: saveNewFm }, {
4034
+ default: withCtx(() => [
4035
+ createTextVNode(" Save Frontmatter ")
4036
+ ]),
4037
+ _: 1
4038
+ })
4039
+ ]);
4040
+ };
4041
+ }
4042
+ });
4043
+
4044
+ /* Injected with object hook! */
4045
+
4046
+ const _hoisted_1$2 = { p: "2" };
4047
+ const _hoisted_2$2 = {
4048
+ class: "flex",
4049
+ gap: "2",
4050
+ "py-2": ""
4051
+ };
4052
+ const _hoisted_3$2 = /* @__PURE__ */ createBaseVNode("div", { "i-vscode-icons:file-type-vscode": "" }, null, -1);
4053
+ const _hoisted_4 = [
4054
+ _hoisted_3$2
4055
+ ];
4056
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
4057
+ __name: "PostPanel",
4058
+ setup(__props) {
4059
+ function launchEditor() {
4060
+ openInEditor({
4061
+ file: getWindowProperty("$pageData").path
4062
+ });
4063
+ }
4064
+ return (_ctx, _cache) => {
4065
+ const _component_PageFrontmatter = _sfc_main$3;
4066
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
4067
+ createBaseVNode("div", _hoisted_2$2, [
4068
+ createBaseVNode("button", {
4069
+ class: "text-xs shadow transition hover:shadow-lg p-2",
4070
+ onClick: _cache[0] || (_cache[0] = ($event) => launchEditor())
4071
+ }, _hoisted_4)
4072
+ ]),
4073
+ unref(frontmatter) ? (openBlock(), createBlock(_component_PageFrontmatter, {
4074
+ key: 0,
4075
+ frontmatter: unref(frontmatter)
4076
+ }, null, 8, ["frontmatter"])) : createCommentVNode("", true)
4077
+ ]);
4078
+ };
4079
+ }
4080
+ });
4081
+
4082
+ /* Injected with object hook! */
4083
+
4084
+ const _hoisted_1$1 = {
4085
+ class: "h-full",
4086
+ overflow: "auto",
4087
+ pl: "12",
4088
+ pr: "4",
4089
+ py: "4"
4090
+ };
4091
+ const _hoisted_2$1 = { flex: "" };
4092
+ const _hoisted_3$1 = ["onClick"];
4093
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4094
+ __name: "VDPostList",
4095
+ setup(__props) {
4096
+ const postList = ref();
4097
+ onMounted(() => {
4098
+ postList.value = getGlobalValaxyProperty("postList").value;
4099
+ });
4100
+ function onClickPost(post) {
4101
+ devtoolsRouter.value?.push(post.path);
4102
+ }
4103
+ return (_ctx, _cache) => {
4104
+ return openBlock(), createElementBlock("ul", _hoisted_1$1, [
4105
+ (openBlock(true), createElementBlock(Fragment, null, renderList(postList.value, (post) => {
4106
+ return openBlock(), createElementBlock("li", {
4107
+ key: post.path,
4108
+ class: "list-decimal"
4109
+ }, [
4110
+ createBaseVNode("div", _hoisted_2$1, [
4111
+ createBaseVNode("span", {
4112
+ class: normalizeClass(["inline-flex flex-grow cursor-pointer hover:text-blue-500", { "text-blue-500 font-bold": unref(activePath) === post.path }]),
4113
+ onClick: ($event) => onClickPost(post)
4114
+ }, toDisplayString(post.title), 11, _hoisted_3$1)
4115
+ ])
4116
+ ]);
4117
+ }), 128))
4118
+ ]);
4119
+ };
4120
+ }
4121
+ });
4122
+
4123
+ /* Injected with object hook! */
4124
+
4125
+ const M = {
4126
+ name: "splitpanes",
4127
+ emits: ["ready", "resize", "resized", "pane-click", "pane-maximize", "pane-add", "pane-remove", "splitter-click"],
4128
+ props: {
4129
+ horizontal: { type: Boolean },
4130
+ pushOtherPanes: { type: Boolean, default: !0 },
4131
+ dblClickSplitter: { type: Boolean, default: !0 },
4132
+ rtl: { type: Boolean, default: !1 },
4133
+ firstSplitter: { type: Boolean }
4134
+ },
4135
+ provide() {
4136
+ return {
4137
+ requestUpdate: this.requestUpdate,
4138
+ onPaneAdd: this.onPaneAdd,
4139
+ onPaneRemove: this.onPaneRemove,
4140
+ onPaneClick: this.onPaneClick
4141
+ };
4142
+ },
4143
+ data: () => ({
4144
+ container: null,
4145
+ ready: !1,
4146
+ panes: [],
4147
+ touch: {
4148
+ mouseDown: !1,
4149
+ dragging: !1,
4150
+ activeSplitter: null
4151
+ },
4152
+ splitterTaps: {
4153
+ splitter: null,
4154
+ timeoutId: null
4155
+ }
4156
+ }),
4157
+ computed: {
4158
+ panesCount() {
4159
+ return this.panes.length;
4160
+ },
4161
+ indexedPanes() {
4162
+ return this.panes.reduce((e, i) => (e[i.id] = i) && e, {});
4163
+ }
4164
+ },
4165
+ methods: {
4166
+ updatePaneComponents() {
4167
+ this.panes.forEach((e) => {
4168
+ e.update && e.update({
4169
+ [this.horizontal ? "height" : "width"]: `${this.indexedPanes[e.id].size}%`
4170
+ });
4171
+ });
4172
+ },
4173
+ bindEvents() {
4174
+ document.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), document.addEventListener("mouseup", this.onMouseUp), "ontouchstart" in window && (document.addEventListener("touchmove", this.onMouseMove, { passive: !1 }), document.addEventListener("touchend", this.onMouseUp));
4175
+ },
4176
+ unbindEvents() {
4177
+ document.removeEventListener("mousemove", this.onMouseMove, { passive: !1 }), document.removeEventListener("mouseup", this.onMouseUp), "ontouchstart" in window && (document.removeEventListener("touchmove", this.onMouseMove, { passive: !1 }), document.removeEventListener("touchend", this.onMouseUp));
4178
+ },
4179
+ onMouseDown(e, i) {
4180
+ this.bindEvents(), this.touch.mouseDown = !0, this.touch.activeSplitter = i;
4181
+ },
4182
+ onMouseMove(e) {
4183
+ this.touch.mouseDown && (e.preventDefault(), this.touch.dragging = !0, this.calculatePanesSize(this.getCurrentMouseDrag(e)), this.$emit("resize", this.panes.map((i) => ({ min: i.min, max: i.max, size: i.size }))));
4184
+ },
4185
+ onMouseUp() {
4186
+ this.touch.dragging && this.$emit("resized", this.panes.map((e) => ({ min: e.min, max: e.max, size: e.size }))), this.touch.mouseDown = !1, setTimeout(() => {
4187
+ this.touch.dragging = !1, this.unbindEvents();
4188
+ }, 100);
4189
+ },
4190
+ onSplitterClick(e, i) {
4191
+ "ontouchstart" in window && (e.preventDefault(), this.dblClickSplitter && (this.splitterTaps.splitter === i ? (clearTimeout(this.splitterTaps.timeoutId), this.splitterTaps.timeoutId = null, this.onSplitterDblClick(e, i), this.splitterTaps.splitter = null) : (this.splitterTaps.splitter = i, this.splitterTaps.timeoutId = setTimeout(() => {
4192
+ this.splitterTaps.splitter = null;
4193
+ }, 500)))), this.touch.dragging || this.$emit("splitter-click", this.panes[i]);
4194
+ },
4195
+ onSplitterDblClick(e, i) {
4196
+ let s = 0;
4197
+ this.panes = this.panes.map((n, t) => (n.size = t === i ? n.max : n.min, t !== i && (s += n.min), n)), this.panes[i].size -= s, this.$emit("pane-maximize", this.panes[i]), this.$emit("resized", this.panes.map((n) => ({ min: n.min, max: n.max, size: n.size })));
4198
+ },
4199
+ onPaneClick(e, i) {
4200
+ this.$emit("pane-click", this.indexedPanes[i]);
4201
+ },
4202
+ getCurrentMouseDrag(e) {
4203
+ const i = this.container.getBoundingClientRect(), { clientX: s, clientY: n } = "ontouchstart" in window && e.touches ? e.touches[0] : e;
4204
+ return {
4205
+ x: s - i.left,
4206
+ y: n - i.top
4207
+ };
4208
+ },
4209
+ getCurrentDragPercentage(e) {
4210
+ e = e[this.horizontal ? "y" : "x"];
4211
+ const i = this.container[this.horizontal ? "clientHeight" : "clientWidth"];
4212
+ return this.rtl && !this.horizontal && (e = i - e), e * 100 / i;
4213
+ },
4214
+ calculatePanesSize(e) {
4215
+ const i = this.touch.activeSplitter;
4216
+ let s = {
4217
+ prevPanesSize: this.sumPrevPanesSize(i),
4218
+ nextPanesSize: this.sumNextPanesSize(i),
4219
+ prevReachedMinPanes: 0,
4220
+ nextReachedMinPanes: 0
4221
+ };
4222
+ const n = 0 + (this.pushOtherPanes ? 0 : s.prevPanesSize), t = 100 - (this.pushOtherPanes ? 0 : s.nextPanesSize), a = Math.max(Math.min(this.getCurrentDragPercentage(e), t), n);
4223
+ let r = [i, i + 1], o = this.panes[r[0]] || null, h = this.panes[r[1]] || null;
4224
+ const l = o.max < 100 && a >= o.max + s.prevPanesSize, u = h.max < 100 && a <= 100 - (h.max + this.sumNextPanesSize(i + 1));
4225
+ if (l || u) {
4226
+ l ? (o.size = o.max, h.size = Math.max(100 - o.max - s.prevPanesSize - s.nextPanesSize, 0)) : (o.size = Math.max(100 - h.max - s.prevPanesSize - this.sumNextPanesSize(i + 1), 0), h.size = h.max);
4227
+ return;
4228
+ }
4229
+ if (this.pushOtherPanes) {
4230
+ const d = this.doPushOtherPanes(s, a);
4231
+ if (!d)
4232
+ return;
4233
+ (({ sums: s, panesToResize: r } = d)), o = this.panes[r[0]] || null, h = this.panes[r[1]] || null;
4234
+ }
4235
+ o !== null && (o.size = Math.min(Math.max(a - s.prevPanesSize - s.prevReachedMinPanes, o.min), o.max)), h !== null && (h.size = Math.min(Math.max(100 - a - s.nextPanesSize - s.nextReachedMinPanes, h.min), h.max));
4236
+ },
4237
+ doPushOtherPanes(e, i) {
4238
+ const s = this.touch.activeSplitter, n = [s, s + 1];
4239
+ return i < e.prevPanesSize + this.panes[n[0]].min && (n[0] = this.findPrevExpandedPane(s).index, e.prevReachedMinPanes = 0, n[0] < s && this.panes.forEach((t, a) => {
4240
+ a > n[0] && a <= s && (t.size = t.min, e.prevReachedMinPanes += t.min);
4241
+ }), e.prevPanesSize = this.sumPrevPanesSize(n[0]), n[0] === void 0) ? (e.prevReachedMinPanes = 0, this.panes[0].size = this.panes[0].min, this.panes.forEach((t, a) => {
4242
+ a > 0 && a <= s && (t.size = t.min, e.prevReachedMinPanes += t.min);
4243
+ }), this.panes[n[1]].size = 100 - e.prevReachedMinPanes - this.panes[0].min - e.prevPanesSize - e.nextPanesSize, null) : i > 100 - e.nextPanesSize - this.panes[n[1]].min && (n[1] = this.findNextExpandedPane(s).index, e.nextReachedMinPanes = 0, n[1] > s + 1 && this.panes.forEach((t, a) => {
4244
+ a > s && a < n[1] && (t.size = t.min, e.nextReachedMinPanes += t.min);
4245
+ }), e.nextPanesSize = this.sumNextPanesSize(n[1] - 1), n[1] === void 0) ? (e.nextReachedMinPanes = 0, this.panes[this.panesCount - 1].size = this.panes[this.panesCount - 1].min, this.panes.forEach((t, a) => {
4246
+ a < this.panesCount - 1 && a >= s + 1 && (t.size = t.min, e.nextReachedMinPanes += t.min);
4247
+ }), this.panes[n[0]].size = 100 - e.prevPanesSize - e.nextReachedMinPanes - this.panes[this.panesCount - 1].min - e.nextPanesSize, null) : { sums: e, panesToResize: n };
4248
+ },
4249
+ sumPrevPanesSize(e) {
4250
+ return this.panes.reduce((i, s, n) => i + (n < e ? s.size : 0), 0);
4251
+ },
4252
+ sumNextPanesSize(e) {
4253
+ return this.panes.reduce((i, s, n) => i + (n > e + 1 ? s.size : 0), 0);
4254
+ },
4255
+ findPrevExpandedPane(e) {
4256
+ return [...this.panes].reverse().find((s) => s.index < e && s.size > s.min) || {};
4257
+ },
4258
+ findNextExpandedPane(e) {
4259
+ return this.panes.find((s) => s.index > e + 1 && s.size > s.min) || {};
4260
+ },
4261
+ checkSplitpanesNodes() {
4262
+ Array.from(this.container.children).forEach((i) => {
4263
+ const s = i.classList.contains("splitpanes__pane"), n = i.classList.contains("splitpanes__splitter");
4264
+ !s && !n && (i.parentNode.removeChild(i), console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."));
4265
+ });
4266
+ },
4267
+ addSplitter(e, i, s = !1) {
4268
+ const n = e - 1, t = document.createElement("div");
4269
+ t.classList.add("splitpanes__splitter"), s || (t.onmousedown = (a) => this.onMouseDown(a, n), typeof window < "u" && "ontouchstart" in window && (t.ontouchstart = (a) => this.onMouseDown(a, n)), t.onclick = (a) => this.onSplitterClick(a, n + 1)), this.dblClickSplitter && (t.ondblclick = (a) => this.onSplitterDblClick(a, n + 1)), i.parentNode.insertBefore(t, i);
4270
+ },
4271
+ removeSplitter(e) {
4272
+ e.onmousedown = void 0, e.onclick = void 0, e.ondblclick = void 0, e.parentNode.removeChild(e);
4273
+ },
4274
+ redoSplitters() {
4275
+ const e = Array.from(this.container.children);
4276
+ e.forEach((s) => {
4277
+ s.className.includes("splitpanes__splitter") && this.removeSplitter(s);
4278
+ });
4279
+ let i = 0;
4280
+ e.forEach((s) => {
4281
+ s.className.includes("splitpanes__pane") && (!i && this.firstSplitter ? this.addSplitter(i, s, !0) : i && this.addSplitter(i, s), i++);
4282
+ });
4283
+ },
4284
+ requestUpdate({ target: e, ...i }) {
4285
+ const s = this.indexedPanes[e._.uid];
4286
+ Object.entries(i).forEach(([n, t]) => s[n] = t);
4287
+ },
4288
+ onPaneAdd(e) {
4289
+ let i = -1;
4290
+ Array.from(e.$el.parentNode.children).some((t) => (t.className.includes("splitpanes__pane") && i++, t === e.$el));
4291
+ const s = parseFloat(e.minSize), n = parseFloat(e.maxSize);
4292
+ this.panes.splice(i, 0, {
4293
+ id: e._.uid,
4294
+ index: i,
4295
+ min: isNaN(s) ? 0 : s,
4296
+ max: isNaN(n) ? 100 : n,
4297
+ size: e.size === null ? null : parseFloat(e.size),
4298
+ givenSize: e.size,
4299
+ update: e.update
4300
+ }), this.panes.forEach((t, a) => t.index = a), this.ready && this.$nextTick(() => {
4301
+ this.redoSplitters(), this.resetPaneSizes({ addedPane: this.panes[i] }), this.$emit("pane-add", { index: i, panes: this.panes.map((t) => ({ min: t.min, max: t.max, size: t.size })) });
4302
+ });
4303
+ },
4304
+ onPaneRemove(e) {
4305
+ const i = this.panes.findIndex((n) => n.id === e._.uid), s = this.panes.splice(i, 1)[0];
4306
+ this.panes.forEach((n, t) => n.index = t), this.$nextTick(() => {
4307
+ this.redoSplitters(), this.resetPaneSizes({ removedPane: { ...s, index: i } }), this.$emit("pane-remove", { removed: s, panes: this.panes.map((n) => ({ min: n.min, max: n.max, size: n.size })) });
4308
+ });
4309
+ },
4310
+ resetPaneSizes(e = {}) {
4311
+ !e.addedPane && !e.removedPane ? this.initialPanesSizing() : this.panes.some((i) => i.givenSize !== null || i.min || i.max < 100) ? this.equalizeAfterAddOrRemove(e) : this.equalize(), this.ready && this.$emit("resized", this.panes.map((i) => ({ min: i.min, max: i.max, size: i.size })));
4312
+ },
4313
+ equalize() {
4314
+ const e = 100 / this.panesCount;
4315
+ let i = 0;
4316
+ const s = [], n = [];
4317
+ this.panes.forEach((t) => {
4318
+ t.size = Math.max(Math.min(e, t.max), t.min), i -= t.size, t.size >= t.max && s.push(t.id), t.size <= t.min && n.push(t.id);
4319
+ }), i > 0.1 && this.readjustSizes(i, s, n);
4320
+ },
4321
+ initialPanesSizing() {
4322
+ let e = 100;
4323
+ const i = [], s = [];
4324
+ let n = 0;
4325
+ this.panes.forEach((a) => {
4326
+ e -= a.size, a.size !== null && n++, a.size >= a.max && i.push(a.id), a.size <= a.min && s.push(a.id);
4327
+ });
4328
+ let t = 100;
4329
+ e > 0.1 && (this.panes.forEach((a) => {
4330
+ a.size === null && (a.size = Math.max(Math.min(e / (this.panesCount - n), a.max), a.min)), t -= a.size;
4331
+ }), t > 0.1 && this.readjustSizes(e, i, s));
4332
+ },
4333
+ equalizeAfterAddOrRemove({ addedPane: e, removedPane: i } = {}) {
4334
+ let s = 100 / this.panesCount, n = 0;
4335
+ const t = [], a = [];
4336
+ e && e.givenSize !== null && (s = (100 - e.givenSize) / (this.panesCount - 1)), this.panes.forEach((r) => {
4337
+ n -= r.size, r.size >= r.max && t.push(r.id), r.size <= r.min && a.push(r.id);
4338
+ }), !(Math.abs(n) < 0.1) && (this.panes.forEach((r) => {
4339
+ e && e.givenSize !== null && e.id === r.id || (r.size = Math.max(Math.min(s, r.max), r.min)), n -= r.size, r.size >= r.max && t.push(r.id), r.size <= r.min && a.push(r.id);
4340
+ }), n > 0.1 && this.readjustSizes(n, t, a));
4341
+ },
4342
+ readjustSizes(e, i, s) {
4343
+ let n;
4344
+ e > 0 ? n = e / (this.panesCount - i.length) : n = e / (this.panesCount - s.length), this.panes.forEach((t, a) => {
4345
+ if (e > 0 && !i.includes(t.id)) {
4346
+ const r = Math.max(Math.min(t.size + n, t.max), t.min), o = r - t.size;
4347
+ e -= o, t.size = r;
4348
+ } else if (!s.includes(t.id)) {
4349
+ const r = Math.max(Math.min(t.size + n, t.max), t.min), o = r - t.size;
4350
+ e -= o, t.size = r;
4351
+ }
4352
+ t.update({
4353
+ [this.horizontal ? "height" : "width"]: `${this.indexedPanes[t.id].size}%`
4354
+ });
4355
+ }), Math.abs(e) > 0.1 && this.$nextTick(() => {
4356
+ this.ready && console.warn("Splitpanes: Could not resize panes correctly due to their constraints.");
4357
+ });
4358
+ }
4359
+ },
4360
+ watch: {
4361
+ panes: {
4362
+ deep: !0,
4363
+ immediate: !1,
4364
+ handler() {
4365
+ this.updatePaneComponents();
4366
+ }
4367
+ },
4368
+ horizontal() {
4369
+ this.updatePaneComponents();
4370
+ },
4371
+ firstSplitter() {
4372
+ this.redoSplitters();
4373
+ },
4374
+ dblClickSplitter(e) {
4375
+ [...this.container.querySelectorAll(".splitpanes__splitter")].forEach((s, n) => {
4376
+ s.ondblclick = e ? (t) => this.onSplitterDblClick(t, n) : void 0;
4377
+ });
4378
+ }
4379
+ },
4380
+ beforeUnmount() {
4381
+ this.ready = !1;
4382
+ },
4383
+ mounted() {
4384
+ this.container = this.$refs.container, this.checkSplitpanesNodes(), this.redoSplitters(), this.resetPaneSizes(), this.$emit("ready"), this.ready = !0;
4385
+ },
4386
+ render() {
4387
+ return h(
4388
+ "div",
4389
+ {
4390
+ ref: "container",
4391
+ class: [
4392
+ "splitpanes",
4393
+ `splitpanes--${this.horizontal ? "horizontal" : "vertical"}`,
4394
+ {
4395
+ "splitpanes--dragging": this.touch.dragging
4396
+ }
4397
+ ]
4398
+ },
4399
+ this.$slots.default()
4400
+ );
4401
+ }
4402
+ }, S = (e, i) => {
4403
+ const s = e.__vccOpts || e;
4404
+ for (const [n, t] of i)
4405
+ s[n] = t;
4406
+ return s;
4407
+ }, x = {
4408
+ name: "pane",
4409
+ inject: ["requestUpdate", "onPaneAdd", "onPaneRemove", "onPaneClick"],
4410
+ props: {
4411
+ size: { type: [Number, String], default: null },
4412
+ minSize: { type: [Number, String], default: 0 },
4413
+ maxSize: { type: [Number, String], default: 100 }
4414
+ },
4415
+ data: () => ({
4416
+ style: {}
4417
+ }),
4418
+ mounted() {
4419
+ this.onPaneAdd(this);
4420
+ },
4421
+ beforeUnmount() {
4422
+ this.onPaneRemove(this);
4423
+ },
4424
+ methods: {
4425
+ update(e) {
4426
+ this.style = e;
4427
+ }
4428
+ },
4429
+ computed: {
4430
+ sizeNumber() {
4431
+ return this.size || this.size === 0 ? parseFloat(this.size) : null;
4432
+ },
4433
+ minSizeNumber() {
4434
+ return parseFloat(this.minSize);
4435
+ },
4436
+ maxSizeNumber() {
4437
+ return parseFloat(this.maxSize);
4438
+ }
4439
+ },
4440
+ watch: {
4441
+ sizeNumber(e) {
4442
+ this.requestUpdate({ target: this, size: e });
4443
+ },
4444
+ minSizeNumber(e) {
4445
+ this.requestUpdate({ target: this, min: e });
4446
+ },
4447
+ maxSizeNumber(e) {
4448
+ this.requestUpdate({ target: this, max: e });
4449
+ }
4450
+ }
4451
+ };
4452
+ function P(e, i, s, n, t, a) {
4453
+ return openBlock(), createElementBlock("div", {
4454
+ class: "splitpanes__pane",
4455
+ onClick: i[0] || (i[0] = (r) => a.onPaneClick(r, e._.uid)),
4456
+ style: normalizeStyle(e.style)
4457
+ }, [
4458
+ renderSlot(e.$slots, "default")
4459
+ ], 4);
4460
+ }
4461
+ const g = /* @__PURE__ */ S(x, [["render", P]]);
4462
+
4463
+ /* Injected with object hook! */
4464
+
4465
+ const _hoisted_1 = {
4466
+ class: "h-full",
4467
+ flex: "~ col",
4468
+ text: "gray-700 dark:gray-200"
4469
+ };
4470
+ const _hoisted_2 = /* @__PURE__ */ createBaseVNode("div", {
4471
+ class: "w-full border-b shadow flex justify-end",
4472
+ dark: "border-b-black"
4473
+ }, [
4474
+ /* @__PURE__ */ createBaseVNode("a", {
4475
+ href: "https://valaxy.site",
4476
+ target: "_blank",
4477
+ class: "bg-gray-100 dark:bg-gray-900 inline-flex justify-center items-center w-8 h-8"
4478
+ }, [
4479
+ /* @__PURE__ */ createBaseVNode("div", { "i-ri-book-line": "" })
4480
+ ])
4481
+ ], -1);
4482
+ const _hoisted_3 = {
4483
+ style: { "height": "calc(100% - 32px)" },
4484
+ overflow: "auto"
4485
+ };
4486
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4487
+ __name: "index",
4488
+ setup(__props) {
4489
+ onMounted(() => {
4490
+ if (isStaticMode)
4491
+ document.title = "Valaxy DevTools (Production)";
4492
+ });
4493
+ return (_ctx, _cache) => {
4494
+ const _component_VDPostList = _sfc_main$1;
4495
+ const _component_PostPanel = _sfc_main$2;
4496
+ return openBlock(), createElementBlock("main", _hoisted_1, [
4497
+ _hoisted_2,
4498
+ createBaseVNode("div", _hoisted_3, [
4499
+ createVNode(unref(M), { class: "h-full" }, {
4500
+ default: withCtx(() => [
4501
+ createVNode(unref(g), null, {
4502
+ default: withCtx(() => [
4503
+ createVNode(_component_VDPostList)
4504
+ ]),
4505
+ _: 1
4506
+ }),
4507
+ createVNode(unref(g), null, {
4508
+ default: withCtx(() => [
4509
+ createVNode(_component_PostPanel)
4510
+ ]),
4511
+ _: 1
4512
+ })
4513
+ ]),
4514
+ _: 1
4515
+ })
4516
+ ])
4517
+ ]);
4518
+ };
4519
+ }
4520
+ });
4521
+
4522
+ /* Injected with object hook! */
4523
+
4524
+ /* Injected with object hook! */
4525
+
4526
+ export { _sfc_main as default };