leafrelay 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,2003 @@
1
- // ../daemon/dist/chunk-SNNRUPGL.js
1
+ import {
2
+ __commonJS,
3
+ __toESM
4
+ } from "./chunk-5WRI5ZAA.js";
5
+
6
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
7
+ var require_constants = __commonJS({
8
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js"(exports, module) {
9
+ "use strict";
10
+ var SEMVER_SPEC_VERSION = "2.0.0";
11
+ var MAX_LENGTH = 256;
12
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
13
+ 9007199254740991;
14
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
15
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
16
+ var RELEASE_TYPES = [
17
+ "major",
18
+ "premajor",
19
+ "minor",
20
+ "preminor",
21
+ "patch",
22
+ "prepatch",
23
+ "prerelease"
24
+ ];
25
+ module.exports = {
26
+ MAX_LENGTH,
27
+ MAX_SAFE_COMPONENT_LENGTH,
28
+ MAX_SAFE_BUILD_LENGTH,
29
+ MAX_SAFE_INTEGER,
30
+ RELEASE_TYPES,
31
+ SEMVER_SPEC_VERSION,
32
+ FLAG_INCLUDE_PRERELEASE: 1,
33
+ FLAG_LOOSE: 2
34
+ };
35
+ }
36
+ });
37
+
38
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js
39
+ var require_debug = __commonJS({
40
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js"(exports, module) {
41
+ "use strict";
42
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
43
+ };
44
+ module.exports = debug;
45
+ }
46
+ });
47
+
48
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js
49
+ var require_re = __commonJS({
50
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js"(exports, module) {
51
+ "use strict";
52
+ var {
53
+ MAX_SAFE_COMPONENT_LENGTH,
54
+ MAX_SAFE_BUILD_LENGTH,
55
+ MAX_LENGTH
56
+ } = require_constants();
57
+ var debug = require_debug();
58
+ exports = module.exports = {};
59
+ var re = exports.re = [];
60
+ var safeRe = exports.safeRe = [];
61
+ var src = exports.src = [];
62
+ var safeSrc = exports.safeSrc = [];
63
+ var t = exports.t = {};
64
+ var R = 0;
65
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
66
+ var safeRegexReplacements = [
67
+ ["\\s", 1],
68
+ ["\\d", MAX_LENGTH],
69
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
70
+ ];
71
+ var makeSafeRegex = (value) => {
72
+ for (const [token, max] of safeRegexReplacements) {
73
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
74
+ }
75
+ return value;
76
+ };
77
+ var createToken = (name, value, isGlobal) => {
78
+ const safe = makeSafeRegex(value);
79
+ const index = R++;
80
+ debug(name, index, value);
81
+ t[name] = index;
82
+ src[index] = value;
83
+ safeSrc[index] = safe;
84
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
85
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
86
+ };
87
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
88
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
89
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
90
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
91
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
92
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
93
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
94
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
95
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
96
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
97
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
98
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
99
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
100
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
101
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
102
+ createToken("GTLT", "((?:<|>)?=?)");
103
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
104
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
105
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
106
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
107
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
108
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
109
+ createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
110
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
111
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
112
+ createToken("COERCERTL", src[t.COERCE], true);
113
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
114
+ createToken("LONETILDE", "(?:~>?)");
115
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
116
+ exports.tildeTrimReplace = "$1~";
117
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
118
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
119
+ createToken("LONECARET", "(?:\\^)");
120
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
121
+ exports.caretTrimReplace = "$1^";
122
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
123
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
124
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
125
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
126
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
127
+ exports.comparatorTrimReplace = "$1$2$3";
128
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
129
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
130
+ createToken("STAR", "(<|>)?=?\\s*\\*");
131
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
132
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
133
+ }
134
+ });
135
+
136
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js
137
+ var require_parse_options = __commonJS({
138
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js"(exports, module) {
139
+ "use strict";
140
+ var looseOption = Object.freeze({ loose: true });
141
+ var emptyOpts = Object.freeze({});
142
+ var parseOptions = (options) => {
143
+ if (!options) {
144
+ return emptyOpts;
145
+ }
146
+ if (typeof options !== "object") {
147
+ return looseOption;
148
+ }
149
+ return options;
150
+ };
151
+ module.exports = parseOptions;
152
+ }
153
+ });
154
+
155
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js
156
+ var require_identifiers = __commonJS({
157
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js"(exports, module) {
158
+ "use strict";
159
+ var numeric2 = /^[0-9]+$/;
160
+ var compareIdentifiers = (a, b) => {
161
+ if (typeof a === "number" && typeof b === "number") {
162
+ return a === b ? 0 : a < b ? -1 : 1;
163
+ }
164
+ const anum = numeric2.test(a);
165
+ const bnum = numeric2.test(b);
166
+ if (anum && bnum) {
167
+ a = +a;
168
+ b = +b;
169
+ }
170
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
171
+ };
172
+ var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
173
+ module.exports = {
174
+ compareIdentifiers,
175
+ rcompareIdentifiers
176
+ };
177
+ }
178
+ });
179
+
180
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js
181
+ var require_semver = __commonJS({
182
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js"(exports, module) {
183
+ "use strict";
184
+ var debug = require_debug();
185
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
186
+ var { safeRe: re, t } = require_re();
187
+ var parseOptions = require_parse_options();
188
+ var { compareIdentifiers } = require_identifiers();
189
+ var isPrereleaseIdentifier = (prerelease, identifier) => {
190
+ const identifiers = identifier.split(".");
191
+ if (identifiers.length > prerelease.length) {
192
+ return false;
193
+ }
194
+ for (let i = 0; i < identifiers.length; i++) {
195
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
196
+ return false;
197
+ }
198
+ }
199
+ return true;
200
+ };
201
+ var SemVer = class _SemVer {
202
+ constructor(version, options) {
203
+ options = parseOptions(options);
204
+ if (version instanceof _SemVer) {
205
+ if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
206
+ return version;
207
+ } else {
208
+ version = version.version;
209
+ }
210
+ } else if (typeof version !== "string") {
211
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
212
+ }
213
+ if (version.length > MAX_LENGTH) {
214
+ throw new TypeError(
215
+ `version is longer than ${MAX_LENGTH} characters`
216
+ );
217
+ }
218
+ debug("SemVer", version, options);
219
+ this.options = options;
220
+ this.loose = !!options.loose;
221
+ this.includePrerelease = !!options.includePrerelease;
222
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
223
+ if (!m) {
224
+ throw new TypeError(`Invalid Version: ${version}`);
225
+ }
226
+ this.raw = version;
227
+ this.major = +m[1];
228
+ this.minor = +m[2];
229
+ this.patch = +m[3];
230
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
231
+ throw new TypeError("Invalid major version");
232
+ }
233
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
234
+ throw new TypeError("Invalid minor version");
235
+ }
236
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
237
+ throw new TypeError("Invalid patch version");
238
+ }
239
+ if (!m[4]) {
240
+ this.prerelease = [];
241
+ } else {
242
+ this.prerelease = m[4].split(".").map((id) => {
243
+ if (/^[0-9]+$/.test(id)) {
244
+ const num = +id;
245
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
246
+ return num;
247
+ }
248
+ }
249
+ return id;
250
+ });
251
+ }
252
+ this.build = m[5] ? m[5].split(".") : [];
253
+ this.format();
254
+ }
255
+ format() {
256
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
257
+ if (this.prerelease.length) {
258
+ this.version += `-${this.prerelease.join(".")}`;
259
+ }
260
+ return this.version;
261
+ }
262
+ toString() {
263
+ return this.version;
264
+ }
265
+ compare(other) {
266
+ debug("SemVer.compare", this.version, this.options, other);
267
+ if (!(other instanceof _SemVer)) {
268
+ if (typeof other === "string" && other === this.version) {
269
+ return 0;
270
+ }
271
+ other = new _SemVer(other, this.options);
272
+ }
273
+ if (other.version === this.version) {
274
+ return 0;
275
+ }
276
+ return this.compareMain(other) || this.comparePre(other);
277
+ }
278
+ compareMain(other) {
279
+ if (!(other instanceof _SemVer)) {
280
+ other = new _SemVer(other, this.options);
281
+ }
282
+ if (this.major < other.major) {
283
+ return -1;
284
+ }
285
+ if (this.major > other.major) {
286
+ return 1;
287
+ }
288
+ if (this.minor < other.minor) {
289
+ return -1;
290
+ }
291
+ if (this.minor > other.minor) {
292
+ return 1;
293
+ }
294
+ if (this.patch < other.patch) {
295
+ return -1;
296
+ }
297
+ if (this.patch > other.patch) {
298
+ return 1;
299
+ }
300
+ return 0;
301
+ }
302
+ comparePre(other) {
303
+ if (!(other instanceof _SemVer)) {
304
+ other = new _SemVer(other, this.options);
305
+ }
306
+ if (this.prerelease.length && !other.prerelease.length) {
307
+ return -1;
308
+ } else if (!this.prerelease.length && other.prerelease.length) {
309
+ return 1;
310
+ } else if (!this.prerelease.length && !other.prerelease.length) {
311
+ return 0;
312
+ }
313
+ let i = 0;
314
+ do {
315
+ const a = this.prerelease[i];
316
+ const b = other.prerelease[i];
317
+ debug("prerelease compare", i, a, b);
318
+ if (a === void 0 && b === void 0) {
319
+ return 0;
320
+ } else if (b === void 0) {
321
+ return 1;
322
+ } else if (a === void 0) {
323
+ return -1;
324
+ } else if (a === b) {
325
+ continue;
326
+ } else {
327
+ return compareIdentifiers(a, b);
328
+ }
329
+ } while (++i);
330
+ }
331
+ compareBuild(other) {
332
+ if (!(other instanceof _SemVer)) {
333
+ other = new _SemVer(other, this.options);
334
+ }
335
+ let i = 0;
336
+ do {
337
+ const a = this.build[i];
338
+ const b = other.build[i];
339
+ debug("build compare", i, a, b);
340
+ if (a === void 0 && b === void 0) {
341
+ return 0;
342
+ } else if (b === void 0) {
343
+ return 1;
344
+ } else if (a === void 0) {
345
+ return -1;
346
+ } else if (a === b) {
347
+ continue;
348
+ } else {
349
+ return compareIdentifiers(a, b);
350
+ }
351
+ } while (++i);
352
+ }
353
+ // preminor will bump the version up to the next minor release, and immediately
354
+ // down to pre-release. premajor and prepatch work the same way.
355
+ inc(release, identifier, identifierBase) {
356
+ if (release.startsWith("pre")) {
357
+ if (!identifier && identifierBase === false) {
358
+ throw new Error("invalid increment argument: identifier is empty");
359
+ }
360
+ if (identifier) {
361
+ const match2 = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
362
+ if (!match2 || match2[1] !== identifier) {
363
+ throw new Error(`invalid identifier: ${identifier}`);
364
+ }
365
+ }
366
+ }
367
+ switch (release) {
368
+ case "premajor":
369
+ this.prerelease.length = 0;
370
+ this.patch = 0;
371
+ this.minor = 0;
372
+ this.major++;
373
+ this.inc("pre", identifier, identifierBase);
374
+ break;
375
+ case "preminor":
376
+ this.prerelease.length = 0;
377
+ this.patch = 0;
378
+ this.minor++;
379
+ this.inc("pre", identifier, identifierBase);
380
+ break;
381
+ case "prepatch":
382
+ this.prerelease.length = 0;
383
+ this.inc("patch", identifier, identifierBase);
384
+ this.inc("pre", identifier, identifierBase);
385
+ break;
386
+ // If the input is a non-prerelease version, this acts the same as
387
+ // prepatch.
388
+ case "prerelease":
389
+ if (this.prerelease.length === 0) {
390
+ this.inc("patch", identifier, identifierBase);
391
+ }
392
+ this.inc("pre", identifier, identifierBase);
393
+ break;
394
+ case "release":
395
+ if (this.prerelease.length === 0) {
396
+ throw new Error(`version ${this.raw} is not a prerelease`);
397
+ }
398
+ this.prerelease.length = 0;
399
+ break;
400
+ case "major":
401
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
402
+ this.major++;
403
+ }
404
+ this.minor = 0;
405
+ this.patch = 0;
406
+ this.prerelease = [];
407
+ break;
408
+ case "minor":
409
+ if (this.patch !== 0 || this.prerelease.length === 0) {
410
+ this.minor++;
411
+ }
412
+ this.patch = 0;
413
+ this.prerelease = [];
414
+ break;
415
+ case "patch":
416
+ if (this.prerelease.length === 0) {
417
+ this.patch++;
418
+ }
419
+ this.prerelease = [];
420
+ break;
421
+ // This probably shouldn't be used publicly.
422
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
423
+ case "pre": {
424
+ const base = Number(identifierBase) ? 1 : 0;
425
+ if (this.prerelease.length === 0) {
426
+ this.prerelease = [base];
427
+ } else {
428
+ let i = this.prerelease.length;
429
+ while (--i >= 0) {
430
+ if (typeof this.prerelease[i] === "number") {
431
+ this.prerelease[i]++;
432
+ i = -2;
433
+ }
434
+ }
435
+ if (i === -1) {
436
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
437
+ throw new Error("invalid increment argument: identifier already exists");
438
+ }
439
+ this.prerelease.push(base);
440
+ }
441
+ }
442
+ if (identifier) {
443
+ let prerelease = [identifier, base];
444
+ if (identifierBase === false) {
445
+ prerelease = [identifier];
446
+ }
447
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
448
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
449
+ if (isNaN(prereleaseBase)) {
450
+ this.prerelease = prerelease;
451
+ }
452
+ } else {
453
+ this.prerelease = prerelease;
454
+ }
455
+ }
456
+ break;
457
+ }
458
+ default:
459
+ throw new Error(`invalid increment argument: ${release}`);
460
+ }
461
+ this.raw = this.format();
462
+ if (this.build.length) {
463
+ this.raw += `+${this.build.join(".")}`;
464
+ }
465
+ return this;
466
+ }
467
+ };
468
+ module.exports = SemVer;
469
+ }
470
+ });
471
+
472
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js
473
+ var require_parse = __commonJS({
474
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports, module) {
475
+ "use strict";
476
+ var SemVer = require_semver();
477
+ var parse = (version, options, throwErrors = false) => {
478
+ if (version instanceof SemVer) {
479
+ return version;
480
+ }
481
+ try {
482
+ return new SemVer(version, options);
483
+ } catch (er) {
484
+ if (!throwErrors) {
485
+ return null;
486
+ }
487
+ throw er;
488
+ }
489
+ };
490
+ module.exports = parse;
491
+ }
492
+ });
493
+
494
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js
495
+ var require_valid = __commonJS({
496
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports, module) {
497
+ "use strict";
498
+ var parse = require_parse();
499
+ var valid2 = (version, options) => {
500
+ const v = parse(version, options);
501
+ return v ? v.version : null;
502
+ };
503
+ module.exports = valid2;
504
+ }
505
+ });
506
+
507
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js
508
+ var require_clean = __commonJS({
509
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports, module) {
510
+ "use strict";
511
+ var parse = require_parse();
512
+ var clean = (version, options) => {
513
+ const s = parse(version.trim().replace(/^[=v]+/, ""), options);
514
+ return s ? s.version : null;
515
+ };
516
+ module.exports = clean;
517
+ }
518
+ });
519
+
520
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js
521
+ var require_inc = __commonJS({
522
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js"(exports, module) {
523
+ "use strict";
524
+ var SemVer = require_semver();
525
+ var inc = (version, release, options, identifier, identifierBase) => {
526
+ if (typeof options === "string") {
527
+ identifierBase = identifier;
528
+ identifier = options;
529
+ options = void 0;
530
+ }
531
+ try {
532
+ return new SemVer(
533
+ version instanceof SemVer ? version.version : version,
534
+ options
535
+ ).inc(release, identifier, identifierBase).version;
536
+ } catch (er) {
537
+ return null;
538
+ }
539
+ };
540
+ module.exports = inc;
541
+ }
542
+ });
543
+
544
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js
545
+ var require_diff = __commonJS({
546
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports, module) {
547
+ "use strict";
548
+ var parse = require_parse();
549
+ var diff = (version1, version2) => {
550
+ const v1 = parse(version1, null, true);
551
+ const v2 = parse(version2, null, true);
552
+ const comparison = v1.compare(v2);
553
+ if (comparison === 0) {
554
+ return null;
555
+ }
556
+ const v1Higher = comparison > 0;
557
+ const highVersion = v1Higher ? v1 : v2;
558
+ const lowVersion = v1Higher ? v2 : v1;
559
+ const highHasPre = !!highVersion.prerelease.length;
560
+ const lowHasPre = !!lowVersion.prerelease.length;
561
+ if (lowHasPre && !highHasPre) {
562
+ if (!lowVersion.patch && !lowVersion.minor) {
563
+ return "major";
564
+ }
565
+ if (lowVersion.compareMain(highVersion) === 0) {
566
+ if (lowVersion.minor && !lowVersion.patch) {
567
+ return "minor";
568
+ }
569
+ return "patch";
570
+ }
571
+ }
572
+ const prefix = highHasPre ? "pre" : "";
573
+ if (v1.major !== v2.major) {
574
+ return prefix + "major";
575
+ }
576
+ if (v1.minor !== v2.minor) {
577
+ return prefix + "minor";
578
+ }
579
+ if (v1.patch !== v2.patch) {
580
+ return prefix + "patch";
581
+ }
582
+ return "prerelease";
583
+ };
584
+ module.exports = diff;
585
+ }
586
+ });
587
+
588
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js
589
+ var require_major = __commonJS({
590
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js"(exports, module) {
591
+ "use strict";
592
+ var SemVer = require_semver();
593
+ var major = (a, loose) => new SemVer(a, loose).major;
594
+ module.exports = major;
595
+ }
596
+ });
597
+
598
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js
599
+ var require_minor = __commonJS({
600
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js"(exports, module) {
601
+ "use strict";
602
+ var SemVer = require_semver();
603
+ var minor = (a, loose) => new SemVer(a, loose).minor;
604
+ module.exports = minor;
605
+ }
606
+ });
607
+
608
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js
609
+ var require_patch = __commonJS({
610
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js"(exports, module) {
611
+ "use strict";
612
+ var SemVer = require_semver();
613
+ var patch = (a, loose) => new SemVer(a, loose).patch;
614
+ module.exports = patch;
615
+ }
616
+ });
617
+
618
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js
619
+ var require_prerelease = __commonJS({
620
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports, module) {
621
+ "use strict";
622
+ var parse = require_parse();
623
+ var prerelease = (version, options) => {
624
+ const parsed = parse(version, options);
625
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
626
+ };
627
+ module.exports = prerelease;
628
+ }
629
+ });
630
+
631
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js
632
+ var require_compare = __commonJS({
633
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js"(exports, module) {
634
+ "use strict";
635
+ var SemVer = require_semver();
636
+ var compare2 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
637
+ module.exports = compare2;
638
+ }
639
+ });
640
+
641
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js
642
+ var require_rcompare = __commonJS({
643
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js"(exports, module) {
644
+ "use strict";
645
+ var compare2 = require_compare();
646
+ var rcompare = (a, b, loose) => compare2(b, a, loose);
647
+ module.exports = rcompare;
648
+ }
649
+ });
650
+
651
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js
652
+ var require_compare_loose = __commonJS({
653
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js"(exports, module) {
654
+ "use strict";
655
+ var compare2 = require_compare();
656
+ var compareLoose = (a, b) => compare2(a, b, true);
657
+ module.exports = compareLoose;
658
+ }
659
+ });
660
+
661
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js
662
+ var require_compare_build = __commonJS({
663
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js"(exports, module) {
664
+ "use strict";
665
+ var SemVer = require_semver();
666
+ var compareBuild = (a, b, loose) => {
667
+ const versionA = new SemVer(a, loose);
668
+ const versionB = new SemVer(b, loose);
669
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
670
+ };
671
+ module.exports = compareBuild;
672
+ }
673
+ });
674
+
675
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js
676
+ var require_sort = __commonJS({
677
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js"(exports, module) {
678
+ "use strict";
679
+ var compareBuild = require_compare_build();
680
+ var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
681
+ module.exports = sort;
682
+ }
683
+ });
684
+
685
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js
686
+ var require_rsort = __commonJS({
687
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js"(exports, module) {
688
+ "use strict";
689
+ var compareBuild = require_compare_build();
690
+ var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
691
+ module.exports = rsort;
692
+ }
693
+ });
694
+
695
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js
696
+ var require_gt = __commonJS({
697
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js"(exports, module) {
698
+ "use strict";
699
+ var compare2 = require_compare();
700
+ var gt = (a, b, loose) => compare2(a, b, loose) > 0;
701
+ module.exports = gt;
702
+ }
703
+ });
704
+
705
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js
706
+ var require_lt = __commonJS({
707
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js"(exports, module) {
708
+ "use strict";
709
+ var compare2 = require_compare();
710
+ var lt = (a, b, loose) => compare2(a, b, loose) < 0;
711
+ module.exports = lt;
712
+ }
713
+ });
714
+
715
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js
716
+ var require_eq = __commonJS({
717
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js"(exports, module) {
718
+ "use strict";
719
+ var compare2 = require_compare();
720
+ var eq = (a, b, loose) => compare2(a, b, loose) === 0;
721
+ module.exports = eq;
722
+ }
723
+ });
724
+
725
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js
726
+ var require_neq = __commonJS({
727
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js"(exports, module) {
728
+ "use strict";
729
+ var compare2 = require_compare();
730
+ var neq = (a, b, loose) => compare2(a, b, loose) !== 0;
731
+ module.exports = neq;
732
+ }
733
+ });
734
+
735
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js
736
+ var require_gte = __commonJS({
737
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js"(exports, module) {
738
+ "use strict";
739
+ var compare2 = require_compare();
740
+ var gte2 = (a, b, loose) => compare2(a, b, loose) >= 0;
741
+ module.exports = gte2;
742
+ }
743
+ });
744
+
745
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js
746
+ var require_lte = __commonJS({
747
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js"(exports, module) {
748
+ "use strict";
749
+ var compare2 = require_compare();
750
+ var lte2 = (a, b, loose) => compare2(a, b, loose) <= 0;
751
+ module.exports = lte2;
752
+ }
753
+ });
754
+
755
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js
756
+ var require_cmp = __commonJS({
757
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js"(exports, module) {
758
+ "use strict";
759
+ var eq = require_eq();
760
+ var neq = require_neq();
761
+ var gt = require_gt();
762
+ var gte2 = require_gte();
763
+ var lt = require_lt();
764
+ var lte2 = require_lte();
765
+ var cmp = (a, op, b, loose) => {
766
+ switch (op) {
767
+ case "===":
768
+ if (typeof a === "object") {
769
+ a = a.version;
770
+ }
771
+ if (typeof b === "object") {
772
+ b = b.version;
773
+ }
774
+ return a === b;
775
+ case "!==":
776
+ if (typeof a === "object") {
777
+ a = a.version;
778
+ }
779
+ if (typeof b === "object") {
780
+ b = b.version;
781
+ }
782
+ return a !== b;
783
+ case "":
784
+ case "=":
785
+ case "==":
786
+ return eq(a, b, loose);
787
+ case "!=":
788
+ return neq(a, b, loose);
789
+ case ">":
790
+ return gt(a, b, loose);
791
+ case ">=":
792
+ return gte2(a, b, loose);
793
+ case "<":
794
+ return lt(a, b, loose);
795
+ case "<=":
796
+ return lte2(a, b, loose);
797
+ default:
798
+ throw new TypeError(`Invalid operator: ${op}`);
799
+ }
800
+ };
801
+ module.exports = cmp;
802
+ }
803
+ });
804
+
805
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js
806
+ var require_coerce = __commonJS({
807
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports, module) {
808
+ "use strict";
809
+ var SemVer = require_semver();
810
+ var parse = require_parse();
811
+ var { safeRe: re, t } = require_re();
812
+ var coerce = (version, options) => {
813
+ if (version instanceof SemVer) {
814
+ return version;
815
+ }
816
+ if (typeof version === "number") {
817
+ version = String(version);
818
+ }
819
+ if (typeof version !== "string") {
820
+ return null;
821
+ }
822
+ options = options || {};
823
+ let match2 = null;
824
+ if (!options.rtl) {
825
+ match2 = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
826
+ } else {
827
+ const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
828
+ let next;
829
+ while ((next = coerceRtlRegex.exec(version)) && (!match2 || match2.index + match2[0].length !== version.length)) {
830
+ if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) {
831
+ match2 = next;
832
+ }
833
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
834
+ }
835
+ coerceRtlRegex.lastIndex = -1;
836
+ }
837
+ if (match2 === null) {
838
+ return null;
839
+ }
840
+ const major = match2[2];
841
+ const minor = match2[3] || "0";
842
+ const patch = match2[4] || "0";
843
+ const prerelease = options.includePrerelease && match2[5] ? `-${match2[5]}` : "";
844
+ const build = options.includePrerelease && match2[6] ? `+${match2[6]}` : "";
845
+ return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
846
+ };
847
+ module.exports = coerce;
848
+ }
849
+ });
850
+
851
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js
852
+ var require_truncate = __commonJS({
853
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports, module) {
854
+ "use strict";
855
+ var parse = require_parse();
856
+ var constants = require_constants();
857
+ var SemVer = require_semver();
858
+ var truncate = (version, truncation, options) => {
859
+ if (!constants.RELEASE_TYPES.includes(truncation)) {
860
+ return null;
861
+ }
862
+ const clonedVersion = cloneInputVersion(version, options);
863
+ return clonedVersion && doTruncation(clonedVersion, truncation);
864
+ };
865
+ var cloneInputVersion = (version, options) => {
866
+ const versionStringToParse = version instanceof SemVer ? version.version : version;
867
+ return parse(versionStringToParse, options);
868
+ };
869
+ var doTruncation = (version, truncation) => {
870
+ if (isPrerelease(truncation)) {
871
+ return version.version;
872
+ }
873
+ version.prerelease = [];
874
+ switch (truncation) {
875
+ case "major":
876
+ version.minor = 0;
877
+ version.patch = 0;
878
+ break;
879
+ case "minor":
880
+ version.patch = 0;
881
+ break;
882
+ }
883
+ return version.format();
884
+ };
885
+ var isPrerelease = (type) => {
886
+ return type.startsWith("pre");
887
+ };
888
+ module.exports = truncate;
889
+ }
890
+ });
891
+
892
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js
893
+ var require_lrucache = __commonJS({
894
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js"(exports, module) {
895
+ "use strict";
896
+ var LRUCache = class {
897
+ constructor() {
898
+ this.max = 1e3;
899
+ this.map = /* @__PURE__ */ new Map();
900
+ }
901
+ get(key) {
902
+ const value = this.map.get(key);
903
+ if (value === void 0) {
904
+ return void 0;
905
+ } else {
906
+ this.map.delete(key);
907
+ this.map.set(key, value);
908
+ return value;
909
+ }
910
+ }
911
+ delete(key) {
912
+ return this.map.delete(key);
913
+ }
914
+ set(key, value) {
915
+ const deleted = this.delete(key);
916
+ if (!deleted && value !== void 0) {
917
+ if (this.map.size >= this.max) {
918
+ const firstKey = this.map.keys().next().value;
919
+ this.delete(firstKey);
920
+ }
921
+ this.map.set(key, value);
922
+ }
923
+ return this;
924
+ }
925
+ };
926
+ module.exports = LRUCache;
927
+ }
928
+ });
929
+
930
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js
931
+ var require_range = __commonJS({
932
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js"(exports, module) {
933
+ "use strict";
934
+ var SPACE_CHARACTERS = /\s+/g;
935
+ var Range = class _Range {
936
+ constructor(range2, options) {
937
+ options = parseOptions(options);
938
+ if (range2 instanceof _Range) {
939
+ if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) {
940
+ return range2;
941
+ } else {
942
+ return new _Range(range2.raw, options);
943
+ }
944
+ }
945
+ if (range2 instanceof Comparator) {
946
+ this.raw = range2.value;
947
+ this.set = [[range2]];
948
+ this.formatted = void 0;
949
+ return this;
950
+ }
951
+ this.options = options;
952
+ this.loose = !!options.loose;
953
+ this.includePrerelease = !!options.includePrerelease;
954
+ this.raw = range2.trim().replace(SPACE_CHARACTERS, " ");
955
+ this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
956
+ if (!this.set.length) {
957
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
958
+ }
959
+ if (this.set.length > 1) {
960
+ const first = this.set[0];
961
+ this.set = this.set.filter((c) => !isNullSet(c[0]));
962
+ if (this.set.length === 0) {
963
+ this.set = [first];
964
+ } else if (this.set.length > 1) {
965
+ for (const c of this.set) {
966
+ if (c.length === 1 && isAny(c[0])) {
967
+ this.set = [c];
968
+ break;
969
+ }
970
+ }
971
+ }
972
+ }
973
+ this.formatted = void 0;
974
+ }
975
+ get range() {
976
+ if (this.formatted === void 0) {
977
+ this.formatted = "";
978
+ for (let i = 0; i < this.set.length; i++) {
979
+ if (i > 0) {
980
+ this.formatted += "||";
981
+ }
982
+ const comps = this.set[i];
983
+ for (let k = 0; k < comps.length; k++) {
984
+ if (k > 0) {
985
+ this.formatted += " ";
986
+ }
987
+ this.formatted += comps[k].toString().trim();
988
+ }
989
+ }
990
+ }
991
+ return this.formatted;
992
+ }
993
+ format() {
994
+ return this.range;
995
+ }
996
+ toString() {
997
+ return this.range;
998
+ }
999
+ parseRange(range2) {
1000
+ range2 = range2.replace(BUILDSTRIPRE, "");
1001
+ const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
1002
+ const memoKey = memoOpts + ":" + range2;
1003
+ const cached = cache.get(memoKey);
1004
+ if (cached) {
1005
+ return cached;
1006
+ }
1007
+ const loose = this.options.loose;
1008
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
1009
+ range2 = range2.replace(hr, hyphenReplace(this.options.includePrerelease));
1010
+ debug("hyphen replace", range2);
1011
+ range2 = range2.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
1012
+ debug("comparator trim", range2);
1013
+ range2 = range2.replace(re[t.TILDETRIM], tildeTrimReplace);
1014
+ debug("tilde trim", range2);
1015
+ range2 = range2.replace(re[t.CARETTRIM], caretTrimReplace);
1016
+ debug("caret trim", range2);
1017
+ let rangeList = range2.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
1018
+ if (loose) {
1019
+ rangeList = rangeList.filter((comp) => {
1020
+ debug("loose invalid filter", comp, this.options);
1021
+ return !!comp.match(re[t.COMPARATORLOOSE]);
1022
+ });
1023
+ }
1024
+ debug("range list", rangeList);
1025
+ const rangeMap = /* @__PURE__ */ new Map();
1026
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
1027
+ for (const comp of comparators) {
1028
+ if (isNullSet(comp)) {
1029
+ return [comp];
1030
+ }
1031
+ rangeMap.set(comp.value, comp);
1032
+ }
1033
+ if (rangeMap.size > 1 && rangeMap.has("")) {
1034
+ rangeMap.delete("");
1035
+ }
1036
+ const result = [...rangeMap.values()];
1037
+ cache.set(memoKey, result);
1038
+ return result;
1039
+ }
1040
+ intersects(range2, options) {
1041
+ if (!(range2 instanceof _Range)) {
1042
+ throw new TypeError("a Range is required");
1043
+ }
1044
+ return this.set.some((thisComparators) => {
1045
+ return isSatisfiable(thisComparators, options) && range2.set.some((rangeComparators) => {
1046
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
1047
+ return rangeComparators.every((rangeComparator) => {
1048
+ return thisComparator.intersects(rangeComparator, options);
1049
+ });
1050
+ });
1051
+ });
1052
+ });
1053
+ }
1054
+ // if ANY of the sets match ALL of its comparators, then pass
1055
+ test(version) {
1056
+ if (!version) {
1057
+ return false;
1058
+ }
1059
+ if (typeof version === "string") {
1060
+ try {
1061
+ version = new SemVer(version, this.options);
1062
+ } catch (er) {
1063
+ return false;
1064
+ }
1065
+ }
1066
+ for (let i = 0; i < this.set.length; i++) {
1067
+ if (testSet(this.set[i], version, this.options)) {
1068
+ return true;
1069
+ }
1070
+ }
1071
+ return false;
1072
+ }
1073
+ };
1074
+ module.exports = Range;
1075
+ var LRU = require_lrucache();
1076
+ var cache = new LRU();
1077
+ var parseOptions = require_parse_options();
1078
+ var Comparator = require_comparator();
1079
+ var debug = require_debug();
1080
+ var SemVer = require_semver();
1081
+ var {
1082
+ safeRe: re,
1083
+ src,
1084
+ t,
1085
+ comparatorTrimReplace,
1086
+ tildeTrimReplace,
1087
+ caretTrimReplace
1088
+ } = require_re();
1089
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
1090
+ var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
1091
+ var isNullSet = (c) => c.value === "<0.0.0-0";
1092
+ var isAny = (c) => c.value === "";
1093
+ var isSatisfiable = (comparators, options) => {
1094
+ let result = true;
1095
+ const remainingComparators = comparators.slice();
1096
+ let testComparator = remainingComparators.pop();
1097
+ while (result && remainingComparators.length) {
1098
+ result = remainingComparators.every((otherComparator) => {
1099
+ return testComparator.intersects(otherComparator, options);
1100
+ });
1101
+ testComparator = remainingComparators.pop();
1102
+ }
1103
+ return result;
1104
+ };
1105
+ var parseComparator = (comp, options) => {
1106
+ comp = comp.replace(re[t.BUILD], "");
1107
+ debug("comp", comp, options);
1108
+ comp = replaceCarets(comp, options);
1109
+ debug("caret", comp);
1110
+ comp = replaceTildes(comp, options);
1111
+ debug("tildes", comp);
1112
+ comp = replaceXRanges(comp, options);
1113
+ debug("xrange", comp);
1114
+ comp = replaceStars(comp, options);
1115
+ debug("stars", comp);
1116
+ return comp;
1117
+ };
1118
+ var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
1119
+ var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
1120
+ var replaceTildes = (comp, options) => {
1121
+ return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
1122
+ };
1123
+ var replaceTilde = (comp, options) => {
1124
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1125
+ const z = options.includePrerelease ? "-0" : "";
1126
+ return comp.replace(r, (_, M, m, p, pr) => {
1127
+ debug("tilde", comp, _, M, m, p, pr);
1128
+ let ret;
1129
+ if (isX(M)) {
1130
+ ret = "";
1131
+ } else if (isX(m)) {
1132
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
1133
+ } else if (isX(p)) {
1134
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
1135
+ } else if (pr) {
1136
+ debug("replaceTilde pr", pr);
1137
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1138
+ } else {
1139
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1140
+ }
1141
+ debug("tilde return", ret);
1142
+ return ret;
1143
+ });
1144
+ };
1145
+ var replaceCarets = (comp, options) => {
1146
+ return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
1147
+ };
1148
+ var replaceCaret = (comp, options) => {
1149
+ debug("caret", comp, options);
1150
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
1151
+ const z = options.includePrerelease ? "-0" : "";
1152
+ return comp.replace(r, (_, M, m, p, pr) => {
1153
+ debug("caret", comp, _, M, m, p, pr);
1154
+ let ret;
1155
+ if (isX(M)) {
1156
+ ret = "";
1157
+ } else if (isX(m)) {
1158
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
1159
+ } else if (isX(p)) {
1160
+ if (M === "0") {
1161
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
1162
+ } else {
1163
+ ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
1164
+ }
1165
+ } else if (pr) {
1166
+ debug("replaceCaret pr", pr);
1167
+ if (M === "0") {
1168
+ if (m === "0") {
1169
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
1170
+ } else {
1171
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1172
+ }
1173
+ } else {
1174
+ ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
1175
+ }
1176
+ } else {
1177
+ debug("no pr");
1178
+ if (M === "0") {
1179
+ if (m === "0") {
1180
+ ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
1181
+ } else {
1182
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1183
+ }
1184
+ } else {
1185
+ ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
1186
+ }
1187
+ }
1188
+ debug("caret return", ret);
1189
+ return ret;
1190
+ });
1191
+ };
1192
+ var replaceXRanges = (comp, options) => {
1193
+ debug("replaceXRanges", comp, options);
1194
+ return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
1195
+ };
1196
+ var replaceXRange = (comp, options) => {
1197
+ comp = comp.trim();
1198
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
1199
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
1200
+ debug("xRange", comp, ret, gtlt, M, m, p, pr);
1201
+ if (invalidXRangeOrder(M, m, p)) {
1202
+ return comp;
1203
+ }
1204
+ const xM = isX(M);
1205
+ const xm = xM || isX(m);
1206
+ const xp = xm || isX(p);
1207
+ const anyX = xp;
1208
+ if (gtlt === "=" && anyX) {
1209
+ gtlt = "";
1210
+ }
1211
+ pr = options.includePrerelease ? "-0" : "";
1212
+ if (xM) {
1213
+ if (gtlt === ">" || gtlt === "<") {
1214
+ ret = "<0.0.0-0";
1215
+ } else {
1216
+ ret = "*";
1217
+ }
1218
+ } else if (gtlt && anyX) {
1219
+ if (xm) {
1220
+ m = 0;
1221
+ }
1222
+ p = 0;
1223
+ if (gtlt === ">") {
1224
+ gtlt = ">=";
1225
+ if (xm) {
1226
+ M = +M + 1;
1227
+ m = 0;
1228
+ p = 0;
1229
+ } else {
1230
+ m = +m + 1;
1231
+ p = 0;
1232
+ }
1233
+ } else if (gtlt === "<=") {
1234
+ gtlt = "<";
1235
+ if (xm) {
1236
+ M = +M + 1;
1237
+ } else {
1238
+ m = +m + 1;
1239
+ }
1240
+ }
1241
+ if (gtlt === "<") {
1242
+ pr = "-0";
1243
+ }
1244
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
1245
+ } else if (xm) {
1246
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
1247
+ } else if (xp) {
1248
+ ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
1249
+ }
1250
+ debug("xRange return", ret);
1251
+ return ret;
1252
+ });
1253
+ };
1254
+ var replaceStars = (comp, options) => {
1255
+ debug("replaceStars", comp, options);
1256
+ return comp.trim().replace(re[t.STAR], "");
1257
+ };
1258
+ var replaceGTE0 = (comp, options) => {
1259
+ debug("replaceGTE0", comp, options);
1260
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1261
+ };
1262
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1263
+ if (isX(fM)) {
1264
+ from = "";
1265
+ } else if (isX(fm)) {
1266
+ from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
1267
+ } else if (isX(fp)) {
1268
+ from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
1269
+ } else if (fpr) {
1270
+ from = `>=${from}`;
1271
+ } else {
1272
+ from = `>=${from}${incPr ? "-0" : ""}`;
1273
+ }
1274
+ if (isX(tM)) {
1275
+ to = "";
1276
+ } else if (isX(tm)) {
1277
+ to = `<${+tM + 1}.0.0-0`;
1278
+ } else if (isX(tp)) {
1279
+ to = `<${tM}.${+tm + 1}.0-0`;
1280
+ } else if (tpr) {
1281
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
1282
+ } else if (incPr) {
1283
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
1284
+ } else {
1285
+ to = `<=${to}`;
1286
+ }
1287
+ return `${from} ${to}`.trim();
1288
+ };
1289
+ var testSet = (set, version, options) => {
1290
+ for (let i = 0; i < set.length; i++) {
1291
+ if (!set[i].test(version)) {
1292
+ return false;
1293
+ }
1294
+ }
1295
+ if (version.prerelease.length && !options.includePrerelease) {
1296
+ for (let i = 0; i < set.length; i++) {
1297
+ debug(set[i].semver);
1298
+ if (set[i].semver === Comparator.ANY) {
1299
+ continue;
1300
+ }
1301
+ if (set[i].semver.prerelease.length > 0) {
1302
+ const allowed = set[i].semver;
1303
+ if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
1304
+ return true;
1305
+ }
1306
+ }
1307
+ }
1308
+ return false;
1309
+ }
1310
+ return true;
1311
+ };
1312
+ }
1313
+ });
1314
+
1315
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js
1316
+ var require_comparator = __commonJS({
1317
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js"(exports, module) {
1318
+ "use strict";
1319
+ var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
1320
+ var Comparator = class _Comparator {
1321
+ static get ANY() {
1322
+ return ANY;
1323
+ }
1324
+ constructor(comp, options) {
1325
+ options = parseOptions(options);
1326
+ if (comp instanceof _Comparator) {
1327
+ if (comp.loose === !!options.loose) {
1328
+ return comp;
1329
+ } else {
1330
+ comp = comp.value;
1331
+ }
1332
+ }
1333
+ comp = comp.trim().split(/\s+/).join(" ");
1334
+ debug("comparator", comp, options);
1335
+ this.options = options;
1336
+ this.loose = !!options.loose;
1337
+ this.parse(comp);
1338
+ if (this.semver === ANY) {
1339
+ this.value = "";
1340
+ } else {
1341
+ this.value = this.operator + this.semver.version;
1342
+ }
1343
+ debug("comp", this);
1344
+ }
1345
+ parse(comp) {
1346
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1347
+ const m = comp.match(r);
1348
+ if (!m) {
1349
+ throw new TypeError(`Invalid comparator: ${comp}`);
1350
+ }
1351
+ this.operator = m[1] !== void 0 ? m[1] : "";
1352
+ if (this.operator === "=") {
1353
+ this.operator = "";
1354
+ }
1355
+ if (!m[2]) {
1356
+ this.semver = ANY;
1357
+ } else {
1358
+ this.semver = new SemVer(m[2], this.options.loose);
1359
+ }
1360
+ }
1361
+ toString() {
1362
+ return this.value;
1363
+ }
1364
+ test(version) {
1365
+ debug("Comparator.test", version, this.options.loose);
1366
+ if (this.semver === ANY || version === ANY) {
1367
+ return true;
1368
+ }
1369
+ if (typeof version === "string") {
1370
+ try {
1371
+ version = new SemVer(version, this.options);
1372
+ } catch (er) {
1373
+ return false;
1374
+ }
1375
+ }
1376
+ return cmp(version, this.operator, this.semver, this.options);
1377
+ }
1378
+ intersects(comp, options) {
1379
+ if (!(comp instanceof _Comparator)) {
1380
+ throw new TypeError("a Comparator is required");
1381
+ }
1382
+ if (this.operator === "") {
1383
+ if (this.value === "") {
1384
+ return true;
1385
+ }
1386
+ return new Range(comp.value, options).test(this.value);
1387
+ } else if (comp.operator === "") {
1388
+ if (comp.value === "") {
1389
+ return true;
1390
+ }
1391
+ return new Range(this.value, options).test(comp.semver);
1392
+ }
1393
+ options = parseOptions(options);
1394
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
1395
+ return false;
1396
+ }
1397
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
1398
+ return false;
1399
+ }
1400
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
1401
+ return true;
1402
+ }
1403
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
1404
+ return true;
1405
+ }
1406
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
1407
+ return true;
1408
+ }
1409
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
1410
+ return true;
1411
+ }
1412
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
1413
+ return true;
1414
+ }
1415
+ return false;
1416
+ }
1417
+ };
1418
+ module.exports = Comparator;
1419
+ var parseOptions = require_parse_options();
1420
+ var { safeRe: re, t } = require_re();
1421
+ var cmp = require_cmp();
1422
+ var debug = require_debug();
1423
+ var SemVer = require_semver();
1424
+ var Range = require_range();
1425
+ }
1426
+ });
1427
+
1428
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js
1429
+ var require_satisfies = __commonJS({
1430
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js"(exports, module) {
1431
+ "use strict";
1432
+ var Range = require_range();
1433
+ var satisfies = (version, range2, options) => {
1434
+ try {
1435
+ range2 = new Range(range2, options);
1436
+ } catch (er) {
1437
+ return false;
1438
+ }
1439
+ return range2.test(version);
1440
+ };
1441
+ module.exports = satisfies;
1442
+ }
1443
+ });
1444
+
1445
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js
1446
+ var require_to_comparators = __commonJS({
1447
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js"(exports, module) {
1448
+ "use strict";
1449
+ var Range = require_range();
1450
+ var toComparators = (range2, options) => new Range(range2, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1451
+ module.exports = toComparators;
1452
+ }
1453
+ });
1454
+
1455
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js
1456
+ var require_max_satisfying = __commonJS({
1457
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
1458
+ "use strict";
1459
+ var SemVer = require_semver();
1460
+ var Range = require_range();
1461
+ var maxSatisfying = (versions, range2, options) => {
1462
+ let max = null;
1463
+ let maxSV = null;
1464
+ let rangeObj = null;
1465
+ try {
1466
+ rangeObj = new Range(range2, options);
1467
+ } catch (er) {
1468
+ return null;
1469
+ }
1470
+ versions.forEach((v) => {
1471
+ if (rangeObj.test(v)) {
1472
+ if (!max || maxSV.compare(v) === -1) {
1473
+ max = v;
1474
+ maxSV = new SemVer(max, options);
1475
+ }
1476
+ }
1477
+ });
1478
+ return max;
1479
+ };
1480
+ module.exports = maxSatisfying;
1481
+ }
1482
+ });
1483
+
1484
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js
1485
+ var require_min_satisfying = __commonJS({
1486
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
1487
+ "use strict";
1488
+ var SemVer = require_semver();
1489
+ var Range = require_range();
1490
+ var minSatisfying = (versions, range2, options) => {
1491
+ let min = null;
1492
+ let minSV = null;
1493
+ let rangeObj = null;
1494
+ try {
1495
+ rangeObj = new Range(range2, options);
1496
+ } catch (er) {
1497
+ return null;
1498
+ }
1499
+ versions.forEach((v) => {
1500
+ if (rangeObj.test(v)) {
1501
+ if (!min || minSV.compare(v) === 1) {
1502
+ min = v;
1503
+ minSV = new SemVer(min, options);
1504
+ }
1505
+ }
1506
+ });
1507
+ return min;
1508
+ };
1509
+ module.exports = minSatisfying;
1510
+ }
1511
+ });
1512
+
1513
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js
1514
+ var require_min_version = __commonJS({
1515
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js"(exports, module) {
1516
+ "use strict";
1517
+ var SemVer = require_semver();
1518
+ var Range = require_range();
1519
+ var gt = require_gt();
1520
+ var minVersion = (range2, loose) => {
1521
+ range2 = new Range(range2, loose);
1522
+ let minver = new SemVer("0.0.0");
1523
+ if (range2.test(minver)) {
1524
+ return minver;
1525
+ }
1526
+ minver = new SemVer("0.0.0-0");
1527
+ if (range2.test(minver)) {
1528
+ return minver;
1529
+ }
1530
+ minver = null;
1531
+ for (let i = 0; i < range2.set.length; ++i) {
1532
+ const comparators = range2.set[i];
1533
+ let setMin = null;
1534
+ comparators.forEach((comparator) => {
1535
+ const compver = new SemVer(comparator.semver.version);
1536
+ switch (comparator.operator) {
1537
+ case ">":
1538
+ if (compver.prerelease.length === 0) {
1539
+ compver.patch++;
1540
+ } else {
1541
+ compver.prerelease.push(0);
1542
+ }
1543
+ compver.raw = compver.format();
1544
+ /* fallthrough */
1545
+ case "":
1546
+ case ">=":
1547
+ if (!setMin || gt(compver, setMin)) {
1548
+ setMin = compver;
1549
+ }
1550
+ break;
1551
+ case "<":
1552
+ case "<=":
1553
+ break;
1554
+ /* istanbul ignore next */
1555
+ default:
1556
+ throw new Error(`Unexpected operation: ${comparator.operator}`);
1557
+ }
1558
+ });
1559
+ if (setMin && (!minver || gt(minver, setMin))) {
1560
+ minver = setMin;
1561
+ }
1562
+ }
1563
+ if (minver && range2.test(minver)) {
1564
+ return minver;
1565
+ }
1566
+ return null;
1567
+ };
1568
+ module.exports = minVersion;
1569
+ }
1570
+ });
1571
+
1572
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js
1573
+ var require_valid2 = __commonJS({
1574
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js"(exports, module) {
1575
+ "use strict";
1576
+ var Range = require_range();
1577
+ var validRange = (range2, options) => {
1578
+ try {
1579
+ return new Range(range2, options).range || "*";
1580
+ } catch (er) {
1581
+ return null;
1582
+ }
1583
+ };
1584
+ module.exports = validRange;
1585
+ }
1586
+ });
1587
+
1588
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js
1589
+ var require_outside = __commonJS({
1590
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js"(exports, module) {
1591
+ "use strict";
1592
+ var SemVer = require_semver();
1593
+ var Comparator = require_comparator();
1594
+ var { ANY } = Comparator;
1595
+ var Range = require_range();
1596
+ var satisfies = require_satisfies();
1597
+ var gt = require_gt();
1598
+ var lt = require_lt();
1599
+ var lte2 = require_lte();
1600
+ var gte2 = require_gte();
1601
+ var outside = (version, range2, hilo, options) => {
1602
+ version = new SemVer(version, options);
1603
+ range2 = new Range(range2, options);
1604
+ let gtfn, ltefn, ltfn, comp, ecomp;
1605
+ switch (hilo) {
1606
+ case ">":
1607
+ gtfn = gt;
1608
+ ltefn = lte2;
1609
+ ltfn = lt;
1610
+ comp = ">";
1611
+ ecomp = ">=";
1612
+ break;
1613
+ case "<":
1614
+ gtfn = lt;
1615
+ ltefn = gte2;
1616
+ ltfn = gt;
1617
+ comp = "<";
1618
+ ecomp = "<=";
1619
+ break;
1620
+ default:
1621
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
1622
+ }
1623
+ if (satisfies(version, range2, options)) {
1624
+ return false;
1625
+ }
1626
+ for (let i = 0; i < range2.set.length; ++i) {
1627
+ const comparators = range2.set[i];
1628
+ let high = null;
1629
+ let low = null;
1630
+ comparators.forEach((comparator) => {
1631
+ if (comparator.semver === ANY) {
1632
+ comparator = new Comparator(">=0.0.0");
1633
+ }
1634
+ high = high || comparator;
1635
+ low = low || comparator;
1636
+ if (gtfn(comparator.semver, high.semver, options)) {
1637
+ high = comparator;
1638
+ } else if (ltfn(comparator.semver, low.semver, options)) {
1639
+ low = comparator;
1640
+ }
1641
+ });
1642
+ if (high.operator === comp || high.operator === ecomp) {
1643
+ return false;
1644
+ }
1645
+ if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
1646
+ return false;
1647
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
1648
+ return false;
1649
+ }
1650
+ }
1651
+ return true;
1652
+ };
1653
+ module.exports = outside;
1654
+ }
1655
+ });
1656
+
1657
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js
1658
+ var require_gtr = __commonJS({
1659
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js"(exports, module) {
1660
+ "use strict";
1661
+ var outside = require_outside();
1662
+ var gtr = (version, range2, options) => outside(version, range2, ">", options);
1663
+ module.exports = gtr;
1664
+ }
1665
+ });
1666
+
1667
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js
1668
+ var require_ltr = __commonJS({
1669
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js"(exports, module) {
1670
+ "use strict";
1671
+ var outside = require_outside();
1672
+ var ltr = (version, range2, options) => outside(version, range2, "<", options);
1673
+ module.exports = ltr;
1674
+ }
1675
+ });
1676
+
1677
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js
1678
+ var require_intersects = __commonJS({
1679
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js"(exports, module) {
1680
+ "use strict";
1681
+ var Range = require_range();
1682
+ var intersects = (r1, r2, options) => {
1683
+ r1 = new Range(r1, options);
1684
+ r2 = new Range(r2, options);
1685
+ return r1.intersects(r2, options);
1686
+ };
1687
+ module.exports = intersects;
1688
+ }
1689
+ });
1690
+
1691
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js
1692
+ var require_simplify = __commonJS({
1693
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js"(exports, module) {
1694
+ "use strict";
1695
+ var satisfies = require_satisfies();
1696
+ var compare2 = require_compare();
1697
+ module.exports = (versions, range2, options) => {
1698
+ const set = [];
1699
+ let first = null;
1700
+ let prev = null;
1701
+ const v = versions.sort((a, b) => compare2(a, b, options));
1702
+ for (const version of v) {
1703
+ const included = satisfies(version, range2, options);
1704
+ if (included) {
1705
+ prev = version;
1706
+ if (!first) {
1707
+ first = version;
1708
+ }
1709
+ } else {
1710
+ if (prev) {
1711
+ set.push([first, prev]);
1712
+ }
1713
+ prev = null;
1714
+ first = null;
1715
+ }
1716
+ }
1717
+ if (first) {
1718
+ set.push([first, null]);
1719
+ }
1720
+ const ranges = [];
1721
+ for (const [min, max] of set) {
1722
+ if (min === max) {
1723
+ ranges.push(min);
1724
+ } else if (!max && min === v[0]) {
1725
+ ranges.push("*");
1726
+ } else if (!max) {
1727
+ ranges.push(`>=${min}`);
1728
+ } else if (min === v[0]) {
1729
+ ranges.push(`<=${max}`);
1730
+ } else {
1731
+ ranges.push(`${min} - ${max}`);
1732
+ }
1733
+ }
1734
+ const simplified = ranges.join(" || ");
1735
+ const original = typeof range2.raw === "string" ? range2.raw : String(range2);
1736
+ return simplified.length < original.length ? simplified : range2;
1737
+ };
1738
+ }
1739
+ });
1740
+
1741
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js
1742
+ var require_subset = __commonJS({
1743
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js"(exports, module) {
1744
+ "use strict";
1745
+ var Range = require_range();
1746
+ var Comparator = require_comparator();
1747
+ var { ANY } = Comparator;
1748
+ var satisfies = require_satisfies();
1749
+ var compare2 = require_compare();
1750
+ var subset = (sub, dom, options = {}) => {
1751
+ if (sub === dom) {
1752
+ return true;
1753
+ }
1754
+ sub = new Range(sub, options);
1755
+ dom = new Range(dom, options);
1756
+ let sawNonNull = false;
1757
+ OUTER: for (const simpleSub of sub.set) {
1758
+ for (const simpleDom of dom.set) {
1759
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
1760
+ sawNonNull = sawNonNull || isSub !== null;
1761
+ if (isSub) {
1762
+ continue OUTER;
1763
+ }
1764
+ }
1765
+ if (sawNonNull) {
1766
+ return false;
1767
+ }
1768
+ }
1769
+ return true;
1770
+ };
1771
+ var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
1772
+ var minimumVersion = [new Comparator(">=0.0.0")];
1773
+ var simpleSubset = (sub, dom, options) => {
1774
+ if (sub === dom) {
1775
+ return true;
1776
+ }
1777
+ if (sub.length === 1 && sub[0].semver === ANY) {
1778
+ if (dom.length === 1 && dom[0].semver === ANY) {
1779
+ return true;
1780
+ } else if (options.includePrerelease) {
1781
+ sub = minimumVersionWithPreRelease;
1782
+ } else {
1783
+ sub = minimumVersion;
1784
+ }
1785
+ }
1786
+ if (dom.length === 1 && dom[0].semver === ANY) {
1787
+ if (options.includePrerelease) {
1788
+ return true;
1789
+ } else {
1790
+ dom = minimumVersion;
1791
+ }
1792
+ }
1793
+ const eqSet = /* @__PURE__ */ new Set();
1794
+ let gt, lt;
1795
+ for (const c of sub) {
1796
+ if (c.operator === ">" || c.operator === ">=") {
1797
+ gt = higherGT(gt, c, options);
1798
+ } else if (c.operator === "<" || c.operator === "<=") {
1799
+ lt = lowerLT(lt, c, options);
1800
+ } else {
1801
+ eqSet.add(c.semver);
1802
+ }
1803
+ }
1804
+ if (eqSet.size > 1) {
1805
+ return null;
1806
+ }
1807
+ let gtltComp;
1808
+ if (gt && lt) {
1809
+ gtltComp = compare2(gt.semver, lt.semver, options);
1810
+ if (gtltComp > 0) {
1811
+ return null;
1812
+ } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
1813
+ return null;
1814
+ }
1815
+ }
1816
+ for (const eq of eqSet) {
1817
+ if (gt && !satisfies(eq, String(gt), options)) {
1818
+ return null;
1819
+ }
1820
+ if (lt && !satisfies(eq, String(lt), options)) {
1821
+ return null;
1822
+ }
1823
+ for (const c of dom) {
1824
+ if (!satisfies(eq, String(c), options)) {
1825
+ return false;
1826
+ }
1827
+ }
1828
+ return true;
1829
+ }
1830
+ let higher, lower;
1831
+ let hasDomLT, hasDomGT;
1832
+ let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
1833
+ let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
1834
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
1835
+ needDomLTPre = false;
1836
+ }
1837
+ for (const c of dom) {
1838
+ hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
1839
+ hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
1840
+ if (gt) {
1841
+ if (needDomGTPre) {
1842
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
1843
+ needDomGTPre = false;
1844
+ }
1845
+ }
1846
+ if (c.operator === ">" || c.operator === ">=") {
1847
+ higher = higherGT(gt, c, options);
1848
+ if (higher === c && higher !== gt) {
1849
+ return false;
1850
+ }
1851
+ } else if (gt.operator === ">=" && !c.test(gt.semver)) {
1852
+ return false;
1853
+ }
1854
+ }
1855
+ if (lt) {
1856
+ if (needDomLTPre) {
1857
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
1858
+ needDomLTPre = false;
1859
+ }
1860
+ }
1861
+ if (c.operator === "<" || c.operator === "<=") {
1862
+ lower = lowerLT(lt, c, options);
1863
+ if (lower === c && lower !== lt) {
1864
+ return false;
1865
+ }
1866
+ } else if (lt.operator === "<=" && !c.test(lt.semver)) {
1867
+ return false;
1868
+ }
1869
+ }
1870
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
1871
+ return false;
1872
+ }
1873
+ }
1874
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
1875
+ return false;
1876
+ }
1877
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
1878
+ return false;
1879
+ }
1880
+ if (needDomGTPre || needDomLTPre) {
1881
+ return false;
1882
+ }
1883
+ return true;
1884
+ };
1885
+ var higherGT = (a, b, options) => {
1886
+ if (!a) {
1887
+ return b;
1888
+ }
1889
+ const comp = compare2(a.semver, b.semver, options);
1890
+ return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
1891
+ };
1892
+ var lowerLT = (a, b, options) => {
1893
+ if (!a) {
1894
+ return b;
1895
+ }
1896
+ const comp = compare2(a.semver, b.semver, options);
1897
+ return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
1898
+ };
1899
+ module.exports = subset;
1900
+ }
1901
+ });
1902
+
1903
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js
1904
+ var require_semver2 = __commonJS({
1905
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js"(exports, module) {
1906
+ "use strict";
1907
+ var internalRe = require_re();
1908
+ var constants = require_constants();
1909
+ var SemVer = require_semver();
1910
+ var identifiers = require_identifiers();
1911
+ var parse = require_parse();
1912
+ var valid2 = require_valid();
1913
+ var clean = require_clean();
1914
+ var inc = require_inc();
1915
+ var diff = require_diff();
1916
+ var major = require_major();
1917
+ var minor = require_minor();
1918
+ var patch = require_patch();
1919
+ var prerelease = require_prerelease();
1920
+ var compare2 = require_compare();
1921
+ var rcompare = require_rcompare();
1922
+ var compareLoose = require_compare_loose();
1923
+ var compareBuild = require_compare_build();
1924
+ var sort = require_sort();
1925
+ var rsort = require_rsort();
1926
+ var gt = require_gt();
1927
+ var lt = require_lt();
1928
+ var eq = require_eq();
1929
+ var neq = require_neq();
1930
+ var gte2 = require_gte();
1931
+ var lte2 = require_lte();
1932
+ var cmp = require_cmp();
1933
+ var coerce = require_coerce();
1934
+ var truncate = require_truncate();
1935
+ var Comparator = require_comparator();
1936
+ var Range = require_range();
1937
+ var satisfies = require_satisfies();
1938
+ var toComparators = require_to_comparators();
1939
+ var maxSatisfying = require_max_satisfying();
1940
+ var minSatisfying = require_min_satisfying();
1941
+ var minVersion = require_min_version();
1942
+ var validRange = require_valid2();
1943
+ var outside = require_outside();
1944
+ var gtr = require_gtr();
1945
+ var ltr = require_ltr();
1946
+ var intersects = require_intersects();
1947
+ var simplifyRange = require_simplify();
1948
+ var subset = require_subset();
1949
+ module.exports = {
1950
+ parse,
1951
+ valid: valid2,
1952
+ clean,
1953
+ inc,
1954
+ diff,
1955
+ major,
1956
+ minor,
1957
+ patch,
1958
+ prerelease,
1959
+ compare: compare2,
1960
+ rcompare,
1961
+ compareLoose,
1962
+ compareBuild,
1963
+ sort,
1964
+ rsort,
1965
+ gt,
1966
+ lt,
1967
+ eq,
1968
+ neq,
1969
+ gte: gte2,
1970
+ lte: lte2,
1971
+ cmp,
1972
+ coerce,
1973
+ truncate,
1974
+ Comparator,
1975
+ Range,
1976
+ satisfies,
1977
+ toComparators,
1978
+ maxSatisfying,
1979
+ minSatisfying,
1980
+ minVersion,
1981
+ validRange,
1982
+ outside,
1983
+ gtr,
1984
+ ltr,
1985
+ intersects,
1986
+ simplifyRange,
1987
+ subset,
1988
+ SemVer,
1989
+ re: internalRe.re,
1990
+ src: internalRe.src,
1991
+ tokens: internalRe.t,
1992
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
1993
+ RELEASE_TYPES: constants.RELEASE_TYPES,
1994
+ compareIdentifiers: identifiers.compareIdentifiers,
1995
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
1996
+ };
1997
+ }
1998
+ });
1999
+
2000
+ // ../daemon/dist/chunk-3PPROZYA.js
2
2001
  import { createHash } from "crypto";
3
2002
  import { homedir } from "os";
4
2003
  import { join, resolve } from "path";
@@ -15,7 +2014,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
2014
  var __getOwnPropNames = Object.getOwnPropertyNames;
16
2015
  var __getProtoOf = Object.getPrototypeOf;
17
2016
  var __hasOwnProp = Object.prototype.hasOwnProperty;
18
- var __commonJS = (cb, mod) => function __require() {
2017
+ var __commonJS2 = (cb, mod) => function __require() {
19
2018
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
20
2019
  };
21
2020
  var __copyProps = (to, from, except, desc) => {
@@ -26,7 +2025,7 @@ var __copyProps = (to, from, except, desc) => {
26
2025
  }
27
2026
  return to;
28
2027
  };
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
2028
+ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
2029
  // If the importer is in node compatibility mode or this is not an ESM
31
2030
  // file that has been converted to a CommonJS file using a Babel-
32
2031
  // compatible transform (i.e. "__esModule" has not been set), then set
@@ -34,7 +2033,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
2033
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
2034
  mod
36
2035
  ));
37
- var require_diff_match_patch = __commonJS({
2036
+ var require_diff_match_patch = __commonJS2({
38
2037
  "../../node_modules/.pnpm/diff-match-patch@1.0.5/node_modules/diff-match-patch/index.js"(exports, module) {
39
2038
  "use strict";
40
2039
  var diff_match_patch = function() {
@@ -4586,8 +6585,8 @@ minimatch.AST = AST;
4586
6585
  minimatch.Minimatch = Minimatch;
4587
6586
  minimatch.escape = escape;
4588
6587
  minimatch.unescape = unescape;
4589
- var import_diff_match_patch = __toESM(require_diff_match_patch(), 1);
4590
- var import_diff_match_patch2 = __toESM(require_diff_match_patch(), 1);
6588
+ var import_diff_match_patch = __toESM2(require_diff_match_patch(), 1);
6589
+ var import_diff_match_patch2 = __toESM2(require_diff_match_patch(), 1);
4591
6590
  var sink;
4592
6591
  function write(level, args) {
4593
6592
  if (sink !== void 0) {
@@ -4742,6 +6741,7 @@ function createSocketRpcConnection(socket) {
4742
6741
  }
4743
6742
 
4744
6743
  // ../daemon/dist/index.js
6744
+ var import_semver = __toESM(require_semver2(), 1);
4745
6745
  import { randomUUID } from "crypto";
4746
6746
  import { mkdir, readFile, rm, stat } from "fs/promises";
4747
6747
  import { connect } from "net";
@@ -4969,7 +6969,7 @@ var LeafRelayDaemonClient = class _LeafRelayDaemonClient {
4969
6969
  return;
4970
6970
  } catch (error2) {
4971
6971
  const code = error2.code;
4972
- if (code === -32001 || code === -32002 || this.closing) {
6972
+ if (code === -32001 || code === -32002 || error2 instanceof DaemonVersionError || this.closing) {
4973
6973
  throw error2;
4974
6974
  }
4975
6975
  const delay = Math.min(1e3 * 2 ** attempt++, 16e3);
@@ -5116,7 +7116,13 @@ var LeafRelayDaemonClient = class _LeafRelayDaemonClient {
5116
7116
  socket?.destroy();
5117
7117
  return Boolean(socket);
5118
7118
  })) {
5119
- return metadata;
7119
+ const order = versionOrder(metadata, this.options);
7120
+ if (order > 0) {
7121
+ throw newerDaemonError(metadata, this.options);
7122
+ }
7123
+ if (order === 0 || this.options.autoStart === false) {
7124
+ return metadata;
7125
+ }
5120
7126
  }
5121
7127
  if (this.options.autoStart === false) {
5122
7128
  throw new Error(`LeafRelay daemon is not running at ${this.paths.socketPath}.`);
@@ -5152,6 +7158,18 @@ async function startDaemon(paths, options, environment) {
5152
7158
  }
5153
7159
  if (ownsLock) {
5154
7160
  try {
7161
+ const running = await readMetadata(paths);
7162
+ if (running && await isListening(running)) {
7163
+ const order = versionOrder(running, options);
7164
+ if (order > 0) {
7165
+ throw newerDaemonError(running, options);
7166
+ }
7167
+ if (order === 0) {
7168
+ return running;
7169
+ }
7170
+ log(`Upgrading LeafRelay daemon ${running.version} to ${options.clientVersion}; waiting for active synchronization to stop.`);
7171
+ await stopForUpgrade(paths, running, options);
7172
+ }
5155
7173
  const entrypoint = options.daemonEntrypoint ?? new URL("./daemon.js", import.meta.url);
5156
7174
  const childEnvironment = { ...environment };
5157
7175
  childEnvironment.LEAFRELAY_HOME = paths.home;
@@ -5161,12 +7179,28 @@ async function startDaemon(paths, options, environment) {
5161
7179
  env: childEnvironment
5162
7180
  });
5163
7181
  child.unref();
5164
- return await waitForDaemon(paths);
7182
+ const started = await waitForDaemon(paths);
7183
+ if (versionOrder(started, options) !== 0) {
7184
+ throw new DaemonVersionError(`Started daemon ${started.version} does not match client ${options.clientVersion}. Update the LeafRelay installation and retry.`);
7185
+ }
7186
+ return started;
5165
7187
  } finally {
5166
7188
  await rm(paths.startupLockPath, { recursive: true, force: true });
5167
7189
  }
5168
7190
  }
5169
- return waitForDaemon(paths);
7191
+ const deadline = Date.now() + START_TIMEOUT_MS;
7192
+ while (Date.now() < deadline) {
7193
+ const metadata = await waitForDaemon(paths);
7194
+ const order = versionOrder(metadata, options);
7195
+ if (order > 0) {
7196
+ throw newerDaemonError(metadata, options);
7197
+ }
7198
+ if (order === 0) {
7199
+ return metadata;
7200
+ }
7201
+ await new Promise((resolveWait) => setTimeout(resolveWait, START_POLL_MS));
7202
+ }
7203
+ throw new Error("Timed out waiting for the LeafRelay daemon upgrade.");
5170
7204
  }
5171
7205
  async function waitForDaemon(paths) {
5172
7206
  const deadline = Date.now() + START_TIMEOUT_MS;
@@ -5207,12 +7241,66 @@ async function tryConnect(metadata) {
5207
7241
  });
5208
7242
  });
5209
7243
  }
7244
+ var DaemonVersionError = class extends Error {
7245
+ };
7246
+ function versionOrder(metadata, options) {
7247
+ return (0, import_semver.valid)(metadata.version) && (0, import_semver.valid)(options.clientVersion) ? (0, import_semver.compare)(metadata.version, options.clientVersion) : 0;
7248
+ }
7249
+ function newerDaemonError(metadata, options) {
7250
+ return new DaemonVersionError(`LeafRelay daemon ${metadata.version} is newer than this ${options.clientName} client (${options.clientVersion}). Update ${options.clientName === "vscode" ? "the LeafRelay VS Code extension" : "LeafRelay (npm install -g leafrelay@latest)"} and retry.`);
7251
+ }
7252
+ async function isListening(metadata) {
7253
+ const socket = await tryConnect(metadata);
7254
+ socket?.destroy();
7255
+ return Boolean(socket);
7256
+ }
7257
+ async function stopForUpgrade(paths, metadata, options) {
7258
+ const socket = await tryConnect(metadata);
7259
+ if (!socket) {
7260
+ return;
7261
+ }
7262
+ const rpc = createSocketRpcConnection(socket);
7263
+ rpc.listen();
7264
+ let timer;
7265
+ try {
7266
+ await Promise.race([
7267
+ (async () => {
7268
+ await rpc.sendRequest(RPC_METHOD.initialize, {
7269
+ token: metadata.token,
7270
+ clientId: randomUUID(),
7271
+ clientName: options.clientName,
7272
+ clientVersion: options.clientVersion,
7273
+ protocolVersion: metadata.protocolVersion
7274
+ });
7275
+ await rpc.sendRequest(RPC_METHOD.daemonShutdown);
7276
+ const deadline = Date.now() + START_TIMEOUT_MS;
7277
+ while (Date.now() < deadline) {
7278
+ const current = await readMetadata(paths);
7279
+ if (!current || current.token !== metadata.token) {
7280
+ return;
7281
+ }
7282
+ await new Promise((resolveWait) => setTimeout(resolveWait, START_POLL_MS));
7283
+ }
7284
+ throw new Error("Old LeafRelay daemon did not finish shutting down.");
7285
+ })(),
7286
+ new Promise((_, reject) => {
7287
+ timer = setTimeout(() => reject(new Error("Timed out stopping the old LeafRelay daemon.")), START_TIMEOUT_MS);
7288
+ })
7289
+ ]);
7290
+ } finally {
7291
+ if (timer) {
7292
+ clearTimeout(timer);
7293
+ }
7294
+ rpc.dispose();
7295
+ socket.destroy();
7296
+ }
7297
+ }
5210
7298
 
5211
7299
  // src/daemonClient.ts
5212
7300
  function connectCliDaemon(autoStart = true) {
5213
7301
  return LeafRelayDaemonClient.connect({
5214
7302
  clientName: "cli",
5215
- clientVersion: "0.2.6",
7303
+ clientVersion: "0.2.8",
5216
7304
  daemonEntrypoint: new URL("./daemon.js", import.meta.url),
5217
7305
  autoStart
5218
7306
  });
@@ -5302,4 +7390,4 @@ export {
5302
7390
  chokidar/index.js:
5303
7391
  (*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) *)
5304
7392
  */
5305
- //# sourceMappingURL=chunk-QRJDW6FM.js.map
7393
+ //# sourceMappingURL=chunk-4EHEWM7N.js.map