@siteping/cli 0.3.0 → 0.4.0
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/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/index.js +18532 -122
- package/dist/index.js.map +1 -0
- package/package.json +10 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.bun/commander@13.1.0/node_modules/commander/lib/error.js","../../../node_modules/.bun/commander@13.1.0/node_modules/commander/lib/argument.js","../../../node_modules/.bun/commander@13.1.0/node_modules/commander/lib/help.js","../../../node_modules/.bun/commander@13.1.0/node_modules/commander/lib/option.js","../../../node_modules/.bun/commander@13.1.0/node_modules/commander/lib/suggestSimilar.js","../../../node_modules/.bun/commander@13.1.0/node_modules/commander/lib/command.js","../../../node_modules/.bun/commander@13.1.0/node_modules/commander/index.js","../../../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js","../../../node_modules/.bun/picocolors@1.1.1/node_modules/picocolors/picocolors.js","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/version.ts","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isPrototype.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_overArg.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nativeKeys.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseKeys.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_freeGlobal.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_root.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Symbol.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getRawTag.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_objectToString.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseGetTag.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isObject.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isFunction.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_coreJsData.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isMasked.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_toSource.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsNative.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getValue.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getNative.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_DataView.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Map.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Promise.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Set.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_WeakMap.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getTag.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isObjectLike.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsArguments.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isArguments.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isArray.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isLength.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isArrayLike.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/stubFalse.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isBuffer.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsTypedArray.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseUnary.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nodeUtil.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isTypedArray.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isEmpty.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arrayMap.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheClear.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/eq.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheGet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheHas.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_listCacheSet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_ListCache.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_stackClear.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_stackDelete.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_stackGet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_stackHas.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nativeCreate.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashClear.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashDelete.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashGet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashHas.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hashSet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Hash.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isKeyable.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getMapData.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_MapCache.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_stackSet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Stack.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_setCacheAdd.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_setCacheHas.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_SetCache.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arraySome.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_cacheHas.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_equalArrays.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Uint8Array.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapToArray.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_setToArray.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_equalByTag.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arrayPush.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseGetAllKeys.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arrayFilter.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/stubArray.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getSymbols.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseTimes.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isIndex.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arrayLikeKeys.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/keys.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getAllKeys.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_equalObjects.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsEqualDeep.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsEqual.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsMatch.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isStrictComparable.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getMatchData.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_matchesStrictComparable.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseMatches.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isSymbol.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isKey.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/memoize.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_memoizeCapped.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_stringToPath.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseToString.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/toString.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_castPath.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_toKey.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseGet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/get.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseHasIn.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hasPath.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/hasIn.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseMatchesProperty.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/identity.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseProperty.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_basePropertyDeep.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/property.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIteratee.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_createBaseFor.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseFor.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseForOwn.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_createBaseEach.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseEach.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseMap.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/map.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arrayEach.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_castFunction.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/forEach.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseValues.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/values.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseHas.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/has.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_defineProperty.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseAssignValue.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_assignValue.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_copyObject.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseAssign.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nativeKeysIn.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseKeysIn.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/keysIn.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseAssignIn.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_cloneBuffer.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_copyArray.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_copySymbols.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getPrototype.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getSymbolsIn.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_copySymbolsIn.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getAllKeysIn.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_initCloneArray.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_cloneArrayBuffer.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_cloneDataView.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_cloneRegExp.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_cloneSymbol.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_cloneTypedArray.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_initCloneByTag.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseCreate.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_initCloneObject.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsMap.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isMap.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsSet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isSet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseClone.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/clone.js","../../../node_modules/.bun/@chevrotain+utils@10.5.0/node_modules/@chevrotain/utils/src/print.ts","../../../node_modules/.bun/@chevrotain+utils@10.5.0/node_modules/@chevrotain/utils/src/timer.ts","../../../node_modules/.bun/@chevrotain+utils@10.5.0/node_modules/@chevrotain/utils/src/to-fast-properties.ts","../../../node_modules/.bun/@chevrotain+utils@10.5.0/node_modules/@chevrotain/utils/src/api.ts","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseSlice.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseTrim.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/toNumber.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/toFinite.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/toInteger.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/drop.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isString.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsRegExp.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isRegExp.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseSet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_basePickBy.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/pickBy.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_apply.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_overRest.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/constant.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseSetToString.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_shortOut.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_setToString.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseRest.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isIterateeCall.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_createAssigner.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/assign.js","../../../node_modules/.bun/@chevrotain+gast@10.5.0/node_modules/@chevrotain/gast/src/model.ts","../../../node_modules/.bun/@chevrotain+gast@10.5.0/node_modules/@chevrotain/gast/src/visitor.ts","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseSome.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/some.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arrayEvery.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseEvery.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/every.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseFindIndex.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsNaN.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_strictIndexOf.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIndexOf.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/includes.js","../../../node_modules/.bun/@chevrotain+gast@10.5.0/node_modules/@chevrotain/gast/src/helpers.ts","../../../node_modules/.bun/@chevrotain+gast@10.5.0/node_modules/@chevrotain/gast/src/api.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/grammar/rest.ts","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isFlattenable.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseFlatten.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/flatten.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arrayIncludes.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arrayIncludesWith.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/noop.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_createSet.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseUniq.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/uniq.js","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/grammar/first.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/constants.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/grammar/follow.ts","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isUndefined.js","../../../node_modules/.bun/regexp-to-ast@0.5.0/node_modules/regexp-to-ast/lib/regexp-to-ast.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/head.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/first.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/compact.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseFilter.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/negate.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/reject.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseDifference.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/isArrayLikeObject.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/difference.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/indexOf.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_createFind.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/findIndex.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/find.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/filter.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/defaults.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arrayReduce.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseReduce.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/reduce.js","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/scan/reg_exp_parser.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/scan/reg_exp.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/scan/lexer.ts","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/last.js","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/scan/tokens.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/scan/lexer_errors_public.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/scan/lexer_public.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/scan/tokens_public.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/errors_public.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/grammar/resolver.ts","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arrayAggregator.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseAggregator.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_createAggregator.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/groupBy.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/flatMap.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/dropRight.js","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/grammar/interpreter.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/grammar/lookahead.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/grammar/checks.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/grammar/gast/gast_resolver_public.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/exceptions_public.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/parser/traits/recoverable.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/grammar/keys.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/grammar/llk_lookahead.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/parser/traits/looksahead.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/cst/cst.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/lang/lang_extensions.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/cst/cst_visitor.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/parser/traits/tree_builder.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/parser/traits/lexer_adapter.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/parser/traits/recognizer_api.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/parser/traits/recognizer_engine.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/parser/traits/error_handler.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/parser/traits/context_assist.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/parser/traits/gast_recorder.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/parser/traits/perf_tracer.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/parser/utils/apply_mixins.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/parse/parser/parser.ts","../../../node_modules/.bun/@chevrotain+cst-dts-gen@10.5.0/node_modules/@chevrotain/cst-dts-gen/src/model.ts","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_castSlice.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hasUnicode.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_asciiToArray.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_unicodeToArray.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_stringToArray.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_createCaseFirst.js","../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/upperFirst.js","../../../node_modules/.bun/@chevrotain+cst-dts-gen@10.5.0/node_modules/@chevrotain/cst-dts-gen/src/generate.ts","../../../node_modules/.bun/@chevrotain+cst-dts-gen@10.5.0/node_modules/@chevrotain/cst-dts-gen/src/api.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/diagrams/render_public.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/src/api.ts","../../../node_modules/.bun/lilconfig@2.1.0/node_modules/lilconfig/dist/index.js","../../../node_modules/.bun/commander@13.1.0/node_modules/commander/esm.mjs","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/node_modules/.pnpm/ansi-regex@6.1.0/node_modules/ansi-regex/index.js","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/node_modules/.pnpm/wrap-ansi@8.1.0/node_modules/wrap-ansi/index.js","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/@clack/core/src/utils/settings.ts","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/@clack/core/src/utils/string.ts","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/@clack/core/src/utils/index.ts","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/prompt.ts","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/confirm.ts","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/group-multiselect.ts","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/multi-select.ts","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/password.ts","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/select.ts","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/select-key.ts","../../../node_modules/.bun/@clack+core@0.4.1/node_modules/@clack/core/src/prompts/text.ts","../../../node_modules/.bun/@clack+prompts@0.9.1/node_modules/node_modules/.pnpm/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js","../../../node_modules/.bun/@clack+prompts@0.9.1/node_modules/@clack/prompts/src/index.ts","../src/commands/doctor.ts","../src/generators/prisma.ts","../../../node_modules/.bun/chevrotain@10.5.0/node_modules/chevrotain/lib_esm/api_esm.mjs","../../../node_modules/.bun/@mrleebo+prisma-ast@0.12.1/node_modules/@mrleebo/prisma-ast/src/lexer.ts","../../../node_modules/.bun/@mrleebo+prisma-ast@0.12.1/node_modules/@mrleebo/prisma-ast/src/schemaUtils.ts","../../../node_modules/.bun/@mrleebo+prisma-ast@0.12.1/node_modules/@mrleebo/prisma-ast/src/getConfig.ts","../../../node_modules/.bun/@mrleebo+prisma-ast@0.12.1/node_modules/@mrleebo/prisma-ast/src/parser.ts","../../../node_modules/.bun/@mrleebo+prisma-ast@0.12.1/node_modules/@mrleebo/prisma-ast/src/visitor.ts","../../../node_modules/.bun/@mrleebo+prisma-ast@0.12.1/node_modules/@mrleebo/prisma-ast/src/getSchema.ts","../../../node_modules/.bun/@mrleebo+prisma-ast@0.12.1/node_modules/@mrleebo/prisma-ast/src/schemaSorter.ts","../../../node_modules/.bun/@mrleebo+prisma-ast@0.12.1/node_modules/@mrleebo/prisma-ast/src/printSchema.ts","../../../node_modules/.bun/@mrleebo+prisma-ast@0.12.1/node_modules/@mrleebo/prisma-ast/src/finder.ts","../../../node_modules/.bun/@mrleebo+prisma-ast@0.12.1/node_modules/@mrleebo/prisma-ast/src/PrismaSchemaBuilder.ts","../../../node_modules/.bun/@mrleebo+prisma-ast@0.12.1/node_modules/@mrleebo/prisma-ast/src/produceSchema.ts","../../core/src/schema.ts","../src/generators/route.ts","../src/utils/find-schema.ts","../src/commands/init.ts","../src/commands/status.ts","../src/commands/sync.ts","../src/index.ts"],"sourcesContent":["/**\n * CommanderError class\n */\nclass CommanderError extends Error {\n /**\n * Constructs the CommanderError class\n * @param {number} exitCode suggested exit code which could be used with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n */\n constructor(exitCode, code, message) {\n super(message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n this.code = code;\n this.exitCode = exitCode;\n this.nestedError = undefined;\n }\n}\n\n/**\n * InvalidArgumentError class\n */\nclass InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param {string} [message] explanation of why argument is invalid\n */\n constructor(message) {\n super(1, 'commander.invalidArgument', message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n }\n}\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\n","const { InvalidArgumentError } = require('./error.js');\n\nclass Argument {\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @param {string} name\n * @param {string} [description]\n */\n\n constructor(name, description) {\n this.description = description || '';\n this.variadic = false;\n this.parseArg = undefined;\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.argChoices = undefined;\n\n switch (name[0]) {\n case '<': // e.g. <required>\n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.length > 3 && this._name.slice(-3) === '...') {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n *\n * @returns {Argument}\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n *\n * @returns {Argument}\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nfunction humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';\n}\n\nexports.Argument = Argument;\nexports.humanReadableArgName = humanReadableArgName;\n","const { humanReadableArgName } = require('./argument.js');\n\n/**\n * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`\n * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types\n * @typedef { import(\"./argument.js\").Argument } Argument\n * @typedef { import(\"./command.js\").Command } Command\n * @typedef { import(\"./option.js\").Option } Option\n */\n\n// Although this is a class, methods are static in style to allow override using subclass or just functions.\nclass Help {\n constructor() {\n this.helpWidth = undefined;\n this.minWidthToWrap = 40;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.\n *\n * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions\n */\n prepareContext(contextOptions) {\n this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: because overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns {number}\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short\n ? option.short.replace(/^-/, '')\n : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(\n cmd.createOption(helpOption.long, helpOption.description),\n );\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(\n cmd.createOption(helpOption.short, helpOption.description),\n );\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n const visibleOptions = ancestorCmd.options.filter(\n (option) => !option.hidden,\n );\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach((argument) => {\n argument.description =\n argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find((argument) => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments\n .map((arg) => humanReadableArgName(arg))\n .join(' ');\n return (\n cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '')\n );\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleSubcommandTerm(helper.subcommandTerm(command)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault =\n option.required ||\n option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(\n `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,\n );\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n return `${option.description} (${extraInfo.join(', ')})`;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(\n `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,\n );\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n return argument.description;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called\n\n function callFormatItem(term, description) {\n return helper.formatItem(term, termWidth, description, helper);\n }\n\n // Usage\n let output = [\n `${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,\n '',\n ];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(\n helper.styleCommandDescription(commandDescription),\n helpWidth,\n ),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return callFormatItem(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n helper.styleArgumentDescription(helper.argumentDescription(argument)),\n );\n });\n if (argumentList.length > 0) {\n output = output.concat([\n helper.styleTitle('Arguments:'),\n ...argumentList,\n '',\n ]);\n }\n\n // Options\n const optionList = helper.visibleOptions(cmd).map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n if (optionList.length > 0) {\n output = output.concat([\n helper.styleTitle('Options:'),\n ...optionList,\n '',\n ]);\n }\n\n if (helper.showGlobalOptions) {\n const globalOptionList = helper\n .visibleGlobalOptions(cmd)\n .map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n if (globalOptionList.length > 0) {\n output = output.concat([\n helper.styleTitle('Global Options:'),\n ...globalOptionList,\n '',\n ]);\n }\n }\n\n // Commands\n const commandList = helper.visibleCommands(cmd).map((cmd) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(cmd)),\n helper.styleSubcommandDescription(helper.subcommandDescription(cmd)),\n );\n });\n if (commandList.length > 0) {\n output = output.concat([\n helper.styleTitle('Commands:'),\n ...commandList,\n '',\n ]);\n }\n\n return output.join('\\n');\n }\n\n /**\n * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.\n *\n * @param {string} str\n * @returns {number}\n */\n displayWidth(str) {\n return stripColor(str).length;\n }\n\n /**\n * Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.\n *\n * @param {string} str\n * @returns {string}\n */\n styleTitle(str) {\n return str;\n }\n\n styleUsage(str) {\n // Usage has lots of parts the user might like to color separately! Assume default usage string which is formed like:\n // command subcommand [options] [command] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word === '[command]') return this.styleSubcommandText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleCommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleCommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleOptionDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleSubcommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleArgumentDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleDescriptionText(str) {\n return str;\n }\n styleOptionTerm(str) {\n return this.styleOptionText(str);\n }\n styleSubcommandTerm(str) {\n // This is very like usage with lots of parts! Assume default string which is formed like:\n // subcommand [options] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleSubcommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleArgumentTerm(str) {\n return this.styleArgumentText(str);\n }\n styleOptionText(str) {\n return str;\n }\n styleArgumentText(str) {\n return str;\n }\n styleSubcommandText(str) {\n return str;\n }\n styleCommandText(str) {\n return str;\n }\n\n /**\n * Calculate the pad width from the maximum term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n padWidth(cmd, helper) {\n return Math.max(\n helper.longestOptionTermLength(cmd, helper),\n helper.longestGlobalOptionTermLength(cmd, helper),\n helper.longestSubcommandTermLength(cmd, helper),\n helper.longestArgumentTermLength(cmd, helper),\n );\n }\n\n /**\n * Detect manually wrapped and indented strings by checking for line break followed by whitespace.\n *\n * @param {string} str\n * @returns {boolean}\n */\n preformatted(str) {\n return /\\n[^\\S\\r\\n]/.test(str);\n }\n\n /**\n * Format the \"item\", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.\n *\n * So \"TTT\", 5, \"DDD DDDD DD DDD\" might be formatted for this.helpWidth=17 like so:\n * TTT DDD DDDD\n * DD DDD\n *\n * @param {string} term\n * @param {number} termWidth\n * @param {string} description\n * @param {Help} helper\n * @returns {string}\n */\n formatItem(term, termWidth, description, helper) {\n const itemIndent = 2;\n const itemIndentStr = ' '.repeat(itemIndent);\n if (!description) return itemIndentStr + term;\n\n // Pad the term out to a consistent width, so descriptions are aligned.\n const paddedTerm = term.padEnd(\n termWidth + term.length - helper.displayWidth(term),\n );\n\n // Format the description.\n const spacerWidth = 2; // between term and description\n const helpWidth = this.helpWidth ?? 80; // in case prepareContext() was not called\n const remainingWidth = helpWidth - termWidth - spacerWidth - itemIndent;\n let formattedDescription;\n if (\n remainingWidth < this.minWidthToWrap ||\n helper.preformatted(description)\n ) {\n formattedDescription = description;\n } else {\n const wrappedDescription = helper.boxWrap(description, remainingWidth);\n formattedDescription = wrappedDescription.replace(\n /\\n/g,\n '\\n' + ' '.repeat(termWidth + spacerWidth),\n );\n }\n\n // Construct and overall indent.\n return (\n itemIndentStr +\n paddedTerm +\n ' '.repeat(spacerWidth) +\n formattedDescription.replace(/\\n/g, `\\n${itemIndentStr}`)\n );\n }\n\n /**\n * Wrap a string at whitespace, preserving existing line breaks.\n * Wrapping is skipped if the width is less than `minWidthToWrap`.\n *\n * @param {string} str\n * @param {number} width\n * @returns {string}\n */\n boxWrap(str, width) {\n if (width < this.minWidthToWrap) return str;\n\n const rawLines = str.split(/\\r\\n|\\n/);\n // split up text by whitespace\n const chunkPattern = /[\\s]*[^\\s]+/g;\n const wrappedLines = [];\n rawLines.forEach((line) => {\n const chunks = line.match(chunkPattern);\n if (chunks === null) {\n wrappedLines.push('');\n return;\n }\n\n let sumChunks = [chunks.shift()];\n let sumWidth = this.displayWidth(sumChunks[0]);\n chunks.forEach((chunk) => {\n const visibleWidth = this.displayWidth(chunk);\n // Accumulate chunks while they fit into width.\n if (sumWidth + visibleWidth <= width) {\n sumChunks.push(chunk);\n sumWidth += visibleWidth;\n return;\n }\n wrappedLines.push(sumChunks.join(''));\n\n const nextChunk = chunk.trimStart(); // trim space at line break\n sumChunks = [nextChunk];\n sumWidth = this.displayWidth(nextChunk);\n });\n wrappedLines.push(sumChunks.join(''));\n });\n\n return wrappedLines.join('\\n');\n }\n}\n\n/**\n * Strip style ANSI escape sequences from the string. In particular, SGR (Select Graphic Rendition) codes.\n *\n * @param {string} str\n * @returns {string}\n * @package\n */\n\nfunction stripColor(str) {\n // eslint-disable-next-line no-control-regex\n const sgrPattern = /\\x1b\\[\\d*(;\\d*)*m/g;\n return str.replace(sgrPattern, '');\n}\n\nexports.Help = Help;\nexports.stripColor = stripColor;\n","const { InvalidArgumentError } = require('./error.js');\n\nclass Option {\n /**\n * Initialize a new `Option` with the given `flags` and `description`.\n *\n * @param {string} flags\n * @param {string} [description]\n */\n\n constructor(flags, description) {\n this.flags = flags;\n this.description = description || '';\n\n this.required = flags.includes('<'); // A value must be supplied when the option is specified.\n this.optional = flags.includes('['); // A value is optional when the option is specified.\n // variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if (typeof impliedOptionValues === 'string') {\n // string is not documented, but easy mistake and we can do what user probably intended.\n newImplied = { [impliedOptionValues]: true };\n }\n this.implied = Object.assign(this.implied || {}, newImplied);\n return this;\n }\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variable is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n }\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n }\n\n /**\n * @package\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n }\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n *\n * @return {string}\n */\n\n attributeName() {\n if (this.negate) {\n return camelcase(this.name().replace(/^no-/, ''));\n }\n return camelcase(this.name());\n }\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @package\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n }\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n *\n * @return {boolean}\n * @package\n */\n\n isBoolean() {\n return !this.required && !this.optional && !this.negate;\n }\n}\n\n/**\n * This class is to make it easier to work with dual options, without changing the existing\n * implementation. We support separate dual options for separate positive and negative options,\n * like `--build` and `--no-build`, which share a single option value. This works nicely for some\n * use cases, but is tricky for others where we want separate behaviours despite\n * the single shared option value.\n */\nclass DualOptions {\n /**\n * @param {Option[]} options\n */\n constructor(options) {\n this.positiveOptions = new Map();\n this.negativeOptions = new Map();\n this.dualOptions = new Set();\n options.forEach((option) => {\n if (option.negate) {\n this.negativeOptions.set(option.attributeName(), option);\n } else {\n this.positiveOptions.set(option.attributeName(), option);\n }\n });\n this.negativeOptions.forEach((value, key) => {\n if (this.positiveOptions.has(key)) {\n this.dualOptions.add(key);\n }\n });\n }\n\n /**\n * Did the value come from the option, and not from possible matching dual option?\n *\n * @param {*} value\n * @param {Option} option\n * @returns {boolean}\n */\n valueFromOption(value, option) {\n const optionKey = option.attributeName();\n if (!this.dualOptions.has(optionKey)) return true;\n\n // Use the value to deduce if (probably) came from the option.\n const preset = this.negativeOptions.get(optionKey).presetArg;\n const negativeValue = preset !== undefined ? preset : false;\n return option.negate === (negativeValue === value);\n }\n}\n\n/**\n * Convert string from kebab-case to camelCase.\n *\n * @param {string} str\n * @return {string}\n * @private\n */\n\nfunction camelcase(str) {\n return str.split('-').reduce((str, word) => {\n return str + word[0].toUpperCase() + word.slice(1);\n });\n}\n\n/**\n * Split the short and long flag out of something like '-m,--mixed <value>'\n *\n * @private\n */\n\nfunction splitOptionFlags(flags) {\n let shortFlag;\n let longFlag;\n // short flag, single dash and single character\n const shortFlagExp = /^-[^-]$/;\n // long flag, double dash and at least one character\n const longFlagExp = /^--[^-]/;\n\n const flagParts = flags.split(/[ |,]+/).concat('guard');\n // Normal is short and/or long.\n if (shortFlagExp.test(flagParts[0])) shortFlag = flagParts.shift();\n if (longFlagExp.test(flagParts[0])) longFlag = flagParts.shift();\n // Long then short. Rarely used but fine.\n if (!shortFlag && shortFlagExp.test(flagParts[0]))\n shortFlag = flagParts.shift();\n // Allow two long flags, like '--ws, --workspace'\n // This is the supported way to have a shortish option flag.\n if (!shortFlag && longFlagExp.test(flagParts[0])) {\n shortFlag = longFlag;\n longFlag = flagParts.shift();\n }\n\n // Check for unprocessed flag. Fail noisily rather than silently ignore.\n if (flagParts[0].startsWith('-')) {\n const unsupportedFlag = flagParts[0];\n const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;\n if (/^-[^-][^-]/.test(unsupportedFlag))\n throw new Error(\n `${baseError}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`,\n );\n if (shortFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many short flags`);\n if (longFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many long flags`);\n\n throw new Error(`${baseError}\n- unrecognised flag format`);\n }\n if (shortFlag === undefined && longFlag === undefined)\n throw new Error(\n `option creation failed due to no flags found in '${flags}'.`,\n );\n\n return { shortFlag, longFlag };\n}\n\nexports.Option = Option;\nexports.DualOptions = DualOptions;\n","const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance\n // Calculating optimal string alignment distance, no substring is edited more than once.\n // (Simple implementation.)\n\n // Quick early exit, return worst case.\n if (Math.abs(a.length - b.length) > maxDistance)\n return Math.max(a.length, b.length);\n\n // distance between prefix substrings of a and b\n const d = [];\n\n // pure deletions turn a into empty string\n for (let i = 0; i <= a.length; i++) {\n d[i] = [i];\n }\n // pure insertions turn empty string into b\n for (let j = 0; j <= b.length; j++) {\n d[0][j] = j;\n }\n\n // fill matrix\n for (let j = 1; j <= b.length; j++) {\n for (let i = 1; i <= a.length; i++) {\n let cost = 1;\n if (a[i - 1] === b[j - 1]) {\n cost = 0;\n } else {\n cost = 1;\n }\n d[i][j] = Math.min(\n d[i - 1][j] + 1, // deletion\n d[i][j - 1] + 1, // insertion\n d[i - 1][j - 1] + cost, // substitution\n );\n // transposition\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);\n }\n }\n }\n\n return d[a.length][b.length];\n}\n\n/**\n * Find close matches, restricted to same number of edits.\n *\n * @param {string} word\n * @param {string[]} candidates\n * @returns {string}\n */\n\nfunction suggestSimilar(word, candidates) {\n if (!candidates || candidates.length === 0) return '';\n // remove possible duplicates\n candidates = Array.from(new Set(candidates));\n\n const searchingOptions = word.startsWith('--');\n if (searchingOptions) {\n word = word.slice(2);\n candidates = candidates.map((candidate) => candidate.slice(2));\n }\n\n let similar = [];\n let bestDistance = maxDistance;\n const minSimilarity = 0.4;\n candidates.forEach((candidate) => {\n if (candidate.length <= 1) return; // no one character guesses\n\n const distance = editDistance(word, candidate);\n const length = Math.max(word.length, candidate.length);\n const similarity = (length - distance) / length;\n if (similarity > minSimilarity) {\n if (distance < bestDistance) {\n // better edit distance, throw away previous worse matches\n bestDistance = distance;\n similar = [candidate];\n } else if (distance === bestDistance) {\n similar.push(candidate);\n }\n }\n });\n\n similar.sort((a, b) => a.localeCompare(b));\n if (searchingOptions) {\n similar = similar.map((candidate) => `--${candidate}`);\n }\n\n if (similar.length > 1) {\n return `\\n(Did you mean one of ${similar.join(', ')}?)`;\n }\n if (similar.length === 1) {\n return `\\n(Did you mean ${similar[0]}?)`;\n }\n return '';\n}\n\nexports.suggestSimilar = suggestSimilar;\n","const EventEmitter = require('node:events').EventEmitter;\nconst childProcess = require('node:child_process');\nconst path = require('node:path');\nconst fs = require('node:fs');\nconst process = require('node:process');\n\nconst { Argument, humanReadableArgName } = require('./argument.js');\nconst { CommanderError } = require('./error.js');\nconst { Help, stripColor } = require('./help.js');\nconst { Option, DualOptions } = require('./option.js');\nconst { suggestSimilar } = require('./suggestSimilar');\n\nclass Command extends EventEmitter {\n /**\n * Initialize a new `Command`.\n *\n * @param {string} [name]\n */\n\n constructor(name) {\n super();\n /** @type {Command[]} */\n this.commands = [];\n /** @type {Option[]} */\n this.options = [];\n this.parent = null;\n this._allowUnknownOption = false;\n this._allowExcessArguments = false;\n /** @type {Argument[]} */\n this.registeredArguments = [];\n this._args = this.registeredArguments; // deprecated old name\n /** @type {string[]} */\n this.args = []; // cli args with options removed\n this.rawArgs = [];\n this.processedArgs = []; // like .args but after custom processing and collecting variadic\n this._scriptPath = null;\n this._name = name || '';\n this._optionValues = {};\n this._optionValueSources = {}; // default, env, cli etc\n this._storeOptionsAsProperties = false;\n this._actionHandler = null;\n this._executableHandler = false;\n this._executableFile = null; // custom name for executable\n this._executableDir = null; // custom search directory for subcommands\n this._defaultCommandName = null;\n this._exitCallback = null;\n this._aliases = [];\n this._combineFlagAndOptionalValue = true;\n this._description = '';\n this._summary = '';\n this._argsDescription = undefined; // legacy\n this._enablePositionalOptions = false;\n this._passThroughOptions = false;\n this._lifeCycleHooks = {}; // a hash of arrays\n /** @type {(boolean | string)} */\n this._showHelpAfterError = false;\n this._showSuggestionAfterError = true;\n this._savedState = null; // used in save/restoreStateBeforeParse\n\n // see configureOutput() for docs\n this._outputConfiguration = {\n writeOut: (str) => process.stdout.write(str),\n writeErr: (str) => process.stderr.write(str),\n outputError: (str, write) => write(str),\n getOutHelpWidth: () =>\n process.stdout.isTTY ? process.stdout.columns : undefined,\n getErrHelpWidth: () =>\n process.stderr.isTTY ? process.stderr.columns : undefined,\n getOutHasColors: () =>\n useColor() ?? (process.stdout.isTTY && process.stdout.hasColors?.()),\n getErrHasColors: () =>\n useColor() ?? (process.stderr.isTTY && process.stderr.hasColors?.()),\n stripColor: (str) => stripColor(str),\n };\n\n this._hidden = false;\n /** @type {(Option | null | undefined)} */\n this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.\n this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited\n /** @type {Command} */\n this._helpCommand = undefined; // lazy initialised, inherited\n this._helpConfiguration = {};\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} `this` command for chaining\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._helpOption = sourceCommand._helpOption;\n this._helpCommand = sourceCommand._helpCommand;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue =\n sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * @returns {Command[]}\n * @private\n */\n\n _getCommandAndAncestors() {\n const result = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let command = this; command; command = command.parent) {\n result.push(command);\n }\n return result;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone <source> [destination]')\n * .description('clone a repository into a newly created directory')\n * .action((source, destination) => {\n * console.log('clone command called');\n * });\n *\n * // Command implemented using separate executable file (description is second parameter to `.command`)\n * program\n * .command('start <service>', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n *\n * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n }\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n }\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n }\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // change how output being written, defaults to stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // change how output being written for errors, defaults to writeErr\n * outputError(str, write) // used for displaying errors and not used for displaying help\n * // specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // color support, currently only used with Help\n * getOutHasColors()\n * getErrHasColors()\n * stripColor() // used to remove ANSI escape codes if output does not have colors\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n Object.assign(this._outputConfiguration, configuration);\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {(boolean|string)} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) {\n throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`);\n }\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd._checkForBrokenPassThrough();\n\n return this;\n }\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n }\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('<input-file>');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {(Function|*)} [fn] - custom argument processing function\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, fn, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof fn === 'function') {\n argument.default(defaultValue).argParser(fn);\n } else {\n argument.default(fn);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments('<cmd> [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names\n .trim()\n .split(/ +/)\n .forEach((detail) => {\n this.argument(detail);\n });\n return this;\n }\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this.registeredArguments.slice(-1)[0];\n if (previousArgument && previousArgument.variadic) {\n throw new Error(\n `only the last argument can be variadic '${previousArgument.name()}'`,\n );\n }\n if (\n argument.required &&\n argument.defaultValue !== undefined &&\n argument.parseArg === undefined\n ) {\n throw new Error(\n `a default value for a required argument is never used: '${argument.name()}'`,\n );\n }\n this.registeredArguments.push(argument);\n return this;\n }\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n *\n * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added\n * @param {string} [description] - custom description\n * @return {Command} `this` command for chaining\n */\n\n helpCommand(enableOrNameAndArgs, description) {\n if (typeof enableOrNameAndArgs === 'boolean') {\n this._addImplicitHelpCommand = enableOrNameAndArgs;\n return this;\n }\n\n enableOrNameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = enableOrNameAndArgs.match(/([^ ]+) *(.*)/);\n const helpDescription = description ?? 'display help for command';\n\n const helpCommand = this.createCommand(helpName);\n helpCommand.helpOption(false);\n if (helpArgs) helpCommand.arguments(helpArgs);\n if (helpDescription) helpCommand.description(helpDescription);\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n\n return this;\n }\n\n /**\n * Add prepared custom help command.\n *\n * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`\n * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only\n * @return {Command} `this` command for chaining\n */\n addHelpCommand(helpCommand, deprecatedDescription) {\n // If not passed an object, call through to helpCommand for backwards compatibility,\n // as addHelpCommand was originally used like helpCommand is now.\n if (typeof helpCommand !== 'object') {\n this.helpCommand(helpCommand, deprecatedDescription);\n return this;\n }\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n return this;\n }\n\n /**\n * Lazy create help command.\n *\n * @return {(Command|null)}\n * @package\n */\n _getHelpCommand() {\n const hasImplicitHelpCommand =\n this._addImplicitHelpCommand ??\n (this.commands.length &&\n !this._actionHandler &&\n !this._findCommand('help'));\n\n if (hasImplicitHelpCommand) {\n if (this._helpCommand === undefined) {\n this.helpCommand(undefined, undefined); // use default name and description\n }\n return this._helpCommand;\n }\n return null;\n }\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preSubcommand', 'preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n }\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n }\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this.registeredArguments.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n }\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n }\n\n /**\n * Wrap parseArgs to catch 'commander.invalidArgument'.\n *\n * @param {(Option | Argument)} target\n * @param {string} value\n * @param {*} previous\n * @param {string} invalidArgumentMessage\n * @private\n */\n\n _callParseArg(target, value, previous, invalidArgumentMessage) {\n try {\n return target.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidArgumentMessage} ${err.message}`;\n this.error(message, { exitCode: err.exitCode, code: err.code });\n }\n throw err;\n }\n }\n\n /**\n * Check for option flag conflicts.\n * Register option if no conflicts found, or throw on conflict.\n *\n * @param {Option} option\n * @private\n */\n\n _registerOption(option) {\n const matchingOption =\n (option.short && this._findOption(option.short)) ||\n (option.long && this._findOption(option.long));\n if (matchingOption) {\n const matchingFlag =\n option.long && this._findOption(option.long)\n ? option.long\n : option.short;\n throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`);\n }\n\n this.options.push(option);\n }\n\n /**\n * Check for command name and alias conflicts with existing commands.\n * Register command if no conflicts found, or throw on conflict.\n *\n * @param {Command} command\n * @private\n */\n\n _registerCommand(command) {\n const knownBy = (cmd) => {\n return [cmd.name()].concat(cmd.aliases());\n };\n\n const alreadyUsed = knownBy(command).find((name) =>\n this._findCommand(name),\n );\n if (alreadyUsed) {\n const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');\n const newCmd = knownBy(command).join('|');\n throw new Error(\n `cannot add command '${newCmd}' as already have command '${existingCmd}'`,\n );\n }\n\n this.commands.push(command);\n }\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n this._registerOption(option);\n\n const oname = option.name();\n const name = option.attributeName();\n\n // store default value\n if (option.negate) {\n // --no-foo is special and defaults foo to true, unless a --foo option is already defined\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n if (!this._findOption(positiveLongFlag)) {\n this.setOptionValueWithSource(\n name,\n option.defaultValue === undefined ? true : option.defaultValue,\n 'default',\n );\n }\n } else if (option.defaultValue !== undefined) {\n this.setOptionValueWithSource(name, option.defaultValue, 'default');\n }\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // val is null for optional option used without an optional-argument.\n // val is undefined for boolean and negated option.\n if (val == null && option.presetArg !== undefined) {\n val = option.presetArg;\n }\n\n // custom processing\n const oldValue = this.getOptionValue(name);\n if (val !== null && option.parseArg) {\n val = this._callParseArg(option, val, oldValue, invalidValueMessage);\n } else if (val !== null && option.variadic) {\n val = option._concatValue(val, oldValue);\n }\n\n // Fill-in appropriate missing values. Long winded but easy to follow.\n if (val == null) {\n if (option.negate) {\n val = false;\n } else if (option.isBoolean() || option.optional) {\n val = true;\n } else {\n val = ''; // not normal, parseArg might have failed or be a mock function for testing\n }\n }\n this.setOptionValueWithSource(name, val, valueSource);\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @return {Command} `this` command for chaining\n * @private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n if (typeof flags === 'object' && flags instanceof Option) {\n throw new Error(\n 'To add an Option object use addOption() instead of option() or requiredOption()',\n );\n }\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n option(flags, description, parseArg, defaultValue) {\n return this._optionEx({}, flags, description, parseArg, defaultValue);\n }\n\n /**\n * Add a required option which must have a value after parsing. This usually means\n * the option must be specified on the command line. (Otherwise the same as .option().)\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n requiredOption(flags, description, parseArg, defaultValue) {\n return this._optionEx(\n { mandatory: true },\n flags,\n description,\n parseArg,\n defaultValue,\n );\n }\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * // for `.option('-f,--flag [value]'):\n * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour\n * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n *\n * @param {boolean} [combine] - if `true` or omitted, an optional value can be specified directly after the flag.\n * @return {Command} `this` command for chaining\n */\n combineFlagAndOptionalValue(combine = true) {\n this._combineFlagAndOptionalValue = !!combine;\n return this;\n }\n\n /**\n * Allow unknown options on the command line.\n *\n * @param {boolean} [allowUnknown] - if `true` or omitted, no error will be thrown for unknown options.\n * @return {Command} `this` command for chaining\n */\n allowUnknownOption(allowUnknown = true) {\n this._allowUnknownOption = !!allowUnknown;\n return this;\n }\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @param {boolean} [allowExcess] - if `true` or omitted, no error will be thrown for excess arguments.\n * @return {Command} `this` command for chaining\n */\n allowExcessArguments(allowExcess = true) {\n this._allowExcessArguments = !!allowExcess;\n return this;\n }\n\n /**\n * Enable positional options. Positional means global options are specified before subcommands which lets\n * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @param {boolean} [positional]\n * @return {Command} `this` command for chaining\n */\n enablePositionalOptions(positional = true) {\n this._enablePositionalOptions = !!positional;\n return this;\n }\n\n /**\n * Pass through options that come after command-arguments rather than treat them as command-options,\n * so actual command-options come before command-arguments. Turning this on for a subcommand requires\n * positional options to have been enabled on the program (parent commands).\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @param {boolean} [passThrough] for unknown options.\n * @return {Command} `this` command for chaining\n */\n passThroughOptions(passThrough = true) {\n this._passThroughOptions = !!passThrough;\n this._checkForBrokenPassThrough();\n return this;\n }\n\n /**\n * @private\n */\n\n _checkForBrokenPassThrough() {\n if (\n this.parent &&\n this._passThroughOptions &&\n !this.parent._enablePositionalOptions\n ) {\n throw new Error(\n `passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`,\n );\n }\n }\n\n /**\n * Whether to store option values as properties on command object,\n * or store separately (specify false). In both cases the option values can be accessed using .opts().\n *\n * @param {boolean} [storeAsProperties=true]\n * @return {Command} `this` command for chaining\n */\n\n storeOptionsAsProperties(storeAsProperties = true) {\n if (this.options.length) {\n throw new Error('call .storeOptionsAsProperties() before adding options');\n }\n if (Object.keys(this._optionValues).length) {\n throw new Error(\n 'call .storeOptionsAsProperties() before setting option values',\n );\n }\n this._storeOptionsAsProperties = !!storeAsProperties;\n return this;\n }\n\n /**\n * Retrieve option value.\n *\n * @param {string} key\n * @return {object} value\n */\n\n getOptionValue(key) {\n if (this._storeOptionsAsProperties) {\n return this[key];\n }\n return this._optionValues[key];\n }\n\n /**\n * Store option value.\n *\n * @param {string} key\n * @param {object} value\n * @return {Command} `this` command for chaining\n */\n\n setOptionValue(key, value) {\n return this.setOptionValueWithSource(key, value, undefined);\n }\n\n /**\n * Store option value and where the value came from.\n *\n * @param {string} key\n * @param {object} value\n * @param {string} source - expected values are default/config/env/cli/implied\n * @return {Command} `this` command for chaining\n */\n\n setOptionValueWithSource(key, value, source) {\n if (this._storeOptionsAsProperties) {\n this[key] = value;\n } else {\n this._optionValues[key] = value;\n }\n this._optionValueSources[key] = source;\n return this;\n }\n\n /**\n * Get source of option value.\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSource(key) {\n return this._optionValueSources[key];\n }\n\n /**\n * Get source of option value. See also .optsWithGlobals().\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSourceWithGlobals(key) {\n // global overwrites local, like optsWithGlobals\n let source;\n this._getCommandAndAncestors().forEach((cmd) => {\n if (cmd.getOptionValueSource(key) !== undefined) {\n source = cmd.getOptionValueSource(key);\n }\n });\n return source;\n }\n\n /**\n * Get user arguments from implied or explicit arguments.\n * Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.\n *\n * @private\n */\n\n _prepareUserArgs(argv, parseOptions) {\n if (argv !== undefined && !Array.isArray(argv)) {\n throw new Error('first parameter to parse must be array or undefined');\n }\n parseOptions = parseOptions || {};\n\n // auto-detect argument conventions if nothing supplied\n if (argv === undefined && parseOptions.from === undefined) {\n if (process.versions?.electron) {\n parseOptions.from = 'electron';\n }\n // check node specific options for scenarios where user CLI args follow executable without scriptname\n const execArgv = process.execArgv ?? [];\n if (\n execArgv.includes('-e') ||\n execArgv.includes('--eval') ||\n execArgv.includes('-p') ||\n execArgv.includes('--print')\n ) {\n parseOptions.from = 'eval'; // internal usage, not documented\n }\n }\n\n // default to using process.argv\n if (argv === undefined) {\n argv = process.argv;\n }\n this.rawArgs = argv.slice();\n\n // extract the user args and scriptPath\n let userArgs;\n switch (parseOptions.from) {\n case undefined:\n case 'node':\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n break;\n case 'electron':\n // @ts-ignore: because defaultApp is an unknown property\n if (process.defaultApp) {\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n } else {\n userArgs = argv.slice(1);\n }\n break;\n case 'user':\n userArgs = argv.slice(0);\n break;\n case 'eval':\n userArgs = argv.slice(1);\n break;\n default:\n throw new Error(\n `unexpected parse option { from: '${parseOptions.from}' }`,\n );\n }\n\n // Find default name for program from arguments.\n if (!this._name && this._scriptPath)\n this.nameFromFilename(this._scriptPath);\n this._name = this._name || 'program';\n\n return userArgs;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Use parseAsync instead of parse if any of your action handlers are async.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * program.parse(); // parse process.argv and auto-detect electron and special node flags\n * program.parse(process.argv); // assume argv[0] is app and argv[1] is script\n * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv] - optional, defaults to process.argv\n * @param {object} [parseOptions] - optionally specify style of options with from: node/user/electron\n * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'\n * @return {Command} `this` command for chaining\n */\n\n parse(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n this._parseCommand([], userArgs);\n\n return this;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags\n * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script\n * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv]\n * @param {object} [parseOptions]\n * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'\n * @return {Promise}\n */\n\n async parseAsync(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n await this._parseCommand([], userArgs);\n\n return this;\n }\n\n _prepareForParse() {\n if (this._savedState === null) {\n this.saveStateBeforeParse();\n } else {\n this.restoreStateBeforeParse();\n }\n }\n\n /**\n * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state saved.\n */\n saveStateBeforeParse() {\n this._savedState = {\n // name is stable if supplied by author, but may be unspecified for root command and deduced during parsing\n _name: this._name,\n // option values before parse have default values (including false for negated options)\n // shallow clones\n _optionValues: { ...this._optionValues },\n _optionValueSources: { ...this._optionValueSources },\n };\n }\n\n /**\n * Restore state before parse for calls after the first.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state restored.\n */\n restoreStateBeforeParse() {\n if (this._storeOptionsAsProperties)\n throw new Error(`Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties`);\n\n // clear state from _prepareUserArgs\n this._name = this._savedState._name;\n this._scriptPath = null;\n this.rawArgs = [];\n // clear state from setOptionValueWithSource\n this._optionValues = { ...this._savedState._optionValues };\n this._optionValueSources = { ...this._savedState._optionValueSources };\n // clear state from _parseCommand\n this.args = [];\n // clear state from _processArguments\n this.processedArgs = [];\n }\n\n /**\n * Throw if expected executable is missing. Add lots of help for author.\n *\n * @param {string} executableFile\n * @param {string} executableDir\n * @param {string} subcommandName\n */\n _checkForMissingExecutable(executableFile, executableDir, subcommandName) {\n if (fs.existsSync(executableFile)) return;\n\n const executableDirMessage = executableDir\n ? `searched for local subcommand relative to directory '${executableDir}'`\n : 'no directory for search for local subcommand, use .executableDir() to supply a custom directory';\n const executableMissing = `'${executableFile}' does not exist\n - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${executableDirMessage}`;\n throw new Error(executableMissing);\n }\n\n /**\n * Execute a sub-command executable.\n *\n * @private\n */\n\n _executeSubCommand(subcommand, args) {\n args = args.slice();\n let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.\n const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];\n\n function findFile(baseDir, baseName) {\n // Look for specified file\n const localBin = path.resolve(baseDir, baseName);\n if (fs.existsSync(localBin)) return localBin;\n\n // Stop looking if candidate already has an expected extension.\n if (sourceExt.includes(path.extname(baseName))) return undefined;\n\n // Try all the extensions.\n const foundExt = sourceExt.find((ext) =>\n fs.existsSync(`${localBin}${ext}`),\n );\n if (foundExt) return `${localBin}${foundExt}`;\n\n return undefined;\n }\n\n // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // executableFile and executableDir might be full path, or just a name\n let executableFile =\n subcommand._executableFile || `${this._name}-${subcommand._name}`;\n let executableDir = this._executableDir || '';\n if (this._scriptPath) {\n let resolvedScriptPath; // resolve possible symlink for installed npm binary\n try {\n resolvedScriptPath = fs.realpathSync(this._scriptPath);\n } catch {\n resolvedScriptPath = this._scriptPath;\n }\n executableDir = path.resolve(\n path.dirname(resolvedScriptPath),\n executableDir,\n );\n }\n\n // Look for a local file in preference to a command in PATH.\n if (executableDir) {\n let localFile = findFile(executableDir, executableFile);\n\n // Legacy search using prefix of script name instead of command name\n if (!localFile && !subcommand._executableFile && this._scriptPath) {\n const legacyName = path.basename(\n this._scriptPath,\n path.extname(this._scriptPath),\n );\n if (legacyName !== this._name) {\n localFile = findFile(\n executableDir,\n `${legacyName}-${subcommand._name}`,\n );\n }\n }\n executableFile = localFile || executableFile;\n }\n\n launchWithNode = sourceExt.includes(path.extname(executableFile));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });\n }\n } else {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n if (!proc.killed) {\n // testing mainly to avoid leak warnings during unit tests with mocked spawn\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n // @ts-ignore because signals not typed to known strings\n proc.kill(signal);\n }\n });\n });\n }\n\n // By default terminate process when spawned process terminates.\n const exitCallback = this._exitCallback;\n proc.on('close', (code) => {\n code = code ?? 1; // code is null if spawned process terminated due to a signal\n if (!exitCallback) {\n process.exit(code);\n } else {\n exitCallback(\n new CommanderError(\n code,\n 'commander.executeSubCommandAsync',\n '(close)',\n ),\n );\n }\n });\n proc.on('error', (err) => {\n // @ts-ignore: because err.code is an unknown property\n if (err.code === 'ENOENT') {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n // @ts-ignore: because err.code is an unknown property\n } else if (err.code === 'EACCES') {\n throw new Error(`'${executableFile}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(\n 1,\n 'commander.executeSubCommandAsync',\n '(error)',\n );\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n }\n\n /**\n * @private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n subCommand._prepareForParse();\n let promiseChain;\n promiseChain = this._chainOrCallSubCommandHook(\n promiseChain,\n subCommand,\n 'preSubcommand',\n );\n promiseChain = this._chainOrCall(promiseChain, () => {\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n });\n return promiseChain;\n }\n\n /**\n * Invoke help directly if possible, or dispatch if necessary.\n * e.g. help foo\n *\n * @private\n */\n\n _dispatchHelpCommand(subcommandName) {\n if (!subcommandName) {\n this.help();\n }\n const subCommand = this._findCommand(subcommandName);\n if (subCommand && !subCommand._executableHandler) {\n subCommand.help();\n }\n\n // Fallback to parsing the help flag to invoke the help.\n return this._dispatchSubcommand(\n subcommandName,\n [],\n [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'],\n );\n }\n\n /**\n * Check this.args against expected this.registeredArguments.\n *\n * @private\n */\n\n _checkNumberOfArguments() {\n // too few\n this.registeredArguments.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (\n this.registeredArguments.length > 0 &&\n this.registeredArguments[this.registeredArguments.length - 1].variadic\n ) {\n return;\n }\n if (this.args.length > this.registeredArguments.length) {\n this._excessArguments(this.args);\n }\n }\n\n /**\n * Process this.args using this.registeredArguments and save as this.processedArgs!\n *\n * @private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;\n parsedValue = this._callParseArg(\n argument,\n value,\n previous,\n invalidValueMessage,\n );\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this.registeredArguments.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {(Promise|undefined)} promise\n * @param {Function} fn\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise && promise.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n this._getCommandAndAncestors()\n .reverse()\n .filter((cmd) => cmd._lifeCycleHooks[event] !== undefined)\n .forEach((hookedCommand) => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {Command} subCommand\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallSubCommandHook(promise, subCommand, event) {\n let result = promise;\n if (this._lifeCycleHooks[event] !== undefined) {\n this._lifeCycleHooks[event].forEach((hook) => {\n result = this._chainOrCall(result, () => {\n return hook(this, subCommand);\n });\n });\n }\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n this._parseOptionsImplied();\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (\n this._getHelpCommand() &&\n operands[0] === this._getHelpCommand().name()\n ) {\n return this._dispatchHelpCommand(operands[1]);\n }\n if (this._defaultCommandName) {\n this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(\n this._defaultCommandName,\n operands,\n unknown,\n );\n }\n if (\n this.commands.length &&\n this.args.length === 0 &&\n !this._actionHandler &&\n !this._defaultCommandName\n ) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n this._outputHelpIfRequested(parsed.unknown);\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let promiseChain;\n promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');\n promiseChain = this._chainOrCall(promiseChain, () =>\n this._actionHandler(this.processedArgs),\n );\n if (this.parent) {\n promiseChain = this._chainOrCall(promiseChain, () => {\n this.parent.emit(commandEvent, operands, unknown); // legacy\n });\n }\n promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');\n return promiseChain;\n }\n if (this.parent && this.parent.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) {\n // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n }\n\n /**\n * Find matching command.\n *\n * @private\n * @return {Command | undefined}\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(\n (cmd) => cmd._name === name || cmd._aliases.includes(name),\n );\n }\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @package\n */\n\n _findOption(arg) {\n return this.options.find((option) => option.is(arg));\n }\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd.options.forEach((anOption) => {\n if (\n anOption.mandatory &&\n cmd.getOptionValue(anOption.attributeName()) === undefined\n ) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n });\n }\n\n /**\n * Display an error message if conflicting options are used together in this.\n *\n * @private\n */\n _checkForConflictingLocalOptions() {\n const definedNonDefaultOptions = this.options.filter((option) => {\n const optionKey = option.attributeName();\n if (this.getOptionValue(optionKey) === undefined) {\n return false;\n }\n return this.getOptionValueSource(optionKey) !== 'default';\n });\n\n const optionsWithConflicting = definedNonDefaultOptions.filter(\n (option) => option.conflictsWith.length > 0,\n );\n\n optionsWithConflicting.forEach((option) => {\n const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>\n option.conflictsWith.includes(defined.attributeName()),\n );\n if (conflictingAndDefined) {\n this._conflictingOption(option, conflictingAndDefined);\n }\n });\n }\n\n /**\n * Display an error message if conflicting options are used together.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n _checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd._checkForConflictingLocalOptions();\n });\n }\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {string[]} argv\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(argv) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n const args = argv.slice();\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n // parse options\n let activeVariadicOption = null;\n while (args.length) {\n const arg = args.shift();\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args);\n break;\n }\n\n if (activeVariadicOption && !maybeOption(arg)) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args.shift();\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (args.length > 0 && !maybeOption(args[0])) {\n value = args.shift();\n }\n this.emit(`option:${option.name()}`, value);\n } else {\n // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (\n option.required ||\n (option.optional && this._combineFlagAndOptionalValue)\n ) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option, emit and put back remainder of arg for further processing\n this.emit(`option:${option.name()}`);\n args.unshift(`-${arg.slice(2)}`);\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n if (maybeOption(arg)) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if (\n (this._enablePositionalOptions || this._passThroughOptions) &&\n operands.length === 0 &&\n unknown.length === 0\n ) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg);\n if (args.length > 0) operands.push(...args);\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg);\n if (args.length > 0) dest.push(...args);\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n }\n\n /**\n * Return an object containing local option values as key-value pairs.\n *\n * @return {object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] =\n key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n }\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n *\n * @return {object}\n */\n optsWithGlobals() {\n // globals overwrite locals\n return this._getCommandAndAncestors().reduce(\n (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),\n {},\n );\n }\n\n /**\n * Display error message and exit (or call exitOverride).\n *\n * @param {string} message\n * @param {object} [errorOptions]\n * @param {string} [errorOptions.code] - an id string representing the error\n * @param {number} [errorOptions.exitCode] - used with process.exit\n */\n error(message, errorOptions) {\n // output handling\n this._outputConfiguration.outputError(\n `${message}\\n`,\n this._outputConfiguration.writeErr,\n );\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n\n // exit handling\n const config = errorOptions || {};\n const exitCode = config.exitCode || 1;\n const code = config.code || 'commander.error';\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (\n this.getOptionValue(optionKey) === undefined ||\n ['default', 'config', 'env'].includes(\n this.getOptionValueSource(optionKey),\n )\n ) {\n if (option.required || option.optional) {\n // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else {\n // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Apply any implied option values, if option is undefined or default value.\n *\n * @private\n */\n _parseOptionsImplied() {\n const dualHelper = new DualOptions(this.options);\n const hasCustomOptionValue = (optionKey) => {\n return (\n this.getOptionValue(optionKey) !== undefined &&\n !['default', 'implied'].includes(this.getOptionValueSource(optionKey))\n );\n };\n this.options\n .filter(\n (option) =>\n option.implied !== undefined &&\n hasCustomOptionValue(option.attributeName()) &&\n dualHelper.valueFromOption(\n this.getOptionValue(option.attributeName()),\n option,\n ),\n )\n .forEach((option) => {\n Object.keys(option.implied)\n .filter((impliedKey) => !hasCustomOptionValue(impliedKey))\n .forEach((impliedKey) => {\n this.setOptionValueWithSource(\n impliedKey,\n option.implied[impliedKey],\n 'implied',\n );\n });\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this.error(message, { code: 'commander.missingArgument' });\n }\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this.error(message, { code: 'commander.optionMissingArgument' });\n }\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this.error(message, { code: 'commander.missingMandatoryOptionValue' });\n }\n\n /**\n * `Option` conflicts with another option.\n *\n * @param {Option} option\n * @param {Option} conflictingOption\n * @private\n */\n _conflictingOption(option, conflictingOption) {\n // The calling code does not know whether a negated option is the source of the\n // value, so do some work to take an educated guess.\n const findBestOptionFromValue = (option) => {\n const optionKey = option.attributeName();\n const optionValue = this.getOptionValue(optionKey);\n const negativeOption = this.options.find(\n (target) => target.negate && optionKey === target.attributeName(),\n );\n const positiveOption = this.options.find(\n (target) => !target.negate && optionKey === target.attributeName(),\n );\n if (\n negativeOption &&\n ((negativeOption.presetArg === undefined && optionValue === false) ||\n (negativeOption.presetArg !== undefined &&\n optionValue === negativeOption.presetArg))\n ) {\n return negativeOption;\n }\n return positiveOption || option;\n };\n\n const getErrorMessage = (option) => {\n const bestOption = findBestOptionFromValue(option);\n const optionKey = bestOption.attributeName();\n const source = this.getOptionValueSource(optionKey);\n if (source === 'env') {\n return `environment variable '${bestOption.envVar}'`;\n }\n return `option '${bestOption.flags}'`;\n };\n\n const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;\n this.error(message, { code: 'commander.conflictingOption' });\n }\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n do {\n const moreFlags = command\n .createHelp()\n .visibleOptions(command)\n .filter((option) => option.long)\n .map((option) => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this.error(message, { code: 'commander.unknownOption' });\n }\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this.registeredArguments.length;\n const s = expected === 1 ? '' : 's';\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;\n this.error(message, { code: 'commander.excessArguments' });\n }\n\n /**\n * Unknown command.\n *\n * @private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp()\n .visibleCommands(this)\n .forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this.error(message, { code: 'commander.unknownCommand' });\n }\n\n /**\n * Get or set the program version.\n *\n * This method auto-registers the \"-V, --version\" option which will print the version number.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} [str]\n * @param {string} [flags]\n * @param {string} [description]\n * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this._registerOption(versionOption);\n\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n }\n\n /**\n * Set the description.\n *\n * @param {string} [str]\n * @param {object} [argsDescription]\n * @return {(string|Command)}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined)\n return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n }\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n summary(str) {\n if (str === undefined) return this._summary;\n this._summary = str;\n return this;\n }\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {(string|Command)}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n if (\n this.commands.length !== 0 &&\n this.commands[this.commands.length - 1]._executableHandler\n ) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name)\n throw new Error(\"Command alias can't be the same as its name\");\n const matchingCommand = this.parent?._findCommand(alias);\n if (matchingCommand) {\n // c.f. _registerCommand\n const existingCmd = [matchingCommand.name()]\n .concat(matchingCommand.aliases())\n .join('|');\n throw new Error(\n `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`,\n );\n }\n\n command._aliases.push(alias);\n return this;\n }\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {(string[]|Command)}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n }\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this.registeredArguments.map((arg) => {\n return humanReadableArgName(arg);\n });\n return []\n .concat(\n this.options.length || this._helpOption !== null ? '[options]' : [],\n this.commands.length ? '[command]' : [],\n this.registeredArguments.length ? args : [],\n )\n .join(' ');\n }\n\n this._usage = str;\n return this;\n }\n\n /**\n * Get or set the name of the command.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n }\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or require.main.filename, or __filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * program.nameFromFilename(require.main.filename);\n *\n * @param {string} filename\n * @return {Command}\n */\n\n nameFromFilename(filename) {\n this._name = path.basename(filename, path.extname(filename));\n\n return this;\n }\n\n /**\n * Get or set the directory for searching for executable subcommands of this command.\n *\n * @example\n * program.executableDir(__dirname);\n * // or\n * program.executableDir('subcommands');\n *\n * @param {string} [path]\n * @return {(string|null|Command)}\n */\n\n executableDir(path) {\n if (path === undefined) return this._executableDir;\n this._executableDir = path;\n return this;\n }\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n const context = this._getOutputContext(contextOptions);\n helper.prepareContext({\n error: context.error,\n helpWidth: context.helpWidth,\n outputHasColors: context.hasColors,\n });\n const text = helper.formatHelp(this, helper);\n if (context.hasColors) return text;\n return this._outputConfiguration.stripColor(text);\n }\n\n /**\n * @typedef HelpContext\n * @type {object}\n * @property {boolean} error\n * @property {number} helpWidth\n * @property {boolean} hasColors\n * @property {function} write - includes stripColor if needed\n *\n * @returns {HelpContext}\n * @private\n */\n\n _getOutputContext(contextOptions) {\n contextOptions = contextOptions || {};\n const error = !!contextOptions.error;\n let baseWrite;\n let hasColors;\n let helpWidth;\n if (error) {\n baseWrite = (str) => this._outputConfiguration.writeErr(str);\n hasColors = this._outputConfiguration.getErrHasColors();\n helpWidth = this._outputConfiguration.getErrHelpWidth();\n } else {\n baseWrite = (str) => this._outputConfiguration.writeOut(str);\n hasColors = this._outputConfiguration.getOutHasColors();\n helpWidth = this._outputConfiguration.getOutHelpWidth();\n }\n const write = (str) => {\n if (!hasColors) str = this._outputConfiguration.stripColor(str);\n return baseWrite(str);\n };\n return { error, write, hasColors, helpWidth };\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n\n const outputContext = this._getOutputContext(contextOptions);\n /** @type {HelpTextEventContext} */\n const eventContext = {\n error: outputContext.error,\n write: outputContext.write,\n command: this,\n };\n\n this._getCommandAndAncestors()\n .reverse()\n .forEach((command) => command.emit('beforeAllHelp', eventContext));\n this.emit('beforeHelp', eventContext);\n\n let helpInformation = this.helpInformation({ error: outputContext.error });\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (\n typeof helpInformation !== 'string' &&\n !Buffer.isBuffer(helpInformation)\n ) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n outputContext.write(helpInformation);\n\n if (this._getHelpOption()?.long) {\n this.emit(this._getHelpOption().long); // deprecated\n }\n this.emit('afterHelp', eventContext);\n this._getCommandAndAncestors().forEach((command) =>\n command.emit('afterAllHelp', eventContext),\n );\n }\n\n /**\n * You can pass in flags and a description to customise the built-in help option.\n * Pass in false to disable the built-in help option.\n *\n * @example\n * program.helpOption('-?, --help' 'show help'); // customise\n * program.helpOption(false); // disable\n *\n * @param {(string | boolean)} flags\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n // Support disabling built-in help option.\n if (typeof flags === 'boolean') {\n // true is not an expected value. Do something sensible but no unit-test.\n // istanbul ignore if\n if (flags) {\n this._helpOption = this._helpOption ?? undefined; // preserve existing option\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n flags = flags ?? '-h, --help';\n description = description ?? 'display help for command';\n this._helpOption = this.createOption(flags, description);\n\n return this;\n }\n\n /**\n * Lazy create help option.\n * Returns null if has been disabled with .helpOption(false).\n *\n * @returns {(Option | null)} the help option\n * @package\n */\n _getHelpOption() {\n // Lazy create help option on demand.\n if (this._helpOption === undefined) {\n this.helpOption(undefined, undefined);\n }\n return this._helpOption;\n }\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addHelpOption(option) {\n this._helpOption = option;\n return this;\n }\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number\n if (\n exitCode === 0 &&\n contextOptions &&\n typeof contextOptions !== 'function' &&\n contextOptions.error\n ) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n }\n\n /**\n * // Do a little typing to coordinate emit and listener for the help text events.\n * @typedef HelpTextEventContext\n * @type {object}\n * @property {boolean} error\n * @property {Command} command\n * @property {function} write\n */\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {(string | Function)} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n\n /**\n * Output help information if help flags specified\n *\n * @param {Array} args - array of options to search for help flags\n * @private\n */\n\n _outputHelpIfRequested(args) {\n const helpOption = this._getHelpOption();\n const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));\n if (helpRequested) {\n this.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n this._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null\n ) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null\n ) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * @returns {boolean | undefined}\n * @package\n */\nfunction useColor() {\n // Test for common conventions.\n // NB: the observed behaviour is in combination with how author adds color! For example:\n // - we do not test NODE_DISABLE_COLORS, but util:styletext does\n // - we do test NO_COLOR, but Chalk does not\n //\n // References:\n // https://no-color.org\n // https://bixense.com/clicolors/\n // https://github.com/nodejs/node/blob/0a00217a5f67ef4a22384cfc80eb6dd9a917fdc1/lib/internal/tty.js#L109\n // https://github.com/chalk/supports-color/blob/c214314a14bcb174b12b3014b2b0a8de375029ae/index.js#L33\n // (https://force-color.org recent web page from 2023, does not match major javascript implementations)\n\n if (\n process.env.NO_COLOR ||\n process.env.FORCE_COLOR === '0' ||\n process.env.FORCE_COLOR === 'false'\n )\n return false;\n if (process.env.FORCE_COLOR || process.env.CLICOLOR_FORCE !== undefined)\n return true;\n return undefined;\n}\n\nexports.Command = Command;\nexports.useColor = useColor; // exporting for tests\n","const { Argument } = require('./lib/argument.js');\nconst { Command } = require('./lib/command.js');\nconst { CommanderError, InvalidArgumentError } = require('./lib/error.js');\nconst { Help } = require('./lib/help.js');\nconst { Option } = require('./lib/option.js');\n\nexports.program = new Command();\n\nexports.createCommand = (name) => new Command(name);\nexports.createOption = (flags, description) => new Option(flags, description);\nexports.createArgument = (name, description) => new Argument(name, description);\n\n/**\n * Expose classes\n */\n\nexports.Command = Command;\nexports.Option = Option;\nexports.Argument = Argument;\nexports.Help = Help;\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\nexports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated\n","'use strict';\n\nconst ESC = '\\x1B';\nconst CSI = `${ESC}[`;\nconst beep = '\\u0007';\n\nconst cursor = {\n to(x, y) {\n if (!y) return `${CSI}${x + 1}G`;\n return `${CSI}${y + 1};${x + 1}H`;\n },\n move(x, y) {\n let ret = '';\n\n if (x < 0) ret += `${CSI}${-x}D`;\n else if (x > 0) ret += `${CSI}${x}C`;\n\n if (y < 0) ret += `${CSI}${-y}A`;\n else if (y > 0) ret += `${CSI}${y}B`;\n\n return ret;\n },\n up: (count = 1) => `${CSI}${count}A`,\n down: (count = 1) => `${CSI}${count}B`,\n forward: (count = 1) => `${CSI}${count}C`,\n backward: (count = 1) => `${CSI}${count}D`,\n nextLine: (count = 1) => `${CSI}E`.repeat(count),\n prevLine: (count = 1) => `${CSI}F`.repeat(count),\n left: `${CSI}G`,\n hide: `${CSI}?25l`,\n show: `${CSI}?25h`,\n save: `${ESC}7`,\n restore: `${ESC}8`\n}\n\nconst scroll = {\n up: (count = 1) => `${CSI}S`.repeat(count),\n down: (count = 1) => `${CSI}T`.repeat(count)\n}\n\nconst erase = {\n screen: `${CSI}2J`,\n up: (count = 1) => `${CSI}1J`.repeat(count),\n down: (count = 1) => `${CSI}J`.repeat(count),\n line: `${CSI}2K`,\n lineEnd: `${CSI}K`,\n lineStart: `${CSI}1K`,\n lines(count) {\n let clear = '';\n for (let i = 0; i < count; i++)\n clear += this.line + (i < count - 1 ? cursor.up() : '');\n if (count)\n clear += cursor.left;\n return clear;\n }\n}\n\nmodule.exports = { cursor, scroll, erase, beep };\n","let p = process || {}, argv = p.argv || [], env = p.env || {}\nlet isColorSupported =\n\t!(!!env.NO_COLOR || argv.includes(\"--no-color\")) &&\n\t(!!env.FORCE_COLOR || argv.includes(\"--color\") || p.platform === \"win32\" || ((p.stdout || {}).isTTY && env.TERM !== \"dumb\") || !!env.CI)\n\nlet formatter = (open, close, replace = open) =>\n\tinput => {\n\t\tlet string = \"\" + input, index = string.indexOf(close, open.length)\n\t\treturn ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close\n\t}\n\nlet replaceClose = (string, close, replace, index) => {\n\tlet result = \"\", cursor = 0\n\tdo {\n\t\tresult += string.substring(cursor, index) + replace\n\t\tcursor = index + close.length\n\t\tindex = string.indexOf(close, cursor)\n\t} while (~index)\n\treturn result + string.substring(cursor)\n}\n\nlet createColors = (enabled = isColorSupported) => {\n\tlet f = enabled ? formatter : () => String\n\treturn {\n\t\tisColorSupported: enabled,\n\t\treset: f(\"\\x1b[0m\", \"\\x1b[0m\"),\n\t\tbold: f(\"\\x1b[1m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[1m\"),\n\t\tdim: f(\"\\x1b[2m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[2m\"),\n\t\titalic: f(\"\\x1b[3m\", \"\\x1b[23m\"),\n\t\tunderline: f(\"\\x1b[4m\", \"\\x1b[24m\"),\n\t\tinverse: f(\"\\x1b[7m\", \"\\x1b[27m\"),\n\t\thidden: f(\"\\x1b[8m\", \"\\x1b[28m\"),\n\t\tstrikethrough: f(\"\\x1b[9m\", \"\\x1b[29m\"),\n\n\t\tblack: f(\"\\x1b[30m\", \"\\x1b[39m\"),\n\t\tred: f(\"\\x1b[31m\", \"\\x1b[39m\"),\n\t\tgreen: f(\"\\x1b[32m\", \"\\x1b[39m\"),\n\t\tyellow: f(\"\\x1b[33m\", \"\\x1b[39m\"),\n\t\tblue: f(\"\\x1b[34m\", \"\\x1b[39m\"),\n\t\tmagenta: f(\"\\x1b[35m\", \"\\x1b[39m\"),\n\t\tcyan: f(\"\\x1b[36m\", \"\\x1b[39m\"),\n\t\twhite: f(\"\\x1b[37m\", \"\\x1b[39m\"),\n\t\tgray: f(\"\\x1b[90m\", \"\\x1b[39m\"),\n\n\t\tbgBlack: f(\"\\x1b[40m\", \"\\x1b[49m\"),\n\t\tbgRed: f(\"\\x1b[41m\", \"\\x1b[49m\"),\n\t\tbgGreen: f(\"\\x1b[42m\", \"\\x1b[49m\"),\n\t\tbgYellow: f(\"\\x1b[43m\", \"\\x1b[49m\"),\n\t\tbgBlue: f(\"\\x1b[44m\", \"\\x1b[49m\"),\n\t\tbgMagenta: f(\"\\x1b[45m\", \"\\x1b[49m\"),\n\t\tbgCyan: f(\"\\x1b[46m\", \"\\x1b[49m\"),\n\t\tbgWhite: f(\"\\x1b[47m\", \"\\x1b[49m\"),\n\n\t\tblackBright: f(\"\\x1b[90m\", \"\\x1b[39m\"),\n\t\tredBright: f(\"\\x1b[91m\", \"\\x1b[39m\"),\n\t\tgreenBright: f(\"\\x1b[92m\", \"\\x1b[39m\"),\n\t\tyellowBright: f(\"\\x1b[93m\", \"\\x1b[39m\"),\n\t\tblueBright: f(\"\\x1b[94m\", \"\\x1b[39m\"),\n\t\tmagentaBright: f(\"\\x1b[95m\", \"\\x1b[39m\"),\n\t\tcyanBright: f(\"\\x1b[96m\", \"\\x1b[39m\"),\n\t\twhiteBright: f(\"\\x1b[97m\", \"\\x1b[39m\"),\n\n\t\tbgBlackBright: f(\"\\x1b[100m\", \"\\x1b[49m\"),\n\t\tbgRedBright: f(\"\\x1b[101m\", \"\\x1b[49m\"),\n\t\tbgGreenBright: f(\"\\x1b[102m\", \"\\x1b[49m\"),\n\t\tbgYellowBright: f(\"\\x1b[103m\", \"\\x1b[49m\"),\n\t\tbgBlueBright: f(\"\\x1b[104m\", \"\\x1b[49m\"),\n\t\tbgMagentaBright: f(\"\\x1b[105m\", \"\\x1b[49m\"),\n\t\tbgCyanBright: f(\"\\x1b[106m\", \"\\x1b[49m\"),\n\t\tbgWhiteBright: f(\"\\x1b[107m\", \"\\x1b[49m\"),\n\t}\n}\n\nmodule.exports = createColors()\nmodule.exports.createColors = createColors\n","// needs a separate module as this is required inside chevrotain productive code\n// and also in the entry point for webpack(api.ts).\n// A separate file avoids cyclic dependencies and webpack errors.\nexport const VERSION = \"10.5.0\"\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseKeys = require('./_baseKeys'),\n getTag = require('./_getTag'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLike = require('./isArrayLike'),\n isBuffer = require('./isBuffer'),\n isPrototype = require('./_isPrototype'),\n isTypedArray = require('./isTypedArray');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = isEmpty;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","var baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var baseForOwn = require('./_baseForOwn'),\n createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n isArray = require('./isArray');\n\n/**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, baseIteratee(iteratee, 3));\n}\n\nmodule.exports = map;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","var identity = require('./identity');\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n return typeof value == 'function' ? value : identity;\n}\n\nmodule.exports = castFunction;\n","var arrayEach = require('./_arrayEach'),\n baseEach = require('./_baseEach'),\n castFunction = require('./_castFunction'),\n isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, castFunction(iteratee));\n}\n\nmodule.exports = forEach;\n","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;\n","var baseValues = require('./_baseValues'),\n keys = require('./keys');\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n}\n\nmodule.exports = values;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nmodule.exports = baseHas;\n","var baseHas = require('./_baseHas'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nmodule.exports = has;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys'),\n keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = clone;\n","export function PRINT_ERROR(msg: string) {\n /* istanbul ignore else - can't override global.console in node.js */\n if (console && console.error) {\n console.error(`Error: ${msg}`)\n }\n}\n\nexport function PRINT_WARNING(msg: string) {\n /* istanbul ignore else - can't override global.console in node.js*/\n if (console && console.warn) {\n // TODO: modify docs accordingly\n console.warn(`Warning: ${msg}`)\n }\n}\n","export function timer<T>(func: () => T): { time: number; value: T } {\n const start = new Date().getTime()\n const val = func()\n const end = new Date().getTime()\n const total = end - start\n return { time: total, value: val }\n}\n","// based on: https://github.com/petkaantonov/bluebird/blob/b97c0d2d487e8c5076e8bd897e0dcd4622d31846/src/util.js#L201-L216\nexport function toFastProperties(toBecomeFast: any) {\n function FakeConstructor() {}\n\n // If our object is used as a constructor it would receive\n FakeConstructor.prototype = toBecomeFast\n const fakeInstance = new (FakeConstructor as any)()\n\n function fakeAccess() {\n return typeof fakeInstance.bar\n }\n\n // help V8 understand this is a \"real\" prototype by actually using\n // the fake instance.\n fakeAccess()\n fakeAccess()\n\n // Always true condition to suppress the Firefox warning of unreachable\n // code after a return statement.\n if (1) return toBecomeFast\n\n // Eval prevents optimization of this method (even though this is dead code)\n /* istanbul ignore next */\n // tslint:disable-next-line\n eval(toBecomeFast)\n}\n","export { PRINT_WARNING, PRINT_ERROR } from \"./print\"\nexport { timer } from \"./timer\"\nexport { toFastProperties } from \"./to-fast-properties\"\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n","var toFinite = require('./toFinite');\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nmodule.exports = toInteger;\n","var baseSlice = require('./_baseSlice'),\n toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\nfunction drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n}\n\nmodule.exports = drop;\n","var baseGetTag = require('./_baseGetTag'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar regexpTag = '[object RegExp]';\n\n/**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\nfunction baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n}\n\nmodule.exports = baseIsRegExp;\n","var baseIsRegExp = require('./_baseIsRegExp'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;\n\n/**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\nvar isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\nmodule.exports = isRegExp;\n","var assignValue = require('./_assignValue'),\n castPath = require('./_castPath'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nmodule.exports = baseSet;\n","var baseGet = require('./_baseGet'),\n baseSet = require('./_baseSet'),\n castPath = require('./_castPath');\n\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\nfunction basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n}\n\nmodule.exports = basePickBy;\n","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n basePickBy = require('./_basePickBy'),\n getAllKeysIn = require('./_getAllKeysIn');\n\n/**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\nfunction pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = baseIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n}\n\nmodule.exports = pickBy;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","var assignValue = require('./_assignValue'),\n copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n isArrayLike = require('./isArrayLike'),\n isPrototype = require('./_isPrototype'),\n keys = require('./keys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\nmodule.exports = assign;\n","import map from \"lodash/map\"\nimport forEach from \"lodash/forEach\"\nimport isString from \"lodash/isString\"\nimport isRegExp from \"lodash/isRegExp\"\nimport pickBy from \"lodash/pickBy\"\nimport assign from \"lodash/assign\"\nimport {\n IGASTVisitor,\n IProduction,\n IProductionWithOccurrence,\n ISerializedGast,\n TokenType\n} from \"@chevrotain/types\"\n\n// TODO: duplicated code to avoid extracting another sub-package -- how to avoid?\nfunction tokenLabel(tokType: TokenType): string {\n if (hasTokenLabel(tokType)) {\n return tokType.LABEL\n } else {\n return tokType.name\n }\n}\n\n// TODO: duplicated code to avoid extracting another sub-package -- how to avoid?\nfunction hasTokenLabel(\n obj: TokenType\n): obj is TokenType & Pick<Required<TokenType>, \"LABEL\"> {\n return isString(obj.LABEL) && obj.LABEL !== \"\"\n}\n\nexport abstract class AbstractProduction<T extends IProduction = IProduction>\n implements IProduction\n{\n public get definition(): T[] {\n return this._definition\n }\n public set definition(value: T[]) {\n this._definition = value\n }\n\n constructor(protected _definition: T[]) {}\n\n accept(visitor: IGASTVisitor): void {\n visitor.visit(this)\n forEach(this.definition, (prod) => {\n prod.accept(visitor)\n })\n }\n}\n\nexport class NonTerminal\n extends AbstractProduction\n implements IProductionWithOccurrence\n{\n public nonTerminalName!: string\n public label?: string\n public referencedRule!: Rule\n public idx: number = 1\n\n constructor(options: {\n nonTerminalName: string\n label?: string\n referencedRule?: Rule\n idx?: number\n }) {\n super([])\n assign(\n this,\n pickBy(options, (v) => v !== undefined)\n )\n }\n\n set definition(definition: IProduction[]) {\n // immutable\n }\n\n get definition(): IProduction[] {\n if (this.referencedRule !== undefined) {\n return this.referencedRule.definition\n }\n return []\n }\n\n accept(visitor: IGASTVisitor): void {\n visitor.visit(this)\n // don't visit children of a reference, we will get cyclic infinite loops if we do so\n }\n}\n\nexport class Rule extends AbstractProduction {\n public name!: string\n public orgText: string = \"\"\n\n constructor(options: {\n name: string\n definition: IProduction[]\n orgText?: string\n }) {\n super(options.definition)\n assign(\n this,\n pickBy(options, (v) => v !== undefined)\n )\n }\n}\n\nexport class Alternative extends AbstractProduction {\n public ignoreAmbiguities: boolean = false\n\n constructor(options: {\n definition: IProduction[]\n ignoreAmbiguities?: boolean\n }) {\n super(options.definition)\n assign(\n this,\n pickBy(options, (v) => v !== undefined)\n )\n }\n}\n\nexport class Option\n extends AbstractProduction\n implements IProductionWithOccurrence\n{\n public idx: number = 1\n public maxLookahead?: number\n\n constructor(options: {\n definition: IProduction[]\n idx?: number\n maxLookahead?: number\n }) {\n super(options.definition)\n assign(\n this,\n pickBy(options, (v) => v !== undefined)\n )\n }\n}\n\nexport class RepetitionMandatory\n extends AbstractProduction\n implements IProductionWithOccurrence\n{\n public idx: number = 1\n public maxLookahead?: number\n\n constructor(options: {\n definition: IProduction[]\n idx?: number\n maxLookahead?: number\n }) {\n super(options.definition)\n assign(\n this,\n pickBy(options, (v) => v !== undefined)\n )\n }\n}\n\nexport class RepetitionMandatoryWithSeparator\n extends AbstractProduction\n implements IProductionWithOccurrence\n{\n public separator!: TokenType\n public idx: number = 1\n public maxLookahead?: number\n\n constructor(options: {\n definition: IProduction[]\n separator: TokenType\n idx?: number\n }) {\n super(options.definition)\n assign(\n this,\n pickBy(options, (v) => v !== undefined)\n )\n }\n}\n\nexport class Repetition\n extends AbstractProduction\n implements IProductionWithOccurrence\n{\n public separator!: TokenType\n public idx: number = 1\n public maxLookahead?: number\n\n constructor(options: {\n definition: IProduction[]\n idx?: number\n maxLookahead?: number\n }) {\n super(options.definition)\n assign(\n this,\n pickBy(options, (v) => v !== undefined)\n )\n }\n}\n\nexport class RepetitionWithSeparator\n extends AbstractProduction\n implements IProductionWithOccurrence\n{\n public separator!: TokenType\n public idx: number = 1\n public maxLookahead?: number\n\n constructor(options: {\n definition: IProduction[]\n separator: TokenType\n idx?: number\n }) {\n super(options.definition)\n assign(\n this,\n pickBy(options, (v) => v !== undefined)\n )\n }\n}\n\nexport class Alternation\n extends AbstractProduction<Alternative>\n implements IProductionWithOccurrence\n{\n public idx: number = 1\n public ignoreAmbiguities: boolean = false\n public hasPredicates: boolean = false\n public maxLookahead?: number\n\n public get definition(): Alternative[] {\n return this._definition\n }\n public set definition(value: Alternative[]) {\n this._definition = value\n }\n\n constructor(options: {\n definition: Alternative[]\n idx?: number\n ignoreAmbiguities?: boolean\n hasPredicates?: boolean\n maxLookahead?: number\n }) {\n super(options.definition)\n assign(\n this,\n pickBy(options, (v) => v !== undefined)\n )\n }\n}\n\nexport class Terminal implements IProductionWithOccurrence {\n public terminalType!: TokenType\n public label?: string\n public idx: number = 1\n\n constructor(options: {\n terminalType: TokenType\n label?: string\n idx?: number\n }) {\n assign(\n this,\n pickBy(options, (v) => v !== undefined)\n )\n }\n\n accept(visitor: IGASTVisitor): void {\n visitor.visit(this)\n }\n}\n\nexport interface ISerializedBasic extends ISerializedGast {\n type:\n | \"Alternative\"\n | \"Option\"\n | \"RepetitionMandatory\"\n | \"Repetition\"\n | \"Alternation\"\n idx?: number\n}\n\nexport interface ISerializedGastRule extends ISerializedGast {\n type: \"Rule\"\n name: string\n orgText: string\n}\n\nexport interface ISerializedNonTerminal extends ISerializedGast {\n type: \"NonTerminal\"\n name: string\n label?: string\n idx: number\n}\n\nexport interface ISerializedTerminal extends ISerializedGast {\n type: \"Terminal\"\n name: string\n terminalLabel?: string\n label?: string\n pattern?: string\n idx: number\n}\n\nexport interface ISerializedTerminalWithSeparator extends ISerializedGast {\n type: \"RepetitionMandatoryWithSeparator\" | \"RepetitionWithSeparator\"\n idx: number\n separator: ISerializedTerminal\n}\n\nexport type ISerializedGastAny =\n | ISerializedBasic\n | ISerializedGastRule\n | ISerializedNonTerminal\n | ISerializedTerminal\n | ISerializedTerminalWithSeparator\n\nexport function serializeGrammar(topRules: Rule[]): ISerializedGast[] {\n return map(topRules, serializeProduction)\n}\n\nexport function serializeProduction(node: IProduction): ISerializedGast {\n function convertDefinition(definition: IProduction[]): ISerializedGast[] {\n return map(definition, serializeProduction)\n }\n /* istanbul ignore else */\n if (node instanceof NonTerminal) {\n const serializedNonTerminal: ISerializedNonTerminal = {\n type: \"NonTerminal\",\n name: node.nonTerminalName,\n idx: node.idx\n }\n\n if (isString(node.label)) {\n serializedNonTerminal.label = node.label\n }\n\n return serializedNonTerminal\n } else if (node instanceof Alternative) {\n return <ISerializedBasic>{\n type: \"Alternative\",\n definition: convertDefinition(node.definition)\n }\n } else if (node instanceof Option) {\n return <ISerializedBasic>{\n type: \"Option\",\n idx: node.idx,\n definition: convertDefinition(node.definition)\n }\n } else if (node instanceof RepetitionMandatory) {\n return <ISerializedBasic>{\n type: \"RepetitionMandatory\",\n idx: node.idx,\n definition: convertDefinition(node.definition)\n }\n } else if (node instanceof RepetitionMandatoryWithSeparator) {\n return <ISerializedTerminalWithSeparator>{\n type: \"RepetitionMandatoryWithSeparator\",\n idx: node.idx,\n separator: <ISerializedTerminal>(\n serializeProduction(new Terminal({ terminalType: node.separator }))\n ),\n definition: convertDefinition(node.definition)\n }\n } else if (node instanceof RepetitionWithSeparator) {\n return <ISerializedTerminalWithSeparator>{\n type: \"RepetitionWithSeparator\",\n idx: node.idx,\n separator: <ISerializedTerminal>(\n serializeProduction(new Terminal({ terminalType: node.separator }))\n ),\n definition: convertDefinition(node.definition)\n }\n } else if (node instanceof Repetition) {\n return <ISerializedBasic>{\n type: \"Repetition\",\n idx: node.idx,\n definition: convertDefinition(node.definition)\n }\n } else if (node instanceof Alternation) {\n return <ISerializedBasic>{\n type: \"Alternation\",\n idx: node.idx,\n definition: convertDefinition(node.definition)\n }\n } else if (node instanceof Terminal) {\n const serializedTerminal = <ISerializedTerminal>{\n type: \"Terminal\",\n name: node.terminalType.name,\n label: tokenLabel(node.terminalType),\n idx: node.idx\n }\n\n if (isString(node.label)) {\n serializedTerminal.terminalLabel = node.label\n }\n\n const pattern = node.terminalType.PATTERN\n if (node.terminalType.PATTERN) {\n serializedTerminal.pattern = isRegExp(pattern)\n ? (<any>pattern).source\n : pattern\n }\n\n return serializedTerminal\n } else if (node instanceof Rule) {\n return <ISerializedGastRule>{\n type: \"Rule\",\n name: node.name,\n orgText: node.orgText,\n definition: convertDefinition(node.definition)\n }\n } else {\n throw Error(\"non exhaustive match\")\n }\n}\n","import {\n Alternation,\n Alternative,\n NonTerminal,\n Option,\n Repetition,\n RepetitionMandatory,\n RepetitionMandatoryWithSeparator,\n RepetitionWithSeparator,\n Rule,\n Terminal\n} from \"./model\"\nimport { IProduction } from \"@chevrotain/types\"\n\nexport abstract class GAstVisitor {\n public visit(node: IProduction): any {\n const nodeAny: any = node\n switch (nodeAny.constructor) {\n case NonTerminal:\n return this.visitNonTerminal(nodeAny)\n case Alternative:\n return this.visitAlternative(nodeAny)\n case Option:\n return this.visitOption(nodeAny)\n case RepetitionMandatory:\n return this.visitRepetitionMandatory(nodeAny)\n case RepetitionMandatoryWithSeparator:\n return this.visitRepetitionMandatoryWithSeparator(nodeAny)\n case RepetitionWithSeparator:\n return this.visitRepetitionWithSeparator(nodeAny)\n case Repetition:\n return this.visitRepetition(nodeAny)\n case Alternation:\n return this.visitAlternation(nodeAny)\n case Terminal:\n return this.visitTerminal(nodeAny)\n case Rule:\n return this.visitRule(nodeAny)\n /* istanbul ignore next */\n default:\n throw Error(\"non exhaustive match\")\n }\n }\n\n /* istanbul ignore next - testing the fact a NOOP function exists is non-trivial */\n public visitNonTerminal(node: NonTerminal): any {}\n\n /* istanbul ignore next - testing the fact a NOOP function exists is non-trivial */\n public visitAlternative(node: Alternative): any {}\n\n /* istanbul ignore next - testing the fact a NOOP function exists is non-trivial */\n public visitOption(node: Option): any {}\n\n /* istanbul ignore next - testing the fact a NOOP function exists is non-trivial */\n public visitRepetition(node: Repetition): any {}\n\n /* istanbul ignore next - testing the fact a NOOP function exists is non-trivial */\n public visitRepetitionMandatory(node: RepetitionMandatory): any {}\n\n /* istanbul ignore next - testing the fact a NOOP function exists is non-trivial */\n public visitRepetitionMandatoryWithSeparator(\n node: RepetitionMandatoryWithSeparator\n ): any {}\n\n /* istanbul ignore next - testing the fact a NOOP function exists is non-trivial */\n public visitRepetitionWithSeparator(node: RepetitionWithSeparator): any {}\n\n /* istanbul ignore next - testing the fact a NOOP function exists is non-trivial */\n public visitAlternation(node: Alternation): any {}\n\n /* istanbul ignore next - testing the fact a NOOP function exists is non-trivial */\n public visitTerminal(node: Terminal): any {}\n\n /* istanbul ignore next - testing the fact a NOOP function exists is non-trivial */\n public visitRule(node: Rule): any {}\n}\n","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n}\n\nmodule.exports = baseSome;\n","var arraySome = require('./_arraySome'),\n baseIteratee = require('./_baseIteratee'),\n baseSome = require('./_baseSome'),\n isArray = require('./isArray'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\nfunction some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = some;\n","/**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\nfunction arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = arrayEvery;\n","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\nfunction baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n}\n\nmodule.exports = baseEvery;\n","var arrayEvery = require('./_arrayEvery'),\n baseEvery = require('./_baseEvery'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\nfunction every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = every;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n","var baseIndexOf = require('./_baseIndexOf'),\n isArrayLike = require('./isArrayLike'),\n isString = require('./isString'),\n toInteger = require('./toInteger'),\n values = require('./values');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\nfunction includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n}\n\nmodule.exports = includes;\n","import some from \"lodash/some\"\nimport every from \"lodash/every\"\nimport has from \"lodash/has\"\nimport includes from \"lodash/includes\"\nimport {\n AbstractProduction,\n Alternation,\n Alternative,\n NonTerminal,\n Option,\n Repetition,\n RepetitionMandatory,\n RepetitionMandatoryWithSeparator,\n RepetitionWithSeparator,\n Rule,\n Terminal\n} from \"./model\"\nimport { GAstVisitor } from \"./visitor\"\nimport { IProduction, IProductionWithOccurrence } from \"@chevrotain/types\"\n\nexport function isSequenceProd(\n prod: IProduction\n): prod is { definition: IProduction[] } & IProduction {\n return (\n prod instanceof Alternative ||\n prod instanceof Option ||\n prod instanceof Repetition ||\n prod instanceof RepetitionMandatory ||\n prod instanceof RepetitionMandatoryWithSeparator ||\n prod instanceof RepetitionWithSeparator ||\n prod instanceof Terminal ||\n prod instanceof Rule\n )\n}\n\nexport function isOptionalProd(\n prod: IProduction,\n alreadyVisited: NonTerminal[] = []\n): boolean {\n const isDirectlyOptional =\n prod instanceof Option ||\n prod instanceof Repetition ||\n prod instanceof RepetitionWithSeparator\n if (isDirectlyOptional) {\n return true\n }\n\n // note that this can cause infinite loop if one optional empty TOP production has a cyclic dependency with another\n // empty optional top rule\n // may be indirectly optional ((A?B?C?) | (D?E?F?))\n if (prod instanceof Alternation) {\n // for OR its enough for just one of the alternatives to be optional\n return some((<Alternation>prod).definition, (subProd: IProduction) => {\n return isOptionalProd(subProd, alreadyVisited)\n })\n } else if (prod instanceof NonTerminal && includes(alreadyVisited, prod)) {\n // avoiding stack overflow due to infinite recursion\n return false\n } else if (prod instanceof AbstractProduction) {\n if (prod instanceof NonTerminal) {\n alreadyVisited.push(prod)\n }\n return every(\n (<AbstractProduction>prod).definition,\n (subProd: IProduction) => {\n return isOptionalProd(subProd, alreadyVisited)\n }\n )\n } else {\n return false\n }\n}\n\nexport function isBranchingProd(\n prod: IProduction\n): prod is { definition: IProduction[] } & IProduction {\n return prod instanceof Alternation\n}\n\nexport function getProductionDslName(prod: IProductionWithOccurrence): string {\n /* istanbul ignore else */\n if (prod instanceof NonTerminal) {\n return \"SUBRULE\"\n } else if (prod instanceof Option) {\n return \"OPTION\"\n } else if (prod instanceof Alternation) {\n return \"OR\"\n } else if (prod instanceof RepetitionMandatory) {\n return \"AT_LEAST_ONE\"\n } else if (prod instanceof RepetitionMandatoryWithSeparator) {\n return \"AT_LEAST_ONE_SEP\"\n } else if (prod instanceof RepetitionWithSeparator) {\n return \"MANY_SEP\"\n } else if (prod instanceof Repetition) {\n return \"MANY\"\n } else if (prod instanceof Terminal) {\n return \"CONSUME\"\n } else {\n throw Error(\"non exhaustive match\")\n }\n}\n","export {\n Rule,\n Terminal,\n NonTerminal,\n Option,\n Repetition,\n RepetitionMandatory,\n RepetitionMandatoryWithSeparator,\n RepetitionWithSeparator,\n Alternation,\n Alternative,\n serializeGrammar,\n serializeProduction\n} from \"./model\"\n\nexport { GAstVisitor } from \"./visitor\"\n\nexport {\n getProductionDslName,\n isOptionalProd,\n isBranchingProd,\n isSequenceProd\n} from \"./helpers\"\n","import drop from \"lodash/drop\"\nimport forEach from \"lodash/forEach\"\nimport {\n Alternation,\n Alternative,\n NonTerminal,\n Option,\n Repetition,\n RepetitionMandatory,\n RepetitionMandatoryWithSeparator,\n RepetitionWithSeparator,\n Terminal\n} from \"@chevrotain/gast\"\nimport { IProduction } from \"@chevrotain/types\"\n\n/**\n * A Grammar Walker that computes the \"remaining\" grammar \"after\" a productions in the grammar.\n */\nexport abstract class RestWalker {\n walk(prod: { definition: IProduction[] }, prevRest: any[] = []): void {\n forEach(prod.definition, (subProd: IProduction, index) => {\n const currRest = drop(prod.definition, index + 1)\n /* istanbul ignore else */\n if (subProd instanceof NonTerminal) {\n this.walkProdRef(subProd, currRest, prevRest)\n } else if (subProd instanceof Terminal) {\n this.walkTerminal(subProd, currRest, prevRest)\n } else if (subProd instanceof Alternative) {\n this.walkFlat(subProd, currRest, prevRest)\n } else if (subProd instanceof Option) {\n this.walkOption(subProd, currRest, prevRest)\n } else if (subProd instanceof RepetitionMandatory) {\n this.walkAtLeastOne(subProd, currRest, prevRest)\n } else if (subProd instanceof RepetitionMandatoryWithSeparator) {\n this.walkAtLeastOneSep(subProd, currRest, prevRest)\n } else if (subProd instanceof RepetitionWithSeparator) {\n this.walkManySep(subProd, currRest, prevRest)\n } else if (subProd instanceof Repetition) {\n this.walkMany(subProd, currRest, prevRest)\n } else if (subProd instanceof Alternation) {\n this.walkOr(subProd, currRest, prevRest)\n } else {\n throw Error(\"non exhaustive match\")\n }\n })\n }\n\n walkTerminal(\n terminal: Terminal,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {}\n\n walkProdRef(\n refProd: NonTerminal,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {}\n\n walkFlat(\n flatProd: Alternative,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n // ABCDEF => after the D the rest is EF\n const fullOrRest = currRest.concat(prevRest)\n this.walk(flatProd, <any>fullOrRest)\n }\n\n walkOption(\n optionProd: Option,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n // ABC(DE)?F => after the (DE)? the rest is F\n const fullOrRest = currRest.concat(prevRest)\n this.walk(optionProd, <any>fullOrRest)\n }\n\n walkAtLeastOne(\n atLeastOneProd: RepetitionMandatory,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n // ABC(DE)+F => after the (DE)+ the rest is (DE)?F\n const fullAtLeastOneRest: IProduction[] = [\n new Option({ definition: atLeastOneProd.definition })\n ].concat(<any>currRest, <any>prevRest)\n this.walk(atLeastOneProd, fullAtLeastOneRest)\n }\n\n walkAtLeastOneSep(\n atLeastOneSepProd: RepetitionMandatoryWithSeparator,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n // ABC DE(,DE)* F => after the (,DE)+ the rest is (,DE)?F\n const fullAtLeastOneSepRest = restForRepetitionWithSeparator(\n atLeastOneSepProd,\n currRest,\n prevRest\n )\n this.walk(atLeastOneSepProd, fullAtLeastOneSepRest)\n }\n\n walkMany(\n manyProd: Repetition,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n // ABC(DE)*F => after the (DE)* the rest is (DE)?F\n const fullManyRest: IProduction[] = [\n new Option({ definition: manyProd.definition })\n ].concat(<any>currRest, <any>prevRest)\n this.walk(manyProd, fullManyRest)\n }\n\n walkManySep(\n manySepProd: RepetitionWithSeparator,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n // ABC (DE(,DE)*)? F => after the (,DE)* the rest is (,DE)?F\n const fullManySepRest = restForRepetitionWithSeparator(\n manySepProd,\n currRest,\n prevRest\n )\n this.walk(manySepProd, fullManySepRest)\n }\n\n walkOr(\n orProd: Alternation,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n // ABC(D|E|F)G => when finding the (D|E|F) the rest is G\n const fullOrRest = currRest.concat(prevRest)\n // walk all different alternatives\n forEach(orProd.definition, (alt) => {\n // wrapping each alternative in a single definition wrapper\n // to avoid errors in computing the rest of that alternative in the invocation to computeInProdFollows\n // (otherwise for OR([alt1,alt2]) alt2 will be considered in 'rest' of alt1\n const prodWrapper = new Alternative({ definition: [alt] })\n this.walk(prodWrapper, <any>fullOrRest)\n })\n }\n}\n\nfunction restForRepetitionWithSeparator(\n repSepProd: RepetitionWithSeparator,\n currRest: IProduction[],\n prevRest: IProduction[]\n) {\n const repSepRest = [\n new Option({\n definition: [\n new Terminal({ terminalType: repSepProd.separator }) as IProduction\n ].concat(repSepProd.definition)\n }) as IProduction\n ]\n const fullRepSepRest: IProduction[] = repSepRest.concat(currRest, prevRest)\n return fullRepSepRest\n}\n","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","var baseFlatten = require('./_baseFlatten');\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n","var baseUniq = require('./_baseUniq');\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\nfunction uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n}\n\nmodule.exports = uniq;\n","import flatten from \"lodash/flatten\"\nimport uniq from \"lodash/uniq\"\nimport map from \"lodash/map\"\nimport { NonTerminal, Terminal } from \"@chevrotain/gast\"\nimport {\n isBranchingProd,\n isOptionalProd,\n isSequenceProd\n} from \"@chevrotain/gast\"\nimport { IProduction, TokenType } from \"@chevrotain/types\"\n\nexport function first(prod: IProduction): TokenType[] {\n /* istanbul ignore else */\n if (prod instanceof NonTerminal) {\n // this could in theory cause infinite loops if\n // (1) prod A refs prod B.\n // (2) prod B refs prod A\n // (3) AB can match the empty set\n // in other words a cycle where everything is optional so the first will keep\n // looking ahead for the next optional part and will never exit\n // currently there is no safeguard for this unique edge case because\n // (1) not sure a grammar in which this can happen is useful for anything (productive)\n return first((<NonTerminal>prod).referencedRule)\n } else if (prod instanceof Terminal) {\n return firstForTerminal(<Terminal>prod)\n } else if (isSequenceProd(prod)) {\n return firstForSequence(prod)\n } else if (isBranchingProd(prod)) {\n return firstForBranching(prod)\n } else {\n throw Error(\"non exhaustive match\")\n }\n}\n\nexport function firstForSequence(prod: {\n definition: IProduction[]\n}): TokenType[] {\n let firstSet: TokenType[] = []\n const seq = prod.definition\n let nextSubProdIdx = 0\n let hasInnerProdsRemaining = seq.length > nextSubProdIdx\n let currSubProd\n // so we enter the loop at least once (if the definition is not empty\n let isLastInnerProdOptional = true\n // scan a sequence until it's end or until we have found a NONE optional production in it\n while (hasInnerProdsRemaining && isLastInnerProdOptional) {\n currSubProd = seq[nextSubProdIdx]\n isLastInnerProdOptional = isOptionalProd(currSubProd)\n firstSet = firstSet.concat(first(currSubProd))\n nextSubProdIdx = nextSubProdIdx + 1\n hasInnerProdsRemaining = seq.length > nextSubProdIdx\n }\n\n return uniq(firstSet)\n}\n\nexport function firstForBranching(prod: {\n definition: IProduction[]\n}): TokenType[] {\n const allAlternativesFirsts: TokenType[][] = map(\n prod.definition,\n (innerProd) => {\n return first(innerProd)\n }\n )\n return uniq(flatten<TokenType>(allAlternativesFirsts))\n}\n\nexport function firstForTerminal(terminal: Terminal): TokenType[] {\n return [terminal.terminalType]\n}\n","// TODO: can this be removed? where is it used?\nexport const IN = \"_~IN~_\"\n","import { RestWalker } from \"./rest\"\nimport { first } from \"./first\"\nimport forEach from \"lodash/forEach\"\nimport assign from \"lodash/assign\"\nimport { IN } from \"../constants\"\nimport { Alternative, NonTerminal, Rule, Terminal } from \"@chevrotain/gast\"\nimport { IProduction, TokenType } from \"@chevrotain/types\"\n\n// This ResyncFollowsWalker computes all of the follows required for RESYNC\n// (skipping reference production).\nexport class ResyncFollowsWalker extends RestWalker {\n public follows: Record<string, TokenType[]> = {}\n\n constructor(private topProd: Rule) {\n super()\n }\n\n startWalking(): Record<string, TokenType[]> {\n this.walk(this.topProd)\n return this.follows\n }\n\n walkTerminal(\n terminal: Terminal,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n // do nothing! just like in the public sector after 13:00\n }\n\n walkProdRef(\n refProd: NonTerminal,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n const followName =\n buildBetweenProdsFollowPrefix(refProd.referencedRule, refProd.idx) +\n this.topProd.name\n const fullRest: IProduction[] = currRest.concat(prevRest)\n const restProd = new Alternative({ definition: fullRest })\n const t_in_topProd_follows = first(restProd)\n this.follows[followName] = t_in_topProd_follows\n }\n}\n\nexport function computeAllProdsFollows(\n topProductions: Rule[]\n): Record<string, TokenType[]> {\n const reSyncFollows = {}\n\n forEach(topProductions, (topProd) => {\n const currRefsFollow = new ResyncFollowsWalker(topProd).startWalking()\n assign(reSyncFollows, currRefsFollow)\n })\n return reSyncFollows\n}\n\nexport function buildBetweenProdsFollowPrefix(\n inner: Rule,\n occurenceInParent: number\n): string {\n return inner.name + occurenceInParent + IN\n}\n\nexport function buildInProdFollowPrefix(terminal: Terminal): string {\n const terminalName = terminal.terminalType.name\n return terminalName + terminal.idx + IN\n}\n","/**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\nfunction isUndefined(value) {\n return value === undefined;\n}\n\nmodule.exports = isUndefined;\n",";(function(root, factory) {\n // istanbul ignore next\n if (typeof define === \"function\" && define.amd) {\n // istanbul ignore next\n define([], factory)\n } else if (typeof module === \"object\" && module.exports) {\n module.exports = factory()\n } else {\n // istanbul ignore next\n root.regexpToAst = factory()\n }\n})(\n typeof self !== \"undefined\"\n ? // istanbul ignore next\n self\n : this,\n function() {\n // references\n // https://hackernoon.com/the-madness-of-parsing-real-world-javascript-regexps-d9ee336df983\n // https://www.ecma-international.org/ecma-262/8.0/index.html#prod-Pattern\n function RegExpParser() {}\n\n RegExpParser.prototype.saveState = function() {\n return {\n idx: this.idx,\n input: this.input,\n groupIdx: this.groupIdx\n }\n }\n\n RegExpParser.prototype.restoreState = function(newState) {\n this.idx = newState.idx\n this.input = newState.input\n this.groupIdx = newState.groupIdx\n }\n\n RegExpParser.prototype.pattern = function(input) {\n // parser state\n this.idx = 0\n this.input = input\n this.groupIdx = 0\n\n this.consumeChar(\"/\")\n var value = this.disjunction()\n this.consumeChar(\"/\")\n\n var flags = {\n type: \"Flags\",\n loc: { begin: this.idx, end: input.length },\n global: false,\n ignoreCase: false,\n multiLine: false,\n unicode: false,\n sticky: false\n }\n\n while (this.isRegExpFlag()) {\n switch (this.popChar()) {\n case \"g\":\n addFlag(flags, \"global\")\n break\n case \"i\":\n addFlag(flags, \"ignoreCase\")\n break\n case \"m\":\n addFlag(flags, \"multiLine\")\n break\n case \"u\":\n addFlag(flags, \"unicode\")\n break\n case \"y\":\n addFlag(flags, \"sticky\")\n break\n }\n }\n\n if (this.idx !== this.input.length) {\n throw Error(\n \"Redundant input: \" + this.input.substring(this.idx)\n )\n }\n return {\n type: \"Pattern\",\n flags: flags,\n value: value,\n loc: this.loc(0)\n }\n }\n\n RegExpParser.prototype.disjunction = function() {\n var alts = []\n var begin = this.idx\n\n alts.push(this.alternative())\n\n while (this.peekChar() === \"|\") {\n this.consumeChar(\"|\")\n alts.push(this.alternative())\n }\n\n return { type: \"Disjunction\", value: alts, loc: this.loc(begin) }\n }\n\n RegExpParser.prototype.alternative = function() {\n var terms = []\n var begin = this.idx\n\n while (this.isTerm()) {\n terms.push(this.term())\n }\n\n return { type: \"Alternative\", value: terms, loc: this.loc(begin) }\n }\n\n RegExpParser.prototype.term = function() {\n if (this.isAssertion()) {\n return this.assertion()\n } else {\n return this.atom()\n }\n }\n\n RegExpParser.prototype.assertion = function() {\n var begin = this.idx\n switch (this.popChar()) {\n case \"^\":\n return {\n type: \"StartAnchor\",\n loc: this.loc(begin)\n }\n case \"$\":\n return { type: \"EndAnchor\", loc: this.loc(begin) }\n // '\\b' or '\\B'\n case \"\\\\\":\n switch (this.popChar()) {\n case \"b\":\n return {\n type: \"WordBoundary\",\n loc: this.loc(begin)\n }\n case \"B\":\n return {\n type: \"NonWordBoundary\",\n loc: this.loc(begin)\n }\n }\n // istanbul ignore next\n throw Error(\"Invalid Assertion Escape\")\n // '(?=' or '(?!'\n case \"(\":\n this.consumeChar(\"?\")\n\n var type\n switch (this.popChar()) {\n case \"=\":\n type = \"Lookahead\"\n break\n case \"!\":\n type = \"NegativeLookahead\"\n break\n }\n ASSERT_EXISTS(type)\n\n var disjunction = this.disjunction()\n\n this.consumeChar(\")\")\n\n return {\n type: type,\n value: disjunction,\n loc: this.loc(begin)\n }\n }\n // istanbul ignore next\n ASSERT_NEVER_REACH_HERE()\n }\n\n RegExpParser.prototype.quantifier = function(isBacktracking) {\n var range\n var begin = this.idx\n switch (this.popChar()) {\n case \"*\":\n range = {\n atLeast: 0,\n atMost: Infinity\n }\n break\n case \"+\":\n range = {\n atLeast: 1,\n atMost: Infinity\n }\n break\n case \"?\":\n range = {\n atLeast: 0,\n atMost: 1\n }\n break\n case \"{\":\n var atLeast = this.integerIncludingZero()\n switch (this.popChar()) {\n case \"}\":\n range = {\n atLeast: atLeast,\n atMost: atLeast\n }\n break\n case \",\":\n var atMost\n if (this.isDigit()) {\n atMost = this.integerIncludingZero()\n range = {\n atLeast: atLeast,\n atMost: atMost\n }\n } else {\n range = {\n atLeast: atLeast,\n atMost: Infinity\n }\n }\n this.consumeChar(\"}\")\n break\n }\n // throwing exceptions from \"ASSERT_EXISTS\" during backtracking\n // causes severe performance degradations\n if (isBacktracking === true && range === undefined) {\n return undefined\n }\n ASSERT_EXISTS(range)\n break\n }\n\n // throwing exceptions from \"ASSERT_EXISTS\" during backtracking\n // causes severe performance degradations\n if (isBacktracking === true && range === undefined) {\n return undefined\n }\n\n ASSERT_EXISTS(range)\n\n if (this.peekChar(0) === \"?\") {\n this.consumeChar(\"?\")\n range.greedy = false\n } else {\n range.greedy = true\n }\n\n range.type = \"Quantifier\"\n range.loc = this.loc(begin)\n return range\n }\n\n RegExpParser.prototype.atom = function() {\n var atom\n var begin = this.idx\n switch (this.peekChar()) {\n case \".\":\n atom = this.dotAll()\n break\n case \"\\\\\":\n atom = this.atomEscape()\n break\n case \"[\":\n atom = this.characterClass()\n break\n case \"(\":\n atom = this.group()\n break\n }\n\n if (atom === undefined && this.isPatternCharacter()) {\n atom = this.patternCharacter()\n }\n\n ASSERT_EXISTS(atom)\n\n atom.loc = this.loc(begin)\n\n if (this.isQuantifier()) {\n atom.quantifier = this.quantifier()\n }\n\n return atom\n }\n\n RegExpParser.prototype.dotAll = function() {\n this.consumeChar(\".\")\n return {\n type: \"Set\",\n complement: true,\n value: [cc(\"\\n\"), cc(\"\\r\"), cc(\"\\u2028\"), cc(\"\\u2029\")]\n }\n }\n\n RegExpParser.prototype.atomEscape = function() {\n this.consumeChar(\"\\\\\")\n\n switch (this.peekChar()) {\n case \"1\":\n case \"2\":\n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\":\n return this.decimalEscapeAtom()\n case \"d\":\n case \"D\":\n case \"s\":\n case \"S\":\n case \"w\":\n case \"W\":\n return this.characterClassEscape()\n case \"f\":\n case \"n\":\n case \"r\":\n case \"t\":\n case \"v\":\n return this.controlEscapeAtom()\n case \"c\":\n return this.controlLetterEscapeAtom()\n case \"0\":\n return this.nulCharacterAtom()\n case \"x\":\n return this.hexEscapeSequenceAtom()\n case \"u\":\n return this.regExpUnicodeEscapeSequenceAtom()\n default:\n return this.identityEscapeAtom()\n }\n }\n\n RegExpParser.prototype.decimalEscapeAtom = function() {\n var value = this.positiveInteger()\n\n return { type: \"GroupBackReference\", value: value }\n }\n\n RegExpParser.prototype.characterClassEscape = function() {\n var set\n var complement = false\n switch (this.popChar()) {\n case \"d\":\n set = digitsCharCodes\n break\n case \"D\":\n set = digitsCharCodes\n complement = true\n break\n case \"s\":\n set = whitespaceCodes\n break\n case \"S\":\n set = whitespaceCodes\n complement = true\n break\n case \"w\":\n set = wordCharCodes\n break\n case \"W\":\n set = wordCharCodes\n complement = true\n break\n }\n\n ASSERT_EXISTS(set)\n\n return { type: \"Set\", value: set, complement: complement }\n }\n\n RegExpParser.prototype.controlEscapeAtom = function() {\n var escapeCode\n switch (this.popChar()) {\n case \"f\":\n escapeCode = cc(\"\\f\")\n break\n case \"n\":\n escapeCode = cc(\"\\n\")\n break\n case \"r\":\n escapeCode = cc(\"\\r\")\n break\n case \"t\":\n escapeCode = cc(\"\\t\")\n break\n case \"v\":\n escapeCode = cc(\"\\v\")\n break\n }\n ASSERT_EXISTS(escapeCode)\n\n return { type: \"Character\", value: escapeCode }\n }\n\n RegExpParser.prototype.controlLetterEscapeAtom = function() {\n this.consumeChar(\"c\")\n var letter = this.popChar()\n if (/[a-zA-Z]/.test(letter) === false) {\n throw Error(\"Invalid \")\n }\n\n var letterCode = letter.toUpperCase().charCodeAt(0) - 64\n return { type: \"Character\", value: letterCode }\n }\n\n RegExpParser.prototype.nulCharacterAtom = function() {\n // TODO implement '[lookahead ∉ DecimalDigit]'\n // TODO: for the deprecated octal escape sequence\n this.consumeChar(\"0\")\n return { type: \"Character\", value: cc(\"\\0\") }\n }\n\n RegExpParser.prototype.hexEscapeSequenceAtom = function() {\n this.consumeChar(\"x\")\n return this.parseHexDigits(2)\n }\n\n RegExpParser.prototype.regExpUnicodeEscapeSequenceAtom = function() {\n this.consumeChar(\"u\")\n return this.parseHexDigits(4)\n }\n\n RegExpParser.prototype.identityEscapeAtom = function() {\n // TODO: implement \"SourceCharacter but not UnicodeIDContinue\"\n // // http://unicode.org/reports/tr31/#Specific_Character_Adjustments\n var escapedChar = this.popChar()\n return { type: \"Character\", value: cc(escapedChar) }\n }\n\n RegExpParser.prototype.classPatternCharacterAtom = function() {\n switch (this.peekChar()) {\n // istanbul ignore next\n case \"\\n\":\n // istanbul ignore next\n case \"\\r\":\n // istanbul ignore next\n case \"\\u2028\":\n // istanbul ignore next\n case \"\\u2029\":\n // istanbul ignore next\n case \"\\\\\":\n // istanbul ignore next\n case \"]\":\n throw Error(\"TBD\")\n default:\n var nextChar = this.popChar()\n return { type: \"Character\", value: cc(nextChar) }\n }\n }\n\n RegExpParser.prototype.characterClass = function() {\n var set = []\n var complement = false\n this.consumeChar(\"[\")\n if (this.peekChar(0) === \"^\") {\n this.consumeChar(\"^\")\n complement = true\n }\n\n while (this.isClassAtom()) {\n var from = this.classAtom()\n var isFromSingleChar = from.type === \"Character\"\n if (isFromSingleChar && this.isRangeDash()) {\n this.consumeChar(\"-\")\n var to = this.classAtom()\n var isToSingleChar = to.type === \"Character\"\n\n // a range can only be used when both sides are single characters\n if (isToSingleChar) {\n if (to.value < from.value) {\n throw Error(\"Range out of order in character class\")\n }\n set.push({ from: from.value, to: to.value })\n } else {\n // literal dash\n insertToSet(from.value, set)\n set.push(cc(\"-\"))\n insertToSet(to.value, set)\n }\n } else {\n insertToSet(from.value, set)\n }\n }\n\n this.consumeChar(\"]\")\n\n return { type: \"Set\", complement: complement, value: set }\n }\n\n RegExpParser.prototype.classAtom = function() {\n switch (this.peekChar()) {\n // istanbul ignore next\n case \"]\":\n // istanbul ignore next\n case \"\\n\":\n // istanbul ignore next\n case \"\\r\":\n // istanbul ignore next\n case \"\\u2028\":\n // istanbul ignore next\n case \"\\u2029\":\n throw Error(\"TBD\")\n case \"\\\\\":\n return this.classEscape()\n default:\n return this.classPatternCharacterAtom()\n }\n }\n\n RegExpParser.prototype.classEscape = function() {\n this.consumeChar(\"\\\\\")\n switch (this.peekChar()) {\n // Matches a backspace.\n // (Not to be confused with \\b word boundary outside characterClass)\n case \"b\":\n this.consumeChar(\"b\")\n return { type: \"Character\", value: cc(\"\\u0008\") }\n case \"d\":\n case \"D\":\n case \"s\":\n case \"S\":\n case \"w\":\n case \"W\":\n return this.characterClassEscape()\n case \"f\":\n case \"n\":\n case \"r\":\n case \"t\":\n case \"v\":\n return this.controlEscapeAtom()\n case \"c\":\n return this.controlLetterEscapeAtom()\n case \"0\":\n return this.nulCharacterAtom()\n case \"x\":\n return this.hexEscapeSequenceAtom()\n case \"u\":\n return this.regExpUnicodeEscapeSequenceAtom()\n default:\n return this.identityEscapeAtom()\n }\n }\n\n RegExpParser.prototype.group = function() {\n var capturing = true\n this.consumeChar(\"(\")\n switch (this.peekChar(0)) {\n case \"?\":\n this.consumeChar(\"?\")\n this.consumeChar(\":\")\n capturing = false\n break\n default:\n this.groupIdx++\n break\n }\n var value = this.disjunction()\n this.consumeChar(\")\")\n\n var groupAst = {\n type: \"Group\",\n capturing: capturing,\n value: value\n }\n\n if (capturing) {\n groupAst.idx = this.groupIdx\n }\n\n return groupAst\n }\n\n RegExpParser.prototype.positiveInteger = function() {\n var number = this.popChar()\n\n // istanbul ignore next - can't ever get here due to previous lookahead checks\n // still implementing this error checking in case this ever changes.\n if (decimalPatternNoZero.test(number) === false) {\n throw Error(\"Expecting a positive integer\")\n }\n\n while (decimalPattern.test(this.peekChar(0))) {\n number += this.popChar()\n }\n\n return parseInt(number, 10)\n }\n\n RegExpParser.prototype.integerIncludingZero = function() {\n var number = this.popChar()\n if (decimalPattern.test(number) === false) {\n throw Error(\"Expecting an integer\")\n }\n\n while (decimalPattern.test(this.peekChar(0))) {\n number += this.popChar()\n }\n\n return parseInt(number, 10)\n }\n\n RegExpParser.prototype.patternCharacter = function() {\n var nextChar = this.popChar()\n switch (nextChar) {\n // istanbul ignore next\n case \"\\n\":\n // istanbul ignore next\n case \"\\r\":\n // istanbul ignore next\n case \"\\u2028\":\n // istanbul ignore next\n case \"\\u2029\":\n // istanbul ignore next\n case \"^\":\n // istanbul ignore next\n case \"$\":\n // istanbul ignore next\n case \"\\\\\":\n // istanbul ignore next\n case \".\":\n // istanbul ignore next\n case \"*\":\n // istanbul ignore next\n case \"+\":\n // istanbul ignore next\n case \"?\":\n // istanbul ignore next\n case \"(\":\n // istanbul ignore next\n case \")\":\n // istanbul ignore next\n case \"[\":\n // istanbul ignore next\n case \"|\":\n // istanbul ignore next\n throw Error(\"TBD\")\n default:\n return { type: \"Character\", value: cc(nextChar) }\n }\n }\n RegExpParser.prototype.isRegExpFlag = function() {\n switch (this.peekChar(0)) {\n case \"g\":\n case \"i\":\n case \"m\":\n case \"u\":\n case \"y\":\n return true\n default:\n return false\n }\n }\n\n RegExpParser.prototype.isRangeDash = function() {\n return this.peekChar() === \"-\" && this.isClassAtom(1)\n }\n\n RegExpParser.prototype.isDigit = function() {\n return decimalPattern.test(this.peekChar(0))\n }\n\n RegExpParser.prototype.isClassAtom = function(howMuch) {\n if (howMuch === undefined) {\n howMuch = 0\n }\n\n switch (this.peekChar(howMuch)) {\n case \"]\":\n case \"\\n\":\n case \"\\r\":\n case \"\\u2028\":\n case \"\\u2029\":\n return false\n default:\n return true\n }\n }\n\n RegExpParser.prototype.isTerm = function() {\n return this.isAtom() || this.isAssertion()\n }\n\n RegExpParser.prototype.isAtom = function() {\n if (this.isPatternCharacter()) {\n return true\n }\n\n switch (this.peekChar(0)) {\n case \".\":\n case \"\\\\\": // atomEscape\n case \"[\": // characterClass\n // TODO: isAtom must be called before isAssertion - disambiguate\n case \"(\": // group\n return true\n default:\n return false\n }\n }\n\n RegExpParser.prototype.isAssertion = function() {\n switch (this.peekChar(0)) {\n case \"^\":\n case \"$\":\n return true\n // '\\b' or '\\B'\n case \"\\\\\":\n switch (this.peekChar(1)) {\n case \"b\":\n case \"B\":\n return true\n default:\n return false\n }\n // '(?=' or '(?!'\n case \"(\":\n return (\n this.peekChar(1) === \"?\" &&\n (this.peekChar(2) === \"=\" || this.peekChar(2) === \"!\")\n )\n default:\n return false\n }\n }\n\n RegExpParser.prototype.isQuantifier = function() {\n var prevState = this.saveState()\n try {\n return this.quantifier(true) !== undefined\n } catch (e) {\n return false\n } finally {\n this.restoreState(prevState)\n }\n }\n\n RegExpParser.prototype.isPatternCharacter = function() {\n switch (this.peekChar()) {\n case \"^\":\n case \"$\":\n case \"\\\\\":\n case \".\":\n case \"*\":\n case \"+\":\n case \"?\":\n case \"(\":\n case \")\":\n case \"[\":\n case \"|\":\n case \"/\":\n case \"\\n\":\n case \"\\r\":\n case \"\\u2028\":\n case \"\\u2029\":\n return false\n default:\n return true\n }\n }\n\n RegExpParser.prototype.parseHexDigits = function(howMany) {\n var hexString = \"\"\n for (var i = 0; i < howMany; i++) {\n var hexChar = this.popChar()\n if (hexDigitPattern.test(hexChar) === false) {\n throw Error(\"Expecting a HexDecimal digits\")\n }\n hexString += hexChar\n }\n var charCode = parseInt(hexString, 16)\n return { type: \"Character\", value: charCode }\n }\n\n RegExpParser.prototype.peekChar = function(howMuch) {\n if (howMuch === undefined) {\n howMuch = 0\n }\n return this.input[this.idx + howMuch]\n }\n\n RegExpParser.prototype.popChar = function() {\n var nextChar = this.peekChar(0)\n this.consumeChar()\n return nextChar\n }\n\n RegExpParser.prototype.consumeChar = function(char) {\n if (char !== undefined && this.input[this.idx] !== char) {\n throw Error(\n \"Expected: '\" +\n char +\n \"' but found: '\" +\n this.input[this.idx] +\n \"' at offset: \" +\n this.idx\n )\n }\n\n if (this.idx >= this.input.length) {\n throw Error(\"Unexpected end of input\")\n }\n this.idx++\n }\n\n RegExpParser.prototype.loc = function(begin) {\n return { begin: begin, end: this.idx }\n }\n\n // consts and utilities\n var hexDigitPattern = /[0-9a-fA-F]/\n var decimalPattern = /[0-9]/\n var decimalPatternNoZero = /[1-9]/\n\n function cc(char) {\n return char.charCodeAt(0)\n }\n\n function insertToSet(item, set) {\n if (item.length !== undefined) {\n item.forEach(function(subItem) {\n set.push(subItem)\n })\n } else {\n set.push(item)\n }\n }\n\n function addFlag(flagObj, flagKey) {\n if (flagObj[flagKey] === true) {\n throw \"duplicate flag \" + flagKey\n }\n\n flagObj[flagKey] = true\n }\n\n function ASSERT_EXISTS(obj) {\n // istanbul ignore next\n if (obj === undefined) {\n throw Error(\"Internal Error - Should never get here!\")\n }\n }\n\n // istanbul ignore next\n function ASSERT_NEVER_REACH_HERE() {\n throw Error(\"Internal Error - Should never get here!\")\n }\n\n var i\n var digitsCharCodes = []\n for (i = cc(\"0\"); i <= cc(\"9\"); i++) {\n digitsCharCodes.push(i)\n }\n\n var wordCharCodes = [cc(\"_\")].concat(digitsCharCodes)\n for (i = cc(\"a\"); i <= cc(\"z\"); i++) {\n wordCharCodes.push(i)\n }\n\n for (i = cc(\"A\"); i <= cc(\"Z\"); i++) {\n wordCharCodes.push(i)\n }\n\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#character-classes\n var whitespaceCodes = [\n cc(\" \"),\n cc(\"\\f\"),\n cc(\"\\n\"),\n cc(\"\\r\"),\n cc(\"\\t\"),\n cc(\"\\v\"),\n cc(\"\\t\"),\n cc(\"\\u00a0\"),\n cc(\"\\u1680\"),\n cc(\"\\u2000\"),\n cc(\"\\u2001\"),\n cc(\"\\u2002\"),\n cc(\"\\u2003\"),\n cc(\"\\u2004\"),\n cc(\"\\u2005\"),\n cc(\"\\u2006\"),\n cc(\"\\u2007\"),\n cc(\"\\u2008\"),\n cc(\"\\u2009\"),\n cc(\"\\u200a\"),\n cc(\"\\u2028\"),\n cc(\"\\u2029\"),\n cc(\"\\u202f\"),\n cc(\"\\u205f\"),\n cc(\"\\u3000\"),\n cc(\"\\ufeff\")\n ]\n\n function BaseRegExpVisitor() {}\n\n BaseRegExpVisitor.prototype.visitChildren = function(node) {\n for (var key in node) {\n var child = node[key]\n /* istanbul ignore else */\n if (node.hasOwnProperty(key)) {\n if (child.type !== undefined) {\n this.visit(child)\n } else if (Array.isArray(child)) {\n child.forEach(function(subChild) {\n this.visit(subChild)\n }, this)\n }\n }\n }\n }\n\n BaseRegExpVisitor.prototype.visit = function(node) {\n switch (node.type) {\n case \"Pattern\":\n this.visitPattern(node)\n break\n case \"Flags\":\n this.visitFlags(node)\n break\n case \"Disjunction\":\n this.visitDisjunction(node)\n break\n case \"Alternative\":\n this.visitAlternative(node)\n break\n case \"StartAnchor\":\n this.visitStartAnchor(node)\n break\n case \"EndAnchor\":\n this.visitEndAnchor(node)\n break\n case \"WordBoundary\":\n this.visitWordBoundary(node)\n break\n case \"NonWordBoundary\":\n this.visitNonWordBoundary(node)\n break\n case \"Lookahead\":\n this.visitLookahead(node)\n break\n case \"NegativeLookahead\":\n this.visitNegativeLookahead(node)\n break\n case \"Character\":\n this.visitCharacter(node)\n break\n case \"Set\":\n this.visitSet(node)\n break\n case \"Group\":\n this.visitGroup(node)\n break\n case \"GroupBackReference\":\n this.visitGroupBackReference(node)\n break\n case \"Quantifier\":\n this.visitQuantifier(node)\n break\n }\n\n this.visitChildren(node)\n }\n\n BaseRegExpVisitor.prototype.visitPattern = function(node) {}\n\n BaseRegExpVisitor.prototype.visitFlags = function(node) {}\n\n BaseRegExpVisitor.prototype.visitDisjunction = function(node) {}\n\n BaseRegExpVisitor.prototype.visitAlternative = function(node) {}\n\n // Assertion\n BaseRegExpVisitor.prototype.visitStartAnchor = function(node) {}\n\n BaseRegExpVisitor.prototype.visitEndAnchor = function(node) {}\n\n BaseRegExpVisitor.prototype.visitWordBoundary = function(node) {}\n\n BaseRegExpVisitor.prototype.visitNonWordBoundary = function(node) {}\n\n BaseRegExpVisitor.prototype.visitLookahead = function(node) {}\n\n BaseRegExpVisitor.prototype.visitNegativeLookahead = function(node) {}\n\n // atoms\n BaseRegExpVisitor.prototype.visitCharacter = function(node) {}\n\n BaseRegExpVisitor.prototype.visitSet = function(node) {}\n\n BaseRegExpVisitor.prototype.visitGroup = function(node) {}\n\n BaseRegExpVisitor.prototype.visitGroupBackReference = function(node) {}\n\n BaseRegExpVisitor.prototype.visitQuantifier = function(node) {}\n\n return {\n RegExpParser: RegExpParser,\n BaseRegExpVisitor: BaseRegExpVisitor,\n VERSION: \"0.5.0\"\n }\n }\n)\n","/**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\nfunction head(array) {\n return (array && array.length) ? array[0] : undefined;\n}\n\nmodule.exports = head;\n","module.exports = require('./head');\n","/**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\nfunction compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = compact;\n","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nmodule.exports = baseFilter;\n","/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\nfunction negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n}\n\nmodule.exports = negate;\n","var arrayFilter = require('./_arrayFilter'),\n baseFilter = require('./_baseFilter'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray'),\n negate = require('./negate');\n\n/**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\nfunction reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(baseIteratee(predicate, 3)));\n}\n\nmodule.exports = reject;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseDifference;\n","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n","var baseDifference = require('./_baseDifference'),\n baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\nvar difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n});\n\nmodule.exports = difference;\n","var baseIndexOf = require('./_baseIndexOf'),\n toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\nfunction indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n}\n\nmodule.exports = indexOf;\n","var baseIteratee = require('./_baseIteratee'),\n isArrayLike = require('./isArrayLike'),\n keys = require('./keys');\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = baseIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n}\n\nmodule.exports = createFind;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIteratee = require('./_baseIteratee'),\n toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\nfunction findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\nmodule.exports = findIndex;\n","var createFind = require('./_createFind'),\n findIndex = require('./findIndex');\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\nvar find = createFind(findIndex);\n\nmodule.exports = find;\n","var arrayFilter = require('./_arrayFilter'),\n baseFilter = require('./_baseFilter'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\nfunction filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = filter;\n","var baseRest = require('./_baseRest'),\n eq = require('./eq'),\n isIterateeCall = require('./_isIterateeCall'),\n keysIn = require('./keysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n});\n\nmodule.exports = defaults;\n","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseReduce;\n","var arrayReduce = require('./_arrayReduce'),\n baseEach = require('./_baseEach'),\n baseIteratee = require('./_baseIteratee'),\n baseReduce = require('./_baseReduce'),\n isArray = require('./isArray');\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\nfunction reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n}\n\nmodule.exports = reduce;\n","import {\n Alternative,\n Assertion,\n Atom,\n Disjunction,\n RegExpParser,\n RegExpPattern\n} from \"regexp-to-ast\"\n\nlet regExpAstCache: { [regex: string]: RegExpPattern } = {}\nconst regExpParser = new RegExpParser()\n\n// this should be moved to regexp-to-ast\nexport type ASTNode =\n | RegExpPattern\n | Disjunction\n | Alternative\n | Assertion\n | Atom\n\nexport function getRegExpAst(regExp: RegExp): RegExpPattern {\n const regExpStr = regExp.toString()\n if (regExpAstCache.hasOwnProperty(regExpStr)) {\n return regExpAstCache[regExpStr]\n } else {\n const regExpAst = regExpParser.pattern(regExpStr)\n regExpAstCache[regExpStr] = regExpAst\n return regExpAst\n }\n}\n\nexport function clearRegExpParserCache() {\n regExpAstCache = {}\n}\n","import {\n Alternative,\n Atom,\n BaseRegExpVisitor,\n Character,\n Disjunction,\n Group,\n Set,\n Term,\n VERSION\n} from \"regexp-to-ast\"\nimport isArray from \"lodash/isArray\"\nimport every from \"lodash/every\"\nimport forEach from \"lodash/forEach\"\nimport find from \"lodash/find\"\nimport values from \"lodash/values\"\nimport includes from \"lodash/includes\"\nimport { PRINT_ERROR, PRINT_WARNING } from \"@chevrotain/utils\"\nimport { ASTNode, getRegExpAst } from \"./reg_exp_parser\"\nimport { charCodeToOptimizedIndex, minOptimizationVal } from \"./lexer\"\n\nconst complementErrorMessage =\n \"Complement Sets are not supported for first char optimization\"\nexport const failedOptimizationPrefixMsg =\n 'Unable to use \"first char\" lexer optimizations:\\n'\n\nexport function getOptimizedStartCodesIndices(\n regExp: RegExp,\n ensureOptimizations = false\n): number[] {\n try {\n const ast = getRegExpAst(regExp)\n const firstChars = firstCharOptimizedIndices(\n ast.value,\n {},\n ast.flags.ignoreCase\n )\n return firstChars\n } catch (e) {\n /* istanbul ignore next */\n // Testing this relies on the regexp-to-ast library having a bug... */\n // TODO: only the else branch needs to be ignored, try to fix with newer prettier / tsc\n if (e.message === complementErrorMessage) {\n if (ensureOptimizations) {\n PRINT_WARNING(\n `${failedOptimizationPrefixMsg}` +\n `\\tUnable to optimize: < ${regExp.toString()} >\\n` +\n \"\\tComplement Sets cannot be automatically optimized.\\n\" +\n \"\\tThis will disable the lexer's first char optimizations.\\n\" +\n \"\\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.\"\n )\n }\n } else {\n let msgSuffix = \"\"\n if (ensureOptimizations) {\n msgSuffix =\n \"\\n\\tThis will disable the lexer's first char optimizations.\\n\" +\n \"\\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.\"\n }\n PRINT_ERROR(\n `${failedOptimizationPrefixMsg}\\n` +\n `\\tFailed parsing: < ${regExp.toString()} >\\n` +\n `\\tUsing the regexp-to-ast library version: ${VERSION}\\n` +\n \"\\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues\" +\n msgSuffix\n )\n }\n }\n\n return []\n}\n\nexport function firstCharOptimizedIndices(\n ast: ASTNode,\n result: { [charCode: number]: number },\n ignoreCase: boolean\n): number[] {\n switch (ast.type) {\n case \"Disjunction\":\n for (let i = 0; i < ast.value.length; i++) {\n firstCharOptimizedIndices(ast.value[i], result, ignoreCase)\n }\n break\n case \"Alternative\":\n const terms = ast.value\n for (let i = 0; i < terms.length; i++) {\n const term = terms[i]\n\n // skip terms that cannot effect the first char results\n switch (term.type) {\n case \"EndAnchor\":\n // A group back reference cannot affect potential starting char.\n // because if a back reference is the first production than automatically\n // the group being referenced has had to come BEFORE so its codes have already been added\n case \"GroupBackReference\":\n // assertions do not affect potential starting codes\n case \"Lookahead\":\n case \"NegativeLookahead\":\n case \"StartAnchor\":\n case \"WordBoundary\":\n case \"NonWordBoundary\":\n continue\n }\n\n const atom = term\n switch (atom.type) {\n case \"Character\":\n addOptimizedIdxToResult(atom.value, result, ignoreCase)\n break\n case \"Set\":\n if (atom.complement === true) {\n throw Error(complementErrorMessage)\n }\n forEach(atom.value, (code) => {\n if (typeof code === \"number\") {\n addOptimizedIdxToResult(code, result, ignoreCase)\n } else {\n // range\n const range = code as any\n // cannot optimize when ignoreCase is\n if (ignoreCase === true) {\n for (\n let rangeCode = range.from;\n rangeCode <= range.to;\n rangeCode++\n ) {\n addOptimizedIdxToResult(rangeCode, result, ignoreCase)\n }\n }\n // Optimization (2 orders of magnitude less work for very large ranges)\n else {\n // handle unoptimized values\n for (\n let rangeCode = range.from;\n rangeCode <= range.to && rangeCode < minOptimizationVal;\n rangeCode++\n ) {\n addOptimizedIdxToResult(rangeCode, result, ignoreCase)\n }\n\n // Less common charCode where we optimize for faster init time, by using larger \"buckets\"\n if (range.to >= minOptimizationVal) {\n const minUnOptVal =\n range.from >= minOptimizationVal\n ? range.from\n : minOptimizationVal\n const maxUnOptVal = range.to\n const minOptIdx = charCodeToOptimizedIndex(minUnOptVal)\n const maxOptIdx = charCodeToOptimizedIndex(maxUnOptVal)\n\n for (\n let currOptIdx = minOptIdx;\n currOptIdx <= maxOptIdx;\n currOptIdx++\n ) {\n result[currOptIdx] = currOptIdx\n }\n }\n }\n }\n })\n break\n case \"Group\":\n firstCharOptimizedIndices(atom.value, result, ignoreCase)\n break\n /* istanbul ignore next */\n default:\n throw Error(\"Non Exhaustive Match\")\n }\n\n // reached a mandatory production, no more **start** codes can be found on this alternative\n const isOptionalQuantifier =\n atom.quantifier !== undefined && atom.quantifier.atLeast === 0\n if (\n // A group may be optional due to empty contents /(?:)/\n // or if everything inside it is optional /((a)?)/\n (atom.type === \"Group\" && isWholeOptional(atom) === false) ||\n // If this term is not a group it may only be optional if it has an optional quantifier\n (atom.type !== \"Group\" && isOptionalQuantifier === false)\n ) {\n break\n }\n }\n break\n /* istanbul ignore next */\n default:\n throw Error(\"non exhaustive match!\")\n }\n\n // console.log(Object.keys(result).length)\n return values(result)\n}\n\nfunction addOptimizedIdxToResult(\n code: number,\n result: { [charCode: number]: number },\n ignoreCase: boolean\n) {\n const optimizedCharIdx = charCodeToOptimizedIndex(code)\n result[optimizedCharIdx] = optimizedCharIdx\n\n if (ignoreCase === true) {\n handleIgnoreCase(code, result)\n }\n}\n\nfunction handleIgnoreCase(\n code: number,\n result: { [charCode: number]: number }\n) {\n const char = String.fromCharCode(code)\n const upperChar = char.toUpperCase()\n /* istanbul ignore else */\n if (upperChar !== char) {\n const optimizedCharIdx = charCodeToOptimizedIndex(upperChar.charCodeAt(0))\n result[optimizedCharIdx] = optimizedCharIdx\n } else {\n const lowerChar = char.toLowerCase()\n if (lowerChar !== char) {\n const optimizedCharIdx = charCodeToOptimizedIndex(lowerChar.charCodeAt(0))\n result[optimizedCharIdx] = optimizedCharIdx\n }\n }\n}\n\nfunction findCode(setNode: Set, targetCharCodes: number[]) {\n return find(setNode.value, (codeOrRange) => {\n if (typeof codeOrRange === \"number\") {\n return includes(targetCharCodes, codeOrRange)\n } else {\n // range\n const range = <any>codeOrRange\n return (\n find(\n targetCharCodes,\n (targetCode) => range.from <= targetCode && targetCode <= range.to\n ) !== undefined\n )\n }\n })\n}\n\nfunction isWholeOptional(ast: any): boolean {\n const quantifier = (ast as Atom).quantifier\n if (quantifier && quantifier.atLeast === 0) {\n return true\n }\n\n if (!ast.value) {\n return false\n }\n\n return isArray(ast.value)\n ? every(ast.value, isWholeOptional)\n : isWholeOptional(ast.value)\n}\n\nclass CharCodeFinder extends BaseRegExpVisitor {\n found: boolean = false\n\n constructor(private targetCharCodes: number[]) {\n super()\n }\n\n visitChildren(node: ASTNode) {\n // No need to keep looking...\n if (this.found === true) {\n return\n }\n\n // switch lookaheads as they do not actually consume any characters thus\n // finding a charCode at lookahead context does not mean that regexp can actually contain it in a match.\n switch (node.type) {\n case \"Lookahead\":\n this.visitLookahead(node)\n return\n case \"NegativeLookahead\":\n this.visitNegativeLookahead(node)\n return\n }\n\n super.visitChildren(node)\n }\n\n visitCharacter(node: Character) {\n if (includes(this.targetCharCodes, node.value)) {\n this.found = true\n }\n }\n\n visitSet(node: Set) {\n if (node.complement) {\n if (findCode(node, this.targetCharCodes) === undefined) {\n this.found = true\n }\n } else {\n if (findCode(node, this.targetCharCodes) !== undefined) {\n this.found = true\n }\n }\n }\n}\n\nexport function canMatchCharCode(\n charCodes: number[],\n pattern: RegExp | string\n) {\n if (pattern instanceof RegExp) {\n const ast = getRegExpAst(pattern)\n const charCodeFinder = new CharCodeFinder(charCodes)\n charCodeFinder.visit(ast)\n return charCodeFinder.found\n } else {\n return (\n find(<any>pattern, (char) => {\n return includes(charCodes, (<string>char).charCodeAt(0))\n }) !== undefined\n )\n }\n}\n","import { BaseRegExpVisitor } from \"regexp-to-ast\"\nimport { IRegExpExec, Lexer, LexerDefinitionErrorType } from \"./lexer_public\"\nimport first from \"lodash/first\"\nimport isEmpty from \"lodash/isEmpty\"\nimport compact from \"lodash/compact\"\nimport isArray from \"lodash/isArray\"\nimport values from \"lodash/values\"\nimport flatten from \"lodash/flatten\"\nimport reject from \"lodash/reject\"\nimport difference from \"lodash/difference\"\nimport indexOf from \"lodash/indexOf\"\nimport map from \"lodash/map\"\nimport forEach from \"lodash/forEach\"\nimport isString from \"lodash/isString\"\nimport isFunction from \"lodash/isFunction\"\nimport isUndefined from \"lodash/isUndefined\"\nimport find from \"lodash/find\"\nimport has from \"lodash/has\"\nimport keys from \"lodash/keys\"\nimport isRegExp from \"lodash/isRegExp\"\nimport filter from \"lodash/filter\"\nimport defaults from \"lodash/defaults\"\nimport reduce from \"lodash/reduce\"\nimport includes from \"lodash/includes\"\nimport { PRINT_ERROR } from \"@chevrotain/utils\"\nimport {\n canMatchCharCode,\n failedOptimizationPrefixMsg,\n getOptimizedStartCodesIndices\n} from \"./reg_exp\"\nimport {\n ILexerDefinitionError,\n ILineTerminatorsTester,\n IMultiModeLexerDefinition,\n IToken,\n TokenType\n} from \"@chevrotain/types\"\nimport { getRegExpAst } from \"./reg_exp_parser\"\n\nconst PATTERN = \"PATTERN\"\nexport const DEFAULT_MODE = \"defaultMode\"\nexport const MODES = \"modes\"\n\nexport interface IPatternConfig {\n pattern: IRegExpExec | string\n longerAlt: number[] | undefined\n canLineTerminator: boolean\n isCustom: boolean\n short: number | false\n group: string | undefined | false\n push: string | undefined\n pop: boolean\n tokenType: TokenType\n tokenTypeIdx: number\n}\n\nexport interface IAnalyzeResult {\n patternIdxToConfig: IPatternConfig[]\n charCodeToPatternIdxToConfig: { [charCode: number]: IPatternConfig[] }\n emptyGroups: { [groupName: string]: IToken[] }\n hasCustom: boolean\n canBeOptimized: boolean\n}\n\nexport let SUPPORT_STICKY =\n typeof (<any>new RegExp(\"(?:)\")).sticky === \"boolean\"\n\nexport function disableSticky() {\n SUPPORT_STICKY = false\n}\n\nexport function enableSticky() {\n SUPPORT_STICKY = true\n}\n\nexport function analyzeTokenTypes(\n tokenTypes: TokenType[],\n options: {\n positionTracking?: \"full\" | \"onlyStart\" | \"onlyOffset\"\n ensureOptimizations?: boolean\n lineTerminatorCharacters?: (number | string)[]\n // TODO: should `useSticky` be an argument here?\n useSticky?: boolean\n safeMode?: boolean\n tracer?: (msg: string, action: () => void) => void\n }\n): IAnalyzeResult {\n options = defaults(options, {\n useSticky: SUPPORT_STICKY,\n debug: false as boolean,\n safeMode: false as boolean,\n positionTracking: \"full\",\n lineTerminatorCharacters: [\"\\r\", \"\\n\"],\n tracer: (msg: string, action: Function) => action()\n })\n\n const tracer = options.tracer!\n\n tracer(\"initCharCodeToOptimizedIndexMap\", () => {\n initCharCodeToOptimizedIndexMap()\n })\n\n let onlyRelevantTypes: TokenType[]\n tracer(\"Reject Lexer.NA\", () => {\n onlyRelevantTypes = reject(tokenTypes, (currType) => {\n return currType[PATTERN] === Lexer.NA\n })\n })\n\n let hasCustom = false\n let allTransformedPatterns: (IRegExpExec | string)[]\n tracer(\"Transform Patterns\", () => {\n hasCustom = false\n allTransformedPatterns = map(\n onlyRelevantTypes,\n (currType): IRegExpExec | string => {\n const currPattern = currType[PATTERN]\n\n /* istanbul ignore else */\n if (isRegExp(currPattern)) {\n const regExpSource = currPattern.source\n if (\n regExpSource.length === 1 &&\n // only these regExp meta characters which can appear in a length one regExp\n regExpSource !== \"^\" &&\n regExpSource !== \"$\" &&\n regExpSource !== \".\" &&\n !currPattern.ignoreCase\n ) {\n return regExpSource\n } else if (\n regExpSource.length === 2 &&\n regExpSource[0] === \"\\\\\" &&\n // not a meta character\n !includes(\n [\n \"d\",\n \"D\",\n \"s\",\n \"S\",\n \"t\",\n \"r\",\n \"n\",\n \"t\",\n \"0\",\n \"c\",\n \"b\",\n \"B\",\n \"f\",\n \"v\",\n \"w\",\n \"W\"\n ],\n regExpSource[1]\n )\n ) {\n // escaped meta Characters: /\\+/ /\\[/\n // or redundant escaping: /\\a/\n // without the escaping \"\\\"\n return regExpSource[1]\n } else {\n return options.useSticky\n ? addStickyFlag(currPattern)\n : addStartOfInput(currPattern)\n }\n } else if (isFunction(currPattern)) {\n hasCustom = true\n // CustomPatternMatcherFunc - custom patterns do not require any transformations, only wrapping in a RegExp Like object\n return { exec: currPattern }\n } else if (typeof currPattern === \"object\") {\n hasCustom = true\n // ICustomPattern\n return currPattern\n } else if (typeof currPattern === \"string\") {\n if (currPattern.length === 1) {\n return currPattern\n } else {\n const escapedRegExpString = currPattern.replace(\n /[\\\\^$.*+?()[\\]{}|]/g,\n \"\\\\$&\"\n )\n const wrappedRegExp = new RegExp(escapedRegExpString)\n return options.useSticky\n ? addStickyFlag(wrappedRegExp)\n : addStartOfInput(wrappedRegExp)\n }\n } else {\n throw Error(\"non exhaustive match\")\n }\n }\n )\n })\n\n let patternIdxToType: number[]\n let patternIdxToGroup: (string | undefined | false)[]\n let patternIdxToLongerAltIdxArr: (number[] | undefined)[]\n let patternIdxToPushMode: (string | undefined)[]\n let patternIdxToPopMode: boolean[]\n tracer(\"misc mapping\", () => {\n patternIdxToType = map(\n onlyRelevantTypes,\n (currType) => currType.tokenTypeIdx!\n )\n\n patternIdxToGroup = map(onlyRelevantTypes, (clazz: any) => {\n const groupName = clazz.GROUP\n /* istanbul ignore next */\n if (groupName === Lexer.SKIPPED) {\n return undefined\n } else if (isString(groupName)) {\n return groupName\n } else if (isUndefined(groupName)) {\n return false\n } else {\n throw Error(\"non exhaustive match\")\n }\n })\n\n patternIdxToLongerAltIdxArr = map(onlyRelevantTypes, (clazz: any) => {\n const longerAltType = clazz.LONGER_ALT\n\n if (longerAltType) {\n const longerAltIdxArr = isArray(longerAltType)\n ? map(longerAltType, (type: any) => indexOf(onlyRelevantTypes, type))\n : [indexOf(onlyRelevantTypes, longerAltType)]\n return longerAltIdxArr\n }\n })\n\n patternIdxToPushMode = map(\n onlyRelevantTypes,\n (clazz: any) => clazz.PUSH_MODE\n )\n\n patternIdxToPopMode = map(onlyRelevantTypes, (clazz: any) =>\n has(clazz, \"POP_MODE\")\n )\n })\n\n let patternIdxToCanLineTerminator: boolean[]\n tracer(\"Line Terminator Handling\", () => {\n const lineTerminatorCharCodes = getCharCodes(\n options.lineTerminatorCharacters!\n )\n patternIdxToCanLineTerminator = map(onlyRelevantTypes, (tokType) => false)\n if (options.positionTracking !== \"onlyOffset\") {\n patternIdxToCanLineTerminator = map(onlyRelevantTypes, (tokType) => {\n if (has(tokType, \"LINE_BREAKS\")) {\n return !!tokType.LINE_BREAKS\n } else {\n return (\n checkLineBreaksIssues(tokType, lineTerminatorCharCodes) === false &&\n canMatchCharCode(\n lineTerminatorCharCodes,\n tokType.PATTERN as RegExp | string\n )\n )\n }\n })\n }\n })\n\n let patternIdxToIsCustom: boolean[]\n let patternIdxToShort: (number | false)[]\n let emptyGroups!: { [groupName: string]: IToken[] }\n let patternIdxToConfig!: IPatternConfig[]\n tracer(\"Misc Mapping #2\", () => {\n patternIdxToIsCustom = map(onlyRelevantTypes, isCustomPattern)\n patternIdxToShort = map(allTransformedPatterns, isShortPattern)\n\n emptyGroups = reduce(\n onlyRelevantTypes,\n (acc, clazz: any) => {\n const groupName = clazz.GROUP\n if (isString(groupName) && !(groupName === Lexer.SKIPPED)) {\n acc[groupName] = []\n }\n return acc\n },\n {} as { [groupName: string]: IToken[] }\n )\n\n patternIdxToConfig = map(\n allTransformedPatterns,\n (x, idx): IPatternConfig => {\n return {\n pattern: allTransformedPatterns[idx],\n longerAlt: patternIdxToLongerAltIdxArr[idx],\n canLineTerminator: patternIdxToCanLineTerminator[idx],\n isCustom: patternIdxToIsCustom[idx],\n short: patternIdxToShort[idx],\n group: patternIdxToGroup[idx],\n push: patternIdxToPushMode[idx],\n pop: patternIdxToPopMode[idx],\n tokenTypeIdx: patternIdxToType[idx],\n tokenType: onlyRelevantTypes[idx]\n }\n }\n )\n })\n\n let canBeOptimized = true\n let charCodeToPatternIdxToConfig: { [charCode: number]: IPatternConfig[] } =\n []\n\n if (!options.safeMode) {\n tracer(\"First Char Optimization\", () => {\n charCodeToPatternIdxToConfig = reduce(\n onlyRelevantTypes,\n (result, currTokType, idx) => {\n if (typeof currTokType.PATTERN === \"string\") {\n const charCode = currTokType.PATTERN.charCodeAt(0)\n const optimizedIdx = charCodeToOptimizedIndex(charCode)\n addToMapOfArrays(result, optimizedIdx, patternIdxToConfig[idx])\n } else if (isArray(currTokType.START_CHARS_HINT)) {\n let lastOptimizedIdx: number\n forEach(currTokType.START_CHARS_HINT, (charOrInt) => {\n const charCode =\n typeof charOrInt === \"string\"\n ? charOrInt.charCodeAt(0)\n : charOrInt\n const currOptimizedIdx = charCodeToOptimizedIndex(charCode)\n // Avoid adding the config multiple times\n /* istanbul ignore else */\n // - Difficult to check this scenario effects as it is only a performance\n // optimization that does not change correctness\n if (lastOptimizedIdx !== currOptimizedIdx) {\n lastOptimizedIdx = currOptimizedIdx\n addToMapOfArrays(\n result,\n currOptimizedIdx,\n patternIdxToConfig[idx]\n )\n }\n })\n } else if (isRegExp(currTokType.PATTERN)) {\n if (currTokType.PATTERN.unicode) {\n canBeOptimized = false\n if (options.ensureOptimizations) {\n PRINT_ERROR(\n `${failedOptimizationPrefixMsg}` +\n `\\tUnable to analyze < ${currTokType.PATTERN.toString()} > pattern.\\n` +\n \"\\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\\n\" +\n \"\\tThis will disable the lexer's first char optimizations.\\n\" +\n \"\\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE\"\n )\n }\n } else {\n const optimizedCodes = getOptimizedStartCodesIndices(\n currTokType.PATTERN,\n options.ensureOptimizations\n )\n /* istanbul ignore if */\n // start code will only be empty given an empty regExp or failure of regexp-to-ast library\n // the first should be a different validation and the second cannot be tested.\n if (isEmpty(optimizedCodes)) {\n // we cannot understand what codes may start possible matches\n // The optimization correctness requires knowing start codes for ALL patterns.\n // Not actually sure this is an error, no debug message\n canBeOptimized = false\n }\n forEach(optimizedCodes, (code) => {\n addToMapOfArrays(result, code, patternIdxToConfig[idx])\n })\n }\n } else {\n if (options.ensureOptimizations) {\n PRINT_ERROR(\n `${failedOptimizationPrefixMsg}` +\n `\\tTokenType: <${currTokType.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\\n` +\n \"\\tThis will disable the lexer's first char optimizations.\\n\" +\n \"\\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE\"\n )\n }\n canBeOptimized = false\n }\n\n return result\n },\n [] as { [charCode: number]: IPatternConfig[] }\n )\n })\n }\n\n return {\n emptyGroups: emptyGroups,\n patternIdxToConfig: patternIdxToConfig,\n charCodeToPatternIdxToConfig: charCodeToPatternIdxToConfig,\n hasCustom: hasCustom,\n canBeOptimized: canBeOptimized\n }\n}\n\nexport function validatePatterns(\n tokenTypes: TokenType[],\n validModesNames: string[]\n): ILexerDefinitionError[] {\n let errors: ILexerDefinitionError[] = []\n\n const missingResult = findMissingPatterns(tokenTypes)\n errors = errors.concat(missingResult.errors)\n\n const invalidResult = findInvalidPatterns(missingResult.valid)\n const validTokenTypes = invalidResult.valid\n errors = errors.concat(invalidResult.errors)\n\n errors = errors.concat(validateRegExpPattern(validTokenTypes))\n\n errors = errors.concat(findInvalidGroupType(validTokenTypes))\n\n errors = errors.concat(\n findModesThatDoNotExist(validTokenTypes, validModesNames)\n )\n\n errors = errors.concat(findUnreachablePatterns(validTokenTypes))\n\n return errors\n}\n\nfunction validateRegExpPattern(\n tokenTypes: TokenType[]\n): ILexerDefinitionError[] {\n let errors: ILexerDefinitionError[] = []\n const withRegExpPatterns = filter(tokenTypes, (currTokType) =>\n isRegExp(currTokType[PATTERN])\n )\n\n errors = errors.concat(findEndOfInputAnchor(withRegExpPatterns))\n\n errors = errors.concat(findStartOfInputAnchor(withRegExpPatterns))\n\n errors = errors.concat(findUnsupportedFlags(withRegExpPatterns))\n\n errors = errors.concat(findDuplicatePatterns(withRegExpPatterns))\n\n errors = errors.concat(findEmptyMatchRegExps(withRegExpPatterns))\n\n return errors\n}\n\nexport interface ILexerFilterResult {\n errors: ILexerDefinitionError[]\n valid: TokenType[]\n}\n\nexport function findMissingPatterns(\n tokenTypes: TokenType[]\n): ILexerFilterResult {\n const tokenTypesWithMissingPattern = filter(tokenTypes, (currType) => {\n return !has(currType, PATTERN)\n })\n\n const errors = map(tokenTypesWithMissingPattern, (currType) => {\n return {\n message:\n \"Token Type: ->\" +\n currType.name +\n \"<- missing static 'PATTERN' property\",\n type: LexerDefinitionErrorType.MISSING_PATTERN,\n tokenTypes: [currType]\n }\n })\n\n const valid = difference(tokenTypes, tokenTypesWithMissingPattern)\n return { errors, valid }\n}\n\nexport function findInvalidPatterns(\n tokenTypes: TokenType[]\n): ILexerFilterResult {\n const tokenTypesWithInvalidPattern = filter(tokenTypes, (currType) => {\n const pattern = currType[PATTERN]\n return (\n !isRegExp(pattern) &&\n !isFunction(pattern) &&\n !has(pattern, \"exec\") &&\n !isString(pattern)\n )\n })\n\n const errors = map(tokenTypesWithInvalidPattern, (currType) => {\n return {\n message:\n \"Token Type: ->\" +\n currType.name +\n \"<- static 'PATTERN' can only be a RegExp, a\" +\n \" Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.\",\n type: LexerDefinitionErrorType.INVALID_PATTERN,\n tokenTypes: [currType]\n }\n })\n\n const valid = difference(tokenTypes, tokenTypesWithInvalidPattern)\n return { errors, valid }\n}\n\nconst end_of_input = /[^\\\\][$]/\n\nexport function findEndOfInputAnchor(\n tokenTypes: TokenType[]\n): ILexerDefinitionError[] {\n class EndAnchorFinder extends BaseRegExpVisitor {\n found = false\n\n visitEndAnchor(node: unknown) {\n this.found = true\n }\n }\n\n const invalidRegex = filter(tokenTypes, (currType) => {\n const pattern = currType.PATTERN\n\n try {\n const regexpAst = getRegExpAst(pattern as RegExp)\n const endAnchorVisitor = new EndAnchorFinder()\n endAnchorVisitor.visit(regexpAst)\n\n return endAnchorVisitor.found\n } catch (e) {\n // old behavior in case of runtime exceptions with regexp-to-ast.\n /* istanbul ignore next - cannot ensure an error in regexp-to-ast*/\n return end_of_input.test((pattern as RegExp).source)\n }\n })\n\n const errors = map(invalidRegex, (currType) => {\n return {\n message:\n \"Unexpected RegExp Anchor Error:\\n\" +\n \"\\tToken Type: ->\" +\n currType.name +\n \"<- static 'PATTERN' cannot contain end of input anchor '$'\\n\" +\n \"\\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\" +\n \"\\tfor details.\",\n type: LexerDefinitionErrorType.EOI_ANCHOR_FOUND,\n tokenTypes: [currType]\n }\n })\n\n return errors\n}\n\nexport function findEmptyMatchRegExps(\n tokenTypes: TokenType[]\n): ILexerDefinitionError[] {\n const matchesEmptyString = filter(tokenTypes, (currType) => {\n const pattern = currType.PATTERN as RegExp\n return pattern.test(\"\")\n })\n\n const errors = map(matchesEmptyString, (currType) => {\n return {\n message:\n \"Token Type: ->\" +\n currType.name +\n \"<- static 'PATTERN' must not match an empty string\",\n type: LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,\n tokenTypes: [currType]\n }\n })\n\n return errors\n}\n\nconst start_of_input = /[^\\\\[][\\^]|^\\^/\n\nexport function findStartOfInputAnchor(\n tokenTypes: TokenType[]\n): ILexerDefinitionError[] {\n class StartAnchorFinder extends BaseRegExpVisitor {\n found = false\n\n visitStartAnchor(node: unknown) {\n this.found = true\n }\n }\n\n const invalidRegex = filter(tokenTypes, (currType) => {\n const pattern = currType.PATTERN as RegExp\n try {\n const regexpAst = getRegExpAst(pattern)\n const startAnchorVisitor = new StartAnchorFinder()\n startAnchorVisitor.visit(regexpAst)\n\n return startAnchorVisitor.found\n } catch (e) {\n // old behavior in case of runtime exceptions with regexp-to-ast.\n /* istanbul ignore next - cannot ensure an error in regexp-to-ast*/\n return start_of_input.test(pattern.source)\n }\n })\n\n const errors = map(invalidRegex, (currType) => {\n return {\n message:\n \"Unexpected RegExp Anchor Error:\\n\" +\n \"\\tToken Type: ->\" +\n currType.name +\n \"<- static 'PATTERN' cannot contain start of input anchor '^'\\n\" +\n \"\\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\" +\n \"\\tfor details.\",\n type: LexerDefinitionErrorType.SOI_ANCHOR_FOUND,\n tokenTypes: [currType]\n }\n })\n\n return errors\n}\n\nexport function findUnsupportedFlags(\n tokenTypes: TokenType[]\n): ILexerDefinitionError[] {\n const invalidFlags = filter(tokenTypes, (currType) => {\n const pattern = currType[PATTERN]\n return pattern instanceof RegExp && (pattern.multiline || pattern.global)\n })\n\n const errors = map(invalidFlags, (currType) => {\n return {\n message:\n \"Token Type: ->\" +\n currType.name +\n \"<- static 'PATTERN' may NOT contain global('g') or multiline('m')\",\n type: LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,\n tokenTypes: [currType]\n }\n })\n\n return errors\n}\n\n// This can only test for identical duplicate RegExps, not semantically equivalent ones.\nexport function findDuplicatePatterns(\n tokenTypes: TokenType[]\n): ILexerDefinitionError[] {\n const found: TokenType[] = []\n let identicalPatterns = map(tokenTypes, (outerType: any) => {\n return reduce(\n tokenTypes,\n (result, innerType) => {\n if (\n outerType.PATTERN.source === (innerType.PATTERN as RegExp).source &&\n !includes(found, innerType) &&\n innerType.PATTERN !== Lexer.NA\n ) {\n // this avoids duplicates in the result, each Token Type may only appear in one \"set\"\n // in essence we are creating Equivalence classes on equality relation.\n found.push(innerType)\n result.push(innerType)\n return result\n }\n return result\n },\n [] as TokenType[]\n )\n })\n\n identicalPatterns = compact(identicalPatterns)\n\n const duplicatePatterns = filter(identicalPatterns, (currIdenticalSet) => {\n return currIdenticalSet.length > 1\n })\n\n const errors = map(duplicatePatterns, (setOfIdentical: any) => {\n const tokenTypeNames = map(setOfIdentical, (currType: any) => {\n return currType.name\n })\n\n const dupPatternSrc = (<any>first(setOfIdentical)).PATTERN\n return {\n message:\n `The same RegExp pattern ->${dupPatternSrc}<-` +\n `has been used in all of the following Token Types: ${tokenTypeNames.join(\n \", \"\n )} <-`,\n type: LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,\n tokenTypes: setOfIdentical\n }\n })\n\n return errors\n}\n\nexport function findInvalidGroupType(\n tokenTypes: TokenType[]\n): ILexerDefinitionError[] {\n const invalidTypes = filter(tokenTypes, (clazz: any) => {\n if (!has(clazz, \"GROUP\")) {\n return false\n }\n const group = clazz.GROUP\n\n return group !== Lexer.SKIPPED && group !== Lexer.NA && !isString(group)\n })\n\n const errors = map(invalidTypes, (currType) => {\n return {\n message:\n \"Token Type: ->\" +\n currType.name +\n \"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String\",\n type: LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,\n tokenTypes: [currType]\n }\n })\n\n return errors\n}\n\nexport function findModesThatDoNotExist(\n tokenTypes: TokenType[],\n validModes: string[]\n): ILexerDefinitionError[] {\n const invalidModes = filter(tokenTypes, (clazz: any) => {\n return (\n clazz.PUSH_MODE !== undefined && !includes(validModes, clazz.PUSH_MODE)\n )\n })\n\n const errors = map(invalidModes, (tokType) => {\n const msg =\n `Token Type: ->${tokType.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${tokType.PUSH_MODE}<-` +\n `which does not exist`\n return {\n message: msg,\n type: LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,\n tokenTypes: [tokType]\n }\n })\n\n return errors\n}\n\nexport function findUnreachablePatterns(\n tokenTypes: TokenType[]\n): ILexerDefinitionError[] {\n const errors: ILexerDefinitionError[] = []\n\n const canBeTested = reduce(\n tokenTypes,\n (result, tokType, idx) => {\n const pattern = tokType.PATTERN\n\n if (pattern === Lexer.NA) {\n return result\n }\n\n // a more comprehensive validation for all forms of regExps would require\n // deeper regExp analysis capabilities\n if (isString(pattern)) {\n result.push({ str: pattern, idx, tokenType: tokType })\n } else if (isRegExp(pattern) && noMetaChar(pattern)) {\n result.push({ str: pattern.source, idx, tokenType: tokType })\n }\n return result\n },\n [] as { str: string; idx: number; tokenType: TokenType }[]\n )\n\n forEach(tokenTypes, (tokType, testIdx) => {\n forEach(canBeTested, ({ str, idx, tokenType }) => {\n if (testIdx < idx && testTokenType(str, tokType.PATTERN)) {\n const msg =\n `Token: ->${tokenType.name}<- can never be matched.\\n` +\n `Because it appears AFTER the Token Type ->${tokType.name}<-` +\n `in the lexer's definition.\\n` +\n `See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`\n errors.push({\n message: msg,\n type: LexerDefinitionErrorType.UNREACHABLE_PATTERN,\n tokenTypes: [tokType, tokenType]\n })\n }\n })\n })\n\n return errors\n}\n\nfunction testTokenType(str: string, pattern: any): boolean {\n /* istanbul ignore else */\n if (isRegExp(pattern)) {\n const regExpArray = pattern.exec(str)\n return regExpArray !== null && regExpArray.index === 0\n } else if (isFunction(pattern)) {\n // maintain the API of custom patterns\n return pattern(str, 0, [], {})\n } else if (has(pattern, \"exec\")) {\n // maintain the API of custom patterns\n return pattern.exec(str, 0, [], {})\n } else if (typeof pattern === \"string\") {\n return pattern === str\n } else {\n throw Error(\"non exhaustive match\")\n }\n}\n\nfunction noMetaChar(regExp: RegExp): boolean {\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\n const metaChars = [\n \".\",\n \"\\\\\",\n \"[\",\n \"]\",\n \"|\",\n \"^\",\n \"$\",\n \"(\",\n \")\",\n \"?\",\n \"*\",\n \"+\",\n \"{\"\n ]\n return (\n find(metaChars, (char) => regExp.source.indexOf(char) !== -1) === undefined\n )\n}\n\nexport function addStartOfInput(pattern: RegExp): RegExp {\n const flags = pattern.ignoreCase ? \"i\" : \"\"\n // always wrapping in a none capturing group preceded by '^' to make sure matching can only work on start of input.\n // duplicate/redundant start of input markers have no meaning (/^^^^A/ === /^A/)\n return new RegExp(`^(?:${pattern.source})`, flags)\n}\n\nexport function addStickyFlag(pattern: RegExp): RegExp {\n const flags = pattern.ignoreCase ? \"iy\" : \"y\"\n // always wrapping in a none capturing group preceded by '^' to make sure matching can only work on start of input.\n // duplicate/redundant start of input markers have no meaning (/^^^^A/ === /^A/)\n return new RegExp(`${pattern.source}`, flags)\n}\n\nexport function performRuntimeChecks(\n lexerDefinition: IMultiModeLexerDefinition,\n trackLines: boolean,\n lineTerminatorCharacters: (number | string)[]\n): ILexerDefinitionError[] {\n const errors: ILexerDefinitionError[] = []\n\n // some run time checks to help the end users.\n if (!has(lexerDefinition, DEFAULT_MODE)) {\n errors.push({\n message:\n \"A MultiMode Lexer cannot be initialized without a <\" +\n DEFAULT_MODE +\n \"> property in its definition\\n\",\n type: LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE\n })\n }\n if (!has(lexerDefinition, MODES)) {\n errors.push({\n message:\n \"A MultiMode Lexer cannot be initialized without a <\" +\n MODES +\n \"> property in its definition\\n\",\n type: LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY\n })\n }\n\n if (\n has(lexerDefinition, MODES) &&\n has(lexerDefinition, DEFAULT_MODE) &&\n !has(lexerDefinition.modes, lexerDefinition.defaultMode)\n ) {\n errors.push({\n message:\n `A MultiMode Lexer cannot be initialized with a ${DEFAULT_MODE}: <${lexerDefinition.defaultMode}>` +\n `which does not exist\\n`,\n type: LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST\n })\n }\n\n if (has(lexerDefinition, MODES)) {\n forEach(lexerDefinition.modes, (currModeValue, currModeName) => {\n forEach(currModeValue, (currTokType, currIdx) => {\n if (isUndefined(currTokType)) {\n errors.push({\n message:\n `A Lexer cannot be initialized using an undefined Token Type. Mode:` +\n `<${currModeName}> at index: <${currIdx}>\\n`,\n type: LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED\n })\n } else if (has(currTokType, \"LONGER_ALT\")) {\n const longerAlt = isArray(currTokType.LONGER_ALT)\n ? currTokType.LONGER_ALT\n : [currTokType.LONGER_ALT]\n forEach(longerAlt, (currLongerAlt) => {\n if (\n !isUndefined(currLongerAlt) &&\n !includes(currModeValue, currLongerAlt)\n ) {\n errors.push({\n message: `A MultiMode Lexer cannot be initialized with a longer_alt <${currLongerAlt.name}> on token <${currTokType.name}> outside of mode <${currModeName}>\\n`,\n type: LexerDefinitionErrorType.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE\n })\n }\n })\n }\n })\n })\n }\n\n return errors\n}\n\nexport function performWarningRuntimeChecks(\n lexerDefinition: IMultiModeLexerDefinition,\n trackLines: boolean,\n lineTerminatorCharacters: (number | string)[]\n): ILexerDefinitionError[] {\n const warnings = []\n let hasAnyLineBreak = false\n const allTokenTypes = compact(flatten(values(lexerDefinition.modes)))\n\n const concreteTokenTypes = reject(\n allTokenTypes,\n (currType) => currType[PATTERN] === Lexer.NA\n )\n const terminatorCharCodes = getCharCodes(lineTerminatorCharacters)\n if (trackLines) {\n forEach(concreteTokenTypes, (tokType) => {\n const currIssue = checkLineBreaksIssues(tokType, terminatorCharCodes)\n if (currIssue !== false) {\n const message = buildLineBreakIssueMessage(tokType, currIssue)\n const warningDescriptor = {\n message,\n type: currIssue.issue,\n tokenType: tokType\n }\n warnings.push(warningDescriptor)\n } else {\n // we don't want to attempt to scan if the user explicitly specified the line_breaks option.\n if (has(tokType, \"LINE_BREAKS\")) {\n if (tokType.LINE_BREAKS === true) {\n hasAnyLineBreak = true\n }\n } else {\n if (\n canMatchCharCode(terminatorCharCodes, tokType.PATTERN as RegExp)\n ) {\n hasAnyLineBreak = true\n }\n }\n }\n })\n }\n\n if (trackLines && !hasAnyLineBreak) {\n warnings.push({\n message:\n \"Warning: No LINE_BREAKS Found.\\n\" +\n \"\\tThis Lexer has been defined to track line and column information,\\n\" +\n \"\\tBut none of the Token Types can be identified as matching a line terminator.\\n\" +\n \"\\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \\n\" +\n \"\\tfor details.\",\n type: LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS\n })\n }\n return warnings\n}\n\nexport function cloneEmptyGroups(emptyGroups: {\n [groupName: string]: IToken\n}): { [groupName: string]: IToken } {\n const clonedResult: any = {}\n const groupKeys = keys(emptyGroups)\n\n forEach(groupKeys, (currKey) => {\n const currGroupValue = emptyGroups[currKey]\n\n /* istanbul ignore else */\n if (isArray(currGroupValue)) {\n clonedResult[currKey] = []\n } else {\n throw Error(\"non exhaustive match\")\n }\n })\n\n return clonedResult\n}\n\n// TODO: refactor to avoid duplication\nexport function isCustomPattern(tokenType: TokenType): boolean {\n const pattern = tokenType.PATTERN\n /* istanbul ignore else */\n if (isRegExp(pattern)) {\n return false\n } else if (isFunction(pattern)) {\n // CustomPatternMatcherFunc - custom patterns do not require any transformations, only wrapping in a RegExp Like object\n return true\n } else if (has(pattern, \"exec\")) {\n // ICustomPattern\n return true\n } else if (isString(pattern)) {\n return false\n } else {\n throw Error(\"non exhaustive match\")\n }\n}\n\nexport function isShortPattern(pattern: any): number | false {\n if (isString(pattern) && pattern.length === 1) {\n return pattern.charCodeAt(0)\n } else {\n return false\n }\n}\n\n/**\n * Faster than using a RegExp for default newline detection during lexing.\n */\nexport const LineTerminatorOptimizedTester: ILineTerminatorsTester = {\n // implements /\\n|\\r\\n?/g.test\n test: function (text) {\n const len = text.length\n for (let i = this.lastIndex; i < len; i++) {\n const c = text.charCodeAt(i)\n if (c === 10) {\n this.lastIndex = i + 1\n return true\n } else if (c === 13) {\n if (text.charCodeAt(i + 1) === 10) {\n this.lastIndex = i + 2\n } else {\n this.lastIndex = i + 1\n }\n return true\n }\n }\n return false\n },\n\n lastIndex: 0\n}\n\nfunction checkLineBreaksIssues(\n tokType: TokenType,\n lineTerminatorCharCodes: number[]\n):\n | {\n issue:\n | LexerDefinitionErrorType.IDENTIFY_TERMINATOR\n | LexerDefinitionErrorType.CUSTOM_LINE_BREAK\n errMsg?: string\n }\n | false {\n if (has(tokType, \"LINE_BREAKS\")) {\n // if the user explicitly declared the line_breaks option we will respect their choice\n // and assume it is correct.\n return false\n } else {\n /* istanbul ignore else */\n if (isRegExp(tokType.PATTERN)) {\n try {\n // TODO: why is the casting suddenly needed?\n canMatchCharCode(lineTerminatorCharCodes, tokType.PATTERN as RegExp)\n } catch (e) {\n /* istanbul ignore next - to test this we would have to mock <canMatchCharCode> to throw an error */\n return {\n issue: LexerDefinitionErrorType.IDENTIFY_TERMINATOR,\n errMsg: (e as Error).message\n }\n }\n return false\n } else if (isString(tokType.PATTERN)) {\n // string literal patterns can always be analyzed to detect line terminator usage\n return false\n } else if (isCustomPattern(tokType)) {\n // custom token types\n return { issue: LexerDefinitionErrorType.CUSTOM_LINE_BREAK }\n } else {\n throw Error(\"non exhaustive match\")\n }\n }\n}\n\nexport function buildLineBreakIssueMessage(\n tokType: TokenType,\n details: {\n issue:\n | LexerDefinitionErrorType.IDENTIFY_TERMINATOR\n | LexerDefinitionErrorType.CUSTOM_LINE_BREAK\n errMsg?: string\n }\n): string {\n /* istanbul ignore else */\n if (details.issue === LexerDefinitionErrorType.IDENTIFY_TERMINATOR) {\n return (\n \"Warning: unable to identify line terminator usage in pattern.\\n\" +\n `\\tThe problem is in the <${tokType.name}> Token Type\\n` +\n `\\t Root cause: ${details.errMsg}.\\n` +\n \"\\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR\"\n )\n } else if (details.issue === LexerDefinitionErrorType.CUSTOM_LINE_BREAK) {\n return (\n \"Warning: A Custom Token Pattern should specify the <line_breaks> option.\\n\" +\n `\\tThe problem is in the <${tokType.name}> Token Type\\n` +\n \"\\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK\"\n )\n } else {\n throw Error(\"non exhaustive match\")\n }\n}\n\nfunction getCharCodes(charsOrCodes: (number | string)[]): number[] {\n const charCodes = map(charsOrCodes, (numOrString) => {\n if (isString(numOrString)) {\n return numOrString.charCodeAt(0)\n } else {\n return numOrString\n }\n })\n\n return charCodes\n}\n\nfunction addToMapOfArrays<T>(\n map: Record<number, T[]>,\n key: number,\n value: T\n): void {\n if (map[key] === undefined) {\n map[key] = [value]\n } else {\n map[key].push(value)\n }\n}\n\nexport const minOptimizationVal = 256\n\n/**\n * We are mapping charCode above ASCI (256) into buckets each in the size of 256.\n * This is because ASCI are the most common start chars so each one of those will get its own\n * possible token configs vector.\n *\n * Tokens starting with charCodes \"above\" ASCI are uncommon, so we can \"afford\"\n * to place these into buckets of possible token configs, What we gain from\n * this is avoiding the case of creating an optimization 'charCodeToPatternIdxToConfig'\n * which would contain 10,000+ arrays of small size (e.g unicode Identifiers scenario).\n * Our 'charCodeToPatternIdxToConfig' max size will now be:\n * 256 + (2^16 / 2^8) - 1 === 511\n *\n * note the hack for fast division integer part extraction\n * See: https://stackoverflow.com/a/4228528\n */\nlet charCodeToOptimizedIdxMap: number[] = []\nexport function charCodeToOptimizedIndex(charCode: number): number {\n return charCode < minOptimizationVal\n ? charCode\n : charCodeToOptimizedIdxMap[charCode]\n}\n\n/**\n * This is a compromise between cold start / hot running performance\n * Creating this array takes ~3ms on a modern machine,\n * But if we perform the computation at runtime as needed the CSS Lexer benchmark\n * performance degrades by ~10%\n *\n * TODO: Perhaps it should be lazy initialized only if a charCode > 255 is used.\n */\nfunction initCharCodeToOptimizedIndexMap() {\n if (isEmpty(charCodeToOptimizedIdxMap)) {\n charCodeToOptimizedIdxMap = new Array(65536)\n for (let i = 0; i < 65536; i++) {\n charCodeToOptimizedIdxMap[i] = i > 255 ? 255 + ~~(i / 255) : i\n }\n }\n}\n","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n","import isEmpty from \"lodash/isEmpty\"\nimport compact from \"lodash/compact\"\nimport isArray from \"lodash/isArray\"\nimport flatten from \"lodash/flatten\"\nimport difference from \"lodash/difference\"\nimport map from \"lodash/map\"\nimport forEach from \"lodash/forEach\"\nimport has from \"lodash/has\"\nimport includes from \"lodash/includes\"\nimport clone from \"lodash/clone\"\nimport { IToken, TokenType } from \"@chevrotain/types\"\n\nexport function tokenStructuredMatcher(\n tokInstance: IToken,\n tokConstructor: TokenType\n) {\n const instanceType = tokInstance.tokenTypeIdx\n if (instanceType === tokConstructor.tokenTypeIdx) {\n return true\n } else {\n return (\n tokConstructor.isParent === true &&\n tokConstructor.categoryMatchesMap![instanceType] === true\n )\n }\n}\n\n// Optimized tokenMatcher in case our grammar does not use token categories\n// Being so tiny it is much more likely to be in-lined and this avoid the function call overhead\nexport function tokenStructuredMatcherNoCategories(\n token: IToken,\n tokType: TokenType\n) {\n return token.tokenTypeIdx === tokType.tokenTypeIdx\n}\n\nexport let tokenShortNameIdx = 1\nexport const tokenIdxToClass: { [tokenIdx: number]: TokenType } = {}\n\nexport function augmentTokenTypes(tokenTypes: TokenType[]): void {\n // collect the parent Token Types as well.\n const tokenTypesAndParents = expandCategories(tokenTypes)\n\n // add required tokenType and categoryMatches properties\n assignTokenDefaultProps(tokenTypesAndParents)\n\n // fill up the categoryMatches\n assignCategoriesMapProp(tokenTypesAndParents)\n assignCategoriesTokensProp(tokenTypesAndParents)\n\n forEach(tokenTypesAndParents, (tokType) => {\n tokType.isParent = tokType.categoryMatches!.length > 0\n })\n}\n\nexport function expandCategories(tokenTypes: TokenType[]): TokenType[] {\n let result = clone(tokenTypes)\n\n let categories = tokenTypes\n let searching = true\n while (searching) {\n categories = compact(\n flatten(map(categories, (currTokType) => currTokType.CATEGORIES))\n )\n\n const newCategories = difference(categories, result)\n\n result = result.concat(newCategories)\n\n if (isEmpty(newCategories)) {\n searching = false\n } else {\n categories = newCategories\n }\n }\n return result\n}\n\nexport function assignTokenDefaultProps(tokenTypes: TokenType[]): void {\n forEach(tokenTypes, (currTokType) => {\n if (!hasShortKeyProperty(currTokType)) {\n tokenIdxToClass[tokenShortNameIdx] = currTokType\n ;(<any>currTokType).tokenTypeIdx = tokenShortNameIdx++\n }\n\n // CATEGORIES? : TokenType | TokenType[]\n if (\n hasCategoriesProperty(currTokType) &&\n !isArray(currTokType.CATEGORIES)\n // &&\n // !isUndefined(currTokType.CATEGORIES.PATTERN)\n ) {\n currTokType.CATEGORIES = [currTokType.CATEGORIES as unknown as TokenType]\n }\n\n if (!hasCategoriesProperty(currTokType)) {\n currTokType.CATEGORIES = []\n }\n\n if (!hasExtendingTokensTypesProperty(currTokType)) {\n currTokType.categoryMatches = []\n }\n\n if (!hasExtendingTokensTypesMapProperty(currTokType)) {\n currTokType.categoryMatchesMap = {}\n }\n })\n}\n\nexport function assignCategoriesTokensProp(tokenTypes: TokenType[]): void {\n forEach(tokenTypes, (currTokType) => {\n // avoid duplications\n currTokType.categoryMatches = []\n forEach(currTokType.categoryMatchesMap!, (val, key) => {\n currTokType.categoryMatches!.push(\n tokenIdxToClass[key as unknown as number].tokenTypeIdx!\n )\n })\n })\n}\n\nexport function assignCategoriesMapProp(tokenTypes: TokenType[]): void {\n forEach(tokenTypes, (currTokType) => {\n singleAssignCategoriesToksMap([], currTokType)\n })\n}\n\nexport function singleAssignCategoriesToksMap(\n path: TokenType[],\n nextNode: TokenType\n): void {\n forEach(path, (pathNode) => {\n nextNode.categoryMatchesMap![pathNode.tokenTypeIdx!] = true\n })\n\n forEach(nextNode.CATEGORIES, (nextCategory) => {\n const newPath = path.concat(nextNode)\n // avoids infinite loops due to cyclic categories.\n if (!includes(newPath, nextCategory)) {\n singleAssignCategoriesToksMap(newPath, nextCategory)\n }\n })\n}\n\nexport function hasShortKeyProperty(tokType: TokenType): boolean {\n return has(tokType, \"tokenTypeIdx\")\n}\n\nexport function hasCategoriesProperty(tokType: TokenType): boolean {\n return has(tokType, \"CATEGORIES\")\n}\n\nexport function hasExtendingTokensTypesProperty(tokType: TokenType): boolean {\n return has(tokType, \"categoryMatches\")\n}\n\nexport function hasExtendingTokensTypesMapProperty(\n tokType: TokenType\n): boolean {\n return has(tokType, \"categoryMatchesMap\")\n}\n\nexport function isTokenType(tokType: TokenType): boolean {\n return has(tokType, \"tokenTypeIdx\")\n}\n","import { ILexerErrorMessageProvider, IToken } from \"@chevrotain/types\"\n\nexport const defaultLexerErrorProvider: ILexerErrorMessageProvider = {\n buildUnableToPopLexerModeMessage(token: IToken): string {\n return `Unable to pop Lexer Mode after encountering Token ->${token.image}<- The Mode Stack is empty`\n },\n\n buildUnexpectedCharactersMessage(\n fullText: string,\n startOffset: number,\n length: number,\n line?: number,\n column?: number\n ): string {\n return (\n `unexpected character: ->${fullText.charAt(\n startOffset\n )}<- at offset: ${startOffset},` + ` skipped ${length} characters.`\n )\n }\n}\n","import {\n analyzeTokenTypes,\n charCodeToOptimizedIndex,\n cloneEmptyGroups,\n DEFAULT_MODE,\n IAnalyzeResult,\n IPatternConfig,\n LineTerminatorOptimizedTester,\n performRuntimeChecks,\n performWarningRuntimeChecks,\n SUPPORT_STICKY,\n validatePatterns\n} from \"./lexer\"\nimport noop from \"lodash/noop\"\nimport isEmpty from \"lodash/isEmpty\"\nimport isArray from \"lodash/isArray\"\nimport last from \"lodash/last\"\nimport reject from \"lodash/reject\"\nimport map from \"lodash/map\"\nimport forEach from \"lodash/forEach\"\nimport keys from \"lodash/keys\"\nimport isUndefined from \"lodash/isUndefined\"\nimport identity from \"lodash/identity\"\nimport assign from \"lodash/assign\"\nimport reduce from \"lodash/reduce\"\nimport clone from \"lodash/clone\"\nimport { PRINT_WARNING, timer, toFastProperties } from \"@chevrotain/utils\"\nimport { augmentTokenTypes } from \"./tokens\"\nimport {\n CustomPatternMatcherFunc,\n CustomPatternMatcherReturn,\n ILexerConfig,\n ILexerDefinitionError,\n ILexingError,\n IMultiModeLexerDefinition,\n IToken,\n TokenType\n} from \"@chevrotain/types\"\nimport { defaultLexerErrorProvider } from \"./lexer_errors_public\"\nimport { clearRegExpParserCache } from \"./reg_exp_parser\"\n\nexport interface ILexingResult {\n tokens: IToken[]\n groups: { [groupName: string]: IToken[] }\n errors: ILexingError[]\n}\n\nexport enum LexerDefinitionErrorType {\n MISSING_PATTERN,\n INVALID_PATTERN,\n EOI_ANCHOR_FOUND,\n UNSUPPORTED_FLAGS_FOUND,\n DUPLICATE_PATTERNS_FOUND,\n INVALID_GROUP_TYPE_FOUND,\n PUSH_MODE_DOES_NOT_EXIST,\n MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE,\n MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY,\n MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST,\n LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED,\n SOI_ANCHOR_FOUND,\n EMPTY_MATCH_PATTERN,\n NO_LINE_BREAKS_FLAGS,\n UNREACHABLE_PATTERN,\n IDENTIFY_TERMINATOR,\n CUSTOM_LINE_BREAK,\n MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE\n}\n\nexport interface IRegExpExec {\n exec: CustomPatternMatcherFunc\n}\n\nconst DEFAULT_LEXER_CONFIG: Required<ILexerConfig> = {\n deferDefinitionErrorsHandling: false,\n positionTracking: \"full\",\n lineTerminatorsPattern: /\\n|\\r\\n?/g,\n lineTerminatorCharacters: [\"\\n\", \"\\r\"],\n ensureOptimizations: false,\n safeMode: false,\n errorMessageProvider: defaultLexerErrorProvider,\n traceInitPerf: false,\n skipValidations: false,\n recoveryEnabled: true\n}\n\nObject.freeze(DEFAULT_LEXER_CONFIG)\n\nexport class Lexer {\n public static SKIPPED =\n \"This marks a skipped Token pattern, this means each token identified by it will\" +\n \"be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.\"\n\n public static NA = /NOT_APPLICABLE/\n public lexerDefinitionErrors: ILexerDefinitionError[] = []\n public lexerDefinitionWarning: ILexerDefinitionError[] = []\n\n protected patternIdxToConfig: Record<string, IPatternConfig[]> = {}\n protected charCodeToPatternIdxToConfig: {\n [modeName: string]: { [charCode: number]: IPatternConfig[] }\n } = {}\n\n protected modes: string[] = []\n protected defaultMode!: string\n protected emptyGroups: { [groupName: string]: IToken } = {}\n\n private config: Required<ILexerConfig>\n private trackStartLines: boolean = true\n private trackEndLines: boolean = true\n private hasCustom: boolean = false\n private canModeBeOptimized: Record<string, boolean> = {}\n\n private traceInitPerf!: boolean | number\n private traceInitMaxIdent!: number\n private traceInitIndent: number\n\n constructor(\n protected lexerDefinition: TokenType[] | IMultiModeLexerDefinition,\n config: ILexerConfig = DEFAULT_LEXER_CONFIG\n ) {\n if (typeof config === \"boolean\") {\n throw Error(\n \"The second argument to the Lexer constructor is now an ILexerConfig Object.\\n\" +\n \"a boolean 2nd argument is no longer supported\"\n )\n }\n\n // todo: defaults func?\n this.config = assign({}, DEFAULT_LEXER_CONFIG, config) as any\n\n const traceInitVal = this.config.traceInitPerf\n if (traceInitVal === true) {\n this.traceInitMaxIdent = Infinity\n this.traceInitPerf = true\n } else if (typeof traceInitVal === \"number\") {\n this.traceInitMaxIdent = traceInitVal\n this.traceInitPerf = true\n }\n this.traceInitIndent = -1\n\n this.TRACE_INIT(\"Lexer Constructor\", () => {\n let actualDefinition!: IMultiModeLexerDefinition\n let hasOnlySingleMode = true\n this.TRACE_INIT(\"Lexer Config handling\", () => {\n if (\n this.config.lineTerminatorsPattern ===\n DEFAULT_LEXER_CONFIG.lineTerminatorsPattern\n ) {\n // optimized built-in implementation for the defaults definition of lineTerminators\n this.config.lineTerminatorsPattern = LineTerminatorOptimizedTester\n } else {\n if (\n this.config.lineTerminatorCharacters ===\n DEFAULT_LEXER_CONFIG.lineTerminatorCharacters\n ) {\n throw Error(\n \"Error: Missing <lineTerminatorCharacters> property on the Lexer config.\\n\" +\n \"\\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS\"\n )\n }\n }\n\n if (config.safeMode && config.ensureOptimizations) {\n throw Error(\n '\"safeMode\" and \"ensureOptimizations\" flags are mutually exclusive.'\n )\n }\n\n this.trackStartLines = /full|onlyStart/i.test(\n this.config.positionTracking\n )\n this.trackEndLines = /full/i.test(this.config.positionTracking)\n\n // Convert SingleModeLexerDefinition into a IMultiModeLexerDefinition.\n if (isArray(lexerDefinition)) {\n actualDefinition = {\n modes: { defaultMode: clone(lexerDefinition) },\n defaultMode: DEFAULT_MODE\n }\n } else {\n // no conversion needed, input should already be a IMultiModeLexerDefinition\n hasOnlySingleMode = false\n actualDefinition = clone(<IMultiModeLexerDefinition>lexerDefinition)\n }\n })\n\n if (this.config.skipValidations === false) {\n this.TRACE_INIT(\"performRuntimeChecks\", () => {\n this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(\n performRuntimeChecks(\n actualDefinition,\n this.trackStartLines,\n this.config.lineTerminatorCharacters\n )\n )\n })\n\n this.TRACE_INIT(\"performWarningRuntimeChecks\", () => {\n this.lexerDefinitionWarning = this.lexerDefinitionWarning.concat(\n performWarningRuntimeChecks(\n actualDefinition,\n this.trackStartLines,\n this.config.lineTerminatorCharacters\n )\n )\n })\n }\n\n // for extra robustness to avoid throwing an none informative error message\n actualDefinition.modes = actualDefinition.modes\n ? actualDefinition.modes\n : {}\n\n // an error of undefined TokenTypes will be detected in \"performRuntimeChecks\" above.\n // this transformation is to increase robustness in the case of partially invalid lexer definition.\n forEach(actualDefinition.modes, (currModeValue, currModeName) => {\n actualDefinition.modes[currModeName] = reject<TokenType>(\n currModeValue,\n (currTokType) => isUndefined(currTokType)\n )\n })\n\n const allModeNames = keys(actualDefinition.modes)\n\n forEach(\n actualDefinition.modes,\n (currModDef: TokenType[], currModName) => {\n this.TRACE_INIT(`Mode: <${currModName}> processing`, () => {\n this.modes.push(currModName)\n\n if (this.config.skipValidations === false) {\n this.TRACE_INIT(`validatePatterns`, () => {\n this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(\n validatePatterns(currModDef, allModeNames)\n )\n })\n }\n\n // If definition errors were encountered, the analysis phase may fail unexpectedly/\n // Considering a lexer with definition errors may never be used, there is no point\n // to performing the analysis anyhow...\n if (isEmpty(this.lexerDefinitionErrors)) {\n augmentTokenTypes(currModDef)\n\n let currAnalyzeResult!: IAnalyzeResult\n this.TRACE_INIT(`analyzeTokenTypes`, () => {\n currAnalyzeResult = analyzeTokenTypes(currModDef, {\n lineTerminatorCharacters:\n this.config.lineTerminatorCharacters,\n positionTracking: config.positionTracking,\n ensureOptimizations: config.ensureOptimizations,\n safeMode: config.safeMode,\n tracer: this.TRACE_INIT\n })\n })\n\n this.patternIdxToConfig[currModName] =\n currAnalyzeResult.patternIdxToConfig\n\n this.charCodeToPatternIdxToConfig[currModName] =\n currAnalyzeResult.charCodeToPatternIdxToConfig\n\n this.emptyGroups = assign(\n {},\n this.emptyGroups,\n currAnalyzeResult.emptyGroups\n ) as any\n\n this.hasCustom = currAnalyzeResult.hasCustom || this.hasCustom\n\n this.canModeBeOptimized[currModName] =\n currAnalyzeResult.canBeOptimized\n }\n })\n }\n )\n\n this.defaultMode = actualDefinition.defaultMode\n\n if (\n !isEmpty(this.lexerDefinitionErrors) &&\n !this.config.deferDefinitionErrorsHandling\n ) {\n const allErrMessages = map(this.lexerDefinitionErrors, (error) => {\n return error.message\n })\n const allErrMessagesString = allErrMessages.join(\n \"-----------------------\\n\"\n )\n throw new Error(\n \"Errors detected in definition of Lexer:\\n\" + allErrMessagesString\n )\n }\n\n // Only print warning if there are no errors, This will avoid pl\n forEach(this.lexerDefinitionWarning, (warningDescriptor) => {\n PRINT_WARNING(warningDescriptor.message)\n })\n\n this.TRACE_INIT(\"Choosing sub-methods implementations\", () => {\n // Choose the relevant internal implementations for this specific parser.\n // These implementations should be in-lined by the JavaScript engine\n // to provide optimal performance in each scenario.\n if (SUPPORT_STICKY) {\n this.chopInput = <any>identity\n this.match = this.matchWithTest\n } else {\n this.updateLastIndex = noop\n this.match = this.matchWithExec\n }\n\n if (hasOnlySingleMode) {\n this.handleModes = noop\n }\n\n if (this.trackStartLines === false) {\n this.computeNewColumn = identity\n }\n\n if (this.trackEndLines === false) {\n this.updateTokenEndLineColumnLocation = noop\n }\n\n if (/full/i.test(this.config.positionTracking)) {\n this.createTokenInstance = this.createFullToken\n } else if (/onlyStart/i.test(this.config.positionTracking)) {\n this.createTokenInstance = this.createStartOnlyToken\n } else if (/onlyOffset/i.test(this.config.positionTracking)) {\n this.createTokenInstance = this.createOffsetOnlyToken\n } else {\n throw Error(\n `Invalid <positionTracking> config option: \"${this.config.positionTracking}\"`\n )\n }\n\n if (this.hasCustom) {\n this.addToken = this.addTokenUsingPush\n this.handlePayload = this.handlePayloadWithCustom\n } else {\n this.addToken = this.addTokenUsingMemberAccess\n this.handlePayload = this.handlePayloadNoCustom\n }\n })\n\n this.TRACE_INIT(\"Failed Optimization Warnings\", () => {\n const unOptimizedModes = reduce(\n this.canModeBeOptimized,\n (cannotBeOptimized, canBeOptimized, modeName) => {\n if (canBeOptimized === false) {\n cannotBeOptimized.push(modeName)\n }\n return cannotBeOptimized\n },\n [] as string[]\n )\n\n if (config.ensureOptimizations && !isEmpty(unOptimizedModes)) {\n throw Error(\n `Lexer Modes: < ${unOptimizedModes.join(\n \", \"\n )} > cannot be optimized.\\n` +\n '\\t Disable the \"ensureOptimizations\" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\\n' +\n \"\\t Or inspect the console log for details on how to resolve these issues.\"\n )\n }\n })\n\n this.TRACE_INIT(\"clearRegExpParserCache\", () => {\n clearRegExpParserCache()\n })\n\n this.TRACE_INIT(\"toFastProperties\", () => {\n toFastProperties(this)\n })\n })\n }\n\n public tokenize(\n text: string,\n initialMode: string = this.defaultMode\n ): ILexingResult {\n if (!isEmpty(this.lexerDefinitionErrors)) {\n const allErrMessages = map(this.lexerDefinitionErrors, (error) => {\n return error.message\n })\n const allErrMessagesString = allErrMessages.join(\n \"-----------------------\\n\"\n )\n throw new Error(\n \"Unable to Tokenize because Errors detected in definition of Lexer:\\n\" +\n allErrMessagesString\n )\n }\n\n return this.tokenizeInternal(text, initialMode)\n }\n\n // There is quite a bit of duplication between this and \"tokenizeInternalLazy\"\n // This is intentional due to performance considerations.\n // this method also used quite a bit of `!` none null assertions because it is too optimized\n // for `tsc` to always understand it is \"safe\"\n private tokenizeInternal(text: string, initialMode: string): ILexingResult {\n let i,\n j,\n k,\n matchAltImage,\n longerAlt,\n matchedImage: string | null,\n payload,\n altPayload,\n imageLength,\n group,\n tokType,\n newToken: IToken,\n errLength,\n droppedChar,\n msg,\n match\n const orgText = text\n const orgLength = orgText.length\n let offset = 0\n let matchedTokensIndex = 0\n // initializing the tokensArray to the \"guessed\" size.\n // guessing too little will still reduce the number of array re-sizes on pushes.\n // guessing too large (Tested by guessing x4 too large) may cost a bit more of memory\n // but would still have a faster runtime by avoiding (All but one) array resizing.\n const guessedNumberOfTokens = this.hasCustom\n ? 0 // will break custom token pattern APIs the matchedTokens array will contain undefined elements.\n : Math.floor(text.length / 10)\n const matchedTokens = new Array(guessedNumberOfTokens)\n const errors: ILexingError[] = []\n let line = this.trackStartLines ? 1 : undefined\n let column = this.trackStartLines ? 1 : undefined\n const groups: any = cloneEmptyGroups(this.emptyGroups)\n const trackLines = this.trackStartLines\n const lineTerminatorPattern = this.config.lineTerminatorsPattern\n\n let currModePatternsLength = 0\n let patternIdxToConfig: IPatternConfig[] = []\n let currCharCodeToPatternIdxToConfig: {\n [charCode: number]: IPatternConfig[]\n } = []\n\n const modeStack: string[] = []\n\n const emptyArray: IPatternConfig[] = []\n Object.freeze(emptyArray)\n let getPossiblePatterns!: (charCode: number) => IPatternConfig[]\n\n function getPossiblePatternsSlow() {\n return patternIdxToConfig\n }\n\n function getPossiblePatternsOptimized(charCode: number): IPatternConfig[] {\n const optimizedCharIdx = charCodeToOptimizedIndex(charCode)\n const possiblePatterns =\n currCharCodeToPatternIdxToConfig[optimizedCharIdx]\n if (possiblePatterns === undefined) {\n return emptyArray\n } else {\n return possiblePatterns\n }\n }\n\n const pop_mode = (popToken: IToken) => {\n // TODO: perhaps avoid this error in the edge case there is no more input?\n if (\n modeStack.length === 1 &&\n // if we have both a POP_MODE and a PUSH_MODE this is in-fact a \"transition\"\n // So no error should occur.\n popToken.tokenType.PUSH_MODE === undefined\n ) {\n // if we try to pop the last mode there lexer will no longer have ANY mode.\n // thus the pop is ignored, an error will be created and the lexer will continue parsing in the previous mode.\n const msg =\n this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(\n popToken\n )\n\n errors.push({\n offset: popToken.startOffset,\n line: popToken.startLine,\n column: popToken.startColumn,\n length: popToken.image.length,\n message: msg\n })\n } else {\n modeStack.pop()\n const newMode = last(modeStack)!\n patternIdxToConfig = this.patternIdxToConfig[newMode]\n currCharCodeToPatternIdxToConfig =\n this.charCodeToPatternIdxToConfig[newMode]\n currModePatternsLength = patternIdxToConfig.length\n const modeCanBeOptimized =\n this.canModeBeOptimized[newMode] && this.config.safeMode === false\n\n if (currCharCodeToPatternIdxToConfig && modeCanBeOptimized) {\n getPossiblePatterns = getPossiblePatternsOptimized\n } else {\n getPossiblePatterns = getPossiblePatternsSlow\n }\n }\n }\n\n function push_mode(this: Lexer, newMode: string) {\n modeStack.push(newMode)\n currCharCodeToPatternIdxToConfig =\n this.charCodeToPatternIdxToConfig[newMode]\n\n patternIdxToConfig = this.patternIdxToConfig[newMode]\n currModePatternsLength = patternIdxToConfig.length\n\n currModePatternsLength = patternIdxToConfig.length\n const modeCanBeOptimized =\n this.canModeBeOptimized[newMode] && this.config.safeMode === false\n\n if (currCharCodeToPatternIdxToConfig && modeCanBeOptimized) {\n getPossiblePatterns = getPossiblePatternsOptimized\n } else {\n getPossiblePatterns = getPossiblePatternsSlow\n }\n }\n\n // this pattern seems to avoid a V8 de-optimization, although that de-optimization does not\n // seem to matter performance wise.\n push_mode.call(this, initialMode)\n\n let currConfig!: IPatternConfig\n\n const recoveryEnabled = this.config.recoveryEnabled\n\n while (offset < orgLength) {\n matchedImage = null\n\n const nextCharCode = orgText.charCodeAt(offset)\n const chosenPatternIdxToConfig = getPossiblePatterns(nextCharCode)\n const chosenPatternsLength = chosenPatternIdxToConfig.length\n\n for (i = 0; i < chosenPatternsLength; i++) {\n currConfig = chosenPatternIdxToConfig[i]\n const currPattern = currConfig.pattern\n payload = null\n\n // manually in-lined because > 600 chars won't be in-lined in V8\n const singleCharCode = currConfig.short\n if (singleCharCode !== false) {\n if (nextCharCode === singleCharCode) {\n // single character string\n matchedImage = currPattern as string\n }\n } else if (currConfig.isCustom === true) {\n match = (currPattern as IRegExpExec).exec(\n orgText,\n offset,\n matchedTokens,\n groups\n )\n if (match !== null) {\n matchedImage = match[0]\n if ((match as CustomPatternMatcherReturn).payload !== undefined) {\n payload = (match as CustomPatternMatcherReturn).payload\n }\n } else {\n matchedImage = null\n }\n } else {\n this.updateLastIndex(currPattern as RegExp, offset)\n matchedImage = this.match(currPattern as RegExp, text, offset)\n }\n\n if (matchedImage !== null) {\n // even though this pattern matched we must try a another longer alternative.\n // this can be used to prioritize keywords over identifiers\n longerAlt = currConfig.longerAlt\n if (longerAlt !== undefined) {\n // TODO: micro optimize, avoid extra prop access\n // by saving/linking longerAlt on the original config?\n const longerAltLength = longerAlt.length\n for (k = 0; k < longerAltLength; k++) {\n const longerAltConfig = patternIdxToConfig[longerAlt[k]]\n const longerAltPattern = longerAltConfig.pattern\n altPayload = null\n\n // single Char can never be a longer alt so no need to test it.\n // manually in-lined because > 600 chars won't be in-lined in V8\n if (longerAltConfig.isCustom === true) {\n match = (longerAltPattern as IRegExpExec).exec(\n orgText,\n offset,\n matchedTokens,\n groups\n )\n if (match !== null) {\n matchAltImage = match[0]\n if (\n (match as CustomPatternMatcherReturn).payload !== undefined\n ) {\n altPayload = (match as CustomPatternMatcherReturn).payload\n }\n } else {\n matchAltImage = null\n }\n } else {\n this.updateLastIndex(longerAltPattern as RegExp, offset)\n matchAltImage = this.match(\n longerAltPattern as RegExp,\n text,\n offset\n )\n }\n\n if (matchAltImage && matchAltImage.length > matchedImage.length) {\n matchedImage = matchAltImage\n payload = altPayload\n currConfig = longerAltConfig\n // Exit the loop early after matching one of the longer alternatives\n // The first matched alternative takes precedence\n break\n }\n }\n }\n break\n }\n }\n\n // successful match\n if (matchedImage !== null) {\n imageLength = matchedImage.length\n group = currConfig.group\n if (group !== undefined) {\n tokType = currConfig.tokenTypeIdx\n // TODO: \"offset + imageLength\" and the new column may be computed twice in case of \"full\" location information inside\n // createFullToken method\n newToken = this.createTokenInstance(\n matchedImage,\n offset,\n tokType,\n currConfig.tokenType,\n line,\n column,\n imageLength\n )\n\n this.handlePayload(newToken, payload)\n\n // TODO: optimize NOOP in case there are no special groups?\n if (group === false) {\n matchedTokensIndex = this.addToken(\n matchedTokens,\n matchedTokensIndex,\n newToken\n )\n } else {\n groups[group].push(newToken)\n }\n }\n text = this.chopInput(text, imageLength)\n offset = offset + imageLength\n\n // TODO: with newlines the column may be assigned twice\n column = this.computeNewColumn(column!, imageLength)\n\n if (trackLines === true && currConfig.canLineTerminator === true) {\n let numOfLTsInMatch = 0\n let foundTerminator\n let lastLTEndOffset: number\n lineTerminatorPattern.lastIndex = 0\n do {\n foundTerminator = lineTerminatorPattern.test(matchedImage)\n if (foundTerminator === true) {\n lastLTEndOffset = lineTerminatorPattern.lastIndex - 1\n numOfLTsInMatch++\n }\n } while (foundTerminator === true)\n\n if (numOfLTsInMatch !== 0) {\n line = line! + numOfLTsInMatch\n column = imageLength - lastLTEndOffset!\n this.updateTokenEndLineColumnLocation(\n newToken!,\n group!,\n lastLTEndOffset!,\n numOfLTsInMatch,\n line,\n column,\n imageLength\n )\n }\n }\n // will be NOOP if no modes present\n this.handleModes(currConfig, pop_mode, push_mode, newToken!)\n } else {\n // error recovery, drop characters until we identify a valid token's start point\n const errorStartOffset = offset\n const errorLine = line\n const errorColumn = column\n let foundResyncPoint = recoveryEnabled === false\n\n while (foundResyncPoint === false && offset < orgLength) {\n // Identity Func (when sticky flag is enabled)\n text = this.chopInput(text, 1)\n offset++\n for (j = 0; j < currModePatternsLength; j++) {\n const currConfig = patternIdxToConfig[j]\n const currPattern = currConfig.pattern\n\n // manually in-lined because > 600 chars won't be in-lined in V8\n const singleCharCode = currConfig.short\n if (singleCharCode !== false) {\n if (orgText.charCodeAt(offset) === singleCharCode) {\n // single character string\n foundResyncPoint = true\n }\n } else if (currConfig.isCustom === true) {\n foundResyncPoint =\n (currPattern as IRegExpExec).exec(\n orgText,\n offset,\n matchedTokens,\n groups\n ) !== null\n } else {\n this.updateLastIndex(currPattern as RegExp, offset)\n foundResyncPoint = (currPattern as RegExp).exec(text) !== null\n }\n\n if (foundResyncPoint === true) {\n break\n }\n }\n }\n\n errLength = offset - errorStartOffset\n // at this point we either re-synced or reached the end of the input text\n msg = this.config.errorMessageProvider.buildUnexpectedCharactersMessage(\n orgText,\n errorStartOffset,\n errLength,\n errorLine,\n errorColumn\n )\n errors.push({\n offset: errorStartOffset,\n line: errorLine,\n column: errorColumn,\n length: errLength,\n message: msg\n })\n\n if (recoveryEnabled === false) {\n break\n }\n }\n }\n\n // if we do have custom patterns which push directly into the\n // TODO: custom tokens should not push directly??\n if (!this.hasCustom) {\n // if we guessed a too large size for the tokens array this will shrink it to the right size.\n matchedTokens.length = matchedTokensIndex\n }\n\n return {\n tokens: matchedTokens,\n groups: groups,\n errors: errors\n }\n }\n\n private handleModes(\n config: IPatternConfig,\n pop_mode: (tok: IToken) => void,\n push_mode: (this: Lexer, pushMode: string) => void,\n newToken: IToken\n ) {\n if (config.pop === true) {\n // need to save the PUSH_MODE property as if the mode is popped\n // patternIdxToPopMode is updated to reflect the new mode after popping the stack\n const pushMode = config.push\n pop_mode(newToken)\n if (pushMode !== undefined) {\n push_mode.call(this, pushMode)\n }\n } else if (config.push !== undefined) {\n push_mode.call(this, config.push)\n }\n }\n\n private chopInput(text: string, length: number): string {\n return text.substring(length)\n }\n\n private updateLastIndex(regExp: RegExp, newLastIndex: number): void {\n regExp.lastIndex = newLastIndex\n }\n\n // TODO: decrease this under 600 characters? inspect stripping comments option in TSC compiler\n private updateTokenEndLineColumnLocation(\n newToken: IToken,\n group: string | false,\n lastLTIdx: number,\n numOfLTsInMatch: number,\n line: number,\n column: number,\n imageLength: number\n ): void {\n let lastCharIsLT, fixForEndingInLT\n if (group !== undefined) {\n // a none skipped multi line Token, need to update endLine/endColumn\n lastCharIsLT = lastLTIdx === imageLength - 1\n fixForEndingInLT = lastCharIsLT ? -1 : 0\n if (!(numOfLTsInMatch === 1 && lastCharIsLT === true)) {\n // if a token ends in a LT that last LT only affects the line numbering of following Tokens\n newToken.endLine = line + fixForEndingInLT\n // the last LT in a token does not affect the endColumn either as the [columnStart ... columnEnd)\n // inclusive to exclusive range.\n newToken.endColumn = column - 1 + -fixForEndingInLT\n }\n // else single LT in the last character of a token, no need to modify the endLine/EndColumn\n }\n }\n\n private computeNewColumn(oldColumn: number, imageLength: number) {\n return oldColumn + imageLength\n }\n\n // Place holder, will be replaced by the correct variant according to the locationTracking option at runtime.\n /* istanbul ignore next - place holder */\n private createTokenInstance!: (...args: any[]) => IToken\n\n private createOffsetOnlyToken(\n image: string,\n startOffset: number,\n tokenTypeIdx: number,\n tokenType: TokenType\n ) {\n return {\n image,\n startOffset,\n tokenTypeIdx,\n tokenType\n }\n }\n\n private createStartOnlyToken(\n image: string,\n startOffset: number,\n tokenTypeIdx: number,\n tokenType: TokenType,\n startLine: number,\n startColumn: number\n ) {\n return {\n image,\n startOffset,\n startLine,\n startColumn,\n tokenTypeIdx,\n tokenType\n }\n }\n\n private createFullToken(\n image: string,\n startOffset: number,\n tokenTypeIdx: number,\n tokenType: TokenType,\n startLine: number,\n startColumn: number,\n imageLength: number\n ): IToken {\n return {\n image,\n startOffset,\n endOffset: startOffset + imageLength - 1,\n startLine,\n endLine: startLine,\n startColumn,\n endColumn: startColumn + imageLength - 1,\n tokenTypeIdx,\n tokenType\n }\n }\n\n // Place holder, will be replaced by the correct variant according to the locationTracking option at runtime.\n /* istanbul ignore next - place holder */\n private addToken!: (\n tokenVector: IToken[],\n index: number,\n tokenToAdd: IToken\n ) => number\n\n private addTokenUsingPush(\n tokenVector: IToken[],\n index: number,\n tokenToAdd: IToken\n ): number {\n tokenVector.push(tokenToAdd)\n return index\n }\n\n private addTokenUsingMemberAccess(\n tokenVector: IToken[],\n index: number,\n tokenToAdd: IToken\n ): number {\n tokenVector[index] = tokenToAdd\n index++\n return index\n }\n\n // Place holder, will be replaced by the correct variant according to the hasCustom flag option at runtime.\n private handlePayload: (token: IToken, payload: any) => void\n\n private handlePayloadNoCustom(token: IToken, payload: any): void {}\n\n private handlePayloadWithCustom(token: IToken, payload: any): void {\n if (payload !== null) {\n token.payload = payload\n }\n }\n\n // place holder to be replaced with chosen alternative at runtime\n private match!: (\n pattern: RegExp,\n text: string,\n offset: number\n ) => string | null\n\n private matchWithTest(\n pattern: RegExp,\n text: string,\n offset: number\n ): string | null {\n const found = pattern.test(text)\n if (found === true) {\n return text.substring(offset, pattern.lastIndex)\n }\n return null\n }\n\n private matchWithExec(pattern: RegExp, text: string): string | null {\n const regExpArray = pattern.exec(text)\n return regExpArray !== null ? regExpArray[0] : null\n }\n\n // Duplicated from the parser's perf trace trait to allow future extraction\n // of the lexer to a separate package.\n TRACE_INIT = <T>(phaseDesc: string, phaseImpl: () => T): T => {\n // No need to optimize this using NOOP pattern because\n // It is not called in a hot spot...\n if (this.traceInitPerf === true) {\n this.traceInitIndent++\n const indent = new Array(this.traceInitIndent + 1).join(\"\\t\")\n if (this.traceInitIndent < this.traceInitMaxIdent) {\n console.log(`${indent}--> <${phaseDesc}>`)\n }\n const { time, value } = timer(phaseImpl)\n /* istanbul ignore next - Difficult to reproduce specific performance behavior (>10ms) in tests */\n const traceMethod = time > 10 ? console.warn : console.log\n if (this.traceInitIndent < this.traceInitMaxIdent) {\n traceMethod(`${indent}<-- <${phaseDesc}> time: ${time}ms`)\n }\n this.traceInitIndent--\n return value\n } else {\n return phaseImpl()\n }\n }\n}\n","import isString from \"lodash/isString\"\nimport has from \"lodash/has\"\nimport isUndefined from \"lodash/isUndefined\"\nimport { Lexer } from \"./lexer_public\"\nimport { augmentTokenTypes, tokenStructuredMatcher } from \"./tokens\"\nimport { IToken, ITokenConfig, TokenType } from \"@chevrotain/types\"\n\nexport function tokenLabel(tokType: TokenType): string {\n if (hasTokenLabel(tokType)) {\n return tokType.LABEL\n } else {\n return tokType.name\n }\n}\n\nexport function tokenName(tokType: TokenType): string {\n return tokType.name\n}\n\nexport function hasTokenLabel(\n obj: TokenType\n): obj is TokenType & Pick<Required<TokenType>, \"LABEL\"> {\n return isString(obj.LABEL) && obj.LABEL !== \"\"\n}\n\nconst PARENT = \"parent\"\nconst CATEGORIES = \"categories\"\nconst LABEL = \"label\"\nconst GROUP = \"group\"\nconst PUSH_MODE = \"push_mode\"\nconst POP_MODE = \"pop_mode\"\nconst LONGER_ALT = \"longer_alt\"\nconst LINE_BREAKS = \"line_breaks\"\nconst START_CHARS_HINT = \"start_chars_hint\"\n\nexport function createToken(config: ITokenConfig): TokenType {\n return createTokenInternal(config)\n}\n\nfunction createTokenInternal(config: ITokenConfig): TokenType {\n const pattern = config.pattern\n\n const tokenType: TokenType = <any>{}\n tokenType.name = config.name\n\n if (!isUndefined(pattern)) {\n tokenType.PATTERN = pattern\n }\n\n if (has(config, PARENT)) {\n throw (\n \"The parent property is no longer supported.\\n\" +\n \"See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.\"\n )\n }\n\n if (has(config, CATEGORIES)) {\n // casting to ANY as this will be fixed inside `augmentTokenTypes``\n tokenType.CATEGORIES = <any>config[CATEGORIES]\n }\n\n augmentTokenTypes([tokenType])\n\n if (has(config, LABEL)) {\n tokenType.LABEL = config[LABEL]\n }\n\n if (has(config, GROUP)) {\n tokenType.GROUP = config[GROUP]\n }\n\n if (has(config, POP_MODE)) {\n tokenType.POP_MODE = config[POP_MODE]\n }\n\n if (has(config, PUSH_MODE)) {\n tokenType.PUSH_MODE = config[PUSH_MODE]\n }\n\n if (has(config, LONGER_ALT)) {\n tokenType.LONGER_ALT = config[LONGER_ALT]\n }\n\n if (has(config, LINE_BREAKS)) {\n tokenType.LINE_BREAKS = config[LINE_BREAKS]\n }\n\n if (has(config, START_CHARS_HINT)) {\n tokenType.START_CHARS_HINT = config[START_CHARS_HINT]\n }\n\n return tokenType\n}\n\nexport const EOF = createToken({ name: \"EOF\", pattern: Lexer.NA })\naugmentTokenTypes([EOF])\n\nexport function createTokenInstance(\n tokType: TokenType,\n image: string,\n startOffset: number,\n endOffset: number,\n startLine: number,\n endLine: number,\n startColumn: number,\n endColumn: number\n): IToken {\n return {\n image,\n startOffset,\n endOffset,\n startLine,\n endLine,\n startColumn,\n endColumn,\n tokenTypeIdx: (<any>tokType).tokenTypeIdx,\n tokenType: tokType\n }\n}\n\nexport function tokenMatcher(token: IToken, tokType: TokenType): boolean {\n return tokenStructuredMatcher(token, tokType)\n}\n","import { hasTokenLabel, tokenLabel } from \"../scan/tokens_public\"\nimport first from \"lodash/first\"\nimport map from \"lodash/map\"\nimport reduce from \"lodash/reduce\"\nimport { Alternation, NonTerminal, Rule, Terminal } from \"@chevrotain/gast\"\nimport { getProductionDslName } from \"@chevrotain/gast\"\nimport {\n IParserErrorMessageProvider,\n IProductionWithOccurrence,\n TokenType\n} from \"@chevrotain/types\"\nimport {\n IGrammarResolverErrorMessageProvider,\n IGrammarValidatorErrorMessageProvider\n} from \"./grammar/types\"\n\nexport const defaultParserErrorProvider: IParserErrorMessageProvider = {\n buildMismatchTokenMessage({ expected, actual, previous, ruleName }): string {\n const hasLabel = hasTokenLabel(expected)\n const expectedMsg = hasLabel\n ? `--> ${tokenLabel(expected)} <--`\n : `token of type --> ${expected.name} <--`\n\n const msg = `Expecting ${expectedMsg} but found --> '${actual.image}' <--`\n\n return msg\n },\n\n buildNotAllInputParsedMessage({ firstRedundant, ruleName }): string {\n return \"Redundant input, expecting EOF but found: \" + firstRedundant.image\n },\n\n buildNoViableAltMessage({\n expectedPathsPerAlt,\n actual,\n previous,\n customUserDescription,\n ruleName\n }): string {\n const errPrefix = \"Expecting: \"\n // TODO: issue: No Viable Alternative Error may have incomplete details. #502\n const actualText = first(actual)!.image\n const errSuffix = \"\\nbut found: '\" + actualText + \"'\"\n\n if (customUserDescription) {\n return errPrefix + customUserDescription + errSuffix\n } else {\n const allLookAheadPaths = reduce(\n expectedPathsPerAlt,\n (result, currAltPaths) => result.concat(currAltPaths),\n [] as TokenType[][]\n )\n const nextValidTokenSequences = map(\n allLookAheadPaths,\n (currPath) =>\n `[${map(currPath, (currTokenType) => tokenLabel(currTokenType)).join(\n \", \"\n )}]`\n )\n const nextValidSequenceItems = map(\n nextValidTokenSequences,\n (itemMsg, idx) => ` ${idx + 1}. ${itemMsg}`\n )\n const calculatedDescription = `one of these possible Token sequences:\\n${nextValidSequenceItems.join(\n \"\\n\"\n )}`\n\n return errPrefix + calculatedDescription + errSuffix\n }\n },\n\n buildEarlyExitMessage({\n expectedIterationPaths,\n actual,\n customUserDescription,\n ruleName\n }): string {\n const errPrefix = \"Expecting: \"\n // TODO: issue: No Viable Alternative Error may have incomplete details. #502\n const actualText = first(actual)!.image\n const errSuffix = \"\\nbut found: '\" + actualText + \"'\"\n\n if (customUserDescription) {\n return errPrefix + customUserDescription + errSuffix\n } else {\n const nextValidTokenSequences = map(\n expectedIterationPaths,\n (currPath) =>\n `[${map(currPath, (currTokenType) => tokenLabel(currTokenType)).join(\n \",\"\n )}]`\n )\n const calculatedDescription =\n `expecting at least one iteration which starts with one of these possible Token sequences::\\n ` +\n `<${nextValidTokenSequences.join(\" ,\")}>`\n\n return errPrefix + calculatedDescription + errSuffix\n }\n }\n}\n\nObject.freeze(defaultParserErrorProvider)\n\nexport const defaultGrammarResolverErrorProvider: IGrammarResolverErrorMessageProvider =\n {\n buildRuleNotFoundError(\n topLevelRule: Rule,\n undefinedRule: NonTerminal\n ): string {\n const msg =\n \"Invalid grammar, reference to a rule which is not defined: ->\" +\n undefinedRule.nonTerminalName +\n \"<-\\n\" +\n \"inside top level rule: ->\" +\n topLevelRule.name +\n \"<-\"\n return msg\n }\n }\n\nexport const defaultGrammarValidatorErrorProvider: IGrammarValidatorErrorMessageProvider =\n {\n buildDuplicateFoundError(\n topLevelRule: Rule,\n duplicateProds: IProductionWithOccurrence[]\n ): string {\n function getExtraProductionArgument(\n prod: IProductionWithOccurrence\n ): string {\n if (prod instanceof Terminal) {\n return prod.terminalType.name\n } else if (prod instanceof NonTerminal) {\n return prod.nonTerminalName\n } else {\n return \"\"\n }\n }\n\n const topLevelName = topLevelRule.name\n const duplicateProd = first(duplicateProds)!\n const index = duplicateProd.idx\n const dslName = getProductionDslName(duplicateProd)\n const extraArgument = getExtraProductionArgument(duplicateProd)\n\n const hasExplicitIndex = index > 0\n let msg = `->${dslName}${hasExplicitIndex ? index : \"\"}<- ${\n extraArgument ? `with argument: ->${extraArgument}<-` : \"\"\n }\n appears more than once (${\n duplicateProds.length\n } times) in the top level rule: ->${topLevelName}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `\n\n // white space trimming time! better to trim afterwards as it allows to use WELL formatted multi line template strings...\n msg = msg.replace(/[ \\t]+/g, \" \")\n msg = msg.replace(/\\s\\s+/g, \"\\n\")\n\n return msg\n },\n\n buildNamespaceConflictError(rule: Rule): string {\n const errMsg =\n `Namespace conflict found in grammar.\\n` +\n `The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${rule.name}>.\\n` +\n `To resolve this make sure each Terminal and Non-Terminal names are unique\\n` +\n `This is easy to accomplish by using the convention that Terminal names start with an uppercase letter\\n` +\n `and Non-Terminal names start with a lower case letter.`\n\n return errMsg\n },\n\n buildAlternationPrefixAmbiguityError(options: {\n topLevelRule: Rule\n prefixPath: TokenType[]\n ambiguityIndices: number[]\n alternation: Alternation\n }): string {\n const pathMsg = map(options.prefixPath, (currTok) =>\n tokenLabel(currTok)\n ).join(\", \")\n const occurrence =\n options.alternation.idx === 0 ? \"\" : options.alternation.idx\n const errMsg =\n `Ambiguous alternatives: <${options.ambiguityIndices.join(\n \" ,\"\n )}> due to common lookahead prefix\\n` +\n `in <OR${occurrence}> inside <${options.topLevelRule.name}> Rule,\\n` +\n `<${pathMsg}> may appears as a prefix path in all these alternatives.\\n` +\n `See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\\n` +\n `For Further details.`\n\n return errMsg\n },\n\n buildAlternationAmbiguityError(options: {\n topLevelRule: Rule\n prefixPath: TokenType[]\n ambiguityIndices: number[]\n alternation: Alternation\n }): string {\n const pathMsg = map(options.prefixPath, (currtok) =>\n tokenLabel(currtok)\n ).join(\", \")\n const occurrence =\n options.alternation.idx === 0 ? \"\" : options.alternation.idx\n let currMessage =\n `Ambiguous Alternatives Detected: <${options.ambiguityIndices.join(\n \" ,\"\n )}> in <OR${occurrence}>` +\n ` inside <${options.topLevelRule.name}> Rule,\\n` +\n `<${pathMsg}> may appears as a prefix path in all these alternatives.\\n`\n\n currMessage =\n currMessage +\n `See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\\n` +\n `For Further details.`\n return currMessage\n },\n\n buildEmptyRepetitionError(options: {\n topLevelRule: Rule\n repetition: IProductionWithOccurrence\n }): string {\n let dslName = getProductionDslName(options.repetition)\n if (options.repetition.idx !== 0) {\n dslName += options.repetition.idx\n }\n\n const errMsg =\n `The repetition <${dslName}> within Rule <${options.topLevelRule.name}> can never consume any tokens.\\n` +\n `This could lead to an infinite loop.`\n\n return errMsg\n },\n\n // TODO: remove - `errors_public` from nyc.config.js exclude\n // once this method is fully removed from this file\n buildTokenNameError(options: {\n tokenType: TokenType\n expectedPattern: RegExp\n }): string {\n /* istanbul ignore next */\n return \"deprecated\"\n },\n\n buildEmptyAlternationError(options: {\n topLevelRule: Rule\n alternation: Alternation\n emptyChoiceIdx: number\n }): string {\n const errMsg =\n `Ambiguous empty alternative: <${options.emptyChoiceIdx + 1}>` +\n ` in <OR${options.alternation.idx}> inside <${options.topLevelRule.name}> Rule.\\n` +\n `Only the last alternative may be an empty alternative.`\n\n return errMsg\n },\n\n buildTooManyAlternativesError(options: {\n topLevelRule: Rule\n alternation: Alternation\n }): string {\n const errMsg =\n `An Alternation cannot have more than 256 alternatives:\\n` +\n `<OR${options.alternation.idx}> inside <${\n options.topLevelRule.name\n }> Rule.\\n has ${\n options.alternation.definition.length + 1\n } alternatives.`\n\n return errMsg\n },\n\n buildLeftRecursionError(options: {\n topLevelRule: Rule\n leftRecursionPath: Rule[]\n }): string {\n const ruleName = options.topLevelRule.name\n const pathNames = map(\n options.leftRecursionPath,\n (currRule) => currRule.name\n )\n const leftRecursivePath = `${ruleName} --> ${pathNames\n .concat([ruleName])\n .join(\" --> \")}`\n const errMsg =\n `Left Recursion found in grammar.\\n` +\n `rule: <${ruleName}> can be invoked from itself (directly or indirectly)\\n` +\n `without consuming any Tokens. The grammar path that causes this is: \\n ${leftRecursivePath}\\n` +\n ` To fix this refactor your grammar to remove the left recursion.\\n` +\n `see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`\n\n return errMsg\n },\n\n // TODO: remove - `errors_public` from nyc.config.js exclude\n // once this method is fully removed from this file\n buildInvalidRuleNameError(options: {\n topLevelRule: Rule\n expectedPattern: RegExp\n }): string {\n /* istanbul ignore next */\n return \"deprecated\"\n },\n\n buildDuplicateRuleNameError(options: {\n topLevelRule: Rule | string\n grammarName: string\n }): string {\n let ruleName\n if (options.topLevelRule instanceof Rule) {\n ruleName = options.topLevelRule.name\n } else {\n ruleName = options.topLevelRule\n }\n\n const errMsg = `Duplicate definition, rule: ->${ruleName}<- is already defined in the grammar: ->${options.grammarName}<-`\n\n return errMsg\n }\n }\n","import {\n IParserUnresolvedRefDefinitionError,\n ParserDefinitionErrorType\n} from \"../parser/parser\"\nimport forEach from \"lodash/forEach\"\nimport values from \"lodash/values\"\nimport { NonTerminal, Rule } from \"@chevrotain/gast\"\nimport { GAstVisitor } from \"@chevrotain/gast\"\nimport {\n IGrammarResolverErrorMessageProvider,\n IParserDefinitionError\n} from \"./types\"\n\nexport function resolveGrammar(\n topLevels: Record<string, Rule>,\n errMsgProvider: IGrammarResolverErrorMessageProvider\n): IParserDefinitionError[] {\n const refResolver = new GastRefResolverVisitor(topLevels, errMsgProvider)\n refResolver.resolveRefs()\n return refResolver.errors\n}\n\nexport class GastRefResolverVisitor extends GAstVisitor {\n public errors: IParserUnresolvedRefDefinitionError[] = []\n private currTopLevel: Rule\n\n constructor(\n private nameToTopRule: Record<string, Rule>,\n private errMsgProvider: IGrammarResolverErrorMessageProvider\n ) {\n super()\n }\n\n public resolveRefs(): void {\n forEach(values(this.nameToTopRule), (prod) => {\n this.currTopLevel = prod\n prod.accept(this)\n })\n }\n\n public visitNonTerminal(node: NonTerminal): void {\n const ref = this.nameToTopRule[node.nonTerminalName]\n\n if (!ref) {\n const msg = this.errMsgProvider.buildRuleNotFoundError(\n this.currTopLevel,\n node\n )\n this.errors.push({\n message: msg,\n type: ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,\n ruleName: this.currTopLevel.name,\n unresolvedRefName: node.nonTerminalName\n })\n } else {\n node.referencedRule = ref\n }\n }\n}\n","/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayAggregator;\n","var baseEach = require('./_baseEach');\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseAggregator;\n","var arrayAggregator = require('./_arrayAggregator'),\n baseAggregator = require('./_baseAggregator'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray');\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n };\n}\n\nmodule.exports = createAggregator;\n","var baseAssignValue = require('./_baseAssignValue'),\n createAggregator = require('./_createAggregator');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n});\n\nmodule.exports = groupBy;\n","var baseFlatten = require('./_baseFlatten'),\n map = require('./map');\n\n/**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\nfunction flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n}\n\nmodule.exports = flatMap;\n","var baseSlice = require('./_baseSlice'),\n toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\nfunction dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n}\n\nmodule.exports = dropRight;\n","import { RestWalker } from \"./rest\"\nimport _first from \"lodash/first\"\nimport isEmpty from \"lodash/isEmpty\"\nimport dropRight from \"lodash/dropRight\"\nimport drop from \"lodash/drop\"\nimport last from \"lodash/last\"\nimport forEach from \"lodash/forEach\"\nimport clone from \"lodash/clone\"\nimport { first } from \"./first\"\nimport { TokenMatcher } from \"../parser/parser\"\nimport {\n Alternation,\n Alternative,\n NonTerminal,\n Option,\n Repetition,\n RepetitionMandatory,\n RepetitionMandatoryWithSeparator,\n RepetitionWithSeparator,\n Rule,\n Terminal\n} from \"@chevrotain/gast\"\nimport {\n IGrammarPath,\n IProduction,\n ISyntacticContentAssistPath,\n IToken,\n ITokenGrammarPath,\n TokenType\n} from \"@chevrotain/types\"\n\nexport abstract class AbstractNextPossibleTokensWalker extends RestWalker {\n protected possibleTokTypes: TokenType[] = []\n protected ruleStack: string[]\n protected occurrenceStack: number[]\n\n protected nextProductionName = \"\"\n protected nextProductionOccurrence = 0\n protected found = false\n protected isAtEndOfPath = false\n\n constructor(protected topProd: Rule, protected path: IGrammarPath) {\n super()\n }\n\n startWalking(): TokenType[] {\n this.found = false\n\n if (this.path.ruleStack[0] !== this.topProd.name) {\n throw Error(\"The path does not start with the walker's top Rule!\")\n }\n\n // immutable for the win\n this.ruleStack = clone(this.path.ruleStack).reverse() // intelij bug requires assertion\n this.occurrenceStack = clone(this.path.occurrenceStack).reverse() // intelij bug requires assertion\n\n // already verified that the first production is valid, we now seek the 2nd production\n this.ruleStack.pop()\n this.occurrenceStack.pop()\n\n this.updateExpectedNext()\n this.walk(this.topProd)\n\n return this.possibleTokTypes\n }\n\n walk(\n prod: { definition: IProduction[] },\n prevRest: IProduction[] = []\n ): void {\n // stop scanning once we found the path\n if (!this.found) {\n super.walk(prod, prevRest)\n }\n }\n\n walkProdRef(\n refProd: NonTerminal,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n // found the next production, need to keep walking in it\n if (\n refProd.referencedRule.name === this.nextProductionName &&\n refProd.idx === this.nextProductionOccurrence\n ) {\n const fullRest = currRest.concat(prevRest)\n this.updateExpectedNext()\n this.walk(refProd.referencedRule, <any>fullRest)\n }\n }\n\n updateExpectedNext(): void {\n // need to consume the Terminal\n if (isEmpty(this.ruleStack)) {\n // must reset nextProductionXXX to avoid walking down another Top Level production while what we are\n // really seeking is the last Terminal...\n this.nextProductionName = \"\"\n this.nextProductionOccurrence = 0\n this.isAtEndOfPath = true\n } else {\n this.nextProductionName = this.ruleStack.pop()!\n this.nextProductionOccurrence = this.occurrenceStack.pop()!\n }\n }\n}\n\nexport class NextAfterTokenWalker extends AbstractNextPossibleTokensWalker {\n private nextTerminalName = \"\"\n private nextTerminalOccurrence = 0\n\n constructor(topProd: Rule, protected path: ITokenGrammarPath) {\n super(topProd, path)\n this.nextTerminalName = this.path.lastTok.name\n this.nextTerminalOccurrence = this.path.lastTokOccurrence\n }\n\n walkTerminal(\n terminal: Terminal,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n if (\n this.isAtEndOfPath &&\n terminal.terminalType.name === this.nextTerminalName &&\n terminal.idx === this.nextTerminalOccurrence &&\n !this.found\n ) {\n const fullRest = currRest.concat(prevRest)\n const restProd = new Alternative({ definition: fullRest })\n this.possibleTokTypes = first(restProd)\n this.found = true\n }\n }\n}\n\nexport type AlternativesFirstTokens = TokenType[][]\n\nexport interface IFirstAfterRepetition {\n token: TokenType | undefined\n occurrence: number | undefined\n isEndOfRule: boolean | undefined\n}\n\n/**\n * This walker only \"walks\" a single \"TOP\" level in the Grammar Ast, this means\n * it never \"follows\" production refs\n */\nexport class AbstractNextTerminalAfterProductionWalker extends RestWalker {\n protected result: IFirstAfterRepetition = {\n token: undefined,\n occurrence: undefined,\n isEndOfRule: undefined\n }\n\n constructor(protected topRule: Rule, protected occurrence: number) {\n super()\n }\n\n startWalking(): IFirstAfterRepetition {\n this.walk(this.topRule)\n return this.result\n }\n}\n\nexport class NextTerminalAfterManyWalker extends AbstractNextTerminalAfterProductionWalker {\n walkMany(\n manyProd: Repetition,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n if (manyProd.idx === this.occurrence) {\n const firstAfterMany = _first(currRest.concat(prevRest))\n this.result.isEndOfRule = firstAfterMany === undefined\n if (firstAfterMany instanceof Terminal) {\n this.result.token = firstAfterMany.terminalType\n this.result.occurrence = firstAfterMany.idx\n }\n } else {\n super.walkMany(manyProd, currRest, prevRest)\n }\n }\n}\n\nexport class NextTerminalAfterManySepWalker extends AbstractNextTerminalAfterProductionWalker {\n walkManySep(\n manySepProd: RepetitionWithSeparator,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n if (manySepProd.idx === this.occurrence) {\n const firstAfterManySep = _first(currRest.concat(prevRest))\n this.result.isEndOfRule = firstAfterManySep === undefined\n if (firstAfterManySep instanceof Terminal) {\n this.result.token = firstAfterManySep.terminalType\n this.result.occurrence = firstAfterManySep.idx\n }\n } else {\n super.walkManySep(manySepProd, currRest, prevRest)\n }\n }\n}\n\nexport class NextTerminalAfterAtLeastOneWalker extends AbstractNextTerminalAfterProductionWalker {\n walkAtLeastOne(\n atLeastOneProd: RepetitionMandatory,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n if (atLeastOneProd.idx === this.occurrence) {\n const firstAfterAtLeastOne = _first(currRest.concat(prevRest))\n this.result.isEndOfRule = firstAfterAtLeastOne === undefined\n if (firstAfterAtLeastOne instanceof Terminal) {\n this.result.token = firstAfterAtLeastOne.terminalType\n this.result.occurrence = firstAfterAtLeastOne.idx\n }\n } else {\n super.walkAtLeastOne(atLeastOneProd, currRest, prevRest)\n }\n }\n}\n\n// TODO: reduce code duplication in the AfterWalkers\nexport class NextTerminalAfterAtLeastOneSepWalker extends AbstractNextTerminalAfterProductionWalker {\n walkAtLeastOneSep(\n atleastOneSepProd: RepetitionMandatoryWithSeparator,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n if (atleastOneSepProd.idx === this.occurrence) {\n const firstAfterfirstAfterAtLeastOneSep = _first(\n currRest.concat(prevRest)\n )\n this.result.isEndOfRule = firstAfterfirstAfterAtLeastOneSep === undefined\n if (firstAfterfirstAfterAtLeastOneSep instanceof Terminal) {\n this.result.token = firstAfterfirstAfterAtLeastOneSep.terminalType\n this.result.occurrence = firstAfterfirstAfterAtLeastOneSep.idx\n }\n } else {\n super.walkAtLeastOneSep(atleastOneSepProd, currRest, prevRest)\n }\n }\n}\n\nexport interface PartialPathAndSuffixes {\n partialPath: TokenType[]\n suffixDef: IProduction[]\n}\n\nexport function possiblePathsFrom(\n targetDef: IProduction[],\n maxLength: number,\n currPath: TokenType[] = []\n): PartialPathAndSuffixes[] {\n // avoid side effects\n currPath = clone(currPath)\n let result: PartialPathAndSuffixes[] = []\n let i = 0\n\n // TODO: avoid inner funcs\n function remainingPathWith(nextDef: IProduction[]) {\n return nextDef.concat(drop(targetDef, i + 1))\n }\n\n // TODO: avoid inner funcs\n function getAlternativesForProd(definition: IProduction[]) {\n const alternatives = possiblePathsFrom(\n remainingPathWith(definition),\n maxLength,\n currPath\n )\n return result.concat(alternatives)\n }\n\n /**\n * Mandatory productions will halt the loop as the paths computed from their recursive calls will already contain the\n * following (rest) of the targetDef.\n *\n * For optional productions (Option/Repetition/...) the loop will continue to represent the paths that do not include the\n * the optional production.\n */\n while (currPath.length < maxLength && i < targetDef.length) {\n const prod = targetDef[i]\n\n /* istanbul ignore else */\n if (prod instanceof Alternative) {\n return getAlternativesForProd(prod.definition)\n } else if (prod instanceof NonTerminal) {\n return getAlternativesForProd(prod.definition)\n } else if (prod instanceof Option) {\n result = getAlternativesForProd(prod.definition)\n } else if (prod instanceof RepetitionMandatory) {\n const newDef = prod.definition.concat([\n new Repetition({\n definition: prod.definition\n })\n ])\n return getAlternativesForProd(newDef)\n } else if (prod instanceof RepetitionMandatoryWithSeparator) {\n const newDef = [\n new Alternative({ definition: prod.definition }),\n new Repetition({\n definition: [new Terminal({ terminalType: prod.separator })].concat(\n <any>prod.definition\n )\n })\n ]\n return getAlternativesForProd(newDef)\n } else if (prod instanceof RepetitionWithSeparator) {\n const newDef = prod.definition.concat([\n new Repetition({\n definition: [new Terminal({ terminalType: prod.separator })].concat(\n <any>prod.definition\n )\n })\n ])\n result = getAlternativesForProd(newDef)\n } else if (prod instanceof Repetition) {\n const newDef = prod.definition.concat([\n new Repetition({\n definition: prod.definition\n })\n ])\n result = getAlternativesForProd(newDef)\n } else if (prod instanceof Alternation) {\n forEach(prod.definition, (currAlt) => {\n // TODO: this is a limited check for empty alternatives\n // It would prevent a common case of infinite loops during parser initialization.\n // However **in-directly** empty alternatives may still cause issues.\n if (isEmpty(currAlt.definition) === false) {\n result = getAlternativesForProd(currAlt.definition)\n }\n })\n return result\n } else if (prod instanceof Terminal) {\n currPath.push(prod.terminalType)\n } else {\n throw Error(\"non exhaustive match\")\n }\n\n i++\n }\n result.push({\n partialPath: currPath,\n suffixDef: drop(targetDef, i)\n })\n\n return result\n}\n\ninterface IPathToExamine {\n idx: number\n def: IProduction[]\n ruleStack: string[]\n occurrenceStack: number[]\n}\n\nexport function nextPossibleTokensAfter(\n initialDef: IProduction[],\n tokenVector: IToken[],\n tokMatcher: TokenMatcher,\n maxLookAhead: number\n): ISyntacticContentAssistPath[] {\n const EXIT_NON_TERMINAL: any = \"EXIT_NONE_TERMINAL\"\n // to avoid creating a new Array each time.\n const EXIT_NON_TERMINAL_ARR = [EXIT_NON_TERMINAL]\n const EXIT_ALTERNATIVE: any = \"EXIT_ALTERNATIVE\"\n let foundCompletePath = false\n\n const tokenVectorLength = tokenVector.length\n const minimalAlternativesIndex = tokenVectorLength - maxLookAhead - 1\n\n const result: ISyntacticContentAssistPath[] = []\n\n const possiblePaths: IPathToExamine[] = []\n possiblePaths.push({\n idx: -1,\n def: initialDef,\n ruleStack: [],\n occurrenceStack: []\n })\n\n while (!isEmpty(possiblePaths)) {\n const currPath = possiblePaths.pop()!\n\n // skip alternatives if no more results can be found (assuming deterministic grammar with fixed lookahead)\n if (currPath === EXIT_ALTERNATIVE) {\n if (\n foundCompletePath &&\n last(possiblePaths)!.idx <= minimalAlternativesIndex\n ) {\n // remove irrelevant alternative\n possiblePaths.pop()\n }\n continue\n }\n\n const currDef = currPath.def\n const currIdx = currPath.idx\n const currRuleStack = currPath.ruleStack\n const currOccurrenceStack = currPath.occurrenceStack\n\n // For Example: an empty path could exist in a valid grammar in the case of an EMPTY_ALT\n if (isEmpty(currDef)) {\n continue\n }\n\n const prod = currDef[0]\n /* istanbul ignore else */\n if (prod === EXIT_NON_TERMINAL) {\n const nextPath = {\n idx: currIdx,\n def: drop(currDef),\n ruleStack: dropRight(currRuleStack),\n occurrenceStack: dropRight(currOccurrenceStack)\n }\n possiblePaths.push(nextPath)\n } else if (prod instanceof Terminal) {\n /* istanbul ignore else */\n if (currIdx < tokenVectorLength - 1) {\n const nextIdx = currIdx + 1\n const actualToken = tokenVector[nextIdx]\n if (tokMatcher!(actualToken, prod.terminalType)) {\n const nextPath = {\n idx: nextIdx,\n def: drop(currDef),\n ruleStack: currRuleStack,\n occurrenceStack: currOccurrenceStack\n }\n possiblePaths.push(nextPath)\n }\n // end of the line\n } else if (currIdx === tokenVectorLength - 1) {\n // IGNORE ABOVE ELSE\n result.push({\n nextTokenType: prod.terminalType,\n nextTokenOccurrence: prod.idx,\n ruleStack: currRuleStack,\n occurrenceStack: currOccurrenceStack\n })\n foundCompletePath = true\n } else {\n throw Error(\"non exhaustive match\")\n }\n } else if (prod instanceof NonTerminal) {\n const newRuleStack = clone(currRuleStack)\n newRuleStack.push(prod.nonTerminalName)\n\n const newOccurrenceStack = clone(currOccurrenceStack)\n newOccurrenceStack.push(prod.idx)\n\n const nextPath = {\n idx: currIdx,\n def: prod.definition.concat(EXIT_NON_TERMINAL_ARR, drop(currDef)),\n ruleStack: newRuleStack,\n occurrenceStack: newOccurrenceStack\n }\n possiblePaths.push(nextPath)\n } else if (prod instanceof Option) {\n // the order of alternatives is meaningful, FILO (Last path will be traversed first).\n const nextPathWithout = {\n idx: currIdx,\n def: drop(currDef),\n ruleStack: currRuleStack,\n occurrenceStack: currOccurrenceStack\n }\n possiblePaths.push(nextPathWithout)\n // required marker to avoid backtracking paths whose higher priority alternatives already matched\n possiblePaths.push(EXIT_ALTERNATIVE)\n\n const nextPathWith = {\n idx: currIdx,\n def: prod.definition.concat(drop(currDef)),\n ruleStack: currRuleStack,\n occurrenceStack: currOccurrenceStack\n }\n possiblePaths.push(nextPathWith)\n } else if (prod instanceof RepetitionMandatory) {\n // TODO:(THE NEW operators here take a while...) (convert once?)\n const secondIteration = new Repetition({\n definition: prod.definition,\n idx: prod.idx\n })\n const nextDef = prod.definition.concat([secondIteration], drop(currDef))\n const nextPath = {\n idx: currIdx,\n def: nextDef,\n ruleStack: currRuleStack,\n occurrenceStack: currOccurrenceStack\n }\n possiblePaths.push(nextPath)\n } else if (prod instanceof RepetitionMandatoryWithSeparator) {\n // TODO:(THE NEW operators here take a while...) (convert once?)\n const separatorGast = new Terminal({\n terminalType: prod.separator\n })\n const secondIteration = new Repetition({\n definition: [<any>separatorGast].concat(prod.definition),\n idx: prod.idx\n })\n const nextDef = prod.definition.concat([secondIteration], drop(currDef))\n const nextPath = {\n idx: currIdx,\n def: nextDef,\n ruleStack: currRuleStack,\n occurrenceStack: currOccurrenceStack\n }\n possiblePaths.push(nextPath)\n } else if (prod instanceof RepetitionWithSeparator) {\n // the order of alternatives is meaningful, FILO (Last path will be traversed first).\n const nextPathWithout = {\n idx: currIdx,\n def: drop(currDef),\n ruleStack: currRuleStack,\n occurrenceStack: currOccurrenceStack\n }\n possiblePaths.push(nextPathWithout)\n // required marker to avoid backtracking paths whose higher priority alternatives already matched\n possiblePaths.push(EXIT_ALTERNATIVE)\n\n const separatorGast = new Terminal({\n terminalType: prod.separator\n })\n const nthRepetition = new Repetition({\n definition: [<any>separatorGast].concat(prod.definition),\n idx: prod.idx\n })\n const nextDef = prod.definition.concat([nthRepetition], drop(currDef))\n const nextPathWith = {\n idx: currIdx,\n def: nextDef,\n ruleStack: currRuleStack,\n occurrenceStack: currOccurrenceStack\n }\n possiblePaths.push(nextPathWith)\n } else if (prod instanceof Repetition) {\n // the order of alternatives is meaningful, FILO (Last path will be traversed first).\n const nextPathWithout = {\n idx: currIdx,\n def: drop(currDef),\n ruleStack: currRuleStack,\n occurrenceStack: currOccurrenceStack\n }\n possiblePaths.push(nextPathWithout)\n // required marker to avoid backtracking paths whose higher priority alternatives already matched\n possiblePaths.push(EXIT_ALTERNATIVE)\n\n // TODO: an empty repetition will cause infinite loops here, will the parser detect this in selfAnalysis?\n const nthRepetition = new Repetition({\n definition: prod.definition,\n idx: prod.idx\n })\n const nextDef = prod.definition.concat([nthRepetition], drop(currDef))\n const nextPathWith = {\n idx: currIdx,\n def: nextDef,\n ruleStack: currRuleStack,\n occurrenceStack: currOccurrenceStack\n }\n possiblePaths.push(nextPathWith)\n } else if (prod instanceof Alternation) {\n // the order of alternatives is meaningful, FILO (Last path will be traversed first).\n for (let i = prod.definition.length - 1; i >= 0; i--) {\n const currAlt: any = prod.definition[i]\n const currAltPath = {\n idx: currIdx,\n def: currAlt.definition.concat(drop(currDef)),\n ruleStack: currRuleStack,\n occurrenceStack: currOccurrenceStack\n }\n possiblePaths.push(currAltPath)\n possiblePaths.push(EXIT_ALTERNATIVE)\n }\n } else if (prod instanceof Alternative) {\n possiblePaths.push({\n idx: currIdx,\n def: prod.definition.concat(drop(currDef)),\n ruleStack: currRuleStack,\n occurrenceStack: currOccurrenceStack\n })\n } else if (prod instanceof Rule) {\n // last because we should only encounter at most a single one of these per invocation.\n possiblePaths.push(\n expandTopLevelRule(prod, currIdx, currRuleStack, currOccurrenceStack)\n )\n } else {\n throw Error(\"non exhaustive match\")\n }\n }\n return result\n}\n\nfunction expandTopLevelRule(\n topRule: Rule,\n currIdx: number,\n currRuleStack: string[],\n currOccurrenceStack: number[]\n): IPathToExamine {\n const newRuleStack = clone(currRuleStack)\n newRuleStack.push(topRule.name)\n\n const newCurrOccurrenceStack = clone(currOccurrenceStack)\n // top rule is always assumed to have been called with occurrence index 1\n newCurrOccurrenceStack.push(1)\n\n return {\n idx: currIdx,\n def: topRule.definition,\n ruleStack: newRuleStack,\n occurrenceStack: newCurrOccurrenceStack\n }\n}\n","import isEmpty from \"lodash/isEmpty\"\nimport flatten from \"lodash/flatten\"\nimport every from \"lodash/every\"\nimport map from \"lodash/map\"\nimport forEach from \"lodash/forEach\"\nimport has from \"lodash/has\"\nimport reduce from \"lodash/reduce\"\nimport { possiblePathsFrom } from \"./interpreter\"\nimport { RestWalker } from \"./rest\"\nimport { Predicate, TokenMatcher } from \"../parser/parser\"\nimport {\n tokenStructuredMatcher,\n tokenStructuredMatcherNoCategories\n} from \"../../scan/tokens\"\nimport {\n Alternation,\n Alternative as AlternativeGAST,\n Option,\n Repetition,\n RepetitionMandatory,\n RepetitionMandatoryWithSeparator,\n RepetitionWithSeparator\n} from \"@chevrotain/gast\"\nimport { GAstVisitor } from \"@chevrotain/gast\"\nimport {\n IOrAlt,\n IProduction,\n IProductionWithOccurrence,\n LookaheadSequence,\n LookaheadProductionType,\n Rule,\n TokenType,\n BaseParser\n} from \"@chevrotain/types\"\n\nexport enum PROD_TYPE {\n OPTION,\n REPETITION,\n REPETITION_MANDATORY,\n REPETITION_MANDATORY_WITH_SEPARATOR,\n REPETITION_WITH_SEPARATOR,\n ALTERNATION\n}\n\nexport function getProdType(\n prod: IProduction | LookaheadProductionType\n): PROD_TYPE {\n /* istanbul ignore else */\n if (prod instanceof Option || prod === \"Option\") {\n return PROD_TYPE.OPTION\n } else if (prod instanceof Repetition || prod === \"Repetition\") {\n return PROD_TYPE.REPETITION\n } else if (\n prod instanceof RepetitionMandatory ||\n prod === \"RepetitionMandatory\"\n ) {\n return PROD_TYPE.REPETITION_MANDATORY\n } else if (\n prod instanceof RepetitionMandatoryWithSeparator ||\n prod === \"RepetitionMandatoryWithSeparator\"\n ) {\n return PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR\n } else if (\n prod instanceof RepetitionWithSeparator ||\n prod === \"RepetitionWithSeparator\"\n ) {\n return PROD_TYPE.REPETITION_WITH_SEPARATOR\n } else if (prod instanceof Alternation || prod === \"Alternation\") {\n return PROD_TYPE.ALTERNATION\n } else {\n throw Error(\"non exhaustive match\")\n }\n}\n\nexport function getLookaheadPaths(options: {\n occurrence: number\n rule: Rule\n prodType: LookaheadProductionType\n maxLookahead: number\n}): LookaheadSequence[] {\n const { occurrence, rule, prodType, maxLookahead } = options\n const type = getProdType(prodType)\n if (type === PROD_TYPE.ALTERNATION) {\n return getLookaheadPathsForOr(occurrence, rule, maxLookahead)\n } else {\n return getLookaheadPathsForOptionalProd(\n occurrence,\n rule,\n type,\n maxLookahead\n )\n }\n}\n\nexport function buildLookaheadFuncForOr(\n occurrence: number,\n ruleGrammar: Rule,\n maxLookahead: number,\n hasPredicates: boolean,\n dynamicTokensEnabled: boolean,\n laFuncBuilder: Function\n): (orAlts?: IOrAlt<any>[]) => number | undefined {\n const lookAheadPaths = getLookaheadPathsForOr(\n occurrence,\n ruleGrammar,\n maxLookahead\n )\n\n const tokenMatcher = areTokenCategoriesNotUsed(lookAheadPaths)\n ? tokenStructuredMatcherNoCategories\n : tokenStructuredMatcher\n\n return laFuncBuilder(\n lookAheadPaths,\n hasPredicates,\n tokenMatcher,\n dynamicTokensEnabled\n )\n}\n\n/**\n * When dealing with an Optional production (OPTION/MANY/2nd iteration of AT_LEAST_ONE/...) we need to compare\n * the lookahead \"inside\" the production and the lookahead immediately \"after\" it in the same top level rule (context free).\n *\n * Example: given a production:\n * ABC(DE)?DF\n *\n * The optional '(DE)?' should only be entered if we see 'DE'. a single Token 'D' is not sufficient to distinguish between the two\n * alternatives.\n *\n * @returns A Lookahead function which will return true IFF the parser should parse the Optional production.\n */\nexport function buildLookaheadFuncForOptionalProd(\n occurrence: number,\n ruleGrammar: Rule,\n k: number,\n dynamicTokensEnabled: boolean,\n prodType: PROD_TYPE,\n lookaheadBuilder: (\n lookAheadSequence: LookaheadSequence,\n tokenMatcher: TokenMatcher,\n dynamicTokensEnabled: boolean\n ) => () => boolean\n): () => boolean {\n const lookAheadPaths = getLookaheadPathsForOptionalProd(\n occurrence,\n ruleGrammar,\n prodType,\n k\n )\n\n const tokenMatcher = areTokenCategoriesNotUsed(lookAheadPaths)\n ? tokenStructuredMatcherNoCategories\n : tokenStructuredMatcher\n\n return lookaheadBuilder(lookAheadPaths[0], tokenMatcher, dynamicTokensEnabled)\n}\n\nexport type Alternative = TokenType[][]\n\nexport function buildAlternativesLookAheadFunc(\n alts: LookaheadSequence[],\n hasPredicates: boolean,\n tokenMatcher: TokenMatcher,\n dynamicTokensEnabled: boolean\n): (orAlts: IOrAlt<any>[]) => number | undefined {\n const numOfAlts = alts.length\n const areAllOneTokenLookahead = every(alts, (currAlt) => {\n return every(currAlt, (currPath) => {\n return currPath.length === 1\n })\n })\n\n // This version takes into account the predicates as well.\n if (hasPredicates) {\n /**\n * @returns {number} - The chosen alternative index\n */\n return function (\n this: BaseParser,\n orAlts: IOrAlt<any>[]\n ): number | undefined {\n // unfortunately the predicates must be extracted every single time\n // as they cannot be cached due to references to parameters(vars) which are no longer valid.\n // note that in the common case of no predicates, no cpu time will be wasted on this (see else block)\n const predicates: (Predicate | undefined)[] = map(\n orAlts,\n (currAlt) => currAlt.GATE\n )\n\n for (let t = 0; t < numOfAlts; t++) {\n const currAlt = alts[t]\n const currNumOfPaths = currAlt.length\n\n const currPredicate = predicates[t]\n if (currPredicate !== undefined && currPredicate.call(this) === false) {\n // if the predicate does not match there is no point in checking the paths\n continue\n }\n nextPath: for (let j = 0; j < currNumOfPaths; j++) {\n const currPath = currAlt[j]\n const currPathLength = currPath.length\n for (let i = 0; i < currPathLength; i++) {\n const nextToken = this.LA(i + 1)\n if (tokenMatcher(nextToken, currPath[i]) === false) {\n // mismatch in current path\n // try the next pth\n continue nextPath\n }\n }\n // found a full path that matches.\n // this will also work for an empty ALT as the loop will be skipped\n return t\n }\n // none of the paths for the current alternative matched\n // try the next alternative\n }\n // none of the alternatives could be matched\n return undefined\n }\n } else if (areAllOneTokenLookahead && !dynamicTokensEnabled) {\n // optimized (common) case of all the lookaheads paths requiring only\n // a single token lookahead. These Optimizations cannot work if dynamically defined Tokens are used.\n const singleTokenAlts = map(alts, (currAlt) => {\n return flatten(currAlt)\n })\n\n const choiceToAlt = reduce(\n singleTokenAlts,\n (result, currAlt, idx) => {\n forEach(currAlt, (currTokType) => {\n if (!has(result, currTokType.tokenTypeIdx!)) {\n result[currTokType.tokenTypeIdx!] = idx\n }\n forEach(currTokType.categoryMatches!, (currExtendingType) => {\n if (!has(result, currExtendingType)) {\n result[currExtendingType] = idx\n }\n })\n })\n return result\n },\n {} as Record<number, number>\n )\n\n /**\n * @returns {number} - The chosen alternative index\n */\n return function (this: BaseParser): number {\n const nextToken = this.LA(1)\n return choiceToAlt[nextToken.tokenTypeIdx]\n }\n } else {\n // optimized lookahead without needing to check the predicates at all.\n // this causes code duplication which is intentional to improve performance.\n /**\n * @returns {number} - The chosen alternative index\n */\n return function (this: BaseParser): number | undefined {\n for (let t = 0; t < numOfAlts; t++) {\n const currAlt = alts[t]\n const currNumOfPaths = currAlt.length\n nextPath: for (let j = 0; j < currNumOfPaths; j++) {\n const currPath = currAlt[j]\n const currPathLength = currPath.length\n for (let i = 0; i < currPathLength; i++) {\n const nextToken = this.LA(i + 1)\n if (tokenMatcher(nextToken, currPath[i]) === false) {\n // mismatch in current path\n // try the next pth\n continue nextPath\n }\n }\n // found a full path that matches.\n // this will also work for an empty ALT as the loop will be skipped\n return t\n }\n // none of the paths for the current alternative matched\n // try the next alternative\n }\n // none of the alternatives could be matched\n return undefined\n }\n }\n}\n\nexport function buildSingleAlternativeLookaheadFunction(\n alt: LookaheadSequence,\n tokenMatcher: TokenMatcher,\n dynamicTokensEnabled: boolean\n): () => boolean {\n const areAllOneTokenLookahead = every(alt, (currPath) => {\n return currPath.length === 1\n })\n\n const numOfPaths = alt.length\n\n // optimized (common) case of all the lookaheads paths requiring only\n // a single token lookahead.\n if (areAllOneTokenLookahead && !dynamicTokensEnabled) {\n const singleTokensTypes = flatten(alt)\n\n if (\n singleTokensTypes.length === 1 &&\n isEmpty((<any>singleTokensTypes[0]).categoryMatches)\n ) {\n const expectedTokenType = singleTokensTypes[0]\n const expectedTokenUniqueKey = (<any>expectedTokenType).tokenTypeIdx\n\n return function (this: BaseParser): boolean {\n return this.LA(1).tokenTypeIdx === expectedTokenUniqueKey\n }\n } else {\n const choiceToAlt = reduce(\n singleTokensTypes,\n (result, currTokType, idx) => {\n result[currTokType.tokenTypeIdx!] = true\n forEach(currTokType.categoryMatches!, (currExtendingType) => {\n result[currExtendingType] = true\n })\n return result\n },\n [] as boolean[]\n )\n\n return function (this: BaseParser): boolean {\n const nextToken = this.LA(1)\n return choiceToAlt[nextToken.tokenTypeIdx] === true\n }\n }\n } else {\n return function (this: BaseParser): boolean {\n nextPath: for (let j = 0; j < numOfPaths; j++) {\n const currPath = alt[j]\n const currPathLength = currPath.length\n for (let i = 0; i < currPathLength; i++) {\n const nextToken = this.LA(i + 1)\n if (tokenMatcher(nextToken, currPath[i]) === false) {\n // mismatch in current path\n // try the next pth\n continue nextPath\n }\n }\n // found a full path that matches.\n return true\n }\n\n // none of the paths matched\n return false\n }\n }\n}\n\nclass RestDefinitionFinderWalker extends RestWalker {\n private restDef: IProduction[]\n\n constructor(\n private topProd: Rule,\n private targetOccurrence: number,\n private targetProdType: PROD_TYPE\n ) {\n super()\n }\n\n startWalking(): IProduction[] {\n this.walk(this.topProd)\n return this.restDef\n }\n\n private checkIsTarget(\n node: IProductionWithOccurrence,\n expectedProdType: PROD_TYPE,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): boolean {\n if (\n node.idx === this.targetOccurrence &&\n this.targetProdType === expectedProdType\n ) {\n this.restDef = currRest.concat(prevRest)\n return true\n }\n // performance optimization, do not iterate over the entire Grammar ast after we have found the target\n return false\n }\n\n walkOption(\n optionProd: Option,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n if (!this.checkIsTarget(optionProd, PROD_TYPE.OPTION, currRest, prevRest)) {\n super.walkOption(optionProd, currRest, prevRest)\n }\n }\n\n walkAtLeastOne(\n atLeastOneProd: RepetitionMandatory,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n if (\n !this.checkIsTarget(\n atLeastOneProd,\n PROD_TYPE.REPETITION_MANDATORY,\n currRest,\n prevRest\n )\n ) {\n super.walkOption(atLeastOneProd, currRest, prevRest)\n }\n }\n\n walkAtLeastOneSep(\n atLeastOneSepProd: RepetitionMandatoryWithSeparator,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n if (\n !this.checkIsTarget(\n atLeastOneSepProd,\n PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,\n currRest,\n prevRest\n )\n ) {\n super.walkOption(atLeastOneSepProd, currRest, prevRest)\n }\n }\n\n walkMany(\n manyProd: Repetition,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n if (\n !this.checkIsTarget(manyProd, PROD_TYPE.REPETITION, currRest, prevRest)\n ) {\n super.walkOption(manyProd, currRest, prevRest)\n }\n }\n\n walkManySep(\n manySepProd: RepetitionWithSeparator,\n currRest: IProduction[],\n prevRest: IProduction[]\n ): void {\n if (\n !this.checkIsTarget(\n manySepProd,\n PROD_TYPE.REPETITION_WITH_SEPARATOR,\n currRest,\n prevRest\n )\n ) {\n super.walkOption(manySepProd, currRest, prevRest)\n }\n }\n}\n\n/**\n * Returns the definition of a target production in a top level level rule.\n */\nclass InsideDefinitionFinderVisitor extends GAstVisitor {\n public result: IProduction[] = []\n\n constructor(\n private targetOccurrence: number,\n private targetProdType: PROD_TYPE,\n private targetRef?: any\n ) {\n super()\n }\n\n private checkIsTarget(\n node: { definition: IProduction[] } & IProductionWithOccurrence,\n expectedProdName: PROD_TYPE\n ): void {\n if (\n node.idx === this.targetOccurrence &&\n this.targetProdType === expectedProdName &&\n (this.targetRef === undefined || node === this.targetRef)\n ) {\n this.result = node.definition\n }\n }\n\n public visitOption(node: Option): void {\n this.checkIsTarget(node, PROD_TYPE.OPTION)\n }\n\n public visitRepetition(node: Repetition): void {\n this.checkIsTarget(node, PROD_TYPE.REPETITION)\n }\n\n public visitRepetitionMandatory(node: RepetitionMandatory): void {\n this.checkIsTarget(node, PROD_TYPE.REPETITION_MANDATORY)\n }\n\n public visitRepetitionMandatoryWithSeparator(\n node: RepetitionMandatoryWithSeparator\n ): void {\n this.checkIsTarget(node, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR)\n }\n\n public visitRepetitionWithSeparator(node: RepetitionWithSeparator): void {\n this.checkIsTarget(node, PROD_TYPE.REPETITION_WITH_SEPARATOR)\n }\n\n public visitAlternation(node: Alternation): void {\n this.checkIsTarget(node, PROD_TYPE.ALTERNATION)\n }\n}\n\nfunction initializeArrayOfArrays(size: number): any[][] {\n const result = new Array(size)\n for (let i = 0; i < size; i++) {\n result[i] = []\n }\n return result\n}\n\n/**\n * A sort of hash function between a Path in the grammar and a string.\n * Note that this returns multiple \"hashes\" to support the scenario of token categories.\n * - A single path with categories may match multiple **actual** paths.\n */\nfunction pathToHashKeys(path: TokenType[]): string[] {\n let keys = [\"\"]\n for (let i = 0; i < path.length; i++) {\n const tokType = path[i]\n const longerKeys = []\n for (let j = 0; j < keys.length; j++) {\n const currShorterKey = keys[j]\n longerKeys.push(currShorterKey + \"_\" + tokType.tokenTypeIdx)\n for (let t = 0; t < tokType.categoryMatches!.length; t++) {\n const categoriesKeySuffix = \"_\" + tokType.categoryMatches![t]\n longerKeys.push(currShorterKey + categoriesKeySuffix)\n }\n }\n keys = longerKeys\n }\n return keys\n}\n\n/**\n * Imperative style due to being called from a hot spot\n */\nfunction isUniquePrefixHash(\n altKnownPathsKeys: Record<string, boolean>[],\n searchPathKeys: string[],\n idx: number\n): boolean {\n for (\n let currAltIdx = 0;\n currAltIdx < altKnownPathsKeys.length;\n currAltIdx++\n ) {\n // We only want to test vs the other alternatives\n if (currAltIdx === idx) {\n continue\n }\n const otherAltKnownPathsKeys = altKnownPathsKeys[currAltIdx]\n for (let searchIdx = 0; searchIdx < searchPathKeys.length; searchIdx++) {\n const searchKey = searchPathKeys[searchIdx]\n if (otherAltKnownPathsKeys[searchKey] === true) {\n return false\n }\n }\n }\n // None of the SearchPathKeys were found in any of the other alternatives\n return true\n}\n\nexport function lookAheadSequenceFromAlternatives(\n altsDefs: IProduction[],\n k: number\n): LookaheadSequence[] {\n const partialAlts = map(altsDefs, (currAlt) =>\n possiblePathsFrom([currAlt], 1)\n )\n const finalResult = initializeArrayOfArrays(partialAlts.length)\n const altsHashes = map(partialAlts, (currAltPaths) => {\n const dict: { [key: string]: boolean } = {}\n forEach(currAltPaths, (item) => {\n const keys = pathToHashKeys(item.partialPath)\n forEach(keys, (currKey) => {\n dict[currKey] = true\n })\n })\n return dict\n })\n let newData = partialAlts\n\n // maxLookahead loop\n for (let pathLength = 1; pathLength <= k; pathLength++) {\n const currDataset = newData\n newData = initializeArrayOfArrays(currDataset.length)\n\n // alternatives loop\n for (let altIdx = 0; altIdx < currDataset.length; altIdx++) {\n const currAltPathsAndSuffixes = currDataset[altIdx]\n // paths in current alternative loop\n for (\n let currPathIdx = 0;\n currPathIdx < currAltPathsAndSuffixes.length;\n currPathIdx++\n ) {\n const currPathPrefix = currAltPathsAndSuffixes[currPathIdx].partialPath\n const suffixDef = currAltPathsAndSuffixes[currPathIdx].suffixDef\n const prefixKeys = pathToHashKeys(currPathPrefix)\n const isUnique = isUniquePrefixHash(altsHashes, prefixKeys, altIdx)\n // End of the line for this path.\n if (isUnique || isEmpty(suffixDef) || currPathPrefix.length === k) {\n const currAltResult = finalResult[altIdx]\n // TODO: Can we implement a containsPath using Maps/Dictionaries?\n if (containsPath(currAltResult, currPathPrefix) === false) {\n currAltResult.push(currPathPrefix)\n // Update all new keys for the current path.\n for (let j = 0; j < prefixKeys.length; j++) {\n const currKey = prefixKeys[j]\n altsHashes[altIdx][currKey] = true\n }\n }\n }\n // Expand longer paths\n else {\n const newPartialPathsAndSuffixes = possiblePathsFrom(\n suffixDef,\n pathLength + 1,\n currPathPrefix\n )\n newData[altIdx] = newData[altIdx].concat(newPartialPathsAndSuffixes)\n\n // Update keys for new known paths\n forEach(newPartialPathsAndSuffixes, (item) => {\n const prefixKeys = pathToHashKeys(item.partialPath)\n forEach(prefixKeys, (key) => {\n altsHashes[altIdx][key] = true\n })\n })\n }\n }\n }\n }\n\n return finalResult\n}\n\nexport function getLookaheadPathsForOr(\n occurrence: number,\n ruleGrammar: Rule,\n k: number,\n orProd?: Alternation\n): LookaheadSequence[] {\n const visitor = new InsideDefinitionFinderVisitor(\n occurrence,\n PROD_TYPE.ALTERNATION,\n orProd\n )\n ruleGrammar.accept(visitor)\n return lookAheadSequenceFromAlternatives(visitor.result, k)\n}\n\nexport function getLookaheadPathsForOptionalProd(\n occurrence: number,\n ruleGrammar: Rule,\n prodType: PROD_TYPE,\n k: number\n): LookaheadSequence[] {\n const insideDefVisitor = new InsideDefinitionFinderVisitor(\n occurrence,\n prodType\n )\n ruleGrammar.accept(insideDefVisitor)\n const insideDef = insideDefVisitor.result\n\n const afterDefWalker = new RestDefinitionFinderWalker(\n ruleGrammar,\n occurrence,\n prodType\n )\n const afterDef = afterDefWalker.startWalking()\n\n const insideFlat = new AlternativeGAST({ definition: insideDef })\n const afterFlat = new AlternativeGAST({ definition: afterDef })\n\n return lookAheadSequenceFromAlternatives([insideFlat, afterFlat], k)\n}\n\nexport function containsPath(\n alternative: Alternative,\n searchPath: TokenType[]\n): boolean {\n compareOtherPath: for (let i = 0; i < alternative.length; i++) {\n const otherPath = alternative[i]\n if (otherPath.length !== searchPath.length) {\n continue\n }\n for (let j = 0; j < otherPath.length; j++) {\n const searchTok = searchPath[j]\n const otherTok = otherPath[j]\n\n const matchingTokens =\n searchTok === otherTok ||\n otherTok.categoryMatchesMap![searchTok.tokenTypeIdx!] !== undefined\n if (matchingTokens === false) {\n continue compareOtherPath\n }\n }\n return true\n }\n\n return false\n}\n\nexport function isStrictPrefixOfPath(\n prefix: TokenType[],\n other: TokenType[]\n): boolean {\n return (\n prefix.length < other.length &&\n every(prefix, (tokType, idx) => {\n const otherTokType = other[idx]\n return (\n tokType === otherTokType ||\n otherTokType.categoryMatchesMap![tokType.tokenTypeIdx!]\n )\n })\n )\n}\n\nexport function areTokenCategoriesNotUsed(\n lookAheadPaths: LookaheadSequence[]\n): boolean {\n return every(lookAheadPaths, (singleAltPaths) =>\n every(singleAltPaths, (singlePath) =>\n every(singlePath, (token) => isEmpty(token.categoryMatches!))\n )\n )\n}\n","import first from \"lodash/first\"\nimport isEmpty from \"lodash/isEmpty\"\nimport drop from \"lodash/drop\"\nimport flatten from \"lodash/flatten\"\nimport filter from \"lodash/filter\"\nimport reject from \"lodash/reject\"\nimport difference from \"lodash/difference\"\nimport map from \"lodash/map\"\nimport forEach from \"lodash/forEach\"\nimport groupBy from \"lodash/groupBy\"\nimport reduce from \"lodash/reduce\"\nimport pickBy from \"lodash/pickBy\"\nimport values from \"lodash/values\"\nimport includes from \"lodash/includes\"\nimport flatMap from \"lodash/flatMap\"\nimport clone from \"lodash/clone\"\nimport {\n IParserAmbiguousAlternativesDefinitionError,\n IParserDuplicatesDefinitionError,\n IParserEmptyAlternativeDefinitionError,\n ParserDefinitionErrorType\n} from \"../parser/parser\"\nimport { getProductionDslName, isOptionalProd } from \"@chevrotain/gast\"\nimport {\n Alternative,\n containsPath,\n getLookaheadPathsForOptionalProd,\n getLookaheadPathsForOr,\n getProdType,\n isStrictPrefixOfPath\n} from \"./lookahead\"\nimport { nextPossibleTokensAfter } from \"./interpreter\"\nimport {\n Alternation,\n Alternative as AlternativeGAST,\n NonTerminal,\n Option,\n Repetition,\n RepetitionMandatory,\n RepetitionMandatoryWithSeparator,\n RepetitionWithSeparator,\n Terminal\n} from \"@chevrotain/gast\"\nimport { GAstVisitor } from \"@chevrotain/gast\"\nimport {\n ILookaheadStrategy,\n IProduction,\n IProductionWithOccurrence,\n TokenType,\n Rule\n} from \"@chevrotain/types\"\nimport {\n IGrammarValidatorErrorMessageProvider,\n IParserDefinitionError\n} from \"./types\"\nimport dropRight from \"lodash/dropRight\"\nimport compact from \"lodash/compact\"\nimport { tokenStructuredMatcher } from \"../../scan/tokens\"\n\nexport function validateLookahead(options: {\n lookaheadStrategy: ILookaheadStrategy\n rules: Rule[]\n tokenTypes: TokenType[]\n grammarName: string\n}): IParserDefinitionError[] {\n const lookaheadValidationErrorMessages = options.lookaheadStrategy.validate({\n rules: options.rules,\n tokenTypes: options.tokenTypes,\n grammarName: options.grammarName\n })\n return map(lookaheadValidationErrorMessages, (errorMessage) => ({\n type: ParserDefinitionErrorType.CUSTOM_LOOKAHEAD_VALIDATION,\n ...errorMessage\n }))\n}\n\nexport function validateGrammar(\n topLevels: Rule[],\n tokenTypes: TokenType[],\n errMsgProvider: IGrammarValidatorErrorMessageProvider,\n grammarName: string\n): IParserDefinitionError[] {\n const duplicateErrors: IParserDefinitionError[] = flatMap(\n topLevels,\n (currTopLevel) => validateDuplicateProductions(currTopLevel, errMsgProvider)\n )\n\n const termsNamespaceConflictErrors = checkTerminalAndNoneTerminalsNameSpace(\n topLevels,\n tokenTypes,\n errMsgProvider\n )\n\n const tooManyAltsErrors = flatMap(topLevels, (curRule) =>\n validateTooManyAlts(curRule, errMsgProvider)\n )\n\n const duplicateRulesError = flatMap(topLevels, (curRule) =>\n validateRuleDoesNotAlreadyExist(\n curRule,\n topLevels,\n grammarName,\n errMsgProvider\n )\n )\n\n return duplicateErrors.concat(\n termsNamespaceConflictErrors,\n tooManyAltsErrors,\n duplicateRulesError\n )\n}\n\nfunction validateDuplicateProductions(\n topLevelRule: Rule,\n errMsgProvider: IGrammarValidatorErrorMessageProvider\n): IParserDuplicatesDefinitionError[] {\n const collectorVisitor = new OccurrenceValidationCollector()\n topLevelRule.accept(collectorVisitor)\n const allRuleProductions = collectorVisitor.allProductions\n\n const productionGroups = groupBy(\n allRuleProductions,\n identifyProductionForDuplicates\n )\n\n const duplicates: any = pickBy(productionGroups, (currGroup) => {\n return currGroup.length > 1\n })\n\n const errors = map(values(duplicates), (currDuplicates: any) => {\n const firstProd: any = first(currDuplicates)\n const msg = errMsgProvider.buildDuplicateFoundError(\n topLevelRule,\n currDuplicates\n )\n const dslName = getProductionDslName(firstProd)\n const defError: IParserDuplicatesDefinitionError = {\n message: msg,\n type: ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,\n ruleName: topLevelRule.name,\n dslName: dslName,\n occurrence: firstProd.idx\n }\n\n const param = getExtraProductionArgument(firstProd)\n if (param) {\n defError.parameter = param\n }\n\n return defError\n })\n return errors\n}\n\nexport function identifyProductionForDuplicates(\n prod: IProductionWithOccurrence\n): string {\n return `${getProductionDslName(prod)}_#_${\n prod.idx\n }_#_${getExtraProductionArgument(prod)}`\n}\n\nfunction getExtraProductionArgument(prod: IProductionWithOccurrence): string {\n if (prod instanceof Terminal) {\n return prod.terminalType.name\n } else if (prod instanceof NonTerminal) {\n return prod.nonTerminalName\n } else {\n return \"\"\n }\n}\n\nexport class OccurrenceValidationCollector extends GAstVisitor {\n public allProductions: IProductionWithOccurrence[] = []\n\n public visitNonTerminal(subrule: NonTerminal): void {\n this.allProductions.push(subrule)\n }\n\n public visitOption(option: Option): void {\n this.allProductions.push(option)\n }\n\n public visitRepetitionWithSeparator(manySep: RepetitionWithSeparator): void {\n this.allProductions.push(manySep)\n }\n\n public visitRepetitionMandatory(atLeastOne: RepetitionMandatory): void {\n this.allProductions.push(atLeastOne)\n }\n\n public visitRepetitionMandatoryWithSeparator(\n atLeastOneSep: RepetitionMandatoryWithSeparator\n ): void {\n this.allProductions.push(atLeastOneSep)\n }\n\n public visitRepetition(many: Repetition): void {\n this.allProductions.push(many)\n }\n\n public visitAlternation(or: Alternation): void {\n this.allProductions.push(or)\n }\n\n public visitTerminal(terminal: Terminal): void {\n this.allProductions.push(terminal)\n }\n}\n\nexport function validateRuleDoesNotAlreadyExist(\n rule: Rule,\n allRules: Rule[],\n className: string,\n errMsgProvider: IGrammarValidatorErrorMessageProvider\n): IParserDefinitionError[] {\n const errors = []\n const occurrences = reduce(\n allRules,\n (result, curRule) => {\n if (curRule.name === rule.name) {\n return result + 1\n }\n return result\n },\n 0\n )\n if (occurrences > 1) {\n const errMsg = errMsgProvider.buildDuplicateRuleNameError({\n topLevelRule: rule,\n grammarName: className\n })\n errors.push({\n message: errMsg,\n type: ParserDefinitionErrorType.DUPLICATE_RULE_NAME,\n ruleName: rule.name\n })\n }\n\n return errors\n}\n\n// TODO: is there anyway to get only the rule names of rules inherited from the super grammars?\n// This is not part of the IGrammarErrorProvider because the validation cannot be performed on\n// The grammar structure, only at runtime.\nexport function validateRuleIsOverridden(\n ruleName: string,\n definedRulesNames: string[],\n className: string\n): IParserDefinitionError[] {\n const errors = []\n let errMsg\n\n if (!includes(definedRulesNames, ruleName)) {\n errMsg =\n `Invalid rule override, rule: ->${ruleName}<- cannot be overridden in the grammar: ->${className}<-` +\n `as it is not defined in any of the super grammars `\n errors.push({\n message: errMsg,\n type: ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,\n ruleName: ruleName\n })\n }\n\n return errors\n}\n\nexport function validateNoLeftRecursion(\n topRule: Rule,\n currRule: Rule,\n errMsgProvider: IGrammarValidatorErrorMessageProvider,\n path: Rule[] = []\n): IParserDefinitionError[] {\n const errors: IParserDefinitionError[] = []\n const nextNonTerminals = getFirstNoneTerminal(currRule.definition)\n if (isEmpty(nextNonTerminals)) {\n return []\n } else {\n const ruleName = topRule.name\n const foundLeftRecursion = includes(nextNonTerminals, topRule)\n if (foundLeftRecursion) {\n errors.push({\n message: errMsgProvider.buildLeftRecursionError({\n topLevelRule: topRule,\n leftRecursionPath: path\n }),\n type: ParserDefinitionErrorType.LEFT_RECURSION,\n ruleName: ruleName\n })\n }\n\n // we are only looking for cyclic paths leading back to the specific topRule\n // other cyclic paths are ignored, we still need this difference to avoid infinite loops...\n const validNextSteps = difference(nextNonTerminals, path.concat([topRule]))\n const errorsFromNextSteps = flatMap(validNextSteps, (currRefRule) => {\n const newPath = clone(path)\n newPath.push(currRefRule)\n return validateNoLeftRecursion(\n topRule,\n currRefRule,\n errMsgProvider,\n newPath\n )\n })\n\n return errors.concat(errorsFromNextSteps)\n }\n}\n\nexport function getFirstNoneTerminal(definition: IProduction[]): Rule[] {\n let result: Rule[] = []\n if (isEmpty(definition)) {\n return result\n }\n const firstProd = first(definition)\n\n /* istanbul ignore else */\n if (firstProd instanceof NonTerminal) {\n result.push(firstProd.referencedRule)\n } else if (\n firstProd instanceof AlternativeGAST ||\n firstProd instanceof Option ||\n firstProd instanceof RepetitionMandatory ||\n firstProd instanceof RepetitionMandatoryWithSeparator ||\n firstProd instanceof RepetitionWithSeparator ||\n firstProd instanceof Repetition\n ) {\n result = result.concat(\n getFirstNoneTerminal(<IProduction[]>firstProd.definition)\n )\n } else if (firstProd instanceof Alternation) {\n // each sub definition in alternation is a FLAT\n result = flatten(\n map(firstProd.definition, (currSubDef) =>\n getFirstNoneTerminal((<AlternativeGAST>currSubDef).definition)\n )\n )\n } else if (firstProd instanceof Terminal) {\n // nothing to see, move along\n } else {\n throw Error(\"non exhaustive match\")\n }\n\n const isFirstOptional = isOptionalProd(firstProd)\n const hasMore = definition.length > 1\n if (isFirstOptional && hasMore) {\n const rest = drop(definition)\n return result.concat(getFirstNoneTerminal(rest))\n } else {\n return result\n }\n}\n\nclass OrCollector extends GAstVisitor {\n public alternations: Alternation[] = []\n\n public visitAlternation(node: Alternation): void {\n this.alternations.push(node)\n }\n}\n\nexport function validateEmptyOrAlternative(\n topLevelRule: Rule,\n errMsgProvider: IGrammarValidatorErrorMessageProvider\n): IParserEmptyAlternativeDefinitionError[] {\n const orCollector = new OrCollector()\n topLevelRule.accept(orCollector)\n const ors = orCollector.alternations\n\n const errors = flatMap<Alternation, IParserEmptyAlternativeDefinitionError>(\n ors,\n (currOr) => {\n const exceptLast = dropRight(currOr.definition)\n return flatMap(exceptLast, (currAlternative, currAltIdx) => {\n const possibleFirstInAlt = nextPossibleTokensAfter(\n [currAlternative],\n [],\n tokenStructuredMatcher,\n 1\n )\n if (isEmpty(possibleFirstInAlt)) {\n return [\n {\n message: errMsgProvider.buildEmptyAlternationError({\n topLevelRule: topLevelRule,\n alternation: currOr,\n emptyChoiceIdx: currAltIdx\n }),\n type: ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,\n ruleName: topLevelRule.name,\n occurrence: currOr.idx,\n alternative: currAltIdx + 1\n }\n ]\n } else {\n return []\n }\n })\n }\n )\n\n return errors\n}\n\nexport function validateAmbiguousAlternationAlternatives(\n topLevelRule: Rule,\n globalMaxLookahead: number,\n errMsgProvider: IGrammarValidatorErrorMessageProvider\n): IParserAmbiguousAlternativesDefinitionError[] {\n const orCollector = new OrCollector()\n topLevelRule.accept(orCollector)\n let ors = orCollector.alternations\n\n // New Handling of ignoring ambiguities\n // - https://github.com/chevrotain/chevrotain/issues/869\n ors = reject(ors, (currOr) => currOr.ignoreAmbiguities === true)\n\n const errors = flatMap(ors, (currOr: Alternation) => {\n const currOccurrence = currOr.idx\n const actualMaxLookahead = currOr.maxLookahead || globalMaxLookahead\n const alternatives = getLookaheadPathsForOr(\n currOccurrence,\n topLevelRule,\n actualMaxLookahead,\n currOr\n )\n const altsAmbiguityErrors = checkAlternativesAmbiguities(\n alternatives,\n currOr,\n topLevelRule,\n errMsgProvider\n )\n const altsPrefixAmbiguityErrors = checkPrefixAlternativesAmbiguities(\n alternatives,\n currOr,\n topLevelRule,\n errMsgProvider\n )\n\n return altsAmbiguityErrors.concat(altsPrefixAmbiguityErrors)\n })\n\n return errors\n}\n\nexport class RepetitionCollector extends GAstVisitor {\n public allProductions: (IProductionWithOccurrence & {\n maxLookahead?: number\n })[] = []\n\n public visitRepetitionWithSeparator(manySep: RepetitionWithSeparator): void {\n this.allProductions.push(manySep)\n }\n\n public visitRepetitionMandatory(atLeastOne: RepetitionMandatory): void {\n this.allProductions.push(atLeastOne)\n }\n\n public visitRepetitionMandatoryWithSeparator(\n atLeastOneSep: RepetitionMandatoryWithSeparator\n ): void {\n this.allProductions.push(atLeastOneSep)\n }\n\n public visitRepetition(many: Repetition): void {\n this.allProductions.push(many)\n }\n}\n\nexport function validateTooManyAlts(\n topLevelRule: Rule,\n errMsgProvider: IGrammarValidatorErrorMessageProvider\n): IParserDefinitionError[] {\n const orCollector = new OrCollector()\n topLevelRule.accept(orCollector)\n const ors = orCollector.alternations\n\n const errors = flatMap(ors, (currOr) => {\n if (currOr.definition.length > 255) {\n return [\n {\n message: errMsgProvider.buildTooManyAlternativesError({\n topLevelRule: topLevelRule,\n alternation: currOr\n }),\n type: ParserDefinitionErrorType.TOO_MANY_ALTS,\n ruleName: topLevelRule.name,\n occurrence: currOr.idx\n }\n ]\n } else {\n return []\n }\n })\n\n return errors\n}\n\nexport function validateSomeNonEmptyLookaheadPath(\n topLevelRules: Rule[],\n maxLookahead: number,\n errMsgProvider: IGrammarValidatorErrorMessageProvider\n): IParserDefinitionError[] {\n const errors: IParserDefinitionError[] = []\n forEach(topLevelRules, (currTopRule) => {\n const collectorVisitor = new RepetitionCollector()\n currTopRule.accept(collectorVisitor)\n const allRuleProductions = collectorVisitor.allProductions\n forEach(allRuleProductions, (currProd) => {\n const prodType = getProdType(currProd)\n const actualMaxLookahead = currProd.maxLookahead || maxLookahead\n const currOccurrence = currProd.idx\n const paths = getLookaheadPathsForOptionalProd(\n currOccurrence,\n currTopRule,\n prodType,\n actualMaxLookahead\n )\n const pathsInsideProduction = paths[0]\n if (isEmpty(flatten(pathsInsideProduction))) {\n const errMsg = errMsgProvider.buildEmptyRepetitionError({\n topLevelRule: currTopRule,\n repetition: currProd\n })\n errors.push({\n message: errMsg,\n type: ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,\n ruleName: currTopRule.name\n })\n }\n })\n })\n\n return errors\n}\n\nexport interface IAmbiguityDescriptor {\n alts: number[]\n path: TokenType[]\n}\n\nfunction checkAlternativesAmbiguities(\n alternatives: Alternative[],\n alternation: Alternation,\n rule: Rule,\n errMsgProvider: IGrammarValidatorErrorMessageProvider\n): IParserAmbiguousAlternativesDefinitionError[] {\n const foundAmbiguousPaths: Alternative = []\n const identicalAmbiguities = reduce(\n alternatives,\n (result, currAlt, currAltIdx) => {\n // ignore (skip) ambiguities with this alternative\n if (alternation.definition[currAltIdx].ignoreAmbiguities === true) {\n return result\n }\n\n forEach(currAlt, (currPath) => {\n const altsCurrPathAppearsIn = [currAltIdx]\n forEach(alternatives, (currOtherAlt, currOtherAltIdx) => {\n if (\n currAltIdx !== currOtherAltIdx &&\n containsPath(currOtherAlt, currPath) &&\n // ignore (skip) ambiguities with this \"other\" alternative\n alternation.definition[currOtherAltIdx].ignoreAmbiguities !== true\n ) {\n altsCurrPathAppearsIn.push(currOtherAltIdx)\n }\n })\n\n if (\n altsCurrPathAppearsIn.length > 1 &&\n !containsPath(foundAmbiguousPaths, currPath)\n ) {\n foundAmbiguousPaths.push(currPath)\n result.push({\n alts: altsCurrPathAppearsIn,\n path: currPath\n })\n }\n })\n return result\n },\n [] as { alts: number[]; path: TokenType[] }[]\n )\n\n const currErrors = map(identicalAmbiguities, (currAmbDescriptor) => {\n const ambgIndices = map(\n currAmbDescriptor.alts,\n (currAltIdx) => currAltIdx + 1\n )\n\n const currMessage = errMsgProvider.buildAlternationAmbiguityError({\n topLevelRule: rule,\n alternation: alternation,\n ambiguityIndices: ambgIndices,\n prefixPath: currAmbDescriptor.path\n })\n\n return {\n message: currMessage,\n type: ParserDefinitionErrorType.AMBIGUOUS_ALTS,\n ruleName: rule.name,\n occurrence: alternation.idx,\n alternatives: currAmbDescriptor.alts\n }\n })\n\n return currErrors\n}\n\nexport function checkPrefixAlternativesAmbiguities(\n alternatives: Alternative[],\n alternation: Alternation,\n rule: Rule,\n errMsgProvider: IGrammarValidatorErrorMessageProvider\n): IParserAmbiguousAlternativesDefinitionError[] {\n // flatten\n const pathsAndIndices = reduce(\n alternatives,\n (result, currAlt, idx) => {\n const currPathsAndIdx = map(currAlt, (currPath) => {\n return { idx: idx, path: currPath }\n })\n return result.concat(currPathsAndIdx)\n },\n [] as { idx: number; path: TokenType[] }[]\n )\n\n const errors = compact(\n flatMap(pathsAndIndices, (currPathAndIdx) => {\n const alternativeGast = alternation.definition[currPathAndIdx.idx]\n // ignore (skip) ambiguities with this alternative\n if (alternativeGast.ignoreAmbiguities === true) {\n return []\n }\n const targetIdx = currPathAndIdx.idx\n const targetPath = currPathAndIdx.path\n\n const prefixAmbiguitiesPathsAndIndices = filter(\n pathsAndIndices,\n (searchPathAndIdx) => {\n // prefix ambiguity can only be created from lower idx (higher priority) path\n return (\n // ignore (skip) ambiguities with this \"other\" alternative\n alternation.definition[searchPathAndIdx.idx].ignoreAmbiguities !==\n true &&\n searchPathAndIdx.idx < targetIdx &&\n // checking for strict prefix because identical lookaheads\n // will be be detected using a different validation.\n isStrictPrefixOfPath(searchPathAndIdx.path, targetPath)\n )\n }\n )\n\n const currPathPrefixErrors = map(\n prefixAmbiguitiesPathsAndIndices,\n (currAmbPathAndIdx): IParserAmbiguousAlternativesDefinitionError => {\n const ambgIndices = [currAmbPathAndIdx.idx + 1, targetIdx + 1]\n const occurrence = alternation.idx === 0 ? \"\" : alternation.idx\n\n const message = errMsgProvider.buildAlternationPrefixAmbiguityError({\n topLevelRule: rule,\n alternation: alternation,\n ambiguityIndices: ambgIndices,\n prefixPath: currAmbPathAndIdx.path\n })\n return {\n message: message,\n type: ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,\n ruleName: rule.name,\n occurrence: occurrence,\n alternatives: ambgIndices\n }\n }\n )\n\n return currPathPrefixErrors\n })\n )\n\n return errors\n}\n\nfunction checkTerminalAndNoneTerminalsNameSpace(\n topLevels: Rule[],\n tokenTypes: TokenType[],\n errMsgProvider: IGrammarValidatorErrorMessageProvider\n): IParserDefinitionError[] {\n const errors: IParserDefinitionError[] = []\n\n const tokenNames = map(tokenTypes, (currToken) => currToken.name)\n\n forEach(topLevels, (currRule) => {\n const currRuleName = currRule.name\n if (includes(tokenNames, currRuleName)) {\n const errMsg = errMsgProvider.buildNamespaceConflictError(currRule)\n\n errors.push({\n message: errMsg,\n type: ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,\n ruleName: currRuleName\n })\n }\n })\n\n return errors\n}\n","import { Rule } from \"@chevrotain/gast\"\nimport forEach from \"lodash/forEach\"\nimport defaults from \"lodash/defaults\"\nimport { resolveGrammar as orgResolveGrammar } from \"../resolver\"\nimport { validateGrammar as orgValidateGrammar } from \"../checks\"\nimport {\n defaultGrammarResolverErrorProvider,\n defaultGrammarValidatorErrorProvider\n} from \"../../errors_public\"\nimport { TokenType } from \"@chevrotain/types\"\nimport {\n IGrammarResolverErrorMessageProvider,\n IGrammarValidatorErrorMessageProvider,\n IParserDefinitionError\n} from \"../types\"\n\ntype ResolveGrammarOpts = {\n rules: Rule[]\n errMsgProvider?: IGrammarResolverErrorMessageProvider\n}\nexport function resolveGrammar(\n options: ResolveGrammarOpts\n): IParserDefinitionError[] {\n const actualOptions: Required<ResolveGrammarOpts> = defaults(options, {\n errMsgProvider: defaultGrammarResolverErrorProvider\n })\n\n const topRulesTable: { [ruleName: string]: Rule } = {}\n forEach(options.rules, (rule) => {\n topRulesTable[rule.name] = rule\n })\n return orgResolveGrammar(topRulesTable, actualOptions.errMsgProvider)\n}\n\nexport function validateGrammar(options: {\n rules: Rule[]\n tokenTypes: TokenType[]\n grammarName: string\n errMsgProvider: IGrammarValidatorErrorMessageProvider\n}): IParserDefinitionError[] {\n options = defaults(options, {\n errMsgProvider: defaultGrammarValidatorErrorProvider\n })\n\n return orgValidateGrammar(\n options.rules,\n options.tokenTypes,\n options.errMsgProvider,\n options.grammarName\n )\n}\n","import includes from \"lodash/includes\"\nimport {\n IToken,\n IRecognitionException,\n IRecognizerContext\n} from \"@chevrotain/types\"\n\nconst MISMATCHED_TOKEN_EXCEPTION = \"MismatchedTokenException\"\nconst NO_VIABLE_ALT_EXCEPTION = \"NoViableAltException\"\nconst EARLY_EXIT_EXCEPTION = \"EarlyExitException\"\nconst NOT_ALL_INPUT_PARSED_EXCEPTION = \"NotAllInputParsedException\"\n\nconst RECOGNITION_EXCEPTION_NAMES = [\n MISMATCHED_TOKEN_EXCEPTION,\n NO_VIABLE_ALT_EXCEPTION,\n EARLY_EXIT_EXCEPTION,\n NOT_ALL_INPUT_PARSED_EXCEPTION\n]\n\nObject.freeze(RECOGNITION_EXCEPTION_NAMES)\n\n// hacks to bypass no support for custom Errors in javascript/typescript\nexport function isRecognitionException(error: Error) {\n // can't do instanceof on hacked custom js exceptions\n return includes(RECOGNITION_EXCEPTION_NAMES, error.name)\n}\n\nabstract class RecognitionException\n extends Error\n implements IRecognitionException\n{\n context: IRecognizerContext\n resyncedTokens: IToken[] = []\n\n protected constructor(message: string, public token: IToken) {\n super(message)\n\n // fix prototype chain when typescript target is ES5\n Object.setPrototypeOf(this, new.target.prototype)\n\n /* istanbul ignore next - V8 workaround to remove constructor from stacktrace when typescript target is ES5 */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor)\n }\n }\n}\n\nexport class MismatchedTokenException extends RecognitionException {\n constructor(message: string, token: IToken, public previousToken: IToken) {\n super(message, token)\n this.name = MISMATCHED_TOKEN_EXCEPTION\n }\n}\n\nexport class NoViableAltException extends RecognitionException {\n constructor(message: string, token: IToken, public previousToken: IToken) {\n super(message, token)\n this.name = NO_VIABLE_ALT_EXCEPTION\n }\n}\n\nexport class NotAllInputParsedException extends RecognitionException {\n constructor(message: string, token: IToken) {\n super(message, token)\n this.name = NOT_ALL_INPUT_PARSED_EXCEPTION\n }\n}\n\nexport class EarlyExitException extends RecognitionException {\n constructor(message: string, token: IToken, public previousToken: IToken) {\n super(message, token)\n this.name = EARLY_EXIT_EXCEPTION\n }\n}\n","import {\n createTokenInstance,\n EOF,\n tokenMatcher\n} from \"../../../scan/tokens_public\"\nimport {\n AbstractNextTerminalAfterProductionWalker,\n IFirstAfterRepetition\n} from \"../../grammar/interpreter\"\nimport isEmpty from \"lodash/isEmpty\"\nimport dropRight from \"lodash/dropRight\"\nimport flatten from \"lodash/flatten\"\nimport map from \"lodash/map\"\nimport find from \"lodash/find\"\nimport has from \"lodash/has\"\nimport includes from \"lodash/includes\"\nimport clone from \"lodash/clone\"\nimport {\n IParserConfig,\n IToken,\n ITokenGrammarPath,\n TokenType\n} from \"@chevrotain/types\"\nimport { MismatchedTokenException } from \"../../exceptions_public\"\nimport { IN } from \"../../constants\"\nimport { MixedInParser } from \"./parser_traits\"\nimport { DEFAULT_PARSER_CONFIG } from \"../parser\"\n\nexport const EOF_FOLLOW_KEY: any = {}\n\nexport interface IFollowKey {\n ruleName: string\n idxInCallingRule: number\n inRule: string\n}\n\nexport const IN_RULE_RECOVERY_EXCEPTION = \"InRuleRecoveryException\"\n\nexport class InRuleRecoveryException extends Error {\n constructor(message: string) {\n super(message)\n this.name = IN_RULE_RECOVERY_EXCEPTION\n }\n}\n\n/**\n * This trait is responsible for the error recovery and fault tolerant logic\n */\nexport class Recoverable {\n recoveryEnabled: boolean\n firstAfterRepMap: Record<string, IFirstAfterRepetition>\n resyncFollows: Record<string, TokenType[]>\n\n initRecoverable(config: IParserConfig) {\n this.firstAfterRepMap = {}\n this.resyncFollows = {}\n\n this.recoveryEnabled = has(config, \"recoveryEnabled\")\n ? (config.recoveryEnabled as boolean) // assumes end user provides the correct config value/type\n : DEFAULT_PARSER_CONFIG.recoveryEnabled\n\n // performance optimization, NOOP will be inlined which\n // effectively means that this optional feature does not exist\n // when not used.\n if (this.recoveryEnabled) {\n this.attemptInRepetitionRecovery = attemptInRepetitionRecovery\n }\n }\n\n public getTokenToInsert(tokType: TokenType): IToken {\n const tokToInsert = createTokenInstance(\n tokType,\n \"\",\n NaN,\n NaN,\n NaN,\n NaN,\n NaN,\n NaN\n )\n tokToInsert.isInsertedInRecovery = true\n return tokToInsert\n }\n\n public canTokenTypeBeInsertedInRecovery(tokType: TokenType): boolean {\n return true\n }\n\n public canTokenTypeBeDeletedInRecovery(tokType: TokenType): boolean {\n return true\n }\n\n tryInRepetitionRecovery(\n this: MixedInParser,\n grammarRule: Function,\n grammarRuleArgs: any[],\n lookAheadFunc: () => boolean,\n expectedTokType: TokenType\n ): void {\n // TODO: can the resyncTokenType be cached?\n const reSyncTokType = this.findReSyncTokenType()\n const savedLexerState = this.exportLexerState()\n const resyncedTokens: IToken[] = []\n let passedResyncPoint = false\n\n const nextTokenWithoutResync = this.LA(1)\n let currToken = this.LA(1)\n\n const generateErrorMessage = () => {\n const previousToken = this.LA(0)\n // we are preemptively re-syncing before an error has been detected, therefor we must reproduce\n // the error that would have been thrown\n const msg = this.errorMessageProvider.buildMismatchTokenMessage({\n expected: expectedTokType,\n actual: nextTokenWithoutResync,\n previous: previousToken,\n ruleName: this.getCurrRuleFullName()\n })\n const error = new MismatchedTokenException(\n msg,\n nextTokenWithoutResync,\n this.LA(0)\n )\n // the first token here will be the original cause of the error, this is not part of the resyncedTokens property.\n error.resyncedTokens = dropRight(resyncedTokens)\n this.SAVE_ERROR(error)\n }\n\n while (!passedResyncPoint) {\n // re-synced to a point where we can safely exit the repetition/\n if (this.tokenMatcher(currToken, expectedTokType)) {\n generateErrorMessage()\n return // must return here to avoid reverting the inputIdx\n } else if (lookAheadFunc.call(this)) {\n // we skipped enough tokens so we can resync right back into another iteration of the repetition grammar rule\n generateErrorMessage()\n // recursive invocation in other to support multiple re-syncs in the same top level repetition grammar rule\n grammarRule.apply(this, grammarRuleArgs)\n return // must return here to avoid reverting the inputIdx\n } else if (this.tokenMatcher(currToken, reSyncTokType)) {\n passedResyncPoint = true\n } else {\n currToken = this.SKIP_TOKEN()\n this.addToResyncTokens(currToken, resyncedTokens)\n }\n }\n\n // we were unable to find a CLOSER point to resync inside the Repetition, reset the state.\n // The parsing exception we were trying to prevent will happen in the NEXT parsing step. it may be handled by\n // \"between rules\" resync recovery later in the flow.\n this.importLexerState(savedLexerState)\n }\n\n shouldInRepetitionRecoveryBeTried(\n this: MixedInParser,\n expectTokAfterLastMatch: TokenType,\n nextTokIdx: number,\n notStuck: boolean | undefined\n ): boolean {\n // Edge case of arriving from a MANY repetition which is stuck\n // Attempting recovery in this case could cause an infinite loop\n if (notStuck === false) {\n return false\n }\n\n // no need to recover, next token is what we expect...\n if (this.tokenMatcher(this.LA(1), expectTokAfterLastMatch)) {\n return false\n }\n\n // error recovery is disabled during backtracking as it can make the parser ignore a valid grammar path\n // and prefer some backtracking path that includes recovered errors.\n if (this.isBackTracking()) {\n return false\n }\n\n // if we can perform inRule recovery (single token insertion or deletion) we always prefer that recovery algorithm\n // because if it works, it makes the least amount of changes to the input stream (greedy algorithm)\n //noinspection RedundantIfStatementJS\n if (\n this.canPerformInRuleRecovery(\n expectTokAfterLastMatch,\n this.getFollowsForInRuleRecovery(expectTokAfterLastMatch, nextTokIdx)\n )\n ) {\n return false\n }\n\n return true\n }\n\n // Error Recovery functionality\n getFollowsForInRuleRecovery(\n this: MixedInParser,\n tokType: TokenType,\n tokIdxInRule: number\n ): TokenType[] {\n const grammarPath = this.getCurrentGrammarPath(tokType, tokIdxInRule)\n const follows = this.getNextPossibleTokenTypes(grammarPath)\n return follows\n }\n\n tryInRuleRecovery(\n this: MixedInParser,\n expectedTokType: TokenType,\n follows: TokenType[]\n ): IToken {\n if (this.canRecoverWithSingleTokenInsertion(expectedTokType, follows)) {\n const tokToInsert = this.getTokenToInsert(expectedTokType)\n return tokToInsert\n }\n\n if (this.canRecoverWithSingleTokenDeletion(expectedTokType)) {\n const nextTok = this.SKIP_TOKEN()\n this.consumeToken()\n return nextTok\n }\n\n throw new InRuleRecoveryException(\"sad sad panda\")\n }\n\n canPerformInRuleRecovery(\n this: MixedInParser,\n expectedToken: TokenType,\n follows: TokenType[]\n ): boolean {\n return (\n this.canRecoverWithSingleTokenInsertion(expectedToken, follows) ||\n this.canRecoverWithSingleTokenDeletion(expectedToken)\n )\n }\n\n canRecoverWithSingleTokenInsertion(\n this: MixedInParser,\n expectedTokType: TokenType,\n follows: TokenType[]\n ): boolean {\n if (!this.canTokenTypeBeInsertedInRecovery(expectedTokType)) {\n return false\n }\n\n // must know the possible following tokens to perform single token insertion\n if (isEmpty(follows)) {\n return false\n }\n\n const mismatchedTok = this.LA(1)\n const isMisMatchedTokInFollows =\n find(follows, (possibleFollowsTokType: TokenType) => {\n return this.tokenMatcher(mismatchedTok, possibleFollowsTokType)\n }) !== undefined\n\n return isMisMatchedTokInFollows\n }\n\n canRecoverWithSingleTokenDeletion(\n this: MixedInParser,\n expectedTokType: TokenType\n ): boolean {\n if (!this.canTokenTypeBeDeletedInRecovery(expectedTokType)) {\n return false\n }\n\n const isNextTokenWhatIsExpected = this.tokenMatcher(\n this.LA(2),\n expectedTokType\n )\n return isNextTokenWhatIsExpected\n }\n\n isInCurrentRuleReSyncSet(\n this: MixedInParser,\n tokenTypeIdx: TokenType\n ): boolean {\n const followKey = this.getCurrFollowKey()\n const currentRuleReSyncSet = this.getFollowSetFromFollowKey(followKey)\n return includes(currentRuleReSyncSet, tokenTypeIdx)\n }\n\n findReSyncTokenType(this: MixedInParser): TokenType {\n const allPossibleReSyncTokTypes = this.flattenFollowSet()\n // this loop will always terminate as EOF is always in the follow stack and also always (virtually) in the input\n let nextToken = this.LA(1)\n let k = 2\n while (true) {\n const foundMatch = find(allPossibleReSyncTokTypes, (resyncTokType) => {\n const canMatch = tokenMatcher(nextToken, resyncTokType)\n return canMatch\n })\n if (foundMatch !== undefined) {\n return foundMatch\n }\n nextToken = this.LA(k)\n k++\n }\n }\n\n getCurrFollowKey(this: MixedInParser): IFollowKey {\n // the length is at least one as we always add the ruleName to the stack before invoking the rule.\n if (this.RULE_STACK.length === 1) {\n return EOF_FOLLOW_KEY\n }\n const currRuleShortName = this.getLastExplicitRuleShortName()\n const currRuleIdx = this.getLastExplicitRuleOccurrenceIndex()\n const prevRuleShortName = this.getPreviousExplicitRuleShortName()\n\n return {\n ruleName: this.shortRuleNameToFullName(currRuleShortName),\n idxInCallingRule: currRuleIdx,\n inRule: this.shortRuleNameToFullName(prevRuleShortName)\n }\n }\n\n buildFullFollowKeyStack(this: MixedInParser): IFollowKey[] {\n const explicitRuleStack = this.RULE_STACK\n const explicitOccurrenceStack = this.RULE_OCCURRENCE_STACK\n\n return map(explicitRuleStack, (ruleName, idx) => {\n if (idx === 0) {\n return EOF_FOLLOW_KEY\n }\n return {\n ruleName: this.shortRuleNameToFullName(ruleName),\n idxInCallingRule: explicitOccurrenceStack[idx],\n inRule: this.shortRuleNameToFullName(explicitRuleStack[idx - 1])\n }\n })\n }\n\n flattenFollowSet(this: MixedInParser): TokenType[] {\n const followStack = map(this.buildFullFollowKeyStack(), (currKey) => {\n return this.getFollowSetFromFollowKey(currKey)\n })\n return <any>flatten(followStack)\n }\n\n getFollowSetFromFollowKey(\n this: MixedInParser,\n followKey: IFollowKey\n ): TokenType[] {\n if (followKey === EOF_FOLLOW_KEY) {\n return [EOF]\n }\n\n const followName =\n followKey.ruleName + followKey.idxInCallingRule + IN + followKey.inRule\n\n return this.resyncFollows[followName]\n }\n\n // It does not make any sense to include a virtual EOF token in the list of resynced tokens\n // as EOF does not really exist and thus does not contain any useful information (line/column numbers)\n addToResyncTokens(\n this: MixedInParser,\n token: IToken,\n resyncTokens: IToken[]\n ): IToken[] {\n if (!this.tokenMatcher(token, EOF)) {\n resyncTokens.push(token)\n }\n return resyncTokens\n }\n\n reSyncTo(this: MixedInParser, tokType: TokenType): IToken[] {\n const resyncedTokens: IToken[] = []\n let nextTok = this.LA(1)\n while (this.tokenMatcher(nextTok, tokType) === false) {\n nextTok = this.SKIP_TOKEN()\n this.addToResyncTokens(nextTok, resyncedTokens)\n }\n // the last token is not part of the error.\n return dropRight(resyncedTokens)\n }\n\n attemptInRepetitionRecovery(\n this: MixedInParser,\n prodFunc: Function,\n args: any[],\n lookaheadFunc: () => boolean,\n dslMethodIdx: number,\n prodOccurrence: number,\n nextToksWalker: typeof AbstractNextTerminalAfterProductionWalker,\n notStuck?: boolean\n ): void {\n // by default this is a NO-OP\n // The actual implementation is with the function(not method) below\n }\n\n getCurrentGrammarPath(\n this: MixedInParser,\n tokType: TokenType,\n tokIdxInRule: number\n ): ITokenGrammarPath {\n const pathRuleStack: string[] = this.getHumanReadableRuleStack()\n const pathOccurrenceStack: number[] = clone(this.RULE_OCCURRENCE_STACK)\n const grammarPath: any = {\n ruleStack: pathRuleStack,\n occurrenceStack: pathOccurrenceStack,\n lastTok: tokType,\n lastTokOccurrence: tokIdxInRule\n }\n\n return grammarPath\n }\n getHumanReadableRuleStack(this: MixedInParser): string[] {\n return map(this.RULE_STACK, (currShortName) =>\n this.shortRuleNameToFullName(currShortName)\n )\n }\n}\n\nexport function attemptInRepetitionRecovery(\n this: MixedInParser,\n prodFunc: Function,\n args: any[],\n lookaheadFunc: () => boolean,\n dslMethodIdx: number,\n prodOccurrence: number,\n nextToksWalker: typeof AbstractNextTerminalAfterProductionWalker,\n notStuck?: boolean\n): void {\n const key = this.getKeyForAutomaticLookahead(dslMethodIdx, prodOccurrence)\n let firstAfterRepInfo = this.firstAfterRepMap[key]\n if (firstAfterRepInfo === undefined) {\n const currRuleName = this.getCurrRuleFullName()\n const ruleGrammar = this.getGAstProductions()[currRuleName]\n const walker: AbstractNextTerminalAfterProductionWalker =\n new nextToksWalker(ruleGrammar, prodOccurrence)\n firstAfterRepInfo = walker.startWalking()\n this.firstAfterRepMap[key] = firstAfterRepInfo\n }\n\n let expectTokAfterLastMatch = firstAfterRepInfo.token\n let nextTokIdx = firstAfterRepInfo.occurrence\n const isEndOfRule = firstAfterRepInfo.isEndOfRule\n\n // special edge case of a TOP most repetition after which the input should END.\n // this will force an attempt for inRule recovery in that scenario.\n if (\n this.RULE_STACK.length === 1 &&\n isEndOfRule &&\n expectTokAfterLastMatch === undefined\n ) {\n expectTokAfterLastMatch = EOF\n nextTokIdx = 1\n }\n\n // We don't have anything to re-sync to...\n // this condition was extracted from `shouldInRepetitionRecoveryBeTried` to act as a type-guard\n if (expectTokAfterLastMatch === undefined || nextTokIdx === undefined) {\n return\n }\n\n if (\n this.shouldInRepetitionRecoveryBeTried(\n expectTokAfterLastMatch,\n nextTokIdx,\n notStuck\n )\n ) {\n // TODO: performance optimization: instead of passing the original args here, we modify\n // the args param (or create a new one) and make sure the lookahead func is explicitly provided\n // to avoid searching the cache for it once more.\n this.tryInRepetitionRecovery(\n prodFunc,\n args,\n lookaheadFunc,\n expectTokAfterLastMatch\n )\n }\n}\n","// Lookahead keys are 32Bit integers in the form\n// TTTTTTTT-ZZZZZZZZZZZZ-YYYY-XXXXXXXX\n// XXXX -> Occurrence Index bitmap.\n// YYYY -> DSL Method Type bitmap.\n// ZZZZZZZZZZZZZZZ -> Rule short Index bitmap.\n// TTTTTTTTT -> alternation alternative index bitmap\n\nexport const BITS_FOR_METHOD_TYPE = 4\nexport const BITS_FOR_OCCURRENCE_IDX = 8\nexport const BITS_FOR_RULE_IDX = 12\n// TODO: validation, this means that there may at most 2^8 --> 256 alternatives for an alternation.\nexport const BITS_FOR_ALT_IDX = 8\n\n// short string used as part of mapping keys.\n// being short improves the performance when composing KEYS for maps out of these\n// The 5 - 8 bits (16 possible values, are reserved for the DSL method indices)\nexport const OR_IDX = 1 << BITS_FOR_OCCURRENCE_IDX\nexport const OPTION_IDX = 2 << BITS_FOR_OCCURRENCE_IDX\nexport const MANY_IDX = 3 << BITS_FOR_OCCURRENCE_IDX\nexport const AT_LEAST_ONE_IDX = 4 << BITS_FOR_OCCURRENCE_IDX\nexport const MANY_SEP_IDX = 5 << BITS_FOR_OCCURRENCE_IDX\nexport const AT_LEAST_ONE_SEP_IDX = 6 << BITS_FOR_OCCURRENCE_IDX\n\n// this actually returns a number, but it is always used as a string (object prop key)\nexport function getKeyForAutomaticLookahead(\n ruleIdx: number,\n dslMethodIdx: number,\n occurrence: number\n): number {\n return occurrence | dslMethodIdx | ruleIdx\n}\n\nconst BITS_START_FOR_ALT_IDX = 32 - BITS_FOR_ALT_IDX\n","import {\n ILookaheadStrategy,\n ILookaheadValidationError,\n IOrAlt,\n Rule,\n TokenType,\n OptionalProductionType\n} from \"@chevrotain/types\"\nimport flatMap from \"lodash/flatMap\"\nimport isEmpty from \"lodash/isEmpty\"\nimport { defaultGrammarValidatorErrorProvider } from \"../errors_public\"\nimport { DEFAULT_PARSER_CONFIG } from \"../parser/parser\"\nimport {\n validateAmbiguousAlternationAlternatives,\n validateEmptyOrAlternative,\n validateNoLeftRecursion,\n validateSomeNonEmptyLookaheadPath\n} from \"./checks\"\nimport {\n buildAlternativesLookAheadFunc,\n buildLookaheadFuncForOptionalProd,\n buildLookaheadFuncForOr,\n buildSingleAlternativeLookaheadFunction,\n getProdType\n} from \"./lookahead\"\nimport { IParserDefinitionError } from \"./types\"\n\nexport class LLkLookaheadStrategy implements ILookaheadStrategy {\n readonly maxLookahead: number\n\n constructor(options?: { maxLookahead?: number }) {\n this.maxLookahead =\n options?.maxLookahead ?? DEFAULT_PARSER_CONFIG.maxLookahead\n }\n\n validate(options: {\n rules: Rule[]\n tokenTypes: TokenType[]\n grammarName: string\n }): ILookaheadValidationError[] {\n const leftRecursionErrors = this.validateNoLeftRecursion(options.rules)\n\n if (isEmpty(leftRecursionErrors)) {\n const emptyAltErrors = this.validateEmptyOrAlternatives(options.rules)\n const ambiguousAltsErrors = this.validateAmbiguousAlternationAlternatives(\n options.rules,\n this.maxLookahead\n )\n const emptyRepetitionErrors = this.validateSomeNonEmptyLookaheadPath(\n options.rules,\n this.maxLookahead\n )\n const allErrors = [\n ...leftRecursionErrors,\n ...emptyAltErrors,\n ...ambiguousAltsErrors,\n ...emptyRepetitionErrors\n ]\n return allErrors\n }\n return leftRecursionErrors\n }\n\n validateNoLeftRecursion(rules: Rule[]): IParserDefinitionError[] {\n return flatMap(rules, (currTopRule) =>\n validateNoLeftRecursion(\n currTopRule,\n currTopRule,\n defaultGrammarValidatorErrorProvider\n )\n )\n }\n\n validateEmptyOrAlternatives(rules: Rule[]): IParserDefinitionError[] {\n return flatMap(rules, (currTopRule) =>\n validateEmptyOrAlternative(\n currTopRule,\n defaultGrammarValidatorErrorProvider\n )\n )\n }\n\n validateAmbiguousAlternationAlternatives(\n rules: Rule[],\n maxLookahead: number\n ): IParserDefinitionError[] {\n return flatMap(rules, (currTopRule) =>\n validateAmbiguousAlternationAlternatives(\n currTopRule,\n maxLookahead,\n defaultGrammarValidatorErrorProvider\n )\n )\n }\n\n validateSomeNonEmptyLookaheadPath(\n rules: Rule[],\n maxLookahead: number\n ): IParserDefinitionError[] {\n return validateSomeNonEmptyLookaheadPath(\n rules,\n maxLookahead,\n defaultGrammarValidatorErrorProvider\n )\n }\n\n buildLookaheadForAlternation(options: {\n prodOccurrence: number\n rule: Rule\n maxLookahead: number\n hasPredicates: boolean\n dynamicTokensEnabled: boolean\n }): (orAlts?: IOrAlt<any>[] | undefined) => number | undefined {\n return buildLookaheadFuncForOr(\n options.prodOccurrence,\n options.rule,\n options.maxLookahead,\n options.hasPredicates,\n options.dynamicTokensEnabled,\n buildAlternativesLookAheadFunc\n )\n }\n\n buildLookaheadForOptional(options: {\n prodOccurrence: number\n prodType: OptionalProductionType\n rule: Rule\n maxLookahead: number\n dynamicTokensEnabled: boolean\n }): () => boolean {\n return buildLookaheadFuncForOptionalProd(\n options.prodOccurrence,\n options.rule,\n options.maxLookahead,\n options.dynamicTokensEnabled,\n getProdType(options.prodType),\n buildSingleAlternativeLookaheadFunction\n )\n }\n}\n","import forEach from \"lodash/forEach\"\nimport has from \"lodash/has\"\nimport { DEFAULT_PARSER_CONFIG } from \"../parser\"\nimport {\n ILookaheadStrategy,\n IParserConfig,\n OptionalProductionType\n} from \"@chevrotain/types\"\nimport {\n AT_LEAST_ONE_IDX,\n AT_LEAST_ONE_SEP_IDX,\n getKeyForAutomaticLookahead,\n MANY_IDX,\n MANY_SEP_IDX,\n OPTION_IDX,\n OR_IDX\n} from \"../../grammar/keys\"\nimport { MixedInParser } from \"./parser_traits\"\nimport {\n Alternation,\n GAstVisitor,\n Option,\n Repetition,\n RepetitionMandatory,\n RepetitionMandatoryWithSeparator,\n RepetitionWithSeparator,\n Rule\n} from \"@chevrotain/gast\"\nimport { getProductionDslName } from \"@chevrotain/gast\"\nimport { LLkLookaheadStrategy } from \"../../grammar/llk_lookahead\"\n\n/**\n * Trait responsible for the lookahead related utilities and optimizations.\n */\nexport class LooksAhead {\n maxLookahead: number\n lookAheadFuncsCache: any\n dynamicTokensEnabled: boolean\n lookaheadStrategy: ILookaheadStrategy\n\n initLooksAhead(config: IParserConfig) {\n this.dynamicTokensEnabled = has(config, \"dynamicTokensEnabled\")\n ? (config.dynamicTokensEnabled as boolean) // assumes end user provides the correct config value/type\n : DEFAULT_PARSER_CONFIG.dynamicTokensEnabled\n\n this.maxLookahead = has(config, \"maxLookahead\")\n ? (config.maxLookahead as number) // assumes end user provides the correct config value/type\n : DEFAULT_PARSER_CONFIG.maxLookahead\n\n this.lookaheadStrategy = has(config, \"lookaheadStrategy\")\n ? (config.lookaheadStrategy as ILookaheadStrategy) // assumes end user provides the correct config value/type\n : new LLkLookaheadStrategy({ maxLookahead: this.maxLookahead })\n\n this.lookAheadFuncsCache = new Map()\n }\n\n preComputeLookaheadFunctions(this: MixedInParser, rules: Rule[]): void {\n forEach(rules, (currRule) => {\n this.TRACE_INIT(`${currRule.name} Rule Lookahead`, () => {\n const {\n alternation,\n repetition,\n option,\n repetitionMandatory,\n repetitionMandatoryWithSeparator,\n repetitionWithSeparator\n } = collectMethods(currRule)\n\n forEach(alternation, (currProd) => {\n const prodIdx = currProd.idx === 0 ? \"\" : currProd.idx\n this.TRACE_INIT(`${getProductionDslName(currProd)}${prodIdx}`, () => {\n const laFunc = this.lookaheadStrategy.buildLookaheadForAlternation({\n prodOccurrence: currProd.idx,\n rule: currRule,\n maxLookahead: currProd.maxLookahead || this.maxLookahead,\n hasPredicates: currProd.hasPredicates,\n dynamicTokensEnabled: this.dynamicTokensEnabled\n })\n\n const key = getKeyForAutomaticLookahead(\n this.fullRuleNameToShort[currRule.name],\n OR_IDX,\n currProd.idx\n )\n this.setLaFuncCache(key, laFunc)\n })\n })\n\n forEach(repetition, (currProd) => {\n this.computeLookaheadFunc(\n currRule,\n currProd.idx,\n MANY_IDX,\n \"Repetition\",\n currProd.maxLookahead,\n getProductionDslName(currProd)\n )\n })\n\n forEach(option, (currProd) => {\n this.computeLookaheadFunc(\n currRule,\n currProd.idx,\n OPTION_IDX,\n \"Option\",\n currProd.maxLookahead,\n getProductionDslName(currProd)\n )\n })\n\n forEach(repetitionMandatory, (currProd) => {\n this.computeLookaheadFunc(\n currRule,\n currProd.idx,\n AT_LEAST_ONE_IDX,\n \"RepetitionMandatory\",\n currProd.maxLookahead,\n getProductionDslName(currProd)\n )\n })\n\n forEach(repetitionMandatoryWithSeparator, (currProd) => {\n this.computeLookaheadFunc(\n currRule,\n currProd.idx,\n AT_LEAST_ONE_SEP_IDX,\n \"RepetitionMandatoryWithSeparator\",\n currProd.maxLookahead,\n getProductionDslName(currProd)\n )\n })\n\n forEach(repetitionWithSeparator, (currProd) => {\n this.computeLookaheadFunc(\n currRule,\n currProd.idx,\n MANY_SEP_IDX,\n \"RepetitionWithSeparator\",\n currProd.maxLookahead,\n getProductionDslName(currProd)\n )\n })\n })\n })\n }\n\n computeLookaheadFunc(\n this: MixedInParser,\n rule: Rule,\n prodOccurrence: number,\n prodKey: number,\n prodType: OptionalProductionType,\n prodMaxLookahead: number | undefined,\n dslMethodName: string\n ): void {\n this.TRACE_INIT(\n `${dslMethodName}${prodOccurrence === 0 ? \"\" : prodOccurrence}`,\n () => {\n const laFunc = this.lookaheadStrategy.buildLookaheadForOptional({\n prodOccurrence,\n rule,\n maxLookahead: prodMaxLookahead || this.maxLookahead,\n dynamicTokensEnabled: this.dynamicTokensEnabled,\n prodType\n })\n const key = getKeyForAutomaticLookahead(\n this.fullRuleNameToShort[rule.name],\n prodKey,\n prodOccurrence\n )\n this.setLaFuncCache(key, laFunc)\n }\n )\n }\n\n // this actually returns a number, but it is always used as a string (object prop key)\n getKeyForAutomaticLookahead(\n this: MixedInParser,\n dslMethodIdx: number,\n occurrence: number\n ): number {\n const currRuleShortName: any = this.getLastExplicitRuleShortName()\n return getKeyForAutomaticLookahead(\n currRuleShortName,\n dslMethodIdx,\n occurrence\n )\n }\n\n getLaFuncFromCache(this: MixedInParser, key: number): Function {\n return this.lookAheadFuncsCache.get(key)\n }\n\n /* istanbul ignore next */\n setLaFuncCache(this: MixedInParser, key: number, value: Function): void {\n this.lookAheadFuncsCache.set(key, value)\n }\n}\n\nclass DslMethodsCollectorVisitor extends GAstVisitor {\n public dslMethods: {\n option: Option[]\n alternation: Alternation[]\n repetition: Repetition[]\n repetitionWithSeparator: RepetitionWithSeparator[]\n repetitionMandatory: RepetitionMandatory[]\n repetitionMandatoryWithSeparator: RepetitionMandatoryWithSeparator[]\n } = {\n option: [],\n alternation: [],\n repetition: [],\n repetitionWithSeparator: [],\n repetitionMandatory: [],\n repetitionMandatoryWithSeparator: []\n }\n\n reset() {\n this.dslMethods = {\n option: [],\n alternation: [],\n repetition: [],\n repetitionWithSeparator: [],\n repetitionMandatory: [],\n repetitionMandatoryWithSeparator: []\n }\n }\n\n public visitOption(option: Option): void {\n this.dslMethods.option.push(option)\n }\n\n public visitRepetitionWithSeparator(manySep: RepetitionWithSeparator): void {\n this.dslMethods.repetitionWithSeparator.push(manySep)\n }\n\n public visitRepetitionMandatory(atLeastOne: RepetitionMandatory): void {\n this.dslMethods.repetitionMandatory.push(atLeastOne)\n }\n\n public visitRepetitionMandatoryWithSeparator(\n atLeastOneSep: RepetitionMandatoryWithSeparator\n ): void {\n this.dslMethods.repetitionMandatoryWithSeparator.push(atLeastOneSep)\n }\n\n public visitRepetition(many: Repetition): void {\n this.dslMethods.repetition.push(many)\n }\n\n public visitAlternation(or: Alternation): void {\n this.dslMethods.alternation.push(or)\n }\n}\n\nconst collectorVisitor = new DslMethodsCollectorVisitor()\nexport function collectMethods(rule: Rule): {\n option: Option[]\n alternation: Alternation[]\n repetition: Repetition[]\n repetitionWithSeparator: RepetitionWithSeparator[]\n repetitionMandatory: RepetitionMandatory[]\n repetitionMandatoryWithSeparator: RepetitionMandatoryWithSeparator[]\n} {\n collectorVisitor.reset()\n rule.accept(collectorVisitor)\n const dslMethods = collectorVisitor.dslMethods\n // avoid uncleaned references\n collectorVisitor.reset()\n return <any>dslMethods\n}\n","import { CstNode, CstNodeLocation, IToken } from \"@chevrotain/types\"\n\n/**\n * This nodeLocation tracking is not efficient and should only be used\n * when error recovery is enabled or the Token Vector contains virtual Tokens\n * (e.g, Python Indent/Outdent)\n * As it executes the calculation for every single terminal/nonTerminal\n * and does not rely on the fact the token vector is **sorted**\n */\nexport function setNodeLocationOnlyOffset(\n currNodeLocation: CstNodeLocation,\n newLocationInfo: Required<Pick<IToken, \"startOffset\" | \"endOffset\">>\n): void {\n // First (valid) update for this cst node\n if (isNaN(currNodeLocation.startOffset) === true) {\n // assumption1: Token location information is either NaN or a valid number\n // assumption2: Token location information is fully valid if it exist\n // (both start/end offsets exist and are numbers).\n currNodeLocation.startOffset = newLocationInfo.startOffset\n currNodeLocation.endOffset = newLocationInfo.endOffset\n }\n // Once the startOffset has been updated with a valid number it should never receive\n // any farther updates as the Token vector is sorted.\n // We still have to check this this condition for every new possible location info\n // because with error recovery enabled we may encounter invalid tokens (NaN location props)\n else if (currNodeLocation.endOffset! < newLocationInfo.endOffset === true) {\n currNodeLocation.endOffset = newLocationInfo.endOffset\n }\n}\n\n/**\n * This nodeLocation tracking is not efficient and should only be used\n * when error recovery is enabled or the Token Vector contains virtual Tokens\n * (e.g, Python Indent/Outdent)\n * As it executes the calculation for every single terminal/nonTerminal\n * and does not rely on the fact the token vector is **sorted**\n */\nexport function setNodeLocationFull(\n currNodeLocation: CstNodeLocation,\n newLocationInfo: CstNodeLocation\n): void {\n // First (valid) update for this cst node\n if (isNaN(currNodeLocation.startOffset) === true) {\n // assumption1: Token location information is either NaN or a valid number\n // assumption2: Token location information is fully valid if it exist\n // (all start/end props exist and are numbers).\n currNodeLocation.startOffset = newLocationInfo.startOffset\n currNodeLocation.startColumn = newLocationInfo.startColumn\n currNodeLocation.startLine = newLocationInfo.startLine\n currNodeLocation.endOffset = newLocationInfo.endOffset\n currNodeLocation.endColumn = newLocationInfo.endColumn\n currNodeLocation.endLine = newLocationInfo.endLine\n }\n // Once the start props has been updated with a valid number it should never receive\n // any farther updates as the Token vector is sorted.\n // We still have to check this this condition for every new possible location info\n // because with error recovery enabled we may encounter invalid tokens (NaN location props)\n else if (currNodeLocation.endOffset! < newLocationInfo.endOffset! === true) {\n currNodeLocation.endOffset = newLocationInfo.endOffset\n currNodeLocation.endColumn = newLocationInfo.endColumn\n currNodeLocation.endLine = newLocationInfo.endLine\n }\n}\n\nexport function addTerminalToCst(\n node: CstNode,\n token: IToken,\n tokenTypeName: string\n): void {\n if (node.children[tokenTypeName] === undefined) {\n node.children[tokenTypeName] = [token]\n } else {\n node.children[tokenTypeName].push(token)\n }\n}\n\nexport function addNoneTerminalToCst(\n node: CstNode,\n ruleName: string,\n ruleResult: any\n): void {\n if (node.children[ruleName] === undefined) {\n node.children[ruleName] = [ruleResult]\n } else {\n node.children[ruleName].push(ruleResult)\n }\n}\n","const NAME = \"name\"\n\nexport function defineNameProp(obj: {}, nameValue: string): void {\n Object.defineProperty(obj, NAME, {\n enumerable: false,\n configurable: true,\n writable: false,\n value: nameValue\n })\n}\n","import isEmpty from \"lodash/isEmpty\"\nimport compact from \"lodash/compact\"\nimport isArray from \"lodash/isArray\"\nimport map from \"lodash/map\"\nimport forEach from \"lodash/forEach\"\nimport filter from \"lodash/filter\"\nimport keys from \"lodash/keys\"\nimport isFunction from \"lodash/isFunction\"\nimport isUndefined from \"lodash/isUndefined\"\nimport { defineNameProp } from \"../../lang/lang_extensions\"\nimport { CstNode, ICstVisitor } from \"@chevrotain/types\"\n\nexport function defaultVisit<IN>(ctx: any, param: IN): void {\n const childrenNames = keys(ctx)\n const childrenNamesLength = childrenNames.length\n for (let i = 0; i < childrenNamesLength; i++) {\n const currChildName = childrenNames[i]\n const currChildArray = ctx[currChildName]\n const currChildArrayLength = currChildArray.length\n for (let j = 0; j < currChildArrayLength; j++) {\n const currChild: any = currChildArray[j]\n // distinction between Tokens Children and CstNode children\n if (currChild.tokenTypeIdx === undefined) {\n this[currChild.name](currChild.children, param)\n }\n }\n }\n // defaultVisit does not support generic out param\n}\n\nexport function createBaseSemanticVisitorConstructor(\n grammarName: string,\n ruleNames: string[]\n): {\n new (...args: any[]): ICstVisitor<any, any>\n} {\n const derivedConstructor: any = function () {}\n\n // can be overwritten according to:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/\n // name?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FFunction%2Fname\n defineNameProp(derivedConstructor, grammarName + \"BaseSemantics\")\n\n const semanticProto = {\n visit: function (cstNode: CstNode | CstNode[], param: any) {\n // enables writing more concise visitor methods when CstNode has only a single child\n if (isArray(cstNode)) {\n // A CST Node's children dictionary can never have empty arrays as values\n // If a key is defined there will be at least one element in the corresponding value array.\n cstNode = cstNode[0]\n }\n\n // enables passing optional CstNodes concisely.\n if (isUndefined(cstNode)) {\n return undefined\n }\n\n return this[cstNode.name](cstNode.children, param)\n },\n\n validateVisitor: function () {\n const semanticDefinitionErrors = validateVisitor(this, ruleNames)\n if (!isEmpty(semanticDefinitionErrors)) {\n const errorMessages = map(\n semanticDefinitionErrors,\n (currDefError) => currDefError.msg\n )\n throw Error(\n `Errors Detected in CST Visitor <${this.constructor.name}>:\\n\\t` +\n `${errorMessages.join(\"\\n\\n\").replace(/\\n/g, \"\\n\\t\")}`\n )\n }\n }\n }\n\n derivedConstructor.prototype = semanticProto\n derivedConstructor.prototype.constructor = derivedConstructor\n\n derivedConstructor._RULE_NAMES = ruleNames\n\n return derivedConstructor\n}\n\nexport function createBaseVisitorConstructorWithDefaults(\n grammarName: string,\n ruleNames: string[],\n baseConstructor: Function\n): {\n new (...args: any[]): ICstVisitor<any, any>\n} {\n const derivedConstructor: any = function () {}\n\n // can be overwritten according to:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/\n // name?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FFunction%2Fname\n defineNameProp(derivedConstructor, grammarName + \"BaseSemanticsWithDefaults\")\n\n const withDefaultsProto = Object.create(baseConstructor.prototype)\n forEach(ruleNames, (ruleName) => {\n withDefaultsProto[ruleName] = defaultVisit\n })\n\n derivedConstructor.prototype = withDefaultsProto\n derivedConstructor.prototype.constructor = derivedConstructor\n\n return derivedConstructor\n}\n\nexport enum CstVisitorDefinitionError {\n REDUNDANT_METHOD,\n MISSING_METHOD\n}\n\nexport interface IVisitorDefinitionError {\n msg: string\n type: CstVisitorDefinitionError\n methodName: string\n}\n\nexport function validateVisitor(\n visitorInstance: ICstVisitor<unknown, unknown>,\n ruleNames: string[]\n): IVisitorDefinitionError[] {\n const missingErrors = validateMissingCstMethods(visitorInstance, ruleNames)\n\n return missingErrors\n}\n\nexport function validateMissingCstMethods(\n visitorInstance: ICstVisitor<unknown, unknown>,\n ruleNames: string[]\n): IVisitorDefinitionError[] {\n const missingRuleNames = filter(ruleNames, (currRuleName) => {\n return isFunction((visitorInstance as any)[currRuleName]) === false\n })\n\n const errors: IVisitorDefinitionError[] = map(\n missingRuleNames,\n (currRuleName) => {\n return {\n msg: `Missing visitor method: <${currRuleName}> on ${<any>(\n visitorInstance.constructor.name\n )} CST Visitor.`,\n type: CstVisitorDefinitionError.MISSING_METHOD,\n methodName: currRuleName\n }\n }\n )\n\n return compact<IVisitorDefinitionError>(errors)\n}\n","import {\n addNoneTerminalToCst,\n addTerminalToCst,\n setNodeLocationFull,\n setNodeLocationOnlyOffset\n} from \"../../cst/cst\"\nimport noop from \"lodash/noop\"\nimport has from \"lodash/has\"\nimport keys from \"lodash/keys\"\nimport isUndefined from \"lodash/isUndefined\"\nimport {\n createBaseSemanticVisitorConstructor,\n createBaseVisitorConstructorWithDefaults\n} from \"../../cst/cst_visitor\"\nimport {\n CstNode,\n CstNodeLocation,\n ICstVisitor,\n IParserConfig,\n IToken,\n nodeLocationTrackingOptions\n} from \"@chevrotain/types\"\nimport { MixedInParser } from \"./parser_traits\"\nimport { DEFAULT_PARSER_CONFIG } from \"../parser\"\n\n/**\n * This trait is responsible for the CST building logic.\n */\nexport class TreeBuilder {\n outputCst: boolean\n CST_STACK: CstNode[]\n baseCstVisitorConstructor: Function\n baseCstVisitorWithDefaultsConstructor: Function\n\n // dynamically assigned Methods\n setNodeLocationFromNode: (\n nodeLocation: CstNodeLocation,\n locationInformation: CstNodeLocation\n ) => void\n setNodeLocationFromToken: (\n nodeLocation: CstNodeLocation,\n locationInformation: CstNodeLocation\n ) => void\n cstPostRule: (this: MixedInParser, ruleCstNode: CstNode) => void\n\n setInitialNodeLocation: (cstNode: CstNode) => void\n nodeLocationTracking: nodeLocationTrackingOptions\n\n initTreeBuilder(this: MixedInParser, config: IParserConfig) {\n this.CST_STACK = []\n\n // outputCst is no longer exposed/defined in the pubic API\n this.outputCst = (config as any).outputCst\n\n this.nodeLocationTracking = has(config, \"nodeLocationTracking\")\n ? (config.nodeLocationTracking as nodeLocationTrackingOptions) // assumes end user provides the correct config value/type\n : DEFAULT_PARSER_CONFIG.nodeLocationTracking\n\n if (!this.outputCst) {\n this.cstInvocationStateUpdate = noop\n this.cstFinallyStateUpdate = noop\n this.cstPostTerminal = noop\n this.cstPostNonTerminal = noop\n this.cstPostRule = noop\n } else {\n if (/full/i.test(this.nodeLocationTracking)) {\n if (this.recoveryEnabled) {\n this.setNodeLocationFromToken = setNodeLocationFull\n this.setNodeLocationFromNode = setNodeLocationFull\n this.cstPostRule = noop\n this.setInitialNodeLocation = this.setInitialNodeLocationFullRecovery\n } else {\n this.setNodeLocationFromToken = noop\n this.setNodeLocationFromNode = noop\n this.cstPostRule = this.cstPostRuleFull\n this.setInitialNodeLocation = this.setInitialNodeLocationFullRegular\n }\n } else if (/onlyOffset/i.test(this.nodeLocationTracking)) {\n if (this.recoveryEnabled) {\n this.setNodeLocationFromToken = <any>setNodeLocationOnlyOffset\n this.setNodeLocationFromNode = <any>setNodeLocationOnlyOffset\n this.cstPostRule = noop\n this.setInitialNodeLocation =\n this.setInitialNodeLocationOnlyOffsetRecovery\n } else {\n this.setNodeLocationFromToken = noop\n this.setNodeLocationFromNode = noop\n this.cstPostRule = this.cstPostRuleOnlyOffset\n this.setInitialNodeLocation =\n this.setInitialNodeLocationOnlyOffsetRegular\n }\n } else if (/none/i.test(this.nodeLocationTracking)) {\n this.setNodeLocationFromToken = noop\n this.setNodeLocationFromNode = noop\n this.cstPostRule = noop\n this.setInitialNodeLocation = noop\n } else {\n throw Error(\n `Invalid <nodeLocationTracking> config option: \"${config.nodeLocationTracking}\"`\n )\n }\n }\n }\n\n setInitialNodeLocationOnlyOffsetRecovery(\n this: MixedInParser,\n cstNode: any\n ): void {\n cstNode.location = {\n startOffset: NaN,\n endOffset: NaN\n }\n }\n\n setInitialNodeLocationOnlyOffsetRegular(\n this: MixedInParser,\n cstNode: any\n ): void {\n cstNode.location = {\n // without error recovery the starting Location of a new CstNode is guaranteed\n // To be the next Token's startOffset (for valid inputs).\n // For invalid inputs there won't be any CSTOutput so this potential\n // inaccuracy does not matter\n startOffset: this.LA(1).startOffset,\n endOffset: NaN\n }\n }\n\n setInitialNodeLocationFullRecovery(this: MixedInParser, cstNode: any): void {\n cstNode.location = {\n startOffset: NaN,\n startLine: NaN,\n startColumn: NaN,\n endOffset: NaN,\n endLine: NaN,\n endColumn: NaN\n }\n }\n\n /**\n * @see setInitialNodeLocationOnlyOffsetRegular for explanation why this work\n\n * @param cstNode\n */\n setInitialNodeLocationFullRegular(this: MixedInParser, cstNode: any): void {\n const nextToken = this.LA(1)\n cstNode.location = {\n startOffset: nextToken.startOffset,\n startLine: nextToken.startLine,\n startColumn: nextToken.startColumn,\n endOffset: NaN,\n endLine: NaN,\n endColumn: NaN\n }\n }\n\n cstInvocationStateUpdate(this: MixedInParser, fullRuleName: string): void {\n const cstNode: CstNode = {\n name: fullRuleName,\n children: Object.create(null)\n }\n\n this.setInitialNodeLocation(cstNode)\n this.CST_STACK.push(cstNode)\n }\n\n cstFinallyStateUpdate(this: MixedInParser): void {\n this.CST_STACK.pop()\n }\n\n cstPostRuleFull(this: MixedInParser, ruleCstNode: CstNode): void {\n // casts to `required<CstNodeLocation>` are safe because `cstPostRuleFull` should only be invoked when full location is enabled\n const prevToken = this.LA(0) as Required<CstNodeLocation>\n const loc = ruleCstNode.location as Required<CstNodeLocation>\n\n // If this condition is true it means we consumed at least one Token\n // In this CstNode.\n if (loc.startOffset <= prevToken.startOffset === true) {\n loc.endOffset = prevToken.endOffset\n loc.endLine = prevToken.endLine\n loc.endColumn = prevToken.endColumn\n }\n // \"empty\" CstNode edge case\n else {\n loc.startOffset = NaN\n loc.startLine = NaN\n loc.startColumn = NaN\n }\n }\n\n cstPostRuleOnlyOffset(this: MixedInParser, ruleCstNode: CstNode): void {\n const prevToken = this.LA(0)\n // `location' is not null because `cstPostRuleOnlyOffset` will only be invoked when location tracking is enabled.\n const loc = ruleCstNode.location!\n\n // If this condition is true it means we consumed at least one Token\n // In this CstNode.\n if (loc.startOffset <= prevToken.startOffset === true) {\n loc.endOffset = prevToken.endOffset\n }\n // \"empty\" CstNode edge case\n else {\n loc.startOffset = NaN\n }\n }\n\n cstPostTerminal(\n this: MixedInParser,\n key: string,\n consumedToken: IToken\n ): void {\n const rootCst = this.CST_STACK[this.CST_STACK.length - 1]\n addTerminalToCst(rootCst, consumedToken, key)\n // This is only used when **both** error recovery and CST Output are enabled.\n this.setNodeLocationFromToken(rootCst.location!, <any>consumedToken)\n }\n\n cstPostNonTerminal(\n this: MixedInParser,\n ruleCstResult: CstNode,\n ruleName: string\n ): void {\n const preCstNode = this.CST_STACK[this.CST_STACK.length - 1]\n addNoneTerminalToCst(preCstNode, ruleName, ruleCstResult)\n // This is only used when **both** error recovery and CST Output are enabled.\n this.setNodeLocationFromNode(preCstNode.location!, ruleCstResult.location!)\n }\n\n getBaseCstVisitorConstructor<IN = any, OUT = any>(\n this: MixedInParser\n ): {\n new (...args: any[]): ICstVisitor<IN, OUT>\n } {\n if (isUndefined(this.baseCstVisitorConstructor)) {\n const newBaseCstVisitorConstructor = createBaseSemanticVisitorConstructor(\n this.className,\n keys(this.gastProductionsCache)\n )\n this.baseCstVisitorConstructor = newBaseCstVisitorConstructor\n return newBaseCstVisitorConstructor\n }\n\n return <any>this.baseCstVisitorConstructor\n }\n\n getBaseCstVisitorConstructorWithDefaults<IN = any, OUT = any>(\n this: MixedInParser\n ): {\n new (...args: any[]): ICstVisitor<IN, OUT>\n } {\n if (isUndefined(this.baseCstVisitorWithDefaultsConstructor)) {\n const newConstructor = createBaseVisitorConstructorWithDefaults(\n this.className,\n keys(this.gastProductionsCache),\n this.getBaseCstVisitorConstructor()\n )\n this.baseCstVisitorWithDefaultsConstructor = newConstructor\n return newConstructor\n }\n\n return <any>this.baseCstVisitorWithDefaultsConstructor\n }\n\n getLastExplicitRuleShortName(this: MixedInParser): number {\n const ruleStack = this.RULE_STACK\n return ruleStack[ruleStack.length - 1]\n }\n\n getPreviousExplicitRuleShortName(this: MixedInParser): number {\n const ruleStack = this.RULE_STACK\n return ruleStack[ruleStack.length - 2]\n }\n\n getLastExplicitRuleOccurrenceIndex(this: MixedInParser): number {\n const occurrenceStack = this.RULE_OCCURRENCE_STACK\n return occurrenceStack[occurrenceStack.length - 1]\n }\n}\n","import { END_OF_FILE } from \"../parser\"\nimport { IToken } from \"@chevrotain/types\"\nimport { MixedInParser } from \"./parser_traits\"\n\n/**\n * Trait responsible abstracting over the interaction with Lexer output (Token vector).\n *\n * This could be generalized to support other kinds of lexers, e.g.\n * - Just in Time Lexing / Lexer-Less parsing.\n * - Streaming Lexer.\n */\nexport class LexerAdapter {\n tokVector: IToken[]\n tokVectorLength: number\n currIdx: number\n\n initLexerAdapter() {\n this.tokVector = []\n this.tokVectorLength = 0\n this.currIdx = -1\n }\n\n set input(newInput: IToken[]) {\n // @ts-ignore - `this parameter` not supported in setters/getters\n // - https://www.typescriptlang.org/docs/handbook/functions.html#this-parameters\n if (this.selfAnalysisDone !== true) {\n throw Error(\n `Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.`\n )\n }\n // @ts-ignore - `this parameter` not supported in setters/getters\n // - https://www.typescriptlang.org/docs/handbook/functions.html#this-parameters\n this.reset()\n this.tokVector = newInput\n this.tokVectorLength = newInput.length\n }\n\n get input(): IToken[] {\n return this.tokVector\n }\n\n // skips a token and returns the next token\n SKIP_TOKEN(this: MixedInParser): IToken {\n if (this.currIdx <= this.tokVector.length - 2) {\n this.consumeToken()\n return this.LA(1)\n } else {\n return END_OF_FILE\n }\n }\n\n // Lexer (accessing Token vector) related methods which can be overridden to implement lazy lexers\n // or lexers dependent on parser context.\n LA(this: MixedInParser, howMuch: number): IToken {\n const soughtIdx = this.currIdx + howMuch\n if (soughtIdx < 0 || this.tokVectorLength <= soughtIdx) {\n return END_OF_FILE\n } else {\n return this.tokVector[soughtIdx]\n }\n }\n\n consumeToken(this: MixedInParser) {\n this.currIdx++\n }\n\n exportLexerState(this: MixedInParser): number {\n return this.currIdx\n }\n\n importLexerState(this: MixedInParser, newState: number) {\n this.currIdx = newState\n }\n\n resetLexerState(this: MixedInParser): void {\n this.currIdx = -1\n }\n\n moveToTerminatedState(this: MixedInParser): void {\n this.currIdx = this.tokVector.length - 1\n }\n\n getLexerPosition(this: MixedInParser): number {\n return this.exportLexerState()\n }\n}\n","import {\n AtLeastOneSepMethodOpts,\n ConsumeMethodOpts,\n DSLMethodOpts,\n DSLMethodOptsWithErr,\n GrammarAction,\n IOrAlt,\n IRuleConfig,\n ISerializedGast,\n IToken,\n ManySepMethodOpts,\n OrMethodOpts,\n SubruleMethodOpts,\n TokenType\n} from \"@chevrotain/types\"\nimport values from \"lodash/values\"\nimport includes from \"lodash/includes\"\nimport { isRecognitionException } from \"../../exceptions_public\"\nimport { DEFAULT_RULE_CONFIG, ParserDefinitionErrorType } from \"../parser\"\nimport { defaultGrammarValidatorErrorProvider } from \"../../errors_public\"\nimport { validateRuleIsOverridden } from \"../../grammar/checks\"\nimport { MixedInParser } from \"./parser_traits\"\nimport { Rule, serializeGrammar } from \"@chevrotain/gast\"\nimport { IParserDefinitionError } from \"../../grammar/types\"\nimport { ParserMethodInternal } from \"../types\"\n\n/**\n * This trait is responsible for implementing the public API\n * for defining Chevrotain parsers, i.e:\n * - CONSUME\n * - RULE\n * - OPTION\n * - ...\n */\nexport class RecognizerApi {\n ACTION<T>(this: MixedInParser, impl: () => T): T {\n return impl.call(this)\n }\n\n consume(\n this: MixedInParser,\n idx: number,\n tokType: TokenType,\n options?: ConsumeMethodOpts\n ): IToken {\n return this.consumeInternal(tokType, idx, options)\n }\n\n subrule<ARGS extends unknown[], R>(\n this: MixedInParser,\n idx: number,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n options?: SubruleMethodOpts<ARGS>\n ): R {\n return this.subruleInternal(ruleToCall, idx, options)\n }\n\n option<OUT>(\n this: MixedInParser,\n idx: number,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): OUT | undefined {\n return this.optionInternal(actionORMethodDef, idx)\n }\n\n or(\n this: MixedInParser,\n idx: number,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<any>\n ): any {\n return this.orInternal(altsOrOpts, idx)\n }\n\n many(\n this: MixedInParser,\n idx: number,\n actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>\n ): void {\n return this.manyInternal(idx, actionORMethodDef)\n }\n\n atLeastOne(\n this: MixedInParser,\n idx: number,\n actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>\n ): void {\n return this.atLeastOneInternal(idx, actionORMethodDef)\n }\n\n CONSUME(\n this: MixedInParser,\n tokType: TokenType,\n options?: ConsumeMethodOpts\n ): IToken {\n return this.consumeInternal(tokType, 0, options)\n }\n\n CONSUME1(\n this: MixedInParser,\n tokType: TokenType,\n options?: ConsumeMethodOpts\n ): IToken {\n return this.consumeInternal(tokType, 1, options)\n }\n\n CONSUME2(\n this: MixedInParser,\n tokType: TokenType,\n options?: ConsumeMethodOpts\n ): IToken {\n return this.consumeInternal(tokType, 2, options)\n }\n\n CONSUME3(\n this: MixedInParser,\n tokType: TokenType,\n options?: ConsumeMethodOpts\n ): IToken {\n return this.consumeInternal(tokType, 3, options)\n }\n\n CONSUME4(\n this: MixedInParser,\n tokType: TokenType,\n options?: ConsumeMethodOpts\n ): IToken {\n return this.consumeInternal(tokType, 4, options)\n }\n\n CONSUME5(\n this: MixedInParser,\n tokType: TokenType,\n options?: ConsumeMethodOpts\n ): IToken {\n return this.consumeInternal(tokType, 5, options)\n }\n\n CONSUME6(\n this: MixedInParser,\n tokType: TokenType,\n options?: ConsumeMethodOpts\n ): IToken {\n return this.consumeInternal(tokType, 6, options)\n }\n\n CONSUME7(\n this: MixedInParser,\n tokType: TokenType,\n options?: ConsumeMethodOpts\n ): IToken {\n return this.consumeInternal(tokType, 7, options)\n }\n\n CONSUME8(\n this: MixedInParser,\n tokType: TokenType,\n options?: ConsumeMethodOpts\n ): IToken {\n return this.consumeInternal(tokType, 8, options)\n }\n\n CONSUME9(\n this: MixedInParser,\n tokType: TokenType,\n options?: ConsumeMethodOpts\n ): IToken {\n return this.consumeInternal(tokType, 9, options)\n }\n\n SUBRULE<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n options?: SubruleMethodOpts<ARGS>\n ): R {\n return this.subruleInternal(ruleToCall, 0, options)\n }\n\n SUBRULE1<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n options?: SubruleMethodOpts<ARGS>\n ): R {\n return this.subruleInternal(ruleToCall, 1, options)\n }\n\n SUBRULE2<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n options?: SubruleMethodOpts<ARGS>\n ): R {\n return this.subruleInternal(ruleToCall, 2, options)\n }\n\n SUBRULE3<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n options?: SubruleMethodOpts<ARGS>\n ): R {\n return this.subruleInternal(ruleToCall, 3, options)\n }\n\n SUBRULE4<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n options?: SubruleMethodOpts<ARGS>\n ): R {\n return this.subruleInternal(ruleToCall, 4, options)\n }\n\n SUBRULE5<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n options?: SubruleMethodOpts<ARGS>\n ): R {\n return this.subruleInternal(ruleToCall, 5, options)\n }\n\n SUBRULE6<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n options?: SubruleMethodOpts<ARGS>\n ): R {\n return this.subruleInternal(ruleToCall, 6, options)\n }\n\n SUBRULE7<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n options?: SubruleMethodOpts<ARGS>\n ): R {\n return this.subruleInternal(ruleToCall, 7, options)\n }\n\n SUBRULE8<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n options?: SubruleMethodOpts<ARGS>\n ): R {\n return this.subruleInternal(ruleToCall, 8, options)\n }\n\n SUBRULE9<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n options?: SubruleMethodOpts<ARGS>\n ): R {\n return this.subruleInternal(ruleToCall, 9, options)\n }\n\n OPTION<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): OUT | undefined {\n return this.optionInternal(actionORMethodDef, 0)\n }\n\n OPTION1<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): OUT | undefined {\n return this.optionInternal(actionORMethodDef, 1)\n }\n\n OPTION2<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): OUT | undefined {\n return this.optionInternal(actionORMethodDef, 2)\n }\n\n OPTION3<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): OUT | undefined {\n return this.optionInternal(actionORMethodDef, 3)\n }\n\n OPTION4<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): OUT | undefined {\n return this.optionInternal(actionORMethodDef, 4)\n }\n\n OPTION5<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): OUT | undefined {\n return this.optionInternal(actionORMethodDef, 5)\n }\n\n OPTION6<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): OUT | undefined {\n return this.optionInternal(actionORMethodDef, 6)\n }\n\n OPTION7<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): OUT | undefined {\n return this.optionInternal(actionORMethodDef, 7)\n }\n\n OPTION8<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): OUT | undefined {\n return this.optionInternal(actionORMethodDef, 8)\n }\n\n OPTION9<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): OUT | undefined {\n return this.optionInternal(actionORMethodDef, 9)\n }\n\n OR<T>(\n this: MixedInParser,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<unknown>\n ): T {\n return this.orInternal(altsOrOpts, 0)\n }\n\n OR1<T>(\n this: MixedInParser,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<unknown>\n ): T {\n return this.orInternal(altsOrOpts, 1)\n }\n\n OR2<T>(\n this: MixedInParser,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<unknown>\n ): T {\n return this.orInternal(altsOrOpts, 2)\n }\n\n OR3<T>(\n this: MixedInParser,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<unknown>\n ): T {\n return this.orInternal(altsOrOpts, 3)\n }\n\n OR4<T>(\n this: MixedInParser,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<unknown>\n ): T {\n return this.orInternal(altsOrOpts, 4)\n }\n\n OR5<T>(\n this: MixedInParser,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<unknown>\n ): T {\n return this.orInternal(altsOrOpts, 5)\n }\n\n OR6<T>(\n this: MixedInParser,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<unknown>\n ): T {\n return this.orInternal(altsOrOpts, 6)\n }\n\n OR7<T>(\n this: MixedInParser,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<unknown>\n ): T {\n return this.orInternal(altsOrOpts, 7)\n }\n\n OR8<T>(\n this: MixedInParser,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<unknown>\n ): T {\n return this.orInternal(altsOrOpts, 8)\n }\n\n OR9<T>(\n this: MixedInParser,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<unknown>\n ): T {\n return this.orInternal(altsOrOpts, 9)\n }\n\n MANY<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): void {\n this.manyInternal(0, actionORMethodDef)\n }\n\n MANY1<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): void {\n this.manyInternal(1, actionORMethodDef)\n }\n\n MANY2<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): void {\n this.manyInternal(2, actionORMethodDef)\n }\n\n MANY3<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): void {\n this.manyInternal(3, actionORMethodDef)\n }\n\n MANY4<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): void {\n this.manyInternal(4, actionORMethodDef)\n }\n\n MANY5<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): void {\n this.manyInternal(5, actionORMethodDef)\n }\n\n MANY6<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): void {\n this.manyInternal(6, actionORMethodDef)\n }\n\n MANY7<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): void {\n this.manyInternal(7, actionORMethodDef)\n }\n\n MANY8<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): void {\n this.manyInternal(8, actionORMethodDef)\n }\n\n MANY9<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): void {\n this.manyInternal(9, actionORMethodDef)\n }\n\n MANY_SEP<OUT>(this: MixedInParser, options: ManySepMethodOpts<OUT>): void {\n this.manySepFirstInternal(0, options)\n }\n\n MANY_SEP1<OUT>(this: MixedInParser, options: ManySepMethodOpts<OUT>): void {\n this.manySepFirstInternal(1, options)\n }\n\n MANY_SEP2<OUT>(this: MixedInParser, options: ManySepMethodOpts<OUT>): void {\n this.manySepFirstInternal(2, options)\n }\n\n MANY_SEP3<OUT>(this: MixedInParser, options: ManySepMethodOpts<OUT>): void {\n this.manySepFirstInternal(3, options)\n }\n\n MANY_SEP4<OUT>(this: MixedInParser, options: ManySepMethodOpts<OUT>): void {\n this.manySepFirstInternal(4, options)\n }\n\n MANY_SEP5<OUT>(this: MixedInParser, options: ManySepMethodOpts<OUT>): void {\n this.manySepFirstInternal(5, options)\n }\n\n MANY_SEP6<OUT>(this: MixedInParser, options: ManySepMethodOpts<OUT>): void {\n this.manySepFirstInternal(6, options)\n }\n\n MANY_SEP7<OUT>(this: MixedInParser, options: ManySepMethodOpts<OUT>): void {\n this.manySepFirstInternal(7, options)\n }\n\n MANY_SEP8<OUT>(this: MixedInParser, options: ManySepMethodOpts<OUT>): void {\n this.manySepFirstInternal(8, options)\n }\n\n MANY_SEP9<OUT>(this: MixedInParser, options: ManySepMethodOpts<OUT>): void {\n this.manySepFirstInternal(9, options)\n }\n\n AT_LEAST_ONE<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>\n ): void {\n this.atLeastOneInternal(0, actionORMethodDef)\n }\n\n AT_LEAST_ONE1<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>\n ): void {\n return this.atLeastOneInternal(1, actionORMethodDef)\n }\n\n AT_LEAST_ONE2<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>\n ): void {\n this.atLeastOneInternal(2, actionORMethodDef)\n }\n\n AT_LEAST_ONE3<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>\n ): void {\n this.atLeastOneInternal(3, actionORMethodDef)\n }\n\n AT_LEAST_ONE4<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>\n ): void {\n this.atLeastOneInternal(4, actionORMethodDef)\n }\n\n AT_LEAST_ONE5<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>\n ): void {\n this.atLeastOneInternal(5, actionORMethodDef)\n }\n\n AT_LEAST_ONE6<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>\n ): void {\n this.atLeastOneInternal(6, actionORMethodDef)\n }\n\n AT_LEAST_ONE7<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>\n ): void {\n this.atLeastOneInternal(7, actionORMethodDef)\n }\n\n AT_LEAST_ONE8<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>\n ): void {\n this.atLeastOneInternal(8, actionORMethodDef)\n }\n\n AT_LEAST_ONE9<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>\n ): void {\n this.atLeastOneInternal(9, actionORMethodDef)\n }\n\n AT_LEAST_ONE_SEP<OUT>(\n this: MixedInParser,\n options: AtLeastOneSepMethodOpts<OUT>\n ): void {\n this.atLeastOneSepFirstInternal(0, options)\n }\n\n AT_LEAST_ONE_SEP1<OUT>(\n this: MixedInParser,\n options: AtLeastOneSepMethodOpts<OUT>\n ): void {\n this.atLeastOneSepFirstInternal(1, options)\n }\n\n AT_LEAST_ONE_SEP2<OUT>(\n this: MixedInParser,\n options: AtLeastOneSepMethodOpts<OUT>\n ): void {\n this.atLeastOneSepFirstInternal(2, options)\n }\n\n AT_LEAST_ONE_SEP3<OUT>(\n this: MixedInParser,\n options: AtLeastOneSepMethodOpts<OUT>\n ): void {\n this.atLeastOneSepFirstInternal(3, options)\n }\n\n AT_LEAST_ONE_SEP4<OUT>(\n this: MixedInParser,\n options: AtLeastOneSepMethodOpts<OUT>\n ): void {\n this.atLeastOneSepFirstInternal(4, options)\n }\n\n AT_LEAST_ONE_SEP5<OUT>(\n this: MixedInParser,\n options: AtLeastOneSepMethodOpts<OUT>\n ): void {\n this.atLeastOneSepFirstInternal(5, options)\n }\n\n AT_LEAST_ONE_SEP6<OUT>(\n this: MixedInParser,\n options: AtLeastOneSepMethodOpts<OUT>\n ): void {\n this.atLeastOneSepFirstInternal(6, options)\n }\n\n AT_LEAST_ONE_SEP7<OUT>(\n this: MixedInParser,\n options: AtLeastOneSepMethodOpts<OUT>\n ): void {\n this.atLeastOneSepFirstInternal(7, options)\n }\n\n AT_LEAST_ONE_SEP8<OUT>(\n this: MixedInParser,\n options: AtLeastOneSepMethodOpts<OUT>\n ): void {\n this.atLeastOneSepFirstInternal(8, options)\n }\n\n AT_LEAST_ONE_SEP9<OUT>(\n this: MixedInParser,\n options: AtLeastOneSepMethodOpts<OUT>\n ): void {\n this.atLeastOneSepFirstInternal(9, options)\n }\n\n RULE<T>(\n this: MixedInParser,\n name: string,\n implementation: (...implArgs: any[]) => T,\n config: IRuleConfig<T> = DEFAULT_RULE_CONFIG\n ): (idxInCallingRule?: number, ...args: any[]) => T | any {\n if (includes(this.definedRulesNames, name)) {\n const errMsg =\n defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({\n topLevelRule: name,\n grammarName: this.className\n })\n\n const error = {\n message: errMsg,\n type: ParserDefinitionErrorType.DUPLICATE_RULE_NAME,\n ruleName: name\n }\n this.definitionErrors.push(error)\n }\n\n this.definedRulesNames.push(name)\n\n const ruleImplementation = this.defineRule(name, implementation, config)\n ;(this as any)[name] = ruleImplementation\n return ruleImplementation\n }\n\n OVERRIDE_RULE<T>(\n this: MixedInParser,\n name: string,\n impl: (...implArgs: any[]) => T,\n config: IRuleConfig<T> = DEFAULT_RULE_CONFIG\n ): (idxInCallingRule?: number, ...args: any[]) => T {\n const ruleErrors: IParserDefinitionError[] = validateRuleIsOverridden(\n name,\n this.definedRulesNames,\n this.className\n )\n this.definitionErrors = this.definitionErrors.concat(ruleErrors)\n\n const ruleImplementation = this.defineRule(name, impl, config)\n ;(this as any)[name] = ruleImplementation\n return ruleImplementation\n }\n\n BACKTRACK<T>(\n this: MixedInParser,\n grammarRule: (...args: any[]) => T,\n args?: any[]\n ): () => boolean {\n return function () {\n // save org state\n this.isBackTrackingStack.push(1)\n const orgState = this.saveRecogState()\n try {\n grammarRule.apply(this, args)\n // if no exception was thrown we have succeed parsing the rule.\n return true\n } catch (e) {\n if (isRecognitionException(e)) {\n return false\n } else {\n throw e\n }\n } finally {\n this.reloadRecogState(orgState)\n this.isBackTrackingStack.pop()\n }\n }\n }\n\n // GAST export APIs\n public getGAstProductions(this: MixedInParser): Record<string, Rule> {\n return this.gastProductionsCache\n }\n\n public getSerializedGastProductions(this: MixedInParser): ISerializedGast[] {\n return serializeGrammar(values(this.gastProductionsCache))\n }\n}\n","import {\n AtLeastOneSepMethodOpts,\n ConsumeMethodOpts,\n DSLMethodOpts,\n DSLMethodOptsWithErr,\n GrammarAction,\n IOrAlt,\n IParserConfig,\n IRuleConfig,\n IToken,\n ManySepMethodOpts,\n OrMethodOpts,\n ParserMethod,\n SubruleMethodOpts,\n TokenType,\n TokenTypeDictionary,\n TokenVocabulary\n} from \"@chevrotain/types\"\nimport isEmpty from \"lodash/isEmpty\"\nimport isArray from \"lodash/isArray\"\nimport flatten from \"lodash/flatten\"\nimport every from \"lodash/every\"\nimport uniq from \"lodash/uniq\"\nimport isObject from \"lodash/isObject\"\nimport has from \"lodash/has\"\nimport values from \"lodash/values\"\nimport reduce from \"lodash/reduce\"\nimport clone from \"lodash/clone\"\nimport {\n AT_LEAST_ONE_IDX,\n AT_LEAST_ONE_SEP_IDX,\n BITS_FOR_METHOD_TYPE,\n BITS_FOR_OCCURRENCE_IDX,\n MANY_IDX,\n MANY_SEP_IDX,\n OPTION_IDX,\n OR_IDX\n} from \"../../grammar/keys\"\nimport {\n isRecognitionException,\n MismatchedTokenException,\n NotAllInputParsedException\n} from \"../../exceptions_public\"\nimport { PROD_TYPE } from \"../../grammar/lookahead\"\nimport {\n AbstractNextTerminalAfterProductionWalker,\n NextTerminalAfterAtLeastOneSepWalker,\n NextTerminalAfterAtLeastOneWalker,\n NextTerminalAfterManySepWalker,\n NextTerminalAfterManyWalker\n} from \"../../grammar/interpreter\"\nimport { DEFAULT_RULE_CONFIG, IParserState, TokenMatcher } from \"../parser\"\nimport { IN_RULE_RECOVERY_EXCEPTION } from \"./recoverable\"\nimport { EOF } from \"../../../scan/tokens_public\"\nimport { MixedInParser } from \"./parser_traits\"\nimport {\n augmentTokenTypes,\n isTokenType,\n tokenStructuredMatcher,\n tokenStructuredMatcherNoCategories\n} from \"../../../scan/tokens\"\nimport { Rule } from \"@chevrotain/gast\"\nimport { ParserMethodInternal } from \"../types\"\n\n/**\n * This trait is responsible for the runtime parsing engine\n * Used by the official API (recognizer_api.ts)\n */\nexport class RecognizerEngine {\n isBackTrackingStack: boolean[]\n className: string\n RULE_STACK: number[]\n RULE_OCCURRENCE_STACK: number[]\n definedRulesNames: string[]\n tokensMap: { [fqn: string]: TokenType }\n gastProductionsCache: Record<string, Rule>\n shortRuleNameToFull: Record<string, string>\n fullRuleNameToShort: Record<string, number>\n // The shortName Index must be coded \"after\" the first 8bits to enable building unique lookahead keys\n ruleShortNameIdx: number\n tokenMatcher: TokenMatcher\n subruleIdx: number\n\n initRecognizerEngine(\n tokenVocabulary: TokenVocabulary,\n config: IParserConfig\n ) {\n this.className = this.constructor.name\n // TODO: would using an ES6 Map or plain object be faster (CST building scenario)\n this.shortRuleNameToFull = {}\n this.fullRuleNameToShort = {}\n this.ruleShortNameIdx = 256\n this.tokenMatcher = tokenStructuredMatcherNoCategories\n this.subruleIdx = 0\n\n this.definedRulesNames = []\n this.tokensMap = {}\n this.isBackTrackingStack = []\n this.RULE_STACK = []\n this.RULE_OCCURRENCE_STACK = []\n this.gastProductionsCache = {}\n\n if (has(config, \"serializedGrammar\")) {\n throw Error(\n \"The Parser's configuration can no longer contain a <serializedGrammar> property.\\n\" +\n \"\\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\\n\" +\n \"\\tFor Further details.\"\n )\n }\n\n if (isArray(tokenVocabulary)) {\n // This only checks for Token vocabularies provided as arrays.\n // That is good enough because the main objective is to detect users of pre-V4.0 APIs\n // rather than all edge cases of empty Token vocabularies.\n if (isEmpty(tokenVocabulary as any[])) {\n throw Error(\n \"A Token Vocabulary cannot be empty.\\n\" +\n \"\\tNote that the first argument for the parser constructor\\n\" +\n \"\\tis no longer a Token vector (since v4.0).\"\n )\n }\n\n if (typeof (tokenVocabulary as any[])[0].startOffset === \"number\") {\n throw Error(\n \"The Parser constructor no longer accepts a token vector as the first argument.\\n\" +\n \"\\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\\n\" +\n \"\\tFor Further details.\"\n )\n }\n }\n\n if (isArray(tokenVocabulary)) {\n this.tokensMap = reduce(\n tokenVocabulary,\n (acc, tokType: TokenType) => {\n acc[tokType.name] = tokType\n return acc\n },\n {} as { [tokenName: string]: TokenType }\n )\n } else if (\n has(tokenVocabulary, \"modes\") &&\n every(flatten(values((<any>tokenVocabulary).modes)), isTokenType)\n ) {\n const allTokenTypes = flatten(values((<any>tokenVocabulary).modes))\n const uniqueTokens = uniq(allTokenTypes)\n this.tokensMap = <any>reduce(\n uniqueTokens,\n (acc, tokType: TokenType) => {\n acc[tokType.name] = tokType\n return acc\n },\n {} as { [tokenName: string]: TokenType }\n )\n } else if (isObject(tokenVocabulary)) {\n this.tokensMap = clone(tokenVocabulary as TokenTypeDictionary)\n } else {\n throw new Error(\n \"<tokensDictionary> argument must be An Array of Token constructors,\" +\n \" A dictionary of Token constructors or an IMultiModeLexerDefinition\"\n )\n }\n\n // always add EOF to the tokenNames -> constructors map. it is useful to assure all the input has been\n // parsed with a clear error message (\"expecting EOF but found ...\")\n this.tokensMap[\"EOF\"] = EOF\n\n const allTokenTypes = has(tokenVocabulary, \"modes\")\n ? flatten(values((<any>tokenVocabulary).modes))\n : values(tokenVocabulary)\n const noTokenCategoriesUsed = every(allTokenTypes, (tokenConstructor) =>\n isEmpty(tokenConstructor.categoryMatches)\n )\n\n this.tokenMatcher = noTokenCategoriesUsed\n ? tokenStructuredMatcherNoCategories\n : tokenStructuredMatcher\n\n // Because ES2015+ syntax should be supported for creating Token classes\n // We cannot assume that the Token classes were created using the \"extendToken\" utilities\n // Therefore we must augment the Token classes both on Lexer initialization and on Parser initialization\n augmentTokenTypes(values(this.tokensMap))\n }\n\n defineRule<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleName: string,\n impl: (...args: ARGS) => R,\n config: IRuleConfig<R>\n ): ParserMethodInternal<ARGS, R> {\n if (this.selfAnalysisDone) {\n throw Error(\n `Grammar rule <${ruleName}> may not be defined after the 'performSelfAnalysis' method has been called'\\n` +\n `Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`\n )\n }\n const resyncEnabled: boolean = has(config, \"resyncEnabled\")\n ? (config.resyncEnabled as boolean) // assumes end user provides the correct config value/type\n : DEFAULT_RULE_CONFIG.resyncEnabled\n const recoveryValueFunc = has(config, \"recoveryValueFunc\")\n ? (config.recoveryValueFunc as () => R) // assumes end user provides the correct config value/type\n : DEFAULT_RULE_CONFIG.recoveryValueFunc\n\n // performance optimization: Use small integers as keys for the longer human readable \"full\" rule names.\n // this greatly improves Map access time (as much as 8% for some performance benchmarks).\n const shortName =\n this.ruleShortNameIdx << (BITS_FOR_METHOD_TYPE + BITS_FOR_OCCURRENCE_IDX)\n\n this.ruleShortNameIdx++\n this.shortRuleNameToFull[shortName] = ruleName\n this.fullRuleNameToShort[ruleName] = shortName\n\n let invokeRuleWithTry: ParserMethod<ARGS, R>\n\n // Micro optimization, only check the condition **once** on rule definition\n // instead of **every single** rule invocation.\n if (this.outputCst === true) {\n invokeRuleWithTry = function invokeRuleWithTry(\n this: MixedInParser,\n ...args: ARGS\n ): R {\n try {\n this.ruleInvocationStateUpdate(shortName, ruleName, this.subruleIdx)\n impl.apply(this, args)\n const cst = this.CST_STACK[this.CST_STACK.length - 1]\n this.cstPostRule(cst)\n return cst as unknown as R\n } catch (e) {\n return this.invokeRuleCatch(e, resyncEnabled, recoveryValueFunc) as R\n } finally {\n this.ruleFinallyStateUpdate()\n }\n }\n } else {\n invokeRuleWithTry = function invokeRuleWithTryCst(\n this: MixedInParser,\n ...args: ARGS\n ): R {\n try {\n this.ruleInvocationStateUpdate(shortName, ruleName, this.subruleIdx)\n return impl.apply(this, args)\n } catch (e) {\n return this.invokeRuleCatch(e, resyncEnabled, recoveryValueFunc) as R\n } finally {\n this.ruleFinallyStateUpdate()\n }\n }\n }\n\n const wrappedGrammarRule: ParserMethodInternal<ARGS, R> = Object.assign(\n invokeRuleWithTry as any,\n { ruleName, originalGrammarAction: impl }\n )\n\n return wrappedGrammarRule\n }\n\n invokeRuleCatch(\n this: MixedInParser,\n e: Error,\n resyncEnabledConfig: boolean,\n recoveryValueFunc: Function\n ): unknown {\n const isFirstInvokedRule = this.RULE_STACK.length === 1\n // note the reSync is always enabled for the first rule invocation, because we must always be able to\n // reSync with EOF and just output some INVALID ParseTree\n // during backtracking reSync recovery is disabled, otherwise we can't be certain the backtracking\n // path is really the most valid one\n const reSyncEnabled =\n resyncEnabledConfig && !this.isBackTracking() && this.recoveryEnabled\n\n if (isRecognitionException(e)) {\n const recogError: any = e\n if (reSyncEnabled) {\n const reSyncTokType = this.findReSyncTokenType()\n if (this.isInCurrentRuleReSyncSet(reSyncTokType)) {\n recogError.resyncedTokens = this.reSyncTo(reSyncTokType)\n if (this.outputCst) {\n const partialCstResult: any =\n this.CST_STACK[this.CST_STACK.length - 1]\n partialCstResult.recoveredNode = true\n return partialCstResult\n } else {\n return recoveryValueFunc(e)\n }\n } else {\n if (this.outputCst) {\n const partialCstResult: any =\n this.CST_STACK[this.CST_STACK.length - 1]\n partialCstResult.recoveredNode = true\n recogError.partialCstResult = partialCstResult\n }\n // to be handled Further up the call stack\n throw recogError\n }\n } else if (isFirstInvokedRule) {\n // otherwise a Redundant input error will be created as well and we cannot guarantee that this is indeed the case\n this.moveToTerminatedState()\n // the parser should never throw one of its own errors outside its flow.\n // even if error recovery is disabled\n return recoveryValueFunc(e)\n } else {\n // to be recovered Further up the call stack\n throw recogError\n }\n } else {\n // some other Error type which we don't know how to handle (for example a built in JavaScript Error)\n throw e\n }\n }\n\n // Implementation of parsing DSL\n optionInternal<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n occurrence: number\n ): OUT | undefined {\n const key = this.getKeyForAutomaticLookahead(OPTION_IDX, occurrence)\n return this.optionInternalLogic(actionORMethodDef, occurrence, key)\n }\n\n optionInternalLogic<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n occurrence: number,\n key: number\n ): OUT | undefined {\n let lookAheadFunc = this.getLaFuncFromCache(key)\n let action: GrammarAction<OUT>\n if (typeof actionORMethodDef !== \"function\") {\n action = actionORMethodDef.DEF\n const predicate = actionORMethodDef.GATE\n // predicate present\n if (predicate !== undefined) {\n const orgLookaheadFunction = lookAheadFunc\n lookAheadFunc = () => {\n return predicate.call(this) && orgLookaheadFunction.call(this)\n }\n }\n } else {\n action = actionORMethodDef\n }\n\n if (lookAheadFunc.call(this) === true) {\n return action.call(this)\n }\n return undefined\n }\n\n atLeastOneInternal<OUT>(\n this: MixedInParser,\n prodOccurrence: number,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>\n ): void {\n const laKey = this.getKeyForAutomaticLookahead(\n AT_LEAST_ONE_IDX,\n prodOccurrence\n )\n return this.atLeastOneInternalLogic(\n prodOccurrence,\n actionORMethodDef,\n laKey\n )\n }\n\n atLeastOneInternalLogic<OUT>(\n this: MixedInParser,\n prodOccurrence: number,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>,\n key: number\n ): void {\n let lookAheadFunc = this.getLaFuncFromCache(key)\n let action\n if (typeof actionORMethodDef !== \"function\") {\n action = actionORMethodDef.DEF\n const predicate = actionORMethodDef.GATE\n // predicate present\n if (predicate !== undefined) {\n const orgLookaheadFunction = lookAheadFunc\n lookAheadFunc = () => {\n return predicate.call(this) && orgLookaheadFunction.call(this)\n }\n }\n } else {\n action = actionORMethodDef\n }\n\n if ((<Function>lookAheadFunc).call(this) === true) {\n let notStuck = this.doSingleRepetition(action)\n while (\n (<Function>lookAheadFunc).call(this) === true &&\n notStuck === true\n ) {\n notStuck = this.doSingleRepetition(action)\n }\n } else {\n throw this.raiseEarlyExitException(\n prodOccurrence,\n PROD_TYPE.REPETITION_MANDATORY,\n (<DSLMethodOptsWithErr<OUT>>actionORMethodDef).ERR_MSG\n )\n }\n\n // note that while it may seem that this can cause an error because by using a recursive call to\n // AT_LEAST_ONE we change the grammar to AT_LEAST_TWO, AT_LEAST_THREE ... , the possible recursive call\n // from the tryInRepetitionRecovery(...) will only happen IFF there really are TWO/THREE/.... items.\n\n // Performance optimization: \"attemptInRepetitionRecovery\" will be defined as NOOP unless recovery is enabled\n this.attemptInRepetitionRecovery(\n this.atLeastOneInternal,\n [prodOccurrence, actionORMethodDef],\n <any>lookAheadFunc,\n AT_LEAST_ONE_IDX,\n prodOccurrence,\n NextTerminalAfterAtLeastOneWalker\n )\n }\n\n atLeastOneSepFirstInternal<OUT>(\n this: MixedInParser,\n prodOccurrence: number,\n options: AtLeastOneSepMethodOpts<OUT>\n ): void {\n const laKey = this.getKeyForAutomaticLookahead(\n AT_LEAST_ONE_SEP_IDX,\n prodOccurrence\n )\n this.atLeastOneSepFirstInternalLogic(prodOccurrence, options, laKey)\n }\n\n atLeastOneSepFirstInternalLogic<OUT>(\n this: MixedInParser,\n prodOccurrence: number,\n options: AtLeastOneSepMethodOpts<OUT>,\n key: number\n ): void {\n const action = options.DEF\n const separator = options.SEP\n\n const firstIterationLookaheadFunc = this.getLaFuncFromCache(key)\n\n // 1st iteration\n if (firstIterationLookaheadFunc.call(this) === true) {\n ;(<GrammarAction<OUT>>action).call(this)\n\n // TODO: Optimization can move this function construction into \"attemptInRepetitionRecovery\"\n // because it is only needed in error recovery scenarios.\n const separatorLookAheadFunc = () => {\n return this.tokenMatcher(this.LA(1), separator)\n }\n\n // 2nd..nth iterations\n while (this.tokenMatcher(this.LA(1), separator) === true) {\n // note that this CONSUME will never enter recovery because\n // the separatorLookAheadFunc checks that the separator really does exist.\n this.CONSUME(separator)\n // No need for checking infinite loop here due to consuming the separator.\n ;(<GrammarAction<OUT>>action).call(this)\n }\n\n // Performance optimization: \"attemptInRepetitionRecovery\" will be defined as NOOP unless recovery is enabled\n this.attemptInRepetitionRecovery(\n this.repetitionSepSecondInternal,\n [\n prodOccurrence,\n separator,\n separatorLookAheadFunc,\n action,\n NextTerminalAfterAtLeastOneSepWalker\n ],\n separatorLookAheadFunc,\n AT_LEAST_ONE_SEP_IDX,\n prodOccurrence,\n NextTerminalAfterAtLeastOneSepWalker\n )\n } else {\n throw this.raiseEarlyExitException(\n prodOccurrence,\n PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,\n options.ERR_MSG\n )\n }\n }\n\n manyInternal<OUT>(\n this: MixedInParser,\n prodOccurrence: number,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): void {\n const laKey = this.getKeyForAutomaticLookahead(MANY_IDX, prodOccurrence)\n return this.manyInternalLogic(prodOccurrence, actionORMethodDef, laKey)\n }\n\n manyInternalLogic<OUT>(\n this: MixedInParser,\n prodOccurrence: number,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n key: number\n ) {\n let lookaheadFunction = this.getLaFuncFromCache(key)\n let action\n if (typeof actionORMethodDef !== \"function\") {\n action = actionORMethodDef.DEF\n const predicate = actionORMethodDef.GATE\n // predicate present\n if (predicate !== undefined) {\n const orgLookaheadFunction = lookaheadFunction\n lookaheadFunction = () => {\n return predicate.call(this) && orgLookaheadFunction.call(this)\n }\n }\n } else {\n action = actionORMethodDef\n }\n\n let notStuck = true\n while (lookaheadFunction.call(this) === true && notStuck === true) {\n notStuck = this.doSingleRepetition(action)\n }\n\n // Performance optimization: \"attemptInRepetitionRecovery\" will be defined as NOOP unless recovery is enabled\n this.attemptInRepetitionRecovery(\n this.manyInternal,\n [prodOccurrence, actionORMethodDef],\n <any>lookaheadFunction,\n MANY_IDX,\n prodOccurrence,\n NextTerminalAfterManyWalker,\n // The notStuck parameter is only relevant when \"attemptInRepetitionRecovery\"\n // is invoked from manyInternal, in the MANY_SEP case and AT_LEAST_ONE[_SEP]\n // An infinite loop cannot occur as:\n // - Either the lookahead is guaranteed to consume something (Single Token Separator)\n // - AT_LEAST_ONE by definition is guaranteed to consume something (or error out).\n notStuck\n )\n }\n\n manySepFirstInternal<OUT>(\n this: MixedInParser,\n prodOccurrence: number,\n options: ManySepMethodOpts<OUT>\n ): void {\n const laKey = this.getKeyForAutomaticLookahead(MANY_SEP_IDX, prodOccurrence)\n this.manySepFirstInternalLogic(prodOccurrence, options, laKey)\n }\n\n manySepFirstInternalLogic<OUT>(\n this: MixedInParser,\n prodOccurrence: number,\n options: ManySepMethodOpts<OUT>,\n key: number\n ): void {\n const action = options.DEF\n const separator = options.SEP\n const firstIterationLaFunc = this.getLaFuncFromCache(key)\n\n // 1st iteration\n if (firstIterationLaFunc.call(this) === true) {\n action.call(this)\n\n const separatorLookAheadFunc = () => {\n return this.tokenMatcher(this.LA(1), separator)\n }\n // 2nd..nth iterations\n while (this.tokenMatcher(this.LA(1), separator) === true) {\n // note that this CONSUME will never enter recovery because\n // the separatorLookAheadFunc checks that the separator really does exist.\n this.CONSUME(separator)\n // No need for checking infinite loop here due to consuming the separator.\n action.call(this)\n }\n\n // Performance optimization: \"attemptInRepetitionRecovery\" will be defined as NOOP unless recovery is enabled\n this.attemptInRepetitionRecovery(\n this.repetitionSepSecondInternal,\n [\n prodOccurrence,\n separator,\n separatorLookAheadFunc,\n action,\n NextTerminalAfterManySepWalker\n ],\n separatorLookAheadFunc,\n MANY_SEP_IDX,\n prodOccurrence,\n NextTerminalAfterManySepWalker\n )\n }\n }\n\n repetitionSepSecondInternal<OUT>(\n this: MixedInParser,\n prodOccurrence: number,\n separator: TokenType,\n separatorLookAheadFunc: () => boolean,\n action: GrammarAction<OUT>,\n nextTerminalAfterWalker: typeof AbstractNextTerminalAfterProductionWalker\n ): void {\n while (separatorLookAheadFunc()) {\n // note that this CONSUME will never enter recovery because\n // the separatorLookAheadFunc checks that the separator really does exist.\n this.CONSUME(separator)\n action.call(this)\n }\n\n // we can only arrive to this function after an error\n // has occurred (hence the name 'second') so the following\n // IF will always be entered, its possible to remove it...\n // however it is kept to avoid confusion and be consistent.\n // Performance optimization: \"attemptInRepetitionRecovery\" will be defined as NOOP unless recovery is enabled\n /* istanbul ignore else */\n this.attemptInRepetitionRecovery(\n this.repetitionSepSecondInternal,\n [\n prodOccurrence,\n separator,\n separatorLookAheadFunc,\n action,\n nextTerminalAfterWalker\n ],\n separatorLookAheadFunc,\n AT_LEAST_ONE_SEP_IDX,\n prodOccurrence,\n nextTerminalAfterWalker\n )\n }\n\n doSingleRepetition(this: MixedInParser, action: Function): any {\n const beforeIteration = this.getLexerPosition()\n action.call(this)\n const afterIteration = this.getLexerPosition()\n\n // This boolean will indicate if this repetition progressed\n // or if we are \"stuck\" (potential infinite loop in the repetition).\n return afterIteration > beforeIteration\n }\n\n orInternal<T>(\n this: MixedInParser,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<unknown>,\n occurrence: number\n ): T {\n const laKey = this.getKeyForAutomaticLookahead(OR_IDX, occurrence)\n const alts = isArray(altsOrOpts) ? altsOrOpts : altsOrOpts.DEF\n\n const laFunc = this.getLaFuncFromCache(laKey)\n const altIdxToTake = laFunc.call(this, alts)\n if (altIdxToTake !== undefined) {\n const chosenAlternative: any = alts[altIdxToTake]\n return chosenAlternative.ALT.call(this)\n }\n this.raiseNoAltException(\n occurrence,\n (altsOrOpts as OrMethodOpts<unknown>).ERR_MSG\n )\n }\n\n ruleFinallyStateUpdate(this: MixedInParser): void {\n this.RULE_STACK.pop()\n this.RULE_OCCURRENCE_STACK.pop()\n\n // NOOP when cst is disabled\n this.cstFinallyStateUpdate()\n\n if (this.RULE_STACK.length === 0 && this.isAtEndOfInput() === false) {\n const firstRedundantTok = this.LA(1)\n const errMsg = this.errorMessageProvider.buildNotAllInputParsedMessage({\n firstRedundant: firstRedundantTok,\n ruleName: this.getCurrRuleFullName()\n })\n this.SAVE_ERROR(new NotAllInputParsedException(errMsg, firstRedundantTok))\n }\n }\n\n subruleInternal<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n idx: number,\n options?: SubruleMethodOpts<ARGS>\n ): R {\n let ruleResult\n try {\n const args = options !== undefined ? options.ARGS : undefined\n this.subruleIdx = idx\n ruleResult = ruleToCall.apply(this, args)\n this.cstPostNonTerminal(\n ruleResult,\n options !== undefined && options.LABEL !== undefined\n ? options.LABEL\n : ruleToCall.ruleName\n )\n return ruleResult\n } catch (e) {\n throw this.subruleInternalError(e, options, ruleToCall.ruleName)\n }\n }\n\n subruleInternalError(\n this: MixedInParser,\n e: any,\n options: SubruleMethodOpts<unknown[]> | undefined,\n ruleName: string\n ): void {\n if (isRecognitionException(e) && e.partialCstResult !== undefined) {\n this.cstPostNonTerminal(\n e.partialCstResult,\n options !== undefined && options.LABEL !== undefined\n ? options.LABEL\n : ruleName\n )\n\n delete e.partialCstResult\n }\n throw e\n }\n\n consumeInternal(\n this: MixedInParser,\n tokType: TokenType,\n idx: number,\n options: ConsumeMethodOpts | undefined\n ): IToken {\n let consumedToken!: IToken\n try {\n const nextToken = this.LA(1)\n if (this.tokenMatcher(nextToken, tokType) === true) {\n this.consumeToken()\n consumedToken = nextToken\n } else {\n this.consumeInternalError(tokType, nextToken, options)\n }\n } catch (eFromConsumption) {\n consumedToken = this.consumeInternalRecovery(\n tokType,\n idx,\n eFromConsumption\n )\n }\n\n this.cstPostTerminal(\n options !== undefined && options.LABEL !== undefined\n ? options.LABEL\n : tokType.name,\n consumedToken\n )\n return consumedToken\n }\n\n consumeInternalError(\n this: MixedInParser,\n tokType: TokenType,\n nextToken: IToken,\n options: ConsumeMethodOpts | undefined\n ): void {\n let msg\n const previousToken = this.LA(0)\n if (options !== undefined && options.ERR_MSG) {\n msg = options.ERR_MSG\n } else {\n msg = this.errorMessageProvider.buildMismatchTokenMessage({\n expected: tokType,\n actual: nextToken,\n previous: previousToken,\n ruleName: this.getCurrRuleFullName()\n })\n }\n throw this.SAVE_ERROR(\n new MismatchedTokenException(msg, nextToken, previousToken)\n )\n }\n\n consumeInternalRecovery(\n this: MixedInParser,\n tokType: TokenType,\n idx: number,\n eFromConsumption: Error\n ): IToken {\n // no recovery allowed during backtracking, otherwise backtracking may recover invalid syntax and accept it\n // but the original syntax could have been parsed successfully without any backtracking + recovery\n if (\n this.recoveryEnabled &&\n // TODO: more robust checking of the exception type. Perhaps Typescript extending expressions?\n eFromConsumption.name === \"MismatchedTokenException\" &&\n !this.isBackTracking()\n ) {\n const follows = this.getFollowsForInRuleRecovery(<any>tokType, idx)\n try {\n return this.tryInRuleRecovery(<any>tokType, follows)\n } catch (eFromInRuleRecovery) {\n if (eFromInRuleRecovery.name === IN_RULE_RECOVERY_EXCEPTION) {\n // failed in RuleRecovery.\n // throw the original error in order to trigger reSync error recovery\n throw eFromConsumption\n } else {\n throw eFromInRuleRecovery\n }\n }\n } else {\n throw eFromConsumption\n }\n }\n\n saveRecogState(this: MixedInParser): IParserState {\n // errors is a getter which will clone the errors array\n const savedErrors = this.errors\n const savedRuleStack = clone(this.RULE_STACK)\n return {\n errors: savedErrors,\n lexerState: this.exportLexerState(),\n RULE_STACK: savedRuleStack,\n CST_STACK: this.CST_STACK\n }\n }\n\n reloadRecogState(this: MixedInParser, newState: IParserState) {\n this.errors = newState.errors\n this.importLexerState(newState.lexerState)\n this.RULE_STACK = newState.RULE_STACK\n }\n\n ruleInvocationStateUpdate(\n this: MixedInParser,\n shortName: number,\n fullName: string,\n idxInCallingRule: number\n ): void {\n this.RULE_OCCURRENCE_STACK.push(idxInCallingRule)\n this.RULE_STACK.push(shortName)\n // NOOP when cst is disabled\n this.cstInvocationStateUpdate(fullName)\n }\n\n isBackTracking(this: MixedInParser): boolean {\n return this.isBackTrackingStack.length !== 0\n }\n\n getCurrRuleFullName(this: MixedInParser): string {\n const shortName = this.getLastExplicitRuleShortName()\n return this.shortRuleNameToFull[shortName]\n }\n\n shortRuleNameToFullName(this: MixedInParser, shortName: number) {\n return this.shortRuleNameToFull[shortName]\n }\n\n public isAtEndOfInput(this: MixedInParser): boolean {\n return this.tokenMatcher(this.LA(1), EOF)\n }\n\n public reset(this: MixedInParser): void {\n this.resetLexerState()\n this.subruleIdx = 0\n this.isBackTrackingStack = []\n this.errors = []\n this.RULE_STACK = []\n // TODO: extract a specific reset for TreeBuilder trait\n this.CST_STACK = []\n this.RULE_OCCURRENCE_STACK = []\n }\n}\n","import {\n IParserConfig,\n IParserErrorMessageProvider,\n IRecognitionException\n} from \"@chevrotain/types\"\nimport {\n EarlyExitException,\n isRecognitionException,\n NoViableAltException\n} from \"../../exceptions_public\"\nimport has from \"lodash/has\"\nimport clone from \"lodash/clone\"\nimport {\n getLookaheadPathsForOptionalProd,\n getLookaheadPathsForOr,\n PROD_TYPE\n} from \"../../grammar/lookahead\"\nimport { MixedInParser } from \"./parser_traits\"\nimport { DEFAULT_PARSER_CONFIG } from \"../parser\"\n\n/**\n * Trait responsible for runtime parsing errors.\n */\nexport class ErrorHandler {\n _errors: IRecognitionException[]\n errorMessageProvider: IParserErrorMessageProvider\n\n initErrorHandler(config: IParserConfig) {\n this._errors = []\n this.errorMessageProvider = has(config, \"errorMessageProvider\")\n ? (config.errorMessageProvider as IParserErrorMessageProvider) // assumes end user provides the correct config value/type\n : DEFAULT_PARSER_CONFIG.errorMessageProvider\n }\n\n SAVE_ERROR(\n this: MixedInParser,\n error: IRecognitionException\n ): IRecognitionException {\n if (isRecognitionException(error)) {\n error.context = {\n ruleStack: this.getHumanReadableRuleStack(),\n ruleOccurrenceStack: clone(this.RULE_OCCURRENCE_STACK)\n }\n this._errors.push(error)\n return error\n } else {\n throw Error(\"Trying to save an Error which is not a RecognitionException\")\n }\n }\n\n get errors(): IRecognitionException[] {\n return clone(this._errors)\n }\n\n set errors(newErrors: IRecognitionException[]) {\n this._errors = newErrors\n }\n\n // TODO: consider caching the error message computed information\n raiseEarlyExitException(\n this: MixedInParser,\n occurrence: number,\n prodType: PROD_TYPE,\n userDefinedErrMsg: string | undefined\n ): never {\n const ruleName = this.getCurrRuleFullName()\n const ruleGrammar = this.getGAstProductions()[ruleName]\n const lookAheadPathsPerAlternative = getLookaheadPathsForOptionalProd(\n occurrence,\n ruleGrammar,\n prodType,\n this.maxLookahead\n )\n const insideProdPaths = lookAheadPathsPerAlternative[0]\n const actualTokens = []\n for (let i = 1; i <= this.maxLookahead; i++) {\n actualTokens.push(this.LA(i))\n }\n const msg = this.errorMessageProvider.buildEarlyExitMessage({\n expectedIterationPaths: insideProdPaths,\n actual: actualTokens,\n previous: this.LA(0),\n customUserDescription: userDefinedErrMsg,\n ruleName: ruleName\n })\n\n throw this.SAVE_ERROR(new EarlyExitException(msg, this.LA(1), this.LA(0)))\n }\n\n // TODO: consider caching the error message computed information\n raiseNoAltException(\n this: MixedInParser,\n occurrence: number,\n errMsgTypes: string | undefined\n ): never {\n const ruleName = this.getCurrRuleFullName()\n const ruleGrammar = this.getGAstProductions()[ruleName]\n // TODO: getLookaheadPathsForOr can be slow for large enough maxLookahead and certain grammars, consider caching ?\n const lookAheadPathsPerAlternative = getLookaheadPathsForOr(\n occurrence,\n ruleGrammar,\n this.maxLookahead\n )\n\n const actualTokens = []\n for (let i = 1; i <= this.maxLookahead; i++) {\n actualTokens.push(this.LA(i))\n }\n const previousToken = this.LA(0)\n\n const errMsg = this.errorMessageProvider.buildNoViableAltMessage({\n expectedPathsPerAlt: lookAheadPathsPerAlternative,\n actual: actualTokens,\n previous: previousToken,\n customUserDescription: errMsgTypes,\n ruleName: this.getCurrRuleFullName()\n })\n\n throw this.SAVE_ERROR(\n new NoViableAltException(errMsg, this.LA(1), previousToken)\n )\n }\n}\n","import {\n ISyntacticContentAssistPath,\n IToken,\n ITokenGrammarPath,\n TokenType\n} from \"@chevrotain/types\"\nimport {\n NextAfterTokenWalker,\n nextPossibleTokensAfter\n} from \"../../grammar/interpreter\"\nimport first from \"lodash/first\"\nimport isUndefined from \"lodash/isUndefined\"\nimport { MixedInParser } from \"./parser_traits\"\n\nexport class ContentAssist {\n initContentAssist() {}\n\n public computeContentAssist(\n this: MixedInParser,\n startRuleName: string,\n precedingInput: IToken[]\n ): ISyntacticContentAssistPath[] {\n const startRuleGast = this.gastProductionsCache[startRuleName]\n\n if (isUndefined(startRuleGast)) {\n throw Error(`Rule ->${startRuleName}<- does not exist in this grammar.`)\n }\n\n return nextPossibleTokensAfter(\n [startRuleGast],\n precedingInput,\n this.tokenMatcher,\n this.maxLookahead\n )\n }\n\n // TODO: should this be a member method or a utility? it does not have any state or usage of 'this'...\n // TODO: should this be more explicitly part of the public API?\n public getNextPossibleTokenTypes(\n this: MixedInParser,\n grammarPath: ITokenGrammarPath\n ): TokenType[] {\n const topRuleName = first(grammarPath.ruleStack)!\n const gastProductions = this.getGAstProductions()\n const topProduction = gastProductions[topRuleName]\n const nextPossibleTokenTypes = new NextAfterTokenWalker(\n topProduction,\n grammarPath\n ).startWalking()\n return nextPossibleTokenTypes\n }\n}\n","import {\n AtLeastOneSepMethodOpts,\n ConsumeMethodOpts,\n CstNode,\n DSLMethodOpts,\n DSLMethodOptsWithErr,\n GrammarAction,\n IOrAlt,\n IParserConfig,\n IProduction,\n IToken,\n ManySepMethodOpts,\n OrMethodOpts,\n SubruleMethodOpts,\n TokenType\n} from \"@chevrotain/types\"\nimport peek from \"lodash/last\"\nimport isArray from \"lodash/isArray\"\nimport some from \"lodash/some\"\nimport forEach from \"lodash/forEach\"\nimport isFunction from \"lodash/isFunction\"\nimport has from \"lodash/has\"\nimport { MixedInParser } from \"./parser_traits\"\nimport {\n Alternation,\n Alternative,\n NonTerminal,\n Option,\n Repetition,\n RepetitionMandatory,\n RepetitionMandatoryWithSeparator,\n RepetitionWithSeparator,\n Rule,\n Terminal\n} from \"@chevrotain/gast\"\nimport { Lexer } from \"../../../scan/lexer_public\"\nimport { augmentTokenTypes, hasShortKeyProperty } from \"../../../scan/tokens\"\nimport { createToken, createTokenInstance } from \"../../../scan/tokens_public\"\nimport { END_OF_FILE } from \"../parser\"\nimport { BITS_FOR_OCCURRENCE_IDX } from \"../../grammar/keys\"\nimport { ParserMethodInternal } from \"../types\"\n\ntype ProdWithDef = IProduction & { definition?: IProduction[] }\nconst RECORDING_NULL_OBJECT = {\n description: \"This Object indicates the Parser is during Recording Phase\"\n}\nObject.freeze(RECORDING_NULL_OBJECT)\n\nconst HANDLE_SEPARATOR = true\nconst MAX_METHOD_IDX = Math.pow(2, BITS_FOR_OCCURRENCE_IDX) - 1\n\nconst RFT = createToken({ name: \"RECORDING_PHASE_TOKEN\", pattern: Lexer.NA })\naugmentTokenTypes([RFT])\nconst RECORDING_PHASE_TOKEN = createTokenInstance(\n RFT,\n \"This IToken indicates the Parser is in Recording Phase\\n\\t\" +\n \"\" +\n \"See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details\",\n // Using \"-1\" instead of NaN (as in EOF) because an actual number is less likely to\n // cause errors if the output of LA or CONSUME would be (incorrectly) used during the recording phase.\n -1,\n -1,\n -1,\n -1,\n -1,\n -1\n)\nObject.freeze(RECORDING_PHASE_TOKEN)\n\nconst RECORDING_PHASE_CSTNODE: CstNode = {\n name:\n \"This CSTNode indicates the Parser is in Recording Phase\\n\\t\" +\n \"See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details\",\n children: {}\n}\n\n/**\n * This trait handles the creation of the GAST structure for Chevrotain Grammars\n */\nexport class GastRecorder {\n recordingProdStack: ProdWithDef[]\n RECORDING_PHASE: boolean\n\n initGastRecorder(this: MixedInParser, config: IParserConfig): void {\n this.recordingProdStack = []\n this.RECORDING_PHASE = false\n }\n\n enableRecording(this: MixedInParser): void {\n this.RECORDING_PHASE = true\n\n this.TRACE_INIT(\"Enable Recording\", () => {\n /**\n * Warning Dark Voodoo Magic upcoming!\n * We are \"replacing\" the public parsing DSL methods API\n * With **new** alternative implementations on the Parser **instance**\n *\n * So far this is the only way I've found to avoid performance regressions during parsing time.\n * - Approx 30% performance regression was measured on Chrome 75 Canary when attempting to replace the \"internal\"\n * implementations directly instead.\n */\n for (let i = 0; i < 10; i++) {\n const idx = i > 0 ? i : \"\"\n this[`CONSUME${idx}` as \"CONSUME\"] = function (arg1, arg2) {\n return this.consumeInternalRecord(arg1, i, arg2)\n }\n this[`SUBRULE${idx}` as \"SUBRULE\"] = function (arg1, arg2) {\n return this.subruleInternalRecord(arg1, i, arg2) as any\n }\n this[`OPTION${idx}` as \"OPTION\"] = function (arg1) {\n return this.optionInternalRecord(arg1, i)\n }\n this[`OR${idx}` as \"OR\"] = function (arg1) {\n return this.orInternalRecord(arg1, i)\n }\n this[`MANY${idx}` as \"MANY\"] = function (arg1) {\n this.manyInternalRecord(i, arg1)\n }\n this[`MANY_SEP${idx}` as \"MANY_SEP\"] = function (arg1) {\n this.manySepFirstInternalRecord(i, arg1)\n }\n this[`AT_LEAST_ONE${idx}` as \"AT_LEAST_ONE\"] = function (arg1) {\n this.atLeastOneInternalRecord(i, arg1)\n }\n this[`AT_LEAST_ONE_SEP${idx}` as \"AT_LEAST_ONE_SEP\"] = function (arg1) {\n this.atLeastOneSepFirstInternalRecord(i, arg1)\n }\n }\n\n // DSL methods with the idx(suffix) as an argument\n this[`consume`] = function (idx, arg1, arg2) {\n return this.consumeInternalRecord(arg1, idx, arg2)\n }\n this[`subrule`] = function (idx, arg1, arg2) {\n return this.subruleInternalRecord(arg1, idx, arg2) as any\n }\n this[`option`] = function (idx, arg1) {\n return this.optionInternalRecord(arg1, idx)\n }\n this[`or`] = function (idx, arg1) {\n return this.orInternalRecord(arg1, idx)\n }\n this[`many`] = function (idx, arg1) {\n this.manyInternalRecord(idx, arg1)\n }\n this[`atLeastOne`] = function (idx, arg1) {\n this.atLeastOneInternalRecord(idx, arg1)\n }\n\n this.ACTION = this.ACTION_RECORD\n this.BACKTRACK = this.BACKTRACK_RECORD\n this.LA = this.LA_RECORD\n })\n }\n\n disableRecording(this: MixedInParser) {\n this.RECORDING_PHASE = false\n // By deleting these **instance** properties, any future invocation\n // will be deferred to the original methods on the **prototype** object\n // This seems to get rid of any incorrect optimizations that V8 may\n // do during the recording phase.\n this.TRACE_INIT(\"Deleting Recording methods\", () => {\n const that: any = this\n\n for (let i = 0; i < 10; i++) {\n const idx = i > 0 ? i : \"\"\n delete that[`CONSUME${idx}`]\n delete that[`SUBRULE${idx}`]\n delete that[`OPTION${idx}`]\n delete that[`OR${idx}`]\n delete that[`MANY${idx}`]\n delete that[`MANY_SEP${idx}`]\n delete that[`AT_LEAST_ONE${idx}`]\n delete that[`AT_LEAST_ONE_SEP${idx}`]\n }\n\n delete that[`consume`]\n delete that[`subrule`]\n delete that[`option`]\n delete that[`or`]\n delete that[`many`]\n delete that[`atLeastOne`]\n\n delete that.ACTION\n delete that.BACKTRACK\n delete that.LA\n })\n }\n\n // Parser methods are called inside an ACTION?\n // Maybe try/catch/finally on ACTIONS while disabling the recorders state changes?\n // @ts-expect-error -- noop place holder\n ACTION_RECORD<T>(this: MixedInParser, impl: () => T): T {\n // NO-OP during recording\n }\n\n // Executing backtracking logic will break our recording logic assumptions\n BACKTRACK_RECORD<T>(\n grammarRule: (...args: any[]) => T,\n args?: any[]\n ): () => boolean {\n return () => true\n }\n\n // LA is part of the official API and may be used for custom lookahead logic\n // by end users who may forget to wrap it in ACTION or inside a GATE\n LA_RECORD(howMuch: number): IToken {\n // We cannot use the RECORD_PHASE_TOKEN here because someone may depend\n // On LA return EOF at the end of the input so an infinite loop may occur.\n return END_OF_FILE\n }\n\n topLevelRuleRecord(name: string, def: Function): Rule {\n try {\n const newTopLevelRule = new Rule({ definition: [], name: name })\n newTopLevelRule.name = name\n this.recordingProdStack.push(newTopLevelRule)\n def.call(this)\n this.recordingProdStack.pop()\n return newTopLevelRule\n } catch (originalError) {\n if (originalError.KNOWN_RECORDER_ERROR !== true) {\n try {\n originalError.message =\n originalError.message +\n '\\n\\t This error was thrown during the \"grammar recording phase\" For more info see:\\n\\t' +\n \"https://chevrotain.io/docs/guide/internals.html#grammar-recording\"\n } catch (mutabilityError) {\n // We may not be able to modify the original error object\n throw originalError\n }\n }\n throw originalError\n }\n }\n\n // Implementation of parsing DSL\n optionInternalRecord<OUT>(\n this: MixedInParser,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n occurrence: number\n ): OUT {\n return recordProd.call(this, Option, actionORMethodDef, occurrence)\n }\n\n atLeastOneInternalRecord<OUT>(\n this: MixedInParser,\n occurrence: number,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOptsWithErr<OUT>\n ): void {\n recordProd.call(this, RepetitionMandatory, actionORMethodDef, occurrence)\n }\n\n atLeastOneSepFirstInternalRecord<OUT>(\n this: MixedInParser,\n occurrence: number,\n options: AtLeastOneSepMethodOpts<OUT>\n ): void {\n recordProd.call(\n this,\n RepetitionMandatoryWithSeparator,\n options,\n occurrence,\n HANDLE_SEPARATOR\n )\n }\n\n manyInternalRecord<OUT>(\n this: MixedInParser,\n occurrence: number,\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>\n ): void {\n recordProd.call(this, Repetition, actionORMethodDef, occurrence)\n }\n\n manySepFirstInternalRecord<OUT>(\n this: MixedInParser,\n occurrence: number,\n options: ManySepMethodOpts<OUT>\n ): void {\n recordProd.call(\n this,\n RepetitionWithSeparator,\n options,\n occurrence,\n HANDLE_SEPARATOR\n )\n }\n\n orInternalRecord<T>(\n this: MixedInParser,\n altsOrOpts: IOrAlt<any>[] | OrMethodOpts<unknown>,\n occurrence: number\n ): T {\n return recordOrProd.call(this, altsOrOpts, occurrence)\n }\n\n subruleInternalRecord<ARGS extends unknown[], R>(\n this: MixedInParser,\n ruleToCall: ParserMethodInternal<ARGS, R>,\n occurrence: number,\n options?: SubruleMethodOpts<ARGS>\n ): R | CstNode {\n assertMethodIdxIsValid(occurrence)\n if (!ruleToCall || has(ruleToCall, \"ruleName\") === false) {\n const error: any = new Error(\n `<SUBRULE${getIdxSuffix(occurrence)}> argument is invalid` +\n ` expecting a Parser method reference but got: <${JSON.stringify(\n ruleToCall\n )}>` +\n `\\n inside top level rule: <${\n (<Rule>this.recordingProdStack[0]).name\n }>`\n )\n error.KNOWN_RECORDER_ERROR = true\n throw error\n }\n\n const prevProd: any = peek(this.recordingProdStack)\n const ruleName = ruleToCall.ruleName\n const newNoneTerminal = new NonTerminal({\n idx: occurrence,\n nonTerminalName: ruleName,\n label: options?.LABEL,\n // The resolving of the `referencedRule` property will be done once all the Rule's GASTs have been created\n referencedRule: undefined\n })\n prevProd.definition.push(newNoneTerminal)\n\n return this.outputCst ? RECORDING_PHASE_CSTNODE : <any>RECORDING_NULL_OBJECT\n }\n\n consumeInternalRecord(\n this: MixedInParser,\n tokType: TokenType,\n occurrence: number,\n options?: ConsumeMethodOpts\n ): IToken {\n assertMethodIdxIsValid(occurrence)\n if (!hasShortKeyProperty(tokType)) {\n const error: any = new Error(\n `<CONSUME${getIdxSuffix(occurrence)}> argument is invalid` +\n ` expecting a TokenType reference but got: <${JSON.stringify(\n tokType\n )}>` +\n `\\n inside top level rule: <${\n (<Rule>this.recordingProdStack[0]).name\n }>`\n )\n error.KNOWN_RECORDER_ERROR = true\n throw error\n }\n const prevProd: any = peek(this.recordingProdStack)\n const newNoneTerminal = new Terminal({\n idx: occurrence,\n terminalType: tokType,\n label: options?.LABEL\n })\n prevProd.definition.push(newNoneTerminal)\n\n return RECORDING_PHASE_TOKEN\n }\n}\n\nfunction recordProd(\n prodConstructor: any,\n mainProdArg: any,\n occurrence: number,\n handleSep: boolean = false\n): any {\n assertMethodIdxIsValid(occurrence)\n const prevProd: any = peek(this.recordingProdStack)\n const grammarAction = isFunction(mainProdArg) ? mainProdArg : mainProdArg.DEF\n\n const newProd = new prodConstructor({ definition: [], idx: occurrence })\n if (handleSep) {\n newProd.separator = mainProdArg.SEP\n }\n if (has(mainProdArg, \"MAX_LOOKAHEAD\")) {\n newProd.maxLookahead = mainProdArg.MAX_LOOKAHEAD\n }\n\n this.recordingProdStack.push(newProd)\n grammarAction.call(this)\n prevProd.definition.push(newProd)\n this.recordingProdStack.pop()\n\n return RECORDING_NULL_OBJECT\n}\n\nfunction recordOrProd(mainProdArg: any, occurrence: number): any {\n assertMethodIdxIsValid(occurrence)\n const prevProd: any = peek(this.recordingProdStack)\n // Only an array of alternatives\n const hasOptions = isArray(mainProdArg) === false\n const alts: IOrAlt<unknown>[] =\n hasOptions === false ? mainProdArg : mainProdArg.DEF\n\n const newOrProd = new Alternation({\n definition: [],\n idx: occurrence,\n ignoreAmbiguities: hasOptions && mainProdArg.IGNORE_AMBIGUITIES === true\n })\n if (has(mainProdArg, \"MAX_LOOKAHEAD\")) {\n newOrProd.maxLookahead = mainProdArg.MAX_LOOKAHEAD\n }\n\n const hasPredicates = some(alts, (currAlt: any) => isFunction(currAlt.GATE))\n newOrProd.hasPredicates = hasPredicates\n\n prevProd.definition.push(newOrProd)\n\n forEach(alts, (currAlt) => {\n const currAltFlat = new Alternative({ definition: [] })\n newOrProd.definition.push(currAltFlat)\n if (has(currAlt, \"IGNORE_AMBIGUITIES\")) {\n currAltFlat.ignoreAmbiguities = currAlt.IGNORE_AMBIGUITIES as boolean // assumes end user provides the correct config value/type\n }\n // **implicit** ignoreAmbiguities due to usage of gate\n else if (has(currAlt, \"GATE\")) {\n currAltFlat.ignoreAmbiguities = true\n }\n this.recordingProdStack.push(currAltFlat)\n currAlt.ALT.call(this)\n this.recordingProdStack.pop()\n })\n return RECORDING_NULL_OBJECT\n}\n\nfunction getIdxSuffix(idx: number): string {\n return idx === 0 ? \"\" : `${idx}`\n}\n\nfunction assertMethodIdxIsValid(idx: number): void {\n if (idx < 0 || idx > MAX_METHOD_IDX) {\n const error: any = new Error(\n // The stack trace will contain all the needed details\n `Invalid DSL Method idx value: <${idx}>\\n\\t` +\n `Idx value must be a none negative value smaller than ${\n MAX_METHOD_IDX + 1\n }`\n )\n error.KNOWN_RECORDER_ERROR = true\n throw error\n }\n}\n","import { IParserConfig } from \"@chevrotain/types\"\nimport has from \"lodash/has\"\nimport { timer } from \"@chevrotain/utils\"\nimport { MixedInParser } from \"./parser_traits\"\nimport { DEFAULT_PARSER_CONFIG } from \"../parser\"\n\n/**\n * Trait responsible for runtime parsing errors.\n */\nexport class PerformanceTracer {\n traceInitPerf: boolean | number\n traceInitMaxIdent: number\n traceInitIndent: number\n\n initPerformanceTracer(config: IParserConfig) {\n if (has(config, \"traceInitPerf\")) {\n const userTraceInitPerf = config.traceInitPerf\n const traceIsNumber = typeof userTraceInitPerf === \"number\"\n this.traceInitMaxIdent = traceIsNumber\n ? <number>userTraceInitPerf\n : Infinity\n this.traceInitPerf = traceIsNumber\n ? userTraceInitPerf > 0\n : (userTraceInitPerf as boolean) // assumes end user provides the correct config value/type\n } else {\n this.traceInitMaxIdent = 0\n this.traceInitPerf = DEFAULT_PARSER_CONFIG.traceInitPerf\n }\n\n this.traceInitIndent = -1\n }\n\n TRACE_INIT<T>(this: MixedInParser, phaseDesc: string, phaseImpl: () => T): T {\n // No need to optimize this using NOOP pattern because\n // It is not called in a hot spot...\n if (this.traceInitPerf === true) {\n this.traceInitIndent++\n const indent = new Array(this.traceInitIndent + 1).join(\"\\t\")\n if (this.traceInitIndent < this.traceInitMaxIdent) {\n console.log(`${indent}--> <${phaseDesc}>`)\n }\n const { time, value } = timer(phaseImpl)\n /* istanbul ignore next - Difficult to reproduce specific performance behavior (>10ms) in tests */\n const traceMethod = time > 10 ? console.warn : console.log\n if (this.traceInitIndent < this.traceInitMaxIdent) {\n traceMethod(`${indent}<-- <${phaseDesc}> time: ${time}ms`)\n }\n this.traceInitIndent--\n return value\n } else {\n return phaseImpl()\n }\n }\n}\n","export function applyMixins(derivedCtor: any, baseCtors: any[]) {\n baseCtors.forEach((baseCtor) => {\n const baseProto = baseCtor.prototype\n Object.getOwnPropertyNames(baseProto).forEach((propName) => {\n if (propName === \"constructor\") {\n return\n }\n\n const basePropDescriptor = Object.getOwnPropertyDescriptor(\n baseProto,\n propName\n )\n // Handle Accessors\n if (\n basePropDescriptor &&\n (basePropDescriptor.get || basePropDescriptor.set)\n ) {\n Object.defineProperty(\n derivedCtor.prototype,\n propName,\n basePropDescriptor\n )\n } else {\n derivedCtor.prototype[propName] = baseCtor.prototype[propName]\n }\n })\n })\n}\n","import isEmpty from \"lodash/isEmpty\"\nimport map from \"lodash/map\"\nimport forEach from \"lodash/forEach\"\nimport values from \"lodash/values\"\nimport has from \"lodash/has\"\nimport clone from \"lodash/clone\"\nimport { toFastProperties } from \"@chevrotain/utils\"\nimport { computeAllProdsFollows } from \"../grammar/follow\"\nimport { createTokenInstance, EOF } from \"../../scan/tokens_public\"\nimport {\n defaultGrammarValidatorErrorProvider,\n defaultParserErrorProvider\n} from \"../errors_public\"\nimport {\n resolveGrammar,\n validateGrammar\n} from \"../grammar/gast/gast_resolver_public\"\nimport {\n CstNode,\n IParserConfig,\n IRecognitionException,\n IRuleConfig,\n IToken,\n TokenType,\n TokenVocabulary\n} from \"@chevrotain/types\"\nimport { Recoverable } from \"./traits/recoverable\"\nimport { LooksAhead } from \"./traits/looksahead\"\nimport { TreeBuilder } from \"./traits/tree_builder\"\nimport { LexerAdapter } from \"./traits/lexer_adapter\"\nimport { RecognizerApi } from \"./traits/recognizer_api\"\nimport { RecognizerEngine } from \"./traits/recognizer_engine\"\n\nimport { ErrorHandler } from \"./traits/error_handler\"\nimport { MixedInParser } from \"./traits/parser_traits\"\nimport { ContentAssist } from \"./traits/context_assist\"\nimport { GastRecorder } from \"./traits/gast_recorder\"\nimport { PerformanceTracer } from \"./traits/perf_tracer\"\nimport { applyMixins } from \"./utils/apply_mixins\"\nimport { IParserDefinitionError } from \"../grammar/types\"\nimport { Rule } from \"@chevrotain/gast\"\nimport { IParserConfigInternal, ParserMethodInternal } from \"./types\"\nimport { validateLookahead } from \"../grammar/checks\"\n\nexport const END_OF_FILE = createTokenInstance(\n EOF,\n \"\",\n NaN,\n NaN,\n NaN,\n NaN,\n NaN,\n NaN\n)\nObject.freeze(END_OF_FILE)\n\nexport type TokenMatcher = (token: IToken, tokType: TokenType) => boolean\n\nexport const DEFAULT_PARSER_CONFIG: Required<\n Omit<IParserConfigInternal, \"lookaheadStrategy\">\n> = Object.freeze({\n recoveryEnabled: false,\n maxLookahead: 3,\n dynamicTokensEnabled: false,\n outputCst: true,\n errorMessageProvider: defaultParserErrorProvider,\n nodeLocationTracking: \"none\",\n traceInitPerf: false,\n skipValidations: false\n})\n\nexport const DEFAULT_RULE_CONFIG: Required<IRuleConfig<any>> = Object.freeze({\n recoveryValueFunc: () => undefined,\n resyncEnabled: true\n})\n\nexport enum ParserDefinitionErrorType {\n INVALID_RULE_NAME = 0,\n DUPLICATE_RULE_NAME = 1,\n INVALID_RULE_OVERRIDE = 2,\n DUPLICATE_PRODUCTIONS = 3,\n UNRESOLVED_SUBRULE_REF = 4,\n LEFT_RECURSION = 5,\n NONE_LAST_EMPTY_ALT = 6,\n AMBIGUOUS_ALTS = 7,\n CONFLICT_TOKENS_RULES_NAMESPACE = 8,\n INVALID_TOKEN_NAME = 9,\n NO_NON_EMPTY_LOOKAHEAD = 10,\n AMBIGUOUS_PREFIX_ALTS = 11,\n TOO_MANY_ALTS = 12,\n CUSTOM_LOOKAHEAD_VALIDATION = 13\n}\n\nexport interface IParserDuplicatesDefinitionError\n extends IParserDefinitionError {\n dslName: string\n occurrence: number\n parameter?: string\n}\n\nexport interface IParserEmptyAlternativeDefinitionError\n extends IParserDefinitionError {\n occurrence: number\n alternative: number\n}\n\nexport interface IParserAmbiguousAlternativesDefinitionError\n extends IParserDefinitionError {\n occurrence: number | string\n alternatives: number[]\n}\n\nexport interface IParserUnresolvedRefDefinitionError\n extends IParserDefinitionError {\n unresolvedRefName: string\n}\n\nexport interface IParserState {\n errors: IRecognitionException[]\n lexerState: any\n RULE_STACK: number[]\n CST_STACK: CstNode[]\n}\n\nexport type Predicate = () => boolean\n\nexport function EMPTY_ALT(): () => undefined\nexport function EMPTY_ALT<T>(value: T): () => T\nexport function EMPTY_ALT(value: any = undefined) {\n return function () {\n return value\n }\n}\n\nexport class Parser {\n // Set this flag to true if you don't want the Parser to throw error when problems in it's definition are detected.\n // (normally during the parser's constructor).\n // This is a design time flag, it will not affect the runtime error handling of the parser, just design time errors,\n // for example: duplicate rule names, referencing an unresolved subrule, ect...\n // This flag should not be enabled during normal usage, it is used in special situations, for example when\n // needing to display the parser definition errors in some GUI(online playground).\n static DEFER_DEFINITION_ERRORS_HANDLING: boolean = false\n\n /**\n * @deprecated use the **instance** method with the same name instead\n */\n static performSelfAnalysis(parserInstance: Parser): void {\n throw Error(\n \"The **static** `performSelfAnalysis` method has been deprecated.\" +\n \"\\t\\nUse the **instance** method with the same name instead.\"\n )\n }\n\n public performSelfAnalysis(this: MixedInParser): void {\n this.TRACE_INIT(\"performSelfAnalysis\", () => {\n let defErrorsMsgs\n\n this.selfAnalysisDone = true\n const className = this.className\n\n this.TRACE_INIT(\"toFastProps\", () => {\n // Without this voodoo magic the parser would be x3-x4 slower\n // It seems it is better to invoke `toFastProperties` **before**\n // Any manipulations of the `this` object done during the recording phase.\n toFastProperties(this)\n })\n\n this.TRACE_INIT(\"Grammar Recording\", () => {\n try {\n this.enableRecording()\n // Building the GAST\n forEach(this.definedRulesNames, (currRuleName) => {\n const wrappedRule = (this as any)[\n currRuleName\n ] as ParserMethodInternal<unknown[], unknown>\n const originalGrammarAction = wrappedRule[\"originalGrammarAction\"]\n let recordedRuleGast!: Rule\n this.TRACE_INIT(`${currRuleName} Rule`, () => {\n recordedRuleGast = this.topLevelRuleRecord(\n currRuleName,\n originalGrammarAction\n )\n })\n this.gastProductionsCache[currRuleName] = recordedRuleGast\n })\n } finally {\n this.disableRecording()\n }\n })\n\n let resolverErrors: IParserDefinitionError[] = []\n this.TRACE_INIT(\"Grammar Resolving\", () => {\n resolverErrors = resolveGrammar({\n rules: values(this.gastProductionsCache)\n })\n this.definitionErrors = this.definitionErrors.concat(resolverErrors)\n })\n\n this.TRACE_INIT(\"Grammar Validations\", () => {\n // only perform additional grammar validations IFF no resolving errors have occurred.\n // as unresolved grammar may lead to unhandled runtime exceptions in the follow up validations.\n if (isEmpty(resolverErrors) && this.skipValidations === false) {\n const validationErrors = validateGrammar({\n rules: values(this.gastProductionsCache),\n tokenTypes: values(this.tokensMap),\n errMsgProvider: defaultGrammarValidatorErrorProvider,\n grammarName: className\n })\n const lookaheadValidationErrors = validateLookahead({\n lookaheadStrategy: this.lookaheadStrategy,\n rules: values(this.gastProductionsCache),\n tokenTypes: values(this.tokensMap),\n grammarName: className\n })\n this.definitionErrors = this.definitionErrors.concat(\n validationErrors,\n lookaheadValidationErrors\n )\n }\n })\n\n // this analysis may fail if the grammar is not perfectly valid\n if (isEmpty(this.definitionErrors)) {\n // The results of these computations are not needed unless error recovery is enabled.\n if (this.recoveryEnabled) {\n this.TRACE_INIT(\"computeAllProdsFollows\", () => {\n const allFollows = computeAllProdsFollows(\n values(this.gastProductionsCache)\n )\n this.resyncFollows = allFollows\n })\n }\n\n this.TRACE_INIT(\"ComputeLookaheadFunctions\", () => {\n this.lookaheadStrategy.initialize?.({\n rules: values(this.gastProductionsCache)\n })\n this.preComputeLookaheadFunctions(values(this.gastProductionsCache))\n })\n }\n\n if (\n !Parser.DEFER_DEFINITION_ERRORS_HANDLING &&\n !isEmpty(this.definitionErrors)\n ) {\n defErrorsMsgs = map(\n this.definitionErrors,\n (defError) => defError.message\n )\n throw new Error(\n `Parser Definition Errors detected:\\n ${defErrorsMsgs.join(\n \"\\n-------------------------------\\n\"\n )}`\n )\n }\n })\n }\n\n definitionErrors: IParserDefinitionError[] = []\n selfAnalysisDone = false\n protected skipValidations: boolean\n\n constructor(tokenVocabulary: TokenVocabulary, config: IParserConfig) {\n const that: MixedInParser = this as any\n that.initErrorHandler(config)\n that.initLexerAdapter()\n that.initLooksAhead(config)\n that.initRecognizerEngine(tokenVocabulary, config)\n that.initRecoverable(config)\n that.initTreeBuilder(config)\n that.initContentAssist()\n that.initGastRecorder(config)\n that.initPerformanceTracer(config)\n\n if (has(config, \"ignoredIssues\")) {\n throw new Error(\n \"The <ignoredIssues> IParserConfig property has been deprecated.\\n\\t\" +\n \"Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\\n\\t\" +\n \"See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\\n\\t\" +\n \"For further details.\"\n )\n }\n\n this.skipValidations = has(config, \"skipValidations\")\n ? (config.skipValidations as boolean) // casting assumes the end user passing the correct type\n : DEFAULT_PARSER_CONFIG.skipValidations\n }\n}\n\napplyMixins(Parser, [\n Recoverable,\n LooksAhead,\n TreeBuilder,\n LexerAdapter,\n RecognizerEngine,\n RecognizerApi,\n ErrorHandler,\n ContentAssist,\n GastRecorder,\n PerformanceTracer\n])\n\nexport class CstParser extends Parser {\n constructor(\n tokenVocabulary: TokenVocabulary,\n config: IParserConfigInternal = DEFAULT_PARSER_CONFIG\n ) {\n const configClone = clone(config)\n configClone.outputCst = true\n super(tokenVocabulary, configClone)\n }\n}\n\nexport class EmbeddedActionsParser extends Parser {\n constructor(\n tokenVocabulary: TokenVocabulary,\n config: IParserConfigInternal = DEFAULT_PARSER_CONFIG\n ) {\n const configClone = clone(config)\n configClone.outputCst = false\n super(tokenVocabulary, configClone)\n }\n}\n","import type {\n Alternation,\n Alternative,\n IProduction,\n Option,\n Repetition,\n RepetitionMandatory,\n RepetitionMandatoryWithSeparator,\n RepetitionWithSeparator,\n Rule,\n Terminal,\n TokenType\n} from \"@chevrotain/types\"\nimport { NonTerminal, GAstVisitor } from \"@chevrotain/gast\"\nimport map from \"lodash/map\"\nimport flatten from \"lodash/flatten\"\nimport values from \"lodash/values\"\nimport some from \"lodash/some\"\nimport groupBy from \"lodash/groupBy\"\nimport assign from \"lodash/assign\"\n\nexport function buildModel(\n productions: Record<string, Rule>\n): CstNodeTypeDefinition[] {\n const generator = new CstNodeDefinitionGenerator()\n const allRules = values(productions)\n return map(allRules, (rule) => generator.visitRule(rule))\n}\n\nexport type CstNodeTypeDefinition = {\n name: string\n properties: PropertyTypeDefinition[]\n}\n\nexport type PropertyTypeDefinition = {\n name: string\n type: PropertyArrayType\n optional: boolean\n}\n\nexport type PropertyArrayType =\n | TokenArrayType\n | RuleArrayType\n | (TokenArrayType | RuleArrayType)[]\n\nexport type TokenArrayType = { kind: \"token\" }\nexport type RuleArrayType = {\n kind: \"rule\"\n name: string\n}\n\nclass CstNodeDefinitionGenerator extends GAstVisitor {\n visitRule(node: Rule): CstNodeTypeDefinition {\n const rawElements = this.visitEach(node.definition)\n\n const grouped = groupBy(rawElements, (el) => el.propertyName)\n const properties = map(grouped, (group, propertyName) => {\n const allNullable = !some(group, (el) => !el.canBeNull)\n\n // In an alternation with a label a property name can have\n // multiple types.\n let propertyType: PropertyArrayType = group[0].type\n if (group.length > 1) {\n propertyType = map(group, (g) => g.type)\n }\n\n return {\n name: propertyName,\n type: propertyType,\n optional: allNullable\n } as PropertyTypeDefinition\n })\n\n return {\n name: node.name,\n properties: properties\n }\n }\n\n visitAlternative(node: Alternative) {\n return this.visitEachAndOverrideWith(node.definition, { canBeNull: true })\n }\n\n visitOption(node: Option) {\n return this.visitEachAndOverrideWith(node.definition, { canBeNull: true })\n }\n\n visitRepetition(node: Repetition) {\n return this.visitEachAndOverrideWith(node.definition, { canBeNull: true })\n }\n\n visitRepetitionMandatory(node: RepetitionMandatory) {\n return this.visitEach(node.definition)\n }\n\n visitRepetitionMandatoryWithSeparator(\n node: RepetitionMandatoryWithSeparator\n ) {\n return this.visitEach(node.definition).concat({\n propertyName: node.separator.name,\n canBeNull: true,\n type: getType(node.separator)\n })\n }\n\n visitRepetitionWithSeparator(node: RepetitionWithSeparator) {\n return this.visitEachAndOverrideWith(node.definition, {\n canBeNull: true\n }).concat({\n propertyName: node.separator.name,\n canBeNull: true,\n type: getType(node.separator)\n })\n }\n\n visitAlternation(node: Alternation) {\n return this.visitEachAndOverrideWith(node.definition, { canBeNull: true })\n }\n\n visitTerminal(node: Terminal): PropertyTupleElement[] {\n return [\n {\n propertyName: node.label || node.terminalType.name,\n canBeNull: false,\n type: getType(node)\n }\n ]\n }\n\n visitNonTerminal(node: NonTerminal): PropertyTupleElement[] {\n return [\n {\n propertyName: node.label || node.nonTerminalName,\n canBeNull: false,\n type: getType(node)\n }\n ]\n }\n\n private visitEachAndOverrideWith(\n definition: IProduction[],\n override: Partial<PropertyTupleElement>\n ) {\n return map(\n this.visitEach(definition),\n (definition) => assign({}, definition, override) as PropertyTupleElement\n )\n }\n\n private visitEach(definition: IProduction[]) {\n return flatten<PropertyTupleElement>(\n map(\n definition,\n (definition) => this.visit(definition) as PropertyTupleElement[]\n )\n )\n }\n}\n\ntype PropertyTupleElement = {\n propertyName: string\n canBeNull: boolean\n type: TokenArrayType | RuleArrayType\n}\n\nfunction getType(\n production: Terminal | NonTerminal | TokenType\n): TokenArrayType | RuleArrayType {\n if (production instanceof NonTerminal) {\n return {\n kind: \"rule\",\n name: production.referencedRule.name\n }\n }\n\n return { kind: \"token\" }\n}\n","var baseSlice = require('./_baseSlice');\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\nmodule.exports = castSlice;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nmodule.exports = hasUnicode;\n","/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\nmodule.exports = asciiToArray;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\nmodule.exports = unicodeToArray;\n","var asciiToArray = require('./_asciiToArray'),\n hasUnicode = require('./_hasUnicode'),\n unicodeToArray = require('./_unicodeToArray');\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\nmodule.exports = stringToArray;\n","var castSlice = require('./_castSlice'),\n hasUnicode = require('./_hasUnicode'),\n stringToArray = require('./_stringToArray'),\n toString = require('./toString');\n\n/**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\nfunction createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n}\n\nmodule.exports = createCaseFirst;\n","var createCaseFirst = require('./_createCaseFirst');\n\n/**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\nvar upperFirst = createCaseFirst('toUpperCase');\n\nmodule.exports = upperFirst;\n","import flatten from \"lodash/flatten\"\nimport isArray from \"lodash/isArray\"\nimport map from \"lodash/map\"\nimport reduce from \"lodash/reduce\"\nimport uniq from \"lodash/uniq\"\nimport upperFirst from \"lodash/upperFirst\"\nimport { GenerateDtsOptions } from \"@chevrotain/types\"\nimport {\n CstNodeTypeDefinition,\n PropertyTypeDefinition,\n PropertyArrayType,\n TokenArrayType,\n RuleArrayType\n} from \"./model\"\n\nexport function genDts(\n model: CstNodeTypeDefinition[],\n options: Required<GenerateDtsOptions>\n): string {\n let contentParts: string[] = []\n\n contentParts = contentParts.concat(\n `import type { CstNode, ICstVisitor, IToken } from \"chevrotain\";`\n )\n\n contentParts = contentParts.concat(\n flatten(map(model, (node) => genCstNodeTypes(node)))\n )\n\n if (options.includeVisitorInterface) {\n contentParts = contentParts.concat(\n genVisitor(options.visitorInterfaceName, model)\n )\n }\n\n return contentParts.join(\"\\n\\n\") + \"\\n\"\n}\n\nfunction genCstNodeTypes(node: CstNodeTypeDefinition) {\n const nodeCstInterface = genNodeInterface(node)\n const nodeChildrenInterface = genNodeChildrenType(node)\n\n return [nodeCstInterface, nodeChildrenInterface]\n}\n\nfunction genNodeInterface(node: CstNodeTypeDefinition) {\n const nodeInterfaceName = getNodeInterfaceName(node.name)\n const childrenTypeName = getNodeChildrenTypeName(node.name)\n\n return `export interface ${nodeInterfaceName} extends CstNode {\n name: \"${node.name}\";\n children: ${childrenTypeName};\n}`\n}\n\nfunction genNodeChildrenType(node: CstNodeTypeDefinition) {\n const typeName = getNodeChildrenTypeName(node.name)\n\n return `export type ${typeName} = {\n ${map(node.properties, (property) => genChildProperty(property)).join(\"\\n \")}\n};`\n}\n\nfunction genChildProperty(prop: PropertyTypeDefinition) {\n const typeName = buildTypeString(prop.type)\n return `${prop.name}${prop.optional ? \"?\" : \"\"}: ${typeName}[];`\n}\n\nfunction genVisitor(name: string, nodes: CstNodeTypeDefinition[]) {\n return `export interface ${name}<IN, OUT> extends ICstVisitor<IN, OUT> {\n ${map(nodes, (node) => genVisitorFunction(node)).join(\"\\n \")}\n}`\n}\n\nfunction genVisitorFunction(node: CstNodeTypeDefinition) {\n const childrenTypeName = getNodeChildrenTypeName(node.name)\n return `${node.name}(children: ${childrenTypeName}, param?: IN): OUT;`\n}\n\nfunction buildTypeString(type: PropertyArrayType) {\n if (isArray(type)) {\n const typeNames = uniq(map(type, (t) => getTypeString(t)))\n const typeString = reduce(typeNames, (sum, t) => sum + \" | \" + t)\n return \"(\" + typeString + \")\"\n } else {\n return getTypeString(type)\n }\n}\n\nfunction getTypeString(type: TokenArrayType | RuleArrayType) {\n if (type.kind === \"token\") {\n return \"IToken\"\n }\n return getNodeInterfaceName(type.name)\n}\n\nfunction getNodeInterfaceName(ruleName: string) {\n return upperFirst(ruleName) + \"CstNode\"\n}\n\nfunction getNodeChildrenTypeName(ruleName: string) {\n return upperFirst(ruleName) + \"CstChildren\"\n}\n","import { Rule, GenerateDtsOptions } from \"@chevrotain/types\"\nimport { buildModel } from \"./model\"\nimport { genDts } from \"./generate\"\n\nconst defaultOptions: Required<GenerateDtsOptions> = {\n includeVisitorInterface: true,\n visitorInterfaceName: \"ICstNodeVisitor\"\n}\n\nexport function generateCstDts(\n productions: Record<string, Rule>,\n options?: GenerateDtsOptions\n): string {\n const effectiveOptions = {\n ...defaultOptions,\n ...options\n }\n\n const model = buildModel(productions)\n\n return genDts(model, effectiveOptions)\n}\n","import { VERSION } from \"../version\"\nimport { ISerializedGast } from \"@chevrotain/types\"\n\nexport function createSyntaxDiagramsCode(\n grammar: ISerializedGast[],\n {\n resourceBase = `https://unpkg.com/chevrotain@${VERSION}/diagrams/`,\n css = `https://unpkg.com/chevrotain@${VERSION}/diagrams/diagrams.css`\n }: {\n resourceBase?: string\n css?: string\n } = {}\n) {\n const header = `\n<!-- This is a generated file -->\n<!DOCTYPE html>\n<meta charset=\"utf-8\">\n<style>\n body {\n background-color: hsl(30, 20%, 95%)\n }\n</style>\n\n`\n const cssHtml = `\n<link rel='stylesheet' href='${css}'>\n`\n\n const scripts = `\n<script src='${resourceBase}vendor/railroad-diagrams.js'></script>\n<script src='${resourceBase}src/diagrams_builder.js'></script>\n<script src='${resourceBase}src/diagrams_behavior.js'></script>\n<script src='${resourceBase}src/main.js'></script>\n`\n const diagramsDiv = `\n<div id=\"diagrams\" align=\"center\"></div> \n`\n const serializedGrammar = `\n<script>\n window.serializedGrammar = ${JSON.stringify(grammar, null, \" \")};\n</script>\n`\n\n const initLogic = `\n<script>\n var diagramsDiv = document.getElementById(\"diagrams\");\n main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);\n</script>\n`\n return (\n header + cssHtml + scripts + diagramsDiv + serializedGrammar + initLogic\n )\n}\n","/* istanbul ignore file - tricky to import some things from this module during testing */\n\n// semantic version\nexport { VERSION } from \"./version\"\n\nexport {\n CstParser,\n EmbeddedActionsParser,\n ParserDefinitionErrorType,\n EMPTY_ALT\n} from \"./parse/parser/parser\"\n\nexport { Lexer, LexerDefinitionErrorType } from \"./scan/lexer_public\"\n\n// Tokens utilities\nexport {\n createToken,\n createTokenInstance,\n EOF,\n tokenLabel,\n tokenMatcher,\n tokenName\n} from \"./scan/tokens_public\"\n\n// Lookahead\n\nexport { getLookaheadPaths } from \"./parse/grammar/lookahead\"\n\nexport { LLkLookaheadStrategy } from \"./parse/grammar/llk_lookahead\"\n\n// Other Utilities\n\nexport { defaultParserErrorProvider } from \"./parse/errors_public\"\n\nexport {\n EarlyExitException,\n isRecognitionException,\n MismatchedTokenException,\n NotAllInputParsedException,\n NoViableAltException\n} from \"./parse/exceptions_public\"\n\nexport { defaultLexerErrorProvider } from \"./scan/lexer_errors_public\"\n\n// grammar reflection API\nexport {\n Alternation,\n Alternative,\n NonTerminal,\n Option,\n Repetition,\n RepetitionMandatory,\n RepetitionMandatoryWithSeparator,\n RepetitionWithSeparator,\n Rule,\n Terminal\n} from \"@chevrotain/gast\"\n\n// GAST Utilities\n\nexport {\n serializeGrammar,\n serializeProduction,\n GAstVisitor\n} from \"@chevrotain/gast\"\n\nexport { generateCstDts } from \"@chevrotain/cst-dts-gen\"\n\n/* istanbul ignore next */\nexport function clearCache() {\n console.warn(\n \"The clearCache function was 'soft' removed from the Chevrotain API.\" +\n \"\\n\\t It performs no action other than printing this message.\" +\n \"\\n\\t Please avoid using it as it will be completely removed in the future\"\n )\n}\n\nexport { createSyntaxDiagramsCode } from \"./diagrams/render_public\"\n\nexport class Parser {\n constructor() {\n throw new Error(\n \"The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.\\t\\n\" +\n \"See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0\"\n )\n }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lilconfigSync = exports.lilconfig = exports.defaultLoaders = void 0;\nconst path = require(\"path\");\nconst fs = require(\"fs\");\nconst os = require(\"os\");\nconst fsReadFileAsync = fs.promises.readFile;\nfunction getDefaultSearchPlaces(name) {\n return [\n 'package.json',\n `.${name}rc.json`,\n `.${name}rc.js`,\n `.${name}rc.cjs`,\n `.config/${name}rc`,\n `.config/${name}rc.json`,\n `.config/${name}rc.js`,\n `.config/${name}rc.cjs`,\n `${name}.config.js`,\n `${name}.config.cjs`,\n ];\n}\nfunction getSearchPaths(startDir, stopDir) {\n return startDir\n .split(path.sep)\n .reduceRight((acc, _, ind, arr) => {\n const currentPath = arr.slice(0, ind + 1).join(path.sep);\n if (!acc.passedStopDir)\n acc.searchPlaces.push(currentPath || path.sep);\n if (currentPath === stopDir)\n acc.passedStopDir = true;\n return acc;\n }, { searchPlaces: [], passedStopDir: false }).searchPlaces;\n}\nexports.defaultLoaders = Object.freeze({\n '.js': require,\n '.json': require,\n '.cjs': require,\n noExt(_, content) {\n return JSON.parse(content);\n },\n});\nfunction getExtDesc(ext) {\n return ext === 'noExt' ? 'files without extensions' : `extension \"${ext}\"`;\n}\nfunction getOptions(name, options = {}) {\n const conf = {\n stopDir: os.homedir(),\n searchPlaces: getDefaultSearchPlaces(name),\n ignoreEmptySearchPlaces: true,\n transform: (x) => x,\n packageProp: [name],\n ...options,\n loaders: { ...exports.defaultLoaders, ...options.loaders },\n };\n conf.searchPlaces.forEach(place => {\n const key = path.extname(place) || 'noExt';\n const loader = conf.loaders[key];\n if (!loader) {\n throw new Error(`No loader specified for ${getExtDesc(key)}, so searchPlaces item \"${place}\" is invalid`);\n }\n if (typeof loader !== 'function') {\n throw new Error(`loader for ${getExtDesc(key)} is not a function (type provided: \"${typeof loader}\"), so searchPlaces item \"${place}\" is invalid`);\n }\n });\n return conf;\n}\nfunction getPackageProp(props, obj) {\n if (typeof props === 'string' && props in obj)\n return obj[props];\n return ((Array.isArray(props) ? props : props.split('.')).reduce((acc, prop) => (acc === undefined ? acc : acc[prop]), obj) || null);\n}\nfunction getSearchItems(searchPlaces, searchPaths) {\n return searchPaths.reduce((acc, searchPath) => {\n searchPlaces.forEach(sp => acc.push({\n searchPlace: sp,\n filepath: path.join(searchPath, sp),\n loaderKey: path.extname(sp) || 'noExt',\n }));\n return acc;\n }, []);\n}\nfunction validateFilePath(filepath) {\n if (!filepath)\n throw new Error('load must pass a non-empty string');\n}\nfunction validateLoader(loader, ext) {\n if (!loader)\n throw new Error(`No loader specified for extension \"${ext}\"`);\n if (typeof loader !== 'function')\n throw new Error('loader is not a function');\n}\nfunction lilconfig(name, options) {\n const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform, } = getOptions(name, options);\n return {\n async search(searchFrom = process.cwd()) {\n const searchPaths = getSearchPaths(searchFrom, stopDir);\n const result = {\n config: null,\n filepath: '',\n };\n const searchItems = getSearchItems(searchPlaces, searchPaths);\n for (const { searchPlace, filepath, loaderKey } of searchItems) {\n try {\n await fs.promises.access(filepath);\n }\n catch (_a) {\n continue;\n }\n const content = String(await fsReadFileAsync(filepath));\n const loader = loaders[loaderKey];\n if (searchPlace === 'package.json') {\n const pkg = await loader(filepath, content);\n const maybeConfig = getPackageProp(packageProp, pkg);\n if (maybeConfig != null) {\n result.config = maybeConfig;\n result.filepath = filepath;\n break;\n }\n continue;\n }\n const isEmpty = content.trim() === '';\n if (isEmpty && ignoreEmptySearchPlaces)\n continue;\n if (isEmpty) {\n result.isEmpty = true;\n result.config = undefined;\n }\n else {\n validateLoader(loader, loaderKey);\n result.config = await loader(filepath, content);\n }\n result.filepath = filepath;\n break;\n }\n if (result.filepath === '' && result.config === null)\n return transform(null);\n return transform(result);\n },\n async load(filepath) {\n validateFilePath(filepath);\n const absPath = path.resolve(process.cwd(), filepath);\n const { base, ext } = path.parse(absPath);\n const loaderKey = ext || 'noExt';\n const loader = loaders[loaderKey];\n validateLoader(loader, loaderKey);\n const content = String(await fsReadFileAsync(absPath));\n if (base === 'package.json') {\n const pkg = await loader(absPath, content);\n return transform({\n config: getPackageProp(packageProp, pkg),\n filepath: absPath,\n });\n }\n const result = {\n config: null,\n filepath: absPath,\n };\n const isEmpty = content.trim() === '';\n if (isEmpty && ignoreEmptySearchPlaces)\n return transform({\n config: undefined,\n filepath: absPath,\n isEmpty: true,\n });\n result.config = isEmpty\n ? undefined\n : await loader(absPath, content);\n return transform(isEmpty ? { ...result, isEmpty, config: undefined } : result);\n },\n };\n}\nexports.lilconfig = lilconfig;\nfunction lilconfigSync(name, options) {\n const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform, } = getOptions(name, options);\n return {\n search(searchFrom = process.cwd()) {\n const searchPaths = getSearchPaths(searchFrom, stopDir);\n const result = {\n config: null,\n filepath: '',\n };\n const searchItems = getSearchItems(searchPlaces, searchPaths);\n for (const { searchPlace, filepath, loaderKey } of searchItems) {\n try {\n fs.accessSync(filepath);\n }\n catch (_a) {\n continue;\n }\n const loader = loaders[loaderKey];\n const content = String(fs.readFileSync(filepath));\n if (searchPlace === 'package.json') {\n const pkg = loader(filepath, content);\n const maybeConfig = getPackageProp(packageProp, pkg);\n if (maybeConfig != null) {\n result.config = maybeConfig;\n result.filepath = filepath;\n break;\n }\n continue;\n }\n const isEmpty = content.trim() === '';\n if (isEmpty && ignoreEmptySearchPlaces)\n continue;\n if (isEmpty) {\n result.isEmpty = true;\n result.config = undefined;\n }\n else {\n validateLoader(loader, loaderKey);\n result.config = loader(filepath, content);\n }\n result.filepath = filepath;\n break;\n }\n if (result.filepath === '' && result.config === null)\n return transform(null);\n return transform(result);\n },\n load(filepath) {\n validateFilePath(filepath);\n const absPath = path.resolve(process.cwd(), filepath);\n const { base, ext } = path.parse(absPath);\n const loaderKey = ext || 'noExt';\n const loader = loaders[loaderKey];\n validateLoader(loader, loaderKey);\n const content = String(fs.readFileSync(absPath));\n if (base === 'package.json') {\n const pkg = loader(absPath, content);\n return transform({\n config: getPackageProp(packageProp, pkg),\n filepath: absPath,\n });\n }\n const result = {\n config: null,\n filepath: absPath,\n };\n const isEmpty = content.trim() === '';\n if (isEmpty && ignoreEmptySearchPlaces)\n return transform({\n filepath: absPath,\n config: undefined,\n isEmpty: true,\n });\n result.config = isEmpty ? undefined : loader(absPath, content);\n return transform(isEmpty ? { ...result, isEmpty, config: undefined } : result);\n },\n };\n}\nexports.lilconfigSync = lilconfigSync;\n","import commander from './index.js';\n\n// wrapper to provide named exports for ESM.\nexport const {\n program,\n createCommand,\n createArgument,\n createOption,\n CommanderError,\n InvalidArgumentError,\n InvalidOptionArgumentError, // deprecated old name\n Command,\n Argument,\n Option,\n Help,\n} = commander;\n","export default function ansiRegex({onlyFirst = false} = {}) {\n\t// Valid string terminator sequences are BEL, ESC\\, and 0x9c\n\tconst ST = '(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)';\n\tconst pattern = [\n\t\t`[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?${ST})`,\n\t\t'(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))',\n\t].join('|');\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n","import ansiRegex from 'ansi-regex';\n\nconst regex = ansiRegex();\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\t// Even though the regex is global, we don't need to reset the `.lastIndex`\n\t// because unlike `.exec()` and `.test()`, `.replace()` does it automatically\n\t// and doing it manually has a performance penalty.\n\treturn string.replace(regex, '');\n}\n","var eaw = {};\n\nif ('undefined' == typeof module) {\n window.eastasianwidth = eaw;\n} else {\n module.exports = eaw;\n}\n\neaw.eastAsianWidth = function(character) {\n var x = character.charCodeAt(0);\n var y = (character.length == 2) ? character.charCodeAt(1) : 0;\n var codePoint = x;\n if ((0xD800 <= x && x <= 0xDBFF) && (0xDC00 <= y && y <= 0xDFFF)) {\n x &= 0x3FF;\n y &= 0x3FF;\n codePoint = (x << 10) | y;\n codePoint += 0x10000;\n }\n\n if ((0x3000 == codePoint) ||\n (0xFF01 <= codePoint && codePoint <= 0xFF60) ||\n (0xFFE0 <= codePoint && codePoint <= 0xFFE6)) {\n return 'F';\n }\n if ((0x20A9 == codePoint) ||\n (0xFF61 <= codePoint && codePoint <= 0xFFBE) ||\n (0xFFC2 <= codePoint && codePoint <= 0xFFC7) ||\n (0xFFCA <= codePoint && codePoint <= 0xFFCF) ||\n (0xFFD2 <= codePoint && codePoint <= 0xFFD7) ||\n (0xFFDA <= codePoint && codePoint <= 0xFFDC) ||\n (0xFFE8 <= codePoint && codePoint <= 0xFFEE)) {\n return 'H';\n }\n if ((0x1100 <= codePoint && codePoint <= 0x115F) ||\n (0x11A3 <= codePoint && codePoint <= 0x11A7) ||\n (0x11FA <= codePoint && codePoint <= 0x11FF) ||\n (0x2329 <= codePoint && codePoint <= 0x232A) ||\n (0x2E80 <= codePoint && codePoint <= 0x2E99) ||\n (0x2E9B <= codePoint && codePoint <= 0x2EF3) ||\n (0x2F00 <= codePoint && codePoint <= 0x2FD5) ||\n (0x2FF0 <= codePoint && codePoint <= 0x2FFB) ||\n (0x3001 <= codePoint && codePoint <= 0x303E) ||\n (0x3041 <= codePoint && codePoint <= 0x3096) ||\n (0x3099 <= codePoint && codePoint <= 0x30FF) ||\n (0x3105 <= codePoint && codePoint <= 0x312D) ||\n (0x3131 <= codePoint && codePoint <= 0x318E) ||\n (0x3190 <= codePoint && codePoint <= 0x31BA) ||\n (0x31C0 <= codePoint && codePoint <= 0x31E3) ||\n (0x31F0 <= codePoint && codePoint <= 0x321E) ||\n (0x3220 <= codePoint && codePoint <= 0x3247) ||\n (0x3250 <= codePoint && codePoint <= 0x32FE) ||\n (0x3300 <= codePoint && codePoint <= 0x4DBF) ||\n (0x4E00 <= codePoint && codePoint <= 0xA48C) ||\n (0xA490 <= codePoint && codePoint <= 0xA4C6) ||\n (0xA960 <= codePoint && codePoint <= 0xA97C) ||\n (0xAC00 <= codePoint && codePoint <= 0xD7A3) ||\n (0xD7B0 <= codePoint && codePoint <= 0xD7C6) ||\n (0xD7CB <= codePoint && codePoint <= 0xD7FB) ||\n (0xF900 <= codePoint && codePoint <= 0xFAFF) ||\n (0xFE10 <= codePoint && codePoint <= 0xFE19) ||\n (0xFE30 <= codePoint && codePoint <= 0xFE52) ||\n (0xFE54 <= codePoint && codePoint <= 0xFE66) ||\n (0xFE68 <= codePoint && codePoint <= 0xFE6B) ||\n (0x1B000 <= codePoint && codePoint <= 0x1B001) ||\n (0x1F200 <= codePoint && codePoint <= 0x1F202) ||\n (0x1F210 <= codePoint && codePoint <= 0x1F23A) ||\n (0x1F240 <= codePoint && codePoint <= 0x1F248) ||\n (0x1F250 <= codePoint && codePoint <= 0x1F251) ||\n (0x20000 <= codePoint && codePoint <= 0x2F73F) ||\n (0x2B740 <= codePoint && codePoint <= 0x2FFFD) ||\n (0x30000 <= codePoint && codePoint <= 0x3FFFD)) {\n return 'W';\n }\n if ((0x0020 <= codePoint && codePoint <= 0x007E) ||\n (0x00A2 <= codePoint && codePoint <= 0x00A3) ||\n (0x00A5 <= codePoint && codePoint <= 0x00A6) ||\n (0x00AC == codePoint) ||\n (0x00AF == codePoint) ||\n (0x27E6 <= codePoint && codePoint <= 0x27ED) ||\n (0x2985 <= codePoint && codePoint <= 0x2986)) {\n return 'Na';\n }\n if ((0x00A1 == codePoint) ||\n (0x00A4 == codePoint) ||\n (0x00A7 <= codePoint && codePoint <= 0x00A8) ||\n (0x00AA == codePoint) ||\n (0x00AD <= codePoint && codePoint <= 0x00AE) ||\n (0x00B0 <= codePoint && codePoint <= 0x00B4) ||\n (0x00B6 <= codePoint && codePoint <= 0x00BA) ||\n (0x00BC <= codePoint && codePoint <= 0x00BF) ||\n (0x00C6 == codePoint) ||\n (0x00D0 == codePoint) ||\n (0x00D7 <= codePoint && codePoint <= 0x00D8) ||\n (0x00DE <= codePoint && codePoint <= 0x00E1) ||\n (0x00E6 == codePoint) ||\n (0x00E8 <= codePoint && codePoint <= 0x00EA) ||\n (0x00EC <= codePoint && codePoint <= 0x00ED) ||\n (0x00F0 == codePoint) ||\n (0x00F2 <= codePoint && codePoint <= 0x00F3) ||\n (0x00F7 <= codePoint && codePoint <= 0x00FA) ||\n (0x00FC == codePoint) ||\n (0x00FE == codePoint) ||\n (0x0101 == codePoint) ||\n (0x0111 == codePoint) ||\n (0x0113 == codePoint) ||\n (0x011B == codePoint) ||\n (0x0126 <= codePoint && codePoint <= 0x0127) ||\n (0x012B == codePoint) ||\n (0x0131 <= codePoint && codePoint <= 0x0133) ||\n (0x0138 == codePoint) ||\n (0x013F <= codePoint && codePoint <= 0x0142) ||\n (0x0144 == codePoint) ||\n (0x0148 <= codePoint && codePoint <= 0x014B) ||\n (0x014D == codePoint) ||\n (0x0152 <= codePoint && codePoint <= 0x0153) ||\n (0x0166 <= codePoint && codePoint <= 0x0167) ||\n (0x016B == codePoint) ||\n (0x01CE == codePoint) ||\n (0x01D0 == codePoint) ||\n (0x01D2 == codePoint) ||\n (0x01D4 == codePoint) ||\n (0x01D6 == codePoint) ||\n (0x01D8 == codePoint) ||\n (0x01DA == codePoint) ||\n (0x01DC == codePoint) ||\n (0x0251 == codePoint) ||\n (0x0261 == codePoint) ||\n (0x02C4 == codePoint) ||\n (0x02C7 == codePoint) ||\n (0x02C9 <= codePoint && codePoint <= 0x02CB) ||\n (0x02CD == codePoint) ||\n (0x02D0 == codePoint) ||\n (0x02D8 <= codePoint && codePoint <= 0x02DB) ||\n (0x02DD == codePoint) ||\n (0x02DF == codePoint) ||\n (0x0300 <= codePoint && codePoint <= 0x036F) ||\n (0x0391 <= codePoint && codePoint <= 0x03A1) ||\n (0x03A3 <= codePoint && codePoint <= 0x03A9) ||\n (0x03B1 <= codePoint && codePoint <= 0x03C1) ||\n (0x03C3 <= codePoint && codePoint <= 0x03C9) ||\n (0x0401 == codePoint) ||\n (0x0410 <= codePoint && codePoint <= 0x044F) ||\n (0x0451 == codePoint) ||\n (0x2010 == codePoint) ||\n (0x2013 <= codePoint && codePoint <= 0x2016) ||\n (0x2018 <= codePoint && codePoint <= 0x2019) ||\n (0x201C <= codePoint && codePoint <= 0x201D) ||\n (0x2020 <= codePoint && codePoint <= 0x2022) ||\n (0x2024 <= codePoint && codePoint <= 0x2027) ||\n (0x2030 == codePoint) ||\n (0x2032 <= codePoint && codePoint <= 0x2033) ||\n (0x2035 == codePoint) ||\n (0x203B == codePoint) ||\n (0x203E == codePoint) ||\n (0x2074 == codePoint) ||\n (0x207F == codePoint) ||\n (0x2081 <= codePoint && codePoint <= 0x2084) ||\n (0x20AC == codePoint) ||\n (0x2103 == codePoint) ||\n (0x2105 == codePoint) ||\n (0x2109 == codePoint) ||\n (0x2113 == codePoint) ||\n (0x2116 == codePoint) ||\n (0x2121 <= codePoint && codePoint <= 0x2122) ||\n (0x2126 == codePoint) ||\n (0x212B == codePoint) ||\n (0x2153 <= codePoint && codePoint <= 0x2154) ||\n (0x215B <= codePoint && codePoint <= 0x215E) ||\n (0x2160 <= codePoint && codePoint <= 0x216B) ||\n (0x2170 <= codePoint && codePoint <= 0x2179) ||\n (0x2189 == codePoint) ||\n (0x2190 <= codePoint && codePoint <= 0x2199) ||\n (0x21B8 <= codePoint && codePoint <= 0x21B9) ||\n (0x21D2 == codePoint) ||\n (0x21D4 == codePoint) ||\n (0x21E7 == codePoint) ||\n (0x2200 == codePoint) ||\n (0x2202 <= codePoint && codePoint <= 0x2203) ||\n (0x2207 <= codePoint && codePoint <= 0x2208) ||\n (0x220B == codePoint) ||\n (0x220F == codePoint) ||\n (0x2211 == codePoint) ||\n (0x2215 == codePoint) ||\n (0x221A == codePoint) ||\n (0x221D <= codePoint && codePoint <= 0x2220) ||\n (0x2223 == codePoint) ||\n (0x2225 == codePoint) ||\n (0x2227 <= codePoint && codePoint <= 0x222C) ||\n (0x222E == codePoint) ||\n (0x2234 <= codePoint && codePoint <= 0x2237) ||\n (0x223C <= codePoint && codePoint <= 0x223D) ||\n (0x2248 == codePoint) ||\n (0x224C == codePoint) ||\n (0x2252 == codePoint) ||\n (0x2260 <= codePoint && codePoint <= 0x2261) ||\n (0x2264 <= codePoint && codePoint <= 0x2267) ||\n (0x226A <= codePoint && codePoint <= 0x226B) ||\n (0x226E <= codePoint && codePoint <= 0x226F) ||\n (0x2282 <= codePoint && codePoint <= 0x2283) ||\n (0x2286 <= codePoint && codePoint <= 0x2287) ||\n (0x2295 == codePoint) ||\n (0x2299 == codePoint) ||\n (0x22A5 == codePoint) ||\n (0x22BF == codePoint) ||\n (0x2312 == codePoint) ||\n (0x2460 <= codePoint && codePoint <= 0x24E9) ||\n (0x24EB <= codePoint && codePoint <= 0x254B) ||\n (0x2550 <= codePoint && codePoint <= 0x2573) ||\n (0x2580 <= codePoint && codePoint <= 0x258F) ||\n (0x2592 <= codePoint && codePoint <= 0x2595) ||\n (0x25A0 <= codePoint && codePoint <= 0x25A1) ||\n (0x25A3 <= codePoint && codePoint <= 0x25A9) ||\n (0x25B2 <= codePoint && codePoint <= 0x25B3) ||\n (0x25B6 <= codePoint && codePoint <= 0x25B7) ||\n (0x25BC <= codePoint && codePoint <= 0x25BD) ||\n (0x25C0 <= codePoint && codePoint <= 0x25C1) ||\n (0x25C6 <= codePoint && codePoint <= 0x25C8) ||\n (0x25CB == codePoint) ||\n (0x25CE <= codePoint && codePoint <= 0x25D1) ||\n (0x25E2 <= codePoint && codePoint <= 0x25E5) ||\n (0x25EF == codePoint) ||\n (0x2605 <= codePoint && codePoint <= 0x2606) ||\n (0x2609 == codePoint) ||\n (0x260E <= codePoint && codePoint <= 0x260F) ||\n (0x2614 <= codePoint && codePoint <= 0x2615) ||\n (0x261C == codePoint) ||\n (0x261E == codePoint) ||\n (0x2640 == codePoint) ||\n (0x2642 == codePoint) ||\n (0x2660 <= codePoint && codePoint <= 0x2661) ||\n (0x2663 <= codePoint && codePoint <= 0x2665) ||\n (0x2667 <= codePoint && codePoint <= 0x266A) ||\n (0x266C <= codePoint && codePoint <= 0x266D) ||\n (0x266F == codePoint) ||\n (0x269E <= codePoint && codePoint <= 0x269F) ||\n (0x26BE <= codePoint && codePoint <= 0x26BF) ||\n (0x26C4 <= codePoint && codePoint <= 0x26CD) ||\n (0x26CF <= codePoint && codePoint <= 0x26E1) ||\n (0x26E3 == codePoint) ||\n (0x26E8 <= codePoint && codePoint <= 0x26FF) ||\n (0x273D == codePoint) ||\n (0x2757 == codePoint) ||\n (0x2776 <= codePoint && codePoint <= 0x277F) ||\n (0x2B55 <= codePoint && codePoint <= 0x2B59) ||\n (0x3248 <= codePoint && codePoint <= 0x324F) ||\n (0xE000 <= codePoint && codePoint <= 0xF8FF) ||\n (0xFE00 <= codePoint && codePoint <= 0xFE0F) ||\n (0xFFFD == codePoint) ||\n (0x1F100 <= codePoint && codePoint <= 0x1F10A) ||\n (0x1F110 <= codePoint && codePoint <= 0x1F12D) ||\n (0x1F130 <= codePoint && codePoint <= 0x1F169) ||\n (0x1F170 <= codePoint && codePoint <= 0x1F19A) ||\n (0xE0100 <= codePoint && codePoint <= 0xE01EF) ||\n (0xF0000 <= codePoint && codePoint <= 0xFFFFD) ||\n (0x100000 <= codePoint && codePoint <= 0x10FFFD)) {\n return 'A';\n }\n\n return 'N';\n};\n\neaw.characterLength = function(character) {\n var code = this.eastAsianWidth(character);\n if (code == 'F' || code == 'W' || code == 'A') {\n return 2;\n } else {\n return 1;\n }\n};\n\n// Split a string considering surrogate-pairs.\nfunction stringToArray(string) {\n return string.match(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^\\uD800-\\uDFFF]/g) || [];\n}\n\neaw.length = function(string) {\n var characters = stringToArray(string);\n var len = 0;\n for (var i = 0; i < characters.length; i++) {\n len = len + this.characterLength(characters[i]);\n }\n return len;\n};\n\neaw.slice = function(text, start, end) {\n textLen = eaw.length(text)\n start = start ? start : 0;\n end = end ? end : 1;\n if (start < 0) {\n start = textLen + start;\n }\n if (end < 0) {\n end = textLen + end;\n }\n var result = '';\n var eawLen = 0;\n var chars = stringToArray(text);\n for (var i = 0; i < chars.length; i++) {\n var char = chars[i];\n var charLen = eaw.length(char);\n if (eawLen >= start - (charLen == 2 ? 1 : 0)) {\n if (eawLen + charLen <= end) {\n result += char;\n } else {\n break;\n }\n }\n eawLen += charLen;\n }\n return result;\n};\n","\"use strict\";\n\nmodule.exports = function () {\n // https://mths.be/emoji\n return /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67)\\uDB40\\uDC7F|(?:\\uD83E\\uDDD1\\uD83C\\uDFFF\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C\\uDFFB(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))?|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\u200D(?:(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC)?|(?:\\uD83D\\uDC69(?:\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69]))|\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|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BD])|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDE36\\u200D\\uD83C\\uDF2B|\\uD83C\\uDFF3\\uFE0F\\u200D\\u26A7|\\uD83D\\uDC3B\\u200D\\u2744|(?:(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\uD83C\\uDFF4\\u200D\\u2620|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])\\u200D[\\u2640\\u2642]|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u2600-\\u2604\\u260E\\u2611\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26B0\\u26B1\\u26C8\\u26CF\\u26D1\\u26D3\\u26E9\\u26F0\\u26F1\\u26F4\\u26F7\\u26F8\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDE02\\uDE37\\uDF21\\uDF24-\\uDF2C\\uDF36\\uDF7D\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E\\uDF9F\\uDFCD\\uDFCE\\uDFD4-\\uDFDF\\uDFF5\\uDFF7]|\\uD83D[\\uDC3F\\uDCFD\\uDD49\\uDD4A\\uDD6F\\uDD70\\uDD73\\uDD76-\\uDD79\\uDD87\\uDD8A-\\uDD8D\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA\\uDECB\\uDECD-\\uDECF\\uDEE0-\\uDEE5\\uDEE9\\uDEF0\\uDEF3])\\uFE0F|\\uD83C\\uDFF3\\uFE0F\\u200D\\uD83C\\uDF08|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDE35\\u200D\\uD83D\\uDCAB|\\uD83D\\uDE2E\\u200D\\uD83D\\uDCA8|\\uD83D\\uDC15\\u200D\\uD83E\\uDDBA|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC|\\uD83C\\uDFFB)?|\\uD83D\\uDC69(?:\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC|\\uD83C\\uDFFB)?|\\uD83C\\uDDFD\\uD83C\\uDDF0|\\uD83C\\uDDF6\\uD83C\\uDDE6|\\uD83C\\uDDF4\\uD83C\\uDDF2|\\uD83D\\uDC08\\u200D\\u2B1B|\\u2764\\uFE0F\\u200D(?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C4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD]|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF]|[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF84\\uDF86-\\uDF93\\uDFA0-\\uDFC1\\uDFC5\\uDFC6\\uDFC8\\uDFC9\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC07\\uDC09-\\uDC14\\uDC16-\\uDC3A\\uDC3C-\\uDC3E\\uDC40\\uDC44\\uDC45\\uDC51-\\uDC65\\uDC6A\\uDC79-\\uDC7B\\uDC7D-\\uDC80\\uDC84\\uDC88-\\uDC8E\\uDC90\\uDC92-\\uDCA9\\uDCAB-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDDA4\\uDDFB-\\uDE2D\\uDE2F-\\uDE34\\uDE37-\\uDE44\\uDE48-\\uDE4A\\uDE80-\\uDEA2\\uDEA4-\\uDEB3\\uDEB7-\\uDEBF\\uDEC1-\\uDEC5\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0D\\uDD0E\\uDD10-\\uDD17\\uDD1D\\uDD20-\\uDD25\\uDD27-\\uDD2F\\uDD3A\\uDD3F-\\uDD45\\uDD47-\\uDD76\\uDD78\\uDD7A-\\uDDB4\\uDDB7\\uDDBA\\uDDBC-\\uDDCB\\uDDD0\\uDDE0-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6]|(?:[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26A7\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3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\\uDE47\\uDE4B-\\uDE4F\\uDEA3\\uDEB4-\\uDEB6\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDD77\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g;\n};\n","import stripAnsi from 'strip-ansi';\nimport eastAsianWidth from 'eastasianwidth';\nimport emojiRegex from 'emoji-regex';\n\nexport default function stringWidth(string, options = {}) {\n\tif (typeof string !== 'string' || string.length === 0) {\n\t\treturn 0;\n\t}\n\n\toptions = {\n\t\tambiguousIsNarrow: true,\n\t\t...options\n\t};\n\n\tstring = stripAnsi(string);\n\n\tif (string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tstring = string.replace(emojiRegex(), ' ');\n\n\tconst ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;\n\tlet width = 0;\n\n\tfor (const character of string) {\n\t\tconst codePoint = character.codePointAt(0);\n\n\t\t// Ignore control characters\n\t\tif (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore combining characters\n\t\tif (codePoint >= 0x300 && codePoint <= 0x36F) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst code = eastAsianWidth.eastAsianWidth(character);\n\t\tswitch (code) {\n\t\t\tcase 'F':\n\t\t\tcase 'W':\n\t\t\t\twidth += 2;\n\t\t\t\tbreak;\n\t\t\tcase 'A':\n\t\t\t\twidth += ambiguousCharacterWidth;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\twidth += 1;\n\t\t}\n\t}\n\n\treturn width;\n}\n","const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue: (red, green, blue) => {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue: hex => {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue: code => {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import stringWidth from 'string-width';\nimport stripAnsi from 'strip-ansi';\nimport ansiStyles from 'ansi-styles';\n\nconst ESCAPES = new Set([\n\t'\\u001B',\n\t'\\u009B',\n]);\n\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = '\\u0007';\nconst ANSI_CSI = '[';\nconst ANSI_OSC = ']';\nconst ANSI_SGR_TERMINATOR = 'm';\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\n\nconst wrapAnsiCode = code => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = uri => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;\n\n// Calculate the length of words split on ' ', ignoring\n// the extra characters added by ansi escape codes\nconst wordLengths = string => string.split(' ').map(character => stringWidth(character));\n\n// Wrap a long word across multiple rows\n// Ansi escape codes do not count towards length\nconst wrapWord = (rows, word, columns) => {\n\tconst characters = [...word];\n\n\tlet isInsideEscape = false;\n\tlet isInsideLinkEscape = false;\n\tlet visible = stringWidth(stripAnsi(rows[rows.length - 1]));\n\n\tfor (const [index, character] of characters.entries()) {\n\t\tconst characterLength = stringWidth(character);\n\n\t\tif (visible + characterLength <= columns) {\n\t\t\trows[rows.length - 1] += character;\n\t\t} else {\n\t\t\trows.push(character);\n\t\t\tvisible = 0;\n\t\t}\n\n\t\tif (ESCAPES.has(character)) {\n\t\t\tisInsideEscape = true;\n\t\t\tisInsideLinkEscape = characters.slice(index + 1).join('').startsWith(ANSI_ESCAPE_LINK);\n\t\t}\n\n\t\tif (isInsideEscape) {\n\t\t\tif (isInsideLinkEscape) {\n\t\t\t\tif (character === ANSI_ESCAPE_BELL) {\n\t\t\t\t\tisInsideEscape = false;\n\t\t\t\t\tisInsideLinkEscape = false;\n\t\t\t\t}\n\t\t\t} else if (character === ANSI_SGR_TERMINATOR) {\n\t\t\t\tisInsideEscape = false;\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tvisible += characterLength;\n\n\t\tif (visible === columns && index < characters.length - 1) {\n\t\t\trows.push('');\n\t\t\tvisible = 0;\n\t\t}\n\t}\n\n\t// It's possible that the last row we copy over is only\n\t// ansi escape characters, handle this edge-case\n\tif (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {\n\t\trows[rows.length - 2] += rows.pop();\n\t}\n};\n\n// Trims spaces from a string ignoring invisible sequences\nconst stringVisibleTrimSpacesRight = string => {\n\tconst words = string.split(' ');\n\tlet last = words.length;\n\n\twhile (last > 0) {\n\t\tif (stringWidth(words[last - 1]) > 0) {\n\t\t\tbreak;\n\t\t}\n\n\t\tlast--;\n\t}\n\n\tif (last === words.length) {\n\t\treturn string;\n\t}\n\n\treturn words.slice(0, last).join(' ') + words.slice(last).join('');\n};\n\n// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode\n//\n// 'hard' will never allow a string to take up more than columns characters\n//\n// 'soft' allows long words to expand past the column length\nconst exec = (string, columns, options = {}) => {\n\tif (options.trim !== false && string.trim() === '') {\n\t\treturn '';\n\t}\n\n\tlet returnValue = '';\n\tlet escapeCode;\n\tlet escapeUrl;\n\n\tconst lengths = wordLengths(string);\n\tlet rows = [''];\n\n\tfor (const [index, word] of string.split(' ').entries()) {\n\t\tif (options.trim !== false) {\n\t\t\trows[rows.length - 1] = rows[rows.length - 1].trimStart();\n\t\t}\n\n\t\tlet rowLength = stringWidth(rows[rows.length - 1]);\n\n\t\tif (index !== 0) {\n\t\t\tif (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {\n\t\t\t\t// If we start with a new word but the current row length equals the length of the columns, add a new row\n\t\t\t\trows.push('');\n\t\t\t\trowLength = 0;\n\t\t\t}\n\n\t\t\tif (rowLength > 0 || options.trim === false) {\n\t\t\t\trows[rows.length - 1] += ' ';\n\t\t\t\trowLength++;\n\t\t\t}\n\t\t}\n\n\t\t// In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'\n\t\tif (options.hard && lengths[index] > columns) {\n\t\t\tconst remainingColumns = (columns - rowLength);\n\t\t\tconst breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);\n\t\t\tconst breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);\n\t\t\tif (breaksStartingNextLine < breaksStartingThisLine) {\n\t\t\t\trows.push('');\n\t\t\t}\n\n\t\t\twrapWord(rows, word, columns);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {\n\t\t\tif (options.wordWrap === false && rowLength < columns) {\n\t\t\t\twrapWord(rows, word, columns);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trows.push('');\n\t\t}\n\n\t\tif (rowLength + lengths[index] > columns && options.wordWrap === false) {\n\t\t\twrapWord(rows, word, columns);\n\t\t\tcontinue;\n\t\t}\n\n\t\trows[rows.length - 1] += word;\n\t}\n\n\tif (options.trim !== false) {\n\t\trows = rows.map(row => stringVisibleTrimSpacesRight(row));\n\t}\n\n\tconst pre = [...rows.join('\\n')];\n\n\tfor (const [index, character] of pre.entries()) {\n\t\treturnValue += character;\n\n\t\tif (ESCAPES.has(character)) {\n\t\t\tconst {groups} = new RegExp(`(?:\\\\${ANSI_CSI}(?<code>\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join('')) || {groups: {}};\n\t\t\tif (groups.code !== undefined) {\n\t\t\t\tconst code = Number.parseFloat(groups.code);\n\t\t\t\tescapeCode = code === END_CODE ? undefined : code;\n\t\t\t} else if (groups.uri !== undefined) {\n\t\t\t\tescapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n\t\t\t}\n\t\t}\n\n\t\tconst code = ansiStyles.codes.get(Number(escapeCode));\n\n\t\tif (pre[index + 1] === '\\n') {\n\t\t\tif (escapeUrl) {\n\t\t\t\treturnValue += wrapAnsiHyperlink('');\n\t\t\t}\n\n\t\t\tif (escapeCode && code) {\n\t\t\t\treturnValue += wrapAnsiCode(code);\n\t\t\t}\n\t\t} else if (character === '\\n') {\n\t\t\tif (escapeCode && code) {\n\t\t\t\treturnValue += wrapAnsiCode(escapeCode);\n\t\t\t}\n\n\t\t\tif (escapeUrl) {\n\t\t\t\treturnValue += wrapAnsiHyperlink(escapeUrl);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn returnValue;\n};\n\n// For each newline, invoke the method separately\nexport default function wrapAnsi(string, columns, options) {\n\treturn String(string)\n\t\t.normalize()\n\t\t.replace(/\\r\\n/g, '\\n')\n\t\t.split('\\n')\n\t\t.map(line => exec(line, columns, options))\n\t\t.join('\\n');\n}\n","const actions = ['up', 'down', 'left', 'right', 'space', 'enter', 'cancel'] as const;\nexport type Action = (typeof actions)[number];\n\n/** Global settings for Clack programs, stored in memory */\ninterface InternalClackSettings {\n\tactions: Set<Action>;\n\taliases: Map<string, Action>;\n}\n\nexport const settings: InternalClackSettings = {\n\tactions: new Set(actions),\n\taliases: new Map<string, Action>([\n\t\t// vim support\n\t\t['k', 'up'],\n\t\t['j', 'down'],\n\t\t['h', 'left'],\n\t\t['l', 'right'],\n\t\t['\\x03', 'cancel'],\n\t\t// opinionated defaults!\n\t\t['escape', 'cancel'],\n\t]),\n};\n\nexport interface ClackSettings {\n\t/**\n\t * Set custom global aliases for the default actions.\n\t * This will not overwrite existing aliases, it will only add new ones!\n\t *\n\t * @param aliases - An object that maps aliases to actions\n\t * @default { k: 'up', j: 'down', h: 'left', l: 'right', '\\x03': 'cancel', 'escape': 'cancel' }\n\t */\n\taliases: Record<string, Action>;\n}\n\nexport function updateSettings(updates: ClackSettings) {\n\tfor (const _key in updates) {\n\t\tconst key = _key as keyof ClackSettings;\n\t\tif (!Object.hasOwn(updates, key)) continue;\n\t\tconst value = updates[key];\n\n\t\tswitch (key) {\n\t\t\tcase 'aliases': {\n\t\t\t\tfor (const alias in value) {\n\t\t\t\t\tif (!Object.hasOwn(value, alias)) continue;\n\t\t\t\t\tif (!settings.aliases.has(alias)) {\n\t\t\t\t\t\tsettings.aliases.set(alias, value[alias]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Check if a key is an alias for a default action\n * @param key - The raw key which might match to an action\n * @param action - The action to match\n * @returns boolean\n */\nexport function isActionKey(key: string | Array<string | undefined>, action: Action) {\n\tif (typeof key === 'string') {\n\t\treturn settings.aliases.get(key) === action;\n\t}\n\n\tfor (const value of key) {\n\t\tif (value === undefined) continue;\n\t\tif (isActionKey(value, action)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n","export function diffLines(a: string, b: string) {\n\tif (a === b) return;\n\n\tconst aLines = a.split('\\n');\n\tconst bLines = b.split('\\n');\n\tconst diff: number[] = [];\n\n\tfor (let i = 0; i < Math.max(aLines.length, bLines.length); i++) {\n\t\tif (aLines[i] !== bLines[i]) diff.push(i);\n\t}\n\n\treturn diff;\n}\n","import { stdin, stdout } from 'node:process';\nimport type { Key } from 'node:readline';\nimport * as readline from 'node:readline';\nimport type { Readable } from 'node:stream';\nimport { cursor } from 'sisteransi';\nimport { isActionKey } from './settings';\n\nexport * from './string';\nexport * from './settings';\n\nconst isWindows = globalThis.process.platform.startsWith('win');\n\nexport const CANCEL_SYMBOL = Symbol('clack:cancel');\n\nexport function isCancel(value: unknown): value is symbol {\n\treturn value === CANCEL_SYMBOL;\n}\n\nexport function setRawMode(input: Readable, value: boolean) {\n\tconst i = input as typeof stdin;\n\n\tif (i.isTTY) i.setRawMode(value);\n}\n\nexport function block({\n\tinput = stdin,\n\toutput = stdout,\n\toverwrite = true,\n\thideCursor = true,\n} = {}) {\n\tconst rl = readline.createInterface({\n\t\tinput,\n\t\toutput,\n\t\tprompt: '',\n\t\ttabSize: 1,\n\t});\n\treadline.emitKeypressEvents(input, rl);\n\tif (input.isTTY) input.setRawMode(true);\n\n\tconst clear = (data: Buffer, { name, sequence }: Key) => {\n\t\tconst str = String(data);\n\t\tif (isActionKey([str, name, sequence], 'cancel')) {\n\t\t\tif (hideCursor) output.write(cursor.show);\n\t\t\tprocess.exit(0);\n\t\t\treturn;\n\t\t}\n\t\tif (!overwrite) return;\n\t\tconst dx = name === 'return' ? 0 : -1;\n\t\tconst dy = name === 'return' ? -1 : 0;\n\n\t\treadline.moveCursor(output, dx, dy, () => {\n\t\t\treadline.clearLine(output, 1, () => {\n\t\t\t\tinput.once('keypress', clear);\n\t\t\t});\n\t\t});\n\t};\n\tif (hideCursor) output.write(cursor.hide);\n\tinput.once('keypress', clear);\n\n\treturn () => {\n\t\tinput.off('keypress', clear);\n\t\tif (hideCursor) output.write(cursor.show);\n\n\t\t// Prevent Windows specific issues: https://github.com/natemoo-re/clack/issues/176\n\t\tif (input.isTTY && !isWindows) input.setRawMode(false);\n\n\t\t// @ts-expect-error fix for https://github.com/nodejs/node/issues/31762#issuecomment-1441223907\n\t\trl.terminal = false;\n\t\trl.close();\n\t};\n}\n","import { stdin, stdout } from 'node:process';\nimport readline, { type Key, type ReadLine } from 'node:readline';\nimport type { Readable, Writable } from 'node:stream';\nimport { WriteStream } from 'node:tty';\nimport { cursor, erase } from 'sisteransi';\nimport wrap from 'wrap-ansi';\n\nimport { CANCEL_SYMBOL, diffLines, isActionKey, setRawMode, settings } from '../utils';\n\nimport type { ClackEvents, ClackState } from '../types';\nimport type { Action } from '../utils';\n\nexport interface PromptOptions<Self extends Prompt> {\n\trender(this: Omit<Self, 'prompt'>): string | undefined;\n\tplaceholder?: string;\n\tinitialValue?: any;\n\tvalidate?: ((value: any) => string | Error | undefined) | undefined;\n\tinput?: Readable;\n\toutput?: Writable;\n\tdebug?: boolean;\n\tsignal?: AbortSignal;\n}\n\nexport default class Prompt {\n\tprotected input: Readable;\n\tprotected output: Writable;\n\tprivate _abortSignal?: AbortSignal;\n\n\tprivate rl: ReadLine | undefined;\n\tprivate opts: Omit<PromptOptions<Prompt>, 'render' | 'input' | 'output'>;\n\tprivate _render: (context: Omit<Prompt, 'prompt'>) => string | undefined;\n\tprivate _track = false;\n\tprivate _prevFrame = '';\n\tprivate _subscribers = new Map<string, { cb: (...args: any) => any; once?: boolean }[]>();\n\tprotected _cursor = 0;\n\n\tpublic state: ClackState = 'initial';\n\tpublic error = '';\n\tpublic value: any;\n\n\tconstructor(options: PromptOptions<Prompt>, trackValue = true) {\n\t\tconst { input = stdin, output = stdout, render, signal, ...opts } = options;\n\n\t\tthis.opts = opts;\n\t\tthis.onKeypress = this.onKeypress.bind(this);\n\t\tthis.close = this.close.bind(this);\n\t\tthis.render = this.render.bind(this);\n\t\tthis._render = render.bind(this);\n\t\tthis._track = trackValue;\n\t\tthis._abortSignal = signal;\n\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t}\n\n\t/**\n\t * Unsubscribe all listeners\n\t */\n\tprotected unsubscribe() {\n\t\tthis._subscribers.clear();\n\t}\n\n\t/**\n\t * Set a subscriber with opts\n\t * @param event - The event name\n\t */\n\tprivate setSubscriber<T extends keyof ClackEvents>(\n\t\tevent: T,\n\t\topts: { cb: ClackEvents[T]; once?: boolean }\n\t) {\n\t\tconst params = this._subscribers.get(event) ?? [];\n\t\tparams.push(opts);\n\t\tthis._subscribers.set(event, params);\n\t}\n\n\t/**\n\t * Subscribe to an event\n\t * @param event - The event name\n\t * @param cb - The callback\n\t */\n\tpublic on<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]) {\n\t\tthis.setSubscriber(event, { cb });\n\t}\n\n\t/**\n\t * Subscribe to an event once\n\t * @param event - The event name\n\t * @param cb - The callback\n\t */\n\tpublic once<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]) {\n\t\tthis.setSubscriber(event, { cb, once: true });\n\t}\n\n\t/**\n\t * Emit an event with data\n\t * @param event - The event name\n\t * @param data - The data to pass to the callback\n\t */\n\tpublic emit<T extends keyof ClackEvents>(event: T, ...data: Parameters<ClackEvents[T]>) {\n\t\tconst cbs = this._subscribers.get(event) ?? [];\n\t\tconst cleanup: (() => void)[] = [];\n\n\t\tfor (const subscriber of cbs) {\n\t\t\tsubscriber.cb(...data);\n\n\t\t\tif (subscriber.once) {\n\t\t\t\tcleanup.push(() => cbs.splice(cbs.indexOf(subscriber), 1));\n\t\t\t}\n\t\t}\n\n\t\tfor (const cb of cleanup) {\n\t\t\tcb();\n\t\t}\n\t}\n\n\tpublic prompt() {\n\t\treturn new Promise<string | symbol>((resolve, reject) => {\n\t\t\tif (this._abortSignal) {\n\t\t\t\tif (this._abortSignal.aborted) {\n\t\t\t\t\tthis.state = 'cancel';\n\n\t\t\t\t\tthis.close();\n\t\t\t\t\treturn resolve(CANCEL_SYMBOL);\n\t\t\t\t}\n\n\t\t\t\tthis._abortSignal.addEventListener(\n\t\t\t\t\t'abort',\n\t\t\t\t\t() => {\n\t\t\t\t\t\tthis.state = 'cancel';\n\t\t\t\t\t\tthis.close();\n\t\t\t\t\t},\n\t\t\t\t\t{ once: true }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst sink = new WriteStream(0);\n\t\t\tsink._write = (chunk, encoding, done) => {\n\t\t\t\tif (this._track) {\n\t\t\t\t\tthis.value = this.rl?.line.replace(/\\t/g, '');\n\t\t\t\t\tthis._cursor = this.rl?.cursor ?? 0;\n\t\t\t\t\tthis.emit('value', this.value);\n\t\t\t\t}\n\t\t\t\tdone();\n\t\t\t};\n\t\t\tthis.input.pipe(sink);\n\n\t\t\tthis.rl = readline.createInterface({\n\t\t\t\tinput: this.input,\n\t\t\t\toutput: sink,\n\t\t\t\ttabSize: 2,\n\t\t\t\tprompt: '',\n\t\t\t\tescapeCodeTimeout: 50,\n\t\t\t});\n\t\t\treadline.emitKeypressEvents(this.input, this.rl);\n\t\t\tthis.rl.prompt();\n\t\t\tif (this.opts.initialValue !== undefined && this._track) {\n\t\t\t\tthis.rl.write(this.opts.initialValue);\n\t\t\t}\n\n\t\t\tthis.input.on('keypress', this.onKeypress);\n\t\t\tsetRawMode(this.input, true);\n\t\t\tthis.output.on('resize', this.render);\n\n\t\t\tthis.render();\n\n\t\t\tthis.once('submit', () => {\n\t\t\t\tthis.output.write(cursor.show);\n\t\t\t\tthis.output.off('resize', this.render);\n\t\t\t\tsetRawMode(this.input, false);\n\t\t\t\tresolve(this.value);\n\t\t\t});\n\t\t\tthis.once('cancel', () => {\n\t\t\t\tthis.output.write(cursor.show);\n\t\t\t\tthis.output.off('resize', this.render);\n\t\t\t\tsetRawMode(this.input, false);\n\t\t\t\tresolve(CANCEL_SYMBOL);\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate onKeypress(char: string, key?: Key) {\n\t\tif (this.state === 'error') {\n\t\t\tthis.state = 'active';\n\t\t}\n\t\tif (key?.name) {\n\t\t\tif (!this._track && settings.aliases.has(key.name)) {\n\t\t\t\tthis.emit('cursor', settings.aliases.get(key.name));\n\t\t\t}\n\t\t\tif (settings.actions.has(key.name as Action)) {\n\t\t\t\tthis.emit('cursor', key.name as Action);\n\t\t\t}\n\t\t}\n\t\tif (char && (char.toLowerCase() === 'y' || char.toLowerCase() === 'n')) {\n\t\t\tthis.emit('confirm', char.toLowerCase() === 'y');\n\t\t}\n\t\tif (char === '\\t' && this.opts.placeholder) {\n\t\t\tif (!this.value) {\n\t\t\t\tthis.rl?.write(this.opts.placeholder);\n\t\t\t\tthis.emit('value', this.opts.placeholder);\n\t\t\t}\n\t\t}\n\t\tif (char) {\n\t\t\tthis.emit('key', char.toLowerCase());\n\t\t}\n\n\t\tif (key?.name === 'return') {\n\t\t\tif (this.opts.validate) {\n\t\t\t\tconst problem = this.opts.validate(this.value);\n\t\t\t\tif (problem) {\n\t\t\t\t\tthis.error = problem instanceof Error ? problem.message : problem;\n\t\t\t\t\tthis.state = 'error';\n\t\t\t\t\tthis.rl?.write(this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.state !== 'error') {\n\t\t\t\tthis.state = 'submit';\n\t\t\t}\n\t\t}\n\n\t\tif (isActionKey([char, key?.name, key?.sequence], 'cancel')) {\n\t\t\tthis.state = 'cancel';\n\t\t}\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\tthis.emit('finalize');\n\t\t}\n\t\tthis.render();\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\tthis.close();\n\t\t}\n\t}\n\n\tprotected close() {\n\t\tthis.input.unpipe();\n\t\tthis.input.removeListener('keypress', this.onKeypress);\n\t\tthis.output.write('\\n');\n\t\tsetRawMode(this.input, false);\n\t\tthis.rl?.close();\n\t\tthis.rl = undefined;\n\t\tthis.emit(`${this.state}`, this.value);\n\t\tthis.unsubscribe();\n\t}\n\n\tprivate restoreCursor() {\n\t\tconst lines =\n\t\t\twrap(this._prevFrame, process.stdout.columns, { hard: true }).split('\\n').length - 1;\n\t\tthis.output.write(cursor.move(-999, lines * -1));\n\t}\n\n\tprivate render() {\n\t\tconst frame = wrap(this._render(this) ?? '', process.stdout.columns, { hard: true });\n\t\tif (frame === this._prevFrame) return;\n\n\t\tif (this.state === 'initial') {\n\t\t\tthis.output.write(cursor.hide);\n\t\t} else {\n\t\t\tconst diff = diffLines(this._prevFrame, frame);\n\t\t\tthis.restoreCursor();\n\t\t\t// If a single line has changed, only update that line\n\t\t\tif (diff && diff?.length === 1) {\n\t\t\t\tconst diffLine = diff[0];\n\t\t\t\tthis.output.write(cursor.move(0, diffLine));\n\t\t\t\tthis.output.write(erase.lines(1));\n\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\tthis.output.write(lines[diffLine]);\n\t\t\t\tthis._prevFrame = frame;\n\t\t\t\tthis.output.write(cursor.move(0, lines.length - diffLine - 1));\n\t\t\t\treturn;\n\t\t\t\t// If many lines have changed, rerender everything past the first line\n\t\t\t}\n\t\t\tif (diff && diff?.length > 1) {\n\t\t\t\tconst diffLine = diff[0];\n\t\t\t\tthis.output.write(cursor.move(0, diffLine));\n\t\t\t\tthis.output.write(erase.down());\n\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\tconst newLines = lines.slice(diffLine);\n\t\t\t\tthis.output.write(newLines.join('\\n'));\n\t\t\t\tthis._prevFrame = frame;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.output.write(erase.down());\n\t\t}\n\n\t\tthis.output.write(frame);\n\t\tif (this.state === 'initial') {\n\t\t\tthis.state = 'active';\n\t\t}\n\t\tthis._prevFrame = frame;\n\t}\n}\n","import { cursor } from 'sisteransi';\nimport Prompt, { type PromptOptions } from './prompt';\n\ninterface ConfirmOptions extends PromptOptions<ConfirmPrompt> {\n\tactive: string;\n\tinactive: string;\n\tinitialValue?: boolean;\n}\nexport default class ConfirmPrompt extends Prompt {\n\tget cursor() {\n\t\treturn this.value ? 0 : 1;\n\t}\n\n\tprivate get _value() {\n\t\treturn this.cursor === 0;\n\t}\n\n\tconstructor(opts: ConfirmOptions) {\n\t\tsuper(opts, false);\n\t\tthis.value = !!opts.initialValue;\n\n\t\tthis.on('value', () => {\n\t\t\tthis.value = this._value;\n\t\t});\n\n\t\tthis.on('confirm', (confirm) => {\n\t\t\tthis.output.write(cursor.move(0, -1));\n\t\t\tthis.value = confirm;\n\t\t\tthis.state = 'submit';\n\t\t\tthis.close();\n\t\t});\n\n\t\tthis.on('cursor', () => {\n\t\t\tthis.value = !this.value;\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt';\n\ninterface GroupMultiSelectOptions<T extends { value: any }>\n\textends PromptOptions<GroupMultiSelectPrompt<T>> {\n\toptions: Record<string, T[]>;\n\tinitialValues?: T['value'][];\n\trequired?: boolean;\n\tcursorAt?: T['value'];\n}\nexport default class GroupMultiSelectPrompt<T extends { value: any }> extends Prompt {\n\toptions: (T & { group: string | boolean })[];\n\tcursor = 0;\n\n\tgetGroupItems(group: string): T[] {\n\t\treturn this.options.filter((o) => o.group === group);\n\t}\n\n\tisGroupSelected(group: string) {\n\t\tconst items = this.getGroupItems(group);\n\t\treturn items.every((i) => this.value.includes(i.value));\n\t}\n\n\tprivate toggleValue() {\n\t\tconst item = this.options[this.cursor];\n\t\tif (item.group === true) {\n\t\t\tconst group = item.value;\n\t\t\tconst groupedItems = this.getGroupItems(group);\n\t\t\tif (this.isGroupSelected(group)) {\n\t\t\t\tthis.value = this.value.filter(\n\t\t\t\t\t(v: string) => groupedItems.findIndex((i) => i.value === v) === -1\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.value = [...this.value, ...groupedItems.map((i) => i.value)];\n\t\t\t}\n\t\t\tthis.value = Array.from(new Set(this.value));\n\t\t} else {\n\t\t\tconst selected = this.value.includes(item.value);\n\t\t\tthis.value = selected\n\t\t\t\t? this.value.filter((v: T['value']) => v !== item.value)\n\t\t\t\t: [...this.value, item.value];\n\t\t}\n\t}\n\n\tconstructor(opts: GroupMultiSelectOptions<T>) {\n\t\tsuper(opts, false);\n\t\tconst { options } = opts;\n\t\tthis.options = Object.entries(options).flatMap(([key, option]) => [\n\t\t\t{ value: key, group: true, label: key },\n\t\t\t...option.map((opt) => ({ ...opt, group: key })),\n\t\t]) as any;\n\t\tthis.value = [...(opts.initialValues ?? [])];\n\t\tthis.cursor = Math.max(\n\t\t\tthis.options.findIndex(({ value }) => value === opts.cursorAt),\n\t\t\t0\n\t\t);\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'space':\n\t\t\t\t\tthis.toggleValue();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt';\n\ninterface MultiSelectOptions<T extends { value: any }> extends PromptOptions<MultiSelectPrompt<T>> {\n\toptions: T[];\n\tinitialValues?: T['value'][];\n\trequired?: boolean;\n\tcursorAt?: T['value'];\n}\nexport default class MultiSelectPrompt<T extends { value: any }> extends Prompt {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _value() {\n\t\treturn this.options[this.cursor].value;\n\t}\n\n\tprivate toggleAll() {\n\t\tconst allSelected = this.value.length === this.options.length;\n\t\tthis.value = allSelected ? [] : this.options.map((v) => v.value);\n\t}\n\n\tprivate toggleValue() {\n\t\tconst selected = this.value.includes(this._value);\n\t\tthis.value = selected\n\t\t\t? this.value.filter((value: T['value']) => value !== this._value)\n\t\t\t: [...this.value, this._value];\n\t}\n\n\tconstructor(opts: MultiSelectOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tthis.value = [...(opts.initialValues ?? [])];\n\t\tthis.cursor = Math.max(\n\t\t\tthis.options.findIndex(({ value }) => value === opts.cursorAt),\n\t\t\t0\n\t\t);\n\t\tthis.on('key', (char) => {\n\t\t\tif (char === 'a') {\n\t\t\t\tthis.toggleAll();\n\t\t\t}\n\t\t});\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'space':\n\t\t\t\t\tthis.toggleValue();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n}\n","import color from 'picocolors';\nimport Prompt, { type PromptOptions } from './prompt';\n\ninterface PasswordOptions extends PromptOptions<PasswordPrompt> {\n\tmask?: string;\n}\nexport default class PasswordPrompt extends Prompt {\n\tvalueWithCursor = '';\n\tprivate _mask = '•';\n\tget cursor() {\n\t\treturn this._cursor;\n\t}\n\tget masked() {\n\t\treturn this.value.replaceAll(/./g, this._mask);\n\t}\n\tconstructor({ mask, ...opts }: PasswordOptions) {\n\t\tsuper(opts);\n\t\tthis._mask = mask ?? '•';\n\n\t\tthis.on('finalize', () => {\n\t\t\tthis.valueWithCursor = this.masked;\n\t\t});\n\t\tthis.on('value', () => {\n\t\t\tif (this.cursor >= this.value.length) {\n\t\t\t\tthis.valueWithCursor = `${this.masked}${color.inverse(color.hidden('_'))}`;\n\t\t\t} else {\n\t\t\t\tconst s1 = this.masked.slice(0, this.cursor);\n\t\t\t\tconst s2 = this.masked.slice(this.cursor);\n\t\t\t\tthis.valueWithCursor = `${s1}${color.inverse(s2[0])}${s2.slice(1)}`;\n\t\t\t}\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt';\n\ninterface SelectOptions<T extends { value: any }> extends PromptOptions<SelectPrompt<T>> {\n\toptions: T[];\n\tinitialValue?: T['value'];\n}\nexport default class SelectPrompt<T extends { value: any }> extends Prompt {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _value() {\n\t\treturn this.options[this.cursor];\n\t}\n\n\tprivate changeValue() {\n\t\tthis.value = this._value.value;\n\t}\n\n\tconstructor(opts: SelectOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tthis.cursor = this.options.findIndex(({ value }) => value === opts.initialValue);\n\t\tif (this.cursor === -1) this.cursor = 0;\n\t\tthis.changeValue();\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.changeValue();\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt';\n\ninterface SelectKeyOptions<T extends { value: any }> extends PromptOptions<SelectKeyPrompt<T>> {\n\toptions: T[];\n}\nexport default class SelectKeyPrompt<T extends { value: any }> extends Prompt {\n\toptions: T[];\n\tcursor = 0;\n\n\tconstructor(opts: SelectKeyOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tconst keys = this.options.map(({ value: [initial] }) => initial?.toLowerCase());\n\t\tthis.cursor = Math.max(keys.indexOf(opts.initialValue), 0);\n\n\t\tthis.on('key', (key) => {\n\t\t\tif (!keys.includes(key)) return;\n\t\t\tconst value = this.options.find(({ value: [initial] }) => initial?.toLowerCase() === key);\n\t\t\tif (value) {\n\t\t\t\tthis.value = value.value;\n\t\t\t\tthis.state = 'submit';\n\t\t\t\tthis.emit('submit');\n\t\t\t}\n\t\t});\n\t}\n}\n","import color from 'picocolors';\nimport Prompt, { type PromptOptions } from './prompt';\n\nexport interface TextOptions extends PromptOptions<TextPrompt> {\n\tplaceholder?: string;\n\tdefaultValue?: string;\n}\n\nexport default class TextPrompt extends Prompt {\n\tget valueWithCursor() {\n\t\tif (this.state === 'submit') {\n\t\t\treturn this.value;\n\t\t}\n\t\tif (this.cursor >= this.value.length) {\n\t\t\treturn `${this.value}█`;\n\t\t}\n\t\tconst s1 = this.value.slice(0, this.cursor);\n\t\tconst [s2, ...s3] = this.value.slice(this.cursor);\n\t\treturn `${s1}${color.inverse(s2)}${s3.join('')}`;\n\t}\n\tget cursor() {\n\t\treturn this._cursor;\n\t}\n\tconstructor(opts: TextOptions) {\n\t\tsuper(opts);\n\n\t\tthis.on('finalize', () => {\n\t\t\tif (!this.value) {\n\t\t\t\tthis.value = opts.defaultValue;\n\t\t\t}\n\t\t});\n\t}\n}\n","import process from 'node:process';\n\nexport default function isUnicodeSupported() {\n\tif (process.platform !== 'win32') {\n\t\treturn process.env.TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(process.env.CI)\n\t\t|| Boolean(process.env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(process.env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| process.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| process.env.TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| process.env.TERM_PROGRAM === 'vscode'\n\t\t|| process.env.TERM === 'xterm-256color'\n\t\t|| process.env.TERM === 'alacritty'\n\t\t|| process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n","import { stripVTControlCharacters as strip } from 'node:util';\nimport {\n\tConfirmPrompt,\n\tGroupMultiSelectPrompt,\n\tMultiSelectPrompt,\n\tPasswordPrompt,\n\tSelectKeyPrompt,\n\tSelectPrompt,\n\ttype State,\n\tTextPrompt,\n\tblock,\n\tisCancel,\n} from '@clack/core';\nimport isUnicodeSupported from 'is-unicode-supported';\nimport color from 'picocolors';\nimport { cursor, erase } from 'sisteransi';\n\nexport { isCancel } from '@clack/core';\nexport { updateSettings, type ClackSettings } from '@clack/core';\n\nconst unicode = isUnicodeSupported();\nconst s = (c: string, fallback: string) => (unicode ? c : fallback);\nconst S_STEP_ACTIVE = s('◆', '*');\nconst S_STEP_CANCEL = s('■', 'x');\nconst S_STEP_ERROR = s('▲', 'x');\nconst S_STEP_SUBMIT = s('◇', 'o');\n\nconst S_BAR_START = s('┌', 'T');\nconst S_BAR = s('│', '|');\nconst S_BAR_END = s('└', '—');\n\nconst S_RADIO_ACTIVE = s('●', '>');\nconst S_RADIO_INACTIVE = s('○', ' ');\nconst S_CHECKBOX_ACTIVE = s('◻', '[•]');\nconst S_CHECKBOX_SELECTED = s('◼', '[+]');\nconst S_CHECKBOX_INACTIVE = s('◻', '[ ]');\nconst S_PASSWORD_MASK = s('▪', '•');\n\nconst S_BAR_H = s('─', '-');\nconst S_CORNER_TOP_RIGHT = s('╮', '+');\nconst S_CONNECT_LEFT = s('├', '+');\nconst S_CORNER_BOTTOM_RIGHT = s('╯', '+');\n\nconst S_INFO = s('●', '•');\nconst S_SUCCESS = s('◆', '*');\nconst S_WARN = s('▲', '!');\nconst S_ERROR = s('■', 'x');\n\nconst symbol = (state: State) => {\n\tswitch (state) {\n\t\tcase 'initial':\n\t\tcase 'active':\n\t\t\treturn color.cyan(S_STEP_ACTIVE);\n\t\tcase 'cancel':\n\t\t\treturn color.red(S_STEP_CANCEL);\n\t\tcase 'error':\n\t\t\treturn color.yellow(S_STEP_ERROR);\n\t\tcase 'submit':\n\t\t\treturn color.green(S_STEP_SUBMIT);\n\t}\n};\n\ninterface LimitOptionsParams<TOption> {\n\toptions: TOption[];\n\tmaxItems: number | undefined;\n\tcursor: number;\n\tstyle: (option: TOption, active: boolean) => string;\n}\n\nconst limitOptions = <TOption>(params: LimitOptionsParams<TOption>): string[] => {\n\tconst { cursor, options, style } = params;\n\n\tconst paramMaxItems = params.maxItems ?? Number.POSITIVE_INFINITY;\n\tconst outputMaxItems = Math.max(process.stdout.rows - 4, 0);\n\t// We clamp to minimum 5 because anything less doesn't make sense UX wise\n\tconst maxItems = Math.min(outputMaxItems, Math.max(paramMaxItems, 5));\n\tlet slidingWindowLocation = 0;\n\n\tif (cursor >= slidingWindowLocation + maxItems - 3) {\n\t\tslidingWindowLocation = Math.max(Math.min(cursor - maxItems + 3, options.length - maxItems), 0);\n\t} else if (cursor < slidingWindowLocation + 2) {\n\t\tslidingWindowLocation = Math.max(cursor - 2, 0);\n\t}\n\n\tconst shouldRenderTopEllipsis = maxItems < options.length && slidingWindowLocation > 0;\n\tconst shouldRenderBottomEllipsis =\n\t\tmaxItems < options.length && slidingWindowLocation + maxItems < options.length;\n\n\treturn options\n\t\t.slice(slidingWindowLocation, slidingWindowLocation + maxItems)\n\t\t.map((option, i, arr) => {\n\t\t\tconst isTopLimit = i === 0 && shouldRenderTopEllipsis;\n\t\t\tconst isBottomLimit = i === arr.length - 1 && shouldRenderBottomEllipsis;\n\t\t\treturn isTopLimit || isBottomLimit\n\t\t\t\t? color.dim('...')\n\t\t\t\t: style(option, i + slidingWindowLocation === cursor);\n\t\t});\n};\n\nexport interface TextOptions {\n\tmessage: string;\n\tplaceholder?: string;\n\tdefaultValue?: string;\n\tinitialValue?: string;\n\tvalidate?: (value: string) => string | Error | undefined;\n}\nexport const text = (opts: TextOptions) => {\n\treturn new TextPrompt({\n\t\tvalidate: opts.validate,\n\t\tplaceholder: opts.placeholder,\n\t\tdefaultValue: opts.defaultValue,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst placeholder = opts.placeholder\n\t\t\t\t? color.inverse(opts.placeholder[0]) + color.dim(opts.placeholder.slice(1))\n\t\t\t\t: color.inverse(color.hidden('_'));\n\t\t\tconst value = !this.value ? placeholder : this.valueWithCursor;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'error':\n\t\t\t\t\treturn `${title.trim()}\\n${color.yellow(S_BAR)} ${value}\\n${color.yellow(\n\t\t\t\t\t\tS_BAR_END\n\t\t\t\t\t)} ${color.yellow(this.error)}\\n`;\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.dim(this.value || opts.placeholder)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(\n\t\t\t\t\t\tcolor.dim(this.value ?? '')\n\t\t\t\t\t)}${this.value?.trim() ? `\\n${color.gray(S_BAR)}` : ''}`;\n\t\t\t\tdefault:\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${value}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<string | symbol>;\n};\n\nexport interface PasswordOptions {\n\tmessage: string;\n\tmask?: string;\n\tvalidate?: (value: string) => string | Error | undefined;\n}\nexport const password = (opts: PasswordOptions) => {\n\treturn new PasswordPrompt({\n\t\tvalidate: opts.validate,\n\t\tmask: opts.mask ?? S_PASSWORD_MASK,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst value = this.valueWithCursor;\n\t\t\tconst masked = this.masked;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'error':\n\t\t\t\t\treturn `${title.trim()}\\n${color.yellow(S_BAR)} ${masked}\\n${color.yellow(\n\t\t\t\t\t\tS_BAR_END\n\t\t\t\t\t)} ${color.yellow(this.error)}\\n`;\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.dim(masked)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(color.dim(masked ?? ''))}${\n\t\t\t\t\t\tmasked ? `\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\tdefault:\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${value}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<string | symbol>;\n};\n\nexport interface ConfirmOptions {\n\tmessage: string;\n\tactive?: string;\n\tinactive?: string;\n\tinitialValue?: boolean;\n}\nexport const confirm = (opts: ConfirmOptions) => {\n\tconst active = opts.active ?? 'Yes';\n\tconst inactive = opts.inactive ?? 'No';\n\treturn new ConfirmPrompt({\n\t\tactive,\n\t\tinactive,\n\t\tinitialValue: opts.initialValue ?? true,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst value = this.value ? active : inactive;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.dim(value)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(\n\t\t\t\t\t\tcolor.dim(value)\n\t\t\t\t\t)}\\n${color.gray(S_BAR)}`;\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${\n\t\t\t\t\t\tthis.value\n\t\t\t\t\t\t\t? `${color.green(S_RADIO_ACTIVE)} ${active}`\n\t\t\t\t\t\t\t: `${color.dim(S_RADIO_INACTIVE)} ${color.dim(active)}`\n\t\t\t\t\t} ${color.dim('/')} ${\n\t\t\t\t\t\t!this.value\n\t\t\t\t\t\t\t? `${color.green(S_RADIO_ACTIVE)} ${inactive}`\n\t\t\t\t\t\t\t: `${color.dim(S_RADIO_INACTIVE)} ${color.dim(inactive)}`\n\t\t\t\t\t}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<boolean | symbol>;\n};\n\ntype Primitive = Readonly<string | boolean | number>;\n\nexport type Option<Value> = Value extends Primitive\n\t? {\n\t\t\t/**\n\t\t\t * Internal data for this option.\n\t\t\t */\n\t\t\tvalue: Value;\n\t\t\t/**\n\t\t\t * The optional, user-facing text for this option.\n\t\t\t *\n\t\t\t * By default, the `value` is converted to a string.\n\t\t\t */\n\t\t\tlabel?: string;\n\t\t\t/**\n\t\t\t * An optional hint to display to the user when\n\t\t\t * this option might be selected.\n\t\t\t *\n\t\t\t * By default, no `hint` is displayed.\n\t\t\t */\n\t\t\thint?: string;\n\t\t}\n\t: {\n\t\t\t/**\n\t\t\t * Internal data for this option.\n\t\t\t */\n\t\t\tvalue: Value;\n\t\t\t/**\n\t\t\t * Required. The user-facing text for this option.\n\t\t\t */\n\t\t\tlabel: string;\n\t\t\t/**\n\t\t\t * An optional hint to display to the user when\n\t\t\t * this option might be selected.\n\t\t\t *\n\t\t\t * By default, no `hint` is displayed.\n\t\t\t */\n\t\t\thint?: string;\n\t\t};\n\nexport interface SelectOptions<Value> {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValue?: Value;\n\tmaxItems?: number;\n}\n\nexport const select = <Value>(opts: SelectOptions<Value>) => {\n\tconst opt = (option: Option<Value>, state: 'inactive' | 'active' | 'selected' | 'cancelled') => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tswitch (state) {\n\t\t\tcase 'selected':\n\t\t\t\treturn `${color.dim(label)}`;\n\t\t\tcase 'active':\n\t\t\t\treturn `${color.green(S_RADIO_ACTIVE)} ${label} ${\n\t\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t\t}`;\n\t\t\tcase 'cancelled':\n\t\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t\tdefault:\n\t\t\t\treturn `${color.dim(S_RADIO_INACTIVE)} ${color.dim(label)}`;\n\t\t}\n\t};\n\n\treturn new SelectPrompt({\n\t\toptions: opts.options,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(this.options[this.cursor], 'selected')}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(\n\t\t\t\t\t\tthis.options[this.cursor],\n\t\t\t\t\t\t'cancelled'\n\t\t\t\t\t)}\\n${color.gray(S_BAR)}`;\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${limitOptions({\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\toptions: this.options,\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\tstyle: (item, active) => opt(item, active ? 'active' : 'inactive'),\n\t\t\t\t\t}).join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value | symbol>;\n};\n\nexport const selectKey = <Value extends string>(opts: SelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate: 'inactive' | 'active' | 'selected' | 'cancelled' = 'inactive'\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tif (state === 'selected') {\n\t\t\treturn `${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'cancelled') {\n\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t}\n\t\tif (state === 'active') {\n\t\t\treturn `${color.bgCyan(color.gray(` ${option.value} `))} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\treturn `${color.gray(color.bgWhite(color.inverse(` ${option.value} `)))} ${label} ${\n\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t}`;\n\t};\n\n\treturn new SelectKeyPrompt({\n\t\toptions: opts.options,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(\n\t\t\t\t\t\tthis.options.find((opt) => opt.value === this.value) ?? opts.options[0],\n\t\t\t\t\t\t'selected'\n\t\t\t\t\t)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(this.options[0], 'cancelled')}\\n${color.gray(\n\t\t\t\t\t\tS_BAR\n\t\t\t\t\t)}`;\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${this.options\n\t\t\t\t\t\t.map((option, i) => opt(option, i === this.cursor ? 'active' : 'inactive'))\n\t\t\t\t\t\t.join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value | symbol>;\n};\n\nexport interface MultiSelectOptions<Value> {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValues?: Value[];\n\tmaxItems?: number;\n\trequired?: boolean;\n\tcursorAt?: Value;\n}\nexport const multiselect = <Value>(opts: MultiSelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate: 'inactive' | 'active' | 'selected' | 'active-selected' | 'submitted' | 'cancelled'\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tif (state === 'active') {\n\t\t\treturn `${color.cyan(S_CHECKBOX_ACTIVE)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'selected') {\n\t\t\treturn `${color.green(S_CHECKBOX_SELECTED)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'cancelled') {\n\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t}\n\t\tif (state === 'active-selected') {\n\t\t\treturn `${color.green(S_CHECKBOX_SELECTED)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'submitted') {\n\t\t\treturn `${color.dim(label)}`;\n\t\t}\n\t\treturn `${color.dim(S_CHECKBOX_INACTIVE)} ${color.dim(label)}`;\n\t};\n\n\treturn new MultiSelectPrompt({\n\t\toptions: opts.options,\n\t\tinitialValues: opts.initialValues,\n\t\trequired: opts.required ?? true,\n\t\tcursorAt: opts.cursorAt,\n\t\tvalidate(selected: Value[]) {\n\t\t\tif (this.required && selected.length === 0)\n\t\t\t\treturn `Please select at least one option.\\n${color.reset(\n\t\t\t\t\tcolor.dim(\n\t\t\t\t\t\t`Press ${color.gray(color.bgWhite(color.inverse(' space ')))} to select, ${color.gray(\n\t\t\t\t\t\t\tcolor.bgWhite(color.inverse(' enter '))\n\t\t\t\t\t\t)} to submit`\n\t\t\t\t\t)\n\t\t\t\t)}`;\n\t\t},\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tconst styleOption = (option: Option<Value>, active: boolean) => {\n\t\t\t\tconst selected = this.value.includes(option.value);\n\t\t\t\tif (active && selected) {\n\t\t\t\t\treturn opt(option, 'active-selected');\n\t\t\t\t}\n\t\t\t\tif (selected) {\n\t\t\t\t\treturn opt(option, 'selected');\n\t\t\t\t}\n\t\t\t\treturn opt(option, active ? 'active' : 'inactive');\n\t\t\t};\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${\n\t\t\t\t\t\tthis.options\n\t\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t\t.map((option) => opt(option, 'submitted'))\n\t\t\t\t\t\t\t.join(color.dim(', ')) || color.dim('none')\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst label = this.options\n\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t.map((option) => opt(option, 'cancelled'))\n\t\t\t\t\t\t.join(color.dim(', '));\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${\n\t\t\t\t\t\tlabel.trim() ? `${label}\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tcase 'error': {\n\t\t\t\t\tconst footer = this.error\n\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t.map((ln, i) =>\n\t\t\t\t\t\t\ti === 0 ? `${color.yellow(S_BAR_END)} ${color.yellow(ln)}` : ` ${ln}`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\treturn `${title + color.yellow(S_BAR)} ${limitOptions({\n\t\t\t\t\t\toptions: this.options,\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\tstyle: styleOption,\n\t\t\t\t\t}).join(`\\n${color.yellow(S_BAR)} `)}\\n${footer}\\n`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${limitOptions({\n\t\t\t\t\t\toptions: this.options,\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\tstyle: styleOption,\n\t\t\t\t\t}).join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value[] | symbol>;\n};\n\nexport interface GroupMultiSelectOptions<Value> {\n\tmessage: string;\n\toptions: Record<string, Option<Value>[]>;\n\tinitialValues?: Value[];\n\trequired?: boolean;\n\tcursorAt?: Value;\n}\nexport const groupMultiselect = <Value>(opts: GroupMultiSelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate:\n\t\t\t| 'inactive'\n\t\t\t| 'active'\n\t\t\t| 'selected'\n\t\t\t| 'active-selected'\n\t\t\t| 'group-active'\n\t\t\t| 'group-active-selected'\n\t\t\t| 'submitted'\n\t\t\t| 'cancelled',\n\t\toptions: Option<Value>[] = []\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tconst isItem = typeof (option as any).group === 'string';\n\t\tconst next = isItem && (options[options.indexOf(option) + 1] ?? { group: true });\n\t\tconst isLast = isItem && (next as any).group === true;\n\t\tconst prefix = isItem ? `${isLast ? S_BAR_END : S_BAR} ` : '';\n\n\t\tif (state === 'active') {\n\t\t\treturn `${color.dim(prefix)}${color.cyan(S_CHECKBOX_ACTIVE)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'group-active') {\n\t\t\treturn `${prefix}${color.cyan(S_CHECKBOX_ACTIVE)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'group-active-selected') {\n\t\t\treturn `${prefix}${color.green(S_CHECKBOX_SELECTED)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'selected') {\n\t\t\treturn `${color.dim(prefix)}${color.green(S_CHECKBOX_SELECTED)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'cancelled') {\n\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t}\n\t\tif (state === 'active-selected') {\n\t\t\treturn `${color.dim(prefix)}${color.green(S_CHECKBOX_SELECTED)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'submitted') {\n\t\t\treturn `${color.dim(label)}`;\n\t\t}\n\t\treturn `${color.dim(prefix)}${color.dim(S_CHECKBOX_INACTIVE)} ${color.dim(label)}`;\n\t};\n\n\treturn new GroupMultiSelectPrompt({\n\t\toptions: opts.options,\n\t\tinitialValues: opts.initialValues,\n\t\trequired: opts.required ?? true,\n\t\tcursorAt: opts.cursorAt,\n\t\tvalidate(selected: Value[]) {\n\t\t\tif (this.required && selected.length === 0)\n\t\t\t\treturn `Please select at least one option.\\n${color.reset(\n\t\t\t\t\tcolor.dim(\n\t\t\t\t\t\t`Press ${color.gray(color.bgWhite(color.inverse(' space ')))} to select, ${color.gray(\n\t\t\t\t\t\t\tcolor.bgWhite(color.inverse(' enter '))\n\t\t\t\t\t\t)} to submit`\n\t\t\t\t\t)\n\t\t\t\t)}`;\n\t\t},\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${this.options\n\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t.map((option) => opt(option, 'submitted'))\n\t\t\t\t\t\t.join(color.dim(', '))}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst label = this.options\n\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t.map((option) => opt(option, 'cancelled'))\n\t\t\t\t\t\t.join(color.dim(', '));\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${\n\t\t\t\t\t\tlabel.trim() ? `${label}\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tcase 'error': {\n\t\t\t\t\tconst footer = this.error\n\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t.map((ln, i) =>\n\t\t\t\t\t\t\ti === 0 ? `${color.yellow(S_BAR_END)} ${color.yellow(ln)}` : ` ${ln}`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\treturn `${title}${color.yellow(S_BAR)} ${this.options\n\t\t\t\t\t\t.map((option, i, options) => {\n\t\t\t\t\t\t\tconst selected =\n\t\t\t\t\t\t\t\tthis.value.includes(option.value) ||\n\t\t\t\t\t\t\t\t(option.group === true && this.isGroupSelected(`${option.value}`));\n\t\t\t\t\t\t\tconst active = i === this.cursor;\n\t\t\t\t\t\t\tconst groupActive =\n\t\t\t\t\t\t\t\t!active &&\n\t\t\t\t\t\t\t\ttypeof option.group === 'string' &&\n\t\t\t\t\t\t\t\tthis.options[this.cursor].value === option.group;\n\t\t\t\t\t\t\tif (groupActive) {\n\t\t\t\t\t\t\t\treturn opt(option, selected ? 'group-active-selected' : 'group-active', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (active && selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'active-selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn opt(option, active ? 'active' : 'inactive', options);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`\\n${color.yellow(S_BAR)} `)}\\n${footer}\\n`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${this.options\n\t\t\t\t\t\t.map((option, i, options) => {\n\t\t\t\t\t\t\tconst selected =\n\t\t\t\t\t\t\t\tthis.value.includes(option.value) ||\n\t\t\t\t\t\t\t\t(option.group === true && this.isGroupSelected(`${option.value}`));\n\t\t\t\t\t\t\tconst active = i === this.cursor;\n\t\t\t\t\t\t\tconst groupActive =\n\t\t\t\t\t\t\t\t!active &&\n\t\t\t\t\t\t\t\ttypeof option.group === 'string' &&\n\t\t\t\t\t\t\t\tthis.options[this.cursor].value === option.group;\n\t\t\t\t\t\t\tif (groupActive) {\n\t\t\t\t\t\t\t\treturn opt(option, selected ? 'group-active-selected' : 'group-active', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (active && selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'active-selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn opt(option, active ? 'active' : 'inactive', options);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value[] | symbol>;\n};\n\nexport const note = (message = '', title = '') => {\n\tconst lines = `\\n${message}\\n`.split('\\n');\n\tconst titleLen = strip(title).length;\n\tconst len =\n\t\tMath.max(\n\t\t\tlines.reduce((sum, ln) => {\n\t\t\t\tconst line = strip(ln);\n\t\t\t\treturn line.length > sum ? line.length : sum;\n\t\t\t}, 0),\n\t\t\ttitleLen\n\t\t) + 2;\n\tconst msg = lines\n\t\t.map(\n\t\t\t(ln) =>\n\t\t\t\t`${color.gray(S_BAR)} ${color.dim(ln)}${' '.repeat(len - strip(ln).length)}${color.gray(\n\t\t\t\t\tS_BAR\n\t\t\t\t)}`\n\t\t)\n\t\t.join('\\n');\n\tprocess.stdout.write(\n\t\t`${color.gray(S_BAR)}\\n${color.green(S_STEP_SUBMIT)} ${color.reset(title)} ${color.gray(\n\t\t\tS_BAR_H.repeat(Math.max(len - titleLen - 1, 1)) + S_CORNER_TOP_RIGHT\n\t\t)}\\n${msg}\\n${color.gray(S_CONNECT_LEFT + S_BAR_H.repeat(len + 2) + S_CORNER_BOTTOM_RIGHT)}\\n`\n\t);\n};\n\nexport const cancel = (message = '') => {\n\tprocess.stdout.write(`${color.gray(S_BAR_END)} ${color.red(message)}\\n\\n`);\n};\n\nexport const intro = (title = '') => {\n\tprocess.stdout.write(`${color.gray(S_BAR_START)} ${title}\\n`);\n};\n\nexport const outro = (message = '') => {\n\tprocess.stdout.write(`${color.gray(S_BAR)}\\n${color.gray(S_BAR_END)} ${message}\\n\\n`);\n};\n\nexport type LogMessageOptions = {\n\tsymbol?: string;\n};\nexport const log = {\n\tmessage: (message = '', { symbol = color.gray(S_BAR) }: LogMessageOptions = {}) => {\n\t\tconst parts = [`${color.gray(S_BAR)}`];\n\t\tif (message) {\n\t\t\tconst [firstLine, ...lines] = message.split('\\n');\n\t\t\tparts.push(`${symbol} ${firstLine}`, ...lines.map((ln) => `${color.gray(S_BAR)} ${ln}`));\n\t\t}\n\t\tprocess.stdout.write(`${parts.join('\\n')}\\n`);\n\t},\n\tinfo: (message: string) => {\n\t\tlog.message(message, { symbol: color.blue(S_INFO) });\n\t},\n\tsuccess: (message: string) => {\n\t\tlog.message(message, { symbol: color.green(S_SUCCESS) });\n\t},\n\tstep: (message: string) => {\n\t\tlog.message(message, { symbol: color.green(S_STEP_SUBMIT) });\n\t},\n\twarn: (message: string) => {\n\t\tlog.message(message, { symbol: color.yellow(S_WARN) });\n\t},\n\t/** alias for `log.warn()`. */\n\twarning: (message: string) => {\n\t\tlog.warn(message);\n\t},\n\terror: (message: string) => {\n\t\tlog.message(message, { symbol: color.red(S_ERROR) });\n\t},\n};\n\nexport const spinner = () => {\n\tconst frames = unicode ? ['◒', '◐', '◓', '◑'] : ['•', 'o', 'O', '0'];\n\tconst delay = unicode ? 80 : 120;\n\tconst isCI = process.env.CI === 'true';\n\n\tlet unblock: () => void;\n\tlet loop: NodeJS.Timeout;\n\tlet isSpinnerActive = false;\n\tlet _message = '';\n\tlet _prevMessage: string | undefined = undefined;\n\n\tconst handleExit = (code: number) => {\n\t\tconst msg = code > 1 ? 'Something went wrong' : 'Canceled';\n\t\tif (isSpinnerActive) stop(msg, code);\n\t};\n\n\tconst errorEventHandler = () => handleExit(2);\n\tconst signalEventHandler = () => handleExit(1);\n\n\tconst registerHooks = () => {\n\t\t// Reference: https://nodejs.org/api/process.html#event-uncaughtexception\n\t\tprocess.on('uncaughtExceptionMonitor', errorEventHandler);\n\t\t// Reference: https://nodejs.org/api/process.html#event-unhandledrejection\n\t\tprocess.on('unhandledRejection', errorEventHandler);\n\t\t// Reference Signal Events: https://nodejs.org/api/process.html#signal-events\n\t\tprocess.on('SIGINT', signalEventHandler);\n\t\tprocess.on('SIGTERM', signalEventHandler);\n\t\tprocess.on('exit', handleExit);\n\t};\n\n\tconst clearHooks = () => {\n\t\tprocess.removeListener('uncaughtExceptionMonitor', errorEventHandler);\n\t\tprocess.removeListener('unhandledRejection', errorEventHandler);\n\t\tprocess.removeListener('SIGINT', signalEventHandler);\n\t\tprocess.removeListener('SIGTERM', signalEventHandler);\n\t\tprocess.removeListener('exit', handleExit);\n\t};\n\n\tconst clearPrevMessage = () => {\n\t\tif (_prevMessage === undefined) return;\n\t\tif (isCI) process.stdout.write('\\n');\n\t\tconst prevLines = _prevMessage.split('\\n');\n\t\tprocess.stdout.write(cursor.move(-999, prevLines.length - 1));\n\t\tprocess.stdout.write(erase.down(prevLines.length));\n\t};\n\n\tconst parseMessage = (msg: string): string => {\n\t\treturn msg.replace(/\\.+$/, '');\n\t};\n\n\tconst start = (msg = ''): void => {\n\t\tisSpinnerActive = true;\n\t\tunblock = block();\n\t\t_message = parseMessage(msg);\n\t\tprocess.stdout.write(`${color.gray(S_BAR)}\\n`);\n\t\tlet frameIndex = 0;\n\t\tlet dotsTimer = 0;\n\t\tregisterHooks();\n\t\tloop = setInterval(() => {\n\t\t\tif (isCI && _message === _prevMessage) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tclearPrevMessage();\n\t\t\t_prevMessage = _message;\n\t\t\tconst frame = color.magenta(frames[frameIndex]);\n\t\t\tconst loadingDots = isCI ? '...' : '.'.repeat(Math.floor(dotsTimer)).slice(0, 3);\n\t\t\tprocess.stdout.write(`${frame} ${_message}${loadingDots}`);\n\t\t\tframeIndex = frameIndex + 1 < frames.length ? frameIndex + 1 : 0;\n\t\t\tdotsTimer = dotsTimer < frames.length ? dotsTimer + 0.125 : 0;\n\t\t}, delay);\n\t};\n\n\tconst stop = (msg = '', code = 0): void => {\n\t\tisSpinnerActive = false;\n\t\tclearInterval(loop);\n\t\tclearPrevMessage();\n\t\tconst step =\n\t\t\tcode === 0\n\t\t\t\t? color.green(S_STEP_SUBMIT)\n\t\t\t\t: code === 1\n\t\t\t\t\t? color.red(S_STEP_CANCEL)\n\t\t\t\t\t: color.red(S_STEP_ERROR);\n\t\t_message = parseMessage(msg ?? _message);\n\t\tprocess.stdout.write(`${step} ${_message}\\n`);\n\t\tclearHooks();\n\t\tunblock();\n\t};\n\n\tconst message = (msg = ''): void => {\n\t\t_message = parseMessage(msg ?? _message);\n\t};\n\n\treturn {\n\t\tstart,\n\t\tstop,\n\t\tmessage,\n\t};\n};\n\nexport type PromptGroupAwaitedReturn<T> = {\n\t[P in keyof T]: Exclude<Awaited<T[P]>, symbol>;\n};\n\nexport interface PromptGroupOptions<T> {\n\t/**\n\t * Control how the group can be canceled\n\t * if one of the prompts is canceled.\n\t */\n\tonCancel?: (opts: { results: Prettify<Partial<PromptGroupAwaitedReturn<T>>> }) => void;\n}\n\ntype Prettify<T> = {\n\t[P in keyof T]: T[P];\n} & {};\n\nexport type PromptGroup<T> = {\n\t[P in keyof T]: (opts: {\n\t\tresults: Prettify<Partial<PromptGroupAwaitedReturn<Omit<T, P>>>>;\n\t}) => undefined | Promise<T[P] | undefined>;\n};\n\n/**\n * Define a group of prompts to be displayed\n * and return a results of objects within the group\n */\nexport const group = async <T>(\n\tprompts: PromptGroup<T>,\n\topts?: PromptGroupOptions<T>\n): Promise<Prettify<PromptGroupAwaitedReturn<T>>> => {\n\tconst results = {} as any;\n\tconst promptNames = Object.keys(prompts);\n\n\tfor (const name of promptNames) {\n\t\tconst prompt = prompts[name as keyof T];\n\t\tconst result = await prompt({ results })?.catch((e) => {\n\t\t\tthrow e;\n\t\t});\n\n\t\t// Pass the results to the onCancel function\n\t\t// so the user can decide what to do with the results\n\t\t// TODO: Switch to callback within core to avoid isCancel Fn\n\t\tif (typeof opts?.onCancel === 'function' && isCancel(result)) {\n\t\t\tresults[name] = 'canceled';\n\t\t\topts.onCancel({ results });\n\t\t\tcontinue;\n\t\t}\n\n\t\tresults[name] = result;\n\t}\n\n\treturn results;\n};\n\nexport type Task = {\n\t/**\n\t * Task title\n\t */\n\ttitle: string;\n\t/**\n\t * Task function\n\t */\n\ttask: (message: (string: string) => void) => string | Promise<string> | void | Promise<void>;\n\n\t/**\n\t * If enabled === false the task will be skipped\n\t */\n\tenabled?: boolean;\n};\n\n/**\n * Define a group of tasks to be executed\n */\nexport const tasks = async (tasks: Task[]) => {\n\tfor (const task of tasks) {\n\t\tif (task.enabled === false) continue;\n\n\t\tconst s = spinner();\n\t\ts.start(task.title);\n\t\tconst result = await task.task(s.message);\n\t\ts.stop(result || task.title);\n\t}\n};\n","import * as p from \"@clack/prompts\";\n\nexport async function doctorCommand(options: { url?: string; endpoint?: string }): Promise<void> {\n p.intro(\"siteping — Diagnostic réseau\");\n\n const url =\n options.url ??\n (await p.text({\n message: \"URL du serveur de développement\",\n placeholder: \"http://localhost:3000\",\n defaultValue: \"http://localhost:3000\",\n }));\n\n if (p.isCancel(url)) {\n p.cancel(\"Annulé.\");\n process.exit(0);\n }\n\n const endpoint =\n options.endpoint ??\n (await p.text({\n message: \"Chemin de l'endpoint API\",\n placeholder: \"/api/siteping\",\n defaultValue: \"/api/siteping\",\n }));\n\n if (p.isCancel(endpoint)) {\n p.cancel(\"Annulé.\");\n process.exit(0);\n }\n\n const fullUrl = `${url}${endpoint}?projectName=__siteping_health_check__`;\n\n const spinner = p.spinner();\n spinner.start(`Test de connexion à ${url}${endpoint}`);\n\n try {\n const start = performance.now();\n const response = await fetch(fullUrl);\n const elapsed = Math.round(performance.now() - start);\n\n if (response.ok) {\n const data = await response.json();\n spinner.stop(`Connexion réussie (${elapsed}ms)`);\n\n if (data && typeof data.total === \"number\") {\n p.log.success(`API fonctionnelle — ${data.total} feedback(s) trouvé(s)`);\n } else {\n p.log.warn(\"Réponse inattendue — vérifiez que l'endpoint utilise createSitepingHandler()\");\n }\n } else {\n spinner.stop(`Erreur HTTP ${response.status} (${elapsed}ms)`);\n const text = await response.text().catch(() => \"\");\n p.log.error(`Le serveur a répondu : ${response.status} ${response.statusText}`);\n if (text) p.log.info(text.slice(0, 200));\n }\n } catch (error) {\n spinner.stop(\"Connexion échouée\");\n if (error instanceof TypeError && String(error).includes(\"fetch\")) {\n p.log.error(\"Impossible de se connecter — le serveur est-il lancé ?\");\n p.log.info(`Vérifiez que ${url} est accessible`);\n } else {\n p.log.error(`Erreur : ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n p.outro(\"Diagnostic terminé\");\n}\n","import { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport type { AttributeArgument, BlockAttribute, Field, Model, Property } from \"@mrleebo/prisma-ast\";\nimport { getSchema, printSchema } from \"@mrleebo/prisma-ast\";\nimport { type FieldDef, type IndexDef, SITEPING_MODELS } from \"@siteping/core\";\n\nconst DEFAULT_SCHEMA_PATH = \"prisma/schema.prisma\";\n\nexport interface FieldChange {\n model: string;\n field: string;\n action: \"added\" | \"updated\";\n detail: string;\n}\n\nexport interface SyncResult {\n schemaPath: string;\n addedModels: string[];\n changes: FieldChange[];\n}\n\n/**\n * Sync Siteping models into an existing Prisma schema.\n *\n * Uses prisma-ast for AST-level manipulation (no regex/string concat).\n * - Missing models are created\n * - Missing fields are added\n * - Fields with wrong type/optional/attributes are updated\n * - User-added fields outside Siteping's definition are left untouched\n */\nexport function syncPrismaModels(schemaPath: string = DEFAULT_SCHEMA_PATH): SyncResult {\n if (!existsSync(schemaPath)) {\n throw new Error(`Fichier schema introuvable : ${schemaPath}`);\n }\n\n const source = readFileSync(schemaPath, \"utf-8\");\n const schema = getSchema(source);\n\n const existingModelsMap = new Map<string, Model>();\n for (const item of schema.list) {\n if (item.type === \"model\") {\n existingModelsMap.set(item.name, item as Model);\n }\n }\n\n const addedModels: string[] = [];\n const changes: FieldChange[] = [];\n\n for (const [modelName, modelDef] of Object.entries(SITEPING_MODELS)) {\n const existingModel = existingModelsMap.get(modelName);\n\n if (!existingModel) {\n const model: Model = { type: \"model\", name: modelName, properties: [] };\n for (const [fieldName, fieldDef] of Object.entries(modelDef.fields)) {\n model.properties.push(buildField(fieldName, fieldDef));\n }\n if (modelDef.indexes) {\n for (const idx of modelDef.indexes) {\n model.properties.push(buildBlockIndex(idx));\n }\n }\n schema.list.push(model);\n addedModels.push(modelName);\n continue;\n }\n\n // Model exists — diff fields\n const existingFields = new Map<string, { field: Field; index: number }>();\n existingModel.properties.forEach((prop, idx) => {\n if (prop.type === \"field\") {\n existingFields.set((prop as Field).name, { field: prop as Field, index: idx });\n }\n });\n\n const fieldsToAdd: Field[] = [];\n const fieldsToUpdate: Array<{ index: number; field: Field }> = [];\n\n for (const [fieldName, fieldDef] of Object.entries(modelDef.fields)) {\n const expected = buildField(fieldName, fieldDef);\n const existing = existingFields.get(fieldName);\n\n if (!existing) {\n fieldsToAdd.push(expected);\n changes.push({\n model: modelName,\n field: fieldName,\n action: \"added\",\n detail: formatFieldSignature(fieldDef),\n });\n } else if (!fieldsMatch(existing.field, expected)) {\n fieldsToUpdate.push({ index: existing.index, field: expected });\n changes.push({\n model: modelName,\n field: fieldName,\n action: \"updated\",\n detail: describeChange(existing.field, expected),\n });\n }\n }\n\n // Apply updates in-place (doesn't shift indices)\n for (const { index, field } of fieldsToUpdate) {\n existingModel.properties[index] = field;\n }\n\n // Insert new fields before createdAt (or at end)\n if (fieldsToAdd.length > 0) {\n const createdAtIdx = existingModel.properties.findIndex(\n (p) => p.type === \"field\" && (p as Field).name === \"createdAt\",\n );\n if (createdAtIdx >= 0) {\n existingModel.properties.splice(createdAtIdx, 0, ...fieldsToAdd);\n } else {\n existingModel.properties.push(...fieldsToAdd);\n }\n }\n\n // Sync @@index block attributes\n if (modelDef.indexes) {\n for (const idx of modelDef.indexes) {\n if (!hasBlockIndex(existingModel, idx)) {\n existingModel.properties.push(buildBlockIndex(idx));\n changes.push({\n model: modelName,\n field: `@@index([${idx.fields.join(\", \")}])`,\n action: \"added\",\n detail: \"index\",\n });\n }\n }\n }\n }\n\n if (addedModels.length > 0 || changes.length > 0) {\n const output = printSchema(schema);\n writeFileSync(schemaPath, output, \"utf-8\");\n }\n\n return { schemaPath, addedModels, changes };\n}\n\n/** Check if two fields have the same type, optionality, and attributes. */\nfunction fieldsMatch(existing: Field, expected: Field): boolean {\n if (existing.fieldType !== expected.fieldType) return false;\n if ((existing.optional ?? false) !== (expected.optional ?? false)) return false;\n if ((existing.array ?? false) !== (expected.array ?? false)) return false;\n\n const existingAttrs = (existing.attributes ?? []).map((a) => a.name).sort();\n const expectedAttrs = (expected.attributes ?? []).map((a) => a.name).sort();\n\n if (existingAttrs.length !== expectedAttrs.length) return false;\n return existingAttrs.every((name, i) => name === expectedAttrs[i]);\n}\n\n/** Human-readable description of what changed. */\nfunction describeChange(existing: Field, expected: Field): string {\n const parts: string[] = [];\n\n if (existing.fieldType !== expected.fieldType) {\n parts.push(`${existing.fieldType} → ${expected.fieldType}`);\n }\n if ((existing.optional ?? false) !== (expected.optional ?? false)) {\n parts.push(expected.optional ? \"requis \\u2192 optionnel\" : \"optionnel \\u2192 requis\");\n }\n\n const existingAttrs = new Set((existing.attributes ?? []).map((a) => a.name));\n const expectedAttrs = new Set((expected.attributes ?? []).map((a) => a.name));\n for (const attr of expectedAttrs) {\n if (!existingAttrs.has(attr)) parts.push(`+@${attr}`);\n }\n for (const attr of existingAttrs) {\n if (!expectedAttrs.has(attr)) parts.push(`-@${attr}`);\n }\n\n return parts.join(\", \") || \"attributs modifi\\u00e9s\";\n}\n\n/** Format a field definition for display. */\nfunction formatFieldSignature(def: FieldDef): string {\n let sig = def.type;\n if (def.optional) sig += \"?\";\n return sig;\n}\n\nfunction buildField(name: string, def: FieldDef): Field {\n const field: Field = {\n type: \"field\",\n name,\n fieldType: def.relation ? def.relation.model : def.type,\n optional: def.optional ?? false,\n array: def.relation?.kind === \"1-to-many\",\n attributes: [],\n };\n\n if (def.isId) {\n field.attributes!.push({ type: \"attribute\", name: \"id\", kind: \"field\" });\n if (def.default) {\n field.attributes!.push({\n type: \"attribute\",\n name: \"default\",\n kind: \"field\",\n args: [\n {\n type: \"attributeArgument\",\n value: { type: \"function\", name: def.default.replace(\"()\", \"\"), params: [] },\n } as AttributeArgument,\n ],\n });\n }\n } else if (def.default && !def.relation) {\n const isFunction = def.default.endsWith(\"()\");\n field.attributes!.push({\n type: \"attribute\",\n name: \"default\",\n kind: \"field\",\n args: [\n {\n type: \"attributeArgument\",\n value: isFunction ? { type: \"function\", name: def.default.replace(\"()\", \"\"), params: [] } : def.default,\n } as AttributeArgument,\n ],\n });\n }\n\n if (def.isUnique) {\n field.attributes!.push({ type: \"attribute\", name: \"unique\", kind: \"field\" });\n }\n\n if (def.relation?.kind === \"many-to-1\") {\n const args: AttributeArgument[] = [];\n if (def.relation.fields) {\n args.push({\n type: \"attributeArgument\",\n value: { type: \"keyValue\", key: \"fields\", value: { type: \"array\", args: def.relation.fields } },\n } as AttributeArgument);\n }\n if (def.relation.references) {\n args.push({\n type: \"attributeArgument\",\n value: { type: \"keyValue\", key: \"references\", value: { type: \"array\", args: def.relation.references } },\n } as AttributeArgument);\n }\n if (def.relation.onDelete) {\n args.push({\n type: \"attributeArgument\",\n value: { type: \"keyValue\", key: \"onDelete\", value: def.relation.onDelete },\n } as AttributeArgument);\n }\n field.attributes!.push({\n type: \"attribute\",\n name: \"relation\",\n kind: \"field\",\n args,\n });\n }\n\n return field;\n}\n\nfunction buildBlockIndex(idx: IndexDef): Property {\n return {\n type: \"attribute\",\n kind: \"object\",\n name: \"index\",\n args: [\n {\n type: \"attributeArgument\",\n value: { type: \"array\", args: idx.fields },\n } as AttributeArgument,\n ],\n } as BlockAttribute;\n}\n\nfunction hasBlockIndex(model: Model, idx: IndexDef): boolean {\n const key = idx.fields.join(\",\");\n return model.properties.some((p) => {\n if (p.type !== \"attribute\" || (p as BlockAttribute).name !== \"index\") return false;\n const attr = p as BlockAttribute;\n const firstArg = attr.args?.[0];\n if (!firstArg || firstArg.type !== \"attributeArgument\") return false;\n const val = firstArg.value;\n if (typeof val === \"object\" && val !== null && \"type\" in val && val.type === \"array\") {\n return (val as { type: \"array\"; args: string[] }).args.join(\",\") === key;\n }\n return false;\n });\n}\n","import mod from \"../lib/src/api.js\";\n\nexport default mod;\nexport const Alternation = mod.Alternation;\nexport const Alternative = mod.Alternative;\nexport const CstParser = mod.CstParser;\nexport const EMPTY_ALT = mod.EMPTY_ALT;\nexport const EOF = mod.EOF;\nexport const EarlyExitException = mod.EarlyExitException;\nexport const EmbeddedActionsParser = mod.EmbeddedActionsParser;\nexport const GAstVisitor = mod.GAstVisitor;\nexport const LLkLookaheadStrategy = mod.LLkLookaheadStrategy;\nexport const Lexer = mod.Lexer;\nexport const LexerDefinitionErrorType = mod.LexerDefinitionErrorType;\nexport const MismatchedTokenException = mod.MismatchedTokenException;\nexport const NoViableAltException = mod.NoViableAltException;\nexport const NonTerminal = mod.NonTerminal;\nexport const NotAllInputParsedException = mod.NotAllInputParsedException;\nexport const Option = mod.Option;\nexport const Parser = mod.Parser;\nexport const ParserDefinitionErrorType = mod.ParserDefinitionErrorType;\nexport const Repetition = mod.Repetition;\nexport const RepetitionMandatory = mod.RepetitionMandatory;\nexport const RepetitionMandatoryWithSeparator = mod.RepetitionMandatoryWithSeparator;\nexport const RepetitionWithSeparator = mod.RepetitionWithSeparator;\nexport const Rule = mod.Rule;\nexport const Terminal = mod.Terminal;\nexport const VERSION = mod.VERSION;\nexport const clearCache = mod.clearCache;\nexport const createSyntaxDiagramsCode = mod.createSyntaxDiagramsCode;\nexport const createToken = mod.createToken;\nexport const createTokenInstance = mod.createTokenInstance;\nexport const defaultLexerErrorProvider = mod.defaultLexerErrorProvider;\nexport const defaultParserErrorProvider = mod.defaultParserErrorProvider;\nexport const generateCstDts = mod.generateCstDts;\nexport const getLookaheadPaths = mod.getLookaheadPaths;\nexport const isRecognitionException = mod.isRecognitionException;\nexport const serializeGrammar = mod.serializeGrammar;\nexport const serializeProduction = mod.serializeProduction;\nexport const tokenLabel = mod.tokenLabel;\nexport const tokenMatcher = mod.tokenMatcher;\nexport const tokenName = mod.tokenName;\n","import { createToken, Lexer, IMultiModeLexerDefinition } from 'chevrotain';\n\nexport const Identifier = createToken({\n name: 'Identifier',\n pattern: /[a-zA-Z][\\w-]*/,\n});\nexport const Datasource = createToken({\n name: 'Datasource',\n pattern: /datasource/,\n push_mode: 'block',\n});\nexport const Generator = createToken({\n name: 'Generator',\n pattern: /generator/,\n push_mode: 'block',\n});\nexport const Model = createToken({\n name: 'Model',\n pattern: /model/,\n push_mode: 'block',\n});\nexport const View = createToken({\n name: 'View',\n pattern: /view/,\n push_mode: 'block',\n});\nexport const Enum = createToken({\n name: 'Enum',\n pattern: /enum/,\n push_mode: 'block',\n});\nexport const Type = createToken({\n name: 'Type',\n pattern: /type/,\n push_mode: 'block',\n});\nexport const True = createToken({\n name: 'True',\n pattern: /true/,\n longer_alt: Identifier,\n});\nexport const False = createToken({\n name: 'False',\n pattern: /false/,\n longer_alt: Identifier,\n});\nexport const Null = createToken({\n name: 'Null',\n pattern: /null/,\n longer_alt: Identifier,\n});\nexport const Comment = createToken({\n name: 'Comment',\n pattern: Lexer.NA,\n});\n\nexport const DocComment = createToken({\n name: 'DocComment',\n pattern: /\\/\\/\\/[ \\t]*(.*)/,\n categories: [Comment],\n});\nexport const LineComment = createToken({\n name: 'LineComment',\n pattern: /\\/\\/[ \\t]*(.*)/,\n categories: [Comment],\n});\nexport const Attribute = createToken({\n name: 'Attribute',\n pattern: Lexer.NA,\n});\nexport const BlockAttribute = createToken({\n name: 'BlockAttribute',\n pattern: /@@/,\n label: \"'@@'\",\n categories: [Attribute],\n});\nexport const FieldAttribute = createToken({\n name: 'FieldAttribute',\n pattern: /@/,\n label: \"'@'\",\n categories: [Attribute],\n});\nexport const Dot = createToken({\n name: 'Dot',\n pattern: /\\./,\n label: \"'.'\",\n});\nexport const QuestionMark = createToken({\n name: 'QuestionMark',\n pattern: /\\?/,\n label: \"'?'\",\n});\nexport const LCurly = createToken({\n name: 'LCurly',\n pattern: /{/,\n label: \"'{'\",\n});\nexport const RCurly = createToken({\n name: 'RCurly',\n pattern: /}/,\n label: \"'}'\",\n pop_mode: true,\n});\nexport const LRound = createToken({\n name: 'LRound',\n pattern: /\\(/,\n label: \"'('\",\n});\nexport const RRound = createToken({\n name: 'RRound',\n pattern: /\\)/,\n label: \"')'\",\n});\nexport const LSquare = createToken({\n name: 'LSquare',\n pattern: /\\[/,\n label: \"'['\",\n});\nexport const RSquare = createToken({\n name: 'RSquare',\n pattern: /\\]/,\n label: \"']'\",\n});\nexport const Comma = createToken({\n name: 'Comma',\n pattern: /,/,\n label: \"','\",\n});\nexport const Colon = createToken({\n name: 'Colon',\n pattern: /:/,\n label: \"':'\",\n});\nexport const Equals = createToken({\n name: 'Equals',\n pattern: /=/,\n label: \"'='\",\n});\nexport const StringLiteral = createToken({\n name: 'StringLiteral',\n pattern: /\"(:?[^\\\\\"\\n\\r]|\\\\(:?[bfnrtv\"\\\\/]|u[0-9a-fA-F]{4}))*\"/,\n});\nexport const NumberLiteral = createToken({\n name: 'NumberLiteral',\n pattern: /-?(0|[1-9]\\d*)(\\.\\d+)?([eE][+-]?\\d+)?/,\n});\nexport const WhiteSpace = createToken({\n name: 'WhiteSpace',\n pattern: /\\s+/,\n group: Lexer.SKIPPED,\n});\nexport const LineBreak = createToken({\n name: 'LineBreak',\n pattern: /\\n|\\r\\n/,\n line_breaks: true,\n label: 'LineBreak',\n});\n\nconst naTokens = [Comment, DocComment, LineComment, LineBreak, WhiteSpace];\n\nexport const multiModeTokens: IMultiModeLexerDefinition = {\n modes: {\n global: [...naTokens, Datasource, Generator, Model, View, Enum, Type],\n block: [\n ...naTokens,\n Attribute,\n BlockAttribute,\n FieldAttribute,\n Dot,\n QuestionMark,\n LCurly,\n RCurly,\n LSquare,\n RSquare,\n LRound,\n RRound,\n Comma,\n Colon,\n Equals,\n True,\n False,\n Null,\n StringLiteral,\n NumberLiteral,\n Identifier,\n ],\n },\n defaultMode: 'global',\n};\n\nexport const PrismaLexer = new Lexer(multiModeTokens);\n","import type { CstNode, IToken } from 'chevrotain';\nimport * as schema from './getSchema';\n\nconst schemaObjects = ['model', 'view', 'type'] as const;\n\nexport function isOneOfSchemaObjects<T extends string>(\n obj: schema.Object,\n schemas: readonly T[]\n): obj is Extract<schema.Object, { type: T }> {\n return obj != null && 'type' in obj && schemas.includes(obj.type as T);\n}\n\n/** Returns true if the value is an Object, such as a model or view or composite type. */\nexport function isSchemaObject(\n obj: schema.Object\n): obj is Extract<schema.Object, { type: (typeof schemaObjects)[number] }> {\n return isOneOfSchemaObjects(obj, schemaObjects);\n}\n\nconst fieldObjects = ['field', 'enumerator'] as const;\n/** Returns true if the value is a Field or Enumerator. */\nexport function isSchemaField(\n field: schema.Field | schema.Enumerator\n): field is Extract<schema.Field, { type: (typeof fieldObjects)[number] }> {\n return field != null && 'type' in field && fieldObjects.includes(field.type);\n}\n\n/** Returns true if the value of the CstNode is a Token. */\nexport function isToken(node: [IToken] | [CstNode]): node is [IToken] {\n return 'image' in node[0];\n}\n\n/**\n * If parser.nodeLocationTracking is set, then read the location statistics\n * from the available tokens. If tracking is 'none' then just return the\n * existing data structure.\n * */\nexport function appendLocationData<T extends Record<string, unknown>>(\n data: T,\n ...tokens: IToken[]\n): T {\n const location = tokens.reduce((memo, token) => {\n if (!token) return memo;\n\n const {\n endColumn = -Infinity,\n endLine = -Infinity,\n endOffset = -Infinity,\n startColumn = Infinity,\n startLine = Infinity,\n startOffset = Infinity,\n } = memo;\n\n if (token.startLine != null && token.startLine < startLine)\n memo.startLine = token.startLine;\n if (token.startColumn != null && token.startColumn < startColumn)\n memo.startColumn = token.startColumn;\n if (token.startOffset != null && token.startOffset < startOffset)\n memo.startOffset = token.startOffset;\n\n if (token.endLine != null && token.endLine > endLine)\n memo.endLine = token.endLine;\n if (token.endColumn != null && token.endColumn > endColumn)\n memo.endColumn = token.endColumn;\n if (token.endOffset != null && token.endOffset > endOffset)\n memo.endOffset = token.endOffset;\n\n return memo;\n }, {} as IToken);\n\n return Object.assign(data, { location });\n}\n","import type { IParserConfig } from 'chevrotain';\nimport {\n lilconfigSync as configSync,\n type LilconfigResult as ConfigResultRaw,\n} from 'lilconfig';\n\nexport type PrismaAstParserConfig = Pick<IParserConfig, 'nodeLocationTracking'>;\nexport interface PrismaAstConfig {\n parser: PrismaAstParserConfig;\n}\n\ntype ConfigResult<T> = Omit<ConfigResultRaw, 'config'> & {\n config: T;\n};\n\nconst defaultConfig: PrismaAstConfig = {\n parser: { nodeLocationTracking: 'none' },\n};\n\nlet config: PrismaAstConfig;\nexport default function getConfig(): PrismaAstConfig {\n if (config != null) return config;\n\n const result: ConfigResult<PrismaAstConfig> | null =\n configSync('prisma-ast').search();\n return (config = Object.assign(defaultConfig, result?.config));\n}\n","import { CstParser } from 'chevrotain';\nimport getConfig, { PrismaAstParserConfig } from './getConfig';\nimport * as lexer from './lexer';\n\ntype ComponentType =\n | 'datasource'\n | 'generator'\n | 'model'\n | 'view'\n | 'enum'\n | 'type';\nexport class PrismaParser extends CstParser {\n readonly config: PrismaAstParserConfig;\n\n constructor(config: PrismaAstParserConfig) {\n super(lexer.multiModeTokens, config);\n this.performSelfAnalysis();\n this.config = config;\n }\n\n private break = this.RULE('break', () => {\n this.CONSUME1(lexer.LineBreak);\n this.CONSUME2(lexer.LineBreak);\n });\n\n private keyedArg = this.RULE('keyedArg', () => {\n this.CONSUME(lexer.Identifier, { LABEL: 'keyName' });\n this.CONSUME(lexer.Colon);\n this.SUBRULE(this.value);\n });\n\n private array = this.RULE('array', () => {\n this.CONSUME(lexer.LSquare);\n this.MANY_SEP({\n SEP: lexer.Comma,\n DEF: () => {\n this.SUBRULE(this.value);\n },\n });\n this.CONSUME(lexer.RSquare);\n });\n\n private func = this.RULE('func', () => {\n this.CONSUME(lexer.Identifier, { LABEL: 'funcName' });\n this.CONSUME(lexer.LRound);\n this.MANY_SEP({\n SEP: lexer.Comma,\n DEF: () => {\n this.OR([\n { ALT: () => this.SUBRULE(this.keyedArg) },\n { ALT: () => this.SUBRULE(this.value) },\n ]);\n },\n });\n this.CONSUME(lexer.RRound);\n });\n\n private value = this.RULE('value', () => {\n this.OR([\n { ALT: () => this.CONSUME(lexer.StringLiteral, { LABEL: 'value' }) },\n { ALT: () => this.CONSUME(lexer.NumberLiteral, { LABEL: 'value' }) },\n { ALT: () => this.SUBRULE(this.array, { LABEL: 'value' }) },\n { ALT: () => this.SUBRULE(this.func, { LABEL: 'value' }) },\n { ALT: () => this.CONSUME(lexer.True, { LABEL: 'value' }) },\n { ALT: () => this.CONSUME(lexer.False, { LABEL: 'value' }) },\n { ALT: () => this.CONSUME(lexer.Null, { LABEL: 'value' }) },\n { ALT: () => this.CONSUME(lexer.Identifier, { LABEL: 'value' }) },\n ]);\n });\n\n private property = this.RULE('property', () => {\n this.CONSUME(lexer.Identifier, { LABEL: 'propertyName' });\n this.CONSUME(lexer.Equals);\n this.SUBRULE(this.value, { LABEL: 'propertyValue' });\n });\n\n private assignment = this.RULE('assignment', () => {\n this.CONSUME(lexer.Identifier, { LABEL: 'assignmentName' });\n this.CONSUME(lexer.Equals);\n this.SUBRULE(this.value, { LABEL: 'assignmentValue' });\n });\n\n private field = this.RULE('field', () => {\n this.CONSUME(lexer.Identifier, { LABEL: 'fieldName' });\n this.SUBRULE(this.value, { LABEL: 'fieldType' });\n this.OPTION1(() => {\n this.OR([\n {\n ALT: () => {\n this.CONSUME(lexer.LSquare, { LABEL: 'array' });\n this.CONSUME(lexer.RSquare, { LABEL: 'array' });\n },\n },\n { ALT: () => this.CONSUME(lexer.QuestionMark, { LABEL: 'optional' }) },\n ]);\n });\n this.MANY(() => {\n this.SUBRULE(this.fieldAttribute, { LABEL: 'attributeList' });\n });\n this.OPTION2(() => {\n this.CONSUME(lexer.Comment, { LABEL: 'comment' });\n });\n });\n\n private block = this.RULE(\n 'block',\n (\n options: {\n componentType?: ComponentType;\n } = {}\n ) => {\n const { componentType } = options;\n const isEnum = componentType === 'enum';\n const isObject =\n componentType === 'model' ||\n componentType === 'view' ||\n componentType === 'type';\n\n this.CONSUME(lexer.LCurly);\n this.CONSUME1(lexer.LineBreak);\n this.MANY(() => {\n this.OR([\n { ALT: () => this.SUBRULE(this.comment, { LABEL: 'list' }) },\n {\n GATE: () => isObject,\n ALT: () => this.SUBRULE(this.property, { LABEL: 'list' }),\n },\n { ALT: () => this.SUBRULE(this.blockAttribute, { LABEL: 'list' }) },\n {\n GATE: () => isObject,\n ALT: () => this.SUBRULE(this.field, { LABEL: 'list' }),\n },\n {\n GATE: () => isEnum,\n ALT: () => this.SUBRULE(this.enum, { LABEL: 'list' }),\n },\n {\n GATE: () => !isObject,\n ALT: () => this.SUBRULE(this.assignment, { LABEL: 'list' }),\n },\n { ALT: () => this.SUBRULE(this.break, { LABEL: 'list' }) },\n { ALT: () => this.CONSUME2(lexer.LineBreak) },\n ]);\n });\n this.CONSUME(lexer.RCurly);\n }\n );\n\n private enum = this.RULE('enum', () => {\n this.CONSUME(lexer.Identifier, { LABEL: 'enumName' });\n this.MANY(() => {\n this.SUBRULE(this.fieldAttribute, { LABEL: 'attributeList' });\n });\n this.OPTION(() => {\n this.CONSUME(lexer.Comment, { LABEL: 'comment' });\n });\n });\n\n private fieldAttribute = this.RULE('fieldAttribute', () => {\n this.CONSUME(lexer.FieldAttribute, { LABEL: 'fieldAttribute' });\n this.OR([\n {\n ALT: () => {\n this.CONSUME1(lexer.Identifier, { LABEL: 'groupName' });\n this.CONSUME(lexer.Dot);\n this.CONSUME2(lexer.Identifier, { LABEL: 'attributeName' });\n },\n },\n {\n ALT: () => this.CONSUME(lexer.Identifier, { LABEL: 'attributeName' }),\n },\n ]);\n\n this.OPTION(() => {\n this.CONSUME(lexer.LRound);\n this.MANY_SEP({\n SEP: lexer.Comma,\n DEF: () => {\n this.SUBRULE(this.attributeArg);\n },\n });\n this.CONSUME(lexer.RRound);\n });\n });\n\n private blockAttribute = this.RULE('blockAttribute', () => {\n this.CONSUME(lexer.BlockAttribute, { LABEL: 'blockAttribute' }),\n this.OR([\n {\n ALT: () => {\n this.CONSUME1(lexer.Identifier, { LABEL: 'groupName' });\n this.CONSUME(lexer.Dot);\n this.CONSUME2(lexer.Identifier, { LABEL: 'attributeName' });\n },\n },\n {\n ALT: () => this.CONSUME(lexer.Identifier, { LABEL: 'attributeName' }),\n },\n ]);\n\n this.OPTION(() => {\n this.CONSUME(lexer.LRound);\n this.MANY_SEP({\n SEP: lexer.Comma,\n DEF: () => {\n this.SUBRULE(this.attributeArg);\n },\n });\n this.CONSUME(lexer.RRound);\n });\n });\n\n private attributeArg = this.RULE('attributeArg', () => {\n this.OR([\n {\n ALT: () => this.SUBRULE(this.keyedArg, { LABEL: 'value' }),\n },\n {\n ALT: () => this.SUBRULE(this.value, { LABEL: 'value' }),\n },\n ]);\n });\n\n private component = this.RULE('component', () => {\n const type = this.OR1([\n { ALT: () => this.CONSUME(lexer.Datasource, { LABEL: 'type' }) },\n { ALT: () => this.CONSUME(lexer.Generator, { LABEL: 'type' }) },\n { ALT: () => this.CONSUME(lexer.Model, { LABEL: 'type' }) },\n { ALT: () => this.CONSUME(lexer.View, { LABEL: 'type' }) },\n { ALT: () => this.CONSUME(lexer.Enum, { LABEL: 'type' }) },\n { ALT: () => this.CONSUME(lexer.Type, { LABEL: 'type' }) },\n ]);\n this.OR2([\n {\n ALT: () => {\n this.CONSUME1(lexer.Identifier, { LABEL: 'groupName' });\n this.CONSUME(lexer.Dot);\n this.CONSUME2(lexer.Identifier, { LABEL: 'componentName' });\n },\n },\n {\n ALT: () => this.CONSUME(lexer.Identifier, { LABEL: 'componentName' }),\n },\n ]);\n\n this.SUBRULE(this.block, {\n ARGS: [{ componentType: type.image as ComponentType }],\n });\n });\n\n private comment = this.RULE('comment', () => {\n this.CONSUME(lexer.Comment, { LABEL: 'text' });\n });\n\n public schema = this.RULE('schema', () => {\n this.MANY(() => {\n this.OR([\n { ALT: () => this.SUBRULE(this.comment, { LABEL: 'list' }) },\n { ALT: () => this.SUBRULE(this.component, { LABEL: 'list' }) },\n { ALT: () => this.SUBRULE(this.break, { LABEL: 'list' }) },\n { ALT: () => this.CONSUME(lexer.LineBreak) },\n ]);\n });\n });\n}\n\nexport const defaultParser = new PrismaParser(getConfig().parser);\n","import { CstNode, IToken } from '@chevrotain/types';\nimport * as Types from './getSchema';\n\nimport { appendLocationData, isToken } from './schemaUtils';\nimport { PrismaParser, defaultParser } from './parser';\nimport { ICstVisitor } from 'chevrotain';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\ntype Class<T> = new (...args: any[]) => T;\nexport type PrismaVisitor = ICstVisitor<any, any>;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport const VisitorClassFactory = (\n parser: PrismaParser\n): Class<PrismaVisitor> => {\n const BasePrismaVisitor = parser.getBaseCstVisitorConstructorWithDefaults();\n return class PrismaVisitor extends BasePrismaVisitor {\n constructor() {\n super();\n this.validateVisitor();\n }\n\n schema(ctx: CstNode & { list: CstNode[] }): Types.Schema {\n const list = ctx.list?.map((item) => this.visit([item])) || [];\n return { type: 'schema', list };\n }\n\n component(\n ctx: CstNode & {\n type: [IToken];\n componentName: [IToken];\n block: [CstNode];\n }\n ): Types.Block {\n const [type] = ctx.type;\n const [name] = ctx.componentName;\n const list = this.visit(ctx.block);\n\n const data = (() => {\n switch (type.image) {\n case 'datasource':\n return {\n type: 'datasource',\n name: name.image,\n assignments: list,\n } as const satisfies Types.Datasource;\n case 'generator':\n return {\n type: 'generator',\n name: name.image,\n assignments: list,\n } as const satisfies Types.Generator;\n case 'model':\n return {\n type: 'model',\n name: name.image,\n properties: list,\n } as const satisfies Types.Model;\n case 'view':\n return {\n type: 'view',\n name: name.image,\n properties: list,\n } as const satisfies Types.View;\n case 'enum':\n return {\n type: 'enum',\n name: name.image,\n enumerators: list,\n } as const satisfies Types.Enum;\n case 'type':\n return {\n type: 'type',\n name: name.image,\n properties: list,\n } as const satisfies Types.Type;\n default:\n throw new Error(`Unexpected block type: ${type}`);\n }\n })();\n\n return this.maybeAppendLocationData(data, type, name);\n }\n\n break(): Types.Break {\n return { type: 'break' };\n }\n\n comment(ctx: CstNode & { text: [IToken] }): Types.Comment {\n const [comment] = ctx.text;\n const data = {\n type: 'comment',\n text: comment.image,\n } as const satisfies Types.Comment;\n return this.maybeAppendLocationData(data, comment);\n }\n\n block(ctx: CstNode & { list: CstNode[] }): BlockList {\n return ctx.list?.map((item) => this.visit([item]));\n }\n\n assignment(\n ctx: CstNode & { assignmentName: [IToken]; assignmentValue: [CstNode] }\n ): Types.Assignment {\n const value = this.visit(ctx.assignmentValue);\n const [key] = ctx.assignmentName;\n const data = {\n type: 'assignment',\n key: key.image,\n value,\n } as const satisfies Types.Assignment;\n return this.maybeAppendLocationData(data, key);\n }\n\n field(\n ctx: CstNode & {\n fieldName: [IToken];\n fieldType: [CstNode];\n array: [IToken];\n optional: [IToken];\n attributeList: CstNode[];\n comment: [IToken];\n }\n ): Types.Field {\n const fieldType = this.visit(ctx.fieldType);\n const [name] = ctx.fieldName;\n const attributes = ctx.attributeList?.map((item) => this.visit([item]));\n const comment = ctx.comment?.[0]?.image;\n const data = {\n type: 'field',\n name: name.image,\n fieldType,\n array: ctx.array != null,\n optional: ctx.optional != null,\n attributes,\n comment,\n } as const satisfies Types.Field;\n\n return this.maybeAppendLocationData(\n data,\n name,\n ctx.optional?.[0],\n ctx.array?.[0]\n );\n }\n\n fieldAttribute(\n ctx: CstNode & {\n fieldAttribute: [IToken];\n groupName: [IToken];\n attributeName: [IToken];\n attributeArg: CstNode[];\n }\n ): Types.Attr {\n const [name] = ctx.attributeName;\n const [group] = ctx.groupName || [{}];\n const args = ctx.attributeArg?.map((attr) => this.visit(attr));\n const data = {\n type: 'attribute',\n name: name.image,\n kind: 'field',\n group: group.image,\n args,\n } as const satisfies Types.Attr;\n return this.maybeAppendLocationData(\n data,\n name,\n ...ctx.fieldAttribute,\n group\n );\n }\n\n blockAttribute(\n ctx: CstNode & {\n blockAttribute: [IToken];\n groupName: [IToken];\n attributeName: [IToken];\n attributeArg: CstNode[];\n }\n ): Types.Attr | null {\n const [name] = ctx.attributeName;\n const [group] = ctx.groupName || [{}];\n const args = ctx.attributeArg?.map((attr) => this.visit(attr));\n const data = {\n type: 'attribute',\n name: name.image,\n kind: 'object',\n group: group.image,\n args,\n } as const satisfies Types.Attr;\n\n return this.maybeAppendLocationData(\n data,\n name,\n ...ctx.blockAttribute,\n group\n );\n }\n\n attributeArg(ctx: CstNode & { value: [CstNode] }): Types.AttributeArgument {\n const value = this.visit(ctx.value);\n return { type: 'attributeArgument', value };\n }\n\n func(\n ctx: CstNode & {\n funcName: [IToken];\n value: CstNode[];\n keyedArg: CstNode[];\n }\n ): Types.Func {\n const [name] = ctx.funcName;\n const params = ctx.value?.map((item) => this.visit([item]));\n const keyedParams = ctx.keyedArg?.map((item) => this.visit([item]));\n const pars = (params || keyedParams) && [\n ...(params ?? []),\n ...(keyedParams ?? []),\n ];\n const data = {\n type: 'function',\n name: name.image,\n params: pars,\n } as const satisfies Types.Func;\n return this.maybeAppendLocationData(data, name);\n }\n\n array(ctx: CstNode & { value: CstNode[] }): Types.RelationArray {\n const args = ctx.value?.map((item) => this.visit([item]));\n return { type: 'array', args };\n }\n\n keyedArg(\n ctx: CstNode & { keyName: [IToken]; value: [CstNode] }\n ): Types.KeyValue {\n const [key] = ctx.keyName;\n const value = this.visit(ctx.value);\n const data = {\n type: 'keyValue',\n key: key.image,\n value,\n } as const satisfies Types.KeyValue;\n return this.maybeAppendLocationData(data, key);\n }\n\n value(ctx: CstNode & { value: [IToken] | [CstNode] }): Types.Value {\n if (isToken(ctx.value)) {\n const [{ image }] = ctx.value;\n return image;\n }\n return this.visit(ctx.value);\n }\n\n enum(\n ctx: CstNode & {\n enumName: [IToken];\n attributeList: CstNode[];\n comment: [IToken];\n }\n ): Types.Enumerator {\n const [name] = ctx.enumName;\n const attributes = ctx.attributeList?.map((item) => this.visit([item]));\n const comment = ctx.comment?.[0]?.image;\n const data = {\n type: 'enumerator',\n name: name.image,\n attributes,\n comment,\n } as const satisfies Types.Enumerator;\n return this.maybeAppendLocationData(data, name);\n }\n\n maybeAppendLocationData<T extends Record<string, unknown>>(\n data: T,\n ...tokens: IToken[]\n ): T {\n if (parser.config.nodeLocationTracking === 'none') return data;\n return appendLocationData(data, ...tokens);\n }\n };\n};\n\ntype BlockList = Array<\n | Types.Comment\n | Types.Property\n | Types.Attribute\n | Types.Field\n | Types.Enum\n | Types.Assignment\n | Types.Break\n>;\nexport const DefaultVisitorClass = VisitorClassFactory(defaultParser);\nexport const defaultVisitor = new DefaultVisitorClass();\n","import { PrismaLexer } from './lexer';\nimport { PrismaVisitor, defaultVisitor } from './visitor';\nimport type { CstNodeLocation } from 'chevrotain';\nimport { PrismaParser, defaultParser } from './parser';\n\n/**\n * Parses a string containing a prisma schema's source code and returns an\n * object that represents the parsed data structure. You can make direct\n * modifications to the objects and arrays nested within, and then produce\n * a new prisma schema using printSchema().\n *\n * @example\n * const schema = getSchema(source)\n * // ... make changes to schema object ...\n * const changedSource = printSchema(schema)\n * */\nexport function getSchema(\n source: string,\n options?: {\n parser: PrismaParser;\n visitor: PrismaVisitor;\n }\n): Schema {\n const lexingResult = PrismaLexer.tokenize(source);\n\n const parser = options?.parser ?? defaultParser;\n parser.input = lexingResult.tokens;\n const cstNode = parser.schema();\n if (parser.errors.length > 0) throw parser.errors[0];\n\n const visitor = options?.visitor ?? defaultVisitor;\n return visitor.visit(cstNode);\n}\n\nexport interface Schema {\n type: 'schema';\n list: Block[];\n}\n\nexport type Block =\n | Model\n | View\n | Datasource\n | Generator\n | Enum\n | Comment\n | Break\n | Type;\n\nexport interface Object {\n type: 'model' | 'view' | 'type';\n name: string;\n properties: Array<Property | Comment | Break>;\n}\n\nexport interface Model extends Object {\n type: 'model';\n location?: CstNodeLocation;\n}\n\nexport interface View extends Object {\n type: 'view';\n location?: CstNodeLocation;\n}\n\nexport interface Type extends Object {\n type: 'type';\n location?: CstNodeLocation;\n}\n\nexport interface Datasource {\n type: 'datasource';\n name: string;\n assignments: Array<Assignment | Comment | Break>;\n location?: CstNodeLocation;\n}\n\nexport interface Generator {\n type: 'generator';\n name: string;\n assignments: Array<Assignment | Comment | Break>;\n location?: CstNodeLocation;\n}\n\nexport interface Enum {\n type: 'enum';\n name: string;\n enumerators: Array<\n Enumerator | Comment | Break | BlockAttribute | GroupedAttribute\n >;\n location?: CstNodeLocation;\n}\n\nexport interface Comment {\n type: 'comment';\n text: string;\n}\n\nexport interface Break {\n type: 'break';\n}\n\nexport type Property = GroupedBlockAttribute | BlockAttribute | Field;\n\nexport interface Assignment {\n type: 'assignment';\n key: string;\n value: Value;\n}\n\nexport interface Enumerator {\n type: 'enumerator';\n name: string;\n value?: Value;\n attributes?: Attribute[];\n comment?: string;\n}\n\nexport interface BlockAttribute {\n type: 'attribute';\n kind: 'object' | 'view' | 'type';\n group?: string;\n name: string;\n args: AttributeArgument[];\n location?: CstNodeLocation;\n}\n\nexport type GroupedBlockAttribute = BlockAttribute & { group: string };\n\nexport interface Field {\n type: 'field';\n name: string;\n fieldType: string | Func;\n array?: boolean;\n optional?: boolean;\n attributes?: Attribute[];\n comment?: string;\n location?: CstNodeLocation;\n}\n\nexport type Attr =\n | Attribute\n | GroupedAttribute\n | BlockAttribute\n | GroupedBlockAttribute;\n\nexport interface Attribute {\n type: 'attribute';\n kind: 'field';\n group?: string;\n name: string;\n args?: AttributeArgument[];\n location?: CstNodeLocation;\n}\n\nexport type GroupedAttribute = Attribute & { group: string };\n\nexport interface AttributeArgument {\n type: 'attributeArgument';\n value: KeyValue | Value | Func;\n}\n\nexport interface KeyValue {\n type: 'keyValue';\n key: string;\n value: Value;\n}\n\nexport interface Func {\n type: 'function';\n name: string;\n params: Value[];\n}\n\nexport interface RelationArray {\n type: 'array';\n args: string[];\n}\n\nexport type Value =\n | string\n | number\n | boolean\n | Func\n | RelationArray\n | Array<Value>;\n","import { Block, Schema } from './getSchema';\n\nconst unsorted = ['break', 'comment'];\nconst defaultSortOrder = [\n 'generator',\n 'datasource',\n 'model',\n 'view',\n 'enum',\n 'break',\n 'comment',\n];\n\n/** Sorts the schema parts, in the given order, and alphabetically for parts of the same type. */\nexport const schemaSorter =\n (\n schema: Schema,\n locales?: string | string[],\n sortOrder: string[] = defaultSortOrder\n ) =>\n (a: Block, b: Block): number => {\n // Preserve the position of comments and line breaks relative to their\n // position in the file, since when a re-sort happens it wouldn't be\n // clear whether a comment should affix to the object above or below it.\n const aUnsorted = unsorted.indexOf(a.type) !== -1;\n const bUnsorted = unsorted.indexOf(b.type) !== -1;\n\n if (aUnsorted !== bUnsorted) {\n return schema.list.indexOf(a) - schema.list.indexOf(b);\n }\n\n if (sortOrder !== defaultSortOrder)\n sortOrder = sortOrder.concat(defaultSortOrder);\n const typeIndex = sortOrder.indexOf(a.type) - sortOrder.indexOf(b.type);\n if (typeIndex !== 0) return typeIndex;\n\n // Resolve ties using the name of object's name.\n if ('name' in a && 'name' in b)\n return a.name.localeCompare(b.name, locales);\n\n // If all else fails, leave objects in their original position.\n return 0;\n };\n","import * as Types from './getSchema';\nimport { EOL } from 'os';\nimport { schemaSorter } from './schemaSorter';\n\ntype Block = 'generator' | 'datasource' | 'model' | 'view' | 'enum' | 'type';\n\nexport interface PrintOptions {\n sort?: boolean;\n locales?: string | string[];\n sortOrder?: Block[];\n}\n\n/**\n * Converts the given schema object into a string representing the prisma\n * schema's source code. Optionally can take options to change the sort order\n * of the schema parts.\n * */\nexport function printSchema(\n schema: Types.Schema,\n options: PrintOptions = {}\n): string {\n const { sort = false, locales = undefined, sortOrder = undefined } = options;\n let blocks = schema.list;\n if (sort) {\n // no point in preserving line breaks when re-sorting\n blocks = schema.list = blocks.filter((block) => block.type !== 'break');\n const sorter = schemaSorter(schema, locales, sortOrder);\n blocks.sort(sorter);\n }\n\n return (\n blocks\n .map(printBlock)\n .filter(Boolean)\n .join(EOL)\n .replace(/(\\r?\\n\\s*){3,}/g, EOL + EOL) + EOL\n );\n}\n\nfunction printBlock(block: Types.Block): string {\n switch (block.type) {\n case 'comment':\n return printComment(block);\n case 'datasource':\n return printDatasource(block);\n case 'enum':\n return printEnum(block);\n case 'generator':\n return printGenerator(block);\n case 'model':\n case 'view':\n case 'type':\n return printObject(block);\n case 'break':\n return printBreak();\n default:\n throw new Error(`Unrecognized block type`);\n }\n}\n\nfunction printComment(comment: Types.Comment) {\n return comment.text;\n}\n\nfunction printBreak() {\n return EOL;\n}\n\nfunction printDatasource(db: Types.Datasource) {\n const children = computeAssignmentFormatting(db.assignments);\n\n return `\ndatasource ${db.name} {\n ${children}\n}`;\n}\n\nfunction printEnum(enumerator: Types.Enum) {\n const list: Array<\n | Types.Comment\n | Types.Break\n | Types.Enumerator\n | Types.BlockAttribute\n | Types.GroupedBlockAttribute\n | Types.GroupedAttribute\n > = enumerator.enumerators;\n const children = list\n .filter(Boolean)\n .map(printEnumerator)\n .join(`${EOL} `)\n .replace(/(\\r?\\n\\s*){3,}/g, `${EOL + EOL} `);\n\n return `\nenum ${enumerator.name} {\n ${children}\n}`;\n}\n\nfunction printEnumerator(\n enumerator:\n | Types.Enumerator\n | Types.Attribute\n | Types.Comment\n | Types.Break\n | Types.BlockAttribute\n | Types.GroupedBlockAttribute\n | Types.GroupedAttribute\n) {\n switch (enumerator.type) {\n case 'enumerator': {\n const attrs = enumerator.attributes\n ? enumerator.attributes.map(printAttribute)\n : [];\n return [enumerator.name, ...attrs, enumerator.comment]\n .filter(Boolean)\n .join(' ');\n }\n case 'attribute':\n return printAttribute(enumerator);\n case 'comment':\n return printComment(enumerator);\n case 'break':\n return printBreak();\n default:\n throw new Error(`Unexpected enumerator type`);\n }\n}\n\nfunction printGenerator(generator: Types.Generator) {\n const children = computeAssignmentFormatting(generator.assignments);\n\n return `\ngenerator ${generator.name} {\n ${children}\n}`;\n}\n\nfunction printObject(object: Types.Object) {\n const props = [...object.properties];\n\n // If block attributes are declared in the middle of the block, move them to\n // the bottom of the list.\n let blockAttributeMoved = false;\n props.sort((a, b) => {\n if (\n a.type === 'attribute' &&\n a.kind === 'object' &&\n (b.type !== 'attribute' ||\n (b.type === 'attribute' && b.kind !== 'object'))\n ) {\n blockAttributeMoved = true;\n return 1;\n }\n\n if (\n b.type === 'attribute' &&\n b.kind === 'object' &&\n (a.type !== 'attribute' ||\n (a.type === 'attribute' && a.kind !== 'object'))\n ) {\n blockAttributeMoved = true;\n return -1;\n }\n\n return 0;\n });\n\n // Insert a break between the block attributes and the file if the block\n // attributes are too close to the model's fields\n const attrIndex = props.findIndex(\n (item) => item.type === 'attribute' && item.kind === 'object'\n );\n\n const needsSpace = !['break', 'comment'].includes(props[attrIndex - 1]?.type);\n if (blockAttributeMoved && needsSpace) {\n props.splice(attrIndex, 0, { type: 'break' });\n }\n\n const children = computePropertyFormatting(props);\n\n return `\n${object.type} ${object.name} {\n ${children}\n}`;\n}\n\nfunction printAssignment(\n node: Types.Assignment | Types.Comment | Types.Break,\n keyLength = 0\n) {\n switch (node.type) {\n case 'comment':\n return printComment(node);\n case 'break':\n return printBreak();\n case 'assignment':\n return `${node.key.padEnd(keyLength)} = ${printValue(node.value)}`;\n default:\n throw new Error(`Unexpected assignment type`);\n }\n}\n\nfunction printProperty(\n node: Types.Property | Types.Comment | Types.Break,\n nameLength = 0,\n typeLength = 0\n) {\n switch (node.type) {\n case 'attribute':\n return printAttribute(node);\n case 'field':\n return printField(node, nameLength, typeLength);\n case 'comment':\n return printComment(node);\n case 'break':\n return printBreak();\n default:\n throw new Error(`Unrecognized property type`);\n }\n}\n\nfunction printAttribute(attribute: Types.Attribute | Types.BlockAttribute) {\n const args =\n attribute.args && attribute.args.length > 0\n ? `(${attribute.args.map(printAttributeArg).filter(Boolean).join(', ')})`\n : '';\n\n const name = [attribute.name];\n if (attribute.group) name.unshift(attribute.group);\n\n return `${attribute.kind === 'field' ? '@' : '@@'}${name.join('.')}${args}`;\n}\n\nfunction printAttributeArg(arg: Types.AttributeArgument) {\n return printValue(arg.value);\n}\n\nfunction printField(field: Types.Field, nameLength = 0, typeLength = 0) {\n const name = field.name.padEnd(nameLength);\n const fieldType = printFieldType(field).padEnd(typeLength);\n const attrs = field.attributes ? field.attributes.map(printAttribute) : [];\n const comment = field.comment;\n return (\n [name, fieldType, ...attrs]\n .filter(Boolean)\n .join(' ')\n // comments ignore indents\n .trim() + (comment ? ` ${comment}` : '')\n );\n}\n\nfunction printFieldType(field: Types.Field) {\n const suffix = field.array ? '[]' : field.optional ? '?' : '';\n\n if (typeof field.fieldType === 'object') {\n switch (field.fieldType.type) {\n case 'function': {\n return `${printFunction(field.fieldType)}${suffix}`;\n }\n default:\n throw new Error(`Unexpected field type`);\n }\n }\n\n return `${field.fieldType}${suffix}`;\n}\n\nfunction printFunction(func: Types.Func) {\n const params = func.params ? func.params.map(printValue) : '';\n return `${func.name}(${params})`;\n}\n\nfunction printValue(value: Types.KeyValue | Types.Value): string {\n switch (typeof value) {\n case 'object': {\n if ('type' in value) {\n switch (value.type) {\n case 'keyValue':\n return `${value.key}: ${printValue(value.value)}`;\n case 'function':\n return printFunction(value);\n case 'array':\n return `[${\n value.args != null ? value.args.map(printValue).join(', ') : ''\n }]`;\n default:\n throw new Error(`Unexpected value type`);\n }\n }\n\n throw new Error(`Unexpected object value`);\n }\n default:\n return String(value);\n }\n}\n\nfunction computeAssignmentFormatting(\n list: Array<Types.Comment | Types.Break | Types.Assignment>\n) {\n let pos = 0;\n const listBlocks = list.reduce<Array<typeof list>>(\n (memo, current, index, arr) => {\n if (current.type === 'break') return memo;\n if (index > 0 && arr[index - 1].type === 'break') memo[++pos] = [];\n memo[pos].push(current);\n return memo;\n },\n [[]]\n );\n\n const keyLengths = listBlocks.map((lists) =>\n lists.reduce(\n (max, current) =>\n Math.max(\n max,\n // perhaps someone more typescript-savy than I am can fix this\n current.type === 'assignment' ? current.key.length : 0\n ),\n 0\n )\n );\n\n return list\n .map((item, index, arr) => {\n if (index > 0 && item.type !== 'break' && arr[index - 1].type === 'break')\n keyLengths.shift();\n return printAssignment(item, keyLengths[0]);\n })\n .filter(Boolean)\n .join(`${EOL} `)\n .replace(/(\\r?\\n\\s*){3,}/g, `${EOL + EOL} `);\n}\n\nfunction computePropertyFormatting(\n list: Array<Types.Break | Types.Comment | Types.Property>\n) {\n let pos = 0;\n const listBlocks = list.reduce<Array<typeof list>>(\n (memo, current, index, arr) => {\n if (current.type === 'break') return memo;\n if (index > 0 && arr[index - 1].type === 'break') memo[++pos] = [];\n memo[pos].push(current);\n return memo;\n },\n [[]]\n );\n\n const nameLengths = listBlocks.map((lists) =>\n lists.reduce(\n (max, current) =>\n Math.max(\n max,\n // perhaps someone more typescript-savy than I am can fix this\n current.type === 'field' ? current.name.length : 0\n ),\n 0\n )\n );\n\n const typeLengths = listBlocks.map((lists) =>\n lists.reduce(\n (max, current) =>\n Math.max(\n max,\n // perhaps someone more typescript-savy than I am can fix this\n current.type === 'field' ? printFieldType(current).length : 0\n ),\n 0\n )\n );\n\n return list\n .map((prop, index, arr) => {\n if (\n index > 0 &&\n prop.type !== 'break' &&\n arr[index - 1].type === 'break'\n ) {\n nameLengths.shift();\n typeLengths.shift();\n }\n\n return printProperty(prop, nameLengths[0], typeLengths[0]);\n })\n .filter(Boolean)\n .join(`${EOL} `)\n .replace(/(\\r?\\n\\s*){3,}/g, `${EOL + EOL} `);\n}\n","import type * as schema from './getSchema';\n\nexport type ByTypeSourceObject =\n | schema.Block\n | schema.Enumerator\n | schema.Field\n | schema.Property\n | schema.Attribute\n | schema.Assignment;\n\nexport type ByTypeMatchObject = Exclude<\n ByTypeSourceObject,\n schema.Comment | schema.Break\n>;\nexport type ByTypeMatch = ByTypeMatchObject['type'];\nexport type ByTypeOptions = { name?: string | RegExp };\nexport type FindByBlock<Match> = Extract<ByTypeMatchObject, { type: Match }>;\n\nexport const findByType = <const Match extends ByTypeMatch>(\n list: ByTypeSourceObject[],\n typeToMatch: Match,\n options: ByTypeOptions = {}\n): FindByBlock<Match> | null => {\n const [match, unexpected] = list.filter(findBy(typeToMatch, options));\n\n if (!match) return null;\n\n if (unexpected)\n throw new Error(`Found multiple blocks with [type=${typeToMatch}]`);\n\n return match;\n};\n\nexport const findAllByType = <const Match extends ByTypeMatch>(\n list: ByTypeSourceObject[],\n typeToMatch: Match,\n options: ByTypeOptions = {}\n): Array<FindByBlock<Match>> => {\n return list.filter(findBy(typeToMatch, options));\n};\n\ntype NameOf<Match extends ByTypeMatch> = Extract<\n Match,\n Match extends 'assignment' ? 'key' : 'name'\n>;\n\nconst findBy =\n <Match extends ByTypeMatch, MatchName extends NameOf<Match>>(\n typeToMatch: Match,\n { name }: ByTypeOptions = {}\n ) =>\n (block: ByTypeSourceObject): block is FindByBlock<Match> => {\n if (name != null) {\n const nameAttribute = (\n typeToMatch === 'assignment' ? 'key' : 'name'\n ) as MatchName;\n if (!(nameAttribute in block)) return false;\n const nameMatches =\n typeof name === 'string'\n ? block[nameAttribute] === name\n : name.test(block[nameAttribute]);\n if (!nameMatches) return false;\n }\n\n return block.type === typeToMatch;\n };\n","import * as schema from './getSchema';\nimport {\n isOneOfSchemaObjects,\n isSchemaField,\n isSchemaObject,\n} from './schemaUtils';\nimport { PrintOptions, printSchema } from './printSchema';\nimport * as finder from './finder';\n\n/** Returns the function type Original with its return type changed to NewReturn. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ReplaceReturnType<Original extends (...args: any) => any, NewReturn> = (\n ...a: Parameters<Original>\n) => NewReturn;\n\n/**\n * Methods with return values that do not propagate the builder should not have\n * their return value modified by the type replacement system below\n * */\ntype ExtractKeys = 'getSchema' | 'getSubject' | 'getParent' | 'print';\n\n/** These keys preserve the return value context that they were given */\ntype NeutralKeys =\n | 'break'\n | 'comment'\n | 'attribute'\n | 'enumerator'\n | 'then'\n | 'findByType'\n | 'findAllByType';\n\n/** Keys allowed when you call .datasource() or .generator() */\ntype DatasourceOrGeneratorKeys = 'assignment';\n\n/** Keys allowed when you call .enum(\"name\") */\ntype EnumKeys = 'enumerator';\n\n/** Keys allowed when you call .field(\"name\") */\ntype FieldKeys = 'attribute' | 'removeAttribute';\n\n/** Keys allowed when you call .model(\"name\") */\ntype BlockKeys = 'blockAttribute' | 'field' | 'removeField';\n\ntype PrismaSchemaFinderOptions = finder.ByTypeOptions & {\n within?: finder.ByTypeSourceObject[];\n};\n\n/**\n * Utility type for making the PrismaSchemaBuilder below readable:\n * Removes methods from the builder that are prohibited based on the context\n * the builder is in. For example, you can add fields to a model, but you can't\n * add fields to an enum or a datasource.\n */\ntype PrismaSchemaSubset<\n Universe extends keyof ConcretePrismaSchemaBuilder,\n Method\n> = ReplaceReturnType<\n ConcretePrismaSchemaBuilder[Universe],\n PrismaSchemaBuilder<Exclude<keyof ConcretePrismaSchemaBuilder, Method>>\n>;\n\n/**\n * The brain of this whole operation: depending on the key of the method name\n * we receive, filter the available list of method calls the user can make to\n * prevent them from making invalid calls, such as builder.datasource().field()\n * */\ntype PrismaSchemaBuilder<K extends keyof ConcretePrismaSchemaBuilder> = {\n [U in K]: U extends ExtractKeys\n ? ConcretePrismaSchemaBuilder[U]\n : U extends NeutralKeys\n ? ConcretePrismaSchemaBuilder[U] //ReplaceReturnType<ConcretePrismaSchemaBuilder[U], PrismaSchemaBuilder<K>>\n : U extends 'datasource'\n ? PrismaSchemaSubset<U, 'datasource' | EnumKeys | FieldKeys | BlockKeys>\n : U extends 'generator'\n ? PrismaSchemaSubset<U, EnumKeys | FieldKeys | BlockKeys>\n : U extends 'model'\n ? PrismaSchemaSubset<U, DatasourceOrGeneratorKeys | EnumKeys | FieldKeys>\n : U extends 'view'\n ? PrismaSchemaSubset<U, DatasourceOrGeneratorKeys | EnumKeys | FieldKeys>\n : U extends 'type'\n ? PrismaSchemaSubset<U, DatasourceOrGeneratorKeys | EnumKeys | FieldKeys>\n : U extends 'field'\n ? PrismaSchemaSubset<U, DatasourceOrGeneratorKeys | EnumKeys>\n : U extends 'removeField'\n ? PrismaSchemaSubset<U, DatasourceOrGeneratorKeys | EnumKeys | FieldKeys>\n : U extends 'enum'\n ? PrismaSchemaSubset<U, DatasourceOrGeneratorKeys | BlockKeys | FieldKeys>\n : U extends 'removeAttribute'\n ? PrismaSchemaSubset<U, DatasourceOrGeneratorKeys | EnumKeys>\n : PrismaSchemaSubset<\n U,\n DatasourceOrGeneratorKeys | EnumKeys | FieldKeys | BlockKeys | 'comment'\n >;\n};\n\ntype Arg =\n | string\n | {\n name: string;\n function?: Arg[];\n };\ntype Parent = schema.Block | undefined;\ntype Subject = schema.Block | schema.Field | schema.Enumerator | undefined;\n\nexport class ConcretePrismaSchemaBuilder {\n private schema: schema.Schema;\n private _subject: Subject;\n private _parent: Parent;\n\n constructor(source = '') {\n this.schema = schema.getSchema(source);\n }\n\n /** Prints the schema out as a source string */\n print(options: PrintOptions = {}): string {\n return printSchema(this.schema, options);\n }\n\n /** Returns the underlying schema object for more advanced use cases. */\n getSchema(): schema.Schema {\n return this.schema;\n }\n\n /** Mutation Methods */\n\n /** Adds or updates a generator block based on the name. */\n generator(name: string, provider = 'prisma-client-js'): this {\n const generator: schema.Generator =\n this.schema.list.reduce<schema.Generator>(\n (memo, block) =>\n block.type === 'generator' && block.name === name ? block : memo,\n {\n type: 'generator',\n name,\n assignments: [\n { type: 'assignment', key: 'provider', value: `\"${provider}\"` },\n ],\n }\n );\n\n if (!this.schema.list.includes(generator)) this.schema.list.push(generator);\n this._subject = generator;\n return this;\n }\n\n /** Removes something from the schema with the given name. */\n drop(name: string): this {\n const index = this.schema.list.findIndex(\n (block) => 'name' in block && block.name === name\n );\n if (index !== -1) this.schema.list.splice(index, 1);\n return this;\n }\n\n /** Sets the datasource for the schema. */\n datasource(provider: string, url: string | { env: string }): this {\n const datasource: schema.Datasource = {\n type: 'datasource',\n name: 'db',\n assignments: [\n {\n type: 'assignment',\n key: 'url',\n value:\n typeof url === 'string'\n ? `\"${url}\"`\n : { type: 'function', name: 'env', params: [`\"${url.env}\"`] },\n },\n { type: 'assignment', key: 'provider', value: provider },\n ],\n };\n const existingIndex = this.schema.list.findIndex(\n (block) => block.type === 'datasource'\n );\n this.schema.list.splice(\n existingIndex,\n existingIndex !== -1 ? 1 : 0,\n datasource\n );\n this._subject = datasource;\n return this;\n }\n\n /** Adds or updates a model based on the name. Can be chained with .field() or .blockAttribute() to add to it. */\n model(name: string): this {\n const model = this.schema.list.reduce<schema.Model>(\n (memo, block) =>\n block.type === 'model' && block.name === name ? block : memo,\n { type: 'model', name, properties: [] }\n );\n if (!this.schema.list.includes(model)) this.schema.list.push(model);\n this._subject = model;\n return this;\n }\n\n /** Adds or updates a view based on the name. Can be chained with .field() or .blockAttribute() to add to it. */\n view(name: string): this {\n const view = this.schema.list.reduce<schema.View>(\n (memo, block) =>\n block.type === 'view' && block.name === name ? block : memo,\n { type: 'view', name, properties: [] }\n );\n if (!this.schema.list.includes(view)) this.schema.list.push(view);\n this._subject = view;\n return this;\n }\n\n /** Adds or updates a type based on the name. Can be chained with .field() or .blockAttribute() to add to it. */\n type(name: string): this {\n const type = this.schema.list.reduce<schema.Type>(\n (memo, block) =>\n block.type === 'type' && block.name === name ? block : memo,\n { type: 'type', name, properties: [] }\n );\n if (!this.schema.list.includes(type)) this.schema.list.push(type);\n this._subject = type;\n return this;\n }\n\n /** Adds or updates an enum based on the name. Can be chained with .enumerator() to add a value to it. */\n enum(name: string, enumeratorNames: string[] = []): this {\n const e = this.schema.list.reduce<schema.Enum>(\n (memo, block) =>\n block.type === 'enum' && block.name === name ? block : memo,\n {\n type: 'enum',\n name,\n enumerators: enumeratorNames.map((name) => ({\n type: 'enumerator',\n name,\n })),\n } satisfies schema.Enum\n );\n if (!this.schema.list.includes(e)) this.schema.list.push(e);\n this._subject = e;\n return this;\n }\n\n /** Add an enum value to the current enum. */\n enumerator(value: string): this {\n const subject = this.getSubject<schema.Enum>();\n if (!subject || !('type' in subject) || subject.type !== 'enum') {\n throw new Error('Subject must be a prisma enum!');\n }\n\n const enumerator = {\n type: 'enumerator',\n name: value,\n } satisfies schema.Enumerator;\n subject.enumerators.push(enumerator);\n this._parent = this._subject as Exclude<\n Subject,\n { type: 'field' | 'enumerator' }\n >;\n this._subject = enumerator;\n return this;\n }\n\n /**\n * Returns the current subject, such as a model, field, or enum.\n * @example\n * builder.getModel('User').field('firstName').getSubject() // the firstName field\n * */\n private getSubject<S extends Subject>(): S {\n return this._subject as S;\n }\n\n /** Returns the parent of the current subject when in a nested context. The parent of a field is its model or view. */\n private getParent<S extends Parent = schema.Object>(): S {\n return this._parent as S;\n }\n\n /**\n * Adds a block-level attribute to the current model.\n * @example\n * builder.model('Project')\n * .blockAttribute(\"map\", \"projects\")\n * .blockAttribute(\"unique\", [\"firstName\", \"lastName\"]) // @@unique([firstName, lastName])\n * */\n blockAttribute(\n name: string,\n args?: string | string[] | Record<string, schema.Value>\n ): this {\n let subject = this.getSubject<schema.Object | schema.Enum>();\n if (subject.type !== 'enum' && !isSchemaObject(subject)) {\n const parent = this.getParent<schema.Object>();\n if (!isOneOfSchemaObjects(parent, ['model', 'view', 'type', 'enum']))\n throw new Error('Subject must be a prisma model, view, or type!');\n\n subject = this._subject = parent;\n }\n\n const attributeArgs = ((): schema.AttributeArgument[] => {\n if (!args) return [] as schema.AttributeArgument[];\n if (typeof args === 'string')\n return [{ type: 'attributeArgument', value: `\"${args}\"` }];\n if (Array.isArray(args))\n return [{ type: 'attributeArgument', value: { type: 'array', args } }];\n return Object.entries(args).map(([key, value]) => ({\n type: 'attributeArgument',\n value: { type: 'keyValue', key, value },\n }));\n })();\n\n const property: schema.BlockAttribute = {\n type: 'attribute',\n kind: 'object',\n name,\n args: attributeArgs,\n };\n\n if (subject.type === 'enum') {\n subject.enumerators.push(property);\n } else {\n subject.properties.push(property);\n }\n return this;\n }\n\n /** Adds an attribute to the current field. */\n attribute<T extends schema.Field>(\n name: string,\n args?: Arg[] | Record<string, string[]>\n ): this {\n const parent = this.getParent();\n const subject = this.getSubject<T>();\n if (!isOneOfSchemaObjects(parent, ['model', 'view', 'type', 'enum'])) {\n throw new Error('Parent must be a prisma model or view!');\n }\n\n if (!isSchemaField(subject)) {\n throw new Error('Subject must be a prisma field or enumerator!');\n }\n\n if (!subject.attributes) subject.attributes = [];\n const attribute = subject.attributes.reduce<schema.Attribute>(\n (memo, attr) =>\n attr.type === 'attribute' &&\n `${attr.group ? `${attr.group}.` : ''}${attr.name}` === name\n ? attr\n : memo,\n {\n type: 'attribute',\n kind: 'field',\n name,\n }\n );\n\n if (Array.isArray(args)) {\n const mapArg = (arg: Arg): schema.Value | schema.Func => {\n return typeof arg === 'string'\n ? arg\n : {\n type: 'function',\n name: arg.name,\n params: arg.function?.map(mapArg) ?? [],\n };\n };\n\n if (args.length > 0)\n attribute.args = args.map((arg) => ({\n type: 'attributeArgument',\n value: mapArg(arg),\n }));\n } else if (typeof args === 'object') {\n attribute.args = Object.entries(args).map(([key, value]) => ({\n type: 'attributeArgument',\n value: { type: 'keyValue', key, value: { type: 'array', args: value } },\n }));\n }\n\n if (!subject.attributes.includes(attribute))\n subject.attributes.push(attribute);\n\n return this;\n }\n\n /** Remove an attribute from the current field */\n removeAttribute<T extends schema.Field>(name: string): this {\n const parent = this.getParent();\n const subject = this.getSubject<T>();\n if (!isSchemaObject(parent)) {\n throw new Error('Parent must be a prisma model or view!');\n }\n\n if (!isSchemaField(subject)) {\n throw new Error('Subject must be a prisma field!');\n }\n\n if (!subject.attributes) subject.attributes = [];\n subject.attributes = subject.attributes.filter(\n (attr) => !(attr.type === 'attribute' && attr.name === name)\n );\n\n return this;\n }\n\n /** Add an assignment to a generator or datasource */\n assignment<T extends schema.Generator | schema.Datasource>(\n key: string,\n value: string\n ): this {\n const subject = this.getSubject<T>();\n if (\n !subject ||\n !('type' in subject) ||\n !['generator', 'datasource'].includes(subject.type)\n )\n throw new Error('Subject must be a prisma generator or datasource!');\n\n function tap<T>(subject: T, callback: (s: T) => void) {\n callback(subject);\n return subject;\n }\n\n const assignment = subject.assignments.reduce<schema.Assignment>(\n (memo, assignment) =>\n assignment.type === 'assignment' && assignment.key === key\n ? tap(assignment, (a) => {\n a.value = `\"${value}\"`;\n })\n : memo,\n {\n type: 'assignment',\n key,\n value: `\"${value}\"`,\n }\n );\n\n if (!subject.assignments.includes(assignment))\n subject.assignments.push(assignment);\n\n return this;\n }\n\n /** Finder Methods */\n\n /**\n * Queries the block list for the given block type. Returns `null` if none\n * match. Throws an error if more than one match is found.\n * */\n findByType<const Match extends finder.ByTypeMatch>(\n typeToMatch: Match,\n { within = this.schema.list, ...options }: PrismaSchemaFinderOptions\n ): finder.FindByBlock<Match> | null {\n return finder.findByType(within, typeToMatch, options);\n }\n\n /**\n * Queries the block list for the given block type. Returns an array of all\n * matching objects, and an empty array (`[]`) if none match.\n * */\n findAllByType<const Match extends finder.ByTypeMatch>(\n typeToMatch: Match,\n { within = this.schema.list, ...options }: PrismaSchemaFinderOptions\n ): Array<finder.FindByBlock<Match> | null> {\n return finder.findAllByType(within, typeToMatch, options);\n }\n\n /** Internal Utilities */\n\n private blockInsert(statement: schema.Break | schema.Comment): this {\n let subject = this.getSubject<schema.Block>();\n const allowed = [\n 'datasource',\n 'enum',\n 'generator',\n 'model',\n 'view',\n 'type',\n ];\n if (!subject || !('type' in subject) || !allowed.includes(subject.type)) {\n const parent = this.getParent<schema.Block>();\n if (!parent || !('type' in parent) || !allowed.includes(parent.type)) {\n throw new Error('Subject must be a prisma block!');\n }\n\n subject = this._subject = parent;\n }\n\n switch (subject.type) {\n case 'datasource': {\n subject.assignments.push(statement);\n break;\n }\n case 'enum': {\n subject.enumerators.push(statement);\n break;\n }\n case 'generator': {\n subject.assignments.push(statement);\n break;\n }\n case 'model': {\n subject.properties.push(statement);\n break;\n }\n }\n return this;\n }\n\n /** Add a line break */\n break(): this {\n const lineBreak: schema.Break = { type: 'break' };\n return this.blockInsert(lineBreak);\n }\n\n /**\n * Add a comment. Regular comments start with // and do not appear in the\n * prisma AST. Node comments start with /// and will appear in the AST,\n * affixed to the node that follows the comment.\n * */\n comment(text: string, node = false): this {\n const comment: schema.Comment = {\n type: 'comment',\n text: `//${node ? '/' : ''} ${text}`,\n };\n return this.blockInsert(comment);\n }\n\n /**\n * Add a comment to the schema. Regular comments start with // and do not appear in the\n * prisma AST. Node comments start with /// and will appear in the AST,\n * affixed to the node that follows the comment.\n * */\n schemaComment(text: string, node = false): this {\n const comment: schema.Comment = {\n type: 'comment',\n text: `//${node ? '/' : ''} ${text}`,\n };\n this.schema.list.push(comment);\n return this;\n }\n\n /**\n * Adds or updates a field in the current model. The field can be customized\n * further with one or more .attribute() calls.\n * */\n field(name: string, fieldType: string | schema.Func = 'String'): this {\n let subject = this.getSubject<schema.Object>();\n if (!isSchemaObject(subject)) {\n const parent = this.getParent<schema.Object>();\n if (!isSchemaObject(parent))\n throw new Error(\n 'Subject must be a prisma model or view or composite type!'\n );\n\n subject = this._subject = parent;\n }\n\n const field = subject.properties.reduce<schema.Field>(\n (memo, block) =>\n block.type === 'field' && block.name === name ? block : memo,\n {\n type: 'field',\n name,\n fieldType,\n }\n );\n\n if (!subject.properties.includes(field)) subject.properties.push(field);\n this._parent = subject;\n this._subject = field;\n return this;\n }\n\n /** Drop a field from the current model or view or composite type. */\n removeField(name: string): this {\n let subject = this.getSubject<schema.Object>();\n if (!isSchemaObject(subject)) {\n const parent = this.getParent<schema.Object>();\n if (!isSchemaObject(parent))\n throw new Error(\n 'Subject must be a prisma model or view or composite type!'\n );\n\n subject = this._subject = parent;\n }\n\n subject.properties = subject.properties.filter(\n (field) => !(field.type === 'field' && field.name === name)\n );\n return this;\n }\n\n /**\n * Returns the current subject, allowing for more advanced ways of\n * manipulating the schema.\n * */\n then<R extends NonNullable<Subject>>(\n callback: (subject: R) => unknown\n ): this {\n callback(this._subject as R);\n return this;\n }\n}\n\nexport function createPrismaSchemaBuilder(\n source?: string\n): PrismaSchemaBuilder<\n Exclude<\n keyof ConcretePrismaSchemaBuilder,\n DatasourceOrGeneratorKeys | EnumKeys | FieldKeys | BlockKeys\n >\n> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new ConcretePrismaSchemaBuilder(source) as any;\n}\n","import { PrintOptions } from './printSchema';\nimport { createPrismaSchemaBuilder } from './PrismaSchemaBuilder';\n\ntype Options = PrintOptions;\n\n/**\n * Receives a prisma schema in the form of a string containing source code, and\n * a callback builder function. Use the builder to modify your schema as\n * desired. Returns the schema as a string with the modifications applied.\n * */\nexport function produceSchema(\n source: string,\n producer: (builder: ReturnType<typeof createPrismaSchemaBuilder>) => void,\n options: Options = {}\n): string {\n const builder = createPrismaSchemaBuilder(source);\n producer(builder);\n return builder.print(options);\n}\n","/**\n * Siteping database models — single source of truth.\n *\n * Used by:\n * - CLI to generate Prisma schema (via prisma-ast)\n * - Adapter for Zod validation\n * - Type exports\n *\n * This is a TS representation, NOT a .prisma file.\n * The CLI generates the actual Prisma schema from this definition.\n */\n\nexport interface FieldDef {\n type: string;\n default?: string;\n optional?: boolean;\n relation?: {\n kind: \"1-to-many\" | \"many-to-1\";\n model: string;\n fields?: string[];\n references?: string[];\n onDelete?: string;\n };\n isId?: boolean;\n isUnique?: boolean;\n}\n\nexport interface IndexDef {\n fields: string[];\n}\n\ninterface ModelDef {\n fields: Record<string, FieldDef>;\n indexes?: IndexDef[];\n}\n\nexport const SITEPING_MODELS: Record<string, ModelDef> = {\n SitepingFeedback: {\n fields: {\n id: { type: \"String\", isId: true, default: \"cuid()\" },\n projectName: { type: \"String\" },\n type: { type: \"String\" },\n message: { type: \"String\" },\n status: { type: \"String\", default: '\"open\"' },\n url: { type: \"String\" },\n viewport: { type: \"String\" },\n userAgent: { type: \"String\" },\n authorName: { type: \"String\" },\n authorEmail: { type: \"String\" },\n clientId: { type: \"String\", isUnique: true },\n resolvedAt: { type: \"DateTime\", optional: true },\n createdAt: { type: \"DateTime\", default: \"now()\" },\n annotations: {\n type: \"SitepingAnnotation\",\n relation: { kind: \"1-to-many\", model: \"SitepingAnnotation\" },\n },\n },\n indexes: [{ fields: [\"projectName\"] }],\n },\n SitepingAnnotation: {\n fields: {\n id: { type: \"String\", isId: true, default: \"cuid()\" },\n feedbackId: { type: \"String\" },\n feedback: {\n type: \"SitepingFeedback\",\n relation: {\n kind: \"many-to-1\",\n model: \"SitepingFeedback\",\n fields: [\"feedbackId\"],\n references: [\"id\"],\n onDelete: \"Cascade\",\n },\n },\n cssSelector: { type: \"String\" },\n xpath: { type: \"String\" },\n textSnippet: { type: \"String\" },\n elementTag: { type: \"String\" },\n elementId: { type: \"String\", optional: true },\n textPrefix: { type: \"String\" },\n textSuffix: { type: \"String\" },\n fingerprint: { type: \"String\" },\n neighborText: { type: \"String\" },\n xPct: { type: \"Float\" },\n yPct: { type: \"Float\" },\n wPct: { type: \"Float\" },\n hPct: { type: \"Float\" },\n scrollX: { type: \"Float\" },\n scrollY: { type: \"Float\" },\n viewportW: { type: \"Int\" },\n viewportH: { type: \"Int\" },\n devicePixelRatio: { type: \"Float\", default: \"1\" },\n createdAt: { type: \"DateTime\", default: \"now()\" },\n },\n indexes: [{ fields: [\"feedbackId\"] }],\n },\n};\n","import { existsSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\n\nconst ROUTE_TEMPLATE = `import { createSitepingHandler } from \"@siteping/adapter-prisma\";\nimport { prisma } from \"@/lib/prisma\";\n\nexport const { GET, POST, PATCH, DELETE } = createSitepingHandler({ prisma });\n`;\n\n/**\n * Generate the Next.js App Router API route file.\n *\n * Creates `app/api/siteping/route.ts` with the handler setup.\n * Skips if the file already exists.\n */\nexport function generateRoute(basePath: string = process.cwd()): { created: boolean; path: string } {\n // Detect app directory\n const appDir = existsSync(join(basePath, \"src\", \"app\")) ? join(basePath, \"src\", \"app\") : join(basePath, \"app\");\n\n if (!existsSync(appDir)) {\n throw new Error(\"Impossible de trouver le dossier app/. \\u00cates-vous dans un projet Next.js App Router ?\");\n }\n\n const routePath = join(appDir, \"api\", \"siteping\", \"route.ts\");\n\n if (existsSync(routePath)) {\n return { created: false, path: routePath };\n }\n\n mkdirSync(dirname(routePath), { recursive: true });\n writeFileSync(routePath, ROUTE_TEMPLATE, \"utf-8\");\n\n return { created: true, path: routePath };\n}\n","import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\n/**\n * Locate the Prisma schema file by checking common paths.\n * Returns the first match or null if none found.\n */\nexport function findPrismaSchema(cwd: string): string | null {\n const candidates = [\n join(cwd, \"prisma\", \"schema.prisma\"),\n join(cwd, \"schema.prisma\"),\n join(cwd, \"prisma\", \"schema\", \"schema.prisma\"),\n ];\n return candidates.find((p) => existsSync(p)) ?? null;\n}\n","import * as p from \"@clack/prompts\";\nimport { syncPrismaModels } from \"../generators/prisma.js\";\nimport { generateRoute } from \"../generators/route.js\";\nimport { findPrismaSchema } from \"../utils/find-schema.js\";\n\nexport async function initCommand(): Promise<void> {\n p.intro(\"siteping — Configuration\");\n\n const cwd = process.cwd();\n\n // Step 1: Prisma schema\n const schemaPath = findPrismaSchema(cwd);\n\n if (schemaPath) {\n p.log.info(`Schema Prisma trouvé : ${schemaPath}`);\n\n const shouldSync = await p.confirm({\n message: \"Synchroniser les modèles Siteping dans le schema Prisma ?\",\n });\n\n if (p.isCancel(shouldSync)) {\n p.cancel(\"Annulé.\");\n process.exit(0);\n }\n\n if (shouldSync) {\n try {\n const { addedModels, changes } = syncPrismaModels(schemaPath);\n\n if (addedModels.length > 0) {\n p.log.success(`Modèles créés : ${addedModels.join(\", \")}`);\n }\n\n for (const change of changes) {\n if (change.action === \"added\") {\n p.log.success(`${change.model}.${change.field} — ajouté (${change.detail})`);\n } else {\n p.log.success(`${change.model}.${change.field} — mis à jour (${change.detail})`);\n }\n }\n\n if (addedModels.length === 0 && changes.length === 0) {\n p.log.info(\"Le schema est déjà à jour.\");\n }\n } catch (error) {\n p.log.error(`Erreur : ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n } else {\n p.log.warn(\"Aucun fichier schema.prisma trouvé. Vous devrez ajouter les modèles manuellement.\");\n p.log.info(\"Consultez la documentation : https://github.com/NeosiaNexus/siteping#prisma-schema-1\");\n }\n\n // Step 2: API route\n const shouldRoute = await p.confirm({\n message: \"Générer la route API Next.js App Router ?\",\n });\n\n if (p.isCancel(shouldRoute)) {\n p.cancel(\"Annulé.\");\n process.exit(0);\n }\n\n if (shouldRoute) {\n try {\n const { created, path } = generateRoute(cwd);\n if (created) {\n p.log.success(`Route créée : ${path}`);\n } else {\n p.log.info(`La route existe déjà : ${path}`);\n }\n } catch (error) {\n p.log.error(`Erreur : ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n // Step 3: Next steps\n p.note(\n [\n \"1. Exécutez : npx prisma db push\",\n \"2. Ajoutez le widget dans votre layout :\",\n \"\",\n ' import { initSiteping } from \"@siteping/widget\"',\n \"\",\n \" initSiteping({\",\n ' endpoint: \"/api/siteping\",',\n ' projectName: \"mon-projet\",',\n \" })\",\n ].join(\"\\n\"),\n \"Prochaines étapes\",\n );\n\n p.outro(\"Configuration terminée !\");\n}\n","import { type Dirent, existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { join, relative } from \"node:path\";\nimport * as p from \"@clack/prompts\";\nimport type { Field, Model } from \"@mrleebo/prisma-ast\";\nimport { getSchema } from \"@mrleebo/prisma-ast\";\nimport { SITEPING_MODELS } from \"@siteping/core\";\nimport { findPrismaSchema } from \"../utils/find-schema.js\";\n\n// ── Helpers ────────────────────────────────────────────────────────────\n\nfunction findApiRoute(cwd: string): string | null {\n const candidates = [\n join(cwd, \"app\", \"api\", \"siteping\", \"route.ts\"),\n join(cwd, \"src\", \"app\", \"api\", \"siteping\", \"route.ts\"),\n ];\n return candidates.find((c) => existsSync(c)) ?? null;\n}\n\nfunction readPackageJson(cwd: string): Record<string, unknown> | null {\n const pkgPath = join(cwd, \"package.json\");\n if (!existsSync(pkgPath)) return null;\n try {\n return JSON.parse(readFileSync(pkgPath, \"utf-8\")) as Record<string, unknown>;\n } catch {\n return null;\n }\n}\n\n/** Recursively search source directories for widget usage. */\nfunction findWidgetUsage(cwd: string): string | null {\n const searchDirs = [join(cwd, \"src\"), join(cwd, \"app\"), join(cwd, \"pages\")];\n const extensions = [\".ts\", \".tsx\", \".js\", \".jsx\"];\n const patterns = [\"initSiteping\", \"@siteping/widget\"];\n\n for (const dir of searchDirs) {\n if (!existsSync(dir)) continue;\n const match = searchInDir(dir, extensions, patterns);\n if (match) return match;\n }\n return null;\n}\n\nfunction searchInDir(dir: string, extensions: string[], patterns: string[]): string | null {\n let entries: Dirent[];\n try {\n entries = readdirSync(dir, { withFileTypes: true });\n } catch {\n return null;\n }\n\n for (const entry of entries) {\n const name = entry.name;\n const fullPath = join(dir, name);\n\n if (entry.isDirectory()) {\n if (name === \"node_modules\" || name === \".next\") continue;\n const match = searchInDir(fullPath, extensions, patterns);\n if (match) return match;\n } else if (extensions.some((ext) => name.endsWith(ext))) {\n try {\n const content = readFileSync(fullPath, \"utf-8\");\n if (patterns.some((pat) => content.includes(pat))) return fullPath;\n } catch {\n // skip unreadable files\n }\n }\n }\n return null;\n}\n\n// ── Schema check ───────────────────────────────────────────────────────\n\ninterface SchemaCheckResult {\n found: boolean;\n path: string | null;\n missingModels: string[];\n missingFields: string[];\n outdatedFields: string[];\n}\n\nfunction checkSchema(schemaPath: string | null): SchemaCheckResult {\n if (!schemaPath || !existsSync(schemaPath)) {\n return { found: false, path: null, missingModels: [], missingFields: [], outdatedFields: [] };\n }\n\n const source = readFileSync(schemaPath, \"utf-8\");\n const schema = getSchema(source);\n\n const existingModels = new Map<string, Model>();\n for (const item of schema.list) {\n if (item.type === \"model\") {\n existingModels.set(item.name, item as Model);\n }\n }\n\n const missingModels: string[] = [];\n const missingFields: string[] = [];\n const outdatedFields: string[] = [];\n\n for (const [modelName, modelDef] of Object.entries(SITEPING_MODELS)) {\n const model = existingModels.get(modelName);\n\n if (!model) {\n missingModels.push(modelName);\n continue;\n }\n\n const existingFields = new Map<string, Field>();\n for (const prop of model.properties) {\n if (prop.type === \"field\") {\n existingFields.set((prop as Field).name, prop as Field);\n }\n }\n\n for (const [fieldName, fieldDef] of Object.entries(modelDef.fields)) {\n const existing = existingFields.get(fieldName);\n\n if (!existing) {\n missingFields.push(`${modelName}.${fieldName}`);\n continue;\n }\n\n // Check type match\n const expectedType = fieldDef.relation ? fieldDef.relation.model : fieldDef.type;\n const expectedOptional = fieldDef.optional ?? false;\n const expectedArray = fieldDef.relation?.kind === \"1-to-many\";\n\n const typeMatch = existing.fieldType === expectedType;\n const optionalMatch = (existing.optional ?? false) === expectedOptional;\n const arrayMatch = (existing.array ?? false) === expectedArray;\n\n if (!typeMatch || !optionalMatch || !arrayMatch) {\n outdatedFields.push(`${modelName}.${fieldName}`);\n }\n }\n }\n\n return { found: true, path: schemaPath, missingModels, missingFields, outdatedFields };\n}\n\n// ── Formatting helpers ─────────────────────────────────────────────────\n\nfunction pad(label: string, width: number): string {\n return label + \" \".repeat(Math.max(1, width - label.length));\n}\n\n// ── Command ────────────────────────────────────────────────────────────\n\nexport function statusCommand(options: { schema?: string }): void {\n const cwd = process.cwd();\n\n p.intro(\"siteping — Diagnostic\");\n\n // 1. Prisma schema\n const schemaPath = options.schema ?? findPrismaSchema(cwd);\n const schemaResult = checkSchema(schemaPath);\n\n if (!schemaResult.found) {\n p.log.error(`${pad(\"Prisma schema\", 25)}✗ Non trouvé`);\n } else {\n const issues = [\n ...schemaResult.missingModels.map((m) => `modèle ${m}`),\n ...schemaResult.missingFields,\n ...schemaResult.outdatedFields,\n ];\n\n if (issues.length === 0) {\n p.log.success(`${pad(\"Prisma schema\", 25)}✓ À jour`);\n } else {\n const missingCount = schemaResult.missingModels.length + schemaResult.missingFields.length;\n const outdatedCount = schemaResult.outdatedFields.length;\n const parts: string[] = [];\n if (missingCount > 0)\n parts.push(`${missingCount} champ${missingCount > 1 ? \"s\" : \"\"} manquant${missingCount > 1 ? \"s\" : \"\"}`);\n if (outdatedCount > 0)\n parts.push(`${outdatedCount} champ${outdatedCount > 1 ? \"s\" : \"\"} obsolète${outdatedCount > 1 ? \"s\" : \"\"}`);\n p.log.warn(`${pad(\"Prisma schema\", 25)}⚠ ${parts.join(\", \")} (${issues.join(\", \")})`);\n }\n }\n\n // 2. API route\n const routePath = findApiRoute(cwd);\n\n if (routePath) {\n p.log.success(`${pad(\"Route API\", 25)}✓ ${relative(cwd, routePath)}`);\n } else {\n p.log.error(`${pad(\"Route API\", 25)}✗ Non trouvée`);\n }\n\n // 3. Package in dependencies\n const pkg = readPackageJson(cwd);\n\n if (pkg) {\n const deps = (pkg.dependencies ?? {}) as Record<string, string>;\n const devDeps = (pkg.devDependencies ?? {}) as Record<string, string>;\n const version = deps[\"@siteping/widget\"] ?? devDeps[\"@siteping/widget\"];\n\n if (version) {\n p.log.success(`${pad(\"Package\", 25)}✓ @siteping/widget@${version}`);\n } else {\n p.log.error(`${pad(\"Package\", 25)}✗ @siteping/widget non trouvé dans package.json`);\n }\n } else {\n p.log.error(`${pad(\"Package\", 25)}✗ package.json non trouvé`);\n }\n\n // 4. Widget integration\n const widgetFile = findWidgetUsage(cwd);\n\n if (widgetFile) {\n p.log.success(`${pad(\"Widget intégré\", 25)}✓ trouvé dans ${relative(cwd, widgetFile)}`);\n } else {\n p.log.warn(`${pad(\"Widget intégré\", 25)}⚠ initSiteping non trouvé dans les sources`);\n }\n\n // Outro\n const hasError =\n !schemaResult.found ||\n !routePath ||\n !pkg ||\n (pkg &&\n !(\n (pkg.dependencies as Record<string, string> | undefined)?.[\"@siteping/widget\"] ??\n (pkg.devDependencies as Record<string, string> | undefined)?.[\"@siteping/widget\"]\n ));\n const hasWarning =\n schemaResult.missingModels.length > 0 ||\n schemaResult.missingFields.length > 0 ||\n schemaResult.outdatedFields.length > 0 ||\n !widgetFile;\n\n if (hasError) {\n p.outro(\"Des éléments sont manquants — lancez `siteping init` pour configurer.\");\n } else if (hasWarning) {\n p.outro(\"Quelques ajustements nécessaires — lancez `siteping sync` pour mettre à jour.\");\n } else {\n p.outro(\"Tout est configuré !\");\n }\n}\n","import { existsSync } from \"node:fs\";\nimport * as p from \"@clack/prompts\";\nimport { syncPrismaModels } from \"../generators/prisma.js\";\nimport { findPrismaSchema } from \"../utils/find-schema.js\";\n\nexport function syncCommand(options: { schema?: string }): void {\n const cwd = process.cwd();\n const schemaPath = options.schema ?? findPrismaSchema(cwd);\n\n if (!schemaPath) {\n p.log.error(\"Aucun fichier schema.prisma trouvé.\");\n p.log.info(\"Spécifiez le chemin avec --schema <path>\");\n process.exit(1);\n }\n\n if (!existsSync(schemaPath)) {\n p.log.error(`Fichier introuvable : ${schemaPath}`);\n process.exit(1);\n }\n\n try {\n const { addedModels, changes } = syncPrismaModels(schemaPath);\n\n if (addedModels.length === 0 && changes.length === 0) {\n p.log.info(\"✓ Le schema est déjà à jour.\");\n return;\n }\n\n if (addedModels.length > 0) {\n p.log.success(`Modèles créés : ${addedModels.join(\", \")}`);\n }\n\n for (const change of changes) {\n const icon = change.action === \"added\" ? \"+\" : \"~\";\n p.log.success(\n `${icon} ${change.model}.${change.field} — ${change.action === \"added\" ? \"ajouté\" : \"mis à jour\"} (${change.detail})`,\n );\n }\n\n p.log.info(\"N'oubliez pas : npx prisma db push\");\n } catch (error) {\n p.log.error(`Erreur : ${error instanceof Error ? error.message : String(error)}`);\n process.exit(1);\n }\n}\n","import { Command } from \"commander\";\nimport { doctorCommand } from \"./commands/doctor.js\";\nimport { initCommand } from \"./commands/init.js\";\nimport { statusCommand } from \"./commands/status.js\";\nimport { syncCommand } from \"./commands/sync.js\";\n\nconst program = new Command().name(\"siteping\").description(\"CLI pour configurer @siteping/*\").version(\"0.4.0\"); // x-release-please-version\n\nprogram\n .command(\"init\")\n .description(\"Configure le schema Prisma et la route API dans votre projet\")\n .action(initCommand)\n .addHelpText(\"after\", \"\\n Examples:\\n $ siteping init\\n $ siteping init --schema prisma/schema.prisma\");\n\nprogram\n .command(\"sync\")\n .description(\"Synchronise le schema Prisma (non-interactif, CI-friendly)\")\n .option(\"--schema <path>\", \"Chemin vers le fichier schema.prisma\")\n .action(syncCommand)\n .addHelpText(\"after\", \"\\n Examples:\\n $ siteping sync\\n $ siteping sync --schema prisma/schema.prisma\");\n\nprogram\n .command(\"status\")\n .description(\"Diagnostic complet de l'intégration Siteping\")\n .option(\"--schema <path>\", \"Chemin vers le fichier schema.prisma\")\n .action(statusCommand);\n\nprogram\n .command(\"doctor\")\n .description(\"Test de connexion à l'API Siteping\")\n .option(\"--url <url>\", \"URL du serveur (défaut: http://localhost:3000)\")\n .option(\"--endpoint <path>\", \"Chemin de l'endpoint (défaut: /api/siteping)\")\n .action(doctorCommand)\n .addHelpText(\n \"after\",\n \"\\n Examples:\\n $ siteping doctor\\n $ siteping doctor --url https://staging.example.com --path /api/feedback\",\n );\n\nprogram.parse();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,iFAAAA,UAAA;AAAA;AAGA,QAAMC,kBAAN,cAA6B,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOjC,YAAY,UAAU,MAAM,SAAS;AACnC,cAAM,OAAO;AAEb,cAAM,kBAAkB,MAAM,KAAK,WAAW;AAC9C,aAAK,OAAO,KAAK,YAAY;AAC7B,aAAK,OAAO;AACZ,aAAK,WAAW;AAChB,aAAK,cAAc;AAAA,MACrB;AAAA,IACF;AAKA,QAAMC,wBAAN,cAAmCD,gBAAe;AAAA;AAAA;AAAA;AAAA;AAAA,MAKhD,YAAY,SAAS;AACnB,cAAM,GAAG,6BAA6B,OAAO;AAE7C,cAAM,kBAAkB,MAAM,KAAK,WAAW;AAC9C,aAAK,OAAO,KAAK,YAAY;AAAA,MAC/B;AAAA,IACF;AAEA,IAAAD,SAAQ,iBAAiBC;AACzB,IAAAD,SAAQ,uBAAuBE;AAAA;AAAA;;;ACtC/B;AAAA,oFAAAC,UAAA;AAAA;AAAA,QAAM,EAAE,sBAAAC,sBAAqB,IAAI;AAEjC,QAAMC,YAAN,MAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUb,YAAY,MAAM,aAAa;AAC7B,aAAK,cAAc,eAAe;AAClC,aAAK,WAAW;AAChB,aAAK,WAAW;AAChB,aAAK,eAAe;AACpB,aAAK,0BAA0B;AAC/B,aAAK,aAAa;A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Q,MAAM;","names":["exports","CommanderError","InvalidArgumentError","exports","InvalidArgumentError","Argument","exports","Help","cmd","a","b","exports","InvalidArgumentError","Option","str","exports","a","b","d","j","exports","process","Argument","CommanderError","Help","Option","Command","config","m","v","option","path","exports","Argument","Command","CommanderError","InvalidArgumentError","Help","Option","exports","module","x","y","exports","module","p","f","exports","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","Symbol","exports","module","Symbol","e","exports","module","exports","module","Symbol","exports","module","exports","module","exports","module","exports","module","exports","module","e","exports","module","exports","module","exports","module","exports","module","exports","module","Map","exports","module","Promise","exports","module","Set","exports","module","exports","module","Map","Promise","Set","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","Buffer","exports","module","exports","module","exports","module","e","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","Map","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","Map","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","othValue","exports","module","Uint8Array","exports","module","exports","module","exports","module","Symbol","Uint8Array","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","Symbol","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","collection","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","e","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","Buffer","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","Uint8Array","exports","module","exports","module","exports","module","Symbol","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","key","exports","module","exports","exports","exports","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","tokenLabel","AbstractProduction","exports","NonTerminal","v","Rule","Alternative","Option","RepetitionMandatory","RepetitionMandatoryWithSeparator","Repetition","RepetitionWithSeparator","Alternation","Terminal","serializeGrammar","serializeProduction","GAstVisitor","exports","exports","module","collection","exports","module","exports","module","exports","module","collection","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","exports","RestWalker","exports","exports","module","Symbol","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","Set","exports","module","exports","module","exports","exports","ResyncFollowsWalker","exports","exports","module","exports","module","e","i","exports","module","require_first","exports","module","exports","module","exports","module","collection","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","collection","exports","module","exports","exports","e","CharCodeFinder","exports","x","charCode","EndAnchorFinder","e","StartAnchorFinder","c","exports","module","exports","exports","LexerDefinitionErrorType","exports","Lexer","config","j","k","tokenLabel","exports","tokenName","createToken","config","createTokenInstance","tokenMatcher","exports","exports","GastRefResolverVisitor","exports","module","exports","module","collection","exports","module","exports","module","exports","module","exports","module","AbstractNextPossibleTokensWalker","exports","NextAfterTokenWalker","AbstractNextTerminalAfterProductionWalker","NextTerminalAfterManyWalker","NextTerminalAfterManySepWalker","NextTerminalAfterAtLeastOneWalker","NextTerminalAfterAtLeastOneSepWalker","PROD_TYPE","exports","getLookaheadPaths","tokenMatcher","k","currAlt","j","RestDefinitionFinderWalker","InsideDefinitionFinderVisitor","altIdx","prefixKeys","exports","OccurrenceValidationCollector","OrCollector","RepetitionCollector","exports","isRecognitionException","exports","RecognitionException","MismatchedTokenException","NoViableAltException","NotAllInputParsedException","EarlyExitException","exports","InRuleRecoveryException","Recoverable","config","k","exports","LLkLookaheadStrategy","exports","LooksAhead","config","exports","DslMethodsCollectorVisitor","exports","exports","j","exports","CstVisitorDefinitionError","TreeBuilder","config","exports","LexerAdapter","exports","RecognizerApi","config","e","exports","RecognizerEngine","config","invokeRuleWithTry","e","exports","ErrorHandler","config","exports","ContentAssist","exports","GastRecorder","config","i","exports","PerformanceTracer","config","exports","exports","exports","ParserDefinitionErrorType","EMPTY_ALT","Parser","config","CstParser","EmbeddedActionsParser","exports","CstNodeDefinitionGenerator","g","definition","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","generateCstDts","exports","createSyntaxDiagramsCode","exports","exports","clearCache","Parser","exports","_","x","lilconfigSync","commander","ansiRegex","onlyFirst","pattern","regex","stripAnsi","string","eaw","module","character","x","y","codePoint","code","stringToArray","characters","len","i","text","start","end","result","eawLen","chars","char","charLen","emojiRegex","stringWidth","options","ambiguousCharacterWidth","width","eastAsianWidth","ANSI_BACKGROUND_OFFSET","wrapAnsi16","offset","wrapAnsi256","wrapAnsi16m","red","green","blue","styles","foregroundColorNames","backgroundColorNames","assembleStyles","codes","groupName","group","styleName","style","hex","matches","colorString","integer","remainder","value","ansiStyles","ESCAPES","END_CODE","ANSI_ESCAPE_BELL","ANSI_CSI","ANSI_OSC","ANSI_SGR_TERMINATOR","ANSI_ESCAPE_LINK","wrapAnsiCode","wrapAnsiHyperlink","uri","wordLengths","wrapWord","rows","word","columns","isInsideEscape","isInsideLinkEscape","visible","index","characterLength","stringVisibleTrimSpacesRight","words","last","exec","returnValue","escapeCode","escapeUrl","lengths","rowLength","remainingColumns","breaksStartingThisLine","row","pre","groups","wrapAnsi","line","actions","settings","isActionKey","key","action","settings","value","diffLines","a","b","aLines","bLines","diff","i","isWindows","CANCEL_SYMBOL","isCancel","setRawMode","input","block","stdin","output","stdout","overwrite","hideCursor","rl","readline","clear","data","name","sequence","str","cursor","dx","dy","v","t","e","s","Prompt","options","trackValue","__publicField","render","signal","opts","event","params","cb","cbs","cleanup","subscriber","resolve","reject","sink","WriteStream","chunk","encoding","done","char","problem","lines","wrap","frame","diffLine","erase","newLines","ConfirmPrompt","confirm","TextPrompt","Prompt","s1","s2","s3","color","opts","isUnicodeSupported","process","unicode","s","c","fallback","S_STEP_ACTIVE","S_STEP_CANCEL","S_STEP_ERROR","S_STEP_SUBMIT","S_BAR_START","S_BAR","S_BAR_END","S_RADIO_ACTIVE","S_RADIO_INACTIVE","S_CHECKBOX_ACTIVE","S_CHECKBOX_SELECTED","S_CHECKBOX_INACTIVE","S_PASSWORD_MASK","S_BAR_H","S_CORNER_TOP_RIGHT","S_CONNECT_LEFT","S_CORNER_BOTTOM_RIGHT","S_INFO","S_SUCCESS","S_WARN","S_ERROR","symbol","state","color","text","opts","TextPrompt","title","color","S_BAR","symbol","placeholder","value","S_BAR_END","confirm","opts","active","inactive","ConfirmPrompt","title","color","S_BAR","symbol","value","S_RADIO_ACTIVE","S_RADIO_INACTIVE","S_BAR_END","note","message","title","lines","titleLen","strip","len","sum","ln","line","msg","color","S_BAR","S_STEP_SUBMIT","S_BAR_H","S_CORNER_TOP_RIGHT","S_CONNECT_LEFT","S_CORNER_BOTTOM_RIGHT","cancel","S_BAR_END","intro","S_BAR_START","outro","log","symbol","parts","firstLine","S_INFO","S_SUCCESS","S_WARN","S_ERROR","spinner","frames","unicode","delay","isCI","unblock","loop","isSpinnerActive","_message","_prevMessage","handleExit","code","stop","errorEventHandler","signalEventHandler","registerHooks","clearHooks","clearPrevMessage","prevLines","cursor","erase","parseMessage","start","block","frameIndex","dotsTimer","frame","loadingDots","step","S_STEP_CANCEL","S_STEP_ERROR","L","v","mod","Option","Identifier","createToken","name","pattern","Datasource","push_mode","Generator","Model","View","Enum","Type","True","longer_alt","False","Null","Comment","Lexer","NA","DocComment","categories","LineComment","Attribute","BlockAttribute","label","FieldAttribute","Dot","QuestionMark","LCurly","RCurly","pop_mode","LRound","RRound","LSquare","RSquare","Comma","Colon","Equals","StringLiteral","NumberLiteral","WhiteSpace","group","SKIPPED","LineBreak","line_breaks","naTokens","multiModeTokens","modes","global","concat","block","defaultMode","PrismaLexer","isToken","node","appendLocationData","data","_len","arguments","length","tokens","Array","_key","location","reduce","memo","token","_memo$endColumn","endColumn","_memo$endLine","endLine","_memo$endOffset","endOffset","_memo$startColumn","startColumn","Infinity","_memo$startLine","startLine","_memo$startOffset","startOffset","Object","assign","defaultConfig","parser","nodeLocationTracking","config","getConfig","result","configSync","search","PrismaParser","_CstParser","_inheritsLoose","_this","call","lexer","RULE","CONSUME1","CONSUME2","keyedArg","CONSUME","LABEL","SUBRULE","value","array","MANY_SEP","SEP","DEF","func","OR","ALT","property","assignment","field","OPTION1","MANY","fieldAttribute","OPTION2","block","options","_options","componentType","isEnum","isObject","comment","GATE","blockAttribute","OPTION","attributeArg","component","type","OR1","OR2","ARGS","image","schema","performSelfAnalysis","CstParser","defaultParser","VisitorClassFactory","BasePrismaVisitor","getBaseCstVisitorConstructorWithDefaults","_BasePrismaVisitor","PrismaVisitor","validateVisitor","_proto","prototype","ctx","_ctx$list","_this2","list","map","item","visit","_ctx$type","_ctx$componentName","componentName","name","assignments","properties","enumerators","Error","maybeAppendLocationData","_break","_ctx$text","text","_ctx$list2","_this3","assignmentValue","_ctx$assignmentName","assignmentName","key","_ctx$attributeList","_this4","_ctx$comment","_ctx$optional","_ctx$array","fieldType","_ctx$fieldName","fieldName","attributes","attributeList","optional","_ctx$attributeArg","_this5","_ctx$attributeName","attributeName","_ref","groupName","group","args","attr","kind","apply","concat","_ctx$attributeArg2","_this6","_ctx$attributeName2","_ref2","_ctx$value","_this7","_ctx$keyedArg","_ctx$funcName","funcName","params","keyedParams","pars","_ctx$value2","_this8","_ctx$keyName","keyName","_ctx$value3","_enum","_ctx$attributeList2","_this9","_ctx$comment2","_ctx$enumName","enumName","DefaultVisitorClass","defaultVisitor","getSchema","source","_options$parser","_options$visitor","lexingResult","PrismaLexer","tokenize","input","cstNode","errors","visitor","unsorted","defaultSortOrder","schemaSorter","locales","sortOrder","a","b","aUnsorted","indexOf","bUnsorted","typeIndex","localeCompare","printSchema","_options$sort","sort","_options$locales","undefined","_options$sortOrder","blocks","filter","sorter","printBlock","Boolean","join","EOL","replace","printComment","printDatasource","printEnum","printGenerator","printObject","printBreak","db","children","computeAssignmentFormatting","enumerator","printEnumerator","attrs","printAttribute","generator","object","_props","props","blockAttributeMoved","attrIndex","findIndex","needsSpace","includes","splice","computePropertyFormatting","printAssignment","keyLength","padEnd","printValue","printProperty","nameLength","typeLength","printField","attribute","printAttributeArg","unshift","arg","printFieldType","trim","suffix","printFunction","String","pos","listBlocks","current","index","arr","push","keyLengths","lists","max","Math","shift","nameLengths","typeLengths","prop","p","a","existsSync","writeFileSync","existsSync","join","p","v","existsSync","readFileSync","join","join","c","existsSync","readFileSync","v","m","existsSync","v","existsSync","program"]}
|