@angular/core 19.0.0-next.6 → 19.0.0-next.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.
Files changed (37) hide show
  1. package/LICENSE +21 -0
  2. package/fesm2022/core.mjs +648 -273
  3. package/fesm2022/core.mjs.map +1 -1
  4. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  5. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  6. package/fesm2022/primitives/signals.mjs +1 -1
  7. package/fesm2022/primitives/signals.mjs.map +1 -1
  8. package/fesm2022/rxjs-interop.mjs +25 -4
  9. package/fesm2022/rxjs-interop.mjs.map +1 -1
  10. package/fesm2022/testing.mjs +12 -11
  11. package/fesm2022/testing.mjs.map +1 -1
  12. package/index.d.ts +232 -148
  13. package/package.json +1 -1
  14. package/primitives/event-dispatch/index.d.ts +1 -1
  15. package/primitives/signals/index.d.ts +1 -1
  16. package/rxjs-interop/index.d.ts +3 -1
  17. package/schematics/bundles/{checker-dcf9a14e.js → checker-e68dd7ce.js} +34 -13
  18. package/schematics/bundles/{compiler_host-6026cdf8.js → compiler_host-9a4d0c2b.js} +2 -2
  19. package/schematics/bundles/control-flow-migration.js +3 -3
  20. package/schematics/bundles/explicit-standalone-flag.js +5 -5
  21. package/schematics/bundles/group_replacements-472b2387.js +31445 -0
  22. package/schematics/bundles/{imports-44987700.js → imports-4ac08251.js} +1 -1
  23. package/schematics/bundles/inject-migration.js +28 -32
  24. package/schematics/bundles/leading_space-d190b83b.js +30 -0
  25. package/schematics/bundles/{nodes-b12e919a.js → nodes-0e7d45ca.js} +2 -2
  26. package/schematics/bundles/pending-tasks.js +103 -0
  27. package/schematics/bundles/{program-4dc8c0fa.js → program-105283c5.js} +1865 -1489
  28. package/schematics/bundles/{project_tsconfig_paths-6c9cde78.js → project_tsconfig_paths-e9ccccbf.js} +1 -1
  29. package/schematics/bundles/route-lazy-loading.js +4 -4
  30. package/schematics/bundles/signal-input-migration.js +706 -31790
  31. package/schematics/bundles/signal-queries-migration.js +905 -0
  32. package/schematics/bundles/standalone-migration.js +12 -12
  33. package/schematics/collection.json +6 -0
  34. package/schematics/migrations.json +5 -0
  35. package/schematics/ng-generate/signal-input-migration/schema.json +5 -0
  36. package/schematics/ng-generate/signal-queries-migration/schema.json +19 -0
  37. package/testing/index.d.ts +3 -1
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.0.0-next.6
3
+ * @license Angular v19.0.0-next.8
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- var checker = require('./checker-dcf9a14e.js');
9
+ var checker = require('./checker-e68dd7ce.js');
10
10
  var ts = require('typescript');
11
11
  var p = require('path');
12
12
  require('os');
@@ -864,7 +864,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
864
864
  function compileDeclareClassMetadata(metadata) {
865
865
  const definitionMap = new checker.DefinitionMap();
866
866
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
867
- definitionMap.set('version', checker.literal('19.0.0-next.6'));
867
+ definitionMap.set('version', checker.literal('19.0.0-next.8'));
868
868
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
869
869
  definitionMap.set('type', metadata.type);
870
870
  definitionMap.set('decorators', metadata.decorators);
@@ -882,7 +882,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
882
882
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? checker.literal(null));
883
883
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? checker.literal(null));
884
884
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
885
- definitionMap.set('version', checker.literal('19.0.0-next.6'));
885
+ definitionMap.set('version', checker.literal('19.0.0-next.8'));
886
886
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
887
887
  definitionMap.set('type', metadata.type);
888
888
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -977,7 +977,7 @@ function createDirectiveDefinitionMap(meta) {
977
977
  const definitionMap = new checker.DefinitionMap();
978
978
  const minVersion = getMinimumVersionForPartialOutput(meta);
979
979
  definitionMap.set('minVersion', checker.literal(minVersion));
980
- definitionMap.set('version', checker.literal('19.0.0-next.6'));
980
+ definitionMap.set('version', checker.literal('19.0.0-next.8'));
981
981
  // e.g. `type: MyDirective`
982
982
  definitionMap.set('type', meta.type.value);
983
983
  if (meta.isStandalone) {
@@ -1396,7 +1396,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
1396
1396
  function compileDeclareFactoryFunction(meta) {
1397
1397
  const definitionMap = new checker.DefinitionMap();
1398
1398
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
1399
- definitionMap.set('version', checker.literal('19.0.0-next.6'));
1399
+ definitionMap.set('version', checker.literal('19.0.0-next.8'));
1400
1400
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
1401
1401
  definitionMap.set('type', meta.type.value);
1402
1402
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -1431,7 +1431,7 @@ function compileDeclareInjectableFromMetadata(meta) {
1431
1431
  function createInjectableDefinitionMap(meta) {
1432
1432
  const definitionMap = new checker.DefinitionMap();
1433
1433
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
1434
- definitionMap.set('version', checker.literal('19.0.0-next.6'));
1434
+ definitionMap.set('version', checker.literal('19.0.0-next.8'));
1435
1435
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
1436
1436
  definitionMap.set('type', meta.type.value);
1437
1437
  // Only generate providedIn property if it has a non-null value
@@ -1482,7 +1482,7 @@ function compileDeclareInjectorFromMetadata(meta) {
1482
1482
  function createInjectorDefinitionMap(meta) {
1483
1483
  const definitionMap = new checker.DefinitionMap();
1484
1484
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
1485
- definitionMap.set('version', checker.literal('19.0.0-next.6'));
1485
+ definitionMap.set('version', checker.literal('19.0.0-next.8'));
1486
1486
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
1487
1487
  definitionMap.set('type', meta.type.value);
1488
1488
  definitionMap.set('providers', meta.providers);
@@ -1515,7 +1515,7 @@ function createNgModuleDefinitionMap(meta) {
1515
1515
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
1516
1516
  }
1517
1517
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
1518
- definitionMap.set('version', checker.literal('19.0.0-next.6'));
1518
+ definitionMap.set('version', checker.literal('19.0.0-next.8'));
1519
1519
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
1520
1520
  definitionMap.set('type', meta.type.value);
1521
1521
  // We only generate the keys in the metadata if the arrays contain values.
@@ -1566,7 +1566,7 @@ function compileDeclarePipeFromMetadata(meta) {
1566
1566
  function createPipeDefinitionMap(meta) {
1567
1567
  const definitionMap = new checker.DefinitionMap();
1568
1568
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION));
1569
- definitionMap.set('version', checker.literal('19.0.0-next.6'));
1569
+ definitionMap.set('version', checker.literal('19.0.0-next.8'));
1570
1570
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
1571
1571
  // e.g. `type: MyPipe`
1572
1572
  definitionMap.set('type', meta.type.value);
@@ -1981,7 +1981,7 @@ class DeferredSymbolTracker {
1981
1981
  * Copyright Google LLC All Rights Reserved.
1982
1982
  *
1983
1983
  * Use of this source code is governed by an MIT-style license that can be
1984
- * found in the LICENSE file at https://angular.io/license
1984
+ * found in the LICENSE file at https://angular.dev/license
1985
1985
  */
1986
1986
  /**
1987
1987
  * Tracks which symbols are imported in specific files and under what names. Allows for efficient
@@ -3074,7 +3074,7 @@ class ExportedProviderStatusResolver {
3074
3074
  * Copyright Google LLC All Rights Reserved.
3075
3075
  *
3076
3076
  * Use of this source code is governed by an MIT-style license that can be
3077
- * found in the LICENSE file at https://angular.io/license
3077
+ * found in the LICENSE file at https://angular.dev/license
3078
3078
  */
3079
3079
  const EMPTY_ARRAY$1 = [];
3080
3080
  /** Resolves the host directives of a directive to a flat array of matches. */
@@ -5275,7 +5275,7 @@ function extractSchemas(rawExpr, evaluator, context) {
5275
5275
  * Copyright Google LLC All Rights Reserved.
5276
5276
  *
5277
5277
  * Use of this source code is governed by an MIT-style license that can be
5278
- * found in the LICENSE file at https://angular.io/license
5278
+ * found in the LICENSE file at https://angular.dev/license
5279
5279
  */
5280
5280
  /** Generates additional fields to be added to a class that has inputs with transform functions. */
5281
5281
  function compileInputTransformFields(inputs) {
@@ -6531,7 +6531,7 @@ const QUERY_TYPES = new Set(queryDecoratorNames);
6531
6531
  * appear in the declarations of an `NgModule` and additional verification is done when processing
6532
6532
  * the module.
6533
6533
  */
6534
- function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, evaluator, refEmitter, referencesRegistry, isCore, annotateForClosureCompiler, compilationMode, defaultSelector) {
6534
+ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, evaluator, refEmitter, referencesRegistry, isCore, annotateForClosureCompiler, compilationMode, defaultSelector, strictStandalone) {
6535
6535
  let directive;
6536
6536
  if (decorator.args === null || decorator.args.length === 0) {
6537
6537
  directive = new Map();
@@ -6643,6 +6643,9 @@ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, ev
6643
6643
  throw createValueHasWrongTypeError(expr, resolved, `standalone flag must be a boolean`);
6644
6644
  }
6645
6645
  isStandalone = resolved;
6646
+ if (!isStandalone && strictStandalone) {
6647
+ throw new checker.FatalDiagnosticError(checker.ErrorCode.NON_STANDALONE_NOT_ALLOWED, expr, `Only standalone components/directives are allowed when 'strictStandalone' is enabled.`);
6648
+ }
6646
6649
  }
6647
6650
  let isSignal = false;
6648
6651
  if (directive.has('signals')) {
@@ -7636,7 +7639,7 @@ const LIFECYCLE_HOOKS = new Set([
7636
7639
  'ngAfterContentChecked',
7637
7640
  ]);
7638
7641
  class DirectiveDecoratorHandler {
7639
- constructor(reflector, evaluator, metaRegistry, scopeRegistry, metaReader, injectableRegistry, refEmitter, referencesRegistry, isCore, strictCtorDeps, semanticDepGraphUpdater, annotateForClosureCompiler, perf, importTracker, includeClassMetadata, compilationMode, jitDeclarationRegistry) {
7642
+ constructor(reflector, evaluator, metaRegistry, scopeRegistry, metaReader, injectableRegistry, refEmitter, referencesRegistry, isCore, strictCtorDeps, semanticDepGraphUpdater, annotateForClosureCompiler, perf, importTracker, includeClassMetadata, compilationMode, jitDeclarationRegistry, strictStandalone) {
7640
7643
  this.reflector = reflector;
7641
7644
  this.evaluator = evaluator;
7642
7645
  this.metaRegistry = metaRegistry;
@@ -7654,6 +7657,7 @@ class DirectiveDecoratorHandler {
7654
7657
  this.includeClassMetadata = includeClassMetadata;
7655
7658
  this.compilationMode = compilationMode;
7656
7659
  this.jitDeclarationRegistry = jitDeclarationRegistry;
7660
+ this.strictStandalone = strictStandalone;
7657
7661
  this.precedence = checker.HandlerPrecedence.PRIMARY;
7658
7662
  this.name = 'DirectiveDecoratorHandler';
7659
7663
  }
@@ -7687,7 +7691,7 @@ class DirectiveDecoratorHandler {
7687
7691
  }
7688
7692
  this.perf.eventCount(checker.PerfEvent.AnalyzeDirective);
7689
7693
  const directiveResult = extractDirectiveMetadata(node, decorator, this.reflector, this.importTracker, this.evaluator, this.refEmitter, this.referencesRegistry, this.isCore, this.annotateForClosureCompiler, this.compilationMode,
7690
- /* defaultSelector */ null);
7694
+ /* defaultSelector */ null, this.strictStandalone);
7691
7695
  // `extractDirectiveMetadata` returns `jitForced = true` when the `@Directive` has
7692
7696
  // set `jit: true`. In this case, compilation of the decorator is skipped. Returning
7693
7697
  // an empty object signifies that no analysis was produced.
@@ -9731,7 +9735,7 @@ const isUsedPipe = (decl) => decl.kind === checker.R3TemplateDependencyKind.Pipe
9731
9735
  * `DecoratorHandler` which handles the `@Component` annotation.
9732
9736
  */
9733
9737
  class ComponentDecoratorHandler {
9734
- constructor(reflector, evaluator, metaRegistry, metaReader, scopeReader, dtsScopeReader, scopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, resourceLoader, rootDirs, defaultPreserveWhitespaces, i18nUseExternalIds, enableI18nLegacyMessageIdFormat, usePoisonedData, i18nNormalizeLineEndingsInICUs, moduleResolver, cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, depTracker, injectableRegistry, semanticDepGraphUpdater, annotateForClosureCompiler, perf, hostDirectivesResolver, importTracker, includeClassMetadata, compilationMode, deferredSymbolTracker, forbidOrphanRendering, enableBlockSyntax, enableLetSyntax, localCompilationExtraImportsTracker, jitDeclarationRegistry, i18nPreserveSignificantWhitespace) {
9738
+ constructor(reflector, evaluator, metaRegistry, metaReader, scopeReader, dtsScopeReader, scopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, resourceLoader, rootDirs, defaultPreserveWhitespaces, i18nUseExternalIds, enableI18nLegacyMessageIdFormat, usePoisonedData, i18nNormalizeLineEndingsInICUs, moduleResolver, cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, depTracker, injectableRegistry, semanticDepGraphUpdater, annotateForClosureCompiler, perf, hostDirectivesResolver, importTracker, includeClassMetadata, compilationMode, deferredSymbolTracker, forbidOrphanRendering, enableBlockSyntax, enableLetSyntax, localCompilationExtraImportsTracker, jitDeclarationRegistry, i18nPreserveSignificantWhitespace, strictStandalone) {
9735
9739
  this.reflector = reflector;
9736
9740
  this.evaluator = evaluator;
9737
9741
  this.metaRegistry = metaRegistry;
@@ -9771,6 +9775,7 @@ class ComponentDecoratorHandler {
9771
9775
  this.localCompilationExtraImportsTracker = localCompilationExtraImportsTracker;
9772
9776
  this.jitDeclarationRegistry = jitDeclarationRegistry;
9773
9777
  this.i18nPreserveSignificantWhitespace = i18nPreserveSignificantWhitespace;
9778
+ this.strictStandalone = strictStandalone;
9774
9779
  this.literalCache = new Map();
9775
9780
  this.elementSchemaRegistry = new checker.DomElementSchemaRegistry();
9776
9781
  /**
@@ -9883,7 +9888,7 @@ class ComponentDecoratorHandler {
9883
9888
  let isPoisoned = false;
9884
9889
  // @Component inherits @Directive, so begin by extracting the @Directive metadata and building
9885
9890
  // on it.
9886
- const directiveResult = extractDirectiveMetadata(node, decorator, this.reflector, this.importTracker, this.evaluator, this.refEmitter, this.referencesRegistry, this.isCore, this.annotateForClosureCompiler, this.compilationMode, this.elementSchemaRegistry.getDefaultComponentElementName());
9891
+ const directiveResult = extractDirectiveMetadata(node, decorator, this.reflector, this.importTracker, this.evaluator, this.refEmitter, this.referencesRegistry, this.isCore, this.annotateForClosureCompiler, this.compilationMode, this.elementSchemaRegistry.getDefaultComponentElementName(), this.strictStandalone);
9887
9892
  // `extractDirectiveMetadata` returns `jitForced = true` when the `@Component` has
9888
9893
  // set `jit: true`. In this case, compilation of the decorator is skipped. Returning
9889
9894
  // an empty object signifies that no analysis was produced.
@@ -11374,7 +11379,7 @@ class PipeSymbol extends SemanticSymbol {
11374
11379
  }
11375
11380
  }
11376
11381
  class PipeDecoratorHandler {
11377
- constructor(reflector, evaluator, metaRegistry, scopeRegistry, injectableRegistry, isCore, perf, includeClassMetadata, compilationMode, generateExtraImportsInLocalMode) {
11382
+ constructor(reflector, evaluator, metaRegistry, scopeRegistry, injectableRegistry, isCore, perf, includeClassMetadata, compilationMode, generateExtraImportsInLocalMode, strictStandalone) {
11378
11383
  this.reflector = reflector;
11379
11384
  this.evaluator = evaluator;
11380
11385
  this.metaRegistry = metaRegistry;
@@ -11385,6 +11390,7 @@ class PipeDecoratorHandler {
11385
11390
  this.includeClassMetadata = includeClassMetadata;
11386
11391
  this.compilationMode = compilationMode;
11387
11392
  this.generateExtraImportsInLocalMode = generateExtraImportsInLocalMode;
11393
+ this.strictStandalone = strictStandalone;
11388
11394
  this.precedence = checker.HandlerPrecedence.PRIMARY;
11389
11395
  this.name = 'PipeDecoratorHandler';
11390
11396
  }
@@ -11444,6 +11450,9 @@ class PipeDecoratorHandler {
11444
11450
  throw createValueHasWrongTypeError(expr, resolved, `standalone flag must be a boolean`);
11445
11451
  }
11446
11452
  isStandalone = resolved;
11453
+ if (!isStandalone && this.strictStandalone) {
11454
+ throw new checker.FatalDiagnosticError(checker.ErrorCode.NON_STANDALONE_NOT_ALLOWED, expr, `Only standalone pipes are allowed when 'strictStandalone' is enabled.`);
11455
+ }
11447
11456
  }
11448
11457
  return {
11449
11458
  analysis: {
@@ -12803,7 +12812,7 @@ function extractJsDocDescription(node) {
12803
12812
  return ts__default["default"].isJSDoc(d) || ts__default["default"].isJSDocParameterTag(d);
12804
12813
  });
12805
12814
  const comment = commentOrTag?.comment ?? '';
12806
- const description = typeof comment === 'string' ? comment : ts__default["default"].getTextOfJSDocComment(comment) ?? '';
12815
+ const description = typeof comment === 'string' ? comment : (ts__default["default"].getTextOfJSDocComment(comment) ?? '');
12807
12816
  return unescapeAngularDecorators(description);
12808
12817
  }
12809
12818
  /**
@@ -15432,7 +15441,7 @@ class StandaloneComponentScopeReader {
15432
15441
  * Copyright Google LLC All Rights Reserved.
15433
15442
  *
15434
15443
  * Use of this source code is governed by an MIT-style license that can be
15435
- * found in the LICENSE file at https://angular.io/license
15444
+ * found in the LICENSE file at https://angular.dev/license
15436
15445
  */
15437
15446
  /** Names of known signal functions. */
15438
15447
  const SIGNAL_FNS = new Set([
@@ -16337,7 +16346,7 @@ function unwrapAstWithSource(ast) {
16337
16346
  * Copyright Google LLC All Rights Reserved.
16338
16347
  *
16339
16348
  * Use of this source code is governed by an MIT-style license that can be
16340
- * found in the LICENSE file at https://angular.io/license
16349
+ * found in the LICENSE file at https://angular.dev/license
16341
16350
  */
16342
16351
  /** APIs whose usages should be checked by the rule. */
16343
16352
  const APIS_TO_CHECK = [
@@ -16407,7 +16416,7 @@ class InitializerApiUsageRule {
16407
16416
  * Copyright Google LLC All Rights Reserved.
16408
16417
  *
16409
16418
  * Use of this source code is governed by an MIT-style license that can be
16410
- * found in the LICENSE file at https://angular.io/license
16419
+ * found in the LICENSE file at https://angular.dev/license
16411
16420
  */
16412
16421
  /**
16413
16422
  * Rule that flags unused symbols inside of the `imports` array of a component.
@@ -16454,15 +16463,18 @@ class UnusedStandaloneImportsRule {
16454
16463
  return checker.makeDiagnostic(checker.ErrorCode.UNUSED_STANDALONE_IMPORTS, metadata.rawImports, 'Imports array contains unused imports', unused.map(([ref, type, name]) => checker.makeRelatedInformation(ref.getOriginForDiagnostics(metadata.rawImports), `${type} "${name}" is not used within the template`)), category);
16455
16464
  }
16456
16465
  getUnusedSymbols(metadata, usedDirectives, usedPipes) {
16457
- if (metadata.imports === null || metadata.rawImports === null) {
16466
+ const { imports, rawImports } = metadata;
16467
+ if (imports === null || rawImports === null) {
16458
16468
  return null;
16459
16469
  }
16460
16470
  let unused = null;
16461
- for (const current of metadata.imports) {
16471
+ for (const current of imports) {
16462
16472
  const currentNode = current.node;
16463
16473
  const dirMeta = this.templateTypeChecker.getDirectiveMetadata(currentNode);
16464
16474
  if (dirMeta !== null) {
16465
- if (dirMeta.isStandalone && (usedDirectives === null || !usedDirectives.has(currentNode))) {
16475
+ if (dirMeta.isStandalone &&
16476
+ !usedDirectives.has(currentNode) &&
16477
+ !this.isPotentialSharedReference(current, rawImports)) {
16466
16478
  unused ??= [];
16467
16479
  unused.push([current, dirMeta.isComponent ? 'Component' : 'Directive', dirMeta.name]);
16468
16480
  }
@@ -16471,13 +16483,41 @@ class UnusedStandaloneImportsRule {
16471
16483
  const pipeMeta = this.templateTypeChecker.getPipeMetadata(currentNode);
16472
16484
  if (pipeMeta !== null &&
16473
16485
  pipeMeta.isStandalone &&
16474
- (usedPipes === null || !usedPipes.has(pipeMeta.name))) {
16486
+ !usedPipes.has(pipeMeta.name) &&
16487
+ !this.isPotentialSharedReference(current, rawImports)) {
16475
16488
  unused ??= [];
16476
16489
  unused.push([current, 'Pipe', pipeMeta.ref.node.name.text]);
16477
16490
  }
16478
16491
  }
16479
16492
  return unused;
16480
16493
  }
16494
+ /**
16495
+ * Determines if an import reference *might* be coming from a shared imports array.
16496
+ * @param reference Reference to be checked.
16497
+ * @param rawImports AST node that defines the `imports` array.
16498
+ */
16499
+ isPotentialSharedReference(reference, rawImports) {
16500
+ // If the reference is defined directly in the `imports` array, it cannot be shared.
16501
+ if (reference.getIdentityInExpression(rawImports) !== null) {
16502
+ return false;
16503
+ }
16504
+ // The reference might be shared if it comes from an exported array. If the variable is local
16505
+ /// to the file, then it likely isn't shared. Note that this has the potential for false
16506
+ // positives if a non-exported array of imports is shared between components in the same
16507
+ // file. This scenario is unlikely and even if we report the diagnostic for it, it would be
16508
+ // okay since the user only has to refactor components within the same file, rather than the
16509
+ // entire application.
16510
+ let current = reference.getIdentityIn(rawImports.getSourceFile());
16511
+ while (current !== null) {
16512
+ if (ts__default["default"].isVariableStatement(current)) {
16513
+ return !!current.modifiers?.some((m) => m.kind === ts__default["default"].SyntaxKind.ExportKeyword);
16514
+ }
16515
+ current = current.parent;
16516
+ }
16517
+ // Otherwise the reference likely comes from an imported
16518
+ // symbol like an array of shared common components.
16519
+ return true;
16520
+ }
16481
16521
  }
16482
16522
 
16483
16523
  /*!
@@ -16485,7 +16525,7 @@ class UnusedStandaloneImportsRule {
16485
16525
  * Copyright Google LLC All Rights Reserved.
16486
16526
  *
16487
16527
  * Use of this source code is governed by an MIT-style license that can be
16488
- * found in the LICENSE file at https://angular.io/license
16528
+ * found in the LICENSE file at https://angular.dev/license
16489
16529
  */
16490
16530
  /**
16491
16531
  * Validates that TypeScript files match a specific set of rules set by the Angular compiler.
@@ -16562,924 +16602,1153 @@ function getDefaultExportFromCjs (x) {
16562
16602
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
16563
16603
  }
16564
16604
 
16565
- var re$2 = {exports: {}};
16605
+ var re = {exports: {}};
16566
16606
 
16567
- // Note: this is the semver.org version of the spec that it implements
16568
- // Not necessarily the package version of this code.
16569
- const SEMVER_SPEC_VERSION = '2.0.0';
16607
+ var constants;
16608
+ var hasRequiredConstants;
16570
16609
 
16571
- const MAX_LENGTH$1 = 256;
16572
- const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER ||
16573
- /* istanbul ignore next */ 9007199254740991;
16610
+ function requireConstants () {
16611
+ if (hasRequiredConstants) return constants;
16612
+ hasRequiredConstants = 1;
16613
+ // Note: this is the semver.org version of the spec that it implements
16614
+ // Not necessarily the package version of this code.
16615
+ const SEMVER_SPEC_VERSION = '2.0.0';
16574
16616
 
16575
- // Max safe segment length for coercion.
16576
- const MAX_SAFE_COMPONENT_LENGTH = 16;
16617
+ const MAX_LENGTH = 256;
16618
+ const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
16619
+ /* istanbul ignore next */ 9007199254740991;
16577
16620
 
16578
- // Max safe length for a build identifier. The max length minus 6 characters for
16579
- // the shortest version with a build 0.0.0+BUILD.
16580
- const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6;
16621
+ // Max safe segment length for coercion.
16622
+ const MAX_SAFE_COMPONENT_LENGTH = 16;
16581
16623
 
16582
- const RELEASE_TYPES = [
16583
- 'major',
16584
- 'premajor',
16585
- 'minor',
16586
- 'preminor',
16587
- 'patch',
16588
- 'prepatch',
16589
- 'prerelease',
16590
- ];
16624
+ // Max safe length for a build identifier. The max length minus 6 characters for
16625
+ // the shortest version with a build 0.0.0+BUILD.
16626
+ const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
16591
16627
 
16592
- var constants$1 = {
16593
- MAX_LENGTH: MAX_LENGTH$1,
16594
- MAX_SAFE_COMPONENT_LENGTH,
16595
- MAX_SAFE_BUILD_LENGTH,
16596
- MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
16597
- RELEASE_TYPES,
16598
- SEMVER_SPEC_VERSION,
16599
- FLAG_INCLUDE_PRERELEASE: 0b001,
16600
- FLAG_LOOSE: 0b010,
16601
- };
16628
+ const RELEASE_TYPES = [
16629
+ 'major',
16630
+ 'premajor',
16631
+ 'minor',
16632
+ 'preminor',
16633
+ 'patch',
16634
+ 'prepatch',
16635
+ 'prerelease',
16636
+ ];
16602
16637
 
16603
- const debug$1 = (
16604
- typeof process === 'object' &&
16605
- process.env &&
16606
- process.env.NODE_DEBUG &&
16607
- /\bsemver\b/i.test(process.env.NODE_DEBUG)
16608
- ) ? (...args) => console.error('SEMVER', ...args)
16609
- : () => {};
16638
+ constants = {
16639
+ MAX_LENGTH,
16640
+ MAX_SAFE_COMPONENT_LENGTH,
16641
+ MAX_SAFE_BUILD_LENGTH,
16642
+ MAX_SAFE_INTEGER,
16643
+ RELEASE_TYPES,
16644
+ SEMVER_SPEC_VERSION,
16645
+ FLAG_INCLUDE_PRERELEASE: 0b001,
16646
+ FLAG_LOOSE: 0b010,
16647
+ };
16648
+ return constants;
16649
+ }
16650
+
16651
+ var debug_1;
16652
+ var hasRequiredDebug;
16653
+
16654
+ function requireDebug () {
16655
+ if (hasRequiredDebug) return debug_1;
16656
+ hasRequiredDebug = 1;
16657
+ const debug = (
16658
+ typeof process === 'object' &&
16659
+ process.env &&
16660
+ process.env.NODE_DEBUG &&
16661
+ /\bsemver\b/i.test(process.env.NODE_DEBUG)
16662
+ ) ? (...args) => console.error('SEMVER', ...args)
16663
+ : () => {};
16664
+
16665
+ debug_1 = debug;
16666
+ return debug_1;
16667
+ }
16668
+
16669
+ re.exports;
16670
+
16671
+ var hasRequiredRe;
16672
+
16673
+ function requireRe () {
16674
+ if (hasRequiredRe) return re.exports;
16675
+ hasRequiredRe = 1;
16676
+ (function (module, exports) {
16677
+ const {
16678
+ MAX_SAFE_COMPONENT_LENGTH,
16679
+ MAX_SAFE_BUILD_LENGTH,
16680
+ MAX_LENGTH,
16681
+ } = requireConstants();
16682
+ const debug = requireDebug();
16683
+ exports = module.exports = {};
16684
+
16685
+ // The actual regexps go on exports.re
16686
+ const re = exports.re = [];
16687
+ const safeRe = exports.safeRe = [];
16688
+ const src = exports.src = [];
16689
+ const t = exports.t = {};
16690
+ let R = 0;
16691
+
16692
+ const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
16693
+
16694
+ // Replace some greedy regex tokens to prevent regex dos issues. These regex are
16695
+ // used internally via the safeRe object since all inputs in this library get
16696
+ // normalized first to trim and collapse all extra whitespace. The original
16697
+ // regexes are exported for userland consumption and lower level usage. A
16698
+ // future breaking change could export the safer regex only with a note that
16699
+ // all input should have extra whitespace removed.
16700
+ const safeRegexReplacements = [
16701
+ ['\\s', 1],
16702
+ ['\\d', MAX_LENGTH],
16703
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
16704
+ ];
16705
+
16706
+ const makeSafeRegex = (value) => {
16707
+ for (const [token, max] of safeRegexReplacements) {
16708
+ value = value
16709
+ .split(`${token}*`).join(`${token}{0,${max}}`)
16710
+ .split(`${token}+`).join(`${token}{1,${max}}`);
16711
+ }
16712
+ return value
16713
+ };
16714
+
16715
+ const createToken = (name, value, isGlobal) => {
16716
+ const safe = makeSafeRegex(value);
16717
+ const index = R++;
16718
+ debug(name, index, value);
16719
+ t[name] = index;
16720
+ src[index] = value;
16721
+ re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
16722
+ safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
16723
+ };
16724
+
16725
+ // The following Regular Expressions can be used for tokenizing,
16726
+ // validating, and parsing SemVer version strings.
16727
+
16728
+ // ## Numeric Identifier
16729
+ // A single `0`, or a non-zero digit followed by zero or more digits.
16730
+
16731
+ createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
16732
+ createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
16733
+
16734
+ // ## Non-numeric Identifier
16735
+ // Zero or more digits, followed by a letter or hyphen, and then zero or
16736
+ // more letters, digits, or hyphens.
16737
+
16738
+ createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
16739
+
16740
+ // ## Main Version
16741
+ // Three dot-separated numeric identifiers.
16742
+
16743
+ createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
16744
+ `(${src[t.NUMERICIDENTIFIER]})\\.` +
16745
+ `(${src[t.NUMERICIDENTIFIER]})`);
16746
+
16747
+ createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
16748
+ `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
16749
+ `(${src[t.NUMERICIDENTIFIERLOOSE]})`);
16750
+
16751
+ // ## Pre-release Version Identifier
16752
+ // A numeric identifier, or a non-numeric identifier.
16753
+
16754
+ createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
16755
+ }|${src[t.NONNUMERICIDENTIFIER]})`);
16756
+
16757
+ createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
16758
+ }|${src[t.NONNUMERICIDENTIFIER]})`);
16759
+
16760
+ // ## Pre-release Version
16761
+ // Hyphen, followed by one or more dot-separated pre-release version
16762
+ // identifiers.
16763
+
16764
+ createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
16765
+ }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
16766
+
16767
+ createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
16768
+ }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
16769
+
16770
+ // ## Build Metadata Identifier
16771
+ // Any combination of digits, letters, or hyphens.
16772
+
16773
+ createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
16774
+
16775
+ // ## Build Metadata
16776
+ // Plus sign, followed by one or more period-separated build metadata
16777
+ // identifiers.
16778
+
16779
+ createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
16780
+ }(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
16781
+
16782
+ // ## Full Version String
16783
+ // A main version, followed optionally by a pre-release version and
16784
+ // build metadata.
16785
+
16786
+ // Note that the only major, minor, patch, and pre-release sections of
16787
+ // the version string are capturing groups. The build metadata is not a
16788
+ // capturing group, because it should not ever be used in version
16789
+ // comparison.
16790
+
16791
+ createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
16792
+ }${src[t.PRERELEASE]}?${
16793
+ src[t.BUILD]}?`);
16794
+
16795
+ createToken('FULL', `^${src[t.FULLPLAIN]}$`);
16796
+
16797
+ // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
16798
+ // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
16799
+ // common in the npm registry.
16800
+ createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
16801
+ }${src[t.PRERELEASELOOSE]}?${
16802
+ src[t.BUILD]}?`);
16803
+
16804
+ createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
16805
+
16806
+ createToken('GTLT', '((?:<|>)?=?)');
16807
+
16808
+ // Something like "2.*" or "1.2.x".
16809
+ // Note that "x.x" is a valid xRange identifer, meaning "any version"
16810
+ // Only the first item is strictly required.
16811
+ createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
16812
+ createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
16813
+
16814
+ createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
16815
+ `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
16816
+ `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
16817
+ `(?:${src[t.PRERELEASE]})?${
16818
+ src[t.BUILD]}?` +
16819
+ `)?)?`);
16820
+
16821
+ createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
16822
+ `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
16823
+ `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
16824
+ `(?:${src[t.PRERELEASELOOSE]})?${
16825
+ src[t.BUILD]}?` +
16826
+ `)?)?`);
16827
+
16828
+ createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
16829
+ createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
16830
+
16831
+ // Coercion.
16832
+ // Extract anything that could conceivably be a part of a valid semver
16833
+ createToken('COERCEPLAIN', `${'(^|[^\\d])' +
16834
+ '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
16835
+ `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
16836
+ `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
16837
+ createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
16838
+ createToken('COERCEFULL', src[t.COERCEPLAIN] +
16839
+ `(?:${src[t.PRERELEASE]})?` +
16840
+ `(?:${src[t.BUILD]})?` +
16841
+ `(?:$|[^\\d])`);
16842
+ createToken('COERCERTL', src[t.COERCE], true);
16843
+ createToken('COERCERTLFULL', src[t.COERCEFULL], true);
16844
+
16845
+ // Tilde ranges.
16846
+ // Meaning is "reasonably at or greater than"
16847
+ createToken('LONETILDE', '(?:~>?)');
16848
+
16849
+ createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
16850
+ exports.tildeTrimReplace = '$1~';
16851
+
16852
+ createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
16853
+ createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
16854
+
16855
+ // Caret ranges.
16856
+ // Meaning is "at least and backwards compatible with"
16857
+ createToken('LONECARET', '(?:\\^)');
16858
+
16859
+ createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
16860
+ exports.caretTrimReplace = '$1^';
16861
+
16862
+ createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
16863
+ createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
16864
+
16865
+ // A simple gt/lt/eq thing, or just "" to indicate "any version"
16866
+ createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
16867
+ createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
16868
+
16869
+ // An expression to strip any whitespace between the gtlt and the thing
16870
+ // it modifies, so that `> 1.2.3` ==> `>1.2.3`
16871
+ createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
16872
+ }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
16873
+ exports.comparatorTrimReplace = '$1$2$3';
16874
+
16875
+ // Something like `1.2.3 - 1.2.4`
16876
+ // Note that these all use the loose form, because they'll be
16877
+ // checked against either the strict or loose comparator form
16878
+ // later.
16879
+ createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
16880
+ `\\s+-\\s+` +
16881
+ `(${src[t.XRANGEPLAIN]})` +
16882
+ `\\s*$`);
16883
+
16884
+ createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
16885
+ `\\s+-\\s+` +
16886
+ `(${src[t.XRANGEPLAINLOOSE]})` +
16887
+ `\\s*$`);
16888
+
16889
+ // Star ranges basically just allow anything at all.
16890
+ createToken('STAR', '(<|>)?=?\\s*\\*');
16891
+ // >=0.0.0 is like a star
16892
+ createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
16893
+ createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
16894
+ } (re, re.exports));
16895
+ return re.exports;
16896
+ }
16897
+
16898
+ var parseOptions_1;
16899
+ var hasRequiredParseOptions;
16900
+
16901
+ function requireParseOptions () {
16902
+ if (hasRequiredParseOptions) return parseOptions_1;
16903
+ hasRequiredParseOptions = 1;
16904
+ // parse out just the options we care about
16905
+ const looseOption = Object.freeze({ loose: true });
16906
+ const emptyOpts = Object.freeze({ });
16907
+ const parseOptions = options => {
16908
+ if (!options) {
16909
+ return emptyOpts
16910
+ }
16610
16911
 
16611
- var debug_1 = debug$1;
16912
+ if (typeof options !== 'object') {
16913
+ return looseOption
16914
+ }
16612
16915
 
16613
- re$2.exports;
16916
+ return options
16917
+ };
16918
+ parseOptions_1 = parseOptions;
16919
+ return parseOptions_1;
16920
+ }
16614
16921
 
16615
- (function (module, exports) {
16616
- const {
16617
- MAX_SAFE_COMPONENT_LENGTH,
16618
- MAX_SAFE_BUILD_LENGTH,
16619
- MAX_LENGTH,
16620
- } = constants$1;
16621
- const debug = debug_1;
16622
- exports = module.exports = {};
16623
-
16624
- // The actual regexps go on exports.re
16625
- const re = exports.re = [];
16626
- const safeRe = exports.safeRe = [];
16627
- const src = exports.src = [];
16628
- const t = exports.t = {};
16629
- let R = 0;
16630
-
16631
- const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
16632
-
16633
- // Replace some greedy regex tokens to prevent regex dos issues. These regex are
16634
- // used internally via the safeRe object since all inputs in this library get
16635
- // normalized first to trim and collapse all extra whitespace. The original
16636
- // regexes are exported for userland consumption and lower level usage. A
16637
- // future breaking change could export the safer regex only with a note that
16638
- // all input should have extra whitespace removed.
16639
- const safeRegexReplacements = [
16640
- ['\\s', 1],
16641
- ['\\d', MAX_LENGTH],
16642
- [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
16643
- ];
16922
+ var identifiers;
16923
+ var hasRequiredIdentifiers;
16644
16924
 
16645
- const makeSafeRegex = (value) => {
16646
- for (const [token, max] of safeRegexReplacements) {
16647
- value = value
16648
- .split(`${token}*`).join(`${token}{0,${max}}`)
16649
- .split(`${token}+`).join(`${token}{1,${max}}`);
16925
+ function requireIdentifiers () {
16926
+ if (hasRequiredIdentifiers) return identifiers;
16927
+ hasRequiredIdentifiers = 1;
16928
+ const numeric = /^[0-9]+$/;
16929
+ const compareIdentifiers = (a, b) => {
16930
+ const anum = numeric.test(a);
16931
+ const bnum = numeric.test(b);
16932
+
16933
+ if (anum && bnum) {
16934
+ a = +a;
16935
+ b = +b;
16650
16936
  }
16651
- return value
16937
+
16938
+ return a === b ? 0
16939
+ : (anum && !bnum) ? -1
16940
+ : (bnum && !anum) ? 1
16941
+ : a < b ? -1
16942
+ : 1
16652
16943
  };
16653
16944
 
16654
- const createToken = (name, value, isGlobal) => {
16655
- const safe = makeSafeRegex(value);
16656
- const index = R++;
16657
- debug(name, index, value);
16658
- t[name] = index;
16659
- src[index] = value;
16660
- re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
16661
- safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
16945
+ const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
16946
+
16947
+ identifiers = {
16948
+ compareIdentifiers,
16949
+ rcompareIdentifiers,
16662
16950
  };
16951
+ return identifiers;
16952
+ }
16663
16953
 
16664
- // The following Regular Expressions can be used for tokenizing,
16665
- // validating, and parsing SemVer version strings.
16954
+ var semver$2;
16955
+ var hasRequiredSemver$1;
16666
16956
 
16667
- // ## Numeric Identifier
16668
- // A single `0`, or a non-zero digit followed by zero or more digits.
16957
+ function requireSemver$1 () {
16958
+ if (hasRequiredSemver$1) return semver$2;
16959
+ hasRequiredSemver$1 = 1;
16960
+ const debug = requireDebug();
16961
+ const { MAX_LENGTH, MAX_SAFE_INTEGER } = requireConstants();
16962
+ const { safeRe: re, t } = requireRe();
16669
16963
 
16670
- createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
16671
- createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
16964
+ const parseOptions = requireParseOptions();
16965
+ const { compareIdentifiers } = requireIdentifiers();
16966
+ class SemVer {
16967
+ constructor (version, options) {
16968
+ options = parseOptions(options);
16672
16969
 
16673
- // ## Non-numeric Identifier
16674
- // Zero or more digits, followed by a letter or hyphen, and then zero or
16675
- // more letters, digits, or hyphens.
16970
+ if (version instanceof SemVer) {
16971
+ if (version.loose === !!options.loose &&
16972
+ version.includePrerelease === !!options.includePrerelease) {
16973
+ return version
16974
+ } else {
16975
+ version = version.version;
16976
+ }
16977
+ } else if (typeof version !== 'string') {
16978
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
16979
+ }
16676
16980
 
16677
- createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
16981
+ if (version.length > MAX_LENGTH) {
16982
+ throw new TypeError(
16983
+ `version is longer than ${MAX_LENGTH} characters`
16984
+ )
16985
+ }
16678
16986
 
16679
- // ## Main Version
16680
- // Three dot-separated numeric identifiers.
16987
+ debug('SemVer', version, options);
16988
+ this.options = options;
16989
+ this.loose = !!options.loose;
16990
+ // this isn't actually relevant for versions, but keep it so that we
16991
+ // don't run into trouble passing this.options around.
16992
+ this.includePrerelease = !!options.includePrerelease;
16681
16993
 
16682
- createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
16683
- `(${src[t.NUMERICIDENTIFIER]})\\.` +
16684
- `(${src[t.NUMERICIDENTIFIER]})`);
16994
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
16685
16995
 
16686
- createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
16687
- `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
16688
- `(${src[t.NUMERICIDENTIFIERLOOSE]})`);
16996
+ if (!m) {
16997
+ throw new TypeError(`Invalid Version: ${version}`)
16998
+ }
16689
16999
 
16690
- // ## Pre-release Version Identifier
16691
- // A numeric identifier, or a non-numeric identifier.
17000
+ this.raw = version;
16692
17001
 
16693
- createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
16694
- }|${src[t.NONNUMERICIDENTIFIER]})`);
17002
+ // these are actually numbers
17003
+ this.major = +m[1];
17004
+ this.minor = +m[2];
17005
+ this.patch = +m[3];
16695
17006
 
16696
- createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
16697
- }|${src[t.NONNUMERICIDENTIFIER]})`);
17007
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
17008
+ throw new TypeError('Invalid major version')
17009
+ }
16698
17010
 
16699
- // ## Pre-release Version
16700
- // Hyphen, followed by one or more dot-separated pre-release version
16701
- // identifiers.
17011
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
17012
+ throw new TypeError('Invalid minor version')
17013
+ }
16702
17014
 
16703
- createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
16704
- }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
17015
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
17016
+ throw new TypeError('Invalid patch version')
17017
+ }
16705
17018
 
16706
- createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
16707
- }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
17019
+ // numberify any prerelease numeric ids
17020
+ if (!m[4]) {
17021
+ this.prerelease = [];
17022
+ } else {
17023
+ this.prerelease = m[4].split('.').map((id) => {
17024
+ if (/^[0-9]+$/.test(id)) {
17025
+ const num = +id;
17026
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
17027
+ return num
17028
+ }
17029
+ }
17030
+ return id
17031
+ });
17032
+ }
16708
17033
 
16709
- // ## Build Metadata Identifier
16710
- // Any combination of digits, letters, or hyphens.
17034
+ this.build = m[5] ? m[5].split('.') : [];
17035
+ this.format();
17036
+ }
16711
17037
 
16712
- createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
17038
+ format () {
17039
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
17040
+ if (this.prerelease.length) {
17041
+ this.version += `-${this.prerelease.join('.')}`;
17042
+ }
17043
+ return this.version
17044
+ }
16713
17045
 
16714
- // ## Build Metadata
16715
- // Plus sign, followed by one or more period-separated build metadata
16716
- // identifiers.
17046
+ toString () {
17047
+ return this.version
17048
+ }
16717
17049
 
16718
- createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
16719
- }(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
17050
+ compare (other) {
17051
+ debug('SemVer.compare', this.version, this.options, other);
17052
+ if (!(other instanceof SemVer)) {
17053
+ if (typeof other === 'string' && other === this.version) {
17054
+ return 0
17055
+ }
17056
+ other = new SemVer(other, this.options);
17057
+ }
16720
17058
 
16721
- // ## Full Version String
16722
- // A main version, followed optionally by a pre-release version and
16723
- // build metadata.
17059
+ if (other.version === this.version) {
17060
+ return 0
17061
+ }
16724
17062
 
16725
- // Note that the only major, minor, patch, and pre-release sections of
16726
- // the version string are capturing groups. The build metadata is not a
16727
- // capturing group, because it should not ever be used in version
16728
- // comparison.
17063
+ return this.compareMain(other) || this.comparePre(other)
17064
+ }
16729
17065
 
16730
- createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
16731
- }${src[t.PRERELEASE]}?${
16732
- src[t.BUILD]}?`);
16733
-
16734
- createToken('FULL', `^${src[t.FULLPLAIN]}$`);
16735
-
16736
- // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
16737
- // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
16738
- // common in the npm registry.
16739
- createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
16740
- }${src[t.PRERELEASELOOSE]}?${
16741
- src[t.BUILD]}?`);
16742
-
16743
- createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
16744
-
16745
- createToken('GTLT', '((?:<|>)?=?)');
16746
-
16747
- // Something like "2.*" or "1.2.x".
16748
- // Note that "x.x" is a valid xRange identifer, meaning "any version"
16749
- // Only the first item is strictly required.
16750
- createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
16751
- createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
16752
-
16753
- createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
16754
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
16755
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
16756
- `(?:${src[t.PRERELEASE]})?${
16757
- src[t.BUILD]}?` +
16758
- `)?)?`);
16759
-
16760
- createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
16761
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
16762
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
16763
- `(?:${src[t.PRERELEASELOOSE]})?${
16764
- src[t.BUILD]}?` +
16765
- `)?)?`);
16766
-
16767
- createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
16768
- createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
16769
-
16770
- // Coercion.
16771
- // Extract anything that could conceivably be a part of a valid semver
16772
- createToken('COERCEPLAIN', `${'(^|[^\\d])' +
16773
- '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
16774
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
16775
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
16776
- createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
16777
- createToken('COERCEFULL', src[t.COERCEPLAIN] +
16778
- `(?:${src[t.PRERELEASE]})?` +
16779
- `(?:${src[t.BUILD]})?` +
16780
- `(?:$|[^\\d])`);
16781
- createToken('COERCERTL', src[t.COERCE], true);
16782
- createToken('COERCERTLFULL', src[t.COERCEFULL], true);
16783
-
16784
- // Tilde ranges.
16785
- // Meaning is "reasonably at or greater than"
16786
- createToken('LONETILDE', '(?:~>?)');
16787
-
16788
- createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
16789
- exports.tildeTrimReplace = '$1~';
16790
-
16791
- createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
16792
- createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
16793
-
16794
- // Caret ranges.
16795
- // Meaning is "at least and backwards compatible with"
16796
- createToken('LONECARET', '(?:\\^)');
16797
-
16798
- createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
16799
- exports.caretTrimReplace = '$1^';
16800
-
16801
- createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
16802
- createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
16803
-
16804
- // A simple gt/lt/eq thing, or just "" to indicate "any version"
16805
- createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
16806
- createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
16807
-
16808
- // An expression to strip any whitespace between the gtlt and the thing
16809
- // it modifies, so that `> 1.2.3` ==> `>1.2.3`
16810
- createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
16811
- }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
16812
- exports.comparatorTrimReplace = '$1$2$3';
16813
-
16814
- // Something like `1.2.3 - 1.2.4`
16815
- // Note that these all use the loose form, because they'll be
16816
- // checked against either the strict or loose comparator form
16817
- // later.
16818
- createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
16819
- `\\s+-\\s+` +
16820
- `(${src[t.XRANGEPLAIN]})` +
16821
- `\\s*$`);
16822
-
16823
- createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
16824
- `\\s+-\\s+` +
16825
- `(${src[t.XRANGEPLAINLOOSE]})` +
16826
- `\\s*$`);
16827
-
16828
- // Star ranges basically just allow anything at all.
16829
- createToken('STAR', '(<|>)?=?\\s*\\*');
16830
- // >=0.0.0 is like a star
16831
- createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
16832
- createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
16833
- } (re$2, re$2.exports));
16834
-
16835
- var reExports = re$2.exports;
16836
-
16837
- // parse out just the options we care about
16838
- const looseOption = Object.freeze({ loose: true });
16839
- const emptyOpts = Object.freeze({ });
16840
- const parseOptions$1 = options => {
16841
- if (!options) {
16842
- return emptyOpts
16843
- }
16844
-
16845
- if (typeof options !== 'object') {
16846
- return looseOption
16847
- }
16848
-
16849
- return options
16850
- };
16851
- var parseOptions_1 = parseOptions$1;
16852
-
16853
- const numeric = /^[0-9]+$/;
16854
- const compareIdentifiers$1 = (a, b) => {
16855
- const anum = numeric.test(a);
16856
- const bnum = numeric.test(b);
16857
-
16858
- if (anum && bnum) {
16859
- a = +a;
16860
- b = +b;
16861
- }
16862
-
16863
- return a === b ? 0
16864
- : (anum && !bnum) ? -1
16865
- : (bnum && !anum) ? 1
16866
- : a < b ? -1
16867
- : 1
16868
- };
17066
+ compareMain (other) {
17067
+ if (!(other instanceof SemVer)) {
17068
+ other = new SemVer(other, this.options);
17069
+ }
16869
17070
 
16870
- const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);
17071
+ return (
17072
+ compareIdentifiers(this.major, other.major) ||
17073
+ compareIdentifiers(this.minor, other.minor) ||
17074
+ compareIdentifiers(this.patch, other.patch)
17075
+ )
17076
+ }
16871
17077
 
16872
- var identifiers$1 = {
16873
- compareIdentifiers: compareIdentifiers$1,
16874
- rcompareIdentifiers,
16875
- };
17078
+ comparePre (other) {
17079
+ if (!(other instanceof SemVer)) {
17080
+ other = new SemVer(other, this.options);
17081
+ }
16876
17082
 
16877
- const debug = debug_1;
16878
- const { MAX_LENGTH, MAX_SAFE_INTEGER } = constants$1;
16879
- const { safeRe: re$1, t: t$1 } = reExports;
17083
+ // NOT having a prerelease is > having one
17084
+ if (this.prerelease.length && !other.prerelease.length) {
17085
+ return -1
17086
+ } else if (!this.prerelease.length && other.prerelease.length) {
17087
+ return 1
17088
+ } else if (!this.prerelease.length && !other.prerelease.length) {
17089
+ return 0
17090
+ }
16880
17091
 
16881
- const parseOptions = parseOptions_1;
16882
- const { compareIdentifiers } = identifiers$1;
16883
- class SemVer$d {
16884
- constructor (version, options) {
16885
- options = parseOptions(options);
17092
+ let i = 0;
17093
+ do {
17094
+ const a = this.prerelease[i];
17095
+ const b = other.prerelease[i];
17096
+ debug('prerelease compare', i, a, b);
17097
+ if (a === undefined && b === undefined) {
17098
+ return 0
17099
+ } else if (b === undefined) {
17100
+ return 1
17101
+ } else if (a === undefined) {
17102
+ return -1
17103
+ } else if (a === b) {
17104
+ continue
17105
+ } else {
17106
+ return compareIdentifiers(a, b)
17107
+ }
17108
+ } while (++i)
17109
+ }
16886
17110
 
16887
- if (version instanceof SemVer$d) {
16888
- if (version.loose === !!options.loose &&
16889
- version.includePrerelease === !!options.includePrerelease) {
16890
- return version
16891
- } else {
16892
- version = version.version;
16893
- }
16894
- } else if (typeof version !== 'string') {
16895
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
16896
- }
17111
+ compareBuild (other) {
17112
+ if (!(other instanceof SemVer)) {
17113
+ other = new SemVer(other, this.options);
17114
+ }
16897
17115
 
16898
- if (version.length > MAX_LENGTH) {
16899
- throw new TypeError(
16900
- `version is longer than ${MAX_LENGTH} characters`
16901
- )
16902
- }
17116
+ let i = 0;
17117
+ do {
17118
+ const a = this.build[i];
17119
+ const b = other.build[i];
17120
+ debug('build compare', i, a, b);
17121
+ if (a === undefined && b === undefined) {
17122
+ return 0
17123
+ } else if (b === undefined) {
17124
+ return 1
17125
+ } else if (a === undefined) {
17126
+ return -1
17127
+ } else if (a === b) {
17128
+ continue
17129
+ } else {
17130
+ return compareIdentifiers(a, b)
17131
+ }
17132
+ } while (++i)
17133
+ }
16903
17134
 
16904
- debug('SemVer', version, options);
16905
- this.options = options;
16906
- this.loose = !!options.loose;
16907
- // this isn't actually relevant for versions, but keep it so that we
16908
- // don't run into trouble passing this.options around.
16909
- this.includePrerelease = !!options.includePrerelease;
17135
+ // preminor will bump the version up to the next minor release, and immediately
17136
+ // down to pre-release. premajor and prepatch work the same way.
17137
+ inc (release, identifier, identifierBase) {
17138
+ switch (release) {
17139
+ case 'premajor':
17140
+ this.prerelease.length = 0;
17141
+ this.patch = 0;
17142
+ this.minor = 0;
17143
+ this.major++;
17144
+ this.inc('pre', identifier, identifierBase);
17145
+ break
17146
+ case 'preminor':
17147
+ this.prerelease.length = 0;
17148
+ this.patch = 0;
17149
+ this.minor++;
17150
+ this.inc('pre', identifier, identifierBase);
17151
+ break
17152
+ case 'prepatch':
17153
+ // If this is already a prerelease, it will bump to the next version
17154
+ // drop any prereleases that might already exist, since they are not
17155
+ // relevant at this point.
17156
+ this.prerelease.length = 0;
17157
+ this.inc('patch', identifier, identifierBase);
17158
+ this.inc('pre', identifier, identifierBase);
17159
+ break
17160
+ // If the input is a non-prerelease version, this acts the same as
17161
+ // prepatch.
17162
+ case 'prerelease':
17163
+ if (this.prerelease.length === 0) {
17164
+ this.inc('patch', identifier, identifierBase);
17165
+ }
17166
+ this.inc('pre', identifier, identifierBase);
17167
+ break
17168
+
17169
+ case 'major':
17170
+ // If this is a pre-major version, bump up to the same major version.
17171
+ // Otherwise increment major.
17172
+ // 1.0.0-5 bumps to 1.0.0
17173
+ // 1.1.0 bumps to 2.0.0
17174
+ if (
17175
+ this.minor !== 0 ||
17176
+ this.patch !== 0 ||
17177
+ this.prerelease.length === 0
17178
+ ) {
17179
+ this.major++;
17180
+ }
17181
+ this.minor = 0;
17182
+ this.patch = 0;
17183
+ this.prerelease = [];
17184
+ break
17185
+ case 'minor':
17186
+ // If this is a pre-minor version, bump up to the same minor version.
17187
+ // Otherwise increment minor.
17188
+ // 1.2.0-5 bumps to 1.2.0
17189
+ // 1.2.1 bumps to 1.3.0
17190
+ if (this.patch !== 0 || this.prerelease.length === 0) {
17191
+ this.minor++;
17192
+ }
17193
+ this.patch = 0;
17194
+ this.prerelease = [];
17195
+ break
17196
+ case 'patch':
17197
+ // If this is not a pre-release version, it will increment the patch.
17198
+ // If it is a pre-release it will bump up to the same patch version.
17199
+ // 1.2.0-5 patches to 1.2.0
17200
+ // 1.2.0 patches to 1.2.1
17201
+ if (this.prerelease.length === 0) {
17202
+ this.patch++;
17203
+ }
17204
+ this.prerelease = [];
17205
+ break
17206
+ // This probably shouldn't be used publicly.
17207
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
17208
+ case 'pre': {
17209
+ const base = Number(identifierBase) ? 1 : 0;
17210
+
17211
+ if (!identifier && identifierBase === false) {
17212
+ throw new Error('invalid increment argument: identifier is empty')
17213
+ }
16910
17214
 
16911
- const m = version.trim().match(options.loose ? re$1[t$1.LOOSE] : re$1[t$1.FULL]);
17215
+ if (this.prerelease.length === 0) {
17216
+ this.prerelease = [base];
17217
+ } else {
17218
+ let i = this.prerelease.length;
17219
+ while (--i >= 0) {
17220
+ if (typeof this.prerelease[i] === 'number') {
17221
+ this.prerelease[i]++;
17222
+ i = -2;
17223
+ }
17224
+ }
17225
+ if (i === -1) {
17226
+ // didn't increment anything
17227
+ if (identifier === this.prerelease.join('.') && identifierBase === false) {
17228
+ throw new Error('invalid increment argument: identifier already exists')
17229
+ }
17230
+ this.prerelease.push(base);
17231
+ }
17232
+ }
17233
+ if (identifier) {
17234
+ // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
17235
+ // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
17236
+ let prerelease = [identifier, base];
17237
+ if (identifierBase === false) {
17238
+ prerelease = [identifier];
17239
+ }
17240
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
17241
+ if (isNaN(this.prerelease[1])) {
17242
+ this.prerelease = prerelease;
17243
+ }
17244
+ } else {
17245
+ this.prerelease = prerelease;
17246
+ }
17247
+ }
17248
+ break
17249
+ }
17250
+ default:
17251
+ throw new Error(`invalid increment argument: ${release}`)
17252
+ }
17253
+ this.raw = this.format();
17254
+ if (this.build.length) {
17255
+ this.raw += `+${this.build.join('.')}`;
17256
+ }
17257
+ return this
17258
+ }
17259
+ }
16912
17260
 
16913
- if (!m) {
16914
- throw new TypeError(`Invalid Version: ${version}`)
16915
- }
17261
+ semver$2 = SemVer;
17262
+ return semver$2;
17263
+ }
16916
17264
 
16917
- this.raw = version;
17265
+ var parse_1;
17266
+ var hasRequiredParse;
16918
17267
 
16919
- // these are actually numbers
16920
- this.major = +m[1];
16921
- this.minor = +m[2];
16922
- this.patch = +m[3];
17268
+ function requireParse () {
17269
+ if (hasRequiredParse) return parse_1;
17270
+ hasRequiredParse = 1;
17271
+ const SemVer = requireSemver$1();
17272
+ const parse = (version, options, throwErrors = false) => {
17273
+ if (version instanceof SemVer) {
17274
+ return version
17275
+ }
17276
+ try {
17277
+ return new SemVer(version, options)
17278
+ } catch (er) {
17279
+ if (!throwErrors) {
17280
+ return null
17281
+ }
17282
+ throw er
17283
+ }
17284
+ };
16923
17285
 
16924
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
16925
- throw new TypeError('Invalid major version')
16926
- }
17286
+ parse_1 = parse;
17287
+ return parse_1;
17288
+ }
16927
17289
 
16928
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
16929
- throw new TypeError('Invalid minor version')
16930
- }
17290
+ var valid_1;
17291
+ var hasRequiredValid$1;
16931
17292
 
16932
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
16933
- throw new TypeError('Invalid patch version')
16934
- }
17293
+ function requireValid$1 () {
17294
+ if (hasRequiredValid$1) return valid_1;
17295
+ hasRequiredValid$1 = 1;
17296
+ const parse = requireParse();
17297
+ const valid = (version, options) => {
17298
+ const v = parse(version, options);
17299
+ return v ? v.version : null
17300
+ };
17301
+ valid_1 = valid;
17302
+ return valid_1;
17303
+ }
16935
17304
 
16936
- // numberify any prerelease numeric ids
16937
- if (!m[4]) {
16938
- this.prerelease = [];
16939
- } else {
16940
- this.prerelease = m[4].split('.').map((id) => {
16941
- if (/^[0-9]+$/.test(id)) {
16942
- const num = +id;
16943
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
16944
- return num
16945
- }
16946
- }
16947
- return id
16948
- });
16949
- }
17305
+ var clean_1;
17306
+ var hasRequiredClean;
16950
17307
 
16951
- this.build = m[5] ? m[5].split('.') : [];
16952
- this.format();
16953
- }
17308
+ function requireClean () {
17309
+ if (hasRequiredClean) return clean_1;
17310
+ hasRequiredClean = 1;
17311
+ const parse = requireParse();
17312
+ const clean = (version, options) => {
17313
+ const s = parse(version.trim().replace(/^[=v]+/, ''), options);
17314
+ return s ? s.version : null
17315
+ };
17316
+ clean_1 = clean;
17317
+ return clean_1;
17318
+ }
16954
17319
 
16955
- format () {
16956
- this.version = `${this.major}.${this.minor}.${this.patch}`;
16957
- if (this.prerelease.length) {
16958
- this.version += `-${this.prerelease.join('.')}`;
16959
- }
16960
- return this.version
16961
- }
17320
+ var inc_1;
17321
+ var hasRequiredInc;
16962
17322
 
16963
- toString () {
16964
- return this.version
16965
- }
17323
+ function requireInc () {
17324
+ if (hasRequiredInc) return inc_1;
17325
+ hasRequiredInc = 1;
17326
+ const SemVer = requireSemver$1();
16966
17327
 
16967
- compare (other) {
16968
- debug('SemVer.compare', this.version, this.options, other);
16969
- if (!(other instanceof SemVer$d)) {
16970
- if (typeof other === 'string' && other === this.version) {
16971
- return 0
16972
- }
16973
- other = new SemVer$d(other, this.options);
16974
- }
17328
+ const inc = (version, release, options, identifier, identifierBase) => {
17329
+ if (typeof (options) === 'string') {
17330
+ identifierBase = identifier;
17331
+ identifier = options;
17332
+ options = undefined;
17333
+ }
16975
17334
 
16976
- if (other.version === this.version) {
16977
- return 0
16978
- }
17335
+ try {
17336
+ return new SemVer(
17337
+ version instanceof SemVer ? version.version : version,
17338
+ options
17339
+ ).inc(release, identifier, identifierBase).version
17340
+ } catch (er) {
17341
+ return null
17342
+ }
17343
+ };
17344
+ inc_1 = inc;
17345
+ return inc_1;
17346
+ }
16979
17347
 
16980
- return this.compareMain(other) || this.comparePre(other)
16981
- }
17348
+ var diff_1;
17349
+ var hasRequiredDiff;
16982
17350
 
16983
- compareMain (other) {
16984
- if (!(other instanceof SemVer$d)) {
16985
- other = new SemVer$d(other, this.options);
16986
- }
17351
+ function requireDiff () {
17352
+ if (hasRequiredDiff) return diff_1;
17353
+ hasRequiredDiff = 1;
17354
+ const parse = requireParse();
16987
17355
 
16988
- return (
16989
- compareIdentifiers(this.major, other.major) ||
16990
- compareIdentifiers(this.minor, other.minor) ||
16991
- compareIdentifiers(this.patch, other.patch)
16992
- )
16993
- }
17356
+ const diff = (version1, version2) => {
17357
+ const v1 = parse(version1, null, true);
17358
+ const v2 = parse(version2, null, true);
17359
+ const comparison = v1.compare(v2);
16994
17360
 
16995
- comparePre (other) {
16996
- if (!(other instanceof SemVer$d)) {
16997
- other = new SemVer$d(other, this.options);
16998
- }
17361
+ if (comparison === 0) {
17362
+ return null
17363
+ }
16999
17364
 
17000
- // NOT having a prerelease is > having one
17001
- if (this.prerelease.length && !other.prerelease.length) {
17002
- return -1
17003
- } else if (!this.prerelease.length && other.prerelease.length) {
17004
- return 1
17005
- } else if (!this.prerelease.length && !other.prerelease.length) {
17006
- return 0
17007
- }
17365
+ const v1Higher = comparison > 0;
17366
+ const highVersion = v1Higher ? v1 : v2;
17367
+ const lowVersion = v1Higher ? v2 : v1;
17368
+ const highHasPre = !!highVersion.prerelease.length;
17369
+ const lowHasPre = !!lowVersion.prerelease.length;
17370
+
17371
+ if (lowHasPre && !highHasPre) {
17372
+ // Going from prerelease -> no prerelease requires some special casing
17373
+
17374
+ // If the low version has only a major, then it will always be a major
17375
+ // Some examples:
17376
+ // 1.0.0-1 -> 1.0.0
17377
+ // 1.0.0-1 -> 1.1.1
17378
+ // 1.0.0-1 -> 2.0.0
17379
+ if (!lowVersion.patch && !lowVersion.minor) {
17380
+ return 'major'
17381
+ }
17008
17382
 
17009
- let i = 0;
17010
- do {
17011
- const a = this.prerelease[i];
17012
- const b = other.prerelease[i];
17013
- debug('prerelease compare', i, a, b);
17014
- if (a === undefined && b === undefined) {
17015
- return 0
17016
- } else if (b === undefined) {
17017
- return 1
17018
- } else if (a === undefined) {
17019
- return -1
17020
- } else if (a === b) {
17021
- continue
17022
- } else {
17023
- return compareIdentifiers(a, b)
17024
- }
17025
- } while (++i)
17026
- }
17027
-
17028
- compareBuild (other) {
17029
- if (!(other instanceof SemVer$d)) {
17030
- other = new SemVer$d(other, this.options);
17031
- }
17032
-
17033
- let i = 0;
17034
- do {
17035
- const a = this.build[i];
17036
- const b = other.build[i];
17037
- debug('build compare', i, a, b);
17038
- if (a === undefined && b === undefined) {
17039
- return 0
17040
- } else if (b === undefined) {
17041
- return 1
17042
- } else if (a === undefined) {
17043
- return -1
17044
- } else if (a === b) {
17045
- continue
17046
- } else {
17047
- return compareIdentifiers(a, b)
17048
- }
17049
- } while (++i)
17050
- }
17051
-
17052
- // preminor will bump the version up to the next minor release, and immediately
17053
- // down to pre-release. premajor and prepatch work the same way.
17054
- inc (release, identifier, identifierBase) {
17055
- switch (release) {
17056
- case 'premajor':
17057
- this.prerelease.length = 0;
17058
- this.patch = 0;
17059
- this.minor = 0;
17060
- this.major++;
17061
- this.inc('pre', identifier, identifierBase);
17062
- break
17063
- case 'preminor':
17064
- this.prerelease.length = 0;
17065
- this.patch = 0;
17066
- this.minor++;
17067
- this.inc('pre', identifier, identifierBase);
17068
- break
17069
- case 'prepatch':
17070
- // If this is already a prerelease, it will bump to the next version
17071
- // drop any prereleases that might already exist, since they are not
17072
- // relevant at this point.
17073
- this.prerelease.length = 0;
17074
- this.inc('patch', identifier, identifierBase);
17075
- this.inc('pre', identifier, identifierBase);
17076
- break
17077
- // If the input is a non-prerelease version, this acts the same as
17078
- // prepatch.
17079
- case 'prerelease':
17080
- if (this.prerelease.length === 0) {
17081
- this.inc('patch', identifier, identifierBase);
17082
- }
17083
- this.inc('pre', identifier, identifierBase);
17084
- break
17085
-
17086
- case 'major':
17087
- // If this is a pre-major version, bump up to the same major version.
17088
- // Otherwise increment major.
17089
- // 1.0.0-5 bumps to 1.0.0
17090
- // 1.1.0 bumps to 2.0.0
17091
- if (
17092
- this.minor !== 0 ||
17093
- this.patch !== 0 ||
17094
- this.prerelease.length === 0
17095
- ) {
17096
- this.major++;
17097
- }
17098
- this.minor = 0;
17099
- this.patch = 0;
17100
- this.prerelease = [];
17101
- break
17102
- case 'minor':
17103
- // If this is a pre-minor version, bump up to the same minor version.
17104
- // Otherwise increment minor.
17105
- // 1.2.0-5 bumps to 1.2.0
17106
- // 1.2.1 bumps to 1.3.0
17107
- if (this.patch !== 0 || this.prerelease.length === 0) {
17108
- this.minor++;
17109
- }
17110
- this.patch = 0;
17111
- this.prerelease = [];
17112
- break
17113
- case 'patch':
17114
- // If this is not a pre-release version, it will increment the patch.
17115
- // If it is a pre-release it will bump up to the same patch version.
17116
- // 1.2.0-5 patches to 1.2.0
17117
- // 1.2.0 patches to 1.2.1
17118
- if (this.prerelease.length === 0) {
17119
- this.patch++;
17120
- }
17121
- this.prerelease = [];
17122
- break
17123
- // This probably shouldn't be used publicly.
17124
- // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
17125
- case 'pre': {
17126
- const base = Number(identifierBase) ? 1 : 0;
17127
-
17128
- if (!identifier && identifierBase === false) {
17129
- throw new Error('invalid increment argument: identifier is empty')
17130
- }
17131
-
17132
- if (this.prerelease.length === 0) {
17133
- this.prerelease = [base];
17134
- } else {
17135
- let i = this.prerelease.length;
17136
- while (--i >= 0) {
17137
- if (typeof this.prerelease[i] === 'number') {
17138
- this.prerelease[i]++;
17139
- i = -2;
17140
- }
17141
- }
17142
- if (i === -1) {
17143
- // didn't increment anything
17144
- if (identifier === this.prerelease.join('.') && identifierBase === false) {
17145
- throw new Error('invalid increment argument: identifier already exists')
17146
- }
17147
- this.prerelease.push(base);
17148
- }
17149
- }
17150
- if (identifier) {
17151
- // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
17152
- // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
17153
- let prerelease = [identifier, base];
17154
- if (identifierBase === false) {
17155
- prerelease = [identifier];
17156
- }
17157
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
17158
- if (isNaN(this.prerelease[1])) {
17159
- this.prerelease = prerelease;
17160
- }
17161
- } else {
17162
- this.prerelease = prerelease;
17163
- }
17164
- }
17165
- break
17166
- }
17167
- default:
17168
- throw new Error(`invalid increment argument: ${release}`)
17169
- }
17170
- this.raw = this.format();
17171
- if (this.build.length) {
17172
- this.raw += `+${this.build.join('.')}`;
17173
- }
17174
- return this
17175
- }
17176
- }
17177
-
17178
- var semver$2 = SemVer$d;
17179
-
17180
- const SemVer$c = semver$2;
17181
- const parse$6 = (version, options, throwErrors = false) => {
17182
- if (version instanceof SemVer$c) {
17183
- return version
17184
- }
17185
- try {
17186
- return new SemVer$c(version, options)
17187
- } catch (er) {
17188
- if (!throwErrors) {
17189
- return null
17190
- }
17191
- throw er
17192
- }
17193
- };
17383
+ // Otherwise it can be determined by checking the high version
17384
+
17385
+ if (highVersion.patch) {
17386
+ // anything higher than a patch bump would result in the wrong version
17387
+ return 'patch'
17388
+ }
17194
17389
 
17195
- var parse_1 = parse$6;
17390
+ if (highVersion.minor) {
17391
+ // anything higher than a minor bump would result in the wrong version
17392
+ return 'minor'
17393
+ }
17196
17394
 
17197
- const parse$5 = parse_1;
17198
- const valid$2 = (version, options) => {
17199
- const v = parse$5(version, options);
17200
- return v ? v.version : null
17201
- };
17202
- var valid_1 = valid$2;
17395
+ // bumping major/minor/patch all have same result
17396
+ return 'major'
17397
+ }
17203
17398
 
17204
- const parse$4 = parse_1;
17205
- const clean$1 = (version, options) => {
17206
- const s = parse$4(version.trim().replace(/^[=v]+/, ''), options);
17207
- return s ? s.version : null
17208
- };
17209
- var clean_1 = clean$1;
17210
-
17211
- const SemVer$b = semver$2;
17212
-
17213
- const inc$1 = (version, release, options, identifier, identifierBase) => {
17214
- if (typeof (options) === 'string') {
17215
- identifierBase = identifier;
17216
- identifier = options;
17217
- options = undefined;
17218
- }
17219
-
17220
- try {
17221
- return new SemVer$b(
17222
- version instanceof SemVer$b ? version.version : version,
17223
- options
17224
- ).inc(release, identifier, identifierBase).version
17225
- } catch (er) {
17226
- return null
17227
- }
17228
- };
17229
- var inc_1 = inc$1;
17399
+ // add the `pre` prefix if we are going to a prerelease version
17400
+ const prefix = highHasPre ? 'pre' : '';
17230
17401
 
17231
- const parse$3 = parse_1;
17402
+ if (v1.major !== v2.major) {
17403
+ return prefix + 'major'
17404
+ }
17232
17405
 
17233
- const diff$1 = (version1, version2) => {
17234
- const v1 = parse$3(version1, null, true);
17235
- const v2 = parse$3(version2, null, true);
17236
- const comparison = v1.compare(v2);
17406
+ if (v1.minor !== v2.minor) {
17407
+ return prefix + 'minor'
17408
+ }
17237
17409
 
17238
- if (comparison === 0) {
17239
- return null
17240
- }
17410
+ if (v1.patch !== v2.patch) {
17411
+ return prefix + 'patch'
17412
+ }
17241
17413
 
17242
- const v1Higher = comparison > 0;
17243
- const highVersion = v1Higher ? v1 : v2;
17244
- const lowVersion = v1Higher ? v2 : v1;
17245
- const highHasPre = !!highVersion.prerelease.length;
17246
- const lowHasPre = !!lowVersion.prerelease.length;
17414
+ // high and low are preleases
17415
+ return 'prerelease'
17416
+ };
17247
17417
 
17248
- if (lowHasPre && !highHasPre) {
17249
- // Going from prerelease -> no prerelease requires some special casing
17418
+ diff_1 = diff;
17419
+ return diff_1;
17420
+ }
17250
17421
 
17251
- // If the low version has only a major, then it will always be a major
17252
- // Some examples:
17253
- // 1.0.0-1 -> 1.0.0
17254
- // 1.0.0-1 -> 1.1.1
17255
- // 1.0.0-1 -> 2.0.0
17256
- if (!lowVersion.patch && !lowVersion.minor) {
17257
- return 'major'
17258
- }
17422
+ var major_1;
17423
+ var hasRequiredMajor;
17259
17424
 
17260
- // Otherwise it can be determined by checking the high version
17425
+ function requireMajor () {
17426
+ if (hasRequiredMajor) return major_1;
17427
+ hasRequiredMajor = 1;
17428
+ const SemVer = requireSemver$1();
17429
+ const major = (a, loose) => new SemVer(a, loose).major;
17430
+ major_1 = major;
17431
+ return major_1;
17432
+ }
17261
17433
 
17262
- if (highVersion.patch) {
17263
- // anything higher than a patch bump would result in the wrong version
17264
- return 'patch'
17265
- }
17434
+ var minor_1;
17435
+ var hasRequiredMinor;
17266
17436
 
17267
- if (highVersion.minor) {
17268
- // anything higher than a minor bump would result in the wrong version
17269
- return 'minor'
17270
- }
17437
+ function requireMinor () {
17438
+ if (hasRequiredMinor) return minor_1;
17439
+ hasRequiredMinor = 1;
17440
+ const SemVer = requireSemver$1();
17441
+ const minor = (a, loose) => new SemVer(a, loose).minor;
17442
+ minor_1 = minor;
17443
+ return minor_1;
17444
+ }
17445
+
17446
+ var patch_1;
17447
+ var hasRequiredPatch;
17448
+
17449
+ function requirePatch () {
17450
+ if (hasRequiredPatch) return patch_1;
17451
+ hasRequiredPatch = 1;
17452
+ const SemVer = requireSemver$1();
17453
+ const patch = (a, loose) => new SemVer(a, loose).patch;
17454
+ patch_1 = patch;
17455
+ return patch_1;
17456
+ }
17271
17457
 
17272
- // bumping major/minor/patch all have same result
17273
- return 'major'
17274
- }
17458
+ var prerelease_1;
17459
+ var hasRequiredPrerelease;
17275
17460
 
17276
- // add the `pre` prefix if we are going to a prerelease version
17277
- const prefix = highHasPre ? 'pre' : '';
17461
+ function requirePrerelease () {
17462
+ if (hasRequiredPrerelease) return prerelease_1;
17463
+ hasRequiredPrerelease = 1;
17464
+ const parse = requireParse();
17465
+ const prerelease = (version, options) => {
17466
+ const parsed = parse(version, options);
17467
+ return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
17468
+ };
17469
+ prerelease_1 = prerelease;
17470
+ return prerelease_1;
17471
+ }
17278
17472
 
17279
- if (v1.major !== v2.major) {
17280
- return prefix + 'major'
17281
- }
17473
+ var compare_1;
17474
+ var hasRequiredCompare;
17282
17475
 
17283
- if (v1.minor !== v2.minor) {
17284
- return prefix + 'minor'
17285
- }
17476
+ function requireCompare () {
17477
+ if (hasRequiredCompare) return compare_1;
17478
+ hasRequiredCompare = 1;
17479
+ const SemVer = requireSemver$1();
17480
+ const compare = (a, b, loose) =>
17481
+ new SemVer(a, loose).compare(new SemVer(b, loose));
17286
17482
 
17287
- if (v1.patch !== v2.patch) {
17288
- return prefix + 'patch'
17289
- }
17483
+ compare_1 = compare;
17484
+ return compare_1;
17485
+ }
17290
17486
 
17291
- // high and low are preleases
17292
- return 'prerelease'
17293
- };
17487
+ var rcompare_1;
17488
+ var hasRequiredRcompare;
17294
17489
 
17295
- var diff_1 = diff$1;
17490
+ function requireRcompare () {
17491
+ if (hasRequiredRcompare) return rcompare_1;
17492
+ hasRequiredRcompare = 1;
17493
+ const compare = requireCompare();
17494
+ const rcompare = (a, b, loose) => compare(b, a, loose);
17495
+ rcompare_1 = rcompare;
17496
+ return rcompare_1;
17497
+ }
17296
17498
 
17297
- const SemVer$a = semver$2;
17298
- const major$1 = (a, loose) => new SemVer$a(a, loose).major;
17299
- var major_1 = major$1;
17499
+ var compareLoose_1;
17500
+ var hasRequiredCompareLoose;
17300
17501
 
17301
- const SemVer$9 = semver$2;
17302
- const minor$1 = (a, loose) => new SemVer$9(a, loose).minor;
17303
- var minor_1 = minor$1;
17502
+ function requireCompareLoose () {
17503
+ if (hasRequiredCompareLoose) return compareLoose_1;
17504
+ hasRequiredCompareLoose = 1;
17505
+ const compare = requireCompare();
17506
+ const compareLoose = (a, b) => compare(a, b, true);
17507
+ compareLoose_1 = compareLoose;
17508
+ return compareLoose_1;
17509
+ }
17304
17510
 
17305
- const SemVer$8 = semver$2;
17306
- const patch$1 = (a, loose) => new SemVer$8(a, loose).patch;
17307
- var patch_1 = patch$1;
17511
+ var compareBuild_1;
17512
+ var hasRequiredCompareBuild;
17308
17513
 
17309
- const parse$2 = parse_1;
17310
- const prerelease$1 = (version, options) => {
17311
- const parsed = parse$2(version, options);
17312
- return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
17313
- };
17314
- var prerelease_1 = prerelease$1;
17514
+ function requireCompareBuild () {
17515
+ if (hasRequiredCompareBuild) return compareBuild_1;
17516
+ hasRequiredCompareBuild = 1;
17517
+ const SemVer = requireSemver$1();
17518
+ const compareBuild = (a, b, loose) => {
17519
+ const versionA = new SemVer(a, loose);
17520
+ const versionB = new SemVer(b, loose);
17521
+ return versionA.compare(versionB) || versionA.compareBuild(versionB)
17522
+ };
17523
+ compareBuild_1 = compareBuild;
17524
+ return compareBuild_1;
17525
+ }
17315
17526
 
17316
- const SemVer$7 = semver$2;
17317
- const compare$b = (a, b, loose) =>
17318
- new SemVer$7(a, loose).compare(new SemVer$7(b, loose));
17527
+ var sort_1;
17528
+ var hasRequiredSort;
17319
17529
 
17320
- var compare_1 = compare$b;
17530
+ function requireSort () {
17531
+ if (hasRequiredSort) return sort_1;
17532
+ hasRequiredSort = 1;
17533
+ const compareBuild = requireCompareBuild();
17534
+ const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
17535
+ sort_1 = sort;
17536
+ return sort_1;
17537
+ }
17538
+
17539
+ var rsort_1;
17540
+ var hasRequiredRsort;
17541
+
17542
+ function requireRsort () {
17543
+ if (hasRequiredRsort) return rsort_1;
17544
+ hasRequiredRsort = 1;
17545
+ const compareBuild = requireCompareBuild();
17546
+ const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
17547
+ rsort_1 = rsort;
17548
+ return rsort_1;
17549
+ }
17550
+
17551
+ var gt_1;
17552
+ var hasRequiredGt;
17553
+
17554
+ function requireGt () {
17555
+ if (hasRequiredGt) return gt_1;
17556
+ hasRequiredGt = 1;
17557
+ const compare = requireCompare();
17558
+ const gt = (a, b, loose) => compare(a, b, loose) > 0;
17559
+ gt_1 = gt;
17560
+ return gt_1;
17561
+ }
17562
+
17563
+ var lt_1;
17564
+ var hasRequiredLt;
17565
+
17566
+ function requireLt () {
17567
+ if (hasRequiredLt) return lt_1;
17568
+ hasRequiredLt = 1;
17569
+ const compare = requireCompare();
17570
+ const lt = (a, b, loose) => compare(a, b, loose) < 0;
17571
+ lt_1 = lt;
17572
+ return lt_1;
17573
+ }
17574
+
17575
+ var eq_1;
17576
+ var hasRequiredEq;
17577
+
17578
+ function requireEq () {
17579
+ if (hasRequiredEq) return eq_1;
17580
+ hasRequiredEq = 1;
17581
+ const compare = requireCompare();
17582
+ const eq = (a, b, loose) => compare(a, b, loose) === 0;
17583
+ eq_1 = eq;
17584
+ return eq_1;
17585
+ }
17586
+
17587
+ var neq_1;
17588
+ var hasRequiredNeq;
17589
+
17590
+ function requireNeq () {
17591
+ if (hasRequiredNeq) return neq_1;
17592
+ hasRequiredNeq = 1;
17593
+ const compare = requireCompare();
17594
+ const neq = (a, b, loose) => compare(a, b, loose) !== 0;
17595
+ neq_1 = neq;
17596
+ return neq_1;
17597
+ }
17598
+
17599
+ var gte_1;
17600
+ var hasRequiredGte;
17601
+
17602
+ function requireGte () {
17603
+ if (hasRequiredGte) return gte_1;
17604
+ hasRequiredGte = 1;
17605
+ const compare = requireCompare();
17606
+ const gte = (a, b, loose) => compare(a, b, loose) >= 0;
17607
+ gte_1 = gte;
17608
+ return gte_1;
17609
+ }
17610
+
17611
+ var lte_1;
17612
+ var hasRequiredLte;
17613
+
17614
+ function requireLte () {
17615
+ if (hasRequiredLte) return lte_1;
17616
+ hasRequiredLte = 1;
17617
+ const compare = requireCompare();
17618
+ const lte = (a, b, loose) => compare(a, b, loose) <= 0;
17619
+ lte_1 = lte;
17620
+ return lte_1;
17621
+ }
17622
+
17623
+ var cmp_1;
17624
+ var hasRequiredCmp;
17625
+
17626
+ function requireCmp () {
17627
+ if (hasRequiredCmp) return cmp_1;
17628
+ hasRequiredCmp = 1;
17629
+ const eq = requireEq();
17630
+ const neq = requireNeq();
17631
+ const gt = requireGt();
17632
+ const gte = requireGte();
17633
+ const lt = requireLt();
17634
+ const lte = requireLte();
17635
+
17636
+ const cmp = (a, op, b, loose) => {
17637
+ switch (op) {
17638
+ case '===':
17639
+ if (typeof a === 'object') {
17640
+ a = a.version;
17641
+ }
17642
+ if (typeof b === 'object') {
17643
+ b = b.version;
17644
+ }
17645
+ return a === b
17321
17646
 
17322
- const compare$a = compare_1;
17323
- const rcompare$1 = (a, b, loose) => compare$a(b, a, loose);
17324
- var rcompare_1 = rcompare$1;
17647
+ case '!==':
17648
+ if (typeof a === 'object') {
17649
+ a = a.version;
17650
+ }
17651
+ if (typeof b === 'object') {
17652
+ b = b.version;
17653
+ }
17654
+ return a !== b
17325
17655
 
17326
- const compare$9 = compare_1;
17327
- const compareLoose$1 = (a, b) => compare$9(a, b, true);
17328
- var compareLoose_1 = compareLoose$1;
17656
+ case '':
17657
+ case '=':
17658
+ case '==':
17659
+ return eq(a, b, loose)
17329
17660
 
17330
- const SemVer$6 = semver$2;
17331
- const compareBuild$3 = (a, b, loose) => {
17332
- const versionA = new SemVer$6(a, loose);
17333
- const versionB = new SemVer$6(b, loose);
17334
- return versionA.compare(versionB) || versionA.compareBuild(versionB)
17335
- };
17336
- var compareBuild_1 = compareBuild$3;
17337
-
17338
- const compareBuild$2 = compareBuild_1;
17339
- const sort$1 = (list, loose) => list.sort((a, b) => compareBuild$2(a, b, loose));
17340
- var sort_1 = sort$1;
17341
-
17342
- const compareBuild$1 = compareBuild_1;
17343
- const rsort$1 = (list, loose) => list.sort((a, b) => compareBuild$1(b, a, loose));
17344
- var rsort_1 = rsort$1;
17345
-
17346
- const compare$8 = compare_1;
17347
- const gt$4 = (a, b, loose) => compare$8(a, b, loose) > 0;
17348
- var gt_1 = gt$4;
17349
-
17350
- const compare$7 = compare_1;
17351
- const lt$3 = (a, b, loose) => compare$7(a, b, loose) < 0;
17352
- var lt_1 = lt$3;
17353
-
17354
- const compare$6 = compare_1;
17355
- const eq$2 = (a, b, loose) => compare$6(a, b, loose) === 0;
17356
- var eq_1 = eq$2;
17357
-
17358
- const compare$5 = compare_1;
17359
- const neq$2 = (a, b, loose) => compare$5(a, b, loose) !== 0;
17360
- var neq_1 = neq$2;
17361
-
17362
- const compare$4 = compare_1;
17363
- const gte$3 = (a, b, loose) => compare$4(a, b, loose) >= 0;
17364
- var gte_1 = gte$3;
17365
-
17366
- const compare$3 = compare_1;
17367
- const lte$3 = (a, b, loose) => compare$3(a, b, loose) <= 0;
17368
- var lte_1 = lte$3;
17369
-
17370
- const eq$1 = eq_1;
17371
- const neq$1 = neq_1;
17372
- const gt$3 = gt_1;
17373
- const gte$2 = gte_1;
17374
- const lt$2 = lt_1;
17375
- const lte$2 = lte_1;
17376
-
17377
- const cmp$1 = (a, op, b, loose) => {
17378
- switch (op) {
17379
- case '===':
17380
- if (typeof a === 'object') {
17381
- a = a.version;
17382
- }
17383
- if (typeof b === 'object') {
17384
- b = b.version;
17385
- }
17386
- return a === b
17387
-
17388
- case '!==':
17389
- if (typeof a === 'object') {
17390
- a = a.version;
17391
- }
17392
- if (typeof b === 'object') {
17393
- b = b.version;
17394
- }
17395
- return a !== b
17396
-
17397
- case '':
17398
- case '=':
17399
- case '==':
17400
- return eq$1(a, b, loose)
17401
-
17402
- case '!=':
17403
- return neq$1(a, b, loose)
17404
-
17405
- case '>':
17406
- return gt$3(a, b, loose)
17407
-
17408
- case '>=':
17409
- return gte$2(a, b, loose)
17410
-
17411
- case '<':
17412
- return lt$2(a, b, loose)
17413
-
17414
- case '<=':
17415
- return lte$2(a, b, loose)
17416
-
17417
- default:
17418
- throw new TypeError(`Invalid operator: ${op}`)
17419
- }
17420
- };
17421
- var cmp_1 = cmp$1;
17422
-
17423
- const SemVer$5 = semver$2;
17424
- const parse$1 = parse_1;
17425
- const { safeRe: re, t } = reExports;
17426
-
17427
- const coerce$1 = (version, options) => {
17428
- if (version instanceof SemVer$5) {
17429
- return version
17430
- }
17431
-
17432
- if (typeof version === 'number') {
17433
- version = String(version);
17434
- }
17435
-
17436
- if (typeof version !== 'string') {
17437
- return null
17438
- }
17439
-
17440
- options = options || {};
17441
-
17442
- let match = null;
17443
- if (!options.rtl) {
17444
- match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
17445
- } else {
17446
- // Find the right-most coercible string that does not share
17447
- // a terminus with a more left-ward coercible string.
17448
- // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
17449
- // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
17450
- //
17451
- // Walk through the string checking with a /g regexp
17452
- // Manually set the index so as to pick up overlapping matches.
17453
- // Stop when we get a match that ends at the string end, since no
17454
- // coercible string can be more right-ward without the same terminus.
17455
- const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
17456
- let next;
17457
- while ((next = coerceRtlRegex.exec(version)) &&
17458
- (!match || match.index + match[0].length !== version.length)
17459
- ) {
17460
- if (!match ||
17461
- next.index + next[0].length !== match.index + match[0].length) {
17462
- match = next;
17463
- }
17464
- coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
17465
- }
17466
- // leave it in a clean state
17467
- coerceRtlRegex.lastIndex = -1;
17468
- }
17469
-
17470
- if (match === null) {
17471
- return null
17472
- }
17473
-
17474
- const major = match[2];
17475
- const minor = match[3] || '0';
17476
- const patch = match[4] || '0';
17477
- const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
17478
- const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
17479
-
17480
- return parse$1(`${major}.${minor}.${patch}${prerelease}${build}`, options)
17481
- };
17482
- var coerce_1 = coerce$1;
17661
+ case '!=':
17662
+ return neq(a, b, loose)
17663
+
17664
+ case '>':
17665
+ return gt(a, b, loose)
17666
+
17667
+ case '>=':
17668
+ return gte(a, b, loose)
17669
+
17670
+ case '<':
17671
+ return lt(a, b, loose)
17672
+
17673
+ case '<=':
17674
+ return lte(a, b, loose)
17675
+
17676
+ default:
17677
+ throw new TypeError(`Invalid operator: ${op}`)
17678
+ }
17679
+ };
17680
+ cmp_1 = cmp;
17681
+ return cmp_1;
17682
+ }
17683
+
17684
+ var coerce_1;
17685
+ var hasRequiredCoerce;
17686
+
17687
+ function requireCoerce () {
17688
+ if (hasRequiredCoerce) return coerce_1;
17689
+ hasRequiredCoerce = 1;
17690
+ const SemVer = requireSemver$1();
17691
+ const parse = requireParse();
17692
+ const { safeRe: re, t } = requireRe();
17693
+
17694
+ const coerce = (version, options) => {
17695
+ if (version instanceof SemVer) {
17696
+ return version
17697
+ }
17698
+
17699
+ if (typeof version === 'number') {
17700
+ version = String(version);
17701
+ }
17702
+
17703
+ if (typeof version !== 'string') {
17704
+ return null
17705
+ }
17706
+
17707
+ options = options || {};
17708
+
17709
+ let match = null;
17710
+ if (!options.rtl) {
17711
+ match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
17712
+ } else {
17713
+ // Find the right-most coercible string that does not share
17714
+ // a terminus with a more left-ward coercible string.
17715
+ // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
17716
+ // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
17717
+ //
17718
+ // Walk through the string checking with a /g regexp
17719
+ // Manually set the index so as to pick up overlapping matches.
17720
+ // Stop when we get a match that ends at the string end, since no
17721
+ // coercible string can be more right-ward without the same terminus.
17722
+ const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
17723
+ let next;
17724
+ while ((next = coerceRtlRegex.exec(version)) &&
17725
+ (!match || match.index + match[0].length !== version.length)
17726
+ ) {
17727
+ if (!match ||
17728
+ next.index + next[0].length !== match.index + match[0].length) {
17729
+ match = next;
17730
+ }
17731
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
17732
+ }
17733
+ // leave it in a clean state
17734
+ coerceRtlRegex.lastIndex = -1;
17735
+ }
17736
+
17737
+ if (match === null) {
17738
+ return null
17739
+ }
17740
+
17741
+ const major = match[2];
17742
+ const minor = match[3] || '0';
17743
+ const patch = match[4] || '0';
17744
+ const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
17745
+ const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
17746
+
17747
+ return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
17748
+ };
17749
+ coerce_1 = coerce;
17750
+ return coerce_1;
17751
+ }
17483
17752
 
17484
17753
  var lrucache;
17485
17754
  var hasRequiredLrucache;
@@ -17753,18 +18022,18 @@ function requireRange () {
17753
18022
  const LRU = requireLrucache();
17754
18023
  const cache = new LRU();
17755
18024
 
17756
- const parseOptions = parseOptions_1;
18025
+ const parseOptions = requireParseOptions();
17757
18026
  const Comparator = requireComparator();
17758
- const debug = debug_1;
17759
- const SemVer = semver$2;
18027
+ const debug = requireDebug();
18028
+ const SemVer = requireSemver$1();
17760
18029
  const {
17761
18030
  safeRe: re,
17762
18031
  t,
17763
18032
  comparatorTrimReplace,
17764
18033
  tildeTrimReplace,
17765
18034
  caretTrimReplace,
17766
- } = reExports;
17767
- const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = constants$1;
18035
+ } = requireRe();
18036
+ const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = requireConstants();
17768
18037
 
17769
18038
  const isNullSet = c => c.value === '<0.0.0-0';
17770
18039
  const isAny = c => c.value === '';
@@ -18234,653 +18503,758 @@ function requireComparator () {
18234
18503
 
18235
18504
  comparator = Comparator;
18236
18505
 
18237
- const parseOptions = parseOptions_1;
18238
- const { safeRe: re, t } = reExports;
18239
- const cmp = cmp_1;
18240
- const debug = debug_1;
18241
- const SemVer = semver$2;
18506
+ const parseOptions = requireParseOptions();
18507
+ const { safeRe: re, t } = requireRe();
18508
+ const cmp = requireCmp();
18509
+ const debug = requireDebug();
18510
+ const SemVer = requireSemver$1();
18242
18511
  const Range = requireRange();
18243
18512
  return comparator;
18244
18513
  }
18245
18514
 
18246
- const Range$9 = requireRange();
18247
- const satisfies$4 = (version, range, options) => {
18248
- try {
18249
- range = new Range$9(range, options);
18250
- } catch (er) {
18251
- return false
18252
- }
18253
- return range.test(version)
18254
- };
18255
- var satisfies_1 = satisfies$4;
18256
-
18257
- const Range$8 = requireRange();
18258
-
18259
- // Mostly just for testing and legacy API reasons
18260
- const toComparators$1 = (range, options) =>
18261
- new Range$8(range, options).set
18262
- .map(comp => comp.map(c => c.value).join(' ').trim().split(' '));
18263
-
18264
- var toComparators_1 = toComparators$1;
18265
-
18266
- const SemVer$4 = semver$2;
18267
- const Range$7 = requireRange();
18268
-
18269
- const maxSatisfying$1 = (versions, range, options) => {
18270
- let max = null;
18271
- let maxSV = null;
18272
- let rangeObj = null;
18273
- try {
18274
- rangeObj = new Range$7(range, options);
18275
- } catch (er) {
18276
- return null
18277
- }
18278
- versions.forEach((v) => {
18279
- if (rangeObj.test(v)) {
18280
- // satisfies(v, range, options)
18281
- if (!max || maxSV.compare(v) === -1) {
18282
- // compare(max, v, true)
18283
- max = v;
18284
- maxSV = new SemVer$4(max, options);
18285
- }
18286
- }
18287
- });
18288
- return max
18289
- };
18290
- var maxSatisfying_1 = maxSatisfying$1;
18291
-
18292
- const SemVer$3 = semver$2;
18293
- const Range$6 = requireRange();
18294
- const minSatisfying$1 = (versions, range, options) => {
18295
- let min = null;
18296
- let minSV = null;
18297
- let rangeObj = null;
18298
- try {
18299
- rangeObj = new Range$6(range, options);
18300
- } catch (er) {
18301
- return null
18302
- }
18303
- versions.forEach((v) => {
18304
- if (rangeObj.test(v)) {
18305
- // satisfies(v, range, options)
18306
- if (!min || minSV.compare(v) === 1) {
18307
- // compare(min, v, true)
18308
- min = v;
18309
- minSV = new SemVer$3(min, options);
18310
- }
18311
- }
18312
- });
18313
- return min
18314
- };
18315
- var minSatisfying_1 = minSatisfying$1;
18316
-
18317
- const SemVer$2 = semver$2;
18318
- const Range$5 = requireRange();
18319
- const gt$2 = gt_1;
18320
-
18321
- const minVersion$1 = (range, loose) => {
18322
- range = new Range$5(range, loose);
18323
-
18324
- let minver = new SemVer$2('0.0.0');
18325
- if (range.test(minver)) {
18326
- return minver
18327
- }
18328
-
18329
- minver = new SemVer$2('0.0.0-0');
18330
- if (range.test(minver)) {
18331
- return minver
18332
- }
18333
-
18334
- minver = null;
18335
- for (let i = 0; i < range.set.length; ++i) {
18336
- const comparators = range.set[i];
18337
-
18338
- let setMin = null;
18339
- comparators.forEach((comparator) => {
18340
- // Clone to avoid manipulating the comparator's semver object.
18341
- const compver = new SemVer$2(comparator.semver.version);
18342
- switch (comparator.operator) {
18343
- case '>':
18344
- if (compver.prerelease.length === 0) {
18345
- compver.patch++;
18346
- } else {
18347
- compver.prerelease.push(0);
18348
- }
18349
- compver.raw = compver.format();
18350
- /* fallthrough */
18351
- case '':
18352
- case '>=':
18353
- if (!setMin || gt$2(compver, setMin)) {
18354
- setMin = compver;
18355
- }
18356
- break
18357
- case '<':
18358
- case '<=':
18359
- /* Ignore maximum versions */
18360
- break
18361
- /* istanbul ignore next */
18362
- default:
18363
- throw new Error(`Unexpected operation: ${comparator.operator}`)
18364
- }
18365
- });
18366
- if (setMin && (!minver || gt$2(minver, setMin))) {
18367
- minver = setMin;
18368
- }
18369
- }
18515
+ var satisfies_1;
18516
+ var hasRequiredSatisfies;
18370
18517
 
18371
- if (minver && range.test(minver)) {
18372
- return minver
18373
- }
18518
+ function requireSatisfies () {
18519
+ if (hasRequiredSatisfies) return satisfies_1;
18520
+ hasRequiredSatisfies = 1;
18521
+ const Range = requireRange();
18522
+ const satisfies = (version, range, options) => {
18523
+ try {
18524
+ range = new Range(range, options);
18525
+ } catch (er) {
18526
+ return false
18527
+ }
18528
+ return range.test(version)
18529
+ };
18530
+ satisfies_1 = satisfies;
18531
+ return satisfies_1;
18532
+ }
18374
18533
 
18375
- return null
18376
- };
18377
- var minVersion_1 = minVersion$1;
18378
-
18379
- const Range$4 = requireRange();
18380
- const validRange$1 = (range, options) => {
18381
- try {
18382
- // Return '*' instead of '' so that truthiness works.
18383
- // This will throw if it's invalid anyway
18384
- return new Range$4(range, options).range || '*'
18385
- } catch (er) {
18386
- return null
18387
- }
18388
- };
18389
- var valid$1 = validRange$1;
18390
-
18391
- const SemVer$1 = semver$2;
18392
- const Comparator$2 = requireComparator();
18393
- const { ANY: ANY$1 } = Comparator$2;
18394
- const Range$3 = requireRange();
18395
- const satisfies$3 = satisfies_1;
18396
- const gt$1 = gt_1;
18397
- const lt$1 = lt_1;
18398
- const lte$1 = lte_1;
18399
- const gte$1 = gte_1;
18400
-
18401
- const outside$3 = (version, range, hilo, options) => {
18402
- version = new SemVer$1(version, options);
18403
- range = new Range$3(range, options);
18404
-
18405
- let gtfn, ltefn, ltfn, comp, ecomp;
18406
- switch (hilo) {
18407
- case '>':
18408
- gtfn = gt$1;
18409
- ltefn = lte$1;
18410
- ltfn = lt$1;
18411
- comp = '>';
18412
- ecomp = '>=';
18413
- break
18414
- case '<':
18415
- gtfn = lt$1;
18416
- ltefn = gte$1;
18417
- ltfn = gt$1;
18418
- comp = '<';
18419
- ecomp = '<=';
18420
- break
18421
- default:
18422
- throw new TypeError('Must provide a hilo val of "<" or ">"')
18423
- }
18424
-
18425
- // If it satisfies the range it is not outside
18426
- if (satisfies$3(version, range, options)) {
18427
- return false
18428
- }
18429
-
18430
- // From now on, variable terms are as if we're in "gtr" mode.
18431
- // but note that everything is flipped for the "ltr" function.
18432
-
18433
- for (let i = 0; i < range.set.length; ++i) {
18434
- const comparators = range.set[i];
18435
-
18436
- let high = null;
18437
- let low = null;
18438
-
18439
- comparators.forEach((comparator) => {
18440
- if (comparator.semver === ANY$1) {
18441
- comparator = new Comparator$2('>=0.0.0');
18442
- }
18443
- high = high || comparator;
18444
- low = low || comparator;
18445
- if (gtfn(comparator.semver, high.semver, options)) {
18446
- high = comparator;
18447
- } else if (ltfn(comparator.semver, low.semver, options)) {
18448
- low = comparator;
18449
- }
18450
- });
18534
+ var toComparators_1;
18535
+ var hasRequiredToComparators;
18451
18536
 
18452
- // If the edge version comparator has a operator then our version
18453
- // isn't outside it
18454
- if (high.operator === comp || high.operator === ecomp) {
18455
- return false
18456
- }
18537
+ function requireToComparators () {
18538
+ if (hasRequiredToComparators) return toComparators_1;
18539
+ hasRequiredToComparators = 1;
18540
+ const Range = requireRange();
18457
18541
 
18458
- // If the lowest version comparator has an operator and our version
18459
- // is less than it then it isn't higher than the range
18460
- if ((!low.operator || low.operator === comp) &&
18461
- ltefn(version, low.semver)) {
18462
- return false
18463
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
18464
- return false
18465
- }
18466
- }
18467
- return true
18468
- };
18542
+ // Mostly just for testing and legacy API reasons
18543
+ const toComparators = (range, options) =>
18544
+ new Range(range, options).set
18545
+ .map(comp => comp.map(c => c.value).join(' ').trim().split(' '));
18469
18546
 
18470
- var outside_1 = outside$3;
18547
+ toComparators_1 = toComparators;
18548
+ return toComparators_1;
18549
+ }
18471
18550
 
18472
- // Determine if version is greater than all the versions possible in the range.
18473
- const outside$2 = outside_1;
18474
- const gtr$1 = (version, range, options) => outside$2(version, range, '>', options);
18475
- var gtr_1 = gtr$1;
18551
+ var maxSatisfying_1;
18552
+ var hasRequiredMaxSatisfying;
18476
18553
 
18477
- const outside$1 = outside_1;
18478
- // Determine if version is less than all the versions possible in the range
18479
- const ltr$1 = (version, range, options) => outside$1(version, range, '<', options);
18480
- var ltr_1 = ltr$1;
18554
+ function requireMaxSatisfying () {
18555
+ if (hasRequiredMaxSatisfying) return maxSatisfying_1;
18556
+ hasRequiredMaxSatisfying = 1;
18557
+ const SemVer = requireSemver$1();
18558
+ const Range = requireRange();
18481
18559
 
18482
- const Range$2 = requireRange();
18483
- const intersects$1 = (r1, r2, options) => {
18484
- r1 = new Range$2(r1, options);
18485
- r2 = new Range$2(r2, options);
18486
- return r1.intersects(r2, options)
18487
- };
18488
- var intersects_1 = intersects$1;
18489
-
18490
- // given a set of versions and a range, create a "simplified" range
18491
- // that includes the same versions that the original range does
18492
- // If the original range is shorter than the simplified one, return that.
18493
- const satisfies$2 = satisfies_1;
18494
- const compare$2 = compare_1;
18495
- var simplify = (versions, range, options) => {
18496
- const set = [];
18497
- let first = null;
18498
- let prev = null;
18499
- const v = versions.sort((a, b) => compare$2(a, b, options));
18500
- for (const version of v) {
18501
- const included = satisfies$2(version, range, options);
18502
- if (included) {
18503
- prev = version;
18504
- if (!first) {
18505
- first = version;
18506
- }
18507
- } else {
18508
- if (prev) {
18509
- set.push([first, prev]);
18510
- }
18511
- prev = null;
18512
- first = null;
18513
- }
18514
- }
18515
- if (first) {
18516
- set.push([first, null]);
18517
- }
18518
-
18519
- const ranges = [];
18520
- for (const [min, max] of set) {
18521
- if (min === max) {
18522
- ranges.push(min);
18523
- } else if (!max && min === v[0]) {
18524
- ranges.push('*');
18525
- } else if (!max) {
18526
- ranges.push(`>=${min}`);
18527
- } else if (min === v[0]) {
18528
- ranges.push(`<=${max}`);
18529
- } else {
18530
- ranges.push(`${min} - ${max}`);
18531
- }
18532
- }
18533
- const simplified = ranges.join(' || ');
18534
- const original = typeof range.raw === 'string' ? range.raw : String(range);
18535
- return simplified.length < original.length ? simplified : range
18536
- };
18560
+ const maxSatisfying = (versions, range, options) => {
18561
+ let max = null;
18562
+ let maxSV = null;
18563
+ let rangeObj = null;
18564
+ try {
18565
+ rangeObj = new Range(range, options);
18566
+ } catch (er) {
18567
+ return null
18568
+ }
18569
+ versions.forEach((v) => {
18570
+ if (rangeObj.test(v)) {
18571
+ // satisfies(v, range, options)
18572
+ if (!max || maxSV.compare(v) === -1) {
18573
+ // compare(max, v, true)
18574
+ max = v;
18575
+ maxSV = new SemVer(max, options);
18576
+ }
18577
+ }
18578
+ });
18579
+ return max
18580
+ };
18581
+ maxSatisfying_1 = maxSatisfying;
18582
+ return maxSatisfying_1;
18583
+ }
18537
18584
 
18538
- const Range$1 = requireRange();
18539
- const Comparator$1 = requireComparator();
18540
- const { ANY } = Comparator$1;
18541
- const satisfies$1 = satisfies_1;
18542
- const compare$1 = compare_1;
18543
-
18544
- // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
18545
- // - Every simple range `r1, r2, ...` is a null set, OR
18546
- // - Every simple range `r1, r2, ...` which is not a null set is a subset of
18547
- // some `R1, R2, ...`
18548
- //
18549
- // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
18550
- // - If c is only the ANY comparator
18551
- // - If C is only the ANY comparator, return true
18552
- // - Else if in prerelease mode, return false
18553
- // - else replace c with `[>=0.0.0]`
18554
- // - If C is only the ANY comparator
18555
- // - if in prerelease mode, return true
18556
- // - else replace C with `[>=0.0.0]`
18557
- // - Let EQ be the set of = comparators in c
18558
- // - If EQ is more than one, return true (null set)
18559
- // - Let GT be the highest > or >= comparator in c
18560
- // - Let LT be the lowest < or <= comparator in c
18561
- // - If GT and LT, and GT.semver > LT.semver, return true (null set)
18562
- // - If any C is a = range, and GT or LT are set, return false
18563
- // - If EQ
18564
- // - If GT, and EQ does not satisfy GT, return true (null set)
18565
- // - If LT, and EQ does not satisfy LT, return true (null set)
18566
- // - If EQ satisfies every C, return true
18567
- // - Else return false
18568
- // - If GT
18569
- // - If GT.semver is lower than any > or >= comp in C, return false
18570
- // - If GT is >=, and GT.semver does not satisfy every C, return false
18571
- // - If GT.semver has a prerelease, and not in prerelease mode
18572
- // - If no C has a prerelease and the GT.semver tuple, return false
18573
- // - If LT
18574
- // - If LT.semver is greater than any < or <= comp in C, return false
18575
- // - If LT is <=, and LT.semver does not satisfy every C, return false
18576
- // - If GT.semver has a prerelease, and not in prerelease mode
18577
- // - If no C has a prerelease and the LT.semver tuple, return false
18578
- // - Else return true
18579
-
18580
- const subset$1 = (sub, dom, options = {}) => {
18581
- if (sub === dom) {
18582
- return true
18583
- }
18584
-
18585
- sub = new Range$1(sub, options);
18586
- dom = new Range$1(dom, options);
18587
- let sawNonNull = false;
18588
-
18589
- OUTER: for (const simpleSub of sub.set) {
18590
- for (const simpleDom of dom.set) {
18591
- const isSub = simpleSubset(simpleSub, simpleDom, options);
18592
- sawNonNull = sawNonNull || isSub !== null;
18593
- if (isSub) {
18594
- continue OUTER
18595
- }
18596
- }
18597
- // the null set is a subset of everything, but null simple ranges in
18598
- // a complex range should be ignored. so if we saw a non-null range,
18599
- // then we know this isn't a subset, but if EVERY simple range was null,
18600
- // then it is a subset.
18601
- if (sawNonNull) {
18602
- return false
18603
- }
18604
- }
18605
- return true
18606
- };
18585
+ var minSatisfying_1;
18586
+ var hasRequiredMinSatisfying;
18607
18587
 
18608
- const minimumVersionWithPreRelease = [new Comparator$1('>=0.0.0-0')];
18609
- const minimumVersion = [new Comparator$1('>=0.0.0')];
18610
-
18611
- const simpleSubset = (sub, dom, options) => {
18612
- if (sub === dom) {
18613
- return true
18614
- }
18615
-
18616
- if (sub.length === 1 && sub[0].semver === ANY) {
18617
- if (dom.length === 1 && dom[0].semver === ANY) {
18618
- return true
18619
- } else if (options.includePrerelease) {
18620
- sub = minimumVersionWithPreRelease;
18621
- } else {
18622
- sub = minimumVersion;
18623
- }
18624
- }
18625
-
18626
- if (dom.length === 1 && dom[0].semver === ANY) {
18627
- if (options.includePrerelease) {
18628
- return true
18629
- } else {
18630
- dom = minimumVersion;
18631
- }
18632
- }
18633
-
18634
- const eqSet = new Set();
18635
- let gt, lt;
18636
- for (const c of sub) {
18637
- if (c.operator === '>' || c.operator === '>=') {
18638
- gt = higherGT(gt, c, options);
18639
- } else if (c.operator === '<' || c.operator === '<=') {
18640
- lt = lowerLT(lt, c, options);
18641
- } else {
18642
- eqSet.add(c.semver);
18643
- }
18644
- }
18645
-
18646
- if (eqSet.size > 1) {
18647
- return null
18648
- }
18649
-
18650
- let gtltComp;
18651
- if (gt && lt) {
18652
- gtltComp = compare$1(gt.semver, lt.semver, options);
18653
- if (gtltComp > 0) {
18654
- return null
18655
- } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
18656
- return null
18657
- }
18658
- }
18659
-
18660
- // will iterate one or zero times
18661
- for (const eq of eqSet) {
18662
- if (gt && !satisfies$1(eq, String(gt), options)) {
18663
- return null
18664
- }
18665
-
18666
- if (lt && !satisfies$1(eq, String(lt), options)) {
18667
- return null
18668
- }
18669
-
18670
- for (const c of dom) {
18671
- if (!satisfies$1(eq, String(c), options)) {
18672
- return false
18673
- }
18674
- }
18675
-
18676
- return true
18677
- }
18678
-
18679
- let higher, lower;
18680
- let hasDomLT, hasDomGT;
18681
- // if the subset has a prerelease, we need a comparator in the superset
18682
- // with the same tuple and a prerelease, or it's not a subset
18683
- let needDomLTPre = lt &&
18684
- !options.includePrerelease &&
18685
- lt.semver.prerelease.length ? lt.semver : false;
18686
- let needDomGTPre = gt &&
18687
- !options.includePrerelease &&
18688
- gt.semver.prerelease.length ? gt.semver : false;
18689
- // exception: <1.2.3-0 is the same as <1.2.3
18690
- if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
18691
- lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
18692
- needDomLTPre = false;
18693
- }
18694
-
18695
- for (const c of dom) {
18696
- hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=';
18697
- hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=';
18698
- if (gt) {
18699
- if (needDomGTPre) {
18700
- if (c.semver.prerelease && c.semver.prerelease.length &&
18701
- c.semver.major === needDomGTPre.major &&
18702
- c.semver.minor === needDomGTPre.minor &&
18703
- c.semver.patch === needDomGTPre.patch) {
18704
- needDomGTPre = false;
18705
- }
18706
- }
18707
- if (c.operator === '>' || c.operator === '>=') {
18708
- higher = higherGT(gt, c, options);
18709
- if (higher === c && higher !== gt) {
18710
- return false
18711
- }
18712
- } else if (gt.operator === '>=' && !satisfies$1(gt.semver, String(c), options)) {
18713
- return false
18714
- }
18715
- }
18716
- if (lt) {
18717
- if (needDomLTPre) {
18718
- if (c.semver.prerelease && c.semver.prerelease.length &&
18719
- c.semver.major === needDomLTPre.major &&
18720
- c.semver.minor === needDomLTPre.minor &&
18721
- c.semver.patch === needDomLTPre.patch) {
18722
- needDomLTPre = false;
18723
- }
18724
- }
18725
- if (c.operator === '<' || c.operator === '<=') {
18726
- lower = lowerLT(lt, c, options);
18727
- if (lower === c && lower !== lt) {
18728
- return false
18729
- }
18730
- } else if (lt.operator === '<=' && !satisfies$1(lt.semver, String(c), options)) {
18731
- return false
18732
- }
18733
- }
18734
- if (!c.operator && (lt || gt) && gtltComp !== 0) {
18735
- return false
18736
- }
18737
- }
18738
-
18739
- // if there was a < or >, and nothing in the dom, then must be false
18740
- // UNLESS it was limited by another range in the other direction.
18741
- // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
18742
- if (gt && hasDomLT && !lt && gtltComp !== 0) {
18743
- return false
18744
- }
18745
-
18746
- if (lt && hasDomGT && !gt && gtltComp !== 0) {
18747
- return false
18748
- }
18749
-
18750
- // we needed a prerelease range in a specific tuple, but didn't get one
18751
- // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
18752
- // because it includes prereleases in the 1.2.3 tuple
18753
- if (needDomGTPre || needDomLTPre) {
18754
- return false
18755
- }
18756
-
18757
- return true
18758
- };
18588
+ function requireMinSatisfying () {
18589
+ if (hasRequiredMinSatisfying) return minSatisfying_1;
18590
+ hasRequiredMinSatisfying = 1;
18591
+ const SemVer = requireSemver$1();
18592
+ const Range = requireRange();
18593
+ const minSatisfying = (versions, range, options) => {
18594
+ let min = null;
18595
+ let minSV = null;
18596
+ let rangeObj = null;
18597
+ try {
18598
+ rangeObj = new Range(range, options);
18599
+ } catch (er) {
18600
+ return null
18601
+ }
18602
+ versions.forEach((v) => {
18603
+ if (rangeObj.test(v)) {
18604
+ // satisfies(v, range, options)
18605
+ if (!min || minSV.compare(v) === 1) {
18606
+ // compare(min, v, true)
18607
+ min = v;
18608
+ minSV = new SemVer(min, options);
18609
+ }
18610
+ }
18611
+ });
18612
+ return min
18613
+ };
18614
+ minSatisfying_1 = minSatisfying;
18615
+ return minSatisfying_1;
18616
+ }
18759
18617
 
18760
- // >=1.2.3 is lower than >1.2.3
18761
- const higherGT = (a, b, options) => {
18762
- if (!a) {
18763
- return b
18764
- }
18765
- const comp = compare$1(a.semver, b.semver, options);
18766
- return comp > 0 ? a
18767
- : comp < 0 ? b
18768
- : b.operator === '>' && a.operator === '>=' ? b
18769
- : a
18770
- };
18618
+ var minVersion_1;
18619
+ var hasRequiredMinVersion;
18771
18620
 
18772
- // <=1.2.3 is higher than <1.2.3
18773
- const lowerLT = (a, b, options) => {
18774
- if (!a) {
18775
- return b
18776
- }
18777
- const comp = compare$1(a.semver, b.semver, options);
18778
- return comp < 0 ? a
18779
- : comp > 0 ? b
18780
- : b.operator === '<' && a.operator === '<=' ? b
18781
- : a
18782
- };
18621
+ function requireMinVersion () {
18622
+ if (hasRequiredMinVersion) return minVersion_1;
18623
+ hasRequiredMinVersion = 1;
18624
+ const SemVer = requireSemver$1();
18625
+ const Range = requireRange();
18626
+ const gt = requireGt();
18783
18627
 
18784
- var subset_1 = subset$1;
18785
-
18786
- // just pre-load all the stuff that index.js lazily exports
18787
- const internalRe = reExports;
18788
- const constants = constants$1;
18789
- const SemVer = semver$2;
18790
- const identifiers = identifiers$1;
18791
- const parse = parse_1;
18792
- const valid = valid_1;
18793
- const clean = clean_1;
18794
- const inc = inc_1;
18795
- const diff = diff_1;
18796
- const major = major_1;
18797
- const minor = minor_1;
18798
- const patch = patch_1;
18799
- const prerelease = prerelease_1;
18800
- const compare = compare_1;
18801
- const rcompare = rcompare_1;
18802
- const compareLoose = compareLoose_1;
18803
- const compareBuild = compareBuild_1;
18804
- const sort = sort_1;
18805
- const rsort = rsort_1;
18806
- const gt = gt_1;
18807
- const lt = lt_1;
18808
- const eq = eq_1;
18809
- const neq = neq_1;
18810
- const gte = gte_1;
18811
- const lte = lte_1;
18812
- const cmp = cmp_1;
18813
- const coerce = coerce_1;
18814
- const Comparator = requireComparator();
18815
- const Range = requireRange();
18816
- const satisfies = satisfies_1;
18817
- const toComparators = toComparators_1;
18818
- const maxSatisfying = maxSatisfying_1;
18819
- const minSatisfying = minSatisfying_1;
18820
- const minVersion = minVersion_1;
18821
- const validRange = valid$1;
18822
- const outside = outside_1;
18823
- const gtr = gtr_1;
18824
- const ltr = ltr_1;
18825
- const intersects = intersects_1;
18826
- const simplifyRange = simplify;
18827
- const subset = subset_1;
18828
- var semver = {
18829
- parse,
18830
- valid,
18831
- clean,
18832
- inc,
18833
- diff,
18834
- major,
18835
- minor,
18836
- patch,
18837
- prerelease,
18838
- compare,
18839
- rcompare,
18840
- compareLoose,
18841
- compareBuild,
18842
- sort,
18843
- rsort,
18844
- gt,
18845
- lt,
18846
- eq,
18847
- neq,
18848
- gte,
18849
- lte,
18850
- cmp,
18851
- coerce,
18852
- Comparator,
18853
- Range,
18854
- satisfies,
18855
- toComparators,
18856
- maxSatisfying,
18857
- minSatisfying,
18858
- minVersion,
18859
- validRange,
18860
- outside,
18861
- gtr,
18862
- ltr,
18863
- intersects,
18864
- simplifyRange,
18865
- subset,
18866
- SemVer,
18867
- re: internalRe.re,
18868
- src: internalRe.src,
18869
- tokens: internalRe.t,
18870
- SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
18871
- RELEASE_TYPES: constants.RELEASE_TYPES,
18872
- compareIdentifiers: identifiers.compareIdentifiers,
18873
- rcompareIdentifiers: identifiers.rcompareIdentifiers,
18874
- };
18628
+ const minVersion = (range, loose) => {
18629
+ range = new Range(range, loose);
18630
+
18631
+ let minver = new SemVer('0.0.0');
18632
+ if (range.test(minver)) {
18633
+ return minver
18634
+ }
18635
+
18636
+ minver = new SemVer('0.0.0-0');
18637
+ if (range.test(minver)) {
18638
+ return minver
18639
+ }
18640
+
18641
+ minver = null;
18642
+ for (let i = 0; i < range.set.length; ++i) {
18643
+ const comparators = range.set[i];
18644
+
18645
+ let setMin = null;
18646
+ comparators.forEach((comparator) => {
18647
+ // Clone to avoid manipulating the comparator's semver object.
18648
+ const compver = new SemVer(comparator.semver.version);
18649
+ switch (comparator.operator) {
18650
+ case '>':
18651
+ if (compver.prerelease.length === 0) {
18652
+ compver.patch++;
18653
+ } else {
18654
+ compver.prerelease.push(0);
18655
+ }
18656
+ compver.raw = compver.format();
18657
+ /* fallthrough */
18658
+ case '':
18659
+ case '>=':
18660
+ if (!setMin || gt(compver, setMin)) {
18661
+ setMin = compver;
18662
+ }
18663
+ break
18664
+ case '<':
18665
+ case '<=':
18666
+ /* Ignore maximum versions */
18667
+ break
18668
+ /* istanbul ignore next */
18669
+ default:
18670
+ throw new Error(`Unexpected operation: ${comparator.operator}`)
18671
+ }
18672
+ });
18673
+ if (setMin && (!minver || gt(minver, setMin))) {
18674
+ minver = setMin;
18675
+ }
18676
+ }
18677
+
18678
+ if (minver && range.test(minver)) {
18679
+ return minver
18680
+ }
18681
+
18682
+ return null
18683
+ };
18684
+ minVersion_1 = minVersion;
18685
+ return minVersion_1;
18686
+ }
18687
+
18688
+ var valid;
18689
+ var hasRequiredValid;
18690
+
18691
+ function requireValid () {
18692
+ if (hasRequiredValid) return valid;
18693
+ hasRequiredValid = 1;
18694
+ const Range = requireRange();
18695
+ const validRange = (range, options) => {
18696
+ try {
18697
+ // Return '*' instead of '' so that truthiness works.
18698
+ // This will throw if it's invalid anyway
18699
+ return new Range(range, options).range || '*'
18700
+ } catch (er) {
18701
+ return null
18702
+ }
18703
+ };
18704
+ valid = validRange;
18705
+ return valid;
18706
+ }
18707
+
18708
+ var outside_1;
18709
+ var hasRequiredOutside;
18710
+
18711
+ function requireOutside () {
18712
+ if (hasRequiredOutside) return outside_1;
18713
+ hasRequiredOutside = 1;
18714
+ const SemVer = requireSemver$1();
18715
+ const Comparator = requireComparator();
18716
+ const { ANY } = Comparator;
18717
+ const Range = requireRange();
18718
+ const satisfies = requireSatisfies();
18719
+ const gt = requireGt();
18720
+ const lt = requireLt();
18721
+ const lte = requireLte();
18722
+ const gte = requireGte();
18723
+
18724
+ const outside = (version, range, hilo, options) => {
18725
+ version = new SemVer(version, options);
18726
+ range = new Range(range, options);
18727
+
18728
+ let gtfn, ltefn, ltfn, comp, ecomp;
18729
+ switch (hilo) {
18730
+ case '>':
18731
+ gtfn = gt;
18732
+ ltefn = lte;
18733
+ ltfn = lt;
18734
+ comp = '>';
18735
+ ecomp = '>=';
18736
+ break
18737
+ case '<':
18738
+ gtfn = lt;
18739
+ ltefn = gte;
18740
+ ltfn = gt;
18741
+ comp = '<';
18742
+ ecomp = '<=';
18743
+ break
18744
+ default:
18745
+ throw new TypeError('Must provide a hilo val of "<" or ">"')
18746
+ }
18747
+
18748
+ // If it satisfies the range it is not outside
18749
+ if (satisfies(version, range, options)) {
18750
+ return false
18751
+ }
18752
+
18753
+ // From now on, variable terms are as if we're in "gtr" mode.
18754
+ // but note that everything is flipped for the "ltr" function.
18755
+
18756
+ for (let i = 0; i < range.set.length; ++i) {
18757
+ const comparators = range.set[i];
18758
+
18759
+ let high = null;
18760
+ let low = null;
18761
+
18762
+ comparators.forEach((comparator) => {
18763
+ if (comparator.semver === ANY) {
18764
+ comparator = new Comparator('>=0.0.0');
18765
+ }
18766
+ high = high || comparator;
18767
+ low = low || comparator;
18768
+ if (gtfn(comparator.semver, high.semver, options)) {
18769
+ high = comparator;
18770
+ } else if (ltfn(comparator.semver, low.semver, options)) {
18771
+ low = comparator;
18772
+ }
18773
+ });
18774
+
18775
+ // If the edge version comparator has a operator then our version
18776
+ // isn't outside it
18777
+ if (high.operator === comp || high.operator === ecomp) {
18778
+ return false
18779
+ }
18780
+
18781
+ // If the lowest version comparator has an operator and our version
18782
+ // is less than it then it isn't higher than the range
18783
+ if ((!low.operator || low.operator === comp) &&
18784
+ ltefn(version, low.semver)) {
18785
+ return false
18786
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
18787
+ return false
18788
+ }
18789
+ }
18790
+ return true
18791
+ };
18792
+
18793
+ outside_1 = outside;
18794
+ return outside_1;
18795
+ }
18796
+
18797
+ var gtr_1;
18798
+ var hasRequiredGtr;
18799
+
18800
+ function requireGtr () {
18801
+ if (hasRequiredGtr) return gtr_1;
18802
+ hasRequiredGtr = 1;
18803
+ // Determine if version is greater than all the versions possible in the range.
18804
+ const outside = requireOutside();
18805
+ const gtr = (version, range, options) => outside(version, range, '>', options);
18806
+ gtr_1 = gtr;
18807
+ return gtr_1;
18808
+ }
18809
+
18810
+ var ltr_1;
18811
+ var hasRequiredLtr;
18812
+
18813
+ function requireLtr () {
18814
+ if (hasRequiredLtr) return ltr_1;
18815
+ hasRequiredLtr = 1;
18816
+ const outside = requireOutside();
18817
+ // Determine if version is less than all the versions possible in the range
18818
+ const ltr = (version, range, options) => outside(version, range, '<', options);
18819
+ ltr_1 = ltr;
18820
+ return ltr_1;
18821
+ }
18822
+
18823
+ var intersects_1;
18824
+ var hasRequiredIntersects;
18825
+
18826
+ function requireIntersects () {
18827
+ if (hasRequiredIntersects) return intersects_1;
18828
+ hasRequiredIntersects = 1;
18829
+ const Range = requireRange();
18830
+ const intersects = (r1, r2, options) => {
18831
+ r1 = new Range(r1, options);
18832
+ r2 = new Range(r2, options);
18833
+ return r1.intersects(r2, options)
18834
+ };
18835
+ intersects_1 = intersects;
18836
+ return intersects_1;
18837
+ }
18838
+
18839
+ var simplify;
18840
+ var hasRequiredSimplify;
18841
+
18842
+ function requireSimplify () {
18843
+ if (hasRequiredSimplify) return simplify;
18844
+ hasRequiredSimplify = 1;
18845
+ // given a set of versions and a range, create a "simplified" range
18846
+ // that includes the same versions that the original range does
18847
+ // If the original range is shorter than the simplified one, return that.
18848
+ const satisfies = requireSatisfies();
18849
+ const compare = requireCompare();
18850
+ simplify = (versions, range, options) => {
18851
+ const set = [];
18852
+ let first = null;
18853
+ let prev = null;
18854
+ const v = versions.sort((a, b) => compare(a, b, options));
18855
+ for (const version of v) {
18856
+ const included = satisfies(version, range, options);
18857
+ if (included) {
18858
+ prev = version;
18859
+ if (!first) {
18860
+ first = version;
18861
+ }
18862
+ } else {
18863
+ if (prev) {
18864
+ set.push([first, prev]);
18865
+ }
18866
+ prev = null;
18867
+ first = null;
18868
+ }
18869
+ }
18870
+ if (first) {
18871
+ set.push([first, null]);
18872
+ }
18873
+
18874
+ const ranges = [];
18875
+ for (const [min, max] of set) {
18876
+ if (min === max) {
18877
+ ranges.push(min);
18878
+ } else if (!max && min === v[0]) {
18879
+ ranges.push('*');
18880
+ } else if (!max) {
18881
+ ranges.push(`>=${min}`);
18882
+ } else if (min === v[0]) {
18883
+ ranges.push(`<=${max}`);
18884
+ } else {
18885
+ ranges.push(`${min} - ${max}`);
18886
+ }
18887
+ }
18888
+ const simplified = ranges.join(' || ');
18889
+ const original = typeof range.raw === 'string' ? range.raw : String(range);
18890
+ return simplified.length < original.length ? simplified : range
18891
+ };
18892
+ return simplify;
18893
+ }
18894
+
18895
+ var subset_1;
18896
+ var hasRequiredSubset;
18897
+
18898
+ function requireSubset () {
18899
+ if (hasRequiredSubset) return subset_1;
18900
+ hasRequiredSubset = 1;
18901
+ const Range = requireRange();
18902
+ const Comparator = requireComparator();
18903
+ const { ANY } = Comparator;
18904
+ const satisfies = requireSatisfies();
18905
+ const compare = requireCompare();
18906
+
18907
+ // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
18908
+ // - Every simple range `r1, r2, ...` is a null set, OR
18909
+ // - Every simple range `r1, r2, ...` which is not a null set is a subset of
18910
+ // some `R1, R2, ...`
18911
+ //
18912
+ // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
18913
+ // - If c is only the ANY comparator
18914
+ // - If C is only the ANY comparator, return true
18915
+ // - Else if in prerelease mode, return false
18916
+ // - else replace c with `[>=0.0.0]`
18917
+ // - If C is only the ANY comparator
18918
+ // - if in prerelease mode, return true
18919
+ // - else replace C with `[>=0.0.0]`
18920
+ // - Let EQ be the set of = comparators in c
18921
+ // - If EQ is more than one, return true (null set)
18922
+ // - Let GT be the highest > or >= comparator in c
18923
+ // - Let LT be the lowest < or <= comparator in c
18924
+ // - If GT and LT, and GT.semver > LT.semver, return true (null set)
18925
+ // - If any C is a = range, and GT or LT are set, return false
18926
+ // - If EQ
18927
+ // - If GT, and EQ does not satisfy GT, return true (null set)
18928
+ // - If LT, and EQ does not satisfy LT, return true (null set)
18929
+ // - If EQ satisfies every C, return true
18930
+ // - Else return false
18931
+ // - If GT
18932
+ // - If GT.semver is lower than any > or >= comp in C, return false
18933
+ // - If GT is >=, and GT.semver does not satisfy every C, return false
18934
+ // - If GT.semver has a prerelease, and not in prerelease mode
18935
+ // - If no C has a prerelease and the GT.semver tuple, return false
18936
+ // - If LT
18937
+ // - If LT.semver is greater than any < or <= comp in C, return false
18938
+ // - If LT is <=, and LT.semver does not satisfy every C, return false
18939
+ // - If GT.semver has a prerelease, and not in prerelease mode
18940
+ // - If no C has a prerelease and the LT.semver tuple, return false
18941
+ // - Else return true
18942
+
18943
+ const subset = (sub, dom, options = {}) => {
18944
+ if (sub === dom) {
18945
+ return true
18946
+ }
18947
+
18948
+ sub = new Range(sub, options);
18949
+ dom = new Range(dom, options);
18950
+ let sawNonNull = false;
18951
+
18952
+ OUTER: for (const simpleSub of sub.set) {
18953
+ for (const simpleDom of dom.set) {
18954
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
18955
+ sawNonNull = sawNonNull || isSub !== null;
18956
+ if (isSub) {
18957
+ continue OUTER
18958
+ }
18959
+ }
18960
+ // the null set is a subset of everything, but null simple ranges in
18961
+ // a complex range should be ignored. so if we saw a non-null range,
18962
+ // then we know this isn't a subset, but if EVERY simple range was null,
18963
+ // then it is a subset.
18964
+ if (sawNonNull) {
18965
+ return false
18966
+ }
18967
+ }
18968
+ return true
18969
+ };
18970
+
18971
+ const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')];
18972
+ const minimumVersion = [new Comparator('>=0.0.0')];
18973
+
18974
+ const simpleSubset = (sub, dom, options) => {
18975
+ if (sub === dom) {
18976
+ return true
18977
+ }
18978
+
18979
+ if (sub.length === 1 && sub[0].semver === ANY) {
18980
+ if (dom.length === 1 && dom[0].semver === ANY) {
18981
+ return true
18982
+ } else if (options.includePrerelease) {
18983
+ sub = minimumVersionWithPreRelease;
18984
+ } else {
18985
+ sub = minimumVersion;
18986
+ }
18987
+ }
18988
+
18989
+ if (dom.length === 1 && dom[0].semver === ANY) {
18990
+ if (options.includePrerelease) {
18991
+ return true
18992
+ } else {
18993
+ dom = minimumVersion;
18994
+ }
18995
+ }
18996
+
18997
+ const eqSet = new Set();
18998
+ let gt, lt;
18999
+ for (const c of sub) {
19000
+ if (c.operator === '>' || c.operator === '>=') {
19001
+ gt = higherGT(gt, c, options);
19002
+ } else if (c.operator === '<' || c.operator === '<=') {
19003
+ lt = lowerLT(lt, c, options);
19004
+ } else {
19005
+ eqSet.add(c.semver);
19006
+ }
19007
+ }
19008
+
19009
+ if (eqSet.size > 1) {
19010
+ return null
19011
+ }
19012
+
19013
+ let gtltComp;
19014
+ if (gt && lt) {
19015
+ gtltComp = compare(gt.semver, lt.semver, options);
19016
+ if (gtltComp > 0) {
19017
+ return null
19018
+ } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
19019
+ return null
19020
+ }
19021
+ }
19022
+
19023
+ // will iterate one or zero times
19024
+ for (const eq of eqSet) {
19025
+ if (gt && !satisfies(eq, String(gt), options)) {
19026
+ return null
19027
+ }
19028
+
19029
+ if (lt && !satisfies(eq, String(lt), options)) {
19030
+ return null
19031
+ }
19032
+
19033
+ for (const c of dom) {
19034
+ if (!satisfies(eq, String(c), options)) {
19035
+ return false
19036
+ }
19037
+ }
19038
+
19039
+ return true
19040
+ }
19041
+
19042
+ let higher, lower;
19043
+ let hasDomLT, hasDomGT;
19044
+ // if the subset has a prerelease, we need a comparator in the superset
19045
+ // with the same tuple and a prerelease, or it's not a subset
19046
+ let needDomLTPre = lt &&
19047
+ !options.includePrerelease &&
19048
+ lt.semver.prerelease.length ? lt.semver : false;
19049
+ let needDomGTPre = gt &&
19050
+ !options.includePrerelease &&
19051
+ gt.semver.prerelease.length ? gt.semver : false;
19052
+ // exception: <1.2.3-0 is the same as <1.2.3
19053
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
19054
+ lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
19055
+ needDomLTPre = false;
19056
+ }
19057
+
19058
+ for (const c of dom) {
19059
+ hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=';
19060
+ hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=';
19061
+ if (gt) {
19062
+ if (needDomGTPre) {
19063
+ if (c.semver.prerelease && c.semver.prerelease.length &&
19064
+ c.semver.major === needDomGTPre.major &&
19065
+ c.semver.minor === needDomGTPre.minor &&
19066
+ c.semver.patch === needDomGTPre.patch) {
19067
+ needDomGTPre = false;
19068
+ }
19069
+ }
19070
+ if (c.operator === '>' || c.operator === '>=') {
19071
+ higher = higherGT(gt, c, options);
19072
+ if (higher === c && higher !== gt) {
19073
+ return false
19074
+ }
19075
+ } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
19076
+ return false
19077
+ }
19078
+ }
19079
+ if (lt) {
19080
+ if (needDomLTPre) {
19081
+ if (c.semver.prerelease && c.semver.prerelease.length &&
19082
+ c.semver.major === needDomLTPre.major &&
19083
+ c.semver.minor === needDomLTPre.minor &&
19084
+ c.semver.patch === needDomLTPre.patch) {
19085
+ needDomLTPre = false;
19086
+ }
19087
+ }
19088
+ if (c.operator === '<' || c.operator === '<=') {
19089
+ lower = lowerLT(lt, c, options);
19090
+ if (lower === c && lower !== lt) {
19091
+ return false
19092
+ }
19093
+ } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
19094
+ return false
19095
+ }
19096
+ }
19097
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
19098
+ return false
19099
+ }
19100
+ }
19101
+
19102
+ // if there was a < or >, and nothing in the dom, then must be false
19103
+ // UNLESS it was limited by another range in the other direction.
19104
+ // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
19105
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
19106
+ return false
19107
+ }
19108
+
19109
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
19110
+ return false
19111
+ }
19112
+
19113
+ // we needed a prerelease range in a specific tuple, but didn't get one
19114
+ // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
19115
+ // because it includes prereleases in the 1.2.3 tuple
19116
+ if (needDomGTPre || needDomLTPre) {
19117
+ return false
19118
+ }
19119
+
19120
+ return true
19121
+ };
19122
+
19123
+ // >=1.2.3 is lower than >1.2.3
19124
+ const higherGT = (a, b, options) => {
19125
+ if (!a) {
19126
+ return b
19127
+ }
19128
+ const comp = compare(a.semver, b.semver, options);
19129
+ return comp > 0 ? a
19130
+ : comp < 0 ? b
19131
+ : b.operator === '>' && a.operator === '>=' ? b
19132
+ : a
19133
+ };
19134
+
19135
+ // <=1.2.3 is higher than <1.2.3
19136
+ const lowerLT = (a, b, options) => {
19137
+ if (!a) {
19138
+ return b
19139
+ }
19140
+ const comp = compare(a.semver, b.semver, options);
19141
+ return comp < 0 ? a
19142
+ : comp > 0 ? b
19143
+ : b.operator === '<' && a.operator === '<=' ? b
19144
+ : a
19145
+ };
19146
+
19147
+ subset_1 = subset;
19148
+ return subset_1;
19149
+ }
19150
+
19151
+ var semver$1;
19152
+ var hasRequiredSemver;
19153
+
19154
+ function requireSemver () {
19155
+ if (hasRequiredSemver) return semver$1;
19156
+ hasRequiredSemver = 1;
19157
+ // just pre-load all the stuff that index.js lazily exports
19158
+ const internalRe = requireRe();
19159
+ const constants = requireConstants();
19160
+ const SemVer = requireSemver$1();
19161
+ const identifiers = requireIdentifiers();
19162
+ const parse = requireParse();
19163
+ const valid = requireValid$1();
19164
+ const clean = requireClean();
19165
+ const inc = requireInc();
19166
+ const diff = requireDiff();
19167
+ const major = requireMajor();
19168
+ const minor = requireMinor();
19169
+ const patch = requirePatch();
19170
+ const prerelease = requirePrerelease();
19171
+ const compare = requireCompare();
19172
+ const rcompare = requireRcompare();
19173
+ const compareLoose = requireCompareLoose();
19174
+ const compareBuild = requireCompareBuild();
19175
+ const sort = requireSort();
19176
+ const rsort = requireRsort();
19177
+ const gt = requireGt();
19178
+ const lt = requireLt();
19179
+ const eq = requireEq();
19180
+ const neq = requireNeq();
19181
+ const gte = requireGte();
19182
+ const lte = requireLte();
19183
+ const cmp = requireCmp();
19184
+ const coerce = requireCoerce();
19185
+ const Comparator = requireComparator();
19186
+ const Range = requireRange();
19187
+ const satisfies = requireSatisfies();
19188
+ const toComparators = requireToComparators();
19189
+ const maxSatisfying = requireMaxSatisfying();
19190
+ const minSatisfying = requireMinSatisfying();
19191
+ const minVersion = requireMinVersion();
19192
+ const validRange = requireValid();
19193
+ const outside = requireOutside();
19194
+ const gtr = requireGtr();
19195
+ const ltr = requireLtr();
19196
+ const intersects = requireIntersects();
19197
+ const simplifyRange = requireSimplify();
19198
+ const subset = requireSubset();
19199
+ semver$1 = {
19200
+ parse,
19201
+ valid,
19202
+ clean,
19203
+ inc,
19204
+ diff,
19205
+ major,
19206
+ minor,
19207
+ patch,
19208
+ prerelease,
19209
+ compare,
19210
+ rcompare,
19211
+ compareLoose,
19212
+ compareBuild,
19213
+ sort,
19214
+ rsort,
19215
+ gt,
19216
+ lt,
19217
+ eq,
19218
+ neq,
19219
+ gte,
19220
+ lte,
19221
+ cmp,
19222
+ coerce,
19223
+ Comparator,
19224
+ Range,
19225
+ satisfies,
19226
+ toComparators,
19227
+ maxSatisfying,
19228
+ minSatisfying,
19229
+ minVersion,
19230
+ validRange,
19231
+ outside,
19232
+ gtr,
19233
+ ltr,
19234
+ intersects,
19235
+ simplifyRange,
19236
+ subset,
19237
+ SemVer,
19238
+ re: internalRe.re,
19239
+ src: internalRe.src,
19240
+ tokens: internalRe.t,
19241
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
19242
+ RELEASE_TYPES: constants.RELEASE_TYPES,
19243
+ compareIdentifiers: identifiers.compareIdentifiers,
19244
+ rcompareIdentifiers: identifiers.rcompareIdentifiers,
19245
+ };
19246
+ return semver$1;
19247
+ }
18875
19248
 
18876
- var semver$1 = /*@__PURE__*/getDefaultExportFromCjs(semver);
19249
+ var semverExports = requireSemver();
19250
+ var semver = /*@__PURE__*/getDefaultExportFromCjs(semverExports);
18877
19251
 
18878
19252
  /*!
18879
19253
  * @license
18880
19254
  * Copyright Google LLC All Rights Reserved.
18881
19255
  *
18882
19256
  * Use of this source code is governed by an MIT-style license that can be
18883
- * found in the LICENSE file at https://angular.io/license
19257
+ * found in the LICENSE file at https://angular.dev/license
18884
19258
  */
18885
19259
  /**
18886
19260
  * Whether a version of `@angular/core` supports a specific feature.
@@ -18888,13 +19262,13 @@ var semver$1 = /*@__PURE__*/getDefaultExportFromCjs(semver);
18888
19262
  * @param minVersion Minimum required version for the feature.
18889
19263
  */
18890
19264
  function coreVersionSupportsFeature(coreVersion, minVersion) {
18891
- // A version of `19.0.0-next.6` usually means that core is at head so it supports
19265
+ // A version of `19.0.0-next.8` usually means that core is at head so it supports
18892
19266
  // all features. Use string interpolation prevent the placeholder from being replaced
18893
19267
  // with the current version during build time.
18894
19268
  if (coreVersion === `0.0.0-${'PLACEHOLDER'}`) {
18895
19269
  return true;
18896
19270
  }
18897
- return semver$1.satisfies(coreVersion, minVersion);
19271
+ return semver.satisfies(coreVersion, minVersion);
18898
19272
  }
18899
19273
 
18900
19274
  /**
@@ -19762,13 +20136,13 @@ class NgCompiler {
19762
20136
  const jitDeclarationRegistry = new JitDeclarationRegistry();
19763
20137
  // Set up the IvyCompilation, which manages state for the Ivy transformer.
19764
20138
  const handlers = [
19765
- new ComponentDecoratorHandler(reflector, evaluator, metaRegistry, metaReader, scopeReader, depScopeReader, ngModuleScopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, this.resourceManager, this.adapter.rootDirs, this.options.preserveWhitespaces || false, this.options.i18nUseExternalIds !== false, this.options.enableI18nLegacyMessageIdFormat !== false, this.usePoisonedData, this.options.i18nNormalizeLineEndingsInICUs === true, this.moduleResolver, this.cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, this.incrementalCompilation.depGraph, injectableRegistry, semanticDepGraphUpdater, this.closureCompilerEnabled, this.delegatingPerfRecorder, hostDirectivesResolver, importTracker, supportTestBed, compilationMode, deferredSymbolsTracker, !!this.options.forbidOrphanComponents, this.enableBlockSyntax, this.enableLetSyntax, localCompilationExtraImportsTracker, jitDeclarationRegistry, this.options.i18nPreserveWhitespaceForLegacyExtraction ?? true),
20139
+ new ComponentDecoratorHandler(reflector, evaluator, metaRegistry, metaReader, scopeReader, depScopeReader, ngModuleScopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, this.resourceManager, this.adapter.rootDirs, this.options.preserveWhitespaces || false, this.options.i18nUseExternalIds !== false, this.options.enableI18nLegacyMessageIdFormat !== false, this.usePoisonedData, this.options.i18nNormalizeLineEndingsInICUs === true, this.moduleResolver, this.cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, this.incrementalCompilation.depGraph, injectableRegistry, semanticDepGraphUpdater, this.closureCompilerEnabled, this.delegatingPerfRecorder, hostDirectivesResolver, importTracker, supportTestBed, compilationMode, deferredSymbolsTracker, !!this.options.forbidOrphanComponents, this.enableBlockSyntax, this.enableLetSyntax, localCompilationExtraImportsTracker, jitDeclarationRegistry, this.options.i18nPreserveWhitespaceForLegacyExtraction ?? true, !!this.options.strictStandalone),
19766
20140
  // TODO(alxhub): understand why the cast here is necessary (something to do with `null`
19767
20141
  // not being assignable to `unknown` when wrapped in `Readonly`).
19768
- new DirectiveDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, metaReader, injectableRegistry, refEmitter, referencesRegistry, isCore, strictCtorDeps, semanticDepGraphUpdater, this.closureCompilerEnabled, this.delegatingPerfRecorder, importTracker, supportTestBed, compilationMode, jitDeclarationRegistry),
20142
+ new DirectiveDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, metaReader, injectableRegistry, refEmitter, referencesRegistry, isCore, strictCtorDeps, semanticDepGraphUpdater, this.closureCompilerEnabled, this.delegatingPerfRecorder, importTracker, supportTestBed, compilationMode, jitDeclarationRegistry, !!this.options.strictStandalone),
19769
20143
  // Pipe handler must be before injectable handler in list so pipe factories are printed
19770
20144
  // before injectable factories (so injectable factories can delegate to them)
19771
- new PipeDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, injectableRegistry, isCore, this.delegatingPerfRecorder, supportTestBed, compilationMode, !!this.options.generateExtraImportsInLocalMode),
20145
+ new PipeDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, injectableRegistry, isCore, this.delegatingPerfRecorder, supportTestBed, compilationMode, !!this.options.generateExtraImportsInLocalMode, !!this.options.strictStandalone),
19772
20146
  new InjectableDecoratorHandler(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, this.delegatingPerfRecorder, supportTestBed, compilationMode),
19773
20147
  new NgModuleDecoratorHandler(reflector, evaluator, metaReader, metaRegistry, ngModuleScopeRegistry, referencesRegistry, exportedProviderStatusResolver, semanticDepGraphUpdater, isCore, refEmitter, this.closureCompilerEnabled, this.options.onlyPublishPublicTypingsForNgModules ?? false, injectableRegistry, this.delegatingPerfRecorder, supportTestBed, supportJitMode, compilationMode, localCompilationExtraImportsTracker, jitDeclarationRegistry),
19774
20148
  ];
@@ -20481,5 +20855,7 @@ exports.DtsMetadataReader = DtsMetadataReader;
20481
20855
  exports.NgtscProgram = NgtscProgram;
20482
20856
  exports.PartialEvaluator = PartialEvaluator;
20483
20857
  exports.UNKNOWN_ERROR_CODE = UNKNOWN_ERROR_CODE;
20858
+ exports.extractDecoratorQueryMetadata = extractDecoratorQueryMetadata;
20484
20859
  exports.extractTemplate = extractTemplate;
20485
20860
  exports.parseDecoratorInputTransformFunction = parseDecoratorInputTransformFunction;
20861
+ exports.queryDecoratorNames = queryDecoratorNames;