@platforma-sdk/block-tools 2.5.53 → 2.5.55

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.
@@ -17,31 +17,31 @@ import { S3 as $s, paginateListObjectsV2 as Rs } from "@aws-sdk/client-s3";
17
17
  import * as K from "node:fs";
18
18
  function ws(t) {
19
19
  return L.string().transform((e, r) => {
20
- const n = Vr(t, e);
21
- return n === void 0 ? (r.addIssue({
20
+ const s = Vr(t, e);
21
+ return s === void 0 ? (r.addIssue({
22
22
  code: L.ZodIssueCode.custom,
23
23
  message: `Can't resolve ${e} against ${t}`
24
24
  }), L.NEVER) : {
25
25
  type: "absolute-file",
26
- file: n
26
+ file: s
27
27
  };
28
28
  });
29
29
  }
30
30
  function Ss(t, ...e) {
31
- return L.string().transform((r, n) => {
31
+ return L.string().transform((r, s) => {
32
32
  const a = r.endsWith("/") ? r : `${r}/`;
33
- for (const l of e) {
34
- const c = Vr(t, a + l);
33
+ for (const u of e) {
34
+ const c = Vr(t, a + u);
35
35
  if (c !== void 0) {
36
- if (!c.endsWith(l))
37
- throw new Error(`Unexpected resolve result ${c} with index file ${l}`);
36
+ if (!c.endsWith(u))
37
+ throw new Error(`Unexpected resolve result ${c} with index file ${u}`);
38
38
  return {
39
39
  type: "absolute-folder",
40
- folder: c.slice(0, c.length - l.length)
40
+ folder: c.slice(0, c.length - u.length)
41
41
  };
42
42
  }
43
43
  }
44
- return n.addIssue({
44
+ return s.addIssue({
45
45
  code: L.ZodIssueCode.custom,
46
46
  message: `Can't resolve ${r} folder against ${t}, no index file found (${e.join(", ")})`
47
47
  }), L.NEVER;
@@ -86,20 +86,20 @@ function Is() {
86
86
  function wt(t, e) {
87
87
  return async (r) => {
88
88
  if (r.type === "absolute-file") {
89
- const n = B.basename(r.file), a = B.resolve(t, n);
90
- return e == null || e.push(n), await V.cp(r.file, a), { type: "relative", path: n };
89
+ const s = B.basename(r.file), a = B.resolve(t, s);
90
+ return e == null || e.push(s), await V.cp(r.file, a), { type: "relative", path: s };
91
91
  } else return r;
92
92
  };
93
93
  }
94
94
  function Os(t, e, r) {
95
95
  if (!e.endsWith(".tgz")) throw new Error(`Unexpected tgz file name: ${e}`);
96
- return async (n) => {
96
+ return async (s) => {
97
97
  const a = B.resolve(t, e);
98
98
  return await ms.create(
99
99
  {
100
100
  gzip: !0,
101
101
  file: a,
102
- cwd: n.folder
102
+ cwd: s.folder
103
103
  },
104
104
  ["."]
105
105
  ), r == null || r.push(e), { type: "relative", path: e };
@@ -223,18 +223,18 @@ async function St(t) {
223
223
  }
224
224
  async function Wn(t, e) {
225
225
  await V.mkdir(e, { recursive: !0 });
226
- const r = [], n = await Ts(e, r).parseAsync(t), a = await Promise.all(
226
+ const r = [], s = await Ts(e, r).parseAsync(t), a = await Promise.all(
227
227
  r.map(async (c) => {
228
- const d = await V.readFile(B.resolve(e, c)), i = await St(d);
229
- return { name: c, size: d.length, sha256: i };
228
+ const h = await V.readFile(B.resolve(e, c)), o = await St(h);
229
+ return { name: c, size: h.length, sha256: o };
230
230
  })
231
- ), l = xr.parse({
231
+ ), u = xr.parse({
232
232
  schema: "v2",
233
- description: n,
233
+ description: s,
234
234
  files: a,
235
235
  timestamp: Date.now()
236
236
  });
237
- return await V.writeFile(B.resolve(e, ps), JSON.stringify(l)), l;
237
+ return await V.writeFile(B.resolve(e, ps), JSON.stringify(u)), u;
238
238
  }
239
239
  const yt = "block", As = /(?:@[a-zA-Z0-9-.]+\/)?(?<organization>[a-zA-Z0-9-]+)\.(?<name>[a-zA-Z0-9-]+)/;
240
240
  function Wr(t) {
@@ -243,44 +243,44 @@ function Wr(t) {
243
243
  throw new Error(
244
244
  `Malformed package name (${t}), can't infer organization and block pack name.`
245
245
  );
246
- const { name: r, organization: n } = e.groups;
247
- return { name: r, organization: n };
246
+ const { name: r, organization: s } = e.groups;
247
+ return { name: r, organization: s };
248
248
  }
249
249
  async function Hn(t, e) {
250
250
  const r = B.resolve(t, "package.json");
251
251
  try {
252
- const n = await Ct(
252
+ const s = await Ct(
253
253
  r,
254
- (d) => JSON.parse(d.toString("utf-8"))
254
+ (h) => JSON.parse(h.toString("utf-8"))
255
255
  );
256
- if (n === void 0) return;
257
- const a = n[yt];
256
+ if (s === void 0) return;
257
+ const a = s[yt];
258
258
  if (a === void 0) return;
259
- const l = {
259
+ const u = {
260
260
  ...Ur.parse(a),
261
261
  id: {
262
262
  ...Wr(
263
- Mr(n.name, `"name" not found in ${r}`)
263
+ Mr(s.name, `"name" not found in ${r}`)
264
264
  ),
265
- version: kt.parse(n.version)
265
+ version: kt.parse(s.version)
266
266
  }
267
- }, c = await Jr(t).safeParseAsync(l);
267
+ }, c = await Jr(t).safeParseAsync(u);
268
268
  if (c.success) return c.data;
269
269
  e == null || e.warn(c.error);
270
270
  return;
271
- } catch (n) {
272
- e == null || e.warn(n);
271
+ } catch (s) {
272
+ e == null || e.warn(s);
273
273
  return;
274
274
  }
275
275
  }
276
276
  async function Fs(t) {
277
- const e = B.resolve(t, "package.json"), r = JSON.parse(await V.readFile(e, { encoding: "utf-8" })), n = r[yt];
278
- if (n === void 0)
277
+ const e = B.resolve(t, "package.json"), r = JSON.parse(await V.readFile(e, { encoding: "utf-8" })), s = r[yt];
278
+ if (s === void 0)
279
279
  throw new Error(
280
280
  `Block description (field ${yt}) not found in ${e}.`
281
281
  );
282
282
  return {
283
- ...Ur.parse(n),
283
+ ...Ur.parse(s),
284
284
  id: {
285
285
  ...Wr(
286
286
  Mr(r.name, `"name" not found in ${e}`)
@@ -301,10 +301,10 @@ function pe() {
301
301
  if (Vt) return Ie;
302
302
  Vt = 1;
303
303
  const t = "2.0.0", e = 256, r = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
304
- 9007199254740991, n = 16, a = e - 6;
304
+ 9007199254740991, s = 16, a = e - 6;
305
305
  return Ie = {
306
306
  MAX_LENGTH: e,
307
- MAX_SAFE_COMPONENT_LENGTH: n,
307
+ MAX_SAFE_COMPONENT_LENGTH: s,
308
308
  MAX_SAFE_BUILD_LENGTH: a,
309
309
  MAX_SAFE_INTEGER: r,
310
310
  RELEASE_TYPES: [
@@ -331,25 +331,25 @@ function ee() {
331
331
  return zt || (zt = 1, function(t, e) {
332
332
  const {
333
333
  MAX_SAFE_COMPONENT_LENGTH: r,
334
- MAX_SAFE_BUILD_LENGTH: n,
334
+ MAX_SAFE_BUILD_LENGTH: s,
335
335
  MAX_LENGTH: a
336
- } = pe(), l = de();
336
+ } = pe(), u = de();
337
337
  e = t.exports = {};
338
- const c = e.re = [], d = e.safeRe = [], i = e.src = [], f = e.safeSrc = [], s = e.t = {};
339
- let o = 0;
340
- const u = "[a-zA-Z0-9-]", h = [
338
+ const c = e.re = [], h = e.safeRe = [], o = e.src = [], i = e.safeSrc = [], n = e.t = {};
339
+ let l = 0;
340
+ const f = "[a-zA-Z0-9-]", d = [
341
341
  ["\\s", 1],
342
342
  ["\\d", a],
343
- [u, n]
344
- ], m = (v) => {
345
- for (const [$, N] of h)
346
- v = v.split(`${$}*`).join(`${$}{0,${N}}`).split(`${$}+`).join(`${$}{1,${N}}`);
347
- return v;
348
- }, p = (v, $, N) => {
349
- const I = m($), F = o++;
350
- l(v, F, $), s[v] = F, i[F] = $, f[F] = I, c[F] = new RegExp($, N ? "g" : void 0), d[F] = new RegExp(I, N ? "g" : void 0);
343
+ [f, s]
344
+ ], w = (E) => {
345
+ for (const [v, N] of d)
346
+ E = E.split(`${v}*`).join(`${v}{0,${N}}`).split(`${v}+`).join(`${v}{1,${N}}`);
347
+ return E;
348
+ }, p = (E, v, N) => {
349
+ const I = w(v), F = l++;
350
+ u(E, F, v), n[E] = F, o[F] = v, i[F] = I, c[F] = new RegExp(v, N ? "g" : void 0), h[F] = new RegExp(I, N ? "g" : void 0);
351
351
  };
352
- p("NUMERICIDENTIFIER", "0|[1-9]\\d*"), p("NUMERICIDENTIFIERLOOSE", "\\d+"), p("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${u}*`), p("MAINVERSION", `(${i[s.NUMERICIDENTIFIER]})\\.(${i[s.NUMERICIDENTIFIER]})\\.(${i[s.NUMERICIDENTIFIER]})`), p("MAINVERSIONLOOSE", `(${i[s.NUMERICIDENTIFIERLOOSE]})\\.(${i[s.NUMERICIDENTIFIERLOOSE]})\\.(${i[s.NUMERICIDENTIFIERLOOSE]})`), p("PRERELEASEIDENTIFIER", `(?:${i[s.NUMERICIDENTIFIER]}|${i[s.NONNUMERICIDENTIFIER]})`), p("PRERELEASEIDENTIFIERLOOSE", `(?:${i[s.NUMERICIDENTIFIERLOOSE]}|${i[s.NONNUMERICIDENTIFIER]})`), p("PRERELEASE", `(?:-(${i[s.PRERELEASEIDENTIFIER]}(?:\\.${i[s.PRERELEASEIDENTIFIER]})*))`), p("PRERELEASELOOSE", `(?:-?(${i[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[s.PRERELEASEIDENTIFIERLOOSE]})*))`), p("BUILDIDENTIFIER", `${u}+`), p("BUILD", `(?:\\+(${i[s.BUILDIDENTIFIER]}(?:\\.${i[s.BUILDIDENTIFIER]})*))`), p("FULLPLAIN", `v?${i[s.MAINVERSION]}${i[s.PRERELEASE]}?${i[s.BUILD]}?`), p("FULL", `^${i[s.FULLPLAIN]}$`), p("LOOSEPLAIN", `[v=\\s]*${i[s.MAINVERSIONLOOSE]}${i[s.PRERELEASELOOSE]}?${i[s.BUILD]}?`), p("LOOSE", `^${i[s.LOOSEPLAIN]}$`), p("GTLT", "((?:<|>)?=?)"), p("XRANGEIDENTIFIERLOOSE", `${i[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), p("XRANGEIDENTIFIER", `${i[s.NUMERICIDENTIFIER]}|x|X|\\*`), p("XRANGEPLAIN", `[v=\\s]*(${i[s.XRANGEIDENTIFIER]})(?:\\.(${i[s.XRANGEIDENTIFIER]})(?:\\.(${i[s.XRANGEIDENTIFIER]})(?:${i[s.PRERELEASE]})?${i[s.BUILD]}?)?)?`), p("XRANGEPLAINLOOSE", `[v=\\s]*(${i[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[s.XRANGEIDENTIFIERLOOSE]})(?:${i[s.PRERELEASELOOSE]})?${i[s.BUILD]}?)?)?`), p("XRANGE", `^${i[s.GTLT]}\\s*${i[s.XRANGEPLAIN]}$`), p("XRANGELOOSE", `^${i[s.GTLT]}\\s*${i[s.XRANGEPLAINLOOSE]}$`), p("COERCEPLAIN", `(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`), p("COERCE", `${i[s.COERCEPLAIN]}(?:$|[^\\d])`), p("COERCEFULL", i[s.COERCEPLAIN] + `(?:${i[s.PRERELEASE]})?(?:${i[s.BUILD]})?(?:$|[^\\d])`), p("COERCERTL", i[s.COERCE], !0), p("COERCERTLFULL", i[s.COERCEFULL], !0), p("LONETILDE", "(?:~>?)"), p("TILDETRIM", `(\\s*)${i[s.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", p("TILDE", `^${i[s.LONETILDE]}${i[s.XRANGEPLAIN]}$`), p("TILDELOOSE", `^${i[s.LONETILDE]}${i[s.XRANGEPLAINLOOSE]}$`), p("LONECARET", "(?:\\^)"), p("CARETTRIM", `(\\s*)${i[s.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", p("CARET", `^${i[s.LONECARET]}${i[s.XRANGEPLAIN]}$`), p("CARETLOOSE", `^${i[s.LONECARET]}${i[s.XRANGEPLAINLOOSE]}$`), p("COMPARATORLOOSE", `^${i[s.GTLT]}\\s*(${i[s.LOOSEPLAIN]})$|^$`), p("COMPARATOR", `^${i[s.GTLT]}\\s*(${i[s.FULLPLAIN]})$|^$`), p("COMPARATORTRIM", `(\\s*)${i[s.GTLT]}\\s*(${i[s.LOOSEPLAIN]}|${i[s.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", p("HYPHENRANGE", `^\\s*(${i[s.XRANGEPLAIN]})\\s+-\\s+(${i[s.XRANGEPLAIN]})\\s*$`), p("HYPHENRANGELOOSE", `^\\s*(${i[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[s.XRANGEPLAINLOOSE]})\\s*$`), p("STAR", "(<|>)?=?\\s*\\*"), p("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), p("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
352
+ p("NUMERICIDENTIFIER", "0|[1-9]\\d*"), p("NUMERICIDENTIFIERLOOSE", "\\d+"), p("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${f}*`), p("MAINVERSION", `(${o[n.NUMERICIDENTIFIER]})\\.(${o[n.NUMERICIDENTIFIER]})\\.(${o[n.NUMERICIDENTIFIER]})`), p("MAINVERSIONLOOSE", `(${o[n.NUMERICIDENTIFIERLOOSE]})\\.(${o[n.NUMERICIDENTIFIERLOOSE]})\\.(${o[n.NUMERICIDENTIFIERLOOSE]})`), p("PRERELEASEIDENTIFIER", `(?:${o[n.NONNUMERICIDENTIFIER]}|${o[n.NUMERICIDENTIFIER]})`), p("PRERELEASEIDENTIFIERLOOSE", `(?:${o[n.NONNUMERICIDENTIFIER]}|${o[n.NUMERICIDENTIFIERLOOSE]})`), p("PRERELEASE", `(?:-(${o[n.PRERELEASEIDENTIFIER]}(?:\\.${o[n.PRERELEASEIDENTIFIER]})*))`), p("PRERELEASELOOSE", `(?:-?(${o[n.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[n.PRERELEASEIDENTIFIERLOOSE]})*))`), p("BUILDIDENTIFIER", `${f}+`), p("BUILD", `(?:\\+(${o[n.BUILDIDENTIFIER]}(?:\\.${o[n.BUILDIDENTIFIER]})*))`), p("FULLPLAIN", `v?${o[n.MAINVERSION]}${o[n.PRERELEASE]}?${o[n.BUILD]}?`), p("FULL", `^${o[n.FULLPLAIN]}$`), p("LOOSEPLAIN", `[v=\\s]*${o[n.MAINVERSIONLOOSE]}${o[n.PRERELEASELOOSE]}?${o[n.BUILD]}?`), p("LOOSE", `^${o[n.LOOSEPLAIN]}$`), p("GTLT", "((?:<|>)?=?)"), p("XRANGEIDENTIFIERLOOSE", `${o[n.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), p("XRANGEIDENTIFIER", `${o[n.NUMERICIDENTIFIER]}|x|X|\\*`), p("XRANGEPLAIN", `[v=\\s]*(${o[n.XRANGEIDENTIFIER]})(?:\\.(${o[n.XRANGEIDENTIFIER]})(?:\\.(${o[n.XRANGEIDENTIFIER]})(?:${o[n.PRERELEASE]})?${o[n.BUILD]}?)?)?`), p("XRANGEPLAINLOOSE", `[v=\\s]*(${o[n.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[n.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[n.XRANGEIDENTIFIERLOOSE]})(?:${o[n.PRERELEASELOOSE]})?${o[n.BUILD]}?)?)?`), p("XRANGE", `^${o[n.GTLT]}\\s*${o[n.XRANGEPLAIN]}$`), p("XRANGELOOSE", `^${o[n.GTLT]}\\s*${o[n.XRANGEPLAINLOOSE]}$`), p("COERCEPLAIN", `(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`), p("COERCE", `${o[n.COERCEPLAIN]}(?:$|[^\\d])`), p("COERCEFULL", o[n.COERCEPLAIN] + `(?:${o[n.PRERELEASE]})?(?:${o[n.BUILD]})?(?:$|[^\\d])`), p("COERCERTL", o[n.COERCE], !0), p("COERCERTLFULL", o[n.COERCEFULL], !0), p("LONETILDE", "(?:~>?)"), p("TILDETRIM", `(\\s*)${o[n.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", p("TILDE", `^${o[n.LONETILDE]}${o[n.XRANGEPLAIN]}$`), p("TILDELOOSE", `^${o[n.LONETILDE]}${o[n.XRANGEPLAINLOOSE]}$`), p("LONECARET", "(?:\\^)"), p("CARETTRIM", `(\\s*)${o[n.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", p("CARET", `^${o[n.LONECARET]}${o[n.XRANGEPLAIN]}$`), p("CARETLOOSE", `^${o[n.LONECARET]}${o[n.XRANGEPLAINLOOSE]}$`), p("COMPARATORLOOSE", `^${o[n.GTLT]}\\s*(${o[n.LOOSEPLAIN]})$|^$`), p("COMPARATOR", `^${o[n.GTLT]}\\s*(${o[n.FULLPLAIN]})$|^$`), p("COMPARATORTRIM", `(\\s*)${o[n.GTLT]}\\s*(${o[n.LOOSEPLAIN]}|${o[n.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", p("HYPHENRANGE", `^\\s*(${o[n.XRANGEPLAIN]})\\s+-\\s+(${o[n.XRANGEPLAIN]})\\s*$`), p("HYPHENRANGELOOSE", `^\\s*(${o[n.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[n.XRANGEPLAINLOOSE]})\\s*$`), p("STAR", "(<|>)?=?\\s*\\*"), p("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), p("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
353
353
  }(se, se.exports)), se.exports;
354
354
  }
355
355
  var Pe, Xt;
@@ -357,56 +357,56 @@ function Tt() {
357
357
  if (Xt) return Pe;
358
358
  Xt = 1;
359
359
  const t = Object.freeze({ loose: !0 }), e = Object.freeze({});
360
- return Pe = (n) => n ? typeof n != "object" ? t : n : e, Pe;
360
+ return Pe = (s) => s ? typeof s != "object" ? t : s : e, Pe;
361
361
  }
362
362
  var Ne, Jt;
363
363
  function Hr() {
364
364
  if (Jt) return Ne;
365
365
  Jt = 1;
366
- const t = /^[0-9]+$/, e = (n, a) => {
367
- const l = t.test(n), c = t.test(a);
368
- return l && c && (n = +n, a = +a), n === a ? 0 : l && !c ? -1 : c && !l ? 1 : n < a ? -1 : 1;
366
+ const t = /^[0-9]+$/, e = (s, a) => {
367
+ const u = t.test(s), c = t.test(a);
368
+ return u && c && (s = +s, a = +a), s === a ? 0 : u && !c ? -1 : c && !u ? 1 : s < a ? -1 : 1;
369
369
  };
370
370
  return Ne = {
371
371
  compareIdentifiers: e,
372
- rcompareIdentifiers: (n, a) => e(a, n)
372
+ rcompareIdentifiers: (s, a) => e(a, s)
373
373
  }, Ne;
374
374
  }
375
375
  var ke, Wt;
376
376
  function j() {
377
377
  if (Wt) return ke;
378
378
  Wt = 1;
379
- const t = de(), { MAX_LENGTH: e, MAX_SAFE_INTEGER: r } = pe(), { safeRe: n, safeSrc: a, t: l } = ee(), c = Tt(), { compareIdentifiers: d } = Hr();
380
- class i {
381
- constructor(s, o) {
382
- if (o = c(o), s instanceof i) {
383
- if (s.loose === !!o.loose && s.includePrerelease === !!o.includePrerelease)
384
- return s;
385
- s = s.version;
386
- } else if (typeof s != "string")
387
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);
388
- if (s.length > e)
379
+ const t = de(), { MAX_LENGTH: e, MAX_SAFE_INTEGER: r } = pe(), { safeRe: s, t: a } = ee(), u = Tt(), { compareIdentifiers: c } = Hr();
380
+ class h {
381
+ constructor(i, n) {
382
+ if (n = u(n), i instanceof h) {
383
+ if (i.loose === !!n.loose && i.includePrerelease === !!n.includePrerelease)
384
+ return i;
385
+ i = i.version;
386
+ } else if (typeof i != "string")
387
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof i}".`);
388
+ if (i.length > e)
389
389
  throw new TypeError(
390
390
  `version is longer than ${e} characters`
391
391
  );
392
- t("SemVer", s, o), this.options = o, this.loose = !!o.loose, this.includePrerelease = !!o.includePrerelease;
393
- const u = s.trim().match(o.loose ? n[l.LOOSE] : n[l.FULL]);
394
- if (!u)
395
- throw new TypeError(`Invalid Version: ${s}`);
396
- if (this.raw = s, this.major = +u[1], this.minor = +u[2], this.patch = +u[3], this.major > r || this.major < 0)
392
+ t("SemVer", i, n), this.options = n, this.loose = !!n.loose, this.includePrerelease = !!n.includePrerelease;
393
+ const l = i.trim().match(n.loose ? s[a.LOOSE] : s[a.FULL]);
394
+ if (!l)
395
+ throw new TypeError(`Invalid Version: ${i}`);
396
+ if (this.raw = i, this.major = +l[1], this.minor = +l[2], this.patch = +l[3], this.major > r || this.major < 0)
397
397
  throw new TypeError("Invalid major version");
398
398
  if (this.minor > r || this.minor < 0)
399
399
  throw new TypeError("Invalid minor version");
400
400
  if (this.patch > r || this.patch < 0)
401
401
  throw new TypeError("Invalid patch version");
402
- u[4] ? this.prerelease = u[4].split(".").map((h) => {
403
- if (/^[0-9]+$/.test(h)) {
404
- const m = +h;
405
- if (m >= 0 && m < r)
406
- return m;
402
+ l[4] ? this.prerelease = l[4].split(".").map((f) => {
403
+ if (/^[0-9]+$/.test(f)) {
404
+ const d = +f;
405
+ if (d >= 0 && d < r)
406
+ return d;
407
407
  }
408
- return h;
409
- }) : this.prerelease = [], this.build = u[5] ? u[5].split(".") : [], this.format();
408
+ return f;
409
+ }) : this.prerelease = [], this.build = l[5] ? l[5].split(".") : [], this.format();
410
410
  }
411
411
  format() {
412
412
  return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
@@ -414,80 +414,80 @@ function j() {
414
414
  toString() {
415
415
  return this.version;
416
416
  }
417
- compare(s) {
418
- if (t("SemVer.compare", this.version, this.options, s), !(s instanceof i)) {
419
- if (typeof s == "string" && s === this.version)
417
+ compare(i) {
418
+ if (t("SemVer.compare", this.version, this.options, i), !(i instanceof h)) {
419
+ if (typeof i == "string" && i === this.version)
420
420
  return 0;
421
- s = new i(s, this.options);
421
+ i = new h(i, this.options);
422
422
  }
423
- return s.version === this.version ? 0 : this.compareMain(s) || this.comparePre(s);
423
+ return i.version === this.version ? 0 : this.compareMain(i) || this.comparePre(i);
424
424
  }
425
- compareMain(s) {
426
- return s instanceof i || (s = new i(s, this.options)), d(this.major, s.major) || d(this.minor, s.minor) || d(this.patch, s.patch);
425
+ compareMain(i) {
426
+ return i instanceof h || (i = new h(i, this.options)), c(this.major, i.major) || c(this.minor, i.minor) || c(this.patch, i.patch);
427
427
  }
428
- comparePre(s) {
429
- if (s instanceof i || (s = new i(s, this.options)), this.prerelease.length && !s.prerelease.length)
428
+ comparePre(i) {
429
+ if (i instanceof h || (i = new h(i, this.options)), this.prerelease.length && !i.prerelease.length)
430
430
  return -1;
431
- if (!this.prerelease.length && s.prerelease.length)
431
+ if (!this.prerelease.length && i.prerelease.length)
432
432
  return 1;
433
- if (!this.prerelease.length && !s.prerelease.length)
433
+ if (!this.prerelease.length && !i.prerelease.length)
434
434
  return 0;
435
- let o = 0;
435
+ let n = 0;
436
436
  do {
437
- const u = this.prerelease[o], h = s.prerelease[o];
438
- if (t("prerelease compare", o, u, h), u === void 0 && h === void 0)
437
+ const l = this.prerelease[n], f = i.prerelease[n];
438
+ if (t("prerelease compare", n, l, f), l === void 0 && f === void 0)
439
439
  return 0;
440
- if (h === void 0)
440
+ if (f === void 0)
441
441
  return 1;
442
- if (u === void 0)
442
+ if (l === void 0)
443
443
  return -1;
444
- if (u === h)
444
+ if (l === f)
445
445
  continue;
446
- return d(u, h);
447
- } while (++o);
446
+ return c(l, f);
447
+ } while (++n);
448
448
  }
449
- compareBuild(s) {
450
- s instanceof i || (s = new i(s, this.options));
451
- let o = 0;
449
+ compareBuild(i) {
450
+ i instanceof h || (i = new h(i, this.options));
451
+ let n = 0;
452
452
  do {
453
- const u = this.build[o], h = s.build[o];
454
- if (t("build compare", o, u, h), u === void 0 && h === void 0)
453
+ const l = this.build[n], f = i.build[n];
454
+ if (t("build compare", n, l, f), l === void 0 && f === void 0)
455
455
  return 0;
456
- if (h === void 0)
456
+ if (f === void 0)
457
457
  return 1;
458
- if (u === void 0)
458
+ if (l === void 0)
459
459
  return -1;
460
- if (u === h)
460
+ if (l === f)
461
461
  continue;
462
- return d(u, h);
463
- } while (++o);
462
+ return c(l, f);
463
+ } while (++n);
464
464
  }
465
465
  // preminor will bump the version up to the next minor release, and immediately
466
466
  // down to pre-release. premajor and prepatch work the same way.
467
- inc(s, o, u) {
468
- if (s.startsWith("pre")) {
469
- if (!o && u === !1)
467
+ inc(i, n, l) {
468
+ if (i.startsWith("pre")) {
469
+ if (!n && l === !1)
470
470
  throw new Error("invalid increment argument: identifier is empty");
471
- if (o) {
472
- const h = new RegExp(`^${this.options.loose ? a[l.PRERELEASELOOSE] : a[l.PRERELEASE]}$`), m = `-${o}`.match(h);
473
- if (!m || m[1] !== o)
474
- throw new Error(`invalid identifier: ${o}`);
471
+ if (n) {
472
+ const f = `-${n}`.match(this.options.loose ? s[a.PRERELEASELOOSE] : s[a.PRERELEASE]);
473
+ if (!f || f[1] !== n)
474
+ throw new Error(`invalid identifier: ${n}`);
475
475
  }
476
476
  }
477
- switch (s) {
477
+ switch (i) {
478
478
  case "premajor":
479
- this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", o, u);
479
+ this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", n, l);
480
480
  break;
481
481
  case "preminor":
482
- this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", o, u);
482
+ this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", n, l);
483
483
  break;
484
484
  case "prepatch":
485
- this.prerelease.length = 0, this.inc("patch", o, u), this.inc("pre", o, u);
485
+ this.prerelease.length = 0, this.inc("patch", n, l), this.inc("pre", n, l);
486
486
  break;
487
487
  // If the input is a non-prerelease version, this acts the same as
488
488
  // prepatch.
489
489
  case "prerelease":
490
- this.prerelease.length === 0 && this.inc("patch", o, u), this.inc("pre", o, u);
490
+ this.prerelease.length === 0 && this.inc("patch", n, l), this.inc("pre", n, l);
491
491
  break;
492
492
  case "release":
493
493
  if (this.prerelease.length === 0)
@@ -506,47 +506,47 @@ function j() {
506
506
  // This probably shouldn't be used publicly.
507
507
  // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
508
508
  case "pre": {
509
- const h = Number(u) ? 1 : 0;
509
+ const f = Number(l) ? 1 : 0;
510
510
  if (this.prerelease.length === 0)
511
- this.prerelease = [h];
511
+ this.prerelease = [f];
512
512
  else {
513
- let m = this.prerelease.length;
514
- for (; --m >= 0; )
515
- typeof this.prerelease[m] == "number" && (this.prerelease[m]++, m = -2);
516
- if (m === -1) {
517
- if (o === this.prerelease.join(".") && u === !1)
513
+ let d = this.prerelease.length;
514
+ for (; --d >= 0; )
515
+ typeof this.prerelease[d] == "number" && (this.prerelease[d]++, d = -2);
516
+ if (d === -1) {
517
+ if (n === this.prerelease.join(".") && l === !1)
518
518
  throw new Error("invalid increment argument: identifier already exists");
519
- this.prerelease.push(h);
519
+ this.prerelease.push(f);
520
520
  }
521
521
  }
522
- if (o) {
523
- let m = [o, h];
524
- u === !1 && (m = [o]), d(this.prerelease[0], o) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = m) : this.prerelease = m;
522
+ if (n) {
523
+ let d = [n, f];
524
+ l === !1 && (d = [n]), c(this.prerelease[0], n) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = d) : this.prerelease = d;
525
525
  }
526
526
  break;
527
527
  }
528
528
  default:
529
- throw new Error(`invalid increment argument: ${s}`);
529
+ throw new Error(`invalid increment argument: ${i}`);
530
530
  }
531
531
  return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
532
532
  }
533
533
  }
534
- return ke = i, ke;
534
+ return ke = h, ke;
535
535
  }
536
536
  var Le, Ht;
537
537
  function W() {
538
538
  if (Ht) return Le;
539
539
  Ht = 1;
540
540
  const t = j();
541
- return Le = (r, n, a = !1) => {
541
+ return Le = (r, s, a = !1) => {
542
542
  if (r instanceof t)
543
543
  return r;
544
544
  try {
545
- return new t(r, n);
546
- } catch (l) {
545
+ return new t(r, s);
546
+ } catch (u) {
547
547
  if (!a)
548
548
  return null;
549
- throw l;
549
+ throw u;
550
550
  }
551
551
  }, Le;
552
552
  }
@@ -555,8 +555,8 @@ function qs() {
555
555
  if (Yt) return Ce;
556
556
  Yt = 1;
557
557
  const t = W();
558
- return Ce = (r, n) => {
559
- const a = t(r, n);
558
+ return Ce = (r, s) => {
559
+ const a = t(r, s);
560
560
  return a ? a.version : null;
561
561
  }, Ce;
562
562
  }
@@ -565,8 +565,8 @@ function Ds() {
565
565
  if (Kt) return Te;
566
566
  Kt = 1;
567
567
  const t = W();
568
- return Te = (r, n) => {
569
- const a = t(r.trim().replace(/^[=v]+/, ""), n);
568
+ return Te = (r, s) => {
569
+ const a = t(r.trim().replace(/^[=v]+/, ""), s);
570
570
  return a ? a.version : null;
571
571
  }, Te;
572
572
  }
@@ -575,13 +575,13 @@ function Bs() {
575
575
  if (Zt) return Ae;
576
576
  Zt = 1;
577
577
  const t = j();
578
- return Ae = (r, n, a, l, c) => {
579
- typeof a == "string" && (c = l, l = a, a = void 0);
578
+ return Ae = (r, s, a, u, c) => {
579
+ typeof a == "string" && (c = u, u = a, a = void 0);
580
580
  try {
581
581
  return new t(
582
582
  r instanceof t ? r.version : r,
583
583
  a
584
- ).inc(n, l, c).version;
584
+ ).inc(s, u, c).version;
585
585
  } catch {
586
586
  return null;
587
587
  }
@@ -592,19 +592,19 @@ function _s() {
592
592
  if (Qt) return Fe;
593
593
  Qt = 1;
594
594
  const t = W();
595
- return Fe = (r, n) => {
596
- const a = t(r, null, !0), l = t(n, null, !0), c = a.compare(l);
595
+ return Fe = (r, s) => {
596
+ const a = t(r, null, !0), u = t(s, null, !0), c = a.compare(u);
597
597
  if (c === 0)
598
598
  return null;
599
- const d = c > 0, i = d ? a : l, f = d ? l : a, s = !!i.prerelease.length;
600
- if (!!f.prerelease.length && !s) {
601
- if (!f.patch && !f.minor)
599
+ const h = c > 0, o = h ? a : u, i = h ? u : a, n = !!o.prerelease.length;
600
+ if (!!i.prerelease.length && !n) {
601
+ if (!i.patch && !i.minor)
602
602
  return "major";
603
- if (f.compareMain(i) === 0)
604
- return f.minor && !f.patch ? "minor" : "patch";
603
+ if (i.compareMain(o) === 0)
604
+ return i.minor && !i.patch ? "minor" : "patch";
605
605
  }
606
- const u = s ? "pre" : "";
607
- return a.major !== l.major ? u + "major" : a.minor !== l.minor ? u + "minor" : a.patch !== l.patch ? u + "patch" : "prerelease";
606
+ const f = n ? "pre" : "";
607
+ return a.major !== u.major ? f + "major" : a.minor !== u.minor ? f + "minor" : a.patch !== u.patch ? f + "patch" : "prerelease";
608
608
  }, Fe;
609
609
  }
610
610
  var be, er;
@@ -612,29 +612,29 @@ function js() {
612
612
  if (er) return be;
613
613
  er = 1;
614
614
  const t = j();
615
- return be = (r, n) => new t(r, n).major, be;
615
+ return be = (r, s) => new t(r, s).major, be;
616
616
  }
617
617
  var qe, tr;
618
618
  function Gs() {
619
619
  if (tr) return qe;
620
620
  tr = 1;
621
621
  const t = j();
622
- return qe = (r, n) => new t(r, n).minor, qe;
622
+ return qe = (r, s) => new t(r, s).minor, qe;
623
623
  }
624
624
  var De, rr;
625
625
  function xs() {
626
626
  if (rr) return De;
627
627
  rr = 1;
628
628
  const t = j();
629
- return De = (r, n) => new t(r, n).patch, De;
629
+ return De = (r, s) => new t(r, s).patch, De;
630
630
  }
631
631
  var Be, sr;
632
632
  function Us() {
633
633
  if (sr) return Be;
634
634
  sr = 1;
635
635
  const t = W();
636
- return Be = (r, n) => {
637
- const a = t(r, n);
636
+ return Be = (r, s) => {
637
+ const a = t(r, s);
638
638
  return a && a.prerelease.length ? a.prerelease : null;
639
639
  }, Be;
640
640
  }
@@ -643,30 +643,30 @@ function G() {
643
643
  if (nr) return _e;
644
644
  nr = 1;
645
645
  const t = j();
646
- return _e = (r, n, a) => new t(r, a).compare(new t(n, a)), _e;
646
+ return _e = (r, s, a) => new t(r, a).compare(new t(s, a)), _e;
647
647
  }
648
648
  var je, ir;
649
649
  function Vs() {
650
650
  if (ir) return je;
651
651
  ir = 1;
652
652
  const t = G();
653
- return je = (r, n, a) => t(n, r, a), je;
653
+ return je = (r, s, a) => t(s, r, a), je;
654
654
  }
655
655
  var Ge, ar;
656
656
  function Ms() {
657
657
  if (ar) return Ge;
658
658
  ar = 1;
659
659
  const t = G();
660
- return Ge = (r, n) => t(r, n, !0), Ge;
660
+ return Ge = (r, s) => t(r, s, !0), Ge;
661
661
  }
662
662
  var xe, or;
663
663
  function At() {
664
664
  if (or) return xe;
665
665
  or = 1;
666
666
  const t = j();
667
- return xe = (r, n, a) => {
668
- const l = new t(r, a), c = new t(n, a);
669
- return l.compare(c) || l.compareBuild(c);
667
+ return xe = (r, s, a) => {
668
+ const u = new t(r, a), c = new t(s, a);
669
+ return u.compare(c) || u.compareBuild(c);
670
670
  }, xe;
671
671
  }
672
672
  var Ue, cr;
@@ -674,84 +674,84 @@ function zs() {
674
674
  if (cr) return Ue;
675
675
  cr = 1;
676
676
  const t = At();
677
- return Ue = (r, n) => r.sort((a, l) => t(a, l, n)), Ue;
677
+ return Ue = (r, s) => r.sort((a, u) => t(a, u, s)), Ue;
678
678
  }
679
679
  var Ve, lr;
680
680
  function Xs() {
681
681
  if (lr) return Ve;
682
682
  lr = 1;
683
683
  const t = At();
684
- return Ve = (r, n) => r.sort((a, l) => t(l, a, n)), Ve;
684
+ return Ve = (r, s) => r.sort((a, u) => t(u, a, s)), Ve;
685
685
  }
686
686
  var Me, ur;
687
687
  function ge() {
688
688
  if (ur) return Me;
689
689
  ur = 1;
690
690
  const t = G();
691
- return Me = (r, n, a) => t(r, n, a) > 0, Me;
691
+ return Me = (r, s, a) => t(r, s, a) > 0, Me;
692
692
  }
693
693
  var ze, fr;
694
694
  function Ft() {
695
695
  if (fr) return ze;
696
696
  fr = 1;
697
697
  const t = G();
698
- return ze = (r, n, a) => t(r, n, a) < 0, ze;
698
+ return ze = (r, s, a) => t(r, s, a) < 0, ze;
699
699
  }
700
700
  var Xe, hr;
701
701
  function Yr() {
702
702
  if (hr) return Xe;
703
703
  hr = 1;
704
704
  const t = G();
705
- return Xe = (r, n, a) => t(r, n, a) === 0, Xe;
705
+ return Xe = (r, s, a) => t(r, s, a) === 0, Xe;
706
706
  }
707
707
  var Je, pr;
708
708
  function Kr() {
709
709
  if (pr) return Je;
710
710
  pr = 1;
711
711
  const t = G();
712
- return Je = (r, n, a) => t(r, n, a) !== 0, Je;
712
+ return Je = (r, s, a) => t(r, s, a) !== 0, Je;
713
713
  }
714
714
  var We, dr;
715
715
  function bt() {
716
716
  if (dr) return We;
717
717
  dr = 1;
718
718
  const t = G();
719
- return We = (r, n, a) => t(r, n, a) >= 0, We;
719
+ return We = (r, s, a) => t(r, s, a) >= 0, We;
720
720
  }
721
721
  var He, gr;
722
722
  function qt() {
723
723
  if (gr) return He;
724
724
  gr = 1;
725
725
  const t = G();
726
- return He = (r, n, a) => t(r, n, a) <= 0, He;
726
+ return He = (r, s, a) => t(r, s, a) <= 0, He;
727
727
  }
728
728
  var Ye, mr;
729
729
  function Zr() {
730
730
  if (mr) return Ye;
731
731
  mr = 1;
732
- const t = Yr(), e = Kr(), r = ge(), n = bt(), a = Ft(), l = qt();
733
- return Ye = (d, i, f, s) => {
734
- switch (i) {
732
+ const t = Yr(), e = Kr(), r = ge(), s = bt(), a = Ft(), u = qt();
733
+ return Ye = (h, o, i, n) => {
734
+ switch (o) {
735
735
  case "===":
736
- return typeof d == "object" && (d = d.version), typeof f == "object" && (f = f.version), d === f;
736
+ return typeof h == "object" && (h = h.version), typeof i == "object" && (i = i.version), h === i;
737
737
  case "!==":
738
- return typeof d == "object" && (d = d.version), typeof f == "object" && (f = f.version), d !== f;
738
+ return typeof h == "object" && (h = h.version), typeof i == "object" && (i = i.version), h !== i;
739
739
  case "":
740
740
  case "=":
741
741
  case "==":
742
- return t(d, f, s);
742
+ return t(h, i, n);
743
743
  case "!=":
744
- return e(d, f, s);
744
+ return e(h, i, n);
745
745
  case ">":
746
- return r(d, f, s);
746
+ return r(h, i, n);
747
747
  case ">=":
748
- return n(d, f, s);
748
+ return s(h, i, n);
749
749
  case "<":
750
- return a(d, f, s);
750
+ return a(h, i, n);
751
751
  case "<=":
752
- return l(d, f, s);
752
+ return u(h, i, n);
753
753
  default:
754
- throw new TypeError(`Invalid operator: ${i}`);
754
+ throw new TypeError(`Invalid operator: ${o}`);
755
755
  }
756
756
  }, Ye;
757
757
  }
@@ -759,27 +759,27 @@ var Ke, Er;
759
759
  function Js() {
760
760
  if (Er) return Ke;
761
761
  Er = 1;
762
- const t = j(), e = W(), { safeRe: r, t: n } = ee();
763
- return Ke = (l, c) => {
764
- if (l instanceof t)
765
- return l;
766
- if (typeof l == "number" && (l = String(l)), typeof l != "string")
762
+ const t = j(), e = W(), { safeRe: r, t: s } = ee();
763
+ return Ke = (u, c) => {
764
+ if (u instanceof t)
765
+ return u;
766
+ if (typeof u == "number" && (u = String(u)), typeof u != "string")
767
767
  return null;
768
768
  c = c || {};
769
- let d = null;
769
+ let h = null;
770
770
  if (!c.rtl)
771
- d = l.match(c.includePrerelease ? r[n.COERCEFULL] : r[n.COERCE]);
771
+ h = u.match(c.includePrerelease ? r[s.COERCEFULL] : r[s.COERCE]);
772
772
  else {
773
- const h = c.includePrerelease ? r[n.COERCERTLFULL] : r[n.COERCERTL];
774
- let m;
775
- for (; (m = h.exec(l)) && (!d || d.index + d[0].length !== l.length); )
776
- (!d || m.index + m[0].length !== d.index + d[0].length) && (d = m), h.lastIndex = m.index + m[1].length + m[2].length;
777
- h.lastIndex = -1;
773
+ const d = c.includePrerelease ? r[s.COERCERTLFULL] : r[s.COERCERTL];
774
+ let w;
775
+ for (; (w = d.exec(u)) && (!h || h.index + h[0].length !== u.length); )
776
+ (!h || w.index + w[0].length !== h.index + h[0].length) && (h = w), d.lastIndex = w.index + w[1].length + w[2].length;
777
+ d.lastIndex = -1;
778
778
  }
779
- if (d === null)
779
+ if (h === null)
780
780
  return null;
781
- const i = d[2], f = d[3] || "0", s = d[4] || "0", o = c.includePrerelease && d[5] ? `-${d[5]}` : "", u = c.includePrerelease && d[6] ? `+${d[6]}` : "";
782
- return e(`${i}.${f}.${s}${o}${u}`, c);
781
+ const o = h[2], i = h[3] || "0", n = h[4] || "0", l = c.includePrerelease && h[5] ? `-${h[5]}` : "", f = c.includePrerelease && h[6] ? `+${h[6]}` : "";
782
+ return e(`${o}.${i}.${n}${l}${f}`, c);
783
783
  }, Ke;
784
784
  }
785
785
  var Ze, vr;
@@ -791,20 +791,20 @@ function Ws() {
791
791
  this.max = 1e3, this.map = /* @__PURE__ */ new Map();
792
792
  }
793
793
  get(r) {
794
- const n = this.map.get(r);
795
- if (n !== void 0)
796
- return this.map.delete(r), this.map.set(r, n), n;
794
+ const s = this.map.get(r);
795
+ if (s !== void 0)
796
+ return this.map.delete(r), this.map.set(r, s), s;
797
797
  }
798
798
  delete(r) {
799
799
  return this.map.delete(r);
800
800
  }
801
- set(r, n) {
802
- if (!this.delete(r) && n !== void 0) {
801
+ set(r, s) {
802
+ if (!this.delete(r) && s !== void 0) {
803
803
  if (this.map.size >= this.max) {
804
- const l = this.map.keys().next().value;
805
- this.delete(l);
804
+ const u = this.map.keys().next().value;
805
+ this.delete(u);
806
806
  }
807
- this.map.set(r, n);
807
+ this.map.set(r, s);
808
808
  }
809
809
  return this;
810
810
  }
@@ -820,17 +820,17 @@ function x() {
820
820
  constructor(g, S) {
821
821
  if (S = a(S), g instanceof e)
822
822
  return g.loose === !!S.loose && g.includePrerelease === !!S.includePrerelease ? g : new e(g.raw, S);
823
- if (g instanceof l)
823
+ if (g instanceof u)
824
824
  return this.raw = g.value, this.set = [[g]], this.formatted = void 0, this;
825
- if (this.options = S, this.loose = !!S.loose, this.includePrerelease = !!S.includePrerelease, this.raw = g.trim().replace(t, " "), this.set = this.raw.split("||").map((R) => this.parseRange(R.trim())).filter((R) => R.length), !this.set.length)
825
+ if (this.options = S, this.loose = !!S.loose, this.includePrerelease = !!S.includePrerelease, this.raw = g.trim().replace(t, " "), this.set = this.raw.split("||").map(($) => this.parseRange($.trim())).filter(($) => $.length), !this.set.length)
826
826
  throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
827
827
  if (this.set.length > 1) {
828
- const R = this.set[0];
828
+ const $ = this.set[0];
829
829
  if (this.set = this.set.filter((y) => !p(y[0])), this.set.length === 0)
830
- this.set = [R];
830
+ this.set = [$];
831
831
  else if (this.set.length > 1) {
832
832
  for (const y of this.set)
833
- if (y.length === 1 && v(y[0])) {
833
+ if (y.length === 1 && E(y[0])) {
834
834
  this.set = [y];
835
835
  break;
836
836
  }
@@ -844,8 +844,8 @@ function x() {
844
844
  for (let g = 0; g < this.set.length; g++) {
845
845
  g > 0 && (this.formatted += "||");
846
846
  const S = this.set[g];
847
- for (let R = 0; R < S.length; R++)
848
- R > 0 && (this.formatted += " "), this.formatted += S[R].toString().trim();
847
+ for (let $ = 0; $ < S.length; $++)
848
+ $ > 0 && (this.formatted += " "), this.formatted += S[$].toString().trim();
849
849
  }
850
850
  }
851
851
  return this.formatted;
@@ -857,14 +857,14 @@ function x() {
857
857
  return this.range;
858
858
  }
859
859
  parseRange(g) {
860
- const R = ((this.options.includePrerelease && h) | (this.options.loose && m)) + ":" + g, y = n.get(R);
860
+ const $ = ((this.options.includePrerelease && d) | (this.options.loose && w)) + ":" + g, y = s.get($);
861
861
  if (y)
862
862
  return y;
863
- const w = this.options.loose, O = w ? i[f.HYPHENRANGELOOSE] : i[f.HYPHENRANGE];
864
- g = g.replace(O, we(this.options.includePrerelease)), c("hyphen replace", g), g = g.replace(i[f.COMPARATORTRIM], s), c("comparator trim", g), g = g.replace(i[f.TILDETRIM], o), c("tilde trim", g), g = g.replace(i[f.CARETTRIM], u), c("caret trim", g);
863
+ const R = this.options.loose, O = R ? o[i.HYPHENRANGELOOSE] : o[i.HYPHENRANGE];
864
+ g = g.replace(O, we(this.options.includePrerelease)), c("hyphen replace", g), g = g.replace(o[i.COMPARATORTRIM], n), c("comparator trim", g), g = g.replace(o[i.TILDETRIM], l), c("tilde trim", g), g = g.replace(o[i.CARETTRIM], f), c("caret trim", g);
865
865
  let C = g.split(" ").map((q) => N(q, this.options)).join(" ").split(/\s+/).map((q) => Re(q, this.options));
866
- w && (C = C.filter((q) => (c("loose invalid filter", q, this.options), !!q.match(i[f.COMPARATORLOOSE])))), c("range list", C);
867
- const k = /* @__PURE__ */ new Map(), A = C.map((q) => new l(q, this.options));
866
+ R && (C = C.filter((q) => (c("loose invalid filter", q, this.options), !!q.match(o[i.COMPARATORLOOSE])))), c("range list", C);
867
+ const k = /* @__PURE__ */ new Map(), A = C.map((q) => new u(q, this.options));
868
868
  for (const q of A) {
869
869
  if (p(q))
870
870
  return [q];
@@ -872,12 +872,12 @@ function x() {
872
872
  }
873
873
  k.size > 1 && k.has("") && k.delete("");
874
874
  const _ = [...k.values()];
875
- return n.set(R, _), _;
875
+ return s.set($, _), _;
876
876
  }
877
877
  intersects(g, S) {
878
878
  if (!(g instanceof e))
879
879
  throw new TypeError("a Range is required");
880
- return this.set.some((R) => $(R, S) && g.set.some((y) => $(y, S) && R.every((w) => y.every((O) => w.intersects(O, S)))));
880
+ return this.set.some(($) => v($, S) && g.set.some((y) => v(y, S) && $.every((R) => y.every((O) => R.intersects(O, S)))));
881
881
  }
882
882
  // if ANY of the sets match ALL of its comparators, then pass
883
883
  test(g) {
@@ -885,7 +885,7 @@ function x() {
885
885
  return !1;
886
886
  if (typeof g == "string")
887
887
  try {
888
- g = new d(g, this.options);
888
+ g = new h(g, this.options);
889
889
  } catch {
890
890
  return !1;
891
891
  }
@@ -896,50 +896,50 @@ function x() {
896
896
  }
897
897
  }
898
898
  Qe = e;
899
- const r = Ws(), n = new r(), a = Tt(), l = me(), c = de(), d = j(), {
900
- safeRe: i,
901
- t: f,
902
- comparatorTrimReplace: s,
903
- tildeTrimReplace: o,
904
- caretTrimReplace: u
905
- } = ee(), { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: m } = pe(), p = (E) => E.value === "<0.0.0-0", v = (E) => E.value === "", $ = (E, g) => {
899
+ const r = Ws(), s = new r(), a = Tt(), u = me(), c = de(), h = j(), {
900
+ safeRe: o,
901
+ t: i,
902
+ comparatorTrimReplace: n,
903
+ tildeTrimReplace: l,
904
+ caretTrimReplace: f
905
+ } = ee(), { FLAG_INCLUDE_PRERELEASE: d, FLAG_LOOSE: w } = pe(), p = (m) => m.value === "<0.0.0-0", E = (m) => m.value === "", v = (m, g) => {
906
906
  let S = !0;
907
- const R = E.slice();
908
- let y = R.pop();
909
- for (; S && R.length; )
910
- S = R.every((w) => y.intersects(w, g)), y = R.pop();
907
+ const $ = m.slice();
908
+ let y = $.pop();
909
+ for (; S && $.length; )
910
+ S = $.every((R) => y.intersects(R, g)), y = $.pop();
911
911
  return S;
912
- }, N = (E, g) => (c("comp", E, g), E = T(E, g), c("caret", E), E = F(E, g), c("tildes", E), E = P(E, g), c("xrange", E), E = $e(E, g), c("stars", E), E), I = (E) => !E || E.toLowerCase() === "x" || E === "*", F = (E, g) => E.trim().split(/\s+/).map((S) => b(S, g)).join(" "), b = (E, g) => {
913
- const S = g.loose ? i[f.TILDELOOSE] : i[f.TILDE];
914
- return E.replace(S, (R, y, w, O, C) => {
915
- c("tilde", E, R, y, w, O, C);
912
+ }, N = (m, g) => (c("comp", m, g), m = T(m, g), c("caret", m), m = F(m, g), c("tildes", m), m = P(m, g), c("xrange", m), m = $e(m, g), c("stars", m), m), I = (m) => !m || m.toLowerCase() === "x" || m === "*", F = (m, g) => m.trim().split(/\s+/).map((S) => b(S, g)).join(" "), b = (m, g) => {
913
+ const S = g.loose ? o[i.TILDELOOSE] : o[i.TILDE];
914
+ return m.replace(S, ($, y, R, O, C) => {
915
+ c("tilde", m, $, y, R, O, C);
916
916
  let k;
917
- return I(y) ? k = "" : I(w) ? k = `>=${y}.0.0 <${+y + 1}.0.0-0` : I(O) ? k = `>=${y}.${w}.0 <${y}.${+w + 1}.0-0` : C ? (c("replaceTilde pr", C), k = `>=${y}.${w}.${O}-${C} <${y}.${+w + 1}.0-0`) : k = `>=${y}.${w}.${O} <${y}.${+w + 1}.0-0`, c("tilde return", k), k;
917
+ return I(y) ? k = "" : I(R) ? k = `>=${y}.0.0 <${+y + 1}.0.0-0` : I(O) ? k = `>=${y}.${R}.0 <${y}.${+R + 1}.0-0` : C ? (c("replaceTilde pr", C), k = `>=${y}.${R}.${O}-${C} <${y}.${+R + 1}.0-0`) : k = `>=${y}.${R}.${O} <${y}.${+R + 1}.0-0`, c("tilde return", k), k;
918
918
  });
919
- }, T = (E, g) => E.trim().split(/\s+/).map((S) => D(S, g)).join(" "), D = (E, g) => {
920
- c("caret", E, g);
921
- const S = g.loose ? i[f.CARETLOOSE] : i[f.CARET], R = g.includePrerelease ? "-0" : "";
922
- return E.replace(S, (y, w, O, C, k) => {
923
- c("caret", E, y, w, O, C, k);
919
+ }, T = (m, g) => m.trim().split(/\s+/).map((S) => D(S, g)).join(" "), D = (m, g) => {
920
+ c("caret", m, g);
921
+ const S = g.loose ? o[i.CARETLOOSE] : o[i.CARET], $ = g.includePrerelease ? "-0" : "";
922
+ return m.replace(S, (y, R, O, C, k) => {
923
+ c("caret", m, y, R, O, C, k);
924
924
  let A;
925
- return I(w) ? A = "" : I(O) ? A = `>=${w}.0.0${R} <${+w + 1}.0.0-0` : I(C) ? w === "0" ? A = `>=${w}.${O}.0${R} <${w}.${+O + 1}.0-0` : A = `>=${w}.${O}.0${R} <${+w + 1}.0.0-0` : k ? (c("replaceCaret pr", k), w === "0" ? O === "0" ? A = `>=${w}.${O}.${C}-${k} <${w}.${O}.${+C + 1}-0` : A = `>=${w}.${O}.${C}-${k} <${w}.${+O + 1}.0-0` : A = `>=${w}.${O}.${C}-${k} <${+w + 1}.0.0-0`) : (c("no pr"), w === "0" ? O === "0" ? A = `>=${w}.${O}.${C}${R} <${w}.${O}.${+C + 1}-0` : A = `>=${w}.${O}.${C}${R} <${w}.${+O + 1}.0-0` : A = `>=${w}.${O}.${C} <${+w + 1}.0.0-0`), c("caret return", A), A;
925
+ return I(R) ? A = "" : I(O) ? A = `>=${R}.0.0${$} <${+R + 1}.0.0-0` : I(C) ? R === "0" ? A = `>=${R}.${O}.0${$} <${R}.${+O + 1}.0-0` : A = `>=${R}.${O}.0${$} <${+R + 1}.0.0-0` : k ? (c("replaceCaret pr", k), R === "0" ? O === "0" ? A = `>=${R}.${O}.${C}-${k} <${R}.${O}.${+C + 1}-0` : A = `>=${R}.${O}.${C}-${k} <${R}.${+O + 1}.0-0` : A = `>=${R}.${O}.${C}-${k} <${+R + 1}.0.0-0`) : (c("no pr"), R === "0" ? O === "0" ? A = `>=${R}.${O}.${C}${$} <${R}.${O}.${+C + 1}-0` : A = `>=${R}.${O}.${C}${$} <${R}.${+O + 1}.0-0` : A = `>=${R}.${O}.${C} <${+R + 1}.0.0-0`), c("caret return", A), A;
926
926
  });
927
- }, P = (E, g) => (c("replaceXRanges", E, g), E.split(/\s+/).map((S) => H(S, g)).join(" ")), H = (E, g) => {
928
- E = E.trim();
929
- const S = g.loose ? i[f.XRANGELOOSE] : i[f.XRANGE];
930
- return E.replace(S, (R, y, w, O, C, k) => {
931
- c("xRange", E, R, y, w, O, C, k);
932
- const A = I(w), _ = A || I(O), q = _ || I(C), Y = q;
933
- return y === "=" && Y && (y = ""), k = g.includePrerelease ? "-0" : "", A ? y === ">" || y === "<" ? R = "<0.0.0-0" : R = "*" : y && Y ? (_ && (O = 0), C = 0, y === ">" ? (y = ">=", _ ? (w = +w + 1, O = 0, C = 0) : (O = +O + 1, C = 0)) : y === "<=" && (y = "<", _ ? w = +w + 1 : O = +O + 1), y === "<" && (k = "-0"), R = `${y + w}.${O}.${C}${k}`) : _ ? R = `>=${w}.0.0${k} <${+w + 1}.0.0-0` : q && (R = `>=${w}.${O}.0${k} <${w}.${+O + 1}.0-0`), c("xRange return", R), R;
927
+ }, P = (m, g) => (c("replaceXRanges", m, g), m.split(/\s+/).map((S) => H(S, g)).join(" ")), H = (m, g) => {
928
+ m = m.trim();
929
+ const S = g.loose ? o[i.XRANGELOOSE] : o[i.XRANGE];
930
+ return m.replace(S, ($, y, R, O, C, k) => {
931
+ c("xRange", m, $, y, R, O, C, k);
932
+ const A = I(R), _ = A || I(O), q = _ || I(C), Y = q;
933
+ return y === "=" && Y && (y = ""), k = g.includePrerelease ? "-0" : "", A ? y === ">" || y === "<" ? $ = "<0.0.0-0" : $ = "*" : y && Y ? (_ && (O = 0), C = 0, y === ">" ? (y = ">=", _ ? (R = +R + 1, O = 0, C = 0) : (O = +O + 1, C = 0)) : y === "<=" && (y = "<", _ ? R = +R + 1 : O = +O + 1), y === "<" && (k = "-0"), $ = `${y + R}.${O}.${C}${k}`) : _ ? $ = `>=${R}.0.0${k} <${+R + 1}.0.0-0` : q && ($ = `>=${R}.${O}.0${k} <${R}.${+O + 1}.0-0`), c("xRange return", $), $;
934
934
  });
935
- }, $e = (E, g) => (c("replaceStars", E, g), E.trim().replace(i[f.STAR], "")), Re = (E, g) => (c("replaceGTE0", E, g), E.trim().replace(i[g.includePrerelease ? f.GTE0PRE : f.GTE0], "")), we = (E) => (g, S, R, y, w, O, C, k, A, _, q, Y) => (I(R) ? S = "" : I(y) ? S = `>=${R}.0.0${E ? "-0" : ""}` : I(w) ? S = `>=${R}.${y}.0${E ? "-0" : ""}` : O ? S = `>=${S}` : S = `>=${S}${E ? "-0" : ""}`, I(A) ? k = "" : I(_) ? k = `<${+A + 1}.0.0-0` : I(q) ? k = `<${A}.${+_ + 1}.0-0` : Y ? k = `<=${A}.${_}.${q}-${Y}` : E ? k = `<${A}.${_}.${+q + 1}-0` : k = `<=${k}`, `${S} ${k}`.trim()), Se = (E, g, S) => {
936
- for (let R = 0; R < E.length; R++)
937
- if (!E[R].test(g))
935
+ }, $e = (m, g) => (c("replaceStars", m, g), m.trim().replace(o[i.STAR], "")), Re = (m, g) => (c("replaceGTE0", m, g), m.trim().replace(o[g.includePrerelease ? i.GTE0PRE : i.GTE0], "")), we = (m) => (g, S, $, y, R, O, C, k, A, _, q, Y) => (I($) ? S = "" : I(y) ? S = `>=${$}.0.0${m ? "-0" : ""}` : I(R) ? S = `>=${$}.${y}.0${m ? "-0" : ""}` : O ? S = `>=${S}` : S = `>=${S}${m ? "-0" : ""}`, I(A) ? k = "" : I(_) ? k = `<${+A + 1}.0.0-0` : I(q) ? k = `<${A}.${+_ + 1}.0-0` : Y ? k = `<=${A}.${_}.${q}-${Y}` : m ? k = `<${A}.${_}.${+q + 1}-0` : k = `<=${k}`, `${S} ${k}`.trim()), Se = (m, g, S) => {
936
+ for (let $ = 0; $ < m.length; $++)
937
+ if (!m[$].test(g))
938
938
  return !1;
939
939
  if (g.prerelease.length && !S.includePrerelease) {
940
- for (let R = 0; R < E.length; R++)
941
- if (c(E[R].semver), E[R].semver !== l.ANY && E[R].semver.prerelease.length > 0) {
942
- const y = E[R].semver;
940
+ for (let $ = 0; $ < m.length; $++)
941
+ if (c(m[$].semver), m[$].semver !== u.ANY && m[$].semver.prerelease.length > 0) {
942
+ const y = m[$].semver;
943
943
  if (y.major === g.major && y.minor === g.minor && y.patch === g.patch)
944
944
  return !0;
945
945
  }
@@ -958,42 +958,42 @@ function me() {
958
958
  static get ANY() {
959
959
  return t;
960
960
  }
961
- constructor(s, o) {
962
- if (o = r(o), s instanceof e) {
963
- if (s.loose === !!o.loose)
964
- return s;
965
- s = s.value;
961
+ constructor(n, l) {
962
+ if (l = r(l), n instanceof e) {
963
+ if (n.loose === !!l.loose)
964
+ return n;
965
+ n = n.value;
966
966
  }
967
- s = s.trim().split(/\s+/).join(" "), c("comparator", s, o), this.options = o, this.loose = !!o.loose, this.parse(s), this.semver === t ? this.value = "" : this.value = this.operator + this.semver.version, c("comp", this);
967
+ n = n.trim().split(/\s+/).join(" "), c("comparator", n, l), this.options = l, this.loose = !!l.loose, this.parse(n), this.semver === t ? this.value = "" : this.value = this.operator + this.semver.version, c("comp", this);
968
968
  }
969
- parse(s) {
970
- const o = this.options.loose ? n[a.COMPARATORLOOSE] : n[a.COMPARATOR], u = s.match(o);
971
- if (!u)
972
- throw new TypeError(`Invalid comparator: ${s}`);
973
- this.operator = u[1] !== void 0 ? u[1] : "", this.operator === "=" && (this.operator = ""), u[2] ? this.semver = new d(u[2], this.options.loose) : this.semver = t;
969
+ parse(n) {
970
+ const l = this.options.loose ? s[a.COMPARATORLOOSE] : s[a.COMPARATOR], f = n.match(l);
971
+ if (!f)
972
+ throw new TypeError(`Invalid comparator: ${n}`);
973
+ this.operator = f[1] !== void 0 ? f[1] : "", this.operator === "=" && (this.operator = ""), f[2] ? this.semver = new h(f[2], this.options.loose) : this.semver = t;
974
974
  }
975
975
  toString() {
976
976
  return this.value;
977
977
  }
978
- test(s) {
979
- if (c("Comparator.test", s, this.options.loose), this.semver === t || s === t)
978
+ test(n) {
979
+ if (c("Comparator.test", n, this.options.loose), this.semver === t || n === t)
980
980
  return !0;
981
- if (typeof s == "string")
981
+ if (typeof n == "string")
982
982
  try {
983
- s = new d(s, this.options);
983
+ n = new h(n, this.options);
984
984
  } catch {
985
985
  return !1;
986
986
  }
987
- return l(s, this.operator, this.semver, this.options);
987
+ return u(n, this.operator, this.semver, this.options);
988
988
  }
989
- intersects(s, o) {
990
- if (!(s instanceof e))
989
+ intersects(n, l) {
990
+ if (!(n instanceof e))
991
991
  throw new TypeError("a Comparator is required");
992
- return this.operator === "" ? this.value === "" ? !0 : new i(s.value, o).test(this.value) : s.operator === "" ? s.value === "" ? !0 : new i(this.value, o).test(s.semver) : (o = r(o), o.includePrerelease && (this.value === "<0.0.0-0" || s.value === "<0.0.0-0") || !o.includePrerelease && (this.value.startsWith("<0.0.0") || s.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && s.operator.startsWith(">") || this.operator.startsWith("<") && s.operator.startsWith("<") || this.semver.version === s.semver.version && this.operator.includes("=") && s.operator.includes("=") || l(this.semver, "<", s.semver, o) && this.operator.startsWith(">") && s.operator.startsWith("<") || l(this.semver, ">", s.semver, o) && this.operator.startsWith("<") && s.operator.startsWith(">")));
992
+ return this.operator === "" ? this.value === "" ? !0 : new o(n.value, l).test(this.value) : n.operator === "" ? n.value === "" ? !0 : new o(this.value, l).test(n.semver) : (l = r(l), l.includePrerelease && (this.value === "<0.0.0-0" || n.value === "<0.0.0-0") || !l.includePrerelease && (this.value.startsWith("<0.0.0") || n.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && n.operator.startsWith(">") || this.operator.startsWith("<") && n.operator.startsWith("<") || this.semver.version === n.semver.version && this.operator.includes("=") && n.operator.includes("=") || u(this.semver, "<", n.semver, l) && this.operator.startsWith(">") && n.operator.startsWith("<") || u(this.semver, ">", n.semver, l) && this.operator.startsWith("<") && n.operator.startsWith(">")));
993
993
  }
994
994
  }
995
995
  et = e;
996
- const r = Tt(), { safeRe: n, t: a } = ee(), l = Zr(), c = de(), d = j(), i = x();
996
+ const r = Tt(), { safeRe: s, t: a } = ee(), u = Zr(), c = de(), h = j(), o = x();
997
997
  return et;
998
998
  }
999
999
  var tt, wr;
@@ -1001,13 +1001,13 @@ function Ee() {
1001
1001
  if (wr) return tt;
1002
1002
  wr = 1;
1003
1003
  const t = x();
1004
- return tt = (r, n, a) => {
1004
+ return tt = (r, s, a) => {
1005
1005
  try {
1006
- n = new t(n, a);
1006
+ s = new t(s, a);
1007
1007
  } catch {
1008
1008
  return !1;
1009
1009
  }
1010
- return n.test(r);
1010
+ return s.test(r);
1011
1011
  }, tt;
1012
1012
  }
1013
1013
  var rt, Sr;
@@ -1015,22 +1015,22 @@ function Hs() {
1015
1015
  if (Sr) return rt;
1016
1016
  Sr = 1;
1017
1017
  const t = x();
1018
- return rt = (r, n) => new t(r, n).set.map((a) => a.map((l) => l.value).join(" ").trim().split(" ")), rt;
1018
+ return rt = (r, s) => new t(r, s).set.map((a) => a.map((u) => u.value).join(" ").trim().split(" ")), rt;
1019
1019
  }
1020
1020
  var st, yr;
1021
1021
  function Ys() {
1022
1022
  if (yr) return st;
1023
1023
  yr = 1;
1024
1024
  const t = j(), e = x();
1025
- return st = (n, a, l) => {
1026
- let c = null, d = null, i = null;
1025
+ return st = (s, a, u) => {
1026
+ let c = null, h = null, o = null;
1027
1027
  try {
1028
- i = new e(a, l);
1028
+ o = new e(a, u);
1029
1029
  } catch {
1030
1030
  return null;
1031
1031
  }
1032
- return n.forEach((f) => {
1033
- i.test(f) && (!c || d.compare(f) === -1) && (c = f, d = new t(c, l));
1032
+ return s.forEach((i) => {
1033
+ o.test(i) && (!c || h.compare(i) === -1) && (c = i, h = new t(c, u));
1034
1034
  }), c;
1035
1035
  }, st;
1036
1036
  }
@@ -1039,15 +1039,15 @@ function Ks() {
1039
1039
  if (Ir) return nt;
1040
1040
  Ir = 1;
1041
1041
  const t = j(), e = x();
1042
- return nt = (n, a, l) => {
1043
- let c = null, d = null, i = null;
1042
+ return nt = (s, a, u) => {
1043
+ let c = null, h = null, o = null;
1044
1044
  try {
1045
- i = new e(a, l);
1045
+ o = new e(a, u);
1046
1046
  } catch {
1047
1047
  return null;
1048
1048
  }
1049
- return n.forEach((f) => {
1050
- i.test(f) && (!c || d.compare(f) === 1) && (c = f, d = new t(c, l));
1049
+ return s.forEach((i) => {
1050
+ o.test(i) && (!c || h.compare(i) === 1) && (c = i, h = new t(c, u));
1051
1051
  }), c;
1052
1052
  }, nt;
1053
1053
  }
@@ -1056,33 +1056,33 @@ function Zs() {
1056
1056
  if (Or) return it;
1057
1057
  Or = 1;
1058
1058
  const t = j(), e = x(), r = ge();
1059
- return it = (a, l) => {
1060
- a = new e(a, l);
1059
+ return it = (a, u) => {
1060
+ a = new e(a, u);
1061
1061
  let c = new t("0.0.0");
1062
1062
  if (a.test(c) || (c = new t("0.0.0-0"), a.test(c)))
1063
1063
  return c;
1064
1064
  c = null;
1065
- for (let d = 0; d < a.set.length; ++d) {
1066
- const i = a.set[d];
1067
- let f = null;
1068
- i.forEach((s) => {
1069
- const o = new t(s.semver.version);
1070
- switch (s.operator) {
1065
+ for (let h = 0; h < a.set.length; ++h) {
1066
+ const o = a.set[h];
1067
+ let i = null;
1068
+ o.forEach((n) => {
1069
+ const l = new t(n.semver.version);
1070
+ switch (n.operator) {
1071
1071
  case ">":
1072
- o.prerelease.length === 0 ? o.patch++ : o.prerelease.push(0), o.raw = o.format();
1072
+ l.prerelease.length === 0 ? l.patch++ : l.prerelease.push(0), l.raw = l.format();
1073
1073
  /* fallthrough */
1074
1074
  case "":
1075
1075
  case ">=":
1076
- (!f || r(o, f)) && (f = o);
1076
+ (!i || r(l, i)) && (i = l);
1077
1077
  break;
1078
1078
  case "<":
1079
1079
  case "<=":
1080
1080
  break;
1081
1081
  /* istanbul ignore next */
1082
1082
  default:
1083
- throw new Error(`Unexpected operation: ${s.operator}`);
1083
+ throw new Error(`Unexpected operation: ${n.operator}`);
1084
1084
  }
1085
- }), f && (!c || r(c, f)) && (c = f);
1085
+ }), i && (!c || r(c, i)) && (c = i);
1086
1086
  }
1087
1087
  return c && a.test(c) ? c : null;
1088
1088
  }, it;
@@ -1092,9 +1092,9 @@ function Qs() {
1092
1092
  if (Pr) return at;
1093
1093
  Pr = 1;
1094
1094
  const t = x();
1095
- return at = (r, n) => {
1095
+ return at = (r, s) => {
1096
1096
  try {
1097
- return new t(r, n).range || "*";
1097
+ return new t(r, s).range || "*";
1098
1098
  } catch {
1099
1099
  return null;
1100
1100
  }
@@ -1104,30 +1104,30 @@ var ot, Nr;
1104
1104
  function Dt() {
1105
1105
  if (Nr) return ot;
1106
1106
  Nr = 1;
1107
- const t = j(), e = me(), { ANY: r } = e, n = x(), a = Ee(), l = ge(), c = Ft(), d = qt(), i = bt();
1108
- return ot = (s, o, u, h) => {
1109
- s = new t(s, h), o = new n(o, h);
1110
- let m, p, v, $, N;
1111
- switch (u) {
1107
+ const t = j(), e = me(), { ANY: r } = e, s = x(), a = Ee(), u = ge(), c = Ft(), h = qt(), o = bt();
1108
+ return ot = (n, l, f, d) => {
1109
+ n = new t(n, d), l = new s(l, d);
1110
+ let w, p, E, v, N;
1111
+ switch (f) {
1112
1112
  case ">":
1113
- m = l, p = d, v = c, $ = ">", N = ">=";
1113
+ w = u, p = h, E = c, v = ">", N = ">=";
1114
1114
  break;
1115
1115
  case "<":
1116
- m = c, p = i, v = l, $ = "<", N = "<=";
1116
+ w = c, p = o, E = u, v = "<", N = "<=";
1117
1117
  break;
1118
1118
  default:
1119
1119
  throw new TypeError('Must provide a hilo val of "<" or ">"');
1120
1120
  }
1121
- if (a(s, o, h))
1121
+ if (a(n, l, d))
1122
1122
  return !1;
1123
- for (let I = 0; I < o.set.length; ++I) {
1124
- const F = o.set[I];
1123
+ for (let I = 0; I < l.set.length; ++I) {
1124
+ const F = l.set[I];
1125
1125
  let b = null, T = null;
1126
1126
  if (F.forEach((D) => {
1127
- D.semver === r && (D = new e(">=0.0.0")), b = b || D, T = T || D, m(D.semver, b.semver, h) ? b = D : v(D.semver, T.semver, h) && (T = D);
1128
- }), b.operator === $ || b.operator === N || (!T.operator || T.operator === $) && p(s, T.semver))
1127
+ D.semver === r && (D = new e(">=0.0.0")), b = b || D, T = T || D, w(D.semver, b.semver, d) ? b = D : E(D.semver, T.semver, d) && (T = D);
1128
+ }), b.operator === v || b.operator === N || (!T.operator || T.operator === v) && p(n, T.semver))
1129
1129
  return !1;
1130
- if (T.operator === N && v(s, T.semver))
1130
+ if (T.operator === N && E(n, T.semver))
1131
1131
  return !1;
1132
1132
  }
1133
1133
  return !0;
@@ -1138,148 +1138,148 @@ function en() {
1138
1138
  if (kr) return ct;
1139
1139
  kr = 1;
1140
1140
  const t = Dt();
1141
- return ct = (r, n, a) => t(r, n, ">", a), ct;
1141
+ return ct = (r, s, a) => t(r, s, ">", a), ct;
1142
1142
  }
1143
1143
  var lt, Lr;
1144
1144
  function tn() {
1145
1145
  if (Lr) return lt;
1146
1146
  Lr = 1;
1147
1147
  const t = Dt();
1148
- return lt = (r, n, a) => t(r, n, "<", a), lt;
1148
+ return lt = (r, s, a) => t(r, s, "<", a), lt;
1149
1149
  }
1150
1150
  var ut, Cr;
1151
1151
  function rn() {
1152
1152
  if (Cr) return ut;
1153
1153
  Cr = 1;
1154
1154
  const t = x();
1155
- return ut = (r, n, a) => (r = new t(r, a), n = new t(n, a), r.intersects(n, a)), ut;
1155
+ return ut = (r, s, a) => (r = new t(r, a), s = new t(s, a), r.intersects(s, a)), ut;
1156
1156
  }
1157
1157
  var ft, Tr;
1158
1158
  function sn() {
1159
1159
  if (Tr) return ft;
1160
1160
  Tr = 1;
1161
1161
  const t = Ee(), e = G();
1162
- return ft = (r, n, a) => {
1163
- const l = [];
1164
- let c = null, d = null;
1165
- const i = r.sort((u, h) => e(u, h, a));
1166
- for (const u of i)
1167
- t(u, n, a) ? (d = u, c || (c = u)) : (d && l.push([c, d]), d = null, c = null);
1168
- c && l.push([c, null]);
1169
- const f = [];
1170
- for (const [u, h] of l)
1171
- u === h ? f.push(u) : !h && u === i[0] ? f.push("*") : h ? u === i[0] ? f.push(`<=${h}`) : f.push(`${u} - ${h}`) : f.push(`>=${u}`);
1172
- const s = f.join(" || "), o = typeof n.raw == "string" ? n.raw : String(n);
1173
- return s.length < o.length ? s : n;
1162
+ return ft = (r, s, a) => {
1163
+ const u = [];
1164
+ let c = null, h = null;
1165
+ const o = r.sort((f, d) => e(f, d, a));
1166
+ for (const f of o)
1167
+ t(f, s, a) ? (h = f, c || (c = f)) : (h && u.push([c, h]), h = null, c = null);
1168
+ c && u.push([c, null]);
1169
+ const i = [];
1170
+ for (const [f, d] of u)
1171
+ f === d ? i.push(f) : !d && f === o[0] ? i.push("*") : d ? f === o[0] ? i.push(`<=${d}`) : i.push(`${f} - ${d}`) : i.push(`>=${f}`);
1172
+ const n = i.join(" || "), l = typeof s.raw == "string" ? s.raw : String(s);
1173
+ return n.length < l.length ? n : s;
1174
1174
  }, ft;
1175
1175
  }
1176
1176
  var ht, Ar;
1177
1177
  function nn() {
1178
1178
  if (Ar) return ht;
1179
1179
  Ar = 1;
1180
- const t = x(), e = me(), { ANY: r } = e, n = Ee(), a = G(), l = (o, u, h = {}) => {
1181
- if (o === u)
1180
+ const t = x(), e = me(), { ANY: r } = e, s = Ee(), a = G(), u = (l, f, d = {}) => {
1181
+ if (l === f)
1182
1182
  return !0;
1183
- o = new t(o, h), u = new t(u, h);
1184
- let m = !1;
1185
- e: for (const p of o.set) {
1186
- for (const v of u.set) {
1187
- const $ = i(p, v, h);
1188
- if (m = m || $ !== null, $)
1183
+ l = new t(l, d), f = new t(f, d);
1184
+ let w = !1;
1185
+ e: for (const p of l.set) {
1186
+ for (const E of f.set) {
1187
+ const v = o(p, E, d);
1188
+ if (w = w || v !== null, v)
1189
1189
  continue e;
1190
1190
  }
1191
- if (m)
1191
+ if (w)
1192
1192
  return !1;
1193
1193
  }
1194
1194
  return !0;
1195
- }, c = [new e(">=0.0.0-0")], d = [new e(">=0.0.0")], i = (o, u, h) => {
1196
- if (o === u)
1195
+ }, c = [new e(">=0.0.0-0")], h = [new e(">=0.0.0")], o = (l, f, d) => {
1196
+ if (l === f)
1197
1197
  return !0;
1198
- if (o.length === 1 && o[0].semver === r) {
1199
- if (u.length === 1 && u[0].semver === r)
1198
+ if (l.length === 1 && l[0].semver === r) {
1199
+ if (f.length === 1 && f[0].semver === r)
1200
1200
  return !0;
1201
- h.includePrerelease ? o = c : o = d;
1201
+ d.includePrerelease ? l = c : l = h;
1202
1202
  }
1203
- if (u.length === 1 && u[0].semver === r) {
1204
- if (h.includePrerelease)
1203
+ if (f.length === 1 && f[0].semver === r) {
1204
+ if (d.includePrerelease)
1205
1205
  return !0;
1206
- u = d;
1206
+ f = h;
1207
1207
  }
1208
- const m = /* @__PURE__ */ new Set();
1209
- let p, v;
1210
- for (const P of o)
1211
- P.operator === ">" || P.operator === ">=" ? p = f(p, P, h) : P.operator === "<" || P.operator === "<=" ? v = s(v, P, h) : m.add(P.semver);
1212
- if (m.size > 1)
1208
+ const w = /* @__PURE__ */ new Set();
1209
+ let p, E;
1210
+ for (const P of l)
1211
+ P.operator === ">" || P.operator === ">=" ? p = i(p, P, d) : P.operator === "<" || P.operator === "<=" ? E = n(E, P, d) : w.add(P.semver);
1212
+ if (w.size > 1)
1213
1213
  return null;
1214
- let $;
1215
- if (p && v) {
1216
- if ($ = a(p.semver, v.semver, h), $ > 0)
1214
+ let v;
1215
+ if (p && E) {
1216
+ if (v = a(p.semver, E.semver, d), v > 0)
1217
1217
  return null;
1218
- if ($ === 0 && (p.operator !== ">=" || v.operator !== "<="))
1218
+ if (v === 0 && (p.operator !== ">=" || E.operator !== "<="))
1219
1219
  return null;
1220
1220
  }
1221
- for (const P of m) {
1222
- if (p && !n(P, String(p), h) || v && !n(P, String(v), h))
1221
+ for (const P of w) {
1222
+ if (p && !s(P, String(p), d) || E && !s(P, String(E), d))
1223
1223
  return null;
1224
- for (const H of u)
1225
- if (!n(P, String(H), h))
1224
+ for (const H of f)
1225
+ if (!s(P, String(H), d))
1226
1226
  return !1;
1227
1227
  return !0;
1228
1228
  }
1229
- let N, I, F, b, T = v && !h.includePrerelease && v.semver.prerelease.length ? v.semver : !1, D = p && !h.includePrerelease && p.semver.prerelease.length ? p.semver : !1;
1230
- T && T.prerelease.length === 1 && v.operator === "<" && T.prerelease[0] === 0 && (T = !1);
1231
- for (const P of u) {
1229
+ let N, I, F, b, T = E && !d.includePrerelease && E.semver.prerelease.length ? E.semver : !1, D = p && !d.includePrerelease && p.semver.prerelease.length ? p.semver : !1;
1230
+ T && T.prerelease.length === 1 && E.operator === "<" && T.prerelease[0] === 0 && (T = !1);
1231
+ for (const P of f) {
1232
1232
  if (b = b || P.operator === ">" || P.operator === ">=", F = F || P.operator === "<" || P.operator === "<=", p) {
1233
1233
  if (D && P.semver.prerelease && P.semver.prerelease.length && P.semver.major === D.major && P.semver.minor === D.minor && P.semver.patch === D.patch && (D = !1), P.operator === ">" || P.operator === ">=") {
1234
- if (N = f(p, P, h), N === P && N !== p)
1234
+ if (N = i(p, P, d), N === P && N !== p)
1235
1235
  return !1;
1236
- } else if (p.operator === ">=" && !n(p.semver, String(P), h))
1236
+ } else if (p.operator === ">=" && !s(p.semver, String(P), d))
1237
1237
  return !1;
1238
1238
  }
1239
- if (v) {
1239
+ if (E) {
1240
1240
  if (T && P.semver.prerelease && P.semver.prerelease.length && P.semver.major === T.major && P.semver.minor === T.minor && P.semver.patch === T.patch && (T = !1), P.operator === "<" || P.operator === "<=") {
1241
- if (I = s(v, P, h), I === P && I !== v)
1241
+ if (I = n(E, P, d), I === P && I !== E)
1242
1242
  return !1;
1243
- } else if (v.operator === "<=" && !n(v.semver, String(P), h))
1243
+ } else if (E.operator === "<=" && !s(E.semver, String(P), d))
1244
1244
  return !1;
1245
1245
  }
1246
- if (!P.operator && (v || p) && $ !== 0)
1246
+ if (!P.operator && (E || p) && v !== 0)
1247
1247
  return !1;
1248
1248
  }
1249
- return !(p && F && !v && $ !== 0 || v && b && !p && $ !== 0 || D || T);
1250
- }, f = (o, u, h) => {
1251
- if (!o)
1252
- return u;
1253
- const m = a(o.semver, u.semver, h);
1254
- return m > 0 ? o : m < 0 || u.operator === ">" && o.operator === ">=" ? u : o;
1255
- }, s = (o, u, h) => {
1256
- if (!o)
1257
- return u;
1258
- const m = a(o.semver, u.semver, h);
1259
- return m < 0 ? o : m > 0 || u.operator === "<" && o.operator === "<=" ? u : o;
1249
+ return !(p && F && !E && v !== 0 || E && b && !p && v !== 0 || D || T);
1250
+ }, i = (l, f, d) => {
1251
+ if (!l)
1252
+ return f;
1253
+ const w = a(l.semver, f.semver, d);
1254
+ return w > 0 ? l : w < 0 || f.operator === ">" && l.operator === ">=" ? f : l;
1255
+ }, n = (l, f, d) => {
1256
+ if (!l)
1257
+ return f;
1258
+ const w = a(l.semver, f.semver, d);
1259
+ return w < 0 ? l : w > 0 || f.operator === "<" && l.operator === "<=" ? f : l;
1260
1260
  };
1261
- return ht = l, ht;
1261
+ return ht = u, ht;
1262
1262
  }
1263
1263
  var pt, Fr;
1264
1264
  function an() {
1265
1265
  if (Fr) return pt;
1266
1266
  Fr = 1;
1267
- const t = ee(), e = pe(), r = j(), n = Hr(), a = W(), l = qs(), c = Ds(), d = Bs(), i = _s(), f = js(), s = Gs(), o = xs(), u = Us(), h = G(), m = Vs(), p = Ms(), v = At(), $ = zs(), N = Xs(), I = ge(), F = Ft(), b = Yr(), T = Kr(), D = bt(), P = qt(), H = Zr(), $e = Js(), Re = me(), we = x(), Se = Ee(), E = Hs(), g = Ys(), S = Ks(), R = Zs(), y = Qs(), w = Dt(), O = en(), C = tn(), k = rn(), A = sn(), _ = nn();
1267
+ const t = ee(), e = pe(), r = j(), s = Hr(), a = W(), u = qs(), c = Ds(), h = Bs(), o = _s(), i = js(), n = Gs(), l = xs(), f = Us(), d = G(), w = Vs(), p = Ms(), E = At(), v = zs(), N = Xs(), I = ge(), F = Ft(), b = Yr(), T = Kr(), D = bt(), P = qt(), H = Zr(), $e = Js(), Re = me(), we = x(), Se = Ee(), m = Hs(), g = Ys(), S = Ks(), $ = Zs(), y = Qs(), R = Dt(), O = en(), C = tn(), k = rn(), A = sn(), _ = nn();
1268
1268
  return pt = {
1269
1269
  parse: a,
1270
- valid: l,
1270
+ valid: u,
1271
1271
  clean: c,
1272
- inc: d,
1273
- diff: i,
1274
- major: f,
1275
- minor: s,
1276
- patch: o,
1277
- prerelease: u,
1278
- compare: h,
1279
- rcompare: m,
1272
+ inc: h,
1273
+ diff: o,
1274
+ major: i,
1275
+ minor: n,
1276
+ patch: l,
1277
+ prerelease: f,
1278
+ compare: d,
1279
+ rcompare: w,
1280
1280
  compareLoose: p,
1281
- compareBuild: v,
1282
- sort: $,
1281
+ compareBuild: E,
1282
+ sort: v,
1283
1283
  rsort: N,
1284
1284
  gt: I,
1285
1285
  lt: F,
@@ -1292,12 +1292,12 @@ function an() {
1292
1292
  Comparator: Re,
1293
1293
  Range: we,
1294
1294
  satisfies: Se,
1295
- toComparators: E,
1295
+ toComparators: m,
1296
1296
  maxSatisfying: g,
1297
1297
  minSatisfying: S,
1298
- minVersion: R,
1298
+ minVersion: $,
1299
1299
  validRange: y,
1300
- outside: w,
1300
+ outside: R,
1301
1301
  gtr: O,
1302
1302
  ltr: C,
1303
1303
  intersects: k,
@@ -1309,8 +1309,8 @@ function an() {
1309
1309
  tokens: t.t,
1310
1310
  SEMVER_SPEC_VERSION: e.SEMVER_SPEC_VERSION,
1311
1311
  RELEASE_TYPES: e.RELEASE_TYPES,
1312
- compareIdentifiers: n.compareIdentifiers,
1313
- rcompareIdentifiers: n.rcompareIdentifiers
1312
+ compareIdentifiers: s.compareIdentifiers,
1313
+ rcompareIdentifiers: s.rcompareIdentifiers
1314
1314
  }, pt;
1315
1315
  }
1316
1316
  var Qr = an();
@@ -1366,7 +1366,7 @@ function ts(t) {
1366
1366
  });
1367
1367
  return e.transform((r) => r.allVersionsWithChannels ? r : {
1368
1368
  ...r,
1369
- allVersionsWithChannels: r.allVersions.map((n) => ({ version: n, channels: [] }))
1369
+ allVersionsWithChannels: r.allVersions.map((s) => ({ version: s, channels: [] }))
1370
1370
  }).transform(
1371
1371
  (r) => r.latestByChannel[oe] ? r : {
1372
1372
  ...r,
@@ -1422,100 +1422,100 @@ class ti {
1422
1422
  }
1423
1423
  async updateRegistry(e = "normal") {
1424
1424
  this.logger.info("Initiating registry refresh...");
1425
- const r = /* @__PURE__ */ new Map(), n = [], a = await this.storage.listFiles(It), l = ({ organization: f, name: s, version: o }) => {
1426
- const u = `${f}:${s}`;
1427
- let h = r.get(u);
1428
- if (h) {
1429
- if (!h.versions.has(o))
1430
- return h.versions.add(o), !0;
1431
- } else return r.set(u, {
1432
- package: { organization: f, name: s },
1433
- versions: /* @__PURE__ */ new Set([o])
1425
+ const r = /* @__PURE__ */ new Map(), s = [], a = await this.storage.listFiles(It), u = ({ organization: i, name: n, version: l }) => {
1426
+ const f = `${i}:${n}`;
1427
+ let d = r.get(f);
1428
+ if (d) {
1429
+ if (!d.versions.has(l))
1430
+ return d.versions.add(l), !0;
1431
+ } else return r.set(f, {
1432
+ package: { organization: i, name: n },
1433
+ versions: /* @__PURE__ */ new Set([l])
1434
1434
  }), !0;
1435
1435
  return !1;
1436
1436
  };
1437
1437
  this.logger.info("Packages to be updated:");
1438
- for (const f of a) {
1439
- const s = f.match(ln);
1440
- if (!s) continue;
1441
- n.push(f);
1442
- const { organization: o, name: u, version: h, seed: m } = s.groups, p = l({ organization: o, name: u, version: h });
1443
- this.logger.info(` - ${o}:${u}:${h} added:${p}`);
1438
+ for (const i of a) {
1439
+ const n = i.match(ln);
1440
+ if (!n) continue;
1441
+ s.push(i);
1442
+ const { organization: l, name: f, version: d, seed: w } = n.groups, p = u({ organization: l, name: f, version: d });
1443
+ this.logger.info(` - ${l}:${f}:${d} added:${p}`);
1444
1444
  }
1445
1445
  if (e === "force") {
1446
- const f = await this.storage.listFiles(te);
1447
- for (const s of f) {
1448
- const o = s.match(En);
1449
- if (!o) continue;
1450
- const { organization: u, name: h, version: m } = o.groups, p = l({ organization: u, name: h, version: m });
1451
- this.logger.info(` - ${u}:${h}:${m} force_added:${p}`);
1446
+ const i = await this.storage.listFiles(te);
1447
+ for (const n of i) {
1448
+ const l = n.match(En);
1449
+ if (!l) continue;
1450
+ const { organization: f, name: d, version: w } = l.groups, p = u({ organization: f, name: d, version: w });
1451
+ this.logger.info(` - ${f}:${d}:${w} force_added:${p}`);
1452
1452
  }
1453
1453
  }
1454
1454
  const c = await this.storage.getFile(mt);
1455
- let i = (c === void 0 ? { packages: [] } : Br.parse(JSON.parse(c.toString()))).packages;
1456
- this.logger.info(`Global overview loaded, ${i.length} records`);
1457
- for (const [, f] of r.entries()) {
1458
- const s = Dr(f.package), o = await this.storage.getFile(s), u = o === void 0 ? { versions: [] } : qr.parse(JSON.parse(o.toString()));
1455
+ let o = (c === void 0 ? { packages: [] } : Br.parse(JSON.parse(c.toString()))).packages;
1456
+ this.logger.info(`Global overview loaded, ${o.length} records`);
1457
+ for (const [, i] of r.entries()) {
1458
+ const n = Dr(i.package), l = await this.storage.getFile(n), f = l === void 0 ? { versions: [] } : qr.parse(JSON.parse(l.toString()));
1459
1459
  this.logger.info(
1460
- `Updating ${f.package.organization}:${f.package.name} overview, ${u.versions.length} records`
1460
+ `Updating ${i.package.organization}:${i.package.name} overview, ${f.versions.length} records`
1461
1461
  );
1462
- const h = u.versions.filter(
1463
- (v) => !f.versions.has(v.description.id.version)
1462
+ const d = f.versions.filter(
1463
+ (E) => !i.versions.has(E.description.id.version)
1464
1464
  );
1465
- for (const [v] of f.versions.entries()) {
1466
- const $ = v.toString(), N = {
1467
- ...f.package,
1468
- version: $
1465
+ for (const [E] of i.versions.entries()) {
1466
+ const v = E.toString(), N = {
1467
+ ...i.package,
1468
+ version: v
1469
1469
  }, I = await this.storage.getFile(
1470
1470
  ne(N) + hn
1471
1471
  );
1472
1472
  if (!I) continue;
1473
1473
  const F = await St(I), b = (await this.storage.listFiles(mn(N))).filter((T) => T.match(gt) ? !0 : (this.logger.warn(`Unexpected channel in ${ye(N)}: ${T}`), !1));
1474
- h.push({
1475
- description: Ut($).parse(
1474
+ d.push({
1475
+ description: Ut(v).parse(
1476
1476
  xr.parse(JSON.parse(I.toString("utf8"))).description
1477
1477
  ),
1478
1478
  manifestSha256: F,
1479
1479
  channels: b
1480
1480
  });
1481
1481
  }
1482
- h.sort(
1483
- (v, $) => Qr.compare($.description.id.version, v.description.id.version)
1482
+ d.sort(
1483
+ (E, v) => Qr.compare(v.description.id.version, E.description.id.version)
1484
1484
  ), e !== "dry-run" && await this.storage.putFile(
1485
- s,
1485
+ n,
1486
1486
  Buffer.from(
1487
- JSON.stringify({ schema: "v2", versions: h })
1487
+ JSON.stringify({ schema: "v2", versions: d })
1488
1488
  )
1489
- ), this.logger.info(`Done (${h.length} records)`);
1490
- const m = /* @__PURE__ */ new Set();
1491
- for (const v of h) for (const $ of v.channels) m.add($);
1492
- i = i.filter(
1493
- (v) => v.id.organization !== f.package.organization || v.id.name !== f.package.name
1489
+ ), this.logger.info(`Done (${d.length} records)`);
1490
+ const w = /* @__PURE__ */ new Set();
1491
+ for (const E of d) for (const v of E.channels) w.add(v);
1492
+ o = o.filter(
1493
+ (E) => E.id.organization !== i.package.organization || E.id.name !== i.package.name
1494
1494
  );
1495
1495
  const p = Ut(
1496
- `${f.package.organization}/${f.package.name}`
1496
+ `${i.package.organization}/${i.package.name}`
1497
1497
  );
1498
- i.push({
1498
+ o.push({
1499
1499
  id: {
1500
- organization: f.package.organization,
1501
- name: f.package.name
1500
+ organization: i.package.organization,
1501
+ name: i.package.name
1502
1502
  },
1503
1503
  // left for backward compatibility
1504
- allVersions: h.map((v) => v.description.id.version).reverse(),
1505
- allVersionsWithChannels: h.map((v) => ({ version: v.description.id.version, channels: v.channels })).reverse(),
1504
+ allVersions: d.map((E) => E.description.id.version).reverse(),
1505
+ allVersionsWithChannels: d.map((E) => ({ version: E.description.id.version, channels: E.channels })).reverse(),
1506
1506
  // left for backward compatibility
1507
- latest: p.parse(h[0].description),
1507
+ latest: p.parse(d[0].description),
1508
1508
  // left for backward compatibility
1509
- latestManifestSha256: h[0].manifestSha256,
1509
+ latestManifestSha256: d[0].manifestSha256,
1510
1510
  latestByChannel: Object.fromEntries(
1511
- [...m, oe].map((v) => {
1512
- const $ = h.find((N) => v === oe || N.channels.indexOf(v) !== -1);
1513
- if (!$) throw new Error("Assertion error");
1511
+ [...w, oe].map((E) => {
1512
+ const v = d.find((N) => E === oe || N.channels.indexOf(E) !== -1);
1513
+ if (!v) throw new Error("Assertion error");
1514
1514
  return [
1515
- v,
1515
+ E,
1516
1516
  {
1517
- description: p.parse($.description),
1518
- manifestSha256: $ == null ? void 0 : $.manifestSha256
1517
+ description: p.parse(v.description),
1518
+ manifestSha256: v == null ? void 0 : v.manifestSha256
1519
1519
  }
1520
1520
  ];
1521
1521
  })
@@ -1525,18 +1525,18 @@ class ti {
1525
1525
  e !== "dry-run" && await this.storage.putFile(
1526
1526
  mt,
1527
1527
  Buffer.from(
1528
- JSON.stringify({ schema: "v2", packages: i })
1528
+ JSON.stringify({ schema: "v2", packages: o })
1529
1529
  )
1530
- ), this.logger.info(`Global overview updated (${i.length} records)`), e !== "dry-run" && await this.storage.deleteFiles(...n.map((f) => `${It}${f}`)), this.logger.info("Version update requests cleared");
1530
+ ), this.logger.info(`Global overview updated (${o.length} records)`), e !== "dry-run" && await this.storage.deleteFiles(...s.map((i) => `${It}${i}`)), this.logger.info("Version update requests cleared");
1531
1531
  }
1532
1532
  async updateIfNeeded(e = "normal") {
1533
1533
  this.logger.info("Checking if registry requires refresh...");
1534
- const r = await this.storage.getFile(dt), n = await this.storage.getFile(br);
1535
- if (e !== "force" && r === void 0 && n === void 0) {
1534
+ const r = await this.storage.getFile(dt), s = await this.storage.getFile(br);
1535
+ if (e !== "force" && r === void 0 && s === void 0) {
1536
1536
  this.logger.info("No global seed files found, update not needed.");
1537
1537
  return;
1538
1538
  }
1539
- if (e !== "force" && r !== void 0 && n !== void 0 && r.equals(n)) {
1539
+ if (e !== "force" && r !== void 0 && s !== void 0 && r.equals(s)) {
1540
1540
  this.logger.info("Registry is up to date.");
1541
1541
  return;
1542
1542
  }
@@ -1553,48 +1553,48 @@ class ti {
1553
1553
  return Br.parse(JSON.parse(e.toString()));
1554
1554
  }
1555
1555
  async marchChanged(e) {
1556
- const r = zr(), n = cn(e, r);
1557
- this.logger.info(`Creating update seed at ${n} ...`), await this.storage.putFile(n, Buffer.from(r)), this.logger.info(`Touching global update seed ${dt} ...`), await this.storage.putFile(dt, Buffer.from(r));
1556
+ const r = zr(), s = cn(e, r);
1557
+ this.logger.info(`Creating update seed at ${s} ...`), await this.storage.putFile(s, Buffer.from(r)), this.logger.info(`Touching global update seed ${dt} ...`), await this.storage.putFile(dt, Buffer.from(r));
1558
1558
  }
1559
1559
  async addPackageToChannel(e, r) {
1560
1560
  if (!r.match(gt))
1561
1561
  throw new Error(`Illegal characters in channel name: ${r}`);
1562
- const n = ne(e);
1563
- if (await this.storage.getFile(`${n}/${ie}`) === void 0)
1562
+ const s = ne(e);
1563
+ if (await this.storage.getFile(`${s}/${ie}`) === void 0)
1564
1564
  throw new Error(`Package ${ye(e)} not found in the registry.`);
1565
- await this.storage.putFile(`${n}/${Ot}/${r}`, Buffer.from(r)), await this.marchChanged(e);
1565
+ await this.storage.putFile(`${s}/${Ot}/${r}`, Buffer.from(r)), await this.marchChanged(e);
1566
1566
  }
1567
1567
  async removePackageFromChannel(e, r) {
1568
1568
  if (!r.match(gt))
1569
1569
  throw new Error(`Illegal characters in channel name: ${r}`);
1570
- const n = ne(e);
1571
- if (await this.storage.getFile(`${n}/${ie}`) === void 0)
1570
+ const s = ne(e);
1571
+ if (await this.storage.getFile(`${s}/${ie}`) === void 0)
1572
1572
  throw new Error(`Package ${ye(e)} not found in the registry.`);
1573
- await this.storage.deleteFiles(`${n}/${Ot}/${r}`), await this.marchChanged(e);
1573
+ await this.storage.deleteFiles(`${s}/${Ot}/${r}`), await this.marchChanged(e);
1574
1574
  }
1575
1575
  async publishPackage(e, r) {
1576
- const n = ne(e.description.id);
1577
- for (const l of e.files) {
1578
- const c = await r(l.name);
1579
- if (c.length !== l.size)
1576
+ const s = ne(e.description.id);
1577
+ for (const u of e.files) {
1578
+ const c = await r(u.name);
1579
+ if (c.length !== u.size)
1580
1580
  throw new Error(
1581
- `Actual file size don't match file size from the manifest file for ${l.name} (actual = ${c.length}; manifest = ${l.size})`
1581
+ `Actual file size don't match file size from the manifest file for ${u.name} (actual = ${c.length}; manifest = ${u.size})`
1582
1582
  );
1583
- const d = await St(c);
1584
- if (d !== l.sha256.toUpperCase())
1583
+ const h = await St(c);
1584
+ if (h !== u.sha256.toUpperCase())
1585
1585
  throw new Error(
1586
- `Actual file SHA-256 don't match the checksum from the manifest file for ${l.name} (actual = ${d}; manifest = ${l.sha256.toUpperCase()})`
1586
+ `Actual file SHA-256 don't match the checksum from the manifest file for ${u.name} (actual = ${h}; manifest = ${u.sha256.toUpperCase()})`
1587
1587
  );
1588
- const i = n + "/" + l.name;
1589
- this.logger.info(`Uploading ${l.name} -> ${i} ...`), await this.storage.putFile(i, c);
1588
+ const o = s + "/" + u.name;
1589
+ this.logger.info(`Uploading ${u.name} -> ${o} ...`), await this.storage.putFile(o, c);
1590
1590
  }
1591
- const a = n + "/" + ie;
1591
+ const a = s + "/" + ie;
1592
1592
  this.logger.info(`Uploading manifest to ${a} ...`), await this.storage.putFile(a, Buffer.from(JSON.stringify(e))), await this.marchChanged(e.description.id);
1593
1593
  }
1594
1594
  }
1595
1595
  class vn {
1596
- constructor(e, r, n) {
1597
- this.client = e, this.bucket = r, this.root = n;
1596
+ constructor(e, r, s) {
1597
+ this.client = e, this.bucket = r, this.root = s;
1598
1598
  }
1599
1599
  async getFile(e) {
1600
1600
  try {
@@ -1610,15 +1610,15 @@ class vn {
1610
1610
  }
1611
1611
  }
1612
1612
  async listFiles(e) {
1613
- const r = U.join(this.root, e), n = Rs(
1613
+ const r = U.join(this.root, e), s = Rs(
1614
1614
  { client: this.client },
1615
1615
  {
1616
1616
  Bucket: this.bucket,
1617
1617
  Prefix: r
1618
1618
  }
1619
1619
  ), a = [];
1620
- for await (const l of n)
1621
- a.push(...(l.Contents ?? []).map((c) => U.relative(r, c.Key)));
1620
+ for await (const u of s)
1621
+ a.push(...(u.Contents ?? []).map((c) => U.relative(r, c.Key)));
1622
1622
  return a;
1623
1623
  }
1624
1624
  async putFile(e, r) {
@@ -1632,8 +1632,8 @@ class vn {
1632
1632
  const r = await this.client.deleteObjects({
1633
1633
  Bucket: this.bucket,
1634
1634
  Delete: {
1635
- Objects: e.map((n) => ({
1636
- Key: U.join(this.root, n)
1635
+ Objects: e.map((s) => ({
1636
+ Key: U.join(this.root, s)
1637
1637
  }))
1638
1638
  }
1639
1639
  });
@@ -1663,8 +1663,8 @@ class $n {
1663
1663
  async listFiles(e) {
1664
1664
  try {
1665
1665
  const r = this.toAbsolutePath(e);
1666
- return (await K.promises.readdir(r, { recursive: !0, withFileTypes: !0 })).filter((n) => n.isFile()).map(
1667
- (n) => B.relative(r, B.resolve(n.path, n.name)).split(B.sep).join(U.sep)
1666
+ return (await K.promises.readdir(r, { recursive: !0, withFileTypes: !0 })).filter((s) => s.isFile()).map(
1667
+ (s) => B.relative(r, B.resolve(s.path, s.name)).split(B.sep).join(U.sep)
1668
1668
  );
1669
1669
  } catch (r) {
1670
1670
  if (r.code == "ENOENT") return [];
@@ -1672,8 +1672,8 @@ class $n {
1672
1672
  }
1673
1673
  }
1674
1674
  async putFile(e, r) {
1675
- const n = this.toAbsolutePath(e);
1676
- await K.promises.mkdir(B.dirname(n), { recursive: !0 }), await K.promises.writeFile(n, r);
1675
+ const s = this.toAbsolutePath(e);
1676
+ await K.promises.mkdir(B.dirname(s), { recursive: !0 }), await K.promises.writeFile(s, r);
1677
1677
  }
1678
1678
  async deleteFiles(...e) {
1679
1679
  for (const r of e) await K.promises.rm(this.toAbsolutePath(r));
@@ -1686,10 +1686,10 @@ function Rn(t) {
1686
1686
  const r = B.resolve(e.pathname);
1687
1687
  return new $n(r);
1688
1688
  case "s3:":
1689
- const n = {}, a = e.searchParams.get("region");
1690
- a && (n.region = a);
1691
- const l = e.hostname;
1692
- return new vn(new $s(n), l, e.pathname.replace(/^\//, ""));
1689
+ const s = {}, a = e.searchParams.get("region");
1690
+ a && (s.region = a);
1691
+ const u = e.hostname;
1692
+ return new vn(new $s(s), u, e.pathname.replace(/^\//, ""));
1693
1693
  default:
1694
1694
  throw new Error(`Unknown protocol: ${e.protocol}`);
1695
1695
  }
@@ -1731,59 +1731,59 @@ class kn {
1731
1731
  return new Ln(this.storage, e);
1732
1732
  }
1733
1733
  async updateRegistry() {
1734
- var c, d, i, f, s, o, u, h;
1734
+ var c, h, o, i, n, l, f, d;
1735
1735
  (c = this.logger) == null || c.info("Initiating registry refresh...");
1736
- const e = /* @__PURE__ */ new Map(), r = [], n = await this.storage.listFiles(Pt);
1737
- (d = this.logger) == null || d.info("Packages to be updated:");
1738
- for (const m of n) {
1739
- const p = m.match(Nn);
1736
+ const e = /* @__PURE__ */ new Map(), r = [], s = await this.storage.listFiles(Pt);
1737
+ (h = this.logger) == null || h.info("Packages to be updated:");
1738
+ for (const w of s) {
1739
+ const p = w.match(Nn);
1740
1740
  if (!p) continue;
1741
- r.push(m);
1742
- const { packageKeyWithoutVersion: v, organization: $, pkg: N, version: I, seed: F } = p.groups;
1743
- let b = e.get(v);
1744
- b ? b.versions.has(I) || b.versions.add(I) : e.set(v, {
1745
- package: { organization: $, package: N },
1741
+ r.push(w);
1742
+ const { packageKeyWithoutVersion: E, organization: v, pkg: N, version: I, seed: F } = p.groups;
1743
+ let b = e.get(E);
1744
+ b ? b.versions.has(I) || b.versions.add(I) : e.set(E, {
1745
+ package: { organization: v, package: N },
1746
1746
  versions: /* @__PURE__ */ new Set([I])
1747
- }), (i = this.logger) == null || i.info(` - ${$}:${N}:${I}`);
1747
+ }), (o = this.logger) == null || o.info(` - ${v}:${N}:${I}`);
1748
1748
  }
1749
1749
  const a = await this.storage.getFile(Et);
1750
- let l = a === void 0 ? [] : JSON.parse(a.toString());
1751
- (f = this.logger) == null || f.info(`Global overview loaded, ${l.length} records`);
1752
- for (const [, m] of e.entries()) {
1753
- const p = _r(m.package), v = await this.storage.getFile(p);
1754
- let $ = v === void 0 ? [] : JSON.parse(v.toString());
1755
- (s = this.logger) == null || s.info(
1756
- `Updating ${m.package.organization}:${m.package.package} overview, ${$.length} records`
1757
- ), $ = $.filter((N) => !m.versions.has(N.version));
1758
- for (const [N] of m.versions.entries()) {
1750
+ let u = a === void 0 ? [] : JSON.parse(a.toString());
1751
+ (i = this.logger) == null || i.info(`Global overview loaded, ${u.length} records`);
1752
+ for (const [, w] of e.entries()) {
1753
+ const p = _r(w.package), E = await this.storage.getFile(p);
1754
+ let v = E === void 0 ? [] : JSON.parse(E.toString());
1755
+ (n = this.logger) == null || n.info(
1756
+ `Updating ${w.package.organization}:${w.package.package} overview, ${v.length} records`
1757
+ ), v = v.filter((N) => !w.versions.has(N.version));
1758
+ for (const [N] of w.versions.entries()) {
1759
1759
  const I = N.toString(), F = await this.storage.getFile(
1760
1760
  ss(
1761
1761
  {
1762
- ...m.package,
1762
+ ...w.package,
1763
1763
  version: I
1764
1764
  },
1765
1765
  ns
1766
1766
  )
1767
1767
  );
1768
- F && $.push({ version: I, meta: JSON.parse(F.toString()) });
1768
+ F && v.push({ version: I, meta: JSON.parse(F.toString()) });
1769
1769
  }
1770
- $.sort((N, I) => on.compare(I.version, N.version)), await this.storage.putFile(p, Buffer.from(JSON.stringify($))), (o = this.logger) == null || o.info(`Done (${$.length} records)`), l = l.filter(
1771
- (N) => N.organization !== m.package.organization || N.package !== m.package.package
1772
- ), l.push({
1773
- organization: m.package.organization,
1774
- package: m.package.package,
1775
- allVersions: $.map((N) => N.version).reverse(),
1776
- latestVersion: $[0].version,
1777
- latestMeta: $[0].meta
1770
+ v.sort((N, I) => on.compare(I.version, N.version)), await this.storage.putFile(p, Buffer.from(JSON.stringify(v))), (l = this.logger) == null || l.info(`Done (${v.length} records)`), u = u.filter(
1771
+ (N) => N.organization !== w.package.organization || N.package !== w.package.package
1772
+ ), u.push({
1773
+ organization: w.package.organization,
1774
+ package: w.package.package,
1775
+ allVersions: v.map((N) => N.version).reverse(),
1776
+ latestVersion: v[0].version,
1777
+ latestMeta: v[0].meta
1778
1778
  });
1779
1779
  }
1780
- await this.storage.putFile(Et, Buffer.from(JSON.stringify(l))), (u = this.logger) == null || u.info(`Global overview updated (${l.length} records)`), await this.storage.deleteFiles(...r.map((m) => `${Pt}${m}`)), (h = this.logger) == null || h.info("Version update requests cleared");
1780
+ await this.storage.putFile(Et, Buffer.from(JSON.stringify(u))), (f = this.logger) == null || f.info(`Global overview updated (${u.length} records)`), await this.storage.deleteFiles(...r.map((w) => `${Pt}${w}`)), (d = this.logger) == null || d.info("Version update requests cleared");
1781
1781
  }
1782
1782
  async updateIfNeeded(e = !1) {
1783
- var a, l;
1783
+ var a, u;
1784
1784
  (a = this.logger) == null || a.info("Checking if registry requires refresh...");
1785
- const r = await this.storage.getFile(is), n = await this.storage.getFile(jr);
1786
- !e && r === void 0 && n === void 0 || !e && r !== void 0 && n !== void 0 && r.equals(n) || (await this.updateRegistry(), r && (await this.storage.putFile(jr, r), (l = this.logger) == null || l.info("Refresh finished")));
1785
+ const r = await this.storage.getFile(is), s = await this.storage.getFile(jr);
1786
+ !e && r === void 0 && s === void 0 || !e && r !== void 0 && s !== void 0 && r.equals(s) || (await this.updateRegistry(), r && (await this.storage.putFile(jr, r), (u = this.logger) == null || u.info("Refresh finished")));
1787
1787
  }
1788
1788
  async getPackageOverview(e) {
1789
1789
  const r = await this.storage.getFile(_r(e));
@@ -1838,9 +1838,9 @@ class Tn {
1838
1838
  createRegistry(e) {
1839
1839
  let r = this.conf.registry;
1840
1840
  if (!r.startsWith("file:") && !r.startsWith("s3:")) {
1841
- const n = this.conf.registries[r];
1842
- if (!n) throw new Error(`Registry with alias "${r}" not found`);
1843
- r = n;
1841
+ const s = this.conf.registries[r];
1842
+ if (!s) throw new Error(`Registry with alias "${r}" not found`);
1843
+ r = s;
1844
1844
  }
1845
1845
  return new kn(Rn(r), e);
1846
1846
  }
@@ -1932,4 +1932,4 @@ export {
1932
1932
  _r as y,
1933
1933
  ss as z
1934
1934
  };
1935
- //# sourceMappingURL=config-DrI3vxIZ.mjs.map
1935
+ //# sourceMappingURL=config-7hVPHpfZ.mjs.map