perstack 0.0.86 → 0.0.87

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,1235 @@
1
+ import { __commonJS, __require } from './chunk-E5EEIGMK.js';
2
+
3
+ // ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
4
+ var require_ms = __commonJS({
5
+ "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports$1, module) {
6
+ var s = 1e3;
7
+ var m = s * 60;
8
+ var h = m * 60;
9
+ var d = h * 24;
10
+ var w = d * 7;
11
+ var y = d * 365.25;
12
+ module.exports = function(val, options) {
13
+ options = options || {};
14
+ var type = typeof val;
15
+ if (type === "string" && val.length > 0) {
16
+ return parse(val);
17
+ } else if (type === "number" && isFinite(val)) {
18
+ return options.long ? fmtLong(val) : fmtShort(val);
19
+ }
20
+ throw new Error(
21
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
22
+ );
23
+ };
24
+ function parse(str) {
25
+ str = String(str);
26
+ if (str.length > 100) {
27
+ return;
28
+ }
29
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
30
+ str
31
+ );
32
+ if (!match) {
33
+ return;
34
+ }
35
+ var n = parseFloat(match[1]);
36
+ var type = (match[2] || "ms").toLowerCase();
37
+ switch (type) {
38
+ case "years":
39
+ case "year":
40
+ case "yrs":
41
+ case "yr":
42
+ case "y":
43
+ return n * y;
44
+ case "weeks":
45
+ case "week":
46
+ case "w":
47
+ return n * w;
48
+ case "days":
49
+ case "day":
50
+ case "d":
51
+ return n * d;
52
+ case "hours":
53
+ case "hour":
54
+ case "hrs":
55
+ case "hr":
56
+ case "h":
57
+ return n * h;
58
+ case "minutes":
59
+ case "minute":
60
+ case "mins":
61
+ case "min":
62
+ case "m":
63
+ return n * m;
64
+ case "seconds":
65
+ case "second":
66
+ case "secs":
67
+ case "sec":
68
+ case "s":
69
+ return n * s;
70
+ case "milliseconds":
71
+ case "millisecond":
72
+ case "msecs":
73
+ case "msec":
74
+ case "ms":
75
+ return n;
76
+ default:
77
+ return void 0;
78
+ }
79
+ }
80
+ function fmtShort(ms) {
81
+ var msAbs = Math.abs(ms);
82
+ if (msAbs >= d) {
83
+ return Math.round(ms / d) + "d";
84
+ }
85
+ if (msAbs >= h) {
86
+ return Math.round(ms / h) + "h";
87
+ }
88
+ if (msAbs >= m) {
89
+ return Math.round(ms / m) + "m";
90
+ }
91
+ if (msAbs >= s) {
92
+ return Math.round(ms / s) + "s";
93
+ }
94
+ return ms + "ms";
95
+ }
96
+ function fmtLong(ms) {
97
+ var msAbs = Math.abs(ms);
98
+ if (msAbs >= d) {
99
+ return plural(ms, msAbs, d, "day");
100
+ }
101
+ if (msAbs >= h) {
102
+ return plural(ms, msAbs, h, "hour");
103
+ }
104
+ if (msAbs >= m) {
105
+ return plural(ms, msAbs, m, "minute");
106
+ }
107
+ if (msAbs >= s) {
108
+ return plural(ms, msAbs, s, "second");
109
+ }
110
+ return ms + " ms";
111
+ }
112
+ function plural(ms, msAbs, n, name) {
113
+ var isPlural = msAbs >= n * 1.5;
114
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
115
+ }
116
+ }
117
+ });
118
+
119
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js
120
+ var require_common = __commonJS({
121
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports$1, module) {
122
+ function setup(env) {
123
+ createDebug.debug = createDebug;
124
+ createDebug.default = createDebug;
125
+ createDebug.coerce = coerce;
126
+ createDebug.disable = disable;
127
+ createDebug.enable = enable;
128
+ createDebug.enabled = enabled;
129
+ createDebug.humanize = require_ms();
130
+ createDebug.destroy = destroy;
131
+ Object.keys(env).forEach((key) => {
132
+ createDebug[key] = env[key];
133
+ });
134
+ createDebug.names = [];
135
+ createDebug.skips = [];
136
+ createDebug.formatters = {};
137
+ function selectColor(namespace) {
138
+ let hash = 0;
139
+ for (let i = 0; i < namespace.length; i++) {
140
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
141
+ hash |= 0;
142
+ }
143
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
144
+ }
145
+ createDebug.selectColor = selectColor;
146
+ function createDebug(namespace) {
147
+ let prevTime;
148
+ let enableOverride = null;
149
+ let namespacesCache;
150
+ let enabledCache;
151
+ function debug(...args) {
152
+ if (!debug.enabled) {
153
+ return;
154
+ }
155
+ const self = debug;
156
+ const curr = Number(/* @__PURE__ */ new Date());
157
+ const ms = curr - (prevTime || curr);
158
+ self.diff = ms;
159
+ self.prev = prevTime;
160
+ self.curr = curr;
161
+ prevTime = curr;
162
+ args[0] = createDebug.coerce(args[0]);
163
+ if (typeof args[0] !== "string") {
164
+ args.unshift("%O");
165
+ }
166
+ let index = 0;
167
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
168
+ if (match === "%%") {
169
+ return "%";
170
+ }
171
+ index++;
172
+ const formatter = createDebug.formatters[format];
173
+ if (typeof formatter === "function") {
174
+ const val = args[index];
175
+ match = formatter.call(self, val);
176
+ args.splice(index, 1);
177
+ index--;
178
+ }
179
+ return match;
180
+ });
181
+ createDebug.formatArgs.call(self, args);
182
+ const logFn = self.log || createDebug.log;
183
+ logFn.apply(self, args);
184
+ }
185
+ debug.namespace = namespace;
186
+ debug.useColors = createDebug.useColors();
187
+ debug.color = createDebug.selectColor(namespace);
188
+ debug.extend = extend;
189
+ debug.destroy = createDebug.destroy;
190
+ Object.defineProperty(debug, "enabled", {
191
+ enumerable: true,
192
+ configurable: false,
193
+ get: () => {
194
+ if (enableOverride !== null) {
195
+ return enableOverride;
196
+ }
197
+ if (namespacesCache !== createDebug.namespaces) {
198
+ namespacesCache = createDebug.namespaces;
199
+ enabledCache = createDebug.enabled(namespace);
200
+ }
201
+ return enabledCache;
202
+ },
203
+ set: (v) => {
204
+ enableOverride = v;
205
+ }
206
+ });
207
+ if (typeof createDebug.init === "function") {
208
+ createDebug.init(debug);
209
+ }
210
+ return debug;
211
+ }
212
+ function extend(namespace, delimiter) {
213
+ const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
214
+ newDebug.log = this.log;
215
+ return newDebug;
216
+ }
217
+ function enable(namespaces) {
218
+ createDebug.save(namespaces);
219
+ createDebug.namespaces = namespaces;
220
+ createDebug.names = [];
221
+ createDebug.skips = [];
222
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
223
+ for (const ns of split) {
224
+ if (ns[0] === "-") {
225
+ createDebug.skips.push(ns.slice(1));
226
+ } else {
227
+ createDebug.names.push(ns);
228
+ }
229
+ }
230
+ }
231
+ function matchesTemplate(search, template) {
232
+ let searchIndex = 0;
233
+ let templateIndex = 0;
234
+ let starIndex = -1;
235
+ let matchIndex = 0;
236
+ while (searchIndex < search.length) {
237
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
238
+ if (template[templateIndex] === "*") {
239
+ starIndex = templateIndex;
240
+ matchIndex = searchIndex;
241
+ templateIndex++;
242
+ } else {
243
+ searchIndex++;
244
+ templateIndex++;
245
+ }
246
+ } else if (starIndex !== -1) {
247
+ templateIndex = starIndex + 1;
248
+ matchIndex++;
249
+ searchIndex = matchIndex;
250
+ } else {
251
+ return false;
252
+ }
253
+ }
254
+ while (templateIndex < template.length && template[templateIndex] === "*") {
255
+ templateIndex++;
256
+ }
257
+ return templateIndex === template.length;
258
+ }
259
+ function disable() {
260
+ const namespaces = [
261
+ ...createDebug.names,
262
+ ...createDebug.skips.map((namespace) => "-" + namespace)
263
+ ].join(",");
264
+ createDebug.enable("");
265
+ return namespaces;
266
+ }
267
+ function enabled(name) {
268
+ for (const skip of createDebug.skips) {
269
+ if (matchesTemplate(name, skip)) {
270
+ return false;
271
+ }
272
+ }
273
+ for (const ns of createDebug.names) {
274
+ if (matchesTemplate(name, ns)) {
275
+ return true;
276
+ }
277
+ }
278
+ return false;
279
+ }
280
+ function coerce(val) {
281
+ if (val instanceof Error) {
282
+ return val.stack || val.message;
283
+ }
284
+ return val;
285
+ }
286
+ function destroy() {
287
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
288
+ }
289
+ createDebug.enable(createDebug.load());
290
+ return createDebug;
291
+ }
292
+ module.exports = setup;
293
+ }
294
+ });
295
+
296
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js
297
+ var require_browser = __commonJS({
298
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports$1, module) {
299
+ exports$1.formatArgs = formatArgs;
300
+ exports$1.save = save;
301
+ exports$1.load = load;
302
+ exports$1.useColors = useColors;
303
+ exports$1.storage = localstorage();
304
+ exports$1.destroy = /* @__PURE__ */ (() => {
305
+ let warned = false;
306
+ return () => {
307
+ if (!warned) {
308
+ warned = true;
309
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
310
+ }
311
+ };
312
+ })();
313
+ exports$1.colors = [
314
+ "#0000CC",
315
+ "#0000FF",
316
+ "#0033CC",
317
+ "#0033FF",
318
+ "#0066CC",
319
+ "#0066FF",
320
+ "#0099CC",
321
+ "#0099FF",
322
+ "#00CC00",
323
+ "#00CC33",
324
+ "#00CC66",
325
+ "#00CC99",
326
+ "#00CCCC",
327
+ "#00CCFF",
328
+ "#3300CC",
329
+ "#3300FF",
330
+ "#3333CC",
331
+ "#3333FF",
332
+ "#3366CC",
333
+ "#3366FF",
334
+ "#3399CC",
335
+ "#3399FF",
336
+ "#33CC00",
337
+ "#33CC33",
338
+ "#33CC66",
339
+ "#33CC99",
340
+ "#33CCCC",
341
+ "#33CCFF",
342
+ "#6600CC",
343
+ "#6600FF",
344
+ "#6633CC",
345
+ "#6633FF",
346
+ "#66CC00",
347
+ "#66CC33",
348
+ "#9900CC",
349
+ "#9900FF",
350
+ "#9933CC",
351
+ "#9933FF",
352
+ "#99CC00",
353
+ "#99CC33",
354
+ "#CC0000",
355
+ "#CC0033",
356
+ "#CC0066",
357
+ "#CC0099",
358
+ "#CC00CC",
359
+ "#CC00FF",
360
+ "#CC3300",
361
+ "#CC3333",
362
+ "#CC3366",
363
+ "#CC3399",
364
+ "#CC33CC",
365
+ "#CC33FF",
366
+ "#CC6600",
367
+ "#CC6633",
368
+ "#CC9900",
369
+ "#CC9933",
370
+ "#CCCC00",
371
+ "#CCCC33",
372
+ "#FF0000",
373
+ "#FF0033",
374
+ "#FF0066",
375
+ "#FF0099",
376
+ "#FF00CC",
377
+ "#FF00FF",
378
+ "#FF3300",
379
+ "#FF3333",
380
+ "#FF3366",
381
+ "#FF3399",
382
+ "#FF33CC",
383
+ "#FF33FF",
384
+ "#FF6600",
385
+ "#FF6633",
386
+ "#FF9900",
387
+ "#FF9933",
388
+ "#FFCC00",
389
+ "#FFCC33"
390
+ ];
391
+ function useColors() {
392
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
393
+ return true;
394
+ }
395
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
396
+ return false;
397
+ }
398
+ let m;
399
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
400
+ typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
401
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
402
+ typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
403
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
404
+ }
405
+ function formatArgs(args) {
406
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
407
+ if (!this.useColors) {
408
+ return;
409
+ }
410
+ const c = "color: " + this.color;
411
+ args.splice(1, 0, c, "color: inherit");
412
+ let index = 0;
413
+ let lastC = 0;
414
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
415
+ if (match === "%%") {
416
+ return;
417
+ }
418
+ index++;
419
+ if (match === "%c") {
420
+ lastC = index;
421
+ }
422
+ });
423
+ args.splice(lastC, 0, c);
424
+ }
425
+ exports$1.log = console.debug || console.log || (() => {
426
+ });
427
+ function save(namespaces) {
428
+ try {
429
+ if (namespaces) {
430
+ exports$1.storage.setItem("debug", namespaces);
431
+ } else {
432
+ exports$1.storage.removeItem("debug");
433
+ }
434
+ } catch (error) {
435
+ }
436
+ }
437
+ function load() {
438
+ let r;
439
+ try {
440
+ r = exports$1.storage.getItem("debug") || exports$1.storage.getItem("DEBUG");
441
+ } catch (error) {
442
+ }
443
+ if (!r && typeof process !== "undefined" && "env" in process) {
444
+ r = process.env.DEBUG;
445
+ }
446
+ return r;
447
+ }
448
+ function localstorage() {
449
+ try {
450
+ return localStorage;
451
+ } catch (error) {
452
+ }
453
+ }
454
+ module.exports = require_common()(exports$1);
455
+ var { formatters } = module.exports;
456
+ formatters.j = function(v) {
457
+ try {
458
+ return JSON.stringify(v);
459
+ } catch (error) {
460
+ return "[UnexpectedJSONParseError]: " + error.message;
461
+ }
462
+ };
463
+ }
464
+ });
465
+
466
+ // ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
467
+ var require_has_flag = __commonJS({
468
+ "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports$1, module) {
469
+ module.exports = (flag, argv = process.argv) => {
470
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
471
+ const position = argv.indexOf(prefix + flag);
472
+ const terminatorPosition = argv.indexOf("--");
473
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
474
+ };
475
+ }
476
+ });
477
+
478
+ // ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
479
+ var require_supports_color = __commonJS({
480
+ "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports$1, module) {
481
+ var os = __require("os");
482
+ var tty = __require("tty");
483
+ var hasFlag = require_has_flag();
484
+ var { env } = process;
485
+ var forceColor;
486
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
487
+ forceColor = 0;
488
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
489
+ forceColor = 1;
490
+ }
491
+ if ("FORCE_COLOR" in env) {
492
+ if (env.FORCE_COLOR === "true") {
493
+ forceColor = 1;
494
+ } else if (env.FORCE_COLOR === "false") {
495
+ forceColor = 0;
496
+ } else {
497
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
498
+ }
499
+ }
500
+ function translateLevel(level) {
501
+ if (level === 0) {
502
+ return false;
503
+ }
504
+ return {
505
+ level,
506
+ hasBasic: true,
507
+ has256: level >= 2,
508
+ has16m: level >= 3
509
+ };
510
+ }
511
+ function supportsColor(haveStream, streamIsTTY) {
512
+ if (forceColor === 0) {
513
+ return 0;
514
+ }
515
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
516
+ return 3;
517
+ }
518
+ if (hasFlag("color=256")) {
519
+ return 2;
520
+ }
521
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
522
+ return 0;
523
+ }
524
+ const min = forceColor || 0;
525
+ if (env.TERM === "dumb") {
526
+ return min;
527
+ }
528
+ if (process.platform === "win32") {
529
+ const osRelease = os.release().split(".");
530
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
531
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
532
+ }
533
+ return 1;
534
+ }
535
+ if ("CI" in env) {
536
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
537
+ return 1;
538
+ }
539
+ return min;
540
+ }
541
+ if ("TEAMCITY_VERSION" in env) {
542
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
543
+ }
544
+ if (env.COLORTERM === "truecolor") {
545
+ return 3;
546
+ }
547
+ if ("TERM_PROGRAM" in env) {
548
+ const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
549
+ switch (env.TERM_PROGRAM) {
550
+ case "iTerm.app":
551
+ return version >= 3 ? 3 : 2;
552
+ case "Apple_Terminal":
553
+ return 2;
554
+ }
555
+ }
556
+ if (/-256(color)?$/i.test(env.TERM)) {
557
+ return 2;
558
+ }
559
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
560
+ return 1;
561
+ }
562
+ if ("COLORTERM" in env) {
563
+ return 1;
564
+ }
565
+ return min;
566
+ }
567
+ function getSupportLevel(stream) {
568
+ const level = supportsColor(stream, stream && stream.isTTY);
569
+ return translateLevel(level);
570
+ }
571
+ module.exports = {
572
+ supportsColor: getSupportLevel,
573
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
574
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
575
+ };
576
+ }
577
+ });
578
+
579
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js
580
+ var require_node = __commonJS({
581
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(exports$1, module) {
582
+ var tty = __require("tty");
583
+ var util = __require("util");
584
+ exports$1.init = init;
585
+ exports$1.log = log;
586
+ exports$1.formatArgs = formatArgs;
587
+ exports$1.save = save;
588
+ exports$1.load = load;
589
+ exports$1.useColors = useColors;
590
+ exports$1.destroy = util.deprecate(
591
+ () => {
592
+ },
593
+ "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
594
+ );
595
+ exports$1.colors = [6, 2, 3, 4, 5, 1];
596
+ try {
597
+ const supportsColor = require_supports_color();
598
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
599
+ exports$1.colors = [
600
+ 20,
601
+ 21,
602
+ 26,
603
+ 27,
604
+ 32,
605
+ 33,
606
+ 38,
607
+ 39,
608
+ 40,
609
+ 41,
610
+ 42,
611
+ 43,
612
+ 44,
613
+ 45,
614
+ 56,
615
+ 57,
616
+ 62,
617
+ 63,
618
+ 68,
619
+ 69,
620
+ 74,
621
+ 75,
622
+ 76,
623
+ 77,
624
+ 78,
625
+ 79,
626
+ 80,
627
+ 81,
628
+ 92,
629
+ 93,
630
+ 98,
631
+ 99,
632
+ 112,
633
+ 113,
634
+ 128,
635
+ 129,
636
+ 134,
637
+ 135,
638
+ 148,
639
+ 149,
640
+ 160,
641
+ 161,
642
+ 162,
643
+ 163,
644
+ 164,
645
+ 165,
646
+ 166,
647
+ 167,
648
+ 168,
649
+ 169,
650
+ 170,
651
+ 171,
652
+ 172,
653
+ 173,
654
+ 178,
655
+ 179,
656
+ 184,
657
+ 185,
658
+ 196,
659
+ 197,
660
+ 198,
661
+ 199,
662
+ 200,
663
+ 201,
664
+ 202,
665
+ 203,
666
+ 204,
667
+ 205,
668
+ 206,
669
+ 207,
670
+ 208,
671
+ 209,
672
+ 214,
673
+ 215,
674
+ 220,
675
+ 221
676
+ ];
677
+ }
678
+ } catch (error) {
679
+ }
680
+ exports$1.inspectOpts = Object.keys(process.env).filter((key) => {
681
+ return /^debug_/i.test(key);
682
+ }).reduce((obj, key) => {
683
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
684
+ return k.toUpperCase();
685
+ });
686
+ let val = process.env[key];
687
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
688
+ val = true;
689
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
690
+ val = false;
691
+ } else if (val === "null") {
692
+ val = null;
693
+ } else {
694
+ val = Number(val);
695
+ }
696
+ obj[prop] = val;
697
+ return obj;
698
+ }, {});
699
+ function useColors() {
700
+ return "colors" in exports$1.inspectOpts ? Boolean(exports$1.inspectOpts.colors) : tty.isatty(process.stderr.fd);
701
+ }
702
+ function formatArgs(args) {
703
+ const { namespace: name, useColors: useColors2 } = this;
704
+ if (useColors2) {
705
+ const c = this.color;
706
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
707
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
708
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
709
+ args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
710
+ } else {
711
+ args[0] = getDate() + name + " " + args[0];
712
+ }
713
+ }
714
+ function getDate() {
715
+ if (exports$1.inspectOpts.hideDate) {
716
+ return "";
717
+ }
718
+ return (/* @__PURE__ */ new Date()).toISOString() + " ";
719
+ }
720
+ function log(...args) {
721
+ return process.stderr.write(util.formatWithOptions(exports$1.inspectOpts, ...args) + "\n");
722
+ }
723
+ function save(namespaces) {
724
+ if (namespaces) {
725
+ process.env.DEBUG = namespaces;
726
+ } else {
727
+ delete process.env.DEBUG;
728
+ }
729
+ }
730
+ function load() {
731
+ return process.env.DEBUG;
732
+ }
733
+ function init(debug) {
734
+ debug.inspectOpts = {};
735
+ const keys = Object.keys(exports$1.inspectOpts);
736
+ for (let i = 0; i < keys.length; i++) {
737
+ debug.inspectOpts[keys[i]] = exports$1.inspectOpts[keys[i]];
738
+ }
739
+ }
740
+ module.exports = require_common()(exports$1);
741
+ var { formatters } = module.exports;
742
+ formatters.o = function(v) {
743
+ this.inspectOpts.colors = this.useColors;
744
+ return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
745
+ };
746
+ formatters.O = function(v) {
747
+ this.inspectOpts.colors = this.useColors;
748
+ return util.inspect(v, this.inspectOpts);
749
+ };
750
+ }
751
+ });
752
+
753
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js
754
+ var require_src = __commonJS({
755
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js"(exports$1, module) {
756
+ if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
757
+ module.exports = require_browser();
758
+ } else {
759
+ module.exports = require_node();
760
+ }
761
+ }
762
+ });
763
+
764
+ // ../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js
765
+ var require_helpers = __commonJS({
766
+ "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js"(exports$1) {
767
+ var __createBinding = exports$1 && exports$1.__createBinding || (Object.create ? (function(o, m, k, k2) {
768
+ if (k2 === void 0) k2 = k;
769
+ var desc = Object.getOwnPropertyDescriptor(m, k);
770
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
771
+ desc = { enumerable: true, get: function() {
772
+ return m[k];
773
+ } };
774
+ }
775
+ Object.defineProperty(o, k2, desc);
776
+ }) : (function(o, m, k, k2) {
777
+ if (k2 === void 0) k2 = k;
778
+ o[k2] = m[k];
779
+ }));
780
+ var __setModuleDefault = exports$1 && exports$1.__setModuleDefault || (Object.create ? (function(o, v) {
781
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
782
+ }) : function(o, v) {
783
+ o["default"] = v;
784
+ });
785
+ var __importStar = exports$1 && exports$1.__importStar || function(mod) {
786
+ if (mod && mod.__esModule) return mod;
787
+ var result = {};
788
+ if (mod != null) {
789
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
790
+ }
791
+ __setModuleDefault(result, mod);
792
+ return result;
793
+ };
794
+ Object.defineProperty(exports$1, "__esModule", { value: true });
795
+ exports$1.req = exports$1.json = exports$1.toBuffer = void 0;
796
+ var http = __importStar(__require("http"));
797
+ var https = __importStar(__require("https"));
798
+ async function toBuffer(stream) {
799
+ let length = 0;
800
+ const chunks = [];
801
+ for await (const chunk of stream) {
802
+ length += chunk.length;
803
+ chunks.push(chunk);
804
+ }
805
+ return Buffer.concat(chunks, length);
806
+ }
807
+ exports$1.toBuffer = toBuffer;
808
+ async function json(stream) {
809
+ const buf = await toBuffer(stream);
810
+ const str = buf.toString("utf8");
811
+ try {
812
+ return JSON.parse(str);
813
+ } catch (_err) {
814
+ const err = _err;
815
+ err.message += ` (input: ${str})`;
816
+ throw err;
817
+ }
818
+ }
819
+ exports$1.json = json;
820
+ function req(url, opts = {}) {
821
+ const href = typeof url === "string" ? url : url.href;
822
+ const req2 = (href.startsWith("https:") ? https : http).request(url, opts);
823
+ const promise = new Promise((resolve, reject) => {
824
+ req2.once("response", resolve).once("error", reject).end();
825
+ });
826
+ req2.then = promise.then.bind(promise);
827
+ return req2;
828
+ }
829
+ exports$1.req = req;
830
+ }
831
+ });
832
+
833
+ // ../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js
834
+ var require_dist = __commonJS({
835
+ "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js"(exports$1) {
836
+ var __createBinding = exports$1 && exports$1.__createBinding || (Object.create ? (function(o, m, k, k2) {
837
+ if (k2 === void 0) k2 = k;
838
+ var desc = Object.getOwnPropertyDescriptor(m, k);
839
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
840
+ desc = { enumerable: true, get: function() {
841
+ return m[k];
842
+ } };
843
+ }
844
+ Object.defineProperty(o, k2, desc);
845
+ }) : (function(o, m, k, k2) {
846
+ if (k2 === void 0) k2 = k;
847
+ o[k2] = m[k];
848
+ }));
849
+ var __setModuleDefault = exports$1 && exports$1.__setModuleDefault || (Object.create ? (function(o, v) {
850
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
851
+ }) : function(o, v) {
852
+ o["default"] = v;
853
+ });
854
+ var __importStar = exports$1 && exports$1.__importStar || function(mod) {
855
+ if (mod && mod.__esModule) return mod;
856
+ var result = {};
857
+ if (mod != null) {
858
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
859
+ }
860
+ __setModuleDefault(result, mod);
861
+ return result;
862
+ };
863
+ var __exportStar = exports$1 && exports$1.__exportStar || function(m, exports2) {
864
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
865
+ };
866
+ Object.defineProperty(exports$1, "__esModule", { value: true });
867
+ exports$1.Agent = void 0;
868
+ var net = __importStar(__require("net"));
869
+ var http = __importStar(__require("http"));
870
+ var https_1 = __require("https");
871
+ __exportStar(require_helpers(), exports$1);
872
+ var INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState");
873
+ var Agent = class extends http.Agent {
874
+ constructor(opts) {
875
+ super(opts);
876
+ this[INTERNAL] = {};
877
+ }
878
+ /**
879
+ * Determine whether this is an `http` or `https` request.
880
+ */
881
+ isSecureEndpoint(options) {
882
+ if (options) {
883
+ if (typeof options.secureEndpoint === "boolean") {
884
+ return options.secureEndpoint;
885
+ }
886
+ if (typeof options.protocol === "string") {
887
+ return options.protocol === "https:";
888
+ }
889
+ }
890
+ const { stack } = new Error();
891
+ if (typeof stack !== "string")
892
+ return false;
893
+ return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
894
+ }
895
+ // In order to support async signatures in `connect()` and Node's native
896
+ // connection pooling in `http.Agent`, the array of sockets for each origin
897
+ // has to be updated synchronously. This is so the length of the array is
898
+ // accurate when `addRequest()` is next called. We achieve this by creating a
899
+ // fake socket and adding it to `sockets[origin]` and incrementing
900
+ // `totalSocketCount`.
901
+ incrementSockets(name) {
902
+ if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) {
903
+ return null;
904
+ }
905
+ if (!this.sockets[name]) {
906
+ this.sockets[name] = [];
907
+ }
908
+ const fakeSocket = new net.Socket({ writable: false });
909
+ this.sockets[name].push(fakeSocket);
910
+ this.totalSocketCount++;
911
+ return fakeSocket;
912
+ }
913
+ decrementSockets(name, socket) {
914
+ if (!this.sockets[name] || socket === null) {
915
+ return;
916
+ }
917
+ const sockets = this.sockets[name];
918
+ const index = sockets.indexOf(socket);
919
+ if (index !== -1) {
920
+ sockets.splice(index, 1);
921
+ this.totalSocketCount--;
922
+ if (sockets.length === 0) {
923
+ delete this.sockets[name];
924
+ }
925
+ }
926
+ }
927
+ // In order to properly update the socket pool, we need to call `getName()` on
928
+ // the core `https.Agent` if it is a secureEndpoint.
929
+ getName(options) {
930
+ const secureEndpoint = this.isSecureEndpoint(options);
931
+ if (secureEndpoint) {
932
+ return https_1.Agent.prototype.getName.call(this, options);
933
+ }
934
+ return super.getName(options);
935
+ }
936
+ createSocket(req, options, cb) {
937
+ const connectOpts = {
938
+ ...options,
939
+ secureEndpoint: this.isSecureEndpoint(options)
940
+ };
941
+ const name = this.getName(connectOpts);
942
+ const fakeSocket = this.incrementSockets(name);
943
+ Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => {
944
+ this.decrementSockets(name, fakeSocket);
945
+ if (socket instanceof http.Agent) {
946
+ try {
947
+ return socket.addRequest(req, connectOpts);
948
+ } catch (err) {
949
+ return cb(err);
950
+ }
951
+ }
952
+ this[INTERNAL].currentSocket = socket;
953
+ super.createSocket(req, options, cb);
954
+ }, (err) => {
955
+ this.decrementSockets(name, fakeSocket);
956
+ cb(err);
957
+ });
958
+ }
959
+ createConnection() {
960
+ const socket = this[INTERNAL].currentSocket;
961
+ this[INTERNAL].currentSocket = void 0;
962
+ if (!socket) {
963
+ throw new Error("No socket was returned in the `connect()` function");
964
+ }
965
+ return socket;
966
+ }
967
+ get defaultPort() {
968
+ return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
969
+ }
970
+ set defaultPort(v) {
971
+ if (this[INTERNAL]) {
972
+ this[INTERNAL].defaultPort = v;
973
+ }
974
+ }
975
+ get protocol() {
976
+ return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
977
+ }
978
+ set protocol(v) {
979
+ if (this[INTERNAL]) {
980
+ this[INTERNAL].protocol = v;
981
+ }
982
+ }
983
+ };
984
+ exports$1.Agent = Agent;
985
+ }
986
+ });
987
+
988
+ // ../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js
989
+ var require_parse_proxy_response = __commonJS({
990
+ "../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports$1) {
991
+ var __importDefault = exports$1 && exports$1.__importDefault || function(mod) {
992
+ return mod && mod.__esModule ? mod : { "default": mod };
993
+ };
994
+ Object.defineProperty(exports$1, "__esModule", { value: true });
995
+ exports$1.parseProxyResponse = void 0;
996
+ var debug_1 = __importDefault(require_src());
997
+ var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
998
+ function parseProxyResponse(socket) {
999
+ return new Promise((resolve, reject) => {
1000
+ let buffersLength = 0;
1001
+ const buffers = [];
1002
+ function read() {
1003
+ const b = socket.read();
1004
+ if (b)
1005
+ ondata(b);
1006
+ else
1007
+ socket.once("readable", read);
1008
+ }
1009
+ function cleanup() {
1010
+ socket.removeListener("end", onend);
1011
+ socket.removeListener("error", onerror);
1012
+ socket.removeListener("readable", read);
1013
+ }
1014
+ function onend() {
1015
+ cleanup();
1016
+ debug("onend");
1017
+ reject(new Error("Proxy connection ended before receiving CONNECT response"));
1018
+ }
1019
+ function onerror(err) {
1020
+ cleanup();
1021
+ debug("onerror %o", err);
1022
+ reject(err);
1023
+ }
1024
+ function ondata(b) {
1025
+ buffers.push(b);
1026
+ buffersLength += b.length;
1027
+ const buffered = Buffer.concat(buffers, buffersLength);
1028
+ const endOfHeaders = buffered.indexOf("\r\n\r\n");
1029
+ if (endOfHeaders === -1) {
1030
+ debug("have not received end of HTTP headers yet...");
1031
+ read();
1032
+ return;
1033
+ }
1034
+ const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n");
1035
+ const firstLine = headerParts.shift();
1036
+ if (!firstLine) {
1037
+ socket.destroy();
1038
+ return reject(new Error("No header received from proxy CONNECT response"));
1039
+ }
1040
+ const firstLineParts = firstLine.split(" ");
1041
+ const statusCode = +firstLineParts[1];
1042
+ const statusText = firstLineParts.slice(2).join(" ");
1043
+ const headers = {};
1044
+ for (const header of headerParts) {
1045
+ if (!header)
1046
+ continue;
1047
+ const firstColon = header.indexOf(":");
1048
+ if (firstColon === -1) {
1049
+ socket.destroy();
1050
+ return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
1051
+ }
1052
+ const key = header.slice(0, firstColon).toLowerCase();
1053
+ const value = header.slice(firstColon + 1).trimStart();
1054
+ const current = headers[key];
1055
+ if (typeof current === "string") {
1056
+ headers[key] = [current, value];
1057
+ } else if (Array.isArray(current)) {
1058
+ current.push(value);
1059
+ } else {
1060
+ headers[key] = value;
1061
+ }
1062
+ }
1063
+ debug("got proxy server response: %o %o", firstLine, headers);
1064
+ cleanup();
1065
+ resolve({
1066
+ connect: {
1067
+ statusCode,
1068
+ statusText,
1069
+ headers
1070
+ },
1071
+ buffered
1072
+ });
1073
+ }
1074
+ socket.on("error", onerror);
1075
+ socket.on("end", onend);
1076
+ read();
1077
+ });
1078
+ }
1079
+ exports$1.parseProxyResponse = parseProxyResponse;
1080
+ }
1081
+ });
1082
+
1083
+ // ../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js
1084
+ var require_dist2 = __commonJS({
1085
+ "../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js"(exports$1) {
1086
+ var __createBinding = exports$1 && exports$1.__createBinding || (Object.create ? (function(o, m, k, k2) {
1087
+ if (k2 === void 0) k2 = k;
1088
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1089
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1090
+ desc = { enumerable: true, get: function() {
1091
+ return m[k];
1092
+ } };
1093
+ }
1094
+ Object.defineProperty(o, k2, desc);
1095
+ }) : (function(o, m, k, k2) {
1096
+ if (k2 === void 0) k2 = k;
1097
+ o[k2] = m[k];
1098
+ }));
1099
+ var __setModuleDefault = exports$1 && exports$1.__setModuleDefault || (Object.create ? (function(o, v) {
1100
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1101
+ }) : function(o, v) {
1102
+ o["default"] = v;
1103
+ });
1104
+ var __importStar = exports$1 && exports$1.__importStar || function(mod) {
1105
+ if (mod && mod.__esModule) return mod;
1106
+ var result = {};
1107
+ if (mod != null) {
1108
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1109
+ }
1110
+ __setModuleDefault(result, mod);
1111
+ return result;
1112
+ };
1113
+ var __importDefault = exports$1 && exports$1.__importDefault || function(mod) {
1114
+ return mod && mod.__esModule ? mod : { "default": mod };
1115
+ };
1116
+ Object.defineProperty(exports$1, "__esModule", { value: true });
1117
+ exports$1.HttpsProxyAgent = void 0;
1118
+ var net = __importStar(__require("net"));
1119
+ var tls = __importStar(__require("tls"));
1120
+ var assert_1 = __importDefault(__require("assert"));
1121
+ var debug_1 = __importDefault(require_src());
1122
+ var agent_base_1 = require_dist();
1123
+ var url_1 = __require("url");
1124
+ var parse_proxy_response_1 = require_parse_proxy_response();
1125
+ var debug = (0, debug_1.default)("https-proxy-agent");
1126
+ var setServernameFromNonIpHost = (options) => {
1127
+ if (options.servername === void 0 && options.host && !net.isIP(options.host)) {
1128
+ return {
1129
+ ...options,
1130
+ servername: options.host
1131
+ };
1132
+ }
1133
+ return options;
1134
+ };
1135
+ var HttpsProxyAgent = class extends agent_base_1.Agent {
1136
+ constructor(proxy, opts) {
1137
+ super(opts);
1138
+ this.options = { path: void 0 };
1139
+ this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
1140
+ this.proxyHeaders = opts?.headers ?? {};
1141
+ debug("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
1142
+ const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
1143
+ const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
1144
+ this.connectOpts = {
1145
+ // Attempt to negotiate http/1.1 for proxy servers that support http/2
1146
+ ALPNProtocols: ["http/1.1"],
1147
+ ...opts ? omit(opts, "headers") : null,
1148
+ host,
1149
+ port
1150
+ };
1151
+ }
1152
+ /**
1153
+ * Called when the node-core HTTP client library is creating a
1154
+ * new HTTP request.
1155
+ */
1156
+ async connect(req, opts) {
1157
+ const { proxy } = this;
1158
+ if (!opts.host) {
1159
+ throw new TypeError('No "host" provided');
1160
+ }
1161
+ let socket;
1162
+ if (proxy.protocol === "https:") {
1163
+ debug("Creating `tls.Socket`: %o", this.connectOpts);
1164
+ socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
1165
+ } else {
1166
+ debug("Creating `net.Socket`: %o", this.connectOpts);
1167
+ socket = net.connect(this.connectOpts);
1168
+ }
1169
+ const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
1170
+ const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
1171
+ let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
1172
+ `;
1173
+ if (proxy.username || proxy.password) {
1174
+ const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
1175
+ headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
1176
+ }
1177
+ headers.Host = `${host}:${opts.port}`;
1178
+ if (!headers["Proxy-Connection"]) {
1179
+ headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
1180
+ }
1181
+ for (const name of Object.keys(headers)) {
1182
+ payload += `${name}: ${headers[name]}\r
1183
+ `;
1184
+ }
1185
+ const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
1186
+ socket.write(`${payload}\r
1187
+ `);
1188
+ const { connect, buffered } = await proxyResponsePromise;
1189
+ req.emit("proxyConnect", connect);
1190
+ this.emit("proxyConnect", connect, req);
1191
+ if (connect.statusCode === 200) {
1192
+ req.once("socket", resume);
1193
+ if (opts.secureEndpoint) {
1194
+ debug("Upgrading socket connection to TLS");
1195
+ return tls.connect({
1196
+ ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"),
1197
+ socket
1198
+ });
1199
+ }
1200
+ return socket;
1201
+ }
1202
+ socket.destroy();
1203
+ const fakeSocket = new net.Socket({ writable: false });
1204
+ fakeSocket.readable = true;
1205
+ req.once("socket", (s) => {
1206
+ debug("Replaying proxy buffer for failed request");
1207
+ (0, assert_1.default)(s.listenerCount("data") > 0);
1208
+ s.push(buffered);
1209
+ s.push(null);
1210
+ });
1211
+ return fakeSocket;
1212
+ }
1213
+ };
1214
+ HttpsProxyAgent.protocols = ["http", "https"];
1215
+ exports$1.HttpsProxyAgent = HttpsProxyAgent;
1216
+ function resume(socket) {
1217
+ socket.resume();
1218
+ }
1219
+ function omit(obj, ...keys) {
1220
+ const ret = {};
1221
+ let key;
1222
+ for (key in obj) {
1223
+ if (!keys.includes(key)) {
1224
+ ret[key] = obj[key];
1225
+ }
1226
+ }
1227
+ return ret;
1228
+ }
1229
+ }
1230
+ });
1231
+ var dist7KM4QPSB = require_dist2();
1232
+
1233
+ export { dist7KM4QPSB as default };
1234
+ //# sourceMappingURL=dist-7KM4QPSB.js.map
1235
+ //# sourceMappingURL=dist-7KM4QPSB.js.map