@harbour-enterprises/superdoc 1.0.0-alpha.57 → 1.0.0-alpha.59

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.
@@ -1,2364 +0,0 @@
1
- import { c as commonjsGlobal, g as getDefaultExportFromCjs, a as getAugmentedNamespace, b as getIntrinsic, d as callBound$1, t as type } from "./index-DlsKpjgi.js";
2
- var punycode$1 = { exports: {} };
3
- /*! https://mths.be/punycode v1.4.1 by @mathias */
4
- punycode$1.exports;
5
- (function(module, exports) {
6
- (function(root) {
7
- var freeExports = exports && !exports.nodeType && exports;
8
- var freeModule = module && !module.nodeType && module;
9
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal;
10
- if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal) {
11
- root = freeGlobal;
12
- }
13
- var punycode2, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, delimiter = "-", regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, errors = {
14
- "overflow": "Overflow: input needs wider integers to process",
15
- "not-basic": "Illegal input >= 0x80 (not a basic code point)",
16
- "invalid-input": "Invalid input"
17
- }, baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, key;
18
- function error(type2) {
19
- throw new RangeError(errors[type2]);
20
- }
21
- function map(array, fn) {
22
- var length = array.length;
23
- var result = [];
24
- while (length--) {
25
- result[length] = fn(array[length]);
26
- }
27
- return result;
28
- }
29
- function mapDomain(string, fn) {
30
- var parts = string.split("@");
31
- var result = "";
32
- if (parts.length > 1) {
33
- result = parts[0] + "@";
34
- string = parts[1];
35
- }
36
- string = string.replace(regexSeparators, ".");
37
- var labels = string.split(".");
38
- var encoded = map(labels, fn).join(".");
39
- return result + encoded;
40
- }
41
- function ucs2decode(string) {
42
- var output = [], counter = 0, length = string.length, value, extra;
43
- while (counter < length) {
44
- value = string.charCodeAt(counter++);
45
- if (value >= 55296 && value <= 56319 && counter < length) {
46
- extra = string.charCodeAt(counter++);
47
- if ((extra & 64512) == 56320) {
48
- output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
49
- } else {
50
- output.push(value);
51
- counter--;
52
- }
53
- } else {
54
- output.push(value);
55
- }
56
- }
57
- return output;
58
- }
59
- function ucs2encode(array) {
60
- return map(array, function(value) {
61
- var output = "";
62
- if (value > 65535) {
63
- value -= 65536;
64
- output += stringFromCharCode(value >>> 10 & 1023 | 55296);
65
- value = 56320 | value & 1023;
66
- }
67
- output += stringFromCharCode(value);
68
- return output;
69
- }).join("");
70
- }
71
- function basicToDigit(codePoint) {
72
- if (codePoint - 48 < 10) {
73
- return codePoint - 22;
74
- }
75
- if (codePoint - 65 < 26) {
76
- return codePoint - 65;
77
- }
78
- if (codePoint - 97 < 26) {
79
- return codePoint - 97;
80
- }
81
- return base;
82
- }
83
- function digitToBasic(digit, flag) {
84
- return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
85
- }
86
- function adapt(delta, numPoints, firstTime) {
87
- var k = 0;
88
- delta = firstTime ? floor(delta / damp) : delta >> 1;
89
- delta += floor(delta / numPoints);
90
- for (; delta > baseMinusTMin * tMax >> 1; k += base) {
91
- delta = floor(delta / baseMinusTMin);
92
- }
93
- return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
94
- }
95
- function decode2(input) {
96
- var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t, baseMinusT;
97
- basic = input.lastIndexOf(delimiter);
98
- if (basic < 0) {
99
- basic = 0;
100
- }
101
- for (j = 0; j < basic; ++j) {
102
- if (input.charCodeAt(j) >= 128) {
103
- error("not-basic");
104
- }
105
- output.push(input.charCodeAt(j));
106
- }
107
- for (index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
108
- for (oldi = i, w = 1, k = base; ; k += base) {
109
- if (index >= inputLength) {
110
- error("invalid-input");
111
- }
112
- digit = basicToDigit(input.charCodeAt(index++));
113
- if (digit >= base || digit > floor((maxInt - i) / w)) {
114
- error("overflow");
115
- }
116
- i += digit * w;
117
- t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
118
- if (digit < t) {
119
- break;
120
- }
121
- baseMinusT = base - t;
122
- if (w > floor(maxInt / baseMinusT)) {
123
- error("overflow");
124
- }
125
- w *= baseMinusT;
126
- }
127
- out = output.length + 1;
128
- bias = adapt(i - oldi, out, oldi == 0);
129
- if (floor(i / out) > maxInt - n) {
130
- error("overflow");
131
- }
132
- n += floor(i / out);
133
- i %= out;
134
- output.splice(i++, 0, n);
135
- }
136
- return ucs2encode(output);
137
- }
138
- function encode3(input) {
139
- var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [], inputLength, handledCPCountPlusOne, baseMinusT, qMinusT;
140
- input = ucs2decode(input);
141
- inputLength = input.length;
142
- n = initialN;
143
- delta = 0;
144
- bias = initialBias;
145
- for (j = 0; j < inputLength; ++j) {
146
- currentValue = input[j];
147
- if (currentValue < 128) {
148
- output.push(stringFromCharCode(currentValue));
149
- }
150
- }
151
- handledCPCount = basicLength = output.length;
152
- if (basicLength) {
153
- output.push(delimiter);
154
- }
155
- while (handledCPCount < inputLength) {
156
- for (m = maxInt, j = 0; j < inputLength; ++j) {
157
- currentValue = input[j];
158
- if (currentValue >= n && currentValue < m) {
159
- m = currentValue;
160
- }
161
- }
162
- handledCPCountPlusOne = handledCPCount + 1;
163
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
164
- error("overflow");
165
- }
166
- delta += (m - n) * handledCPCountPlusOne;
167
- n = m;
168
- for (j = 0; j < inputLength; ++j) {
169
- currentValue = input[j];
170
- if (currentValue < n && ++delta > maxInt) {
171
- error("overflow");
172
- }
173
- if (currentValue == n) {
174
- for (q = delta, k = base; ; k += base) {
175
- t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
176
- if (q < t) {
177
- break;
178
- }
179
- qMinusT = q - t;
180
- baseMinusT = base - t;
181
- output.push(
182
- stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
183
- );
184
- q = floor(qMinusT / baseMinusT);
185
- }
186
- output.push(stringFromCharCode(digitToBasic(q, 0)));
187
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
188
- delta = 0;
189
- ++handledCPCount;
190
- }
191
- }
192
- ++delta;
193
- ++n;
194
- }
195
- return output.join("");
196
- }
197
- function toUnicode(input) {
198
- return mapDomain(input, function(string) {
199
- return regexPunycode.test(string) ? decode2(string.slice(4).toLowerCase()) : string;
200
- });
201
- }
202
- function toASCII(input) {
203
- return mapDomain(input, function(string) {
204
- return regexNonASCII.test(string) ? "xn--" + encode3(string) : string;
205
- });
206
- }
207
- punycode2 = {
208
- /**
209
- * A string representing the current Punycode.js version number.
210
- * @memberOf punycode
211
- * @type String
212
- */
213
- "version": "1.4.1",
214
- /**
215
- * An object of methods to convert from JavaScript's internal character
216
- * representation (UCS-2) to Unicode code points, and back.
217
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
218
- * @memberOf punycode
219
- * @type Object
220
- */
221
- "ucs2": {
222
- "decode": ucs2decode,
223
- "encode": ucs2encode
224
- },
225
- "decode": decode2,
226
- "encode": encode3,
227
- "toASCII": toASCII,
228
- "toUnicode": toUnicode
229
- };
230
- if (freeExports && freeModule) {
231
- if (module.exports == freeExports) {
232
- freeModule.exports = punycode2;
233
- } else {
234
- for (key in punycode2) {
235
- punycode2.hasOwnProperty(key) && (freeExports[key] = punycode2[key]);
236
- }
237
- }
238
- } else {
239
- root.punycode = punycode2;
240
- }
241
- })(commonjsGlobal);
242
- })(punycode$1, punycode$1.exports);
243
- var punycodeExports = punycode$1.exports;
244
- const require$$0$1 = /* @__PURE__ */ getDefaultExportFromCjs(punycodeExports);
245
- const __viteBrowserExternal = {};
246
- const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
247
- __proto__: null,
248
- default: __viteBrowserExternal
249
- }, Symbol.toStringTag, { value: "Module" }));
250
- const require$$0 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
251
- var hasMap = typeof Map === "function" && Map.prototype;
252
- var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null;
253
- var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null;
254
- var mapForEach = hasMap && Map.prototype.forEach;
255
- var hasSet = typeof Set === "function" && Set.prototype;
256
- var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null;
257
- var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null;
258
- var setForEach = hasSet && Set.prototype.forEach;
259
- var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype;
260
- var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
261
- var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype;
262
- var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
263
- var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype;
264
- var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
265
- var booleanValueOf = Boolean.prototype.valueOf;
266
- var objectToString = Object.prototype.toString;
267
- var functionToString = Function.prototype.toString;
268
- var $match = String.prototype.match;
269
- var $slice = String.prototype.slice;
270
- var $replace = String.prototype.replace;
271
- var $toUpperCase = String.prototype.toUpperCase;
272
- var $toLowerCase = String.prototype.toLowerCase;
273
- var $test = RegExp.prototype.test;
274
- var $concat = Array.prototype.concat;
275
- var $join = Array.prototype.join;
276
- var $arrSlice = Array.prototype.slice;
277
- var $floor = Math.floor;
278
- var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null;
279
- var gOPS = Object.getOwnPropertySymbols;
280
- var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null;
281
- var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object";
282
- var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null;
283
- var isEnumerable = Object.prototype.propertyIsEnumerable;
284
- var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) {
285
- return O.__proto__;
286
- } : null);
287
- function addNumericSeparator(num, str) {
288
- if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str)) {
289
- return str;
290
- }
291
- var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
292
- if (typeof num === "number") {
293
- var int = num < 0 ? -$floor(-num) : $floor(num);
294
- if (int !== num) {
295
- var intStr = String(int);
296
- var dec = $slice.call(str, intStr.length + 1);
297
- return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, "");
298
- }
299
- }
300
- return $replace.call(str, sepRegex, "$&_");
301
- }
302
- var utilInspect = require$$0;
303
- var inspectCustom = utilInspect.custom;
304
- var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
305
- var objectInspect = function inspect_(obj, options, depth, seen) {
306
- var opts = options || {};
307
- if (has$3(opts, "quoteStyle") && (opts.quoteStyle !== "single" && opts.quoteStyle !== "double")) {
308
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
309
- }
310
- if (has$3(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) {
311
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
312
- }
313
- var customInspect = has$3(opts, "customInspect") ? opts.customInspect : true;
314
- if (typeof customInspect !== "boolean" && customInspect !== "symbol") {
315
- throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
316
- }
317
- if (has$3(opts, "indent") && opts.indent !== null && opts.indent !== " " && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) {
318
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
319
- }
320
- if (has$3(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") {
321
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
322
- }
323
- var numericSeparator = opts.numericSeparator;
324
- if (typeof obj === "undefined") {
325
- return "undefined";
326
- }
327
- if (obj === null) {
328
- return "null";
329
- }
330
- if (typeof obj === "boolean") {
331
- return obj ? "true" : "false";
332
- }
333
- if (typeof obj === "string") {
334
- return inspectString(obj, opts);
335
- }
336
- if (typeof obj === "number") {
337
- if (obj === 0) {
338
- return Infinity / obj > 0 ? "0" : "-0";
339
- }
340
- var str = String(obj);
341
- return numericSeparator ? addNumericSeparator(obj, str) : str;
342
- }
343
- if (typeof obj === "bigint") {
344
- var bigIntStr = String(obj) + "n";
345
- return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
346
- }
347
- var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth;
348
- if (typeof depth === "undefined") {
349
- depth = 0;
350
- }
351
- if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") {
352
- return isArray$3(obj) ? "[Array]" : "[Object]";
353
- }
354
- var indent = getIndent(opts, depth);
355
- if (typeof seen === "undefined") {
356
- seen = [];
357
- } else if (indexOf(seen, obj) >= 0) {
358
- return "[Circular]";
359
- }
360
- function inspect2(value, from, noIndent) {
361
- if (from) {
362
- seen = $arrSlice.call(seen);
363
- seen.push(from);
364
- }
365
- if (noIndent) {
366
- var newOpts = {
367
- depth: opts.depth
368
- };
369
- if (has$3(opts, "quoteStyle")) {
370
- newOpts.quoteStyle = opts.quoteStyle;
371
- }
372
- return inspect_(value, newOpts, depth + 1, seen);
373
- }
374
- return inspect_(value, opts, depth + 1, seen);
375
- }
376
- if (typeof obj === "function" && !isRegExp$1(obj)) {
377
- var name = nameOf(obj);
378
- var keys = arrObjKeys(obj, inspect2);
379
- return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
380
- }
381
- if (isSymbol(obj)) {
382
- var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj);
383
- return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString;
384
- }
385
- if (isElement(obj)) {
386
- var s = "<" + $toLowerCase.call(String(obj.nodeName));
387
- var attrs = obj.attributes || [];
388
- for (var i = 0; i < attrs.length; i++) {
389
- s += " " + attrs[i].name + "=" + wrapQuotes(quote(attrs[i].value), "double", opts);
390
- }
391
- s += ">";
392
- if (obj.childNodes && obj.childNodes.length) {
393
- s += "...";
394
- }
395
- s += "</" + $toLowerCase.call(String(obj.nodeName)) + ">";
396
- return s;
397
- }
398
- if (isArray$3(obj)) {
399
- if (obj.length === 0) {
400
- return "[]";
401
- }
402
- var xs = arrObjKeys(obj, inspect2);
403
- if (indent && !singleLineValues(xs)) {
404
- return "[" + indentedJoin(xs, indent) + "]";
405
- }
406
- return "[ " + $join.call(xs, ", ") + " ]";
407
- }
408
- if (isError(obj)) {
409
- var parts = arrObjKeys(obj, inspect2);
410
- if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) {
411
- return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect2(obj.cause), parts), ", ") + " }";
412
- }
413
- if (parts.length === 0) {
414
- return "[" + String(obj) + "]";
415
- }
416
- return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }";
417
- }
418
- if (typeof obj === "object" && customInspect) {
419
- if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) {
420
- return utilInspect(obj, { depth: maxDepth - depth });
421
- } else if (customInspect !== "symbol" && typeof obj.inspect === "function") {
422
- return obj.inspect();
423
- }
424
- }
425
- if (isMap(obj)) {
426
- var mapParts = [];
427
- if (mapForEach) {
428
- mapForEach.call(obj, function(value, key) {
429
- mapParts.push(inspect2(key, obj, true) + " => " + inspect2(value, obj));
430
- });
431
- }
432
- return collectionOf("Map", mapSize.call(obj), mapParts, indent);
433
- }
434
- if (isSet(obj)) {
435
- var setParts = [];
436
- if (setForEach) {
437
- setForEach.call(obj, function(value) {
438
- setParts.push(inspect2(value, obj));
439
- });
440
- }
441
- return collectionOf("Set", setSize.call(obj), setParts, indent);
442
- }
443
- if (isWeakMap(obj)) {
444
- return weakCollectionOf("WeakMap");
445
- }
446
- if (isWeakSet(obj)) {
447
- return weakCollectionOf("WeakSet");
448
- }
449
- if (isWeakRef(obj)) {
450
- return weakCollectionOf("WeakRef");
451
- }
452
- if (isNumber(obj)) {
453
- return markBoxed(inspect2(Number(obj)));
454
- }
455
- if (isBigInt(obj)) {
456
- return markBoxed(inspect2(bigIntValueOf.call(obj)));
457
- }
458
- if (isBoolean(obj)) {
459
- return markBoxed(booleanValueOf.call(obj));
460
- }
461
- if (isString(obj)) {
462
- return markBoxed(inspect2(String(obj)));
463
- }
464
- if (typeof window !== "undefined" && obj === window) {
465
- return "{ [object Window] }";
466
- }
467
- if (typeof globalThis !== "undefined" && obj === globalThis || typeof commonjsGlobal !== "undefined" && obj === commonjsGlobal) {
468
- return "{ [object globalThis] }";
469
- }
470
- if (!isDate(obj) && !isRegExp$1(obj)) {
471
- var ys = arrObjKeys(obj, inspect2);
472
- var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
473
- var protoTag = obj instanceof Object ? "" : "null prototype";
474
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
475
- var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
476
- var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
477
- if (ys.length === 0) {
478
- return tag + "{}";
479
- }
480
- if (indent) {
481
- return tag + "{" + indentedJoin(ys, indent) + "}";
482
- }
483
- return tag + "{ " + $join.call(ys, ", ") + " }";
484
- }
485
- return String(obj);
486
- };
487
- function wrapQuotes(s, defaultStyle, opts) {
488
- var quoteChar = (opts.quoteStyle || defaultStyle) === "double" ? '"' : "'";
489
- return quoteChar + s + quoteChar;
490
- }
491
- function quote(s) {
492
- return $replace.call(String(s), /"/g, "&quot;");
493
- }
494
- function isArray$3(obj) {
495
- return toStr(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
496
- }
497
- function isDate(obj) {
498
- return toStr(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
499
- }
500
- function isRegExp$1(obj) {
501
- return toStr(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
502
- }
503
- function isError(obj) {
504
- return toStr(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
505
- }
506
- function isString(obj) {
507
- return toStr(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
508
- }
509
- function isNumber(obj) {
510
- return toStr(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
511
- }
512
- function isBoolean(obj) {
513
- return toStr(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
514
- }
515
- function isSymbol(obj) {
516
- if (hasShammedSymbols) {
517
- return obj && typeof obj === "object" && obj instanceof Symbol;
518
- }
519
- if (typeof obj === "symbol") {
520
- return true;
521
- }
522
- if (!obj || typeof obj !== "object" || !symToString) {
523
- return false;
524
- }
525
- try {
526
- symToString.call(obj);
527
- return true;
528
- } catch (e) {
529
- }
530
- return false;
531
- }
532
- function isBigInt(obj) {
533
- if (!obj || typeof obj !== "object" || !bigIntValueOf) {
534
- return false;
535
- }
536
- try {
537
- bigIntValueOf.call(obj);
538
- return true;
539
- } catch (e) {
540
- }
541
- return false;
542
- }
543
- var hasOwn = Object.prototype.hasOwnProperty || function(key) {
544
- return key in this;
545
- };
546
- function has$3(obj, key) {
547
- return hasOwn.call(obj, key);
548
- }
549
- function toStr(obj) {
550
- return objectToString.call(obj);
551
- }
552
- function nameOf(f) {
553
- if (f.name) {
554
- return f.name;
555
- }
556
- var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
557
- if (m) {
558
- return m[1];
559
- }
560
- return null;
561
- }
562
- function indexOf(xs, x) {
563
- if (xs.indexOf) {
564
- return xs.indexOf(x);
565
- }
566
- for (var i = 0, l = xs.length; i < l; i++) {
567
- if (xs[i] === x) {
568
- return i;
569
- }
570
- }
571
- return -1;
572
- }
573
- function isMap(x) {
574
- if (!mapSize || !x || typeof x !== "object") {
575
- return false;
576
- }
577
- try {
578
- mapSize.call(x);
579
- try {
580
- setSize.call(x);
581
- } catch (s) {
582
- return true;
583
- }
584
- return x instanceof Map;
585
- } catch (e) {
586
- }
587
- return false;
588
- }
589
- function isWeakMap(x) {
590
- if (!weakMapHas || !x || typeof x !== "object") {
591
- return false;
592
- }
593
- try {
594
- weakMapHas.call(x, weakMapHas);
595
- try {
596
- weakSetHas.call(x, weakSetHas);
597
- } catch (s) {
598
- return true;
599
- }
600
- return x instanceof WeakMap;
601
- } catch (e) {
602
- }
603
- return false;
604
- }
605
- function isWeakRef(x) {
606
- if (!weakRefDeref || !x || typeof x !== "object") {
607
- return false;
608
- }
609
- try {
610
- weakRefDeref.call(x);
611
- return true;
612
- } catch (e) {
613
- }
614
- return false;
615
- }
616
- function isSet(x) {
617
- if (!setSize || !x || typeof x !== "object") {
618
- return false;
619
- }
620
- try {
621
- setSize.call(x);
622
- try {
623
- mapSize.call(x);
624
- } catch (m) {
625
- return true;
626
- }
627
- return x instanceof Set;
628
- } catch (e) {
629
- }
630
- return false;
631
- }
632
- function isWeakSet(x) {
633
- if (!weakSetHas || !x || typeof x !== "object") {
634
- return false;
635
- }
636
- try {
637
- weakSetHas.call(x, weakSetHas);
638
- try {
639
- weakMapHas.call(x, weakMapHas);
640
- } catch (s) {
641
- return true;
642
- }
643
- return x instanceof WeakSet;
644
- } catch (e) {
645
- }
646
- return false;
647
- }
648
- function isElement(x) {
649
- if (!x || typeof x !== "object") {
650
- return false;
651
- }
652
- if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) {
653
- return true;
654
- }
655
- return typeof x.nodeName === "string" && typeof x.getAttribute === "function";
656
- }
657
- function inspectString(str, opts) {
658
- if (str.length > opts.maxStringLength) {
659
- var remaining = str.length - opts.maxStringLength;
660
- var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : "");
661
- return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
662
- }
663
- var s = $replace.call($replace.call(str, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, lowbyte);
664
- return wrapQuotes(s, "single", opts);
665
- }
666
- function lowbyte(c) {
667
- var n = c.charCodeAt(0);
668
- var x = {
669
- 8: "b",
670
- 9: "t",
671
- 10: "n",
672
- 12: "f",
673
- 13: "r"
674
- }[n];
675
- if (x) {
676
- return "\\" + x;
677
- }
678
- return "\\x" + (n < 16 ? "0" : "") + $toUpperCase.call(n.toString(16));
679
- }
680
- function markBoxed(str) {
681
- return "Object(" + str + ")";
682
- }
683
- function weakCollectionOf(type2) {
684
- return type2 + " { ? }";
685
- }
686
- function collectionOf(type2, size, entries, indent) {
687
- var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", ");
688
- return type2 + " (" + size + ") {" + joinedEntries + "}";
689
- }
690
- function singleLineValues(xs) {
691
- for (var i = 0; i < xs.length; i++) {
692
- if (indexOf(xs[i], "\n") >= 0) {
693
- return false;
694
- }
695
- }
696
- return true;
697
- }
698
- function getIndent(opts, depth) {
699
- var baseIndent;
700
- if (opts.indent === " ") {
701
- baseIndent = " ";
702
- } else if (typeof opts.indent === "number" && opts.indent > 0) {
703
- baseIndent = $join.call(Array(opts.indent + 1), " ");
704
- } else {
705
- return null;
706
- }
707
- return {
708
- base: baseIndent,
709
- prev: $join.call(Array(depth + 1), baseIndent)
710
- };
711
- }
712
- function indentedJoin(xs, indent) {
713
- if (xs.length === 0) {
714
- return "";
715
- }
716
- var lineJoiner = "\n" + indent.prev + indent.base;
717
- return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
718
- }
719
- function arrObjKeys(obj, inspect2) {
720
- var isArr = isArray$3(obj);
721
- var xs = [];
722
- if (isArr) {
723
- xs.length = obj.length;
724
- for (var i = 0; i < obj.length; i++) {
725
- xs[i] = has$3(obj, i) ? inspect2(obj[i], obj) : "";
726
- }
727
- }
728
- var syms = typeof gOPS === "function" ? gOPS(obj) : [];
729
- var symMap;
730
- if (hasShammedSymbols) {
731
- symMap = {};
732
- for (var k = 0; k < syms.length; k++) {
733
- symMap["$" + syms[k]] = syms[k];
734
- }
735
- }
736
- for (var key in obj) {
737
- if (!has$3(obj, key)) {
738
- continue;
739
- }
740
- if (isArr && String(Number(key)) === key && key < obj.length) {
741
- continue;
742
- }
743
- if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) {
744
- continue;
745
- } else if ($test.call(/[^\w$]/, key)) {
746
- xs.push(inspect2(key, obj) + ": " + inspect2(obj[key], obj));
747
- } else {
748
- xs.push(key + ": " + inspect2(obj[key], obj));
749
- }
750
- }
751
- if (typeof gOPS === "function") {
752
- for (var j = 0; j < syms.length; j++) {
753
- if (isEnumerable.call(obj, syms[j])) {
754
- xs.push("[" + inspect2(syms[j]) + "]: " + inspect2(obj[syms[j]], obj));
755
- }
756
- }
757
- }
758
- return xs;
759
- }
760
- var GetIntrinsic = getIntrinsic;
761
- var callBound = callBound$1;
762
- var inspect = objectInspect;
763
- var $TypeError = type;
764
- var $WeakMap = GetIntrinsic("%WeakMap%", true);
765
- var $Map = GetIntrinsic("%Map%", true);
766
- var $weakMapGet = callBound("WeakMap.prototype.get", true);
767
- var $weakMapSet = callBound("WeakMap.prototype.set", true);
768
- var $weakMapHas = callBound("WeakMap.prototype.has", true);
769
- var $mapGet = callBound("Map.prototype.get", true);
770
- var $mapSet = callBound("Map.prototype.set", true);
771
- var $mapHas = callBound("Map.prototype.has", true);
772
- var listGetNode = function(list, key) {
773
- var prev = list;
774
- var curr;
775
- for (; (curr = prev.next) !== null; prev = curr) {
776
- if (curr.key === key) {
777
- prev.next = curr.next;
778
- curr.next = /** @type {NonNullable<typeof list.next>} */
779
- list.next;
780
- list.next = curr;
781
- return curr;
782
- }
783
- }
784
- };
785
- var listGet = function(objects, key) {
786
- var node = listGetNode(objects, key);
787
- return node && node.value;
788
- };
789
- var listSet = function(objects, key, value) {
790
- var node = listGetNode(objects, key);
791
- if (node) {
792
- node.value = value;
793
- } else {
794
- objects.next = /** @type {import('.').ListNode<typeof value>} */
795
- {
796
- // eslint-disable-line no-param-reassign, no-extra-parens
797
- key,
798
- next: objects.next,
799
- value
800
- };
801
- }
802
- };
803
- var listHas = function(objects, key) {
804
- return !!listGetNode(objects, key);
805
- };
806
- var sideChannel = function getSideChannel() {
807
- var $wm;
808
- var $m;
809
- var $o;
810
- var channel = {
811
- assert: function(key) {
812
- if (!channel.has(key)) {
813
- throw new $TypeError("Side channel does not contain " + inspect(key));
814
- }
815
- },
816
- get: function(key) {
817
- if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
818
- if ($wm) {
819
- return $weakMapGet($wm, key);
820
- }
821
- } else if ($Map) {
822
- if ($m) {
823
- return $mapGet($m, key);
824
- }
825
- } else {
826
- if ($o) {
827
- return listGet($o, key);
828
- }
829
- }
830
- },
831
- has: function(key) {
832
- if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
833
- if ($wm) {
834
- return $weakMapHas($wm, key);
835
- }
836
- } else if ($Map) {
837
- if ($m) {
838
- return $mapHas($m, key);
839
- }
840
- } else {
841
- if ($o) {
842
- return listHas($o, key);
843
- }
844
- }
845
- return false;
846
- },
847
- set: function(key, value) {
848
- if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
849
- if (!$wm) {
850
- $wm = new $WeakMap();
851
- }
852
- $weakMapSet($wm, key, value);
853
- } else if ($Map) {
854
- if (!$m) {
855
- $m = new $Map();
856
- }
857
- $mapSet($m, key, value);
858
- } else {
859
- if (!$o) {
860
- $o = { key: {}, next: null };
861
- }
862
- listSet($o, key, value);
863
- }
864
- }
865
- };
866
- return channel;
867
- };
868
- var replace = String.prototype.replace;
869
- var percentTwenties = /%20/g;
870
- var Format = {
871
- RFC1738: "RFC1738",
872
- RFC3986: "RFC3986"
873
- };
874
- var formats$3 = {
875
- "default": Format.RFC3986,
876
- formatters: {
877
- RFC1738: function(value) {
878
- return replace.call(value, percentTwenties, "+");
879
- },
880
- RFC3986: function(value) {
881
- return String(value);
882
- }
883
- },
884
- RFC1738: Format.RFC1738,
885
- RFC3986: Format.RFC3986
886
- };
887
- var formats$2 = formats$3;
888
- var has$2 = Object.prototype.hasOwnProperty;
889
- var isArray$2 = Array.isArray;
890
- var hexTable = function() {
891
- var array = [];
892
- for (var i = 0; i < 256; ++i) {
893
- array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase());
894
- }
895
- return array;
896
- }();
897
- var compactQueue = function compactQueue2(queue) {
898
- while (queue.length > 1) {
899
- var item = queue.pop();
900
- var obj = item.obj[item.prop];
901
- if (isArray$2(obj)) {
902
- var compacted = [];
903
- for (var j = 0; j < obj.length; ++j) {
904
- if (typeof obj[j] !== "undefined") {
905
- compacted.push(obj[j]);
906
- }
907
- }
908
- item.obj[item.prop] = compacted;
909
- }
910
- }
911
- };
912
- var arrayToObject = function arrayToObject2(source, options) {
913
- var obj = options && options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
914
- for (var i = 0; i < source.length; ++i) {
915
- if (typeof source[i] !== "undefined") {
916
- obj[i] = source[i];
917
- }
918
- }
919
- return obj;
920
- };
921
- var merge = function merge2(target, source, options) {
922
- if (!source) {
923
- return target;
924
- }
925
- if (typeof source !== "object") {
926
- if (isArray$2(target)) {
927
- target.push(source);
928
- } else if (target && typeof target === "object") {
929
- if (options && (options.plainObjects || options.allowPrototypes) || !has$2.call(Object.prototype, source)) {
930
- target[source] = true;
931
- }
932
- } else {
933
- return [target, source];
934
- }
935
- return target;
936
- }
937
- if (!target || typeof target !== "object") {
938
- return [target].concat(source);
939
- }
940
- var mergeTarget = target;
941
- if (isArray$2(target) && !isArray$2(source)) {
942
- mergeTarget = arrayToObject(target, options);
943
- }
944
- if (isArray$2(target) && isArray$2(source)) {
945
- source.forEach(function(item, i) {
946
- if (has$2.call(target, i)) {
947
- var targetItem = target[i];
948
- if (targetItem && typeof targetItem === "object" && item && typeof item === "object") {
949
- target[i] = merge2(targetItem, item, options);
950
- } else {
951
- target.push(item);
952
- }
953
- } else {
954
- target[i] = item;
955
- }
956
- });
957
- return target;
958
- }
959
- return Object.keys(source).reduce(function(acc, key) {
960
- var value = source[key];
961
- if (has$2.call(acc, key)) {
962
- acc[key] = merge2(acc[key], value, options);
963
- } else {
964
- acc[key] = value;
965
- }
966
- return acc;
967
- }, mergeTarget);
968
- };
969
- var assign = function assignSingleSource(target, source) {
970
- return Object.keys(source).reduce(function(acc, key) {
971
- acc[key] = source[key];
972
- return acc;
973
- }, target);
974
- };
975
- var decode = function(str, decoder, charset) {
976
- var strWithoutPlus = str.replace(/\+/g, " ");
977
- if (charset === "iso-8859-1") {
978
- return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
979
- }
980
- try {
981
- return decodeURIComponent(strWithoutPlus);
982
- } catch (e) {
983
- return strWithoutPlus;
984
- }
985
- };
986
- var limit = 1024;
987
- var encode = function encode2(str, defaultEncoder, charset, kind, format2) {
988
- if (str.length === 0) {
989
- return str;
990
- }
991
- var string = str;
992
- if (typeof str === "symbol") {
993
- string = Symbol.prototype.toString.call(str);
994
- } else if (typeof str !== "string") {
995
- string = String(str);
996
- }
997
- if (charset === "iso-8859-1") {
998
- return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
999
- return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
1000
- });
1001
- }
1002
- var out = "";
1003
- for (var j = 0; j < string.length; j += limit) {
1004
- var segment = string.length >= limit ? string.slice(j, j + limit) : string;
1005
- var arr = [];
1006
- for (var i = 0; i < segment.length; ++i) {
1007
- var c = segment.charCodeAt(i);
1008
- if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format2 === formats$2.RFC1738 && (c === 40 || c === 41)) {
1009
- arr[arr.length] = segment.charAt(i);
1010
- continue;
1011
- }
1012
- if (c < 128) {
1013
- arr[arr.length] = hexTable[c];
1014
- continue;
1015
- }
1016
- if (c < 2048) {
1017
- arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | c & 63];
1018
- continue;
1019
- }
1020
- if (c < 55296 || c >= 57344) {
1021
- arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
1022
- continue;
1023
- }
1024
- i += 1;
1025
- c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023);
1026
- arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
1027
- }
1028
- out += arr.join("");
1029
- }
1030
- return out;
1031
- };
1032
- var compact = function compact2(value) {
1033
- var queue = [{ obj: { o: value }, prop: "o" }];
1034
- var refs = [];
1035
- for (var i = 0; i < queue.length; ++i) {
1036
- var item = queue[i];
1037
- var obj = item.obj[item.prop];
1038
- var keys = Object.keys(obj);
1039
- for (var j = 0; j < keys.length; ++j) {
1040
- var key = keys[j];
1041
- var val = obj[key];
1042
- if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
1043
- queue.push({ obj, prop: key });
1044
- refs.push(val);
1045
- }
1046
- }
1047
- }
1048
- compactQueue(queue);
1049
- return value;
1050
- };
1051
- var isRegExp = function isRegExp2(obj) {
1052
- return Object.prototype.toString.call(obj) === "[object RegExp]";
1053
- };
1054
- var isBuffer = function isBuffer2(obj) {
1055
- if (!obj || typeof obj !== "object") {
1056
- return false;
1057
- }
1058
- return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
1059
- };
1060
- var combine = function combine2(a, b) {
1061
- return [].concat(a, b);
1062
- };
1063
- var maybeMap = function maybeMap2(val, fn) {
1064
- if (isArray$2(val)) {
1065
- var mapped = [];
1066
- for (var i = 0; i < val.length; i += 1) {
1067
- mapped.push(fn(val[i]));
1068
- }
1069
- return mapped;
1070
- }
1071
- return fn(val);
1072
- };
1073
- var utils$2 = {
1074
- arrayToObject,
1075
- assign,
1076
- combine,
1077
- compact,
1078
- decode,
1079
- encode,
1080
- isBuffer,
1081
- isRegExp,
1082
- maybeMap,
1083
- merge
1084
- };
1085
- var getSideChannel2 = sideChannel;
1086
- var utils$1 = utils$2;
1087
- var formats$1 = formats$3;
1088
- var has$1 = Object.prototype.hasOwnProperty;
1089
- var arrayPrefixGenerators = {
1090
- brackets: function brackets(prefix) {
1091
- return prefix + "[]";
1092
- },
1093
- comma: "comma",
1094
- indices: function indices(prefix, key) {
1095
- return prefix + "[" + key + "]";
1096
- },
1097
- repeat: function repeat(prefix) {
1098
- return prefix;
1099
- }
1100
- };
1101
- var isArray$1 = Array.isArray;
1102
- var push = Array.prototype.push;
1103
- var pushToArray = function(arr, valueOrArray) {
1104
- push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
1105
- };
1106
- var toISO = Date.prototype.toISOString;
1107
- var defaultFormat = formats$1["default"];
1108
- var defaults$1 = {
1109
- addQueryPrefix: false,
1110
- allowDots: false,
1111
- allowEmptyArrays: false,
1112
- arrayFormat: "indices",
1113
- charset: "utf-8",
1114
- charsetSentinel: false,
1115
- delimiter: "&",
1116
- encode: true,
1117
- encodeDotInKeys: false,
1118
- encoder: utils$1.encode,
1119
- encodeValuesOnly: false,
1120
- format: defaultFormat,
1121
- formatter: formats$1.formatters[defaultFormat],
1122
- // deprecated
1123
- indices: false,
1124
- serializeDate: function serializeDate(date) {
1125
- return toISO.call(date);
1126
- },
1127
- skipNulls: false,
1128
- strictNullHandling: false
1129
- };
1130
- var isNonNullishPrimitive = function isNonNullishPrimitive2(v) {
1131
- return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint";
1132
- };
1133
- var sentinel = {};
1134
- var stringify$1 = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter2, sort, allowDots, serializeDate2, format2, formatter, encodeValuesOnly, charset, sideChannel2) {
1135
- var obj = object;
1136
- var tmpSc = sideChannel2;
1137
- var step = 0;
1138
- var findFlag = false;
1139
- while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
1140
- var pos = tmpSc.get(object);
1141
- step += 1;
1142
- if (typeof pos !== "undefined") {
1143
- if (pos === step) {
1144
- throw new RangeError("Cyclic object value");
1145
- } else {
1146
- findFlag = true;
1147
- }
1148
- }
1149
- if (typeof tmpSc.get(sentinel) === "undefined") {
1150
- step = 0;
1151
- }
1152
- }
1153
- if (typeof filter2 === "function") {
1154
- obj = filter2(prefix, obj);
1155
- } else if (obj instanceof Date) {
1156
- obj = serializeDate2(obj);
1157
- } else if (generateArrayPrefix === "comma" && isArray$1(obj)) {
1158
- obj = utils$1.maybeMap(obj, function(value2) {
1159
- if (value2 instanceof Date) {
1160
- return serializeDate2(value2);
1161
- }
1162
- return value2;
1163
- });
1164
- }
1165
- if (obj === null) {
1166
- if (strictNullHandling) {
1167
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, "key", format2) : prefix;
1168
- }
1169
- obj = "";
1170
- }
1171
- if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
1172
- if (encoder) {
1173
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, "key", format2);
1174
- return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults$1.encoder, charset, "value", format2))];
1175
- }
1176
- return [formatter(prefix) + "=" + formatter(String(obj))];
1177
- }
1178
- var values = [];
1179
- if (typeof obj === "undefined") {
1180
- return values;
1181
- }
1182
- var objKeys;
1183
- if (generateArrayPrefix === "comma" && isArray$1(obj)) {
1184
- if (encodeValuesOnly && encoder) {
1185
- obj = utils$1.maybeMap(obj, encoder);
1186
- }
1187
- objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }];
1188
- } else if (isArray$1(filter2)) {
1189
- objKeys = filter2;
1190
- } else {
1191
- var keys = Object.keys(obj);
1192
- objKeys = sort ? keys.sort(sort) : keys;
1193
- }
1194
- var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, "%2E") : prefix;
1195
- var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
1196
- if (allowEmptyArrays && isArray$1(obj) && obj.length === 0) {
1197
- return adjustedPrefix + "[]";
1198
- }
1199
- for (var j = 0; j < objKeys.length; ++j) {
1200
- var key = objKeys[j];
1201
- var value = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key];
1202
- if (skipNulls && value === null) {
1203
- continue;
1204
- }
1205
- var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key;
1206
- var keyPrefix = isArray$1(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
1207
- sideChannel2.set(object, step);
1208
- var valueSideChannel = getSideChannel2();
1209
- valueSideChannel.set(sentinel, sideChannel2);
1210
- pushToArray(values, stringify(
1211
- value,
1212
- keyPrefix,
1213
- generateArrayPrefix,
1214
- commaRoundTrip,
1215
- allowEmptyArrays,
1216
- strictNullHandling,
1217
- skipNulls,
1218
- encodeDotInKeys,
1219
- generateArrayPrefix === "comma" && encodeValuesOnly && isArray$1(obj) ? null : encoder,
1220
- filter2,
1221
- sort,
1222
- allowDots,
1223
- serializeDate2,
1224
- format2,
1225
- formatter,
1226
- encodeValuesOnly,
1227
- charset,
1228
- valueSideChannel
1229
- ));
1230
- }
1231
- return values;
1232
- };
1233
- var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) {
1234
- if (!opts) {
1235
- return defaults$1;
1236
- }
1237
- if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
1238
- throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1239
- }
1240
- if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") {
1241
- throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
1242
- }
1243
- if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") {
1244
- throw new TypeError("Encoder has to be a function.");
1245
- }
1246
- var charset = opts.charset || defaults$1.charset;
1247
- if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
1248
- throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1249
- }
1250
- var format2 = formats$1["default"];
1251
- if (typeof opts.format !== "undefined") {
1252
- if (!has$1.call(formats$1.formatters, opts.format)) {
1253
- throw new TypeError("Unknown format option provided.");
1254
- }
1255
- format2 = opts.format;
1256
- }
1257
- var formatter = formats$1.formatters[format2];
1258
- var filter2 = defaults$1.filter;
1259
- if (typeof opts.filter === "function" || isArray$1(opts.filter)) {
1260
- filter2 = opts.filter;
1261
- }
1262
- var arrayFormat;
1263
- if (opts.arrayFormat in arrayPrefixGenerators) {
1264
- arrayFormat = opts.arrayFormat;
1265
- } else if ("indices" in opts) {
1266
- arrayFormat = opts.indices ? "indices" : "repeat";
1267
- } else {
1268
- arrayFormat = defaults$1.arrayFormat;
1269
- }
1270
- if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") {
1271
- throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
1272
- }
1273
- var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults$1.allowDots : !!opts.allowDots;
1274
- return {
1275
- addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
1276
- allowDots,
1277
- allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults$1.allowEmptyArrays,
1278
- arrayFormat,
1279
- charset,
1280
- charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults$1.charsetSentinel,
1281
- commaRoundTrip: opts.commaRoundTrip,
1282
- delimiter: typeof opts.delimiter === "undefined" ? defaults$1.delimiter : opts.delimiter,
1283
- encode: typeof opts.encode === "boolean" ? opts.encode : defaults$1.encode,
1284
- encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults$1.encodeDotInKeys,
1285
- encoder: typeof opts.encoder === "function" ? opts.encoder : defaults$1.encoder,
1286
- encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
1287
- filter: filter2,
1288
- format: format2,
1289
- formatter,
1290
- serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults$1.serializeDate,
1291
- skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults$1.skipNulls,
1292
- sort: typeof opts.sort === "function" ? opts.sort : null,
1293
- strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults$1.strictNullHandling
1294
- };
1295
- };
1296
- var stringify_1 = function(object, opts) {
1297
- var obj = object;
1298
- var options = normalizeStringifyOptions(opts);
1299
- var objKeys;
1300
- var filter2;
1301
- if (typeof options.filter === "function") {
1302
- filter2 = options.filter;
1303
- obj = filter2("", obj);
1304
- } else if (isArray$1(options.filter)) {
1305
- filter2 = options.filter;
1306
- objKeys = filter2;
1307
- }
1308
- var keys = [];
1309
- if (typeof obj !== "object" || obj === null) {
1310
- return "";
1311
- }
1312
- var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
1313
- var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip;
1314
- if (!objKeys) {
1315
- objKeys = Object.keys(obj);
1316
- }
1317
- if (options.sort) {
1318
- objKeys.sort(options.sort);
1319
- }
1320
- var sideChannel2 = getSideChannel2();
1321
- for (var i = 0; i < objKeys.length; ++i) {
1322
- var key = objKeys[i];
1323
- if (options.skipNulls && obj[key] === null) {
1324
- continue;
1325
- }
1326
- pushToArray(keys, stringify$1(
1327
- obj[key],
1328
- key,
1329
- generateArrayPrefix,
1330
- commaRoundTrip,
1331
- options.allowEmptyArrays,
1332
- options.strictNullHandling,
1333
- options.skipNulls,
1334
- options.encodeDotInKeys,
1335
- options.encode ? options.encoder : null,
1336
- options.filter,
1337
- options.sort,
1338
- options.allowDots,
1339
- options.serializeDate,
1340
- options.format,
1341
- options.formatter,
1342
- options.encodeValuesOnly,
1343
- options.charset,
1344
- sideChannel2
1345
- ));
1346
- }
1347
- var joined = keys.join(options.delimiter);
1348
- var prefix = options.addQueryPrefix === true ? "?" : "";
1349
- if (options.charsetSentinel) {
1350
- if (options.charset === "iso-8859-1") {
1351
- prefix += "utf8=%26%2310003%3B&";
1352
- } else {
1353
- prefix += "utf8=%E2%9C%93&";
1354
- }
1355
- }
1356
- return joined.length > 0 ? prefix + joined : "";
1357
- };
1358
- var utils = utils$2;
1359
- var has = Object.prototype.hasOwnProperty;
1360
- var isArray = Array.isArray;
1361
- var defaults = {
1362
- allowDots: false,
1363
- allowEmptyArrays: false,
1364
- allowPrototypes: false,
1365
- allowSparse: false,
1366
- arrayLimit: 20,
1367
- charset: "utf-8",
1368
- charsetSentinel: false,
1369
- comma: false,
1370
- decodeDotInKeys: false,
1371
- decoder: utils.decode,
1372
- delimiter: "&",
1373
- depth: 5,
1374
- duplicates: "combine",
1375
- ignoreQueryPrefix: false,
1376
- interpretNumericEntities: false,
1377
- parameterLimit: 1e3,
1378
- parseArrays: true,
1379
- plainObjects: false,
1380
- strictDepth: false,
1381
- strictNullHandling: false
1382
- };
1383
- var interpretNumericEntities = function(str) {
1384
- return str.replace(/&#(\d+);/g, function($0, numberStr) {
1385
- return String.fromCharCode(parseInt(numberStr, 10));
1386
- });
1387
- };
1388
- var parseArrayValue = function(val, options) {
1389
- if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) {
1390
- return val.split(",");
1391
- }
1392
- return val;
1393
- };
1394
- var isoSentinel = "utf8=%26%2310003%3B";
1395
- var charsetSentinel = "utf8=%E2%9C%93";
1396
- var parseValues = function parseQueryStringValues(str, options) {
1397
- var obj = { __proto__: null };
1398
- var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
1399
- cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
1400
- var limit2 = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
1401
- var parts = cleanStr.split(options.delimiter, limit2);
1402
- var skipIndex = -1;
1403
- var i;
1404
- var charset = options.charset;
1405
- if (options.charsetSentinel) {
1406
- for (i = 0; i < parts.length; ++i) {
1407
- if (parts[i].indexOf("utf8=") === 0) {
1408
- if (parts[i] === charsetSentinel) {
1409
- charset = "utf-8";
1410
- } else if (parts[i] === isoSentinel) {
1411
- charset = "iso-8859-1";
1412
- }
1413
- skipIndex = i;
1414
- i = parts.length;
1415
- }
1416
- }
1417
- }
1418
- for (i = 0; i < parts.length; ++i) {
1419
- if (i === skipIndex) {
1420
- continue;
1421
- }
1422
- var part = parts[i];
1423
- var bracketEqualsPos = part.indexOf("]=");
1424
- var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
1425
- var key, val;
1426
- if (pos === -1) {
1427
- key = options.decoder(part, defaults.decoder, charset, "key");
1428
- val = options.strictNullHandling ? null : "";
1429
- } else {
1430
- key = options.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
1431
- val = utils.maybeMap(
1432
- parseArrayValue(part.slice(pos + 1), options),
1433
- function(encodedVal) {
1434
- return options.decoder(encodedVal, defaults.decoder, charset, "value");
1435
- }
1436
- );
1437
- }
1438
- if (val && options.interpretNumericEntities && charset === "iso-8859-1") {
1439
- val = interpretNumericEntities(val);
1440
- }
1441
- if (part.indexOf("[]=") > -1) {
1442
- val = isArray(val) ? [val] : val;
1443
- }
1444
- var existing = has.call(obj, key);
1445
- if (existing && options.duplicates === "combine") {
1446
- obj[key] = utils.combine(obj[key], val);
1447
- } else if (!existing || options.duplicates === "last") {
1448
- obj[key] = val;
1449
- }
1450
- }
1451
- return obj;
1452
- };
1453
- var parseObject = function(chain, val, options, valuesParsed) {
1454
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
1455
- for (var i = chain.length - 1; i >= 0; --i) {
1456
- var obj;
1457
- var root = chain[i];
1458
- if (root === "[]" && options.parseArrays) {
1459
- obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf);
1460
- } else {
1461
- obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
1462
- var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
1463
- var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
1464
- var index = parseInt(decodedRoot, 10);
1465
- if (!options.parseArrays && decodedRoot === "") {
1466
- obj = { 0: leaf };
1467
- } else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) {
1468
- obj = [];
1469
- obj[index] = leaf;
1470
- } else if (decodedRoot !== "__proto__") {
1471
- obj[decodedRoot] = leaf;
1472
- }
1473
- }
1474
- leaf = obj;
1475
- }
1476
- return leaf;
1477
- };
1478
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
1479
- if (!givenKey) {
1480
- return;
1481
- }
1482
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
1483
- var brackets2 = /(\[[^[\]]*])/;
1484
- var child = /(\[[^[\]]*])/g;
1485
- var segment = options.depth > 0 && brackets2.exec(key);
1486
- var parent = segment ? key.slice(0, segment.index) : key;
1487
- var keys = [];
1488
- if (parent) {
1489
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
1490
- if (!options.allowPrototypes) {
1491
- return;
1492
- }
1493
- }
1494
- keys.push(parent);
1495
- }
1496
- var i = 0;
1497
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
1498
- i += 1;
1499
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
1500
- if (!options.allowPrototypes) {
1501
- return;
1502
- }
1503
- }
1504
- keys.push(segment[1]);
1505
- }
1506
- if (segment) {
1507
- if (options.strictDepth === true) {
1508
- throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
1509
- }
1510
- keys.push("[" + key.slice(segment.index) + "]");
1511
- }
1512
- return parseObject(keys, val, options, valuesParsed);
1513
- };
1514
- var normalizeParseOptions = function normalizeParseOptions2(opts) {
1515
- if (!opts) {
1516
- return defaults;
1517
- }
1518
- if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
1519
- throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1520
- }
1521
- if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") {
1522
- throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
1523
- }
1524
- if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") {
1525
- throw new TypeError("Decoder has to be a function.");
1526
- }
1527
- if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
1528
- throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1529
- }
1530
- var charset = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
1531
- var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
1532
- if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") {
1533
- throw new TypeError("The duplicates option must be either combine, first, or last");
1534
- }
1535
- var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
1536
- return {
1537
- allowDots,
1538
- allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
1539
- allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
1540
- allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
1541
- arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults.arrayLimit,
1542
- charset,
1543
- charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
1544
- comma: typeof opts.comma === "boolean" ? opts.comma : defaults.comma,
1545
- decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
1546
- decoder: typeof opts.decoder === "function" ? opts.decoder : defaults.decoder,
1547
- delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
1548
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
1549
- depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults.depth,
1550
- duplicates,
1551
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
1552
- interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
1553
- parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
1554
- parseArrays: opts.parseArrays !== false,
1555
- plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
1556
- strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
1557
- strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
1558
- };
1559
- };
1560
- var parse$2 = function(str, opts) {
1561
- var options = normalizeParseOptions(opts);
1562
- if (str === "" || str === null || typeof str === "undefined") {
1563
- return options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
1564
- }
1565
- var tempObj = typeof str === "string" ? parseValues(str, options) : str;
1566
- var obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
1567
- var keys = Object.keys(tempObj);
1568
- for (var i = 0; i < keys.length; ++i) {
1569
- var key = keys[i];
1570
- var newObj = parseKeys(key, tempObj[key], options, typeof str === "string");
1571
- obj = utils.merge(obj, newObj, options);
1572
- }
1573
- if (options.allowSparse === true) {
1574
- return obj;
1575
- }
1576
- return utils.compact(obj);
1577
- };
1578
- var stringify2 = stringify_1;
1579
- var parse$1 = parse$2;
1580
- var formats = formats$3;
1581
- var lib = {
1582
- formats,
1583
- parse: parse$1,
1584
- stringify: stringify2
1585
- };
1586
- const require$$1 = /* @__PURE__ */ getDefaultExportFromCjs(lib);
1587
- var punycode = require$$0$1;
1588
- function Url() {
1589
- this.protocol = null;
1590
- this.slashes = null;
1591
- this.auth = null;
1592
- this.host = null;
1593
- this.port = null;
1594
- this.hostname = null;
1595
- this.hash = null;
1596
- this.search = null;
1597
- this.query = null;
1598
- this.pathname = null;
1599
- this.path = null;
1600
- this.href = null;
1601
- }
1602
- var protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, delims = [
1603
- "<",
1604
- ">",
1605
- '"',
1606
- "`",
1607
- " ",
1608
- "\r",
1609
- "\n",
1610
- " "
1611
- ], unwise = [
1612
- "{",
1613
- "}",
1614
- "|",
1615
- "\\",
1616
- "^",
1617
- "`"
1618
- ].concat(delims), autoEscape = ["'"].concat(unwise), nonHostChars = [
1619
- "%",
1620
- "/",
1621
- "?",
1622
- ";",
1623
- "#"
1624
- ].concat(autoEscape), hostEndingChars = [
1625
- "/",
1626
- "?",
1627
- "#"
1628
- ], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = {
1629
- javascript: true,
1630
- "javascript:": true
1631
- }, hostlessProtocol = {
1632
- javascript: true,
1633
- "javascript:": true
1634
- }, slashedProtocol = {
1635
- http: true,
1636
- https: true,
1637
- ftp: true,
1638
- gopher: true,
1639
- file: true,
1640
- "http:": true,
1641
- "https:": true,
1642
- "ftp:": true,
1643
- "gopher:": true,
1644
- "file:": true
1645
- }, querystring = require$$1;
1646
- function urlParse(url2, parseQueryString, slashesDenoteHost) {
1647
- if (url2 && typeof url2 === "object" && url2 instanceof Url) {
1648
- return url2;
1649
- }
1650
- var u = new Url();
1651
- u.parse(url2, parseQueryString, slashesDenoteHost);
1652
- return u;
1653
- }
1654
- Url.prototype.parse = function(url2, parseQueryString, slashesDenoteHost) {
1655
- if (typeof url2 !== "string") {
1656
- throw new TypeError("Parameter 'url' must be a string, not " + typeof url2);
1657
- }
1658
- var queryIndex = url2.indexOf("?"), splitter = queryIndex !== -1 && queryIndex < url2.indexOf("#") ? "?" : "#", uSplit = url2.split(splitter), slashRegex = /\\/g;
1659
- uSplit[0] = uSplit[0].replace(slashRegex, "/");
1660
- url2 = uSplit.join(splitter);
1661
- var rest = url2;
1662
- rest = rest.trim();
1663
- if (!slashesDenoteHost && url2.split("#").length === 1) {
1664
- var simplePath = simplePathPattern.exec(rest);
1665
- if (simplePath) {
1666
- this.path = rest;
1667
- this.href = rest;
1668
- this.pathname = simplePath[1];
1669
- if (simplePath[2]) {
1670
- this.search = simplePath[2];
1671
- if (parseQueryString) {
1672
- this.query = querystring.parse(this.search.substr(1));
1673
- } else {
1674
- this.query = this.search.substr(1);
1675
- }
1676
- } else if (parseQueryString) {
1677
- this.search = "";
1678
- this.query = {};
1679
- }
1680
- return this;
1681
- }
1682
- }
1683
- var proto = protocolPattern.exec(rest);
1684
- if (proto) {
1685
- proto = proto[0];
1686
- var lowerProto = proto.toLowerCase();
1687
- this.protocol = lowerProto;
1688
- rest = rest.substr(proto.length);
1689
- }
1690
- if (slashesDenoteHost || proto || rest.match(/^\/\/[^@/]+@[^@/]+/)) {
1691
- var slashes = rest.substr(0, 2) === "//";
1692
- if (slashes && !(proto && hostlessProtocol[proto])) {
1693
- rest = rest.substr(2);
1694
- this.slashes = true;
1695
- }
1696
- }
1697
- if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {
1698
- var hostEnd = -1;
1699
- for (var i = 0; i < hostEndingChars.length; i++) {
1700
- var hec = rest.indexOf(hostEndingChars[i]);
1701
- if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
1702
- hostEnd = hec;
1703
- }
1704
- }
1705
- var auth, atSign;
1706
- if (hostEnd === -1) {
1707
- atSign = rest.lastIndexOf("@");
1708
- } else {
1709
- atSign = rest.lastIndexOf("@", hostEnd);
1710
- }
1711
- if (atSign !== -1) {
1712
- auth = rest.slice(0, atSign);
1713
- rest = rest.slice(atSign + 1);
1714
- this.auth = decodeURIComponent(auth);
1715
- }
1716
- hostEnd = -1;
1717
- for (var i = 0; i < nonHostChars.length; i++) {
1718
- var hec = rest.indexOf(nonHostChars[i]);
1719
- if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
1720
- hostEnd = hec;
1721
- }
1722
- }
1723
- if (hostEnd === -1) {
1724
- hostEnd = rest.length;
1725
- }
1726
- this.host = rest.slice(0, hostEnd);
1727
- rest = rest.slice(hostEnd);
1728
- this.parseHost();
1729
- this.hostname = this.hostname || "";
1730
- var ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
1731
- if (!ipv6Hostname) {
1732
- var hostparts = this.hostname.split(/\./);
1733
- for (var i = 0, l = hostparts.length; i < l; i++) {
1734
- var part = hostparts[i];
1735
- if (!part) {
1736
- continue;
1737
- }
1738
- if (!part.match(hostnamePartPattern)) {
1739
- var newpart = "";
1740
- for (var j = 0, k = part.length; j < k; j++) {
1741
- if (part.charCodeAt(j) > 127) {
1742
- newpart += "x";
1743
- } else {
1744
- newpart += part[j];
1745
- }
1746
- }
1747
- if (!newpart.match(hostnamePartPattern)) {
1748
- var validParts = hostparts.slice(0, i);
1749
- var notHost = hostparts.slice(i + 1);
1750
- var bit = part.match(hostnamePartStart);
1751
- if (bit) {
1752
- validParts.push(bit[1]);
1753
- notHost.unshift(bit[2]);
1754
- }
1755
- if (notHost.length) {
1756
- rest = "/" + notHost.join(".") + rest;
1757
- }
1758
- this.hostname = validParts.join(".");
1759
- break;
1760
- }
1761
- }
1762
- }
1763
- }
1764
- if (this.hostname.length > hostnameMaxLen) {
1765
- this.hostname = "";
1766
- } else {
1767
- this.hostname = this.hostname.toLowerCase();
1768
- }
1769
- if (!ipv6Hostname) {
1770
- this.hostname = punycode.toASCII(this.hostname);
1771
- }
1772
- var p = this.port ? ":" + this.port : "";
1773
- var h = this.hostname || "";
1774
- this.host = h + p;
1775
- this.href += this.host;
1776
- if (ipv6Hostname) {
1777
- this.hostname = this.hostname.substr(1, this.hostname.length - 2);
1778
- if (rest[0] !== "/") {
1779
- rest = "/" + rest;
1780
- }
1781
- }
1782
- }
1783
- if (!unsafeProtocol[lowerProto]) {
1784
- for (var i = 0, l = autoEscape.length; i < l; i++) {
1785
- var ae = autoEscape[i];
1786
- if (rest.indexOf(ae) === -1) {
1787
- continue;
1788
- }
1789
- var esc = encodeURIComponent(ae);
1790
- if (esc === ae) {
1791
- esc = escape(ae);
1792
- }
1793
- rest = rest.split(ae).join(esc);
1794
- }
1795
- }
1796
- var hash = rest.indexOf("#");
1797
- if (hash !== -1) {
1798
- this.hash = rest.substr(hash);
1799
- rest = rest.slice(0, hash);
1800
- }
1801
- var qm = rest.indexOf("?");
1802
- if (qm !== -1) {
1803
- this.search = rest.substr(qm);
1804
- this.query = rest.substr(qm + 1);
1805
- if (parseQueryString) {
1806
- this.query = querystring.parse(this.query);
1807
- }
1808
- rest = rest.slice(0, qm);
1809
- } else if (parseQueryString) {
1810
- this.search = "";
1811
- this.query = {};
1812
- }
1813
- if (rest) {
1814
- this.pathname = rest;
1815
- }
1816
- if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {
1817
- this.pathname = "/";
1818
- }
1819
- if (this.pathname || this.search) {
1820
- var p = this.pathname || "";
1821
- var s = this.search || "";
1822
- this.path = p + s;
1823
- }
1824
- this.href = this.format();
1825
- return this;
1826
- };
1827
- function urlFormat(obj) {
1828
- if (typeof obj === "string") {
1829
- obj = urlParse(obj);
1830
- }
1831
- if (!(obj instanceof Url)) {
1832
- return Url.prototype.format.call(obj);
1833
- }
1834
- return obj.format();
1835
- }
1836
- Url.prototype.format = function() {
1837
- var auth = this.auth || "";
1838
- if (auth) {
1839
- auth = encodeURIComponent(auth);
1840
- auth = auth.replace(/%3A/i, ":");
1841
- auth += "@";
1842
- }
1843
- var protocol = this.protocol || "", pathname = this.pathname || "", hash = this.hash || "", host = false, query = "";
1844
- if (this.host) {
1845
- host = auth + this.host;
1846
- } else if (this.hostname) {
1847
- host = auth + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]");
1848
- if (this.port) {
1849
- host += ":" + this.port;
1850
- }
1851
- }
1852
- if (this.query && typeof this.query === "object" && Object.keys(this.query).length) {
1853
- query = querystring.stringify(this.query, {
1854
- arrayFormat: "repeat",
1855
- addQueryPrefix: false
1856
- });
1857
- }
1858
- var search = this.search || query && "?" + query || "";
1859
- if (protocol && protocol.substr(-1) !== ":") {
1860
- protocol += ":";
1861
- }
1862
- if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) {
1863
- host = "//" + (host || "");
1864
- if (pathname && pathname.charAt(0) !== "/") {
1865
- pathname = "/" + pathname;
1866
- }
1867
- } else if (!host) {
1868
- host = "";
1869
- }
1870
- if (hash && hash.charAt(0) !== "#") {
1871
- hash = "#" + hash;
1872
- }
1873
- if (search && search.charAt(0) !== "?") {
1874
- search = "?" + search;
1875
- }
1876
- pathname = pathname.replace(/[?#]/g, function(match) {
1877
- return encodeURIComponent(match);
1878
- });
1879
- search = search.replace("#", "%23");
1880
- return protocol + host + pathname + search + hash;
1881
- };
1882
- function urlResolve(source, relative) {
1883
- return urlParse(source, false, true).resolve(relative);
1884
- }
1885
- Url.prototype.resolve = function(relative) {
1886
- return this.resolveObject(urlParse(relative, false, true)).format();
1887
- };
1888
- function urlResolveObject(source, relative) {
1889
- if (!source) {
1890
- return relative;
1891
- }
1892
- return urlParse(source, false, true).resolveObject(relative);
1893
- }
1894
- Url.prototype.resolveObject = function(relative) {
1895
- if (typeof relative === "string") {
1896
- var rel = new Url();
1897
- rel.parse(relative, false, true);
1898
- relative = rel;
1899
- }
1900
- var result = new Url();
1901
- var tkeys = Object.keys(this);
1902
- for (var tk = 0; tk < tkeys.length; tk++) {
1903
- var tkey = tkeys[tk];
1904
- result[tkey] = this[tkey];
1905
- }
1906
- result.hash = relative.hash;
1907
- if (relative.href === "") {
1908
- result.href = result.format();
1909
- return result;
1910
- }
1911
- if (relative.slashes && !relative.protocol) {
1912
- var rkeys = Object.keys(relative);
1913
- for (var rk = 0; rk < rkeys.length; rk++) {
1914
- var rkey = rkeys[rk];
1915
- if (rkey !== "protocol") {
1916
- result[rkey] = relative[rkey];
1917
- }
1918
- }
1919
- if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) {
1920
- result.pathname = "/";
1921
- result.path = result.pathname;
1922
- }
1923
- result.href = result.format();
1924
- return result;
1925
- }
1926
- if (relative.protocol && relative.protocol !== result.protocol) {
1927
- if (!slashedProtocol[relative.protocol]) {
1928
- var keys = Object.keys(relative);
1929
- for (var v = 0; v < keys.length; v++) {
1930
- var k = keys[v];
1931
- result[k] = relative[k];
1932
- }
1933
- result.href = result.format();
1934
- return result;
1935
- }
1936
- result.protocol = relative.protocol;
1937
- if (!relative.host && !hostlessProtocol[relative.protocol]) {
1938
- var relPath = (relative.pathname || "").split("/");
1939
- while (relPath.length && !(relative.host = relPath.shift())) {
1940
- }
1941
- if (!relative.host) {
1942
- relative.host = "";
1943
- }
1944
- if (!relative.hostname) {
1945
- relative.hostname = "";
1946
- }
1947
- if (relPath[0] !== "") {
1948
- relPath.unshift("");
1949
- }
1950
- if (relPath.length < 2) {
1951
- relPath.unshift("");
1952
- }
1953
- result.pathname = relPath.join("/");
1954
- } else {
1955
- result.pathname = relative.pathname;
1956
- }
1957
- result.search = relative.search;
1958
- result.query = relative.query;
1959
- result.host = relative.host || "";
1960
- result.auth = relative.auth;
1961
- result.hostname = relative.hostname || relative.host;
1962
- result.port = relative.port;
1963
- if (result.pathname || result.search) {
1964
- var p = result.pathname || "";
1965
- var s = result.search || "";
1966
- result.path = p + s;
1967
- }
1968
- result.slashes = result.slashes || relative.slashes;
1969
- result.href = result.format();
1970
- return result;
1971
- }
1972
- var isSourceAbs = result.pathname && result.pathname.charAt(0) === "/", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === "/", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split("/") || [], relPath = relative.pathname && relative.pathname.split("/") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];
1973
- if (psychotic) {
1974
- result.hostname = "";
1975
- result.port = null;
1976
- if (result.host) {
1977
- if (srcPath[0] === "") {
1978
- srcPath[0] = result.host;
1979
- } else {
1980
- srcPath.unshift(result.host);
1981
- }
1982
- }
1983
- result.host = "";
1984
- if (relative.protocol) {
1985
- relative.hostname = null;
1986
- relative.port = null;
1987
- if (relative.host) {
1988
- if (relPath[0] === "") {
1989
- relPath[0] = relative.host;
1990
- } else {
1991
- relPath.unshift(relative.host);
1992
- }
1993
- }
1994
- relative.host = null;
1995
- }
1996
- mustEndAbs = mustEndAbs && (relPath[0] === "" || srcPath[0] === "");
1997
- }
1998
- if (isRelAbs) {
1999
- result.host = relative.host || relative.host === "" ? relative.host : result.host;
2000
- result.hostname = relative.hostname || relative.hostname === "" ? relative.hostname : result.hostname;
2001
- result.search = relative.search;
2002
- result.query = relative.query;
2003
- srcPath = relPath;
2004
- } else if (relPath.length) {
2005
- if (!srcPath) {
2006
- srcPath = [];
2007
- }
2008
- srcPath.pop();
2009
- srcPath = srcPath.concat(relPath);
2010
- result.search = relative.search;
2011
- result.query = relative.query;
2012
- } else if (relative.search != null) {
2013
- if (psychotic) {
2014
- result.host = srcPath.shift();
2015
- result.hostname = result.host;
2016
- var authInHost = result.host && result.host.indexOf("@") > 0 ? result.host.split("@") : false;
2017
- if (authInHost) {
2018
- result.auth = authInHost.shift();
2019
- result.hostname = authInHost.shift();
2020
- result.host = result.hostname;
2021
- }
2022
- }
2023
- result.search = relative.search;
2024
- result.query = relative.query;
2025
- if (result.pathname !== null || result.search !== null) {
2026
- result.path = (result.pathname ? result.pathname : "") + (result.search ? result.search : "");
2027
- }
2028
- result.href = result.format();
2029
- return result;
2030
- }
2031
- if (!srcPath.length) {
2032
- result.pathname = null;
2033
- if (result.search) {
2034
- result.path = "/" + result.search;
2035
- } else {
2036
- result.path = null;
2037
- }
2038
- result.href = result.format();
2039
- return result;
2040
- }
2041
- var last = srcPath.slice(-1)[0];
2042
- var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === "." || last === "..") || last === "";
2043
- var up = 0;
2044
- for (var i = srcPath.length; i >= 0; i--) {
2045
- last = srcPath[i];
2046
- if (last === ".") {
2047
- srcPath.splice(i, 1);
2048
- } else if (last === "..") {
2049
- srcPath.splice(i, 1);
2050
- up++;
2051
- } else if (up) {
2052
- srcPath.splice(i, 1);
2053
- up--;
2054
- }
2055
- }
2056
- if (!mustEndAbs && !removeAllDots) {
2057
- for (; up--; up) {
2058
- srcPath.unshift("..");
2059
- }
2060
- }
2061
- if (mustEndAbs && srcPath[0] !== "" && (!srcPath[0] || srcPath[0].charAt(0) !== "/")) {
2062
- srcPath.unshift("");
2063
- }
2064
- if (hasTrailingSlash && srcPath.join("/").substr(-1) !== "/") {
2065
- srcPath.push("");
2066
- }
2067
- var isAbsolute = srcPath[0] === "" || srcPath[0] && srcPath[0].charAt(0) === "/";
2068
- if (psychotic) {
2069
- result.hostname = isAbsolute ? "" : srcPath.length ? srcPath.shift() : "";
2070
- result.host = result.hostname;
2071
- var authInHost = result.host && result.host.indexOf("@") > 0 ? result.host.split("@") : false;
2072
- if (authInHost) {
2073
- result.auth = authInHost.shift();
2074
- result.hostname = authInHost.shift();
2075
- result.host = result.hostname;
2076
- }
2077
- }
2078
- mustEndAbs = mustEndAbs || result.host && srcPath.length;
2079
- if (mustEndAbs && !isAbsolute) {
2080
- srcPath.unshift("");
2081
- }
2082
- if (srcPath.length > 0) {
2083
- result.pathname = srcPath.join("/");
2084
- } else {
2085
- result.pathname = null;
2086
- result.path = null;
2087
- }
2088
- if (result.pathname !== null || result.search !== null) {
2089
- result.path = (result.pathname ? result.pathname : "") + (result.search ? result.search : "");
2090
- }
2091
- result.auth = relative.auth || result.auth;
2092
- result.slashes = result.slashes || relative.slashes;
2093
- result.href = result.format();
2094
- return result;
2095
- };
2096
- Url.prototype.parseHost = function() {
2097
- var host = this.host;
2098
- var port = portPattern.exec(host);
2099
- if (port) {
2100
- port = port[0];
2101
- if (port !== ":") {
2102
- this.port = port.substr(1);
2103
- }
2104
- host = host.substr(0, host.length - port.length);
2105
- }
2106
- if (host) {
2107
- this.hostname = host;
2108
- }
2109
- };
2110
- var parse = urlParse;
2111
- var resolve$1 = urlResolve;
2112
- var resolveObject = urlResolveObject;
2113
- var format = urlFormat;
2114
- var Url_1 = Url;
2115
- function normalizeArray(parts, allowAboveRoot) {
2116
- var up = 0;
2117
- for (var i = parts.length - 1; i >= 0; i--) {
2118
- var last = parts[i];
2119
- if (last === ".") {
2120
- parts.splice(i, 1);
2121
- } else if (last === "..") {
2122
- parts.splice(i, 1);
2123
- up++;
2124
- } else if (up) {
2125
- parts.splice(i, 1);
2126
- up--;
2127
- }
2128
- }
2129
- if (allowAboveRoot) {
2130
- for (; up--; up) {
2131
- parts.unshift("..");
2132
- }
2133
- }
2134
- return parts;
2135
- }
2136
- function resolve() {
2137
- var resolvedPath = "", resolvedAbsolute = false;
2138
- for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
2139
- var path = i >= 0 ? arguments[i] : "/";
2140
- if (typeof path !== "string") {
2141
- throw new TypeError("Arguments to path.resolve must be strings");
2142
- } else if (!path) {
2143
- continue;
2144
- }
2145
- resolvedPath = path + "/" + resolvedPath;
2146
- resolvedAbsolute = path.charAt(0) === "/";
2147
- }
2148
- resolvedPath = normalizeArray(filter(resolvedPath.split("/"), function(p) {
2149
- return !!p;
2150
- }), !resolvedAbsolute).join("/");
2151
- return (resolvedAbsolute ? "/" : "") + resolvedPath || ".";
2152
- }
2153
- function filter(xs, f) {
2154
- if (xs.filter) return xs.filter(f);
2155
- var res = [];
2156
- for (var i = 0; i < xs.length; i++) {
2157
- if (f(xs[i], i, xs)) res.push(xs[i]);
2158
- }
2159
- return res;
2160
- }
2161
- var _globalThis = function(Object2) {
2162
- function get() {
2163
- var _global2 = this || self;
2164
- delete Object2.prototype.__magic__;
2165
- return _global2;
2166
- }
2167
- if (typeof globalThis === "object") {
2168
- return globalThis;
2169
- }
2170
- if (this) {
2171
- return get();
2172
- } else {
2173
- Object2.defineProperty(Object2.prototype, "__magic__", {
2174
- configurable: true,
2175
- get
2176
- });
2177
- var _global = __magic__;
2178
- return _global;
2179
- }
2180
- }(Object);
2181
- var formatImport = (
2182
- /** @type {formatImport}*/
2183
- format
2184
- );
2185
- var parseImport = (
2186
- /** @type {parseImport}*/
2187
- parse
2188
- );
2189
- var resolveImport = (
2190
- /** @type {resolveImport}*/
2191
- resolve$1
2192
- );
2193
- var UrlImport = (
2194
- /** @type {UrlImport}*/
2195
- Url_1
2196
- );
2197
- var URL = _globalThis.URL;
2198
- var URLSearchParams = _globalThis.URLSearchParams;
2199
- var percentRegEx = /%/g;
2200
- var backslashRegEx = /\\/g;
2201
- var newlineRegEx = /\n/g;
2202
- var carriageReturnRegEx = /\r/g;
2203
- var tabRegEx = /\t/g;
2204
- var CHAR_FORWARD_SLASH = 47;
2205
- function isURLInstance(instance) {
2206
- var resolved = (
2207
- /** @type {URL|null} */
2208
- instance != null ? instance : null
2209
- );
2210
- return Boolean(resolved !== null && (resolved == null ? void 0 : resolved.href) && (resolved == null ? void 0 : resolved.origin));
2211
- }
2212
- function getPathFromURLPosix(url2) {
2213
- if (url2.hostname !== "") {
2214
- throw new TypeError('File URL host must be "localhost" or empty on browser');
2215
- }
2216
- var pathname = url2.pathname;
2217
- for (var n = 0; n < pathname.length; n++) {
2218
- if (pathname[n] === "%") {
2219
- var third = pathname.codePointAt(n + 2) | 32;
2220
- if (pathname[n + 1] === "2" && third === 102) {
2221
- throw new TypeError("File URL path must not include encoded / characters");
2222
- }
2223
- }
2224
- }
2225
- return decodeURIComponent(pathname);
2226
- }
2227
- function encodePathChars(filepath) {
2228
- if (filepath.includes("%")) {
2229
- filepath = filepath.replace(percentRegEx, "%25");
2230
- }
2231
- if (filepath.includes("\\")) {
2232
- filepath = filepath.replace(backslashRegEx, "%5C");
2233
- }
2234
- if (filepath.includes("\n")) {
2235
- filepath = filepath.replace(newlineRegEx, "%0A");
2236
- }
2237
- if (filepath.includes("\r")) {
2238
- filepath = filepath.replace(carriageReturnRegEx, "%0D");
2239
- }
2240
- if (filepath.includes(" ")) {
2241
- filepath = filepath.replace(tabRegEx, "%09");
2242
- }
2243
- return filepath;
2244
- }
2245
- var domainToASCII = (
2246
- /**
2247
- * @type {domainToASCII}
2248
- */
2249
- function domainToASCII2(domain) {
2250
- if (typeof domain === "undefined") {
2251
- throw new TypeError('The "domain" argument must be specified');
2252
- }
2253
- return new URL("http://" + domain).hostname;
2254
- }
2255
- );
2256
- var domainToUnicode = (
2257
- /**
2258
- * @type {domainToUnicode}
2259
- */
2260
- function domainToUnicode2(domain) {
2261
- if (typeof domain === "undefined") {
2262
- throw new TypeError('The "domain" argument must be specified');
2263
- }
2264
- return new URL("http://" + domain).hostname;
2265
- }
2266
- );
2267
- var pathToFileURL = (
2268
- /**
2269
- * @type {(url: string) => URL}
2270
- */
2271
- function pathToFileURL2(filepath) {
2272
- var outURL = new URL("file://");
2273
- var resolved = resolve(filepath);
2274
- var filePathLast = filepath.charCodeAt(filepath.length - 1);
2275
- if (filePathLast === CHAR_FORWARD_SLASH && resolved[resolved.length - 1] !== "/") {
2276
- resolved += "/";
2277
- }
2278
- outURL.pathname = encodePathChars(resolved);
2279
- return outURL;
2280
- }
2281
- );
2282
- var fileURLToPath = (
2283
- /**
2284
- * @type {fileURLToPath & ((path: string | URL) => string)}
2285
- */
2286
- function fileURLToPath2(path) {
2287
- if (!isURLInstance(path) && typeof path !== "string") {
2288
- throw new TypeError('The "path" argument must be of type string or an instance of URL. Received type ' + typeof path + " (" + path + ")");
2289
- }
2290
- var resolved = new URL(path);
2291
- if (resolved.protocol !== "file:") {
2292
- throw new TypeError("The URL must be of scheme file");
2293
- }
2294
- return getPathFromURLPosix(resolved);
2295
- }
2296
- );
2297
- var formatImportWithOverloads = (
2298
- /**
2299
- * @type {(
2300
- * ((urlObject: URL, options?: URLFormatOptions) => string) &
2301
- * ((urlObject: UrlObject | string, options?: never) => string)
2302
- * )}
2303
- */
2304
- function formatImportWithOverloads2(urlObject, options) {
2305
- var _options$auth, _options$fragment, _options$search, _options$unicode;
2306
- if (options === void 0) {
2307
- options = {};
2308
- }
2309
- if (!(urlObject instanceof URL)) {
2310
- return formatImport(urlObject);
2311
- }
2312
- if (typeof options !== "object" || options === null) {
2313
- throw new TypeError('The "options" argument must be of type object.');
2314
- }
2315
- var auth = (_options$auth = options.auth) != null ? _options$auth : true;
2316
- var fragment = (_options$fragment = options.fragment) != null ? _options$fragment : true;
2317
- var search = (_options$search = options.search) != null ? _options$search : true;
2318
- (_options$unicode = options.unicode) != null ? _options$unicode : false;
2319
- var parsed = new URL(urlObject.toString());
2320
- if (!auth) {
2321
- parsed.username = "";
2322
- parsed.password = "";
2323
- }
2324
- if (!fragment) {
2325
- parsed.hash = "";
2326
- }
2327
- if (!search) {
2328
- parsed.search = "";
2329
- }
2330
- return parsed.toString();
2331
- }
2332
- );
2333
- var api = {
2334
- format: formatImportWithOverloads,
2335
- parse: parseImport,
2336
- resolve: resolveImport,
2337
- resolveObject,
2338
- Url: UrlImport,
2339
- URL,
2340
- URLSearchParams,
2341
- domainToASCII,
2342
- domainToUnicode,
2343
- pathToFileURL,
2344
- fileURLToPath
2345
- };
2346
- const url = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2347
- __proto__: null,
2348
- URL,
2349
- URLSearchParams,
2350
- Url: UrlImport,
2351
- default: api,
2352
- domainToASCII,
2353
- domainToUnicode,
2354
- fileURLToPath,
2355
- format: formatImportWithOverloads,
2356
- parse: parseImport,
2357
- pathToFileURL,
2358
- resolve: resolveImport,
2359
- resolveObject
2360
- }, Symbol.toStringTag, { value: "Module" }));
2361
- export {
2362
- url as u
2363
- };
2364
- //# sourceMappingURL=url-DU7sMdfO.js.map