@prisma-lossless/fetch-engine 7.8.0-lossless.11

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,1667 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_LXSSCRSH_exports = {};
30
+ __export(chunk_LXSSCRSH_exports, {
31
+ getProxyAgent: () => getProxyAgent
32
+ });
33
+ module.exports = __toCommonJS(chunk_LXSSCRSH_exports);
34
+ var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
35
+ var import_node_process = __toESM(require("node:process"));
36
+ var import_node_os = __toESM(require("node:os"));
37
+ var import_node_tty = __toESM(require("node:tty"));
38
+ var import_debug = __toESM(require("@prisma-lossless/debug"));
39
+ var require_ms = (0, import_chunk_2ESYSVXG.__commonJS)({
40
+ "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module2) {
41
+ "use strict";
42
+ var s = 1e3;
43
+ var m = s * 60;
44
+ var h = m * 60;
45
+ var d = h * 24;
46
+ var w = d * 7;
47
+ var y = d * 365.25;
48
+ module2.exports = function(val, options) {
49
+ options = options || {};
50
+ var type = typeof val;
51
+ if (type === "string" && val.length > 0) {
52
+ return parse(val);
53
+ } else if (type === "number" && isFinite(val)) {
54
+ return options.long ? fmtLong(val) : fmtShort(val);
55
+ }
56
+ throw new Error(
57
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
58
+ );
59
+ };
60
+ function parse(str) {
61
+ str = String(str);
62
+ if (str.length > 100) {
63
+ return;
64
+ }
65
+ 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(
66
+ str
67
+ );
68
+ if (!match) {
69
+ return;
70
+ }
71
+ var n = parseFloat(match[1]);
72
+ var type = (match[2] || "ms").toLowerCase();
73
+ switch (type) {
74
+ case "years":
75
+ case "year":
76
+ case "yrs":
77
+ case "yr":
78
+ case "y":
79
+ return n * y;
80
+ case "weeks":
81
+ case "week":
82
+ case "w":
83
+ return n * w;
84
+ case "days":
85
+ case "day":
86
+ case "d":
87
+ return n * d;
88
+ case "hours":
89
+ case "hour":
90
+ case "hrs":
91
+ case "hr":
92
+ case "h":
93
+ return n * h;
94
+ case "minutes":
95
+ case "minute":
96
+ case "mins":
97
+ case "min":
98
+ case "m":
99
+ return n * m;
100
+ case "seconds":
101
+ case "second":
102
+ case "secs":
103
+ case "sec":
104
+ case "s":
105
+ return n * s;
106
+ case "milliseconds":
107
+ case "millisecond":
108
+ case "msecs":
109
+ case "msec":
110
+ case "ms":
111
+ return n;
112
+ default:
113
+ return void 0;
114
+ }
115
+ }
116
+ function fmtShort(ms) {
117
+ var msAbs = Math.abs(ms);
118
+ if (msAbs >= d) {
119
+ return Math.round(ms / d) + "d";
120
+ }
121
+ if (msAbs >= h) {
122
+ return Math.round(ms / h) + "h";
123
+ }
124
+ if (msAbs >= m) {
125
+ return Math.round(ms / m) + "m";
126
+ }
127
+ if (msAbs >= s) {
128
+ return Math.round(ms / s) + "s";
129
+ }
130
+ return ms + "ms";
131
+ }
132
+ function fmtLong(ms) {
133
+ var msAbs = Math.abs(ms);
134
+ if (msAbs >= d) {
135
+ return plural(ms, msAbs, d, "day");
136
+ }
137
+ if (msAbs >= h) {
138
+ return plural(ms, msAbs, h, "hour");
139
+ }
140
+ if (msAbs >= m) {
141
+ return plural(ms, msAbs, m, "minute");
142
+ }
143
+ if (msAbs >= s) {
144
+ return plural(ms, msAbs, s, "second");
145
+ }
146
+ return ms + " ms";
147
+ }
148
+ function plural(ms, msAbs, n, name) {
149
+ var isPlural = msAbs >= n * 1.5;
150
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
151
+ }
152
+ }
153
+ });
154
+ var require_common = (0, import_chunk_2ESYSVXG.__commonJS)({
155
+ "../../node_modules/.pnpm/debug@4.4.0_supports-color@10.2.2/node_modules/debug/src/common.js"(exports, module2) {
156
+ "use strict";
157
+ function setup(env2) {
158
+ createDebug.debug = createDebug;
159
+ createDebug.default = createDebug;
160
+ createDebug.coerce = coerce;
161
+ createDebug.disable = disable;
162
+ createDebug.enable = enable;
163
+ createDebug.enabled = enabled;
164
+ createDebug.humanize = require_ms();
165
+ createDebug.destroy = destroy;
166
+ Object.keys(env2).forEach((key) => {
167
+ createDebug[key] = env2[key];
168
+ });
169
+ createDebug.names = [];
170
+ createDebug.skips = [];
171
+ createDebug.formatters = {};
172
+ function selectColor(namespace) {
173
+ let hash = 0;
174
+ for (let i = 0; i < namespace.length; i++) {
175
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
176
+ hash |= 0;
177
+ }
178
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
179
+ }
180
+ createDebug.selectColor = selectColor;
181
+ function createDebug(namespace) {
182
+ let prevTime;
183
+ let enableOverride = null;
184
+ let namespacesCache;
185
+ let enabledCache;
186
+ function debug2(...args) {
187
+ if (!debug2.enabled) {
188
+ return;
189
+ }
190
+ const self = debug2;
191
+ const curr = Number(/* @__PURE__ */ new Date());
192
+ const ms = curr - (prevTime || curr);
193
+ self.diff = ms;
194
+ self.prev = prevTime;
195
+ self.curr = curr;
196
+ prevTime = curr;
197
+ args[0] = createDebug.coerce(args[0]);
198
+ if (typeof args[0] !== "string") {
199
+ args.unshift("%O");
200
+ }
201
+ let index = 0;
202
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
203
+ if (match === "%%") {
204
+ return "%";
205
+ }
206
+ index++;
207
+ const formatter = createDebug.formatters[format];
208
+ if (typeof formatter === "function") {
209
+ const val = args[index];
210
+ match = formatter.call(self, val);
211
+ args.splice(index, 1);
212
+ index--;
213
+ }
214
+ return match;
215
+ });
216
+ createDebug.formatArgs.call(self, args);
217
+ const logFn = self.log || createDebug.log;
218
+ logFn.apply(self, args);
219
+ }
220
+ debug2.namespace = namespace;
221
+ debug2.useColors = createDebug.useColors();
222
+ debug2.color = createDebug.selectColor(namespace);
223
+ debug2.extend = extend;
224
+ debug2.destroy = createDebug.destroy;
225
+ Object.defineProperty(debug2, "enabled", {
226
+ enumerable: true,
227
+ configurable: false,
228
+ get: () => {
229
+ if (enableOverride !== null) {
230
+ return enableOverride;
231
+ }
232
+ if (namespacesCache !== createDebug.namespaces) {
233
+ namespacesCache = createDebug.namespaces;
234
+ enabledCache = createDebug.enabled(namespace);
235
+ }
236
+ return enabledCache;
237
+ },
238
+ set: (v) => {
239
+ enableOverride = v;
240
+ }
241
+ });
242
+ if (typeof createDebug.init === "function") {
243
+ createDebug.init(debug2);
244
+ }
245
+ return debug2;
246
+ }
247
+ function extend(namespace, delimiter) {
248
+ const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
249
+ newDebug.log = this.log;
250
+ return newDebug;
251
+ }
252
+ function enable(namespaces) {
253
+ createDebug.save(namespaces);
254
+ createDebug.namespaces = namespaces;
255
+ createDebug.names = [];
256
+ createDebug.skips = [];
257
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
258
+ for (const ns of split) {
259
+ if (ns[0] === "-") {
260
+ createDebug.skips.push(ns.slice(1));
261
+ } else {
262
+ createDebug.names.push(ns);
263
+ }
264
+ }
265
+ }
266
+ function matchesTemplate(search, template) {
267
+ let searchIndex = 0;
268
+ let templateIndex = 0;
269
+ let starIndex = -1;
270
+ let matchIndex = 0;
271
+ while (searchIndex < search.length) {
272
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
273
+ if (template[templateIndex] === "*") {
274
+ starIndex = templateIndex;
275
+ matchIndex = searchIndex;
276
+ templateIndex++;
277
+ } else {
278
+ searchIndex++;
279
+ templateIndex++;
280
+ }
281
+ } else if (starIndex !== -1) {
282
+ templateIndex = starIndex + 1;
283
+ matchIndex++;
284
+ searchIndex = matchIndex;
285
+ } else {
286
+ return false;
287
+ }
288
+ }
289
+ while (templateIndex < template.length && template[templateIndex] === "*") {
290
+ templateIndex++;
291
+ }
292
+ return templateIndex === template.length;
293
+ }
294
+ function disable() {
295
+ const namespaces = [
296
+ ...createDebug.names,
297
+ ...createDebug.skips.map((namespace) => "-" + namespace)
298
+ ].join(",");
299
+ createDebug.enable("");
300
+ return namespaces;
301
+ }
302
+ function enabled(name) {
303
+ for (const skip of createDebug.skips) {
304
+ if (matchesTemplate(name, skip)) {
305
+ return false;
306
+ }
307
+ }
308
+ for (const ns of createDebug.names) {
309
+ if (matchesTemplate(name, ns)) {
310
+ return true;
311
+ }
312
+ }
313
+ return false;
314
+ }
315
+ function coerce(val) {
316
+ if (val instanceof Error) {
317
+ return val.stack || val.message;
318
+ }
319
+ return val;
320
+ }
321
+ function destroy() {
322
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
323
+ }
324
+ createDebug.enable(createDebug.load());
325
+ return createDebug;
326
+ }
327
+ module2.exports = setup;
328
+ }
329
+ });
330
+ var require_browser = (0, import_chunk_2ESYSVXG.__commonJS)({
331
+ "../../node_modules/.pnpm/debug@4.4.0_supports-color@10.2.2/node_modules/debug/src/browser.js"(exports, module2) {
332
+ "use strict";
333
+ exports.formatArgs = formatArgs;
334
+ exports.save = save;
335
+ exports.load = load;
336
+ exports.useColors = useColors;
337
+ exports.storage = localstorage();
338
+ exports.destroy = /* @__PURE__ */ (() => {
339
+ let warned = false;
340
+ return () => {
341
+ if (!warned) {
342
+ warned = true;
343
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
344
+ }
345
+ };
346
+ })();
347
+ exports.colors = [
348
+ "#0000CC",
349
+ "#0000FF",
350
+ "#0033CC",
351
+ "#0033FF",
352
+ "#0066CC",
353
+ "#0066FF",
354
+ "#0099CC",
355
+ "#0099FF",
356
+ "#00CC00",
357
+ "#00CC33",
358
+ "#00CC66",
359
+ "#00CC99",
360
+ "#00CCCC",
361
+ "#00CCFF",
362
+ "#3300CC",
363
+ "#3300FF",
364
+ "#3333CC",
365
+ "#3333FF",
366
+ "#3366CC",
367
+ "#3366FF",
368
+ "#3399CC",
369
+ "#3399FF",
370
+ "#33CC00",
371
+ "#33CC33",
372
+ "#33CC66",
373
+ "#33CC99",
374
+ "#33CCCC",
375
+ "#33CCFF",
376
+ "#6600CC",
377
+ "#6600FF",
378
+ "#6633CC",
379
+ "#6633FF",
380
+ "#66CC00",
381
+ "#66CC33",
382
+ "#9900CC",
383
+ "#9900FF",
384
+ "#9933CC",
385
+ "#9933FF",
386
+ "#99CC00",
387
+ "#99CC33",
388
+ "#CC0000",
389
+ "#CC0033",
390
+ "#CC0066",
391
+ "#CC0099",
392
+ "#CC00CC",
393
+ "#CC00FF",
394
+ "#CC3300",
395
+ "#CC3333",
396
+ "#CC3366",
397
+ "#CC3399",
398
+ "#CC33CC",
399
+ "#CC33FF",
400
+ "#CC6600",
401
+ "#CC6633",
402
+ "#CC9900",
403
+ "#CC9933",
404
+ "#CCCC00",
405
+ "#CCCC33",
406
+ "#FF0000",
407
+ "#FF0033",
408
+ "#FF0066",
409
+ "#FF0099",
410
+ "#FF00CC",
411
+ "#FF00FF",
412
+ "#FF3300",
413
+ "#FF3333",
414
+ "#FF3366",
415
+ "#FF3399",
416
+ "#FF33CC",
417
+ "#FF33FF",
418
+ "#FF6600",
419
+ "#FF6633",
420
+ "#FF9900",
421
+ "#FF9933",
422
+ "#FFCC00",
423
+ "#FFCC33"
424
+ ];
425
+ function useColors() {
426
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
427
+ return true;
428
+ }
429
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
430
+ return false;
431
+ }
432
+ let m;
433
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
434
+ typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
435
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
436
+ 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
437
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
438
+ }
439
+ function formatArgs(args) {
440
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
441
+ if (!this.useColors) {
442
+ return;
443
+ }
444
+ const c = "color: " + this.color;
445
+ args.splice(1, 0, c, "color: inherit");
446
+ let index = 0;
447
+ let lastC = 0;
448
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
449
+ if (match === "%%") {
450
+ return;
451
+ }
452
+ index++;
453
+ if (match === "%c") {
454
+ lastC = index;
455
+ }
456
+ });
457
+ args.splice(lastC, 0, c);
458
+ }
459
+ exports.log = console.debug || console.log || (() => {
460
+ });
461
+ function save(namespaces) {
462
+ try {
463
+ if (namespaces) {
464
+ exports.storage.setItem("debug", namespaces);
465
+ } else {
466
+ exports.storage.removeItem("debug");
467
+ }
468
+ } catch (error) {
469
+ }
470
+ }
471
+ function load() {
472
+ let r;
473
+ try {
474
+ r = exports.storage.getItem("debug");
475
+ } catch (error) {
476
+ }
477
+ if (!r && typeof process !== "undefined" && "env" in process) {
478
+ r = process.env.DEBUG;
479
+ }
480
+ return r;
481
+ }
482
+ function localstorage() {
483
+ try {
484
+ return localStorage;
485
+ } catch (error) {
486
+ }
487
+ }
488
+ module2.exports = require_common()(exports);
489
+ var { formatters } = module2.exports;
490
+ formatters.j = function(v) {
491
+ try {
492
+ return JSON.stringify(v);
493
+ } catch (error) {
494
+ return "[UnexpectedJSONParseError]: " + error.message;
495
+ }
496
+ };
497
+ }
498
+ });
499
+ var supports_color_exports = {};
500
+ (0, import_chunk_2ESYSVXG.__export)(supports_color_exports, {
501
+ createSupportsColor: () => createSupportsColor,
502
+ default: () => supports_color_default
503
+ });
504
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
505
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
506
+ const position = argv.indexOf(prefix + flag);
507
+ const terminatorPosition = argv.indexOf("--");
508
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
509
+ }
510
+ function envForceColor() {
511
+ if (!("FORCE_COLOR" in env)) {
512
+ return;
513
+ }
514
+ if (env.FORCE_COLOR === "true") {
515
+ return 1;
516
+ }
517
+ if (env.FORCE_COLOR === "false") {
518
+ return 0;
519
+ }
520
+ if (env.FORCE_COLOR.length === 0) {
521
+ return 1;
522
+ }
523
+ const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
524
+ if (![0, 1, 2, 3].includes(level)) {
525
+ return;
526
+ }
527
+ return level;
528
+ }
529
+ function translateLevel(level) {
530
+ if (level === 0) {
531
+ return false;
532
+ }
533
+ return {
534
+ level,
535
+ hasBasic: true,
536
+ has256: level >= 2,
537
+ has16m: level >= 3
538
+ };
539
+ }
540
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
541
+ const noFlagForceColor = envForceColor();
542
+ if (noFlagForceColor !== void 0) {
543
+ flagForceColor = noFlagForceColor;
544
+ }
545
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
546
+ if (forceColor === 0) {
547
+ return 0;
548
+ }
549
+ if (sniffFlags) {
550
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
551
+ return 3;
552
+ }
553
+ if (hasFlag("color=256")) {
554
+ return 2;
555
+ }
556
+ }
557
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) {
558
+ return 1;
559
+ }
560
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
561
+ return 0;
562
+ }
563
+ const min = forceColor || 0;
564
+ if (env.TERM === "dumb") {
565
+ return min;
566
+ }
567
+ if (import_node_process.default.platform === "win32") {
568
+ const osRelease = import_node_os.default.release().split(".");
569
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
570
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
571
+ }
572
+ return 1;
573
+ }
574
+ if ("CI" in env) {
575
+ if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
576
+ return 3;
577
+ }
578
+ if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
579
+ return 1;
580
+ }
581
+ return min;
582
+ }
583
+ if ("TEAMCITY_VERSION" in env) {
584
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
585
+ }
586
+ if (env.COLORTERM === "truecolor") {
587
+ return 3;
588
+ }
589
+ if (env.TERM === "xterm-kitty") {
590
+ return 3;
591
+ }
592
+ if (env.TERM === "xterm-ghostty") {
593
+ return 3;
594
+ }
595
+ if (env.TERM === "wezterm") {
596
+ return 3;
597
+ }
598
+ if ("TERM_PROGRAM" in env) {
599
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
600
+ switch (env.TERM_PROGRAM) {
601
+ case "iTerm.app": {
602
+ return version >= 3 ? 3 : 2;
603
+ }
604
+ case "Apple_Terminal": {
605
+ return 2;
606
+ }
607
+ }
608
+ }
609
+ if (/-256(color)?$/i.test(env.TERM)) {
610
+ return 2;
611
+ }
612
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
613
+ return 1;
614
+ }
615
+ if ("COLORTERM" in env) {
616
+ return 1;
617
+ }
618
+ return min;
619
+ }
620
+ function createSupportsColor(stream, options = {}) {
621
+ const level = _supportsColor(stream, {
622
+ streamIsTTY: stream && stream.isTTY,
623
+ ...options
624
+ });
625
+ return translateLevel(level);
626
+ }
627
+ var env, flagForceColor, supportsColor, supports_color_default;
628
+ var init_supports_color = (0, import_chunk_2ESYSVXG.__esm)({
629
+ "../../node_modules/.pnpm/supports-color@10.2.2/node_modules/supports-color/index.js"() {
630
+ "use strict";
631
+ ({ env } = import_node_process.default);
632
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
633
+ flagForceColor = 0;
634
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
635
+ flagForceColor = 1;
636
+ }
637
+ supportsColor = {
638
+ stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
639
+ stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
640
+ };
641
+ supports_color_default = supportsColor;
642
+ }
643
+ });
644
+ var require_node = (0, import_chunk_2ESYSVXG.__commonJS)({
645
+ "../../node_modules/.pnpm/debug@4.4.0_supports-color@10.2.2/node_modules/debug/src/node.js"(exports, module2) {
646
+ "use strict";
647
+ var tty2 = (0, import_chunk_2ESYSVXG.__require)("tty");
648
+ var util = (0, import_chunk_2ESYSVXG.__require)("util");
649
+ exports.init = init;
650
+ exports.log = log;
651
+ exports.formatArgs = formatArgs;
652
+ exports.save = save;
653
+ exports.load = load;
654
+ exports.useColors = useColors;
655
+ exports.destroy = util.deprecate(
656
+ () => {
657
+ },
658
+ "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
659
+ );
660
+ exports.colors = [6, 2, 3, 4, 5, 1];
661
+ try {
662
+ const supportsColor2 = (init_supports_color(), (0, import_chunk_2ESYSVXG.__toCommonJS)(supports_color_exports));
663
+ if (supportsColor2 && (supportsColor2.stderr || supportsColor2).level >= 2) {
664
+ exports.colors = [
665
+ 20,
666
+ 21,
667
+ 26,
668
+ 27,
669
+ 32,
670
+ 33,
671
+ 38,
672
+ 39,
673
+ 40,
674
+ 41,
675
+ 42,
676
+ 43,
677
+ 44,
678
+ 45,
679
+ 56,
680
+ 57,
681
+ 62,
682
+ 63,
683
+ 68,
684
+ 69,
685
+ 74,
686
+ 75,
687
+ 76,
688
+ 77,
689
+ 78,
690
+ 79,
691
+ 80,
692
+ 81,
693
+ 92,
694
+ 93,
695
+ 98,
696
+ 99,
697
+ 112,
698
+ 113,
699
+ 128,
700
+ 129,
701
+ 134,
702
+ 135,
703
+ 148,
704
+ 149,
705
+ 160,
706
+ 161,
707
+ 162,
708
+ 163,
709
+ 164,
710
+ 165,
711
+ 166,
712
+ 167,
713
+ 168,
714
+ 169,
715
+ 170,
716
+ 171,
717
+ 172,
718
+ 173,
719
+ 178,
720
+ 179,
721
+ 184,
722
+ 185,
723
+ 196,
724
+ 197,
725
+ 198,
726
+ 199,
727
+ 200,
728
+ 201,
729
+ 202,
730
+ 203,
731
+ 204,
732
+ 205,
733
+ 206,
734
+ 207,
735
+ 208,
736
+ 209,
737
+ 214,
738
+ 215,
739
+ 220,
740
+ 221
741
+ ];
742
+ }
743
+ } catch (error) {
744
+ }
745
+ exports.inspectOpts = Object.keys(process.env).filter((key) => {
746
+ return /^debug_/i.test(key);
747
+ }).reduce((obj, key) => {
748
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
749
+ return k.toUpperCase();
750
+ });
751
+ let val = process.env[key];
752
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
753
+ val = true;
754
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
755
+ val = false;
756
+ } else if (val === "null") {
757
+ val = null;
758
+ } else {
759
+ val = Number(val);
760
+ }
761
+ obj[prop] = val;
762
+ return obj;
763
+ }, {});
764
+ function useColors() {
765
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty2.isatty(process.stderr.fd);
766
+ }
767
+ function formatArgs(args) {
768
+ const { namespace: name, useColors: useColors2 } = this;
769
+ if (useColors2) {
770
+ const c = this.color;
771
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
772
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
773
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
774
+ args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
775
+ } else {
776
+ args[0] = getDate() + name + " " + args[0];
777
+ }
778
+ }
779
+ function getDate() {
780
+ if (exports.inspectOpts.hideDate) {
781
+ return "";
782
+ }
783
+ return (/* @__PURE__ */ new Date()).toISOString() + " ";
784
+ }
785
+ function log(...args) {
786
+ return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + "\n");
787
+ }
788
+ function save(namespaces) {
789
+ if (namespaces) {
790
+ process.env.DEBUG = namespaces;
791
+ } else {
792
+ delete process.env.DEBUG;
793
+ }
794
+ }
795
+ function load() {
796
+ return process.env.DEBUG;
797
+ }
798
+ function init(debug2) {
799
+ debug2.inspectOpts = {};
800
+ const keys = Object.keys(exports.inspectOpts);
801
+ for (let i = 0; i < keys.length; i++) {
802
+ debug2.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
803
+ }
804
+ }
805
+ module2.exports = require_common()(exports);
806
+ var { formatters } = module2.exports;
807
+ formatters.o = function(v) {
808
+ this.inspectOpts.colors = this.useColors;
809
+ return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
810
+ };
811
+ formatters.O = function(v) {
812
+ this.inspectOpts.colors = this.useColors;
813
+ return util.inspect(v, this.inspectOpts);
814
+ };
815
+ }
816
+ });
817
+ var require_src = (0, import_chunk_2ESYSVXG.__commonJS)({
818
+ "../../node_modules/.pnpm/debug@4.4.0_supports-color@10.2.2/node_modules/debug/src/index.js"(exports, module2) {
819
+ "use strict";
820
+ if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
821
+ module2.exports = require_browser();
822
+ } else {
823
+ module2.exports = require_node();
824
+ }
825
+ }
826
+ });
827
+ var require_helpers = (0, import_chunk_2ESYSVXG.__commonJS)({
828
+ "../../node_modules/.pnpm/agent-base@7.1.0/node_modules/agent-base/dist/helpers.js"(exports) {
829
+ "use strict";
830
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
831
+ if (k2 === void 0) k2 = k;
832
+ var desc = Object.getOwnPropertyDescriptor(m, k);
833
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
834
+ desc = { enumerable: true, get: function() {
835
+ return m[k];
836
+ } };
837
+ }
838
+ Object.defineProperty(o, k2, desc);
839
+ } : function(o, m, k, k2) {
840
+ if (k2 === void 0) k2 = k;
841
+ o[k2] = m[k];
842
+ });
843
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
844
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
845
+ } : function(o, v) {
846
+ o["default"] = v;
847
+ });
848
+ var __importStar = exports && exports.__importStar || function(mod) {
849
+ if (mod && mod.__esModule) return mod;
850
+ var result = {};
851
+ if (mod != null) {
852
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
853
+ }
854
+ __setModuleDefault(result, mod);
855
+ return result;
856
+ };
857
+ Object.defineProperty(exports, "__esModule", { value: true });
858
+ exports.req = exports.json = exports.toBuffer = void 0;
859
+ var http = __importStar((0, import_chunk_2ESYSVXG.__require)("http"));
860
+ var https = __importStar((0, import_chunk_2ESYSVXG.__require)("https"));
861
+ async function toBuffer(stream) {
862
+ let length = 0;
863
+ const chunks = [];
864
+ for await (const chunk of stream) {
865
+ length += chunk.length;
866
+ chunks.push(chunk);
867
+ }
868
+ return Buffer.concat(chunks, length);
869
+ }
870
+ exports.toBuffer = toBuffer;
871
+ async function json(stream) {
872
+ const buf = await toBuffer(stream);
873
+ const str = buf.toString("utf8");
874
+ try {
875
+ return JSON.parse(str);
876
+ } catch (_err) {
877
+ const err = _err;
878
+ err.message += ` (input: ${str})`;
879
+ throw err;
880
+ }
881
+ }
882
+ exports.json = json;
883
+ function req(url, opts = {}) {
884
+ const href = typeof url === "string" ? url : url.href;
885
+ const req2 = (href.startsWith("https:") ? https : http).request(url, opts);
886
+ const promise = new Promise((resolve, reject) => {
887
+ req2.once("response", resolve).once("error", reject).end();
888
+ });
889
+ req2.then = promise.then.bind(promise);
890
+ return req2;
891
+ }
892
+ exports.req = req;
893
+ }
894
+ });
895
+ var require_dist = (0, import_chunk_2ESYSVXG.__commonJS)({
896
+ "../../node_modules/.pnpm/agent-base@7.1.0/node_modules/agent-base/dist/index.js"(exports) {
897
+ "use strict";
898
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
899
+ if (k2 === void 0) k2 = k;
900
+ var desc = Object.getOwnPropertyDescriptor(m, k);
901
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
902
+ desc = { enumerable: true, get: function() {
903
+ return m[k];
904
+ } };
905
+ }
906
+ Object.defineProperty(o, k2, desc);
907
+ } : function(o, m, k, k2) {
908
+ if (k2 === void 0) k2 = k;
909
+ o[k2] = m[k];
910
+ });
911
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
912
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
913
+ } : function(o, v) {
914
+ o["default"] = v;
915
+ });
916
+ var __importStar = exports && exports.__importStar || function(mod) {
917
+ if (mod && mod.__esModule) return mod;
918
+ var result = {};
919
+ if (mod != null) {
920
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
921
+ }
922
+ __setModuleDefault(result, mod);
923
+ return result;
924
+ };
925
+ var __exportStar = exports && exports.__exportStar || function(m, exports2) {
926
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
927
+ };
928
+ Object.defineProperty(exports, "__esModule", { value: true });
929
+ exports.Agent = void 0;
930
+ var http = __importStar((0, import_chunk_2ESYSVXG.__require)("http"));
931
+ __exportStar(require_helpers(), exports);
932
+ var INTERNAL = Symbol("AgentBaseInternalState");
933
+ var Agent = class extends http.Agent {
934
+ constructor(opts) {
935
+ super(opts);
936
+ this[INTERNAL] = {};
937
+ }
938
+ /**
939
+ * Determine whether this is an `http` or `https` request.
940
+ */
941
+ isSecureEndpoint(options) {
942
+ if (options) {
943
+ if (typeof options.secureEndpoint === "boolean") {
944
+ return options.secureEndpoint;
945
+ }
946
+ if (typeof options.protocol === "string") {
947
+ return options.protocol === "https:";
948
+ }
949
+ }
950
+ const { stack } = new Error();
951
+ if (typeof stack !== "string")
952
+ return false;
953
+ return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
954
+ }
955
+ createSocket(req, options, cb) {
956
+ const connectOpts = {
957
+ ...options,
958
+ secureEndpoint: this.isSecureEndpoint(options)
959
+ };
960
+ Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => {
961
+ if (socket instanceof http.Agent) {
962
+ return socket.addRequest(req, connectOpts);
963
+ }
964
+ this[INTERNAL].currentSocket = socket;
965
+ super.createSocket(req, options, cb);
966
+ }, cb);
967
+ }
968
+ createConnection() {
969
+ const socket = this[INTERNAL].currentSocket;
970
+ this[INTERNAL].currentSocket = void 0;
971
+ if (!socket) {
972
+ throw new Error("No socket was returned in the `connect()` function");
973
+ }
974
+ return socket;
975
+ }
976
+ get defaultPort() {
977
+ return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
978
+ }
979
+ set defaultPort(v) {
980
+ if (this[INTERNAL]) {
981
+ this[INTERNAL].defaultPort = v;
982
+ }
983
+ }
984
+ get protocol() {
985
+ return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
986
+ }
987
+ set protocol(v) {
988
+ if (this[INTERNAL]) {
989
+ this[INTERNAL].protocol = v;
990
+ }
991
+ }
992
+ };
993
+ exports.Agent = Agent;
994
+ }
995
+ });
996
+ var require_dist2 = (0, import_chunk_2ESYSVXG.__commonJS)({
997
+ "../../node_modules/.pnpm/http-proxy-agent@7.0.2/node_modules/http-proxy-agent/dist/index.js"(exports) {
998
+ "use strict";
999
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
1000
+ if (k2 === void 0) k2 = k;
1001
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1002
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1003
+ desc = { enumerable: true, get: function() {
1004
+ return m[k];
1005
+ } };
1006
+ }
1007
+ Object.defineProperty(o, k2, desc);
1008
+ } : function(o, m, k, k2) {
1009
+ if (k2 === void 0) k2 = k;
1010
+ o[k2] = m[k];
1011
+ });
1012
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
1013
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1014
+ } : function(o, v) {
1015
+ o["default"] = v;
1016
+ });
1017
+ var __importStar = exports && exports.__importStar || function(mod) {
1018
+ if (mod && mod.__esModule) return mod;
1019
+ var result = {};
1020
+ if (mod != null) {
1021
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1022
+ }
1023
+ __setModuleDefault(result, mod);
1024
+ return result;
1025
+ };
1026
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1027
+ return mod && mod.__esModule ? mod : { "default": mod };
1028
+ };
1029
+ Object.defineProperty(exports, "__esModule", { value: true });
1030
+ exports.HttpProxyAgent = void 0;
1031
+ var net = __importStar((0, import_chunk_2ESYSVXG.__require)("net"));
1032
+ var tls = __importStar((0, import_chunk_2ESYSVXG.__require)("tls"));
1033
+ var debug_1 = __importDefault(require_src());
1034
+ var events_1 = (0, import_chunk_2ESYSVXG.__require)("events");
1035
+ var agent_base_1 = require_dist();
1036
+ var url_1 = (0, import_chunk_2ESYSVXG.__require)("url");
1037
+ var debug2 = (0, debug_1.default)("http-proxy-agent");
1038
+ var HttpProxyAgent2 = class extends agent_base_1.Agent {
1039
+ constructor(proxy, opts) {
1040
+ super(opts);
1041
+ this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
1042
+ this.proxyHeaders = opts?.headers ?? {};
1043
+ debug2("Creating new HttpProxyAgent instance: %o", this.proxy.href);
1044
+ const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
1045
+ const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
1046
+ this.connectOpts = {
1047
+ ...opts ? omit(opts, "headers") : null,
1048
+ host,
1049
+ port
1050
+ };
1051
+ }
1052
+ addRequest(req, opts) {
1053
+ req._header = null;
1054
+ this.setRequestProps(req, opts);
1055
+ super.addRequest(req, opts);
1056
+ }
1057
+ setRequestProps(req, opts) {
1058
+ const { proxy } = this;
1059
+ const protocol = opts.secureEndpoint ? "https:" : "http:";
1060
+ const hostname = req.getHeader("host") || "localhost";
1061
+ const base = `${protocol}//${hostname}`;
1062
+ const url = new url_1.URL(req.path, base);
1063
+ if (opts.port !== 80) {
1064
+ url.port = String(opts.port);
1065
+ }
1066
+ req.path = String(url);
1067
+ const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
1068
+ if (proxy.username || proxy.password) {
1069
+ const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
1070
+ headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
1071
+ }
1072
+ if (!headers["Proxy-Connection"]) {
1073
+ headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
1074
+ }
1075
+ for (const name of Object.keys(headers)) {
1076
+ const value = headers[name];
1077
+ if (value) {
1078
+ req.setHeader(name, value);
1079
+ }
1080
+ }
1081
+ }
1082
+ async connect(req, opts) {
1083
+ req._header = null;
1084
+ if (!req.path.includes("://")) {
1085
+ this.setRequestProps(req, opts);
1086
+ }
1087
+ let first;
1088
+ let endOfHeaders;
1089
+ debug2("Regenerating stored HTTP header string for request");
1090
+ req._implicitHeader();
1091
+ if (req.outputData && req.outputData.length > 0) {
1092
+ debug2("Patching connection write() output buffer with updated header");
1093
+ first = req.outputData[0].data;
1094
+ endOfHeaders = first.indexOf("\r\n\r\n") + 4;
1095
+ req.outputData[0].data = req._header + first.substring(endOfHeaders);
1096
+ debug2("Output buffer: %o", req.outputData[0].data);
1097
+ }
1098
+ let socket;
1099
+ if (this.proxy.protocol === "https:") {
1100
+ debug2("Creating `tls.Socket`: %o", this.connectOpts);
1101
+ socket = tls.connect(this.connectOpts);
1102
+ } else {
1103
+ debug2("Creating `net.Socket`: %o", this.connectOpts);
1104
+ socket = net.connect(this.connectOpts);
1105
+ }
1106
+ await (0, events_1.once)(socket, "connect");
1107
+ return socket;
1108
+ }
1109
+ };
1110
+ HttpProxyAgent2.protocols = ["http", "https"];
1111
+ exports.HttpProxyAgent = HttpProxyAgent2;
1112
+ function omit(obj, ...keys) {
1113
+ const ret = {};
1114
+ let key;
1115
+ for (key in obj) {
1116
+ if (!keys.includes(key)) {
1117
+ ret[key] = obj[key];
1118
+ }
1119
+ }
1120
+ return ret;
1121
+ }
1122
+ }
1123
+ });
1124
+ var require_helpers2 = (0, import_chunk_2ESYSVXG.__commonJS)({
1125
+ "../../node_modules/.pnpm/agent-base@7.1.3/node_modules/agent-base/dist/helpers.js"(exports) {
1126
+ "use strict";
1127
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
1128
+ if (k2 === void 0) k2 = k;
1129
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1130
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1131
+ desc = { enumerable: true, get: function() {
1132
+ return m[k];
1133
+ } };
1134
+ }
1135
+ Object.defineProperty(o, k2, desc);
1136
+ } : function(o, m, k, k2) {
1137
+ if (k2 === void 0) k2 = k;
1138
+ o[k2] = m[k];
1139
+ });
1140
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
1141
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1142
+ } : function(o, v) {
1143
+ o["default"] = v;
1144
+ });
1145
+ var __importStar = exports && exports.__importStar || function(mod) {
1146
+ if (mod && mod.__esModule) return mod;
1147
+ var result = {};
1148
+ if (mod != null) {
1149
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1150
+ }
1151
+ __setModuleDefault(result, mod);
1152
+ return result;
1153
+ };
1154
+ Object.defineProperty(exports, "__esModule", { value: true });
1155
+ exports.req = exports.json = exports.toBuffer = void 0;
1156
+ var http = __importStar((0, import_chunk_2ESYSVXG.__require)("http"));
1157
+ var https = __importStar((0, import_chunk_2ESYSVXG.__require)("https"));
1158
+ async function toBuffer(stream) {
1159
+ let length = 0;
1160
+ const chunks = [];
1161
+ for await (const chunk of stream) {
1162
+ length += chunk.length;
1163
+ chunks.push(chunk);
1164
+ }
1165
+ return Buffer.concat(chunks, length);
1166
+ }
1167
+ exports.toBuffer = toBuffer;
1168
+ async function json(stream) {
1169
+ const buf = await toBuffer(stream);
1170
+ const str = buf.toString("utf8");
1171
+ try {
1172
+ return JSON.parse(str);
1173
+ } catch (_err) {
1174
+ const err = _err;
1175
+ err.message += ` (input: ${str})`;
1176
+ throw err;
1177
+ }
1178
+ }
1179
+ exports.json = json;
1180
+ function req(url, opts = {}) {
1181
+ const href = typeof url === "string" ? url : url.href;
1182
+ const req2 = (href.startsWith("https:") ? https : http).request(url, opts);
1183
+ const promise = new Promise((resolve, reject) => {
1184
+ req2.once("response", resolve).once("error", reject).end();
1185
+ });
1186
+ req2.then = promise.then.bind(promise);
1187
+ return req2;
1188
+ }
1189
+ exports.req = req;
1190
+ }
1191
+ });
1192
+ var require_dist3 = (0, import_chunk_2ESYSVXG.__commonJS)({
1193
+ "../../node_modules/.pnpm/agent-base@7.1.3/node_modules/agent-base/dist/index.js"(exports) {
1194
+ "use strict";
1195
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
1196
+ if (k2 === void 0) k2 = k;
1197
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1198
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1199
+ desc = { enumerable: true, get: function() {
1200
+ return m[k];
1201
+ } };
1202
+ }
1203
+ Object.defineProperty(o, k2, desc);
1204
+ } : function(o, m, k, k2) {
1205
+ if (k2 === void 0) k2 = k;
1206
+ o[k2] = m[k];
1207
+ });
1208
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
1209
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1210
+ } : function(o, v) {
1211
+ o["default"] = v;
1212
+ });
1213
+ var __importStar = exports && exports.__importStar || function(mod) {
1214
+ if (mod && mod.__esModule) return mod;
1215
+ var result = {};
1216
+ if (mod != null) {
1217
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1218
+ }
1219
+ __setModuleDefault(result, mod);
1220
+ return result;
1221
+ };
1222
+ var __exportStar = exports && exports.__exportStar || function(m, exports2) {
1223
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
1224
+ };
1225
+ Object.defineProperty(exports, "__esModule", { value: true });
1226
+ exports.Agent = void 0;
1227
+ var net = __importStar((0, import_chunk_2ESYSVXG.__require)("net"));
1228
+ var http = __importStar((0, import_chunk_2ESYSVXG.__require)("http"));
1229
+ var https_1 = (0, import_chunk_2ESYSVXG.__require)("https");
1230
+ __exportStar(require_helpers2(), exports);
1231
+ var INTERNAL = Symbol("AgentBaseInternalState");
1232
+ var Agent = class extends http.Agent {
1233
+ constructor(opts) {
1234
+ super(opts);
1235
+ this[INTERNAL] = {};
1236
+ }
1237
+ /**
1238
+ * Determine whether this is an `http` or `https` request.
1239
+ */
1240
+ isSecureEndpoint(options) {
1241
+ if (options) {
1242
+ if (typeof options.secureEndpoint === "boolean") {
1243
+ return options.secureEndpoint;
1244
+ }
1245
+ if (typeof options.protocol === "string") {
1246
+ return options.protocol === "https:";
1247
+ }
1248
+ }
1249
+ const { stack } = new Error();
1250
+ if (typeof stack !== "string")
1251
+ return false;
1252
+ return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
1253
+ }
1254
+ // In order to support async signatures in `connect()` and Node's native
1255
+ // connection pooling in `http.Agent`, the array of sockets for each origin
1256
+ // has to be updated synchronously. This is so the length of the array is
1257
+ // accurate when `addRequest()` is next called. We achieve this by creating a
1258
+ // fake socket and adding it to `sockets[origin]` and incrementing
1259
+ // `totalSocketCount`.
1260
+ incrementSockets(name) {
1261
+ if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) {
1262
+ return null;
1263
+ }
1264
+ if (!this.sockets[name]) {
1265
+ this.sockets[name] = [];
1266
+ }
1267
+ const fakeSocket = new net.Socket({ writable: false });
1268
+ this.sockets[name].push(fakeSocket);
1269
+ this.totalSocketCount++;
1270
+ return fakeSocket;
1271
+ }
1272
+ decrementSockets(name, socket) {
1273
+ if (!this.sockets[name] || socket === null) {
1274
+ return;
1275
+ }
1276
+ const sockets = this.sockets[name];
1277
+ const index = sockets.indexOf(socket);
1278
+ if (index !== -1) {
1279
+ sockets.splice(index, 1);
1280
+ this.totalSocketCount--;
1281
+ if (sockets.length === 0) {
1282
+ delete this.sockets[name];
1283
+ }
1284
+ }
1285
+ }
1286
+ // In order to properly update the socket pool, we need to call `getName()` on
1287
+ // the core `https.Agent` if it is a secureEndpoint.
1288
+ getName(options) {
1289
+ const secureEndpoint = typeof options.secureEndpoint === "boolean" ? options.secureEndpoint : this.isSecureEndpoint(options);
1290
+ if (secureEndpoint) {
1291
+ return https_1.Agent.prototype.getName.call(this, options);
1292
+ }
1293
+ return super.getName(options);
1294
+ }
1295
+ createSocket(req, options, cb) {
1296
+ const connectOpts = {
1297
+ ...options,
1298
+ secureEndpoint: this.isSecureEndpoint(options)
1299
+ };
1300
+ const name = this.getName(connectOpts);
1301
+ const fakeSocket = this.incrementSockets(name);
1302
+ Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => {
1303
+ this.decrementSockets(name, fakeSocket);
1304
+ if (socket instanceof http.Agent) {
1305
+ try {
1306
+ return socket.addRequest(req, connectOpts);
1307
+ } catch (err) {
1308
+ return cb(err);
1309
+ }
1310
+ }
1311
+ this[INTERNAL].currentSocket = socket;
1312
+ super.createSocket(req, options, cb);
1313
+ }, (err) => {
1314
+ this.decrementSockets(name, fakeSocket);
1315
+ cb(err);
1316
+ });
1317
+ }
1318
+ createConnection() {
1319
+ const socket = this[INTERNAL].currentSocket;
1320
+ this[INTERNAL].currentSocket = void 0;
1321
+ if (!socket) {
1322
+ throw new Error("No socket was returned in the `connect()` function");
1323
+ }
1324
+ return socket;
1325
+ }
1326
+ get defaultPort() {
1327
+ return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
1328
+ }
1329
+ set defaultPort(v) {
1330
+ if (this[INTERNAL]) {
1331
+ this[INTERNAL].defaultPort = v;
1332
+ }
1333
+ }
1334
+ get protocol() {
1335
+ return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
1336
+ }
1337
+ set protocol(v) {
1338
+ if (this[INTERNAL]) {
1339
+ this[INTERNAL].protocol = v;
1340
+ }
1341
+ }
1342
+ };
1343
+ exports.Agent = Agent;
1344
+ }
1345
+ });
1346
+ var require_parse_proxy_response = (0, import_chunk_2ESYSVXG.__commonJS)({
1347
+ "../../node_modules/.pnpm/https-proxy-agent@7.0.6_supports-color@10.2.2/node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports) {
1348
+ "use strict";
1349
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1350
+ return mod && mod.__esModule ? mod : { "default": mod };
1351
+ };
1352
+ Object.defineProperty(exports, "__esModule", { value: true });
1353
+ exports.parseProxyResponse = void 0;
1354
+ var debug_1 = __importDefault(require_src());
1355
+ var debug2 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
1356
+ function parseProxyResponse(socket) {
1357
+ return new Promise((resolve, reject) => {
1358
+ let buffersLength = 0;
1359
+ const buffers = [];
1360
+ function read() {
1361
+ const b = socket.read();
1362
+ if (b)
1363
+ ondata(b);
1364
+ else
1365
+ socket.once("readable", read);
1366
+ }
1367
+ function cleanup() {
1368
+ socket.removeListener("end", onend);
1369
+ socket.removeListener("error", onerror);
1370
+ socket.removeListener("readable", read);
1371
+ }
1372
+ function onend() {
1373
+ cleanup();
1374
+ debug2("onend");
1375
+ reject(new Error("Proxy connection ended before receiving CONNECT response"));
1376
+ }
1377
+ function onerror(err) {
1378
+ cleanup();
1379
+ debug2("onerror %o", err);
1380
+ reject(err);
1381
+ }
1382
+ function ondata(b) {
1383
+ buffers.push(b);
1384
+ buffersLength += b.length;
1385
+ const buffered = Buffer.concat(buffers, buffersLength);
1386
+ const endOfHeaders = buffered.indexOf("\r\n\r\n");
1387
+ if (endOfHeaders === -1) {
1388
+ debug2("have not received end of HTTP headers yet...");
1389
+ read();
1390
+ return;
1391
+ }
1392
+ const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n");
1393
+ const firstLine = headerParts.shift();
1394
+ if (!firstLine) {
1395
+ socket.destroy();
1396
+ return reject(new Error("No header received from proxy CONNECT response"));
1397
+ }
1398
+ const firstLineParts = firstLine.split(" ");
1399
+ const statusCode = +firstLineParts[1];
1400
+ const statusText = firstLineParts.slice(2).join(" ");
1401
+ const headers = {};
1402
+ for (const header of headerParts) {
1403
+ if (!header)
1404
+ continue;
1405
+ const firstColon = header.indexOf(":");
1406
+ if (firstColon === -1) {
1407
+ socket.destroy();
1408
+ return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
1409
+ }
1410
+ const key = header.slice(0, firstColon).toLowerCase();
1411
+ const value = header.slice(firstColon + 1).trimStart();
1412
+ const current = headers[key];
1413
+ if (typeof current === "string") {
1414
+ headers[key] = [current, value];
1415
+ } else if (Array.isArray(current)) {
1416
+ current.push(value);
1417
+ } else {
1418
+ headers[key] = value;
1419
+ }
1420
+ }
1421
+ debug2("got proxy server response: %o %o", firstLine, headers);
1422
+ cleanup();
1423
+ resolve({
1424
+ connect: {
1425
+ statusCode,
1426
+ statusText,
1427
+ headers
1428
+ },
1429
+ buffered
1430
+ });
1431
+ }
1432
+ socket.on("error", onerror);
1433
+ socket.on("end", onend);
1434
+ read();
1435
+ });
1436
+ }
1437
+ exports.parseProxyResponse = parseProxyResponse;
1438
+ }
1439
+ });
1440
+ var require_dist4 = (0, import_chunk_2ESYSVXG.__commonJS)({
1441
+ "../../node_modules/.pnpm/https-proxy-agent@7.0.6_supports-color@10.2.2/node_modules/https-proxy-agent/dist/index.js"(exports) {
1442
+ "use strict";
1443
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
1444
+ if (k2 === void 0) k2 = k;
1445
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1446
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1447
+ desc = { enumerable: true, get: function() {
1448
+ return m[k];
1449
+ } };
1450
+ }
1451
+ Object.defineProperty(o, k2, desc);
1452
+ } : function(o, m, k, k2) {
1453
+ if (k2 === void 0) k2 = k;
1454
+ o[k2] = m[k];
1455
+ });
1456
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
1457
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1458
+ } : function(o, v) {
1459
+ o["default"] = v;
1460
+ });
1461
+ var __importStar = exports && exports.__importStar || function(mod) {
1462
+ if (mod && mod.__esModule) return mod;
1463
+ var result = {};
1464
+ if (mod != null) {
1465
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1466
+ }
1467
+ __setModuleDefault(result, mod);
1468
+ return result;
1469
+ };
1470
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1471
+ return mod && mod.__esModule ? mod : { "default": mod };
1472
+ };
1473
+ Object.defineProperty(exports, "__esModule", { value: true });
1474
+ exports.HttpsProxyAgent = void 0;
1475
+ var net = __importStar((0, import_chunk_2ESYSVXG.__require)("net"));
1476
+ var tls = __importStar((0, import_chunk_2ESYSVXG.__require)("tls"));
1477
+ var assert_1 = __importDefault((0, import_chunk_2ESYSVXG.__require)("assert"));
1478
+ var debug_1 = __importDefault(require_src());
1479
+ var agent_base_1 = require_dist3();
1480
+ var url_1 = (0, import_chunk_2ESYSVXG.__require)("url");
1481
+ var parse_proxy_response_1 = require_parse_proxy_response();
1482
+ var debug2 = (0, debug_1.default)("https-proxy-agent");
1483
+ var setServernameFromNonIpHost = (options) => {
1484
+ if (options.servername === void 0 && options.host && !net.isIP(options.host)) {
1485
+ return {
1486
+ ...options,
1487
+ servername: options.host
1488
+ };
1489
+ }
1490
+ return options;
1491
+ };
1492
+ var HttpsProxyAgent2 = class extends agent_base_1.Agent {
1493
+ constructor(proxy, opts) {
1494
+ super(opts);
1495
+ this.options = { path: void 0 };
1496
+ this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
1497
+ this.proxyHeaders = opts?.headers ?? {};
1498
+ debug2("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
1499
+ const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
1500
+ const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
1501
+ this.connectOpts = {
1502
+ // Attempt to negotiate http/1.1 for proxy servers that support http/2
1503
+ ALPNProtocols: ["http/1.1"],
1504
+ ...opts ? omit(opts, "headers") : null,
1505
+ host,
1506
+ port
1507
+ };
1508
+ }
1509
+ /**
1510
+ * Called when the node-core HTTP client library is creating a
1511
+ * new HTTP request.
1512
+ */
1513
+ async connect(req, opts) {
1514
+ const { proxy } = this;
1515
+ if (!opts.host) {
1516
+ throw new TypeError('No "host" provided');
1517
+ }
1518
+ let socket;
1519
+ if (proxy.protocol === "https:") {
1520
+ debug2("Creating `tls.Socket`: %o", this.connectOpts);
1521
+ socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
1522
+ } else {
1523
+ debug2("Creating `net.Socket`: %o", this.connectOpts);
1524
+ socket = net.connect(this.connectOpts);
1525
+ }
1526
+ const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
1527
+ const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
1528
+ let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
1529
+ `;
1530
+ if (proxy.username || proxy.password) {
1531
+ const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
1532
+ headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
1533
+ }
1534
+ headers.Host = `${host}:${opts.port}`;
1535
+ if (!headers["Proxy-Connection"]) {
1536
+ headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
1537
+ }
1538
+ for (const name of Object.keys(headers)) {
1539
+ payload += `${name}: ${headers[name]}\r
1540
+ `;
1541
+ }
1542
+ const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
1543
+ socket.write(`${payload}\r
1544
+ `);
1545
+ const { connect, buffered } = await proxyResponsePromise;
1546
+ req.emit("proxyConnect", connect);
1547
+ this.emit("proxyConnect", connect, req);
1548
+ if (connect.statusCode === 200) {
1549
+ req.once("socket", resume);
1550
+ if (opts.secureEndpoint) {
1551
+ debug2("Upgrading socket connection to TLS");
1552
+ return tls.connect({
1553
+ ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"),
1554
+ socket
1555
+ });
1556
+ }
1557
+ return socket;
1558
+ }
1559
+ socket.destroy();
1560
+ const fakeSocket = new net.Socket({ writable: false });
1561
+ fakeSocket.readable = true;
1562
+ req.once("socket", (s) => {
1563
+ debug2("Replaying proxy buffer for failed request");
1564
+ (0, assert_1.default)(s.listenerCount("data") > 0);
1565
+ s.push(buffered);
1566
+ s.push(null);
1567
+ });
1568
+ return fakeSocket;
1569
+ }
1570
+ };
1571
+ HttpsProxyAgent2.protocols = ["http", "https"];
1572
+ exports.HttpsProxyAgent = HttpsProxyAgent2;
1573
+ function resume(socket) {
1574
+ socket.resume();
1575
+ }
1576
+ function omit(obj, ...keys) {
1577
+ const ret = {};
1578
+ let key;
1579
+ for (key in obj) {
1580
+ if (!keys.includes(key)) {
1581
+ ret[key] = obj[key];
1582
+ }
1583
+ }
1584
+ return ret;
1585
+ }
1586
+ }
1587
+ });
1588
+ var import_http_proxy_agent = (0, import_chunk_2ESYSVXG.__toESM)(require_dist2());
1589
+ var import_https_proxy_agent = (0, import_chunk_2ESYSVXG.__toESM)(require_dist4());
1590
+ var debug = (0, import_debug.default)("prisma:fetch-engine:getProxyAgent");
1591
+ function formatHostname(hostname) {
1592
+ return hostname.replace(/^\.*/, ".").toLowerCase();
1593
+ }
1594
+ function parseNoProxyZone(zone) {
1595
+ zone = zone.trim().toLowerCase();
1596
+ const zoneParts = zone.split(":", 2);
1597
+ const zoneHost = formatHostname(zoneParts[0]);
1598
+ const zonePort = zoneParts[1];
1599
+ const hasPort = zone.includes(":");
1600
+ return { hostname: zoneHost, port: zonePort, hasPort };
1601
+ }
1602
+ function uriInNoProxy(uri, noProxy) {
1603
+ const port = uri.port || (uri.protocol === "https:" ? "443" : "80");
1604
+ const hostname = formatHostname(uri.hostname);
1605
+ const noProxyList = noProxy.split(",");
1606
+ return noProxyList.map(parseNoProxyZone).some(function(noProxyZone) {
1607
+ const isMatchedAt = hostname.indexOf(noProxyZone.hostname);
1608
+ const hostnameMatched = isMatchedAt > -1 && isMatchedAt === hostname.length - noProxyZone.hostname.length;
1609
+ if (noProxyZone.hasPort) {
1610
+ return port === noProxyZone.port && hostnameMatched;
1611
+ }
1612
+ return hostnameMatched;
1613
+ });
1614
+ }
1615
+ function getProxyFromURI(uri) {
1616
+ const noProxy = process.env.NO_PROXY || process.env.no_proxy || "";
1617
+ if (noProxy) debug(`noProxy is set to "${noProxy}"`);
1618
+ if (noProxy === "*") {
1619
+ return null;
1620
+ }
1621
+ if (noProxy !== "" && uriInNoProxy(uri, noProxy)) {
1622
+ return null;
1623
+ }
1624
+ if (uri.protocol === "http:") {
1625
+ const httpProxy = process.env.HTTP_PROXY || process.env.http_proxy || null;
1626
+ if (httpProxy) debug(`uri.protocol is HTTP and the URL for the proxy is "${httpProxy}"`);
1627
+ return httpProxy;
1628
+ }
1629
+ if (uri.protocol === "https:") {
1630
+ const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy || null;
1631
+ if (httpsProxy) debug(`uri.protocol is HTTPS and the URL for the proxy is "${httpsProxy}"`);
1632
+ return httpsProxy;
1633
+ }
1634
+ return null;
1635
+ }
1636
+ function getProxyAgent(url) {
1637
+ try {
1638
+ const uri = new URL(url);
1639
+ const proxy = getProxyFromURI(uri);
1640
+ if (!proxy) {
1641
+ return void 0;
1642
+ } else if (uri.protocol === "http:") {
1643
+ try {
1644
+ return new import_http_proxy_agent.HttpProxyAgent(proxy);
1645
+ } catch (agentError) {
1646
+ throw new Error(
1647
+ `Error while instantiating HttpProxyAgent with URL: "${proxy}"
1648
+ ${agentError}
1649
+ Check the following env vars "http_proxy" or "HTTP_PROXY". The value should be a valid URL starting with "http://"`
1650
+ );
1651
+ }
1652
+ } else if (uri.protocol === "https:") {
1653
+ try {
1654
+ return new import_https_proxy_agent.HttpsProxyAgent(proxy);
1655
+ } catch (agentError) {
1656
+ throw new Error(
1657
+ `Error while instantiating HttpsProxyAgent with URL: "${proxy}"
1658
+ ${agentError}
1659
+ Check the following env vars "https_proxy" or "HTTPS_PROXY". The value should be a valid URL starting with "https://"`
1660
+ );
1661
+ }
1662
+ }
1663
+ } catch (e) {
1664
+ console.warn(`An error occurred in getProxyAgent(), no proxy agent will be used.`, e);
1665
+ }
1666
+ return void 0;
1667
+ }