@abaplint/transpiler-cli 2.14.34 → 2.14.35

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.
package/build/bundle.js CHANGED
@@ -7238,7 +7238,7 @@ const loop_group_by_component_1 = __webpack_require__(/*! ./loop_group_by_compon
7238
7238
  class LoopGroupBy extends combi_1.Expression {
7239
7239
  getRunnable() {
7240
7240
  const components = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.plus)(loop_group_by_component_1.LoopGroupByComponent), (0, combi_1.tok)(tokens_1.WParenRightW));
7241
- const ret = (0, combi_1.seq)((0, combi_1.alt)(source_1.Source, components), (0, combi_1.optPrio)("ASCENDING"), (0, combi_1.optPrio)("WITHOUT MEMBERS"), loop_group_by_target_1.LoopGroupByTarget);
7241
+ const ret = (0, combi_1.seq)((0, combi_1.alt)(source_1.Source, components), (0, combi_1.optPrio)((0, combi_1.seq)((0, combi_1.alt)("ASCENDING", "DESCENDING"), (0, combi_1.optPrio)("AS TEXT"))), (0, combi_1.optPrio)("WITHOUT MEMBERS"), loop_group_by_target_1.LoopGroupByTarget);
7242
7242
  return ret;
7243
7243
  }
7244
7244
  }
@@ -7787,7 +7787,7 @@ exports.MethodName = void 0;
7787
7787
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
7788
7788
  class MethodName extends combi_1.Expression {
7789
7789
  getRunnable() {
7790
- return (0, combi_1.regex)(/^(\/\w+\/)?\w+(~\w+)?$/);
7790
+ return (0, combi_1.regex)(/^!?(\/\w+\/)?\w+(~\w+)?$/);
7791
7791
  }
7792
7792
  }
7793
7793
  exports.MethodName = MethodName;
@@ -13356,7 +13356,7 @@ class AuthorityCheck {
13356
13356
  getMatcher() {
13357
13357
  const field = (0, combi_1.seq)("FIELD", expressions_1.Source);
13358
13358
  const id = (0, combi_1.seq)("ID", expressions_1.Source, (0, combi_1.alt)(field, "DUMMY"));
13359
- const ret = (0, combi_1.seq)("AUTHORITY-CHECK OBJECT", expressions_1.Source, (0, combi_1.opt)((0, combi_1.seq)("FOR USER", expressions_1.Source)), (0, combi_1.plus)(id));
13359
+ const ret = (0, combi_1.seq)("AUTHORITY-CHECK OBJECT", expressions_1.Source, (0, combi_1.opt)((0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.seq)("FOR USER", expressions_1.Source))), (0, combi_1.plus)(id));
13360
13360
  return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, ret);
13361
13361
  }
13362
13362
  }
@@ -14249,7 +14249,7 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
14249
14249
  class Commit {
14250
14250
  getMatcher() {
14251
14251
  const work = (0, combi_1.seq)("WORK", (0, combi_1.opt)("AND WAIT"));
14252
- return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("COMMIT", (0, combi_1.alt)(work, expressions_1.DatabaseConnection)));
14252
+ return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("COMMIT", (0, combi_1.alt)(work, (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, expressions_1.DatabaseConnection))));
14253
14253
  }
14254
14254
  }
14255
14255
  exports.Commit = Commit;
@@ -14558,9 +14558,9 @@ class Convert {
14558
14558
  const tim = (0, combi_1.seq)("TIME", expressions_1.Source);
14559
14559
  const stamp = (0, combi_1.seq)("INTO TIME STAMP", expressions_1.Target);
14560
14560
  const intoutc = (0, combi_1.ver)(version_1.Release.v754, (0, combi_1.seq)("INTO UTCLONG", expressions_1.Target), { also: combi_1.AlsoIn.OpenABAP });
14561
- const invert = (0, combi_1.seq)("INTO INVERTED-DATE", expressions_1.Target);
14561
+ const invert = (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.seq)("INTO INVERTED-DATE", expressions_1.Target));
14562
14562
  const date = (0, combi_1.seq)((0, combi_1.per)(dat, tim), (0, combi_1.per)(daylightSource, stamp, zone, invert, intoutc));
14563
- const inv = (0, combi_1.seq)("INVERTED-DATE", expressions_1.Source, "INTO DATE", expressions_1.Target);
14563
+ const inv = (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.seq)("INVERTED-DATE", expressions_1.Source, "INTO DATE", expressions_1.Target));
14564
14564
  const utclong = (0, combi_1.ver)(version_1.Release.v754, (0, combi_1.seq)("UTCLONG", expressions_1.Source, (0, combi_1.per)(zone, into, daylightTarget)), { also: combi_1.AlsoIn.OpenABAP });
14565
14565
  return (0, combi_1.seq)("CONVERT", (0, combi_1.alt)(time, date, inv, utclong));
14566
14566
  }
@@ -15128,13 +15128,14 @@ exports.Divide = Divide;
15128
15128
  Object.defineProperty(exports, "__esModule", ({ value: true }));
15129
15129
  exports.Do = void 0;
15130
15130
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
15131
+ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
15131
15132
  const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
15132
15133
  class Do {
15133
15134
  getMatcher() {
15134
15135
  const range = (0, combi_1.seq)("RANGE", expressions_1.Source);
15135
15136
  const vary = (0, combi_1.seq)("VARYING", expressions_1.Target, "FROM", expressions_1.Source, "NEXT", expressions_1.Source, (0, combi_1.optPrio)(range));
15136
15137
  const times = (0, combi_1.seq)(expressions_1.Source, "TIMES");
15137
- return (0, combi_1.seq)("DO", (0, combi_1.optPrio)((0, combi_1.per)((0, combi_1.plus)(vary), times)));
15138
+ return (0, combi_1.seq)("DO", (0, combi_1.optPrio)((0, combi_1.per)((0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.plus)(vary)), times)));
15138
15139
  }
15139
15140
  }
15140
15141
  exports.Do = Do;
@@ -15957,9 +15958,10 @@ exports.ExecSQL = ExecSQL;
15957
15958
  Object.defineProperty(exports, "__esModule", ({ value: true }));
15958
15959
  exports.Exit = void 0;
15959
15960
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
15961
+ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
15960
15962
  class Exit {
15961
15963
  getMatcher() {
15962
- return (0, combi_1.seq)("EXIT", (0, combi_1.opt)((0, combi_1.alt)("FROM SQL", "FROM STEP-LOOP")));
15964
+ return (0, combi_1.seq)("EXIT", (0, combi_1.opt)((0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.alt)("FROM SQL", "FROM STEP-LOOP"))));
15963
15965
  }
15964
15966
  }
15965
15967
  exports.Exit = Exit;
@@ -16832,8 +16834,9 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
16832
16834
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
16833
16835
  class GetTime {
16834
16836
  getMatcher() {
16835
- const options = (0, combi_1.seq)((0, combi_1.alt)("STAMP FIELD", "FIELD"), expressions_1.Target);
16836
- return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("GET TIME", (0, combi_1.opt)(options)));
16837
+ const stamp = (0, combi_1.seq)("GET TIME STAMP FIELD", expressions_1.Target);
16838
+ const time = (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.seq)("GET TIME", (0, combi_1.opt)((0, combi_1.seq)("FIELD", expressions_1.Target))));
16839
+ return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.alt)(stamp, time));
16837
16840
  }
16838
16841
  }
16839
16842
  exports.GetTime = GetTime;
@@ -18672,7 +18675,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
18672
18675
  class Perform {
18673
18676
  getMatcher() {
18674
18677
  const level = (0, combi_1.seq)("LEVEL", Expressions.Source);
18675
- const commit = (0, combi_1.alt)((0, combi_1.seq)("ON COMMIT", (0, combi_1.opt)(level)), "ON ROLLBACK");
18678
+ const commit = (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.alt)((0, combi_1.seq)("ON COMMIT", (0, combi_1.opt)(level)), "ON ROLLBACK"));
18676
18679
  const short = (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.seq)(Expressions.FormName, (0, combi_1.tok)(tokens_1.ParenLeft), Expressions.IncludeName, (0, combi_1.tok)(tokens_1.ParenRightW)));
18677
18680
  const program = (0, combi_1.seq)("IN PROGRAM", (0, combi_1.opt)((0, combi_1.alt)(Expressions.Dynamic, Expressions.IncludeName)));
18678
18681
  const found = (0, combi_1.str)("IF FOUND");
@@ -19529,7 +19532,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
19529
19532
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
19530
19533
  class Rollback {
19531
19534
  getMatcher() {
19532
- return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("ROLLBACK", (0, combi_1.altPrio)("WORK", expressions_1.DatabaseConnection)));
19535
+ return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("ROLLBACK", (0, combi_1.altPrio)("WORK", (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, expressions_1.DatabaseConnection))));
19533
19536
  }
19534
19537
  }
19535
19538
  exports.Rollback = Rollback;
@@ -21485,7 +21488,7 @@ class Wait {
21485
21488
  const type = (0, combi_1.seq)("FOR", (0, combi_1.per)(channels, push, tasks));
21486
21489
  const until = (0, combi_1.seq)((0, combi_1.opt)(type), "UNTIL", expressions_1.Cond, (0, combi_1.opt)(up));
21487
21490
  const ret = (0, combi_1.seq)("WAIT", (0, combi_1.alt)(until, up));
21488
- return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, ret);
21491
+ return (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, ret);
21489
21492
  }
21490
21493
  }
21491
21494
  exports.Wait = Wait;
@@ -27338,6 +27341,114 @@ BuiltIn.argumentTypedReturn = new Set(["ABS", "CEIL", "FLOOR", "FRAC", "SIGN", "
27338
27341
 
27339
27342
  /***/ },
27340
27343
 
27344
+ /***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin_call.js"
27345
+ /*!******************************************************************************!*\
27346
+ !*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin_call.js ***!
27347
+ \******************************************************************************/
27348
+ (__unused_webpack_module, exports, __webpack_require__) {
27349
+
27350
+ "use strict";
27351
+
27352
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
27353
+ if (k2 === undefined) k2 = k;
27354
+ var desc = Object.getOwnPropertyDescriptor(m, k);
27355
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
27356
+ desc = { enumerable: true, get: function() { return m[k]; } };
27357
+ }
27358
+ Object.defineProperty(o, k2, desc);
27359
+ }) : (function(o, m, k, k2) {
27360
+ if (k2 === undefined) k2 = k;
27361
+ o[k2] = m[k];
27362
+ }));
27363
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
27364
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
27365
+ }) : function(o, v) {
27366
+ o["default"] = v;
27367
+ });
27368
+ var __importStar = (this && this.__importStar) || (function () {
27369
+ var ownKeys = function(o) {
27370
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27371
+ var ar = [];
27372
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27373
+ return ar;
27374
+ };
27375
+ return ownKeys(o);
27376
+ };
27377
+ return function (mod) {
27378
+ if (mod && mod.__esModule) return mod;
27379
+ var result = {};
27380
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
27381
+ __setModuleDefault(result, mod);
27382
+ return result;
27383
+ };
27384
+ })();
27385
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
27386
+ exports.BuiltInCall = void 0;
27387
+ const Expressions = __importStar(__webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
27388
+ const nodes_1 = __webpack_require__(/*! ../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
27389
+ const _builtin_1 = __webpack_require__(/*! ./_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
27390
+ const _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
27391
+ const basic_1 = __webpack_require__(/*! ../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
27392
+ class BuiltInCall {
27393
+ // the call of a built-in function that starts a method call chain, not hidden by a method of the same name
27394
+ static fromChain(chain, input) {
27395
+ if (chain === undefined || !(chain.get() instanceof Expressions.MethodCallChain)) {
27396
+ return undefined;
27397
+ }
27398
+ const call = chain.getChildren()[0];
27399
+ if (!(call instanceof nodes_1.ExpressionNode) || !(call.get() instanceof Expressions.MethodCall)) {
27400
+ return undefined;
27401
+ }
27402
+ const name = this.callName(call);
27403
+ // upper case, the definition is cached with the name it is first searched with
27404
+ if (name === undefined || _builtin_1.BuiltIn.searchBuiltin(name.toUpperCase()) === undefined) {
27405
+ return undefined;
27406
+ }
27407
+ const enclosing = input.scope.findClassDefinition(input.scope.getEnclosingClassName());
27408
+ if (enclosing !== undefined && new _object_oriented_1.ObjectOriented(input.scope).searchMethodName(enclosing, name).method !== undefined) {
27409
+ return undefined;
27410
+ }
27411
+ return call;
27412
+ }
27413
+ // the call of a built-in function when the source is exactly that one call
27414
+ static fromSource(source, input) {
27415
+ const chain = source === null || source === void 0 ? void 0 : source.getChildren();
27416
+ if ((chain === null || chain === void 0 ? void 0 : chain.length) !== 1 || !(chain[0] instanceof nodes_1.ExpressionNode) || chain[0].getChildren().length !== 1) {
27417
+ return undefined;
27418
+ }
27419
+ return this.fromChain(chain[0], input);
27420
+ }
27421
+ static callName(call) {
27422
+ var _a;
27423
+ return (_a = call.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.concatTokens().replace(/^!/, "");
27424
+ }
27425
+ static isNumeric(call) {
27426
+ var _a, _b, _c;
27427
+ const returning = (_c = (_b = _builtin_1.BuiltIn.searchBuiltin((_a = this.callName(call)) === null || _a === void 0 ? void 0 : _a.toUpperCase())) === null || _b === void 0 ? void 0 : _b.getParameters().getReturning()) === null || _c === void 0 ? void 0 : _c.getType();
27428
+ return returning instanceof basic_1.IntegerType || returning instanceof basic_1.FloatType || returning instanceof basic_1.DecFloat34Type;
27429
+ }
27430
+ // the call has a single argument, without a parameter name, that is a data object and not an expression
27431
+ static hasDataObjectArgument(call) {
27432
+ var _a;
27433
+ const argument = (_a = call.findDirectExpression(Expressions.MethodCallParam)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source);
27434
+ const children = (argument === null || argument === void 0 ? void 0 : argument.getChildren()) || [];
27435
+ // a literal or a text symbol, text-001
27436
+ if (children.length === 1
27437
+ && (children[0].get() instanceof Expressions.Constant || children[0].get() instanceof Expressions.TextElement)) {
27438
+ return true;
27439
+ }
27440
+ // a field, a component, an offset/length or a dereference, r->*
27441
+ return children.length > 0
27442
+ && children[0].get() instanceof Expressions.FieldChain
27443
+ && children.every(c => c.get() instanceof Expressions.FieldChain || c.get() instanceof Expressions.Dereference)
27444
+ && (argument === null || argument === void 0 ? void 0 : argument.findFirstExpression(Expressions.TableExpression)) === undefined;
27445
+ }
27446
+ }
27447
+ exports.BuiltInCall = BuiltInCall;
27448
+ //# sourceMappingURL=_builtin_call.js.map
27449
+
27450
+ /***/ },
27451
+
27341
27452
  /***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js"
27342
27453
  /*!*******************************************************************************!*\
27343
27454
  !*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js ***!
@@ -27382,6 +27493,9 @@ class CurrentScope {
27382
27493
  this.localFriends = new Map();
27383
27494
  /** types of the FOR and LET names used in a procedure, key is the scope node of the procedure */
27384
27495
  this.localNameTypes = new WeakMap();
27496
+ /** row type of the members of a group, key is the identifier of the group variable,
27497
+ * a LOOP AT ... GROUP BY binds the group until its ENDLOOP */
27498
+ this.groupMemberTypes = new Map();
27385
27499
  this.current = undefined;
27386
27500
  this.parentObj = obj;
27387
27501
  this.reg = reg;
@@ -27914,6 +28028,18 @@ class CurrentScope {
27914
28028
  && type.isGeneric() === false
27915
28029
  && type.toText(0).includes("Unknown type") === false;
27916
28030
  }
28031
+ setGroupMemberType(group, rowType) {
28032
+ this.groupMemberTypes.set(CurrentScope.groupKey(group), rowType);
28033
+ }
28034
+ findGroupMemberType(group) {
28035
+ return this.groupMemberTypes.get(CurrentScope.groupKey(group));
28036
+ }
28037
+ removeGroupMemberType(group) {
28038
+ this.groupMemberTypes.delete(CurrentScope.groupKey(group));
28039
+ }
28040
+ static groupKey(group) {
28041
+ return group.getFilename() + ":" + group.getStart().getRow() + ":" + group.getStart().getCol();
28042
+ }
27917
28043
  getEnclosingMethodName() {
27918
28044
  let curr = this.current;
27919
28045
  while (curr !== undefined) {
@@ -28507,6 +28633,17 @@ class ObjectOriented {
28507
28633
  }
28508
28634
  return undefined;
28509
28635
  }
28636
+ // RAISE EXCEPTION and THROW are not allowed in a method whose interface declares classic EXCEPTIONS,
28637
+ // not even for a CX_NO_CHECK class
28638
+ checkClassBasedException() {
28639
+ var _a;
28640
+ const methodName = this.scope.getEnclosingMethodName();
28641
+ const classDef = this.scope.findClassDefinition(this.scope.getEnclosingClassName());
28642
+ if (methodName && classDef && ((_a = this.searchMethodName(classDef, methodName).method) === null || _a === void 0 ? void 0 : _a.getExceptions().length)) {
28643
+ return "Old exceptions and class-based exceptions cannot be used at the same time";
28644
+ }
28645
+ return undefined;
28646
+ }
28510
28647
  // SUPER-> can only call the previous implementation of the method it is used in, returns the message otherwise
28511
28648
  // both names are resolved in the super class, so an alias and the method it stands for are the same
28512
28649
  checkSuperCall(superDef, methodName) {
@@ -29307,6 +29444,28 @@ var ReferenceType;
29307
29444
 
29308
29445
  /***/ },
29309
29446
 
29447
+ /***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reserved_names.js"
29448
+ /*!********************************************************************************!*\
29449
+ !*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/_reserved_names.js ***!
29450
+ \********************************************************************************/
29451
+ (__unused_webpack_module, exports, __webpack_require__) {
29452
+
29453
+ "use strict";
29454
+
29455
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
29456
+ exports.checkReservedName = checkReservedName;
29457
+ const _syntax_input_1 = __webpack_require__(/*! ./_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
29458
+ /** "me" is the self reference in classes, it cannot be declared as a parameter, attribute or variable */
29459
+ function checkReservedName(token, input) {
29460
+ if (token === undefined || token.getStr().toLowerCase() !== "me" || input.scope.isAnyOO() === false) {
29461
+ return;
29462
+ }
29463
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, "\"me\" is a reserved name, it cannot be declared"));
29464
+ }
29465
+ //# sourceMappingURL=_reserved_names.js.map
29466
+
29467
+ /***/ },
29468
+
29310
29469
  /***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js"
29311
29470
  /*!****************************************************************************!*\
29312
29471
  !*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js ***!
@@ -30991,11 +31150,47 @@ class BasicTypes {
30991
31150
  }
30992
31151
  cloneType(type, qualifiedName) {
30993
31152
  // nested types(containing "-") will inherit the qualified names if possible
30994
- // todo, this needs to be extended to all AbstractTypes instead of just CharacterType
30995
- if (type instanceof basic_1.CharacterType
30996
- && qualifiedName
30997
- && qualifiedName.includes("-") === false) {
30998
- type = type.cloneType({ qualifiedName });
31153
+ // todo, this needs to be extended to all AbstractTypes
31154
+ if (!qualifiedName || qualifiedName.includes("-") === true) {
31155
+ return type;
31156
+ }
31157
+ // TYPES creates a new type, it is no longer the DDIC type
31158
+ const data = Object.assign(Object.assign({}, type.getAbstractTypeData()), { qualifiedName, ddicName: undefined });
31159
+ if (type instanceof basic_1.CharacterType) {
31160
+ type = new basic_1.CharacterType(type.getLength(), data);
31161
+ }
31162
+ else if (type instanceof Types.IntegerType) {
31163
+ type = Types.IntegerType.get(data);
31164
+ }
31165
+ else if (type instanceof Types.StringType) {
31166
+ type = Types.StringType.get(data);
31167
+ }
31168
+ else if (type instanceof Types.XStringType) {
31169
+ type = Types.XStringType.get(data);
31170
+ }
31171
+ else if (type instanceof Types.Integer8Type) {
31172
+ type = new Types.Integer8Type(data);
31173
+ }
31174
+ else if (type instanceof Types.NumericType) {
31175
+ type = new Types.NumericType(type.getLength(), data);
31176
+ }
31177
+ else if (type instanceof Types.HexType) {
31178
+ type = new Types.HexType(type.getLength(), data);
31179
+ }
31180
+ else if (type instanceof Types.FloatingPointType) {
31181
+ type = new Types.FloatingPointType(type.getLength(), data);
31182
+ }
31183
+ else if (type instanceof Types.DateType) {
31184
+ type = new Types.DateType(data);
31185
+ }
31186
+ else if (type instanceof Types.TimeType) {
31187
+ type = new Types.TimeType(data);
31188
+ }
31189
+ else if (type instanceof basic_1.StructureType) {
31190
+ type = new basic_1.StructureType(type.getComponents().slice(), qualifiedName, undefined, type.getDescription());
31191
+ }
31192
+ else if (type instanceof basic_1.TableType) {
31193
+ type = new basic_1.TableType(type.getRowType(), type.getOptions(), qualifiedName, type.getDescription());
30999
31194
  }
31000
31195
  return type;
31001
31196
  }
@@ -31276,6 +31471,11 @@ class BasicTypes {
31276
31471
  if (text === undefined) {
31277
31472
  text = "TYPE";
31278
31473
  }
31474
+ const additionIssue = this.checkLengthDecimals(node, text);
31475
+ if (additionIssue !== undefined) {
31476
+ this.input.issues.push(additionIssue);
31477
+ return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
31478
+ }
31279
31479
  let found = undefined;
31280
31480
  if (this.isRAPTypeStructure(text)) {
31281
31481
  return Types.VoidType.get((_f = node.findFirstExpression(Expressions.TypeStructure)) === null || _f === void 0 ? void 0 : _f.concatTokens());
@@ -31322,6 +31522,10 @@ class BasicTypes {
31322
31522
  if (type === undefined) {
31323
31523
  return new Types.UnknownType("Type error, could not resolve \"" + name + "\", parseType");
31324
31524
  }
31525
+ // generic tables are reported via DataReference.isGeneric()
31526
+ if (type.isGeneric() === true && !(type instanceof basic_1.TableType)) {
31527
+ throw new Error("LIKE REF TO not possible, \"" + name + "\" is generic");
31528
+ }
31325
31529
  return new Types.DataReference(type, name);
31326
31530
  }
31327
31531
  else if (text === "TYPE STANDARD TABLE"
@@ -31819,6 +32023,65 @@ class BasicTypes {
31819
32023
  }
31820
32024
  throw new Error("findValue, unexpected");
31821
32025
  }
32026
+ // the LENGTH and DECIMALS additions of DATA, TYPES, CONSTANTS and STATICS, as a system checks them:
32027
+ // LENGTH only with TYPE c, n, x or p, DECIMALS only with TYPE p, also not without a TYPE addition,
32028
+ // a named type cannot be given a length either. With LIKE, a system ignores LENGTH and rejects DECIMALS
32029
+ checkLengthDecimals(node, text) {
32030
+ const length = node.findDirectExpression(Expressions.Length);
32031
+ const decimals = node.findDirectExpression(Expressions.Decimals);
32032
+ const fieldLength = node.get() instanceof Statements.Parameter
32033
+ ? undefined : node.findDirectExpression(Expressions.ConstantFieldLength);
32034
+ if (length === undefined && decimals === undefined && fieldLength === undefined) {
32035
+ return undefined;
32036
+ }
32037
+ else if (text.startsWith("LIKE")) {
32038
+ if (decimals === undefined && fieldLength === undefined) {
32039
+ return undefined;
32040
+ }
32041
+ const message = "When referencing another field (with LIKE), type and length cannot be changed";
32042
+ return (0, _syntax_input_1.syntaxIssue)(this.input, (decimals !== null && decimals !== void 0 ? decimals : node).getFirstToken(), message);
32043
+ }
32044
+ if (fieldLength !== undefined) {
32045
+ const fieldLengthIssue = this.checkFieldLength(node, text);
32046
+ if (fieldLengthIssue !== undefined) {
32047
+ return fieldLengthIssue;
32048
+ }
32049
+ }
32050
+ const builtin = text.startsWith("TYPE") ? text.substring(4).trim() : "";
32051
+ if (length !== undefined && ["C", "N", "X", "P"].includes(builtin) === false) {
32052
+ return (0, _syntax_input_1.syntaxIssue)(this.input, length.getFirstToken(), "\"LENGTH\" can only be specified for types C, N, X, or P");
32053
+ }
32054
+ else if (decimals !== undefined && builtin !== "P") {
32055
+ return (0, _syntax_input_1.syntaxIssue)(this.input, decimals.getFirstToken(), "\"DECIMALS\" can be specified only for type P");
32056
+ }
32057
+ return undefined;
32058
+ }
32059
+ // the length in brackets, "DATA foo(8) TYPE d", as a system checks it: c, n, x and p take any length,
32060
+ // d, t and f only their own length, i any length. Their allowed lengths are ignored with a warning,
32061
+ // which is an error in classes and interfaces. Any other type is an error
32062
+ checkFieldLength(node, text) {
32063
+ var _a;
32064
+ const typeNameExpression = node.findFirstExpression(Expressions.TypeName);
32065
+ const typeName = (_a = typeNameExpression === null || typeNameExpression === void 0 ? void 0 : typeNameExpression.concatTokens().toUpperCase()) !== null && _a !== void 0 ? _a : "";
32066
+ if (typeNameExpression === undefined
32067
+ || text.includes(" REF TO ")
32068
+ || ["C", "N", "X", "P"].includes(typeName)) {
32069
+ return undefined;
32070
+ }
32071
+ const token = typeNameExpression.getFirstToken();
32072
+ const ownLength = { "D": 8, "T": 6, "F": 8 };
32073
+ if (ownLength[typeName] !== undefined) {
32074
+ const length = this.findLength(node);
32075
+ if (length !== undefined && length !== ownLength[typeName]) {
32076
+ const message = "Type \"" + typeName + "\" can only have the specified length \"" + ownLength[typeName] + "\" or no length specified at all";
32077
+ return (0, _syntax_input_1.syntaxIssue)(this.input, token, message);
32078
+ }
32079
+ }
32080
+ if ((ownLength[typeName] !== undefined || typeName === "I") && this.input.scope.isAnyOO() === false) {
32081
+ return undefined;
32082
+ }
32083
+ return (0, _syntax_input_1.syntaxIssue)(this.input, token, "Lengths specified in combination with type \"" + typeName + "\" are ignored");
32084
+ }
31822
32085
  findDecimals(node) {
31823
32086
  var _a, _b, _c;
31824
32087
  const dec = (_b = (_a = node.findDirectExpression(Expressions.Decimals)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Integer)) === null || _b === void 0 ? void 0 : _b.concatTokens();
@@ -32097,6 +32360,75 @@ function checkDatabaseWorkArea(node, dbSource, sourceTypes, input) {
32097
32360
 
32098
32361
  /***/ },
32099
32362
 
32363
+ /***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_check_header_line.js"
32364
+ /*!***********************************************************************************************!*\
32365
+ !*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_check_header_line.js ***!
32366
+ \***********************************************************************************************/
32367
+ (__unused_webpack_module, exports, __webpack_require__) {
32368
+
32369
+ "use strict";
32370
+
32371
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
32372
+ if (k2 === undefined) k2 = k;
32373
+ var desc = Object.getOwnPropertyDescriptor(m, k);
32374
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
32375
+ desc = { enumerable: true, get: function() { return m[k]; } };
32376
+ }
32377
+ Object.defineProperty(o, k2, desc);
32378
+ }) : (function(o, m, k, k2) {
32379
+ if (k2 === undefined) k2 = k;
32380
+ o[k2] = m[k];
32381
+ }));
32382
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
32383
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
32384
+ }) : function(o, v) {
32385
+ o["default"] = v;
32386
+ });
32387
+ var __importStar = (this && this.__importStar) || (function () {
32388
+ var ownKeys = function(o) {
32389
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32390
+ var ar = [];
32391
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32392
+ return ar;
32393
+ };
32394
+ return ownKeys(o);
32395
+ };
32396
+ return function (mod) {
32397
+ if (mod && mod.__esModule) return mod;
32398
+ var result = {};
32399
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32400
+ __setModuleDefault(result, mod);
32401
+ return result;
32402
+ };
32403
+ })();
32404
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
32405
+ exports.checkHeaderLine = checkHeaderLine;
32406
+ const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
32407
+ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
32408
+ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
32409
+ // A table with header line written without [] is the header line, not the table body,
32410
+ // so it cannot be passed to a table typed method parameter. Returns true if an issue was reported.
32411
+ function checkHeaderLine(source, sourceType, parameterType, input) {
32412
+ if (source === undefined
32413
+ || !(parameterType instanceof basic_1.TableType)
32414
+ || !(sourceType instanceof basic_1.TableType)
32415
+ || sourceType.isWithHeader() === false) {
32416
+ return false;
32417
+ }
32418
+ const chain = source.getChildren().length === 1 ? source.findDirectExpression(Expressions.FieldChain) : undefined;
32419
+ const children = (chain === null || chain === void 0 ? void 0 : chain.getChildren()) || [];
32420
+ if (chain === undefined || children[children.length - 1].get() instanceof Expressions.TableBody) {
32421
+ return false;
32422
+ }
32423
+ const name = chain.concatTokens();
32424
+ const message = `"${name}" is the header line, use "${name}[]" to pass the table body`;
32425
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, source.getFirstToken(), message));
32426
+ return true;
32427
+ }
32428
+ //# sourceMappingURL=_check_header_line.js.map
32429
+
32430
+ /***/ },
32431
+
32100
32432
  /***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_check_offset_length.js"
32101
32433
  /*!*************************************************************************************************!*\
32102
32434
  !*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_check_offset_length.js ***!
@@ -32293,7 +32625,7 @@ function substringType(context, offset, length, node, input) {
32293
32625
  return context;
32294
32626
  }
32295
32627
  else if (numericName !== undefined) {
32296
- const message = `Offset or length specification not possible on a field of numeric type "${numericName}"`;
32628
+ const message = `Field type "${numericName}" does not permit substrings to be accessed`;
32297
32629
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
32298
32630
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
32299
32631
  }
@@ -32322,12 +32654,13 @@ function substringType(context, offset, length, node, input) {
32322
32654
  }
32323
32655
  return context;
32324
32656
  }
32657
+ // the internal type code the ABAP syntax check names: I, 8, P, F, a (decfloat16), e (decfloat34)
32325
32658
  function numericTypeName(context) {
32326
32659
  if (context instanceof basic_1.IntegerType) {
32327
32660
  return "I";
32328
32661
  }
32329
32662
  else if (context instanceof basic_1.Integer8Type) {
32330
- return "INT8";
32663
+ return "8";
32331
32664
  }
32332
32665
  else if (context instanceof basic_1.PackedType) {
32333
32666
  return "P";
@@ -32336,10 +32669,10 @@ function numericTypeName(context) {
32336
32669
  return "F";
32337
32670
  }
32338
32671
  else if (context instanceof basic_1.DecFloat16Type) {
32339
- return "DECFLOAT16";
32672
+ return "a";
32340
32673
  }
32341
32674
  else if (context instanceof basic_1.DecFloat34Type) {
32342
- return "DECFLOAT34";
32675
+ return "e";
32343
32676
  }
32344
32677
  else if (context instanceof basic_1.DecFloatType) {
32345
32678
  return "DECFLOAT";
@@ -32795,12 +33128,20 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modu
32795
33128
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
32796
33129
  const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
32797
33130
  const _builtin_1 = __webpack_require__(/*! ../_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
32798
- const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
33131
+ const _builtin_call_1 = __webpack_require__(/*! ../_builtin_call */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin_call.js");
32799
33132
  class Compare {
32800
33133
  static runSyntax(node, input) {
32801
33134
  var _a;
32802
- const sourceTypes = [];
32803
33135
  const sources = node.findDirectExpressions(Expressions.Source);
33136
+ // reported before the operands are checked, which then skip the more general predicate function message
33137
+ const initialMessage = this.checkInitialOperand(node, input);
33138
+ const predicateMessage = this.checkPredicateOperand(sources, input);
33139
+ const operandMessage = initialMessage !== null && initialMessage !== void 0 ? initialMessage : predicateMessage;
33140
+ if (operandMessage !== undefined) {
33141
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), operandMessage));
33142
+ }
33143
+ // the operands are always checked, for their own errors and references
33144
+ const sourceTypes = [];
32804
33145
  for (const t of sources) {
32805
33146
  sourceTypes.push(source_1.Source.runSyntax(t, input));
32806
33147
  }
@@ -32810,14 +33151,7 @@ class Compare {
32810
33151
  for (const t of node.findDirectExpressions(Expressions.MethodCallChain)) {
32811
33152
  method_call_chain_1.MethodCallChain.runSyntax(t, input);
32812
33153
  }
32813
- const initialMessage = this.checkInitialOperand(node, input);
32814
- if (initialMessage !== undefined) {
32815
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), initialMessage));
32816
- return;
32817
- }
32818
- const predicateMessage = this.checkPredicateOperand(sources, input);
32819
- if (predicateMessage !== undefined) {
32820
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), predicateMessage));
33154
+ if (operandMessage !== undefined) {
32821
33155
  return;
32822
33156
  }
32823
33157
  const typeUtils = new _type_utils_1.TypeUtils(input.scope);
@@ -32873,35 +33207,20 @@ class Compare {
32873
33207
  if (input.scope.getOpenABAP()) {
32874
33208
  return undefined;
32875
33209
  }
33210
+ let message = undefined;
32876
33211
  for (const source of sources) {
32877
33212
  const name = this.builtinCallName(source, input);
32878
33213
  if (_builtin_1.BuiltIn.isPredicate(name) === true) {
32879
- return `Predicate function "${name}" cannot be the operand of a comparison`;
33214
+ source_1.Source.predicateReported(source);
33215
+ message = message !== null && message !== void 0 ? message : `Predicate function "${name}" cannot be the operand of a comparison`;
32880
33216
  }
32881
33217
  }
32882
- return undefined;
33218
+ return message;
32883
33219
  }
32884
33220
  // the name of the built-in function when the source is exactly one call of it, not hidden by a method of the same name
32885
33221
  static builtinCallName(source, input) {
32886
- var _a;
32887
- const chain = source === null || source === void 0 ? void 0 : source.getChildren();
32888
- if ((chain === null || chain === void 0 ? void 0 : chain.length) !== 1 || !(chain[0] instanceof nodes_1.ExpressionNode) || !(chain[0].get() instanceof Expressions.MethodCallChain)) {
32889
- return undefined;
32890
- }
32891
- const calls = chain[0].getChildren();
32892
- if (calls.length !== 1 || !(calls[0] instanceof nodes_1.ExpressionNode) || !(calls[0].get() instanceof Expressions.MethodCall)) {
32893
- return undefined;
32894
- }
32895
- const name = (_a = calls[0].findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.concatTokens();
32896
- if (name === undefined || _builtin_1.BuiltIn.searchBuiltin(name) === undefined) {
32897
- return undefined;
32898
- }
32899
- // a method of the same name hides the built-in function
32900
- const enclosing = input.scope.findClassDefinition(input.scope.getEnclosingClassName());
32901
- if (enclosing !== undefined && new _object_oriented_1.ObjectOriented(input.scope).searchMethodName(enclosing, name).method !== undefined) {
32902
- return undefined;
32903
- }
32904
- return name;
33222
+ const call = _builtin_call_1.BuiltInCall.fromSource(source, input);
33223
+ return call === undefined ? undefined : _builtin_call_1.BuiltInCall.callName(call);
32905
33224
  }
32906
33225
  }
32907
33226
  exports.Compare = Compare;
@@ -33482,15 +33801,22 @@ var __importStar = (this && this.__importStar) || (function () {
33482
33801
  Object.defineProperty(exports, "__esModule", ({ value: true }));
33483
33802
  exports.CondBody = void 0;
33484
33803
  const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
33804
+ const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
33485
33805
  const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
33486
33806
  const let_1 = __webpack_require__(/*! ./let */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/let.js");
33487
33807
  const cond_1 = __webpack_require__(/*! ./cond */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cond.js");
33488
33808
  const _raise_message_1 = __webpack_require__(/*! ../_raise_message */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_raise_message.js");
33809
+ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
33489
33810
  class CondBody {
33490
33811
  static runSyntax(node, input, targetType) {
33491
33812
  if (node === undefined) {
33492
33813
  return undefined;
33493
33814
  }
33815
+ const throwNode = node.findDirectExpression(Expressions.Throw);
33816
+ const throwMessage = throwNode ? new _object_oriented_1.ObjectOriented(input.scope).checkClassBasedException() : undefined;
33817
+ if (throwNode && throwMessage) {
33818
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, throwNode.getFirstToken(), throwMessage));
33819
+ }
33494
33820
  let scoped = false;
33495
33821
  const l = node.findDirectExpression(Expressions.Let);
33496
33822
  if (l) {
@@ -34562,6 +34888,7 @@ const _scope_type_1 = __webpack_require__(/*! ../_scope_type */ "./node_modules/
34562
34888
  const component_cond_1 = __webpack_require__(/*! ./component_cond */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_cond.js");
34563
34889
  const cond_1 = __webpack_require__(/*! ./cond */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cond.js");
34564
34890
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
34891
+ const loop_group_by_1 = __webpack_require__(/*! ./loop_group_by */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/loop_group_by.js");
34565
34892
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
34566
34893
  const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
34567
34894
  const let_1 = __webpack_require__(/*! ./let */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/let.js");
@@ -34589,18 +34916,19 @@ class For {
34589
34916
  for (const f of inlineField) {
34590
34917
  inline_field_definition_1.InlineFieldDefinition.runSyntax(f, input);
34591
34918
  }
34919
+ let groupsSource = undefined;
34592
34920
  if (groupsToken !== undefined) {
34593
34921
  const message = input.scope.checkLocalName(groupsToken.getStr(), undefined);
34594
34922
  if (message !== undefined) {
34595
34923
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, groupsToken, message));
34596
34924
  return scoped;
34597
34925
  }
34598
- const type = basic_1.VoidType.get("todoGroupBy");
34599
- const identifier = new _typed_identifier_1.TypedIdentifier(groupsToken, input.filename, type, ["inline" /* IdentifierMeta.InlineDefinition */]);
34600
- input.scope.addIdentifier(identifier);
34601
- input.scope.addReference(groupsToken, identifier, _reference_1.ReferenceType.DataWriteReference, input.filename);
34926
+ groupsSource = this.runGroups(node, groupsToken, input);
34602
34927
  }
34603
34928
  for (const s of node.findDirectExpressions(Expressions.Source)) {
34929
+ if (s === groupsSource) {
34930
+ continue;
34931
+ }
34604
34932
  source_1.Source.runSyntax(s, input);
34605
34933
  }
34606
34934
  for (const s of node.findDirectExpressions(Expressions.ComponentCond)) {
@@ -34614,6 +34942,32 @@ class For {
34614
34942
  }
34615
34943
  return scoped;
34616
34944
  }
34945
+ /** FOR GROUPS group OF wa IN itab GROUP BY key, returns the itab source */
34946
+ static runGroups(node, groupsToken, input) {
34947
+ var _a;
34948
+ const tableSource = node.findExpressionAfterToken("IN");
34949
+ let rowType = basic_1.VoidType.get("ForGroups");
34950
+ if ((tableSource === null || tableSource === void 0 ? void 0 : tableSource.get()) instanceof Expressions.Source) {
34951
+ const tableType = source_1.Source.runSyntax(tableSource, input);
34952
+ if (tableType instanceof basic_1.TableType) {
34953
+ rowType = tableType.getRowType();
34954
+ }
34955
+ }
34956
+ const waToken = (_a = node.findExpressionAfterToken("OF")) === null || _a === void 0 ? void 0 : _a.getFirstToken();
34957
+ if (waToken !== undefined) {
34958
+ const wa = new _typed_identifier_1.TypedIdentifier(waToken, input.filename, rowType, ["inline" /* IdentifierMeta.InlineDefinition */]);
34959
+ input.scope.addIdentifier(wa);
34960
+ input.scope.addReference(waToken, wa, _reference_1.ReferenceType.DataWriteReference, input.filename);
34961
+ }
34962
+ const keyType = node.findDirectTokenByText("BY") !== undefined
34963
+ ? loop_group_by_1.LoopGroupBy.runKey(node, input)
34964
+ : basic_1.VoidType.get("ForGroups");
34965
+ const group = new _typed_identifier_1.TypedIdentifier(groupsToken, input.filename, keyType, ["inline" /* IdentifierMeta.InlineDefinition */]);
34966
+ input.scope.addIdentifier(group);
34967
+ input.scope.addReference(groupsToken, group, _reference_1.ReferenceType.DataWriteReference, input.filename);
34968
+ input.scope.setGroupMemberType(group, rowType);
34969
+ return (tableSource === null || tableSource === void 0 ? void 0 : tableSource.get()) instanceof Expressions.Source ? tableSource : undefined;
34970
+ }
34617
34971
  }
34618
34972
  exports.For = For;
34619
34973
  //# sourceMappingURL=for.js.map
@@ -34926,6 +35280,7 @@ const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifie
34926
35280
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
34927
35281
  const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
34928
35282
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
35283
+ const _reserved_names_1 = __webpack_require__(/*! ../_reserved_names */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reserved_names.js");
34929
35284
  class InlineData {
34930
35285
  static runSyntax(node, input, type) {
34931
35286
  var _a;
@@ -34934,6 +35289,7 @@ class InlineData {
34934
35289
  const message = "DATA name too long, " + token.getStr();
34935
35290
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, message));
34936
35291
  }
35292
+ (0, _reserved_names_1.checkReservedName)(token, input);
34937
35293
  if (token && type) {
34938
35294
  if (type instanceof basic_1.CSequenceType || type instanceof basic_1.CLikeType) {
34939
35295
  type = basic_1.StringType.get();
@@ -35203,6 +35559,7 @@ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@ab
35203
35559
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
35204
35560
  const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
35205
35561
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
35562
+ const loop_group_by_1 = __webpack_require__(/*! ./loop_group_by */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/loop_group_by.js");
35206
35563
  class InlineLoopDefinition {
35207
35564
  static runSyntax(node, input) {
35208
35565
  if (node === undefined) {
@@ -35215,8 +35572,12 @@ class InlineLoopDefinition {
35215
35572
  const source = node.findDirectExpression(Expressions.Source);
35216
35573
  if (source && target) {
35217
35574
  const sourceType = source_1.Source.runSyntax(source, input);
35218
- let rowType = undefined;
35219
- if (sourceType instanceof basic_1.TableType) {
35575
+ const inGroup = node.concatTokens().toUpperCase().includes(" IN GROUP ");
35576
+ let rowType = inGroup ? loop_group_by_1.LoopGroupBy.findMemberType(source, input) : undefined;
35577
+ if (rowType !== undefined) {
35578
+ // FOR ... IN GROUP, the members have the row type of the grouped table
35579
+ }
35580
+ else if (sourceType instanceof basic_1.TableType) {
35220
35581
  rowType = sourceType.getRowType();
35221
35582
  }
35222
35583
  else if (sourceType instanceof basic_1.VoidType) {
@@ -35228,7 +35589,7 @@ class InlineLoopDefinition {
35228
35589
  return;
35229
35590
  }
35230
35591
  if (rowType === undefined
35231
- && node.concatTokens().toUpperCase().includes(" IN GROUP ")
35592
+ && inGroup
35232
35593
  && sourceType !== undefined) {
35233
35594
  rowType = sourceType;
35234
35595
  }
@@ -35374,34 +35735,144 @@ var __importStar = (this && this.__importStar) || (function () {
35374
35735
  Object.defineProperty(exports, "__esModule", ({ value: true }));
35375
35736
  exports.LoopGroupBy = void 0;
35376
35737
  const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
35738
+ const nodes_1 = __webpack_require__(/*! ../../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
35377
35739
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
35378
- const component_compare_1 = __webpack_require__(/*! ./component_compare */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_compare.js");
35740
+ const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
35379
35741
  const inline_data_1 = __webpack_require__(/*! ./inline_data */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js");
35380
35742
  const fstarget_1 = __webpack_require__(/*! ./fstarget */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js");
35381
35743
  const target_1 = __webpack_require__(/*! ./target */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js");
35382
35744
  const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
35745
+ const field_chain_1 = __webpack_require__(/*! ./field_chain */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js");
35383
35746
  class LoopGroupBy {
35384
- static runSyntax(node, input) {
35385
- for (const t of node.findAllExpressions(Expressions.Target)) {
35386
- const inline = t.findDirectExpression(Expressions.InlineData);
35747
+ /**
35748
+ * @param rowType row type of the grouped table, the type of the members of each group
35749
+ * @param representative the row target of the LOOP, it is the group when GROUP BY has no target
35750
+ */
35751
+ static runSyntax(node, input, rowType, representative) {
35752
+ var _a;
35753
+ const keyType = this.runKey(node, input);
35754
+ const groupTarget = node.findDirectExpression(Expressions.LoopGroupByTarget);
35755
+ const target = groupTarget === null || groupTarget === void 0 ? void 0 : groupTarget.findDirectExpression(Expressions.Target);
35756
+ const fsTarget = groupTarget === null || groupTarget === void 0 ? void 0 : groupTarget.findDirectExpression(Expressions.FSTarget);
35757
+ if (target) {
35758
+ const inline = target.findDirectExpression(Expressions.InlineData);
35387
35759
  if (inline) {
35388
- inline_data_1.InlineData.runSyntax(inline, input, basic_1.VoidType.get("todoGroupBy"));
35760
+ const isReference = (groupTarget === null || groupTarget === void 0 ? void 0 : groupTarget.findDirectTokenByText("REFERENCE")) !== undefined;
35761
+ inline_data_1.InlineData.runSyntax(inline, input, isReference ? new basic_1.DataReference(keyType) : keyType);
35389
35762
  }
35390
35763
  else {
35391
- target_1.Target.runSyntax(t, input);
35764
+ target_1.Target.runSyntax(target, input);
35392
35765
  }
35393
35766
  }
35394
- for (const t of node.findAllExpressions(Expressions.FSTarget)) {
35395
- fstarget_1.FSTarget.runSyntax(t, input, basic_1.VoidType.get("todoGroupBy"));
35767
+ else if (fsTarget) {
35768
+ fstarget_1.FSTarget.runSyntax(fsTarget, input, keyType);
35769
+ }
35770
+ // bind the group until ENDLOOP, see unbind(), also when the row type is unknown
35771
+ const group = this.findTargetIdentifier((_a = target !== null && target !== void 0 ? target : fsTarget) !== null && _a !== void 0 ? _a : representative, input.scope);
35772
+ if (group) {
35773
+ input.scope.setGroupMemberType(group, rowType !== null && rowType !== void 0 ? rowType : basic_1.VoidType.get("GroupMember"));
35774
+ }
35775
+ }
35776
+ /** the row target of a LOOP, it is the group when GROUP BY has no target */
35777
+ static findRepresentative(loop) {
35778
+ var _a;
35779
+ const loopTarget = loop.findDirectExpression(Expressions.LoopTarget);
35780
+ return (_a = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectExpression(Expressions.Target)) !== null && _a !== void 0 ? _a : loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectExpression(Expressions.FSTarget);
35781
+ }
35782
+ /** called at the end of a LOOP structure, the group of a LOOP AT ... GROUP BY is not bound after its ENDLOOP */
35783
+ static unbind(loop, scope) {
35784
+ var _a, _b;
35785
+ const groupBy = loop.findDirectExpression(Expressions.LoopGroupBy);
35786
+ if (groupBy === undefined) {
35787
+ return;
35396
35788
  }
35397
- for (const t of node.findDirectExpressions(Expressions.Source)) {
35398
- source_1.Source.runSyntax(t, input, basic_1.VoidType.get("todoGroupBy"));
35789
+ const groupTarget = groupBy.findDirectExpression(Expressions.LoopGroupByTarget);
35790
+ const node = (_b = (_a = groupTarget === null || groupTarget === void 0 ? void 0 : groupTarget.findDirectExpression(Expressions.Target)) !== null && _a !== void 0 ? _a : groupTarget === null || groupTarget === void 0 ? void 0 : groupTarget.findDirectExpression(Expressions.FSTarget)) !== null && _b !== void 0 ? _b : this.findRepresentative(loop);
35791
+ const group = this.findTargetIdentifier(node, scope);
35792
+ if (group) {
35793
+ scope.removeGroupMemberType(group);
35399
35794
  }
35400
- for (const c of node.findDirectExpressions(Expressions.LoopGroupByComponent)) {
35401
- for (const t of c.findDirectExpressions(Expressions.ComponentCompareSingle)) {
35402
- component_compare_1.ComponentCompare.runSyntax(t, input);
35795
+ }
35796
+ /** LOOP AT GROUP group, the name of the group when it is a variable that no enclosing group loop binds */
35797
+ static findUnboundGroup(source, input) {
35798
+ if (source === undefined) {
35799
+ return undefined;
35800
+ }
35801
+ const name = this.groupName(source);
35802
+ const found = input.scope.findVariable(name);
35803
+ if (found === undefined || input.scope.findGroupMemberType(found) !== undefined) {
35804
+ return undefined;
35805
+ }
35806
+ return name;
35807
+ }
35808
+ /** type of the group key, from GROUP BY expr or GROUP BY ( name = expr ... ) */
35809
+ static runKey(node, input) {
35810
+ const components = node.findDirectExpressions(Expressions.LoopGroupByComponent);
35811
+ if (components.length === 0) {
35812
+ // LOOP: the key is the first child of LoopGroupBy, FOR GROUPS: the key follows GROUP BY
35813
+ const key = node.get() instanceof Expressions.LoopGroupBy ? node.getFirstChild() : node.findExpressionAfterToken("BY");
35814
+ let type = undefined;
35815
+ if (key instanceof nodes_1.ExpressionNode && key.get() instanceof Expressions.Source) {
35816
+ type = source_1.Source.runSyntax(key, input);
35817
+ }
35818
+ else if (key instanceof nodes_1.ExpressionNode && key.get() instanceof Expressions.FieldChain) {
35819
+ type = field_chain_1.FieldChain.runSyntax(key, input, _reference_1.ReferenceType.DataReadReference);
35403
35820
  }
35821
+ return type !== null && type !== void 0 ? type : basic_1.VoidType.get("GroupKey");
35822
+ }
35823
+ const fields = [];
35824
+ let dynamic = false;
35825
+ for (const c of components) {
35826
+ const single = c.findDirectExpression(Expressions.ComponentCompareSingle);
35827
+ if (single) {
35828
+ const source = single.findDirectExpression(Expressions.Source);
35829
+ const type = source ? source_1.Source.runSyntax(source, input) : undefined;
35830
+ const name = single.findDirectExpression(Expressions.ComponentChainSimple);
35831
+ if (name === undefined) {
35832
+ dynamic = true;
35833
+ continue;
35834
+ }
35835
+ fields.push({ name: name.concatTokens(), type: type !== null && type !== void 0 ? type : basic_1.VoidType.get("GroupKey") });
35836
+ }
35837
+ else {
35838
+ // GROUP SIZE and GROUP INDEX
35839
+ const name = c.findDirectExpression(Expressions.ComponentName);
35840
+ if (name) {
35841
+ fields.push({ name: name.concatTokens(), type: basic_1.IntegerType.get() });
35842
+ }
35843
+ }
35844
+ }
35845
+ if (dynamic === true || fields.length === 0) {
35846
+ return basic_1.VoidType.get("GroupKey");
35847
+ }
35848
+ return new basic_1.StructureType(fields);
35849
+ }
35850
+ /** the group variable in LOOP AT GROUP group and FOR ... IN GROUP group */
35851
+ static findMemberType(source, input) {
35852
+ if (source === undefined) {
35853
+ return undefined;
35854
+ }
35855
+ const found = input.scope.findVariable(this.groupName(source));
35856
+ return found ? input.scope.findGroupMemberType(found) : undefined;
35857
+ }
35858
+ static groupName(source) {
35859
+ return source.concatTokens().replace(/\s/g, "").replace(/->\*$/, "");
35860
+ }
35861
+ static findTargetIdentifier(node, scope) {
35862
+ var _a;
35863
+ var _b, _c;
35864
+ if (node === undefined) {
35865
+ return undefined;
35866
+ }
35867
+ const inline = (_b = node.findDirectExpression(Expressions.InlineData)) !== null && _b !== void 0 ? _b : node.findDirectExpression(Expressions.InlineFS);
35868
+ let name;
35869
+ if (inline) {
35870
+ name = (_a = ((_c = inline.findFirstExpression(Expressions.TargetField)) !== null && _c !== void 0 ? _c : inline.findFirstExpression(Expressions.TargetFieldSymbol))) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();
35871
+ }
35872
+ else if (node.getChildren().length === 1) {
35873
+ name = node.getFirstToken().getStr();
35404
35874
  }
35875
+ return scope.findVariable(name);
35405
35876
  }
35406
35877
  }
35407
35878
  exports.LoopGroupBy = LoopGroupBy;
@@ -35651,7 +36122,7 @@ class MethodCallChain {
35651
36122
  // for built-in methods set className to undefined
35652
36123
  const className = context instanceof basic_1.ObjectReferenceType ? context.getIdentifierName() : undefined;
35653
36124
  const methodToken = (_a = current.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
35654
- const methodName = methodToken === null || methodToken === void 0 ? void 0 : methodToken.getStr();
36125
+ const methodName = methodToken === null || methodToken === void 0 ? void 0 : methodToken.getStr().replace(/^!/, "");
35655
36126
  const def = input.scope.findObjectDefinition(className);
35656
36127
  const isSuper = current === children[2]
35657
36128
  && first.get() instanceof Expressions.FieldChain
@@ -35846,6 +36317,7 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modu
35846
36317
  const constant_1 = __webpack_require__(/*! ./constant */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/constant.js");
35847
36318
  const _check_offset_length_1 = __webpack_require__(/*! ./_check_offset_length */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_check_offset_length.js");
35848
36319
  const _check_text_symbol_1 = __webpack_require__(/*! ./_check_text_symbol */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_check_text_symbol.js");
36320
+ const _check_header_line_1 = __webpack_require__(/*! ./_check_header_line */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_check_header_line.js");
35849
36321
  const _builtin_1 = __webpack_require__(/*! ../_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
35850
36322
  class MethodCallParam {
35851
36323
  /** returns the type of the unnamed argument, if any */
@@ -35923,6 +36395,9 @@ class MethodCallParam {
35923
36395
  else if ((0, _check_text_symbol_1.checkTextSymbol)(child, targetType, input)) {
35924
36396
  return;
35925
36397
  }
36398
+ else if ((0, _check_header_line_1.checkHeaderLine)(child, sourceType, targetType, input)) {
36399
+ return;
36400
+ }
35926
36401
  else if (this.isAssignable(sourceType, targetType, child, method, input) === false) {
35927
36402
  const message = "Method parameter type not compatible";
35928
36403
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
@@ -36186,6 +36661,7 @@ const field_chain_1 = __webpack_require__(/*! ./field_chain */ "./node_modules/@
36186
36661
  const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
36187
36662
  const _check_offset_length_1 = __webpack_require__(/*! ./_check_offset_length */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_check_offset_length.js");
36188
36663
  const _check_text_symbol_1 = __webpack_require__(/*! ./_check_text_symbol */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_check_text_symbol.js");
36664
+ const _check_header_line_1 = __webpack_require__(/*! ./_check_header_line */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_check_header_line.js");
36189
36665
  const _builtin_1 = __webpack_require__(/*! ../_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
36190
36666
  function normalizeParameterName(name) {
36191
36667
  return name.replace(/^!/, "").toUpperCase();
@@ -36351,6 +36827,9 @@ class MethodParameters {
36351
36827
  if ((0, _check_text_symbol_1.checkTextSymbol)(item.source, parameter.getType(), input)) {
36352
36828
  return;
36353
36829
  }
36830
+ else if ((0, _check_header_line_1.checkHeaderLine)(item.source, item.sourceType, parameter.getType(), input)) {
36831
+ return;
36832
+ }
36354
36833
  else if (assignable(item.sourceType, parameter.getType(), item.source) === false) {
36355
36834
  const message = "Method parameter type not compatible, " + item.name;
36356
36835
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
@@ -37194,6 +37673,8 @@ const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@a
37194
37673
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
37195
37674
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
37196
37675
  const _check_database_fields_1 = __webpack_require__(/*! ./_check_database_fields */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_check_database_fields.js");
37676
+ const field_chain_1 = __webpack_require__(/*! ./field_chain */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js");
37677
+ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
37197
37678
  const isSimple = /^\w+$/;
37198
37679
  // SQL functions where the result has the same type as the first argument
37199
37680
  const sameTypeAsFirstArgument = new Set(["UPPER", "LOWER", "LTRIM", "RTRIM"]);
@@ -37402,7 +37883,7 @@ class Select {
37402
37883
  if (intoStructure) {
37403
37884
  const inlineList = intoStructure.findAllExpressions(Expressions.InlineData);
37404
37885
  if (inlineList.length === 1) {
37405
- inline_data_1.InlineData.runSyntax(inlineList[0], input, this.buildStructureType(fields, dbSources, input.scope, from));
37886
+ inline_data_1.InlineData.runSyntax(inlineList[0], input, this.buildStructureType(fields, dbSources, input, from));
37406
37887
  }
37407
37888
  else {
37408
37889
  for (const inline of inlineList) {
@@ -37469,13 +37950,19 @@ class Select {
37469
37950
  return basic_1.IntegerType.get();
37470
37951
  }
37471
37952
  }
37472
- static buildStructureType(fields, dbSources, scope, from) {
37953
+ static buildStructureType(fields, dbSources, input, from) {
37473
37954
  var _a, _b, _c, _d, _e, _f;
37955
+ const scope = input.scope;
37474
37956
  if (fields.length === 1 && dbSources.length === 1) {
37475
37957
  // COUNT( * ) yields an integer regardless of the (possibly dynamic) table
37476
37958
  if (/^count\(\s*\*\s*\)$/i.test(fields[0].code)) {
37477
37959
  return this.countResultType(scope);
37478
37960
  }
37961
+ // a host variable yields its own type regardless of the table
37962
+ const hostType = this.findHostFieldType(fields[0], input);
37963
+ if (hostType) {
37964
+ return hostType;
37965
+ }
37479
37966
  const dbType = (_a = dbSources[0]) === null || _a === void 0 ? void 0 : _a.parseType(scope.getRegistry());
37480
37967
  if (dbType === undefined) {
37481
37968
  const name = ((_b = dbSources[0]) === null || _b === void 0 ? void 0 : _b.getName()) || "buildStructureTypeError";
@@ -37627,6 +38114,30 @@ class Select {
37627
38114
  }
37628
38115
  return components;
37629
38116
  }
38117
+ /** returns the type of the field list entry if it is a single ABAP host variable, "@var" or "@( var )" */
38118
+ static findHostFieldType(field, input) {
38119
+ var _a;
38120
+ if (!(field.expression.get() instanceof Expressions.SQLField)) {
38121
+ return undefined;
38122
+ }
38123
+ const children = field.expression.getChildren().filter(c => !(c.get() instanceof Expressions.SQLAsName) && c.concatTokens().toUpperCase() !== "AS");
38124
+ if (!(((_a = children[0]) === null || _a === void 0 ? void 0 : _a.get()) instanceof tokens_1.WAt)) {
38125
+ return undefined;
38126
+ }
38127
+ // "@var" has two children, "@( var )" has four, anything else is an expression
38128
+ const chain = children.length === 2 ? children[1] : children.length === 4 ? children[2] : undefined;
38129
+ if (!(chain instanceof nodes_1.ExpressionNode) || !(chain.get() instanceof Expressions.SimpleFieldChain2)) {
38130
+ return undefined;
38131
+ }
38132
+ // only resolve the type here, errors for the host variable are not reported by this lookup
38133
+ const issues = [];
38134
+ const type = field_chain_1.FieldChain.runSyntax(chain, Object.assign(Object.assign({}, input), { issues }));
38135
+ // a generic host type cannot type the inline declaration, keep it voided
38136
+ if (issues.length > 0 || type === undefined || type.isGeneric()) {
38137
+ return undefined;
38138
+ }
38139
+ return type;
38140
+ }
37630
38141
  /** returns the SQLFunction node if the field list entry is a single SQL function call */
37631
38142
  static findFunctionColumn(field, requireAlias = true) {
37632
38143
  if (requireAlias === true && field.as === "") {
@@ -37817,6 +38328,7 @@ const conv_body_1 = __webpack_require__(/*! ./conv_body */ "./node_modules/@abap
37817
38328
  const filter_body_1 = __webpack_require__(/*! ./filter_body */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/filter_body.js");
37818
38329
  const corresponding_body_1 = __webpack_require__(/*! ./corresponding_body */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/corresponding_body.js");
37819
38330
  const _builtin_1 = __webpack_require__(/*! ../_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
38331
+ const _builtin_call_1 = __webpack_require__(/*! ../_builtin_call */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin_call.js");
37820
38332
  const attribute_chain_1 = __webpack_require__(/*! ./attribute_chain */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/attribute_chain.js");
37821
38333
  const dereference_1 = __webpack_require__(/*! ./dereference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dereference.js");
37822
38334
  const cast_1 = __webpack_require__(/*! ./cast */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cast.js");
@@ -37836,6 +38348,10 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
37836
38348
  */
37837
38349
  // TODO: refactor all these method parameters to objects, this is getting messy
37838
38350
  class Source {
38351
+ // the predicate function in this source is already reported by the caller, Source only checks its arguments
38352
+ static predicateReported(source) {
38353
+ this.logicalArguments.add(source);
38354
+ }
37839
38355
  static runSyntax(node, input, targetType, writeReference = false, allowGenericDeference = false, readReference = true) {
37840
38356
  var _a, _b;
37841
38357
  if (node === undefined) {
@@ -38046,6 +38562,14 @@ class Source {
38046
38562
  if (first instanceof nodes_1.ExpressionNode) {
38047
38563
  const get = first.get();
38048
38564
  if (get instanceof Expressions.MethodCallChain) {
38565
+ const predicate = this.predicateCall(node, first, input);
38566
+ if (predicate !== undefined) {
38567
+ const message = `Predicate function "${predicate}" can only be used in a logical expression`;
38568
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, first.getFirstToken(), message));
38569
+ // the arguments are still checked, for their own errors and references
38570
+ method_call_chain_1.MethodCallChain.runSyntax(first, input, targetType);
38571
+ return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
38572
+ }
38049
38573
  const found = method_call_chain_1.MethodCallChain.runSyntax(first, input, targetType);
38050
38574
  context = arithmetic === true ? this.infer(context, found, true) : found;
38051
38575
  if (context === undefined) {
@@ -38298,6 +38822,36 @@ class Source {
38298
38822
  }
38299
38823
  return targetType;
38300
38824
  }
38825
+ // a predicate function, line_exists( ) or contains( ), is a logical expression and not a value,
38826
+ // a system reports it as an unknown method in any operand position other than the argument of boolc( ) or xsdbool( ),
38827
+ // which parse as method calls in releases before xsdbool( ) was added, or the bool parameter of boolx( )
38828
+ static predicateCall(source, chain, input) {
38829
+ var _a, _b;
38830
+ if (input.scope.getOpenABAP()) {
38831
+ return undefined;
38832
+ }
38833
+ const call = _builtin_call_1.BuiltInCall.fromChain(chain, input);
38834
+ const name = call === undefined ? undefined : _builtin_call_1.BuiltInCall.callName(call);
38835
+ const upper = name === null || name === void 0 ? void 0 : name.toUpperCase();
38836
+ const param = call === null || call === void 0 ? void 0 : call.findDirectExpression(Expressions.MethodCallParam);
38837
+ if (upper === "BOOLC" || upper === "XSDBOOL") {
38838
+ const argument = param === null || param === void 0 ? void 0 : param.findDirectExpression(Expressions.Source);
38839
+ if (argument !== undefined) {
38840
+ this.logicalArguments.add(argument);
38841
+ }
38842
+ return undefined;
38843
+ }
38844
+ else if (upper === "BOOLX") {
38845
+ for (const p of ((_a = param === null || param === void 0 ? void 0 : param.findDirectExpression(Expressions.ParameterListS)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.ParameterS)) || []) {
38846
+ const argument = p.findDirectExpression(Expressions.Source);
38847
+ if (((_b = p.findDirectExpression(Expressions.ParameterName)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) === "BOOL" && argument !== undefined) {
38848
+ this.logicalArguments.add(argument);
38849
+ }
38850
+ }
38851
+ return undefined;
38852
+ }
38853
+ return _builtin_1.BuiltIn.isPredicate(name) === true && this.logicalArguments.has(source) === false ? name : undefined;
38854
+ }
38301
38855
  // "NEW ty( )->*" is a syntax error, also in releases where a method call can be dereferenced
38302
38856
  static isNewObjectDereference(node, deref) {
38303
38857
  var _a;
@@ -38310,6 +38864,9 @@ class Source {
38310
38864
  }
38311
38865
  }
38312
38866
  exports.Source = Source;
38867
+ // arguments of boolc( ), xsdbool( ) and the bool parameter of boolx( ) parsed as method calls, where a predicate function is allowed,
38868
+ // and operands where the caller has already reported the predicate function in more specific terms
38869
+ Source.logicalArguments = new WeakSet();
38313
38870
  //# sourceMappingURL=source.js.map
38314
38871
 
38315
38872
  /***/ },
@@ -39106,6 +39663,7 @@ var __importStar = (this && this.__importStar) || (function () {
39106
39663
  Object.defineProperty(exports, "__esModule", ({ value: true }));
39107
39664
  exports.SwitchBody = void 0;
39108
39665
  const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
39666
+ const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
39109
39667
  const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
39110
39668
  const _raise_message_1 = __webpack_require__(/*! ../_raise_message */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_raise_message.js");
39111
39669
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
@@ -39115,6 +39673,11 @@ class SwitchBody {
39115
39673
  if (node === undefined) {
39116
39674
  return;
39117
39675
  }
39676
+ const throwNode = node.findDirectExpression(Expressions.Throw);
39677
+ const throwMessage = throwNode ? new _object_oriented_1.ObjectOriented(input.scope).checkClassBasedException() : undefined;
39678
+ if (throwNode && throwMessage) {
39679
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, throwNode.getFirstToken(), throwMessage));
39680
+ }
39118
39681
  for (const t of node.findDirectExpressions(Expressions.Throw)) {
39119
39682
  _raise_message_1.RaiseMessage.checkThrow(t, input);
39120
39683
  }
@@ -39560,7 +40123,9 @@ class TypeTable {
39560
40123
  if (type === undefined) {
39561
40124
  return new _typed_identifier_1.TypedIdentifier(name, input.filename, new basic_1.UnknownType("TableType, fallback"));
39562
40125
  }
39563
- for (const tt of node.findAllExpressions(Expressions.TypeTableKey)) {
40126
+ const keys = node.findAllExpressions(Expressions.TypeTableKey);
40127
+ TypeTable.checkUniqueness(keys, type);
40128
+ for (const tt of keys) {
39564
40129
  const error = type_table_key_1.TypeTableKey.runSyntax(tt, type);
39565
40130
  if (error) {
39566
40131
  type = error;
@@ -39568,6 +40133,24 @@ class TypeTable {
39568
40133
  }
39569
40134
  return new _typed_identifier_1.TypedIdentifier(name, input.filename, type);
39570
40135
  }
40136
+ static checkUniqueness(keys, type) {
40137
+ var _a;
40138
+ for (const key of keys) {
40139
+ if (key.concatTokens().toUpperCase().startsWith("WITH UNIQUE EMPTY KEY")) {
40140
+ throw new Error("EMPTY KEY cannot be UNIQUE");
40141
+ }
40142
+ }
40143
+ // the primary key comes first, it is unnamed or named PRIMARY_KEY
40144
+ const first = keys[0];
40145
+ const keyName = (_a = first === null || first === void 0 ? void 0 : first.findDirectExpression(Expressions.Field)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
40146
+ if (type instanceof basic_1.TableType
40147
+ && type.getAccessType() === basic_1.TableAccessType.hashed
40148
+ && first !== undefined
40149
+ && (keyName === undefined || keyName === "PRIMARY_KEY")
40150
+ && first.concatTokens().toUpperCase().startsWith("WITH NON-UNIQUE ")) {
40151
+ throw new Error("HASHED tables cannot have NON-UNIQUE key");
40152
+ }
40153
+ }
39571
40154
  }
39572
40155
  exports.TypeTable = TypeTable;
39573
40156
  //# sourceMappingURL=type_table.js.map
@@ -41771,6 +42354,7 @@ const data_definition_1 = __webpack_require__(/*! ../expressions/data_definition
41771
42354
  const unknown_type_1 = __webpack_require__(/*! ../../types/basic/unknown_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/unknown_type.js");
41772
42355
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
41773
42356
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
42357
+ const _reserved_names_1 = __webpack_require__(/*! ../_reserved_names */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reserved_names.js");
41774
42358
  class ClassData {
41775
42359
  runSyntax(node, input) {
41776
42360
  const dd = node.findFirstExpression(Expressions.DataDefinition);
@@ -41779,6 +42363,7 @@ class ClassData {
41779
42363
  if (found === undefined) {
41780
42364
  return undefined;
41781
42365
  }
42366
+ (0, _reserved_names_1.checkReservedName)(found.getToken(), input);
41782
42367
  if ((found === null || found === void 0 ? void 0 : found.getType().isGeneric()) === true
41783
42368
  && (found === null || found === void 0 ? void 0 : found.getType().containsVoid()) === false) {
41784
42369
  const message = "DATA definition cannot be generic, " + found.getName();
@@ -43173,12 +43758,14 @@ const data_definition_1 = __webpack_require__(/*! ../expressions/data_definition
43173
43758
  const unknown_type_1 = __webpack_require__(/*! ../../types/basic/unknown_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/unknown_type.js");
43174
43759
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
43175
43760
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
43761
+ const _reserved_names_1 = __webpack_require__(/*! ../_reserved_names */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reserved_names.js");
43176
43762
  class Data {
43177
43763
  runSyntax(node, input) {
43178
43764
  const name = node.findFirstExpression(Expressions.DefinitionName);
43179
43765
  const dd = node.findFirstExpression(Expressions.DataDefinition);
43180
43766
  if (dd) {
43181
43767
  const id = data_definition_1.DataDefinition.runSyntax(dd, input);
43768
+ (0, _reserved_names_1.checkReservedName)(id === null || id === void 0 ? void 0 : id.getToken(), input);
43182
43769
  if (id && this.isOnlyDigits(id.getName()) && this.allowOnlyDigitsName(node, input) === false) {
43183
43770
  const message = "not possible to have a name with only digits";
43184
43771
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, id.getToken(), message));
@@ -43460,6 +44047,17 @@ class DeleteInternal {
43460
44047
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
43461
44048
  return;
43462
44049
  }
44050
+ if (targetType instanceof basic_1.TableType && targetType.isWithHeader() === false) {
44051
+ // short forms, "DELETE itab." deletes the current line inside a LOOP, otherwise both use the header line
44052
+ const children = node.getChildren().length;
44053
+ const short = children === 3 && input.inLoop !== true;
44054
+ const shortTable = children === 4 && node.findDirectTokenByText("TABLE") !== undefined;
44055
+ if (short || shortTable) {
44056
+ const message = "Table does not have header line";
44057
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
44058
+ return;
44059
+ }
44060
+ }
43463
44061
  if (targetType instanceof basic_1.TableType) {
43464
44062
  targetType = targetType.getRowType();
43465
44063
  }
@@ -45553,9 +46151,12 @@ const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expr
45553
46151
  const source_1 = __webpack_require__(/*! ../expressions/source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
45554
46152
  const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
45555
46153
  const database_table_1 = __webpack_require__(/*! ../expressions/database_table */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/database_table.js");
46154
+ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
46155
+ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
45556
46156
  const _check_database_work_area_1 = __webpack_require__(/*! ../expressions/_check_database_work_area */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/_check_database_work_area.js");
45557
46157
  class InsertDatabase {
45558
46158
  runSyntax(node, input) {
46159
+ var _a;
45559
46160
  const sourceTypes = new Map();
45560
46161
  for (const s of node.findAllExpressions(Expressions.Source)) {
45561
46162
  sourceTypes.set(s, source_1.Source.runSyntax(s, input));
@@ -45568,6 +46169,15 @@ class InsertDatabase {
45568
46169
  }
45569
46170
  const dbtab = node.findFirstExpression(Expressions.DatabaseTable);
45570
46171
  if (dbtab !== undefined) {
46172
+ // "INSERT itab." is the short form for an internal table with header line
46173
+ const localType = node.getChildren().length === 3
46174
+ ? (_a = input.scope.findVariable(dbtab.concatTokens())) === null || _a === void 0 ? void 0 : _a.getType()
46175
+ : undefined;
46176
+ if (localType instanceof basic_1.TableType && localType.isWithHeader() === false) {
46177
+ const message = "Table does not have header line";
46178
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
46179
+ return;
46180
+ }
45571
46181
  const dbSource = database_table_1.DatabaseTable.runSyntax(dbtab, input);
45572
46182
  (0, _check_database_work_area_1.checkDatabaseWorkArea)(node, dbSource, sourceTypes, input);
45573
46183
  }
@@ -45696,7 +46306,7 @@ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/
45696
46306
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
45697
46307
  class InsertInternal {
45698
46308
  runSyntax(node, input) {
45699
- var _a;
46309
+ var _a, _b;
45700
46310
  let targetType;
45701
46311
  const t = node.findDirectExpression(Expressions.Target);
45702
46312
  if (t) {
@@ -45759,9 +46369,21 @@ class InsertInternal {
45759
46369
  // yea, well, INSERT doesnt convert the values automatically, like everything else?
45760
46370
  error = true;
45761
46371
  }
46372
+ else if ((sourceType instanceof basic_1.StringType || sourceType instanceof basic_1.CharacterType)
46373
+ && ((_a = sourceType.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) !== true
46374
+ && (source === null || source === void 0 ? void 0 : source.findDirectExpression(Expressions.Constant)) === undefined
46375
+ && (targetType instanceof basic_1.IntegerType
46376
+ || targetType instanceof basic_1.Integer8Type
46377
+ || targetType instanceof basic_1.PackedType
46378
+ || targetType instanceof basic_1.FloatType
46379
+ || targetType instanceof basic_1.DecFloat16Type
46380
+ || targetType instanceof basic_1.DecFloat34Type)) {
46381
+ // a character-like data object into a table with a numeric row type, no conversion
46382
+ error = true;
46383
+ }
45762
46384
  else if (sourceType instanceof basic_1.CharacterType
45763
46385
  && targetType instanceof basic_1.CharacterType
45764
- && ((_a = sourceType.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true
46386
+ && ((_b = sourceType.getAbstractTypeData()) === null || _b === void 0 ? void 0 : _b.derivedFromConstant) === true
45765
46387
  && sourceType.getLength() !== targetType.getLength()) {
45766
46388
  // character literal of different length than the row type
45767
46389
  error = true;
@@ -46147,6 +46769,17 @@ class Loop {
46147
46769
  }
46148
46770
  if (sourceType instanceof basic_1.TableType) {
46149
46771
  rowType = sourceType.getRowType();
46772
+ }
46773
+ else if (concat.startsWith("LOOP AT GROUP ")) {
46774
+ const unbound = loop_group_by_1.LoopGroupBy.findUnboundGroup(firstSource, input);
46775
+ if (unbound !== undefined) {
46776
+ const message = `No group is bound to "${unbound}"`;
46777
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
46778
+ return;
46779
+ }
46780
+ rowType = loop_group_by_1.LoopGroupBy.findMemberType(firstSource, input);
46781
+ }
46782
+ if (rowType) {
46150
46783
  sourceType = rowType;
46151
46784
  if (targetConcat === null || targetConcat === void 0 ? void 0 : targetConcat.startsWith("REFERENCE INTO ")) {
46152
46785
  sourceType = new basic_1.DataReference(sourceType);
@@ -46232,7 +46865,7 @@ class Loop {
46232
46865
  }
46233
46866
  const group = node.findDirectExpression(Expressions.LoopGroupBy);
46234
46867
  if (group) {
46235
- loop_group_by_1.LoopGroupBy.runSyntax(group, input);
46868
+ loop_group_by_1.LoopGroupBy.runSyntax(group, input, rowType, loop_group_by_1.LoopGroupBy.findRepresentative(node));
46236
46869
  }
46237
46870
  }
46238
46871
  }
@@ -46356,6 +46989,7 @@ const target_1 = __webpack_require__(/*! ../expressions/target */ "./node_module
46356
46989
  const message_source_1 = __webpack_require__(/*! ../expressions/message_source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/message_source.js");
46357
46990
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
46358
46991
  const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
46992
+ const _builtin_call_1 = __webpack_require__(/*! ../_builtin_call */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin_call.js");
46359
46993
  class Message {
46360
46994
  runSyntax(node, input) {
46361
46995
  const exceptionName = node.findDirectExpression(Expressions.ExceptionName);
@@ -46374,7 +47008,16 @@ class Message {
46374
47008
  }
46375
47009
  for (const mss of node.findDirectExpressions(Expressions.MessageSourceSource)) {
46376
47010
  for (const s of mss.findDirectExpressions(Expressions.Source)) {
47011
+ const issueCount = input.issues.length;
46377
47012
  source_1.Source.runSyntax(s, input);
47013
+ // "Arithmetic calculation not permitted here" on a system, whatever the argument
47014
+ const call = issueCount === input.issues.length && input.scope.getOpenABAP() === false
47015
+ ? _builtin_call_1.BuiltInCall.fromSource(s, input) : undefined;
47016
+ if (call !== undefined && _builtin_call_1.BuiltInCall.isNumeric(call)) {
47017
+ const message = `Numeric function "${_builtin_call_1.BuiltInCall.callName(call)}" cannot be used in MESSAGE WITH`;
47018
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
47019
+ return;
47020
+ }
46378
47021
  }
46379
47022
  for (const s of mss.findDirectExpressions(Expressions.SimpleSource3)) {
46380
47023
  source_1.Source.runSyntax(s, input);
@@ -46742,6 +47385,13 @@ class ModifyInternal {
46742
47385
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
46743
47386
  return;
46744
47387
  }
47388
+ if (node.findDirectTokenByText("FROM") === undefined
47389
+ && targetType.isWithHeader() === false) {
47390
+ // short form, the header line is the work area, eg. "MODIFY itab."
47391
+ const message = "Table does not have header line";
47392
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
47393
+ return;
47394
+ }
46745
47395
  }
46746
47396
  else if (targetType instanceof basic_1.StructureType) {
46747
47397
  // it might originate from a TABLES statement
@@ -46882,6 +47532,7 @@ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@ab
46882
47532
  const nodes_1 = __webpack_require__(/*! ../../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
46883
47533
  class Move {
46884
47534
  runSyntax(node, input) {
47535
+ var _a;
46885
47536
  const targets = node.findDirectExpressions(Expressions.Target);
46886
47537
  const firstTarget = targets[0];
46887
47538
  const inline = firstTarget === null || firstTarget === void 0 ? void 0 : firstTarget.findDirectExpression(Expressions.InlineData);
@@ -46922,6 +47573,13 @@ class Move {
46922
47573
  sourceType = dereference_1.Dereference.runSyntax(node, sourceType, input);
46923
47574
  }
46924
47575
  if (inline) {
47576
+ // the length of a text symbol depends on the text pool, "DATA(x) = TEXT-abc." does not compile
47577
+ const sourceChildren = (_a = source === null || source === void 0 ? void 0 : source.getChildren()) !== null && _a !== void 0 ? _a : [];
47578
+ if (sourceChildren.length === 1 && sourceChildren[0].get() instanceof Expressions.TextElement) {
47579
+ const message = `"${source.concatTokens().toUpperCase()}" has a generic type that cannot be used for declarations`;
47580
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, source.getFirstToken(), message));
47581
+ return;
47582
+ }
46925
47583
  if (sourceType instanceof basic_1.PackedType && (source === null || source === void 0 ? void 0 : source.findDirectExpression(Expressions.ArithOperator))) {
46926
47584
  sourceType = new basic_1.PackedType(8, 0);
46927
47585
  }
@@ -47623,6 +48281,11 @@ class Raise {
47623
48281
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, exceptionName.getFirstToken(), classicMessage));
47624
48282
  return;
47625
48283
  }
48284
+ const classBasedMessage = exceptionName === undefined && node.findDirectTokenByText("EXCEPTION")
48285
+ ? helper.checkClassBasedException() : undefined;
48286
+ if (classBasedMessage) {
48287
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), classBasedMessage));
48288
+ }
47626
48289
  const classTok = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
47627
48290
  const className = classTok === null || classTok === void 0 ? void 0 : classTok.getStr();
47628
48291
  if (classTok && className) {
@@ -51026,6 +51689,7 @@ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/
51026
51689
  const field_chain_1 = __webpack_require__(/*! ../expressions/field_chain */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js");
51027
51690
  const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
51028
51691
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
51692
+ const _builtin_call_1 = __webpack_require__(/*! ../_builtin_call */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin_call.js");
51029
51693
  class Write {
51030
51694
  runSyntax(node, input) {
51031
51695
  // todo, more
@@ -51035,7 +51699,16 @@ class Write {
51035
51699
  second = node.getChildren()[2];
51036
51700
  }
51037
51701
  for (const s of node.findDirectExpressions(Expressions.Source)) {
51702
+ const issueCount = input.issues.length;
51038
51703
  const type = source_1.Source.runSyntax(s, input);
51704
+ // "Arithmetic calculation not permitted here" on a system, while abs( x ) or lines( itab ) is fine
51705
+ const call = s === second && issueCount === input.issues.length
51706
+ ? _builtin_call_1.BuiltInCall.fromSource(s, input) : undefined;
51707
+ if (call !== undefined && _builtin_call_1.BuiltInCall.isNumeric(call) && _builtin_call_1.BuiltInCall.hasDataObjectArgument(call) === false) {
51708
+ const message = `Numeric function "${_builtin_call_1.BuiltInCall.callName(call)}" in WRITE takes only a single data object as argument`;
51709
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
51710
+ return;
51711
+ }
51039
51712
  if (s === second
51040
51713
  && new _type_utils_1.TypeUtils(input.scope).isCharLike(type) === false
51041
51714
  && new _type_utils_1.TypeUtils(input.scope).isHexLike(type) === false) {
@@ -52172,6 +52845,7 @@ const statics_1 = __webpack_require__(/*! ./structures/statics */ "./node_module
52172
52845
  const constants_1 = __webpack_require__(/*! ./structures/constants */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/constants.js");
52173
52846
  const cleanup_1 = __webpack_require__(/*! ./structures/cleanup */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/cleanup.js");
52174
52847
  const try_1 = __webpack_require__(/*! ./structures/try */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/try.js");
52848
+ const loop_group_by_1 = __webpack_require__(/*! ./expressions/loop_group_by */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/loop_group_by.js");
52175
52849
  const class_definition_1 = __webpack_require__(/*! ../types/class_definition */ "./node_modules/@abaplint/core/build/src/abap/types/class_definition.js");
52176
52850
  const interface_definition_1 = __webpack_require__(/*! ../types/interface_definition */ "./node_modules/@abaplint/core/build/src/abap/types/interface_definition.js");
52177
52851
  const delete_memory_1 = __webpack_require__(/*! ./statements/delete_memory */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_memory.js");
@@ -52480,6 +53154,7 @@ class SyntaxLogic {
52480
53154
  this.issues = [];
52481
53155
  this.deferred = [];
52482
53156
  this.loopTables = new _loop_table_change_1.LoopTableChange();
53157
+ this.loopDepth = 0;
52483
53158
  this.sortedLines = new _sorted_key_write_1.SortedKeyWrite();
52484
53159
  this.reg.getDDICReferences().clear(this.object);
52485
53160
  this.reg.getMSAGReferences().clear(this.object);
@@ -52549,6 +53224,10 @@ class SyntaxLogic {
52549
53224
  const loop = node instanceof nodes_1.StructureNode
52550
53225
  && node.get() instanceof Structures.Loop
52551
53226
  && this.loopTables.push(node, this.scope);
53227
+ const isLoop = node instanceof nodes_1.StructureNode && node.get() instanceof Structures.Loop;
53228
+ if (isLoop) {
53229
+ this.loopDepth++;
53230
+ }
52552
53231
  if (node instanceof nodes_1.StructureNode) {
52553
53232
  this.sortedLines.enter(node, this.currentFile.getFilename());
52554
53233
  }
@@ -52597,6 +53276,15 @@ class SyntaxLogic {
52597
53276
  if (loop === true) {
52598
53277
  this.loopTables.pop();
52599
53278
  }
53279
+ if (isLoop) {
53280
+ this.loopDepth--;
53281
+ }
53282
+ if (node instanceof nodes_1.StructureNode && node.get() instanceof Structures.Loop) {
53283
+ const loopStatement = node.findDirectStatement(Statements.Loop);
53284
+ if (loopStatement) {
53285
+ loop_group_by_1.LoopGroupBy.unbind(loopStatement, this.scope);
53286
+ }
53287
+ }
52600
53288
  if (node instanceof nodes_1.StructureNode) {
52601
53289
  this.sortedLines.leave(node);
52602
53290
  }
@@ -52676,6 +53364,7 @@ class SyntaxLogic {
52676
53364
  filename,
52677
53365
  issues: this.issues,
52678
53366
  deferred: this.deferred,
53367
+ inLoop: this.loopDepth > 0,
52679
53368
  };
52680
53369
  // todo, refactor
52681
53370
  if (s instanceof Statements.Type) {
@@ -54872,8 +55561,8 @@ exports.FloatingPointType = void 0;
54872
55561
  const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
54873
55562
  // this is the DDIC floating point type
54874
55563
  class FloatingPointType extends _abstract_type_1.AbstractType {
54875
- constructor(length, qualifiedName) {
54876
- super({ qualifiedName: qualifiedName });
55564
+ constructor(length, extra) {
55565
+ super(extra === undefined || typeof extra === "string" ? { qualifiedName: extra } : extra);
54877
55566
  if (length <= 0) {
54878
55567
  throw new Error("Bad LENGTH, Floating Point");
54879
55568
  }
@@ -54949,8 +55638,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
54949
55638
  exports.HexType = void 0;
54950
55639
  const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
54951
55640
  class HexType extends _abstract_type_1.AbstractType {
54952
- constructor(length, qualifiedName) {
54953
- super({ qualifiedName: qualifiedName });
55641
+ constructor(length, extra) {
55642
+ super(extra === undefined || typeof extra === "string" ? { qualifiedName: extra } : extra);
54954
55643
  if (length <= 0) {
54955
55644
  throw new Error("Bad LENGTH, Hex");
54956
55645
  }
@@ -55208,8 +55897,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
55208
55897
  exports.NumericType = void 0;
55209
55898
  const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
55210
55899
  class NumericType extends _abstract_type_1.AbstractType {
55211
- constructor(length, qualifiedName) {
55212
- super({ qualifiedName: qualifiedName });
55900
+ constructor(length, extra) {
55901
+ super(extra === undefined || typeof extra === "string" ? { qualifiedName: extra } : extra);
55213
55902
  if (length <= 0) {
55214
55903
  throw new Error("Bad LENGTH, Numeric");
55215
55904
  }
@@ -55564,11 +56253,12 @@ var TableKeyType;
55564
56253
  TableKeyType["empty"] = "EMPTY";
55565
56254
  })(TableKeyType || (exports.TableKeyType = TableKeyType = {}));
55566
56255
  class TableType extends _abstract_type_1.AbstractType {
55567
- constructor(rowType, options, qualifiedName, description) {
56256
+ constructor(rowType, options, qualifiedName, description, ddicName) {
55568
56257
  var _a;
55569
56258
  super({
55570
56259
  qualifiedName: qualifiedName,
55571
56260
  description: description,
56261
+ ddicName: ddicName,
55572
56262
  });
55573
56263
  this.rowType = rowType;
55574
56264
  this.options = options;
@@ -56800,6 +57490,7 @@ const Expressions = __importStar(__webpack_require__(/*! ../2_statements/express
56800
57490
  const events_1 = __webpack_require__(/*! ../2_statements/statements/events */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/events.js");
56801
57491
  const expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
56802
57492
  const method_param_1 = __webpack_require__(/*! ../5_syntax/expressions/method_param */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_param.js");
57493
+ const _syntax_input_1 = __webpack_require__(/*! ../5_syntax/_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
56803
57494
  class EventDefinition extends _identifier_1.Identifier {
56804
57495
  constructor(node, _visibility, input) {
56805
57496
  if (!(node.get() instanceof events_1.Events)) {
@@ -56822,10 +57513,21 @@ class EventDefinition extends _identifier_1.Identifier {
56822
57513
  }
56823
57514
  ///////////////
56824
57515
  parse(node, input) {
57516
+ var _a;
57517
+ var _b;
56825
57518
  for (const e of node.findAllExpressions(expressions_1.MethodParam)) {
57519
+ if (this.isPassByValue(e) === false) {
57520
+ const name = (_b = (_a = e.findDirectExpression(Expressions.MethodParamName)) === null || _a === void 0 ? void 0 : _a.concatTokens()) !== null && _b !== void 0 ? _b : "";
57521
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, e.getFirstToken(), "Event parameter " + name + " must be passed by VALUE"));
57522
+ }
56826
57523
  this.parameters.push(method_param_1.MethodParam.runSyntax(e, input, []));
56827
57524
  }
56828
57525
  }
57526
+ // event parameters can only be passed by value
57527
+ isPassByValue(param) {
57528
+ const first = param.getFirstToken().getStr().toUpperCase();
57529
+ return first === "VALUE" || first === "!VALUE";
57530
+ }
56829
57531
  }
56830
57532
  exports.EventDefinition = EventDefinition;
56831
57533
  //# sourceMappingURL=event_definition.js.map
@@ -57001,6 +57703,13 @@ class FunctionModuleDefinition {
57001
57703
  isGlobalParameters() {
57002
57704
  return this.globalParameters;
57003
57705
  }
57706
+ /** the classic exceptions, or the exception classes if isClassBasedExceptions() */
57707
+ getExceptions() {
57708
+ return this.exceptions;
57709
+ }
57710
+ isClassBasedExceptions() {
57711
+ return this.classBasedExceptions;
57712
+ }
57004
57713
  ///////////////
57005
57714
  parse(data) {
57006
57715
  if (data.FUNCNAME === undefined) {
@@ -57010,6 +57719,8 @@ class FunctionModuleDefinition {
57010
57719
  this.description = data.SHORT_TEXT;
57011
57720
  this.parameters = [];
57012
57721
  this.globalParameters = data.GLOBAL_FLAG === "X";
57722
+ this.exceptions = [];
57723
+ this.classBasedExceptions = data.EXCEPTION_CLASSES === "X";
57013
57724
  this.moduleType = FunctionModuleType.regular;
57014
57725
  if (data.REMOTE_CALL === "R") {
57015
57726
  this.moduleType = FunctionModuleType.remote;
@@ -57078,6 +57789,13 @@ class FunctionModuleDefinition {
57078
57789
  });
57079
57790
  }
57080
57791
  }
57792
+ if (data.EXCEPTION) {
57793
+ for (const exception of (0, xml_utils_1.xmlToArray)(data.EXCEPTION.RSEXC)) {
57794
+ if (typeof exception.EXCEPTION === "string") {
57795
+ this.exceptions.push(exception.EXCEPTION);
57796
+ }
57797
+ }
57798
+ }
57081
57799
  }
57082
57800
  }
57083
57801
  exports.FunctionModuleDefinition = FunctionModuleDefinition;
@@ -57729,6 +58447,7 @@ const _reference_1 = __webpack_require__(/*! ../5_syntax/_reference */ "./node_m
57729
58447
  const identifier_1 = __webpack_require__(/*! ../1_lexer/tokens/identifier */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/identifier.js");
57730
58448
  const _scope_type_1 = __webpack_require__(/*! ../5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
57731
58449
  const _syntax_input_1 = __webpack_require__(/*! ../5_syntax/_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
58450
+ const _reserved_names_1 = __webpack_require__(/*! ../5_syntax/_reserved_names */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reserved_names.js");
57732
58451
  // the keywords that can follow a parameter in each section, a plain parameter name is read as them
57733
58452
  const KEYWORDS_AFTER = {
57734
58453
  "IMPORTING": ["PREFERRED", "EXPORTING", "CHANGING", "RETURNING", "RAISING", "EXCEPTIONS"],
@@ -57914,6 +58633,7 @@ class MethodParameters {
57914
58633
  if (parameter.getName().length > 30) {
57915
58634
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, parameter.getToken(), "Method parameter name longer than 30 characters"));
57916
58635
  }
58636
+ (0, _reserved_names_1.checkReservedName)(parameter.getToken(), input);
57917
58637
  }
57918
58638
  }
57919
58639
  workaroundRAP(node, input, parentName) {
@@ -58000,9 +58720,14 @@ class MethodParameters {
58000
58720
  const id = method_param_1.MethodParam.runSyntax(p, input, [...meta, ...extraMeta]);
58001
58721
  input.scope.addIdentifier(id);
58002
58722
  target.push(id);
58003
- if (opt.findDirectTokenByText("OPTIONAL")) {
58723
+ const optionalToken = opt.findDirectTokenByText("OPTIONAL");
58724
+ if (optionalToken) {
58004
58725
  const name = target[target.length - 1].getName().toUpperCase();
58005
58726
  this.optional.push(name);
58727
+ if (opt.findFirstExpression(Expressions.Default)) {
58728
+ const message = "Parameter \"" + id.getName() + "\" cannot have both DEFAULT and OPTIONAL";
58729
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, optionalToken, message));
58730
+ }
58006
58731
  }
58007
58732
  else if (opt.findFirstExpression(Expressions.Default)) {
58008
58733
  const name = target[target.length - 1].getName().toUpperCase();
@@ -61636,7 +62361,7 @@ class DDIC {
61636
62361
  if (input.length === undefined) {
61637
62362
  return new Types.UnknownType(input.text + " unknown length", input.infoText);
61638
62363
  }
61639
- return new Types.NumericType(parseInt(input.length, 10), input.qualifiedName);
62364
+ return new Types.NumericType(parseInt(input.length, 10), extra);
61640
62365
  case "CHAR": // 1 <= len <= 30000 (1333 for table fields)
61641
62366
  case "LCHR": // 256 <= len <= 32000
61642
62367
  if (input.length === undefined) {
@@ -61648,10 +62373,10 @@ class DDIC {
61648
62373
  if (input.length === undefined) {
61649
62374
  return new Types.UnknownType(input.text + " unknown length", input.infoText);
61650
62375
  }
61651
- return new Types.HexType(parseInt(input.length, 10), input.qualifiedName);
62376
+ return new Types.HexType(parseInt(input.length, 10), extra);
61652
62377
  case "TIMN": // Native HANA
61653
62378
  case "TIMS":
61654
- return new Types.TimeType({ qualifiedName: input.qualifiedName }); //HHMMSS
62379
+ return new Types.TimeType(extra); //HHMMSS
61655
62380
  case "DECFLOAT16": // len = 16
61656
62381
  case "DECFLOAT34": // len = 34
61657
62382
  case "D16R": // len = 16
@@ -61662,25 +62387,25 @@ class DDIC {
61662
62387
  if (input.length === undefined) {
61663
62388
  return new Types.UnknownType(input.text + " unknown length", input.infoText);
61664
62389
  }
61665
- return new Types.FloatingPointType(parseInt(input.length, 10), input.qualifiedName);
62390
+ return new Types.FloatingPointType(parseInt(input.length, 10), extra);
61666
62391
  case "DATN": // Native HANA
61667
62392
  case "DATS":
61668
- return new Types.DateType({ qualifiedName: input.qualifiedName }); //YYYYMMDD
62393
+ return new Types.DateType(extra); //YYYYMMDD
61669
62394
  case "INT1":
61670
62395
  case "INT2":
61671
62396
  case "INT4":
61672
- return Types.IntegerType.get({ qualifiedName: input.qualifiedName });
62397
+ return Types.IntegerType.get(extra);
61673
62398
  case "INT8":
61674
- return new Types.Integer8Type({ qualifiedName: input.qualifiedName });
62399
+ return new Types.Integer8Type(extra);
61675
62400
  case "SSTR": // 1 <= len <= 1333
61676
62401
  case "SSTRING": // 1 <= len <= 1333
61677
62402
  case "STRG": // 256 <= len
61678
62403
  case "STRING": // 256 <= len
61679
- return Types.StringType.get({ qualifiedName: input.qualifiedName });
62404
+ return Types.StringType.get(extra);
61680
62405
  case "RSTR": // 256 <= len
61681
62406
  case "RAWSTRING": // 256 <= len
61682
62407
  case "GEOM_EWKB":
61683
- return Types.XStringType.get({ qualifiedName: input.qualifiedName });
62408
+ return Types.XStringType.get(extra);
61684
62409
  case "D16S":
61685
62410
  case "D34S":
61686
62411
  case "DF16_SCL":
@@ -73860,34 +74585,35 @@ class TableType extends _abstract_object_1.AbstractObject {
73860
74585
  }
73861
74586
  else if (this.parsedXML.rowkind === "S") {
73862
74587
  const lookup = ddic.lookupTableOrView(this.parsedXML.rowtype);
73863
- type = new Types.TableType(lookup.type, tableOptions, this.getName(), this.getDescription());
74588
+ type = new Types.TableType(lookup.type, tableOptions, this.getName(), this.getDescription(), this.getName());
73864
74589
  if (lookup.object) {
73865
74590
  references.push({ object: lookup.object });
73866
74591
  }
73867
74592
  }
73868
74593
  else if (this.parsedXML.rowkind === "E") {
73869
74594
  const lookup = ddic.lookupDataElement(this.parsedXML.rowtype);
73870
- type = new Types.TableType(lookup.type, tableOptions, this.getName(), this.getDescription());
74595
+ type = new Types.TableType(lookup.type, tableOptions, this.getName(), this.getDescription(), this.getName());
73871
74596
  if (lookup.object) {
73872
74597
  references.push({ object: lookup.object });
73873
74598
  }
73874
74599
  }
73875
74600
  else if (this.parsedXML.rowkind === "L") {
73876
74601
  const lookup = ddic.lookupTableType(this.parsedXML.rowtype);
73877
- type = new Types.TableType(lookup.type, tableOptions, this.getName(), this.getDescription());
74602
+ type = new Types.TableType(lookup.type, tableOptions, this.getName(), this.getDescription(), this.getName());
73878
74603
  if (lookup.object) {
73879
74604
  references.push({ object: lookup.object });
73880
74605
  }
73881
74606
  }
73882
74607
  else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype === "OBJECT") {
73883
- type = new Types.TableType(new basic_1.GenericObjectReferenceType(), tableOptions, this.getName(), this.getDescription());
74608
+ type = new Types.TableType(new basic_1.GenericObjectReferenceType(), tableOptions, this.getName(), this.getDescription(), this.getName());
73884
74609
  }
73885
74610
  else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype === "DATA") {
73886
- type = new Types.TableType(new basic_1.DataReference(new Types.DataType()), tableOptions, this.getName(), this.getDescription());
74611
+ const row = new basic_1.DataReference(new Types.DataType());
74612
+ type = new Types.TableType(row, tableOptions, this.getName(), this.getDescription(), this.getName());
73887
74613
  }
73888
74614
  else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype !== undefined) {
73889
74615
  const lookup = ddic.lookupObject(this.parsedXML.rowtype);
73890
- type = new Types.TableType(lookup.type, tableOptions, this.getName(), this.getDescription());
74616
+ type = new Types.TableType(lookup.type, tableOptions, this.getName(), this.getDescription(), this.getName());
73891
74617
  if (lookup.object) {
73892
74618
  references.push({ object: lookup.object });
73893
74619
  }
@@ -73903,7 +74629,7 @@ class TableType extends _abstract_object_1.AbstractObject {
73903
74629
  decimals: this.parsedXML.decimals,
73904
74630
  infoText: this.getName(),
73905
74631
  });
73906
- type = new Types.TableType(row, tableOptions, this.getName(), this.getDescription());
74632
+ type = new Types.TableType(row, tableOptions, this.getName(), this.getDescription(), this.getName());
73907
74633
  }
73908
74634
  }
73909
74635
  else {
@@ -75210,7 +75936,7 @@ class Registry {
75210
75936
  }
75211
75937
  static abaplintVersion() {
75212
75938
  // magic, see build script "version.js"
75213
- return "2.120.110";
75939
+ return "2.120.113";
75214
75940
  }
75215
75941
  getDDICReferences() {
75216
75942
  return this.ddicReferences;
@@ -83317,6 +84043,10 @@ class CheckSubrcConf extends _basic_rule_config_1.BasicRuleConfig {
83317
84043
  this.readTable = true;
83318
84044
  this.assign = true;
83319
84045
  this.find = true;
84046
+ /** CALL FUNCTION with EXCEPTIONS, unless every exception is mapped to 0 */
84047
+ this.callFunction = true;
84048
+ /** Method call with EXCEPTIONS, unless every exception is mapped to 0 */
84049
+ this.callMethod = true;
83320
84050
  }
83321
84051
  }
83322
84052
  exports.CheckSubrcConf = CheckSubrcConf;
@@ -83338,7 +84068,17 @@ If sy-dbcnt is checked after database statements, it is considered okay.
83338
84068
 
83339
84069
  If IS ASSIGNED is checked after assigning, it is considered okay.
83340
84070
 
83341
- FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
84071
+ FIND statement with MATCH COUNT is considered okay if subrc is not checked
84072
+
84073
+ CALL FUNCTION and method calls are checked if they have an EXCEPTIONS addition that maps an exception to a value other than 0,
84074
+ including CALL FUNCTION DESTINATION and STARTING NEW TASK. Not checked: calls without EXCEPTIONS, calls where every exception
84075
+ is mapped to 0, EXCEPTION-TABLE, CALL FUNCTION IN UPDATE TASK and IN BACKGROUND.
84076
+ For CALL FUNCTION the pragma ##FM_SUBRC_OK is also accepted.
84077
+
84078
+ A call of a method with SUBRC in its name, like check_subrc( ), is considered a check.
84079
+
84080
+ After ELSE, ELSEIF, WHEN, CATCH and CLEANUP the check continues after the end of the block, as these branches are not run
84081
+ after the statement`,
83342
84082
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
83343
84083
  pseudoComment: "EC CI_SUBRC",
83344
84084
  pragma: "##SUBRC_OK",
@@ -83363,7 +84103,6 @@ FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
83363
84103
  const config = this.getConfig();
83364
84104
  for (let i = 0; i < statements.length; i++) {
83365
84105
  const statement = statements[i];
83366
- // todo: CALL FUNCTION
83367
84106
  if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {
83368
84107
  continue;
83369
84108
  }
@@ -83449,6 +84188,22 @@ FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
83449
84188
  const fix = this.buildFix(file, statement);
83450
84189
  issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, undefined, [fix]));
83451
84190
  }
84191
+ else if (config.callFunction === true
84192
+ && statement.get() instanceof Statements.CallFunction
84193
+ && statement.getPragmas().some(t => t.getStr().toUpperCase() === "##FM_SUBRC_OK") === false
84194
+ && this.isUpdateOrBackgroundTask(statement) === false
84195
+ && this.mapsExceptionToNonZero(statement) === true
84196
+ && this.isChecked(i, statements) === false) {
84197
+ const fix = this.buildFix(file, statement);
84198
+ issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, undefined, [fix]));
84199
+ }
84200
+ else if (config.callMethod === true
84201
+ && statement.get() instanceof Statements.Call
84202
+ && this.mapsExceptionToNonZero(statement) === true
84203
+ && this.isChecked(i, statements) === false) {
84204
+ const fix = this.buildFix(file, statement);
84205
+ issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, undefined, [fix]));
84206
+ }
83452
84207
  }
83453
84208
  return issues;
83454
84209
  }
@@ -83463,6 +84218,22 @@ FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
83463
84218
  }
83464
84219
  return false;
83465
84220
  }
84221
+ /** true if the EXCEPTIONS addition maps an exception to a value other than 0, then the call sets sy-subrc */
84222
+ mapsExceptionToNonZero(statement) {
84223
+ for (const list of statement.findAllExpressions(Expressions.ParameterListExceptions)) {
84224
+ for (const exception of list.findDirectExpressions(Expressions.ParameterException)) {
84225
+ const value = exception.findDirectExpression(Expressions.Integer);
84226
+ if (value === undefined || parseInt(value.concatTokens().replace(/\s/g, ""), 10) !== 0) {
84227
+ return true;
84228
+ }
84229
+ }
84230
+ }
84231
+ return false;
84232
+ }
84233
+ isUpdateOrBackgroundTask(statement) {
84234
+ const concat = statement.concatTokens().toUpperCase();
84235
+ return concat.includes(" IN UPDATE TASK") || concat.includes(" IN BACKGROUND ");
84236
+ }
83466
84237
  isExemptedFind(s) {
83467
84238
  // see https://github.com/abaplint/abaplint/issues/2130
83468
84239
  return s.concatTokens().toUpperCase().includes(" MATCH COUNT ") === true;
@@ -83484,6 +84255,28 @@ FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
83484
84255
  }
83485
84256
  return false;
83486
84257
  }
84258
+ /** index of the end statement that closes the block the statement at index is in */
84259
+ findEnd(index, statements, open, close) {
84260
+ let depth = 0;
84261
+ for (let i = index + 1; i < statements.length; i++) {
84262
+ const statement = statements[i].get();
84263
+ if (open.some(o => statement instanceof o)) {
84264
+ depth++;
84265
+ }
84266
+ else if (statement instanceof close) {
84267
+ if (depth === 0) {
84268
+ return i;
84269
+ }
84270
+ depth--;
84271
+ }
84272
+ }
84273
+ return statements.length;
84274
+ }
84275
+ /** a method call like check_subrc( ), the method reads sy-subrc */
84276
+ callsSubrcMethod(statement) {
84277
+ return statement.get() instanceof Statements.Call
84278
+ && statement.findAllExpressions(Expressions.MethodName).some(m => m.concatTokens().toUpperCase().includes("SUBRC"));
84279
+ }
83487
84280
  isChecked(index, statements) {
83488
84281
  var _a, _b;
83489
84282
  let assigned = undefined;
@@ -83503,9 +84296,25 @@ FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
83503
84296
  }
83504
84297
  }
83505
84298
  else if (statement.get() instanceof Statements.EndIf
84299
+ || statement.get() instanceof Statements.EndCase
84300
+ || statement.get() instanceof Statements.EndTry
83506
84301
  || statement.get() instanceof Statements.EndTestSeam) {
83507
84302
  continue;
83508
84303
  }
84304
+ else if (statement.get() instanceof Statements.Else
84305
+ || statement.get() instanceof Statements.ElseIf) {
84306
+ // the other branches are not run after this one, continue after ENDIF
84307
+ i = this.findEnd(i, statements, [Statements.If], Statements.EndIf);
84308
+ }
84309
+ else if (statement.get() instanceof Statements.When
84310
+ || statement.get() instanceof Statements.WhenOthers
84311
+ || statement.get() instanceof Statements.WhenType) {
84312
+ i = this.findEnd(i, statements, [Statements.Case, Statements.CaseType], Statements.EndCase);
84313
+ }
84314
+ else if (statement.get() instanceof Statements.Catch
84315
+ || statement.get() instanceof Statements.Cleanup) {
84316
+ i = this.findEnd(i, statements, [Statements.Try], Statements.EndTry);
84317
+ }
83509
84318
  else {
83510
84319
  if (assigned && concat.includes(assigned)) {
83511
84320
  return true;
@@ -83514,7 +84323,8 @@ FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
83514
84323
  return true;
83515
84324
  }
83516
84325
  return concat.includes(" SY-SUBRC")
83517
- || concat.includes("CL_ABAP_UNIT_ASSERT=>ASSERT_SUBRC");
84326
+ || concat.includes("CL_ABAP_UNIT_ASSERT=>ASSERT_SUBRC")
84327
+ || this.callsSubrcMethod(statement);
83518
84328
  }
83519
84329
  }
83520
84330
  return false;
@@ -84907,7 +85717,8 @@ https://docs.abapopenchecks.org/checks/14/`,
84907
85717
  return [];
84908
85718
  }
84909
85719
  let containsStatement = false;
84910
- for (const statementNode of statementNodes) {
85720
+ for (let i = 0; i < statementNodes.length; i++) {
85721
+ const statementNode = statementNodes[i];
84911
85722
  const statement = statementNode.get();
84912
85723
  if (this.getConfig().allowIncludeInFugr === true
84913
85724
  && obj instanceof objects_1.FunctionGroup
@@ -84917,6 +85728,9 @@ https://docs.abapopenchecks.org/checks/14/`,
84917
85728
  if (!(statement instanceof _statement_1.Unknown
84918
85729
  || statement instanceof _statement_1.Empty
84919
85730
  || statement instanceof _statement_1.Comment)) {
85731
+ if (this.isSplitFromText(statementNodes, i)) {
85732
+ continue;
85733
+ }
84920
85734
  containsStatement = true;
84921
85735
  break;
84922
85736
  }
@@ -84928,6 +85742,22 @@ https://docs.abapopenchecks.org/checks/14/`,
84928
85742
  const issue = issue_1.Issue.atRange(file, posStart, posEnd, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);
84929
85743
  return [issue];
84930
85744
  }
85745
+ /**
85746
+ * The statement parser splits an Unknown statement at a line break if the rest parses as a statement.
85747
+ * In comment text, such a split is code only if no further text follows the statement on its line.
85748
+ */
85749
+ isSplitFromText(statementNodes, index) {
85750
+ const previous = statementNodes[index - 1];
85751
+ if (previous === undefined
85752
+ || !(previous.get() instanceof _statement_1.Unknown)
85753
+ || [".", ","].includes(previous.getLastToken().getStr())) {
85754
+ return false;
85755
+ }
85756
+ const next = statementNodes[index + 1];
85757
+ return next !== undefined
85758
+ && next.get() instanceof _statement_1.Unknown
85759
+ && next.getFirstToken().getRow() === statementNodes[index].getLastToken().getRow();
85760
+ }
84931
85761
  isCommentLine(text) {
84932
85762
  return (text.substr(0, 1) === "*")
84933
85763
  || (text.trim().substr(0, 1) === "\"" && text.trim().substr(1, 1) !== "!");
@@ -90479,6 +91309,11 @@ ${indentation} output = ${uniqueName}.\n`;
90479
91309
  if (this.lowReg.getConfig().isOpenABAP()) {
90480
91310
  return undefined;
90481
91311
  }
91312
+ else if (node.get() instanceof Statements.Loop
91313
+ && node.concatTokens().toUpperCase().startsWith("LOOP AT GROUP ")) {
91314
+ // rewritten by the LOOP GROUP downport, the inline target is outlined afterwards
91315
+ return undefined;
91316
+ }
90482
91317
  for (const i of node.findAllExpressionsRecursive(Expressions.InlineData)) {
90483
91318
  const nameToken = (_a = i.findDirectExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
90484
91319
  if (nameToken === undefined) {
@@ -93238,6 +94073,138 @@ exports.ForbiddenPseudoAndPragma = ForbiddenPseudoAndPragma;
93238
94073
 
93239
94074
  /***/ },
93240
94075
 
94076
+ /***/ "./node_modules/@abaplint/core/build/src/rules/forbidden_statement.js"
94077
+ /*!****************************************************************************!*\
94078
+ !*** ./node_modules/@abaplint/core/build/src/rules/forbidden_statement.js ***!
94079
+ \****************************************************************************/
94080
+ (__unused_webpack_module, exports, __webpack_require__) {
94081
+
94082
+ "use strict";
94083
+
94084
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
94085
+ if (k2 === undefined) k2 = k;
94086
+ var desc = Object.getOwnPropertyDescriptor(m, k);
94087
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
94088
+ desc = { enumerable: true, get: function() { return m[k]; } };
94089
+ }
94090
+ Object.defineProperty(o, k2, desc);
94091
+ }) : (function(o, m, k, k2) {
94092
+ if (k2 === undefined) k2 = k;
94093
+ o[k2] = m[k];
94094
+ }));
94095
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
94096
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
94097
+ }) : function(o, v) {
94098
+ o["default"] = v;
94099
+ });
94100
+ var __importStar = (this && this.__importStar) || (function () {
94101
+ var ownKeys = function(o) {
94102
+ ownKeys = Object.getOwnPropertyNames || function (o) {
94103
+ var ar = [];
94104
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
94105
+ return ar;
94106
+ };
94107
+ return ownKeys(o);
94108
+ };
94109
+ return function (mod) {
94110
+ if (mod && mod.__esModule) return mod;
94111
+ var result = {};
94112
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
94113
+ __setModuleDefault(result, mod);
94114
+ return result;
94115
+ };
94116
+ })();
94117
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
94118
+ exports.ForbiddenStatement = exports.ForbiddenStatementConf = void 0;
94119
+ const Statements = __importStar(__webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js"));
94120
+ const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
94121
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
94122
+ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
94123
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
94124
+ class ForbiddenStatementConf extends _basic_rule_config_1.BasicRuleConfig {
94125
+ constructor() {
94126
+ super(...arguments);
94127
+ /** List of forbidden statements, given as abaplint statement names,
94128
+ * case insensitive, spaces, underscores and dashes are ignored,
94129
+ * so "READ TABLE", "ReadTable" and "read_table" are the same
94130
+ * @uniqueItems true
94131
+ */
94132
+ this.statements = [];
94133
+ }
94134
+ }
94135
+ exports.ForbiddenStatementConf = ForbiddenStatementConf;
94136
+ class ForbiddenStatement extends _abap_rule_1.ABAPRule {
94137
+ constructor() {
94138
+ super(...arguments);
94139
+ this.conf = new ForbiddenStatementConf();
94140
+ /** statement class -> configured spelling, used in the message */
94141
+ this.forbidden = new Map();
94142
+ }
94143
+ getMetadata() {
94144
+ return {
94145
+ key: "forbidden_statement",
94146
+ title: "Forbidden Statement",
94147
+ shortDescription: `Forbid use of specified statements.`,
94148
+ extendedInformation: `Nothing is reported unless statements are configured.
94149
+
94150
+ A configured entry matches the abaplint statement with the same name, compared case insensitive,
94151
+ ignoring spaces, underscores and dashes, so "READ TABLE", "ReadTable" and "read_table" all match ReadTable.
94152
+
94153
+ The names are the class names in https://github.com/abaplint/abaplint/tree/main/packages/core/src/abap/2_statements/statements,
94154
+ some keywords are split into several statements, eg. "INSERT" does not match anything,
94155
+ use "InsertInternal" or "InsertDatabase", likewise for DELETE, MODIFY and READ. Entries that do not match a statement are ignored.
94156
+
94157
+ Each part of a chained statement is checked as a separate statement.`,
94158
+ tags: [_irule_1.RuleTag.SingleFile],
94159
+ badExample: `* with "statements": ["READ TABLE"]
94160
+ READ TABLE items INDEX 1 INTO item.`,
94161
+ goodExample: `* with "statements": ["READ TABLE"]
94162
+ item = items[ 1 ].`,
94163
+ };
94164
+ }
94165
+ getConfig() {
94166
+ return this.conf;
94167
+ }
94168
+ setConfig(conf) {
94169
+ this.conf = conf;
94170
+ if (this.conf.statements === undefined) {
94171
+ this.conf.statements = [];
94172
+ }
94173
+ const byName = new Map();
94174
+ for (const [name, value] of Object.entries(Statements)) {
94175
+ byName.set(ForbiddenStatement.normalize(name), value);
94176
+ }
94177
+ this.forbidden = new Map();
94178
+ for (const entry of this.conf.statements) {
94179
+ const found = byName.get(ForbiddenStatement.normalize(entry));
94180
+ if (found !== undefined && this.forbidden.has(found) === false) {
94181
+ this.forbidden.set(found, entry.trim());
94182
+ }
94183
+ }
94184
+ }
94185
+ runParsed(file) {
94186
+ if (this.forbidden.size === 0) {
94187
+ return [];
94188
+ }
94189
+ const ret = [];
94190
+ for (const s of file.getStatements()) {
94191
+ const name = this.forbidden.get(s.get().constructor);
94192
+ if (name !== undefined) {
94193
+ const message = "Statement \"" + name + "\" is forbidden";
94194
+ ret.push(issue_1.Issue.atStatement(file, s, message, this.getMetadata().key, this.conf.severity));
94195
+ }
94196
+ }
94197
+ return ret;
94198
+ }
94199
+ static normalize(name) {
94200
+ return name.toLowerCase().replace(/[\s_-]/g, "");
94201
+ }
94202
+ }
94203
+ exports.ForbiddenStatement = ForbiddenStatement;
94204
+ //# sourceMappingURL=forbidden_statement.js.map
94205
+
94206
+ /***/ },
94207
+
93241
94208
  /***/ "./node_modules/@abaplint/core/build/src/rules/forbidden_void_type.js"
93242
94209
  /*!****************************************************************************!*\
93243
94210
  !*** ./node_modules/@abaplint/core/build/src/rules/forbidden_void_type.js ***!
@@ -93667,6 +94634,155 @@ exports.FullyTypeITabs = FullyTypeITabs;
93667
94634
 
93668
94635
  /***/ },
93669
94636
 
94637
+ /***/ "./node_modules/@abaplint/core/build/src/rules/function_module_parameter_names.js"
94638
+ /*!****************************************************************************************!*\
94639
+ !*** ./node_modules/@abaplint/core/build/src/rules/function_module_parameter_names.js ***!
94640
+ \****************************************************************************************/
94641
+ (__unused_webpack_module, exports, __webpack_require__) {
94642
+
94643
+ "use strict";
94644
+
94645
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
94646
+ exports.FunctionModuleParameterNames = exports.FunctionModuleParameterNamesConf = void 0;
94647
+ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
94648
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
94649
+ const function_group_1 = __webpack_require__(/*! ../objects/function_group */ "./node_modules/@abaplint/core/build/src/objects/function_group.js");
94650
+ const _naming_rule_config_1 = __webpack_require__(/*! ./_naming_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_naming_rule_config.js");
94651
+ const name_validator_1 = __webpack_require__(/*! ../utils/name_validator */ "./node_modules/@abaplint/core/build/src/utils/name_validator.js");
94652
+ const function_module_definition_1 = __webpack_require__(/*! ../abap/types/function_module_definition */ "./node_modules/@abaplint/core/build/src/abap/types/function_module_definition.js");
94653
+ const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
94654
+ class FunctionModuleParameterNamesConf extends _naming_rule_config_1.NamingRuleConfig {
94655
+ constructor() {
94656
+ super(...arguments);
94657
+ /** The pattern for importing parameters */
94658
+ this.importing = "^I._.+$";
94659
+ /** The pattern for exporting parameters */
94660
+ this.exporting = "^E._.+$";
94661
+ /** The pattern for changing parameters */
94662
+ this.changing = "^C._.+$";
94663
+ /** The pattern for tables parameters */
94664
+ this.tables = "^T._.+$";
94665
+ }
94666
+ }
94667
+ exports.FunctionModuleParameterNamesConf = FunctionModuleParameterNamesConf;
94668
+ class FunctionModuleParameterNames {
94669
+ constructor() {
94670
+ this.conf = new FunctionModuleParameterNamesConf();
94671
+ this.regex = this.compile();
94672
+ }
94673
+ getMetadata() {
94674
+ return {
94675
+ key: "function_module_parameter_names",
94676
+ title: "Function module parameter naming conventions",
94677
+ shortDescription: `Allows you to enforce a pattern, such as a prefix, for function module parameter names`,
94678
+ extendedInformation: `Checks the parameters of function modules in function groups,
94679
+ with a separate pattern for importing, exporting, changing and tables parameters.`,
94680
+ tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
94681
+ badExample: `FUNCTION z_get_name.
94682
+ *" IMPORTING
94683
+ *" VALUE(CUSTOMER) TYPE STRING
94684
+ *" EXPORTING
94685
+ *" VALUE(NAME) TYPE STRING
94686
+ ENDFUNCTION.`,
94687
+ goodExample: `FUNCTION z_get_name.
94688
+ *" IMPORTING
94689
+ *" VALUE(IV_CUSTOMER) TYPE STRING
94690
+ *" EXPORTING
94691
+ *" VALUE(EV_NAME) TYPE STRING
94692
+ ENDFUNCTION.`,
94693
+ };
94694
+ }
94695
+ getDescription(expected, actual) {
94696
+ return this.conf.patternKind === "required" ?
94697
+ "Function module parameter name does not match pattern " + expected + ": " + actual :
94698
+ "Function module parameter name must not match pattern " + expected + ": " + actual;
94699
+ }
94700
+ getConfig() {
94701
+ return this.conf;
94702
+ }
94703
+ setConfig(conf) {
94704
+ this.conf = conf;
94705
+ this.regex = this.compile();
94706
+ }
94707
+ compile() {
94708
+ return {
94709
+ importing: new RegExp(this.conf.importing, "i"),
94710
+ exporting: new RegExp(this.conf.exporting, "i"),
94711
+ changing: new RegExp(this.conf.changing, "i"),
94712
+ tables: new RegExp(this.conf.tables, "i"),
94713
+ ignorePatterns: name_validator_1.NameValidator.compileIgnorePatterns(this.conf),
94714
+ };
94715
+ }
94716
+ initialize(_reg) {
94717
+ return this;
94718
+ }
94719
+ run(obj) {
94720
+ if (this.conf.patternKind === undefined) {
94721
+ this.conf.patternKind = "required";
94722
+ }
94723
+ if (!(obj instanceof function_group_1.FunctionGroup)) {
94724
+ return [];
94725
+ }
94726
+ let ret = [];
94727
+ for (const module of obj.getModules()) {
94728
+ ret = ret.concat(this.checkModule(obj, module));
94729
+ }
94730
+ return ret;
94731
+ }
94732
+ checkModule(obj, module) {
94733
+ const ret = [];
94734
+ for (const p of module.getParameters()) {
94735
+ let expected;
94736
+ let regex;
94737
+ switch (p.direction) {
94738
+ case function_module_definition_1.FunctionModuleParameterDirection.importing:
94739
+ expected = this.conf.importing;
94740
+ regex = this.regex.importing;
94741
+ break;
94742
+ case function_module_definition_1.FunctionModuleParameterDirection.exporting:
94743
+ expected = this.conf.exporting;
94744
+ regex = this.regex.exporting;
94745
+ break;
94746
+ case function_module_definition_1.FunctionModuleParameterDirection.changing:
94747
+ expected = this.conf.changing;
94748
+ regex = this.regex.changing;
94749
+ break;
94750
+ case function_module_definition_1.FunctionModuleParameterDirection.tables:
94751
+ expected = this.conf.tables;
94752
+ regex = this.regex.tables;
94753
+ break;
94754
+ default:
94755
+ continue;
94756
+ }
94757
+ const issue = this.checkParameter(obj, module, p, expected, regex);
94758
+ if (issue) {
94759
+ ret.push(issue);
94760
+ }
94761
+ }
94762
+ return ret;
94763
+ }
94764
+ checkParameter(obj, module, param, expected, regex) {
94765
+ if (!name_validator_1.NameValidator.violatesRule(param.name, regex, this.conf, this.regex.ignorePatterns)) {
94766
+ return undefined;
94767
+ }
94768
+ // the parameter is only defined in the XML, so report at the start of the module file, if it exists
94769
+ const file = this.findModuleFile(obj, module) || obj.getMainABAPFile();
94770
+ if (file === undefined) {
94771
+ return undefined;
94772
+ }
94773
+ const message = this.getDescription(expected, param.name);
94774
+ return issue_1.Issue.atPosition(file, new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);
94775
+ }
94776
+ findModuleFile(obj, module) {
94777
+ const search = "." + module.getName().toLowerCase().replace(/\//g, "#") + ".abap";
94778
+ return obj.getABAPFiles().find(f => f.getFilename().toLowerCase().endsWith(search));
94779
+ }
94780
+ }
94781
+ exports.FunctionModuleParameterNames = FunctionModuleParameterNames;
94782
+ //# sourceMappingURL=function_module_parameter_names.js.map
94783
+
94784
+ /***/ },
94785
+
93670
94786
  /***/ "./node_modules/@abaplint/core/build/src/rules/function_module_recommendations.js"
93671
94787
  /*!****************************************************************************************!*\
93672
94788
  !*** ./node_modules/@abaplint/core/build/src/rules/function_module_recommendations.js ***!
@@ -96111,10 +97227,12 @@ __exportStar(__webpack_require__(/*! ./fm_global_parameters_obsolete */ "./node_
96111
97227
  __exportStar(__webpack_require__(/*! ./forbidden_identifier */ "./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js"), exports);
96112
97228
  __exportStar(__webpack_require__(/*! ./forbidden_kernel_write */ "./node_modules/@abaplint/core/build/src/rules/forbidden_kernel_write.js"), exports);
96113
97229
  __exportStar(__webpack_require__(/*! ./forbidden_pseudo_and_pragma */ "./node_modules/@abaplint/core/build/src/rules/forbidden_pseudo_and_pragma.js"), exports);
97230
+ __exportStar(__webpack_require__(/*! ./forbidden_statement */ "./node_modules/@abaplint/core/build/src/rules/forbidden_statement.js"), exports);
96114
97231
  __exportStar(__webpack_require__(/*! ./forbidden_void_type */ "./node_modules/@abaplint/core/build/src/rules/forbidden_void_type.js"), exports);
96115
97232
  __exportStar(__webpack_require__(/*! ./form_tables_obsolete */ "./node_modules/@abaplint/core/build/src/rules/form_tables_obsolete.js"), exports);
96116
97233
  __exportStar(__webpack_require__(/*! ./fully_type_constants */ "./node_modules/@abaplint/core/build/src/rules/fully_type_constants.js"), exports);
96117
97234
  __exportStar(__webpack_require__(/*! ./fully_type_itabs */ "./node_modules/@abaplint/core/build/src/rules/fully_type_itabs.js"), exports);
97235
+ __exportStar(__webpack_require__(/*! ./function_module_parameter_names */ "./node_modules/@abaplint/core/build/src/rules/function_module_parameter_names.js"), exports);
96118
97236
  __exportStar(__webpack_require__(/*! ./function_module_recommendations */ "./node_modules/@abaplint/core/build/src/rules/function_module_recommendations.js"), exports);
96119
97237
  __exportStar(__webpack_require__(/*! ./functional_writing */ "./node_modules/@abaplint/core/build/src/rules/functional_writing.js"), exports);
96120
97238
  __exportStar(__webpack_require__(/*! ./generic_regex */ "./node_modules/@abaplint/core/build/src/rules/generic_regex.js"), exports);
@@ -96243,6 +97361,7 @@ __exportStar(__webpack_require__(/*! ./try_without_catch */ "./node_modules/@aba
96243
97361
  __exportStar(__webpack_require__(/*! ./type_form_parameters */ "./node_modules/@abaplint/core/build/src/rules/type_form_parameters.js"), exports);
96244
97362
  __exportStar(__webpack_require__(/*! ./types_naming */ "./node_modules/@abaplint/core/build/src/rules/types_naming.js"), exports);
96245
97363
  __exportStar(__webpack_require__(/*! ./uncaught_exception */ "./node_modules/@abaplint/core/build/src/rules/uncaught_exception.js"), exports);
97364
+ __exportStar(__webpack_require__(/*! ./unhandled_classic_exception */ "./node_modules/@abaplint/core/build/src/rules/unhandled_classic_exception.js"), exports);
96246
97365
  __exportStar(__webpack_require__(/*! ./unit_test_assertions */ "./node_modules/@abaplint/core/build/src/rules/unit_test_assertions.js"), exports);
96247
97366
  __exportStar(__webpack_require__(/*! ./unknown_types */ "./node_modules/@abaplint/core/build/src/rules/unknown_types.js"), exports);
96248
97367
  __exportStar(__webpack_require__(/*! ./unnecessary_chaining */ "./node_modules/@abaplint/core/build/src/rules/unnecessary_chaining.js"), exports);
@@ -98655,6 +99774,7 @@ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/co
98655
99774
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
98656
99775
  const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
98657
99776
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
99777
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
98658
99778
  class LoopTargetMisuseConf extends _basic_rule_config_1.BasicRuleConfig {
98659
99779
  constructor() {
98660
99780
  super(...arguments);
@@ -98663,6 +99783,9 @@ class LoopTargetMisuseConf extends _basic_rule_config_1.BasicRuleConfig {
98663
99783
  /** Report LOOP AT ... INTO <fs> and READ TABLE ... INTO <fs> when the local field symbol is only bound by ASSIGNING,
98664
99784
  * so the statement overwrites a table row */
98665
99785
  this.intoFieldSymbol = true;
99786
+ /** Report a field symbol of LOOP AT ... ASSIGNING used after ENDLOOP, and a field symbol of READ TABLE ... ASSIGNING
99787
+ * used after the check of sy-subrc, outside the branch that found the row */
99788
+ this.usedAfterLoop = true;
98666
99789
  }
98667
99790
  }
98668
99791
  exports.LoopTargetMisuseConf = LoopTargetMisuseConf;
@@ -98688,7 +99811,21 @@ Option intoFieldSymbol: LOOP AT ... INTO <fs> or READ TABLE ... INTO <fs>. INTO
98688
99811
  into the data object the field symbol points to. When <fs> was bound by ASSIGNING, that data
98689
99812
  object is a row of a table, and the statement overwrites it. ASSIGNING was meant.
98690
99813
  Reported only for a field symbol declared in the method, form or function module, and only when
98691
- no ASSIGN and no STRUCTURE ... DEFAULT binds it there, so it can only point to a table row.`,
99814
+ no ASSIGN and no STRUCTURE ... DEFAULT binds it there, so it can only point to a table row.
99815
+
99816
+ Option usedAfterLoop: a field symbol of LOOP AT ... ASSIGNING used after ENDLOOP. It points to
99817
+ the last row the loop processed. When the loop processed no row, it is not assigned, and the use
99818
+ raises GETWA_NOT_ASSIGNED, or it still points to what it was bound to before the loop.
99819
+ Also a field symbol of READ TABLE ... ASSIGNING used after sy-subrc was checked, outside the
99820
+ branch of that check. When the READ fails, the field symbol keeps its previous binding.
99821
+ Reported at the first such use in the method, form or function module.
99822
+ Not reported: a use inside IF, ELSEIF, CASE or WHILE whose condition reads sy-subrc, the table of
99823
+ the loop or a variable the loop body sets (a flag), a use after such a check that leaves with
99824
+ RETURN, EXIT, CONTINUE, CHECK, RAISE or MESSAGE or that does not use the field symbol, a use after
99825
+ CHECK or ASSERT of such a condition, and any use after IS ASSIGNED, UNASSIGN or another binding of
99826
+ the field symbol, or after a macro call. Work areas of INTO are not checked, they keep a value.
99827
+ A READ TABLE whose sy-subrc is not checked at all is left to check_subrc, a LOOP inside a LOOP
99828
+ with the same field symbol to the option nestedLoop.`,
98692
99829
  tags: [_irule_1.RuleTag.SingleFile],
98693
99830
  badExample: `LOOP AT lt_header INTO ls_row.
98694
99831
  LOOP AT lt_items INTO ls_row WHERE parent = ls_row-id.
@@ -98700,7 +99837,12 @@ ENDLOOP.
98700
99837
 
98701
99838
  LOOP AT lt_a ASSIGNING <ls_a>.
98702
99839
  ENDLOOP.
98703
- READ TABLE lt_a INTO <ls_a> INDEX 1.`,
99840
+ READ TABLE lt_a INTO <ls_a> INDEX 1.
99841
+
99842
+ LOOP AT lt_a ASSIGNING <ls_a> WHERE id = lv_id.
99843
+ EXIT.
99844
+ ENDLOOP.
99845
+ <ls_a>-flag = abap_true.`,
98704
99846
  goodExample: `LOOP AT lt_header INTO ls_row.
98705
99847
  LOOP AT lt_items INTO ls_item WHERE parent = ls_row-id.
98706
99848
  lv_sum = lv_sum + ls_item-amount.
@@ -98711,7 +99853,14 @@ ENDLOOP.
98711
99853
 
98712
99854
  LOOP AT lt_a ASSIGNING <ls_a>.
98713
99855
  ENDLOOP.
98714
- READ TABLE lt_a ASSIGNING <ls_a> INDEX 1.`,
99856
+ READ TABLE lt_a ASSIGNING <ls_a> INDEX 1.
99857
+
99858
+ LOOP AT lt_a ASSIGNING <ls_a> WHERE id = lv_id.
99859
+ EXIT.
99860
+ ENDLOOP.
99861
+ IF sy-subrc = 0.
99862
+ <ls_a>-flag = abap_true.
99863
+ ENDIF.`,
98715
99864
  };
98716
99865
  }
98717
99866
  getConfig() {
@@ -98729,6 +99878,14 @@ READ TABLE lt_a ASSIGNING <ls_a> INDEX 1.`,
98729
99878
  if (this.conf.intoFieldSymbol !== false) {
98730
99879
  issues.push(...this.checkIntoFieldSymbol(file, statements));
98731
99880
  }
99881
+ if (this.conf.usedAfterLoop !== false) {
99882
+ for (const issue of this.checkUsedAfterLoop(file, statements)) {
99883
+ // a READ TABLE ... INTO <fs> after the loop is already reported by the option intoFieldSymbol
99884
+ if (issues.some(i => i.getStart().equals(issue.getStart())) === false) {
99885
+ issues.push(issue);
99886
+ }
99887
+ }
99888
+ }
98732
99889
  return issues;
98733
99890
  }
98734
99891
  ////////////////
@@ -98785,7 +99942,7 @@ READ TABLE lt_a ASSIGNING <ls_a> INDEX 1.`,
98785
99942
  let depth = 0;
98786
99943
  for (let i = index + 1; i < statements.length && this.isBlockBoundary(statements[i]) === false; i++) {
98787
99944
  const s = statements[i].get();
98788
- if (s instanceof Statements.Loop) {
99945
+ if (s instanceof Statements.Loop || s instanceof Statements.LoopAtScreen || s instanceof Statements.LoopExtract) {
98789
99946
  depth++;
98790
99947
  }
98791
99948
  else if (s instanceof Statements.EndLoop) {
@@ -98894,6 +100051,232 @@ READ TABLE lt_a ASSIGNING <ls_a> INDEX 1.`,
98894
100051
  var _a;
98895
100052
  return (_a = fsTarget.findFirstExpression(Expressions.FieldSymbol)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
98896
100053
  }
100054
+ checkUsedAfterLoop(file, statements) {
100055
+ var _a;
100056
+ const issues = [];
100057
+ // the field symbols of the open LOOPs, undefined for a LOOP without field symbol
100058
+ let open = [];
100059
+ for (let i = 0; i < statements.length; i++) {
100060
+ const statement = statements[i];
100061
+ const s = statement.get();
100062
+ if (this.isBlockBoundary(statement)) {
100063
+ open = [];
100064
+ continue;
100065
+ }
100066
+ else if (s instanceof Statements.EndLoop) {
100067
+ open.pop();
100068
+ continue;
100069
+ }
100070
+ let use = undefined;
100071
+ let name = undefined;
100072
+ let what = "";
100073
+ if (s instanceof Statements.Loop) {
100074
+ const node = this.loopTarget(statement);
100075
+ name = (node === null || node === void 0 ? void 0 : node.get()) instanceof Expressions.FSTarget ? this.targetName(node) : undefined;
100076
+ const end = this.findEndLoop(statements, i);
100077
+ // a LOOP inside a LOOP with the same field symbol is left to the option nestedLoop
100078
+ if (name !== undefined && end !== undefined && open.includes(name) === false) {
100079
+ const guards = this.loopGuards(statements, i, end, name);
100080
+ use = this.findUncheckedUse(statements, end + 1, name, guards, false);
100081
+ what = `after ENDLOOP, it points to the last row, or is not assigned when the loop processed no row`;
100082
+ }
100083
+ open.push(name);
100084
+ }
100085
+ else if (s instanceof Statements.LoopAtScreen || s instanceof Statements.LoopExtract) {
100086
+ open.push(undefined);
100087
+ }
100088
+ else if (s instanceof Statements.ReadTable) {
100089
+ const fs = (_a = statement.findDirectExpression(Expressions.ReadTableTarget)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.FSTarget);
100090
+ name = fs ? this.targetName(fs) : undefined;
100091
+ if (name !== undefined) {
100092
+ use = this.findUncheckedUse(statements, i + 1, name, new Set(), true);
100093
+ what = `outside the check of sy-subrc, when the READ TABLE fails it is not assigned or points to an earlier row`;
100094
+ }
100095
+ }
100096
+ if (use !== undefined && name !== undefined) {
100097
+ const token = statements[use].getTokens().find(t => t.getStr().toUpperCase() === name);
100098
+ const message = `${token === null || token === void 0 ? void 0 : token.getStr()} is used ${what}`;
100099
+ issues.push(issue_1.Issue.atStatement(file, statements[use], message, this.getMetadata().key, this.conf.severity));
100100
+ }
100101
+ }
100102
+ return issues;
100103
+ }
100104
+ /** upper case names of the variables whose check counts as a check that the LOOP processed a row:
100105
+ * the table and the variables the loop body writes */
100106
+ loopGuards(statements, loop, end, name) {
100107
+ var _a;
100108
+ const guards = new Set();
100109
+ const first = (_a = statements[loop].findDirectExpression(Expressions.LoopSource)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toUpperCase();
100110
+ if (first !== undefined) {
100111
+ guards.add(first);
100112
+ }
100113
+ for (let i = loop + 1; i < end; i++) {
100114
+ for (const target of statements[i].findAllExpressions(Expressions.Target)) {
100115
+ guards.add(this.firstName(target));
100116
+ }
100117
+ }
100118
+ guards.delete(name);
100119
+ return guards;
100120
+ }
100121
+ /** upper case name of the variable a Target writes, also declared inline */
100122
+ firstName(target) {
100123
+ const inline = target.findFirstExpression(Expressions.TargetField);
100124
+ return (inline ? inline.getFirstToken() : target.getFirstToken()).getStr().toUpperCase();
100125
+ }
100126
+ /** index of the first statement from the index on that uses the field symbol without a check before it,
100127
+ * looking until the end of the method, form or function module or until the field symbol is bound again.
100128
+ * With checkFirst, only a use after a check is returned, an unchecked READ TABLE is left to check_subrc */
100129
+ findUncheckedUse(statements, from, name, guards, checkFirst) {
100130
+ const frames = [];
100131
+ let checked = false;
100132
+ let sawCheck = false;
100133
+ for (let i = from; i < statements.length && this.isBlockBoundary(statements[i]) === false; i++) {
100134
+ const statement = statements[i];
100135
+ const s = statement.get();
100136
+ if (s instanceof _statement_1.MacroCall || s instanceof _statement_1.Unknown || this.bindsOrTests(statement, name)) {
100137
+ return undefined;
100138
+ }
100139
+ const isCondition = s instanceof Statements.If || s instanceof Statements.ElseIf || s instanceof Statements.Case
100140
+ || s instanceof Statements.When || s instanceof Statements.While
100141
+ || s instanceof Statements.Check || s instanceof Statements.Assert;
100142
+ const guard = isCondition && this.isGuard(statement, guards);
100143
+ sawCheck = sawCheck || guard;
100144
+ if ((s instanceof Statements.Check || s instanceof Statements.Assert) && guard) {
100145
+ checked = true;
100146
+ }
100147
+ if (s instanceof Statements.FieldSymbol === false && this.mentions(statement, name)) {
100148
+ if (guard || checked || frames.some(f => f.guard)) {
100149
+ frames.forEach(f => f.uses = true);
100150
+ }
100151
+ else if (checkFirst === false || sawCheck === true) {
100152
+ return i;
100153
+ }
100154
+ }
100155
+ if (guard || frames.some(f => f.guard)) {
100156
+ // a flag set where the check holds, like lv_found = abap_true, checks it as well
100157
+ for (const target of statement.findAllExpressions(Expressions.Target)) {
100158
+ guards.add(this.firstName(target));
100159
+ }
100160
+ guards.delete(name);
100161
+ }
100162
+ if (this.leaves(statement)) {
100163
+ frames.forEach(f => f.leaves = true);
100164
+ }
100165
+ if (this.opensBlock(statement)) {
100166
+ frames.push({ guard, uses: false, leaves: false });
100167
+ }
100168
+ else if (this.isBranch(statement)) {
100169
+ if (frames.length === 0) {
100170
+ // another branch of a block around the binding, it does not run after it
100171
+ return undefined;
100172
+ }
100173
+ frames[frames.length - 1].guard = frames[frames.length - 1].guard || guard;
100174
+ }
100175
+ else if (this.closesBlock(statement)) {
100176
+ const frame = frames.pop();
100177
+ // IF sy-subrc <> 0. RETURN. ENDIF., or a check that sets a flag
100178
+ if (frame && frame.guard && (frame.leaves || frame.uses === false)) {
100179
+ checked = true;
100180
+ }
100181
+ }
100182
+ }
100183
+ return undefined;
100184
+ }
100185
+ /** true when the statement binds the field symbol again, unassigns it, or checks IS ASSIGNED */
100186
+ bindsOrTests(statement, name) {
100187
+ if (statement.get() instanceof Statements.Unassign && this.mentions(statement, name)) {
100188
+ return true;
100189
+ }
100190
+ for (const fsTarget of statement.findAllExpressions(Expressions.FSTarget)) {
100191
+ if (this.targetName(fsTarget) === name) {
100192
+ return true;
100193
+ }
100194
+ }
100195
+ const tokens = statement.getTokens().map(t => t.getStr().toUpperCase());
100196
+ for (let i = 0; i < tokens.length - 2; i++) {
100197
+ if (tokens[i] === name && tokens[i + 1] === "IS"
100198
+ && (tokens[i + 2] === "ASSIGNED" || (tokens[i + 2] === "NOT" && tokens[i + 3] === "ASSIGNED"))) {
100199
+ return true;
100200
+ }
100201
+ }
100202
+ return false;
100203
+ }
100204
+ /** true when the condition reads sy-subrc or one of the variables */
100205
+ isGuard(statement, guards) {
100206
+ var _a, _b;
100207
+ const tokens = statement.getTokens();
100208
+ for (let i = 0; i < tokens.length; i++) {
100209
+ const str = tokens[i].getStr().toUpperCase();
100210
+ const previous = i > 0 ? tokens[i - 1].getStr() : "";
100211
+ if (["-", "->", "=>", "~"].includes(previous)) {
100212
+ continue;
100213
+ }
100214
+ if ((str === "SY" && ((_a = tokens[i + 1]) === null || _a === void 0 ? void 0 : _a.getStr()) === "-" && ((_b = tokens[i + 2]) === null || _b === void 0 ? void 0 : _b.getStr().toUpperCase()) === "SUBRC")
100215
+ || guards.has(str)) {
100216
+ return true;
100217
+ }
100218
+ }
100219
+ return false;
100220
+ }
100221
+ mentions(statement, name) {
100222
+ return statement.getTokens().some(t => t.getStr().toUpperCase() === name);
100223
+ }
100224
+ /** true for a statement that can leave the current block, a call of a method named like RAISE counts */
100225
+ leaves(statement) {
100226
+ const s = statement.get();
100227
+ return s instanceof Statements.Return
100228
+ || s instanceof Statements.Exit
100229
+ || s instanceof Statements.Continue
100230
+ || s instanceof Statements.Check
100231
+ || s instanceof Statements.Raise
100232
+ || s instanceof Statements.Leave
100233
+ || s instanceof Statements.Message
100234
+ || s instanceof Statements.Assert
100235
+ || (s instanceof Statements.Call && statement.getTokens().some(t => /raise/i.test(t.getStr())));
100236
+ }
100237
+ opensBlock(statement) {
100238
+ const s = statement.get();
100239
+ return s instanceof Statements.If
100240
+ || s instanceof Statements.Case
100241
+ || s instanceof Statements.CaseType
100242
+ || s instanceof Statements.Loop
100243
+ || s instanceof Statements.LoopAtScreen
100244
+ || s instanceof Statements.LoopExtract
100245
+ || s instanceof Statements.Do
100246
+ || s instanceof Statements.While
100247
+ || s instanceof Statements.Try
100248
+ || s instanceof Statements.SelectLoop
100249
+ || s instanceof Statements.At
100250
+ || s instanceof Statements.AtFirst
100251
+ || s instanceof Statements.AtLast
100252
+ || s instanceof Statements.OnChange
100253
+ || s instanceof Statements.Provide
100254
+ || s instanceof Statements.CatchSystemExceptions;
100255
+ }
100256
+ isBranch(statement) {
100257
+ const s = statement.get();
100258
+ return s instanceof Statements.ElseIf
100259
+ || s instanceof Statements.Else
100260
+ || s instanceof Statements.When
100261
+ || s instanceof Statements.WhenOthers
100262
+ || s instanceof Statements.WhenType
100263
+ || s instanceof Statements.Catch
100264
+ || s instanceof Statements.Cleanup;
100265
+ }
100266
+ closesBlock(statement) {
100267
+ const s = statement.get();
100268
+ return s instanceof Statements.EndIf
100269
+ || s instanceof Statements.EndCase
100270
+ || s instanceof Statements.EndLoop
100271
+ || s instanceof Statements.EndDo
100272
+ || s instanceof Statements.EndWhile
100273
+ || s instanceof Statements.EndTry
100274
+ || s instanceof Statements.EndSelect
100275
+ || s instanceof Statements.EndAt
100276
+ || s instanceof Statements.EndOn
100277
+ || s instanceof Statements.EndProvide
100278
+ || s instanceof Statements.EndCatch;
100279
+ }
98897
100280
  isBlockBoundary(statement) {
98898
100281
  return this.startsBlock(statement) || this.endsBlock(statement);
98899
100282
  }
@@ -103062,6 +104445,8 @@ class ObsoleteStatementConf extends _basic_rule_config_1.BasicRuleConfig {
103062
104445
  this.replaceInto = true;
103063
104446
  this.loopExtract = true;
103064
104447
  this.sortExtract = true;
104448
+ /** Checks for TRANSLATE statement */
104449
+ this.translate = true;
103065
104450
  }
103066
104451
  }
103067
104452
  exports.ObsoleteStatementConf = ObsoleteStatementConf;
@@ -103118,7 +104503,9 @@ POSIX REGEX: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/ABE
103118
104503
 
103119
104504
  OCCURENCES: check for OCCURENCES vs OCCURRENCES
103120
104505
 
103121
- CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abapselect_client_obsolete.html`,
104506
+ CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abapselect_client_obsolete.html
104507
+
104508
+ TRANSLATE: https://help.sap.com/docs/abap-cloud/abap-keywords-standard-abap/translate`,
103122
104509
  badExample: `REFRESH itab.
103123
104510
 
103124
104511
  COMPUTE foo = 2 + 2.
@@ -103323,6 +104710,11 @@ ENDIF.`,
103323
104710
  const issue = issue_1.Issue.atStatement(file, staNode, "SORT extract", this.getMetadata().key, this.conf.severity);
103324
104711
  issues.push(issue);
103325
104712
  }
104713
+ if (this.conf.translate && sta instanceof Statements.Translate) {
104714
+ const fix = this.getTranslateFix(file, staNode);
104715
+ const issue = issue_1.Issue.atStatement(file, staNode, "TRANSLATE is obsolete", this.getMetadata().key, this.conf.severity, fix);
104716
+ issues.push(issue);
104717
+ }
103326
104718
  if ((0, version_1.releaseAtLeast)(configRelease, version_1.Release.v754) && this.conf.clientSpecified
103327
104719
  && (sta instanceof Statements.Select
103328
104720
  || sta instanceof Statements.SelectLoop
@@ -103445,6 +104837,27 @@ ENDIF.`,
103445
104837
  }
103446
104838
  return undefined;
103447
104839
  }
104840
+ getTranslateFix(file, statementNode) {
104841
+ const tokens = statementNode.getTokens();
104842
+ // tokens: TRANSLATE <target> TO UPPER|LOWER CASE .
104843
+ // or: TRANSLATE <target> USING <source> .
104844
+ if (tokens.length < 4) {
104845
+ return undefined;
104846
+ }
104847
+ const thirdToken = tokens[2].getStr().toUpperCase();
104848
+ if (thirdToken !== "TO") {
104849
+ return undefined;
104850
+ }
104851
+ const targetStr = tokens[1].getStr();
104852
+ const directionToken = tokens[3].getStr().toUpperCase();
104853
+ if (directionToken === "UPPER") {
104854
+ return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), targetStr + " = to_upper( " + targetStr + " ).");
104855
+ }
104856
+ else if (directionToken === "LOWER") {
104857
+ return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), targetStr + " = to_lower( " + targetStr + " ).");
104858
+ }
104859
+ return undefined;
104860
+ }
103448
104861
  }
103449
104862
  exports.ObsoleteStatement = ObsoleteStatement;
103450
104863
  //# sourceMappingURL=obsolete_statement.js.map
@@ -107912,8 +109325,16 @@ text = text.`,
107912
109325
  if (structure === undefined) {
107913
109326
  continue;
107914
109327
  }
109328
+ const sources = structure.findAllExpressionsRecursive(Expressions.Source);
109329
+ // Sources that are an operand of an enclosing Source, e.g. "2 * CONV i( a + b )" or "- CONV i( a + b )"
109330
+ const operands = new Set();
109331
+ for (const source of sources) {
109332
+ if (source.getChildren().length > 1) {
109333
+ source.findDirectExpressions(Expressions.Source).forEach(operand => operands.add(operand));
109334
+ }
109335
+ }
107915
109336
  // recursive, a CONV can be the argument of a built-in function, which is itself a Source
107916
- for (const source of structure.findAllExpressionsRecursive(Expressions.Source)) {
109337
+ for (const source of sources) {
107917
109338
  if (source.getFirstToken().getStr().toUpperCase() !== "CONV") {
107918
109339
  continue;
107919
109340
  }
@@ -107946,8 +109367,12 @@ text = text.`,
107946
109367
  if (closingParen === undefined) {
107947
109368
  continue;
107948
109369
  }
107949
- const preserveParentheses = bodySource.findDirectExpression(Expressions.ArithOperator) !== undefined
107950
- || bodySource.findDirectTokenByText("&&") !== undefined;
109370
+ // parentheses are only needed when the CONV takes part in a surrounding operation,
109371
+ // "CONV type ( body )" alone has 5 children, more means a trailing operator
109372
+ const partOfOperation = source.getChildren().length !== 5 || operands.has(source);
109373
+ const preserveParentheses = partOfOperation
109374
+ && (bodySource.findDirectExpression(Expressions.ArithOperator) !== undefined
109375
+ || bodySource.findDirectTokenByText("&&") !== undefined);
107951
109376
  // Apply the later edit first so the original positions remain valid when
107952
109377
  // both parts of the CONV wrapper are changed on the same line.
107953
109378
  const fix = edit_helper_1.EditHelper.merge(edit_helper_1.EditHelper.replaceRange(file, bodySource.getLastToken().getEnd(), closingParen.getEnd(), preserveParentheses ? ")" : ""), edit_helper_1.EditHelper.replaceRange(file, source.getFirstToken().getStart(), bodySource.getFirstToken().getStart(), preserveParentheses ? "(" : ""));
@@ -108537,6 +109962,15 @@ const Statements = __importStar(__webpack_require__(/*! ../abap/2_statements/sta
108537
109962
  const Expressions = __importStar(__webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
108538
109963
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
108539
109964
  class RFCErrorHandlingConf extends _basic_rule_config_1.BasicRuleConfig {
109965
+ constructor() {
109966
+ super(...arguments);
109967
+ /** Also check CALL FUNCTION ... STARTING NEW TASK without DESTINATION, an asynchronous RFC to the destination NONE */
109968
+ this.startingNewTask = true;
109969
+ /** Report error_message in the EXCEPTIONS of an RFC call, it is ignored in RFC */
109970
+ this.errorMessage = true;
109971
+ /** Report SYSTEM_FAILURE and COMMUNICATION_FAILURE without the addition MESSAGE, the error text is lost */
109972
+ this.requireMessage = false;
109973
+ }
108540
109974
  }
108541
109975
  exports.RFCErrorHandlingConf = RFCErrorHandlingConf;
108542
109976
  class RFCErrorHandling extends _abap_rule_1.ABAPRule {
@@ -108552,11 +109986,35 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
108552
109986
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
108553
109987
  extendedInformation: `RESOURCE_FAILURE is also required for asynchronous calls with DESTINATION IN GROUP.
108554
109988
 
108555
- https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abenrfc_exception.html`,
109989
+ Checked are CALL FUNCTION ... DESTINATION and, with startingNewTask, CALL FUNCTION ... STARTING NEW TASK
109990
+ without DESTINATION, which is an asynchronous RFC to the destination NONE.
109991
+ CALL FUNCTION ... IN BACKGROUND TASK is not checked, it cannot have EXCEPTIONS.
109992
+
109993
+ errorMessage: reports error_message in the EXCEPTIONS of an RFC call. It is ignored in RFC, a message of
109994
+ type A, E or X ends the called function module and raises SYSTEM_FAILURE, use system_failure = n MESSAGE msg
109995
+ to get the message text. Exception: with a DESTINATION that is blank at runtime, the call is local.
109996
+
109997
+ requireMessage: reports SYSTEM_FAILURE and COMMUNICATION_FAILURE without the addition MESSAGE.
109998
+
109999
+ https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abenrfc_exception.html
110000
+ https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abapcall_function_destination_para.html`,
108556
110001
  badExample: `CALL FUNCTION 'ZRFC'
108557
- DESTINATION lv_rfc.`,
110002
+ DESTINATION lv_rfc.
110003
+
110004
+ CALL FUNCTION 'ZRFC'
110005
+ STARTING NEW TASK 'TASK'
110006
+ EXCEPTIONS
110007
+ error_message = 1
110008
+ OTHERS = 2.`,
108558
110009
  goodExample: `CALL FUNCTION 'ZRFC'
108559
110010
  DESTINATION lv_rfc
110011
+ EXCEPTIONS
110012
+ system_failure = 1 MESSAGE msg
110013
+ communication_failure = 2 MESSAGE msg
110014
+ OTHERS = 3.
110015
+
110016
+ CALL FUNCTION 'ZRFC'
110017
+ STARTING NEW TASK 'TASK'
108560
110018
  EXCEPTIONS
108561
110019
  system_failure = 1 MESSAGE msg
108562
110020
  communication_failure = 2 MESSAGE msg
@@ -108581,28 +110039,45 @@ https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abenrfc_exceptio
108581
110039
  continue;
108582
110040
  }
108583
110041
  const destination = stat.findFirstExpression(Expressions.Destination);
108584
- if (destination === undefined) {
110042
+ const starting = stat.findDirectTokenByText("STARTING") !== undefined;
110043
+ if (destination === undefined && (starting === false || this.conf.startingNewTask === false)) {
108585
110044
  continue;
108586
110045
  }
108587
- const requireResourceFailure = stat.findDirectTokenByText("STARTING") !== undefined
108588
- && destination.findDirectTokenByText("GROUP") !== undefined;
110046
+ if (stat.findDirectTokenByText("BACKGROUND") !== undefined) {
110047
+ // transactional RFC, it has no EXCEPTIONS
110048
+ continue;
110049
+ }
110050
+ const requireResourceFailure = starting === true
110051
+ && (destination === null || destination === void 0 ? void 0 : destination.findDirectTokenByText("GROUP")) !== undefined;
108589
110052
  const list = stat.findFirstExpression(Expressions.ParameterListExceptions);
108590
110053
  if (list === undefined) {
108591
110054
  const issue = issue_1.Issue.atToken(file, token, this.getMessage(requireResourceFailure), this.getMetadata().key, this.conf.severity);
108592
110055
  output.push(issue);
108593
110056
  continue;
108594
110057
  }
108595
- const parameters = list.findAllExpressions(Expressions.ParameterName);
108596
- const names = [];
108597
- for (const par of parameters) {
108598
- names.push(par.getFirstToken().getStr().toUpperCase());
110058
+ const exceptions = new Map();
110059
+ for (const exception of list.findDirectExpressions(Expressions.ParameterException)) {
110060
+ exceptions.set(exception.getFirstToken().getStr().toUpperCase(), exception);
108599
110061
  }
108600
- if (names.indexOf("SYSTEM_FAILURE") < 0
108601
- || names.indexOf("COMMUNICATION_FAILURE") < 0
108602
- || (requireResourceFailure && names.indexOf("RESOURCE_FAILURE") < 0)) {
110062
+ if (exceptions.has("SYSTEM_FAILURE") === false
110063
+ || exceptions.has("COMMUNICATION_FAILURE") === false
110064
+ || (requireResourceFailure && exceptions.has("RESOURCE_FAILURE") === false)) {
108603
110065
  const issue = issue_1.Issue.atToken(file, token, this.getMessage(requireResourceFailure), this.getMetadata().key, this.conf.severity);
108604
110066
  output.push(issue);
108605
- continue;
110067
+ }
110068
+ const errorMessage = exceptions.get("ERROR_MESSAGE");
110069
+ if (this.conf.errorMessage !== false && errorMessage !== undefined) {
110070
+ const message = "error_message is ignored in RFC, messages of type A, E and X raise SYSTEM_FAILURE, use system_failure = n MESSAGE msg";
110071
+ output.push(issue_1.Issue.atToken(file, errorMessage.getFirstToken(), message, this.getMetadata().key, this.conf.severity));
110072
+ }
110073
+ if (this.conf.requireMessage === true) {
110074
+ for (const name of ["SYSTEM_FAILURE", "COMMUNICATION_FAILURE"]) {
110075
+ const exception = exceptions.get(name);
110076
+ if (exception !== undefined && exception.findDirectTokenByText("MESSAGE") === undefined) {
110077
+ const message = `${name} without MESSAGE, the error text is lost, use ${name.toLowerCase()} = n MESSAGE msg`;
110078
+ output.push(issue_1.Issue.atToken(file, exception.getFirstToken(), message, this.getMetadata().key, this.conf.severity));
110079
+ }
110080
+ }
108606
110081
  }
108607
110082
  }
108608
110083
  return output;
@@ -114612,6 +116087,321 @@ exports.UncaughtException = UncaughtException;
114612
116087
 
114613
116088
  /***/ },
114614
116089
 
116090
+ /***/ "./node_modules/@abaplint/core/build/src/rules/unhandled_classic_exception.js"
116091
+ /*!************************************************************************************!*\
116092
+ !*** ./node_modules/@abaplint/core/build/src/rules/unhandled_classic_exception.js ***!
116093
+ \************************************************************************************/
116094
+ (__unused_webpack_module, exports, __webpack_require__) {
116095
+
116096
+ "use strict";
116097
+
116098
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
116099
+ if (k2 === undefined) k2 = k;
116100
+ var desc = Object.getOwnPropertyDescriptor(m, k);
116101
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
116102
+ desc = { enumerable: true, get: function() { return m[k]; } };
116103
+ }
116104
+ Object.defineProperty(o, k2, desc);
116105
+ }) : (function(o, m, k, k2) {
116106
+ if (k2 === undefined) k2 = k;
116107
+ o[k2] = m[k];
116108
+ }));
116109
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
116110
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
116111
+ }) : function(o, v) {
116112
+ o["default"] = v;
116113
+ });
116114
+ var __importStar = (this && this.__importStar) || (function () {
116115
+ var ownKeys = function(o) {
116116
+ ownKeys = Object.getOwnPropertyNames || function (o) {
116117
+ var ar = [];
116118
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
116119
+ return ar;
116120
+ };
116121
+ return ownKeys(o);
116122
+ };
116123
+ return function (mod) {
116124
+ if (mod && mod.__esModule) return mod;
116125
+ var result = {};
116126
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
116127
+ __setModuleDefault(result, mod);
116128
+ return result;
116129
+ };
116130
+ })();
116131
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
116132
+ exports.UnhandledClassicException = exports.UnhandledClassicExceptionConf = void 0;
116133
+ const Statements = __importStar(__webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js"));
116134
+ const Expressions = __importStar(__webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js"));
116135
+ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
116136
+ const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
116137
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
116138
+ const severity_1 = __webpack_require__(/*! ../severity */ "./node_modules/@abaplint/core/build/src/severity.js");
116139
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
116140
+ const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
116141
+ const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
116142
+ const types_1 = __webpack_require__(/*! ../abap/types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
116143
+ const virtual_position_1 = __webpack_require__(/*! ../virtual_position */ "./node_modules/@abaplint/core/build/src/virtual_position.js");
116144
+ class UnhandledClassicExceptionConf extends _basic_rule_config_1.BasicRuleConfig {
116145
+ constructor() {
116146
+ super(...arguments);
116147
+ this.severity = severity_1.Severity.Warning;
116148
+ /** Report an EXCEPTIONS list without OTHERS, unless the method or function module is known and all its exceptions are listed */
116149
+ this.missingOthers = true;
116150
+ /** Report a call without EXCEPTIONS, including a functional call, of a method or function module that declares classic exceptions */
116151
+ this.missingExceptions = true;
116152
+ /** missingExceptions: do not report a method call whose arguments are all literals or me, like describe_by_name( 'T100' ) */
116153
+ this.allowLiteralArguments = true;
116154
+ /** Report CALL FUNCTION without error_message, the policy "always list error_message", for code that runs outside dialog */
116155
+ this.missingErrorMessage = false;
116156
+ }
116157
+ }
116158
+ exports.UnhandledClassicExceptionConf = UnhandledClassicExceptionConf;
116159
+ class UnhandledClassicException extends _abap_rule_1.ABAPRule {
116160
+ constructor() {
116161
+ super(...arguments);
116162
+ this.conf = new UnhandledClassicExceptionConf();
116163
+ }
116164
+ getMetadata() {
116165
+ return {
116166
+ key: "unhandled_classic_exception",
116167
+ title: "Unhandled classic exception",
116168
+ shortDescription: `Finds calls that do not map every classic exception the callee can raise`,
116169
+ extendedInformation: `A classic exception that is raised with RAISE and not mapped in the EXCEPTIONS addition of the call
116170
+ ends in the runtime error RAISE_EXCEPTION. TRY ... CATCH cx_root does not catch it.
116171
+
116172
+ missingOthers: reports CALL FUNCTION and method calls with an EXCEPTIONS list without OTHERS.
116173
+ Not reported if the function module or method is known and every exception it declares is listed,
116174
+ for CALL FUNCTION ... DESTINATION this includes SYSTEM_FAILURE and COMMUNICATION_FAILURE.
116175
+ CALL FUNCTION ... STARTING NEW TASK, IN UPDATE TASK and IN BACKGROUND are not checked.
116176
+
116177
+ missingExceptions: reports calls without EXCEPTIONS of a method or function module that declares classic exceptions,
116178
+ this includes functional calls, which cannot have EXCEPTIONS.
116179
+ With allowLiteralArguments, a method call whose arguments are all literals or me is not reported.
116180
+
116181
+ missingErrorMessage, off by default: reports every CALL FUNCTION that does not list the predefined exception error_message,
116182
+ the policy "always list error_message". Any function module can send a MESSAGE without RAISING, directly or from a
116183
+ function module it calls, and OTHERS does not catch it. Outside dialog, in HTTP handlers, RFC and background jobs,
116184
+ a message of type E or A ends the processing. Use it together with check_subrc, otherwise error_message turns a
116185
+ visible abort into a silent failure. Not reported: DESTINATION, STARTING NEW TASK, IN UPDATE TASK, IN BACKGROUND,
116186
+ EXCEPTION-TABLE, and function modules in the registry with class-based exceptions.
116187
+
116188
+ Signatures are taken from the registry, including dependencies. Methods and function modules that are not
116189
+ found (void) are only checked by missingOthers.
116190
+
116191
+ Does not report any issues if the code contains syntax errors`,
116192
+ tags: [_irule_1.RuleTag.Syntax],
116193
+ badExample: `CALL FUNCTION 'Z_READ'
116194
+ EXCEPTIONS
116195
+ not_found = 1.
116196
+
116197
+ lo_type = cl_abap_typedescr=>describe_by_name( lv_name ).`,
116198
+ goodExample: `CALL FUNCTION 'Z_READ'
116199
+ EXCEPTIONS
116200
+ not_found = 1
116201
+ OTHERS = 2.
116202
+
116203
+ cl_abap_typedescr=>describe_by_name(
116204
+ EXPORTING
116205
+ p_name = lv_name
116206
+ RECEIVING
116207
+ p_descr_ref = lo_type
116208
+ EXCEPTIONS
116209
+ type_not_found = 1
116210
+ OTHERS = 2 ).`,
116211
+ };
116212
+ }
116213
+ initialize(reg) {
116214
+ super.initialize(reg);
116215
+ this.functionModules = undefined;
116216
+ return this;
116217
+ }
116218
+ getConfig() {
116219
+ return this.conf;
116220
+ }
116221
+ setConfig(conf) {
116222
+ this.conf = conf;
116223
+ }
116224
+ runParsed(file, obj) {
116225
+ var _a;
116226
+ if (obj.getType() === "INTF" || file.getStructure() === undefined) {
116227
+ return [];
116228
+ }
116229
+ const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();
116230
+ if (syntax.issues.length > 0) {
116231
+ return [];
116232
+ }
116233
+ const methods = new Map();
116234
+ this.findMethodReferences(syntax.spaghetti.getTop(), file.getFilename(), methods);
116235
+ const issues = [];
116236
+ for (const statement of file.getStatements()) {
116237
+ if (statement.get() instanceof Statements.CallFunction) {
116238
+ issues.push(...this.checkCallFunction(statement, file));
116239
+ continue;
116240
+ }
116241
+ if (statement.get() instanceof Statements.Call) {
116242
+ const source = statement.findDirectExpression(Expressions.MethodSource);
116243
+ const body = statement.findDirectExpression(Expressions.MethodCallBody);
116244
+ const nameNode = source === null || source === void 0 ? void 0 : source.getLastChild();
116245
+ if (nameNode) {
116246
+ const token = nameNode.getFirstToken();
116247
+ const callee = nameNode.get() instanceof Expressions.Dynamic ? undefined : this.findMethod(methods, token);
116248
+ const issue = this.checkCall(file, token, callee, body === null || body === void 0 ? void 0 : body.findDirectExpression(Expressions.MethodParameters), (body === null || body === void 0 ? void 0 : body.findDirectTokenByText("EXCEPTION")) !== undefined, false, this.onlyLiterals(body));
116249
+ if (issue) {
116250
+ issues.push(issue);
116251
+ }
116252
+ }
116253
+ }
116254
+ for (const call of statement.findAllExpressionsRecursive(Expressions.MethodCall)) {
116255
+ const token = (_a = call.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
116256
+ if (token === undefined) {
116257
+ continue;
116258
+ }
116259
+ const param = call.findDirectExpression(Expressions.MethodCallParam);
116260
+ const parameters = param === null || param === void 0 ? void 0 : param.findDirectExpression(Expressions.MethodParameters);
116261
+ const issue = this.checkCall(file, token, this.findMethod(methods, token), parameters, false, false, this.onlyLiterals(param));
116262
+ if (issue) {
116263
+ issues.push(issue);
116264
+ }
116265
+ }
116266
+ }
116267
+ return issues;
116268
+ }
116269
+ checkCallFunction(statement, file) {
116270
+ var _a;
116271
+ if (statement.findDirectTokenByText("STARTING")
116272
+ || statement.findDirectTokenByText("UPDATE")
116273
+ || statement.findDirectTokenByText("BACKGROUND")) {
116274
+ return [];
116275
+ }
116276
+ const nameNode = statement.findDirectExpression(Expressions.FunctionName);
116277
+ if (nameNode === undefined) {
116278
+ return [];
116279
+ }
116280
+ let callee = undefined;
116281
+ let classBased = false;
116282
+ if (nameNode.findFirstExpression(Expressions.FieldChain) === undefined) {
116283
+ const name = nameNode.concatTokens().replace(/'/g, "").replace(/`/g, "");
116284
+ const module = this.findFunctionModule(name);
116285
+ if (module) {
116286
+ classBased = module.isClassBasedExceptions();
116287
+ callee = {
116288
+ name: module.getName(),
116289
+ exceptions: classBased ? [] : module.getExceptions().map(e => e.toUpperCase()),
116290
+ };
116291
+ }
116292
+ }
116293
+ const issues = [];
116294
+ const parameters = statement.findDirectExpression(Expressions.FunctionParameters);
116295
+ const exceptionTable = statement.findDirectTokenByText("EXCEPTION") !== undefined;
116296
+ const destination = statement.findDirectExpression(Expressions.Destination) !== undefined;
116297
+ const issue = this.checkCall(file, nameNode.getFirstToken(), callee, parameters, exceptionTable, destination, false);
116298
+ if (issue) {
116299
+ issues.push(issue);
116300
+ }
116301
+ if (this.conf.missingErrorMessage === true && exceptionTable === false && destination === false && classBased === false) {
116302
+ const listed = (_a = parameters === null || parameters === void 0 ? void 0 : parameters.findDirectExpression(Expressions.ParameterListExceptions)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.ParameterException).some(e => e.getFirstChild().concatTokens().toUpperCase() === "ERROR_MESSAGE");
116303
+ if (listed !== true) {
116304
+ const position = (parameters === null || parameters === void 0 ? void 0 : parameters.findDirectTokenByText("EXCEPTIONS")) || nameNode.getFirstToken();
116305
+ const message = "No error_message, OTHERS does not catch a message that the function module sends without RAISING";
116306
+ issues.push(issue_1.Issue.atToken(file, position, message, this.getMetadata().key, this.conf.severity));
116307
+ }
116308
+ }
116309
+ return issues;
116310
+ }
116311
+ checkCall(file, token, callee, parameters, exceptionTable, destination, onlyLiterals) {
116312
+ if (exceptionTable === true) {
116313
+ return undefined;
116314
+ }
116315
+ const list = parameters === null || parameters === void 0 ? void 0 : parameters.findDirectExpression(Expressions.ParameterListExceptions);
116316
+ if (list === undefined) {
116317
+ if (this.conf.missingExceptions === false
116318
+ || callee === undefined
116319
+ || callee.exceptions.length === 0
116320
+ || (this.conf.allowLiteralArguments === true && onlyLiterals === true)) {
116321
+ return undefined;
116322
+ }
116323
+ const message = `Classic exceptions of "${callee.name}" not handled: ${callee.exceptions.join(", ")}, call it with EXCEPTIONS`;
116324
+ return issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);
116325
+ }
116326
+ if (this.conf.missingOthers === false) {
116327
+ return undefined;
116328
+ }
116329
+ const listed = list.findDirectExpressions(Expressions.ParameterException)
116330
+ .map(e => e.getFirstChild().concatTokens().toUpperCase());
116331
+ if (listed.includes("OTHERS")) {
116332
+ return undefined;
116333
+ }
116334
+ const position = parameters.findDirectTokenByText("EXCEPTIONS") || list.getFirstToken();
116335
+ if (callee === undefined) {
116336
+ const message = "EXCEPTIONS without OTHERS, an exception that is not listed ends in a runtime error";
116337
+ return issue_1.Issue.atToken(file, position, message, this.getMetadata().key, this.conf.severity);
116338
+ }
116339
+ const expected = [...callee.exceptions];
116340
+ if (destination === true) {
116341
+ expected.push("SYSTEM_FAILURE", "COMMUNICATION_FAILURE");
116342
+ }
116343
+ const missing = expected.filter(e => listed.includes(e) === false);
116344
+ if (missing.length === 0) {
116345
+ return undefined;
116346
+ }
116347
+ const message = `EXCEPTIONS without OTHERS, not mapped: ${missing.join(", ")}`;
116348
+ return issue_1.Issue.atToken(file, position, message, this.getMetadata().key, this.conf.severity);
116349
+ }
116350
+ /** true if the call has arguments and all of them are literals or me, like describe_by_name( 'T100' ) */
116351
+ onlyLiterals(node) {
116352
+ if (node === undefined || node.findFirstExpression(Expressions.MethodCall) !== undefined) {
116353
+ return false;
116354
+ }
116355
+ const sources = node.findAllExpressions(Expressions.Source);
116356
+ return sources.length > 0
116357
+ && sources.every(s => { var _a; return (s.getChildren().length === 1 && ((_a = s.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Constant)
116358
+ || s.concatTokens().toUpperCase() === "ME"; });
116359
+ }
116360
+ findMethod(methods, token) {
116361
+ const method = methods.get(UnhandledClassicException.positionKey(token.getStart()));
116362
+ if (method === undefined) {
116363
+ return undefined;
116364
+ }
116365
+ return {
116366
+ name: method.getName(),
116367
+ exceptions: method.getExceptions().map(e => e.toUpperCase()),
116368
+ };
116369
+ }
116370
+ findMethodReferences(node, filename, found) {
116371
+ for (const r of node.getData().references) {
116372
+ if (r.referenceType === _reference_1.ReferenceType.MethodReference
116373
+ && r.position.getFilename() === filename
116374
+ && r.resolved instanceof types_1.MethodDefinition) {
116375
+ found.set(UnhandledClassicException.positionKey(r.position.getStart()), r.resolved);
116376
+ }
116377
+ }
116378
+ for (const child of node.getChildren()) {
116379
+ this.findMethodReferences(child, filename, found);
116380
+ }
116381
+ }
116382
+ findFunctionModule(name) {
116383
+ if (this.functionModules === undefined) {
116384
+ this.functionModules = new Map();
116385
+ for (const fugr of this.reg.getObjectsByType("FUGR")) {
116386
+ for (const module of fugr.getModules()) {
116387
+ this.functionModules.set(module.getName().toUpperCase(), module);
116388
+ }
116389
+ }
116390
+ }
116391
+ return this.functionModules.get(name.toUpperCase());
116392
+ }
116393
+ static positionKey(p) {
116394
+ if (p instanceof virtual_position_1.VirtualPosition) {
116395
+ return p.getRow() + ":" + p.getCol() + ":" + p.vrow + ":" + p.vcol;
116396
+ }
116397
+ return p.getRow() + ":" + p.getCol();
116398
+ }
116399
+ }
116400
+ exports.UnhandledClassicException = UnhandledClassicException;
116401
+ //# sourceMappingURL=unhandled_classic_exception.js.map
116402
+
116403
+ /***/ },
116404
+
114615
116405
  /***/ "./node_modules/@abaplint/core/build/src/rules/unit_test_assertions.js"
114616
116406
  /*!*****************************************************************************!*\
114617
116407
  !*** ./node_modules/@abaplint/core/build/src/rules/unit_test_assertions.js ***!
@@ -123701,7 +125491,7 @@ const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abapli
123701
125491
  const statements_1 = __webpack_require__(/*! ../statements */ "./node_modules/@abaplint/transpiler/build/src/statements/index.js");
123702
125492
  const source_field_symbol_1 = __webpack_require__(/*! ./source_field_symbol */ "./node_modules/@abaplint/transpiler/build/src/expressions/source_field_symbol.js");
123703
125493
  const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./node_modules/@abaplint/transpiler/build/src/unique_identifier.js");
123704
- /** FOR GROUPS group OF member IN itab GROUP BY key [ASCENDING|DESCENDING] [WITHOUT MEMBERS] */
125494
+ /** FOR GROUPS group OF member IN itab GROUP BY key [ASCENDING|DESCENDING [AS TEXT]] [WITHOUT MEMBERS] */
123705
125495
  class ForGroupsTranspiler {
123706
125496
  transpile(forExpression, traversal) {
123707
125497
  const targets = forExpression.getChildren().filter(c => c instanceof core_1.Nodes.ExpressionNode
@@ -123717,9 +125507,6 @@ class ForGroupsTranspiler {
123717
125507
  if (groupBy === undefined) {
123718
125508
  throw new Error("FOR GROUPS, GROUP BY expected, " + forExpression.concatTokens());
123719
125509
  }
123720
- if (forExpression.findDirectTokenByText("TEXT")) {
123721
- throw new Error("FOR GROUPS, AS TEXT, todo, " + forExpression.concatTokens());
123722
- }
123723
125510
  const declarations = [];
123724
125511
  const [groupNode, memberNode] = targets;
123725
125512
  const row = unique_identifier_1.UniqueIdentifier.get();
@@ -123751,11 +125538,16 @@ class ForGroupsTranspiler {
123751
125538
  const rawKey = unique_identifier_1.UniqueIdentifier.get();
123752
125539
  const entry = unique_identifier_1.UniqueIdentifier.get();
123753
125540
  let ordered = `${groups}.values()`;
125541
+ const text = forExpression.findDirectTokenByText("TEXT") !== undefined;
123754
125542
  if (forExpression.findDirectTokenByText("ASCENDING")) {
123755
- ordered = `[...${groups}.values()].sort((a, b) => abap.compare.lt(a.key, b.key) ? -1 : abap.compare.gt(a.key, b.key) ? 1 : 0)`;
125543
+ ordered = text
125544
+ ? `[...${groups}.values()].sort((a, b) => abap.compare.compareText(a.key, b.key))`
125545
+ : `[...${groups}.values()].sort((a, b) => abap.compare.lt(a.key, b.key) ? -1 : abap.compare.gt(a.key, b.key) ? 1 : 0)`;
123756
125546
  }
123757
125547
  else if (forExpression.findDirectTokenByText("DESCENDING")) {
123758
- ordered = `[...${groups}.values()].sort((a, b) => abap.compare.gt(a.key, b.key) ? -1 : abap.compare.lt(a.key, b.key) ? 1 : 0)`;
125548
+ ordered = text
125549
+ ? `[...${groups}.values()].sort((a, b) => abap.compare.compareText(b.key, a.key))`
125550
+ : `[...${groups}.values()].sort((a, b) => abap.compare.gt(a.key, b.key) ? -1 : abap.compare.lt(a.key, b.key) ? 1 : 0)`;
123759
125551
  }
123760
125552
  // groups are kept in order of first occurrence
123761
125553
  const generator = `(async function*() {\n`
@@ -124508,6 +126300,7 @@ const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abapli
124508
126300
  const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@abaplint/transpiler/build/src/traversal.js");
124509
126301
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
124510
126302
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
126303
+ const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./node_modules/@abaplint/transpiler/build/src/unique_identifier.js");
124511
126304
  class MethodSourceTranspiler {
124512
126305
  prepend;
124513
126306
  privatePrefix;
@@ -124519,6 +126312,13 @@ class MethodSourceTranspiler {
124519
126312
  this.privatePrefix = privatePrefix;
124520
126313
  this.staticConstructorCall = staticConstructorCall;
124521
126314
  }
126315
+ /** (name)=>: the class of a dynamic static call, a local class of the program first, as CREATE OBJECT ... TYPE (name),
126316
+ * then a global class. name is the JS code of the name. Returns the JS name of a variable holding the class */
126317
+ dynamicClass(name, ret, traversal) {
126318
+ const id = unique_identifier_1.UniqueIdentifier.get();
126319
+ ret.appendString(`const ${id} = abap.Classes["${traversal.buildPrefix()}" + ${name}.trimEnd()] ?? abap.Classes[${name}.trimEnd()];\n`);
126320
+ return id;
126321
+ }
124522
126322
  transpile(node, traversal) {
124523
126323
  const ret = new chunk_1.Chunk();
124524
126324
  const children = node.getChildren();
@@ -124536,11 +126336,11 @@ class MethodSourceTranspiler {
124536
126336
  const illegalMethod = traversal.lookupClassOrInterface("'CX_SY_DYN_CALL_ILLEGAL_METHOD'", child.getFirstToken(), true);
124537
126337
  if (second.get() instanceof core_1.Expressions.FieldChain && second instanceof core_1.Nodes.ExpressionNode) {
124538
126338
  const t = new _1.FieldChainTranspiler(true).transpile(second, traversal).getCode();
124539
- call = traversal.lookupClassOrInterface(t, child.getFirstToken(), true);
126339
+ call = this.dynamicClass(t, ret, traversal);
124540
126340
  ret.appendString(`if (${call} === undefined) { if (${illegalClass} === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_CLASS not found"; } else {throw new ${illegalClass}(); } }\n`);
124541
126341
  }
124542
126342
  else if (second.get() instanceof core_1.Expressions.Constant) {
124543
- call = traversal.lookupClassOrInterface(second.getFirstToken().getStr(), child.getFirstToken(), true);
126343
+ call = this.dynamicClass(second.getFirstToken().getStr(), ret, traversal);
124544
126344
  ret.appendString(`if (${call} === undefined) { if (${illegalClass} === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_CLASS not found"; } else {throw new ${illegalClass}(); } }\n`);
124545
126345
  const name = children[i + 2];
124546
126346
  if (name.get() instanceof core_1.Expressions.AttributeName) {
@@ -127469,6 +129269,7 @@ exports.TableExpressionTranspiler = void 0;
127469
129269
  const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
127470
129270
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
127471
129271
  const component_chain_simple_1 = __webpack_require__(/*! ./component_chain_simple */ "./node_modules/@abaplint/transpiler/build/src/expressions/component_chain_simple.js");
129272
+ const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./node_modules/@abaplint/transpiler/build/src/unique_identifier.js");
127472
129273
  class TableExpressionTranspiler {
127473
129274
  transpile(node, traversal, source) {
127474
129275
  if (source === undefined) {
@@ -127479,6 +129280,8 @@ class TableExpressionTranspiler {
127479
129280
  let field = "";
127480
129281
  let usesTableLine = false;
127481
129282
  const withKey = [];
129283
+ const withKeyValue = [];
129284
+ const values = [];
127482
129285
  // KEY name: the row is searched, or counted by INDEX, in the order of that key
127483
129286
  const keyName = node.findDirectExpression(core_1.Expressions.SimpleName);
127484
129287
  if (keyName) {
@@ -127507,7 +129310,11 @@ class TableExpressionTranspiler {
127507
129310
  }
127508
129311
  }
127509
129312
  else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.Source) {
127510
- withKey.push("abap.compare.eq(" + field + ", " + traversal.traverse(c).getCode() + ")");
129313
+ // the value is evaluated once, before the search
129314
+ const id = unique_identifier_1.UniqueIdentifier.get();
129315
+ values.push("const " + id + " = " + traversal.traverse(c).getCode() + ";");
129316
+ withKey.push("abap.compare.eq(" + field + ", " + id + ")");
129317
+ withKeyValue.push(`{key: (i) => {return ${field}}, value: ${id}}`);
127511
129318
  }
127512
129319
  else if (c.concatTokens() === "=" || c.concatTokens() === "[" || c.concatTokens() === "]") {
127513
129320
  continue;
@@ -127517,9 +129324,16 @@ class TableExpressionTranspiler {
127517
129324
  }
127518
129325
  }
127519
129326
  extra.push("withKey: async (i) => {return " + withKey.join(" && ") + ";}");
129327
+ extra.push(`withKeyValue: [${withKeyValue.join(",")}]`);
127520
129328
  extra.push("usesTableLine: " + usesTableLine);
127521
129329
  }
127522
- ret.appendString(`(await abap.operators.tableExpression(${source.getCode()}, {${extra.join(", ")} }))`);
129330
+ const call = `abap.operators.tableExpression(${source.getCode()}, {${extra.join(", ")} })`;
129331
+ if (values.length > 0) {
129332
+ ret.appendString(`(await (async () => {${values.join(" ")} return ${call};})())`);
129333
+ }
129334
+ else {
129335
+ ret.appendString(`(await ${call})`);
129336
+ }
127523
129337
  return ret;
127524
129338
  }
127525
129339
  }
@@ -131040,7 +132854,34 @@ throw error;
131040
132854
  const first = source.findFirstExpression(abaplint.Expressions.FieldChain)?.getFirstChild();
131041
132855
  return first !== undefined && !(first.get() instanceof abaplint.Expressions.SourceFieldSymbol);
131042
132856
  }
132857
+ /** ASSIGN dobj INCREMENT inc TO <fs> [CASTING] [RANGE range]., dobj is parsed as the Target,
132858
+ * inc as the AssignSource */
132859
+ transpileIncrement(node, traversal, fs) {
132860
+ const options = ["target: " + fs];
132861
+ const dobj = node.findDirectExpression(abaplint.Expressions.Target);
132862
+ options.push("source: " + new expressions_1.TargetTranspiler().transpile(dobj, traversal).getCode());
132863
+ const inc = node.findDirectExpression(abaplint.Expressions.AssignSource)?.findDirectExpression(abaplint.Expressions.Source);
132864
+ options.push("increment: " + new expressions_1.SourceTranspiler(false).transpile(inc, traversal).getCode());
132865
+ const range = node.findDirectExpression(abaplint.Expressions.Source);
132866
+ if (range !== undefined) {
132867
+ options.push("range: " + new expressions_1.SourceTranspiler(false).transpile(range, traversal).getCode());
132868
+ }
132869
+ const concat = node.concatTokens().toUpperCase();
132870
+ if (concat.includes(" CASTING")) {
132871
+ options.push("casting: true");
132872
+ }
132873
+ return new chunk_1.Chunk().append("abap.statements.assign({", node, traversal)
132874
+ .appendString(options.join(", "))
132875
+ .append("});", node.getLastToken(), traversal);
132876
+ }
131043
132877
  transpile(node, traversal) {
132878
+ if (node.findDirectTokenByText("INCREMENT") !== undefined) {
132879
+ let fsTarget = node.findDirectExpression(abaplint.Expressions.FSTarget);
132880
+ if (fsTarget?.getFirstChild()?.get() instanceof abaplint.Expressions.InlineFS) {
132881
+ fsTarget = fsTarget.findFirstExpression(abaplint.Expressions.TargetFieldSymbol);
132882
+ }
132883
+ return this.transpileIncrement(node, traversal, new expressions_1.FieldSymbolTranspiler().transpile(fsTarget, traversal).getCode());
132884
+ }
131044
132885
  const assignSource = node.findDirectExpression(abaplint.Expressions.AssignSource);
131045
132886
  const sourceExpressions = assignSource?.findDirectExpressionsMulti([abaplint.Expressions.Source, abaplint.Expressions.SimpleSource3]) || [];
131046
132887
  const sources = sourceExpressions.map(e => this.tableExpressionSafeSource(e, new expressions_1.SourceTranspiler(false).transpile(e, traversal).getCode()));
@@ -137033,17 +138874,25 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
137033
138874
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
137034
138875
  class LoopTranspiler {
137035
138876
  unique = "";
138877
+ targetCode = "";
137036
138878
  injectFrom = undefined;
137037
138879
  skipInto = undefined;
137038
138880
  atLast = undefined;
138881
+ groupEntry = undefined;
138882
+ /** groupEntry: LOOP AT GROUP, the JS name of the current group of the enclosing group loop */
137039
138883
  constructor(options) {
137040
138884
  this.injectFrom = options?.injectFrom;
137041
138885
  this.skipInto = options?.skipInto;
137042
138886
  this.atLast = options?.atLast;
138887
+ this.groupEntry = options?.groupEntry;
137043
138888
  }
137044
138889
  getTarget() {
137045
138890
  return this.unique;
137046
138891
  }
138892
+ /** the code assigning the row in getTarget() to the INTO, ASSIGNING or REFERENCE INTO target, can be empty */
138893
+ getTargetCode() {
138894
+ return this.targetCode;
138895
+ }
137047
138896
  determineInto(node) {
137048
138897
  const loopTarget = node.findDirectExpression(abaplint.Expressions.LoopTarget);
137049
138898
  let into = loopTarget?.findDirectExpression(abaplint.Expressions.Target);
@@ -137063,9 +138912,11 @@ class LoopTranspiler {
137063
138912
  // the abap expression the target-assignment line should map back to
137064
138913
  let targetNode = undefined;
137065
138914
  const into = this.determineInto(node);
138915
+ // the row target only, a GROUP BY has its own INTO, ASSIGNING or REFERENCE INTO for the group
138916
+ const loopTarget = node.findDirectExpression(abaplint.Expressions.LoopTarget);
137066
138917
  if (into && this.skipInto !== true) {
137067
138918
  targetNode = into;
137068
- const concat = node.concatTokens().toUpperCase();
138919
+ const concat = " " + (loopTarget?.concatTokens().toUpperCase() ?? "") + " ";
137069
138920
  const t = traversal.traverse(into).getCode();
137070
138921
  const scope = traversal.findCurrentScopeByToken(node.getFirstToken());
137071
138922
  const typ = traversal.determineType(node, scope);
@@ -137082,7 +138933,8 @@ class LoopTranspiler {
137082
138933
  }
137083
138934
  }
137084
138935
  else if (this.skipInto !== true) {
137085
- const assigning = node.findFirstExpression(abaplint.Expressions.FSTarget)?.findFirstExpression(abaplint.Expressions.FieldSymbol);
138936
+ const assigning = loopTarget?.findFirstExpression(abaplint.Expressions.FSTarget)
138937
+ ?.findFirstExpression(abaplint.Expressions.FieldSymbol);
137086
138938
  if (assigning) {
137087
138939
  targetNode = assigning;
137088
138940
  target = traversal.traverse(assigning).getCode() + ".assign(" + this.unique + ");";
@@ -137177,8 +139029,16 @@ class LoopTranspiler {
137177
139029
  }
137178
139030
  // map the loop head to the statement start and the target-assignment line
137179
139031
  // (foo.set(unique)) back to the INTO/ASSIGNING target expression
139032
+ this.targetCode = target;
137180
139033
  const ret = new chunk_1.Chunk();
137181
- ret.append(`for await (const ${this.unique} of abap.statements.loop(${source}${concat})) {`, node, traversal);
139034
+ if (this.groupEntry !== undefined) {
139035
+ // LOOP AT GROUP allows only WHERE
139036
+ const where = whereNode ? `,{where: async ${traversal.traverse(whereNode).getCode()}}` : "";
139037
+ ret.append(`for await (const ${this.unique} of abap.statements.loopGroup(${this.groupEntry}${where})) {`, node, traversal);
139038
+ }
139039
+ else {
139040
+ ret.append(`for await (const ${this.unique} of abap.statements.loop(${source}${concat})) {`, node, traversal);
139041
+ }
137182
139042
  ret.appendString("\n");
137183
139043
  if (target !== "") {
137184
139044
  ret.append(target, targetNode ?? node, traversal);
@@ -141546,31 +143406,65 @@ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/tr
141546
143406
  const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
141547
143407
  class SortTranspiler {
141548
143408
  transpile(node, traversal) {
141549
- const concat = node.concatTokens().toUpperCase();
141550
- const components = node.getChildren().filter(c => c instanceof abaplint.Nodes.ExpressionNode
141551
- && (c.get() instanceof abaplint.Expressions.ComponentChain || this.isDynamicName(c, traversal)));
141552
143409
  const options = [];
141553
- if (concat.includes(" BY ") === false) {
141554
- const descending = node.findDirectTokenByText("DESCENDING") !== undefined;
141555
- if (descending === true) {
141556
- options.push("descending: true");
143410
+ // additions before BY apply to the whole SORT, after BY each component can have its own order and AS TEXT,
143411
+ // a component without its own order takes the order of the SORT
143412
+ let descending = false;
143413
+ let text = false;
143414
+ let afterBy = false;
143415
+ const by = [];
143416
+ for (const c of node.getChildren()) {
143417
+ if (c instanceof abaplint.Nodes.ExpressionNode) {
143418
+ if (afterBy && (c.get() instanceof abaplint.Expressions.ComponentChain || this.isDynamicName(c, traversal))) {
143419
+ const component = c.get() instanceof abaplint.Expressions.Dynamic
143420
+ ? this.dynamicName(c, traversal)
143421
+ : `"${expressions_1.ComponentChainTranspiler.concat(c, traversal)}"`;
143422
+ by.push({ component, text: false });
143423
+ }
143424
+ continue;
141557
143425
  }
141558
- }
141559
- else if (components.length > 0) {
141560
- const by = [];
141561
- for (const c of components) {
141562
- const next = this.findNextText(c, node);
141563
- const component = c.get() instanceof abaplint.Expressions.Dynamic
141564
- ? this.dynamicName(c, traversal)
141565
- : `"${expressions_1.ComponentChainTranspiler.concat(c, traversal)}"`;
141566
- if (next === "DESCENDING") {
141567
- by.push(`{component: ${component}, descending: true}`);
143426
+ const word = c.concatTokens().toUpperCase();
143427
+ const current = by[by.length - 1];
143428
+ if (word === "BY") {
143429
+ afterBy = true;
143430
+ }
143431
+ else if (word === "DESCENDING" || word === "ASCENDING") {
143432
+ if (current !== undefined) {
143433
+ current.order = word;
141568
143434
  }
141569
143435
  else {
141570
- by.push(`{component: ${component}}`);
143436
+ descending = word === "DESCENDING";
143437
+ }
143438
+ }
143439
+ else if (word === "TEXT") {
143440
+ if (current !== undefined) {
143441
+ current.text = true;
143442
+ }
143443
+ else {
143444
+ text = true;
143445
+ }
143446
+ }
143447
+ }
143448
+ if (by.length > 0) {
143449
+ const list = by.map(b => {
143450
+ const opts = [`component: ${b.component}`];
143451
+ if (b.order === "DESCENDING" || (b.order === undefined && descending)) {
143452
+ opts.push("descending: true");
143453
+ }
143454
+ if (b.text || text) {
143455
+ opts.push("text: true");
141571
143456
  }
143457
+ return "{" + opts.join(", ") + "}";
143458
+ });
143459
+ options.push(`by: [${list.join(",")}]`);
143460
+ }
143461
+ else if (afterBy === false) {
143462
+ if (descending === true) {
143463
+ options.push("descending: true");
143464
+ }
143465
+ if (text === true) {
143466
+ options.push("text: true");
141572
143467
  }
141573
- options.push(`by: [${by.join(",")}]`);
141574
143468
  }
141575
143469
  const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Target)).getCode();
141576
143470
  return new chunk_1.Chunk().append("abap.statements.sort(" + target + ",{" + options.join(",") + "});", node, traversal);
@@ -141601,20 +143495,6 @@ class SortTranspiler {
141601
143495
  const field = c.findFirstExpression(abaplint.Expressions.FieldChain);
141602
143496
  return new expressions_1.FieldChainTranspiler(true).transpile(field, traversal).getCode() + ".toLowerCase().trimEnd()";
141603
143497
  }
141604
- findNextText(c, parent) {
141605
- const children = parent.getChildren();
141606
- for (let i = 0; i < children.length; i++) {
141607
- const element = children[i];
141608
- if (element !== c) {
141609
- continue;
141610
- }
141611
- const next = children[i + 1];
141612
- if (next) {
141613
- return next.concatTokens().toUpperCase();
141614
- }
141615
- }
141616
- return "";
141617
- }
141618
143498
  }
141619
143499
  exports.SortTranspiler = SortTranspiler;
141620
143500
  //# sourceMappingURL=sort.js.map
@@ -143269,9 +145149,13 @@ class CaseTypeTranspiler {
143269
145149
  }
143270
145150
  const cname = c.findDirectExpression(abaplint.Expressions.ClassName);
143271
145151
  const lookup = traversal.lookupClassOrInterface(cname?.concatTokens(), cname?.getFirstToken());
143272
- ret.appendString(u + ".get() instanceof " + lookup);
145152
+ // as IS INSTANCE OF: interfaces, and for an initial reference its static type
145153
+ ret.appendString("abap.compare.instance_of(" + u + ", " + lookup + ")");
143273
145154
  ret.appendString(") {\n");
143274
- ret.appendString(traversal.traverse(c.findDirectExpression(abaplint.Expressions.Target)).getCode() + ".set(" + u + ")\n");
145155
+ const target = c.findDirectExpression(abaplint.Expressions.Target);
145156
+ if (target !== undefined) {
145157
+ ret.appendString(traversal.traverse(target).getCode() + ".set(" + u + ")\n");
145158
+ }
143275
145159
  }
143276
145160
  else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.WhenOthers) {
143277
145161
  if (first === true) {
@@ -144432,8 +146316,129 @@ const at_last_1 = __webpack_require__(/*! ./at_last */ "./node_modules/@abaplint
144432
146316
  const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./node_modules/@abaplint/transpiler/build/src/unique_identifier.js");
144433
146317
  const statements_1 = __webpack_require__(/*! ../statements */ "./node_modules/@abaplint/transpiler/build/src/statements/index.js");
144434
146318
  const at_1 = __webpack_require__(/*! ./at */ "./node_modules/@abaplint/transpiler/build/src/structures/at.js");
146319
+ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
146320
+ /** the group loops being transpiled, innermost last: name is the group variable, or the row target
146321
+ * for a group loop without group target, entry the JS name of the current group */
146322
+ const groupLoops = [];
144435
146323
  class LoopTranspiler {
146324
+ /** the variable name of a Target or FSTarget, lower case, as LOOP AT GROUP refers to it */
146325
+ static targetName(node) {
146326
+ if (node === undefined) {
146327
+ return undefined;
146328
+ }
146329
+ const field = node.findFirstExpression(abaplint.Expressions.FieldSymbol)
146330
+ ?? node.findFirstExpression(abaplint.Expressions.TargetField)
146331
+ ?? node;
146332
+ return field.concatTokens().toLowerCase();
146333
+ }
146334
+ /** LOOP AT GROUP group: the JS name of the current group of the enclosing group loop, undefined for other loops */
146335
+ static findGroupEntry(loopStatement) {
146336
+ const at = loopStatement.getChildren()[2];
146337
+ if (!(at instanceof abaplint.Nodes.TokenNode) || at.concatTokens().toUpperCase() !== "GROUP") {
146338
+ return undefined;
146339
+ }
146340
+ const name = loopStatement.findDirectExpression(abaplint.Expressions.LoopSource)?.concatTokens().toLowerCase();
146341
+ const entry = [...groupLoops].reverse().find(g => g.name === name)?.entry;
146342
+ if (entry === undefined) {
146343
+ throw new Error("LOOP AT GROUP, no enclosing group loop for " + name);
146344
+ }
146345
+ return entry;
146346
+ }
146347
+ /** the group key: the code of a simple key, or a list of [component, value] for a structured key */
146348
+ groupKey(groupBy, traversal) {
146349
+ const components = groupBy.findDirectExpressions(abaplint.Expressions.LoopGroupByComponent);
146350
+ if (components.length === 0) {
146351
+ const source = groupBy.findDirectExpression(abaplint.Expressions.Source);
146352
+ return new expressions_1.SourceTranspiler(false).transpile(source, traversal).getCode();
146353
+ }
146354
+ const list = [];
146355
+ for (const c of components) {
146356
+ const compare = c.findDirectExpression(abaplint.Expressions.ComponentCompareSingle);
146357
+ if (compare !== undefined) {
146358
+ const name = compare.findDirectExpression(abaplint.Expressions.ComponentChainSimple).concatTokens().toLowerCase();
146359
+ const sourceNode = compare.findDirectExpression(abaplint.Expressions.Source);
146360
+ const source = new expressions_1.SourceTranspiler(false).transpile(sourceNode, traversal).getCode();
146361
+ list.push(`["${name}", ${source}]`);
146362
+ }
146363
+ else {
146364
+ const name = c.findDirectExpression(abaplint.Expressions.ComponentName).concatTokens().toLowerCase();
146365
+ const what = c.concatTokens().toUpperCase().endsWith("GROUP SIZE") ? "SIZE" : "INDEX";
146366
+ list.push(`["${name}", "${what}"]`);
146367
+ }
146368
+ }
146369
+ return "[" + list.join(", ") + "]";
146370
+ }
146371
+ /** LOOP AT itab ... GROUP BY key [ASCENDING|DESCENDING [AS TEXT]] [WITHOUT MEMBERS] [INTO|ASSIGNING|REFERENCE INTO group],
146372
+ * first all rows are read and grouped, then the body runs once per group */
146373
+ transpileGroupBy(node, loopStatement, traversal) {
146374
+ const groupBy = loopStatement.findDirectExpression(abaplint.Expressions.LoopGroupBy);
146375
+ const collector = unique_identifier_1.UniqueIdentifier.get();
146376
+ const entry = unique_identifier_1.UniqueIdentifier.get();
146377
+ const ret = new chunk_1.Chunk();
146378
+ // the grouping, every row is read into the row target, then its key is evaluated
146379
+ const statement = new statements_1.LoopTranspiler({ groupEntry: LoopTranspiler.findGroupEntry(loopStatement) });
146380
+ ret.appendString(`const ${collector} = abap.statements.groupBy();\n`);
146381
+ ret.appendChunk(statement.transpile(loopStatement, traversal));
146382
+ ret.appendString(`\n${collector}.add(${statement.getTarget()}, ${this.groupKey(groupBy, traversal)});\n}\n`);
146383
+ let order = "";
146384
+ if (groupBy.findDirectTokenByText("ASCENDING") !== undefined) {
146385
+ order = `"ASCENDING"`;
146386
+ }
146387
+ else if (groupBy.findDirectTokenByText("DESCENDING") !== undefined) {
146388
+ order = `"DESCENDING"`;
146389
+ }
146390
+ if (order !== "" && groupBy.findDirectTokenByText("TEXT") !== undefined) {
146391
+ order += ", true";
146392
+ }
146393
+ // the group loop binds the group key, or without a group target the first row of each group
146394
+ const groupTarget = groupBy.findDirectExpression(abaplint.Expressions.LoopGroupByTarget);
146395
+ const pass = unique_identifier_1.UniqueIdentifier.get();
146396
+ ret.append(`for (const [${pass}, ${entry}] of ${collector}.getGroups(${order}).entries()) {\n`, loopStatement, traversal);
146397
+ ret.appendString(`${collector}.setTabix(${entry}, ${pass} + 1, ${groupTarget === undefined});\n`);
146398
+ let name;
146399
+ if (groupTarget !== undefined) {
146400
+ const fs = groupTarget.findDirectExpression(abaplint.Expressions.FSTarget);
146401
+ const target = groupTarget.findDirectExpression(abaplint.Expressions.Target);
146402
+ if (fs !== undefined) {
146403
+ const symbol = fs.findFirstExpression(abaplint.Expressions.FieldSymbol);
146404
+ ret.appendString(`${traversal.traverse(symbol).getCode()}.assign(${entry}.key);\n`);
146405
+ name = LoopTranspiler.targetName(fs);
146406
+ }
146407
+ else {
146408
+ const field = target?.getFirstChild()?.get() instanceof abaplint.Expressions.InlineData
146409
+ ? target.findFirstExpression(abaplint.Expressions.TargetField)
146410
+ : target;
146411
+ const code = traversal.traverse(field).getCode();
146412
+ const reference = groupTarget.findDirectTokenByText("REFERENCE") !== undefined;
146413
+ ret.appendString(reference ? `${code}.assign(${entry}.key);\n` : `${code}.set(${entry}.key);\n`);
146414
+ name = LoopTranspiler.targetName(target);
146415
+ }
146416
+ }
146417
+ else {
146418
+ ret.appendString(`const ${statement.getTarget()} = ${entry}.representative;\n`);
146419
+ ret.appendString(statement.getTargetCode() + "\n");
146420
+ const rowTarget = loopStatement.findDirectExpression(abaplint.Expressions.LoopTarget);
146421
+ name = LoopTranspiler.targetName(rowTarget?.findDirectExpression(abaplint.Expressions.FSTarget)
146422
+ ?? rowTarget?.findDirectExpression(abaplint.Expressions.Target));
146423
+ }
146424
+ groupLoops.push({ name: name ?? "", entry });
146425
+ try {
146426
+ for (const c of node.findDirectStructure(abaplint.Structures.Body)?.getChildren() || []) {
146427
+ ret.appendChunk(traversal.traverse(c));
146428
+ }
146429
+ }
146430
+ finally {
146431
+ groupLoops.pop();
146432
+ }
146433
+ const endLoop = node.findDirectStatement(abaplint.Statements.EndLoop);
146434
+ ret.append("}", endLoop ?? loopStatement, traversal);
146435
+ return ret;
146436
+ }
144436
146437
  transpile(node, traversal) {
146438
+ const loopHead = node.findDirectStatement(abaplint.Statements.Loop);
146439
+ if (loopHead?.findDirectExpression(abaplint.Expressions.LoopGroupBy) !== undefined) {
146440
+ return this.transpileGroupBy(node, loopHead, traversal);
146441
+ }
144437
146442
  const ret = new chunk_1.Chunk();
144438
146443
  let pre = "";
144439
146444
  let atFirst = undefined;
@@ -144457,9 +146462,7 @@ class LoopTranspiler {
144457
146462
  atLastFlag = unique_identifier_1.UniqueIdentifier.get();
144458
146463
  ret.appendString(`let ${atLastFlag} = false;\n`);
144459
146464
  }
144460
- if (node.findDirectStatement(abaplint.Statements.Loop)?.findDirectTokenByText("GROUP") !== undefined) {
144461
- return new chunk_1.Chunk(`throw new Error("transpiler todo, GROUP BY");`);
144462
- }
146465
+ const groupEntry = loopHead === undefined ? undefined : LoopTranspiler.findGroupEntry(loopHead);
144463
146466
  for (const c of node.getChildren()) {
144464
146467
  if (c instanceof abaplint.Nodes.StructureNode && c.get() instanceof abaplint.Structures.Body) {
144465
146468
  for (const b of c.getChildren()) {
@@ -144495,7 +146498,7 @@ class LoopTranspiler {
144495
146498
  ret.appendString(`let ${previous} = undefined;\n`);
144496
146499
  ret.appendString(`let ${tabix} = undefined;\n`);
144497
146500
  }
144498
- const loop = new statements_1.LoopTranspiler({ atLast: atLastFlag || undefined });
146501
+ const loop = new statements_1.LoopTranspiler({ atLast: atLastFlag || undefined, groupEntry });
144499
146502
  // LoopStatementTranspiler maps its own head, so no ensureStartMapping needed here
144500
146503
  ret.appendChunk(loop.transpile(c, traversal));
144501
146504
  ret.appendString("\n");
@@ -151386,7 +153389,7 @@ module.exports = require("url");
151386
153389
 
151387
153390
  "use strict";
151388
153391
  var C=(r,t)=>()=>{try{return t||r((t={exports:{}}).exports,t),t.exports}catch(e){throw t=0,e}};var ms=C(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.range=tt.balanced=void 0;var Ei=(r,t,e)=>{let s=r instanceof RegExp?ps(r,e):r,i=t instanceof RegExp?ps(t,e):t,n=s!==null&&i!=null&&(0,tt.range)(s,i,e);return n&&{start:n[0],end:n[1],pre:e.slice(0,n[0]),body:e.slice(n[0]+s.length,n[1]),post:e.slice(n[1]+i.length)}};tt.balanced=Ei;var ps=(r,t)=>{let e=t.match(r);return e?e[0]:null},Oi=(r,t,e)=>{let s,i,n,o,h,a=e.indexOf(r),l=e.indexOf(t,a+1),c=a;if(a>=0&&l>0){if(r===t)return[a,l];for(s=[],n=e.length;c>=0&&!h;){if(c===a)s.push(c),a=e.indexOf(r,c+1);else if(s.length===1){let u=s.pop();u!==void 0&&(h=[u,l])}else i=s.pop(),i!==void 0&&i<n&&(n=i,o=l),l=e.indexOf(t,c+1);c=a<l&&a>=0?a:l}s.length&&o!==void 0&&(h=[n,o])}return h};tt.range=Oi});var vs=C(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.EXPANSION_MAX_REWRITES=T.EXPANSION_MAX_DEPTH=T.EXPANSION_MAX_LENGTH=T.EXPANSION_MAX=void 0;T.expand=Wi;var gs=ms(),ws="\0SLASH"+Math.random()+"\0",bs="\0OPEN"+Math.random()+"\0",xe="\0CLOSE"+Math.random()+"\0",ys="\0COMMA"+Math.random()+"\0",Ss="\0PERIOD"+Math.random()+"\0",xi=new RegExp(ws,"g"),Ci=new RegExp(bs,"g"),Mi=new RegExp(xe,"g"),ki=new RegExp(ys,"g"),Ai=new RegExp(Ss,"g"),Ri=/\\\\/g,Pi=/\\{/g,Ti=/\\}/g,Fi=/\\,/g,ji=/\\\./g;T.EXPANSION_MAX=1e5;T.EXPANSION_MAX_LENGTH=4e6;T.EXPANSION_MAX_DEPTH=1e3;T.EXPANSION_MAX_REWRITES=1e3;function _e(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function Ni(r){return r.replace(Ri,ws).replace(Pi,bs).replace(Ti,xe).replace(Fi,ys).replace(ji,Ss)}function Di(r){return r.replace(xi,"\\").replace(Ci,"{").replace(Mi,"}").replace(ki,",").replace(Ai,".")}function Ee(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}function Li(r){let t=[],e="";for(;;){let s=(0,gs.balanced)("{","}",r);if(!s){let a=r.split(",");return a[0]=e+a[0],Ee(t,a),t}let{pre:i,body:n,post:o}=s,h=i.split(",");if(h[0]=e+h[0],h[h.length-1]+="{"+n+"}",!o.length)return Ee(t,h),t;e=h.pop(),Ee(t,h),r=o}}function Wi(r,t={}){if(!r)return[];let{max:e=T.EXPANSION_MAX,maxLength:s=T.EXPANSION_MAX_LENGTH,maxDepth:i=T.EXPANSION_MAX_DEPTH,maxRewrites:n=T.EXPANSION_MAX_REWRITES}=t;return r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),Oe(Ni(r),e,s,i,0,n,!0).map(Di)}function zi(r){return"{"+r+"}"}function Bi(r){return/^-?0\d/.test(r)}function Gi(r,t){return r<=t}function Ii(r,t){return r>=t}function ct(r,t,e,s,i,n){let o=[],h=0;for(let a=0;a<r.length;a++)for(let l=0;l<e.length;l++){if(o.length>=s)return o;let c=r[a]+t+e[l];if(!(n&&!c)){if(h+c.length>i)return o;o.push(c),h+=c.length}}return o}function $i(r,t,e,s){let i=r.split(/\.\./),n=[];if(i[0]===void 0||i[1]===void 0)return n;let o=_e(i[0]),h=_e(i[1]),a=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(_e(i[2])),1):1,c=Gi;h<o&&(l*=-1,c=Ii);let f=i.some(Bi),p=0;for(let g=o;c(g,h)&&n.length<e;g+=l){let d;if(t)d=String.fromCharCode(g),d==="\\"&&(d="");else if(d=String(g),f){let b=a-d.length;if(b>0){let m=new Array(b+1).join("0");g<0?d="-"+m+d.slice(1):d=m+d}}if(p+d.length>s)break;n.push(d),p+=d.length}return n}function Oe(r,t,e,s,i,n,o){if(i>s)return[r];let h=[""],a=0,l=!1,c=!0;for(;;){let u=(0,gs.balanced)("{","}",r);if(!u)return ct(h,r,[""],t,e,l);let f=u.pre;if(/\$$/.test(f)){if(h=ct(h,f+"{"+u.body+"}",[""],t,e,l&&!u.post.length),c=!1,!u.post.length)break;r=u.post;continue}let p=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(u.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(u.body),d=p||g,b=u.body.indexOf(",")>=0;if(!d&&!b){if(a<n&&u.post.match(/,(?!,).*\}/)){a++,r=u.pre+"{"+u.body+xe+u.post,o=!0;continue}return ct(h,f+"{"+u.body+"}"+u.post,[""],t,e,l)}c&&(l=o&&!d,c=!1);let m;if(d)m=$i(u.body,g,t,e);else{let y=Li(u.body);if(y.length===1&&y[0]!==void 0&&(y=Oe(y[0],t,e,s,i+1,n,!1).map(zi),y.length===1)){if(h=ct(h,f+y[0],[""],t,e,l&&!u.post.length),!u.post.length)break;r=u.post;continue}let _=l&&!u.post.length&&!f;for(let S=0;_&&S<h.length;S++)h[S]&&(_=!1);m=[];let v=0;t:for(let S=0;S<y.length;S++){let K=Oe(y[S],t,e,s,i+1,n,!1);for(let B=0;B<K.length;B++){let U=K[B];if(!(_&&!U)){if(m.length>=t||v+U.length>e)break t;m.push(U),v+=U.length}}}}if(h=ct(h,f,m,t,e,l&&!u.post.length),!u.post.length)break;r=u.post}return h}});var Es=C(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.numericRange=void 0;var Me=(r,t)=>r===t?{t:"lit",ch:String(r)}:{t:"class",re:new RegExp(`^[${r}-${t}]$`)},Ce=(r,t)=>t.map(e=>[Me(r,r),...e]),ut=(r,t)=>{if(!r)return[[]];let e=+r[0],s=+t[0],i=r.slice(1),n=t.slice(1);if(e===s)return Ce(e,ut(i,n));let o="0".repeat(i.length),h="9".repeat(i.length),a=[];i!==o&&a.push(...Ce(e++,ut(i,h)));let l=n===h?[]:Ce(s--,ut(o,n));return e<=s&&a.push([Me(e,s),...Array.from(i,()=>Me(0,9))]),a.push(...l),a},_s=(r,t,e)=>{if(e)return ut(String(r).padStart(e,"0"),String(t).padStart(e,"0"));let s=[];for(let i=String(r).length;i<=String(t).length;i++){let n=Math.max(r,i===1?0:10**(i-1)),o=Math.min(t,10**i-1);s.push(...ut(String(n),String(o)))}return s},Ui=(r,t)=>{let e=Number(r),s=Number(t);if(!Number.isSafeInteger(e)||!Number.isSafeInteger(s))return;e>s&&([e,s]=[s,e]);let n=/^-?0\d/.test(r)||/^-?0\d/.test(t)?Math.max(r.length,t.length):0,o=[];if(e<0){let h=_s(Math.max(-s,1),-e,n&&n-1);o.push(...h.map(a=>[{t:"lit",ch:"-"},...a]))}return s>=0&&o.push(..._s(Math.max(e,0),s,n)),o};jt.numericRange=Ui});var Os=C(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.parseClass=void 0;var qi={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}"],"[:alpha:]":["\\p{L}\\p{Nl}"],"[:ascii:]":["\\x00-\\x7f"],"[:blank:]":["\\p{Zs}\\t"],"[:cntrl:]":["\\p{Cc}"],"[:digit:]":["\\p{Nd}"],"[:graph:]":["\\p{Z}\\p{C}",!0],"[:lower:]":["\\p{Ll}"],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}\\p{S}"],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f"],"[:upper:]":["\\p{Lu}"],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}"],"[:xdigit:]":["A-Fa-f0-9"]},ft=r=>r.replace(/[[\]\\-]/g,"\\$&"),ke=/$./,Hi=(r,t,e=!1,s)=>{let i=m=>{let y=s?m.normalize(s):m;return[...y].length===1?y:m},n=t;if(r.charAt(n)!=="[")throw new Error("not in a brace expression");let o=[],h=[],a=n+1,l=!1,c=!1,u=!1,f=n,p="";t:for(;a<r.length;){let m=String.fromCodePoint(r.codePointAt(a));if((m==="!"||m==="^")&&a===n+1){u=!0,a++;continue}if(m==="]"&&l&&!c){f=a+1;break}if(l=!0,m==="\\"&&!c){c=!0,a++;continue}if(m==="["&&!c){for(let[_,[v,S]]of Object.entries(qi))if(r.startsWith(_,a)){if(p)return[ke,r.length-n];a+=_.length,S?h.push(v):o.push(v);continue t}}c=!1;let y=i(m);if(p){y.codePointAt(0)>p.codePointAt(0)?o.push(ft(p)+"-"+ft(y)):y===p&&o.push(ft(y)),p="",a+=m.length;continue}if(r.startsWith("-]",a+m.length)){o.push(ft(y+"-")),a+=m.length+1;continue}if(r.startsWith("-",a+m.length)){p=y,a+=m.length+1;continue}o.push(ft(y)),a+=m.length}if(f<a)return[ke,0];if(!o.length&&!h.length)return[ke,r.length-n];let g="["+(u?"^":"")+o.join("")+"]",d="["+(u?"":"^")+h.join("")+"]",b="^"+(o.length&&h.length?"("+g+"|"+d+")":o.length?g:d);return[new RegExp(b,e?"iu":"u"),f-n]};Nt.parseClass=Hi});var Ns=C(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.Matcher=void 0;var Xi=Es(),Ki=Os(),Ae={t:"match",id:0},Vi="!?+*@",et=r=>({t:"lit",ch:r}),Yi=r=>r.replace(/[\\^$.*+?()[\]{}|/]/g,"\\$&"),ks=r=>new RegExp(`^${Yi(r)}$`,"iu"),Dt=new Map,As=r=>{let t=Dt.get(r);return t||(t=ks(r),Dt.size>=1e3&&Dt.clear(),Dt.set(r,t)),t},Fe=(r,t)=>{if(t===r.ch)return!0;if(!r.re)return!1;let e=t.charCodeAt(0);if(e>=128)return r.re.test(t);let s=r.ascii??=new Uint8Array(128);return s[e]||=r.re.test(t)?1:2,s[e]===1},Ji=(r,t,e,s,i)=>{let n=[];for(let o=0;o<r.length;){let h=String.fromCodePoint(r.codePointAt(o));if(i){let a=h==="\\"&&r.startsWith(i,o+1)?1:0;if(a||h===i){let l=o+a+i.length,c=r.indexOf(i,l),u=/^(-?\d+)\.\.(-?\d+)$/.exec(r.slice(l,c)),f=c!==-1&&u&&(0,Xi.numericRange)(u[1],u[2]);if(f){n.push({t:"ext",type:"@",alts:f}),o=c+i.length;continue}}}if(h==="\\"){let a=r.codePointAt(o+1),l=a===void 0?h:String.fromCodePoint(a);n.push(et(l)),o+=1+l.length;continue}if(h==="["){let[a,l]=(0,Ki.parseClass)(r,o,t,s);if(l){n.push({t:"class",re:a}),o+=l;continue}}if(!e&&Vi.includes(h)&&r[o+1]==="("){n.push({t:"open",type:h}),o+=2;continue}n.push(!e&&h==="|"?{t:"bar"}:!e&&h===")"?{t:"close"}:h==="*"?{t:"star"}:h==="?"?{t:"any"}:et(h)),o+=h.length}return n},Zi=r=>{let t=new Map,e=[];return r.forEach((s,i)=>{s.t==="open"?e.push(i):s.t==="close"&&e.length&&t.set(e.pop(),i)}),t},Rs=(r,t,e,s,i)=>{let n=[],o=[n];for(let h=e;h<s;h++){let a=r[h],l=t.get(h);if(a.t==="open"&&l!==void 0){let c=Rs(r,t,h+1,l,!1);n.push({t:"ext",type:a.type,alts:c}),h=l}else a.t==="bar"&&!i?o.push(n=[]):a.t==="open"?n.push(et(a.type),et("(")):a.t==="bar"?n.push(et("|")):a.t==="close"?n.push(et(")")):n.push(a)}return o},Ps=(r,t)=>{let e=[],s="",i=()=>{for(let n of s.normalize(t))e.push(et(n));s=""};for(let n of r){if(n.t==="lit"){s+=n.ch;continue}i(),e.push(n.t==="ext"?{...n,alts:n.alts.map(o=>Ps(o,t))}:n)}return i(),e},Qi=(r,t)=>{let e=1,s=h=>({t:"split",id:e++,out:h}),i=(h,a)=>h.reduceRight((l,c)=>n(c,l),a),n=(h,a)=>{switch(h.t){case"lit":let f=t?As(h.ch):void 0;return{t:"lit",id:e++,ch:h.ch,re:f,next:a};case"any":case"star":return{t:h.t,id:e++,next:a};case"class":return{t:"class",id:e++,re:h.re,next:a}}let l=f=>h.alts.map(p=>i(p,f));switch(h.type){case"@":return s(l(a));case"?":return s([a,...l(a)]);case"!":return{t:"neg",id:e++,sub:s(l(Ae)),next:a}}let c=s([]),u=s(l(c));return c.out.push(a,u),h.type==="*"?c:u};return[i(r,Ae),e]},tn=r=>{let t=[],e=new Set,s=n=>n.t==="match"?"match":String(n.id),i=(n,o)=>{if(n.t==="match"||e.has(n))return;e.add(n);let h=a=>t.push(`${o}${n.id}: ${a}`);switch(n.t){case"split":h(`split -> ${n.out.map(s).join(", ")}`);for(let a of n.out)i(a,o);return;case"neg":return h(`!(${s(n.sub)}) -> ${s(n.next)}`),i(n.sub,o+" "),i(n.next,o);case"lit":h(`${JSON.stringify(n.ch)} -> ${s(n.next)}`);break;case"class":h(`${n.re} -> ${s(n.next)}`);break;default:h(`${n.t==="any"?"?":"*"} -> ${s(n.next)}`)}i(n.next,o)};return i(r,""),[`start -> ${s(r)}`,...t].join(`
151389
- `)},Re=class{gen;threads=[];match=!1;runs=[];ids=[];constructor(t){this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},Ts=(r,t)=>r.ids.length!==t.ids.length||r.runs.length!==t.runs.length||r.ids.some((e,s)=>e!==t.ids[s])?!1:r.runs.every(e=>t.runs.some(s=>s.neg===e.neg&&Ts(s.state,e.state))),xs=r=>({has:new Float64Array(r),seen:new Float64Array(r),gen:0}),dt=class{dots;dotStart;#t;constructor(t,e,s){this.dots=t,this.dotStart=e,this.#t=s}state(){return new Re(++this.#t.gen)}done(t){return t.ids=t.threads.map(e=>e.id).sort((e,s)=>e-s),t.match&&t.ids.unshift(Ae.id),t}#n(t,e){let{seen:s}=this.#t;return s[e.id]===t.gen?!1:(s[e.id]=t.gen,!0)}#i(t,e){let{has:s}=this.#t;return s[e.id]===t.gen?!1:(s[e.id]=t.gen,t.threads.push(e),!0)}restricted(t,e){return e&&(this.dots||this.dotStart&&t===0)}add(t,e,s,i){switch(e.t){case"split":if(!this.#n(t,e))return;for(let o of e.out)this.add(t,o,s,i);return;case"neg":if(!this.#n(t,e))return;let n=this.state();return this.add(n,e.sub,s,!1),this.done(n),this.addRun(t,{t:"run",neg:e,state:n},s,i);case"star":if(this.restricted(s,i))return;this.#i(t,e)&&this.add(t,e.next,s,i);return;case"match":t.match=!0;return;default:this.#i(t,e)}}addRun(t,e,s,i){for(let n of t.runs)if(n.neg===e.neg&&Ts(n.state,e.state))return;t.runs.push(e),e.state.match||this.add(t,e.neg.next,s,i)}step(t,e,s,i){let n=this.state();for(let o of t.threads)switch(o.t){case"lit":Fe(o,e)&&this.add(n,o.next,s+1,i);break;case"any":this.restricted(s,i)||this.add(n,o.next,s+1,i);break;case"class":!this.restricted(s,i)&&o.re.test(e)&&this.add(n,o.next,s+1,i);break;case"star":this.restricted(s,i)||this.add(n,o,s+1,i)}if(!this.restricted(s,i))for(let o of t.runs){if(o.state.dead){this.addRun(n,o,s+1,i);continue}let h=this.step(o.state,e,s,!1);this.addRun(n,{t:"run",neg:o.neg,state:h},s+1,i)}return this.done(n)}},Fs=r=>{let t=r.ids.join();if(!r.runs.length)return t;let e=r.runs.map(s=>`${s.neg.id}(${Fs(s.state)})`);return`${t}|${e.sort().join("|")}`},en=1<<18,Pe=class{#t;#n=new Map;#i=0;#o;#r;#d;#f;constructor(t,e){this.#t=t,this.#d=new dt(!1,!1,e),this.#f=new dt(!1,!0,e)}#u(t){return{state:t,match:t.match,dead:t.dead,next:new Map}}#h(t){let e=Fs(t),s=this.#n.get(e);if(s)return s;this.#i>en&&this.#m();let i=this.#u(t);return this.#n.set(e,i),this.#i+=e.length+1,i}#m(){this.#n.clear(),this.#i=0,this.#o=void 0,this.#r=void 0}start(t){if(t){if(this.#r)return this.#r;let s=this.#f.state();return this.#f.add(s,this.#t,0,!0),this.#r=this.#u(this.#f.done(s))}if(this.#o)return this.#o;let e=this.#d.state();return this.#d.add(e,this.#t,0,!0),this.#o=this.#h(this.#d.done(e))}next(t,e){let s=e.charCodeAt(0),i=s<128?void 0:t.next.get(e);if(i)return i;let n=t===this.#r?this.#h(this.#f.step(t.state,e,0,!0)):this.#h(this.#d.step(t.state,e,1,!0));return s<128?(t.ascii||(t.ascii=new Array(128),this.#i+=128),t.ascii[s]=n):t.next.set(e,n),this.#i++,n}},sn=r=>{let t=[];for(let e=r;e.t!=="match";e=e.next){if(e.t==="split"||e.t==="neg")return;t.push(e)}return t},nn=(r,t,e,s)=>{let i=0,n=e,o=-1,h=0;for(;n<s;){let a=r[i];if(a?.t==="star"){o=i++,h=n;continue}let l=t[n];if(a&&(a.t==="any"||a.t==="lit"&&Fe(a,l)||a.t==="class"&&a.re.test(l))){i++,n++;continue}if(o===-1)return!1;i=o+1,n=++h}for(;r[i]?.t==="star";)i++;return i===r.length},js=r=>{let t=0,e=0;for(let s of r){let[i,n]=rn(s);t+=i,e+=n}return[t,e]},rn=r=>{if(r.t==="star")return[0,1/0];if(r.t!=="ext")return[1,1];if(r.type==="!")return[0,1/0];let t=r.alts.map(js),e=Math.min(...t.map(n=>n[0])),s=Math.max(...t.map(n=>n[1])),i=s===0?0:1/0;return r.type==="@"?[e,s]:r.type==="?"?[0,s]:r.type==="*"?[0,i]:[e,i]},Cs=(r,t,e)=>{for(let s=0;s<r.length;s++)if(!Fe(r[s],t[e+s]))return!1;return!0},on=/[/\ud800-\udfff]/,hn=/[\ud800-\udfff]/,Lt=r=>hn.test(r)?[...r]:r,Ms=r=>{if(r.includes("/"))throw new Error("can only match a single path portion, got: "+r)},Te=class{pattern;options;#t;#n;#i;#o;#r;#d=!1;#f;#u;#h=!1;#m=0;#l=1/0;#a=[];#s=[];#b;#E;#y=!1;#g;#w;constructor(t,e={}){if(t.includes("/"))throw new Error("can only match a single path portion, got pattern: "+t);this.pattern=t,this.options=e;let{nocase:s=!1,noext:i=!1,normalize:n}=e;this.#w=n===!0?"NFC":n||void 0;let o=/^[?*+@]\(\)$/.test(t),h=Ji(t,s,i||o,this.#w,e.rangeMark),[a]=Rs(h,Zi(h),0,h.length,!0);this.#w&&(a=Ps(a,this.#w));let[l,c]=Qi(a,s);if(this.#t=l,this.#n=c,a.every(u=>u.t==="lit"))this.#r=a.map(u=>u.ch).join(""),this.#d=s;else{let u=g=>g.t!=="lit"?void 0:s?{ch:g.ch,re:As(g.ch)}:{ch:g.ch};for(let g of a){let d=u(g);if(!d)break;this.#a.push(d)}for(let g=a.length-1;g>=0;g--){let d=u(a[g]);if(!d)break;this.#s.unshift(d)}this.#y=!!(this.#a.length||this.#s.length),s||(this.#b=this.#a.map(g=>g.ch).join(""),this.#E=this.#s.map(g=>g.ch).join("")),this.#u=sn(this.#t)?.slice(this.#a.length,-this.#s.length||void 0),this.#h=!!this.#u?.every(g=>g.t==="star"||g.t==="any");let[f,p]=js(a);this.#m=f,this.#l=p}}test(t){return this.#w?(Ms(t),this.#p(t.normalize(this.#w))):on.test(t)?(Ms(t),this.#p(t,[...t])):this.#p(t,t)}testUnchecked(t){return this.#p(this.#w?t.normalize(this.#w):t)}#p(t,e){if(this.#r!==void 0)return this.#d?(this.#f??=ks(this.#r)).test(t):t===this.#r;let s=this.#m,i=this.#l;if(e===void 0){let c=t.length,u=c+1>>1;if(c<s||u>i)return!1;(u<s||c>i)&&(e=Lt(t))}if(e!==void 0&&(e.length<s||e.length>i))return!1;let n=this.#a.length;if(this.#y)if(this.#b!==void 0&&this.#E!==void 0){if(!t.startsWith(this.#b)||!t.endsWith(this.#E))return!1}else{e??=Lt(t);let c=e.length-this.#s.length;if(!Cs(this.#a,e,0)||!Cs(this.#s,e,c))return!1}let o=!this.options.dot&&t.startsWith(".");if(this.#u){if(t==="."||t===".."||o&&!n)return!1;if(this.#h)return!0;e??=Lt(t);let c=e.length-this.#s.length;return nn(this.#u,e,n,c)}if(e??=Lt(t),t==="."||t===".."){this.#i??=xs(this.#n);let c=this.#o??=new dt(!0,!1,this.#i),u=c.state();c.add(u,this.#t,0,!0);let f=c.done(u);for(let p=0;p<e.length;p++)f=c.step(f,e[p],p,!0);return f.match}this.#i??=xs(this.#n);let h=this.#g??=new Pe(this.#t,this.#i),a=h.start(o),l=e===t;for(let c=0;c<e.length;c++){if(a.dead)return!1;let u=l?t.charCodeAt(c):e[c].charCodeAt(0);a=a.ascii?.[u]??h.next(a,e[c])}return a.match}toString(){return tn(this.#t)}};Wt.Matcher=Te});var Ds=C(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.assertValidPattern=void 0;var an=1024*64,ln=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>an)throw new TypeError("pattern is too long")};zt.assertValidPattern=ln});var je=C(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.escape=void 0;var cn=(r,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):t?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");Bt.escape=cn});var Ne=C(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.unescape=void 0;var un=(r,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");Gt.unescape=un});var Y=C(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.unescape=w.escape=w.Minimatch=w.match=w.braceExpand=w.defaults=w.filter=w.GLOBSTAR=w.sep=w.minimatch=void 0;var fn=vs(),Ls=Ns(),Ut=Ds(),dn=je(),pn=Ne(),mn=(r,t,e={})=>((0,Ut.assertValidPattern)(t),!e.nocomment&&t.charAt(0)==="#"?!1:wn(t,e).match(r));w.minimatch=mn;var ot=new Map,gn=256,wn=(r,t)=>{let e=r+"\0"+JSON.stringify(t),s=ot.get(e);return s?ot.delete(e):(s=new ht(r,{...t}),ot.size>=gn&&ot.delete(ot.keys().next().value)),ot.set(e,s),s},$s=typeof process=="object"&&process?process.env?.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ws={win32:{sep:"\\"},posix:{sep:"/"}};w.sep=$s==="win32"?Ws.win32.sep:Ws.posix.sep;w.minimatch.sep=w.sep;w.GLOBSTAR=Symbol("globstar **");w.minimatch.GLOBSTAR=w.GLOBSTAR;var bn=(r,t={})=>e=>(0,w.minimatch)(e,r,t);w.filter=bn;w.minimatch.filter=w.filter;var q=(r,t={})=>Object.assign({},r,t),yn=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return w.minimatch;let t=w.minimatch;return Object.assign((s,i,n={})=>t(s,i,q(r,n)),{Minimatch:class extends t.Minimatch{constructor(i,n={}){super(i,q(r,n))}static defaults(i){return t.defaults(q(r,i)).Minimatch}},unescape:(s,i={})=>t.unescape(s,q(r,i)),escape:(s,i={})=>t.escape(s,q(r,i)),filter:(s,i={})=>t.filter(s,q(r,i)),defaults:s=>t.defaults(q(r,s)),braceExpand:(s,i={})=>t.braceExpand(s,q(r,i)),match:(s,i,n={})=>t.match(s,i,q(r,n)),sep:t.sep,GLOBSTAR:w.GLOBSTAR})};w.defaults=yn;w.minimatch.defaults=w.defaults;var Sn=(r,t={})=>((0,Ut.assertValidPattern)(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,fn.expand)(r,{max:t.braceExpandMax}));w.braceExpand=Sn;w.minimatch.braceExpand=w.braceExpand;var vn=100,_n=/(?<![\\$])\{(-?\d+)\.\.(-?\d+)\}/g,En=(r,t,e={})=>{let s=new ht(t,e);return r=r.filter(i=>s.match(i)),s.options.nonull&&!r.length&&r.push(t),r};w.match=En;w.minimatch.match=w.match;var zs=/[?*]|[+@!]\(.*?\)|\[|\]/,Us=(r,t)=>{let e=t+1;(r.charAt(e)==="!"||r.charAt(e)==="^")&&e++;let s=!1;for(;e<r.length;e++){let i=r.charAt(e);if(i==="]"&&s)return e;s=!0,i==="\\"&&e++}return-1},On=(r,t)=>{if(!t&&(r==="+()"||r==="@()"))return r;let e="";for(let s=0;s<r.length;s++){let i=r.charAt(s);if(i==="\\")e+=r.charAt(++s)||i;else{if(i==="*"||i==="?")return;if(i==="["){let n=Us(r,s);if(n===-1){e+=i;continue}let o=r.slice(s+1,n);if(o.startsWith("\\")&&(o=o.slice(1)),[...o].length!==1||"!^".includes(r.charAt(s+1)))return;e+=o,s=n}else{if(!t&&"+@!".includes(i)&&r.charAt(s+1)==="("&&r.includes(")",s+2))return;e+=i}}}return e},xn=r=>{if(/^[?*+@]\(\)$/.test(r)||r.includes("[:"))return!1;let t=0;for(let e=0;e<r.length;e++){let s=r.charAt(e);if(s==="\\"){if(++e===r.length)return!1}else if(s==="["){let i=Us(r,e);i!==-1&&(e=i)}else if("+@!?*".includes(s)&&r.charAt(e+1)==="(")t++,e++;else if(s===")"){if(!t--)return!1}else if(s==="|"&&!t)return!1}return!t},De,Bs,V=(r,t)=>typeof r=="string"?t===r:t!==""&&r.testUnchecked(t),Gs=(r,t,e,s,i)=>V(r,t)?e:s!==void 0&&V(r,s)?i:-1,Be=r=>r==="."||r==="..",Le=r=>typeof r=="string"&&/^[a-z]:$/i.test(r),$t=r=>typeof r=="string"&&/^unc$/i.test(r),We=r=>{if(r[0]!==""||r[1]!=="")return-1;let t=r[2]!=="?"?2:$t(r[3])?4:-1,e=r[t],s=r[t+1];return t!==-1&&e!==void 0&&e!==""&&e!==w.GLOBSTAR&&s!==void 0&&s!==""&&s!==w.GLOBSTAR?t:-1},It=(r,t)=>!Be(r)&&(t||!r.startsWith(".")),pt=(r,t,e,s,i)=>{for(let n=t;n<e;){if(r.charCodeAt(n)===46){if(!s)return!0;let h=r.charCodeAt(n+1)===46?n+2:n+1;if(h>=e||qt(r.charCodeAt(h),i))return!0}let o=Ge(r,n,i);if(o===-1)return!1;for(n=o+1;n<e&&qt(r.charCodeAt(n),i);)n++}return!1},qt=(r,t)=>t==="/"?r===47:t==="\\"?r===92:r===47||r===92,Ge=(r,t,e)=>{if(e!=="both")return r.indexOf(e,t);let s=r.indexOf("/",t),i=r.indexOf("\\",t);return s===-1?i:i===-1?s:Math.min(s,i)},Is=(r,t,e)=>e!=="both"?r.lastIndexOf(e,t):Math.max(r.lastIndexOf("/",t),r.lastIndexOf("\\",t)),ze={},ht=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;#t;#n;#i;#o;#r=[];#d=[];#f=[];#u=new Map;#h=!1;#m;#l=new WeakMap;constructor(t,e={}){(0,Ut.assertValidPattern)(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||$s,this.isWindows=this.platform==="win32";let s="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.#t=!this.preserveMultipleSlashes,this.#i=(e.optimizationLevel??1)>=2;let i=e.normalize;this.#o=i===!0?"NFC":i||void 0,this.make();let n=this.set.map(o=>this.#s(o));this.#f=this.set.map((o,h)=>this.#t&&o.length-1>n[h]),this.#r=this.set.map((o,h)=>{let a=this.#f[h]?o.length-1:o.length,l=o.slice(n[h]+1,a).filter(c=>typeof c=="string"&&!!c);return[...new Set(l)]}),this.#n=this.#r.some(o=>o.length),this.#d=this.set.map((o,h)=>{let[a,l,c]=o;if(this.#f[h]&&o.length===2&&a===w.GLOBSTAR&&l!==w.GLOBSTAR)return"tail";if(this.#f[h]&&e.matchBase&&o.length===1&&a!==w.GLOBSTAR&&a!=="")return"base";if(!(!this.#t||n[h]!==-1)){if(o.length===3&&a===w.GLOBSTAR&&c===w.GLOBSTAR&&l!==w.GLOBSTAR&&l!==""&&this.maxGlobstarRecursion>0)return"mid";if(o.length===2&&l===w.GLOBSTAR&&a!==w.GLOBSTAR&&a!=="")return"head"}})}#a(t){return this.#o?t.normalize(this.#o):t}#s(t){if(!this.isWindows)return-1;if(Le(t[0]))return 0;if(t[0]===""&&t[1]===""&&t[2]==="?"&&Le(t[3]))return 3;let s=We(t);return s===-1?-1:s+1}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.#M())];let s=this.globSet.map(n=>this.#e(n));this.globParts=this.preprocess(s),this.#h=!0;let i=this.globParts.map((n,o,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=n[2]==="?"&&$t(n[3])?6:4,l=n[0]===""&&n[1]===""&&(n[2]==="?"||!zs.test(n[2]))&&n.slice(3,a).every(u=>!zs.test(u)),c=/^[a-z]:/i.test(n[0]);if(l)return[...n.slice(0,a).map(u=>this.#a(u)),...n.slice(a).map(u=>this.parse(u))];if(c)return[this.#a(n[0]),...n.slice(1).map(u=>this.parse(u))]}return n.map(a=>this.parse(a))});if(this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let o=this.set[n];o[0]===""&&o[1]===""&&this.globParts[n][2]==="?"&&(Le(o[3])||$t(this.globParts[n][3]))&&($t(this.globParts[n][3])&&(o[3]="UNC"),o[2]="?")}e.noext||this.mergeRows(),this.#h=!1,this.set.forEach((n,o)=>{for(let h=0;h<n.length;h++)n[h]===ze&&(n[h]=this.parse(this.globParts[o][h]))})}mergeRows(){let t=!0;for(;t;){t=!1;let e=Math.max(0,...this.set.map(s=>s.length));for(let s=0;s<e;s++){let i=new Map;this.set.forEach((o,h)=>{if(!(o[s]instanceof Ls.Matcher||o[s]===ze)||!xn(this.globParts[h][s]))return;let a=[...this.globParts[h]];a[s]="";let l=`${o.length}/${a.join("/")}`,c=i.get(l);c?c.push(h):i.set(l,[h])});let n=new Set;for(let o of i.values()){if(o.length<2)continue;let[h,...a]=o,c=`@(${o.map(u=>this.globParts[u][s]).join("|")})`;this.globParts[h][s]=c,this.set[h][s]=this.parse(c);for(let u of a)n.add(u)}n.size&&(t=!0,this.set=this.set.filter((o,h)=>!n.has(h)),this.globParts=this.globParts.filter((o,h)=>!n.has(h)))}}}preprocess(t){if(this.options.noglobstar)for(let s of t)for(let i=0;i<s.length;i++)s[i]==="**"&&(s[i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let i=s;for(;e[i+1]==="**";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(t){return t.map(e=>{let s=this.#s(e)+1;return e=e.reduce((i,n)=>{let o=i[i.length-1];return n==="**"&&o==="**"?i:n===".."&&i.length>s&&o&&o!==".."&&o!=="."&&o!=="**"?(i.pop(),i):(i.push(n),i)},[]),e.length===0?[""]:e})}#b(t){let e=!this.isWindows||!t.includes("\\")?"/":t.includes("/")?"both":"\\",s=this.#t?0:-1,i="",n=0,o,h=0,a=!!this.options.dot;t:for(let l=0;l<this.set.length;l++){let c=this.set[l],u=c[c.length-1],f=s!==-1&&this.#f[l]&&u!==w.GLOBSTAR;if(f&&s===0){let d=Is(t,t.length,e);if(n=d+1,i=t.slice(n),i===""&&d>=0){let m=d;for(;m>0&&qt(t.charCodeAt(m-1),e);)m--;h=m===0?0:Is(t,m-1,e)+1,o=t.slice(h,m)}let b=this.#i&&(Be(i)||i===""&&o!==void 0&&Be(o));s=b?-1:1,f=!b}let p=-1;if(f&&typeof u=="string"&&(p=Gs(u,i,n,o,h),p===-1))continue;if(this.#n){for(let d of this.#r[l])if(!t.includes(d))continue t}if(f&&typeof u=="object"&&(p=Gs(u,i,n,o,h),p===-1))continue;let g=this.#d[l];if(g==="base"&&f)return"yes";if(g==="tail"&&f){if(this.#i&&pt(t,0,p,!0,e))return"maybe";if(!pt(t,0,p,a,e))return"yes";continue}if(g==="mid"||g==="head"){let d=this.#y(t,c,g==="head",a,e);if(d!=="no")return d;continue}return"maybe"}return"no"}#E(t,e,s){let i=!!this.options.dot,n=t.length;if(s==="head"){if(n<2||!V(e[0],t[0]))return!1;for(let h=1;h<n;h++)if(!It(t[h],i))return!1;return!0}let o=e[1];if(s==="tail"){let h=n-1;if(!V(o,t[h])&&(t[h]!==""||n===1||!V(o,t[--h])))return!1;for(let a=0;a<h;a++)if(!It(t[a],i))return!1;return!0}for(let h=0;h<n;h++){if(V(o,t[h])&&h+1<n){let a=h+1;for(;a<n&&It(t[a],i);)a++;if(a===n)return!0}if(!It(t[h],i))return!1}return!1}#y(t,e,s,i,n){if(this.#i&&pt(t,0,t.length,!0,n))return"maybe";let o=e[s?0:1],h=0;for(let a=Ge(t,h,n);a!==-1;a=Ge(t,h,n)){let l=a+1;for(;l<t.length&&qt(t.charCodeAt(l),n);)l++;if((typeof o=="string"?a-h===o.length&&t.startsWith(o,h):a>h&&o.testUnchecked(t.slice(h,a)))&&!pt(t,l,t.length,i,n))return"yes";if(s||pt(t,h,l,i,n))return"no";h=l}return"no"}#g(t){let e=De;return e?.f===t&&e.isWindows===this.isWindows&&e.preserveMultipleSlashes===this.preserveMultipleSlashes&&e.normalize===this.#o?e:void 0}#w(t){let{isWindows:e,preserveMultipleSlashes:s}=this,i=this.#e(e?t.split("\\").join("/"):t),n=this.#o;return n&&(i=i.map(o=>o.normalize(n))),De={f:t,isWindows:e,preserveMultipleSlashes:s,normalize:n,parts:i},De}#p(t){let e=[...t],s=!1;do{if(s=!1,!this.preserveMultipleSlashes){for(let o=1;o<e.length-1;o++){let h=e[o];o===1&&h===""&&e[0]===""||(h==="."||h==="")&&(s=!0,e.splice(o,1),o--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(s=!0,e.pop())}let i=this.#s(e)+1,n=i;for(;(n=e.indexOf("..",n+1))!==-1;){let o=e[n-1];o&&o!=="."&&o!==".."&&o!=="**"&&(s=!0,e.splice(n-1,2),n=Math.max(n-2,i))}}while(s);return e.length===0?[""]:e}firstPhasePreProcess(t){let{braceExpandMax:e=1e5}=this.options,s=0,i=1e6,n=!1;do{n=!1;for(let o of t){let h=-1;for(;(h=o.indexOf("**",h+1))!==-1;){let c=h;for(;o[c+1]==="**";)c++;c>h&&o.splice(h+1,c-h);let u=o[h+1],f=o[h+2],p=o[h+3];if(u!==".."||!f||f==="."||f===".."||!p||p==="."||p==="..")continue;let g=o.length-1;if(t.length>=e||s+g>i)throw new RangeError("optimizationLevel 2: too many patterns from '**/..'");n=!0,o.splice(h,1);let d=o.slice(0);d[h]="**",s+=g,t.push(d),h--}if(!this.preserveMultipleSlashes){for(let c=1;c<o.length-1;c++){let u=o[c];c===1&&u===""&&o[0]===""||(u==="."||u==="")&&(n=!0,o.splice(c,1),c--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(n=!0,o.pop())}let a=this.#s(o)+1,l=a;for(;(l=o.indexOf("..",l+1))!==-1;){let c=o[l-1];if(c&&c!=="."&&c!==".."&&c!=="**"){n=!0;let f=l===1&&o[l+1]==="**"?["."]:[];o.splice(l-1,2,...f),o.length===0&&o.push(""),l=Math.max(l-2,a)}}}}while(n);return t}secondPhasePreProcess(t){let e=new Set,s=t.filter(o=>{let h=o.join("/");return e.has(h)?!1:(e.add(h),!0)}),i=new Map;for(let o of s){let h=[];for(let a=0;a<o.length;a++)o[a]==="*"&&h.push(a);h.length&&i.set(h.join(","),h)}if(!i.size||s.length*i.size>1e5)return s;let{dot:n}=this.options;return s.filter(o=>{for(let h of i.values()){if(h[h.length-1]>=o.length)continue;let a=[...o],l=!0,c=!1;for(let u of h){let f=o[u];if(f!=="*"){if(!f||f==="**"||!n&&f.startsWith(".")){l=!1;break}a[u]="*",c=!0}}if(l&&c&&e.has(a.join("/")))return!1}return!0})}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}#O(t,e,s,i){let n=0,o=0,h=this.isWindows?We(e):-1,a=h===-1?-1:We(s);if(a!==-1){let l=s[a],c=s[a+1];typeof l!="string"||typeof c!="string"?(n=h,o=a):e[h].toLowerCase()===l.toLowerCase()&&e[h+1].toLowerCase()===c.toLowerCase()&&(n=h+2,o=a+2)}else if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0]),f=!u&&s[0]===""&&s[1]===""&&s[2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3]),p=c?3:l?0:void 0,g=f?3:u?0:void 0;if(typeof p=="number"&&typeof g=="number"){let[d,b]=[t[p],s[g]];d.toLowerCase()===b.toLowerCase()&&(o=g+1,n=p+1)}}return t=e,s.includes(w.GLOBSTAR)?this.#x(t,s,i,n,o):this.#S(t,s,i,n,o)}#x(t,e,s,i,n){let{head:o,body:h,tail:a,segments:l}=this.#v(e,s,n);if(o.length){let u=i+o.length;if(!this.#S(t,o,s,i,0,u))return!1;i+=o.length,n+=o.length}let c=0;if(a.length){if(a.length+i>t.length)return!1;let u=t.length-a.length;if(this.#S(t,a,s,u,0))c=a.length;else{if(t[t.length-1]!==""||i+a.length===t.length||(u--,!this.#S(t,a,s,u,0)))return!1;c=a.length+1}}if(!h.length){let u=!!c;for(let f=i;f<t.length-c;f++){let p=String(t[f]);if(u=!0,p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return s||u}return!!this.#_(t,l,t.length-c,i,0,s,0,!!c,new Set)}#v(t,e,s){let i=this.#l.get(t);i||(i=[],this.#l.set(t,i));let n=s*2+(e?1:0),o=i[n];if(o)return o;let h=t.indexOf(w.GLOBSTAR,s),a=t.lastIndexOf(w.GLOBSTAR),l=t.slice(s,h),c=t.slice(h+1,e?void 0:a),u=e?[]:t.slice(a+1),f=[[[],0]],p=f[0],g=0,d=[0];for(let m of c)m===w.GLOBSTAR?(d.push(g),p=[[],0],f.push(p)):(p[0].push(m),g++);f.forEach((m,y)=>{m[1]=g-d[y]});let b={head:l,body:c,tail:u,segments:f};return i[n]=b,b}#_(t,e,s,i,n,o,h,a,l){let c=e[n];if(!c){if(o)return i>=s||i===s-1&&t[i]==="";for(let g=i;g<s;g++){a=!0;let d=t[g];if(d==="."||d===".."||!this.options.dot&&d.startsWith("."))return!1}return a}let[u,f]=c,p=o?s:s-f;for(;i<=p;){let g=n*(t.length+1)+i;if(l.has(g))return!1;if(l.add(g),this.#S(t,u,o,i,0,i+u.length)&&h<this.maxGlobstarRecursion){let m=this.#_(t,e,s,i+u.length,n+1,o,h+1,a,l);if(m!==!1)return m}if(i===p)break;let b=t[i];if(b==="."||b===".."||!this.options.dot&&b.startsWith("."))return!1;i++}return o||null}#S(t,e,s,i,n,o=t.length){let h,a,l,c;for(h=i,a=n,c=Math.min(o,t.length),l=e.length;h<c&&a<l;h++,a++){let u=e[a],f=t[h];if(u===!1||u===w.GLOBSTAR||!V(u,f))return!1}if(h===c&&a===l)return!0;if(h===c)return s;if(a===l)return h===c-1&&t[h]==="";throw new Error("wtf?")}braceExpand(){return(0,w.braceExpand)(this.pattern,this.options)}#M(){let{pattern:t}=this;if(this.options.nobrace)return this.braceExpand();let e=57344;for(;t.includes(String.fromCharCode(e));)if(++e>63743)return this.braceExpand();let s=String.fromCharCode(e),i=!1,n=t.replace(_n,(h,a,l)=>{let c=Number(a),u=Number(l);return!Number.isSafeInteger(c)||!Number.isSafeInteger(u)||Math.abs(c-u)+1<vn?h:(i=!0,`${s}${a}..${l}${s}`)});if(!i)return this.braceExpand();let o=(0,w.braceExpand)(n,this.options);for(let h of o)for(let a of h.split("/")){let l=a.indexOf("[");if(l!==-1&&l<a.lastIndexOf(s))return this.braceExpand()}return this.#m=s,o}parse(t){(0,Ut.assertValidPattern)(t);let e=this.options;if(t==="**")return w.GLOBSTAR;if(t==="")return"";let{nocase:s,nocaseMagicOnly:i,noext:n=!1,dot:o,normalize:h}=e,a=this.#m,l=a&&t.includes(a)?void 0:On(t,n);if(l!==void 0&&!(s&&!i&&t.toUpperCase()!==t.toLowerCase()))return this.#a(l);if(this.#h)return ze;let c=this.#u.get(t);return c||(c=new Ls.Matcher(t,{nocase:s,noext:n,dot:o,normalize:h,...a&&{rangeMark:a}}),this.#u.set(t,c)),c}#e(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options,i=this.#g(t);if(!i){if(!e&&!this.#o&&(this.#t||this.#n)&&Bs!==t){Bs=t;let l=this.#b(t);if(l==="no")return s.flipNegate?!1:this.negate;if(l==="yes")return s.flipNegate?!0:!this.negate}i=this.#w(t)}let n=i.parts,o=this.#i?i.resolved??=this.#p(n):n,h=this.set,a=n[n.length-1];if(!a)for(let l=n.length-2;!a&&l>=0;l--)a=n[l];for(let l=0;l<h.length;l++){let c=h[l],u=e?void 0:this.#d[l];if(u==="base"?V(c[0],a):u?this.#E(o,c,u):s.matchBase&&c.length===1?this.#O([a],[a],c,e):this.#O(n,o,c,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return w.minimatch.defaults(t).Minimatch}};w.Minimatch=ht;var Cn=je();Object.defineProperty(w,"escape",{enumerable:!0,get:function(){return Cn.escape}});var Mn=Ne();Object.defineProperty(w,"unescape",{enumerable:!0,get:function(){return Mn.unescape}});w.minimatch.Minimatch=ht;w.minimatch.escape=dn.escape;w.minimatch.unescape=pn.unescape});var Ys=C(Xt=>{"use strict";var Hs=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),kn=Hs(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.tracing=r.metrics=void 0;var t=__webpack_require__(/*! node:diagnostics_channel */ "node:diagnostics_channel");r.metrics=(0,t.channel)("lru-cache:metrics"),r.tracing=(0,t.tracingChannel)("lru-cache")}),An=Hs(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.defaultPerf=void 0,r.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(Xt,"__esModule",{value:!0});Xt.LRUCache=void 0;var O=kn(),Rn=An(),Ie=()=>O.metrics.hasSubscribers||O.tracing.hasSubscribers,Xs=new Set,qs=typeof process=="object"&&process?process:{},Pn=(r,t,e,s)=>{typeof qs.emitWarning=="function"?qs.emitWarning(r,t,e,s):console.error(`[${e}] ${t}: ${r}`)},Tn=r=>!Xs.has(r),J=r=>!!r&&r===Math.floor(r)&&r>0&&isFinite(r),Ks=r=>J(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Ht:null:null,Ht=class extends Array{constructor(r){super(r),this.fill(0)}},Fn=class mt{heap;length;static#t=!1;static create(t){let e=Ks(t);if(!e)return[];mt.#t=!0;let s=new mt(t,e);return mt.#t=!1,s}constructor(t,e){if(!mt.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},jn=class Vs{#t;#n;#i;#o;#r;#d;#f;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#h;#m;#l;#a;#s;#b;#E;#y;#g;#w;#p;#O;#x;#v;#_;#S;#M;#e;#P;static unsafeExposeInternals(t){return{starts:t.#x,ttls:t.#v,autopurgeTimers:t.#_,sizes:t.#O,keyMap:t.#l,keyList:t.#a,valList:t.#s,next:t.#b,prev:t.#E,get head(){return t.#y},get tail(){return t.#g},free:t.#w,isBackgroundFetch:e=>t.#c(e),backgroundFetch:(e,s,i,n)=>t.#L(e,s,i,n),moveToTail:e=>t.#K(e),indexes:e=>t.#A(e),rindexes:e=>t.#R(e),isStale:e=>t.#C(e)}}get max(){return this.#t}get maxSize(){return this.#n}get calculatedSize(){return this.#m}get size(){return this.#h}get fetchMethod(){return this.#d}get memoMethod(){return this.#f}get dispose(){return this.#i}get onInsert(){return this.#o}get disposeAfter(){return this.#r}constructor(t){let{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:a,dispose:l,onInsert:c,disposeAfter:u,noDisposeOnSet:f,noUpdateTTL:p,maxSize:g=0,maxEntrySize:d=0,sizeCalculation:b,fetchMethod:m,memoMethod:y,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:K,ignoreFetchAbort:B,backgroundFetchSize:U=1,perf:rt}=t;if(this.backgroundFetchSize=U,rt!==void 0&&typeof rt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=rt??Rn.defaultPerf,e!==0&&!J(e))throw new TypeError("max option must be a nonnegative integer");let Se=e?Ks(e):Array;if(!Se)throw new Error("invalid max value: "+e);if(this.#t=e,this.#n=g,this.maxEntrySize=d||this.#n,this.sizeCalculation=b,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=y,m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#d=m,this.#M=!!m,this.#l=new Map,this.#a=Array.from({length:e}).fill(void 0),this.#s=Array.from({length:e}).fill(void 0),this.#b=new Se(e),this.#E=new Se(e),this.#y=0,this.#g=0,this.#w=Fn.create(e),this.#h=0,this.#m=0,typeof l=="function"&&(this.#i=l),typeof c=="function"&&(this.#o=c),typeof u=="function"?(this.#r=u,this.#p=[]):(this.#r=void 0,this.#p=void 0),this.#S=!!this.#i,this.#P=!!this.#o,this.#e=!!this.#r,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!K,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#n!==0&&!J(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!J(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#U()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=J(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!J(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(this.#t===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#n){let ve="LRU_CACHE_UNBOUNDED";Tn(ve)&&(Xs.add(ve),Pn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ve,Vs))}}getRemainingTTL(t){return this.#l.has(t)?1/0:0}#T(){let t=new Ht(this.#t),e=new Ht(this.#t);this.#v=t,this.#x=e;let s=this.ttlAutopurge?Array.from({length:this.#t}):void 0;this.#_=s,this.#z=(a,l,c=this.#u.now())=>{e[a]=l!==0?c:0,t[a]=l,i(a,l)},this.#k=a=>{e[a]=t[a]!==0?this.#u.now():0,i(a,t[a])};let i=this.ttlAutopurge?(a,l)=>{if(s?.[a]&&(clearTimeout(s[a]),s[a]=void 0),l&&l!==0&&s){let c=setTimeout(()=>{this.#C(a)?(this.#W(this.#a[a],"expire"),s[a]=void 0):i(a,h(a))},l+1);c.unref&&c.unref(),s[a]=c}}:()=>{};this.#F=(a,l)=>{if(t[l]){let c=t[l],u=e[l];if(!c||!u)return;a.ttl=c,a.start=u,a.now=n||o();let f=a.now-u;a.remainingTTL=c-f}};let n=0,o=()=>{let a=this.#u.now();if(this.ttlResolution>0){n=a;let l=setTimeout(()=>n=0,this.ttlResolution);l.unref&&l.unref()}return a};this.getRemainingTTL=a=>{let l=this.#l.get(a);return l===void 0?0:h(l)};let h=a=>{let l=t[a],c=e[a];if(!l||!c)return 1/0;let u=(n||o())-c;return l-u};this.#C=a=>{let l=e[a],c=t[a];return!!c&&!!l&&(n||o())-l>c}}#k=()=>{};#F=()=>{};#z=()=>{};#C=()=>!1;#U(){let t=new Ht(this.#t);this.#m=0,this.#O=t,this.#N=e=>{this.#m-=t[e],t[e]=0},this.#B=(e,s,i,n)=>{if(!J(i)){if(this.#c(s))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(s,e),!J(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#j=(e,s,i)=>{if(t[e]=s,this.#n){let n=this.#n-t[e];for(;this.#m>n;)this.#$(!0)}this.#m+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#m)}}#N=t=>{};#j=(t,e,s)=>{};#B=(t,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#g;this.#G(e)&&((t||!this.#C(e))&&(yield e),e!==this.#y);)e=this.#E[e]}*#R({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#y;this.#G(e)&&((t||!this.#C(e))&&(yield e),e!==this.#g);)e=this.#b[e]}#G(t){return t!==void 0&&this.#l.get(this.#a[t])===t}*entries(){for(let t of this.#A())this.#s[t]!==void 0&&this.#a[t]!==void 0&&!this.#c(this.#s[t])&&(yield[this.#a[t],this.#s[t]])}*rentries(){for(let t of this.#R())this.#s[t]!==void 0&&this.#a[t]!==void 0&&!this.#c(this.#s[t])&&(yield[this.#a[t],this.#s[t]])}*keys(){for(let t of this.#A()){let e=this.#a[t];e!==void 0&&!this.#c(this.#s[t])&&(yield e)}}*rkeys(){for(let t of this.#R()){let e=this.#a[t];e!==void 0&&!this.#c(this.#s[t])&&(yield e)}}*values(){for(let t of this.#A())this.#s[t]!==void 0&&!this.#c(this.#s[t])&&(yield this.#s[t])}*rvalues(){for(let t of this.#R())this.#s[t]!==void 0&&!this.#c(this.#s[t])&&(yield this.#s[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#A()){let i=this.#s[s],n=this.#c(i)?i.__staleWhileFetching:i;if(n!==void 0&&t(n,this.#a[s],this))return this.#X(this.#a[s],e)}}forEach(t,e=this){for(let s of this.#A()){let i=this.#s[s],n=this.#c(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#a[s],this)}}rforEach(t,e=this){for(let s of this.#R()){let i=this.#s[s],n=this.#c(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#a[s],this)}}purgeStale(){let t=!1;for(let e of this.#R({allowStale:!0}))this.#C(e)&&(this.#W(this.#a[e],"expire"),t=!0);return t}info(t){let e=this.#l.get(t);if(e===void 0)return;let s=this.#s[e],i=this.#c(s)?s.__staleWhileFetching:s;if(i===void 0)return;let n={value:i};if(this.#v&&this.#x){let o=this.#v[e],h=this.#x[e];if(o&&h){let a=o-(this.#u.now()-h);n.ttl=a,n.start=Date.now()}}return this.#O&&(n.size=this.#O[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let s=this.#a[e],i=this.#s[e],n=this.#c(i)?i.__staleWhileFetching:i;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#v&&this.#x){o.ttl=this.#v[e];let h=this.#u.now()-this.#x[e];o.start=Math.floor(Date.now()-h)}this.#O&&(o.size=this.#O[e]),t.unshift([s,o])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let i=Date.now()-s.start;s.start=this.#u.now()-i}this.#D(e,s.value,s)}}set(t,e,s={}){let{status:i=O.metrics.hasSubscribers?{}:void 0}=s;s.status=i,i&&(i.op="set",i.key=t,e!==void 0&&(i.value=e),i.cache=this);let n=this.#D(t,e,s);return i&&O.metrics.hasSubscribers&&O.metrics.publish(i),n}#D(t,e,s,i){let{ttl:n=this.ttl,start:o,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=s,c=this.#c(e);if(e===void 0)return l&&(l.set="deleted"),this.delete(t),this;let{noUpdateTTL:u=this.noUpdateTTL}=s;l&&!c&&(l.value=e);let f=this.#B(t,e,s.size||0,a,l);if(this.maxEntrySize&&f>this.maxEntrySize)return this.#W(t,"set"),l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this;let p=this.#h===0?void 0:this.#l.get(t);if(p===void 0)p=this.#h===0?this.#g:this.#w.length!==0?this.#w.pop():this.#h===this.#t?this.#$(!1):this.#h,this.#a[p]=t,this.#s[p]=e,this.#l.set(t,p),this.#b[this.#g]=p,this.#E[p]=this.#g,this.#g=p,this.#h++,this.#j(p,f,l),l&&(l.set="add"),u=!1,this.#P&&!c&&this.#o?.(e,t,"add");else{this.#K(p);let g=this.#s[p];if(e!==g){if(!h)if(this.#c(g)){g!==i&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=g;d!==void 0&&d!==e&&(this.#S&&this.#i?.(d,t,"set"),this.#e&&this.#p?.push([d,t,"set"]))}else this.#S&&this.#i?.(g,t,"set"),this.#e&&this.#p?.push([g,t,"set"]);if(this.#N(p),this.#j(p,f,l),this.#s[p]=e,!c){let d=g&&this.#c(g)?g.__staleWhileFetching:g,b=d===void 0?"add":e!==d?"replace":"update";l&&(l.set=b,d!==void 0&&(l.oldValue=d)),this.#P&&this.onInsert?.(e,t,b)}}else c||(l&&(l.set="update"),this.#P&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#v&&this.#T(),this.#v&&(u||this.#z(p,n,o),l&&this.#F(l,p)),!h&&this.#e&&this.#p){let g=this.#p,d;for(;d=g?.shift();)this.#r?.(...d)}return this}pop(){try{for(;this.#h;){let t=this.#s[this.#y];if(this.#$(!0),this.#c(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#e&&this.#p){let t=this.#p,e;for(;e=t?.shift();)this.#r?.(...e)}}}#$(t){let e=this.#y,s=this.#a[e],i=this.#s[e],n=this.#c(i);n&&i.__abortController.abort(new Error("evicted"));let o=n?i.__staleWhileFetching:i;return(this.#S||this.#e)&&o!==void 0&&(this.#S&&this.#i?.(o,s,"evict"),this.#e&&this.#p?.push([o,s,"evict"])),this.#N(e),this.#_?.[e]&&(clearTimeout(this.#_[e]),this.#_[e]=void 0),t&&(this.#a[e]=void 0,this.#s[e]=void 0,this.#w.push(e)),this.#h===1?(this.#y=this.#g=0,this.#w.length=0):this.#y=this.#b[e],this.#l.delete(s),this.#h--,e}has(t,e={}){let{status:s=O.metrics.hasSubscribers?{}:void 0}=e;e.status=s,s&&(s.op="has",s.key=t,s.cache=this);let i=this.#V(t,e);return O.metrics.hasSubscribers&&O.metrics.publish(s),i}#V(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,n=this.#l.get(t);if(n!==void 0){let o=this.#s[n];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#C(n))i&&(i.has="stale",this.#F(i,n));else return s&&this.#k(n),i&&(i.has="hit",this.#F(i,n)),!0}else i&&(i.has="miss");return!1}peek(t,e={}){let{status:s=Ie()?{}:void 0}=e;s&&(s.op="peek",s.key=t,s.cache=this),e.status=s;let i=this.#q(t,e);return O.metrics.hasSubscribers&&O.metrics.publish(s),i}#q(t,e){let{status:s,allowStale:i=this.allowStale}=e,n=this.#l.get(t);if(n===void 0||!i&&this.#C(n)){s&&(s.peek=n===void 0?"miss":"stale");return}let o=this.#s[n],h=this.#c(o)?o.__staleWhileFetching:o;return s&&(h!==void 0?(s.peek="hit",s.value=h):s.peek="miss"),h}#L(t,e,s,i){let n=e===void 0?void 0:this.#s[e];if(this.#c(n))return n;let o=new AbortController,{signal:h}=s;h?.addEventListener("abort",()=>o.abort(h.reason),{signal:o.signal});let a={signal:o.signal,options:s,context:i},l=(d,b=!1)=>{let{aborted:m}=o.signal,y=s.ignoreFetchAbort&&d!==void 0,_=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&d!==void 0);if(s.status&&(m&&!b?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,y&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),m&&!y&&!b)return u(o.signal.reason,_);let v=p,S=this.#s[e];return(S===p||S===void 0&&y&&b)&&(d===void 0?v.__staleWhileFetching!==void 0?this.#s[e]=v.__staleWhileFetching:this.#W(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.#D(t,d,a.options,v))),d},c=d=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=d),u(d,!1)),u=(d,b)=>{let{aborted:m}=o.signal,y=m&&s.allowStaleOnFetchAbort,_=y||s.allowStaleOnFetchRejection,v=_||s.noDeleteOnFetchRejection,S=p;if(this.#s[e]===p&&(!v||!b&&S.__staleWhileFetching===void 0?this.#W(t,"fetch"):y||(this.#s[e]=S.__staleWhileFetching)),_)return s.status&&S.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw d},f=(d,b)=>{let m=this.#d?.(t,n,a);o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(d(void 0),s.allowStaleOnFetchAbort&&(d=y=>l(y,!0)))}),m&&m instanceof Promise?m.then(y=>d(y===void 0?void 0:y),b):m!==void 0&&d(m)};s.status&&(s.status.fetchDispatched=!0);let p=new Promise(f).then(l,c),g=Object.assign(p,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#D(t,g,{...a.options,status:void 0}),e=this.#l.get(t)):this.#s[e]=g,g}#c(t){if(!this.#M)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let s=O.tracing.hasSubscribers,{status:i=Ie()?{}:void 0}=e;e.status=i,i&&e.context&&(i.context=e.context);let n=this.#H(t,e);return i&&s&&(i.trace=!0,O.tracing.tracePromise(()=>n,i).catch(()=>{})),n}async#H(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:d,forceRefresh:b=!1,status:m,signal:y}=e;if(m&&(m.op="fetch",m.key=t,b&&(m.forceRefresh=!0),m.cache=this),!this.#M)return m&&(m.fetch="get"),this.#X(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:m});let _={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:h,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:m,signal:y},v=this.#l.get(t);if(v===void 0){m&&(m.fetch="miss");let S=this.#L(t,v,_,d);return S.__returned=S}else{let S=this.#s[v];if(this.#c(S)){let rt=s&&S.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",rt&&(m.returnedStale=!0)),rt?S.__staleWhileFetching:S.__returned=S}let K=this.#C(v);if(!b&&!K)return m&&(m.fetch="hit"),this.#K(v),i&&this.#k(v),m&&this.#F(m,v),S;let B=this.#L(t,v,_,d),U=B.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=K?"stale":"refresh",U&&K&&(m.returnedStale=!0)),U?B.__staleWhileFetching:B.__returned=B}}forceFetch(t,e={}){let s=O.tracing.hasSubscribers,{status:i=Ie()?{}:void 0}=e;e.status=i,i&&e.context&&(i.context=e.context);let n=this.#I(t,e);return i&&s&&(i.trace=!0,O.tracing.tracePromise(()=>n,i).catch(()=>{})),n}async#I(t,e={}){let s=await this.#H(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let{status:s=O.metrics.hasSubscribers?{}:void 0}=e;e.status=s,s&&(s.op="memo",s.key=t,e.context&&(s.context=e.context),s.cache=this);let i=this.#Z(t,e);return s&&(s.value=i),O.metrics.hasSubscribers&&O.metrics.publish(s),i}#Z(t,e={}){let s=this.#f;if(!s)throw new Error("no memoMethod provided to constructor");let{context:i,status:n,forceRefresh:o,...h}=e;n&&o&&(n.forceRefresh=!0);let a=this.#X(t,h),l=o||a===void 0;if(n&&(n.memo=l?"miss":"hit",l||(n.value=a)),!l)return a;let c=s(t,a,{options:h,context:i});return n&&(n.value=c),this.#D(t,c,h),c}get(t,e={}){let{status:s=O.metrics.hasSubscribers?{}:void 0}=e;e.status=s,s&&(s.op="get",s.key=t,s.cache=this);let i=this.#X(t,e);return s&&(i!==void 0&&(s.value=i),O.metrics.hasSubscribers&&O.metrics.publish(s)),i}#X(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,h=this.#l.get(t);if(h===void 0){o&&(o.get="miss");return}let a=this.#s[h],l=this.#c(a);return o&&this.#F(o,h),this.#C(h)?l?(o&&(o.get="stale-fetching"),s&&a.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#W(t,"expire"),o&&(o.get="stale"),s?(o&&(o.returnedStale=!0),a):void 0):(o&&(o.get=l?"fetching":"hit"),this.#K(h),i&&this.#k(h),l?a.__staleWhileFetching:a)}#Y(t,e){this.#E[e]=t,this.#b[t]=e}#K(t){t!==this.#g&&(t===this.#y?this.#y=this.#b[t]:this.#Y(this.#E[t],this.#b[t]),this.#Y(this.#g,t),this.#g=t)}delete(t){return this.#W(t,"delete")}#W(t,e){O.metrics.hasSubscribers&&O.metrics.publish({op:"delete",delete:e,key:t,cache:this});let s=!1;if(this.#h!==0){let i=this.#l.get(t);if(i!==void 0)if(this.#_?.[i]&&(clearTimeout(this.#_[i]),this.#_[i]=void 0),s=!0,this.#h===1)this.#J(e);else{this.#N(i);let n=this.#s[i];if(this.#c(n)?n.__abortController.abort(new Error("deleted")):(this.#S||this.#e)&&(this.#S&&this.#i?.(n,t,e),this.#e&&this.#p?.push([n,t,e])),this.#l.delete(t),this.#a[i]=void 0,this.#s[i]=void 0,i===this.#g)this.#g=this.#E[i];else if(i===this.#y)this.#y=this.#b[i];else{let o=this.#E[i];this.#b[o]=this.#b[i];let h=this.#b[i];this.#E[h]=this.#E[i]}this.#h--,this.#w.push(i)}}if(this.#e&&this.#p?.length){let i=this.#p,n;for(;n=i?.shift();)this.#r?.(...n)}return s}clear(){return this.#J("delete")}#J(t){for(let e of this.#R({allowStale:!0})){let s=this.#s[e];if(this.#c(s))s.__abortController.abort(new Error("deleted"));else{let i=this.#a[e];this.#S&&this.#i?.(s,i,t),this.#e&&this.#p?.push([s,i,t])}}if(this.#l.clear(),this.#s.fill(void 0),this.#a.fill(void 0),this.#v&&this.#x){this.#v.fill(0),this.#x.fill(0);for(let e of this.#_??[])e!==void 0&&clearTimeout(e);this.#_?.fill(void 0)}if(this.#O&&this.#O.fill(0),this.#y=0,this.#g=0,this.#w.length=0,this.#m=0,this.#h=0,this.#e&&this.#p){let e=this.#p,s;for(;s=e?.shift();)this.#r?.(...s)}}};Xt.LRUCache=jn});var Ye=C(j=>{"use strict";var Nn=j&&j.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(j,"__esModule",{value:!0});j.Minipass=j.isWritable=j.isReadable=j.isStream=void 0;var Js=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ve=__webpack_require__(/*! node:events */ "node:events"),ei=Nn(__webpack_require__(/*! node:stream */ "node:stream")),Dn=__webpack_require__(/*! node:string_decoder */ "node:string_decoder"),Ln=r=>!!r&&typeof r=="object"&&(r instanceof te||r instanceof ei.default||(0,j.isReadable)(r)||(0,j.isWritable)(r));j.isStream=Ln;var Wn=r=>!!r&&typeof r=="object"&&r instanceof Ve.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==ei.default.Writable.prototype.pipe;j.isReadable=Wn;var zn=r=>!!r&&typeof r=="object"&&r instanceof Ve.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function";j.isWritable=zn;var H=Symbol("EOF"),X=Symbol("maybeEmitEnd"),Z=Symbol("emittedEnd"),Kt=Symbol("emittingEnd"),gt=Symbol("emittedError"),Vt=Symbol("closed"),Zs=Symbol("read"),Yt=Symbol("flush"),Qs=Symbol("flushChunk"),W=Symbol("encoding"),at=Symbol("decoder"),M=Symbol("flowing"),wt=Symbol("paused"),lt=Symbol("resume"),k=Symbol("buffer"),F=Symbol("pipes"),A=Symbol("bufferLength"),$e=Symbol("bufferPush"),Jt=Symbol("bufferShift"),P=Symbol("objectMode"),x=Symbol("destroyed"),Ue=Symbol("error"),qe=Symbol("emitData"),ti=Symbol("emitEnd"),He=Symbol("emitEnd2"),G=Symbol("async"),Xe=Symbol("abort"),Zt=Symbol("aborted"),bt=Symbol("signal"),st=Symbol("dataListeners"),N=Symbol("discarded"),yt=r=>Promise.resolve().then(r),Bn=r=>r(),Gn=r=>r==="end"||r==="finish"||r==="prefinish",In=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,$n=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Qt=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[lt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ke=class extends Qt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=i=>this.dest.emit("error",i),t.on("error",this.proxyErrors)}},Un=r=>!!r.objectMode,qn=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",te=class extends Ve.EventEmitter{[M]=!1;[wt]=!1;[F]=[];[k]=[];[P];[W];[G];[at];[H]=!1;[Z]=!1;[Kt]=!1;[Vt]=!1;[gt]=null;[A]=0;[x]=!1;[bt];[Zt]=!1;[st]=0;[N]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Un(e)?(this[P]=!0,this[W]=null):qn(e)?(this[W]=e.encoding,this[P]=!1):(this[P]=!1,this[W]=null),this[G]=!!e.async,this[at]=this[W]?new Dn.StringDecoder(this[W]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[k]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[F]});let{signal:s}=e;s&&(this[bt]=s,s.aborted?this[Xe]():s.addEventListener("abort",()=>this[Xe]()))}get bufferLength(){return this[A]}get encoding(){return this[W]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[P]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[G]}set async(t){this[G]=this[G]||!!t}[Xe](){this[Zt]=!0,this.emit("abort",this[bt]?.reason),this.destroy(this[bt]?.reason)}get aborted(){return this[Zt]}set aborted(t){}write(t,e,s){if(this[Zt])return!1;if(this[H])throw new Error("write after end");if(this[x])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let i=this[G]?yt:Bn;if(!this[P]&&!Buffer.isBuffer(t)){if($n(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(In(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[P]?(this[M]&&this[A]!==0&&this[Yt](!0),this[M]?this.emit("data",t):this[$e](t),this[A]!==0&&this.emit("readable"),s&&i(s),this[M]):t.length?(typeof t=="string"&&!(e===this[W]&&!this[at]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[W]&&(t=this[at].write(t)),this[M]&&this[A]!==0&&this[Yt](!0),this[M]?this.emit("data",t):this[$e](t),this[A]!==0&&this.emit("readable"),s&&i(s),this[M]):(this[A]!==0&&this.emit("readable"),s&&i(s),this[M])}read(t){if(this[x])return null;if(this[N]=!1,this[A]===0||t===0||t&&t>this[A])return this[X](),null;this[P]&&(t=null),this[k].length>1&&!this[P]&&(this[k]=[this[W]?this[k].join(""):Buffer.concat(this[k],this[A])]);let e=this[Zs](t||null,this[k][0]);return this[X](),e}[Zs](t,e){if(this[P])this[Jt]();else{let s=e;t===s.length||t===null?this[Jt]():typeof s=="string"?(this[k][0]=s.slice(t),e=s.slice(0,t),this[A]-=t):(this[k][0]=s.subarray(t),e=s.subarray(0,t),this[A]-=t)}return this.emit("data",e),!this[k].length&&!this[H]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[H]=!0,this.writable=!1,(this[M]||!this[wt])&&this[X](),this}[lt](){this[x]||(!this[st]&&!this[F].length&&(this[N]=!0),this[wt]=!1,this[M]=!0,this.emit("resume"),this[k].length?this[Yt]():this[H]?this[X]():this.emit("drain"))}resume(){return this[lt]()}pause(){this[M]=!1,this[wt]=!0,this[N]=!1}get destroyed(){return this[x]}get flowing(){return this[M]}get paused(){return this[wt]}[$e](t){this[P]?this[A]+=1:this[A]+=t.length,this[k].push(t)}[Jt](){return this[P]?this[A]-=1:this[A]-=this[k][0].length,this[k].shift()}[Yt](t=!1){do;while(this[Qs](this[Jt]())&&this[k].length);!t&&!this[k].length&&!this[H]&&this.emit("drain")}[Qs](t){return this.emit("data",t),this[M]}pipe(t,e){if(this[x])return t;this[N]=!1;let s=this[Z];return e=e||{},t===Js.stdout||t===Js.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[F].push(e.proxyErrors?new Ke(this,t,e):new Qt(this,t,e)),this[G]?yt(()=>this[lt]()):this[lt]()),t}unpipe(t){let e=this[F].find(s=>s.dest===t);e&&(this[F].length===1?(this[M]&&this[st]===0&&(this[M]=!1),this[F]=[]):this[F].splice(this[F].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[N]=!1,this[st]++,!this[F].length&&!this[M]&&this[lt]();else if(t==="readable"&&this[A]!==0)super.emit("readable");else if(Gn(t)&&this[Z])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[gt]){let i=e;this[G]?yt(()=>i.call(this,this[gt])):i.call(this,this[gt])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[st]=this.listeners("data").length,this[st]===0&&!this[N]&&!this[F].length&&(this[M]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[st]=0,!this[N]&&!this[F].length&&(this[M]=!1)),e}get emittedEnd(){return this[Z]}[X](){!this[Kt]&&!this[Z]&&!this[x]&&this[k].length===0&&this[H]&&(this[Kt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Vt]&&this.emit("close"),this[Kt]=!1)}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==x&&this[x])return!1;if(t==="data")return!this[P]&&!s?!1:this[G]?(yt(()=>this[qe](s)),!0):this[qe](s);if(t==="end")return this[ti]();if(t==="close"){if(this[Vt]=!0,!this[Z]&&!this[x])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[gt]=s,super.emit(Ue,s);let n=!this[bt]||this.listeners("error").length?super.emit("error",s):!1;return this[X](),n}else if(t==="resume"){let n=super.emit("resume");return this[X](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let i=super.emit(t,...e);return this[X](),i}[qe](t){for(let s of this[F])s.dest.write(t)===!1&&this.pause();let e=this[N]?!1:super.emit("data",t);return this[X](),e}[ti](){return this[Z]?!1:(this[Z]=!0,this.readable=!1,this[G]?(yt(()=>this[He]()),!0):this[He]())}[He](){if(this[at]){let e=this[at].end();if(e){for(let s of this[F])s.dest.write(e);this[N]||super.emit("data",e)}}for(let e of this[F])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[P]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[P]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[P])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[W]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(x,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[N]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[H])return e();let n,o,h=u=>{this.off("data",a),this.off("end",l),this.off(x,c),e(),o(u)},a=u=>{this.off("error",h),this.off("end",l),this.off(x,c),this.pause(),n({value:u,done:!!this[H]})},l=()=>{this.off("error",h),this.off("data",a),this.off(x,c),e(),n({done:!0,value:void 0})},c=()=>h(new Error("stream destroyed"));return new Promise((u,f)=>{o=f,n=u,this.once(x,c),this.once("error",h),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[N]=!1;let t=!1,e=()=>(this.pause(),this.off(Ue,e),this.off(x,e),this.off("end",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let i=this.read();return i===null?e():{done:!1,value:i}};return this.once("end",e),this.once(Ue,e),this.once(x,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[x])return t?this.emit("error",t):this.emit(x),this;this[x]=!0,this[N]=!0,this[k].length=0,this[A]=0;let e=this;return typeof e.close=="function"&&!this[Vt]&&e.close(),t?this.emit("error",t):this.emit(x),this}static get isStream(){return j.isStream}};j.Minipass=te});var mi=C(E=>{"use strict";var Hn=E&&E.__createBinding||(Object.create?(function(r,t,e,s){s===void 0&&(s=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,s,i)}):(function(r,t,e,s){s===void 0&&(s=e),r[s]=t[e]})),Xn=E&&E.__setModuleDefault||(Object.create?(function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}):function(r,t){r.default=t}),Kn=E&&E.__importStar||(function(){var r=function(t){return r=Object.getOwnPropertyNames||function(e){var s=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[s.length]=i);return s},r(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s=r(t),i=0;i<s.length;i++)s[i]!=="default"&&Hn(e,t,s[i]);return Xn(e,t),e}})();Object.defineProperty(E,"__esModule",{value:!0});E.PathScurry=E.Path=E.PathScurryDarwin=E.PathScurryPosix=E.PathScurryWin32=E.PathScurryBase=E.PathPosix=E.PathWin32=E.PathBase=E.ChildrenCache=E.ResolveCache=void 0;var ae=Ys(),re=__webpack_require__(/*! node:path */ "node:path"),Vn=__webpack_require__(/*! node:url */ "node:url"),vt=__webpack_require__(/*! fs */ "fs"),Yn=Kn(__webpack_require__(/*! node:fs */ "node:fs")),Jn=vt.realpathSync.native,ee=__webpack_require__(/*! node:fs/promises */ "node:fs/promises"),si=Ye(),_t={lstatSync:vt.lstatSync,readdir:vt.readdir,readdirSync:vt.readdirSync,readlinkSync:vt.readlinkSync,realpathSync:Jn,promises:{lstat:ee.lstat,readdir:ee.readdir,readlink:ee.readlink,realpath:ee.realpath}},ai=r=>!r||r===_t||r===Yn?_t:{..._t,...r,promises:{..._t.promises,...r.promises}},Zn=/^\\\\\?\\([a-z]:)\\?$/i,Qn=/^\\\\\?\\UNC\\([^\\]+\\[^\\]+)\\?$/i,tr=/^\\\\[^\\?]+\\[^\\]+$/,ii=r=>r.replace(/\//g,"\\").replace(Zn,"$1\\").replace(Qn,"\\\\$1\\").replace(tr,"$&\\"),er=/^[\\/]{2}\?[\\/]unc[\\/][^\\/]+[\\/][^\\/]+(?:[\\/]|$)/i,sr=/^[\\/]{2}\?[\\/](?=[a-z]:)/i,ir=/^[\\/]{2}\?[\\/]unc(?=[\\/][^\\/]+[\\/][^\\/])/i,nr=/[\\/]/,L=0,li=1,ci=2,I=4,ui=6,fi=8,it=10,di=12,D=15,St=~D,Je=16,ni=32,Et=64,z=128,se=256,ne=512,ri=Et|z|ne,rr=1023,Ze=r=>r.isFile()?fi:r.isDirectory()?I:r.isSymbolicLink()?it:r.isCharacterDevice()?ci:r.isBlockDevice()?ui:r.isSocket()?di:r.isFIFO()?li:L,oi=new ae.LRUCache({max:2**12}),Ot=r=>{let t=oi.get(r);if(t)return t;let e=r.normalize("NFKD");return oi.set(r,e),e},hi=new ae.LRUCache({max:2**12}),ie=r=>{let t=hi.get(r);if(t)return t;let e=Ot(r.toLowerCase());return hi.set(r,e),e},xt=class extends ae.LRUCache{constructor(){super({max:256})}};E.ResolveCache=xt;var oe=class extends ae.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}};E.ChildrenCache=oe;var pi=Symbol("PathScurry setAsCwd"),R=class{name;root;roots;parent;nocase;isCWD=!1;#t;#n;get dev(){return this.#n}#i;get mode(){return this.#i}#o;get nlink(){return this.#o}#r;get uid(){return this.#r}#d;get gid(){return this.#d}#f;get rdev(){return this.#f}#u;get blksize(){return this.#u}#h;get ino(){return this.#h}#m;get size(){return this.#m}#l;get blocks(){return this.#l}#a;get atimeMs(){return this.#a}#s;get mtimeMs(){return this.#s}#b;get ctimeMs(){return this.#b}#E;get birthtimeMs(){return this.#E}#y;get atime(){return this.#y}#g;get mtime(){return this.#g}#w;get ctime(){return this.#w}#p;get birthtime(){return this.#p}#O;#x;#v;#_;#S;#M;#e;#P;#T;#k;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=L,s,i,n,o,h){this.name=t,this.#O=n?ie(t):Ot(t),this.#e=e&rr,this.nocase=n,this.roots=i,this.root=s||this,this.#P=o,this.#v=h.fullpath,this.#S=h.relative,this.#M=h.relativePosix,this.parent=h.parent,this.parent?this.#t=this.parent.#t:this.#t=ai(h.fs)}get fs(){return this.#t}depth(){return this.#x!==void 0?this.#x:this.parent?this.#x=this.parent.depth()+1:this.#x=0}childrenCache(){return this.#P}resolve(t){if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#F(i):this.#F(i)}#F(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#P.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#P.set(this,e),this.#e&=~Je,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),i=this.nocase?ie(t):Ot(t);for(let a of s)if(a.#O===i)return a;let n=this.parent?this.sep:"",o=this.#v?this.#v+n+t:void 0,h=this.newChild(t,L,{...e,parent:this,fullpath:o});return this.canReaddir()||(h.#e|=z),s.push(h),h}relative(){if(this.isCWD)return"";if(this.#S!==void 0)return this.#S;let t=this.name,e=this.parent;if(!e)return this.#S=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#M!==void 0)return this.#M;let t=this.name,e=this.parent;if(!e)return this.#M=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#v!==void 0)return this.#v;let t=this.name,e=this.parent;if(!e)return this.#v=this.name;let i=e.fullpath()+(e.parent?this.sep:"")+t;return this.#v=i}fullpathPosix(){if(this.#_!==void 0)return this.#_;if(this.sep==="/")return this.#_=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#_=`//?/${i}`:this.#_=i}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#_=s}isUnknown(){return(this.#e&D)===L}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#e&D)===fi}isDirectory(){return(this.#e&D)===I}isCharacterDevice(){return(this.#e&D)===ci}isBlockDevice(){return(this.#e&D)===ui}isFIFO(){return(this.#e&D)===li}isSocket(){return(this.#e&D)===di}isSymbolicLink(){return(this.#e&it)===it}lstatCached(){return this.#e&ni?this:void 0}readlinkCached(){return this.#T}realpathCached(){return this.#k}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#T)return!0;if(!this.parent)return!1;let t=this.#e&D;return!(t!==L&&t!==it||this.#e&se||this.#e&z)}calledReaddir(){return!!(this.#e&Je)}isENOENT(){return!!(this.#e&z)}isNamed(t){return this.nocase?this.#O===ie(t):this.#O===Ot(t)}async readlink(){let t=this.#T;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#T=s}catch(e){this.#R(e.code);return}}readlinkSync(){let t=this.#T;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#T=s}catch(e){this.#R(e.code);return}}#z(t){this.#e|=Je;for(let e=t.provisional;e<t.length;e++){let s=t[e];s&&s.#C()}}#C(){this.#e&z||(this.#e=(this.#e|z)&St,this.#U())}#U(){let t=this.children();t.provisional=0;for(let e of t)e.#C()}#N(){this.#e|=ne,this.#j()}#j(){if(this.#e&Et)return;let t=this.#e;(t&D)===I&&(t&=St),this.#e=t|Et,this.#U()}#B(t=""){t==="ENOTDIR"||t==="EPERM"?this.#j():t==="ENOENT"?this.#C():this.children().provisional=0}#A(t=""){t==="ENOTDIR"?this.parent.#j():t==="ENOENT"&&this.#C()}#R(t=""){let e=this.#e;e|=se,t==="ENOENT"&&(e|=z),(t==="EINVAL"||t==="UNKNOWN")&&(e&=St),this.#e=e,t==="ENOTDIR"&&this.parent&&this.parent.#j()}#G(t,e){return this.#$(t,e)||this.#D(t,e)}#D(t,e){let s=Ze(t),i=this.newChild(t.name,s,{parent:this}),n=i.#e&D;return n!==I&&n!==it&&n!==L&&(i.#e|=Et),e.unshift(i),e.provisional++,i}#$(t,e){for(let s=e.provisional;s<e.length;s++){let i=e[s];if((this.nocase?ie(t.name):Ot(t.name))===i.#O)return this.#V(t,i,s,e)}}#V(t,e,s,i){let n=e.name;return e.#e=e.#e&St|Ze(t),n!==t.name&&(e.name=t.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(e)),i.provisional++,e}async lstat(){if((this.#e&z)===0)try{return this.#q(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#A(t.code)}}lstatSync(){if((this.#e&z)===0)try{return this.#q(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#A(t.code)}}#q(t){let{atime:e,atimeMs:s,birthtime:i,birthtimeMs:n,blksize:o,blocks:h,ctime:a,ctimeMs:l,dev:c,gid:u,ino:f,mode:p,mtime:g,mtimeMs:d,nlink:b,rdev:m,size:y,uid:_}=t;this.#y=e,this.#a=s,this.#p=i,this.#E=n,this.#u=o,this.#l=h,this.#w=a,this.#b=l,this.#n=c,this.#d=u,this.#h=f,this.#i=p,this.#g=g,this.#s=d,this.#o=b,this.#f=m,this.#m=y,this.#r=_;let v=Ze(t);this.#e=this.#e&St|v|ni,v!==L&&v!==I&&v!==it&&(this.#e|=Et)}#L=[];#c=!1;#H(t){this.#c=!1;let e=this.#L.slice();this.#L.length=0,e.forEach(s=>s(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);e?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#L.push(t),this.#c)return;this.#c=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(n,o)=>{if(n)this.#B(n.code),s.provisional=0;else{for(let h of o)this.#G(h,s);this.#z(s)}this.#H(s.slice(0,s.provisional))})}#I;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#I)await this.#I;else{let s=()=>{};this.#I=new Promise(i=>s=i);try{for(let i of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#G(i,t);this.#z(t)}catch(i){this.#B(i.code),t.provisional=0}this.#I=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#G(s,t);this.#z(t)}catch(s){this.#B(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#e&ri)return!1;let t=D&this.#e;return t===L||t===I||t===it}shouldWalk(t,e){return(this.#e&I)===I&&!(this.#e&ri)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#k)return this.#k;if(!((ne|se|z)&this.#e))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#k=this.resolve(t)}catch{this.#N()}}realpathSync(){if(this.#k)return this.#k;if(!((ne|se|z)&this.#e))try{let t=this.#t.realpathSync(this.fullpath());return this.#k=this.resolve(t)}catch{this.#N()}}[pi](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],i=this;for(;i&&i.parent;)e.add(i),i.#S=s.join(this.sep),i.#M=s.join("/"),i=i.parent,s.push("..");for(i=t;i&&i.parent&&!e.has(i);)i.#S=void 0,i.#M=void 0,i=i.parent}};E.PathBase=R;var Ct=class r extends R{sep="\\";splitSep=nr;constructor(t,e=L,s,i,n,o,h){super(t,e,s,i,n,o,h)}newChild(t,e=L,s={}){return new r(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return er.exec(t)?.[0]??re.win32.parse(t).root}getRoot(t){if(t=ii(t.toUpperCase()),t===this.root.name||/^[\\/]$/.test(t))return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new At(t,{nocase:this.nocase,fs:this.fs}).root}sameRoot(t,e=this.root.name){return ii(t.toUpperCase())===e}};E.PathWin32=Ct;var Mt=class r extends R{splitSep="/";sep="/";constructor(t,e=L,s,i,n,o,h){super(t,e,s,i,n,o,h)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=L,s={}){return new r(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}};E.PathPosix=Mt;var kt=class{root;rootPath;roots;cwd;#t;#n;#i;nocase;#o;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:n=16*1024,fs:o=_t}={}){this.#o=ai(o),(t instanceof URL||t.startsWith("file://"))&&(t=(0,Vn.fileURLToPath)(t));let h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),this.#t=new xt,this.#n=new xt,this.#i=new oe(n);let a=h.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]&&a.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#o),this.roots[this.rootPath]=this.root;let l=this.root,c=a.length-1,u=e.sep,f=this.rootPath,p=!1;for(let g of a){let d=c--;l=l.child(g,{relative:new Array(d).fill("..").join(u),relativePosix:new Array(d).fill("..").join("/"),fullpath:f+=(p?"":u)+g}),p=!0}this.cwd=l}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#i}resolve(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpath();return this.#t.set(e,i),i}resolvePosix(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#n.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpathPosix();return this.#n.set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let i=await t.readdir();return s?i:i.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set,l=(u,f)=>{a.add(u),u.readdirCB((p,g)=>{if(p)return f(p);let d=g.length;if(!d)return f();let b=()=>{--d===0&&f()};for(let m of g)(!n||n(m))&&h.push(s?m:m.fullpath()),i&&m.isSymbolicLink()?m.realpath().then(y=>y?.isUnknown()?y.lstat():y).then(y=>y?.shouldWalk(a,o)?l(y,b):b()):m.shouldWalk(a,o)?l(m,b):b()},!0)},c=t;return new Promise((u,f)=>{l(c,p=>{if(p)return f(p);u(h)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set([t]);for(let l of a){let c=l.readdirSync();for(let u of c){(!n||n(u))&&h.push(s?u:u.fullpath());let f=u;if(u.isSymbolicLink()){if(!(i&&(f=u.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(a,o)&&a.add(f)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e;(!n||n(t))&&(yield s?t:t.fullpath());let h=new Set([t]);for(let a of h){let l=a.readdirSync();for(let c of l){(!n||n(c))&&(yield s?c:c.fullpath());let u=c;if(c.isSymbolicLink()){if(!(i&&(u=c.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(h,o)&&h.add(u)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=new si.Minipass({objectMode:!0});(!n||n(t))&&h.write(s?t:t.fullpath());let a=new Set,l=[t],c=0,u=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){c===0&&h.end();return}c++,a.add(p);let g=(b,m,y=!1)=>{if(b)return h.emit("error",b);if(i&&!y){let _=[];for(let v of m)v.isSymbolicLink()&&_.push(v.realpath().then(S=>S?.isUnknown()?S.lstat():S));if(_.length){Promise.all(_).then(()=>g(null,m,!0));return}}for(let _ of m)_&&(!n||n(_))&&(h.write(s?_:_.fullpath())||(f=!0));c--;for(let _ of m){let v=_.realpathCached()||_;v.shouldWalk(a,o)&&l.push(v)}f&&!h.flowing?h.once("drain",u):d||u()},d=!0;p.readdirCB(g,!0),d=!1}};return u(),h}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=new si.Minipass({objectMode:!0}),a=new Set;(!n||n(t))&&h.write(s?t:t.fullpath());let l=[t],c=0,u=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){c===0&&h.end();return}c++,a.add(p);let g=p.readdirSync();for(let d of g)(!n||n(d))&&(h.write(s?d:d.fullpath())||(f=!0));c--;for(let d of g){let b=d;if(d.isSymbolicLink()){if(!(i&&(b=d.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(a,o)&&l.push(b)}}f&&!h.flowing&&h.once("drain",u)};return u(),h}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[pi](e)}};E.PathScurryBase=kt;var At=class extends kt{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;typeof t=="string"&&!t.startsWith("file://")&&(t=t.replace(sr,"").replace(ir,"\\")),super(t,re.win32,"\\",{...e,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(t){return re.win32.parse(t).root.toUpperCase()}newRoot(t){return new Ct(this.rootPath,I,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}};E.PathScurryWin32=At;var Rt=class extends kt{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,re.posix,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new Mt(this.rootPath,I,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}};E.PathScurryPosix=Rt;var he=class extends Rt{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}};E.PathScurryDarwin=he;E.Path=process.platform==="win32"?Ct:Mt;E.PathScurry=process.platform==="win32"?At:process.platform==="darwin"?he:Rt});var ts=C(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.Pattern=void 0;var or=Y(),hr=r=>r.length>=1,ar=r=>r.length>=1,lr=Symbol.for("nodejs.util.inspect.custom"),Qe=class r{#t;#n;#i;length;#o;#r;#d;#f;#u;#h;#m=!0;constructor(t,e,s,i){if(!hr(t))throw new TypeError("empty pattern list");if(!ar(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#n=e,this.#i=s,this.#o=i,this.#i===0){if(this.isUNC()){let n=this.#l()?6:4,o=this.#t.slice(0,n),h=this.#n.slice(0,n),a=this.#t.slice(n),l=this.#n.slice(n);a[0]===""&&(a.shift(),l.shift());let c=[...o,""].join("/"),u=[...h,""].join("/");this.#t=[c,...a],this.#n=[u,...l],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#t,[h,...a]=this.#n;o[0]===""&&(o.shift(),a.shift());let l=`${n}/`,c=`${h}/`;this.#t=[l,...o],this.#n=[c,...a],this.length=this.#t.length}}}[lr](){return`Pattern <${this.#n.slice(this.#i).join("/")}>`}pattern(){return this.#t[this.#i]}isString(){return typeof this.#t[this.#i]=="string"}isGlobstar(){return this.#t[this.#i]===or.GLOBSTAR}isMatcher(){return typeof this.#t[this.#i]=="object"}globString(){return this.#d=this.#d||(this.#i===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#r!==void 0?this.#r:this.hasMore()?(this.#r=new r(this.#t,this.#n,this.#i+1,this.#o),this.#r.#h=this.#h,this.#r.#u=this.#u,this.#r.#f=this.#f,this.#r):this.#r=null}#l(){let t=this.#t;return t[2]==="?"&&typeof t[3]=="string"&&/^unc$/i.test(t[3])}isUNC(){let t=this.#t,e=this.#l()?4:2;return this.#u!==void 0?this.#u:this.#u=this.#o==="win32"&&this.#i===0&&t[0]===""&&t[1]===""&&typeof t[e]=="string"&&!!t[e]&&typeof t[e+1]=="string"&&!!t[e+1]}isDrive(){let t=this.#t;return this.#f!==void 0?this.#f:this.#f=this.#o==="win32"&&this.#i===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#h!==void 0?this.#h:this.#h=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#i===0?t:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#m)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#m?!1:(this.#m=!1,!0)}};le.Pattern=Qe});var is=C(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.Ignore=void 0;var es=Y(),cr=ts(),ur=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ss=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;slashRoot;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:n,normalize:o,platform:h=ur,root:a,windowsPathsNoEscape:l,allowWindowsEscape:c},u){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=h,l=!!l||c===!1,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:n,normalize:o,optimizationLevel:2,platform:h,nocomment:!0,nonegate:!0,windowsPathsNoEscape:l};let f=u?.resolve(a??"/").fullpath()??"/";this.slashRoot=(0,es.escape)(f.replace(/\\/g,"/").replace(/\/$/,""),{windowsPathsNoEscape:l});for(let p of t)this.add(p)}add(t){let e=new es.Minimatch(t,this.mmopts);for(let s=0;s<e.set.length;s++){let i=e.set[s],n=e.globParts[s];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let o=new cr.Pattern(i,n,0,this.platform),h=o.root()==="/"?`${this.slashRoot}/${o.rest()?.globString()??""}`:o.globString(),a=new es.Minimatch(h,this.mmopts),l=n[n.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(a):this.relative.push(a),l&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(t){let e=t.fullpath(),s=`${e}/`,i=t.relative()||".",n=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(n))return!0;for(let o of this.absolute)if(o.match(e)||o.match(s))return!0;return!1}childrenIgnored(t){let e=`${t.fullpath()}/`,s=`${t.relative()||"."}/`;for(let i of this.relativeChildren)if(i.match(s))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}};ce.Ignore=ss});var wi=C($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.Processor=$.SubWalks=$.MatchRecord=$.HasWalkedCache=void 0;var gi=Y(),ue=class r{parent;store;constructor(t){this.parent=t}copy(){return new r(this)}#t(t){let e=this.store?.get(t);return e||!this.parent?e:this.parent.#t(t)}hasWalked(t,e){return!!this.#t(t.fullpath())?.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),i=this.#t(s);i?i.add(e.globString()):(this.store??=new Map).set(s,new Set([e.globString()]))}};$.HasWalkedCache=ue;var fe=class r{static ABSOLUTE=2;static IF_DIR=1;store=new Map;add(t,e,s){let i=(e?r.ABSOLUTE:0)|(s?r.IF_DIR:0),n=this.store.get(t);this.store.set(t,n===void 0?i:i&n)}};$.MatchRecord=fe;var de=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(i=>i.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}};$.SubWalks=de;var ns=class r{hasWalkedCache;matches=new fe;subwalks=new de;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new ue}processPatterns(t,e){this.patterns=e;let s=e.map(i=>[t,i]);for(let[i,n]of s){this.hasWalkedCache.storeWalked(i,n);let o=n.root(),h=n.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let u=n.rest();if(u)n=u;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let a,l,c=!1;for(;typeof(a=n.pattern())=="string"&&(l=n.rest());)i=i.resolve(a),n=l,c=!0;if(a=n.pattern(),l=n.rest(),c){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof a=="string"){let u=a===".."||a===""||a===".";this.matches.add(i.resolve(a),h,u);continue}else if(a===gi.GLOBSTAR){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let u=l?.pattern(),f=l?.rest();if(!l||(u===""||u===".")&&!f)this.matches.add(i,h,u===""||u===".");else if(u===".."){let p=i.parent||i;f?this.hasWalkedCache.hasWalked(p,f)||this.subwalks.add(p,f):this.matches.add(p,h,!0)}}else typeof a=="object"&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),i=this.child();for(let n of e)for(let o of s){let h=o.isAbsolute(),a=o.pattern(),l=o.rest();a===gi.GLOBSTAR?i.testGlobstar(n,o,l,h):typeof a=="object"?i.testMatcher(n,a,l,h):i.testString(n,a,l,h)}return i}testGlobstar(t,e,s,i){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),i);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s)}else typeof n=="object"&&this.testMatcher(t,n,s.rest(),i)}}testMatcher(t,e,s,i){e.testUnchecked(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}};$.Processor=ns});var yi=C(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.GlobStream=Q.GlobWalker=Q.GlobUtil=void 0;var fr=Ye(),bi=is(),rs=wi(),{ABSOLUTE:pe,IF_DIR:me}=rs.MatchRecord,dr=(r,t,e)=>typeof r=="string"?new bi.Ignore([r],t,e):Array.isArray(r)?new bi.Ignore(r,t,e):r,Pt=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#n;#i;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#i=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#n=dr(s.ignore??[],s,e),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#o(t){return this.seen.has(t)||!!this.#n?.ignored?.(t)}#r(t){return!!this.#n?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.paused?this.#t.push(t):t()}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s,i;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;i=s}else i=t;let o=i.isUnknown()||this.opts.stat?await i.lstat():i;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let h=await o.realpath();h&&(h.isUnknown()||this.opts.stat)&&await h.lstat()}return this.matchCheckTest(o,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#o(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s,i;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;i=s}else i=t;let o=i.isUnknown()||this.opts.stat?i.lstatSync():i;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let h=o.realpathSync();h&&(h?.isUnknown()||this.opts.stat)&&h.lstatSync()}return this.matchCheckTest(o,e)}matchFinish(t,e){this.#o(t)||this.#d(t,e)}#d(t,e){if(!this.includeChildMatches&&this.#n?.add){let n=`${t.relativePosix()}/**`;this.#n.add(n)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!n.startsWith(`..${this.#i}`)?`.${this.#i}`:"";this.matchEmit(n?o+n+i:`.${i}`)}}async match(t,e,s){let i=await this.matchCheck(t,s);i&&this.matchFinish(i,e)}matchSync(t,e,s){let i=this.matchCheckSync(t,s);i&&this.#d(i,e)}walkCB(t,e,s){if(this.signal?.aborted)return s();this.walkCB2(t,e,new rs.Processor(this.opts),s)}walkCB2(t,e,s,i){if(this.#r(t)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2(t,e,s,i));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a]of s.matches.store)this.#o(h)||(n++,this.match(h,!!(a&pe),!!(a&me)).then(()=>o()));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirCached();h.calledReaddir()?this.walkCB3(h,a,s,o):h.readdirCB((l,c)=>this.walkCB3(h,c,s,o),!0)}o()}walkCB3(t,e,s,i){let n=s.filterEntries(t,e),o=1,h=()=>{--o===0&&i()};for(let[a,l]of n.matches.store)this.#o(a)||(o++,this.match(a,!!(l&pe),!!(l&me)).then(()=>h()));for(let[a,l]of n.subwalks.entries())o++,this.walkCB2(a,l,n.child(),h);h()}walkCBSync(t,e,s){if(this.signal?.aborted)return s();this.walkCB2Sync(t,e,new rs.Processor(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#r(t)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,i));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a]of s.matches.store)this.#o(h)||this.matchSync(h,!!(a&pe),!!(a&me));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirSync();this.walkCB3Sync(h,a,s,o)}o()}walkCB3Sync(t,e,s,i){let n=s.filterEntries(t,e),o=1,h=()=>{--o===0&&i()};for(let[a,l]of n.matches.store)this.#o(a)||this.matchSync(a,!!(l&pe),!!(l&me));for(let[a,l]of n.subwalks.entries())o++,this.walkCB2Sync(a,l,n.child(),h);h()}};Q.GlobUtil=Pt;var os=class extends Pt{matches=[];constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.push(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};Q.GlobWalker=os;var hs=class extends Pt{results;constructor(t,e,s){super(t,e,s),this.results=new fr.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};Q.GlobStream=hs});var ls=C(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.Glob=void 0;var pr=Y(),mr=__webpack_require__(/*! node:url */ "node:url"),ge=mi(),gr=ts(),we=yi(),wr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",as=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,mr.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");let s=typeof t=="string"?[t]:t;if(this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(s=s.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");s=s.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=s,this.platform=e.platform||wr,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=e.platform==="win32"?ge.PathScurryWin32:e.platform==="darwin"?ge.PathScurryDarwin:e.platform?ge.PathScurryPosix:ge.PathScurry;this.scurry=new l(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape},o=this.pattern.map(l=>new pr.Minimatch(l,n)),[h,a]=o.reduce((l,c)=>(l[0].push(...c.set),l[1].push(...c.globParts),l),[[],[]]);this.patterns=h.map((l,c)=>{let u=a[c];if(!u)throw new Error("invalid pattern object");return new gr.Pattern(l,u,0,this.platform)})}async walk(){return await new we.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()}walkSync(){return new we.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()}stream(){return new we.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new we.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};be.Glob=as});var cs=C(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.hasMagic=void 0;var br=Y(),yr=(r,t={})=>{for(let e of Array.isArray(r)?r:[r])if(new br.Minimatch(e,t).hasMagic())return!0;return!1};ye.hasMagic=yr});Object.defineProperty(exports, "__esModule", ({value:!0}));exports.glob=exports.sync=exports.iterate=exports.iterateSync=exports.stream=exports.streamSync=exports.Ignore=exports.hasMagic=exports.Glob=exports.unescape=exports.escape=void 0;exports.globStreamSync=Tt;exports.globStream=us;exports.globSync=fs;exports.globIterateSync=Ft;exports.globIterate=ds;var Si=Y(),nt=ls(),Sr=cs(),_i=Y();Object.defineProperty(exports, "escape", ({enumerable:!0,get:function(){return _i.escape}}));Object.defineProperty(exports, "unescape", ({enumerable:!0,get:function(){return _i.unescape}}));var vr=ls();Object.defineProperty(exports, "Glob", ({enumerable:!0,get:function(){return vr.Glob}}));var _r=cs();Object.defineProperty(exports, "hasMagic", ({enumerable:!0,get:function(){return _r.hasMagic}}));var Er=is();Object.defineProperty(exports, "Ignore", ({enumerable:!0,get:function(){return Er.Ignore}}));function Tt(r,t={}){return new nt.Glob(r,t).streamSync()}function us(r,t={}){return new nt.Glob(r,t).stream()}function fs(r,t={}){return new nt.Glob(r,t).walkSync()}async function vi(r,t={}){return new nt.Glob(r,t).walk()}function Ft(r,t={}){return new nt.Glob(r,t).iterateSync()}function ds(r,t={}){return new nt.Glob(r,t).iterate()}exports.streamSync=Tt;exports.stream=Object.assign(us,{sync:Tt});exports.iterateSync=Ft;exports.iterate=Object.assign(ds,{sync:Ft});exports.sync=Object.assign(fs,{stream:Tt,iterate:Ft});exports.glob=Object.assign(vi,{glob:vi,globSync:fs,sync:exports.sync,globStream:us,stream:exports.stream,globStreamSync:Tt,streamSync:exports.streamSync,globIterate:ds,iterate:exports.iterate,globIterateSync:Ft,iterateSync:exports.iterateSync,Glob:nt.Glob,hasMagic:Sr.hasMagic,escape:Si.escape,unescape:Si.unescape});exports.glob.glob=exports.glob;
153392
+ `)},Re=class{gen;threads=[];match=!1;runs=[];ids=[];constructor(t){this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},Ts=(r,t)=>r.ids.length!==t.ids.length||r.runs.length!==t.runs.length||r.ids.some((e,s)=>e!==t.ids[s])?!1:r.runs.every(e=>t.runs.some(s=>s.neg===e.neg&&Ts(s.state,e.state))),xs=r=>({has:new Float64Array(r),seen:new Float64Array(r),gen:0}),dt=class{dots;dotStart;#t;constructor(t,e,s){this.dots=t,this.dotStart=e,this.#t=s}state(){return new Re(++this.#t.gen)}done(t){return t.ids=t.threads.map(e=>e.id).sort((e,s)=>e-s),t.match&&t.ids.unshift(Ae.id),t}#n(t,e){let{seen:s}=this.#t;return s[e.id]===t.gen?!1:(s[e.id]=t.gen,!0)}#i(t,e){let{has:s}=this.#t;return s[e.id]===t.gen?!1:(s[e.id]=t.gen,t.threads.push(e),!0)}restricted(t,e){return e&&(this.dots||this.dotStart&&t===0)}add(t,e,s,i){switch(e.t){case"split":if(!this.#n(t,e))return;for(let o of e.out)this.add(t,o,s,i);return;case"neg":if(!this.#n(t,e))return;let n=this.state();return this.add(n,e.sub,s,!1),this.done(n),this.addRun(t,{t:"run",neg:e,state:n},s,i);case"star":if(this.restricted(s,i))return;this.#i(t,e)&&this.add(t,e.next,s,i);return;case"match":t.match=!0;return;default:this.#i(t,e)}}addRun(t,e,s,i){for(let n of t.runs)if(n.neg===e.neg&&Ts(n.state,e.state))return;t.runs.push(e),e.state.match||this.add(t,e.neg.next,s,i)}step(t,e,s,i){let n=this.state();for(let o of t.threads)switch(o.t){case"lit":Fe(o,e)&&this.add(n,o.next,s+1,i);break;case"any":this.restricted(s,i)||this.add(n,o.next,s+1,i);break;case"class":!this.restricted(s,i)&&o.re.test(e)&&this.add(n,o.next,s+1,i);break;case"star":this.restricted(s,i)||this.add(n,o,s+1,i)}if(!this.restricted(s,i))for(let o of t.runs){if(o.state.dead){this.addRun(n,o,s+1,i);continue}let h=this.step(o.state,e,s,!1);this.addRun(n,{t:"run",neg:o.neg,state:h},s+1,i)}return this.done(n)}},Fs=r=>{let t=r.ids.join();if(!r.runs.length)return t;let e=r.runs.map(s=>`${s.neg.id}(${Fs(s.state)})`);return`${t}|${e.sort().join("|")}`},en=1<<18,Pe=class{#t;#n=new Map;#i=0;#o;#r;#d;#f;constructor(t,e){this.#t=t,this.#d=new dt(!1,!1,e),this.#f=new dt(!1,!0,e)}#u(t){return{state:t,match:t.match,dead:t.dead,next:new Map}}#h(t){let e=Fs(t),s=this.#n.get(e);if(s)return s;this.#i>en&&this.#m();let i=this.#u(t);return this.#n.set(e,i),this.#i+=e.length+1,i}#m(){this.#n.clear(),this.#i=0,this.#o=void 0,this.#r=void 0}start(t){if(t){if(this.#r)return this.#r;let s=this.#f.state();return this.#f.add(s,this.#t,0,!0),this.#r=this.#u(this.#f.done(s))}if(this.#o)return this.#o;let e=this.#d.state();return this.#d.add(e,this.#t,0,!0),this.#o=this.#h(this.#d.done(e))}next(t,e){let s=e.charCodeAt(0),i=s<128?void 0:t.next.get(e);if(i)return i;let n=t===this.#r?this.#h(this.#f.step(t.state,e,0,!0)):this.#h(this.#d.step(t.state,e,1,!0));return s<128?(t.ascii||(t.ascii=new Array(128),this.#i+=128),t.ascii[s]=n):t.next.set(e,n),this.#i++,n}},sn=r=>{let t=[];for(let e=r;e.t!=="match";e=e.next){if(e.t==="split"||e.t==="neg")return;t.push(e)}return t},nn=(r,t,e,s)=>{let i=0,n=e,o=-1,h=0;for(;n<s;){let a=r[i];if(a?.t==="star"){o=i++,h=n;continue}let l=t[n];if(a&&(a.t==="any"||a.t==="lit"&&Fe(a,l)||a.t==="class"&&a.re.test(l))){i++,n++;continue}if(o===-1)return!1;i=o+1,n=++h}for(;r[i]?.t==="star";)i++;return i===r.length},js=r=>{let t=0,e=0;for(let s of r){let[i,n]=rn(s);t+=i,e+=n}return[t,e]},rn=r=>{if(r.t==="star")return[0,1/0];if(r.t!=="ext")return[1,1];if(r.type==="!")return[0,1/0];let t=r.alts.map(js),e=Math.min(...t.map(n=>n[0])),s=Math.max(...t.map(n=>n[1])),i=s===0?0:1/0;return r.type==="@"?[e,s]:r.type==="?"?[0,s]:r.type==="*"?[0,i]:[e,i]},Cs=(r,t,e)=>{for(let s=0;s<r.length;s++)if(!Fe(r[s],t[e+s]))return!1;return!0},on=/[/\ud800-\udfff]/,hn=/[\ud800-\udfff]/,Lt=r=>hn.test(r)?[...r]:r,Ms=r=>{if(r.includes("/"))throw new Error("can only match a single path portion, got: "+r)},Te=class{pattern;options;#t;#n;#i;#o;#r;#d=!1;#f;#u;#h=!1;#m=0;#l=1/0;#a=[];#s=[];#b;#E;#y=!1;#g;#w;constructor(t,e={}){if(t.includes("/"))throw new Error("can only match a single path portion, got pattern: "+t);this.pattern=t,this.options=e;let{nocase:s=!1,noext:i=!1,normalize:n}=e;this.#w=n===!0?"NFC":n||void 0;let o=/^[?*+@]\(\)$/.test(t),h=Ji(t,s,i||o,this.#w,e.rangeMark),[a]=Rs(h,Zi(h),0,h.length,!0);this.#w&&(a=Ps(a,this.#w));let[l,c]=Qi(a,s);if(this.#t=l,this.#n=c,a.every(u=>u.t==="lit"))this.#r=a.map(u=>u.ch).join(""),this.#d=s;else{let u=g=>g.t!=="lit"?void 0:s?{ch:g.ch,re:As(g.ch)}:{ch:g.ch};for(let g of a){let d=u(g);if(!d)break;this.#a.push(d)}for(let g=a.length-1;g>=0;g--){let d=u(a[g]);if(!d)break;this.#s.unshift(d)}this.#y=!!(this.#a.length||this.#s.length),s||(this.#b=this.#a.map(g=>g.ch).join(""),this.#E=this.#s.map(g=>g.ch).join("")),this.#u=sn(this.#t)?.slice(this.#a.length,-this.#s.length||void 0),this.#h=!!this.#u?.every(g=>g.t==="star"||g.t==="any");let[f,p]=js(a);this.#m=f,this.#l=p}}test(t){return this.#w?(Ms(t),this.#p(t.normalize(this.#w))):on.test(t)?(Ms(t),this.#p(t,[...t])):this.#p(t,t)}testUnchecked(t){return this.#p(this.#w?t.normalize(this.#w):t)}#p(t,e){if(this.#r!==void 0)return this.#d?(this.#f??=ks(this.#r)).test(t):t===this.#r;let s=this.#m,i=this.#l;if(e===void 0){let c=t.length,u=c+1>>1;if(c<s||u>i)return!1;(u<s||c>i)&&(e=Lt(t))}if(e!==void 0&&(e.length<s||e.length>i))return!1;let n=this.#a.length;if(this.#y)if(this.#b!==void 0&&this.#E!==void 0){if(!t.startsWith(this.#b)||!t.endsWith(this.#E))return!1}else{e??=Lt(t);let c=e.length-this.#s.length;if(!Cs(this.#a,e,0)||!Cs(this.#s,e,c))return!1}let o=!this.options.dot&&t.startsWith(".");if(this.#u){if(t==="."||t===".."||o&&!n)return!1;if(this.#h)return!0;e??=Lt(t);let c=e.length-this.#s.length;return nn(this.#u,e,n,c)}if(e??=Lt(t),t==="."||t===".."){this.#i??=xs(this.#n);let c=this.#o??=new dt(!0,!1,this.#i),u=c.state();c.add(u,this.#t,0,!0);let f=c.done(u);for(let p=0;p<e.length;p++)f=c.step(f,e[p],p,!0);return f.match}this.#i??=xs(this.#n);let h=this.#g??=new Pe(this.#t,this.#i),a=h.start(o),l=e===t;for(let c=0;c<e.length;c++){if(a.dead)return!1;let u=l?t.charCodeAt(c):e[c].charCodeAt(0);a=a.ascii?.[u]??h.next(a,e[c])}return a.match}toString(){return tn(this.#t)}};Wt.Matcher=Te});var Ds=C(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.assertValidPattern=void 0;var an=1024*64,ln=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>an)throw new TypeError("pattern is too long")};zt.assertValidPattern=ln});var je=C(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.escape=void 0;var cn=(r,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):t?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");Bt.escape=cn});var Ne=C(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.unescape=void 0;var un=(r,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");Gt.unescape=un});var Y=C(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.unescape=w.escape=w.Minimatch=w.match=w.braceExpand=w.defaults=w.filter=w.GLOBSTAR=w.sep=w.minimatch=void 0;var fn=vs(),Ls=Ns(),Ut=Ds(),dn=je(),pn=Ne(),mn=(r,t,e={})=>((0,Ut.assertValidPattern)(t),!e.nocomment&&t.charAt(0)==="#"?!1:wn(t,e).match(r));w.minimatch=mn;var ot=new Map,gn=256,wn=(r,t)=>{let e=r+"\0"+JSON.stringify(t),s=ot.get(e);return s?ot.delete(e):(s=new ht(r,{...t}),ot.size>=gn&&ot.delete(ot.keys().next().value)),ot.set(e,s),s},$s=typeof process=="object"&&process?process.env?.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ws={win32:{sep:"\\"},posix:{sep:"/"}};w.sep=$s==="win32"?Ws.win32.sep:Ws.posix.sep;w.minimatch.sep=w.sep;w.GLOBSTAR=Symbol("globstar **");w.minimatch.GLOBSTAR=w.GLOBSTAR;var bn=(r,t={})=>e=>(0,w.minimatch)(e,r,t);w.filter=bn;w.minimatch.filter=w.filter;var q=(r,t={})=>Object.assign({},r,t),yn=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return w.minimatch;let t=w.minimatch;return Object.assign((s,i,n={})=>t(s,i,q(r,n)),{Minimatch:class extends t.Minimatch{constructor(i,n={}){super(i,q(r,n))}static defaults(i){return t.defaults(q(r,i)).Minimatch}},unescape:(s,i={})=>t.unescape(s,q(r,i)),escape:(s,i={})=>t.escape(s,q(r,i)),filter:(s,i={})=>t.filter(s,q(r,i)),defaults:s=>t.defaults(q(r,s)),braceExpand:(s,i={})=>t.braceExpand(s,q(r,i)),match:(s,i,n={})=>t.match(s,i,q(r,n)),sep:t.sep,GLOBSTAR:w.GLOBSTAR})};w.defaults=yn;w.minimatch.defaults=w.defaults;var Sn=(r,t={})=>((0,Ut.assertValidPattern)(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,fn.expand)(r,{max:t.braceExpandMax}));w.braceExpand=Sn;w.minimatch.braceExpand=w.braceExpand;var vn=100,_n=/(?<![\\$])\{(-?\d+)\.\.(-?\d+)\}/g,En=(r,t,e={})=>{let s=new ht(t,e);return r=r.filter(i=>s.match(i)),s.options.nonull&&!r.length&&r.push(t),r};w.match=En;w.minimatch.match=w.match;var zs=/[?*]|[+@!]\(.*?\)|\[|\]/,Us=(r,t)=>{let e=t+1;(r.charAt(e)==="!"||r.charAt(e)==="^")&&e++;let s=!1;for(;e<r.length;e++){let i=r.charAt(e);if(i==="]"&&s)return e;s=!0,i==="\\"&&e++}return-1},On=(r,t)=>{if(!t&&(r==="+()"||r==="@()"))return r;let e="";for(let s=0;s<r.length;s++){let i=r.charAt(s);if(i==="\\")e+=r.charAt(++s)||i;else{if(i==="*"||i==="?")return;if(i==="["){let n=Us(r,s);if(n===-1){e+=i;continue}let o=r.slice(s+1,n);if(o.startsWith("\\")&&(o=o.slice(1)),[...o].length!==1||"!^".includes(r.charAt(s+1)))return;e+=o,s=n}else{if(!t&&"+@!".includes(i)&&r.charAt(s+1)==="("&&r.includes(")",s+2))return;e+=i}}}return e},xn=r=>{if(/^[?*+@]\(\)$/.test(r)||r.includes("[:"))return!1;let t=0;for(let e=0;e<r.length;e++){let s=r.charAt(e);if(s==="\\"){if(++e===r.length)return!1}else if(s==="["){let i=Us(r,e);i!==-1&&(e=i)}else if("+@!?*".includes(s)&&r.charAt(e+1)==="(")t++,e++;else if(s===")"){if(!t--)return!1}else if(s==="|"&&!t)return!1}return!t},De,Bs,V=(r,t)=>typeof r=="string"?t===r:t!==""&&r.testUnchecked(t),Gs=(r,t,e,s,i)=>V(r,t)?e:s!==void 0&&V(r,s)?i:-1,Be=r=>r==="."||r==="..",Le=r=>typeof r=="string"&&/^[a-z]:$/i.test(r),$t=r=>typeof r=="string"&&/^unc$/i.test(r),We=r=>{if(r[0]!==""||r[1]!=="")return-1;let t=r[2]!=="?"?2:$t(r[3])?4:-1,e=r[t],s=r[t+1];return t!==-1&&e!==void 0&&e!==""&&e!==w.GLOBSTAR&&s!==void 0&&s!==""&&s!==w.GLOBSTAR?t:-1},It=(r,t)=>!Be(r)&&(t||!r.startsWith(".")),pt=(r,t,e,s,i)=>{for(let n=t;n<e;){if(r.charCodeAt(n)===46){if(!s)return!0;let h=r.charCodeAt(n+1)===46?n+2:n+1;if(h>=e||qt(r.charCodeAt(h),i))return!0}let o=Ge(r,n,i);if(o===-1)return!1;for(n=o+1;n<e&&qt(r.charCodeAt(n),i);)n++}return!1},qt=(r,t)=>t==="/"?r===47:t==="\\"?r===92:r===47||r===92,Ge=(r,t,e)=>{if(e!=="both")return r.indexOf(e,t);let s=r.indexOf("/",t),i=r.indexOf("\\",t);return s===-1?i:i===-1?s:Math.min(s,i)},Is=(r,t,e)=>e!=="both"?r.lastIndexOf(e,t):Math.max(r.lastIndexOf("/",t),r.lastIndexOf("\\",t)),ze={},ht=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;#t;#n;#i;#o;#r=[];#d=[];#f=[];#u=new Map;#h=!1;#m;#l=new WeakMap;constructor(t,e={}){(0,Ut.assertValidPattern)(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||$s,this.isWindows=this.platform==="win32";let s="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.#t=!this.preserveMultipleSlashes,this.#i=(e.optimizationLevel??1)>=2;let i=e.normalize;this.#o=i===!0?"NFC":i||void 0,this.make();let n=this.set.map(o=>this.#s(o));this.#f=this.set.map((o,h)=>this.#t&&o.length-1>n[h]),this.#r=this.set.map((o,h)=>{let a=this.#f[h]?o.length-1:o.length,l=o.slice(n[h]+1,a).filter(c=>typeof c=="string"&&!!c);return[...new Set(l)]}),this.#n=this.#r.some(o=>o.length),this.#d=this.set.map((o,h)=>{let[a,l,c]=o;if(this.#f[h]&&o.length===2&&a===w.GLOBSTAR&&l!==w.GLOBSTAR)return"tail";if(this.#f[h]&&e.matchBase&&o.length===1&&a!==w.GLOBSTAR&&a!=="")return"base";if(!(!this.#t||n[h]!==-1)){if(o.length===3&&a===w.GLOBSTAR&&c===w.GLOBSTAR&&l!==w.GLOBSTAR&&l!==""&&this.maxGlobstarRecursion>0)return"mid";if(o.length===2&&l===w.GLOBSTAR&&a!==w.GLOBSTAR&&a!=="")return"head"}})}#a(t){return this.#o?t.normalize(this.#o):t}#s(t){if(!this.isWindows)return-1;if(Le(t[0]))return 0;if(t[0]===""&&t[1]===""&&t[2]==="?"&&Le(t[3]))return 3;let s=We(t);return s===-1?-1:s+1}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.#M())];let s=this.globSet.map(n=>this.#e(n));this.globParts=this.preprocess(s),this.#h=!0;let i=this.globParts.map((n,o,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=n[2]==="?"&&$t(n[3])?6:4,l=n[0]===""&&n[1]===""&&(n[2]==="?"||!zs.test(n[2]))&&n.slice(3,a).every(u=>!zs.test(u)),c=/^[a-z]:/i.test(n[0]);if(l)return[...n.slice(0,a).map(u=>this.#a(u)),...n.slice(a).map(u=>this.parse(u))];if(c)return[this.#a(n[0]),...n.slice(1).map(u=>this.parse(u))]}return n.map(a=>this.parse(a))});if(this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let o=this.set[n];o[0]===""&&o[1]===""&&this.globParts[n][2]==="?"&&(Le(o[3])||$t(this.globParts[n][3]))&&($t(this.globParts[n][3])&&(o[3]="UNC"),o[2]="?")}e.noext||this.mergeRows(),this.#h=!1,this.set.forEach((n,o)=>{for(let h=0;h<n.length;h++)n[h]===ze&&(n[h]=this.parse(this.globParts[o][h]))})}mergeRows(){let t=!0;for(;t;){t=!1;let e=Math.max(0,...this.set.map(s=>s.length));for(let s=0;s<e;s++){let i=new Map;this.set.forEach((o,h)=>{if(!(o[s]instanceof Ls.Matcher||o[s]===ze)||!xn(this.globParts[h][s]))return;let a=[...this.globParts[h]];a[s]="";let l=`${o.length}/${a.join("/")}`,c=i.get(l);c?c.push(h):i.set(l,[h])});let n=new Set;for(let o of i.values()){if(o.length<2)continue;let[h,...a]=o,c=`@(${o.map(u=>this.globParts[u][s]).join("|")})`;this.globParts[h][s]=c,this.set[h][s]=this.parse(c);for(let u of a)n.add(u)}n.size&&(t=!0,this.set=this.set.filter((o,h)=>!n.has(h)),this.globParts=this.globParts.filter((o,h)=>!n.has(h)))}}}preprocess(t){if(this.options.noglobstar)for(let s of t)for(let i=0;i<s.length;i++)s[i]==="**"&&(s[i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let i=s;for(;e[i+1]==="**";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(t){return t.map(e=>{let s=this.#s(e)+1;return e=e.reduce((i,n)=>{let o=i[i.length-1];return n==="**"&&o==="**"?i:n===".."&&i.length>s&&o&&o!==".."&&o!=="."&&o!=="**"?(i.pop(),i):(i.push(n),i)},[]),e.length===0?[""]:e})}#b(t){let e=!this.isWindows||!t.includes("\\")?"/":t.includes("/")?"both":"\\",s=this.#t?0:-1,i="",n=0,o,h=0,a=!!this.options.dot;t:for(let l=0;l<this.set.length;l++){let c=this.set[l],u=c[c.length-1],f=s!==-1&&this.#f[l]&&u!==w.GLOBSTAR;if(f&&s===0){let d=Is(t,t.length,e);if(n=d+1,i=t.slice(n),i===""&&d>=0){let m=d;for(;m>0&&qt(t.charCodeAt(m-1),e);)m--;h=m===0?0:Is(t,m-1,e)+1,o=t.slice(h,m)}let b=this.#i&&(Be(i)||i===""&&o!==void 0&&Be(o));s=b?-1:1,f=!b}let p=-1;if(f&&typeof u=="string"&&(p=Gs(u,i,n,o,h),p===-1))continue;if(this.#n){for(let d of this.#r[l])if(!t.includes(d))continue t}if(f&&typeof u=="object"&&(p=Gs(u,i,n,o,h),p===-1))continue;let g=this.#d[l];if(g==="base"&&f)return"yes";if(g==="tail"&&f){if(this.#i&&pt(t,0,p,!0,e))return"maybe";if(!pt(t,0,p,a,e))return"yes";continue}if(g==="mid"||g==="head"){let d=this.#y(t,c,g==="head",a,e);if(d!=="no")return d;continue}return"maybe"}return"no"}#E(t,e,s){let i=!!this.options.dot,n=t.length;if(s==="head"){if(n<2||!V(e[0],t[0]))return!1;for(let h=1;h<n;h++)if(!It(t[h],i))return!1;return!0}let o=e[1];if(s==="tail"){let h=n-1;if(!V(o,t[h])&&(t[h]!==""||n===1||!V(o,t[--h])))return!1;for(let a=0;a<h;a++)if(!It(t[a],i))return!1;return!0}for(let h=0;h<n;h++){if(V(o,t[h])&&h+1<n){let a=h+1;for(;a<n&&It(t[a],i);)a++;if(a===n)return!0}if(!It(t[h],i))return!1}return!1}#y(t,e,s,i,n){if(this.#i&&pt(t,0,t.length,!0,n))return"maybe";let o=e[s?0:1],h=0;for(let a=Ge(t,h,n);a!==-1;a=Ge(t,h,n)){let l=a+1;for(;l<t.length&&qt(t.charCodeAt(l),n);)l++;if((typeof o=="string"?a-h===o.length&&t.startsWith(o,h):a>h&&o.testUnchecked(t.slice(h,a)))&&!pt(t,l,t.length,i,n))return"yes";if(s||pt(t,h,l,i,n))return"no";h=l}return"no"}#g(t){let e=De;return e?.f===t&&e.isWindows===this.isWindows&&e.preserveMultipleSlashes===this.preserveMultipleSlashes&&e.normalize===this.#o?e:void 0}#w(t){let{isWindows:e,preserveMultipleSlashes:s}=this,i=this.#e(e?t.split("\\").join("/"):t),n=this.#o;return n&&(i=i.map(o=>o.normalize(n))),De={f:t,isWindows:e,preserveMultipleSlashes:s,normalize:n,parts:i},De}#p(t){let e=[...t],s=!1;do{if(s=!1,!this.preserveMultipleSlashes){for(let o=1;o<e.length-1;o++){let h=e[o];o===1&&h===""&&e[0]===""||(h==="."||h==="")&&(s=!0,e.splice(o,1),o--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(s=!0,e.pop())}let i=this.#s(e)+1,n=i;for(;(n=e.indexOf("..",n+1))!==-1;){let o=e[n-1];o&&o!=="."&&o!==".."&&o!=="**"&&(s=!0,e.splice(n-1,2),n=Math.max(n-2,i))}}while(s);return e.length===0?[""]:e}firstPhasePreProcess(t){let{braceExpandMax:e=1e5}=this.options,s=0,i=1e6,n=!1;do{n=!1;for(let o of t){let h=-1;for(;(h=o.indexOf("**",h+1))!==-1;){let c=h;for(;o[c+1]==="**";)c++;c>h&&o.splice(h+1,c-h);let u=o[h+1],f=o[h+2],p=o[h+3];if(u!==".."||!f||f==="."||f===".."||!p||p==="."||p==="..")continue;let g=o.length-1;if(t.length>=e||s+g>i)throw new RangeError("optimizationLevel 2: too many patterns from '**/..'");n=!0,o.splice(h,1);let d=o.slice(0);d[h]="**",s+=g,t.push(d),h--}if(!this.preserveMultipleSlashes){for(let c=1;c<o.length-1;c++){let u=o[c];c===1&&u===""&&o[0]===""||(u==="."||u==="")&&(n=!0,o.splice(c,1),c--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(n=!0,o.pop())}let a=this.#s(o)+1,l=a;for(;(l=o.indexOf("..",l+1))!==-1;){let c=o[l-1];if(c&&c!=="."&&c!==".."&&c!=="**"){n=!0;let f=l===1&&o[l+1]==="**"?["."]:[];o.splice(l-1,2,...f),o.length===0&&o.push(""),l=Math.max(l-2,a)}}}}while(n);return t}secondPhasePreProcess(t){let e=new Set,s=t.filter(o=>{let h=o.join("/");return e.has(h)?!1:(e.add(h),!0)}),i=new Map;for(let o of s){let h=[];for(let a=0;a<o.length;a++)o[a]==="*"&&h.push(a);h.length&&i.set(h.join(","),h)}if(!i.size||s.length*i.size>1e5)return s;let{dot:n}=this.options;return s.filter(o=>{for(let h of i.values()){if(h[h.length-1]>=o.length)continue;let a=[...o],l=!0,c=!1;for(let u of h){let f=o[u];if(f!=="*"){if(!f||f==="**"||!n&&f.startsWith(".")){l=!1;break}a[u]="*",c=!0}}if(l&&c&&e.has(a.join("/")))return!1}return!0})}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}#O(t,e,s,i){let n=0,o=0,h=this.isWindows?We(e):-1,a=h===-1?-1:We(s);if(a!==-1){let l=s[a],c=s[a+1];typeof l!="string"||typeof c!="string"?(n=h,o=a):e[h].toLowerCase()===l.toLowerCase()&&e[h+1].toLowerCase()===c.toLowerCase()&&(n=h+2,o=a+2)}else if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0]),f=!u&&s[0]===""&&s[1]===""&&s[2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3]),p=c?3:l?0:void 0,g=f?3:u?0:void 0;if(typeof p=="number"&&typeof g=="number"){let[d,b]=[t[p],s[g]];d.toLowerCase()===b.toLowerCase()&&(o=g+1,n=p+1)}}return t=e,s.includes(w.GLOBSTAR)?this.#x(t,s,i,n,o):this.#S(t,s,i,n,o)}#x(t,e,s,i,n){let{head:o,body:h,tail:a,segments:l}=this.#v(e,s,n);if(o.length){let u=i+o.length;if(!this.#S(t,o,s,i,0,u))return!1;i+=o.length,n+=o.length}let c=0;if(a.length){if(a.length+i>t.length)return!1;let u=t.length-a.length;if(this.#S(t,a,s,u,0))c=a.length;else{if(t[t.length-1]!==""||i+a.length===t.length||(u--,!this.#S(t,a,s,u,0)))return!1;c=a.length+1}}if(!h.length){let u=!!c;for(let f=i;f<t.length-c;f++){let p=String(t[f]);if(u=!0,p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return s||u}return!!this.#_(t,l,t.length-c,i,0,s,0,!!c,new Set)}#v(t,e,s){let i=this.#l.get(t);i||(i=[],this.#l.set(t,i));let n=s*2+(e?1:0),o=i[n];if(o)return o;let h=t.indexOf(w.GLOBSTAR,s),a=t.lastIndexOf(w.GLOBSTAR),l=t.slice(s,h),c=t.slice(h+1,e?void 0:a),u=e?[]:t.slice(a+1),f=[[[],0]],p=f[0],g=0,d=[0];for(let m of c)m===w.GLOBSTAR?(d.push(g),p=[[],0],f.push(p)):(p[0].push(m),g++);f.forEach((m,y)=>{m[1]=g-d[y]});let b={head:l,body:c,tail:u,segments:f};return i[n]=b,b}#_(t,e,s,i,n,o,h,a,l){let c=e[n];if(!c){if(o)return i>=s||i===s-1&&t[i]==="";for(let g=i;g<s;g++){a=!0;let d=t[g];if(d==="."||d===".."||!this.options.dot&&d.startsWith("."))return!1}return a}let[u,f]=c,p=o?s:s-f;for(;i<=p;){let g=n*(t.length+1)+i;if(l.has(g))return!1;if(l.add(g),this.#S(t,u,o,i,0,i+u.length)&&h<this.maxGlobstarRecursion){let m=this.#_(t,e,s,i+u.length,n+1,o,h+1,a,l);if(m!==!1)return m}if(i===p)break;let b=t[i];if(b==="."||b===".."||!this.options.dot&&b.startsWith("."))return!1;i++}return o||null}#S(t,e,s,i,n,o=t.length){let h,a,l,c;for(h=i,a=n,c=Math.min(o,t.length),l=e.length;h<c&&a<l;h++,a++){let u=e[a],f=t[h];if(u===!1||u===w.GLOBSTAR||!V(u,f))return!1}if(h===c&&a===l)return!0;if(h===c)return s;if(a===l)return h===c-1&&t[h]==="";throw new Error("wtf?")}braceExpand(){return(0,w.braceExpand)(this.pattern,this.options)}#M(){let{pattern:t}=this;if(this.options.nobrace)return this.braceExpand();let e=57344;for(;t.includes(String.fromCharCode(e));)if(++e>63743)return this.braceExpand();let s=String.fromCharCode(e),i=!1,n=t.replace(_n,(h,a,l)=>{let c=Number(a),u=Number(l);return!Number.isSafeInteger(c)||!Number.isSafeInteger(u)||Math.abs(c-u)+1<vn?h:(i=!0,`${s}${a}..${l}${s}`)});if(!i)return this.braceExpand();let o=(0,w.braceExpand)(n,this.options);for(let h of o)for(let a of h.split("/")){let l=a.indexOf("[");if(l!==-1&&l<a.lastIndexOf(s))return this.braceExpand()}return this.#m=s,o}parse(t){(0,Ut.assertValidPattern)(t);let e=this.options;if(t==="**")return w.GLOBSTAR;if(t==="")return"";let{nocase:s,nocaseMagicOnly:i,noext:n=!1,dot:o,normalize:h}=e,a=this.#m,l=a&&t.includes(a)?void 0:On(t,n);if(l!==void 0&&!(s&&!i&&t.toUpperCase()!==t.toLowerCase()))return this.#a(l);if(this.#h)return ze;let c=this.#u.get(t);return c||(c=new Ls.Matcher(t,{nocase:s,noext:n,dot:o,normalize:h,...a&&{rangeMark:a}}),this.#u.set(t,c)),c}#e(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options,i=this.#g(t);if(!i){if(!e&&!this.#o&&(this.#t||this.#n)&&Bs!==t){Bs=t;let l=this.#b(t);if(l==="no")return s.flipNegate?!1:this.negate;if(l==="yes")return s.flipNegate?!0:!this.negate}i=this.#w(t)}let n=i.parts,o=this.#i?i.resolved??=this.#p(n):n,h=this.set,a=n[n.length-1];if(!a)for(let l=n.length-2;!a&&l>=0;l--)a=n[l];for(let l=0;l<h.length;l++){let c=h[l],u=e?void 0:this.#d[l];if(u==="base"?V(c[0],a):u?this.#E(o,c,u):s.matchBase&&c.length===1?this.#O([a],[a],c,e):this.#O(n,o,c,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return w.minimatch.defaults(t).Minimatch}};w.Minimatch=ht;var Cn=je();Object.defineProperty(w,"escape",{enumerable:!0,get:function(){return Cn.escape}});var Mn=Ne();Object.defineProperty(w,"unescape",{enumerable:!0,get:function(){return Mn.unescape}});w.minimatch.Minimatch=ht;w.minimatch.escape=dn.escape;w.minimatch.unescape=pn.unescape});var Ys=C(Xt=>{"use strict";var Hs=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),kn=Hs(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.tracing=r.metrics=void 0;var t=__webpack_require__(/*! node:diagnostics_channel */ "node:diagnostics_channel");r.metrics=(0,t.channel)("lru-cache:metrics"),r.tracing=(0,t.tracingChannel)("lru-cache")}),An=Hs(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.defaultPerf=void 0,r.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(Xt,"__esModule",{value:!0});Xt.LRUCache=void 0;var O=kn(),Rn=An(),Ie=()=>O.metrics.hasSubscribers||O.tracing.hasSubscribers,Xs=new Set,qs=typeof process=="object"&&process?process:{},Pn=(r,t,e,s)=>{typeof qs.emitWarning=="function"?qs.emitWarning(r,t,e,s):console.error(`[${e}] ${t}: ${r}`)},Tn=r=>!Xs.has(r),J=r=>!!r&&r===Math.floor(r)&&r>0&&isFinite(r),Ks=r=>J(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Ht:null:null,Ht=class extends Array{constructor(r){super(r),this.fill(0)}},Fn=class mt{heap;length;static#t=!1;static create(t){let e=Ks(t);if(!e)return[];mt.#t=!0;let s=new mt(t,e);return mt.#t=!1,s}constructor(t,e){if(!mt.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},jn=class Vs{#t;#n;#i;#o;#r;#d;#f;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#h;#m;#l;#a;#s;#b;#E;#y;#g;#w;#p;#O;#x;#v;#_;#S;#M;#e;#P;static unsafeExposeInternals(t){return{starts:t.#x,ttls:t.#v,autopurgeTimers:t.#_,sizes:t.#O,keyMap:t.#l,keyList:t.#a,valList:t.#s,next:t.#b,prev:t.#E,get head(){return t.#y},get tail(){return t.#g},free:t.#w,isBackgroundFetch:e=>t.#c(e),backgroundFetch:(e,s,i,n)=>t.#L(e,s,i,n),moveToTail:e=>t.#K(e),indexes:e=>t.#A(e),rindexes:e=>t.#R(e),isStale:e=>t.#C(e)}}get max(){return this.#t}get maxSize(){return this.#n}get calculatedSize(){return this.#m}get size(){return this.#h}get fetchMethod(){return this.#d}get memoMethod(){return this.#f}get dispose(){return this.#i}get onInsert(){return this.#o}get disposeAfter(){return this.#r}constructor(t){let{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:a,dispose:l,onInsert:c,disposeAfter:u,noDisposeOnSet:f,noUpdateTTL:p,maxSize:g=0,maxEntrySize:d=0,sizeCalculation:b,fetchMethod:m,memoMethod:y,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:K,ignoreFetchAbort:B,backgroundFetchSize:U=1,perf:rt}=t;if(this.backgroundFetchSize=U,rt!==void 0&&typeof rt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=rt??Rn.defaultPerf,e!==0&&!J(e))throw new TypeError("max option must be a nonnegative integer");let Se=e?Ks(e):Array;if(!Se)throw new Error("invalid max value: "+e);if(this.#t=e,this.#n=g,this.maxEntrySize=d||this.#n,this.sizeCalculation=b,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=y,m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#d=m,this.#M=!!m,this.#l=new Map,this.#a=Array.from({length:e}).fill(void 0),this.#s=Array.from({length:e}).fill(void 0),this.#b=new Se(e),this.#E=new Se(e),this.#y=0,this.#g=0,this.#w=Fn.create(e),this.#h=0,this.#m=0,typeof l=="function"&&(this.#i=l),typeof c=="function"&&(this.#o=c),typeof u=="function"?(this.#r=u,this.#p=[]):(this.#r=void 0,this.#p=void 0),this.#S=!!this.#i,this.#P=!!this.#o,this.#e=!!this.#r,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!K,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#n!==0&&!J(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!J(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#U()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=J(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!J(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(this.#t===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#n){let ve="LRU_CACHE_UNBOUNDED";Tn(ve)&&(Xs.add(ve),Pn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ve,Vs))}}getRemainingTTL(t){return this.#l.has(t)?1/0:0}#T(){let t=new Ht(this.#t),e=new Ht(this.#t);this.#v=t,this.#x=e;let s=this.ttlAutopurge?Array.from({length:this.#t}):void 0;this.#_=s,this.#z=(a,l,c=this.#u.now())=>{e[a]=l!==0?c:0,t[a]=l,i(a,l)},this.#k=a=>{e[a]=t[a]!==0?this.#u.now():0,i(a,t[a])};let i=this.ttlAutopurge?(a,l)=>{if(s?.[a]&&(clearTimeout(s[a]),s[a]=void 0),l&&l!==0&&s){let c=setTimeout(()=>{this.#C(a)?(this.#W(this.#a[a],"expire"),s[a]=void 0):i(a,h(a))},l+1);c.unref&&c.unref(),s[a]=c}}:()=>{};this.#F=(a,l)=>{if(t[l]){let c=t[l],u=e[l];if(!c||!u)return;a.ttl=c,a.start=u,a.now=n||o();let f=a.now-u;a.remainingTTL=c-f}};let n=0,o=()=>{let a=this.#u.now();if(this.ttlResolution>0){n=a;let l=setTimeout(()=>n=0,this.ttlResolution);l.unref&&l.unref()}return a};this.getRemainingTTL=a=>{let l=this.#l.get(a);return l===void 0?0:h(l)};let h=a=>{let l=t[a],c=e[a];if(!l||!c)return 1/0;let u=(n||o())-c;return l-u};this.#C=a=>{let l=e[a],c=t[a];return!!c&&!!l&&(n||o())-l>c}}#k=()=>{};#F=()=>{};#z=()=>{};#C=()=>!1;#U(){let t=new Ht(this.#t);this.#m=0,this.#O=t,this.#N=e=>{this.#m-=t[e],t[e]=0},this.#B=(e,s,i,n)=>{if(!J(i)){if(this.#c(s))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(s,e),!J(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#j=(e,s,i)=>{if(t[e]=s,this.#n){let n=this.#n-t[e];for(;this.#m>n;)this.#$(!0)}this.#m+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#m)}}#N=t=>{};#j=(t,e,s)=>{};#B=(t,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#g;this.#G(e)&&((t||!this.#C(e))&&(yield e),e!==this.#y);)e=this.#E[e]}*#R({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#y;this.#G(e)&&((t||!this.#C(e))&&(yield e),e!==this.#g);)e=this.#b[e]}#G(t){return t!==void 0&&this.#l.get(this.#a[t])===t}*entries(){for(let t of this.#A())this.#s[t]!==void 0&&this.#a[t]!==void 0&&!this.#c(this.#s[t])&&(yield[this.#a[t],this.#s[t]])}*rentries(){for(let t of this.#R())this.#s[t]!==void 0&&this.#a[t]!==void 0&&!this.#c(this.#s[t])&&(yield[this.#a[t],this.#s[t]])}*keys(){for(let t of this.#A()){let e=this.#a[t];e!==void 0&&!this.#c(this.#s[t])&&(yield e)}}*rkeys(){for(let t of this.#R()){let e=this.#a[t];e!==void 0&&!this.#c(this.#s[t])&&(yield e)}}*values(){for(let t of this.#A())this.#s[t]!==void 0&&!this.#c(this.#s[t])&&(yield this.#s[t])}*rvalues(){for(let t of this.#R())this.#s[t]!==void 0&&!this.#c(this.#s[t])&&(yield this.#s[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#A()){let i=this.#s[s],n=this.#c(i)?i.__staleWhileFetching:i;if(n!==void 0&&t(n,this.#a[s],this))return this.#X(this.#a[s],e)}}forEach(t,e=this){for(let s of this.#A()){let i=this.#s[s],n=this.#c(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#a[s],this)}}rforEach(t,e=this){for(let s of this.#R()){let i=this.#s[s],n=this.#c(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#a[s],this)}}purgeStale(){let t=!1;for(let e of this.#R({allowStale:!0}))this.#C(e)&&(this.#W(this.#a[e],"expire"),t=!0);return t}info(t){let e=this.#l.get(t);if(e===void 0)return;let s=this.#s[e],i=this.#c(s)?s.__staleWhileFetching:s;if(i===void 0)return;let n={value:i};if(this.#v&&this.#x){let o=this.#v[e],h=this.#x[e];if(o&&h){let a=o-(this.#u.now()-h);n.ttl=a,n.start=Date.now()}}return this.#O&&(n.size=this.#O[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let s=this.#a[e],i=this.#s[e],n=this.#c(i)?i.__staleWhileFetching:i;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#v&&this.#x){o.ttl=this.#v[e];let h=this.#u.now()-this.#x[e];o.start=Math.floor(Date.now()-h)}this.#O&&(o.size=this.#O[e]),t.unshift([s,o])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let i=Date.now()-s.start;s.start=this.#u.now()-i}this.#D(e,s.value,s)}}set(t,e,s={}){let{status:i=O.metrics.hasSubscribers?{}:void 0}=s;s.status=i,i&&(i.op="set",i.key=t,e!==void 0&&(i.value=e),i.cache=this);let n=this.#D(t,e,s);return i&&O.metrics.hasSubscribers&&O.metrics.publish(i),n}#D(t,e,s,i){let{ttl:n=this.ttl,start:o,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=s,c=this.#c(e);if(e===void 0)return l&&(l.set="deleted"),this.delete(t),this;let{noUpdateTTL:u=this.noUpdateTTL}=s;l&&!c&&(l.value=e);let f=this.#B(t,e,s.size||0,a,l);if(this.maxEntrySize&&f>this.maxEntrySize)return this.#W(t,"set"),l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this;let p=this.#h===0?void 0:this.#l.get(t);if(p===void 0)p=this.#h===0?this.#g:this.#w.length!==0?this.#w.pop():this.#h===this.#t?this.#$(!1):this.#h,this.#a[p]=t,this.#s[p]=e,this.#l.set(t,p),this.#b[this.#g]=p,this.#E[p]=this.#g,this.#g=p,this.#h++,this.#j(p,f,l),l&&(l.set="add"),u=!1,this.#P&&!c&&this.#o?.(e,t,"add");else{this.#K(p);let g=this.#s[p];if(e!==g){if(!h)if(this.#c(g)){g!==i&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=g;d!==void 0&&d!==e&&(this.#S&&this.#i?.(d,t,"set"),this.#e&&this.#p?.push([d,t,"set"]))}else this.#S&&this.#i?.(g,t,"set"),this.#e&&this.#p?.push([g,t,"set"]);if(this.#N(p),this.#j(p,f,l),this.#s[p]=e,!c){let d=g&&this.#c(g)?g.__staleWhileFetching:g,b=d===void 0?"add":e!==d?"replace":"update";l&&(l.set=b,d!==void 0&&(l.oldValue=d)),this.#P&&this.onInsert?.(e,t,b)}}else c||(l&&(l.set="update"),this.#P&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#v&&this.#T(),this.#v&&(u||this.#z(p,n,o),l&&this.#F(l,p)),!h&&this.#e&&this.#p){let g=this.#p,d;for(;d=g?.shift();)this.#r?.(...d)}return this}pop(){try{for(;this.#h;){let t=this.#s[this.#y];if(this.#$(!0),this.#c(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#e&&this.#p){let t=this.#p,e;for(;e=t?.shift();)this.#r?.(...e)}}}#$(t){let e=this.#y,s=this.#a[e],i=this.#s[e],n=this.#c(i);n&&i.__abortController.abort(new Error("evicted"));let o=n?i.__staleWhileFetching:i;return(this.#S||this.#e)&&o!==void 0&&(this.#S&&this.#i?.(o,s,"evict"),this.#e&&this.#p?.push([o,s,"evict"])),this.#N(e),this.#_?.[e]&&(clearTimeout(this.#_[e]),this.#_[e]=void 0),t&&(this.#a[e]=void 0,this.#s[e]=void 0,this.#w.push(e)),this.#h===1?(this.#y=this.#g=0,this.#w.length=0):this.#y=this.#b[e],this.#l.delete(s),this.#h--,e}has(t,e={}){let{status:s=O.metrics.hasSubscribers?{}:void 0}=e;e.status=s,s&&(s.op="has",s.key=t,s.cache=this);let i=this.#V(t,e);return O.metrics.hasSubscribers&&O.metrics.publish(s),i}#V(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,n=this.#l.get(t);if(n!==void 0){let o=this.#s[n];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#C(n))i&&(i.has="stale",this.#F(i,n));else return s&&this.#k(n),i&&(i.has="hit",this.#F(i,n)),!0}else i&&(i.has="miss");return!1}peek(t,e={}){let{status:s=Ie()?{}:void 0}=e;s&&(s.op="peek",s.key=t,s.cache=this),e.status=s;let i=this.#q(t,e);return O.metrics.hasSubscribers&&O.metrics.publish(s),i}#q(t,e){let{status:s,allowStale:i=this.allowStale}=e,n=this.#l.get(t);if(n===void 0||!i&&this.#C(n)){s&&(s.peek=n===void 0?"miss":"stale");return}let o=this.#s[n],h=this.#c(o)?o.__staleWhileFetching:o;return s&&(h!==void 0?(s.peek="hit",s.value=h):s.peek="miss"),h}#L(t,e,s,i){let n=e===void 0?void 0:this.#s[e];if(this.#c(n))return n;let o=new AbortController,{signal:h}=s;h?.addEventListener("abort",()=>o.abort(h.reason),{signal:o.signal});let a={signal:o.signal,options:s,context:i},l=(d,b=!1)=>{let{aborted:m}=o.signal,y=s.ignoreFetchAbort&&d!==void 0,_=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&d!==void 0);if(s.status&&(m&&!b?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,y&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),m&&!y&&!b)return u(o.signal.reason,_);let v=p,S=this.#s[e];return(S===p||S===void 0&&y&&b)&&(d===void 0?v.__staleWhileFetching!==void 0?this.#s[e]=v.__staleWhileFetching:this.#W(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.#D(t,d,a.options,v))),d},c=d=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=d),u(d,!1)),u=(d,b)=>{let{aborted:m}=o.signal,y=m&&s.allowStaleOnFetchAbort,_=y||s.allowStaleOnFetchRejection,v=_||s.noDeleteOnFetchRejection,S=p;if(this.#s[e]===p&&(!v||!b&&S.__staleWhileFetching===void 0?this.#W(t,"fetch"):y||(this.#s[e]=S.__staleWhileFetching)),_)return s.status&&S.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw d},f=(d,b)=>{let m=this.#d?.(t,n,a);o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(d(void 0),s.allowStaleOnFetchAbort&&(d=y=>l(y,!0)))}),m&&m instanceof Promise?m.then(y=>d(y===void 0?void 0:y),b):m!==void 0&&d(m)};s.status&&(s.status.fetchDispatched=!0);let p=new Promise(f).then(l,c),g=Object.assign(p,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#D(t,g,{...a.options,status:void 0}),e=this.#l.get(t)):this.#s[e]=g,g}#c(t){if(!this.#M)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let s=O.tracing.hasSubscribers,{status:i=Ie()?{}:void 0}=e;e.status=i,i&&e.context&&(i.context=e.context);let n=this.#H(t,e);return i&&s&&(i.trace=!0,O.tracing.tracePromise(()=>n,i).catch(()=>{})),n}async#H(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:d,forceRefresh:b=!1,status:m,signal:y}=e;if(m&&(m.op="fetch",m.key=t,b&&(m.forceRefresh=!0),m.cache=this),!this.#M)return m&&(m.fetch="get"),this.#X(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:m});let _={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:h,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:m,signal:y},v=this.#l.get(t);if(v===void 0){m&&(m.fetch="miss");let S=this.#L(t,v,_,d);return S.__returned=S}else{let S=this.#s[v];if(this.#c(S)){let rt=s&&S.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",rt&&(m.returnedStale=!0)),rt?S.__staleWhileFetching:S.__returned=S}let K=this.#C(v);if(!b&&!K)return m&&(m.fetch="hit"),this.#K(v),i&&this.#k(v),m&&this.#F(m,v),S;let B=this.#L(t,v,_,d),U=B.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=K?"stale":"refresh",U&&K&&(m.returnedStale=!0)),U?B.__staleWhileFetching:B.__returned=B}}forceFetch(t,e={}){let s=O.tracing.hasSubscribers,{status:i=Ie()?{}:void 0}=e;e.status=i,i&&e.context&&(i.context=e.context);let n=this.#I(t,e);return i&&s&&(i.trace=!0,O.tracing.tracePromise(()=>n,i).catch(()=>{})),n}async#I(t,e={}){let s=await this.#H(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let{status:s=O.metrics.hasSubscribers?{}:void 0}=e;e.status=s,s&&(s.op="memo",s.key=t,e.context&&(s.context=e.context),s.cache=this);let i=this.#Z(t,e);return s&&(s.value=i),O.metrics.hasSubscribers&&O.metrics.publish(s),i}#Z(t,e={}){let s=this.#f;if(!s)throw new Error("no memoMethod provided to constructor");let{context:i,status:n,forceRefresh:o,...h}=e;n&&o&&(n.forceRefresh=!0);let a=this.#X(t,h),l=o||a===void 0;if(n&&(n.memo=l?"miss":"hit",l||(n.value=a)),!l)return a;let c=s(t,a,{options:h,context:i});return n&&(n.value=c),this.#D(t,c,h),c}get(t,e={}){let{status:s=O.metrics.hasSubscribers?{}:void 0}=e;e.status=s,s&&(s.op="get",s.key=t,s.cache=this);let i=this.#X(t,e);return s&&(i!==void 0&&(s.value=i),O.metrics.hasSubscribers&&O.metrics.publish(s)),i}#X(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,h=this.#l.get(t);if(h===void 0){o&&(o.get="miss");return}let a=this.#s[h],l=this.#c(a);return o&&this.#F(o,h),this.#C(h)?l?(o&&(o.get="stale-fetching"),s&&a.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#W(t,"expire"),o&&(o.get="stale"),s?(o&&(o.returnedStale=!0),a):void 0):(o&&(o.get=l?"fetching":"hit"),this.#K(h),i&&this.#k(h),l?a.__staleWhileFetching:a)}#Y(t,e){this.#E[e]=t,this.#b[t]=e}#K(t){t!==this.#g&&(t===this.#y?this.#y=this.#b[t]:this.#Y(this.#E[t],this.#b[t]),this.#Y(this.#g,t),this.#g=t)}delete(t){return this.#W(t,"delete")}#W(t,e){O.metrics.hasSubscribers&&O.metrics.publish({op:"delete",delete:e,key:t,cache:this});let s=!1;if(this.#h!==0){let i=this.#l.get(t);if(i!==void 0)if(this.#_?.[i]&&(clearTimeout(this.#_[i]),this.#_[i]=void 0),s=!0,this.#h===1)this.#J(e);else{this.#N(i);let n=this.#s[i];if(this.#c(n)?n.__abortController.abort(new Error("deleted")):(this.#S||this.#e)&&(this.#S&&this.#i?.(n,t,e),this.#e&&this.#p?.push([n,t,e])),this.#l.delete(t),this.#a[i]=void 0,this.#s[i]=void 0,i===this.#g)this.#g=this.#E[i];else if(i===this.#y)this.#y=this.#b[i];else{let o=this.#E[i];this.#b[o]=this.#b[i];let h=this.#b[i];this.#E[h]=this.#E[i]}this.#h--,this.#w.push(i)}}if(this.#e&&this.#p?.length){let i=this.#p,n;for(;n=i?.shift();)this.#r?.(...n)}return s}clear(){return this.#J("delete")}#J(t){for(let e of this.#R({allowStale:!0})){let s=this.#s[e];if(this.#c(s))s.__abortController.abort(new Error("deleted"));else{let i=this.#a[e];this.#S&&this.#i?.(s,i,t),this.#e&&this.#p?.push([s,i,t])}}if(this.#l.clear(),this.#s.fill(void 0),this.#a.fill(void 0),this.#v&&this.#x){this.#v.fill(0),this.#x.fill(0);for(let e of this.#_??[])e!==void 0&&clearTimeout(e);this.#_?.fill(void 0)}if(this.#O&&this.#O.fill(0),this.#y=0,this.#g=0,this.#w.length=0,this.#m=0,this.#h=0,this.#e&&this.#p){let e=this.#p,s;for(;s=e?.shift();)this.#r?.(...s)}}};Xt.LRUCache=jn});var Ye=C(j=>{"use strict";var Nn=j&&j.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(j,"__esModule",{value:!0});j.Minipass=j.isWritable=j.isReadable=j.isStream=void 0;var Js=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ve=__webpack_require__(/*! node:events */ "node:events"),ei=Nn(__webpack_require__(/*! node:stream */ "node:stream")),Dn=__webpack_require__(/*! node:string_decoder */ "node:string_decoder"),Ln=r=>!!r&&typeof r=="object"&&(r instanceof te||r instanceof ei.default||(0,j.isReadable)(r)||(0,j.isWritable)(r));j.isStream=Ln;var Wn=r=>!!r&&typeof r=="object"&&r instanceof Ve.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==ei.default.Writable.prototype.pipe;j.isReadable=Wn;var zn=r=>!!r&&typeof r=="object"&&r instanceof Ve.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function";j.isWritable=zn;var H=Symbol("EOF"),X=Symbol("maybeEmitEnd"),Z=Symbol("emittedEnd"),Kt=Symbol("emittingEnd"),gt=Symbol("emittedError"),Vt=Symbol("closed"),Zs=Symbol("read"),Yt=Symbol("flush"),Qs=Symbol("flushChunk"),W=Symbol("encoding"),at=Symbol("decoder"),M=Symbol("flowing"),wt=Symbol("paused"),lt=Symbol("resume"),k=Symbol("buffer"),F=Symbol("pipes"),A=Symbol("bufferLength"),$e=Symbol("bufferPush"),Jt=Symbol("bufferShift"),P=Symbol("objectMode"),x=Symbol("destroyed"),Ue=Symbol("error"),qe=Symbol("emitData"),ti=Symbol("emitEnd"),He=Symbol("emitEnd2"),G=Symbol("async"),Xe=Symbol("abort"),Zt=Symbol("aborted"),bt=Symbol("signal"),st=Symbol("dataListeners"),N=Symbol("discarded"),yt=r=>Promise.resolve().then(r),Bn=r=>r(),Gn=r=>r==="end"||r==="finish"||r==="prefinish",In=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,$n=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Qt=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[lt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ke=class extends Qt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=i=>this.dest.emit("error",i),t.on("error",this.proxyErrors)}},Un=r=>!!r.objectMode,qn=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",te=class extends Ve.EventEmitter{[M]=!1;[wt]=!1;[F]=[];[k]=[];[P];[W];[G];[at];[H]=!1;[Z]=!1;[Kt]=!1;[Vt]=!1;[gt]=null;[A]=0;[x]=!1;[bt];[Zt]=!1;[st]=0;[N]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Un(e)?(this[P]=!0,this[W]=null):qn(e)?(this[W]=e.encoding,this[P]=!1):(this[P]=!1,this[W]=null),this[G]=!!e.async,this[at]=this[W]?new Dn.StringDecoder(this[W]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[k]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[F]});let{signal:s}=e;s&&(this[bt]=s,s.aborted?this[Xe]():s.addEventListener("abort",()=>this[Xe]()))}get bufferLength(){return this[A]}get encoding(){return this[W]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[P]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[G]}set async(t){this[G]=this[G]||!!t}[Xe](){this[Zt]=!0,this.emit("abort",this[bt]?.reason),this.destroy(this[bt]?.reason)}get aborted(){return this[Zt]}set aborted(t){}write(t,e,s){if(this[Zt])return!1;if(this[H])throw new Error("write after end");if(this[x])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let i=this[G]?yt:Bn;if(!this[P]&&!Buffer.isBuffer(t)){if($n(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(In(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[P]?(this[M]&&this[A]!==0&&this[Yt](!0),this[M]?this.emit("data",t):this[$e](t),this[A]!==0&&this.emit("readable"),s&&i(s),this[M]):t.length?(typeof t=="string"&&!(e===this[W]&&!this[at]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[W]&&(t=this[at].write(t)),this[M]&&this[A]!==0&&this[Yt](!0),this[M]?this.emit("data",t):this[$e](t),this[A]!==0&&this.emit("readable"),s&&i(s),this[M]):(this[A]!==0&&this.emit("readable"),s&&i(s),this[M])}read(t){if(this[x])return null;if(this[N]=!1,this[A]===0||t===0||t&&t>this[A])return this[X](),null;this[P]&&(t=null),this[k].length>1&&!this[P]&&(this[k]=[this[W]?this[k].join(""):Buffer.concat(this[k],this[A])]);let e=this[Zs](t||null,this[k][0]);return this[X](),e}[Zs](t,e){if(this[P])this[Jt]();else{let s=e;t===s.length||t===null?this[Jt]():typeof s=="string"?(this[k][0]=s.slice(t),e=s.slice(0,t),this[A]-=t):(this[k][0]=s.subarray(t),e=s.subarray(0,t),this[A]-=t)}return this.emit("data",e),!this[k].length&&!this[H]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[H]=!0,this.writable=!1,(this[M]||!this[wt])&&this[X](),this}[lt](){this[x]||(!this[st]&&!this[F].length&&(this[N]=!0),this[wt]=!1,this[M]=!0,this.emit("resume"),this[k].length?this[Yt]():this[H]?this[X]():this.emit("drain"))}resume(){return this[lt]()}pause(){this[M]=!1,this[wt]=!0,this[N]=!1}get destroyed(){return this[x]}get flowing(){return this[M]}get paused(){return this[wt]}[$e](t){this[P]?this[A]+=1:this[A]+=t.length,this[k].push(t)}[Jt](){return this[P]?this[A]-=1:this[A]-=this[k][0].length,this[k].shift()}[Yt](t=!1){do;while(this[Qs](this[Jt]())&&this[k].length);!t&&!this[k].length&&!this[H]&&this.emit("drain")}[Qs](t){return this.emit("data",t),this[M]}pipe(t,e){if(this[x])return t;this[N]=!1;let s=this[Z];return e=e||{},t===Js.stdout||t===Js.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[F].push(e.proxyErrors?new Ke(this,t,e):new Qt(this,t,e)),this[G]?yt(()=>this[lt]()):this[lt]()),t}unpipe(t){let e=this[F].find(s=>s.dest===t);e&&(this[F].length===1?(this[M]&&this[st]===0&&(this[M]=!1),this[F]=[]):this[F].splice(this[F].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[N]=!1,this[st]++,!this[F].length&&!this[M]&&this[lt]();else if(t==="readable"&&this[A]!==0)super.emit("readable");else if(Gn(t)&&this[Z])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[gt]){let i=e;this[G]?yt(()=>i.call(this,this[gt])):i.call(this,this[gt])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[st]=this.listeners("data").length,this[st]===0&&!this[N]&&!this[F].length&&(this[M]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[st]=0,!this[N]&&!this[F].length&&(this[M]=!1)),e}get emittedEnd(){return this[Z]}[X](){!this[Kt]&&!this[Z]&&!this[x]&&this[k].length===0&&this[H]&&(this[Kt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Vt]&&this.emit("close"),this[Kt]=!1)}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==x&&this[x])return!1;if(t==="data")return!this[P]&&!s?!1:this[G]?(yt(()=>this[qe](s)),!0):this[qe](s);if(t==="end")return this[ti]();if(t==="close"){if(this[Vt]=!0,!this[Z]&&!this[x])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[gt]=s,super.emit(Ue,s);let n=!this[bt]||this.listeners("error").length?super.emit("error",s):!1;return this[X](),n}else if(t==="resume"){let n=super.emit("resume");return this[X](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let i=super.emit(t,...e);return this[X](),i}[qe](t){for(let s of this[F])s.dest.write(t)===!1&&this.pause();let e=this[N]?!1:super.emit("data",t);return this[X](),e}[ti](){return this[Z]?!1:(this[Z]=!0,this.readable=!1,this[G]?(yt(()=>this[He]()),!0):this[He]())}[He](){if(this[at]){let e=this[at].end();if(e){for(let s of this[F])s.dest.write(e);this[N]||super.emit("data",e)}}for(let e of this[F])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[P]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[P]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[P])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[W]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(x,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[N]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[H])return e();let n,o,h=u=>{this.off("data",a),this.off("end",l),this.off(x,c),e(),o(u)},a=u=>{this.off("error",h),this.off("end",l),this.off(x,c),this.pause(),n({value:u,done:!!this[H]})},l=()=>{this.off("error",h),this.off("data",a),this.off(x,c),e(),n({done:!0,value:void 0})},c=()=>h(new Error("stream destroyed"));return new Promise((u,f)=>{o=f,n=u,this.once(x,c),this.once("error",h),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[N]=!1;let t=!1,e=()=>(this.pause(),this.off(Ue,e),this.off(x,e),this.off("end",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let i=this.read();return i===null?e():{done:!1,value:i}};return this.once("end",e),this.once(Ue,e),this.once(x,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[x])return t?this.emit("error",t):this.emit(x),this;this[x]=!0,this[N]=!0,this[k].length=0,this[A]=0;let e=this;return typeof e.close=="function"&&!this[Vt]&&e.close(),t?this.emit("error",t):this.emit(x),this}static get isStream(){return j.isStream}};j.Minipass=te});var mi=C(E=>{"use strict";var Hn=E&&E.__createBinding||(Object.create?(function(r,t,e,s){s===void 0&&(s=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,s,i)}):(function(r,t,e,s){s===void 0&&(s=e),r[s]=t[e]})),Xn=E&&E.__setModuleDefault||(Object.create?(function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}):function(r,t){r.default=t}),Kn=E&&E.__importStar||(function(){var r=function(t){return r=Object.getOwnPropertyNames||function(e){var s=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[s.length]=i);return s},r(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s=r(t),i=0;i<s.length;i++)s[i]!=="default"&&Hn(e,t,s[i]);return Xn(e,t),e}})();Object.defineProperty(E,"__esModule",{value:!0});E.PathScurry=E.Path=E.PathScurryDarwin=E.PathScurryPosix=E.PathScurryWin32=E.PathScurryBase=E.PathPosix=E.PathWin32=E.PathBase=E.ChildrenCache=E.ResolveCache=void 0;var ae=Ys(),re=__webpack_require__(/*! node:path */ "node:path"),Vn=__webpack_require__(/*! node:url */ "node:url"),vt=__webpack_require__(/*! fs */ "fs"),Yn=Kn(__webpack_require__(/*! node:fs */ "node:fs")),Jn=vt.realpathSync.native,ee=__webpack_require__(/*! node:fs/promises */ "node:fs/promises"),si=Ye(),_t={lstatSync:vt.lstatSync,readdir:vt.readdir,readdirSync:vt.readdirSync,readlinkSync:vt.readlinkSync,realpathSync:Jn,promises:{lstat:ee.lstat,readdir:ee.readdir,readlink:ee.readlink,realpath:ee.realpath}},ai=r=>!r||r===_t||r===Yn?_t:{..._t,...r,promises:{..._t.promises,...r.promises}},Zn=/^\\\\\?\\([a-z]:)\\?$/i,Qn=/^\\\\\?\\UNC\\([^\\]+\\[^\\]+)\\?$/i,tr=/^\\\\[^\\?]+\\[^\\]+$/,ii=r=>r.replace(/\//g,"\\").replace(Zn,"$1\\").replace(Qn,"\\\\$1\\").replace(tr,"$&\\"),er=/^[\\/]{2}\?[\\/]unc[\\/][^\\/]+[\\/][^\\/]+(?:[\\/]|$)/i,sr=/^[\\/]{2}\?[\\/](?=[a-z]:)/i,ir=/^[\\/]{2}\?[\\/]unc(?=[\\/][^\\/]+[\\/][^\\/])/i,nr=/[\\/]/,L=0,li=1,ci=2,I=4,ui=6,fi=8,it=10,di=12,D=15,St=~D,Je=16,ni=32,Et=64,z=128,se=256,ne=512,ri=Et|z|ne,rr=1023,Ze=r=>r.isFile()?fi:r.isDirectory()?I:r.isSymbolicLink()?it:r.isCharacterDevice()?ci:r.isBlockDevice()?ui:r.isSocket()?di:r.isFIFO()?li:L,oi=new ae.LRUCache({max:2**12}),Ot=r=>{let t=oi.get(r);if(t)return t;let e=r.normalize("NFKD");return oi.set(r,e),e},hi=new ae.LRUCache({max:2**12}),ie=r=>{let t=hi.get(r);if(t)return t;let e=Ot(r.toLowerCase());return hi.set(r,e),e},xt=class extends ae.LRUCache{constructor(){super({max:256})}};E.ResolveCache=xt;var oe=class extends ae.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}};E.ChildrenCache=oe;var pi=Symbol("PathScurry setAsCwd"),R=class{name;root;roots;parent;nocase;isCWD=!1;#t;#n;get dev(){return this.#n}#i;get mode(){return this.#i}#o;get nlink(){return this.#o}#r;get uid(){return this.#r}#d;get gid(){return this.#d}#f;get rdev(){return this.#f}#u;get blksize(){return this.#u}#h;get ino(){return this.#h}#m;get size(){return this.#m}#l;get blocks(){return this.#l}#a;get atimeMs(){return this.#a}#s;get mtimeMs(){return this.#s}#b;get ctimeMs(){return this.#b}#E;get birthtimeMs(){return this.#E}#y;get atime(){return this.#y}#g;get mtime(){return this.#g}#w;get ctime(){return this.#w}#p;get birthtime(){return this.#p}#O;#x;#v;#_;#S;#M;#e;#P;#T;#k;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=L,s,i,n,o,h){this.name=t,this.#O=n?ie(t):Ot(t),this.#e=e&rr,this.nocase=n,this.roots=i,this.root=s||this,this.#P=o,this.#v=h.fullpath,this.#S=h.relative,this.#M=h.relativePosix,this.parent=h.parent,this.parent?this.#t=this.parent.#t:this.#t=ai(h.fs)}get fs(){return this.#t}depth(){return this.#x!==void 0?this.#x:this.parent?this.#x=this.parent.depth()+1:this.#x=0}childrenCache(){return this.#P}resolve(t){if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#F(i):this.#F(i)}#F(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#P.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#P.set(this,e),this.#e&=~Je,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),i=this.nocase?ie(t):Ot(t);for(let a of s)if(a.#O===i)return a;let n=this.parent?this.sep:"",o=this.#v?this.#v+n+t:void 0,h=this.newChild(t,L,{...e,parent:this,fullpath:o});return this.canReaddir()||(h.#e|=z),s.push(h),h}relative(){if(this.isCWD)return"";if(this.#S!==void 0)return this.#S;let t=this.name,e=this.parent;if(!e)return this.#S=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#M!==void 0)return this.#M;let t=this.name,e=this.parent;if(!e)return this.#M=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#v!==void 0)return this.#v;let t=this.name,e=this.parent;if(!e)return this.#v=this.name;let i=e.fullpath()+(e.parent?this.sep:"")+t;return this.#v=i}fullpathPosix(){if(this.#_!==void 0)return this.#_;if(this.sep==="/")return this.#_=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#_=`//?/${i}`:this.#_=i}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#_=s}isUnknown(){return(this.#e&D)===L}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#e&D)===fi}isDirectory(){return(this.#e&D)===I}isCharacterDevice(){return(this.#e&D)===ci}isBlockDevice(){return(this.#e&D)===ui}isFIFO(){return(this.#e&D)===li}isSocket(){return(this.#e&D)===di}isSymbolicLink(){return(this.#e&it)===it}lstatCached(){return this.#e&ni?this:void 0}readlinkCached(){return this.#T}realpathCached(){return this.#k}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#T)return!0;if(!this.parent)return!1;let t=this.#e&D;return!(t!==L&&t!==it||this.#e&se||this.#e&z)}calledReaddir(){return!!(this.#e&Je)}isENOENT(){return!!(this.#e&z)}isNamed(t){return this.nocase?this.#O===ie(t):this.#O===Ot(t)}async readlink(){let t=this.#T;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#T=s}catch(e){this.#R(e.code);return}}readlinkSync(){let t=this.#T;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#T=s}catch(e){this.#R(e.code);return}}#z(t){this.#e|=Je;for(let e=t.provisional;e<t.length;e++){let s=t[e];s&&s.#C()}}#C(){this.#e&z||(this.#e=(this.#e|z)&St,this.#U())}#U(){let t=this.children();t.provisional=0;for(let e of t)e.#C()}#N(){this.#e|=ne,this.#j()}#j(){if(this.#e&Et)return;let t=this.#e;(t&D)===I&&(t&=St),this.#e=t|Et,this.#U()}#B(t=""){t==="ENOTDIR"||t==="EPERM"?this.#j():t==="ENOENT"?this.#C():this.children().provisional=0}#A(t=""){t==="ENOTDIR"?this.parent.#j():t==="ENOENT"&&this.#C()}#R(t=""){let e=this.#e;e|=se,t==="ENOENT"&&(e|=z),(t==="EINVAL"||t==="UNKNOWN")&&(e&=St),this.#e=e,t==="ENOTDIR"&&this.parent&&this.parent.#j()}#G(t,e){return this.#$(t,e)||this.#D(t,e)}#D(t,e){let s=Ze(t),i=this.newChild(t.name,s,{parent:this}),n=i.#e&D;return n!==I&&n!==it&&n!==L&&(i.#e|=Et),e.unshift(i),e.provisional++,i}#$(t,e){for(let s=e.provisional;s<e.length;s++){let i=e[s];if((this.nocase?ie(t.name):Ot(t.name))===i.#O)return this.#V(t,i,s,e)}}#V(t,e,s,i){let n=e.name;return e.#e=e.#e&St|Ze(t),n!==t.name&&(e.name=t.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(e)),i.provisional++,e}async lstat(){if((this.#e&z)===0)try{return this.#q(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#A(t.code)}}lstatSync(){if((this.#e&z)===0)try{return this.#q(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#A(t.code)}}#q(t){let{atime:e,atimeMs:s,birthtime:i,birthtimeMs:n,blksize:o,blocks:h,ctime:a,ctimeMs:l,dev:c,gid:u,ino:f,mode:p,mtime:g,mtimeMs:d,nlink:b,rdev:m,size:y,uid:_}=t;this.#y=e,this.#a=s,this.#p=i,this.#E=n,this.#u=o,this.#l=h,this.#w=a,this.#b=l,this.#n=c,this.#d=u,this.#h=f,this.#i=p,this.#g=g,this.#s=d,this.#o=b,this.#f=m,this.#m=y,this.#r=_;let v=Ze(t);this.#e=this.#e&St|v|ni,v!==L&&v!==I&&v!==it&&(this.#e|=Et)}#L=[];#c=!1;#H(t){this.#c=!1;let e=this.#L.slice();this.#L.length=0,e.forEach(s=>s(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);e?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#L.push(t),this.#c)return;this.#c=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(n,o)=>{if(n)this.#B(n.code),s.provisional=0;else{for(let h of o)this.#G(h,s);this.#z(s)}this.#H(s.slice(0,s.provisional))})}#I;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#I)await this.#I;else{let s=()=>{};this.#I=new Promise(i=>s=i);try{for(let i of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#G(i,t);this.#z(t)}catch(i){this.#B(i.code),t.provisional=0}this.#I=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#G(s,t);this.#z(t)}catch(s){this.#B(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#e&ri)return!1;let t=D&this.#e;return t===L||t===I||t===it}shouldWalk(t,e){return(this.#e&I)===I&&!(this.#e&ri)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#k)return this.#k;if(!((ne|se|z)&this.#e))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#k=this.resolve(t)}catch{this.#N()}}realpathSync(){if(this.#k)return this.#k;if(!((ne|se|z)&this.#e))try{let t=this.#t.realpathSync(this.fullpath());return this.#k=this.resolve(t)}catch{this.#N()}}[pi](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],i=this;for(;i&&i.parent;)e.add(i),i.#S=s.join(this.sep),i.#M=s.join("/"),i=i.parent,s.push("..");for(i=t;i&&i.parent&&!e.has(i);)i.#S=void 0,i.#M=void 0,i=i.parent}};E.PathBase=R;var Ct=class r extends R{sep="\\";splitSep=nr;constructor(t,e=L,s,i,n,o,h){super(t,e,s,i,n,o,h)}newChild(t,e=L,s={}){return new r(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return er.exec(t)?.[0]??re.win32.parse(t).root}getRoot(t){if(t=ii(t.toUpperCase()),t===this.root.name||/^[\\/]$/.test(t))return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new At(t,{nocase:this.nocase,fs:this.fs}).root}sameRoot(t,e=this.root.name){return ii(t.toUpperCase())===e}};E.PathWin32=Ct;var Mt=class r extends R{splitSep="/";sep="/";constructor(t,e=L,s,i,n,o,h){super(t,e,s,i,n,o,h)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=L,s={}){return new r(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}};E.PathPosix=Mt;var kt=class{root;rootPath;roots;cwd;#t;#n;#i;nocase;#o;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:n=16*1024,fs:o=_t}={}){this.#o=ai(o),(t instanceof URL||t.startsWith("file://"))&&(t=(0,Vn.fileURLToPath)(t));let h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),this.#t=new xt,this.#n=new xt,this.#i=new oe(n);let a=h.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]&&a.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#o),this.roots[this.rootPath]=this.root;let l=this.root,c=a.length-1,u=e.sep,f=this.rootPath,p=!1;for(let g of a){let d=c--;l=l.child(g,{relative:new Array(d).fill("..").join(u),relativePosix:new Array(d).fill("..").join("/"),fullpath:f+=(p?"":u)+g}),p=!0}this.cwd=l}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#i}resolve(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpath();return this.#t.set(e,i),i}resolvePosix(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#n.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpathPosix();return this.#n.set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let i=await t.readdir();return s?i:i.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set,l=(u,f)=>{a.add(u),u.readdirCB((p,g)=>{if(p)return f(p);let d=g.length;if(!d)return f();let b=()=>{--d===0&&f()};for(let m of g)(!n||n(m))&&h.push(s?m:m.fullpath()),i&&m.isSymbolicLink()?m.realpath().then(y=>y?.isUnknown()?y.lstat():y).then(y=>y?.shouldWalk(a,o)?l(y,b):b()):m.shouldWalk(a,o)?l(m,b):b()},!0)},c=t;return new Promise((u,f)=>{l(c,p=>{if(p)return f(p);u(h)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set([t]);for(let l of a){let c=l.readdirSync();for(let u of c){(!n||n(u))&&h.push(s?u:u.fullpath());let f=u;if(u.isSymbolicLink()){if(!(i&&(f=u.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(a,o)&&a.add(f)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e;(!n||n(t))&&(yield s?t:t.fullpath());let h=new Set([t]);for(let a of h){let l=a.readdirSync();for(let c of l){(!n||n(c))&&(yield s?c:c.fullpath());let u=c;if(c.isSymbolicLink()){if(!(i&&(u=c.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(h,o)&&h.add(u)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=new si.Minipass({objectMode:!0});(!n||n(t))&&h.write(s?t:t.fullpath());let a=new Set,l=[t],c=0,u=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){c===0&&h.end();return}c++,a.add(p);let g=(b,m,y=!1)=>{if(b)return h.emit("error",b);if(i&&!y){let _=[];for(let v of m)v.isSymbolicLink()&&_.push(v.realpath().then(S=>S?.isUnknown()?S.lstat():S));if(_.length){Promise.all(_).then(()=>g(null,m,!0));return}}for(let _ of m)_&&(!n||n(_))&&(h.write(s?_:_.fullpath())||(f=!0));c--;for(let _ of m){let v=_.realpathCached()||_;v.shouldWalk(a,o)&&l.push(v)}f&&!h.flowing?h.once("drain",u):d||u()},d=!0;p.readdirCB(g,!0),d=!1}};return u(),h}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=new si.Minipass({objectMode:!0}),a=new Set;(!n||n(t))&&h.write(s?t:t.fullpath());let l=[t],c=0,u=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){c===0&&h.end();return}c++,a.add(p);let g=p.readdirSync();for(let d of g)(!n||n(d))&&(h.write(s?d:d.fullpath())||(f=!0));c--;for(let d of g){let b=d;if(d.isSymbolicLink()){if(!(i&&(b=d.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(a,o)&&l.push(b)}}f&&!h.flowing&&h.once("drain",u)};return u(),h}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[pi](e)}};E.PathScurryBase=kt;var At=class extends kt{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;typeof t=="string"&&!t.startsWith("file://")&&(t=t.replace(sr,"").replace(ir,"\\")),super(t,re.win32,"\\",{...e,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(t){return re.win32.parse(t).root.toUpperCase()}newRoot(t){return new Ct(this.rootPath,I,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}};E.PathScurryWin32=At;var Rt=class extends kt{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,re.posix,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new Mt(this.rootPath,I,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}};E.PathScurryPosix=Rt;var he=class extends Rt{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}};E.PathScurryDarwin=he;E.Path=process.platform==="win32"?Ct:Mt;E.PathScurry=process.platform==="win32"?At:process.platform==="darwin"?he:Rt});var ts=C(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.Pattern=void 0;var or=Y(),hr=r=>r.length>=1,ar=r=>r.length>=1,lr=Symbol.for("nodejs.util.inspect.custom"),Qe=class r{#t;#n;#i;length;#o;#r;#d;#f;#u;#h;#m=!0;constructor(t,e,s,i){if(!hr(t))throw new TypeError("empty pattern list");if(!ar(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#n=e,this.#i=s,this.#o=i,this.#i===0){if(this.isUNC()){let n=this.#l()?6:4,o=this.#t.slice(0,n),h=this.#n.slice(0,n),a=this.#t.slice(n),l=this.#n.slice(n);a[0]===""&&(a.shift(),l.shift());let c=[...o,""].join("/"),u=[...h,""].join("/");this.#t=[c,...a],this.#n=[u,...l],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#t,[h,...a]=this.#n;o[0]===""&&(o.shift(),a.shift());let l=`${n}/`,c=`${h}/`;this.#t=[l,...o],this.#n=[c,...a],this.length=this.#t.length}}}[lr](){return`Pattern <${this.#n.slice(this.#i).join("/")}>`}pattern(){return this.#t[this.#i]}isString(){return typeof this.#t[this.#i]=="string"}isGlobstar(){return this.#t[this.#i]===or.GLOBSTAR}isMatcher(){return typeof this.#t[this.#i]=="object"}globString(){return this.#d=this.#d||(this.#i===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#r!==void 0?this.#r:this.hasMore()?(this.#r=new r(this.#t,this.#n,this.#i+1,this.#o),this.#r.#h=this.#h,this.#r.#u=this.#u,this.#r.#f=this.#f,this.#r):this.#r=null}#l(){let t=this.#t;return t[2]==="?"&&typeof t[3]=="string"&&/^unc$/i.test(t[3])}isUNC(){let t=this.#t,e=this.#l()?4:2;return this.#u!==void 0?this.#u:this.#u=this.#o==="win32"&&this.#i===0&&t[0]===""&&t[1]===""&&typeof t[e]=="string"&&!!t[e]&&typeof t[e+1]=="string"&&!!t[e+1]}isDrive(){let t=this.#t;return this.#f!==void 0?this.#f:this.#f=this.#o==="win32"&&this.#i===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#h!==void 0?this.#h:this.#h=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#i===0?t:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#m)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#m?!1:(this.#m=!1,!0)}};le.Pattern=Qe});var is=C(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.Ignore=void 0;var es=Y(),cr=ts(),ur=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ss=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;slashRoot;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:n,normalize:o,platform:h=ur,root:a,windowsPathsNoEscape:l,allowWindowsEscape:c,braceExpandMax:u=1e4},f){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=h,l=!!l||c===!1,this.mmopts={braceExpandMax:u,dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:n,normalize:o,optimizationLevel:2,platform:h,nocomment:!0,nonegate:!0,windowsPathsNoEscape:l};let p=f?.resolve(a??"/").fullpath()??"/";this.slashRoot=(0,es.escape)(p.replace(/\\/g,"/").replace(/\/$/,""),{magicalBraces:!0,windowsPathsNoEscape:l});for(let g of t)this.add(g)}add(t){let e=new es.Minimatch(t,this.mmopts);for(let s=0;s<e.set.length;s++){let i=e.set[s],n=e.globParts[s];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let o=new cr.Pattern(i,n,0,this.platform),h=o.root()==="/"?`${this.slashRoot}/${o.rest()?.globString()??""}`:o.globString(),a=new es.Minimatch(h,this.mmopts),l=n[n.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(a):this.relative.push(a),l&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(t){let e=t.fullpath(),s=`${e}/`,i=t.relative()||".",n=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(n))return!0;for(let o of this.absolute)if(o.match(e)||o.match(s))return!0;return!1}childrenIgnored(t){let e=`${t.fullpath()}/`,s=`${t.relative()||"."}/`;for(let i of this.relativeChildren)if(i.match(s))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}};ce.Ignore=ss});var wi=C($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.Processor=$.SubWalks=$.MatchRecord=$.HasWalkedCache=void 0;var gi=Y(),ue=class r{parent;store;constructor(t){this.parent=t}copy(){return new r(this)}#t(t){let e=this.store?.get(t);return e||!this.parent?e:this.parent.#t(t)}hasWalked(t,e){return!!this.#t(t.fullpath())?.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),i=this.#t(s);i?i.add(e.globString()):(this.store??=new Map).set(s,new Set([e.globString()]))}};$.HasWalkedCache=ue;var fe=class r{static ABSOLUTE=2;static IF_DIR=1;store=new Map;add(t,e,s){let i=(e?r.ABSOLUTE:0)|(s?r.IF_DIR:0),n=this.store.get(t);this.store.set(t,n===void 0?i:i&n)}};$.MatchRecord=fe;var de=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(i=>i.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}};$.SubWalks=de;var ns=class r{hasWalkedCache;matches=new fe;subwalks=new de;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new ue}processPatterns(t,e){this.patterns=e;let s=e.map(i=>[t,i]);for(let[i,n]of s){this.hasWalkedCache.storeWalked(i,n);let o=n.root(),h=n.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let u=n.rest();if(u)n=u;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let a,l,c=!1;for(;typeof(a=n.pattern())=="string"&&(l=n.rest());)i=i.resolve(a),n=l,c=!0;if(a=n.pattern(),l=n.rest(),c){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof a=="string"){let u=a===".."||a===""||a===".";this.matches.add(i.resolve(a),h,u);continue}else if(a===gi.GLOBSTAR){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let u=l?.pattern(),f=l?.rest();if(!l||(u===""||u===".")&&!f)this.matches.add(i,h,u===""||u===".");else if(u===".."){let p=i.parent||i;f?this.hasWalkedCache.hasWalked(p,f)||this.subwalks.add(p,f):this.matches.add(p,h,!0)}}else typeof a=="object"&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),i=this.child();for(let n of e)for(let o of s){let h=o.isAbsolute(),a=o.pattern(),l=o.rest();a===gi.GLOBSTAR?i.testGlobstar(n,o,l,h):typeof a=="object"?i.testMatcher(n,a,l,h):i.testString(n,a,l,h)}return i}testGlobstar(t,e,s,i){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),i);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s)}else typeof n=="object"&&this.testMatcher(t,n,s.rest(),i)}}testMatcher(t,e,s,i){e.testUnchecked(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}};$.Processor=ns});var yi=C(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.GlobStream=Q.GlobWalker=Q.GlobUtil=void 0;var fr=Ye(),bi=is(),rs=wi(),{ABSOLUTE:pe,IF_DIR:me}=rs.MatchRecord,dr=(r,t,e)=>typeof r=="string"?new bi.Ignore([r],t,e):Array.isArray(r)?new bi.Ignore(r,t,e):r,Pt=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#n;#i;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#i=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#n=dr(s.ignore??[],s,e),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#o(t){return this.seen.has(t)||!!this.#n?.ignored?.(t)}#r(t){return!!this.#n?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.paused?this.#t.push(t):t()}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s,i;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;i=s}else i=t;let o=i.isUnknown()||this.opts.stat?await i.lstat():i;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let h=await o.realpath();h&&(h.isUnknown()||this.opts.stat)&&await h.lstat()}return this.matchCheckTest(o,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#o(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s,i;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;i=s}else i=t;let o=i.isUnknown()||this.opts.stat?i.lstatSync():i;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let h=o.realpathSync();h&&(h?.isUnknown()||this.opts.stat)&&h.lstatSync()}return this.matchCheckTest(o,e)}matchFinish(t,e){this.#o(t)||this.#d(t,e)}#d(t,e){if(!this.includeChildMatches&&this.#n?.add){let n=`${t.relativePosix()}/**`;this.#n.add(n)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!n.startsWith(`..${this.#i}`)?`.${this.#i}`:"";this.matchEmit(n?o+n+i:`.${i}`)}}async match(t,e,s){let i=await this.matchCheck(t,s);i&&this.matchFinish(i,e)}matchSync(t,e,s){let i=this.matchCheckSync(t,s);i&&this.#d(i,e)}walkCB(t,e,s){if(this.signal?.aborted)return s();this.walkCB2(t,e,new rs.Processor(this.opts),s)}walkCB2(t,e,s,i){if(this.#r(t)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2(t,e,s,i));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a]of s.matches.store)this.#o(h)||(n++,this.match(h,!!(a&pe),!!(a&me)).then(()=>o()));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirCached();h.calledReaddir()?this.walkCB3(h,a,s,o):h.readdirCB((l,c)=>this.walkCB3(h,c,s,o),!0)}o()}walkCB3(t,e,s,i){let n=s.filterEntries(t,e),o=1,h=()=>{--o===0&&i()};for(let[a,l]of n.matches.store)this.#o(a)||(o++,this.match(a,!!(l&pe),!!(l&me)).then(()=>h()));for(let[a,l]of n.subwalks.entries())o++,this.walkCB2(a,l,n.child(),h);h()}walkCBSync(t,e,s){if(this.signal?.aborted)return s();this.walkCB2Sync(t,e,new rs.Processor(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#r(t)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,i));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a]of s.matches.store)this.#o(h)||this.matchSync(h,!!(a&pe),!!(a&me));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirSync();this.walkCB3Sync(h,a,s,o)}o()}walkCB3Sync(t,e,s,i){let n=s.filterEntries(t,e),o=1,h=()=>{--o===0&&i()};for(let[a,l]of n.matches.store)this.#o(a)||this.matchSync(a,!!(l&pe),!!(l&me));for(let[a,l]of n.subwalks.entries())o++,this.walkCB2Sync(a,l,n.child(),h);h()}};Q.GlobUtil=Pt;var os=class extends Pt{matches=[];constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.push(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};Q.GlobWalker=os;var hs=class extends Pt{results;constructor(t,e,s){super(t,e,s),this.results=new fr.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};Q.GlobStream=hs});var ls=C(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.Glob=void 0;var pr=Y(),mr=__webpack_require__(/*! node:url */ "node:url"),ge=mi(),gr=ts(),we=yi(),wr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",as=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,mr.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");let s=typeof t=="string"?[t]:t;if(this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(s=s.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");s=s.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=s,this.platform=e.platform||wr,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=e.platform==="win32"?ge.PathScurryWin32:e.platform==="darwin"?ge.PathScurryDarwin:e.platform?ge.PathScurryPosix:ge.PathScurry;this.scurry=new l(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape},o=this.pattern.map(l=>new pr.Minimatch(l,n)),[h,a]=o.reduce((l,c)=>(l[0].push(...c.set),l[1].push(...c.globParts),l),[[],[]]);this.patterns=h.map((l,c)=>{let u=a[c];if(!u)throw new Error("invalid pattern object");return new gr.Pattern(l,u,0,this.platform)})}async walk(){return await new we.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()}walkSync(){return new we.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()}stream(){return new we.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new we.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};be.Glob=as});var cs=C(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.hasMagic=void 0;var br=Y(),yr=(r,t={})=>{for(let e of Array.isArray(r)?r:[r])if(new br.Minimatch(e,t).hasMagic())return!0;return!1};ye.hasMagic=yr});Object.defineProperty(exports, "__esModule", ({value:!0}));exports.glob=exports.sync=exports.iterate=exports.iterateSync=exports.stream=exports.streamSync=exports.Ignore=exports.hasMagic=exports.Glob=exports.unescape=exports.escape=void 0;exports.globStreamSync=Tt;exports.globStream=us;exports.globSync=fs;exports.globIterateSync=Ft;exports.globIterate=ds;var Si=Y(),nt=ls(),Sr=cs(),_i=Y();Object.defineProperty(exports, "escape", ({enumerable:!0,get:function(){return _i.escape}}));Object.defineProperty(exports, "unescape", ({enumerable:!0,get:function(){return _i.unescape}}));var vr=ls();Object.defineProperty(exports, "Glob", ({enumerable:!0,get:function(){return vr.Glob}}));var _r=cs();Object.defineProperty(exports, "hasMagic", ({enumerable:!0,get:function(){return _r.hasMagic}}));var Er=is();Object.defineProperty(exports, "Ignore", ({enumerable:!0,get:function(){return Er.Ignore}}));function Tt(r,t={}){return new nt.Glob(r,t).streamSync()}function us(r,t={}){return new nt.Glob(r,t).stream()}function fs(r,t={}){return new nt.Glob(r,t).walkSync()}async function vi(r,t={}){return new nt.Glob(r,t).walk()}function Ft(r,t={}){return new nt.Glob(r,t).iterateSync()}function ds(r,t={}){return new nt.Glob(r,t).iterate()}exports.streamSync=Tt;exports.stream=Object.assign(us,{sync:Tt});exports.iterateSync=Ft;exports.iterate=Object.assign(ds,{sync:Ft});exports.sync=Object.assign(fs,{stream:Tt,iterate:Ft});exports.glob=Object.assign(vi,{glob:vi,globSync:fs,sync:exports.sync,globStream:us,stream:exports.stream,globStreamSync:Tt,streamSync:exports.streamSync,globIterate:ds,iterate:exports.iterate,globIterateSync:Ft,iterateSync:exports.iterateSync,Glob:nt.Glob,hasMagic:Sr.hasMagic,escape:Si.escape,unescape:Si.unescape});exports.glob.glob=exports.glob;
151390
153393
  //# sourceMappingURL=index.min.js.map
151391
153394
 
151392
153395
 
@@ -155666,8 +157669,7 @@ class Queue {
155666
157669
  /******/ /* webpack/runtime/make namespace object */
155667
157670
  /******/ // define __esModule on exports
155668
157671
  /******/ __webpack_require__.r = (exports) => {
155669
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
155670
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
157672
+ /******/ Object.defineProperties(exports, { [Symbol.toStringTag]: { value: 'Module' }, __esModule: { value: true } });
155671
157673
  /******/ };
155672
157674
  /******/
155673
157675
  /************************************************************************/